Repository: berinhard/pyp5js Branch: develop Commit: 87ebb8e48eba Files: 369 Total size: 43.5 MB Directory structure: gitextract_1xzdirb8/ ├── .github/ │ └── workflows/ │ └── ci.yml ├── .gitignore ├── .gitpod.yml ├── CHANGELOG.md ├── CONTRIBUTING.md ├── LICENSE ├── MANIFEST.in ├── Makefile ├── Makefile.bat ├── README.md ├── VERSION ├── bin/ │ └── check_license.sh ├── dev-requirements.txt ├── docs/ │ ├── examples/ │ │ ├── index.md │ │ ├── pyodide/ │ │ │ ├── bouncing/ │ │ │ │ ├── bouncing.py │ │ │ │ ├── bouncingFPS.py │ │ │ │ ├── index.html │ │ │ │ ├── odkaz.txt │ │ │ │ ├── static/ │ │ │ │ │ └── p5.js │ │ │ │ └── target/ │ │ │ │ └── target_sketch.js │ │ │ ├── breakout/ │ │ │ │ ├── breakout-kb.py │ │ │ │ ├── breakout-ms.py │ │ │ │ ├── breakout.py │ │ │ │ ├── index.html │ │ │ │ ├── static/ │ │ │ │ │ └── p5.js │ │ │ │ └── target/ │ │ │ │ └── target_sketch.js │ │ │ ├── flappybird/ │ │ │ │ ├── flappybird.py │ │ │ │ ├── index.html │ │ │ │ ├── static/ │ │ │ │ │ └── p5.js │ │ │ │ └── target/ │ │ │ │ └── target_sketch.js │ │ │ ├── index.html.template │ │ │ ├── memory/ │ │ │ │ ├── LICENCE │ │ │ │ ├── README.md │ │ │ │ ├── index.html │ │ │ │ ├── memory.py │ │ │ │ ├── static/ │ │ │ │ │ └── p5.js │ │ │ │ └── target/ │ │ │ │ └── target_sketch.js │ │ │ ├── mines/ │ │ │ │ ├── index.html │ │ │ │ ├── mines.py │ │ │ │ ├── static/ │ │ │ │ │ └── p5.js │ │ │ │ └── target/ │ │ │ │ └── target_sketch.js │ │ │ ├── pong/ │ │ │ │ ├── index.html │ │ │ │ ├── pong.py │ │ │ │ ├── static/ │ │ │ │ │ └── p5.js │ │ │ │ └── target/ │ │ │ │ └── target_sketch.js │ │ │ ├── samegame/ │ │ │ │ ├── index.html │ │ │ │ ├── samegame.py │ │ │ │ ├── static/ │ │ │ │ │ └── p5.js │ │ │ │ └── target/ │ │ │ │ └── target_sketch.js │ │ │ ├── sketch_001/ │ │ │ │ ├── index.html │ │ │ │ ├── sketch_001.py │ │ │ │ ├── static/ │ │ │ │ │ └── p5.js │ │ │ │ └── target/ │ │ │ │ └── target_sketch.js │ │ │ ├── sketch_002/ │ │ │ │ ├── index.html │ │ │ │ ├── sketch_002.py │ │ │ │ ├── static/ │ │ │ │ │ └── p5.js │ │ │ │ └── target/ │ │ │ │ └── target_sketch.js │ │ │ ├── sketch_003/ │ │ │ │ ├── index.html │ │ │ │ ├── sketch_003.py │ │ │ │ ├── static/ │ │ │ │ │ └── p5.js │ │ │ │ └── target/ │ │ │ │ └── target_sketch.js │ │ │ ├── sketch_004/ │ │ │ │ ├── index.html │ │ │ │ ├── sketch_004.py │ │ │ │ ├── static/ │ │ │ │ │ └── p5.js │ │ │ │ └── target/ │ │ │ │ └── target_sketch.js │ │ │ ├── sketch_005/ │ │ │ │ ├── index.html │ │ │ │ ├── sketch_005.py │ │ │ │ ├── static/ │ │ │ │ │ └── p5.js │ │ │ │ └── target/ │ │ │ │ └── target_sketch.js │ │ │ ├── sketch_006/ │ │ │ │ ├── index.html │ │ │ │ ├── sketch_006.py │ │ │ │ ├── static/ │ │ │ │ │ └── p5.js │ │ │ │ └── target/ │ │ │ │ └── target_sketch.js │ │ │ ├── sketch_007/ │ │ │ │ ├── index.html │ │ │ │ ├── sketch_007.py │ │ │ │ ├── static/ │ │ │ │ │ └── p5.js │ │ │ │ └── target/ │ │ │ │ └── target_sketch.js │ │ │ ├── sketch_008/ │ │ │ │ ├── index.html │ │ │ │ ├── sketch_008.py │ │ │ │ ├── static/ │ │ │ │ │ └── p5.js │ │ │ │ └── target/ │ │ │ │ └── target_sketch.js │ │ │ ├── sketch_009/ │ │ │ │ ├── index.html │ │ │ │ ├── sketch_009.py │ │ │ │ ├── static/ │ │ │ │ │ └── p5.js │ │ │ │ └── target/ │ │ │ │ └── target_sketch.js │ │ │ ├── sketch_010/ │ │ │ │ ├── index.html │ │ │ │ ├── sketch_010.py │ │ │ │ ├── static/ │ │ │ │ │ └── p5.js │ │ │ │ └── target/ │ │ │ │ └── target_sketch.js │ │ │ ├── sketch_011/ │ │ │ │ ├── index.html │ │ │ │ ├── sketch_011.py │ │ │ │ ├── static/ │ │ │ │ │ └── p5.js │ │ │ │ └── target/ │ │ │ │ └── target_sketch.js │ │ │ └── sketch_012/ │ │ │ ├── index.html │ │ │ ├── sketch_012.py │ │ │ ├── static/ │ │ │ │ └── p5.js │ │ │ └── target/ │ │ │ └── target_sketch.js │ │ ├── sketch_000/ │ │ │ ├── index.html │ │ │ ├── sketch_000.py │ │ │ ├── static/ │ │ │ │ └── p5.js │ │ │ └── target/ │ │ │ ├── org.transcrypt.__runtime__.js │ │ │ ├── org.transcrypt.__runtime__.py │ │ │ ├── pyp5js.js │ │ │ ├── pyp5js.py │ │ │ ├── pyp5js.python_functions.js │ │ │ ├── pyp5js.python_functions.py │ │ │ ├── sketch_000.js │ │ │ ├── sketch_000.py │ │ │ ├── target_sketch.js │ │ │ ├── target_sketch.project │ │ │ └── target_sketch.py │ │ └── transcrypt/ │ │ ├── index.html.template │ │ ├── sketch_001/ │ │ │ ├── index.html │ │ │ ├── sketch_001.py │ │ │ ├── static/ │ │ │ │ └── p5.js │ │ │ └── target/ │ │ │ ├── org.transcrypt.__runtime__.js │ │ │ ├── org.transcrypt.__runtime__.py │ │ │ ├── pyp5js.js │ │ │ ├── pyp5js.py │ │ │ ├── python_functions.js │ │ │ ├── python_functions.py │ │ │ ├── target_sketch.js │ │ │ ├── target_sketch.project │ │ │ └── target_sketch.py │ │ ├── sketch_002/ │ │ │ ├── index.html │ │ │ ├── sketch_002.py │ │ │ ├── static/ │ │ │ │ └── p5.js │ │ │ └── target/ │ │ │ ├── org.transcrypt.__runtime__.js │ │ │ ├── org.transcrypt.__runtime__.py │ │ │ ├── pyp5js.js │ │ │ ├── pyp5js.py │ │ │ ├── python_functions.js │ │ │ ├── python_functions.py │ │ │ ├── target_sketch.js │ │ │ ├── target_sketch.project │ │ │ └── target_sketch.py │ │ ├── sketch_003/ │ │ │ ├── index.html │ │ │ ├── sketch_003.py │ │ │ ├── static/ │ │ │ │ └── p5.js │ │ │ └── target/ │ │ │ ├── org.transcrypt.__runtime__.js │ │ │ ├── org.transcrypt.__runtime__.py │ │ │ ├── pyp5js.js │ │ │ ├── pyp5js.py │ │ │ ├── python_functions.js │ │ │ ├── python_functions.py │ │ │ ├── target_sketch.js │ │ │ ├── target_sketch.project │ │ │ └── target_sketch.py │ │ ├── sketch_004/ │ │ │ ├── index.html │ │ │ ├── sketch_004.py │ │ │ ├── static/ │ │ │ │ └── p5.js │ │ │ └── target/ │ │ │ ├── org.transcrypt.__runtime__.js │ │ │ ├── org.transcrypt.__runtime__.py │ │ │ ├── pyp5js.js │ │ │ ├── pyp5js.py │ │ │ ├── python_functions.js │ │ │ ├── python_functions.py │ │ │ ├── target_sketch.js │ │ │ ├── target_sketch.project │ │ │ └── target_sketch.py │ │ ├── sketch_005/ │ │ │ ├── index.html │ │ │ ├── sketch_005.py │ │ │ ├── static/ │ │ │ │ └── p5.js │ │ │ └── target/ │ │ │ ├── org.transcrypt.__runtime__.js │ │ │ ├── org.transcrypt.__runtime__.py │ │ │ ├── pyp5js.js │ │ │ ├── pyp5js.py │ │ │ ├── python_functions.js │ │ │ ├── python_functions.py │ │ │ ├── target_sketch.js │ │ │ ├── target_sketch.project │ │ │ └── target_sketch.py │ │ ├── sketch_006/ │ │ │ ├── index.html │ │ │ ├── sketch_006.py │ │ │ ├── static/ │ │ │ │ └── p5.js │ │ │ └── target/ │ │ │ ├── org.transcrypt.__runtime__.js │ │ │ ├── org.transcrypt.__runtime__.py │ │ │ ├── pyp5js.js │ │ │ ├── pyp5js.py │ │ │ ├── python_functions.js │ │ │ ├── python_functions.py │ │ │ ├── target_sketch.js │ │ │ ├── target_sketch.project │ │ │ └── target_sketch.py │ │ ├── sketch_007/ │ │ │ ├── index.html │ │ │ ├── sketch_007.py │ │ │ ├── static/ │ │ │ │ └── p5.js │ │ │ └── target/ │ │ │ ├── org.transcrypt.__runtime__.js │ │ │ ├── org.transcrypt.__runtime__.py │ │ │ ├── pyp5js.js │ │ │ ├── pyp5js.py │ │ │ ├── python_functions.js │ │ │ ├── python_functions.py │ │ │ ├── target_sketch.js │ │ │ ├── target_sketch.project │ │ │ └── target_sketch.py │ │ ├── sketch_008/ │ │ │ ├── index.html │ │ │ ├── sketch_008.py │ │ │ ├── static/ │ │ │ │ └── p5.js │ │ │ └── target/ │ │ │ ├── org.transcrypt.__runtime__.js │ │ │ ├── org.transcrypt.__runtime__.py │ │ │ ├── pyp5js.js │ │ │ ├── pyp5js.py │ │ │ ├── python_functions.js │ │ │ ├── python_functions.py │ │ │ ├── target_sketch.js │ │ │ ├── target_sketch.project │ │ │ └── target_sketch.py │ │ ├── sketch_009/ │ │ │ ├── index.html │ │ │ ├── sketch_009.py │ │ │ ├── static/ │ │ │ │ └── p5.js │ │ │ └── target/ │ │ │ ├── math.js │ │ │ ├── math.py │ │ │ ├── org.transcrypt.__runtime__.js │ │ │ ├── org.transcrypt.__runtime__.py │ │ │ ├── pyp5js.js │ │ │ ├── pyp5js.py │ │ │ ├── python_functions.js │ │ │ ├── python_functions.py │ │ │ ├── random.js │ │ │ ├── random.py │ │ │ ├── target_sketch.js │ │ │ ├── target_sketch.project │ │ │ └── target_sketch.py │ │ └── sketch_010/ │ │ ├── index.html │ │ ├── sketch_010.py │ │ ├── static/ │ │ │ └── p5.js │ │ └── target/ │ │ ├── org.transcrypt.__runtime__.js │ │ ├── org.transcrypt.__runtime__.py │ │ ├── pyp5js.js │ │ ├── pyp5js.py │ │ ├── python_functions.js │ │ ├── python_functions.py │ │ ├── target_sketch.js │ │ ├── target_sketch.project │ │ └── target_sketch.py │ ├── index.md │ └── pyodide/ │ ├── afterBody.js │ ├── index.html │ ├── index.html.template │ ├── pyodide.py │ ├── share.js │ ├── styles.css │ └── target/ │ └── target_sketch.js ├── pyp5js/ │ ├── __init__.py │ ├── cli.py │ ├── commands.py │ ├── compiler.py │ ├── config/ │ │ ├── __init__.py │ │ ├── fs.py │ │ └── sketch.py │ ├── exceptions.py │ ├── http_local/ │ │ ├── __init__.py │ │ ├── static/ │ │ │ ├── js/ │ │ │ │ ├── ace/ │ │ │ │ │ ├── ace.js │ │ │ │ │ ├── ext-beautify.js │ │ │ │ │ ├── ext-code_lens.js │ │ │ │ │ ├── ext-elastic_tabstops_lite.js │ │ │ │ │ ├── ext-emmet.js │ │ │ │ │ ├── ext-error_marker.js │ │ │ │ │ ├── ext-keybinding_menu.js │ │ │ │ │ ├── ext-language_tools.js │ │ │ │ │ ├── ext-linking.js │ │ │ │ │ ├── ext-modelist.js │ │ │ │ │ ├── ext-options.js │ │ │ │ │ ├── ext-prompt.js │ │ │ │ │ ├── ext-rtl.js │ │ │ │ │ ├── ext-searchbox.js │ │ │ │ │ ├── ext-settings_menu.js │ │ │ │ │ ├── ext-spellcheck.js │ │ │ │ │ ├── ext-split.js │ │ │ │ │ ├── ext-static_highlight.js │ │ │ │ │ ├── ext-statusbar.js │ │ │ │ │ ├── ext-textarea.js │ │ │ │ │ ├── ext-themelist.js │ │ │ │ │ ├── ext-whitespace.js │ │ │ │ │ ├── keybinding-emacs.js │ │ │ │ │ ├── keybinding-sublime.js │ │ │ │ │ ├── keybinding-vim.js │ │ │ │ │ ├── keybinding-vscode.js │ │ │ │ │ ├── mode-python.js │ │ │ │ │ ├── theme-ambiance.js │ │ │ │ │ ├── theme-chaos.js │ │ │ │ │ ├── theme-chrome.js │ │ │ │ │ ├── theme-clouds.js │ │ │ │ │ ├── theme-clouds_midnight.js │ │ │ │ │ ├── theme-cobalt.js │ │ │ │ │ ├── theme-crimson_editor.js │ │ │ │ │ ├── theme-dawn.js │ │ │ │ │ ├── theme-dracula.js │ │ │ │ │ ├── theme-dreamweaver.js │ │ │ │ │ ├── theme-eclipse.js │ │ │ │ │ ├── theme-github.js │ │ │ │ │ ├── theme-gob.js │ │ │ │ │ ├── theme-gruvbox.js │ │ │ │ │ ├── theme-idle_fingers.js │ │ │ │ │ ├── theme-iplastic.js │ │ │ │ │ ├── theme-katzenmilch.js │ │ │ │ │ ├── theme-kr_theme.js │ │ │ │ │ ├── theme-kuroir.js │ │ │ │ │ ├── theme-merbivore.js │ │ │ │ │ ├── theme-merbivore_soft.js │ │ │ │ │ ├── theme-mono_industrial.js │ │ │ │ │ ├── theme-monokai.js │ │ │ │ │ ├── theme-nord_dark.js │ │ │ │ │ ├── theme-pastel_on_dark.js │ │ │ │ │ ├── theme-solarized_dark.js │ │ │ │ │ ├── theme-solarized_light.js │ │ │ │ │ ├── theme-sqlserver.js │ │ │ │ │ ├── theme-terminal.js │ │ │ │ │ ├── theme-textmate.js │ │ │ │ │ ├── theme-tomorrow.js │ │ │ │ │ ├── theme-tomorrow_night.js │ │ │ │ │ ├── theme-tomorrow_night_blue.js │ │ │ │ │ ├── theme-tomorrow_night_bright.js │ │ │ │ │ ├── theme-tomorrow_night_eighties.js │ │ │ │ │ ├── theme-twilight.js │ │ │ │ │ ├── theme-vibrant_ink.js │ │ │ │ │ ├── theme-xcode.js │ │ │ │ │ ├── worker-coffee.js │ │ │ │ │ ├── worker-css.js │ │ │ │ │ ├── worker-html.js │ │ │ │ │ ├── worker-javascript.js │ │ │ │ │ ├── worker-json.js │ │ │ │ │ ├── worker-lua.js │ │ │ │ │ ├── worker-php.js │ │ │ │ │ ├── worker-xml.js │ │ │ │ │ └── worker-xquery.js │ │ │ │ ├── p5/ │ │ │ │ │ ├── addons/ │ │ │ │ │ │ └── p5.sound.js │ │ │ │ │ └── p5.js │ │ │ │ └── pyodide/ │ │ │ │ ├── packages.json │ │ │ │ ├── pyodide.asm.data │ │ │ │ ├── pyodide.asm.js │ │ │ │ ├── pyodide.asm.wasm │ │ │ │ ├── pyodide.js.map │ │ │ │ └── pyodide_v0.18.1.js │ │ │ ├── p5_reference.yml │ │ │ └── styles/ │ │ │ └── custom.css │ │ ├── templates/ │ │ │ ├── base.html │ │ │ ├── index.html │ │ │ ├── new_sketch_form.html │ │ │ ├── new_sketch_success.html │ │ │ └── view_sketch.html │ │ └── web_app.py │ ├── monitor.py │ ├── sketch.py │ ├── templates/ │ │ ├── pyodide/ │ │ │ ├── base_sketch.py.template │ │ │ ├── index.html │ │ │ └── target_sketch.js.template │ │ └── transcrypt/ │ │ ├── base_sketch.py.template │ │ ├── index.html │ │ ├── pyp5js.py │ │ ├── python_functions.py │ │ └── target_sketch.py.template │ ├── templates_renderers.py │ └── tests/ │ ├── __init__.py │ ├── fixtures.py │ ├── test_commands.py │ ├── test_compiler.py │ ├── test_config/ │ │ ├── __init__.py │ │ ├── test_fs.py │ │ └── test_sketch.py │ ├── test_http/ │ │ └── test_web_app.py │ ├── test_monitor.py │ ├── test_pyp5js.py │ ├── test_sketch.py │ └── test_templates_renderers.py ├── pytest.ini ├── requirements.txt └── setup.py ================================================ FILE CONTENTS ================================================ ================================================ FILE: .github/workflows/ci.yml ================================================ name: Continuous Integration on: push: branches: - main - develop pull_request: branches: - main - develop jobs: license: name: Check source files for license headers runs-on: ubuntu-latest steps: - uses: actions/checkout@v1 - name: Check for license headers run: bash bin/check_license.sh test: name: Test on ${{ matrix.os }} with Python ${{ matrix.python-version }} runs-on: ${{ matrix.os }} strategy: max-parallel: 4 matrix: os: [windows-latest, ubuntu-latest, macos-latest] python-version: [3.7, 3.8, 3.9, '3.10'] steps: - uses: actions/checkout@v1 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v1 with: python-version: ${{ matrix.python-version }} - name: Display python version run: python --version - name: Upgrade pip run: python -m pip install --upgrade pip setuptools --user - name: Install dev dependencies run: pip install -r dev-requirements.txt - name: Install pyp5js for dev run: python setup.py develop --install-dir dist - name: run: python -m pytest ================================================ FILE: .gitignore ================================================ .Python .DS_Store *.pyc .vscode *.env *.swp *.swo *.swn *.sqlite3 *.map !pyodide.js.map __target__ build dist *.egg-info demo_sketch tests-sketchbook venv docs/examples/dev* docs/examples/issue* .theia .envrc *.properties.json .idea/* ================================================ FILE: .gitpod.yml ================================================ image: gitpod/workspace-full ports: - port: 5000 onOpen: open-browser tasks: - init: export SKETCHBOOK_DIR=sketchbook && python -m venv venv --system-site-packages && venv/bin/pip install -r dev-requirements.txt && venv/bin/python setup.py develop && source venv/bin/activate && pytest command: pyp5js serve ================================================ FILE: CHANGELOG.md ================================================ Development ----------- - Add `--version` parameter to the command line interface [PR #223](https://github.com/berinhard/pyp5js/pull/223) 0.7.3 ----- - Fix bug on 0.7.2 verison without required local web server template files. 0.7.2 ----- - Remove existing sketch after clearing/running it again [PR #199](https://github.com/berinhard/pyp5js/pull/199) - Add share button to demo editor [PR #205](https://github.com/berinhard/pyp5js/pull/205) - Fixed bug of adding new lines when saving Sketch in Windowns [PR #209](https://github.com/berinhard/pyp5js/pull/209) - Upgrade pyp5js dependencies versions [PR #220](https://github.com/berinhard/pyp5js/pull/220) - Run CI for Python 3.10 version [PR #219](https://github.com/berinhard/pyp5js/pull/219) 0.7.1 ----- - Create sketch using p5.js from CDN [PR #191](https://github.com/berinhard/pyp5js/pull/191) - Add `keyIsDown` event to Transcrypt mode - [PR #187](https://github.com/berinhard/pyp5js/pull/187) - Fix bug with multiple events calls - PR #187 too - Serve JS files if `--local` flag [PR #195](https://github.com/berinhard/pyp5js/pull/195) - Force `utf-8` as the lib's default encoding [PR #193](https://github.com/berinhard/pyp5js/pull/193) - Fix preload function bug in both modes - [PR #196](https://github.com/berinhard/pyp5js/pull/196) 0.7.0 ----- - Remove `from pyp5js import *` requirement under transcrypt [PR #183](https://github.com/berinhard/pyp5js/pull/183/) - Make local code editor collapsible [PR #184](https://github.com/berinhard/pyp5js/pull/184/) - Add `mouseWheel` event to Pyodide's demo [PR #185](https://github.com/berinhard/pyp5js/pull/185/) 0.6.0 ----- - Add transcrypt interpreter choice to web editor - [PR #175](https://github.com/berinhard/pyp5js/pull/175) - Upgrade Transcrypt to 3.9.0 - Upgrade Pyodide to v0.18.1 - [PR #181](https://github.com/berinhard/pyp5js/pull/181) - Enable to use custom templates files to generate and compile index.html - [PR #177](https://github.com/berinhard/pyp5js/pull/177) - Add docs on Pyodide examples - [PR #178](https://github.com/berinhard/pyp5js/pull/178) 0.5.2 ----- - Pyodide mode bugfix for missing `P3D` global definition - Processing-like PVector class under transcrypt mode - Processing-like PVector class under pyodide mode 0.5.1 ----- - Minor fix in view sketch HTML 0.5.0 ----- - Support to Pyodide as the Python interpreter 0.4.5 ----- - Support to get/set pixels with Transcrypt interpreter - `pyp5js` can run on top of Gitpod.io 0.4.4 ----- - Fix to allow directories name with spaces - PR #127 0.4.3 ----- - Fix conflict with p5.js `clear` method and Python - Upgrade `p5.js` version to `1.0.0` - Use local file for Ace editor 0.4.2 ----- - Keep Python functions with name conflict with p5.js working as expected - `createCanvas` now returns `p5.Renderer` - Fix `transcrypt` error on Windows - Add support to `loadImage` 0.4.1 ----- - Fix bug of null `_P5_INSTANCE` 0.4.0 ----- - Display sketch with code - Add ACE editor to edit the sketch code - Add aliases to Processing.py functions & constants (`size`, `pushMatrix`, `popMatrix`, `pushStyle`, `pushStyle`, `P3D`) 0.3.5 ----- - Fix issue with assets 0.3.4 ----- - Update sketch's template - Add unit tests to the Flask API - Base style for the web client 0.3.3 ----- - Validate sketch name - Add base templates for the web app - Add iframe with example 000 to the index 0.3.2 ----- - Ensure the sketchbook dir always exists 0.3.1 ----- - Fix build without web application assets 0.3.0 ----- - Create `pyp5js serve` command - Add `SKETCHBOOK_DIR` to configure the sketchbook's directory - Local web app to compile sketches on the fly and to create sketches 0.2.0 ----- - Rename pyp5.js module from pytop5js to pyp5js - Enable keyword argument - Enable checking for existence in dictionary keys - Commands now printing index files as URI 0.1.1 ----- - Fix install issue 0.1.0 ----- - Simplification of pytop5js usage - Support p5.dom.js library - Fixes on monitor observer 0.0.7 ----- - Fix bug with monitor not running transcrypt more than once 0.0.6 ----- - Add flag on new commmand to monitor sketch after creating it - Fix bug when running the monitor command from the sketch's directory - Update width and height values on createCanvas 0.0.5 ----- - Add all p5's missing global variables 0.0.4.1 ------- - Support event functions such as `keyPressed` 0.0.4 ----- - Support p5.js pop function - Add `monitor` command to the CLI - Allow to run `pyp5js` commands specifying a directory - First try on organizing the docs 0.0.3 ----- - Add WEBGL variables 0.0.2 ----- - Support more of P5's variable 0.0.1 ----- - First release ================================================ FILE: CONTRIBUTING.md ================================================ ## Contributing to pyp5js Here you'll find all possible ways to contribute to the project. ### Testing, testing and testing Since pyp5js have a lot of moving parts, it would be great to have the p5.js API fully covered and tested. So, use your imagination, code your sketches and, if pyp5js breaks or starts to annoy you with something, you're very welcome to [open an issue](https://github.com/berinhard/pyp5js/issues/new) documenting your thoughts. Test it and let me know how can I improve it. ### What about these shinning examples? If you fell confortable with that, I'd be happy to add some of your pyp5js sketches to our [examples list](https://berinhard.github.io/pyp5js/examples/)! To do so, you'll have [to fork this repository](https://help.github.com/en/articles/fork-a-repo) and add your new sketch example in the `docs/examples` directory. Once you've your sketch ready, you can [open a pull request](https://help.github.com/en/articles/about-pull-requests) and I'll take a look at it. ### I want to hack! Okay, if you want to contribute with pyp5js's code, let's go! I really advise you to use [virtualenv with virtualenvwrapper](http://www.indjango.com/python-install-virtualenv-and-virtualenvwrapper/) or [pyenv](https://amaral.northwestern.edu/resources/guides/pyenv-tutorial) to isolate your pyp5js fork from the rest of your system. Once you have everything ready, you can run: ``` $ git clone git@github.com:YOUR_GITHUB_PROFILE/pyp5js.git $ cd pyp5js $ pip install -r dev-requirements.txt $ python setup.py develop $ make test ``` After that, you should have the `pyp5js` command enabled and it will respect all the changes you introduce to the code. Now, a brief explanation about the code under `pyp5js` directory: - `config` module: centralize pieces of code used to configure how `pyp5js` runs - `cli.py`: the entrypoint for `pyp5js` commands such as `new` or `compile` - `commands.py`: just functions responsible for the real implementations for `pyp5js` commands - `compiler.py`: where all the magic happens! - `exception.py`: custom exceptions used by `pyp5js` - `monitor.py`: module with the objects used by the `monitor` command - `sketch.py`: class to abstract Sketches' files, directories and configuration - `template_renderers.py`: simple module with the renderization logic for the code templates like `target_sketch.py` - `http/web_app.py`: Flask application for the web interface. Now go [fetch yourself an issue](https://github.com/berinhard/pyp5js/issues) and happy hacking! ================================================ FILE: LICENSE ================================================ GNU LESSER GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. This version of the GNU Lesser General Public License incorporates the terms and conditions of version 3 of the GNU General Public License, supplemented by the additional permissions listed below. 0. Additional Definitions. As used herein, "this License" refers to version 3 of the GNU Lesser General Public License, and the "GNU GPL" refers to version 3 of the GNU General Public License. "The Library" refers to a covered work governed by this License, other than an Application or a Combined Work as defined below. An "Application" is any work that makes use of an interface provided by the Library, but which is not otherwise based on the Library. Defining a subclass of a class defined by the Library is deemed a mode of using an interface provided by the Library. A "Combined Work" is a work produced by combining or linking an Application with the Library. The particular version of the Library with which the Combined Work was made is also called the "Linked Version". The "Minimal Corresponding Source" for a Combined Work means the Corresponding Source for the Combined Work, excluding any source code for portions of the Combined Work that, considered in isolation, are based on the Application, and not on the Linked Version. The "Corresponding Application Code" for a Combined Work means the object code and/or source code for the Application, including any data and utility programs needed for reproducing the Combined Work from the Application, but excluding the System Libraries of the Combined Work. 1. Exception to Section 3 of the GNU GPL. You may convey a covered work under sections 3 and 4 of this License without being bound by section 3 of the GNU GPL. 2. Conveying Modified Versions. If you modify a copy of the Library, and, in your modifications, a facility refers to a function or data to be supplied by an Application that uses the facility (other than as an argument passed when the facility is invoked), then you may convey a copy of the modified version: a) under this License, provided that you make a good faith effort to ensure that, in the event an Application does not supply the function or data, the facility still operates, and performs whatever part of its purpose remains meaningful, or b) under the GNU GPL, with none of the additional permissions of this License applicable to that copy. 3. Object Code Incorporating Material from Library Header Files. The object code form of an Application may incorporate material from a header file that is part of the Library. You may convey such object code under terms of your choice, provided that, if the incorporated material is not limited to numerical parameters, data structure layouts and accessors, or small macros, inline functions and templates (ten or fewer lines in length), you do both of the following: a) Give prominent notice with each copy of the object code that the Library is used in it and that the Library and its use are covered by this License. b) Accompany the object code with a copy of the GNU GPL and this license document. 4. Combined Works. You may convey a Combined Work under terms of your choice that, taken together, effectively do not restrict modification of the portions of the Library contained in the Combined Work and reverse engineering for debugging such modifications, if you also do each of the following: a) Give prominent notice with each copy of the Combined Work that the Library is used in it and that the Library and its use are covered by this License. b) Accompany the Combined Work with a copy of the GNU GPL and this license document. c) For a Combined Work that displays copyright notices during execution, include the copyright notice for the Library among these notices, as well as a reference directing the user to the copies of the GNU GPL and this license document. d) Do one of the following: 0) Convey the Minimal Corresponding Source under the terms of this License, and the Corresponding Application Code in a form suitable for, and under terms that permit, the user to recombine or relink the Application with a modified version of the Linked Version to produce a modified Combined Work, in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source. 1) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (a) uses at run time a copy of the Library already present on the user's computer system, and (b) will operate properly with a modified version of the Library that is interface-compatible with the Linked Version. e) Provide Installation Information, but only if you would otherwise be required to provide such information under section 6 of the GNU GPL, and only to the extent that such information is necessary to install and execute a modified version of the Combined Work produced by recombining or relinking the Application with a modified version of the Linked Version. (If you use option 4d0, the Installation Information must accompany the Minimal Corresponding Source and Corresponding Application Code. If you use option 4d1, you must provide the Installation Information in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source.) 5. Combined Libraries. You may place library facilities that are a work based on the Library side by side in a single library together with other library facilities that are not Applications and are not covered by this License, and convey such a combined library under terms of your choice, if you do both of the following: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities, conveyed under the terms of this License. b) Give prominent notice with the combined library that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 6. Revised Versions of the GNU Lesser General Public License. The Free Software Foundation may publish revised and/or new versions of the GNU Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library as you received it specifies that a certain numbered version of the GNU Lesser General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that published version or of any later version published by the Free Software Foundation. If the Library as you received it does not specify a version number of the GNU Lesser General Public License, you may choose any version of the GNU Lesser General Public License ever published by the Free Software Foundation. If the Library as you received it specifies that a proxy can decide whether future versions of the GNU Lesser General Public License shall apply, that proxy's public statement of acceptance of any version is permanent authorization for you to choose that version for the Library. ================================================ FILE: MANIFEST.in ================================================ recursive-include pyp5js/templates * recursive-include pyp5js/http_local/templates * recursive-include pyp5js/http_local/static * ================================================ FILE: Makefile ================================================ test: export PYTHONWARNINGS=ignore::flask.DeprecationWarning; pytest update_dist: @python3 setup.py sdist bdist_wheel upload_pypi: @twine upload dist/* # helper command for the maintainer to refresh the docs files refresh_transcrypt_docs: cd docs/examples/transcrypt; for x in `ls -d */`; do SKETCHBOOK_DIR="/home/bernardo/envs/pyp5js/docs/examples/transcrypt/" pyp5js compile $$x --refresh --template "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/index.html.template"; done; refresh_pyodide_docs: cd docs/examples/pyodide; for x in `ls -d */`; do SKETCHBOOK_DIR="/home/bernardo/envs/pyp5js/docs/examples/pyodide" pyp5js compile $$x --refresh --template "/home/bernardo/envs/pyp5js/docs/examples/pyodide/index.html.template"; done; refresh_demo: SKETCHBOOK_DIR="/home/bernardo/envs/pyp5js/docs/" pyp5js compile pyodide --refresh --template "/home/bernardo/envs/pyp5js/docs/pyodide/index.html.template"; run_demo: cd docs/pyodide && python -m http.server ================================================ FILE: Makefile.bat ================================================ @echo off IF /I "%1"=="test" GOTO test IF /I "%1"=="update_dist" GOTO update_dist IF /I "%1"=="upload_pypi" GOTO upload_pypi IF /I "%1"=="run_demo" GOTO run_demo GOTO error :test set PYTHONWARNINGS=ignore::flask.DeprecationWarning && pytest GOTO :EOF :update_dist @python3 setup.py sdist bdist_wheel GOTO :EOF :upload_pypi @twine upload dist/* GOTO :EOF :run_demo PUSHD docs/pyodide python -m http.server POPD GOTO :EOF :error IF "%1"=="" ( ECHO make: *** No targets specified and no makefile found. Stop. ) ELSE ( ECHO make: *** No rule to make target '%1%'. Stop. ) GOTO :EOF ================================================ FILE: README.md ================================================ ## pyp5js: drawing with Python 3 [![PyPI version](https://badge.fury.io/py/pyp5js.svg)](https://badge.fury.io/py/pyp5js) ![Continuous Integration](https://github.com/berinhard/pyp5js/workflows/Continuous%20Integration/badge.svg?branch=develop&event=push) [![Gitpod ready-to-code](https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/berinhard/pyp5js/tree/main) > [Processing](https://processing.org) ideas and Python 3 together with [P5.js](https://p5js.org) in the browser. Python 3 drawing in the web! Try it [here](https://berinhard.github.io/pyp5js/pyodide/)! Here's an example of a valid Python code using P5.js API: ```python def setup(): createCanvas(200, 200) def draw(): background(200) diameter = sin(frameCount / 60) * 50 + 50 fill('blue') ellipse(100, 100, diameter, diameter) ``` ## Project setup ``` $ git clone git@github.com:YOUR_GITHUB_PROFILE/pyp5js.git $ cd pyp5js $ pip install -r dev-requirements.txt $ python setup.py develop $ make test ``` ## More references ### [Documentation](https://berinhard.github.io/pyp5js) ### [Examples](https://berinhard.github.io/pyp5js/examples/) ### [Installation](https://berinhard.github.io/pyp5js#installation) ### [Quickstart](https://berinhard.github.io/pyp5js#quickstart) ### [Internals details](https://berinhard.github.io/pyp5js#internals-details) ### [Known issues and differences to the Processing.Py and P5.js ways of doing things](https://berinhard.github.io/pyp5js#known-issues-and-differences-to-the-processingpy-and-p5js-ways-of-doing-things) ### [How can I contribute?](CONTRIBUTING.md) ================================================ FILE: VERSION ================================================ 0.7.3 ================================================ FILE: bin/check_license.sh ================================================ #!/bin/bash EXIT_CODE=0 while IFS= read -r -d '' file; do if ! head -5 "$file" | grep -q 'Copyright'; then echo "$file" is missing a license EXIT_CODE=1 fi done < <(find pyp5js -type f \( \ -name "*.py" -o \ -name "*.html" -o \ -name "*.js.template" \) -print0) exit $EXIT_CODE ================================================ FILE: dev-requirements.txt ================================================ -r requirements.txt black==22.10.0 ipython==7.34.0 pytest==7.1.3 tox==3.26.0 pytest-env==0.6.2 Flask-Testing==0.8.1 blinker==1.5 pyaml==21.10.1 wheel==0.38.1 twine==4.0.1 ================================================ FILE: docs/examples/index.md ================================================ ### Examples list Here you find a list of examples using pyp5js. They can have lnks to working examples using Transcrypt or Pyodide as the interpreter. **Angles and mouse coordinates** | [pyodide](pyodide/sketch_001/index.html) | [transcrypt](transcrypt/sketch_001/index.html) **Move Eye**, an example by Simon Greenwold, ported by [@villares](https://github.com/villares) | [pyodide](pyodide/sketch_002/index.html) | [transcrypt](transcrypt/sketch_002/index.html) **Rotating 3D box** | [pyodide](pyodide/sketch_003/index.html) | [transcrypt](transcrypt/sketch_003/index.html) **Boids** | [pyodide](pyodide/sketch_004/index.html) | [transcrypt](transcrypt/sketch_004/index.html) **Globals variables (HSB and CENTER)** | [pyodide](pyodide/sketch_005/index.html) | [transcrypt](transcrypt/sketch_005/index.html) **Registering event functions such as keyPressed** | [pyodide](pyodide/sketch_006/index.html) | [transcrypt](transcrypt/sketch_006/index.html) **p5.Vector static methods** | [pyodide](pyodide/sketch_007/index.html) | [transcrypt](transcrypt/sketch_007/index.html) **p5.dom.js usage** | [pyodide](pyodide/sketch_008/index.html) | [transcrypt](transcrypt/sketch_008/index.html) **Working with images** | [pyodide](pyodide/sketch_009/index.html) | [transcrypt](transcrypt/sketch_009/index.html) **Complex shapes**, by [Pedro Queiroga](https://github.com/pedroqueiroga/pqueiroga.github.io/blob/master/curveVertexExample/main.js) | [pyodide](pyodide/sketch_010/index.html) | [transcrypt](transcrypt/sketch_010/index.html) **A-star search algoritm**, by [@ademakdogan](https://github.com/ademakdogan) | [pyodide](pyodide/sketch_012/index.html) **Breakout**, by [@misolietavec](https://github.com/misolietavec) | [pyodide](pyodide/breakout/index.html) **Flappy bird**, by [@misolietavec](https://github.com/misolietavec) | [pyodide](pyodide/flappybird/index.html) **Memory**, by [@misolietavec](https://github.com/misolietavec) | [pyodide](pyodide/memory/index.html) **Same game**, by [@misolietavec](https://github.com/misolietavec) | [pyodide](pyodide/samegame/index.html) ================================================ FILE: docs/examples/pyodide/bouncing/bouncing.py ================================================ x = 50 y = 100 rad = 6 vx = 5 vy = 5 WIDTH = 640 HEIGHT = 400 FPS = 60 def setup(): createCanvas(WIDTH, HEIGHT) frameRate(FPS) def draw(): global x, y, vx, vy background(220) fill(0, 255, 0) ellipse(x, y, 2 * rad) x += vx y += vy if (x + rad >= width or x - rad <= 0): vx = -vx if (y + rad >= height or y - rad <= 0): vy = -vy ================================================ FILE: docs/examples/pyodide/bouncing/bouncingFPS.py ================================================ x = 50 y = 100 diam = 10 vx = 2 vy = 2 framecount = 0 WIDTH = 640 HEIGHT = 400 FPS = 60 afps = FPS def setup(): createCanvas(WIDTH, HEIGHT) frameRate(FPS) def draw(): global x, y, vx, vy, framecount, afps background(220) fill(255, 0, 0) ellipse(x, y, diam) framecount += 1 if not framecount % FPS: afps = frameRate() fill(10) textSize(20) text("FPS: %.1f" %afps, 30, HEIGHT - 24) x += vx y += vy if (x + diam // 2 >= width or x - diam // 2 <= 0): vx = -vx if (y + diam // 2 >= height or y - diam // 2 <= 0): vy = -vy ================================================ FILE: docs/examples/pyodide/bouncing/index.html ================================================ bouncing - pyp5js

Python code here.

x = 50
y = 100
rad = 6

vx = 5
vy = 5

WIDTH = 640
HEIGHT = 400
FPS = 60

def setup():
    createCanvas(WIDTH, HEIGHT)
    frameRate(FPS)

def draw():
    global x, y, vx, vy
    
    background(220)
    fill(0, 255, 0)
    ellipse(x, y, 2 * rad)

    x += vx
    y += vy
  
    if (x + rad >= width or x - rad <= 0):
        vx = -vx
    
    if (y + rad >= height or y - rad <= 0):
        vy = -vy
================================================ FILE: docs/examples/pyodide/bouncing/odkaz.txt ================================================ https://github.com/Luxapodular/Py5.js/blob/master/examples/bouncingBall.py ================================================ FILE: docs/examples/pyodide/bouncing/static/p5.js ================================================ /*! p5.js v1.0.0 February 29, 2020 */ !function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).p5=e()}}(function(){return function o(a,s,l){function u(t,e){if(!s[t]){if(!a[t]){var r="function"==typeof require&&require;if(!e&&r)return r(t,!0);if(h)return h(t,!0);var i=new Error("Cannot find module '"+t+"'");throw i.code="MODULE_NOT_FOUND",i}var n=s[t]={exports:{}};a[t][0].call(n.exports,function(e){return u(a[t][1][e]||e)},n,n.exports,o,a,s,l)}return s[t].exports}for(var h="function"==typeof require&&require,e=0;e>16&255,a[s++]=t>>8&255,a[s++]=255&t;2===o&&(t=u[e.charCodeAt(r)]<<2|u[e.charCodeAt(r+1)]>>4,a[s++]=255&t);1===o&&(t=u[e.charCodeAt(r)]<<10|u[e.charCodeAt(r+1)]<<4|u[e.charCodeAt(r+2)]>>2,a[s++]=t>>8&255,a[s++]=255&t);return a},r.fromByteArray=function(e){for(var t,r=e.length,i=r%3,n=[],o=0,a=r-i;o>2]+s[t<<4&63]+"==")):2==i&&(t=(e[r-2]<<8)+e[r-1],n.push(s[t>>10]+s[t>>4&63]+s[t<<2&63]+"="));return n.join("")};for(var s=[],u=[],h="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=0,o=i.length;n>18&63]+s[n>>12&63]+s[n>>6&63]+s[63&n]);return o.join("")}u["-".charCodeAt(0)]=62,u["_".charCodeAt(0)]=63},{}],20:[function(e,t,r){},{}],21:[function(N,e,F){(function(c){"use strict";var i=N("base64-js"),o=N("ieee754"),e="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;F.Buffer=c,F.SlowBuffer=function(e){+e!=e&&(e=0);return c.alloc(+e)},F.INSPECT_MAX_BYTES=50;var r=2147483647;function a(e){if(r>>1;case"base64":return O(e).length;default:if(n)return i?-1:R(e).length;t=(""+t).toLowerCase(),n=!0}}function d(e,t,r){var i=e[t];e[t]=e[r],e[r]=i}function p(e,t,r,i,n){if(0===e.length)return-1;if("string"==typeof r?(i=r,r=0):2147483647=e.length){if(n)return-1;r=e.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof t&&(t=c.from(t,i)),c.isBuffer(t))return 0===t.length?-1:m(e,t,r,i,n);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):m(e,[t],r,i,n);throw new TypeError("val must be string, number or Buffer")}function m(e,t,r,i,n){var o,a=1,s=e.length,l=t.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(e.length<2||t.length<2)return-1;s/=a=2,l/=2,r/=2}function u(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(n){var h=-1;for(o=r;o>8,n=r%256,o.push(n),o.push(i);return o}(t,e.length-r),e,r,i)}function b(e,t,r){return 0===t&&r===e.length?i.fromByteArray(e):i.fromByteArray(e.slice(t,r))}function _(e,t,r){r=Math.min(e.length,r);for(var i=[],n=t;n>>10&1023|55296),h=56320|1023&h),i.push(h),n+=c}return function(e){var t=e.length;if(t<=x)return String.fromCharCode.apply(String,e);var r="",i=0;for(;ithis.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e=e||"utf8";;)switch(e){case"hex":return M(this,t,r);case"utf8":case"utf-8":return _(this,t,r);case"ascii":return w(this,t,r);case"latin1":case"binary":return S(this,t,r);case"base64":return b(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,t,r);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}.apply(this,arguments)},c.prototype.equals=function(e){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===c.compare(this,e)},c.prototype.inspect=function(){var e="",t=F.INSPECT_MAX_BYTES;return e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(e+=" ... "),""},e&&(c.prototype[e]=c.prototype.inspect),c.prototype.compare=function(e,t,r,i,n){if(A(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),t<0||r>e.length||i<0||n>this.length)throw new RangeError("out of range index");if(n<=i&&r<=t)return 0;if(n<=i)return-1;if(r<=t)return 1;if(this===e)return 0;for(var o=(n>>>=0)-(i>>>=0),a=(r>>>=0)-(t>>>=0),s=Math.min(o,a),l=this.slice(i,n),u=e.slice(t,r),h=0;h>>=0,isFinite(r)?(r>>>=0,void 0===i&&(i="utf8")):(i=r,r=void 0)}var n=this.length-t;if((void 0===r||nthis.length)throw new RangeError("Attempt to write outside buffer bounds");i=i||"utf8";for(var o,a,s,l,u,h,c=!1;;)switch(i){case"hex":return g(this,e,t,r);case"utf8":case"utf-8":return u=t,h=r,D(R(e,(l=this).length-u),l,u,h);case"ascii":return v(this,e,t,r);case"latin1":case"binary":return v(this,e,t,r);case"base64":return o=this,a=t,s=r,D(O(e),o,a,s);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return y(this,e,t,r);default:if(c)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),c=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var x=4096;function w(e,t,r){var i="";r=Math.min(e.length,r);for(var n=t;ne.length)throw new RangeError("Index out of range")}function P(e,t,r,i){if(r+i>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function L(e,t,r,i,n){return t=+t,r>>>=0,n||P(e,0,r,4),o.write(e,t,r,i,23,4),r+4}function k(e,t,r,i,n){return t=+t,r>>>=0,n||P(e,0,r,8),o.write(e,t,r,i,52,8),r+8}c.prototype.slice=function(e,t){var r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):r>>=0,t>>>=0,r||T(e,t,this.length);for(var i=this[e],n=1,o=0;++o>>=0,t>>>=0,r||T(e,t,this.length);for(var i=this[e+--t],n=1;0>>=0,t||T(e,1,this.length),this[e]},c.prototype.readUInt16LE=function(e,t){return e>>>=0,t||T(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUInt16BE=function(e,t){return e>>>=0,t||T(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUInt32LE=function(e,t){return e>>>=0,t||T(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUInt32BE=function(e,t){return e>>>=0,t||T(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||T(e,t,this.length);for(var i=this[e],n=1,o=0;++o>>=0,t>>>=0,r||T(e,t,this.length);for(var i=t,n=1,o=this[e+--i];0>>=0,t||T(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){e>>>=0,t||T(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(e,t){e>>>=0,t||T(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(e,t){return e>>>=0,t||T(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return e>>>=0,t||T(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readFloatLE=function(e,t){return e>>>=0,t||T(e,4,this.length),o.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return e>>>=0,t||T(e,4,this.length),o.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return e>>>=0,t||T(e,8,this.length),o.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return e>>>=0,t||T(e,8,this.length),o.read(this,e,!1,52,8)},c.prototype.writeUIntLE=function(e,t,r,i){e=+e,t>>>=0,r>>>=0,i||C(this,e,t,r,Math.pow(2,8*r)-1,0);var n=1,o=0;for(this[t]=255&e;++o>>=0,r>>>=0,i||C(this,e,t,r,Math.pow(2,8*r)-1,0);var n=r-1,o=1;for(this[t+n]=255&e;0<=--n&&(o*=256);)this[t+n]=e/o&255;return t+r},c.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,1,255,0),this[t]=255&e,t+1},c.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},c.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeIntLE=function(e,t,r,i){if(e=+e,t>>>=0,!i){var n=Math.pow(2,8*r-1);C(this,e,t,r,n-1,-n)}var o=0,a=1,s=0;for(this[t]=255&e;++o>0)-s&255;return t+r},c.prototype.writeIntBE=function(e,t,r,i){if(e=+e,t>>>=0,!i){var n=Math.pow(2,8*r-1);C(this,e,t,r,n-1,-n)}var o=r-1,a=1,s=0;for(this[t+o]=255&e;0<=--o&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+r},c.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},c.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeFloatLE=function(e,t,r){return L(this,e,t,!0,r)},c.prototype.writeFloatBE=function(e,t,r){return L(this,e,t,!1,r)},c.prototype.writeDoubleLE=function(e,t,r){return k(this,e,t,!0,r)},c.prototype.writeDoubleBE=function(e,t,r){return k(this,e,t,!1,r)},c.prototype.copy=function(e,t,r,i){if(!c.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r=r||0,i||0===i||(i=this.length),t>=e.length&&(t=e.length),t=t||0,0=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t>>=0,r=void 0===r?this.length:r>>>0,"number"==typeof(e=e||0))for(o=t;o>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function O(e){return i.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(t,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function D(e,t,r,i){for(var n=0;n=t.length||n>=e.length);++n)t[n+r]=e[n];return n}function A(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function I(e){return e!=e}var U=function(){for(var e="0123456789abcdef",t=new Array(256),r=0;r<16;++r)for(var i=16*r,n=0;n<16;++n)t[i+n]=e[r]+e[n];return t}()}).call(this,N("buffer").Buffer)},{"base64-js":19,buffer:21,ieee754:30}],22:[function(e,t,r){"use strict";t.exports=e("./").polyfill()},{"./":23}],23:[function(z,r,i){(function(j,V){var e,t;e=this,t=function(){"use strict";function l(e){return"function"==typeof e}var r=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},i=0,t=void 0,n=void 0,a=function(e,t){f[i]=e,f[i+1]=t,2===(i+=2)&&(n?n(d):y())};var e="undefined"!=typeof window?window:void 0,o=e||{},s=o.MutationObserver||o.WebKitMutationObserver,u="undefined"==typeof self&&void 0!==j&&"[object process]"==={}.toString.call(j),h="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function c(){var e=setTimeout;return function(){return e(d,1)}}var f=new Array(1e3);function d(){for(var e=0;e":">",'"':""","'":"'","/":"/"};function S(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,function(e){return w[e]}):e}var M=function(){function i(e){var t,r=1=this.maxReplaces)break}for(a=0;r=this.regexp.exec(e);){if(void 0===(i=h(r[1].trim())))if("function"==typeof c){var d=c(e,r,t);i="string"==typeof d?d:""}else this.logger.warn("missed to pass in variable ".concat(r[1]," for interpolating ").concat(e)),i="";else"string"==typeof i||this.useRawValueToEscape||(i=v(i));if(i=this.escapeValue?u(this.escape(i)):u(i),e=e.replace(r[0],i),this.regexp.lastIndex=0,++a>=this.maxReplaces)break}return e}},{key:"nest",value:function(e,t,r){var i,n,o=D({},2>1,h=-7,c=r?n-1:0,f=r?-1:1,d=e[t+c];for(c+=f,o=d&(1<<-h)-1,d>>=-h,h+=s;0>=-h,h+=i;0>1,f=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,d=i?0:o-1,p=i?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=h):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),2<=(t+=1<=a+c?f/l:f*Math.pow(2,1-c))*l&&(a++,l/=2),h<=a+c?(s=0,a=h):1<=a+c?(s=(t*l-1)*Math.pow(2,n),a+=c):(s=t*Math.pow(2,c-1)*Math.pow(2,n),a=0));8<=n;e[r+d]=255&s,d+=p,s/=256,n-=8);for(a=a<Math.abs(e[0])&&(t=1),Math.abs(e[2])>Math.abs(e[t])&&(t=2),t}var C=4e150;function P(e,t){e.f+=t.f,e.b.f+=t.b.f}function u(e,t,r){return e=e.a,t=t.a,r=r.a,t.b.a===e?r.b.a===e?v(t.a,r.a)?b(r.b.a,t.a,r.a)<=0:0<=b(t.b.a,r.a,t.a):b(r.b.a,e,r.a)<=0:r.b.a===e?0<=b(t.b.a,e,t.a):(t=y(t.b.a,e,t.a),(e=y(r.b.a,e,r.a))<=t)}function L(e){e.a.i=null;var t=e.e;t.a.c=t.c,t.c.a=t.a,e.e=null}function h(e,t){c(e.a),e.c=!1,(e.a=t).i=e}function k(e){for(var t=e.a.a;(e=fe(e)).a.a===t;);return e.c&&(h(e,t=f(ce(e).a.b,e.a.e)),e=fe(e)),e}function R(e,t,r){var i=new he;return i.a=r,i.e=W(e.f,t.e,i),r.i=i}function O(e,t){switch(e.s){case 100130:return 0!=(1&t);case 100131:return 0!==t;case 100132:return 0>1]],s[a[u]])?le(r,u):ue(r,u)),s[o]=null,l[o]=r.b,r.b=o}else for(r.c[-(o+1)]=null;0Math.max(a.a,l.a))return!1;if(v(o,a)){if(0i.f&&(i.f*=2,i.c=oe(i.c,i.f+1)),0===i.b?r=n:(r=i.b,i.b=i.c[i.b]),i.e[r]=t,i.c[r]=n,i.d[n]=r,i.h&&ue(i,n),r}return i=e.a++,e.c[i]=t,-(i+1)}function ie(e){if(0===e.a)return se(e.b);var t=e.c[e.d[e.a-1]];if(0!==e.b.a&&v(ae(e.b),t))return se(e.b);for(;--e.a,0e.a||v(i[a],i[l])){n[r[o]=a]=o;break}n[r[o]=l]=o,o=s}}function ue(e,t){for(var r=e.d,i=e.e,n=e.c,o=t,a=r[o];;){var s=o>>1,l=r[s];if(0==s||v(i[l],i[a])){n[r[o]=a]=o;break}n[r[o]=l]=o,o=s}}function he(){this.e=this.a=null,this.f=0,this.c=this.b=this.h=this.d=!1}function ce(e){return e.e.c.b}function fe(e){return e.e.a.b}(i=q.prototype).x=function(){Y(this,0)},i.B=function(e,t){switch(e){case 100142:return;case 100140:switch(t){case 100130:case 100131:case 100132:case 100133:case 100134:return void(this.s=t)}break;case 100141:return void(this.m=!!t);default:return void Z(this,100900)}Z(this,100901)},i.y=function(e){switch(e){case 100142:return 0;case 100140:return this.s;case 100141:return this.m;default:Z(this,100900)}return!1},i.A=function(e,t,r){this.j[0]=e,this.j[1]=t,this.j[2]=r},i.z=function(e,t){var r=t||null;switch(e){case 100100:case 100106:this.h=r;break;case 100104:case 100110:this.l=r;break;case 100101:case 100107:this.k=r;break;case 100102:case 100108:this.i=r;break;case 100103:case 100109:this.p=r;break;case 100105:case 100111:this.o=r;break;case 100112:this.r=r;break;default:Z(this,100900)}},i.C=function(e,t){var r=!1,i=[0,0,0];Y(this,2);for(var n=0;n<3;++n){var o=e[n];o<-1e150&&(o=-1e150,r=!0),1e150n[u]&&(n[u]=h,a[u]=l)}if(l=0,n[1]-o[1]>n[0]-o[0]&&(l=1),n[2]-o[2]>n[l]-o[l]&&(l=2),o[l]>=n[l])i[0]=0,i[1]=0,i[2]=1;else{for(n=0,o=s[l],a=a[l],s=[0,0,0],o=[o.g[0]-a.g[0],o.g[1]-a.g[1],o.g[2]-a.g[2]],u=[0,0,0],l=r.e;l!==r;l=l.e)u[0]=l.g[0]-a.g[0],u[1]=l.g[1]-a.g[1],u[2]=l.g[2]-a.g[2],s[0]=o[1]*u[2]-o[2]*u[1],s[1]=o[2]*u[0]-o[0]*u[2],s[2]=o[0]*u[1]-o[1]*u[0],n<(h=s[0]*s[0]+s[1]*s[1]+s[2]*s[2])&&(n=h,i[0]=s[0],i[1]=s[1],i[2]=s[2]);n<=0&&(i[0]=i[1]=i[2]=0,i[T(o)]=1)}r=!0}for(s=T(i),l=this.b.c,n=(s+1)%3,a=(s+2)%3,s=0>=l,h-=l,g!=o){if(g==a)break;for(var v=g>8,++y;var _=b;if(i>=8;null!==m&&s<4096&&(p[s++]=m<<8|_,u+1<=s&&l<12&&(++l,u=u<<1|1)),m=g}else s=1+a,u=(1<<(l=n+1))-1,m=null}return f!==i&&console.log("Warning, gif stream shorter than expected."),r}try{r.GifWriter=function(v,e,t,r){var y=0,i=void 0===(r=void 0===r?{}:r).loop?null:r.loop,b=void 0===r.palette?null:r.palette;if(e<=0||t<=0||65535>=1;)++n;if(a=1<>8&255,v[y++]=255&t,v[y++]=t>>8&255,v[y++]=(null!==b?128:0)|n,v[y++]=o,v[y++]=0,null!==b)for(var s=0,l=b.length;s>16&255,v[y++]=u>>8&255,v[y++]=255&u}if(null!==i){if(i<0||65535>8&255,v[y++]=0}var x=!1;this.addFrame=function(e,t,r,i,n,o){if(!0===x&&(--y,x=!1),o=void 0===o?{}:o,e<0||t<0||65535>=1;)++u;l=1<>8&255,v[y++]=d,v[y++]=0),v[y++]=44,v[y++]=255&e,v[y++]=e>>8&255,v[y++]=255&t,v[y++]=t>>8&255,v[y++]=255&r,v[y++]=r>>8&255,v[y++]=255&i,v[y++]=i>>8&255,v[y++]=!0===a?128|u-1:0,!0===a)for(var p=0,m=s.length;p>16&255,v[y++]=g>>8&255,v[y++]=255&g}return y=function(t,r,e,i){t[r++]=e;var n=r++,o=1<>=8,h-=8,r===n+256&&(t[n]=255,n=r++)}function d(e){c|=e<>=8,h-=8,r===n+256&&(t[n]=255,n=r++);4096===l?(d(o),l=1+s,u=e+1,m={}):(1<>7,n=1<<1+(7&r);x[e++],x[e++];var o=null,a=null;i&&(o=e,e+=3*(a=n));var s=!0,l=[],u=0,h=null,c=0,f=null;for(this.width=w,this.height=t;s&&e>2&7,e++;break;case 254:for(;;){if(!(0<=(C=x[e++])))throw Error("Invalid block size");if(0===C)break;e+=C}break;default:throw new Error("Unknown graphic control label: 0x"+x[e-1].toString(16))}break;case 44:var p=x[e++]|x[e++]<<8,m=x[e++]|x[e++]<<8,g=x[e++]|x[e++]<<8,v=x[e++]|x[e++]<<8,y=x[e++],b=y>>6&1,_=1<<1+(7&y),S=o,M=a,E=!1;if(y>>7){E=!0;S=e,e+=3*(M=_)}var T=e;for(e++;;){var C;if(!(0<=(C=x[e++])))throw Error("Invalid block size");if(0===C)break;e+=C}l.push({x:p,y:m,width:g,height:v,has_local_palette:E,palette_offset:S,palette_size:M,data_offset:T,data_length:e-T,transparent_index:h,interlaced:!!b,delay:u,disposal:c});break;case 59:s=!1;break;default:throw new Error("Unknown gif block: 0x"+x[e-1].toString(16))}this.numFrames=function(){return l.length},this.loopCount=function(){return f},this.frameInfo=function(e){if(e<0||e>=l.length)throw new Error("Frame index out of range.");return l[e]},this.decodeAndBlitFrameBGRA=function(e,t){var r=this.frameInfo(e),i=r.width*r.height,n=new Uint8Array(i);P(x,r.data_offset,n,i);var o=r.palette_offset,a=r.transparent_index;null===a&&(a=256);var s=r.width,l=w-s,u=s,h=4*(r.y*w+r.x),c=4*((r.y+r.height)*w+r.x),f=h,d=4*l;!0===r.interlaced&&(d+=4*w*7);for(var p=8,m=0,g=n.length;m>=1)),v===a)f+=4;else{var y=x[o+3*v],b=x[o+3*v+1],_=x[o+3*v+2];t[f++]=_,t[f++]=b,t[f++]=y,t[f++]=255}--u}},this.decodeAndBlitFrameRGBA=function(e,t){var r=this.frameInfo(e),i=r.width*r.height,n=new Uint8Array(i);P(x,r.data_offset,n,i);var o=r.palette_offset,a=r.transparent_index;null===a&&(a=256);var s=r.width,l=w-s,u=s,h=4*(r.y*w+r.x),c=4*((r.y+r.height)*w+r.x),f=h,d=4*l;!0===r.interlaced&&(d+=4*w*7);for(var p=8,m=0,g=n.length;m>=1)),v===a)f+=4;else{var y=x[o+3*v],b=x[o+3*v+1],_=x[o+3*v+2];t[f++]=y,t[f++]=b,t[f++]=_,t[f++]=255}--u}}}}catch(e){}},{}],33:[function(jr,t,r){(function(Gr){var e;e=this,function(E){"use strict";function e(e){if(null==this)throw TypeError();var t=String(this),r=t.length,i=e?Number(e):0;if(i!=i&&(i=0),!(i<0||r<=i)){var n,o=t.charCodeAt(i);return 55296<=o&&o<=56319&&i+1>>=1,t}function _(e,t,r){if(!t)return r;for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<>>16-t;return e.tag>>>=t,e.bitcount-=t,i+r}function x(e,t){for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<>>=1,++n,r+=t.table[n],0<=(i-=t.table[n]););return e.tag=o,e.bitcount-=n,t.trans[r+i]}function w(e,t,r){var i,n,o,a,s,l;for(i=_(e,5,257),n=_(e,5,1),o=_(e,4,4),a=0;a<19;++a)g[a]=0;for(a=0;athis.x2&&(this.x2=e)),"number"==typeof t&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=t,this.y2=t),tthis.y2&&(this.y2=t))},C.prototype.addX=function(e){this.addPoint(e,null)},C.prototype.addY=function(e){this.addPoint(null,e)},C.prototype.addBezier=function(e,t,r,i,n,o,a,s){var l=this,u=[e,t],h=[r,i],c=[n,o],f=[a,s];this.addPoint(e,t),this.addPoint(a,s);for(var d=0;d<=1;d++){var p=6*u[d]-12*h[d]+6*c[d],m=-3*u[d]+9*h[d]-9*c[d]+3*f[d],g=3*h[d]-3*u[d];if(0!=m){var v=Math.pow(p,2)-4*g*m;if(!(v<0)){var y=(-p+Math.sqrt(v))/(2*m);0>8&255,255&e]},A.USHORT=U(2),D.SHORT=function(e){return 32768<=e&&(e=-(65536-e)),[e>>8&255,255&e]},A.SHORT=U(2),D.UINT24=function(e){return[e>>16&255,e>>8&255,255&e]},A.UINT24=U(3),D.ULONG=function(e){return[e>>24&255,e>>16&255,e>>8&255,255&e]},A.ULONG=U(4),D.LONG=function(e){return R<=e&&(e=-(2*R-e)),[e>>24&255,e>>16&255,e>>8&255,255&e]},A.LONG=U(4),D.FIXED=D.ULONG,A.FIXED=A.ULONG,D.FWORD=D.SHORT,A.FWORD=A.SHORT,D.UFWORD=D.USHORT,A.UFWORD=A.USHORT,D.LONGDATETIME=function(e){return[0,0,0,0,e>>24&255,e>>16&255,e>>8&255,255&e]},A.LONGDATETIME=U(8),D.TAG=function(e){return k.argument(4===e.length,"Tag should be exactly 4 ASCII characters."),[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]},A.TAG=U(4),D.Card8=D.BYTE,A.Card8=A.BYTE,D.Card16=D.USHORT,A.Card16=A.USHORT,D.OffSize=D.BYTE,A.OffSize=A.BYTE,D.SID=D.USHORT,A.SID=A.USHORT,D.NUMBER=function(e){return-107<=e&&e<=107?[e+139]:108<=e&&e<=1131?[247+((e-=108)>>8),255&e]:-1131<=e&&e<=-108?[251+((e=-e-108)>>8),255&e]:-32768<=e&&e<=32767?D.NUMBER16(e):D.NUMBER32(e)},A.NUMBER=function(e){return D.NUMBER(e).length},D.NUMBER16=function(e){return[28,e>>8&255,255&e]},A.NUMBER16=U(3),D.NUMBER32=function(e){return[29,e>>24&255,e>>16&255,e>>8&255,255&e]},A.NUMBER32=U(5),D.REAL=function(e){var t=e.toString(),r=/\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec(t);if(r){var i=parseFloat("1e"+((r[2]?+r[2]:0)+r[1].length));t=(Math.round(e*i)/i).toString()}for(var n="",o=0,a=t.length;o>8&255,t[t.length]=255&i}return t},A.UTF16=function(e){return 2*e.length};var N={"x-mac-croatian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈ƫȅ ÀÃÕŒœĐ—“”‘’÷◊©⁄€‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ","x-mac-cyrillic":"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю","x-mac-gaelic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØḂ±≤≥ḃĊċḊḋḞḟĠġṀæøṁṖṗɼƒſṠ«»… ÀÃÕŒœ–—“”‘’ṡẛÿŸṪ€‹›Ŷŷṫ·Ỳỳ⁊ÂÊÁËÈÍÎÏÌÓÔ♣ÒÚÛÙıÝýŴŵẄẅẀẁẂẃ","x-mac-greek":"Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦€ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ­","x-mac-icelandic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüݰ¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-inuit":"ᐃᐄᐅᐆᐊᐋᐱᐲᐳᐴᐸᐹᑉᑎᑏᑐᑑᑕᑖᑦᑭᑮᑯᑰᑲᑳᒃᒋᒌᒍᒎᒐᒑ°ᒡᒥᒦ•¶ᒧ®©™ᒨᒪᒫᒻᓂᓃᓄᓅᓇᓈᓐᓯᓰᓱᓲᓴᓵᔅᓕᓖᓗᓘᓚᓛᓪᔨᔩᔪᔫᔭ… ᔮᔾᕕᕖᕗ–—“”‘’ᕘᕙᕚᕝᕆᕇᕈᕉᕋᕌᕐᕿᖀᖁᖂᖃᖄᖅᖏᖐᖑᖒᖓᖔᖕᙱᙲᙳᙴᙵᙶᖖᖠᖡᖢᖣᖤᖥᖦᕼŁł","x-mac-ce":"ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ",macintosh:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-romanian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂȘ∞±≤≥¥µ∂∑∏π∫ªºΩăș¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›Țț‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-turkish":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙˆ˜¯˘˙˚¸˝˛ˇ"};O.MACSTRING=function(e,t,r,i){var n=N[i];if(void 0!==n){for(var o="",a=0;a>8&255,l+256&255)}return o}D.MACSTRING=function(e,t){var r=function(e){if(!F)for(var t in F={},N)F[t]=new String(t);var r=F[e];if(void 0!==r){if(B){var i=B.get(r);if(void 0!==i)return i}var n=N[e];if(void 0!==n){for(var o={},a=0;a>8,t[c+1]=255&f,t=t.concat(i[h])}return t},A.TABLE=function(e){for(var t=0,r=e.fields.length,i=0;i>1,t.skip("uShort",3),e.glyphIndexMap={};for(var a=new se.Parser(r,i+n+14),s=new se.Parser(r,i+n+16+2*o),l=new se.Parser(r,i+n+16+4*o),u=new se.Parser(r,i+n+16+6*o),h=i+n+16+8*o,c=0;c>4,o=15&i;if(15==n)break;if(t+=r[n],15==o)break;t+=r[o]}return parseFloat(t)}(e);if(32<=t&&t<=246)return t-139;if(247<=t&&t<=250)return 256*(t-247)+e.parseByte()+108;if(251<=t&&t<=254)return 256*-(t-251)-e.parseByte()-108;throw new Error("Invalid b0 "+t)}function Te(e,t,r){t=void 0!==t?t:0;var i=new se.Parser(e,t),n=[],o=[];for(r=void 0!==r?r:e.length;i.relativeOffset>1,T.length=0,P=!0}return function e(t){for(var r,i,n,o,a,s,l,u,h,c,f,d,p=0;pMath.abs(d-R)?k=f+T.shift():R=d+T.shift(),E.curveTo(y,b,_,x,l,u),E.curveTo(h,c,f,d,k,R);break;default:console.log("Glyph "+v.index+": unknown operator 1200"+m),T.length=0}break;case 14:0>3;break;case 21:2>16),p+=2;break;case 29:a=T.pop()+g.gsubrsBias,(s=g.gsubrs[a])&&e(s);break;case 30:for(;0=r.begin&&e=fe.length){var a=i.parseChar();r.names.push(i.parseString(a))}break;case 2.5:r.numberOfGlyphs=i.parseUShort(),r.offset=new Array(r.numberOfGlyphs);for(var s=0;st.value.tag?1:-1}),t.fields=t.fields.concat(i),t.fields=t.fields.concat(n),t}function gt(e,t,r){for(var i=0;i 123 are reserved for internal usage");d|=1<>>1,o=e[n].tag;if(o===t)return n;o>>1,o=e[n];if(o===t)return n;o>>1,a=(r=e[o]).start;if(a===t)return r;a(r=e[i-1]).end?0:r}function xt(e,t){this.font=e,this.tableName=t}function wt(e){xt.call(this,e,"gpos")}function St(e){xt.call(this,e,"gsub")}function Mt(e,t){var r=e.length;if(r!==t.length)return!1;for(var i=0;it.points.length-1||i.matchedPoints[1]>n.points.length-1)throw Error("Matched points out of range in "+t.name);var a=t.points[i.matchedPoints[0]],s=n.points[i.matchedPoints[1]],l={xScale:i.xScale,scale01:i.scale01,scale10:i.scale10,yScale:i.yScale,dx:0,dy:0};s=kt([s],l)[0],l.dx=a.x-s.x,l.dy=a.y-s.y,o=kt(n.points,l)}t.points=t.points.concat(o)}}return Rt(t.points)}(wt.prototype=xt.prototype={searchTag:yt,binSearch:bt,getTable:function(e){var t=this.font.tables[this.tableName];return!t&&e&&(t=this.font.tables[this.tableName]=this.createDefaultTable()),t},getScriptNames:function(){var e=this.getTable();return e?e.scripts.map(function(e){return e.tag}):[]},getDefaultScriptName:function(){var e=this.getTable();if(e){for(var t=!1,r=0;r=s[u-1].tag,"Features must be added in alphabetical order."),o={tag:r,feature:{params:0,lookupListIndexes:[]}},s.push(o),a.push(u),o.feature}}},getLookupTables:function(e,t,r,i,n){var o=this.getFeatureTable(e,t,r,n),a=[];if(o){for(var s,l=o.lookupListIndexes,u=this.font.tables[this.tableName].lookups,h=0;h",s),t.stack.push(Math.round(64*s))}function vr(e,t){var r=t.stack,i=r.pop(),n=t.fv,o=t.pv,a=t.ppem,s=t.deltaBase+16*(e-1),l=t.deltaShift,u=t.z0;E.DEBUG&&console.log(t.step,"DELTAP["+e+"]",i,r);for(var h=0;h>4)===a){var d=(15&f)-8;0<=d&&d++,E.DEBUG&&console.log(t.step,"DELTAPFIX",c,"by",d*l);var p=u[c];n.setRelative(p,p,d*l,o)}}}function yr(e,t){var r=t.stack,i=r.pop();E.DEBUG&&console.log(t.step,"ROUND[]"),r.push(64*t.round(i/64))}function br(e,t){var r=t.stack,i=r.pop(),n=t.ppem,o=t.deltaBase+16*(e-1),a=t.deltaShift;E.DEBUG&&console.log(t.step,"DELTAC["+e+"]",i,r);for(var s=0;s>4)===n){var h=(15&u)-8;0<=h&&h++;var c=h*a;E.DEBUG&&console.log(t.step,"DELTACFIX",l,"by",c),t.cvt[l]+=c}}}function _r(e,t){var r,i,n=t.stack,o=n.pop(),a=n.pop(),s=t.z2[o],l=t.z1[a];E.DEBUG&&console.log(t.step,"SDPVTL["+e+"]",o,a),i=e?(r=s.y-l.y,l.x-s.x):(r=l.x-s.x,l.y-s.y),t.dpv=Zt(r,i)}function xr(e,t){var r=t.stack,i=t.prog,n=t.ip;E.DEBUG&&console.log(t.step,"PUSHB["+e+"]");for(var o=0;o":"_")+(i?"R":"_")+(0===n?"Gr":1===n?"Bl":2===n?"Wh":"")+"]",e?c+"("+o.cvt[c]+","+u+")":"",f,"(d =",a,"->",l*s,")"),o.rp1=o.rp0,o.rp2=f,t&&(o.rp0=f)}Ft.prototype.exec=function(e,t){if("number"!=typeof t)throw new Error("Point size is not a number!");if(!(2",i),s.interpolate(c,o,a,l),s.touch(c)}e.loop=1},dr.bind(void 0,0),dr.bind(void 0,1),function(e){for(var t=e.stack,r=e.rp0,i=e.z0[r],n=e.loop,o=e.fv,a=e.pv,s=e.z1;n--;){var l=t.pop(),u=s[l];E.DEBUG&&console.log(e.step,(1=a.width||t>=a.height?[0,0,0,0]:this._getPixel(e,t);var s=new l.default.Image(r,i);return s.canvas.getContext("2d").drawImage(a,e,t,r*o,i*o,0,0,r,i),s},l.default.Renderer.prototype.textLeading=function(e){return"number"==typeof e?(this._setProperty("_textLeading",e),this._pInst):this._textLeading},l.default.Renderer.prototype.textSize=function(e){return"number"==typeof e?(this._setProperty("_textSize",e),this._setProperty("_textLeading",e*y._DEFAULT_LEADMULT),this._applyTextProperties()):this._textSize},l.default.Renderer.prototype.textStyle=function(e){return e?(e!==y.NORMAL&&e!==y.ITALIC&&e!==y.BOLD&&e!==y.BOLDITALIC||this._setProperty("_textStyle",e),this._applyTextProperties()):this._textStyle},l.default.Renderer.prototype.textAscent=function(){return null===this._textAscent&&this._updateTextMetrics(),this._textAscent},l.default.Renderer.prototype.textDescent=function(){return null===this._textDescent&&this._updateTextMetrics(),this._textDescent},l.default.Renderer.prototype.textAlign=function(e,t){return void 0!==e?(this._setProperty("_textAlign",e),void 0!==t&&this._setProperty("_textBaseline",t),this._applyTextProperties()):{horizontal:this._textAlign,vertical:this._textBaseline}},l.default.Renderer.prototype.text=function(e,t,r,i,n){var o,a,s,l,u,h,c,f,d=this._pInst,p=Number.MAX_VALUE;if((this._doFill||this._doStroke)&&void 0!==e){if("string"!=typeof e&&(e=e.toString()),o=(e=e.replace(/(\t)/g," ")).split("\n"),void 0!==i){for(s=f=0;ss.HALF_PI&&e<=3*s.HALF_PI?Math.atan(r/i*Math.tan(e))+s.PI:Math.atan(r/i*Math.tan(e))+s.TWO_PI,t=t<=s.HALF_PI?Math.atan(r/i*Math.tan(t)):t>s.HALF_PI&&t<=3*s.HALF_PI?Math.atan(r/i*Math.tan(t))+s.PI:Math.atan(r/i*Math.tan(t))+s.TWO_PI),tv||Math.abs(this.accelerationY-this.pAccelerationY)>v||Math.abs(this.accelerationZ-this.pAccelerationZ)>v)&&e();var t=this.deviceTurned||window.deviceTurned;if("function"==typeof t){var r=this.rotationX+180,i=this.pRotationX+180,n=c+180;0>>24],i+=x[(16711680&C)>>16],n+=x[(65280&C)>>8],o+=x[255&C],r+=k[_],s++}w[l=T+y]=a/r,S[l]=i/r,M[l]=n/r,E[l]=o/r}T+=d}for(h=(u=-P)*d,b=T=0;b>>16,e[r+1]=(65280&t[i])>>>8,e[r+2]=255&t[i],e[r+3]=(4278190080&t[i])>>>24},O._toImageData=function(e){return e instanceof ImageData?e:e.getContext("2d").getImageData(0,0,e.width,e.height)},O._createImageData=function(e,t){return O._tmpCanvas=document.createElement("canvas"),O._tmpCtx=O._tmpCanvas.getContext("2d"),this._tmpCtx.createImageData(e,t)},O.apply=function(e,t,r){var i=e.getContext("2d"),n=i.getImageData(0,0,e.width,e.height),o=t(n,r);o instanceof ImageData?i.putImageData(o,0,0,0,0,e.width,e.height):i.putImageData(n,0,0,0,0,e.width,e.height)},O.threshold=function(e,t){var r=O._toPixels(e);void 0===t&&(t=.5);for(var i=Math.floor(255*t),n=0;n>8)/i,r[n+1]=255*(a*t>>8)/i,r[n+2]=255*(s*t>>8)/i}},O.dilate=function(e){for(var t,r,i,n,o,a,s,l,u,h,c,f,d,p,m,g,v,y=O._toPixels(e),b=0,_=y.length?y.length/4:0,x=new Int32Array(_);b<_;)for(r=(t=b)+e.width;b>16&255)+151*(i>>8&255)+28*(255&i))<(m=77*(c>>16&255)+151*(c>>8&255)+28*(255&c))&&(n=c,o=m),o<(p=77*((h=O._getARGB(y,a))>>16&255)+151*(h>>8&255)+28*(255&h))&&(n=h,o=p),o<(g=77*(f>>16&255)+151*(f>>8&255)+28*(255&f))&&(n=f,o=g),o<(v=77*(d>>16&255)+151*(d>>8&255)+28*(255&d))&&(n=d,o=v),x[b++]=n;O._setPixels(y,x)},O.erode=function(e){for(var t,r,i,n,o,a,s,l,u,h,c,f,d,p,m,g,v,y=O._toPixels(e),b=0,_=y.length?y.length/4:0,x=new Int32Array(_);b<_;)for(r=(t=b)+e.width;b>16&255)+151*(c>>8&255)+28*(255&c))<(o=77*(i>>16&255)+151*(i>>8&255)+28*(255&i))&&(n=c,o=m),(p=77*((h=O._getARGB(y,a))>>16&255)+151*(h>>8&255)+28*(255&h))>16&255)+151*(f>>8&255)+28*(255&f))>16&255)+151*(d>>8&255)+28*(255&d))=r){var i=Math.floor(t.timeDisplayed/r);if(t.timeDisplayed=0,t.displayIndex+=i,t.loopCount=Math.floor(t.displayIndex/t.numFrames),null!==t.loopLimit&&t.loopCount>=t.loopLimit)t.playing=!1;else{var n=t.displayIndex%t.numFrames;this.drawingContext.putImageData(t.frames[n].image,0,0),t.displayIndex=n,this.setModified(!0)}}}},n.default.Image.prototype._setProperty=function(e,t){this[e]=t,this.setModified(!0)},n.default.Image.prototype.loadPixels=function(){n.default.Renderer2D.prototype.loadPixels.call(this),this.setModified(!0)},n.default.Image.prototype.updatePixels=function(e,t,r,i){n.default.Renderer2D.prototype.updatePixels.call(this,e,t,r,i),this.setModified(!0)},n.default.Image.prototype.get=function(e,t,r,i){return n.default._validateParameters("p5.Image.get",arguments),n.default.Renderer2D.prototype.get.apply(this,arguments)},n.default.Image.prototype._getPixel=n.default.Renderer2D.prototype._getPixel,n.default.Image.prototype.set=function(e,t,r){n.default.Renderer2D.prototype.set.call(this,e,t,r),this.setModified(!0)},n.default.Image.prototype.resize=function(e,t){0===e&&0===t?(e=this.canvas.width,t=this.canvas.height):0===e?e=this.canvas.width*t/this.canvas.height:0===t&&(t=this.canvas.height*e/this.canvas.width),e=Math.floor(e),t=Math.floor(t);var r=document.createElement("canvas");if(r.width=e,r.height=t,this.gifProperties)for(var i=this.gifProperties,n=function(e,t){for(var r=0,i=0;i/g,">").replace(/"/g,""").replace(/'/g,"'")}function l(e,t){t&&!0!==t&&"true"!==t||(t="");var r="";return(e=e||"untitled")&&e.includes(".")&&(r=e.split(".").pop()),t&&r!==t&&(r=t,e="".concat(e,".").concat(r)),[e,r]}e("../core/error_helpers"),v.default.prototype.loadJSON=function(){for(var e=arguments.length,t=new Array(e),r=0;r"),n.print("");if(n.print(' '),n.print(""),n.print(""),n.print(" "),"0"!==o[0]){n.print(" ");for(var h=0;h".concat(c)),n.print(" ")}n.print(" ")}for(var f=0;f");for(var d=0;d".concat(p)),n.print(" ")}n.print(" ")}n.print("
"),n.print(""),n.print("")}n.close(),n.clear()},v.default.prototype.writeFile=function(e,t,r){var i="application/octet-stream";v.default.prototype._isSafari()&&(i="text/plain");var n=new Blob(e,{type:i});v.default.prototype.downloadFile(n,t,r)},v.default.prototype.downloadFile=function(e,t,r){var i=l(t,r),n=i[0];if(e instanceof Blob)s.default.saveAs(e,n);else{var o=document.createElement("a");if(o.href=e,o.download=n,o.onclick=function(e){var t;t=e,document.body.removeChild(t.target),e.stopPropagation()},o.style.display="none",document.body.appendChild(o),v.default.prototype._isSafari()){var a="Hello, Safari user! To download this file...\n";a+="1. Go to File --\x3e Save As.\n",a+='2. Choose "Page Source" as the Format.\n',a+='3. Name it with this extension: ."'.concat(i[1],'"'),alert(a)}o.click()}},v.default.prototype._checkFileExtension=l,v.default.prototype._isSafari=function(){return 0>>0},getSeed:function(){return t},rand:function(){return(r=(1664525*r+1013904223)%i)/i}});n.setSeed(e),_=new Array(4096);for(var o=0;o<4096;o++)_[o]=n.rand()};var o=n.default;r.default=o},{"../core/main":49}],82:[function(e,t,r){"use strict";function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i,l=(i=e("../core/main"))&&i.__esModule?i:{default:i},o=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==a(e)&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var o=i?Object.getOwnPropertyDescriptor(e,n):null;o&&(o.get||o.set)?Object.defineProperty(r,n,o):r[n]=e[n]}r.default=e,t&&t.set(e,r);return r}(e("../core/constants"));function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}l.default.Vector=function(e,t,r){var i,n,o;o=e instanceof l.default?(this.p5=e,i=t[0]||0,n=t[1]||0,t[2]||0):(i=e||0,n=t||0,r||0),this.x=i,this.y=n,this.z=o},l.default.Vector.prototype.toString=function(){return"p5.Vector Object : [".concat(this.x,", ").concat(this.y,", ").concat(this.z,"]")},l.default.Vector.prototype.set=function(e,t,r){return e instanceof l.default.Vector?(this.x=e.x||0,this.y=e.y||0,this.z=e.z||0):e instanceof Array?(this.x=e[0]||0,this.y=e[1]||0,this.z=e[2]||0):(this.x=e||0,this.y=t||0,this.z=r||0),this},l.default.Vector.prototype.copy=function(){return this.p5?new l.default.Vector(this.p5,[this.x,this.y,this.z]):new l.default.Vector(this.x,this.y,this.z)},l.default.Vector.prototype.add=function(e,t,r){return e instanceof l.default.Vector?(this.x+=e.x||0,this.y+=e.y||0,this.z+=e.z||0):e instanceof Array?(this.x+=e[0]||0,this.y+=e[1]||0,this.z+=e[2]||0):(this.x+=e||0,this.y+=t||0,this.z+=r||0),this};function u(e,t){return 0!==e&&(this.x=this.x%e),0!==t&&(this.y=this.y%t),this}function h(e,t,r){return 0!==e&&(this.x=this.x%e),0!==t&&(this.y=this.y%t),0!==r&&(this.z=this.z%r),this}l.default.Vector.prototype.rem=function(e,t,r){if(e instanceof l.default.Vector){if(Number.isFinite(e.x)&&Number.isFinite(e.y)&&Number.isFinite(e.z)){var i=parseFloat(e.x),n=parseFloat(e.y),o=parseFloat(e.z);h.call(this,i,n,o)}}else if(e instanceof Array)e.every(function(e){return Number.isFinite(e)})&&(2===e.length&&u.call(this,e[0],e[1]),3===e.length&&h.call(this,e[0],e[1],e[2]));else if(1===arguments.length){if(Number.isFinite(e)&&0!==e)return this.x=this.x%e,this.y=this.y%e,this.z=this.z%e,this}else if(2===arguments.length){var a=Array.prototype.slice.call(arguments);a.every(function(e){return Number.isFinite(e)})&&2===a.length&&u.call(this,a[0],a[1])}else if(3===arguments.length){var s=Array.prototype.slice.call(arguments);s.every(function(e){return Number.isFinite(e)})&&3===s.length&&h.call(this,s[0],s[1],s[2])}},l.default.Vector.prototype.sub=function(e,t,r){return e instanceof l.default.Vector?(this.x-=e.x||0,this.y-=e.y||0,this.z-=e.z||0):e instanceof Array?(this.x-=e[0]||0,this.y-=e[1]||0,this.z-=e[2]||0):(this.x-=e||0,this.y-=t||0,this.z-=r||0),this},l.default.Vector.prototype.mult=function(e){return"number"==typeof e&&isFinite(e)?(this.x*=e,this.y*=e,this.z*=e):console.warn("p5.Vector.prototype.mult:","n is undefined or not a finite number"),this},l.default.Vector.prototype.div=function(e){return"number"==typeof e&&isFinite(e)?0===e?console.warn("p5.Vector.prototype.div:","divide by 0"):(this.x/=e,this.y/=e,this.z/=e):console.warn("p5.Vector.prototype.div:","n is undefined or not a finite number"),this},l.default.Vector.prototype.mag=function(){return Math.sqrt(this.magSq())},l.default.Vector.prototype.magSq=function(){var e=this.x,t=this.y,r=this.z;return e*e+t*t+r*r},l.default.Vector.prototype.dot=function(e,t,r){return e instanceof l.default.Vector?this.dot(e.x,e.y,e.z):this.x*(e||0)+this.y*(t||0)+this.z*(r||0)},l.default.Vector.prototype.cross=function(e){var t=this.y*e.z-this.z*e.y,r=this.z*e.x-this.x*e.z,i=this.x*e.y-this.y*e.x;return this.p5?new l.default.Vector(this.p5,[t,r,i]):new l.default.Vector(t,r,i)},l.default.Vector.prototype.dist=function(e){return e.copy().sub(this).mag()},l.default.Vector.prototype.normalize=function(){var e=this.mag();return 0!==e&&this.mult(1/e),this},l.default.Vector.prototype.limit=function(e){var t=this.magSq();return e*e>>0},n.default.prototype.randomSeed=function(e){this._lcgSetSeed(o,e),this._gaussian_previous=!1},n.default.prototype.random=function(e,t){var r;if(n.default._validateParameters("random",arguments),r=null!=this[o]?this._lcg(o):Math.random(),void 0===e)return r;if(void 0===t)return e instanceof Array?e[Math.floor(r*e.length)]:r*e;if(tf){var P=p,L=l,k=u;p=d+f*(s&&d=t&&(r=r.substring(r.length-t,r.length)),r}},n.default.prototype.unhex=function(e){return e instanceof Array?e.map(n.default.prototype.unhex):parseInt("0x".concat(e),16)};var o=n.default;r.default=o},{"../core/main":49}],90:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i,a=(i=e("../core/main"))&&i.__esModule?i:{default:i};function n(e,t,r){var i=e<0,n=i?e.toString().substring(1):e.toString(),o=n.indexOf("."),a=-1!==o?n.substring(0,o):n,s=-1!==o?n.substring(o+1):"",l=i?"-":"";if(void 0!==r){var u="";(-1!==o||0r&&(s=s.substring(0,r));for(var h=0;hi.length)for(var o=t-(i+=-1===r?".":"").length+1,a=0;a=d.TWO_PI?"".concat("ellipse","|").concat(u,"|"):"".concat("arc","|").concat(a,"|").concat(s,"|").concat(l,"|").concat(u,"|"),!this.geometryInHash(t)){var h=new T.default.Geometry(u,1,function(){if(this.strokeIndices=[],a.toFixed(10)!==s.toFixed(10)){l!==d.PIE&&void 0!==l||(this.vertices.push(new T.default.Vector(.5,.5,0)),this.uvs.push([.5,.5]));for(var e=0;e<=u;e++){var t=(s-a)*(e/u)+a,r=.5+Math.cos(t)/2,i=.5+Math.sin(t)/2;this.vertices.push(new T.default.Vector(r,i,0)),this.uvs.push([r,i]),e>5&31)/31,(y>>10&31)/31):(r=a,i=s,l)}for(var b=1;b<=3;b++){var _=p+12*b,x=new S.default.Vector(u.getFloat32(_,!0),u.getFloat32(8+_,!0),u.getFloat32(4+_,!0));e.vertices.push(x),c&&o.push(r,i,n)}var w=new S.default.Vector(m,g,v);e.vertexNormals.push(w,w,w),e.faces.push([3*d,3*d+1,3*d+2]),e.uvs.push([0,0],[0,0],[0,0])}}(e,t);else{var r=new DataView(t);if(!("TextDecoder"in window))return console.warn("Sorry, ASCII STL loading only works in browsers that support TextDecoder (https://caniuse.com/#feat=textencoder)");var i=new TextDecoder("utf-8").decode(r).split("\n");!function(e,t){for(var r,i,n="",o=[],a=0;aMath.PI?l=Math.PI:l<=0&&(l=.001);var u=Math.sin(l)*a*Math.sin(s),h=Math.cos(l)*a,c=Math.sin(l)*a*Math.cos(s);this.camera(u+this.centerX,h+this.centerY,c+this.centerZ,this.centerX,this.centerY,this.centerZ,0,1,0)},m.default.Camera.prototype._isActive=function(){return this===this._renderer._curCamera},m.default.prototype.setCamera=function(e){this._renderer._curCamera=e,this._renderer.uPMatrix.set(e.projMatrix.mat4[0],e.projMatrix.mat4[1],e.projMatrix.mat4[2],e.projMatrix.mat4[3],e.projMatrix.mat4[4],e.projMatrix.mat4[5],e.projMatrix.mat4[6],e.projMatrix.mat4[7],e.projMatrix.mat4[8],e.projMatrix.mat4[9],e.projMatrix.mat4[10],e.projMatrix.mat4[11],e.projMatrix.mat4[12],e.projMatrix.mat4[13],e.projMatrix.mat4[14],e.projMatrix.mat4[15])};var n=m.default.Camera;r.default=n},{"../core/main":49}],98:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i,h=(i=e("../core/main"))&&i.__esModule?i:{default:i};h.default.Geometry=function(e,t,r){return this.vertices=[],this.lineVertices=[],this.lineNormals=[],this.vertexNormals=[],this.faces=[],this.uvs=[],this.edges=[],this.vertexColors=[],this.detailX=void 0!==e?e:1,this.detailY=void 0!==t?t:1,this.dirtyFlags={},r instanceof Function&&r.call(this),this},h.default.Geometry.prototype.reset=function(){this.lineVertices.length=0,this.lineNormals.length=0,this.vertices.length=0,this.edges.length=0,this.vertexColors.length=0,this.vertexNormals.length=0,this.uvs.length=0,this.dirtyFlags={}},h.default.Geometry.prototype.computeFaces=function(){this.faces.length=0;for(var e,t,r,i,n=this.detailX+1,o=0;othis.vertices.length-1-this.detailX;i--)e.add(this.vertexNormals[i]);e=h.default.Vector.div(e,this.detailX);for(var n=this.vertices.length-1;n>this.vertices.length-1-this.detailX;n--)this.vertexNormals[n]=e;return this},h.default.Geometry.prototype._makeTriangleEdges=function(){if(this.edges.length=0,Array.isArray(this.strokeIndices))for(var e=0,t=this.strokeIndices.length;e vTexCoord.y;\n bool y1 = p1.y > vTexCoord.y;\n bool y2 = p2.y > vTexCoord.y;\n\n // could web be under the curve (after t1)?\n if (y1 ? !y2 : y0) {\n // add the coverage for t1\n coverage.x += saturate(C1.x + 0.5);\n // calculate the anti-aliasing for t1\n weight.x = min(weight.x, abs(C1.x));\n }\n\n // are we outside the curve (after t2)?\n if (y1 ? !y0 : y2) {\n // subtract the coverage for t2\n coverage.x -= saturate(C2.x + 0.5);\n // calculate the anti-aliasing for t2\n weight.x = min(weight.x, abs(C2.x));\n }\n}\n\n// this is essentially the same as coverageX, but with the axes swapped\nvoid coverageY(vec2 p0, vec2 p1, vec2 p2) {\n\n vec2 C1, C2;\n calulateCrossings(p0, p1, p2, C1, C2);\n\n bool x0 = p0.x > vTexCoord.x;\n bool x1 = p1.x > vTexCoord.x;\n bool x2 = p2.x > vTexCoord.x;\n\n if (x1 ? !x2 : x0) {\n coverage.y -= saturate(C1.y + 0.5);\n weight.y = min(weight.y, abs(C1.y));\n }\n\n if (x1 ? !x0 : x2) {\n coverage.y += saturate(C2.y + 0.5);\n weight.y = min(weight.y, abs(C2.y));\n }\n}\n\nvoid main() {\n\n // calculate the pixel scale based on screen-coordinates\n pixelScale = hardness / fwidth(vTexCoord);\n\n // which grid cell is this pixel in?\n ivec2 gridCoord = ifloor(vTexCoord * vec2(uGridSize));\n\n // intersect curves in this row\n {\n // the index into the row info bitmap\n int rowIndex = gridCoord.y + uGridOffset.y;\n // fetch the info texel\n vec4 rowInfo = getTexel(uSamplerRows, rowIndex, uGridImageSize);\n // unpack the rowInfo\n int rowStrokeIndex = getInt16(rowInfo.xy);\n int rowStrokeCount = getInt16(rowInfo.zw);\n\n for (int iRowStroke = INT(0); iRowStroke < N; iRowStroke++) {\n if (iRowStroke >= rowStrokeCount)\n break;\n\n // each stroke is made up of 3 points: the start and control point\n // and the start of the next curve.\n // fetch the indices of this pair of strokes:\n vec4 strokeIndices = getTexel(uSamplerRowStrokes, rowStrokeIndex++, uCellsImageSize);\n\n // unpack the stroke index\n int strokePos = getInt16(strokeIndices.xy);\n\n // fetch the two strokes\n vec4 stroke0 = getTexel(uSamplerStrokes, strokePos + INT(0), uStrokeImageSize);\n vec4 stroke1 = getTexel(uSamplerStrokes, strokePos + INT(1), uStrokeImageSize);\n\n // calculate the coverage\n coverageX(stroke0.xy, stroke0.zw, stroke1.xy);\n }\n }\n\n // intersect curves in this column\n {\n int colIndex = gridCoord.x + uGridOffset.x;\n vec4 colInfo = getTexel(uSamplerCols, colIndex, uGridImageSize);\n int colStrokeIndex = getInt16(colInfo.xy);\n int colStrokeCount = getInt16(colInfo.zw);\n \n for (int iColStroke = INT(0); iColStroke < N; iColStroke++) {\n if (iColStroke >= colStrokeCount)\n break;\n\n vec4 strokeIndices = getTexel(uSamplerColStrokes, colStrokeIndex++, uCellsImageSize);\n\n int strokePos = getInt16(strokeIndices.xy);\n vec4 stroke0 = getTexel(uSamplerStrokes, strokePos + INT(0), uStrokeImageSize);\n vec4 stroke1 = getTexel(uSamplerStrokes, strokePos + INT(1), uStrokeImageSize);\n coverageY(stroke0.xy, stroke0.zw, stroke1.xy);\n }\n }\n\n weight = saturate(1.0 - weight * 2.0);\n float distance = max(weight.x + weight.y, minDistance); // manhattan approx.\n float antialias = abs(dot(coverage, weight) / distance);\n float cover = min(abs(coverage.x), abs(coverage.y));\n gl_FragColor = uMaterialColor;\n gl_FragColor.a *= saturate(max(antialias, cover));\n}",lineVert:"/*\n Part of the Processing project - http://processing.org\n Copyright (c) 2012-15 The Processing Foundation\n Copyright (c) 2004-12 Ben Fry and Casey Reas\n Copyright (c) 2001-04 Massachusetts Institute of Technology\n This library is free software; you can redistribute it and/or\n modify it under the terms of the GNU Lesser General Public\n License as published by the Free Software Foundation, version 2.1.\n This library is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n Lesser General Public License for more details.\n You should have received a copy of the GNU Lesser General\n Public License along with this library; if not, write to the\n Free Software Foundation, Inc., 59 Temple Place, Suite 330,\n Boston, MA 02111-1307 USA\n*/\n\n#define PROCESSING_LINE_SHADER\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform float uStrokeWeight;\n\nuniform vec4 uViewport;\nuniform int uPerspective;\n\nattribute vec4 aPosition;\nattribute vec4 aDirection;\n \nvoid main() {\n // using a scale <1 moves the lines towards the camera\n // in order to prevent popping effects due to half of\n // the line disappearing behind the geometry faces.\n vec3 scale = vec3(0.9995);\n\n vec4 posp = uModelViewMatrix * aPosition;\n vec4 posq = uModelViewMatrix * (aPosition + vec4(aDirection.xyz, 0));\n\n // Moving vertices slightly toward the camera\n // to avoid depth-fighting with the fill triangles.\n // Discussed here:\n // http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Number=252848 \n posp.xyz = posp.xyz * scale;\n posq.xyz = posq.xyz * scale;\n\n vec4 p = uProjectionMatrix * posp;\n vec4 q = uProjectionMatrix * posq;\n\n // formula to convert from clip space (range -1..1) to screen space (range 0..[width or height])\n // screen_p = (p.xy/p.w + <1,1>) * 0.5 * uViewport.zw\n\n // prevent division by W by transforming the tangent formula (div by 0 causes\n // the line to disappear, see https://github.com/processing/processing/issues/5183)\n // t = screen_q - screen_p\n //\n // tangent is normalized and we don't care which aDirection it points to (+-)\n // t = +- normalize( screen_q - screen_p )\n // t = +- normalize( (q.xy/q.w+<1,1>)*0.5*uViewport.zw - (p.xy/p.w+<1,1>)*0.5*uViewport.zw )\n //\n // extract common factor, <1,1> - <1,1> cancels out\n // t = +- normalize( (q.xy/q.w - p.xy/p.w) * 0.5 * uViewport.zw )\n //\n // convert to common divisor\n // t = +- normalize( ((q.xy*p.w - p.xy*q.w) / (p.w*q.w)) * 0.5 * uViewport.zw )\n //\n // remove the common scalar divisor/factor, not needed due to normalize and +-\n // (keep uViewport - can't remove because it has different components for x and y\n // and corrects for aspect ratio, see https://github.com/processing/processing/issues/5181)\n // t = +- normalize( (q.xy*p.w - p.xy*q.w) * uViewport.zw )\n\n vec2 tangent = normalize((q.xy*p.w - p.xy*q.w) * uViewport.zw);\n\n // flip tangent to normal (it's already normalized)\n vec2 normal = vec2(-tangent.y, tangent.x);\n\n float thickness = aDirection.w * uStrokeWeight;\n vec2 offset = normal * thickness / 2.0;\n\n vec2 curPerspScale;\n\n if(uPerspective == 1) {\n // Perspective ---\n // convert from world to clip by multiplying with projection scaling factor\n // to get the right thickness (see https://github.com/processing/processing/issues/5182)\n // invert Y, projections in Processing invert Y\n curPerspScale = (uProjectionMatrix * vec4(1, -1, 0, 0)).xy;\n } else {\n // No Perspective ---\n // multiply by W (to cancel out division by W later in the pipeline) and\n // convert from screen to clip (derived from clip to screen above)\n curPerspScale = p.w / (0.5 * uViewport.zw);\n }\n\n gl_Position.xy = p.xy + offset.xy * curPerspScale;\n gl_Position.zw = p.zw;\n}\n",lineFrag:"precision mediump float;\nprecision mediump int;\n\nuniform vec4 uMaterialColor;\n\nvoid main() {\n gl_FragColor = uMaterialColor;\n}",pointVert:"attribute vec3 aPosition;\nuniform float uPointSize;\nvarying float vStrokeWeight;\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nvoid main() {\n\tvec4 positionVec4 = vec4(aPosition, 1.0);\n\tgl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n\tgl_PointSize = uPointSize;\n\tvStrokeWeight = uPointSize;\n}",pointFrag:"precision mediump float;\nprecision mediump int;\nuniform vec4 uMaterialColor;\nvarying float vStrokeWeight;\n\nvoid main(){\n\tfloat mask = 0.0;\n\n\t// make a circular mask using the gl_PointCoord (goes from 0 - 1 on a point)\n // might be able to get a nicer edge on big strokeweights with smoothstep but slightly less performant\n\n\tmask = step(0.98, length(gl_PointCoord * 2.0 - 1.0));\n\n\t// if strokeWeight is 1 or less lets just draw a square\n\t// this prevents weird artifacting from carving circles when our points are really small\n\t// if strokeWeight is larger than 1, we just use it as is\n\n\tmask = mix(0.0, mask, clamp(floor(vStrokeWeight - 0.5),0.0,1.0));\n\n\t// throw away the borders of the mask\n // otherwise we get weird alpha blending issues\n\n\tif(mask > 0.98){\n discard;\n \t}\n\n \tgl_FragColor = vec4(uMaterialColor.rgb * (1.0 - mask), uMaterialColor.a) ;\n}"};u.default.RendererGL=function(e,t,r,i){return u.default.Renderer.call(this,e,t,r),this._setAttributeDefaults(t),this._initContext(),this.isP3D=!0,this.GL=this.drawingContext,this._isErasing=!1,this._enableLighting=!1,this.ambientLightColors=[],this.specularColors=[1,1,1],this.directionalLightDirections=[],this.directionalLightDiffuseColors=[],this.directionalLightSpecularColors=[],this.pointLightPositions=[],this.pointLightDiffuseColors=[],this.pointLightSpecularColors=[],this.spotLightPositions=[],this.spotLightDirections=[],this.spotLightDiffuseColors=[],this.spotLightSpecularColors=[],this.spotLightAngle=[],this.spotLightConc=[],this.drawMode=o.FILL,this.curFillColor=this._cachedFillStyle=[1,1,1,1],this.curStrokeColor=this._cachedStrokeStyle=[0,0,0,1],this.curBlendMode=o.BLEND,this._cachedBlendMode=void 0,this.blendExt=this.GL.getExtension("EXT_blend_minmax"),this._isBlending=!1,this._useSpecularMaterial=!1,this._useEmissiveMaterial=!1,this._useNormalMaterial=!1,this._useShininess=1,this._tint=[255,255,255,255],this.constantAttenuation=1,this.linearAttenuation=0,this.quadraticAttenuation=0,this.uMVMatrix=new u.default.Matrix,this.uPMatrix=new u.default.Matrix,this.uNMatrix=new u.default.Matrix("mat3"),this._curCamera=new u.default.Camera(this),this._curCamera._computeCameraDefaultSettings(),this._curCamera._setDefaultCamera(),this._defaultLightShader=void 0,this._defaultImmediateModeShader=void 0,this._defaultNormalShader=void 0,this._defaultColorShader=void 0,this._defaultPointShader=void 0,this.userFillShader=void 0,this.userStrokeShader=void 0,this.userPointShader=void 0,this.retainedMode={geometry:{},buffers:{stroke:[new u.default.RenderBuffer(3,"lineVertices","lineVertexBuffer","aPosition",this,this._flatten),new u.default.RenderBuffer(4,"lineNormals","lineNormalBuffer","aDirection",this,this._flatten)],fill:[new u.default.RenderBuffer(3,"vertices","vertexBuffer","aPosition",this,this._vToNArray),new u.default.RenderBuffer(3,"vertexNormals","normalBuffer","aNormal",this,this._vToNArray),new u.default.RenderBuffer(4,"vertexColors","colorBuffer","aMaterialColor",this),new u.default.RenderBuffer(3,"vertexAmbients","ambientBuffer","aAmbientColor",this),new u.default.RenderBuffer(2,"uvs","uvBuffer","aTexCoord",this,this._flatten)],text:[new u.default.RenderBuffer(3,"vertices","vertexBuffer","aPosition",this,this._vToNArray),new u.default.RenderBuffer(2,"uvs","uvBuffer","aTexCoord",this,this._flatten)]}},this.immediateMode={geometry:new u.default.Geometry,shapeMode:o.TRIANGLE_FAN,_bezierVertex:[],_quadraticVertex:[],_curveVertex:[],buffers:{fill:[new u.default.RenderBuffer(3,"vertices","vertexBuffer","aPosition",this,this._vToNArray),new u.default.RenderBuffer(3,"vertexNormals","normalBuffer","aNormal",this,this._vToNArray),new u.default.RenderBuffer(4,"vertexColors","colorBuffer","aVertexColor",this),new u.default.RenderBuffer(3,"vertexAmbients","ambientBuffer","aAmbientColor",this),new u.default.RenderBuffer(2,"uvs","uvBuffer","aTexCoord",this,this._flatten)],stroke:[new u.default.RenderBuffer(3,"lineVertices","lineVertexBuffer","aPosition",this,this._flatten),new u.default.RenderBuffer(4,"lineNormals","lineNormalBuffer","aDirection",this,this._flatten)],point:this.GL.createBuffer()}},this.pointSize=5,this.curStrokeWeight=1,this.textures=[],this.textureMode=o.IMAGE,this.textureWrapX=o.CLAMP,this.textureWrapY=o.CLAMP,this._tex=null,this._curveTightness=6,this._lookUpTableBezier=[],this._lookUpTableQuadratic=[],this._lutBezierDetail=0,this._lutQuadraticDetail=0,this._tessy=this._initTessy(),this.fontInfos={},this._curShader=void 0,this},u.default.RendererGL.prototype=Object.create(u.default.Renderer.prototype),u.default.RendererGL.prototype._setAttributeDefaults=function(e){var t={alpha:!0,depth:!0,stencil:!0,antialias:navigator.userAgent.toLowerCase().includes("safari"),premultipliedAlpha:!1,preserveDrawingBuffer:!0,perPixelLighting:!0};null===e._glAttributes?e._glAttributes=t:e._glAttributes=Object.assign(t,e._glAttributes)},u.default.RendererGL.prototype._initContext=function(){try{if(this.drawingContext=this.canvas.getContext("webgl",this._pInst._glAttributes)||this.canvas.getContext("experimental-webgl",this._pInst._glAttributes),null===this.drawingContext)throw new Error("Error creating webgl context");var e=this.drawingContext;e.enable(e.DEPTH_TEST),e.depthFunc(e.LEQUAL),e.viewport(0,0,e.drawingBufferWidth,e.drawingBufferHeight),this._viewport=this.drawingContext.getParameter(this.drawingContext.VIEWPORT)}catch(e){throw e}},u.default.RendererGL.prototype._resetContext=function(e,t){var r=this.width,i=this.height,n=this.canvas.id,o=this._pInst instanceof u.default.Graphics;if(o){var a=this._pInst;a.canvas.parentNode.removeChild(a.canvas),a.canvas=document.createElement("canvas"),(a._pInst._userNode||document.body).appendChild(a.canvas),u.default.Element.call(a,a.canvas,a._pInst),a.width=r,a.height=i}else{var s=this.canvas;s&&s.parentNode.removeChild(s),(s=document.createElement("canvas")).id=n,this._pInst._userNode?this._pInst._userNode.appendChild(s):document.body.appendChild(s),this._pInst.canvas=s}var l=new u.default.RendererGL(this._pInst.canvas,this._pInst,!o);this._pInst._setProperty("_renderer",l),l.resize(r,i),l._applyDefaults(),o||this._pInst._elements.push(l),"function"==typeof t&&setTimeout(function(){t.apply(window._renderer,e)},0)},u.default.prototype.setAttributes=function(e,t){if(void 0!==this._glAttributes){var r=!0;if(void 0!==t?(null===this._glAttributes&&(this._glAttributes={}),this._glAttributes[e]!==t&&(this._glAttributes[e]=t,r=!1)):e instanceof Object&&this._glAttributes!==e&&(this._glAttributes=e,r=!1),this._renderer.isP3D&&!r){if(!this._setupDone)for(var i in this._renderer.retainedMode.geometry)if(this._renderer.retainedMode.geometry.hasOwnProperty(i))return void console.error("Sorry, Could not set the attributes, you need to call setAttributes() before calling the other drawing methods in setup()");this.push(),this._renderer._resetContext(),this.pop(),this._renderer._curCamera&&(this._renderer._curCamera._renderer=this._renderer)}}else console.log("You are trying to use setAttributes on a p5.Graphics object that does not use a WEBGL renderer.")},u.default.RendererGL.prototype._update=function(){this.uMVMatrix.set(this._curCamera.cameraMatrix.mat4[0],this._curCamera.cameraMatrix.mat4[1],this._curCamera.cameraMatrix.mat4[2],this._curCamera.cameraMatrix.mat4[3],this._curCamera.cameraMatrix.mat4[4],this._curCamera.cameraMatrix.mat4[5],this._curCamera.cameraMatrix.mat4[6],this._curCamera.cameraMatrix.mat4[7],this._curCamera.cameraMatrix.mat4[8],this._curCamera.cameraMatrix.mat4[9],this._curCamera.cameraMatrix.mat4[10],this._curCamera.cameraMatrix.mat4[11],this._curCamera.cameraMatrix.mat4[12],this._curCamera.cameraMatrix.mat4[13],this._curCamera.cameraMatrix.mat4[14],this._curCamera.cameraMatrix.mat4[15]),this.ambientLightColors.length=0,this.specularColors=[1,1,1],this.directionalLightDirections.length=0,this.directionalLightDiffuseColors.length=0,this.directionalLightSpecularColors.length=0,this.pointLightPositions.length=0,this.pointLightDiffuseColors.length=0,this.pointLightSpecularColors.length=0,this.spotLightPositions.length=0,this.spotLightDirections.length=0,this.spotLightDiffuseColors.length=0,this.spotLightSpecularColors.length=0,this.spotLightAngle.length=0,this.spotLightConc.length=0,this._enableLighting=!1,this._tint=[255,255,255,255],this.GL.clear(this.GL.DEPTH_BUFFER_BIT)},u.default.RendererGL.prototype.background=function(){var e,t=(e=this._pInst).color.apply(e,arguments),r=t.levels[0]/255,i=t.levels[1]/255,n=t.levels[2]/255,o=t.levels[3]/255;this.GL.clearColor(r,i,n,o),this.GL.clear(this.GL.COLOR_BUFFER_BIT)},u.default.RendererGL.prototype.fill=function(e,t,r,i){var n=u.default.prototype.color.apply(this._pInst,arguments);this.curFillColor=n._array,this.drawMode=o.FILL,this._useNormalMaterial=!1,this._tex=null},u.default.RendererGL.prototype.stroke=function(e,t,r,i){arguments[3]=255;var n=u.default.prototype.color.apply(this._pInst,arguments);this.curStrokeColor=n._array},u.default.RendererGL.prototype.strokeCap=function(e){console.error("Sorry, strokeCap() is not yet implemented in WEBGL mode")},u.default.RendererGL.prototype.strokeJoin=function(e){console.error("Sorry, strokeJoin() is not yet implemented in WEBGL mode")},u.default.RendererGL.prototype.filter=function(e){console.error("filter() does not work in WEBGL mode")},u.default.RendererGL.prototype.blendMode=function(e){e===o.DARKEST||e===o.LIGHTEST||e===o.ADD||e===o.BLEND||e===o.SUBTRACT||e===o.SCREEN||e===o.EXCLUSION||e===o.REPLACE||e===o.MULTIPLY||e===o.REMOVE?this.curBlendMode=e:e!==o.BURN&&e!==o.OVERLAY&&e!==o.HARD_LIGHT&&e!==o.SOFT_LIGHT&&e!==o.DODGE||console.warn("BURN, OVERLAY, HARD_LIGHT, SOFT_LIGHT, and DODGE only work for blendMode in 2D mode.")},u.default.RendererGL.prototype.erase=function(e,t){this._isErasing||(this._cachedBlendMode=this.curBlendMode,this.blendMode(o.REMOVE),this._cachedFillStyle=this.curFillColor.slice(),this.curFillColor=[1,1,1,e/255],this._cachedStrokeStyle=this.curStrokeColor.slice(),this.curStrokeColor=[1,1,1,t/255],this._isErasing=!0)},u.default.RendererGL.prototype.noErase=function(){this._isErasing&&(this.curFillColor=this._cachedFillStyle.slice(),this.curStrokeColor=this._cachedStrokeStyle.slice(),this.blendMode(this._cachedBlendMode),this._isErasing=!1)},u.default.RendererGL.prototype.strokeWeight=function(e){this.curStrokeWeight!==e&&(this.pointSize=e,this.curStrokeWeight=e)},u.default.RendererGL.prototype._getPixel=function(e,t){var r;return r=new Uint8Array(4),this.drawingContext.readPixels(e,t,1,1,this.drawingContext.RGBA,this.drawingContext.UNSIGNED_BYTE,r),[r[0],r[1],r[2],r[3]]},u.default.RendererGL.prototype.loadPixels=function(){var e=this._pixelsState;if(!0===this._pInst._glAttributes.preserveDrawingBuffer){var t=e.pixels,r=this.GL.drawingBufferWidth*this.GL.drawingBufferHeight*4;t instanceof Uint8Array&&t.length===r||(t=new Uint8Array(r),this._pixelsState._setProperty("pixels",t));var i=this._pInst._pixelDensity;this.GL.readPixels(0,0,this.width*i,this.height*i,this.GL.RGBA,this.GL.UNSIGNED_BYTE,t)}else console.log("loadPixels only works in WebGL when preserveDrawingBuffer is true.")},u.default.RendererGL.prototype.geometryInHash=function(e){return void 0!==this.retainedMode.geometry[e]},u.default.RendererGL.prototype.resize=function(e,t){u.default.Renderer.prototype.resize.call(this,e,t),this.GL.viewport(0,0,this.GL.drawingBufferWidth,this.GL.drawingBufferHeight),this._viewport=this.GL.getParameter(this.GL.VIEWPORT),this._curCamera._resize();var r=this._pixelsState;void 0!==r.pixels&&r._setProperty("pixels",new Uint8Array(this.GL.drawingBufferWidth*this.GL.drawingBufferHeight*4))},u.default.RendererGL.prototype.clear=function(){var e=(arguments.length<=0?void 0:arguments[0])||0,t=(arguments.length<=1?void 0:arguments[1])||0,r=(arguments.length<=2?void 0:arguments[2])||0,i=(arguments.length<=3?void 0:arguments[3])||0;this.GL.clearColor(e,t,r,i),this.GL.clear(this.GL.COLOR_BUFFER_BIT|this.GL.DEPTH_BUFFER_BIT)},u.default.RendererGL.prototype.applyMatrix=function(e,t,r,i,n,o){16===arguments.length?u.default.Matrix.prototype.apply.apply(this.uMVMatrix,arguments):this.uMVMatrix.apply([e,t,0,0,r,i,0,0,0,0,1,0,n,o,0,1])},u.default.RendererGL.prototype.translate=function(e,t,r){return e instanceof u.default.Vector&&(r=e.z,t=e.y,e=e.x),this.uMVMatrix.translate([e,t,r]),this},u.default.RendererGL.prototype.scale=function(e,t,r){return this.uMVMatrix.scale(e,t,r),this},u.default.RendererGL.prototype.rotate=function(e,t){return void 0===t?this.rotateZ(e):(u.default.Matrix.prototype.rotate.apply(this.uMVMatrix,arguments),this)},u.default.RendererGL.prototype.rotateX=function(e){return this.rotate(e,1,0,0),this},u.default.RendererGL.prototype.rotateY=function(e){return this.rotate(e,0,1,0),this},u.default.RendererGL.prototype.rotateZ=function(e){return this.rotate(e,0,0,1),this},u.default.RendererGL.prototype.push=function(){var e=u.default.Renderer.prototype.push.apply(this),t=e.properties;return t.uMVMatrix=this.uMVMatrix.copy(),t.uPMatrix=this.uPMatrix.copy(),t._curCamera=this._curCamera,this._curCamera=this._curCamera.copy(),t.ambientLightColors=this.ambientLightColors.slice(),t.specularColors=this.specularColors.slice(),t.directionalLightDirections=this.directionalLightDirections.slice(),t.directionalLightDiffuseColors=this.directionalLightDiffuseColors.slice(),t.directionalLightSpecularColors=this.directionalLightSpecularColors.slice(),t.pointLightPositions=this.pointLightPositions.slice(),t.pointLightDiffuseColors=this.pointLightDiffuseColors.slice(),t.pointLightSpecularColors=this.pointLightSpecularColors.slice(),t.spotLightPositions=this.spotLightPositions.slice(),t.spotLightDirections=this.spotLightDirections.slice(),t.spotLightDiffuseColors=this.spotLightDiffuseColors.slice(),t.spotLightSpecularColors=this.spotLightSpecularColors.slice(),t.spotLightAngle=this.spotLightAngle.slice(),t.spotLightConc=this.spotLightConc.slice(),t.userFillShader=this.userFillShader,t.userStrokeShader=this.userStrokeShader,t.userPointShader=this.userPointShader,t.pointSize=this.pointSize,t.curStrokeWeight=this.curStrokeWeight,t.curStrokeColor=this.curStrokeColor,t.curFillColor=this.curFillColor,t._useSpecularMaterial=this._useSpecularMaterial,t._useEmissiveMaterial=this._useEmissiveMaterial,t._useShininess=this._useShininess,t.constantAttenuation=this.constantAttenuation,t.linearAttenuation=this.linearAttenuation,t.quadraticAttenuation=this.quadraticAttenuation,t._enableLighting=this._enableLighting,t._useNormalMaterial=this._useNormalMaterial,t._tex=this._tex,t.drawMode=this.drawMode,e},u.default.RendererGL.prototype.resetMatrix=function(){return this.uMVMatrix=u.default.Matrix.identity(this._pInst),this},u.default.RendererGL.prototype._getImmediateStrokeShader=function(){var e=this.userStrokeShader;return e&&e.isStrokeShader()?e:this._getLineShader()},u.default.RendererGL.prototype._getRetainedStrokeShader=u.default.RendererGL.prototype._getImmediateStrokeShader,u.default.RendererGL.prototype._getImmediateFillShader=function(){var e=this.userFillShader;if(this._useNormalMaterial&&(!e||!e.isNormalShader()))return this._getNormalShader();if(this._enableLighting){if(!e||!e.isLightShader())return this._getLightShader()}else if(this._tex){if(!e||!e.isTextureShader())return this._getLightShader()}else if(!e)return this._getImmediateModeShader();return e},u.default.RendererGL.prototype._getRetainedFillShader=function(){if(this._useNormalMaterial)return this._getNormalShader();var e=this.userFillShader;if(this._enableLighting){if(!e||!e.isLightShader())return this._getLightShader()}else if(this._tex){if(!e||!e.isTextureShader())return this._getLightShader()}else if(!e)return this._getColorShader();return e},u.default.RendererGL.prototype._getImmediatePointShader=function(){var e=this.userPointShader;return e&&e.isPointShader()?e:this._getPointShader()},u.default.RendererGL.prototype._getRetainedLineShader=u.default.RendererGL.prototype._getImmediateLineShader,u.default.RendererGL.prototype._getLightShader=function(){return this._defaultLightShader||(this._pInst._glAttributes.perPixelLighting?this._defaultLightShader=new u.default.Shader(this,c.phongVert,c.phongFrag):this._defaultLightShader=new u.default.Shader(this,c.lightVert,c.lightTextureFrag)),this._defaultLightShader},u.default.RendererGL.prototype._getImmediateModeShader=function(){return this._defaultImmediateModeShader||(this._defaultImmediateModeShader=new u.default.Shader(this,c.immediateVert,c.vertexColorFrag)),this._defaultImmediateModeShader},u.default.RendererGL.prototype._getNormalShader=function(){return this._defaultNormalShader||(this._defaultNormalShader=new u.default.Shader(this,c.normalVert,c.normalFrag)),this._defaultNormalShader},u.default.RendererGL.prototype._getColorShader=function(){return this._defaultColorShader||(this._defaultColorShader=new u.default.Shader(this,c.normalVert,c.basicFrag)),this._defaultColorShader},u.default.RendererGL.prototype._getPointShader=function(){return this._defaultPointShader||(this._defaultPointShader=new u.default.Shader(this,c.pointVert,c.pointFrag)),this._defaultPointShader},u.default.RendererGL.prototype._getLineShader=function(){return this._defaultLineShader||(this._defaultLineShader=new u.default.Shader(this,c.lineVert,c.lineFrag)),this._defaultLineShader},u.default.RendererGL.prototype._getFontShader=function(){return this._defaultFontShader||(this.GL.getExtension("OES_standard_derivatives"),this._defaultFontShader=new u.default.Shader(this,c.fontVert,c.fontFrag)),this._defaultFontShader},u.default.RendererGL.prototype._getEmptyTexture=function(){if(!this._emptyTexture){var e=new u.default.Image(1,1);e.set(0,0,255),this._emptyTexture=new u.default.Texture(this,e)}return this._emptyTexture},u.default.RendererGL.prototype.getTexture=function(e){var t=this.textures,r=!0,i=!1,n=void 0;try{for(var o,a=t[Symbol.iterator]();!(r=(o=a.next()).done);r=!0){var s=o.value;if(s.src===e)return s}}catch(e){i=!0,n=e}finally{try{r||null==a.return||a.return()}finally{if(i)throw n}}var l=new u.default.Texture(this,e);return t.push(l),l},u.default.RendererGL.prototype._setStrokeUniforms=function(e){e.bindShader(),e.setUniform("uMaterialColor",this.curStrokeColor),e.setUniform("uStrokeWeight",this.curStrokeWeight)},u.default.RendererGL.prototype._setFillUniforms=function(e){e.bindShader(),e.setUniform("uMaterialColor",this.curFillColor),e.setUniform("isTexture",!!this._tex),this._tex&&e.setUniform("uSampler",this._tex),e.setUniform("uTint",this._tint),e.setUniform("uSpecular",this._useSpecularMaterial),e.setUniform("uEmissive",this._useEmissiveMaterial),e.setUniform("uShininess",this._useShininess),e.setUniform("uUseLighting",this._enableLighting);var t=this.pointLightDiffuseColors.length/3;e.setUniform("uPointLightCount",t),e.setUniform("uPointLightLocation",this.pointLightPositions),e.setUniform("uPointLightDiffuseColors",this.pointLightDiffuseColors),e.setUniform("uPointLightSpecularColors",this.pointLightSpecularColors);var r=this.directionalLightDiffuseColors.length/3;e.setUniform("uDirectionalLightCount",r),e.setUniform("uLightingDirection",this.directionalLightDirections),e.setUniform("uDirectionalDiffuseColors",this.directionalLightDiffuseColors),e.setUniform("uDirectionalSpecularColors",this.directionalLightSpecularColors);var i=this.ambientLightColors.length/3;e.setUniform("uAmbientLightCount",i),e.setUniform("uAmbientColor",this.ambientLightColors);var n=this.spotLightDiffuseColors.length/3;e.setUniform("uSpotLightCount",n),e.setUniform("uSpotLightAngle",this.spotLightAngle),e.setUniform("uSpotLightConc",this.spotLightConc),e.setUniform("uSpotLightDiffuseColors",this.spotLightDiffuseColors),e.setUniform("uSpotLightSpecularColors",this.spotLightSpecularColors),e.setUniform("uSpotLightLocation",this.spotLightPositions),e.setUniform("uSpotLightDirection",this.spotLightDirections),e.setUniform("uConstantAttenuation",this.constantAttenuation),e.setUniform("uLinearAttenuation",this.linearAttenuation),e.setUniform("uQuadraticAttenuation",this.quadraticAttenuation),e.bindTextures()},u.default.RendererGL.prototype._setPointUniforms=function(e){e.bindShader(),e.setUniform("uMaterialColor",this.curStrokeColor),e.setUniform("uPointSize",this.pointSize)},u.default.RendererGL.prototype._bindBuffer=function(e,t,r,i,n){if(t=t||this.GL.ARRAY_BUFFER,this.GL.bindBuffer(t,e),void 0!==r){var o=new(i||Float32Array)(r);this.GL.bufferData(t,o,n||this.GL.STATIC_DRAW)}},u.default.RendererGL.prototype._arraysEqual=function(e,t){var r=e.length;if(r!==t.length)return!1;for(var i=0;i>7,127&f,c>>7,127&c);for(var d=0;d>7,127&p,0,0)}}return{cellImageInfo:l,dimOffset:o,dimImageInfo:n}}return(t=this.glyphInfos[e.index]={glyph:e,uGlyphRect:[i.x1,-i.y1,i.x2,-i.y2],strokeImageInfo:U,strokes:d,colInfo:G(m,this.colDimImageInfos,this.colCellImageInfos),rowInfo:G(p,this.rowDimImageInfos,this.rowCellImageInfos)}).uGridOffset=[t.colInfo.dimOffset,t.rowInfo.dimOffset],t}}var z=Math.sqrt(3);j.default.RendererGL.prototype._renderText=function(e,t,r,i,n){if(this._textFont&&"string"!=typeof this._textFont){if(!(n<=i)&&this._doFill){if(!this._isOpenType())return console.log("WEBGL: only Opentype (.otf) and Truetype (.ttf) fonts are supported"),e;e.push();var o=this._doStroke,a=this.drawMode;this._doStroke=!1,this.drawMode=D.TEXTURE;var s=this._textFont.font,l=this._textFont._fontInfo;l=l||(this._textFont._fontInfo=new A(s));var u=this._textFont._handleAlignment(this,t,r,i),h=this._textSize/s.unitsPerEm;this.translate(u.x,u.y,0),this.scale(h,h,1);var c=this.GL,f=!this._defaultFontShader,d=this._getFontShader();d.init(),d.bindShader(),f&&(d.setUniform("uGridImageSize",[64,64]),d.setUniform("uCellsImageSize",[64,64]),d.setUniform("uStrokeImageSize",[64,64]),d.setUniform("uGridSize",[9,9])),this._applyColorBlend(this.curFillColor);var p=this.retainedMode.geometry.glyph;if(!p){var m=this._textGeom=new j.default.Geometry(1,1,function(){for(var e=0;e<=1;e++)for(var t=0;t<=1;t++)this.vertices.push(new j.default.Vector(t,e,0)),this.uvs.push(t,e)});m.computeFaces().computeNormals(),p=this.createBuffers("glyph",m)}var g=!0,v=!1,y=void 0;try{for(var b,_=this.retainedMode.buffers.text[Symbol.iterator]();!(g=(b=_.next()).done);g=!0){b.value._prepareBuffer(p,d)}}catch(e){v=!0,y=e}finally{try{g||null==_.return||_.return()}finally{if(v)throw y}}this._bindBuffer(p.indexBuffer,c.ELEMENT_ARRAY_BUFFER),d.setUniform("uMaterialColor",this.curFillColor);try{var x=0,w=null,S=s.stringToGlyphs(t),M=!0,E=!1,T=void 0;try{for(var C,P=S[Symbol.iterator]();!(M=(C=P.next()).done);M=!0){var L=C.value;w&&(x+=s.getKerningValue(w,L));var k=l.getGlyphInfo(L);if(k.uGlyphRect){var R=k.rowInfo,O=k.colInfo;d.setUniform("uSamplerStrokes",k.strokeImageInfo.imageData),d.setUniform("uSamplerRowStrokes",R.cellImageInfo.imageData),d.setUniform("uSamplerRows",R.dimImageInfo.imageData),d.setUniform("uSamplerColStrokes",O.cellImageInfo.imageData),d.setUniform("uSamplerCols",O.dimImageInfo.imageData),d.setUniform("uGridOffset",k.uGridOffset),d.setUniform("uGlyphRect",k.uGlyphRect),d.setUniform("uGlyphOffset",x),d.bindTextures(),c.drawElements(c.TRIANGLES,6,this.GL.UNSIGNED_SHORT,0)}x+=L.advanceWidth,w=L}}catch(e){E=!0,T=e}finally{try{M||null==P.return||P.return()}finally{if(E)throw T}}}finally{d.unbindShader(),this._doStroke=o,this.drawMode=a,e.pop()}return e}}else console.log("WEBGL: you must load and set a font before drawing text. See `loadFont` and `textFont` for more details.")}},{"../core/constants":42,"../core/main":49,"./p5.RendererGL.Retained":102,"./p5.Shader":104}],107:[function(e,t,r){t.exports={fes:{autoplay:"The media that tried to play (with '{{src}}') wasn't allowed to by this browser, most likely due to the browser's autoplay policy. Check out {{link}} for more information about why.",fileLoadError:{bytes:"It looks like there was a problem loading your file. {{suggestion}}",font:"It looks like there was a problem loading your font. {{suggestion}}",gif:"There was some trouble loading your GIF. Make sure that your GIF is using 87a or 89a encoding.",image:"It looks like there was a problem loading your image. {{suggestion}}",json:"It looks like there was a problem loading your JSON file. {{suggestion}}",large:"If your large file isn't fetched successfully, we recommend splitting the file into smaller segments and fetching those.",strings:"It looks like there was a problem loading your text file. {{suggestion}}",suggestion:"Try checking if the file path ({{filePath}}) is correct, hosting the file online, or running a local server. (More info at {{link}})",table:"It looks like there was a problem loading your table file. {{suggestion}}",xml:"It looks like there was a problem loading your XML file. {{suggestion}}"},misusedTopLevel:"Did you just try to use p5.js's {{symbolName}} {{symbolType}}? If so, you may want to move it into your sketch's setup() function.\n\nFor more details, see: {{link}}",pre:"🌸 p5.js says: {{message}}",welcome:"Welcome! This is your friendly debugger. To turn me off, switch to using p5.min.js."}}},{}],108:[function(e,t,r){t.exports={fes:{autoplay:"Su browser impidío un medio tocar (de '{{src}}'), posiblemente porque las reglas de autoplay. Para aprender más, visite {{link}}.",fileLoadError:{bytes:"",font:"",gif:"",image:"",json:"",large:"",strings:"",suggestion:"",table:"",xml:""},misusedTopLevel:"",pre:"🌸 p5.js dice: {{message}}",welcome:""}}},{}],109:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i=o(e("./en/translation")),n=o(e("./es/translation"));function o(e){return e&&e.__esModule?e:{default:e}}var a={en:{translation:i.default},es:{translation:n.default}};r.default=a},{"./en/translation":107,"./es/translation":108}]},{},[37])(37)}); ================================================ FILE: docs/examples/pyodide/bouncing/target/target_sketch.js ================================================ const wrapperContent = ` class PythonFunctions: pass setattr(PythonFunctions, 'map', map) setattr(PythonFunctions, 'filter', filter) setattr(PythonFunctions, 'set', set) _P5_INSTANCE = None _CTX_MIDDLE = None _DEFAULT_FILL = None _DEFAULT_LEADMULT = None _DEFAULT_STROKE = None _DEFAULT_TEXT_FILL = None ADD = None ALT = None ARROW = None AUDIO = None AUTO = None AXES = None BACKSPACE = None BASELINE = None BEVEL = None BEZIER = None BLEND = None BLUR = None BOLD = None BOLDITALIC = None BOTTOM = None BURN = None CENTER = None CHORD = None CLAMP = None CLOSE = None CONTROL = None CORNER = None CORNERS = None CROSS = None CURVE = None DARKEST = None DEG_TO_RAD = None DEGREES = None DELETE = None DIFFERENCE = None DILATE = None DODGE = None DOWN_ARROW = None ENTER = None ERODE = None ESCAPE = None EXCLUSION = None FILL = None GRAY = None GRID = None HALF_PI = None HAND = None HARD_LIGHT = None HSB = None HSL = None IMAGE = None IMMEDIATE = None INVERT = None ITALIC = None LANDSCAPE = None LEFT = None LEFT_ARROW = None LIGHTEST = None LINE_LOOP = None LINE_STRIP = None LINEAR = None LINES = None MIRROR = None MITER = None MOVE = None MULTIPLY = None NEAREST = None NORMAL = None OPAQUE = None OPEN = None OPTION = None OVERLAY = None PI = None PIE = None POINTS = None PORTRAIT = None POSTERIZE = None PROJECT = None QUAD_STRIP = None QUADRATIC = None QUADS = None QUARTER_PI = None RAD_TO_DEG = None RADIANS = None RADIUS = None REPEAT = None REPLACE = None RETURN = None RGB = None RIGHT = None RIGHT_ARROW = None ROUND = None SCREEN = None SHIFT = None SOFT_LIGHT = None SQUARE = None STROKE = None SUBTRACT = None TAB = None TAU = None TEXT = None TEXTURE = None THRESHOLD = None TOP = None TRIANGLE_FAN = None TRIANGLE_STRIP = None TRIANGLES = None TWO_PI = None UP_ARROW = None VIDEO = None WAIT = None WEBGL = None P2D = None PI = None frameCount = None focused = None displayWidth = None displayHeight = None windowWidth = None windowHeight = None width = None height = None deviceOrientation = None accelerationX = None accelerationY = None accelerationZ = None pAccelerationX = None pAccelerationY = None pAccelerationZ = None rotationX = None rotationY = None rotationZ = None pRotationX = None pRotationY = None pRotationZ = None turnAxis = None keyIsPressed = None key = None keyCode = None mouseX = None mouseY = None pmouseX = None pmouseY = None winMouseX = None winMouseY = None pwinMouseX = None pwinMouseY = None mouseButton = None mouseIsPressed = None touches = None pixels = None def alpha(*args): return _P5_INSTANCE.alpha(*args) def blue(*args): return _P5_INSTANCE.blue(*args) def brightness(*args): return _P5_INSTANCE.brightness(*args) def color(*args): return _P5_INSTANCE.color(*args) def green(*args): return _P5_INSTANCE.green(*args) def hue(*args): return _P5_INSTANCE.hue(*args) def lerpColor(*args): return _P5_INSTANCE.lerpColor(*args) def lightness(*args): return _P5_INSTANCE.lightness(*args) def red(*args): return _P5_INSTANCE.red(*args) def saturation(*args): return _P5_INSTANCE.saturation(*args) def background(*args): return _P5_INSTANCE.background(*args) def clear(*args): p5_clear = _P5_INSTANCE.clear(*args) return p5_clear def erase(*args): return _P5_INSTANCE.erase(*args) def noErase(*args): return _P5_INSTANCE.noErase(*args) def colorMode(*args): return _P5_INSTANCE.colorMode(*args) def fill(*args): return _P5_INSTANCE.fill(*args) def noFill(*args): return _P5_INSTANCE.noFill(*args) def noStroke(*args): return _P5_INSTANCE.noStroke(*args) def stroke(*args): return _P5_INSTANCE.stroke(*args) def arc(*args): return _P5_INSTANCE.arc(*args) def ellipse(*args): return _P5_INSTANCE.ellipse(*args) def circle(*args): return _P5_INSTANCE.circle(*args) def line(*args): return _P5_INSTANCE.line(*args) def point(*args): return _P5_INSTANCE.point(*args) def quad(*args): return _P5_INSTANCE.quad(*args) def rect(*args): return _P5_INSTANCE.rect(*args) def square(*args): return _P5_INSTANCE.square(*args) def triangle(*args): return _P5_INSTANCE.triangle(*args) def plane(*args): return _P5_INSTANCE.plane(*args) def box(*args): return _P5_INSTANCE.box(*args) def sphere(*args): return _P5_INSTANCE.sphere(*args) def cylinder(*args): return _P5_INSTANCE.cylinder(*args) def cone(*args): return _P5_INSTANCE.cone(*args) def ellipsoid(*args): return _P5_INSTANCE.ellipsoid(*args) def torus(*args): return _P5_INSTANCE.torus(*args) def loadModel(*args): return _P5_INSTANCE.loadModel(*args) def model(*args): return _P5_INSTANCE.model(*args) def ellipseMode(*args): return _P5_INSTANCE.ellipseMode(*args) def noSmooth(*args): return _P5_INSTANCE.noSmooth(*args) def rectMode(*args): return _P5_INSTANCE.rectMode(*args) def smooth(*args): return _P5_INSTANCE.smooth(*args) def strokeCap(*args): return _P5_INSTANCE.strokeCap(*args) def strokeJoin(*args): return _P5_INSTANCE.strokeJoin(*args) def strokeWeight(*args): return _P5_INSTANCE.strokeWeight(*args) def bezier(*args): return _P5_INSTANCE.bezier(*args) def bezierDetail(*args): return _P5_INSTANCE.bezierDetail(*args) def bezierPoint(*args): return _P5_INSTANCE.bezierPoint(*args) def bezierTangent(*args): return _P5_INSTANCE.bezierTangent(*args) def curve(*args): return _P5_INSTANCE.curve(*args) def curveDetail(*args): return _P5_INSTANCE.curveDetail(*args) def curveTightness(*args): return _P5_INSTANCE.curveTightness(*args) def curvePoint(*args): return _P5_INSTANCE.curvePoint(*args) def curveTangent(*args): return _P5_INSTANCE.curveTangent(*args) def beginContour(*args): return _P5_INSTANCE.beginContour(*args) def beginShape(*args): return _P5_INSTANCE.beginShape(*args) def bezierVertex(*args): return _P5_INSTANCE.bezierVertex(*args) def curveVertex(*args): return _P5_INSTANCE.curveVertex(*args) def endContour(*args): return _P5_INSTANCE.endContour(*args) def endShape(*args): return _P5_INSTANCE.endShape(*args) def quadraticVertex(*args): return _P5_INSTANCE.quadraticVertex(*args) def vertex(*args): return _P5_INSTANCE.vertex(*args) def cursor(*args): return _P5_INSTANCE.cursor(*args) def frameRate(*args): return _P5_INSTANCE.frameRate(*args) def noCursor(*args): return _P5_INSTANCE.noCursor(*args) def fullscreen(*args): return _P5_INSTANCE.fullscreen(*args) def pixelDensity(*args): return _P5_INSTANCE.pixelDensity(*args) def displayDensity(*args): return _P5_INSTANCE.displayDensity(*args) def getURL(*args): return _P5_INSTANCE.getURL(*args) def getURLPath(*args): return _P5_INSTANCE.getURLPath(*args) def getURLParams(*args): return _P5_INSTANCE.getURLParams(*args) def remove(*args): return _P5_INSTANCE.remove(*args) def noLoop(*args): return _P5_INSTANCE.noLoop(*args) def loop(*args): return _P5_INSTANCE.loop(*args) def push(*args): return _P5_INSTANCE.push(*args) def redraw(*args): return _P5_INSTANCE.redraw(*args) def resizeCanvas(*args): return _P5_INSTANCE.resizeCanvas(*args) def noCanvas(*args): return _P5_INSTANCE.noCanvas(*args) def createGraphics(*args): return _P5_INSTANCE.createGraphics(*args) def blendMode(*args): return _P5_INSTANCE.blendMode(*args) def setAttributes(*args): return _P5_INSTANCE.setAttributes(*args) def applyMatrix(*args): return _P5_INSTANCE.applyMatrix(*args) def resetMatrix(*args): return _P5_INSTANCE.resetMatrix(*args) def rotate(*args): return _P5_INSTANCE.rotate(*args) def rotateX(*args): return _P5_INSTANCE.rotateX(*args) def rotateY(*args): return _P5_INSTANCE.rotateY(*args) def rotateZ(*args): return _P5_INSTANCE.rotateZ(*args) def scale(*args): return _P5_INSTANCE.scale(*args) def shearX(*args): return _P5_INSTANCE.shearX(*args) def shearY(*args): return _P5_INSTANCE.shearY(*args) def translate(*args): return _P5_INSTANCE.translate(*args) def createStringDict(*args): return _P5_INSTANCE.createStringDict(*args) def createNumberDict(*args): return _P5_INSTANCE.createNumberDict(*args) def append(*args): return _P5_INSTANCE.append(*args) def arrayCopy(*args): return _P5_INSTANCE.arrayCopy(*args) def concat(*args): return _P5_INSTANCE.concat(*args) def reverse(*args): return _P5_INSTANCE.reverse(*args) def shorten(*args): return _P5_INSTANCE.shorten(*args) def shuffle(*args): return _P5_INSTANCE.shuffle(*args) def sort(*args): return _P5_INSTANCE.sort(*args) def splice(*args): return _P5_INSTANCE.splice(*args) def subset(*args): return _P5_INSTANCE.subset(*args) def float(*args): return _P5_INSTANCE.float(*args) def int(*args): return _P5_INSTANCE.int(*args) def str(*args): return _P5_INSTANCE.str(*args) def boolean(*args): return _P5_INSTANCE.boolean(*args) def byte(*args): return _P5_INSTANCE.byte(*args) def char(*args): return _P5_INSTANCE.char(*args) def unchar(*args): return _P5_INSTANCE.unchar(*args) def hex(*args): return _P5_INSTANCE.hex(*args) def unhex(*args): return _P5_INSTANCE.unhex(*args) def join(*args): return _P5_INSTANCE.join(*args) def match(*args): return _P5_INSTANCE.match(*args) def matchAll(*args): return _P5_INSTANCE.matchAll(*args) def nf(*args): return _P5_INSTANCE.nf(*args) def nfc(*args): return _P5_INSTANCE.nfc(*args) def nfp(*args): return _P5_INSTANCE.nfp(*args) def nfs(*args): return _P5_INSTANCE.nfs(*args) def split(*args): return _P5_INSTANCE.split(*args) def splitTokens(*args): return _P5_INSTANCE.splitTokens(*args) def trim(*args): return _P5_INSTANCE.trim(*args) def setMoveThreshold(*args): return _P5_INSTANCE.setMoveThreshold(*args) def setShakeThreshold(*args): return _P5_INSTANCE.setShakeThreshold(*args) def keyIsDown(*args): return _P5_INSTANCE.keyIsDown(*args) def createImage(*args): return _P5_INSTANCE.createImage(*args) def saveCanvas(*args): return _P5_INSTANCE.saveCanvas(*args) def saveFrames(*args): return _P5_INSTANCE.saveFrames(*args) def loadImage(*args): return _P5_INSTANCE.loadImage(*args) def image(*args): return _P5_INSTANCE.image(*args) def tint(*args): return _P5_INSTANCE.tint(*args) def noTint(*args): return _P5_INSTANCE.noTint(*args) def imageMode(*args): return _P5_INSTANCE.imageMode(*args) def blend(*args): return _P5_INSTANCE.blend(*args) def copy(*args): return _P5_INSTANCE.copy(*args) def filter(*args): if len(args) > 1 and (args[0] is None or callable(args[0])): return PythonFunctions.filter(*args) else: return _P5_INSTANCE.filter(*args) def get(*args): return _P5_INSTANCE.get(*args) def loadPixels(*args): return _P5_INSTANCE.loadPixels(*args) def set(*args): if len(args) <= 1: return PythonFunctions.set(*args) else: return _P5_INSTANCE.set(*args) def updatePixels(*args): return _P5_INSTANCE.updatePixels(*args) def loadJSON(*args): return _P5_INSTANCE.loadJSON(*args) def loadStrings(*args): return _P5_INSTANCE.loadStrings(*args) def loadTable(*args): return _P5_INSTANCE.loadTable(*args) def loadXML(*args): return _P5_INSTANCE.loadXML(*args) def loadBytes(*args): return _P5_INSTANCE.loadBytes(*args) def httpGet(*args): return _P5_INSTANCE.httpGet(*args) def httpPost(*args): return _P5_INSTANCE.httpPost(*args) def httpDo(*args): return _P5_INSTANCE.httpDo(*args) def createWriter(*args): return _P5_INSTANCE.createWriter(*args) def save(*args): return _P5_INSTANCE.save(*args) def saveJSON(*args): return _P5_INSTANCE.saveJSON(*args) def saveStrings(*args): return _P5_INSTANCE.saveStrings(*args) def saveTable(*args): return _P5_INSTANCE.saveTable(*args) def day(*args): return _P5_INSTANCE.day(*args) def hour(*args): return _P5_INSTANCE.hour(*args) def minute(*args): return _P5_INSTANCE.minute(*args) def millis(*args): return _P5_INSTANCE.millis(*args) def month(*args): return _P5_INSTANCE.month(*args) def second(*args): return _P5_INSTANCE.second(*args) def year(*args): return _P5_INSTANCE.year(*args) def createVector(*args): return _P5_INSTANCE.createVector(*args) def abs(*args): return _P5_INSTANCE.abs(*args) def ceil(*args): return _P5_INSTANCE.ceil(*args) def constrain(*args): return _P5_INSTANCE.constrain(*args) def dist(*args): return _P5_INSTANCE.dist(*args) def exp(*args): return _P5_INSTANCE.exp(*args) def floor(*args): return _P5_INSTANCE.floor(*args) def lerp(*args): return _P5_INSTANCE.lerp(*args) def log(*args): return _P5_INSTANCE.log(*args) def mag(*args): return _P5_INSTANCE.mag(*args) def map(*args): if len(args) > 1 and callable(args[0]): return PythonFunctions.map(*args) else: return _P5_INSTANCE.map(*args) def max(*args): return _P5_INSTANCE.max(*args) def min(*args): return _P5_INSTANCE.min(*args) def norm(*args): return _P5_INSTANCE.norm(*args) def pow(*args): return _P5_INSTANCE.pow(*args) def round(*args): return _P5_INSTANCE.round(*args) def sq(*args): return _P5_INSTANCE.sq(*args) def sqrt(*args): return _P5_INSTANCE.sqrt(*args) def noise(*args): return _P5_INSTANCE.noise(*args) def noiseDetail(*args): return _P5_INSTANCE.noiseDetail(*args) def noiseSeed(*args): return _P5_INSTANCE.noiseSeed(*args) def randomSeed(*args): return _P5_INSTANCE.randomSeed(*args) def random(*args): return _P5_INSTANCE.random(*args) def randomGaussian(*args): return _P5_INSTANCE.randomGaussian(*args) def acos(*args): return _P5_INSTANCE.acos(*args) def asin(*args): return _P5_INSTANCE.asin(*args) def atan(*args): return _P5_INSTANCE.atan(*args) def atan2(*args): return _P5_INSTANCE.atan2(*args) def cos(*args): return _P5_INSTANCE.cos(*args) def sin(*args): return _P5_INSTANCE.sin(*args) def tan(*args): return _P5_INSTANCE.tan(*args) def degrees(*args): return _P5_INSTANCE.degrees(*args) def radians(*args): return _P5_INSTANCE.radians(*args) def angleMode(*args): return _P5_INSTANCE.angleMode(*args) def textAlign(*args): return _P5_INSTANCE.textAlign(*args) def textLeading(*args): return _P5_INSTANCE.textLeading(*args) def textSize(*args): return _P5_INSTANCE.textSize(*args) def textStyle(*args): return _P5_INSTANCE.textStyle(*args) def textWidth(*args): return _P5_INSTANCE.textWidth(*args) def textAscent(*args): return _P5_INSTANCE.textAscent(*args) def textDescent(*args): return _P5_INSTANCE.textDescent(*args) def loadFont(*args): return _P5_INSTANCE.loadFont(*args) def text(*args): return _P5_INSTANCE.text(*args) def textFont(*args): return _P5_INSTANCE.textFont(*args) def orbitControl(*args): return _P5_INSTANCE.orbitControl(*args) def debugMode(*args): return _P5_INSTANCE.debugMode(*args) def noDebugMode(*args): return _P5_INSTANCE.noDebugMode(*args) def ambientLight(*args): return _P5_INSTANCE.ambientLight(*args) def directionalLight(*args): return _P5_INSTANCE.directionalLight(*args) def pointLight(*args): return _P5_INSTANCE.pointLight(*args) def lights(*args): return _P5_INSTANCE.lights(*args) def loadShader(*args): return _P5_INSTANCE.loadShader(*args) def createShader(*args): return _P5_INSTANCE.createShader(*args) def shader(*args): return _P5_INSTANCE.shader(*args) def resetShader(*args): return _P5_INSTANCE.resetShader(*args) def normalMaterial(*args): return _P5_INSTANCE.normalMaterial(*args) def texture(*args): return _P5_INSTANCE.texture(*args) def textureMode(*args): return _P5_INSTANCE.textureMode(*args) def textureWrap(*args): return _P5_INSTANCE.textureWrap(*args) def ambientMaterial(*args): return _P5_INSTANCE.ambientMaterial(*args) def specularMaterial(*args): return _P5_INSTANCE.specularMaterial(*args) def shininess(*args): return _P5_INSTANCE.shininess(*args) def camera(*args): return _P5_INSTANCE.camera(*args) def perspective(*args): return _P5_INSTANCE.perspective(*args) def ortho(*args): return _P5_INSTANCE.ortho(*args) def createCamera(*args): return _P5_INSTANCE.createCamera(*args) def setCamera(*args): return _P5_INSTANCE.setCamera(*args) def select(*args): return _P5_INSTANCE.select(*args) def selectAll(*args): return _P5_INSTANCE.selectAll(*args) def removeElements(*args): return _P5_INSTANCE.removeElements(*args) def changed(*args): return _P5_INSTANCE.changed(*args) def input(*args): return _P5_INSTANCE.input(*args) def createDiv(*args): return _P5_INSTANCE.createDiv(*args) def createP(*args): return _P5_INSTANCE.createP(*args) def createSpan(*args): return _P5_INSTANCE.createSpan(*args) def createImg(*args): return _P5_INSTANCE.createImg(*args) def createA(*args): return _P5_INSTANCE.createA(*args) def createSlider(*args): return _P5_INSTANCE.createSlider(*args) def createButton(*args): return _P5_INSTANCE.createButton(*args) def createCheckbox(*args): return _P5_INSTANCE.createCheckbox(*args) def createSelect(*args): return _P5_INSTANCE.createSelect(*args) def createRadio(*args): return _P5_INSTANCE.createRadio(*args) def createColorPicker(*args): return _P5_INSTANCE.createColorPicker(*args) def createInput(*args): return _P5_INSTANCE.createInput(*args) def createFileInput(*args): return _P5_INSTANCE.createFileInput(*args) def createVideo(*args): return _P5_INSTANCE.createVideo(*args) def createAudio(*args): return _P5_INSTANCE.createAudio(*args) def createCapture(*args): return _P5_INSTANCE.createCapture(*args) def createElement(*args): return _P5_INSTANCE.createElement(*args) def createCanvas(*args): canvas = _P5_INSTANCE.createCanvas(*args) global width, height width = _P5_INSTANCE.width height = _P5_INSTANCE.height return canvas def __deviceMoved(e): try: _bind_event_function(deviceMoved, e) except NameError: pass def __deviceTurned(e): try: _bind_event_function(deviceTurned, e) except NameError: pass def __deviceShaken(e): try: _bind_event_function(deviceShaken, e) except NameError: pass def __touchEnded(e): try: _bind_event_function(deviceShaken, e) except NameError: pass def __touchStarted(e): try: _bind_event_function(touchStarted, e) except NameError: pass def __windowResized(e): try: _bind_event_function(windowResized, e) except NameError: pass def __touchMoved(e): try: _bind_event_function(touchMoved, e) except NameError: pass def __mouseMoved(e): try: _bind_event_function(mouseMoved, e) except NameError: pass def __mouseDragged(e): try: _bind_event_function(mouseDragged, e) except NameError: pass def __mousePressed(e): try: _bind_event_function(mousePressed, e) except NameError: pass def __mouseReleased(e): try: _bind_event_function(mouseReleased, e) except NameError: pass def __mouseClicked(e): try: _bind_event_function(mouseClicked, e) except NameError: pass def __doubleClicked(e): try: _bind_event_function(doubleClicked, e) except NameError: pass def __mouseWheel(e): try: _bind_event_function(mouseWheel, e) except NameError: pass def __keyPressed(e): try: _bind_event_function(keyPressed, e) except NameError: pass def __keyReleased(e): try: _bind_event_function(keyReleased, e) except NameError: pass def __keyTyped(e): try: _bind_event_function(keyTyped, e) except NameError: pass def __keyIsDown(e): try: _bind_event_function(keyIsDown, e) except NameError: pass def pop(*args): p5_pop = _P5_INSTANCE.pop(*args) return p5_pop # Processing Python or Java mode compatibility aliases size = createCanvas popMatrix = pop popStyle = pop pushMatrix = push pushStyle = push # PVector is a wrapper/helper class for p5.Vector objets # providing names similar to Processing Python or Java modes # but mostly keeping p5js functionality from numbers import Number class PVector: def __init__(self, x=0, y=0, z=0): self.__vector = createVector(x, y, z) self.add = self.__instance_add__ self.sub = self.__instance_sub__ self.mult = self.__instance_mult__ self.div = self.__instance_div__ self.cross = self.__instance_cross__ self.dist = self.__instance_dist__ self.dot = self.__instance_dot__ self.lerp = self.__instance_lerp__ @property def x(self): return self.__vector.x @x.setter def x(self, x): self.__vector.x = x @property def y(self): return self.__vector.y @y.setter def y(self, y): self.__vector.y = y @property def z(self): return self.__vector.z @z.setter def z(self, z): self.__vector.z = z def mag(self): return self.__vector.mag() def magSq(self): return self.__vector.magSq() def setMag(self, mag): self.__vector.setMag(mag) return self def normalize(self): self.__vector.normalize() return self def limit(self, max): self.__vector.limit(max) return self def heading(self): return self.__vector.heading() def rotate(self, angle): self.__vector.rotate(angle) return self def __instance_add__(self, *args): if len(args) == 1: return PVector.add(self, args[0], self) else: return PVector.add(self, PVector(*args), self) def __instance_sub__(self, *args): if len(args) == 1: return PVector.sub(self, args[0], self) else: return PVector.sub(self, PVector(*args), self) def __instance_mult__(self, o): return PVector.mult(self, o, self) def __instance_div__(self, f): return PVector.div(self, f, self) def __instance_cross__(self, o): return PVector.cross(self, o, self) def __instance_dist__(self, o): return PVector.dist(self, o) def __instance_dot__(self, *args): if len(args) == 1: v = args[0] else: v = args return self.x * v[0] + self.y * v[1] + self.z * v[2] def __instance_lerp__(self, *args): if len(args) == 2: return PVector.lerp(self, args[0], args[1], self) else: vx, vy, vz, f = args return PVector.lerp(self, PVector(vx, vy, vz), f, self) def get(self): return PVector(self.x, self.y, self.z) def copy(self): return PVector(self.x, self.y, self.z) def __getitem__(self, k): return getattr(self, ('x', 'y', 'z')[k]) def __setitem__(self, k, v): setattr(self, ('x', 'y', 'z')[k], v) def __copy__(self): return PVector(self.x, self.y, self.z) def __deepcopy__(self, memo): return PVector(self.x, self.y, self.z) def __repr__(self): # PROVISÓRIO return f'PVector({self.x}, {self.y}, {self.z})' def set(self, *args): """ Sets the x, y, and z component of the vector using two or three separate variables, the data from a p5.Vector, or the values from a float array. """ self.__vector.set(*args) @classmethod def add(cls, a, b, dest=None): if dest is None: return PVector(a.x + b[0], a.y + b[1], a.z + b[2]) dest.__vector.set(a.x + b[0], a.y + b[1], a.z + b[2]) return dest @classmethod def sub(cls, a, b, dest=None): if dest is None: return PVector(a.x - b[0], a.y - b[1], a.z - b[2]) dest.__vector.set(a.x - b[0], a.y - b[1], a.z - b[2]) return dest @classmethod def mult(cls, a, b, dest=None): if dest is None: return PVector(a.x * b, a.y * b, a.z * b) dest.__vector.set(a.x * b, a.y * b, a.z * b) return dest @classmethod def div(cls, a, b, dest=None): if dest is None: return PVector(a.x / b, a.y / b, a.z / b) dest.__vector.set(a.x / b, a.y / b, a.z / b) return dest @classmethod def dist(cls, a, b): return a.__vector.dist(b.__vector) @classmethod def dot(cls, a, b): return a.__vector.dot(b.__vector) def __add__(a, b): return PVector.add(a, b, None) def __sub__(a, b): return PVector.sub(a, b, None) def __isub__(a, b): a.sub(b) return a def __iadd__(a, b): a.add(b) return a def __mul__(a, b): if not isinstance(b, Number): raise TypeError( "The * operator can only be used to multiply a PVector by a number") return PVector.mult(a, float(b), None) def __rmul__(a, b): if not isinstance(b, Number): raise TypeError( "The * operator can only be used to multiply a PVector by a number") return PVector.mult(a, float(b), None) def __imul__(a, b): if not isinstance(b, Number): raise TypeError( "The *= operator can only be used to multiply a PVector by a number") a.__vector.mult(float(b)) return a def __truediv__(a, b): if not isinstance(b, Number): raise TypeError( "The * operator can only be used to multiply a PVector by a number") return PVector(a.x / float(b), a.y / float(b), a.z / float(b)) def __itruediv__(a, b): if not isinstance(b, Number): raise TypeError( "The /= operator can only be used to multiply a PVector by a number") a.__vector.set(a.x / float(b), a.y / float(b), a.z / float(b)) return a def __eq__(a, b): return a.x == b[0] and a.y == b[1] and a.z == b[2] def __lt__(a, b): return a.magSq() < b.magSq() def __le__(a, b): return a.magSq() <= b.magSq() def __gt__(a, b): return a.magSq() > b.magSq() def __ge__(a, b): return a.magSq() >= b.magSq() # Problematic class methods, we would rather use p5.Vector when possible... @classmethod def lerp(cls, a, b, f, dest=None): v = createVector(a.x, a.y, a.z) v.lerp(b.__vector, f) if dest is None: return PVector(v.x, v.y, v.z) dest.set(v.x, v.y, v.z) return dest @classmethod def cross(cls, a, b, dest=None): x = a.y * b[2] - b[1] * a.z y = a.z * b[0] - b[2] * a.x z = a.x * b[1] - b[0] * a.y if dest is None: return PVector(x, y, z) dest.set(x, y, z) return dest @classmethod def fromAngle(cls, angle, length=1): # https://github.com/processing/p5.js/blob/3f0b2f0fe575dc81c724474154f5b23a517b7233/src/math/p5.Vector.js return PVector(length * cos(angle), length * sin(angle), 0) @classmethod def fromAngles(theta, phi, length=1): # https://github.com/processing/p5.js/blob/3f0b2f0fe575dc81c724474154f5b23a517b7233/src/math/p5.Vector.js cosPhi = cos(phi) sinPhi = sin(phi) cosTheta = cos(theta) sinTheta = sin(theta) return PVector(length * sinTheta * sinPhi, -length * cosTheta, length * sinTheta * cosPhi) @classmethod def random2D(cls): return PVector.fromAngle(random(TWO_PI)) @classmethod def random3D(cls, dest=None): angle = random(TWO_PI) vz = random(2) - 1 mult = sqrt(1 - vz * vz) vx = mult * cos(angle) vy = mult * sin(angle) if dest is None: return PVector(vx, vy, vz) dest.set(vx, vy, vz) return dest @classmethod def angleBetween(cls, a, b): return acos(a.dot(b) / sqrt(a.magSq() * b.magSq())) # Other harmless p5js methods def equals(self, v): return self == v def heading2D(self): return self.__vector.heading() def reflect(self, *args): # Reflect the incoming vector about a normal to a line in 2D, or about # a normal to a plane in 3D This method acts on the vector directly r = self.__vector.reflect(*args) return r def array(self): # Return a representation of this vector as a float array. This is only # for temporary use. If used in any w fashion, the contents should be # copied by using the p5.Vector.copy() method to copy into your own # array. return self.__vector.array() def toString(self): # Returns a string representation of a vector v by calling String(v) or v.toString(). # return self.__vector.toString() would be something like "p5.vector # Object […, …, …]" return str(self) def rem(self, *args): # Gives remainder of a vector when it is divided by anw vector. See # examples for more context. self.__vector.rem(*args) return self def pre_draw(p5_instance, draw_func, *args, **kwargs): """ We need to run this before the actual draw to insert and update p5 env variables """ global _CTX_MIDDLE, _DEFAULT_FILL, _DEFAULT_LEADMULT, _DEFAULT_STROKE, _DEFAULT_TEXT_FILL global ADD, ALT, ARROW, AUTO, AUDIO, AXES, BACKSPACE, BASELINE, BEVEL, BEZIER, BLEND, BLUR, BOLD, BOLDITALIC global BOTTOM, BURN, CENTER, CHORD, CLAMP, CLOSE, CONTROL, CORNER, CORNERS, CROSS, CURVE, DARKEST global DEG_TO_RAD, DEGREES, DELETE, DIFFERENCE, DILATE, DODGE, DOWN_ARROW, ENTER, ERODE, ESCAPE, EXCLUSION global FILL, GRAY, GRID, HALF_PI, HAND, HARD_LIGHT, HSB, HSL, IMAGE, IMMEDIATE, INVERT, ITALIC, LANDSCAPE global LEFT, LEFT_ARROW, LIGHTEST, LINE_LOOP, LINE_STRIP, LINEAR, LINES, MIRROR, MITER, MOVE, MULTIPLY, NEAREST global NORMAL, OPAQUE, OPEN, OPTION, OVERLAY, P2D, P3D, PI, PIE, POINTS, PORTRAIT, POSTERIZE, PROJECT, QUAD_STRIP global QUADRATIC, QUADS, QUARTER_PI, RAD_TO_DEG, RADIANS, RADIUS, REPEAT, REPLACE, RETURN, RGB, RIGHT, RIGHT_ARROW global ROUND, SCREEN, SHIFT, SOFT_LIGHT, SQUARE, STROKE, SUBTRACT, TAB, TAU, TEXT, TEXTURE, THRESHOLD, TOP global TRIANGLE_FAN, TRIANGLE_STRIP, TRIANGLES, TWO_PI, UP_ARROW, VIDEO, WAIT, WEBGL global frameCount, focused, displayWidth, displayHeight, windowWidth, windowHeight, width, height global deviceOrientation, accelerationX, accelerationY, accelerationZ global pAccelerationX, pAccelerationY, pAccelerationZ, rotationX, rotationY, rotationZ global pRotationX, pRotationY, pRotationZ, turnAxis, keyIsPressed, key, keyCode, mouseX, mouseY, pmouseX, pmouseY global winMouseX, winMouseY, pwinMouseX, pwinMouseY, mouseButton, mouseIsPressed, touches, pixels _CTX_MIDDLE = p5_instance._CTX_MIDDLE _DEFAULT_FILL = p5_instance._DEFAULT_FILL _DEFAULT_LEADMULT = p5_instance._DEFAULT_LEADMULT _DEFAULT_STROKE = p5_instance._DEFAULT_STROKE _DEFAULT_TEXT_FILL = p5_instance._DEFAULT_TEXT_FILL ADD = p5_instance.ADD ALT = p5_instance.ALT ARROW = p5_instance.ARROW AUDIO = p5_instance.AUDIO AUTO = p5_instance.AUTO AXES = p5_instance.AXES BACKSPACE = p5_instance.BACKSPACE BASELINE = p5_instance.BASELINE BEVEL = p5_instance.BEVEL BEZIER = p5_instance.BEZIER BLEND = p5_instance.BLEND BLUR = p5_instance.BLUR BOLD = p5_instance.BOLD BOLDITALIC = p5_instance.BOLDITALIC BOTTOM = p5_instance.BOTTOM BURN = p5_instance.BURN CENTER = p5_instance.CENTER CHORD = p5_instance.CHORD CLAMP = p5_instance.CLAMP CLOSE = p5_instance.CLOSE CONTROL = p5_instance.CONTROL CORNER = p5_instance.CORNER CORNERS = p5_instance.CORNERS CROSS = p5_instance.CROSS CURVE = p5_instance.CURVE DARKEST = p5_instance.DARKEST DEG_TO_RAD = p5_instance.DEG_TO_RAD DEGREES = p5_instance.DEGREES DELETE = p5_instance.DELETE DIFFERENCE = p5_instance.DIFFERENCE DILATE = p5_instance.DILATE DODGE = p5_instance.DODGE DOWN_ARROW = p5_instance.DOWN_ARROW ENTER = p5_instance.ENTER ERODE = p5_instance.ERODE ESCAPE = p5_instance.ESCAPE EXCLUSION = p5_instance.EXCLUSION FILL = p5_instance.FILL GRAY = p5_instance.GRAY GRID = p5_instance.GRID HALF_PI = p5_instance.HALF_PI HAND = p5_instance.HAND HARD_LIGHT = p5_instance.HARD_LIGHT HSB = p5_instance.HSB HSL = p5_instance.HSL IMAGE = p5_instance.IMAGE IMMEDIATE = p5_instance.IMMEDIATE INVERT = p5_instance.INVERT ITALIC = p5_instance.ITALIC LANDSCAPE = p5_instance.LANDSCAPE LEFT = p5_instance.LEFT LEFT_ARROW = p5_instance.LEFT_ARROW LIGHTEST = p5_instance.LIGHTEST LINE_LOOP = p5_instance.LINE_LOOP LINE_STRIP = p5_instance.LINE_STRIP LINEAR = p5_instance.LINEAR LINES = p5_instance.LINES MIRROR = p5_instance.MIRROR MITER = p5_instance.MITER MOVE = p5_instance.MOVE MULTIPLY = p5_instance.MULTIPLY NEAREST = p5_instance.NEAREST NORMAL = p5_instance.NORMAL OPAQUE = p5_instance.OPAQUE OPEN = p5_instance.OPEN OPTION = p5_instance.OPTION OVERLAY = p5_instance.OVERLAY P2D = p5_instance.P2D P3D = p5_instance.WEBGL PI = p5_instance.PI PIE = p5_instance.PIE POINTS = p5_instance.POINTS PORTRAIT = p5_instance.PORTRAIT POSTERIZE = p5_instance.POSTERIZE PROJECT = p5_instance.PROJECT QUAD_STRIP = p5_instance.QUAD_STRIP QUADRATIC = p5_instance.QUADRATIC QUADS = p5_instance.QUADS QUARTER_PI = p5_instance.QUARTER_PI RAD_TO_DEG = p5_instance.RAD_TO_DEG RADIANS = p5_instance.RADIANS RADIUS = p5_instance.RADIUS REPEAT = p5_instance.REPEAT REPLACE = p5_instance.REPLACE RETURN = p5_instance.RETURN RGB = p5_instance.RGB RIGHT = p5_instance.RIGHT RIGHT_ARROW = p5_instance.RIGHT_ARROW ROUND = p5_instance.ROUND SCREEN = p5_instance.SCREEN SHIFT = p5_instance.SHIFT SOFT_LIGHT = p5_instance.SOFT_LIGHT SQUARE = p5_instance.SQUARE STROKE = p5_instance.STROKE SUBTRACT = p5_instance.SUBTRACT TAB = p5_instance.TAB TAU = p5_instance.TAU TEXT = p5_instance.TEXT TEXTURE = p5_instance.TEXTURE THRESHOLD = p5_instance.THRESHOLD TOP = p5_instance.TOP TRIANGLE_FAN = p5_instance.TRIANGLE_FAN TRIANGLE_STRIP = p5_instance.TRIANGLE_STRIP TRIANGLES = p5_instance.TRIANGLES TWO_PI = p5_instance.TWO_PI UP_ARROW = p5_instance.UP_ARROW VIDEO = p5_instance.VIDEO WAIT = p5_instance.WAIT WEBGL = p5_instance.WEBGL frameCount = p5_instance.frameCount focused = p5_instance.focused displayWidth = p5_instance.displayWidth displayHeight = p5_instance.displayHeight windowWidth = p5_instance.windowWidth windowHeight = p5_instance.windowHeight width = p5_instance.width height = p5_instance.height deviceOrientation = p5_instance.deviceOrientation accelerationX = p5_instance.accelerationX accelerationY = p5_instance.accelerationY accelerationZ = p5_instance.accelerationZ pAccelerationX = p5_instance.pAccelerationX pAccelerationY = p5_instance.pAccelerationY pAccelerationZ = p5_instance.pAccelerationZ rotationX = p5_instance.rotationX rotationY = p5_instance.rotationY rotationZ = p5_instance.rotationZ pRotationX = p5_instance.pRotationX pRotationY = p5_instance.pRotationY pRotationZ = p5_instance.pRotationZ turnAxis = p5_instance.turnAxis keyIsPressed = p5_instance.keyIsPressed key = p5_instance.key keyCode = p5_instance.keyCode mouseX = p5_instance.mouseX mouseY = p5_instance.mouseY pmouseX = p5_instance.pmouseX pmouseY = p5_instance.pmouseY winMouseX = p5_instance.winMouseX winMouseY = p5_instance.winMouseY pwinMouseX = p5_instance.pwinMouseX pwinMouseY = p5_instance.pwinMouseY mouseButton = p5_instance.mouseButton mouseIsPressed = p5_instance.mouseIsPressed touches = p5_instance.touches pixels = p5_instance.pixels return draw_func(*args, **kwargs) def global_p5_injection(p5_sketch): """ Injects the p5js's skecth instance as a global variable to setup and draw functions """ def decorator(f, *args, **kwargs): def wrapper(*args, **kwargs): global _P5_INSTANCE _P5_INSTANCE = p5_sketch return pre_draw(_P5_INSTANCE, f, *args, **kwargs) return wrapper return decorator def start_p5(preload_func, setup_func, draw_func, event_functions): """ This is the entrypoint function. It accepts 2 parameters: - preload_func: A Python preload callable - setup_func: a Python setup callable - draw_func: a Python draw callable - event_functions: a config dict for the event functions in the format: {"eventFunctionName": python_event_function} This method gets the p5js's sketch instance and injects them """ def sketch_setup(p5_sketch): """ Callback function called to configure new p5 instance """ p5_sketch.preload = global_p5_injection(p5_sketch)(preload_func) p5_sketch.setup = global_p5_injection(p5_sketch)(setup_func) p5_sketch.draw = global_p5_injection(p5_sketch)(draw_func) window.instance = p5.new(sketch_setup, 'sketch-holder') # Register event functions event_function_names = ( "deviceMoved", "deviceTurned", "deviceShaken", "windowResized", "keyPressed", "keyReleased", "keyTyped", "mousePressed", "mouseReleased", "mouseClicked", "doubleClicked", "mouseMoved", "mouseDragged", "mouseWheel", "touchStarted", "touchMoved", "touchEnded", "keyIsDown", ) for f_name in [f for f in event_function_names if event_functions.get(f, None)]: func = event_functions[f_name] event_func = global_p5_injection(window.instance)(func) setattr(window.instance, f_name, event_func) `; const placeholder = ` def preload(): pass def setup(): pass def draw(): pass deviceMoved = None deviceTurned = None deviceShaken = None keyPressed = None keyReleased = None keyTyped = None mouseMoved = None mouseDragged = None mousePressed = None mouseReleased = None mouseClicked = None doubleClicked = None mouseWheel = None touchStarted = None touchMoved = None touchEnded = None windowResized = None `; let userCode = ` x = 50 y = 100 rad = 6 vx = 5 vy = 5 WIDTH = 640 HEIGHT = 400 FPS = 60 def setup(): createCanvas(WIDTH, HEIGHT) frameRate(FPS) def draw(): global x, y, vx, vy background(220) fill(0, 255, 0) ellipse(x, y, 2 * rad) x += vx y += vy if (x + rad >= width or x - rad <= 0): vx = -vx if (y + rad >= height or y - rad <= 0): vy = -vy `; const startCode = ` event_functions = { "deviceMoved": deviceMoved, "deviceTurned": deviceTurned, "deviceShaken": deviceShaken, "keyPressed": keyPressed, "keyReleased": keyReleased, "keyTyped": keyTyped, "mouseMoved": mouseMoved, "mouseDragged": mouseDragged, "mousePressed": mousePressed, "mouseReleased": mouseReleased, "mouseClicked": mouseClicked, "doubleClicked": doubleClicked, "mouseWheel": mouseWheel, "touchStarted": touchStarted, "touchMoved": touchMoved, "touchEnded": touchEnded, "windowResized": windowResized, } start_p5(preload, setup, draw, event_functions) `; function runCode() { let code = [ placeholder, userCode, wrapperContent, startCode, ].join('\n'); if (window.instance) { window.instance.canvas.remove(); } console.log("Python execution output:"); window.pyodide.runPython(code); } async function main() { const config = { indexURL : "https://cdn.jsdelivr.net/pyodide/v0.18.1/full/", fullStdLib: false, } window.pyodide = await loadPyodide(config); // Pyodide is now ready to use... console.log(window.pyodide.runPython(` import io, code, sys from js import p5, window, document print(sys.version) `)); window.runSketchCode = (code) => { userCode = code; runCode(); } runCode(); }; // async method main(); ================================================ FILE: docs/examples/pyodide/breakout/breakout-kb.py ================================================ # Inspired by Mats Lund: # https://github.com/CoderMats/breakout # Completely rewritten WIDTH = 640 # canvas width HEIGHT = 400 # canvas height P_WIDTH = 50 # paddle halfwidth P_HEIGHT = 8 # paddle halfheight B_ROWS = 5 # bricks, number of rows B_COLS = 10 # bricks, number of columns B_MARGINS = 15 # margins for bricks (bottom, side) BALL_DIAM = 10 # diameter of ball FPS = 30 # frames per second # block width, height, total space b_width = (WIDTH - 2 * B_MARGINS) // B_COLS b_height = 40 b_gap = 15 # gap between blocks # constants, helper variables bw2 = b_width // 2 bh2 = b_height // 2 dw = (b_width - b_gap) // 2 dh = (b_height - b_gap) // 2 r = BALL_DIAM // 2 # ball diameter y_paddle = HEIGHT - 30 cell_colors = {1:"green" , 2:"blue" , 3:"red" , 4:"yellow"} game = None def setup(): global game createCanvas(WIDTH, HEIGHT, P2D) rectMode(CENTER) frameRate(FPS) noCursor() game = Game() def new_game(): global game new_level = game.level + int(game.blocks_gone) game = Game(level=new_level) def draw(): global game if game.blocks_gone: new_game() if keyIsPressed: if (keyCode == RIGHT_ARROW) and (not game.game_over): # Move right game.paddle.x = min(game.paddle.x + 12, WIDTH - P_WIDTH) elif (keyCode == LEFT_ARROW) and (not game.game_over): # Move left game.paddle.x = max(game.paddle.x - 12, P_WIDTH) elif (key == ' '): new_game() game.update() class Ball(object): def __init__(self,level=1): # ball velocity self.vel = PVector(3 + int(1.5 * level),-3 - int(1.5 * level)) xp = WIDTH // 2 + int(random(-P_WIDTH - 40,P_WIDTH + 40)) yp = y_paddle - P_HEIGHT // 2 - r - 1 self.pos = PVector(xp,yp) # ball position def update(self): self.pos = PVector.add(self.pos,self.vel) if (self.pos.x >= WIDTH or self.pos.x <= 0): self.vel.x = -self.vel.x if (self.pos.y <= 0): self.vel.y = -self.vel.y class Game(object): def __init__(self,level=1): self.paddle = PVector(WIDTH // 2, HEIGHT - 30) self.level = level self.ball = Ball() self.score = 0 self.blocks = [int(random(1.5,4.5)) for k in range(B_ROWS * B_COLS)] self.game_over = False self.blocks_gone = False # x, y positions of block centers self.centers = [((i % B_COLS) * b_width + B_MARGINS + bw2, b_height * (i // B_COLS) + B_MARGINS + bh2) for i in range(B_ROWS * B_COLS)] def update_ball(self): self.ball.update() px, py = self.paddle.x, self.paddle.y if ((px - P_WIDTH -r) <= self.ball.pos.x <= (px + P_WIDTH + r) and (py - P_HEIGHT - r <= self.ball.pos.y <= py - P_HEIGHT)): # ball is hitting paddle rectangle, reverse y_speed self.ball.vel.y = -self.ball.vel.y self.score = self.score + 1 fill(100,100,200) ellipse(self.ball.pos.x, self.ball.pos.y, BALL_DIAM, BALL_DIAM) def update_paddle(self): fill(0,255,0) rect(self.paddle.x, self.paddle.y, 2 * P_WIDTH, 2* P_HEIGHT) if (self.ball.pos.y >= HEIGHT): fill(255) textSize(40) textAlign(CENTER) text("Game over", WIDTH // 2, HEIGHT // 2 + 40) self.game_over = True def update_texts(self): background(25) noStroke() # Set fill color to white fill(255) # Display score textSize(16) textAlign(RIGHT) text("Score", 80, HEIGHT - 6) textAlign(LEFT) text(self.score, 90, HEIGHT - 6) # text("Frames: %.1f" %frameRate(), 130, HEIGHT - 6) # Display level textAlign(RIGHT) text("Level", WIDTH - 50, HEIGHT - 6) textAlign(LEFT) text(self.level, WIDTH - 40, HEIGHT - 6) def update_blocks(self): self.blocks_gone = True # Loop through all the potential blocks collide = False for i in range(B_ROWS * B_COLS): # Check if we have that block if (self.blocks[i]): x_cent, y_cent = self.centers[i] self.blocks_gone = False if not collide: bx, by = self.ball.pos.x, self.ball.pos.y # check bounce on top/bottom if ((x_cent - dw - r < bx < x_cent + dw + r) and ((y_cent + dh < by < y_cent + dh + r) or (y_cent -dh - r < by < y_cent - dh))): self.blocks[i] = 0 self.ball.vel.y = -self.ball.vel.y self.score = self.score + 5 collide = True # check bounce on left/right if ((y_cent - dh - r < by < y_cent + dh + r) and ((x_cent + dw < bx < x_cent + dw + r) or (x_cent - dw -r < bx < x_cent - dw))): self.blocks[i] = 0 self.ball.vel.x = -self.ball.vel.x self.score = self.score + 5 collide = True if collide: break def draw_blocks(self): for i in range(B_ROWS * B_COLS): if (self.blocks[i]): fill(cell_colors[self.blocks[i]]) x_cent, y_cent = self.centers[i] rect(x_cent, y_cent, 2 * dw, 2 * dh) def update(self): self.update_texts() self.update_ball() self.update_paddle() self.update_blocks() self.draw_blocks() ================================================ FILE: docs/examples/pyodide/breakout/breakout-ms.py ================================================ # Inspired by Mats Lund: # https://github.com/CoderMats/breakout # Completely rewritten WIDTH = 640 # canvas width HEIGHT = 400 # canvas height P_WIDTH = 50 # paddle halfwidth P_HEIGHT = 8 # paddle halfheight B_ROWS = 5 # bricks, number of rows B_COLS = 10 # bricks, number of columns B_MARGINS = 15 # margins for bricks (bottom, side) BALL_DIAM = 10 # diameter of ball FPS = 30 # frames per second # block width, height, total space b_width = (WIDTH - 2 * B_MARGINS) // B_COLS b_height = 40 b_gap = 15 # gap between blocks # constants, helper variables bw2 = b_width // 2 bh2 = b_height // 2 dw = (b_width - b_gap) // 2 dh = (b_height - b_gap) // 2 r = BALL_DIAM // 2 # ball diameter y_paddle = HEIGHT - 30 cell_colors = {1:"green" , 2:"blue" , 3:"red" , 4:"yellow"} game = None def setup(): global game createCanvas(WIDTH, HEIGHT, P2D) rectMode(CENTER) frameRate(FPS) noCursor() game = Game() def new_game(): global game new_level = game.level + int(game.blocks_gone) game = Game(level=new_level) def draw(): global game if game.blocks_gone: new_game() if not game.game_over: game.paddle.x = min(WIDTH - P_WIDTH, max(mouseX, P_WIDTH)) game.update() def keyPressed(): if key == " ": new_game() class Ball(object): def __init__(self,level=1): # ball velocity self.vel = PVector(3 + int(1.5 * level),-3 - int(1.5 * level)) xp = WIDTH // 2 + int(random(-P_WIDTH - 40,P_WIDTH + 40)) yp = y_paddle - P_HEIGHT // 2 - r - 1 self.pos = PVector(xp,yp) # ball position def update(self): self.pos = PVector.add(self.pos,self.vel) if (self.pos.x >= WIDTH or self.pos.x <= 0): self.vel.x = -self.vel.x if (self.pos.y <= 0): self.vel.y = -self.vel.y class Game(object): def __init__(self,level=1): self.paddle = PVector(WIDTH // 2, HEIGHT - 30) self.level = level self.ball = Ball() self.score = 0 self.blocks = [int(random(1.5,4.5)) for k in range(B_ROWS * B_COLS)] self.game_over = False self.blocks_gone = False # x, y positions of block centers self.centers = [((i % B_COLS) * b_width + B_MARGINS + bw2, b_height * (i // B_COLS) + B_MARGINS + bh2) for i in range(B_ROWS * B_COLS)] def update_ball(self): self.ball.update() px, py = self.paddle.x, self.paddle.y if ((px - P_WIDTH -r) <= self.ball.pos.x <= (px + P_WIDTH + r) and (py - P_HEIGHT - r <= self.ball.pos.y <= py - P_HEIGHT)): # ball is hitting paddle rectangle, reverse y_speed self.ball.vel.y = -self.ball.vel.y self.score = self.score + 1 fill(100,100,200) ellipse(self.ball.pos.x, self.ball.pos.y, BALL_DIAM, BALL_DIAM) def update_paddle(self): fill(0,255,0) rect(self.paddle.x, self.paddle.y, 2 * P_WIDTH, 2* P_HEIGHT) if (self.ball.pos.y >= HEIGHT): fill(255) textSize(40) textAlign(CENTER) text("Game over", WIDTH // 2, HEIGHT // 2 + 40) self.game_over = True def update_texts(self): background(25) noStroke() # Set fill color to white fill(255) # Display score textSize(16) textAlign(RIGHT) text("Score", 80, HEIGHT - 6) textAlign(LEFT) text(self.score, 90, HEIGHT - 6) # text("Frames: %.1f" %frameRate(), 130, HEIGHT - 6) # Display level textAlign(RIGHT) text("Level", WIDTH - 50, HEIGHT - 6) textAlign(LEFT) text(self.level, WIDTH - 40, HEIGHT - 6) def update_blocks(self): self.blocks_gone = True # Loop through all the potential blocks collide = False for i in range(B_ROWS * B_COLS): # Check if we have that block if (self.blocks[i]): x_cent, y_cent = self.centers[i] self.blocks_gone = False if not collide: bx, by = self.ball.pos.x, self.ball.pos.y # check bounce on top/bottom if ((x_cent - dw - r < bx < x_cent + dw + r) and ((y_cent + dh < by < y_cent + dh + r) or (y_cent -dh - r < by < y_cent - dh))): self.blocks[i] = 0 self.ball.vel.y = -self.ball.vel.y self.score = self.score + 5 collide = True # check bounce on left/right if ((y_cent - dh - r < by < y_cent + dh + r) and ((x_cent + dw < bx < x_cent + dw + r) or (x_cent - dw -r < bx < x_cent - dw))): self.blocks[i] = 0 self.ball.vel.x = -self.ball.vel.x self.score = self.score + 5 collide = True if collide: break def draw_blocks(self): for i in range(B_ROWS * B_COLS): if (self.blocks[i]): fill(cell_colors[self.blocks[i]]) x_cent, y_cent = self.centers[i] rect(x_cent, y_cent, 2 * dw, 2 * dh) def update(self): self.update_texts() self.update_ball() self.update_paddle() self.update_blocks() self.draw_blocks() ================================================ FILE: docs/examples/pyodide/breakout/breakout.py ================================================ # Inspired by Mats Lund: # https://github.com/CoderMats/breakout # Completely rewritten WIDTH = 640 # canvas width HEIGHT = 400 # canvas height P_WIDTH = 50 # paddle halfwidth P_HEIGHT = 8 # paddle halfheight B_ROWS = 5 # bricks, number of rows B_COLS = 10 # bricks, number of columns B_MARGINS = 15 # margins for bricks (bottom, side) BALL_DIAM = 10 # diameter of ball FPS = 30 # frames per second # block width, height, total space b_width = (WIDTH - 2 * B_MARGINS) // B_COLS b_height = 40 b_gap = 15 # gap between blocks # constants, helper variables bw2 = b_width // 2 bh2 = b_height // 2 dw = (b_width - b_gap) // 2 dh = (b_height - b_gap) // 2 r = BALL_DIAM // 2 # ball diameter y_paddle = HEIGHT - 30 cell_colors = {1:"green" , 2:"blue" , 3:"red" , 4:"yellow"} game = None def setup(): global game createCanvas(WIDTH, HEIGHT, P2D) rectMode(CENTER) frameRate(FPS) noCursor() game = Game() def new_game(): global game new_level = game.level + int(game.blocks_gone) game = Game(level=new_level) def draw(): global game if game.blocks_gone: new_game() if not game.game_over: game.paddle.x = min(WIDTH - P_WIDTH, max(mouseX, P_WIDTH)) game.update() def keyPressed(): if key == " ": new_game() class Ball(object): def __init__(self,level=1): # ball velocity self.vel = PVector(3 + int(1.5 * level),-3 - int(1.5 * level)) xp = WIDTH // 2 + int(random(-P_WIDTH - 40,P_WIDTH + 40)) yp = y_paddle - P_HEIGHT // 2 - r - 1 self.pos = PVector(xp,yp) # ball position def update(self): self.pos = PVector.add(self.pos,self.vel) if (self.pos.x >= WIDTH or self.pos.x <= 0): self.vel.x = -self.vel.x if (self.pos.y <= 0): self.vel.y = -self.vel.y class Game(object): def __init__(self,level=1): self.paddle = PVector(WIDTH // 2, HEIGHT - 30) self.level = level self.ball = Ball() self.score = 0 self.blocks = [int(random(1.5,4.5)) for k in range(B_ROWS * B_COLS)] self.game_over = False self.blocks_gone = False # x, y positions of block centers self.centers = [((i % B_COLS) * b_width + B_MARGINS + bw2, b_height * (i // B_COLS) + B_MARGINS + bh2) for i in range(B_ROWS * B_COLS)] def update_ball(self): self.ball.update() px, py = self.paddle.x, self.paddle.y if ((px - P_WIDTH -r) <= self.ball.pos.x <= (px + P_WIDTH + r) and (py - P_HEIGHT - r <= self.ball.pos.y <= py - P_HEIGHT)): # ball is hitting paddle rectangle, reverse y_speed self.ball.vel.y = -self.ball.vel.y self.score = self.score + 1 fill(100,100,200) ellipse(self.ball.pos.x, self.ball.pos.y, BALL_DIAM, BALL_DIAM) def update_paddle(self): fill(0,255,0) rect(self.paddle.x, self.paddle.y, 2 * P_WIDTH, 2* P_HEIGHT) if (self.ball.pos.y >= HEIGHT): fill(255) textSize(40) textAlign(CENTER) text("Game over", WIDTH // 2, HEIGHT // 2 + 40) self.game_over = True def update_texts(self): background(25) noStroke() # Set fill color to white fill(255) # Display score textSize(16) textAlign(RIGHT) text("Score", 80, HEIGHT - 6) textAlign(LEFT) text(self.score, 90, HEIGHT - 6) # text("Frames: %.1f" %frameRate(), 130, HEIGHT - 6) # Display level textAlign(RIGHT) text("Level", WIDTH - 50, HEIGHT - 6) textAlign(LEFT) text(self.level, WIDTH - 40, HEIGHT - 6) def update_blocks(self): self.blocks_gone = True # Loop through all the potential blocks collide = False for i in range(B_ROWS * B_COLS): # Check if we have that block if (self.blocks[i]): x_cent, y_cent = self.centers[i] self.blocks_gone = False if not collide: bx, by = self.ball.pos.x, self.ball.pos.y # check bounce on top/bottom if ((x_cent - dw - r < bx < x_cent + dw + r) and ((y_cent + dh < by < y_cent + dh + r) or (y_cent -dh - r < by < y_cent - dh))): self.blocks[i] = 0 self.ball.vel.y = -self.ball.vel.y self.score = self.score + 5 collide = True # check bounce on left/right if ((y_cent - dh - r < by < y_cent + dh + r) and ((x_cent + dw < bx < x_cent + dw + r) or (x_cent - dw -r < bx < x_cent - dw))): self.blocks[i] = 0 self.ball.vel.x = -self.ball.vel.x self.score = self.score + 5 collide = True if collide: break def draw_blocks(self): for i in range(B_ROWS * B_COLS): if (self.blocks[i]): fill(cell_colors[self.blocks[i]]) x_cent, y_cent = self.centers[i] rect(x_cent, y_cent, 2 * dw, 2 * dh) def update(self): self.update_texts() self.update_ball() self.update_paddle() self.update_blocks() self.draw_blocks() ================================================ FILE: docs/examples/pyodide/breakout/index.html ================================================ breakout - pyp5js

Python code here.

# Inspired by Mats Lund:
# https://github.com/CoderMats/breakout 
# Completely rewritten

WIDTH =  640    # canvas width
HEIGHT = 400    # canvas height
P_WIDTH =  50   # paddle halfwidth
P_HEIGHT = 8    # paddle halfheight
B_ROWS = 5      # bricks, number of rows
B_COLS = 10     # bricks, number of columns
B_MARGINS = 15  # margins for bricks (bottom, side)
BALL_DIAM = 10  # diameter of ball
FPS = 30        # frames per second

# block width, height, total space
b_width = (WIDTH - 2 * B_MARGINS) // B_COLS
b_height = 40  
b_gap = 15      # gap between blocks

# constants, helper variables
bw2 = b_width // 2 
bh2 = b_height // 2
dw = (b_width - b_gap) // 2
dh = (b_height - b_gap) // 2
r = BALL_DIAM // 2    # ball diameter
y_paddle = HEIGHT - 30

cell_colors = {1:"green" , 2:"blue" , 3:"red" , 4:"yellow"}

game = None

def setup():
    global game
    createCanvas(WIDTH, HEIGHT, P2D)
    rectMode(CENTER)
    frameRate(FPS)
    noCursor()
    game = Game()

def new_game():
    global game
    new_level = game.level + int(game.blocks_gone)
    game = Game(level=new_level)
        
def draw():
    global game
    if game.blocks_gone:
        new_game()    
    if not game.game_over:
        game.paddle.x = min(WIDTH - P_WIDTH, max(mouseX, P_WIDTH))
    game.update()        

def keyPressed():
    if key == " ":
        new_game()

class Ball(object):
    def __init__(self,level=1):
        # ball velocity
        self.vel = PVector(3 + int(1.5 * level),-3 - int(1.5 * level))
        xp = WIDTH // 2 + int(random(-P_WIDTH - 40,P_WIDTH + 40))
        yp = y_paddle - P_HEIGHT // 2 - r - 1      
        self.pos = PVector(xp,yp)                   # ball position

    def update(self):    
        self.pos = PVector.add(self.pos,self.vel)
        if (self.pos.x >= WIDTH or self.pos.x <= 0):  
            self.vel.x = -self.vel.x
        if (self.pos.y <= 0):
            self.vel.y = -self.vel.y

class Game(object):
    def __init__(self,level=1):
        self.paddle = PVector(WIDTH // 2, HEIGHT - 30)
        self.level = level
        self.ball = Ball()
        self.score = 0 
        self.blocks = [int(random(1.5,4.5)) for k in  range(B_ROWS * B_COLS)]
        self.game_over = False
        self.blocks_gone = False
        # x, y positions of block centers
        self.centers = [((i % B_COLS) * b_width + B_MARGINS + bw2,
                         b_height * (i // B_COLS) + B_MARGINS + bh2) 
                         for i in range(B_ROWS * B_COLS)]

    def update_ball(self):
        self.ball.update()
        px, py = self.paddle.x, self.paddle.y
        if ((px - P_WIDTH -r) <= self.ball.pos.x
             <= (px + P_WIDTH + r) and 
            (py - P_HEIGHT - r <= self.ball.pos.y 
             <= py - P_HEIGHT)):
            # ball is hitting paddle rectangle, reverse y_speed
            self.ball.vel.y = -self.ball.vel.y
            self.score = self.score + 1
        fill(100,100,200)
        ellipse(self.ball.pos.x, self.ball.pos.y, BALL_DIAM, BALL_DIAM)

            
    def update_paddle(self):
        fill(0,255,0)
        rect(self.paddle.x, self.paddle.y, 2 * P_WIDTH, 2* P_HEIGHT)
        if (self.ball.pos.y >= HEIGHT):
            fill(255) 
            textSize(40)
            textAlign(CENTER)
            text("Game over", WIDTH // 2, HEIGHT // 2 + 40)
            self.game_over = True 
    
    def update_texts(self):            
        background(25)
        noStroke()
        # Set fill color to white
        fill(255)
        # Display score
        textSize(16)
        textAlign(RIGHT)
        text("Score", 80, HEIGHT - 6)
        textAlign(LEFT)
        text(self.score, 90, HEIGHT - 6)
        # text("Frames: %.1f" %frameRate(), 130, HEIGHT - 6) 
        # Display level
        textAlign(RIGHT)
        text("Level", WIDTH - 50, HEIGHT - 6)
        textAlign(LEFT)
        text(self.level, WIDTH - 40, HEIGHT - 6)

    def update_blocks(self):
        self.blocks_gone = True
        # Loop through all the potential blocks
        collide = False

        for i in range(B_ROWS * B_COLS):
            # Check if we have that block
            if (self.blocks[i]):
                x_cent, y_cent = self.centers[i]
                self.blocks_gone = False
                    
                if not collide:
                    bx, by = self.ball.pos.x, self.ball.pos.y     
                    # check bounce on top/bottom
                    if ((x_cent - dw - r < bx < x_cent + dw + r) and 
                        ((y_cent + dh < by < y_cent + dh + r) or 
                        (y_cent -dh - r < by < y_cent - dh))):
                        self.blocks[i] = 0
                        self.ball.vel.y = -self.ball.vel.y
                        self.score = self.score + 5
                        collide = True
                     
                    # check bounce on left/right
                    if ((y_cent - dh - r < by < y_cent + dh + r) and 
                        ((x_cent + dw < bx < x_cent + dw + r) or 
                        (x_cent - dw -r < bx < x_cent - dw))):
                        self.blocks[i] = 0
                        self.ball.vel.x = -self.ball.vel.x
                        self.score = self.score + 5
                        collide = True
            if collide:
                break
                    
    def draw_blocks(self):
        for i in range(B_ROWS * B_COLS):
            if (self.blocks[i]):
                fill(cell_colors[self.blocks[i]])
                x_cent, y_cent = self.centers[i]
                rect(x_cent, y_cent, 2 * dw, 2 * dh)
                        
    def update(self):
        self.update_texts()
        self.update_ball()
        self.update_paddle()
        self.update_blocks()    
        self.draw_blocks()
        
                  
================================================ FILE: docs/examples/pyodide/breakout/static/p5.js ================================================ /*! p5.js v1.0.0 February 29, 2020 */ !function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).p5=e()}}(function(){return function o(a,s,l){function u(t,e){if(!s[t]){if(!a[t]){var r="function"==typeof require&&require;if(!e&&r)return r(t,!0);if(h)return h(t,!0);var i=new Error("Cannot find module '"+t+"'");throw i.code="MODULE_NOT_FOUND",i}var n=s[t]={exports:{}};a[t][0].call(n.exports,function(e){return u(a[t][1][e]||e)},n,n.exports,o,a,s,l)}return s[t].exports}for(var h="function"==typeof require&&require,e=0;e>16&255,a[s++]=t>>8&255,a[s++]=255&t;2===o&&(t=u[e.charCodeAt(r)]<<2|u[e.charCodeAt(r+1)]>>4,a[s++]=255&t);1===o&&(t=u[e.charCodeAt(r)]<<10|u[e.charCodeAt(r+1)]<<4|u[e.charCodeAt(r+2)]>>2,a[s++]=t>>8&255,a[s++]=255&t);return a},r.fromByteArray=function(e){for(var t,r=e.length,i=r%3,n=[],o=0,a=r-i;o>2]+s[t<<4&63]+"==")):2==i&&(t=(e[r-2]<<8)+e[r-1],n.push(s[t>>10]+s[t>>4&63]+s[t<<2&63]+"="));return n.join("")};for(var s=[],u=[],h="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=0,o=i.length;n>18&63]+s[n>>12&63]+s[n>>6&63]+s[63&n]);return o.join("")}u["-".charCodeAt(0)]=62,u["_".charCodeAt(0)]=63},{}],20:[function(e,t,r){},{}],21:[function(N,e,F){(function(c){"use strict";var i=N("base64-js"),o=N("ieee754"),e="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;F.Buffer=c,F.SlowBuffer=function(e){+e!=e&&(e=0);return c.alloc(+e)},F.INSPECT_MAX_BYTES=50;var r=2147483647;function a(e){if(r>>1;case"base64":return O(e).length;default:if(n)return i?-1:R(e).length;t=(""+t).toLowerCase(),n=!0}}function d(e,t,r){var i=e[t];e[t]=e[r],e[r]=i}function p(e,t,r,i,n){if(0===e.length)return-1;if("string"==typeof r?(i=r,r=0):2147483647=e.length){if(n)return-1;r=e.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof t&&(t=c.from(t,i)),c.isBuffer(t))return 0===t.length?-1:m(e,t,r,i,n);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):m(e,[t],r,i,n);throw new TypeError("val must be string, number or Buffer")}function m(e,t,r,i,n){var o,a=1,s=e.length,l=t.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(e.length<2||t.length<2)return-1;s/=a=2,l/=2,r/=2}function u(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(n){var h=-1;for(o=r;o>8,n=r%256,o.push(n),o.push(i);return o}(t,e.length-r),e,r,i)}function b(e,t,r){return 0===t&&r===e.length?i.fromByteArray(e):i.fromByteArray(e.slice(t,r))}function _(e,t,r){r=Math.min(e.length,r);for(var i=[],n=t;n>>10&1023|55296),h=56320|1023&h),i.push(h),n+=c}return function(e){var t=e.length;if(t<=x)return String.fromCharCode.apply(String,e);var r="",i=0;for(;ithis.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e=e||"utf8";;)switch(e){case"hex":return M(this,t,r);case"utf8":case"utf-8":return _(this,t,r);case"ascii":return w(this,t,r);case"latin1":case"binary":return S(this,t,r);case"base64":return b(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,t,r);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}.apply(this,arguments)},c.prototype.equals=function(e){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===c.compare(this,e)},c.prototype.inspect=function(){var e="",t=F.INSPECT_MAX_BYTES;return e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(e+=" ... "),""},e&&(c.prototype[e]=c.prototype.inspect),c.prototype.compare=function(e,t,r,i,n){if(A(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),t<0||r>e.length||i<0||n>this.length)throw new RangeError("out of range index");if(n<=i&&r<=t)return 0;if(n<=i)return-1;if(r<=t)return 1;if(this===e)return 0;for(var o=(n>>>=0)-(i>>>=0),a=(r>>>=0)-(t>>>=0),s=Math.min(o,a),l=this.slice(i,n),u=e.slice(t,r),h=0;h>>=0,isFinite(r)?(r>>>=0,void 0===i&&(i="utf8")):(i=r,r=void 0)}var n=this.length-t;if((void 0===r||nthis.length)throw new RangeError("Attempt to write outside buffer bounds");i=i||"utf8";for(var o,a,s,l,u,h,c=!1;;)switch(i){case"hex":return g(this,e,t,r);case"utf8":case"utf-8":return u=t,h=r,D(R(e,(l=this).length-u),l,u,h);case"ascii":return v(this,e,t,r);case"latin1":case"binary":return v(this,e,t,r);case"base64":return o=this,a=t,s=r,D(O(e),o,a,s);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return y(this,e,t,r);default:if(c)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),c=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var x=4096;function w(e,t,r){var i="";r=Math.min(e.length,r);for(var n=t;ne.length)throw new RangeError("Index out of range")}function P(e,t,r,i){if(r+i>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function L(e,t,r,i,n){return t=+t,r>>>=0,n||P(e,0,r,4),o.write(e,t,r,i,23,4),r+4}function k(e,t,r,i,n){return t=+t,r>>>=0,n||P(e,0,r,8),o.write(e,t,r,i,52,8),r+8}c.prototype.slice=function(e,t){var r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):r>>=0,t>>>=0,r||T(e,t,this.length);for(var i=this[e],n=1,o=0;++o>>=0,t>>>=0,r||T(e,t,this.length);for(var i=this[e+--t],n=1;0>>=0,t||T(e,1,this.length),this[e]},c.prototype.readUInt16LE=function(e,t){return e>>>=0,t||T(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUInt16BE=function(e,t){return e>>>=0,t||T(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUInt32LE=function(e,t){return e>>>=0,t||T(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUInt32BE=function(e,t){return e>>>=0,t||T(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||T(e,t,this.length);for(var i=this[e],n=1,o=0;++o>>=0,t>>>=0,r||T(e,t,this.length);for(var i=t,n=1,o=this[e+--i];0>>=0,t||T(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){e>>>=0,t||T(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(e,t){e>>>=0,t||T(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(e,t){return e>>>=0,t||T(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return e>>>=0,t||T(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readFloatLE=function(e,t){return e>>>=0,t||T(e,4,this.length),o.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return e>>>=0,t||T(e,4,this.length),o.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return e>>>=0,t||T(e,8,this.length),o.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return e>>>=0,t||T(e,8,this.length),o.read(this,e,!1,52,8)},c.prototype.writeUIntLE=function(e,t,r,i){e=+e,t>>>=0,r>>>=0,i||C(this,e,t,r,Math.pow(2,8*r)-1,0);var n=1,o=0;for(this[t]=255&e;++o>>=0,r>>>=0,i||C(this,e,t,r,Math.pow(2,8*r)-1,0);var n=r-1,o=1;for(this[t+n]=255&e;0<=--n&&(o*=256);)this[t+n]=e/o&255;return t+r},c.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,1,255,0),this[t]=255&e,t+1},c.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},c.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeIntLE=function(e,t,r,i){if(e=+e,t>>>=0,!i){var n=Math.pow(2,8*r-1);C(this,e,t,r,n-1,-n)}var o=0,a=1,s=0;for(this[t]=255&e;++o>0)-s&255;return t+r},c.prototype.writeIntBE=function(e,t,r,i){if(e=+e,t>>>=0,!i){var n=Math.pow(2,8*r-1);C(this,e,t,r,n-1,-n)}var o=r-1,a=1,s=0;for(this[t+o]=255&e;0<=--o&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+r},c.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},c.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeFloatLE=function(e,t,r){return L(this,e,t,!0,r)},c.prototype.writeFloatBE=function(e,t,r){return L(this,e,t,!1,r)},c.prototype.writeDoubleLE=function(e,t,r){return k(this,e,t,!0,r)},c.prototype.writeDoubleBE=function(e,t,r){return k(this,e,t,!1,r)},c.prototype.copy=function(e,t,r,i){if(!c.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r=r||0,i||0===i||(i=this.length),t>=e.length&&(t=e.length),t=t||0,0=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t>>=0,r=void 0===r?this.length:r>>>0,"number"==typeof(e=e||0))for(o=t;o>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function O(e){return i.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(t,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function D(e,t,r,i){for(var n=0;n=t.length||n>=e.length);++n)t[n+r]=e[n];return n}function A(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function I(e){return e!=e}var U=function(){for(var e="0123456789abcdef",t=new Array(256),r=0;r<16;++r)for(var i=16*r,n=0;n<16;++n)t[i+n]=e[r]+e[n];return t}()}).call(this,N("buffer").Buffer)},{"base64-js":19,buffer:21,ieee754:30}],22:[function(e,t,r){"use strict";t.exports=e("./").polyfill()},{"./":23}],23:[function(z,r,i){(function(j,V){var e,t;e=this,t=function(){"use strict";function l(e){return"function"==typeof e}var r=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},i=0,t=void 0,n=void 0,a=function(e,t){f[i]=e,f[i+1]=t,2===(i+=2)&&(n?n(d):y())};var e="undefined"!=typeof window?window:void 0,o=e||{},s=o.MutationObserver||o.WebKitMutationObserver,u="undefined"==typeof self&&void 0!==j&&"[object process]"==={}.toString.call(j),h="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function c(){var e=setTimeout;return function(){return e(d,1)}}var f=new Array(1e3);function d(){for(var e=0;e":">",'"':""","'":"'","/":"/"};function S(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,function(e){return w[e]}):e}var M=function(){function i(e){var t,r=1=this.maxReplaces)break}for(a=0;r=this.regexp.exec(e);){if(void 0===(i=h(r[1].trim())))if("function"==typeof c){var d=c(e,r,t);i="string"==typeof d?d:""}else this.logger.warn("missed to pass in variable ".concat(r[1]," for interpolating ").concat(e)),i="";else"string"==typeof i||this.useRawValueToEscape||(i=v(i));if(i=this.escapeValue?u(this.escape(i)):u(i),e=e.replace(r[0],i),this.regexp.lastIndex=0,++a>=this.maxReplaces)break}return e}},{key:"nest",value:function(e,t,r){var i,n,o=D({},2>1,h=-7,c=r?n-1:0,f=r?-1:1,d=e[t+c];for(c+=f,o=d&(1<<-h)-1,d>>=-h,h+=s;0>=-h,h+=i;0>1,f=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,d=i?0:o-1,p=i?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=h):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),2<=(t+=1<=a+c?f/l:f*Math.pow(2,1-c))*l&&(a++,l/=2),h<=a+c?(s=0,a=h):1<=a+c?(s=(t*l-1)*Math.pow(2,n),a+=c):(s=t*Math.pow(2,c-1)*Math.pow(2,n),a=0));8<=n;e[r+d]=255&s,d+=p,s/=256,n-=8);for(a=a<Math.abs(e[0])&&(t=1),Math.abs(e[2])>Math.abs(e[t])&&(t=2),t}var C=4e150;function P(e,t){e.f+=t.f,e.b.f+=t.b.f}function u(e,t,r){return e=e.a,t=t.a,r=r.a,t.b.a===e?r.b.a===e?v(t.a,r.a)?b(r.b.a,t.a,r.a)<=0:0<=b(t.b.a,r.a,t.a):b(r.b.a,e,r.a)<=0:r.b.a===e?0<=b(t.b.a,e,t.a):(t=y(t.b.a,e,t.a),(e=y(r.b.a,e,r.a))<=t)}function L(e){e.a.i=null;var t=e.e;t.a.c=t.c,t.c.a=t.a,e.e=null}function h(e,t){c(e.a),e.c=!1,(e.a=t).i=e}function k(e){for(var t=e.a.a;(e=fe(e)).a.a===t;);return e.c&&(h(e,t=f(ce(e).a.b,e.a.e)),e=fe(e)),e}function R(e,t,r){var i=new he;return i.a=r,i.e=W(e.f,t.e,i),r.i=i}function O(e,t){switch(e.s){case 100130:return 0!=(1&t);case 100131:return 0!==t;case 100132:return 0>1]],s[a[u]])?le(r,u):ue(r,u)),s[o]=null,l[o]=r.b,r.b=o}else for(r.c[-(o+1)]=null;0Math.max(a.a,l.a))return!1;if(v(o,a)){if(0i.f&&(i.f*=2,i.c=oe(i.c,i.f+1)),0===i.b?r=n:(r=i.b,i.b=i.c[i.b]),i.e[r]=t,i.c[r]=n,i.d[n]=r,i.h&&ue(i,n),r}return i=e.a++,e.c[i]=t,-(i+1)}function ie(e){if(0===e.a)return se(e.b);var t=e.c[e.d[e.a-1]];if(0!==e.b.a&&v(ae(e.b),t))return se(e.b);for(;--e.a,0e.a||v(i[a],i[l])){n[r[o]=a]=o;break}n[r[o]=l]=o,o=s}}function ue(e,t){for(var r=e.d,i=e.e,n=e.c,o=t,a=r[o];;){var s=o>>1,l=r[s];if(0==s||v(i[l],i[a])){n[r[o]=a]=o;break}n[r[o]=l]=o,o=s}}function he(){this.e=this.a=null,this.f=0,this.c=this.b=this.h=this.d=!1}function ce(e){return e.e.c.b}function fe(e){return e.e.a.b}(i=q.prototype).x=function(){Y(this,0)},i.B=function(e,t){switch(e){case 100142:return;case 100140:switch(t){case 100130:case 100131:case 100132:case 100133:case 100134:return void(this.s=t)}break;case 100141:return void(this.m=!!t);default:return void Z(this,100900)}Z(this,100901)},i.y=function(e){switch(e){case 100142:return 0;case 100140:return this.s;case 100141:return this.m;default:Z(this,100900)}return!1},i.A=function(e,t,r){this.j[0]=e,this.j[1]=t,this.j[2]=r},i.z=function(e,t){var r=t||null;switch(e){case 100100:case 100106:this.h=r;break;case 100104:case 100110:this.l=r;break;case 100101:case 100107:this.k=r;break;case 100102:case 100108:this.i=r;break;case 100103:case 100109:this.p=r;break;case 100105:case 100111:this.o=r;break;case 100112:this.r=r;break;default:Z(this,100900)}},i.C=function(e,t){var r=!1,i=[0,0,0];Y(this,2);for(var n=0;n<3;++n){var o=e[n];o<-1e150&&(o=-1e150,r=!0),1e150n[u]&&(n[u]=h,a[u]=l)}if(l=0,n[1]-o[1]>n[0]-o[0]&&(l=1),n[2]-o[2]>n[l]-o[l]&&(l=2),o[l]>=n[l])i[0]=0,i[1]=0,i[2]=1;else{for(n=0,o=s[l],a=a[l],s=[0,0,0],o=[o.g[0]-a.g[0],o.g[1]-a.g[1],o.g[2]-a.g[2]],u=[0,0,0],l=r.e;l!==r;l=l.e)u[0]=l.g[0]-a.g[0],u[1]=l.g[1]-a.g[1],u[2]=l.g[2]-a.g[2],s[0]=o[1]*u[2]-o[2]*u[1],s[1]=o[2]*u[0]-o[0]*u[2],s[2]=o[0]*u[1]-o[1]*u[0],n<(h=s[0]*s[0]+s[1]*s[1]+s[2]*s[2])&&(n=h,i[0]=s[0],i[1]=s[1],i[2]=s[2]);n<=0&&(i[0]=i[1]=i[2]=0,i[T(o)]=1)}r=!0}for(s=T(i),l=this.b.c,n=(s+1)%3,a=(s+2)%3,s=0>=l,h-=l,g!=o){if(g==a)break;for(var v=g>8,++y;var _=b;if(i>=8;null!==m&&s<4096&&(p[s++]=m<<8|_,u+1<=s&&l<12&&(++l,u=u<<1|1)),m=g}else s=1+a,u=(1<<(l=n+1))-1,m=null}return f!==i&&console.log("Warning, gif stream shorter than expected."),r}try{r.GifWriter=function(v,e,t,r){var y=0,i=void 0===(r=void 0===r?{}:r).loop?null:r.loop,b=void 0===r.palette?null:r.palette;if(e<=0||t<=0||65535>=1;)++n;if(a=1<>8&255,v[y++]=255&t,v[y++]=t>>8&255,v[y++]=(null!==b?128:0)|n,v[y++]=o,v[y++]=0,null!==b)for(var s=0,l=b.length;s>16&255,v[y++]=u>>8&255,v[y++]=255&u}if(null!==i){if(i<0||65535>8&255,v[y++]=0}var x=!1;this.addFrame=function(e,t,r,i,n,o){if(!0===x&&(--y,x=!1),o=void 0===o?{}:o,e<0||t<0||65535>=1;)++u;l=1<>8&255,v[y++]=d,v[y++]=0),v[y++]=44,v[y++]=255&e,v[y++]=e>>8&255,v[y++]=255&t,v[y++]=t>>8&255,v[y++]=255&r,v[y++]=r>>8&255,v[y++]=255&i,v[y++]=i>>8&255,v[y++]=!0===a?128|u-1:0,!0===a)for(var p=0,m=s.length;p>16&255,v[y++]=g>>8&255,v[y++]=255&g}return y=function(t,r,e,i){t[r++]=e;var n=r++,o=1<>=8,h-=8,r===n+256&&(t[n]=255,n=r++)}function d(e){c|=e<>=8,h-=8,r===n+256&&(t[n]=255,n=r++);4096===l?(d(o),l=1+s,u=e+1,m={}):(1<>7,n=1<<1+(7&r);x[e++],x[e++];var o=null,a=null;i&&(o=e,e+=3*(a=n));var s=!0,l=[],u=0,h=null,c=0,f=null;for(this.width=w,this.height=t;s&&e>2&7,e++;break;case 254:for(;;){if(!(0<=(C=x[e++])))throw Error("Invalid block size");if(0===C)break;e+=C}break;default:throw new Error("Unknown graphic control label: 0x"+x[e-1].toString(16))}break;case 44:var p=x[e++]|x[e++]<<8,m=x[e++]|x[e++]<<8,g=x[e++]|x[e++]<<8,v=x[e++]|x[e++]<<8,y=x[e++],b=y>>6&1,_=1<<1+(7&y),S=o,M=a,E=!1;if(y>>7){E=!0;S=e,e+=3*(M=_)}var T=e;for(e++;;){var C;if(!(0<=(C=x[e++])))throw Error("Invalid block size");if(0===C)break;e+=C}l.push({x:p,y:m,width:g,height:v,has_local_palette:E,palette_offset:S,palette_size:M,data_offset:T,data_length:e-T,transparent_index:h,interlaced:!!b,delay:u,disposal:c});break;case 59:s=!1;break;default:throw new Error("Unknown gif block: 0x"+x[e-1].toString(16))}this.numFrames=function(){return l.length},this.loopCount=function(){return f},this.frameInfo=function(e){if(e<0||e>=l.length)throw new Error("Frame index out of range.");return l[e]},this.decodeAndBlitFrameBGRA=function(e,t){var r=this.frameInfo(e),i=r.width*r.height,n=new Uint8Array(i);P(x,r.data_offset,n,i);var o=r.palette_offset,a=r.transparent_index;null===a&&(a=256);var s=r.width,l=w-s,u=s,h=4*(r.y*w+r.x),c=4*((r.y+r.height)*w+r.x),f=h,d=4*l;!0===r.interlaced&&(d+=4*w*7);for(var p=8,m=0,g=n.length;m>=1)),v===a)f+=4;else{var y=x[o+3*v],b=x[o+3*v+1],_=x[o+3*v+2];t[f++]=_,t[f++]=b,t[f++]=y,t[f++]=255}--u}},this.decodeAndBlitFrameRGBA=function(e,t){var r=this.frameInfo(e),i=r.width*r.height,n=new Uint8Array(i);P(x,r.data_offset,n,i);var o=r.palette_offset,a=r.transparent_index;null===a&&(a=256);var s=r.width,l=w-s,u=s,h=4*(r.y*w+r.x),c=4*((r.y+r.height)*w+r.x),f=h,d=4*l;!0===r.interlaced&&(d+=4*w*7);for(var p=8,m=0,g=n.length;m>=1)),v===a)f+=4;else{var y=x[o+3*v],b=x[o+3*v+1],_=x[o+3*v+2];t[f++]=y,t[f++]=b,t[f++]=_,t[f++]=255}--u}}}}catch(e){}},{}],33:[function(jr,t,r){(function(Gr){var e;e=this,function(E){"use strict";function e(e){if(null==this)throw TypeError();var t=String(this),r=t.length,i=e?Number(e):0;if(i!=i&&(i=0),!(i<0||r<=i)){var n,o=t.charCodeAt(i);return 55296<=o&&o<=56319&&i+1>>=1,t}function _(e,t,r){if(!t)return r;for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<>>16-t;return e.tag>>>=t,e.bitcount-=t,i+r}function x(e,t){for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<>>=1,++n,r+=t.table[n],0<=(i-=t.table[n]););return e.tag=o,e.bitcount-=n,t.trans[r+i]}function w(e,t,r){var i,n,o,a,s,l;for(i=_(e,5,257),n=_(e,5,1),o=_(e,4,4),a=0;a<19;++a)g[a]=0;for(a=0;athis.x2&&(this.x2=e)),"number"==typeof t&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=t,this.y2=t),tthis.y2&&(this.y2=t))},C.prototype.addX=function(e){this.addPoint(e,null)},C.prototype.addY=function(e){this.addPoint(null,e)},C.prototype.addBezier=function(e,t,r,i,n,o,a,s){var l=this,u=[e,t],h=[r,i],c=[n,o],f=[a,s];this.addPoint(e,t),this.addPoint(a,s);for(var d=0;d<=1;d++){var p=6*u[d]-12*h[d]+6*c[d],m=-3*u[d]+9*h[d]-9*c[d]+3*f[d],g=3*h[d]-3*u[d];if(0!=m){var v=Math.pow(p,2)-4*g*m;if(!(v<0)){var y=(-p+Math.sqrt(v))/(2*m);0>8&255,255&e]},A.USHORT=U(2),D.SHORT=function(e){return 32768<=e&&(e=-(65536-e)),[e>>8&255,255&e]},A.SHORT=U(2),D.UINT24=function(e){return[e>>16&255,e>>8&255,255&e]},A.UINT24=U(3),D.ULONG=function(e){return[e>>24&255,e>>16&255,e>>8&255,255&e]},A.ULONG=U(4),D.LONG=function(e){return R<=e&&(e=-(2*R-e)),[e>>24&255,e>>16&255,e>>8&255,255&e]},A.LONG=U(4),D.FIXED=D.ULONG,A.FIXED=A.ULONG,D.FWORD=D.SHORT,A.FWORD=A.SHORT,D.UFWORD=D.USHORT,A.UFWORD=A.USHORT,D.LONGDATETIME=function(e){return[0,0,0,0,e>>24&255,e>>16&255,e>>8&255,255&e]},A.LONGDATETIME=U(8),D.TAG=function(e){return k.argument(4===e.length,"Tag should be exactly 4 ASCII characters."),[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]},A.TAG=U(4),D.Card8=D.BYTE,A.Card8=A.BYTE,D.Card16=D.USHORT,A.Card16=A.USHORT,D.OffSize=D.BYTE,A.OffSize=A.BYTE,D.SID=D.USHORT,A.SID=A.USHORT,D.NUMBER=function(e){return-107<=e&&e<=107?[e+139]:108<=e&&e<=1131?[247+((e-=108)>>8),255&e]:-1131<=e&&e<=-108?[251+((e=-e-108)>>8),255&e]:-32768<=e&&e<=32767?D.NUMBER16(e):D.NUMBER32(e)},A.NUMBER=function(e){return D.NUMBER(e).length},D.NUMBER16=function(e){return[28,e>>8&255,255&e]},A.NUMBER16=U(3),D.NUMBER32=function(e){return[29,e>>24&255,e>>16&255,e>>8&255,255&e]},A.NUMBER32=U(5),D.REAL=function(e){var t=e.toString(),r=/\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec(t);if(r){var i=parseFloat("1e"+((r[2]?+r[2]:0)+r[1].length));t=(Math.round(e*i)/i).toString()}for(var n="",o=0,a=t.length;o>8&255,t[t.length]=255&i}return t},A.UTF16=function(e){return 2*e.length};var N={"x-mac-croatian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈ƫȅ ÀÃÕŒœĐ—“”‘’÷◊©⁄€‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ","x-mac-cyrillic":"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю","x-mac-gaelic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØḂ±≤≥ḃĊċḊḋḞḟĠġṀæøṁṖṗɼƒſṠ«»… ÀÃÕŒœ–—“”‘’ṡẛÿŸṪ€‹›Ŷŷṫ·Ỳỳ⁊ÂÊÁËÈÍÎÏÌÓÔ♣ÒÚÛÙıÝýŴŵẄẅẀẁẂẃ","x-mac-greek":"Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦€ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ­","x-mac-icelandic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüݰ¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-inuit":"ᐃᐄᐅᐆᐊᐋᐱᐲᐳᐴᐸᐹᑉᑎᑏᑐᑑᑕᑖᑦᑭᑮᑯᑰᑲᑳᒃᒋᒌᒍᒎᒐᒑ°ᒡᒥᒦ•¶ᒧ®©™ᒨᒪᒫᒻᓂᓃᓄᓅᓇᓈᓐᓯᓰᓱᓲᓴᓵᔅᓕᓖᓗᓘᓚᓛᓪᔨᔩᔪᔫᔭ… ᔮᔾᕕᕖᕗ–—“”‘’ᕘᕙᕚᕝᕆᕇᕈᕉᕋᕌᕐᕿᖀᖁᖂᖃᖄᖅᖏᖐᖑᖒᖓᖔᖕᙱᙲᙳᙴᙵᙶᖖᖠᖡᖢᖣᖤᖥᖦᕼŁł","x-mac-ce":"ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ",macintosh:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-romanian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂȘ∞±≤≥¥µ∂∑∏π∫ªºΩăș¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›Țț‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-turkish":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙˆ˜¯˘˙˚¸˝˛ˇ"};O.MACSTRING=function(e,t,r,i){var n=N[i];if(void 0!==n){for(var o="",a=0;a>8&255,l+256&255)}return o}D.MACSTRING=function(e,t){var r=function(e){if(!F)for(var t in F={},N)F[t]=new String(t);var r=F[e];if(void 0!==r){if(B){var i=B.get(r);if(void 0!==i)return i}var n=N[e];if(void 0!==n){for(var o={},a=0;a>8,t[c+1]=255&f,t=t.concat(i[h])}return t},A.TABLE=function(e){for(var t=0,r=e.fields.length,i=0;i>1,t.skip("uShort",3),e.glyphIndexMap={};for(var a=new se.Parser(r,i+n+14),s=new se.Parser(r,i+n+16+2*o),l=new se.Parser(r,i+n+16+4*o),u=new se.Parser(r,i+n+16+6*o),h=i+n+16+8*o,c=0;c>4,o=15&i;if(15==n)break;if(t+=r[n],15==o)break;t+=r[o]}return parseFloat(t)}(e);if(32<=t&&t<=246)return t-139;if(247<=t&&t<=250)return 256*(t-247)+e.parseByte()+108;if(251<=t&&t<=254)return 256*-(t-251)-e.parseByte()-108;throw new Error("Invalid b0 "+t)}function Te(e,t,r){t=void 0!==t?t:0;var i=new se.Parser(e,t),n=[],o=[];for(r=void 0!==r?r:e.length;i.relativeOffset>1,T.length=0,P=!0}return function e(t){for(var r,i,n,o,a,s,l,u,h,c,f,d,p=0;pMath.abs(d-R)?k=f+T.shift():R=d+T.shift(),E.curveTo(y,b,_,x,l,u),E.curveTo(h,c,f,d,k,R);break;default:console.log("Glyph "+v.index+": unknown operator 1200"+m),T.length=0}break;case 14:0>3;break;case 21:2>16),p+=2;break;case 29:a=T.pop()+g.gsubrsBias,(s=g.gsubrs[a])&&e(s);break;case 30:for(;0=r.begin&&e=fe.length){var a=i.parseChar();r.names.push(i.parseString(a))}break;case 2.5:r.numberOfGlyphs=i.parseUShort(),r.offset=new Array(r.numberOfGlyphs);for(var s=0;st.value.tag?1:-1}),t.fields=t.fields.concat(i),t.fields=t.fields.concat(n),t}function gt(e,t,r){for(var i=0;i 123 are reserved for internal usage");d|=1<>>1,o=e[n].tag;if(o===t)return n;o>>1,o=e[n];if(o===t)return n;o>>1,a=(r=e[o]).start;if(a===t)return r;a(r=e[i-1]).end?0:r}function xt(e,t){this.font=e,this.tableName=t}function wt(e){xt.call(this,e,"gpos")}function St(e){xt.call(this,e,"gsub")}function Mt(e,t){var r=e.length;if(r!==t.length)return!1;for(var i=0;it.points.length-1||i.matchedPoints[1]>n.points.length-1)throw Error("Matched points out of range in "+t.name);var a=t.points[i.matchedPoints[0]],s=n.points[i.matchedPoints[1]],l={xScale:i.xScale,scale01:i.scale01,scale10:i.scale10,yScale:i.yScale,dx:0,dy:0};s=kt([s],l)[0],l.dx=a.x-s.x,l.dy=a.y-s.y,o=kt(n.points,l)}t.points=t.points.concat(o)}}return Rt(t.points)}(wt.prototype=xt.prototype={searchTag:yt,binSearch:bt,getTable:function(e){var t=this.font.tables[this.tableName];return!t&&e&&(t=this.font.tables[this.tableName]=this.createDefaultTable()),t},getScriptNames:function(){var e=this.getTable();return e?e.scripts.map(function(e){return e.tag}):[]},getDefaultScriptName:function(){var e=this.getTable();if(e){for(var t=!1,r=0;r=s[u-1].tag,"Features must be added in alphabetical order."),o={tag:r,feature:{params:0,lookupListIndexes:[]}},s.push(o),a.push(u),o.feature}}},getLookupTables:function(e,t,r,i,n){var o=this.getFeatureTable(e,t,r,n),a=[];if(o){for(var s,l=o.lookupListIndexes,u=this.font.tables[this.tableName].lookups,h=0;h",s),t.stack.push(Math.round(64*s))}function vr(e,t){var r=t.stack,i=r.pop(),n=t.fv,o=t.pv,a=t.ppem,s=t.deltaBase+16*(e-1),l=t.deltaShift,u=t.z0;E.DEBUG&&console.log(t.step,"DELTAP["+e+"]",i,r);for(var h=0;h>4)===a){var d=(15&f)-8;0<=d&&d++,E.DEBUG&&console.log(t.step,"DELTAPFIX",c,"by",d*l);var p=u[c];n.setRelative(p,p,d*l,o)}}}function yr(e,t){var r=t.stack,i=r.pop();E.DEBUG&&console.log(t.step,"ROUND[]"),r.push(64*t.round(i/64))}function br(e,t){var r=t.stack,i=r.pop(),n=t.ppem,o=t.deltaBase+16*(e-1),a=t.deltaShift;E.DEBUG&&console.log(t.step,"DELTAC["+e+"]",i,r);for(var s=0;s>4)===n){var h=(15&u)-8;0<=h&&h++;var c=h*a;E.DEBUG&&console.log(t.step,"DELTACFIX",l,"by",c),t.cvt[l]+=c}}}function _r(e,t){var r,i,n=t.stack,o=n.pop(),a=n.pop(),s=t.z2[o],l=t.z1[a];E.DEBUG&&console.log(t.step,"SDPVTL["+e+"]",o,a),i=e?(r=s.y-l.y,l.x-s.x):(r=l.x-s.x,l.y-s.y),t.dpv=Zt(r,i)}function xr(e,t){var r=t.stack,i=t.prog,n=t.ip;E.DEBUG&&console.log(t.step,"PUSHB["+e+"]");for(var o=0;o":"_")+(i?"R":"_")+(0===n?"Gr":1===n?"Bl":2===n?"Wh":"")+"]",e?c+"("+o.cvt[c]+","+u+")":"",f,"(d =",a,"->",l*s,")"),o.rp1=o.rp0,o.rp2=f,t&&(o.rp0=f)}Ft.prototype.exec=function(e,t){if("number"!=typeof t)throw new Error("Point size is not a number!");if(!(2",i),s.interpolate(c,o,a,l),s.touch(c)}e.loop=1},dr.bind(void 0,0),dr.bind(void 0,1),function(e){for(var t=e.stack,r=e.rp0,i=e.z0[r],n=e.loop,o=e.fv,a=e.pv,s=e.z1;n--;){var l=t.pop(),u=s[l];E.DEBUG&&console.log(e.step,(1=a.width||t>=a.height?[0,0,0,0]:this._getPixel(e,t);var s=new l.default.Image(r,i);return s.canvas.getContext("2d").drawImage(a,e,t,r*o,i*o,0,0,r,i),s},l.default.Renderer.prototype.textLeading=function(e){return"number"==typeof e?(this._setProperty("_textLeading",e),this._pInst):this._textLeading},l.default.Renderer.prototype.textSize=function(e){return"number"==typeof e?(this._setProperty("_textSize",e),this._setProperty("_textLeading",e*y._DEFAULT_LEADMULT),this._applyTextProperties()):this._textSize},l.default.Renderer.prototype.textStyle=function(e){return e?(e!==y.NORMAL&&e!==y.ITALIC&&e!==y.BOLD&&e!==y.BOLDITALIC||this._setProperty("_textStyle",e),this._applyTextProperties()):this._textStyle},l.default.Renderer.prototype.textAscent=function(){return null===this._textAscent&&this._updateTextMetrics(),this._textAscent},l.default.Renderer.prototype.textDescent=function(){return null===this._textDescent&&this._updateTextMetrics(),this._textDescent},l.default.Renderer.prototype.textAlign=function(e,t){return void 0!==e?(this._setProperty("_textAlign",e),void 0!==t&&this._setProperty("_textBaseline",t),this._applyTextProperties()):{horizontal:this._textAlign,vertical:this._textBaseline}},l.default.Renderer.prototype.text=function(e,t,r,i,n){var o,a,s,l,u,h,c,f,d=this._pInst,p=Number.MAX_VALUE;if((this._doFill||this._doStroke)&&void 0!==e){if("string"!=typeof e&&(e=e.toString()),o=(e=e.replace(/(\t)/g," ")).split("\n"),void 0!==i){for(s=f=0;ss.HALF_PI&&e<=3*s.HALF_PI?Math.atan(r/i*Math.tan(e))+s.PI:Math.atan(r/i*Math.tan(e))+s.TWO_PI,t=t<=s.HALF_PI?Math.atan(r/i*Math.tan(t)):t>s.HALF_PI&&t<=3*s.HALF_PI?Math.atan(r/i*Math.tan(t))+s.PI:Math.atan(r/i*Math.tan(t))+s.TWO_PI),tv||Math.abs(this.accelerationY-this.pAccelerationY)>v||Math.abs(this.accelerationZ-this.pAccelerationZ)>v)&&e();var t=this.deviceTurned||window.deviceTurned;if("function"==typeof t){var r=this.rotationX+180,i=this.pRotationX+180,n=c+180;0>>24],i+=x[(16711680&C)>>16],n+=x[(65280&C)>>8],o+=x[255&C],r+=k[_],s++}w[l=T+y]=a/r,S[l]=i/r,M[l]=n/r,E[l]=o/r}T+=d}for(h=(u=-P)*d,b=T=0;b>>16,e[r+1]=(65280&t[i])>>>8,e[r+2]=255&t[i],e[r+3]=(4278190080&t[i])>>>24},O._toImageData=function(e){return e instanceof ImageData?e:e.getContext("2d").getImageData(0,0,e.width,e.height)},O._createImageData=function(e,t){return O._tmpCanvas=document.createElement("canvas"),O._tmpCtx=O._tmpCanvas.getContext("2d"),this._tmpCtx.createImageData(e,t)},O.apply=function(e,t,r){var i=e.getContext("2d"),n=i.getImageData(0,0,e.width,e.height),o=t(n,r);o instanceof ImageData?i.putImageData(o,0,0,0,0,e.width,e.height):i.putImageData(n,0,0,0,0,e.width,e.height)},O.threshold=function(e,t){var r=O._toPixels(e);void 0===t&&(t=.5);for(var i=Math.floor(255*t),n=0;n>8)/i,r[n+1]=255*(a*t>>8)/i,r[n+2]=255*(s*t>>8)/i}},O.dilate=function(e){for(var t,r,i,n,o,a,s,l,u,h,c,f,d,p,m,g,v,y=O._toPixels(e),b=0,_=y.length?y.length/4:0,x=new Int32Array(_);b<_;)for(r=(t=b)+e.width;b>16&255)+151*(i>>8&255)+28*(255&i))<(m=77*(c>>16&255)+151*(c>>8&255)+28*(255&c))&&(n=c,o=m),o<(p=77*((h=O._getARGB(y,a))>>16&255)+151*(h>>8&255)+28*(255&h))&&(n=h,o=p),o<(g=77*(f>>16&255)+151*(f>>8&255)+28*(255&f))&&(n=f,o=g),o<(v=77*(d>>16&255)+151*(d>>8&255)+28*(255&d))&&(n=d,o=v),x[b++]=n;O._setPixels(y,x)},O.erode=function(e){for(var t,r,i,n,o,a,s,l,u,h,c,f,d,p,m,g,v,y=O._toPixels(e),b=0,_=y.length?y.length/4:0,x=new Int32Array(_);b<_;)for(r=(t=b)+e.width;b>16&255)+151*(c>>8&255)+28*(255&c))<(o=77*(i>>16&255)+151*(i>>8&255)+28*(255&i))&&(n=c,o=m),(p=77*((h=O._getARGB(y,a))>>16&255)+151*(h>>8&255)+28*(255&h))>16&255)+151*(f>>8&255)+28*(255&f))>16&255)+151*(d>>8&255)+28*(255&d))=r){var i=Math.floor(t.timeDisplayed/r);if(t.timeDisplayed=0,t.displayIndex+=i,t.loopCount=Math.floor(t.displayIndex/t.numFrames),null!==t.loopLimit&&t.loopCount>=t.loopLimit)t.playing=!1;else{var n=t.displayIndex%t.numFrames;this.drawingContext.putImageData(t.frames[n].image,0,0),t.displayIndex=n,this.setModified(!0)}}}},n.default.Image.prototype._setProperty=function(e,t){this[e]=t,this.setModified(!0)},n.default.Image.prototype.loadPixels=function(){n.default.Renderer2D.prototype.loadPixels.call(this),this.setModified(!0)},n.default.Image.prototype.updatePixels=function(e,t,r,i){n.default.Renderer2D.prototype.updatePixels.call(this,e,t,r,i),this.setModified(!0)},n.default.Image.prototype.get=function(e,t,r,i){return n.default._validateParameters("p5.Image.get",arguments),n.default.Renderer2D.prototype.get.apply(this,arguments)},n.default.Image.prototype._getPixel=n.default.Renderer2D.prototype._getPixel,n.default.Image.prototype.set=function(e,t,r){n.default.Renderer2D.prototype.set.call(this,e,t,r),this.setModified(!0)},n.default.Image.prototype.resize=function(e,t){0===e&&0===t?(e=this.canvas.width,t=this.canvas.height):0===e?e=this.canvas.width*t/this.canvas.height:0===t&&(t=this.canvas.height*e/this.canvas.width),e=Math.floor(e),t=Math.floor(t);var r=document.createElement("canvas");if(r.width=e,r.height=t,this.gifProperties)for(var i=this.gifProperties,n=function(e,t){for(var r=0,i=0;i/g,">").replace(/"/g,""").replace(/'/g,"'")}function l(e,t){t&&!0!==t&&"true"!==t||(t="");var r="";return(e=e||"untitled")&&e.includes(".")&&(r=e.split(".").pop()),t&&r!==t&&(r=t,e="".concat(e,".").concat(r)),[e,r]}e("../core/error_helpers"),v.default.prototype.loadJSON=function(){for(var e=arguments.length,t=new Array(e),r=0;r"),n.print("");if(n.print(' '),n.print(""),n.print(""),n.print(" "),"0"!==o[0]){n.print(" ");for(var h=0;h".concat(c)),n.print(" ")}n.print(" ")}for(var f=0;f");for(var d=0;d".concat(p)),n.print(" ")}n.print(" ")}n.print("
"),n.print(""),n.print("")}n.close(),n.clear()},v.default.prototype.writeFile=function(e,t,r){var i="application/octet-stream";v.default.prototype._isSafari()&&(i="text/plain");var n=new Blob(e,{type:i});v.default.prototype.downloadFile(n,t,r)},v.default.prototype.downloadFile=function(e,t,r){var i=l(t,r),n=i[0];if(e instanceof Blob)s.default.saveAs(e,n);else{var o=document.createElement("a");if(o.href=e,o.download=n,o.onclick=function(e){var t;t=e,document.body.removeChild(t.target),e.stopPropagation()},o.style.display="none",document.body.appendChild(o),v.default.prototype._isSafari()){var a="Hello, Safari user! To download this file...\n";a+="1. Go to File --\x3e Save As.\n",a+='2. Choose "Page Source" as the Format.\n',a+='3. Name it with this extension: ."'.concat(i[1],'"'),alert(a)}o.click()}},v.default.prototype._checkFileExtension=l,v.default.prototype._isSafari=function(){return 0>>0},getSeed:function(){return t},rand:function(){return(r=(1664525*r+1013904223)%i)/i}});n.setSeed(e),_=new Array(4096);for(var o=0;o<4096;o++)_[o]=n.rand()};var o=n.default;r.default=o},{"../core/main":49}],82:[function(e,t,r){"use strict";function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i,l=(i=e("../core/main"))&&i.__esModule?i:{default:i},o=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==a(e)&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var o=i?Object.getOwnPropertyDescriptor(e,n):null;o&&(o.get||o.set)?Object.defineProperty(r,n,o):r[n]=e[n]}r.default=e,t&&t.set(e,r);return r}(e("../core/constants"));function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}l.default.Vector=function(e,t,r){var i,n,o;o=e instanceof l.default?(this.p5=e,i=t[0]||0,n=t[1]||0,t[2]||0):(i=e||0,n=t||0,r||0),this.x=i,this.y=n,this.z=o},l.default.Vector.prototype.toString=function(){return"p5.Vector Object : [".concat(this.x,", ").concat(this.y,", ").concat(this.z,"]")},l.default.Vector.prototype.set=function(e,t,r){return e instanceof l.default.Vector?(this.x=e.x||0,this.y=e.y||0,this.z=e.z||0):e instanceof Array?(this.x=e[0]||0,this.y=e[1]||0,this.z=e[2]||0):(this.x=e||0,this.y=t||0,this.z=r||0),this},l.default.Vector.prototype.copy=function(){return this.p5?new l.default.Vector(this.p5,[this.x,this.y,this.z]):new l.default.Vector(this.x,this.y,this.z)},l.default.Vector.prototype.add=function(e,t,r){return e instanceof l.default.Vector?(this.x+=e.x||0,this.y+=e.y||0,this.z+=e.z||0):e instanceof Array?(this.x+=e[0]||0,this.y+=e[1]||0,this.z+=e[2]||0):(this.x+=e||0,this.y+=t||0,this.z+=r||0),this};function u(e,t){return 0!==e&&(this.x=this.x%e),0!==t&&(this.y=this.y%t),this}function h(e,t,r){return 0!==e&&(this.x=this.x%e),0!==t&&(this.y=this.y%t),0!==r&&(this.z=this.z%r),this}l.default.Vector.prototype.rem=function(e,t,r){if(e instanceof l.default.Vector){if(Number.isFinite(e.x)&&Number.isFinite(e.y)&&Number.isFinite(e.z)){var i=parseFloat(e.x),n=parseFloat(e.y),o=parseFloat(e.z);h.call(this,i,n,o)}}else if(e instanceof Array)e.every(function(e){return Number.isFinite(e)})&&(2===e.length&&u.call(this,e[0],e[1]),3===e.length&&h.call(this,e[0],e[1],e[2]));else if(1===arguments.length){if(Number.isFinite(e)&&0!==e)return this.x=this.x%e,this.y=this.y%e,this.z=this.z%e,this}else if(2===arguments.length){var a=Array.prototype.slice.call(arguments);a.every(function(e){return Number.isFinite(e)})&&2===a.length&&u.call(this,a[0],a[1])}else if(3===arguments.length){var s=Array.prototype.slice.call(arguments);s.every(function(e){return Number.isFinite(e)})&&3===s.length&&h.call(this,s[0],s[1],s[2])}},l.default.Vector.prototype.sub=function(e,t,r){return e instanceof l.default.Vector?(this.x-=e.x||0,this.y-=e.y||0,this.z-=e.z||0):e instanceof Array?(this.x-=e[0]||0,this.y-=e[1]||0,this.z-=e[2]||0):(this.x-=e||0,this.y-=t||0,this.z-=r||0),this},l.default.Vector.prototype.mult=function(e){return"number"==typeof e&&isFinite(e)?(this.x*=e,this.y*=e,this.z*=e):console.warn("p5.Vector.prototype.mult:","n is undefined or not a finite number"),this},l.default.Vector.prototype.div=function(e){return"number"==typeof e&&isFinite(e)?0===e?console.warn("p5.Vector.prototype.div:","divide by 0"):(this.x/=e,this.y/=e,this.z/=e):console.warn("p5.Vector.prototype.div:","n is undefined or not a finite number"),this},l.default.Vector.prototype.mag=function(){return Math.sqrt(this.magSq())},l.default.Vector.prototype.magSq=function(){var e=this.x,t=this.y,r=this.z;return e*e+t*t+r*r},l.default.Vector.prototype.dot=function(e,t,r){return e instanceof l.default.Vector?this.dot(e.x,e.y,e.z):this.x*(e||0)+this.y*(t||0)+this.z*(r||0)},l.default.Vector.prototype.cross=function(e){var t=this.y*e.z-this.z*e.y,r=this.z*e.x-this.x*e.z,i=this.x*e.y-this.y*e.x;return this.p5?new l.default.Vector(this.p5,[t,r,i]):new l.default.Vector(t,r,i)},l.default.Vector.prototype.dist=function(e){return e.copy().sub(this).mag()},l.default.Vector.prototype.normalize=function(){var e=this.mag();return 0!==e&&this.mult(1/e),this},l.default.Vector.prototype.limit=function(e){var t=this.magSq();return e*e>>0},n.default.prototype.randomSeed=function(e){this._lcgSetSeed(o,e),this._gaussian_previous=!1},n.default.prototype.random=function(e,t){var r;if(n.default._validateParameters("random",arguments),r=null!=this[o]?this._lcg(o):Math.random(),void 0===e)return r;if(void 0===t)return e instanceof Array?e[Math.floor(r*e.length)]:r*e;if(tf){var P=p,L=l,k=u;p=d+f*(s&&d=t&&(r=r.substring(r.length-t,r.length)),r}},n.default.prototype.unhex=function(e){return e instanceof Array?e.map(n.default.prototype.unhex):parseInt("0x".concat(e),16)};var o=n.default;r.default=o},{"../core/main":49}],90:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i,a=(i=e("../core/main"))&&i.__esModule?i:{default:i};function n(e,t,r){var i=e<0,n=i?e.toString().substring(1):e.toString(),o=n.indexOf("."),a=-1!==o?n.substring(0,o):n,s=-1!==o?n.substring(o+1):"",l=i?"-":"";if(void 0!==r){var u="";(-1!==o||0r&&(s=s.substring(0,r));for(var h=0;hi.length)for(var o=t-(i+=-1===r?".":"").length+1,a=0;a=d.TWO_PI?"".concat("ellipse","|").concat(u,"|"):"".concat("arc","|").concat(a,"|").concat(s,"|").concat(l,"|").concat(u,"|"),!this.geometryInHash(t)){var h=new T.default.Geometry(u,1,function(){if(this.strokeIndices=[],a.toFixed(10)!==s.toFixed(10)){l!==d.PIE&&void 0!==l||(this.vertices.push(new T.default.Vector(.5,.5,0)),this.uvs.push([.5,.5]));for(var e=0;e<=u;e++){var t=(s-a)*(e/u)+a,r=.5+Math.cos(t)/2,i=.5+Math.sin(t)/2;this.vertices.push(new T.default.Vector(r,i,0)),this.uvs.push([r,i]),e>5&31)/31,(y>>10&31)/31):(r=a,i=s,l)}for(var b=1;b<=3;b++){var _=p+12*b,x=new S.default.Vector(u.getFloat32(_,!0),u.getFloat32(8+_,!0),u.getFloat32(4+_,!0));e.vertices.push(x),c&&o.push(r,i,n)}var w=new S.default.Vector(m,g,v);e.vertexNormals.push(w,w,w),e.faces.push([3*d,3*d+1,3*d+2]),e.uvs.push([0,0],[0,0],[0,0])}}(e,t);else{var r=new DataView(t);if(!("TextDecoder"in window))return console.warn("Sorry, ASCII STL loading only works in browsers that support TextDecoder (https://caniuse.com/#feat=textencoder)");var i=new TextDecoder("utf-8").decode(r).split("\n");!function(e,t){for(var r,i,n="",o=[],a=0;aMath.PI?l=Math.PI:l<=0&&(l=.001);var u=Math.sin(l)*a*Math.sin(s),h=Math.cos(l)*a,c=Math.sin(l)*a*Math.cos(s);this.camera(u+this.centerX,h+this.centerY,c+this.centerZ,this.centerX,this.centerY,this.centerZ,0,1,0)},m.default.Camera.prototype._isActive=function(){return this===this._renderer._curCamera},m.default.prototype.setCamera=function(e){this._renderer._curCamera=e,this._renderer.uPMatrix.set(e.projMatrix.mat4[0],e.projMatrix.mat4[1],e.projMatrix.mat4[2],e.projMatrix.mat4[3],e.projMatrix.mat4[4],e.projMatrix.mat4[5],e.projMatrix.mat4[6],e.projMatrix.mat4[7],e.projMatrix.mat4[8],e.projMatrix.mat4[9],e.projMatrix.mat4[10],e.projMatrix.mat4[11],e.projMatrix.mat4[12],e.projMatrix.mat4[13],e.projMatrix.mat4[14],e.projMatrix.mat4[15])};var n=m.default.Camera;r.default=n},{"../core/main":49}],98:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i,h=(i=e("../core/main"))&&i.__esModule?i:{default:i};h.default.Geometry=function(e,t,r){return this.vertices=[],this.lineVertices=[],this.lineNormals=[],this.vertexNormals=[],this.faces=[],this.uvs=[],this.edges=[],this.vertexColors=[],this.detailX=void 0!==e?e:1,this.detailY=void 0!==t?t:1,this.dirtyFlags={},r instanceof Function&&r.call(this),this},h.default.Geometry.prototype.reset=function(){this.lineVertices.length=0,this.lineNormals.length=0,this.vertices.length=0,this.edges.length=0,this.vertexColors.length=0,this.vertexNormals.length=0,this.uvs.length=0,this.dirtyFlags={}},h.default.Geometry.prototype.computeFaces=function(){this.faces.length=0;for(var e,t,r,i,n=this.detailX+1,o=0;othis.vertices.length-1-this.detailX;i--)e.add(this.vertexNormals[i]);e=h.default.Vector.div(e,this.detailX);for(var n=this.vertices.length-1;n>this.vertices.length-1-this.detailX;n--)this.vertexNormals[n]=e;return this},h.default.Geometry.prototype._makeTriangleEdges=function(){if(this.edges.length=0,Array.isArray(this.strokeIndices))for(var e=0,t=this.strokeIndices.length;e vTexCoord.y;\n bool y1 = p1.y > vTexCoord.y;\n bool y2 = p2.y > vTexCoord.y;\n\n // could web be under the curve (after t1)?\n if (y1 ? !y2 : y0) {\n // add the coverage for t1\n coverage.x += saturate(C1.x + 0.5);\n // calculate the anti-aliasing for t1\n weight.x = min(weight.x, abs(C1.x));\n }\n\n // are we outside the curve (after t2)?\n if (y1 ? !y0 : y2) {\n // subtract the coverage for t2\n coverage.x -= saturate(C2.x + 0.5);\n // calculate the anti-aliasing for t2\n weight.x = min(weight.x, abs(C2.x));\n }\n}\n\n// this is essentially the same as coverageX, but with the axes swapped\nvoid coverageY(vec2 p0, vec2 p1, vec2 p2) {\n\n vec2 C1, C2;\n calulateCrossings(p0, p1, p2, C1, C2);\n\n bool x0 = p0.x > vTexCoord.x;\n bool x1 = p1.x > vTexCoord.x;\n bool x2 = p2.x > vTexCoord.x;\n\n if (x1 ? !x2 : x0) {\n coverage.y -= saturate(C1.y + 0.5);\n weight.y = min(weight.y, abs(C1.y));\n }\n\n if (x1 ? !x0 : x2) {\n coverage.y += saturate(C2.y + 0.5);\n weight.y = min(weight.y, abs(C2.y));\n }\n}\n\nvoid main() {\n\n // calculate the pixel scale based on screen-coordinates\n pixelScale = hardness / fwidth(vTexCoord);\n\n // which grid cell is this pixel in?\n ivec2 gridCoord = ifloor(vTexCoord * vec2(uGridSize));\n\n // intersect curves in this row\n {\n // the index into the row info bitmap\n int rowIndex = gridCoord.y + uGridOffset.y;\n // fetch the info texel\n vec4 rowInfo = getTexel(uSamplerRows, rowIndex, uGridImageSize);\n // unpack the rowInfo\n int rowStrokeIndex = getInt16(rowInfo.xy);\n int rowStrokeCount = getInt16(rowInfo.zw);\n\n for (int iRowStroke = INT(0); iRowStroke < N; iRowStroke++) {\n if (iRowStroke >= rowStrokeCount)\n break;\n\n // each stroke is made up of 3 points: the start and control point\n // and the start of the next curve.\n // fetch the indices of this pair of strokes:\n vec4 strokeIndices = getTexel(uSamplerRowStrokes, rowStrokeIndex++, uCellsImageSize);\n\n // unpack the stroke index\n int strokePos = getInt16(strokeIndices.xy);\n\n // fetch the two strokes\n vec4 stroke0 = getTexel(uSamplerStrokes, strokePos + INT(0), uStrokeImageSize);\n vec4 stroke1 = getTexel(uSamplerStrokes, strokePos + INT(1), uStrokeImageSize);\n\n // calculate the coverage\n coverageX(stroke0.xy, stroke0.zw, stroke1.xy);\n }\n }\n\n // intersect curves in this column\n {\n int colIndex = gridCoord.x + uGridOffset.x;\n vec4 colInfo = getTexel(uSamplerCols, colIndex, uGridImageSize);\n int colStrokeIndex = getInt16(colInfo.xy);\n int colStrokeCount = getInt16(colInfo.zw);\n \n for (int iColStroke = INT(0); iColStroke < N; iColStroke++) {\n if (iColStroke >= colStrokeCount)\n break;\n\n vec4 strokeIndices = getTexel(uSamplerColStrokes, colStrokeIndex++, uCellsImageSize);\n\n int strokePos = getInt16(strokeIndices.xy);\n vec4 stroke0 = getTexel(uSamplerStrokes, strokePos + INT(0), uStrokeImageSize);\n vec4 stroke1 = getTexel(uSamplerStrokes, strokePos + INT(1), uStrokeImageSize);\n coverageY(stroke0.xy, stroke0.zw, stroke1.xy);\n }\n }\n\n weight = saturate(1.0 - weight * 2.0);\n float distance = max(weight.x + weight.y, minDistance); // manhattan approx.\n float antialias = abs(dot(coverage, weight) / distance);\n float cover = min(abs(coverage.x), abs(coverage.y));\n gl_FragColor = uMaterialColor;\n gl_FragColor.a *= saturate(max(antialias, cover));\n}",lineVert:"/*\n Part of the Processing project - http://processing.org\n Copyright (c) 2012-15 The Processing Foundation\n Copyright (c) 2004-12 Ben Fry and Casey Reas\n Copyright (c) 2001-04 Massachusetts Institute of Technology\n This library is free software; you can redistribute it and/or\n modify it under the terms of the GNU Lesser General Public\n License as published by the Free Software Foundation, version 2.1.\n This library is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n Lesser General Public License for more details.\n You should have received a copy of the GNU Lesser General\n Public License along with this library; if not, write to the\n Free Software Foundation, Inc., 59 Temple Place, Suite 330,\n Boston, MA 02111-1307 USA\n*/\n\n#define PROCESSING_LINE_SHADER\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform float uStrokeWeight;\n\nuniform vec4 uViewport;\nuniform int uPerspective;\n\nattribute vec4 aPosition;\nattribute vec4 aDirection;\n \nvoid main() {\n // using a scale <1 moves the lines towards the camera\n // in order to prevent popping effects due to half of\n // the line disappearing behind the geometry faces.\n vec3 scale = vec3(0.9995);\n\n vec4 posp = uModelViewMatrix * aPosition;\n vec4 posq = uModelViewMatrix * (aPosition + vec4(aDirection.xyz, 0));\n\n // Moving vertices slightly toward the camera\n // to avoid depth-fighting with the fill triangles.\n // Discussed here:\n // http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Number=252848 \n posp.xyz = posp.xyz * scale;\n posq.xyz = posq.xyz * scale;\n\n vec4 p = uProjectionMatrix * posp;\n vec4 q = uProjectionMatrix * posq;\n\n // formula to convert from clip space (range -1..1) to screen space (range 0..[width or height])\n // screen_p = (p.xy/p.w + <1,1>) * 0.5 * uViewport.zw\n\n // prevent division by W by transforming the tangent formula (div by 0 causes\n // the line to disappear, see https://github.com/processing/processing/issues/5183)\n // t = screen_q - screen_p\n //\n // tangent is normalized and we don't care which aDirection it points to (+-)\n // t = +- normalize( screen_q - screen_p )\n // t = +- normalize( (q.xy/q.w+<1,1>)*0.5*uViewport.zw - (p.xy/p.w+<1,1>)*0.5*uViewport.zw )\n //\n // extract common factor, <1,1> - <1,1> cancels out\n // t = +- normalize( (q.xy/q.w - p.xy/p.w) * 0.5 * uViewport.zw )\n //\n // convert to common divisor\n // t = +- normalize( ((q.xy*p.w - p.xy*q.w) / (p.w*q.w)) * 0.5 * uViewport.zw )\n //\n // remove the common scalar divisor/factor, not needed due to normalize and +-\n // (keep uViewport - can't remove because it has different components for x and y\n // and corrects for aspect ratio, see https://github.com/processing/processing/issues/5181)\n // t = +- normalize( (q.xy*p.w - p.xy*q.w) * uViewport.zw )\n\n vec2 tangent = normalize((q.xy*p.w - p.xy*q.w) * uViewport.zw);\n\n // flip tangent to normal (it's already normalized)\n vec2 normal = vec2(-tangent.y, tangent.x);\n\n float thickness = aDirection.w * uStrokeWeight;\n vec2 offset = normal * thickness / 2.0;\n\n vec2 curPerspScale;\n\n if(uPerspective == 1) {\n // Perspective ---\n // convert from world to clip by multiplying with projection scaling factor\n // to get the right thickness (see https://github.com/processing/processing/issues/5182)\n // invert Y, projections in Processing invert Y\n curPerspScale = (uProjectionMatrix * vec4(1, -1, 0, 0)).xy;\n } else {\n // No Perspective ---\n // multiply by W (to cancel out division by W later in the pipeline) and\n // convert from screen to clip (derived from clip to screen above)\n curPerspScale = p.w / (0.5 * uViewport.zw);\n }\n\n gl_Position.xy = p.xy + offset.xy * curPerspScale;\n gl_Position.zw = p.zw;\n}\n",lineFrag:"precision mediump float;\nprecision mediump int;\n\nuniform vec4 uMaterialColor;\n\nvoid main() {\n gl_FragColor = uMaterialColor;\n}",pointVert:"attribute vec3 aPosition;\nuniform float uPointSize;\nvarying float vStrokeWeight;\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nvoid main() {\n\tvec4 positionVec4 = vec4(aPosition, 1.0);\n\tgl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n\tgl_PointSize = uPointSize;\n\tvStrokeWeight = uPointSize;\n}",pointFrag:"precision mediump float;\nprecision mediump int;\nuniform vec4 uMaterialColor;\nvarying float vStrokeWeight;\n\nvoid main(){\n\tfloat mask = 0.0;\n\n\t// make a circular mask using the gl_PointCoord (goes from 0 - 1 on a point)\n // might be able to get a nicer edge on big strokeweights with smoothstep but slightly less performant\n\n\tmask = step(0.98, length(gl_PointCoord * 2.0 - 1.0));\n\n\t// if strokeWeight is 1 or less lets just draw a square\n\t// this prevents weird artifacting from carving circles when our points are really small\n\t// if strokeWeight is larger than 1, we just use it as is\n\n\tmask = mix(0.0, mask, clamp(floor(vStrokeWeight - 0.5),0.0,1.0));\n\n\t// throw away the borders of the mask\n // otherwise we get weird alpha blending issues\n\n\tif(mask > 0.98){\n discard;\n \t}\n\n \tgl_FragColor = vec4(uMaterialColor.rgb * (1.0 - mask), uMaterialColor.a) ;\n}"};u.default.RendererGL=function(e,t,r,i){return u.default.Renderer.call(this,e,t,r),this._setAttributeDefaults(t),this._initContext(),this.isP3D=!0,this.GL=this.drawingContext,this._isErasing=!1,this._enableLighting=!1,this.ambientLightColors=[],this.specularColors=[1,1,1],this.directionalLightDirections=[],this.directionalLightDiffuseColors=[],this.directionalLightSpecularColors=[],this.pointLightPositions=[],this.pointLightDiffuseColors=[],this.pointLightSpecularColors=[],this.spotLightPositions=[],this.spotLightDirections=[],this.spotLightDiffuseColors=[],this.spotLightSpecularColors=[],this.spotLightAngle=[],this.spotLightConc=[],this.drawMode=o.FILL,this.curFillColor=this._cachedFillStyle=[1,1,1,1],this.curStrokeColor=this._cachedStrokeStyle=[0,0,0,1],this.curBlendMode=o.BLEND,this._cachedBlendMode=void 0,this.blendExt=this.GL.getExtension("EXT_blend_minmax"),this._isBlending=!1,this._useSpecularMaterial=!1,this._useEmissiveMaterial=!1,this._useNormalMaterial=!1,this._useShininess=1,this._tint=[255,255,255,255],this.constantAttenuation=1,this.linearAttenuation=0,this.quadraticAttenuation=0,this.uMVMatrix=new u.default.Matrix,this.uPMatrix=new u.default.Matrix,this.uNMatrix=new u.default.Matrix("mat3"),this._curCamera=new u.default.Camera(this),this._curCamera._computeCameraDefaultSettings(),this._curCamera._setDefaultCamera(),this._defaultLightShader=void 0,this._defaultImmediateModeShader=void 0,this._defaultNormalShader=void 0,this._defaultColorShader=void 0,this._defaultPointShader=void 0,this.userFillShader=void 0,this.userStrokeShader=void 0,this.userPointShader=void 0,this.retainedMode={geometry:{},buffers:{stroke:[new u.default.RenderBuffer(3,"lineVertices","lineVertexBuffer","aPosition",this,this._flatten),new u.default.RenderBuffer(4,"lineNormals","lineNormalBuffer","aDirection",this,this._flatten)],fill:[new u.default.RenderBuffer(3,"vertices","vertexBuffer","aPosition",this,this._vToNArray),new u.default.RenderBuffer(3,"vertexNormals","normalBuffer","aNormal",this,this._vToNArray),new u.default.RenderBuffer(4,"vertexColors","colorBuffer","aMaterialColor",this),new u.default.RenderBuffer(3,"vertexAmbients","ambientBuffer","aAmbientColor",this),new u.default.RenderBuffer(2,"uvs","uvBuffer","aTexCoord",this,this._flatten)],text:[new u.default.RenderBuffer(3,"vertices","vertexBuffer","aPosition",this,this._vToNArray),new u.default.RenderBuffer(2,"uvs","uvBuffer","aTexCoord",this,this._flatten)]}},this.immediateMode={geometry:new u.default.Geometry,shapeMode:o.TRIANGLE_FAN,_bezierVertex:[],_quadraticVertex:[],_curveVertex:[],buffers:{fill:[new u.default.RenderBuffer(3,"vertices","vertexBuffer","aPosition",this,this._vToNArray),new u.default.RenderBuffer(3,"vertexNormals","normalBuffer","aNormal",this,this._vToNArray),new u.default.RenderBuffer(4,"vertexColors","colorBuffer","aVertexColor",this),new u.default.RenderBuffer(3,"vertexAmbients","ambientBuffer","aAmbientColor",this),new u.default.RenderBuffer(2,"uvs","uvBuffer","aTexCoord",this,this._flatten)],stroke:[new u.default.RenderBuffer(3,"lineVertices","lineVertexBuffer","aPosition",this,this._flatten),new u.default.RenderBuffer(4,"lineNormals","lineNormalBuffer","aDirection",this,this._flatten)],point:this.GL.createBuffer()}},this.pointSize=5,this.curStrokeWeight=1,this.textures=[],this.textureMode=o.IMAGE,this.textureWrapX=o.CLAMP,this.textureWrapY=o.CLAMP,this._tex=null,this._curveTightness=6,this._lookUpTableBezier=[],this._lookUpTableQuadratic=[],this._lutBezierDetail=0,this._lutQuadraticDetail=0,this._tessy=this._initTessy(),this.fontInfos={},this._curShader=void 0,this},u.default.RendererGL.prototype=Object.create(u.default.Renderer.prototype),u.default.RendererGL.prototype._setAttributeDefaults=function(e){var t={alpha:!0,depth:!0,stencil:!0,antialias:navigator.userAgent.toLowerCase().includes("safari"),premultipliedAlpha:!1,preserveDrawingBuffer:!0,perPixelLighting:!0};null===e._glAttributes?e._glAttributes=t:e._glAttributes=Object.assign(t,e._glAttributes)},u.default.RendererGL.prototype._initContext=function(){try{if(this.drawingContext=this.canvas.getContext("webgl",this._pInst._glAttributes)||this.canvas.getContext("experimental-webgl",this._pInst._glAttributes),null===this.drawingContext)throw new Error("Error creating webgl context");var e=this.drawingContext;e.enable(e.DEPTH_TEST),e.depthFunc(e.LEQUAL),e.viewport(0,0,e.drawingBufferWidth,e.drawingBufferHeight),this._viewport=this.drawingContext.getParameter(this.drawingContext.VIEWPORT)}catch(e){throw e}},u.default.RendererGL.prototype._resetContext=function(e,t){var r=this.width,i=this.height,n=this.canvas.id,o=this._pInst instanceof u.default.Graphics;if(o){var a=this._pInst;a.canvas.parentNode.removeChild(a.canvas),a.canvas=document.createElement("canvas"),(a._pInst._userNode||document.body).appendChild(a.canvas),u.default.Element.call(a,a.canvas,a._pInst),a.width=r,a.height=i}else{var s=this.canvas;s&&s.parentNode.removeChild(s),(s=document.createElement("canvas")).id=n,this._pInst._userNode?this._pInst._userNode.appendChild(s):document.body.appendChild(s),this._pInst.canvas=s}var l=new u.default.RendererGL(this._pInst.canvas,this._pInst,!o);this._pInst._setProperty("_renderer",l),l.resize(r,i),l._applyDefaults(),o||this._pInst._elements.push(l),"function"==typeof t&&setTimeout(function(){t.apply(window._renderer,e)},0)},u.default.prototype.setAttributes=function(e,t){if(void 0!==this._glAttributes){var r=!0;if(void 0!==t?(null===this._glAttributes&&(this._glAttributes={}),this._glAttributes[e]!==t&&(this._glAttributes[e]=t,r=!1)):e instanceof Object&&this._glAttributes!==e&&(this._glAttributes=e,r=!1),this._renderer.isP3D&&!r){if(!this._setupDone)for(var i in this._renderer.retainedMode.geometry)if(this._renderer.retainedMode.geometry.hasOwnProperty(i))return void console.error("Sorry, Could not set the attributes, you need to call setAttributes() before calling the other drawing methods in setup()");this.push(),this._renderer._resetContext(),this.pop(),this._renderer._curCamera&&(this._renderer._curCamera._renderer=this._renderer)}}else console.log("You are trying to use setAttributes on a p5.Graphics object that does not use a WEBGL renderer.")},u.default.RendererGL.prototype._update=function(){this.uMVMatrix.set(this._curCamera.cameraMatrix.mat4[0],this._curCamera.cameraMatrix.mat4[1],this._curCamera.cameraMatrix.mat4[2],this._curCamera.cameraMatrix.mat4[3],this._curCamera.cameraMatrix.mat4[4],this._curCamera.cameraMatrix.mat4[5],this._curCamera.cameraMatrix.mat4[6],this._curCamera.cameraMatrix.mat4[7],this._curCamera.cameraMatrix.mat4[8],this._curCamera.cameraMatrix.mat4[9],this._curCamera.cameraMatrix.mat4[10],this._curCamera.cameraMatrix.mat4[11],this._curCamera.cameraMatrix.mat4[12],this._curCamera.cameraMatrix.mat4[13],this._curCamera.cameraMatrix.mat4[14],this._curCamera.cameraMatrix.mat4[15]),this.ambientLightColors.length=0,this.specularColors=[1,1,1],this.directionalLightDirections.length=0,this.directionalLightDiffuseColors.length=0,this.directionalLightSpecularColors.length=0,this.pointLightPositions.length=0,this.pointLightDiffuseColors.length=0,this.pointLightSpecularColors.length=0,this.spotLightPositions.length=0,this.spotLightDirections.length=0,this.spotLightDiffuseColors.length=0,this.spotLightSpecularColors.length=0,this.spotLightAngle.length=0,this.spotLightConc.length=0,this._enableLighting=!1,this._tint=[255,255,255,255],this.GL.clear(this.GL.DEPTH_BUFFER_BIT)},u.default.RendererGL.prototype.background=function(){var e,t=(e=this._pInst).color.apply(e,arguments),r=t.levels[0]/255,i=t.levels[1]/255,n=t.levels[2]/255,o=t.levels[3]/255;this.GL.clearColor(r,i,n,o),this.GL.clear(this.GL.COLOR_BUFFER_BIT)},u.default.RendererGL.prototype.fill=function(e,t,r,i){var n=u.default.prototype.color.apply(this._pInst,arguments);this.curFillColor=n._array,this.drawMode=o.FILL,this._useNormalMaterial=!1,this._tex=null},u.default.RendererGL.prototype.stroke=function(e,t,r,i){arguments[3]=255;var n=u.default.prototype.color.apply(this._pInst,arguments);this.curStrokeColor=n._array},u.default.RendererGL.prototype.strokeCap=function(e){console.error("Sorry, strokeCap() is not yet implemented in WEBGL mode")},u.default.RendererGL.prototype.strokeJoin=function(e){console.error("Sorry, strokeJoin() is not yet implemented in WEBGL mode")},u.default.RendererGL.prototype.filter=function(e){console.error("filter() does not work in WEBGL mode")},u.default.RendererGL.prototype.blendMode=function(e){e===o.DARKEST||e===o.LIGHTEST||e===o.ADD||e===o.BLEND||e===o.SUBTRACT||e===o.SCREEN||e===o.EXCLUSION||e===o.REPLACE||e===o.MULTIPLY||e===o.REMOVE?this.curBlendMode=e:e!==o.BURN&&e!==o.OVERLAY&&e!==o.HARD_LIGHT&&e!==o.SOFT_LIGHT&&e!==o.DODGE||console.warn("BURN, OVERLAY, HARD_LIGHT, SOFT_LIGHT, and DODGE only work for blendMode in 2D mode.")},u.default.RendererGL.prototype.erase=function(e,t){this._isErasing||(this._cachedBlendMode=this.curBlendMode,this.blendMode(o.REMOVE),this._cachedFillStyle=this.curFillColor.slice(),this.curFillColor=[1,1,1,e/255],this._cachedStrokeStyle=this.curStrokeColor.slice(),this.curStrokeColor=[1,1,1,t/255],this._isErasing=!0)},u.default.RendererGL.prototype.noErase=function(){this._isErasing&&(this.curFillColor=this._cachedFillStyle.slice(),this.curStrokeColor=this._cachedStrokeStyle.slice(),this.blendMode(this._cachedBlendMode),this._isErasing=!1)},u.default.RendererGL.prototype.strokeWeight=function(e){this.curStrokeWeight!==e&&(this.pointSize=e,this.curStrokeWeight=e)},u.default.RendererGL.prototype._getPixel=function(e,t){var r;return r=new Uint8Array(4),this.drawingContext.readPixels(e,t,1,1,this.drawingContext.RGBA,this.drawingContext.UNSIGNED_BYTE,r),[r[0],r[1],r[2],r[3]]},u.default.RendererGL.prototype.loadPixels=function(){var e=this._pixelsState;if(!0===this._pInst._glAttributes.preserveDrawingBuffer){var t=e.pixels,r=this.GL.drawingBufferWidth*this.GL.drawingBufferHeight*4;t instanceof Uint8Array&&t.length===r||(t=new Uint8Array(r),this._pixelsState._setProperty("pixels",t));var i=this._pInst._pixelDensity;this.GL.readPixels(0,0,this.width*i,this.height*i,this.GL.RGBA,this.GL.UNSIGNED_BYTE,t)}else console.log("loadPixels only works in WebGL when preserveDrawingBuffer is true.")},u.default.RendererGL.prototype.geometryInHash=function(e){return void 0!==this.retainedMode.geometry[e]},u.default.RendererGL.prototype.resize=function(e,t){u.default.Renderer.prototype.resize.call(this,e,t),this.GL.viewport(0,0,this.GL.drawingBufferWidth,this.GL.drawingBufferHeight),this._viewport=this.GL.getParameter(this.GL.VIEWPORT),this._curCamera._resize();var r=this._pixelsState;void 0!==r.pixels&&r._setProperty("pixels",new Uint8Array(this.GL.drawingBufferWidth*this.GL.drawingBufferHeight*4))},u.default.RendererGL.prototype.clear=function(){var e=(arguments.length<=0?void 0:arguments[0])||0,t=(arguments.length<=1?void 0:arguments[1])||0,r=(arguments.length<=2?void 0:arguments[2])||0,i=(arguments.length<=3?void 0:arguments[3])||0;this.GL.clearColor(e,t,r,i),this.GL.clear(this.GL.COLOR_BUFFER_BIT|this.GL.DEPTH_BUFFER_BIT)},u.default.RendererGL.prototype.applyMatrix=function(e,t,r,i,n,o){16===arguments.length?u.default.Matrix.prototype.apply.apply(this.uMVMatrix,arguments):this.uMVMatrix.apply([e,t,0,0,r,i,0,0,0,0,1,0,n,o,0,1])},u.default.RendererGL.prototype.translate=function(e,t,r){return e instanceof u.default.Vector&&(r=e.z,t=e.y,e=e.x),this.uMVMatrix.translate([e,t,r]),this},u.default.RendererGL.prototype.scale=function(e,t,r){return this.uMVMatrix.scale(e,t,r),this},u.default.RendererGL.prototype.rotate=function(e,t){return void 0===t?this.rotateZ(e):(u.default.Matrix.prototype.rotate.apply(this.uMVMatrix,arguments),this)},u.default.RendererGL.prototype.rotateX=function(e){return this.rotate(e,1,0,0),this},u.default.RendererGL.prototype.rotateY=function(e){return this.rotate(e,0,1,0),this},u.default.RendererGL.prototype.rotateZ=function(e){return this.rotate(e,0,0,1),this},u.default.RendererGL.prototype.push=function(){var e=u.default.Renderer.prototype.push.apply(this),t=e.properties;return t.uMVMatrix=this.uMVMatrix.copy(),t.uPMatrix=this.uPMatrix.copy(),t._curCamera=this._curCamera,this._curCamera=this._curCamera.copy(),t.ambientLightColors=this.ambientLightColors.slice(),t.specularColors=this.specularColors.slice(),t.directionalLightDirections=this.directionalLightDirections.slice(),t.directionalLightDiffuseColors=this.directionalLightDiffuseColors.slice(),t.directionalLightSpecularColors=this.directionalLightSpecularColors.slice(),t.pointLightPositions=this.pointLightPositions.slice(),t.pointLightDiffuseColors=this.pointLightDiffuseColors.slice(),t.pointLightSpecularColors=this.pointLightSpecularColors.slice(),t.spotLightPositions=this.spotLightPositions.slice(),t.spotLightDirections=this.spotLightDirections.slice(),t.spotLightDiffuseColors=this.spotLightDiffuseColors.slice(),t.spotLightSpecularColors=this.spotLightSpecularColors.slice(),t.spotLightAngle=this.spotLightAngle.slice(),t.spotLightConc=this.spotLightConc.slice(),t.userFillShader=this.userFillShader,t.userStrokeShader=this.userStrokeShader,t.userPointShader=this.userPointShader,t.pointSize=this.pointSize,t.curStrokeWeight=this.curStrokeWeight,t.curStrokeColor=this.curStrokeColor,t.curFillColor=this.curFillColor,t._useSpecularMaterial=this._useSpecularMaterial,t._useEmissiveMaterial=this._useEmissiveMaterial,t._useShininess=this._useShininess,t.constantAttenuation=this.constantAttenuation,t.linearAttenuation=this.linearAttenuation,t.quadraticAttenuation=this.quadraticAttenuation,t._enableLighting=this._enableLighting,t._useNormalMaterial=this._useNormalMaterial,t._tex=this._tex,t.drawMode=this.drawMode,e},u.default.RendererGL.prototype.resetMatrix=function(){return this.uMVMatrix=u.default.Matrix.identity(this._pInst),this},u.default.RendererGL.prototype._getImmediateStrokeShader=function(){var e=this.userStrokeShader;return e&&e.isStrokeShader()?e:this._getLineShader()},u.default.RendererGL.prototype._getRetainedStrokeShader=u.default.RendererGL.prototype._getImmediateStrokeShader,u.default.RendererGL.prototype._getImmediateFillShader=function(){var e=this.userFillShader;if(this._useNormalMaterial&&(!e||!e.isNormalShader()))return this._getNormalShader();if(this._enableLighting){if(!e||!e.isLightShader())return this._getLightShader()}else if(this._tex){if(!e||!e.isTextureShader())return this._getLightShader()}else if(!e)return this._getImmediateModeShader();return e},u.default.RendererGL.prototype._getRetainedFillShader=function(){if(this._useNormalMaterial)return this._getNormalShader();var e=this.userFillShader;if(this._enableLighting){if(!e||!e.isLightShader())return this._getLightShader()}else if(this._tex){if(!e||!e.isTextureShader())return this._getLightShader()}else if(!e)return this._getColorShader();return e},u.default.RendererGL.prototype._getImmediatePointShader=function(){var e=this.userPointShader;return e&&e.isPointShader()?e:this._getPointShader()},u.default.RendererGL.prototype._getRetainedLineShader=u.default.RendererGL.prototype._getImmediateLineShader,u.default.RendererGL.prototype._getLightShader=function(){return this._defaultLightShader||(this._pInst._glAttributes.perPixelLighting?this._defaultLightShader=new u.default.Shader(this,c.phongVert,c.phongFrag):this._defaultLightShader=new u.default.Shader(this,c.lightVert,c.lightTextureFrag)),this._defaultLightShader},u.default.RendererGL.prototype._getImmediateModeShader=function(){return this._defaultImmediateModeShader||(this._defaultImmediateModeShader=new u.default.Shader(this,c.immediateVert,c.vertexColorFrag)),this._defaultImmediateModeShader},u.default.RendererGL.prototype._getNormalShader=function(){return this._defaultNormalShader||(this._defaultNormalShader=new u.default.Shader(this,c.normalVert,c.normalFrag)),this._defaultNormalShader},u.default.RendererGL.prototype._getColorShader=function(){return this._defaultColorShader||(this._defaultColorShader=new u.default.Shader(this,c.normalVert,c.basicFrag)),this._defaultColorShader},u.default.RendererGL.prototype._getPointShader=function(){return this._defaultPointShader||(this._defaultPointShader=new u.default.Shader(this,c.pointVert,c.pointFrag)),this._defaultPointShader},u.default.RendererGL.prototype._getLineShader=function(){return this._defaultLineShader||(this._defaultLineShader=new u.default.Shader(this,c.lineVert,c.lineFrag)),this._defaultLineShader},u.default.RendererGL.prototype._getFontShader=function(){return this._defaultFontShader||(this.GL.getExtension("OES_standard_derivatives"),this._defaultFontShader=new u.default.Shader(this,c.fontVert,c.fontFrag)),this._defaultFontShader},u.default.RendererGL.prototype._getEmptyTexture=function(){if(!this._emptyTexture){var e=new u.default.Image(1,1);e.set(0,0,255),this._emptyTexture=new u.default.Texture(this,e)}return this._emptyTexture},u.default.RendererGL.prototype.getTexture=function(e){var t=this.textures,r=!0,i=!1,n=void 0;try{for(var o,a=t[Symbol.iterator]();!(r=(o=a.next()).done);r=!0){var s=o.value;if(s.src===e)return s}}catch(e){i=!0,n=e}finally{try{r||null==a.return||a.return()}finally{if(i)throw n}}var l=new u.default.Texture(this,e);return t.push(l),l},u.default.RendererGL.prototype._setStrokeUniforms=function(e){e.bindShader(),e.setUniform("uMaterialColor",this.curStrokeColor),e.setUniform("uStrokeWeight",this.curStrokeWeight)},u.default.RendererGL.prototype._setFillUniforms=function(e){e.bindShader(),e.setUniform("uMaterialColor",this.curFillColor),e.setUniform("isTexture",!!this._tex),this._tex&&e.setUniform("uSampler",this._tex),e.setUniform("uTint",this._tint),e.setUniform("uSpecular",this._useSpecularMaterial),e.setUniform("uEmissive",this._useEmissiveMaterial),e.setUniform("uShininess",this._useShininess),e.setUniform("uUseLighting",this._enableLighting);var t=this.pointLightDiffuseColors.length/3;e.setUniform("uPointLightCount",t),e.setUniform("uPointLightLocation",this.pointLightPositions),e.setUniform("uPointLightDiffuseColors",this.pointLightDiffuseColors),e.setUniform("uPointLightSpecularColors",this.pointLightSpecularColors);var r=this.directionalLightDiffuseColors.length/3;e.setUniform("uDirectionalLightCount",r),e.setUniform("uLightingDirection",this.directionalLightDirections),e.setUniform("uDirectionalDiffuseColors",this.directionalLightDiffuseColors),e.setUniform("uDirectionalSpecularColors",this.directionalLightSpecularColors);var i=this.ambientLightColors.length/3;e.setUniform("uAmbientLightCount",i),e.setUniform("uAmbientColor",this.ambientLightColors);var n=this.spotLightDiffuseColors.length/3;e.setUniform("uSpotLightCount",n),e.setUniform("uSpotLightAngle",this.spotLightAngle),e.setUniform("uSpotLightConc",this.spotLightConc),e.setUniform("uSpotLightDiffuseColors",this.spotLightDiffuseColors),e.setUniform("uSpotLightSpecularColors",this.spotLightSpecularColors),e.setUniform("uSpotLightLocation",this.spotLightPositions),e.setUniform("uSpotLightDirection",this.spotLightDirections),e.setUniform("uConstantAttenuation",this.constantAttenuation),e.setUniform("uLinearAttenuation",this.linearAttenuation),e.setUniform("uQuadraticAttenuation",this.quadraticAttenuation),e.bindTextures()},u.default.RendererGL.prototype._setPointUniforms=function(e){e.bindShader(),e.setUniform("uMaterialColor",this.curStrokeColor),e.setUniform("uPointSize",this.pointSize)},u.default.RendererGL.prototype._bindBuffer=function(e,t,r,i,n){if(t=t||this.GL.ARRAY_BUFFER,this.GL.bindBuffer(t,e),void 0!==r){var o=new(i||Float32Array)(r);this.GL.bufferData(t,o,n||this.GL.STATIC_DRAW)}},u.default.RendererGL.prototype._arraysEqual=function(e,t){var r=e.length;if(r!==t.length)return!1;for(var i=0;i>7,127&f,c>>7,127&c);for(var d=0;d>7,127&p,0,0)}}return{cellImageInfo:l,dimOffset:o,dimImageInfo:n}}return(t=this.glyphInfos[e.index]={glyph:e,uGlyphRect:[i.x1,-i.y1,i.x2,-i.y2],strokeImageInfo:U,strokes:d,colInfo:G(m,this.colDimImageInfos,this.colCellImageInfos),rowInfo:G(p,this.rowDimImageInfos,this.rowCellImageInfos)}).uGridOffset=[t.colInfo.dimOffset,t.rowInfo.dimOffset],t}}var z=Math.sqrt(3);j.default.RendererGL.prototype._renderText=function(e,t,r,i,n){if(this._textFont&&"string"!=typeof this._textFont){if(!(n<=i)&&this._doFill){if(!this._isOpenType())return console.log("WEBGL: only Opentype (.otf) and Truetype (.ttf) fonts are supported"),e;e.push();var o=this._doStroke,a=this.drawMode;this._doStroke=!1,this.drawMode=D.TEXTURE;var s=this._textFont.font,l=this._textFont._fontInfo;l=l||(this._textFont._fontInfo=new A(s));var u=this._textFont._handleAlignment(this,t,r,i),h=this._textSize/s.unitsPerEm;this.translate(u.x,u.y,0),this.scale(h,h,1);var c=this.GL,f=!this._defaultFontShader,d=this._getFontShader();d.init(),d.bindShader(),f&&(d.setUniform("uGridImageSize",[64,64]),d.setUniform("uCellsImageSize",[64,64]),d.setUniform("uStrokeImageSize",[64,64]),d.setUniform("uGridSize",[9,9])),this._applyColorBlend(this.curFillColor);var p=this.retainedMode.geometry.glyph;if(!p){var m=this._textGeom=new j.default.Geometry(1,1,function(){for(var e=0;e<=1;e++)for(var t=0;t<=1;t++)this.vertices.push(new j.default.Vector(t,e,0)),this.uvs.push(t,e)});m.computeFaces().computeNormals(),p=this.createBuffers("glyph",m)}var g=!0,v=!1,y=void 0;try{for(var b,_=this.retainedMode.buffers.text[Symbol.iterator]();!(g=(b=_.next()).done);g=!0){b.value._prepareBuffer(p,d)}}catch(e){v=!0,y=e}finally{try{g||null==_.return||_.return()}finally{if(v)throw y}}this._bindBuffer(p.indexBuffer,c.ELEMENT_ARRAY_BUFFER),d.setUniform("uMaterialColor",this.curFillColor);try{var x=0,w=null,S=s.stringToGlyphs(t),M=!0,E=!1,T=void 0;try{for(var C,P=S[Symbol.iterator]();!(M=(C=P.next()).done);M=!0){var L=C.value;w&&(x+=s.getKerningValue(w,L));var k=l.getGlyphInfo(L);if(k.uGlyphRect){var R=k.rowInfo,O=k.colInfo;d.setUniform("uSamplerStrokes",k.strokeImageInfo.imageData),d.setUniform("uSamplerRowStrokes",R.cellImageInfo.imageData),d.setUniform("uSamplerRows",R.dimImageInfo.imageData),d.setUniform("uSamplerColStrokes",O.cellImageInfo.imageData),d.setUniform("uSamplerCols",O.dimImageInfo.imageData),d.setUniform("uGridOffset",k.uGridOffset),d.setUniform("uGlyphRect",k.uGlyphRect),d.setUniform("uGlyphOffset",x),d.bindTextures(),c.drawElements(c.TRIANGLES,6,this.GL.UNSIGNED_SHORT,0)}x+=L.advanceWidth,w=L}}catch(e){E=!0,T=e}finally{try{M||null==P.return||P.return()}finally{if(E)throw T}}}finally{d.unbindShader(),this._doStroke=o,this.drawMode=a,e.pop()}return e}}else console.log("WEBGL: you must load and set a font before drawing text. See `loadFont` and `textFont` for more details.")}},{"../core/constants":42,"../core/main":49,"./p5.RendererGL.Retained":102,"./p5.Shader":104}],107:[function(e,t,r){t.exports={fes:{autoplay:"The media that tried to play (with '{{src}}') wasn't allowed to by this browser, most likely due to the browser's autoplay policy. Check out {{link}} for more information about why.",fileLoadError:{bytes:"It looks like there was a problem loading your file. {{suggestion}}",font:"It looks like there was a problem loading your font. {{suggestion}}",gif:"There was some trouble loading your GIF. Make sure that your GIF is using 87a or 89a encoding.",image:"It looks like there was a problem loading your image. {{suggestion}}",json:"It looks like there was a problem loading your JSON file. {{suggestion}}",large:"If your large file isn't fetched successfully, we recommend splitting the file into smaller segments and fetching those.",strings:"It looks like there was a problem loading your text file. {{suggestion}}",suggestion:"Try checking if the file path ({{filePath}}) is correct, hosting the file online, or running a local server. (More info at {{link}})",table:"It looks like there was a problem loading your table file. {{suggestion}}",xml:"It looks like there was a problem loading your XML file. {{suggestion}}"},misusedTopLevel:"Did you just try to use p5.js's {{symbolName}} {{symbolType}}? If so, you may want to move it into your sketch's setup() function.\n\nFor more details, see: {{link}}",pre:"🌸 p5.js says: {{message}}",welcome:"Welcome! This is your friendly debugger. To turn me off, switch to using p5.min.js."}}},{}],108:[function(e,t,r){t.exports={fes:{autoplay:"Su browser impidío un medio tocar (de '{{src}}'), posiblemente porque las reglas de autoplay. Para aprender más, visite {{link}}.",fileLoadError:{bytes:"",font:"",gif:"",image:"",json:"",large:"",strings:"",suggestion:"",table:"",xml:""},misusedTopLevel:"",pre:"🌸 p5.js dice: {{message}}",welcome:""}}},{}],109:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i=o(e("./en/translation")),n=o(e("./es/translation"));function o(e){return e&&e.__esModule?e:{default:e}}var a={en:{translation:i.default},es:{translation:n.default}};r.default=a},{"./en/translation":107,"./es/translation":108}]},{},[37])(37)}); ================================================ FILE: docs/examples/pyodide/breakout/target/target_sketch.js ================================================ const wrapperContent = ` class PythonFunctions: pass setattr(PythonFunctions, 'map', map) setattr(PythonFunctions, 'filter', filter) setattr(PythonFunctions, 'set', set) _P5_INSTANCE = None _CTX_MIDDLE = None _DEFAULT_FILL = None _DEFAULT_LEADMULT = None _DEFAULT_STROKE = None _DEFAULT_TEXT_FILL = None ADD = None ALT = None ARROW = None AUDIO = None AUTO = None AXES = None BACKSPACE = None BASELINE = None BEVEL = None BEZIER = None BLEND = None BLUR = None BOLD = None BOLDITALIC = None BOTTOM = None BURN = None CENTER = None CHORD = None CLAMP = None CLOSE = None CONTROL = None CORNER = None CORNERS = None CROSS = None CURVE = None DARKEST = None DEG_TO_RAD = None DEGREES = None DELETE = None DIFFERENCE = None DILATE = None DODGE = None DOWN_ARROW = None ENTER = None ERODE = None ESCAPE = None EXCLUSION = None FILL = None GRAY = None GRID = None HALF_PI = None HAND = None HARD_LIGHT = None HSB = None HSL = None IMAGE = None IMMEDIATE = None INVERT = None ITALIC = None LANDSCAPE = None LEFT = None LEFT_ARROW = None LIGHTEST = None LINE_LOOP = None LINE_STRIP = None LINEAR = None LINES = None MIRROR = None MITER = None MOVE = None MULTIPLY = None NEAREST = None NORMAL = None OPAQUE = None OPEN = None OPTION = None OVERLAY = None PI = None PIE = None POINTS = None PORTRAIT = None POSTERIZE = None PROJECT = None QUAD_STRIP = None QUADRATIC = None QUADS = None QUARTER_PI = None RAD_TO_DEG = None RADIANS = None RADIUS = None REPEAT = None REPLACE = None RETURN = None RGB = None RIGHT = None RIGHT_ARROW = None ROUND = None SCREEN = None SHIFT = None SOFT_LIGHT = None SQUARE = None STROKE = None SUBTRACT = None TAB = None TAU = None TEXT = None TEXTURE = None THRESHOLD = None TOP = None TRIANGLE_FAN = None TRIANGLE_STRIP = None TRIANGLES = None TWO_PI = None UP_ARROW = None VIDEO = None WAIT = None WEBGL = None P2D = None PI = None frameCount = None focused = None displayWidth = None displayHeight = None windowWidth = None windowHeight = None width = None height = None deviceOrientation = None accelerationX = None accelerationY = None accelerationZ = None pAccelerationX = None pAccelerationY = None pAccelerationZ = None rotationX = None rotationY = None rotationZ = None pRotationX = None pRotationY = None pRotationZ = None turnAxis = None keyIsPressed = None key = None keyCode = None mouseX = None mouseY = None pmouseX = None pmouseY = None winMouseX = None winMouseY = None pwinMouseX = None pwinMouseY = None mouseButton = None mouseIsPressed = None touches = None pixels = None def alpha(*args): return _P5_INSTANCE.alpha(*args) def blue(*args): return _P5_INSTANCE.blue(*args) def brightness(*args): return _P5_INSTANCE.brightness(*args) def color(*args): return _P5_INSTANCE.color(*args) def green(*args): return _P5_INSTANCE.green(*args) def hue(*args): return _P5_INSTANCE.hue(*args) def lerpColor(*args): return _P5_INSTANCE.lerpColor(*args) def lightness(*args): return _P5_INSTANCE.lightness(*args) def red(*args): return _P5_INSTANCE.red(*args) def saturation(*args): return _P5_INSTANCE.saturation(*args) def background(*args): return _P5_INSTANCE.background(*args) def clear(*args): p5_clear = _P5_INSTANCE.clear(*args) return p5_clear def erase(*args): return _P5_INSTANCE.erase(*args) def noErase(*args): return _P5_INSTANCE.noErase(*args) def colorMode(*args): return _P5_INSTANCE.colorMode(*args) def fill(*args): return _P5_INSTANCE.fill(*args) def noFill(*args): return _P5_INSTANCE.noFill(*args) def noStroke(*args): return _P5_INSTANCE.noStroke(*args) def stroke(*args): return _P5_INSTANCE.stroke(*args) def arc(*args): return _P5_INSTANCE.arc(*args) def ellipse(*args): return _P5_INSTANCE.ellipse(*args) def circle(*args): return _P5_INSTANCE.circle(*args) def line(*args): return _P5_INSTANCE.line(*args) def point(*args): return _P5_INSTANCE.point(*args) def quad(*args): return _P5_INSTANCE.quad(*args) def rect(*args): return _P5_INSTANCE.rect(*args) def square(*args): return _P5_INSTANCE.square(*args) def triangle(*args): return _P5_INSTANCE.triangle(*args) def plane(*args): return _P5_INSTANCE.plane(*args) def box(*args): return _P5_INSTANCE.box(*args) def sphere(*args): return _P5_INSTANCE.sphere(*args) def cylinder(*args): return _P5_INSTANCE.cylinder(*args) def cone(*args): return _P5_INSTANCE.cone(*args) def ellipsoid(*args): return _P5_INSTANCE.ellipsoid(*args) def torus(*args): return _P5_INSTANCE.torus(*args) def loadModel(*args): return _P5_INSTANCE.loadModel(*args) def model(*args): return _P5_INSTANCE.model(*args) def ellipseMode(*args): return _P5_INSTANCE.ellipseMode(*args) def noSmooth(*args): return _P5_INSTANCE.noSmooth(*args) def rectMode(*args): return _P5_INSTANCE.rectMode(*args) def smooth(*args): return _P5_INSTANCE.smooth(*args) def strokeCap(*args): return _P5_INSTANCE.strokeCap(*args) def strokeJoin(*args): return _P5_INSTANCE.strokeJoin(*args) def strokeWeight(*args): return _P5_INSTANCE.strokeWeight(*args) def bezier(*args): return _P5_INSTANCE.bezier(*args) def bezierDetail(*args): return _P5_INSTANCE.bezierDetail(*args) def bezierPoint(*args): return _P5_INSTANCE.bezierPoint(*args) def bezierTangent(*args): return _P5_INSTANCE.bezierTangent(*args) def curve(*args): return _P5_INSTANCE.curve(*args) def curveDetail(*args): return _P5_INSTANCE.curveDetail(*args) def curveTightness(*args): return _P5_INSTANCE.curveTightness(*args) def curvePoint(*args): return _P5_INSTANCE.curvePoint(*args) def curveTangent(*args): return _P5_INSTANCE.curveTangent(*args) def beginContour(*args): return _P5_INSTANCE.beginContour(*args) def beginShape(*args): return _P5_INSTANCE.beginShape(*args) def bezierVertex(*args): return _P5_INSTANCE.bezierVertex(*args) def curveVertex(*args): return _P5_INSTANCE.curveVertex(*args) def endContour(*args): return _P5_INSTANCE.endContour(*args) def endShape(*args): return _P5_INSTANCE.endShape(*args) def quadraticVertex(*args): return _P5_INSTANCE.quadraticVertex(*args) def vertex(*args): return _P5_INSTANCE.vertex(*args) def cursor(*args): return _P5_INSTANCE.cursor(*args) def frameRate(*args): return _P5_INSTANCE.frameRate(*args) def noCursor(*args): return _P5_INSTANCE.noCursor(*args) def fullscreen(*args): return _P5_INSTANCE.fullscreen(*args) def pixelDensity(*args): return _P5_INSTANCE.pixelDensity(*args) def displayDensity(*args): return _P5_INSTANCE.displayDensity(*args) def getURL(*args): return _P5_INSTANCE.getURL(*args) def getURLPath(*args): return _P5_INSTANCE.getURLPath(*args) def getURLParams(*args): return _P5_INSTANCE.getURLParams(*args) def remove(*args): return _P5_INSTANCE.remove(*args) def noLoop(*args): return _P5_INSTANCE.noLoop(*args) def loop(*args): return _P5_INSTANCE.loop(*args) def push(*args): return _P5_INSTANCE.push(*args) def redraw(*args): return _P5_INSTANCE.redraw(*args) def resizeCanvas(*args): return _P5_INSTANCE.resizeCanvas(*args) def noCanvas(*args): return _P5_INSTANCE.noCanvas(*args) def createGraphics(*args): return _P5_INSTANCE.createGraphics(*args) def blendMode(*args): return _P5_INSTANCE.blendMode(*args) def setAttributes(*args): return _P5_INSTANCE.setAttributes(*args) def applyMatrix(*args): return _P5_INSTANCE.applyMatrix(*args) def resetMatrix(*args): return _P5_INSTANCE.resetMatrix(*args) def rotate(*args): return _P5_INSTANCE.rotate(*args) def rotateX(*args): return _P5_INSTANCE.rotateX(*args) def rotateY(*args): return _P5_INSTANCE.rotateY(*args) def rotateZ(*args): return _P5_INSTANCE.rotateZ(*args) def scale(*args): return _P5_INSTANCE.scale(*args) def shearX(*args): return _P5_INSTANCE.shearX(*args) def shearY(*args): return _P5_INSTANCE.shearY(*args) def translate(*args): return _P5_INSTANCE.translate(*args) def createStringDict(*args): return _P5_INSTANCE.createStringDict(*args) def createNumberDict(*args): return _P5_INSTANCE.createNumberDict(*args) def append(*args): return _P5_INSTANCE.append(*args) def arrayCopy(*args): return _P5_INSTANCE.arrayCopy(*args) def concat(*args): return _P5_INSTANCE.concat(*args) def reverse(*args): return _P5_INSTANCE.reverse(*args) def shorten(*args): return _P5_INSTANCE.shorten(*args) def shuffle(*args): return _P5_INSTANCE.shuffle(*args) def sort(*args): return _P5_INSTANCE.sort(*args) def splice(*args): return _P5_INSTANCE.splice(*args) def subset(*args): return _P5_INSTANCE.subset(*args) def float(*args): return _P5_INSTANCE.float(*args) def int(*args): return _P5_INSTANCE.int(*args) def str(*args): return _P5_INSTANCE.str(*args) def boolean(*args): return _P5_INSTANCE.boolean(*args) def byte(*args): return _P5_INSTANCE.byte(*args) def char(*args): return _P5_INSTANCE.char(*args) def unchar(*args): return _P5_INSTANCE.unchar(*args) def hex(*args): return _P5_INSTANCE.hex(*args) def unhex(*args): return _P5_INSTANCE.unhex(*args) def join(*args): return _P5_INSTANCE.join(*args) def match(*args): return _P5_INSTANCE.match(*args) def matchAll(*args): return _P5_INSTANCE.matchAll(*args) def nf(*args): return _P5_INSTANCE.nf(*args) def nfc(*args): return _P5_INSTANCE.nfc(*args) def nfp(*args): return _P5_INSTANCE.nfp(*args) def nfs(*args): return _P5_INSTANCE.nfs(*args) def split(*args): return _P5_INSTANCE.split(*args) def splitTokens(*args): return _P5_INSTANCE.splitTokens(*args) def trim(*args): return _P5_INSTANCE.trim(*args) def setMoveThreshold(*args): return _P5_INSTANCE.setMoveThreshold(*args) def setShakeThreshold(*args): return _P5_INSTANCE.setShakeThreshold(*args) def keyIsDown(*args): return _P5_INSTANCE.keyIsDown(*args) def createImage(*args): return _P5_INSTANCE.createImage(*args) def saveCanvas(*args): return _P5_INSTANCE.saveCanvas(*args) def saveFrames(*args): return _P5_INSTANCE.saveFrames(*args) def loadImage(*args): return _P5_INSTANCE.loadImage(*args) def image(*args): return _P5_INSTANCE.image(*args) def tint(*args): return _P5_INSTANCE.tint(*args) def noTint(*args): return _P5_INSTANCE.noTint(*args) def imageMode(*args): return _P5_INSTANCE.imageMode(*args) def blend(*args): return _P5_INSTANCE.blend(*args) def copy(*args): return _P5_INSTANCE.copy(*args) def filter(*args): if len(args) > 1 and (args[0] is None or callable(args[0])): return PythonFunctions.filter(*args) else: return _P5_INSTANCE.filter(*args) def get(*args): return _P5_INSTANCE.get(*args) def loadPixels(*args): return _P5_INSTANCE.loadPixels(*args) def set(*args): if len(args) <= 1: return PythonFunctions.set(*args) else: return _P5_INSTANCE.set(*args) def updatePixels(*args): return _P5_INSTANCE.updatePixels(*args) def loadJSON(*args): return _P5_INSTANCE.loadJSON(*args) def loadStrings(*args): return _P5_INSTANCE.loadStrings(*args) def loadTable(*args): return _P5_INSTANCE.loadTable(*args) def loadXML(*args): return _P5_INSTANCE.loadXML(*args) def loadBytes(*args): return _P5_INSTANCE.loadBytes(*args) def httpGet(*args): return _P5_INSTANCE.httpGet(*args) def httpPost(*args): return _P5_INSTANCE.httpPost(*args) def httpDo(*args): return _P5_INSTANCE.httpDo(*args) def createWriter(*args): return _P5_INSTANCE.createWriter(*args) def save(*args): return _P5_INSTANCE.save(*args) def saveJSON(*args): return _P5_INSTANCE.saveJSON(*args) def saveStrings(*args): return _P5_INSTANCE.saveStrings(*args) def saveTable(*args): return _P5_INSTANCE.saveTable(*args) def day(*args): return _P5_INSTANCE.day(*args) def hour(*args): return _P5_INSTANCE.hour(*args) def minute(*args): return _P5_INSTANCE.minute(*args) def millis(*args): return _P5_INSTANCE.millis(*args) def month(*args): return _P5_INSTANCE.month(*args) def second(*args): return _P5_INSTANCE.second(*args) def year(*args): return _P5_INSTANCE.year(*args) def createVector(*args): return _P5_INSTANCE.createVector(*args) def abs(*args): return _P5_INSTANCE.abs(*args) def ceil(*args): return _P5_INSTANCE.ceil(*args) def constrain(*args): return _P5_INSTANCE.constrain(*args) def dist(*args): return _P5_INSTANCE.dist(*args) def exp(*args): return _P5_INSTANCE.exp(*args) def floor(*args): return _P5_INSTANCE.floor(*args) def lerp(*args): return _P5_INSTANCE.lerp(*args) def log(*args): return _P5_INSTANCE.log(*args) def mag(*args): return _P5_INSTANCE.mag(*args) def map(*args): if len(args) > 1 and callable(args[0]): return PythonFunctions.map(*args) else: return _P5_INSTANCE.map(*args) def max(*args): return _P5_INSTANCE.max(*args) def min(*args): return _P5_INSTANCE.min(*args) def norm(*args): return _P5_INSTANCE.norm(*args) def pow(*args): return _P5_INSTANCE.pow(*args) def round(*args): return _P5_INSTANCE.round(*args) def sq(*args): return _P5_INSTANCE.sq(*args) def sqrt(*args): return _P5_INSTANCE.sqrt(*args) def noise(*args): return _P5_INSTANCE.noise(*args) def noiseDetail(*args): return _P5_INSTANCE.noiseDetail(*args) def noiseSeed(*args): return _P5_INSTANCE.noiseSeed(*args) def randomSeed(*args): return _P5_INSTANCE.randomSeed(*args) def random(*args): return _P5_INSTANCE.random(*args) def randomGaussian(*args): return _P5_INSTANCE.randomGaussian(*args) def acos(*args): return _P5_INSTANCE.acos(*args) def asin(*args): return _P5_INSTANCE.asin(*args) def atan(*args): return _P5_INSTANCE.atan(*args) def atan2(*args): return _P5_INSTANCE.atan2(*args) def cos(*args): return _P5_INSTANCE.cos(*args) def sin(*args): return _P5_INSTANCE.sin(*args) def tan(*args): return _P5_INSTANCE.tan(*args) def degrees(*args): return _P5_INSTANCE.degrees(*args) def radians(*args): return _P5_INSTANCE.radians(*args) def angleMode(*args): return _P5_INSTANCE.angleMode(*args) def textAlign(*args): return _P5_INSTANCE.textAlign(*args) def textLeading(*args): return _P5_INSTANCE.textLeading(*args) def textSize(*args): return _P5_INSTANCE.textSize(*args) def textStyle(*args): return _P5_INSTANCE.textStyle(*args) def textWidth(*args): return _P5_INSTANCE.textWidth(*args) def textAscent(*args): return _P5_INSTANCE.textAscent(*args) def textDescent(*args): return _P5_INSTANCE.textDescent(*args) def loadFont(*args): return _P5_INSTANCE.loadFont(*args) def text(*args): return _P5_INSTANCE.text(*args) def textFont(*args): return _P5_INSTANCE.textFont(*args) def orbitControl(*args): return _P5_INSTANCE.orbitControl(*args) def debugMode(*args): return _P5_INSTANCE.debugMode(*args) def noDebugMode(*args): return _P5_INSTANCE.noDebugMode(*args) def ambientLight(*args): return _P5_INSTANCE.ambientLight(*args) def directionalLight(*args): return _P5_INSTANCE.directionalLight(*args) def pointLight(*args): return _P5_INSTANCE.pointLight(*args) def lights(*args): return _P5_INSTANCE.lights(*args) def loadShader(*args): return _P5_INSTANCE.loadShader(*args) def createShader(*args): return _P5_INSTANCE.createShader(*args) def shader(*args): return _P5_INSTANCE.shader(*args) def resetShader(*args): return _P5_INSTANCE.resetShader(*args) def normalMaterial(*args): return _P5_INSTANCE.normalMaterial(*args) def texture(*args): return _P5_INSTANCE.texture(*args) def textureMode(*args): return _P5_INSTANCE.textureMode(*args) def textureWrap(*args): return _P5_INSTANCE.textureWrap(*args) def ambientMaterial(*args): return _P5_INSTANCE.ambientMaterial(*args) def specularMaterial(*args): return _P5_INSTANCE.specularMaterial(*args) def shininess(*args): return _P5_INSTANCE.shininess(*args) def camera(*args): return _P5_INSTANCE.camera(*args) def perspective(*args): return _P5_INSTANCE.perspective(*args) def ortho(*args): return _P5_INSTANCE.ortho(*args) def createCamera(*args): return _P5_INSTANCE.createCamera(*args) def setCamera(*args): return _P5_INSTANCE.setCamera(*args) def select(*args): return _P5_INSTANCE.select(*args) def selectAll(*args): return _P5_INSTANCE.selectAll(*args) def removeElements(*args): return _P5_INSTANCE.removeElements(*args) def changed(*args): return _P5_INSTANCE.changed(*args) def input(*args): return _P5_INSTANCE.input(*args) def createDiv(*args): return _P5_INSTANCE.createDiv(*args) def createP(*args): return _P5_INSTANCE.createP(*args) def createSpan(*args): return _P5_INSTANCE.createSpan(*args) def createImg(*args): return _P5_INSTANCE.createImg(*args) def createA(*args): return _P5_INSTANCE.createA(*args) def createSlider(*args): return _P5_INSTANCE.createSlider(*args) def createButton(*args): return _P5_INSTANCE.createButton(*args) def createCheckbox(*args): return _P5_INSTANCE.createCheckbox(*args) def createSelect(*args): return _P5_INSTANCE.createSelect(*args) def createRadio(*args): return _P5_INSTANCE.createRadio(*args) def createColorPicker(*args): return _P5_INSTANCE.createColorPicker(*args) def createInput(*args): return _P5_INSTANCE.createInput(*args) def createFileInput(*args): return _P5_INSTANCE.createFileInput(*args) def createVideo(*args): return _P5_INSTANCE.createVideo(*args) def createAudio(*args): return _P5_INSTANCE.createAudio(*args) def createCapture(*args): return _P5_INSTANCE.createCapture(*args) def createElement(*args): return _P5_INSTANCE.createElement(*args) def createCanvas(*args): canvas = _P5_INSTANCE.createCanvas(*args) global width, height width = _P5_INSTANCE.width height = _P5_INSTANCE.height return canvas def __deviceMoved(e): try: _bind_event_function(deviceMoved, e) except NameError: pass def __deviceTurned(e): try: _bind_event_function(deviceTurned, e) except NameError: pass def __deviceShaken(e): try: _bind_event_function(deviceShaken, e) except NameError: pass def __touchEnded(e): try: _bind_event_function(deviceShaken, e) except NameError: pass def __touchStarted(e): try: _bind_event_function(touchStarted, e) except NameError: pass def __windowResized(e): try: _bind_event_function(windowResized, e) except NameError: pass def __touchMoved(e): try: _bind_event_function(touchMoved, e) except NameError: pass def __mouseMoved(e): try: _bind_event_function(mouseMoved, e) except NameError: pass def __mouseDragged(e): try: _bind_event_function(mouseDragged, e) except NameError: pass def __mousePressed(e): try: _bind_event_function(mousePressed, e) except NameError: pass def __mouseReleased(e): try: _bind_event_function(mouseReleased, e) except NameError: pass def __mouseClicked(e): try: _bind_event_function(mouseClicked, e) except NameError: pass def __doubleClicked(e): try: _bind_event_function(doubleClicked, e) except NameError: pass def __mouseWheel(e): try: _bind_event_function(mouseWheel, e) except NameError: pass def __keyPressed(e): try: _bind_event_function(keyPressed, e) except NameError: pass def __keyReleased(e): try: _bind_event_function(keyReleased, e) except NameError: pass def __keyTyped(e): try: _bind_event_function(keyTyped, e) except NameError: pass def __keyIsDown(e): try: _bind_event_function(keyIsDown, e) except NameError: pass def pop(*args): p5_pop = _P5_INSTANCE.pop(*args) return p5_pop # Processing Python or Java mode compatibility aliases size = createCanvas popMatrix = pop popStyle = pop pushMatrix = push pushStyle = push # PVector is a wrapper/helper class for p5.Vector objets # providing names similar to Processing Python or Java modes # but mostly keeping p5js functionality from numbers import Number class PVector: def __init__(self, x=0, y=0, z=0): self.__vector = createVector(x, y, z) self.add = self.__instance_add__ self.sub = self.__instance_sub__ self.mult = self.__instance_mult__ self.div = self.__instance_div__ self.cross = self.__instance_cross__ self.dist = self.__instance_dist__ self.dot = self.__instance_dot__ self.lerp = self.__instance_lerp__ @property def x(self): return self.__vector.x @x.setter def x(self, x): self.__vector.x = x @property def y(self): return self.__vector.y @y.setter def y(self, y): self.__vector.y = y @property def z(self): return self.__vector.z @z.setter def z(self, z): self.__vector.z = z def mag(self): return self.__vector.mag() def magSq(self): return self.__vector.magSq() def setMag(self, mag): self.__vector.setMag(mag) return self def normalize(self): self.__vector.normalize() return self def limit(self, max): self.__vector.limit(max) return self def heading(self): return self.__vector.heading() def rotate(self, angle): self.__vector.rotate(angle) return self def __instance_add__(self, *args): if len(args) == 1: return PVector.add(self, args[0], self) else: return PVector.add(self, PVector(*args), self) def __instance_sub__(self, *args): if len(args) == 1: return PVector.sub(self, args[0], self) else: return PVector.sub(self, PVector(*args), self) def __instance_mult__(self, o): return PVector.mult(self, o, self) def __instance_div__(self, f): return PVector.div(self, f, self) def __instance_cross__(self, o): return PVector.cross(self, o, self) def __instance_dist__(self, o): return PVector.dist(self, o) def __instance_dot__(self, *args): if len(args) == 1: v = args[0] else: v = args return self.x * v[0] + self.y * v[1] + self.z * v[2] def __instance_lerp__(self, *args): if len(args) == 2: return PVector.lerp(self, args[0], args[1], self) else: vx, vy, vz, f = args return PVector.lerp(self, PVector(vx, vy, vz), f, self) def get(self): return PVector(self.x, self.y, self.z) def copy(self): return PVector(self.x, self.y, self.z) def __getitem__(self, k): return getattr(self, ('x', 'y', 'z')[k]) def __setitem__(self, k, v): setattr(self, ('x', 'y', 'z')[k], v) def __copy__(self): return PVector(self.x, self.y, self.z) def __deepcopy__(self, memo): return PVector(self.x, self.y, self.z) def __repr__(self): # PROVISÓRIO return f'PVector({self.x}, {self.y}, {self.z})' def set(self, *args): """ Sets the x, y, and z component of the vector using two or three separate variables, the data from a p5.Vector, or the values from a float array. """ self.__vector.set(*args) @classmethod def add(cls, a, b, dest=None): if dest is None: return PVector(a.x + b[0], a.y + b[1], a.z + b[2]) dest.__vector.set(a.x + b[0], a.y + b[1], a.z + b[2]) return dest @classmethod def sub(cls, a, b, dest=None): if dest is None: return PVector(a.x - b[0], a.y - b[1], a.z - b[2]) dest.__vector.set(a.x - b[0], a.y - b[1], a.z - b[2]) return dest @classmethod def mult(cls, a, b, dest=None): if dest is None: return PVector(a.x * b, a.y * b, a.z * b) dest.__vector.set(a.x * b, a.y * b, a.z * b) return dest @classmethod def div(cls, a, b, dest=None): if dest is None: return PVector(a.x / b, a.y / b, a.z / b) dest.__vector.set(a.x / b, a.y / b, a.z / b) return dest @classmethod def dist(cls, a, b): return a.__vector.dist(b.__vector) @classmethod def dot(cls, a, b): return a.__vector.dot(b.__vector) def __add__(a, b): return PVector.add(a, b, None) def __sub__(a, b): return PVector.sub(a, b, None) def __isub__(a, b): a.sub(b) return a def __iadd__(a, b): a.add(b) return a def __mul__(a, b): if not isinstance(b, Number): raise TypeError( "The * operator can only be used to multiply a PVector by a number") return PVector.mult(a, float(b), None) def __rmul__(a, b): if not isinstance(b, Number): raise TypeError( "The * operator can only be used to multiply a PVector by a number") return PVector.mult(a, float(b), None) def __imul__(a, b): if not isinstance(b, Number): raise TypeError( "The *= operator can only be used to multiply a PVector by a number") a.__vector.mult(float(b)) return a def __truediv__(a, b): if not isinstance(b, Number): raise TypeError( "The * operator can only be used to multiply a PVector by a number") return PVector(a.x / float(b), a.y / float(b), a.z / float(b)) def __itruediv__(a, b): if not isinstance(b, Number): raise TypeError( "The /= operator can only be used to multiply a PVector by a number") a.__vector.set(a.x / float(b), a.y / float(b), a.z / float(b)) return a def __eq__(a, b): return a.x == b[0] and a.y == b[1] and a.z == b[2] def __lt__(a, b): return a.magSq() < b.magSq() def __le__(a, b): return a.magSq() <= b.magSq() def __gt__(a, b): return a.magSq() > b.magSq() def __ge__(a, b): return a.magSq() >= b.magSq() # Problematic class methods, we would rather use p5.Vector when possible... @classmethod def lerp(cls, a, b, f, dest=None): v = createVector(a.x, a.y, a.z) v.lerp(b.__vector, f) if dest is None: return PVector(v.x, v.y, v.z) dest.set(v.x, v.y, v.z) return dest @classmethod def cross(cls, a, b, dest=None): x = a.y * b[2] - b[1] * a.z y = a.z * b[0] - b[2] * a.x z = a.x * b[1] - b[0] * a.y if dest is None: return PVector(x, y, z) dest.set(x, y, z) return dest @classmethod def fromAngle(cls, angle, length=1): # https://github.com/processing/p5.js/blob/3f0b2f0fe575dc81c724474154f5b23a517b7233/src/math/p5.Vector.js return PVector(length * cos(angle), length * sin(angle), 0) @classmethod def fromAngles(theta, phi, length=1): # https://github.com/processing/p5.js/blob/3f0b2f0fe575dc81c724474154f5b23a517b7233/src/math/p5.Vector.js cosPhi = cos(phi) sinPhi = sin(phi) cosTheta = cos(theta) sinTheta = sin(theta) return PVector(length * sinTheta * sinPhi, -length * cosTheta, length * sinTheta * cosPhi) @classmethod def random2D(cls): return PVector.fromAngle(random(TWO_PI)) @classmethod def random3D(cls, dest=None): angle = random(TWO_PI) vz = random(2) - 1 mult = sqrt(1 - vz * vz) vx = mult * cos(angle) vy = mult * sin(angle) if dest is None: return PVector(vx, vy, vz) dest.set(vx, vy, vz) return dest @classmethod def angleBetween(cls, a, b): return acos(a.dot(b) / sqrt(a.magSq() * b.magSq())) # Other harmless p5js methods def equals(self, v): return self == v def heading2D(self): return self.__vector.heading() def reflect(self, *args): # Reflect the incoming vector about a normal to a line in 2D, or about # a normal to a plane in 3D This method acts on the vector directly r = self.__vector.reflect(*args) return r def array(self): # Return a representation of this vector as a float array. This is only # for temporary use. If used in any w fashion, the contents should be # copied by using the p5.Vector.copy() method to copy into your own # array. return self.__vector.array() def toString(self): # Returns a string representation of a vector v by calling String(v) or v.toString(). # return self.__vector.toString() would be something like "p5.vector # Object […, …, …]" return str(self) def rem(self, *args): # Gives remainder of a vector when it is divided by anw vector. See # examples for more context. self.__vector.rem(*args) return self def pre_draw(p5_instance, draw_func, *args, **kwargs): """ We need to run this before the actual draw to insert and update p5 env variables """ global _CTX_MIDDLE, _DEFAULT_FILL, _DEFAULT_LEADMULT, _DEFAULT_STROKE, _DEFAULT_TEXT_FILL global ADD, ALT, ARROW, AUTO, AUDIO, AXES, BACKSPACE, BASELINE, BEVEL, BEZIER, BLEND, BLUR, BOLD, BOLDITALIC global BOTTOM, BURN, CENTER, CHORD, CLAMP, CLOSE, CONTROL, CORNER, CORNERS, CROSS, CURVE, DARKEST global DEG_TO_RAD, DEGREES, DELETE, DIFFERENCE, DILATE, DODGE, DOWN_ARROW, ENTER, ERODE, ESCAPE, EXCLUSION global FILL, GRAY, GRID, HALF_PI, HAND, HARD_LIGHT, HSB, HSL, IMAGE, IMMEDIATE, INVERT, ITALIC, LANDSCAPE global LEFT, LEFT_ARROW, LIGHTEST, LINE_LOOP, LINE_STRIP, LINEAR, LINES, MIRROR, MITER, MOVE, MULTIPLY, NEAREST global NORMAL, OPAQUE, OPEN, OPTION, OVERLAY, P2D, P3D, PI, PIE, POINTS, PORTRAIT, POSTERIZE, PROJECT, QUAD_STRIP global QUADRATIC, QUADS, QUARTER_PI, RAD_TO_DEG, RADIANS, RADIUS, REPEAT, REPLACE, RETURN, RGB, RIGHT, RIGHT_ARROW global ROUND, SCREEN, SHIFT, SOFT_LIGHT, SQUARE, STROKE, SUBTRACT, TAB, TAU, TEXT, TEXTURE, THRESHOLD, TOP global TRIANGLE_FAN, TRIANGLE_STRIP, TRIANGLES, TWO_PI, UP_ARROW, VIDEO, WAIT, WEBGL global frameCount, focused, displayWidth, displayHeight, windowWidth, windowHeight, width, height global deviceOrientation, accelerationX, accelerationY, accelerationZ global pAccelerationX, pAccelerationY, pAccelerationZ, rotationX, rotationY, rotationZ global pRotationX, pRotationY, pRotationZ, turnAxis, keyIsPressed, key, keyCode, mouseX, mouseY, pmouseX, pmouseY global winMouseX, winMouseY, pwinMouseX, pwinMouseY, mouseButton, mouseIsPressed, touches, pixels _CTX_MIDDLE = p5_instance._CTX_MIDDLE _DEFAULT_FILL = p5_instance._DEFAULT_FILL _DEFAULT_LEADMULT = p5_instance._DEFAULT_LEADMULT _DEFAULT_STROKE = p5_instance._DEFAULT_STROKE _DEFAULT_TEXT_FILL = p5_instance._DEFAULT_TEXT_FILL ADD = p5_instance.ADD ALT = p5_instance.ALT ARROW = p5_instance.ARROW AUDIO = p5_instance.AUDIO AUTO = p5_instance.AUTO AXES = p5_instance.AXES BACKSPACE = p5_instance.BACKSPACE BASELINE = p5_instance.BASELINE BEVEL = p5_instance.BEVEL BEZIER = p5_instance.BEZIER BLEND = p5_instance.BLEND BLUR = p5_instance.BLUR BOLD = p5_instance.BOLD BOLDITALIC = p5_instance.BOLDITALIC BOTTOM = p5_instance.BOTTOM BURN = p5_instance.BURN CENTER = p5_instance.CENTER CHORD = p5_instance.CHORD CLAMP = p5_instance.CLAMP CLOSE = p5_instance.CLOSE CONTROL = p5_instance.CONTROL CORNER = p5_instance.CORNER CORNERS = p5_instance.CORNERS CROSS = p5_instance.CROSS CURVE = p5_instance.CURVE DARKEST = p5_instance.DARKEST DEG_TO_RAD = p5_instance.DEG_TO_RAD DEGREES = p5_instance.DEGREES DELETE = p5_instance.DELETE DIFFERENCE = p5_instance.DIFFERENCE DILATE = p5_instance.DILATE DODGE = p5_instance.DODGE DOWN_ARROW = p5_instance.DOWN_ARROW ENTER = p5_instance.ENTER ERODE = p5_instance.ERODE ESCAPE = p5_instance.ESCAPE EXCLUSION = p5_instance.EXCLUSION FILL = p5_instance.FILL GRAY = p5_instance.GRAY GRID = p5_instance.GRID HALF_PI = p5_instance.HALF_PI HAND = p5_instance.HAND HARD_LIGHT = p5_instance.HARD_LIGHT HSB = p5_instance.HSB HSL = p5_instance.HSL IMAGE = p5_instance.IMAGE IMMEDIATE = p5_instance.IMMEDIATE INVERT = p5_instance.INVERT ITALIC = p5_instance.ITALIC LANDSCAPE = p5_instance.LANDSCAPE LEFT = p5_instance.LEFT LEFT_ARROW = p5_instance.LEFT_ARROW LIGHTEST = p5_instance.LIGHTEST LINE_LOOP = p5_instance.LINE_LOOP LINE_STRIP = p5_instance.LINE_STRIP LINEAR = p5_instance.LINEAR LINES = p5_instance.LINES MIRROR = p5_instance.MIRROR MITER = p5_instance.MITER MOVE = p5_instance.MOVE MULTIPLY = p5_instance.MULTIPLY NEAREST = p5_instance.NEAREST NORMAL = p5_instance.NORMAL OPAQUE = p5_instance.OPAQUE OPEN = p5_instance.OPEN OPTION = p5_instance.OPTION OVERLAY = p5_instance.OVERLAY P2D = p5_instance.P2D P3D = p5_instance.WEBGL PI = p5_instance.PI PIE = p5_instance.PIE POINTS = p5_instance.POINTS PORTRAIT = p5_instance.PORTRAIT POSTERIZE = p5_instance.POSTERIZE PROJECT = p5_instance.PROJECT QUAD_STRIP = p5_instance.QUAD_STRIP QUADRATIC = p5_instance.QUADRATIC QUADS = p5_instance.QUADS QUARTER_PI = p5_instance.QUARTER_PI RAD_TO_DEG = p5_instance.RAD_TO_DEG RADIANS = p5_instance.RADIANS RADIUS = p5_instance.RADIUS REPEAT = p5_instance.REPEAT REPLACE = p5_instance.REPLACE RETURN = p5_instance.RETURN RGB = p5_instance.RGB RIGHT = p5_instance.RIGHT RIGHT_ARROW = p5_instance.RIGHT_ARROW ROUND = p5_instance.ROUND SCREEN = p5_instance.SCREEN SHIFT = p5_instance.SHIFT SOFT_LIGHT = p5_instance.SOFT_LIGHT SQUARE = p5_instance.SQUARE STROKE = p5_instance.STROKE SUBTRACT = p5_instance.SUBTRACT TAB = p5_instance.TAB TAU = p5_instance.TAU TEXT = p5_instance.TEXT TEXTURE = p5_instance.TEXTURE THRESHOLD = p5_instance.THRESHOLD TOP = p5_instance.TOP TRIANGLE_FAN = p5_instance.TRIANGLE_FAN TRIANGLE_STRIP = p5_instance.TRIANGLE_STRIP TRIANGLES = p5_instance.TRIANGLES TWO_PI = p5_instance.TWO_PI UP_ARROW = p5_instance.UP_ARROW VIDEO = p5_instance.VIDEO WAIT = p5_instance.WAIT WEBGL = p5_instance.WEBGL frameCount = p5_instance.frameCount focused = p5_instance.focused displayWidth = p5_instance.displayWidth displayHeight = p5_instance.displayHeight windowWidth = p5_instance.windowWidth windowHeight = p5_instance.windowHeight width = p5_instance.width height = p5_instance.height deviceOrientation = p5_instance.deviceOrientation accelerationX = p5_instance.accelerationX accelerationY = p5_instance.accelerationY accelerationZ = p5_instance.accelerationZ pAccelerationX = p5_instance.pAccelerationX pAccelerationY = p5_instance.pAccelerationY pAccelerationZ = p5_instance.pAccelerationZ rotationX = p5_instance.rotationX rotationY = p5_instance.rotationY rotationZ = p5_instance.rotationZ pRotationX = p5_instance.pRotationX pRotationY = p5_instance.pRotationY pRotationZ = p5_instance.pRotationZ turnAxis = p5_instance.turnAxis keyIsPressed = p5_instance.keyIsPressed key = p5_instance.key keyCode = p5_instance.keyCode mouseX = p5_instance.mouseX mouseY = p5_instance.mouseY pmouseX = p5_instance.pmouseX pmouseY = p5_instance.pmouseY winMouseX = p5_instance.winMouseX winMouseY = p5_instance.winMouseY pwinMouseX = p5_instance.pwinMouseX pwinMouseY = p5_instance.pwinMouseY mouseButton = p5_instance.mouseButton mouseIsPressed = p5_instance.mouseIsPressed touches = p5_instance.touches pixels = p5_instance.pixels return draw_func(*args, **kwargs) def global_p5_injection(p5_sketch): """ Injects the p5js's skecth instance as a global variable to setup and draw functions """ def decorator(f, *args, **kwargs): def wrapper(*args, **kwargs): global _P5_INSTANCE _P5_INSTANCE = p5_sketch return pre_draw(_P5_INSTANCE, f, *args, **kwargs) return wrapper return decorator def start_p5(preload_func, setup_func, draw_func, event_functions): """ This is the entrypoint function. It accepts 2 parameters: - preload_func: A Python preload callable - setup_func: a Python setup callable - draw_func: a Python draw callable - event_functions: a config dict for the event functions in the format: {"eventFunctionName": python_event_function} This method gets the p5js's sketch instance and injects them """ def sketch_setup(p5_sketch): """ Callback function called to configure new p5 instance """ p5_sketch.preload = global_p5_injection(p5_sketch)(preload_func) p5_sketch.setup = global_p5_injection(p5_sketch)(setup_func) p5_sketch.draw = global_p5_injection(p5_sketch)(draw_func) window.instance = p5.new(sketch_setup, 'sketch-holder') # Register event functions event_function_names = ( "deviceMoved", "deviceTurned", "deviceShaken", "windowResized", "keyPressed", "keyReleased", "keyTyped", "mousePressed", "mouseReleased", "mouseClicked", "doubleClicked", "mouseMoved", "mouseDragged", "mouseWheel", "touchStarted", "touchMoved", "touchEnded", "keyIsDown", ) for f_name in [f for f in event_function_names if event_functions.get(f, None)]: func = event_functions[f_name] event_func = global_p5_injection(window.instance)(func) setattr(window.instance, f_name, event_func) `; const placeholder = ` def preload(): pass def setup(): pass def draw(): pass deviceMoved = None deviceTurned = None deviceShaken = None keyPressed = None keyReleased = None keyTyped = None mouseMoved = None mouseDragged = None mousePressed = None mouseReleased = None mouseClicked = None doubleClicked = None mouseWheel = None touchStarted = None touchMoved = None touchEnded = None windowResized = None `; let userCode = ` # Inspired by Mats Lund: # https://github.com/CoderMats/breakout # Completely rewritten WIDTH = 640 # canvas width HEIGHT = 400 # canvas height P_WIDTH = 50 # paddle halfwidth P_HEIGHT = 8 # paddle halfheight B_ROWS = 5 # bricks, number of rows B_COLS = 10 # bricks, number of columns B_MARGINS = 15 # margins for bricks (bottom, side) BALL_DIAM = 10 # diameter of ball FPS = 30 # frames per second # block width, height, total space b_width = (WIDTH - 2 * B_MARGINS) // B_COLS b_height = 40 b_gap = 15 # gap between blocks # constants, helper variables bw2 = b_width // 2 bh2 = b_height // 2 dw = (b_width - b_gap) // 2 dh = (b_height - b_gap) // 2 r = BALL_DIAM // 2 # ball diameter y_paddle = HEIGHT - 30 cell_colors = {1:"green" , 2:"blue" , 3:"red" , 4:"yellow"} game = None def setup(): global game createCanvas(WIDTH, HEIGHT, P2D) rectMode(CENTER) frameRate(FPS) noCursor() game = Game() def new_game(): global game new_level = game.level + int(game.blocks_gone) game = Game(level=new_level) def draw(): global game if game.blocks_gone: new_game() if not game.game_over: game.paddle.x = min(WIDTH - P_WIDTH, max(mouseX, P_WIDTH)) game.update() def keyPressed(): if key == " ": new_game() class Ball(object): def __init__(self,level=1): # ball velocity self.vel = PVector(3 + int(1.5 * level),-3 - int(1.5 * level)) xp = WIDTH // 2 + int(random(-P_WIDTH - 40,P_WIDTH + 40)) yp = y_paddle - P_HEIGHT // 2 - r - 1 self.pos = PVector(xp,yp) # ball position def update(self): self.pos = PVector.add(self.pos,self.vel) if (self.pos.x >= WIDTH or self.pos.x <= 0): self.vel.x = -self.vel.x if (self.pos.y <= 0): self.vel.y = -self.vel.y class Game(object): def __init__(self,level=1): self.paddle = PVector(WIDTH // 2, HEIGHT - 30) self.level = level self.ball = Ball() self.score = 0 self.blocks = [int(random(1.5,4.5)) for k in range(B_ROWS * B_COLS)] self.game_over = False self.blocks_gone = False # x, y positions of block centers self.centers = [((i % B_COLS) * b_width + B_MARGINS + bw2, b_height * (i // B_COLS) + B_MARGINS + bh2) for i in range(B_ROWS * B_COLS)] def update_ball(self): self.ball.update() px, py = self.paddle.x, self.paddle.y if ((px - P_WIDTH -r) <= self.ball.pos.x <= (px + P_WIDTH + r) and (py - P_HEIGHT - r <= self.ball.pos.y <= py - P_HEIGHT)): # ball is hitting paddle rectangle, reverse y_speed self.ball.vel.y = -self.ball.vel.y self.score = self.score + 1 fill(100,100,200) ellipse(self.ball.pos.x, self.ball.pos.y, BALL_DIAM, BALL_DIAM) def update_paddle(self): fill(0,255,0) rect(self.paddle.x, self.paddle.y, 2 * P_WIDTH, 2* P_HEIGHT) if (self.ball.pos.y >= HEIGHT): fill(255) textSize(40) textAlign(CENTER) text("Game over", WIDTH // 2, HEIGHT // 2 + 40) self.game_over = True def update_texts(self): background(25) noStroke() # Set fill color to white fill(255) # Display score textSize(16) textAlign(RIGHT) text("Score", 80, HEIGHT - 6) textAlign(LEFT) text(self.score, 90, HEIGHT - 6) # text("Frames: %.1f" %frameRate(), 130, HEIGHT - 6) # Display level textAlign(RIGHT) text("Level", WIDTH - 50, HEIGHT - 6) textAlign(LEFT) text(self.level, WIDTH - 40, HEIGHT - 6) def update_blocks(self): self.blocks_gone = True # Loop through all the potential blocks collide = False for i in range(B_ROWS * B_COLS): # Check if we have that block if (self.blocks[i]): x_cent, y_cent = self.centers[i] self.blocks_gone = False if not collide: bx, by = self.ball.pos.x, self.ball.pos.y # check bounce on top/bottom if ((x_cent - dw - r < bx < x_cent + dw + r) and ((y_cent + dh < by < y_cent + dh + r) or (y_cent -dh - r < by < y_cent - dh))): self.blocks[i] = 0 self.ball.vel.y = -self.ball.vel.y self.score = self.score + 5 collide = True # check bounce on left/right if ((y_cent - dh - r < by < y_cent + dh + r) and ((x_cent + dw < bx < x_cent + dw + r) or (x_cent - dw -r < bx < x_cent - dw))): self.blocks[i] = 0 self.ball.vel.x = -self.ball.vel.x self.score = self.score + 5 collide = True if collide: break def draw_blocks(self): for i in range(B_ROWS * B_COLS): if (self.blocks[i]): fill(cell_colors[self.blocks[i]]) x_cent, y_cent = self.centers[i] rect(x_cent, y_cent, 2 * dw, 2 * dh) def update(self): self.update_texts() self.update_ball() self.update_paddle() self.update_blocks() self.draw_blocks() `; const startCode = ` event_functions = { "deviceMoved": deviceMoved, "deviceTurned": deviceTurned, "deviceShaken": deviceShaken, "keyPressed": keyPressed, "keyReleased": keyReleased, "keyTyped": keyTyped, "mouseMoved": mouseMoved, "mouseDragged": mouseDragged, "mousePressed": mousePressed, "mouseReleased": mouseReleased, "mouseClicked": mouseClicked, "doubleClicked": doubleClicked, "mouseWheel": mouseWheel, "touchStarted": touchStarted, "touchMoved": touchMoved, "touchEnded": touchEnded, "windowResized": windowResized, } start_p5(preload, setup, draw, event_functions) `; function runCode() { let code = [ placeholder, userCode, wrapperContent, startCode, ].join('\n'); if (window.instance) { window.instance.canvas.remove(); } console.log("Python execution output:"); window.pyodide.runPython(code); } async function main() { const config = { indexURL : "https://cdn.jsdelivr.net/pyodide/v0.18.1/full/", fullStdLib: false, } window.pyodide = await loadPyodide(config); // Pyodide is now ready to use... console.log(window.pyodide.runPython(` import io, code, sys from js import p5, window, document print(sys.version) `)); window.runSketchCode = (code) => { userCode = code; runCode(); } runCode(); }; // async method main(); ================================================ FILE: docs/examples/pyodide/flappybird/flappybird.py ================================================ def colliderect(im1,im2): x1,y1, w1, h1 = im1.x,im1.y,im1.img.width,im1.img.height x2,y2, w2, h2 = im2.x,im2.y,im2.img.width,im2.img.height return ((x1 < x2 + w2) and (y1 < y2 + h2) and (x1 + w1 > x2) and (y1 + h1 > y2)) def load_image(img_file, im_dir="images",ext="png"): img = loadImage("%s/%s.%s" %(im_dir,img_file,ext)) return img class Actor: def __init__(self,img,x=0,y=0): self.img = load_image(img) self.x = x self.y = y def draw(self): image(self.img,self.x,self.y) WIDTH = 400 HEIGHT = 708 # These constants control the difficulty of the game GAP = 130 GRAVITY = 0.3 FLAP_STRENGTH = 6.5 SPEED = 3 background, bird, pipe_top, pipe_bottom = None, None, None, None bird1, bird2, birddead = None, None, None def setup(): global background, bird, pipe_top, pipe_bottom, bird1, bird2, birddead createCanvas(WIDTH, HEIGHT) noCursor() bird = Actor("bird1",75,200) bird.score = 0 bird.dead = False bird.vy = 0 gap_y = int(random(200, HEIGHT - 200)) pipe_top = Actor("top") pipe_top.x, pipe_top.y = WIDTH, gap_y - GAP // 2 - 500 pipe_bottom = Actor("bottom") pipe_bottom.x, pipe_bottom.y = WIDTH, gap_y + GAP // 2 background = load_image("background") bird1 = load_image("bird1") bird2 = load_image("bird2") birddead = load_image("birddead") image(background,0, 0) bird.draw() pipe_top.draw() pipe_bottom.draw() def draw(): image(background, 0, 0) update_pipes() update_bird() bird.draw() pipe_top.draw() pipe_bottom.draw() fill(255) textSize(24) text("Score: %d" %bird.score, WIDTH-140, 30) def keyPressed(): if keyIsPressed: if not bird.dead: bird.vy = -FLAP_STRENGTH def reset_pipes(create=False): gap_y = int(random(200, HEIGHT - 200)) # anchor - left bottom pipe_top.x, pipe_top.y = WIDTH, gap_y - GAP // 2 - pipe_top.img.height pipe_bottom.x, pipe_bottom.y = WIDTH, gap_y + GAP // 2 def update_pipes(): pipe_top.x -= SPEED pipe_bottom.x -= SPEED if (pipe_top.x < 0): reset_pipes() if not bird.dead: bird.score += 1 def update_bird(): uy = bird.vy bird.vy += GRAVITY bird.y += (uy + bird.vy) / 2 bird.x = 75 if not bird.dead: if bird.vy < -3: bird.img = bird2 else: bird.img = bird1 if colliderect(bird,pipe_top) or colliderect(bird,pipe_bottom): bird.dead = True bird.img = birddead if not (0 < bird.y < HEIGHT + 12): bird.y = 200 bird.dead = False bird.score = bird.vy = 0 reset_pipes() ================================================ FILE: docs/examples/pyodide/flappybird/index.html ================================================ flappybird - pyp5js

Python code here.

def colliderect(im1,im2):
    x1,y1, w1, h1 = im1.x,im1.y,im1.img.width,im1.img.height
    x2,y2, w2, h2 = im2.x,im2.y,im2.img.width,im2.img.height
    return ((x1 < x2 + w2) and (y1 < y2 + h2) and
            (x1 + w1 > x2) and (y1 + h1 > y2))

def load_image(img_file, im_dir="images",ext="png"):
    img = loadImage("%s/%s.%s" %(im_dir,img_file,ext))    
    return img
     
class Actor:
    def __init__(self,img,x=0,y=0):
        self.img = load_image(img)
        self.x = x
        self.y = y

    def draw(self):
        image(self.img,self.x,self.y)
     
WIDTH =  400
HEIGHT = 708
                 
# These constants control the difficulty of the game
GAP = 130
GRAVITY = 0.3
FLAP_STRENGTH = 6.5
SPEED = 3

background, bird, pipe_top, pipe_bottom = None, None, None, None
bird1, bird2, birddead = None, None, None

def setup():
    global background, bird, pipe_top, pipe_bottom, bird1, bird2, birddead
    createCanvas(WIDTH, HEIGHT)
    noCursor()
    bird = Actor("bird1",75,200)
    bird.score = 0
    bird.dead = False
    bird.vy = 0
    gap_y = int(random(200, HEIGHT - 200))
    pipe_top = Actor("top")
    pipe_top.x, pipe_top.y = WIDTH, gap_y - GAP // 2 - 500
    pipe_bottom = Actor("bottom")
    pipe_bottom.x, pipe_bottom.y = WIDTH, gap_y + GAP // 2
    background = load_image("background")
    bird1 = load_image("bird1")
    bird2 = load_image("bird2")
    birddead = load_image("birddead")
    image(background,0, 0)
    bird.draw()
    pipe_top.draw()
    pipe_bottom.draw()

def draw():
    image(background, 0, 0)
    update_pipes()
    update_bird()
    bird.draw()
    pipe_top.draw()
    pipe_bottom.draw()
    fill(255)
    textSize(24)
    text("Score: %d" %bird.score, WIDTH-140, 30)

def keyPressed():
    if keyIsPressed:
        if not bird.dead:
            bird.vy = -FLAP_STRENGTH

def reset_pipes(create=False):
    gap_y = int(random(200, HEIGHT - 200))
    # anchor - left bottom
    pipe_top.x, pipe_top.y = WIDTH, gap_y - GAP // 2 - pipe_top.img.height
    pipe_bottom.x, pipe_bottom.y = WIDTH, gap_y + GAP // 2
           

def update_pipes():
    pipe_top.x -= SPEED
    pipe_bottom.x -= SPEED
    if (pipe_top.x  < 0):
        reset_pipes()
        if not bird.dead:
            bird.score += 1

def update_bird():
    uy = bird.vy
    bird.vy += GRAVITY
    bird.y += (uy + bird.vy) / 2
    bird.x = 75

    if not bird.dead:
        if bird.vy < -3:
            bird.img = bird2
        else:
            bird.img = bird1

    if colliderect(bird,pipe_top) or colliderect(bird,pipe_bottom):
        bird.dead = True
        bird.img = birddead
 
    if not (0 < bird.y < HEIGHT + 12):
        bird.y = 200
        bird.dead = False
        bird.score = bird.vy = 0
        reset_pipes()
================================================ FILE: docs/examples/pyodide/flappybird/static/p5.js ================================================ /*! p5.js v1.0.0 February 29, 2020 */ !function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).p5=e()}}(function(){return function o(a,s,l){function u(t,e){if(!s[t]){if(!a[t]){var r="function"==typeof require&&require;if(!e&&r)return r(t,!0);if(h)return h(t,!0);var i=new Error("Cannot find module '"+t+"'");throw i.code="MODULE_NOT_FOUND",i}var n=s[t]={exports:{}};a[t][0].call(n.exports,function(e){return u(a[t][1][e]||e)},n,n.exports,o,a,s,l)}return s[t].exports}for(var h="function"==typeof require&&require,e=0;e>16&255,a[s++]=t>>8&255,a[s++]=255&t;2===o&&(t=u[e.charCodeAt(r)]<<2|u[e.charCodeAt(r+1)]>>4,a[s++]=255&t);1===o&&(t=u[e.charCodeAt(r)]<<10|u[e.charCodeAt(r+1)]<<4|u[e.charCodeAt(r+2)]>>2,a[s++]=t>>8&255,a[s++]=255&t);return a},r.fromByteArray=function(e){for(var t,r=e.length,i=r%3,n=[],o=0,a=r-i;o>2]+s[t<<4&63]+"==")):2==i&&(t=(e[r-2]<<8)+e[r-1],n.push(s[t>>10]+s[t>>4&63]+s[t<<2&63]+"="));return n.join("")};for(var s=[],u=[],h="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=0,o=i.length;n>18&63]+s[n>>12&63]+s[n>>6&63]+s[63&n]);return o.join("")}u["-".charCodeAt(0)]=62,u["_".charCodeAt(0)]=63},{}],20:[function(e,t,r){},{}],21:[function(N,e,F){(function(c){"use strict";var i=N("base64-js"),o=N("ieee754"),e="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;F.Buffer=c,F.SlowBuffer=function(e){+e!=e&&(e=0);return c.alloc(+e)},F.INSPECT_MAX_BYTES=50;var r=2147483647;function a(e){if(r>>1;case"base64":return O(e).length;default:if(n)return i?-1:R(e).length;t=(""+t).toLowerCase(),n=!0}}function d(e,t,r){var i=e[t];e[t]=e[r],e[r]=i}function p(e,t,r,i,n){if(0===e.length)return-1;if("string"==typeof r?(i=r,r=0):2147483647=e.length){if(n)return-1;r=e.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof t&&(t=c.from(t,i)),c.isBuffer(t))return 0===t.length?-1:m(e,t,r,i,n);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):m(e,[t],r,i,n);throw new TypeError("val must be string, number or Buffer")}function m(e,t,r,i,n){var o,a=1,s=e.length,l=t.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(e.length<2||t.length<2)return-1;s/=a=2,l/=2,r/=2}function u(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(n){var h=-1;for(o=r;o>8,n=r%256,o.push(n),o.push(i);return o}(t,e.length-r),e,r,i)}function b(e,t,r){return 0===t&&r===e.length?i.fromByteArray(e):i.fromByteArray(e.slice(t,r))}function _(e,t,r){r=Math.min(e.length,r);for(var i=[],n=t;n>>10&1023|55296),h=56320|1023&h),i.push(h),n+=c}return function(e){var t=e.length;if(t<=x)return String.fromCharCode.apply(String,e);var r="",i=0;for(;ithis.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e=e||"utf8";;)switch(e){case"hex":return M(this,t,r);case"utf8":case"utf-8":return _(this,t,r);case"ascii":return w(this,t,r);case"latin1":case"binary":return S(this,t,r);case"base64":return b(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,t,r);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}.apply(this,arguments)},c.prototype.equals=function(e){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===c.compare(this,e)},c.prototype.inspect=function(){var e="",t=F.INSPECT_MAX_BYTES;return e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(e+=" ... "),""},e&&(c.prototype[e]=c.prototype.inspect),c.prototype.compare=function(e,t,r,i,n){if(A(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),t<0||r>e.length||i<0||n>this.length)throw new RangeError("out of range index");if(n<=i&&r<=t)return 0;if(n<=i)return-1;if(r<=t)return 1;if(this===e)return 0;for(var o=(n>>>=0)-(i>>>=0),a=(r>>>=0)-(t>>>=0),s=Math.min(o,a),l=this.slice(i,n),u=e.slice(t,r),h=0;h>>=0,isFinite(r)?(r>>>=0,void 0===i&&(i="utf8")):(i=r,r=void 0)}var n=this.length-t;if((void 0===r||nthis.length)throw new RangeError("Attempt to write outside buffer bounds");i=i||"utf8";for(var o,a,s,l,u,h,c=!1;;)switch(i){case"hex":return g(this,e,t,r);case"utf8":case"utf-8":return u=t,h=r,D(R(e,(l=this).length-u),l,u,h);case"ascii":return v(this,e,t,r);case"latin1":case"binary":return v(this,e,t,r);case"base64":return o=this,a=t,s=r,D(O(e),o,a,s);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return y(this,e,t,r);default:if(c)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),c=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var x=4096;function w(e,t,r){var i="";r=Math.min(e.length,r);for(var n=t;ne.length)throw new RangeError("Index out of range")}function P(e,t,r,i){if(r+i>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function L(e,t,r,i,n){return t=+t,r>>>=0,n||P(e,0,r,4),o.write(e,t,r,i,23,4),r+4}function k(e,t,r,i,n){return t=+t,r>>>=0,n||P(e,0,r,8),o.write(e,t,r,i,52,8),r+8}c.prototype.slice=function(e,t){var r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):r>>=0,t>>>=0,r||T(e,t,this.length);for(var i=this[e],n=1,o=0;++o>>=0,t>>>=0,r||T(e,t,this.length);for(var i=this[e+--t],n=1;0>>=0,t||T(e,1,this.length),this[e]},c.prototype.readUInt16LE=function(e,t){return e>>>=0,t||T(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUInt16BE=function(e,t){return e>>>=0,t||T(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUInt32LE=function(e,t){return e>>>=0,t||T(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUInt32BE=function(e,t){return e>>>=0,t||T(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||T(e,t,this.length);for(var i=this[e],n=1,o=0;++o>>=0,t>>>=0,r||T(e,t,this.length);for(var i=t,n=1,o=this[e+--i];0>>=0,t||T(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){e>>>=0,t||T(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(e,t){e>>>=0,t||T(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(e,t){return e>>>=0,t||T(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return e>>>=0,t||T(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readFloatLE=function(e,t){return e>>>=0,t||T(e,4,this.length),o.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return e>>>=0,t||T(e,4,this.length),o.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return e>>>=0,t||T(e,8,this.length),o.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return e>>>=0,t||T(e,8,this.length),o.read(this,e,!1,52,8)},c.prototype.writeUIntLE=function(e,t,r,i){e=+e,t>>>=0,r>>>=0,i||C(this,e,t,r,Math.pow(2,8*r)-1,0);var n=1,o=0;for(this[t]=255&e;++o>>=0,r>>>=0,i||C(this,e,t,r,Math.pow(2,8*r)-1,0);var n=r-1,o=1;for(this[t+n]=255&e;0<=--n&&(o*=256);)this[t+n]=e/o&255;return t+r},c.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,1,255,0),this[t]=255&e,t+1},c.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},c.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeIntLE=function(e,t,r,i){if(e=+e,t>>>=0,!i){var n=Math.pow(2,8*r-1);C(this,e,t,r,n-1,-n)}var o=0,a=1,s=0;for(this[t]=255&e;++o>0)-s&255;return t+r},c.prototype.writeIntBE=function(e,t,r,i){if(e=+e,t>>>=0,!i){var n=Math.pow(2,8*r-1);C(this,e,t,r,n-1,-n)}var o=r-1,a=1,s=0;for(this[t+o]=255&e;0<=--o&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+r},c.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},c.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeFloatLE=function(e,t,r){return L(this,e,t,!0,r)},c.prototype.writeFloatBE=function(e,t,r){return L(this,e,t,!1,r)},c.prototype.writeDoubleLE=function(e,t,r){return k(this,e,t,!0,r)},c.prototype.writeDoubleBE=function(e,t,r){return k(this,e,t,!1,r)},c.prototype.copy=function(e,t,r,i){if(!c.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r=r||0,i||0===i||(i=this.length),t>=e.length&&(t=e.length),t=t||0,0=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t>>=0,r=void 0===r?this.length:r>>>0,"number"==typeof(e=e||0))for(o=t;o>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function O(e){return i.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(t,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function D(e,t,r,i){for(var n=0;n=t.length||n>=e.length);++n)t[n+r]=e[n];return n}function A(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function I(e){return e!=e}var U=function(){for(var e="0123456789abcdef",t=new Array(256),r=0;r<16;++r)for(var i=16*r,n=0;n<16;++n)t[i+n]=e[r]+e[n];return t}()}).call(this,N("buffer").Buffer)},{"base64-js":19,buffer:21,ieee754:30}],22:[function(e,t,r){"use strict";t.exports=e("./").polyfill()},{"./":23}],23:[function(z,r,i){(function(j,V){var e,t;e=this,t=function(){"use strict";function l(e){return"function"==typeof e}var r=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},i=0,t=void 0,n=void 0,a=function(e,t){f[i]=e,f[i+1]=t,2===(i+=2)&&(n?n(d):y())};var e="undefined"!=typeof window?window:void 0,o=e||{},s=o.MutationObserver||o.WebKitMutationObserver,u="undefined"==typeof self&&void 0!==j&&"[object process]"==={}.toString.call(j),h="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function c(){var e=setTimeout;return function(){return e(d,1)}}var f=new Array(1e3);function d(){for(var e=0;e":">",'"':""","'":"'","/":"/"};function S(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,function(e){return w[e]}):e}var M=function(){function i(e){var t,r=1=this.maxReplaces)break}for(a=0;r=this.regexp.exec(e);){if(void 0===(i=h(r[1].trim())))if("function"==typeof c){var d=c(e,r,t);i="string"==typeof d?d:""}else this.logger.warn("missed to pass in variable ".concat(r[1]," for interpolating ").concat(e)),i="";else"string"==typeof i||this.useRawValueToEscape||(i=v(i));if(i=this.escapeValue?u(this.escape(i)):u(i),e=e.replace(r[0],i),this.regexp.lastIndex=0,++a>=this.maxReplaces)break}return e}},{key:"nest",value:function(e,t,r){var i,n,o=D({},2>1,h=-7,c=r?n-1:0,f=r?-1:1,d=e[t+c];for(c+=f,o=d&(1<<-h)-1,d>>=-h,h+=s;0>=-h,h+=i;0>1,f=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,d=i?0:o-1,p=i?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=h):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),2<=(t+=1<=a+c?f/l:f*Math.pow(2,1-c))*l&&(a++,l/=2),h<=a+c?(s=0,a=h):1<=a+c?(s=(t*l-1)*Math.pow(2,n),a+=c):(s=t*Math.pow(2,c-1)*Math.pow(2,n),a=0));8<=n;e[r+d]=255&s,d+=p,s/=256,n-=8);for(a=a<Math.abs(e[0])&&(t=1),Math.abs(e[2])>Math.abs(e[t])&&(t=2),t}var C=4e150;function P(e,t){e.f+=t.f,e.b.f+=t.b.f}function u(e,t,r){return e=e.a,t=t.a,r=r.a,t.b.a===e?r.b.a===e?v(t.a,r.a)?b(r.b.a,t.a,r.a)<=0:0<=b(t.b.a,r.a,t.a):b(r.b.a,e,r.a)<=0:r.b.a===e?0<=b(t.b.a,e,t.a):(t=y(t.b.a,e,t.a),(e=y(r.b.a,e,r.a))<=t)}function L(e){e.a.i=null;var t=e.e;t.a.c=t.c,t.c.a=t.a,e.e=null}function h(e,t){c(e.a),e.c=!1,(e.a=t).i=e}function k(e){for(var t=e.a.a;(e=fe(e)).a.a===t;);return e.c&&(h(e,t=f(ce(e).a.b,e.a.e)),e=fe(e)),e}function R(e,t,r){var i=new he;return i.a=r,i.e=W(e.f,t.e,i),r.i=i}function O(e,t){switch(e.s){case 100130:return 0!=(1&t);case 100131:return 0!==t;case 100132:return 0>1]],s[a[u]])?le(r,u):ue(r,u)),s[o]=null,l[o]=r.b,r.b=o}else for(r.c[-(o+1)]=null;0Math.max(a.a,l.a))return!1;if(v(o,a)){if(0i.f&&(i.f*=2,i.c=oe(i.c,i.f+1)),0===i.b?r=n:(r=i.b,i.b=i.c[i.b]),i.e[r]=t,i.c[r]=n,i.d[n]=r,i.h&&ue(i,n),r}return i=e.a++,e.c[i]=t,-(i+1)}function ie(e){if(0===e.a)return se(e.b);var t=e.c[e.d[e.a-1]];if(0!==e.b.a&&v(ae(e.b),t))return se(e.b);for(;--e.a,0e.a||v(i[a],i[l])){n[r[o]=a]=o;break}n[r[o]=l]=o,o=s}}function ue(e,t){for(var r=e.d,i=e.e,n=e.c,o=t,a=r[o];;){var s=o>>1,l=r[s];if(0==s||v(i[l],i[a])){n[r[o]=a]=o;break}n[r[o]=l]=o,o=s}}function he(){this.e=this.a=null,this.f=0,this.c=this.b=this.h=this.d=!1}function ce(e){return e.e.c.b}function fe(e){return e.e.a.b}(i=q.prototype).x=function(){Y(this,0)},i.B=function(e,t){switch(e){case 100142:return;case 100140:switch(t){case 100130:case 100131:case 100132:case 100133:case 100134:return void(this.s=t)}break;case 100141:return void(this.m=!!t);default:return void Z(this,100900)}Z(this,100901)},i.y=function(e){switch(e){case 100142:return 0;case 100140:return this.s;case 100141:return this.m;default:Z(this,100900)}return!1},i.A=function(e,t,r){this.j[0]=e,this.j[1]=t,this.j[2]=r},i.z=function(e,t){var r=t||null;switch(e){case 100100:case 100106:this.h=r;break;case 100104:case 100110:this.l=r;break;case 100101:case 100107:this.k=r;break;case 100102:case 100108:this.i=r;break;case 100103:case 100109:this.p=r;break;case 100105:case 100111:this.o=r;break;case 100112:this.r=r;break;default:Z(this,100900)}},i.C=function(e,t){var r=!1,i=[0,0,0];Y(this,2);for(var n=0;n<3;++n){var o=e[n];o<-1e150&&(o=-1e150,r=!0),1e150n[u]&&(n[u]=h,a[u]=l)}if(l=0,n[1]-o[1]>n[0]-o[0]&&(l=1),n[2]-o[2]>n[l]-o[l]&&(l=2),o[l]>=n[l])i[0]=0,i[1]=0,i[2]=1;else{for(n=0,o=s[l],a=a[l],s=[0,0,0],o=[o.g[0]-a.g[0],o.g[1]-a.g[1],o.g[2]-a.g[2]],u=[0,0,0],l=r.e;l!==r;l=l.e)u[0]=l.g[0]-a.g[0],u[1]=l.g[1]-a.g[1],u[2]=l.g[2]-a.g[2],s[0]=o[1]*u[2]-o[2]*u[1],s[1]=o[2]*u[0]-o[0]*u[2],s[2]=o[0]*u[1]-o[1]*u[0],n<(h=s[0]*s[0]+s[1]*s[1]+s[2]*s[2])&&(n=h,i[0]=s[0],i[1]=s[1],i[2]=s[2]);n<=0&&(i[0]=i[1]=i[2]=0,i[T(o)]=1)}r=!0}for(s=T(i),l=this.b.c,n=(s+1)%3,a=(s+2)%3,s=0>=l,h-=l,g!=o){if(g==a)break;for(var v=g>8,++y;var _=b;if(i>=8;null!==m&&s<4096&&(p[s++]=m<<8|_,u+1<=s&&l<12&&(++l,u=u<<1|1)),m=g}else s=1+a,u=(1<<(l=n+1))-1,m=null}return f!==i&&console.log("Warning, gif stream shorter than expected."),r}try{r.GifWriter=function(v,e,t,r){var y=0,i=void 0===(r=void 0===r?{}:r).loop?null:r.loop,b=void 0===r.palette?null:r.palette;if(e<=0||t<=0||65535>=1;)++n;if(a=1<>8&255,v[y++]=255&t,v[y++]=t>>8&255,v[y++]=(null!==b?128:0)|n,v[y++]=o,v[y++]=0,null!==b)for(var s=0,l=b.length;s>16&255,v[y++]=u>>8&255,v[y++]=255&u}if(null!==i){if(i<0||65535>8&255,v[y++]=0}var x=!1;this.addFrame=function(e,t,r,i,n,o){if(!0===x&&(--y,x=!1),o=void 0===o?{}:o,e<0||t<0||65535>=1;)++u;l=1<>8&255,v[y++]=d,v[y++]=0),v[y++]=44,v[y++]=255&e,v[y++]=e>>8&255,v[y++]=255&t,v[y++]=t>>8&255,v[y++]=255&r,v[y++]=r>>8&255,v[y++]=255&i,v[y++]=i>>8&255,v[y++]=!0===a?128|u-1:0,!0===a)for(var p=0,m=s.length;p>16&255,v[y++]=g>>8&255,v[y++]=255&g}return y=function(t,r,e,i){t[r++]=e;var n=r++,o=1<>=8,h-=8,r===n+256&&(t[n]=255,n=r++)}function d(e){c|=e<>=8,h-=8,r===n+256&&(t[n]=255,n=r++);4096===l?(d(o),l=1+s,u=e+1,m={}):(1<>7,n=1<<1+(7&r);x[e++],x[e++];var o=null,a=null;i&&(o=e,e+=3*(a=n));var s=!0,l=[],u=0,h=null,c=0,f=null;for(this.width=w,this.height=t;s&&e>2&7,e++;break;case 254:for(;;){if(!(0<=(C=x[e++])))throw Error("Invalid block size");if(0===C)break;e+=C}break;default:throw new Error("Unknown graphic control label: 0x"+x[e-1].toString(16))}break;case 44:var p=x[e++]|x[e++]<<8,m=x[e++]|x[e++]<<8,g=x[e++]|x[e++]<<8,v=x[e++]|x[e++]<<8,y=x[e++],b=y>>6&1,_=1<<1+(7&y),S=o,M=a,E=!1;if(y>>7){E=!0;S=e,e+=3*(M=_)}var T=e;for(e++;;){var C;if(!(0<=(C=x[e++])))throw Error("Invalid block size");if(0===C)break;e+=C}l.push({x:p,y:m,width:g,height:v,has_local_palette:E,palette_offset:S,palette_size:M,data_offset:T,data_length:e-T,transparent_index:h,interlaced:!!b,delay:u,disposal:c});break;case 59:s=!1;break;default:throw new Error("Unknown gif block: 0x"+x[e-1].toString(16))}this.numFrames=function(){return l.length},this.loopCount=function(){return f},this.frameInfo=function(e){if(e<0||e>=l.length)throw new Error("Frame index out of range.");return l[e]},this.decodeAndBlitFrameBGRA=function(e,t){var r=this.frameInfo(e),i=r.width*r.height,n=new Uint8Array(i);P(x,r.data_offset,n,i);var o=r.palette_offset,a=r.transparent_index;null===a&&(a=256);var s=r.width,l=w-s,u=s,h=4*(r.y*w+r.x),c=4*((r.y+r.height)*w+r.x),f=h,d=4*l;!0===r.interlaced&&(d+=4*w*7);for(var p=8,m=0,g=n.length;m>=1)),v===a)f+=4;else{var y=x[o+3*v],b=x[o+3*v+1],_=x[o+3*v+2];t[f++]=_,t[f++]=b,t[f++]=y,t[f++]=255}--u}},this.decodeAndBlitFrameRGBA=function(e,t){var r=this.frameInfo(e),i=r.width*r.height,n=new Uint8Array(i);P(x,r.data_offset,n,i);var o=r.palette_offset,a=r.transparent_index;null===a&&(a=256);var s=r.width,l=w-s,u=s,h=4*(r.y*w+r.x),c=4*((r.y+r.height)*w+r.x),f=h,d=4*l;!0===r.interlaced&&(d+=4*w*7);for(var p=8,m=0,g=n.length;m>=1)),v===a)f+=4;else{var y=x[o+3*v],b=x[o+3*v+1],_=x[o+3*v+2];t[f++]=y,t[f++]=b,t[f++]=_,t[f++]=255}--u}}}}catch(e){}},{}],33:[function(jr,t,r){(function(Gr){var e;e=this,function(E){"use strict";function e(e){if(null==this)throw TypeError();var t=String(this),r=t.length,i=e?Number(e):0;if(i!=i&&(i=0),!(i<0||r<=i)){var n,o=t.charCodeAt(i);return 55296<=o&&o<=56319&&i+1>>=1,t}function _(e,t,r){if(!t)return r;for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<>>16-t;return e.tag>>>=t,e.bitcount-=t,i+r}function x(e,t){for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<>>=1,++n,r+=t.table[n],0<=(i-=t.table[n]););return e.tag=o,e.bitcount-=n,t.trans[r+i]}function w(e,t,r){var i,n,o,a,s,l;for(i=_(e,5,257),n=_(e,5,1),o=_(e,4,4),a=0;a<19;++a)g[a]=0;for(a=0;athis.x2&&(this.x2=e)),"number"==typeof t&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=t,this.y2=t),tthis.y2&&(this.y2=t))},C.prototype.addX=function(e){this.addPoint(e,null)},C.prototype.addY=function(e){this.addPoint(null,e)},C.prototype.addBezier=function(e,t,r,i,n,o,a,s){var l=this,u=[e,t],h=[r,i],c=[n,o],f=[a,s];this.addPoint(e,t),this.addPoint(a,s);for(var d=0;d<=1;d++){var p=6*u[d]-12*h[d]+6*c[d],m=-3*u[d]+9*h[d]-9*c[d]+3*f[d],g=3*h[d]-3*u[d];if(0!=m){var v=Math.pow(p,2)-4*g*m;if(!(v<0)){var y=(-p+Math.sqrt(v))/(2*m);0>8&255,255&e]},A.USHORT=U(2),D.SHORT=function(e){return 32768<=e&&(e=-(65536-e)),[e>>8&255,255&e]},A.SHORT=U(2),D.UINT24=function(e){return[e>>16&255,e>>8&255,255&e]},A.UINT24=U(3),D.ULONG=function(e){return[e>>24&255,e>>16&255,e>>8&255,255&e]},A.ULONG=U(4),D.LONG=function(e){return R<=e&&(e=-(2*R-e)),[e>>24&255,e>>16&255,e>>8&255,255&e]},A.LONG=U(4),D.FIXED=D.ULONG,A.FIXED=A.ULONG,D.FWORD=D.SHORT,A.FWORD=A.SHORT,D.UFWORD=D.USHORT,A.UFWORD=A.USHORT,D.LONGDATETIME=function(e){return[0,0,0,0,e>>24&255,e>>16&255,e>>8&255,255&e]},A.LONGDATETIME=U(8),D.TAG=function(e){return k.argument(4===e.length,"Tag should be exactly 4 ASCII characters."),[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]},A.TAG=U(4),D.Card8=D.BYTE,A.Card8=A.BYTE,D.Card16=D.USHORT,A.Card16=A.USHORT,D.OffSize=D.BYTE,A.OffSize=A.BYTE,D.SID=D.USHORT,A.SID=A.USHORT,D.NUMBER=function(e){return-107<=e&&e<=107?[e+139]:108<=e&&e<=1131?[247+((e-=108)>>8),255&e]:-1131<=e&&e<=-108?[251+((e=-e-108)>>8),255&e]:-32768<=e&&e<=32767?D.NUMBER16(e):D.NUMBER32(e)},A.NUMBER=function(e){return D.NUMBER(e).length},D.NUMBER16=function(e){return[28,e>>8&255,255&e]},A.NUMBER16=U(3),D.NUMBER32=function(e){return[29,e>>24&255,e>>16&255,e>>8&255,255&e]},A.NUMBER32=U(5),D.REAL=function(e){var t=e.toString(),r=/\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec(t);if(r){var i=parseFloat("1e"+((r[2]?+r[2]:0)+r[1].length));t=(Math.round(e*i)/i).toString()}for(var n="",o=0,a=t.length;o>8&255,t[t.length]=255&i}return t},A.UTF16=function(e){return 2*e.length};var N={"x-mac-croatian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈ƫȅ ÀÃÕŒœĐ—“”‘’÷◊©⁄€‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ","x-mac-cyrillic":"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю","x-mac-gaelic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØḂ±≤≥ḃĊċḊḋḞḟĠġṀæøṁṖṗɼƒſṠ«»… ÀÃÕŒœ–—“”‘’ṡẛÿŸṪ€‹›Ŷŷṫ·Ỳỳ⁊ÂÊÁËÈÍÎÏÌÓÔ♣ÒÚÛÙıÝýŴŵẄẅẀẁẂẃ","x-mac-greek":"Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦€ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ­","x-mac-icelandic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüݰ¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-inuit":"ᐃᐄᐅᐆᐊᐋᐱᐲᐳᐴᐸᐹᑉᑎᑏᑐᑑᑕᑖᑦᑭᑮᑯᑰᑲᑳᒃᒋᒌᒍᒎᒐᒑ°ᒡᒥᒦ•¶ᒧ®©™ᒨᒪᒫᒻᓂᓃᓄᓅᓇᓈᓐᓯᓰᓱᓲᓴᓵᔅᓕᓖᓗᓘᓚᓛᓪᔨᔩᔪᔫᔭ… ᔮᔾᕕᕖᕗ–—“”‘’ᕘᕙᕚᕝᕆᕇᕈᕉᕋᕌᕐᕿᖀᖁᖂᖃᖄᖅᖏᖐᖑᖒᖓᖔᖕᙱᙲᙳᙴᙵᙶᖖᖠᖡᖢᖣᖤᖥᖦᕼŁł","x-mac-ce":"ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ",macintosh:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-romanian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂȘ∞±≤≥¥µ∂∑∏π∫ªºΩăș¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›Țț‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-turkish":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙˆ˜¯˘˙˚¸˝˛ˇ"};O.MACSTRING=function(e,t,r,i){var n=N[i];if(void 0!==n){for(var o="",a=0;a>8&255,l+256&255)}return o}D.MACSTRING=function(e,t){var r=function(e){if(!F)for(var t in F={},N)F[t]=new String(t);var r=F[e];if(void 0!==r){if(B){var i=B.get(r);if(void 0!==i)return i}var n=N[e];if(void 0!==n){for(var o={},a=0;a>8,t[c+1]=255&f,t=t.concat(i[h])}return t},A.TABLE=function(e){for(var t=0,r=e.fields.length,i=0;i>1,t.skip("uShort",3),e.glyphIndexMap={};for(var a=new se.Parser(r,i+n+14),s=new se.Parser(r,i+n+16+2*o),l=new se.Parser(r,i+n+16+4*o),u=new se.Parser(r,i+n+16+6*o),h=i+n+16+8*o,c=0;c>4,o=15&i;if(15==n)break;if(t+=r[n],15==o)break;t+=r[o]}return parseFloat(t)}(e);if(32<=t&&t<=246)return t-139;if(247<=t&&t<=250)return 256*(t-247)+e.parseByte()+108;if(251<=t&&t<=254)return 256*-(t-251)-e.parseByte()-108;throw new Error("Invalid b0 "+t)}function Te(e,t,r){t=void 0!==t?t:0;var i=new se.Parser(e,t),n=[],o=[];for(r=void 0!==r?r:e.length;i.relativeOffset>1,T.length=0,P=!0}return function e(t){for(var r,i,n,o,a,s,l,u,h,c,f,d,p=0;pMath.abs(d-R)?k=f+T.shift():R=d+T.shift(),E.curveTo(y,b,_,x,l,u),E.curveTo(h,c,f,d,k,R);break;default:console.log("Glyph "+v.index+": unknown operator 1200"+m),T.length=0}break;case 14:0>3;break;case 21:2>16),p+=2;break;case 29:a=T.pop()+g.gsubrsBias,(s=g.gsubrs[a])&&e(s);break;case 30:for(;0=r.begin&&e=fe.length){var a=i.parseChar();r.names.push(i.parseString(a))}break;case 2.5:r.numberOfGlyphs=i.parseUShort(),r.offset=new Array(r.numberOfGlyphs);for(var s=0;st.value.tag?1:-1}),t.fields=t.fields.concat(i),t.fields=t.fields.concat(n),t}function gt(e,t,r){for(var i=0;i 123 are reserved for internal usage");d|=1<>>1,o=e[n].tag;if(o===t)return n;o>>1,o=e[n];if(o===t)return n;o>>1,a=(r=e[o]).start;if(a===t)return r;a(r=e[i-1]).end?0:r}function xt(e,t){this.font=e,this.tableName=t}function wt(e){xt.call(this,e,"gpos")}function St(e){xt.call(this,e,"gsub")}function Mt(e,t){var r=e.length;if(r!==t.length)return!1;for(var i=0;it.points.length-1||i.matchedPoints[1]>n.points.length-1)throw Error("Matched points out of range in "+t.name);var a=t.points[i.matchedPoints[0]],s=n.points[i.matchedPoints[1]],l={xScale:i.xScale,scale01:i.scale01,scale10:i.scale10,yScale:i.yScale,dx:0,dy:0};s=kt([s],l)[0],l.dx=a.x-s.x,l.dy=a.y-s.y,o=kt(n.points,l)}t.points=t.points.concat(o)}}return Rt(t.points)}(wt.prototype=xt.prototype={searchTag:yt,binSearch:bt,getTable:function(e){var t=this.font.tables[this.tableName];return!t&&e&&(t=this.font.tables[this.tableName]=this.createDefaultTable()),t},getScriptNames:function(){var e=this.getTable();return e?e.scripts.map(function(e){return e.tag}):[]},getDefaultScriptName:function(){var e=this.getTable();if(e){for(var t=!1,r=0;r=s[u-1].tag,"Features must be added in alphabetical order."),o={tag:r,feature:{params:0,lookupListIndexes:[]}},s.push(o),a.push(u),o.feature}}},getLookupTables:function(e,t,r,i,n){var o=this.getFeatureTable(e,t,r,n),a=[];if(o){for(var s,l=o.lookupListIndexes,u=this.font.tables[this.tableName].lookups,h=0;h",s),t.stack.push(Math.round(64*s))}function vr(e,t){var r=t.stack,i=r.pop(),n=t.fv,o=t.pv,a=t.ppem,s=t.deltaBase+16*(e-1),l=t.deltaShift,u=t.z0;E.DEBUG&&console.log(t.step,"DELTAP["+e+"]",i,r);for(var h=0;h>4)===a){var d=(15&f)-8;0<=d&&d++,E.DEBUG&&console.log(t.step,"DELTAPFIX",c,"by",d*l);var p=u[c];n.setRelative(p,p,d*l,o)}}}function yr(e,t){var r=t.stack,i=r.pop();E.DEBUG&&console.log(t.step,"ROUND[]"),r.push(64*t.round(i/64))}function br(e,t){var r=t.stack,i=r.pop(),n=t.ppem,o=t.deltaBase+16*(e-1),a=t.deltaShift;E.DEBUG&&console.log(t.step,"DELTAC["+e+"]",i,r);for(var s=0;s>4)===n){var h=(15&u)-8;0<=h&&h++;var c=h*a;E.DEBUG&&console.log(t.step,"DELTACFIX",l,"by",c),t.cvt[l]+=c}}}function _r(e,t){var r,i,n=t.stack,o=n.pop(),a=n.pop(),s=t.z2[o],l=t.z1[a];E.DEBUG&&console.log(t.step,"SDPVTL["+e+"]",o,a),i=e?(r=s.y-l.y,l.x-s.x):(r=l.x-s.x,l.y-s.y),t.dpv=Zt(r,i)}function xr(e,t){var r=t.stack,i=t.prog,n=t.ip;E.DEBUG&&console.log(t.step,"PUSHB["+e+"]");for(var o=0;o":"_")+(i?"R":"_")+(0===n?"Gr":1===n?"Bl":2===n?"Wh":"")+"]",e?c+"("+o.cvt[c]+","+u+")":"",f,"(d =",a,"->",l*s,")"),o.rp1=o.rp0,o.rp2=f,t&&(o.rp0=f)}Ft.prototype.exec=function(e,t){if("number"!=typeof t)throw new Error("Point size is not a number!");if(!(2",i),s.interpolate(c,o,a,l),s.touch(c)}e.loop=1},dr.bind(void 0,0),dr.bind(void 0,1),function(e){for(var t=e.stack,r=e.rp0,i=e.z0[r],n=e.loop,o=e.fv,a=e.pv,s=e.z1;n--;){var l=t.pop(),u=s[l];E.DEBUG&&console.log(e.step,(1=a.width||t>=a.height?[0,0,0,0]:this._getPixel(e,t);var s=new l.default.Image(r,i);return s.canvas.getContext("2d").drawImage(a,e,t,r*o,i*o,0,0,r,i),s},l.default.Renderer.prototype.textLeading=function(e){return"number"==typeof e?(this._setProperty("_textLeading",e),this._pInst):this._textLeading},l.default.Renderer.prototype.textSize=function(e){return"number"==typeof e?(this._setProperty("_textSize",e),this._setProperty("_textLeading",e*y._DEFAULT_LEADMULT),this._applyTextProperties()):this._textSize},l.default.Renderer.prototype.textStyle=function(e){return e?(e!==y.NORMAL&&e!==y.ITALIC&&e!==y.BOLD&&e!==y.BOLDITALIC||this._setProperty("_textStyle",e),this._applyTextProperties()):this._textStyle},l.default.Renderer.prototype.textAscent=function(){return null===this._textAscent&&this._updateTextMetrics(),this._textAscent},l.default.Renderer.prototype.textDescent=function(){return null===this._textDescent&&this._updateTextMetrics(),this._textDescent},l.default.Renderer.prototype.textAlign=function(e,t){return void 0!==e?(this._setProperty("_textAlign",e),void 0!==t&&this._setProperty("_textBaseline",t),this._applyTextProperties()):{horizontal:this._textAlign,vertical:this._textBaseline}},l.default.Renderer.prototype.text=function(e,t,r,i,n){var o,a,s,l,u,h,c,f,d=this._pInst,p=Number.MAX_VALUE;if((this._doFill||this._doStroke)&&void 0!==e){if("string"!=typeof e&&(e=e.toString()),o=(e=e.replace(/(\t)/g," ")).split("\n"),void 0!==i){for(s=f=0;ss.HALF_PI&&e<=3*s.HALF_PI?Math.atan(r/i*Math.tan(e))+s.PI:Math.atan(r/i*Math.tan(e))+s.TWO_PI,t=t<=s.HALF_PI?Math.atan(r/i*Math.tan(t)):t>s.HALF_PI&&t<=3*s.HALF_PI?Math.atan(r/i*Math.tan(t))+s.PI:Math.atan(r/i*Math.tan(t))+s.TWO_PI),tv||Math.abs(this.accelerationY-this.pAccelerationY)>v||Math.abs(this.accelerationZ-this.pAccelerationZ)>v)&&e();var t=this.deviceTurned||window.deviceTurned;if("function"==typeof t){var r=this.rotationX+180,i=this.pRotationX+180,n=c+180;0>>24],i+=x[(16711680&C)>>16],n+=x[(65280&C)>>8],o+=x[255&C],r+=k[_],s++}w[l=T+y]=a/r,S[l]=i/r,M[l]=n/r,E[l]=o/r}T+=d}for(h=(u=-P)*d,b=T=0;b>>16,e[r+1]=(65280&t[i])>>>8,e[r+2]=255&t[i],e[r+3]=(4278190080&t[i])>>>24},O._toImageData=function(e){return e instanceof ImageData?e:e.getContext("2d").getImageData(0,0,e.width,e.height)},O._createImageData=function(e,t){return O._tmpCanvas=document.createElement("canvas"),O._tmpCtx=O._tmpCanvas.getContext("2d"),this._tmpCtx.createImageData(e,t)},O.apply=function(e,t,r){var i=e.getContext("2d"),n=i.getImageData(0,0,e.width,e.height),o=t(n,r);o instanceof ImageData?i.putImageData(o,0,0,0,0,e.width,e.height):i.putImageData(n,0,0,0,0,e.width,e.height)},O.threshold=function(e,t){var r=O._toPixels(e);void 0===t&&(t=.5);for(var i=Math.floor(255*t),n=0;n>8)/i,r[n+1]=255*(a*t>>8)/i,r[n+2]=255*(s*t>>8)/i}},O.dilate=function(e){for(var t,r,i,n,o,a,s,l,u,h,c,f,d,p,m,g,v,y=O._toPixels(e),b=0,_=y.length?y.length/4:0,x=new Int32Array(_);b<_;)for(r=(t=b)+e.width;b>16&255)+151*(i>>8&255)+28*(255&i))<(m=77*(c>>16&255)+151*(c>>8&255)+28*(255&c))&&(n=c,o=m),o<(p=77*((h=O._getARGB(y,a))>>16&255)+151*(h>>8&255)+28*(255&h))&&(n=h,o=p),o<(g=77*(f>>16&255)+151*(f>>8&255)+28*(255&f))&&(n=f,o=g),o<(v=77*(d>>16&255)+151*(d>>8&255)+28*(255&d))&&(n=d,o=v),x[b++]=n;O._setPixels(y,x)},O.erode=function(e){for(var t,r,i,n,o,a,s,l,u,h,c,f,d,p,m,g,v,y=O._toPixels(e),b=0,_=y.length?y.length/4:0,x=new Int32Array(_);b<_;)for(r=(t=b)+e.width;b>16&255)+151*(c>>8&255)+28*(255&c))<(o=77*(i>>16&255)+151*(i>>8&255)+28*(255&i))&&(n=c,o=m),(p=77*((h=O._getARGB(y,a))>>16&255)+151*(h>>8&255)+28*(255&h))>16&255)+151*(f>>8&255)+28*(255&f))>16&255)+151*(d>>8&255)+28*(255&d))=r){var i=Math.floor(t.timeDisplayed/r);if(t.timeDisplayed=0,t.displayIndex+=i,t.loopCount=Math.floor(t.displayIndex/t.numFrames),null!==t.loopLimit&&t.loopCount>=t.loopLimit)t.playing=!1;else{var n=t.displayIndex%t.numFrames;this.drawingContext.putImageData(t.frames[n].image,0,0),t.displayIndex=n,this.setModified(!0)}}}},n.default.Image.prototype._setProperty=function(e,t){this[e]=t,this.setModified(!0)},n.default.Image.prototype.loadPixels=function(){n.default.Renderer2D.prototype.loadPixels.call(this),this.setModified(!0)},n.default.Image.prototype.updatePixels=function(e,t,r,i){n.default.Renderer2D.prototype.updatePixels.call(this,e,t,r,i),this.setModified(!0)},n.default.Image.prototype.get=function(e,t,r,i){return n.default._validateParameters("p5.Image.get",arguments),n.default.Renderer2D.prototype.get.apply(this,arguments)},n.default.Image.prototype._getPixel=n.default.Renderer2D.prototype._getPixel,n.default.Image.prototype.set=function(e,t,r){n.default.Renderer2D.prototype.set.call(this,e,t,r),this.setModified(!0)},n.default.Image.prototype.resize=function(e,t){0===e&&0===t?(e=this.canvas.width,t=this.canvas.height):0===e?e=this.canvas.width*t/this.canvas.height:0===t&&(t=this.canvas.height*e/this.canvas.width),e=Math.floor(e),t=Math.floor(t);var r=document.createElement("canvas");if(r.width=e,r.height=t,this.gifProperties)for(var i=this.gifProperties,n=function(e,t){for(var r=0,i=0;i/g,">").replace(/"/g,""").replace(/'/g,"'")}function l(e,t){t&&!0!==t&&"true"!==t||(t="");var r="";return(e=e||"untitled")&&e.includes(".")&&(r=e.split(".").pop()),t&&r!==t&&(r=t,e="".concat(e,".").concat(r)),[e,r]}e("../core/error_helpers"),v.default.prototype.loadJSON=function(){for(var e=arguments.length,t=new Array(e),r=0;r"),n.print("");if(n.print(' '),n.print(""),n.print(""),n.print(" "),"0"!==o[0]){n.print(" ");for(var h=0;h".concat(c)),n.print(" ")}n.print(" ")}for(var f=0;f");for(var d=0;d".concat(p)),n.print(" ")}n.print(" ")}n.print("
"),n.print(""),n.print("")}n.close(),n.clear()},v.default.prototype.writeFile=function(e,t,r){var i="application/octet-stream";v.default.prototype._isSafari()&&(i="text/plain");var n=new Blob(e,{type:i});v.default.prototype.downloadFile(n,t,r)},v.default.prototype.downloadFile=function(e,t,r){var i=l(t,r),n=i[0];if(e instanceof Blob)s.default.saveAs(e,n);else{var o=document.createElement("a");if(o.href=e,o.download=n,o.onclick=function(e){var t;t=e,document.body.removeChild(t.target),e.stopPropagation()},o.style.display="none",document.body.appendChild(o),v.default.prototype._isSafari()){var a="Hello, Safari user! To download this file...\n";a+="1. Go to File --\x3e Save As.\n",a+='2. Choose "Page Source" as the Format.\n',a+='3. Name it with this extension: ."'.concat(i[1],'"'),alert(a)}o.click()}},v.default.prototype._checkFileExtension=l,v.default.prototype._isSafari=function(){return 0>>0},getSeed:function(){return t},rand:function(){return(r=(1664525*r+1013904223)%i)/i}});n.setSeed(e),_=new Array(4096);for(var o=0;o<4096;o++)_[o]=n.rand()};var o=n.default;r.default=o},{"../core/main":49}],82:[function(e,t,r){"use strict";function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i,l=(i=e("../core/main"))&&i.__esModule?i:{default:i},o=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==a(e)&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var o=i?Object.getOwnPropertyDescriptor(e,n):null;o&&(o.get||o.set)?Object.defineProperty(r,n,o):r[n]=e[n]}r.default=e,t&&t.set(e,r);return r}(e("../core/constants"));function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}l.default.Vector=function(e,t,r){var i,n,o;o=e instanceof l.default?(this.p5=e,i=t[0]||0,n=t[1]||0,t[2]||0):(i=e||0,n=t||0,r||0),this.x=i,this.y=n,this.z=o},l.default.Vector.prototype.toString=function(){return"p5.Vector Object : [".concat(this.x,", ").concat(this.y,", ").concat(this.z,"]")},l.default.Vector.prototype.set=function(e,t,r){return e instanceof l.default.Vector?(this.x=e.x||0,this.y=e.y||0,this.z=e.z||0):e instanceof Array?(this.x=e[0]||0,this.y=e[1]||0,this.z=e[2]||0):(this.x=e||0,this.y=t||0,this.z=r||0),this},l.default.Vector.prototype.copy=function(){return this.p5?new l.default.Vector(this.p5,[this.x,this.y,this.z]):new l.default.Vector(this.x,this.y,this.z)},l.default.Vector.prototype.add=function(e,t,r){return e instanceof l.default.Vector?(this.x+=e.x||0,this.y+=e.y||0,this.z+=e.z||0):e instanceof Array?(this.x+=e[0]||0,this.y+=e[1]||0,this.z+=e[2]||0):(this.x+=e||0,this.y+=t||0,this.z+=r||0),this};function u(e,t){return 0!==e&&(this.x=this.x%e),0!==t&&(this.y=this.y%t),this}function h(e,t,r){return 0!==e&&(this.x=this.x%e),0!==t&&(this.y=this.y%t),0!==r&&(this.z=this.z%r),this}l.default.Vector.prototype.rem=function(e,t,r){if(e instanceof l.default.Vector){if(Number.isFinite(e.x)&&Number.isFinite(e.y)&&Number.isFinite(e.z)){var i=parseFloat(e.x),n=parseFloat(e.y),o=parseFloat(e.z);h.call(this,i,n,o)}}else if(e instanceof Array)e.every(function(e){return Number.isFinite(e)})&&(2===e.length&&u.call(this,e[0],e[1]),3===e.length&&h.call(this,e[0],e[1],e[2]));else if(1===arguments.length){if(Number.isFinite(e)&&0!==e)return this.x=this.x%e,this.y=this.y%e,this.z=this.z%e,this}else if(2===arguments.length){var a=Array.prototype.slice.call(arguments);a.every(function(e){return Number.isFinite(e)})&&2===a.length&&u.call(this,a[0],a[1])}else if(3===arguments.length){var s=Array.prototype.slice.call(arguments);s.every(function(e){return Number.isFinite(e)})&&3===s.length&&h.call(this,s[0],s[1],s[2])}},l.default.Vector.prototype.sub=function(e,t,r){return e instanceof l.default.Vector?(this.x-=e.x||0,this.y-=e.y||0,this.z-=e.z||0):e instanceof Array?(this.x-=e[0]||0,this.y-=e[1]||0,this.z-=e[2]||0):(this.x-=e||0,this.y-=t||0,this.z-=r||0),this},l.default.Vector.prototype.mult=function(e){return"number"==typeof e&&isFinite(e)?(this.x*=e,this.y*=e,this.z*=e):console.warn("p5.Vector.prototype.mult:","n is undefined or not a finite number"),this},l.default.Vector.prototype.div=function(e){return"number"==typeof e&&isFinite(e)?0===e?console.warn("p5.Vector.prototype.div:","divide by 0"):(this.x/=e,this.y/=e,this.z/=e):console.warn("p5.Vector.prototype.div:","n is undefined or not a finite number"),this},l.default.Vector.prototype.mag=function(){return Math.sqrt(this.magSq())},l.default.Vector.prototype.magSq=function(){var e=this.x,t=this.y,r=this.z;return e*e+t*t+r*r},l.default.Vector.prototype.dot=function(e,t,r){return e instanceof l.default.Vector?this.dot(e.x,e.y,e.z):this.x*(e||0)+this.y*(t||0)+this.z*(r||0)},l.default.Vector.prototype.cross=function(e){var t=this.y*e.z-this.z*e.y,r=this.z*e.x-this.x*e.z,i=this.x*e.y-this.y*e.x;return this.p5?new l.default.Vector(this.p5,[t,r,i]):new l.default.Vector(t,r,i)},l.default.Vector.prototype.dist=function(e){return e.copy().sub(this).mag()},l.default.Vector.prototype.normalize=function(){var e=this.mag();return 0!==e&&this.mult(1/e),this},l.default.Vector.prototype.limit=function(e){var t=this.magSq();return e*e>>0},n.default.prototype.randomSeed=function(e){this._lcgSetSeed(o,e),this._gaussian_previous=!1},n.default.prototype.random=function(e,t){var r;if(n.default._validateParameters("random",arguments),r=null!=this[o]?this._lcg(o):Math.random(),void 0===e)return r;if(void 0===t)return e instanceof Array?e[Math.floor(r*e.length)]:r*e;if(tf){var P=p,L=l,k=u;p=d+f*(s&&d=t&&(r=r.substring(r.length-t,r.length)),r}},n.default.prototype.unhex=function(e){return e instanceof Array?e.map(n.default.prototype.unhex):parseInt("0x".concat(e),16)};var o=n.default;r.default=o},{"../core/main":49}],90:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i,a=(i=e("../core/main"))&&i.__esModule?i:{default:i};function n(e,t,r){var i=e<0,n=i?e.toString().substring(1):e.toString(),o=n.indexOf("."),a=-1!==o?n.substring(0,o):n,s=-1!==o?n.substring(o+1):"",l=i?"-":"";if(void 0!==r){var u="";(-1!==o||0r&&(s=s.substring(0,r));for(var h=0;hi.length)for(var o=t-(i+=-1===r?".":"").length+1,a=0;a=d.TWO_PI?"".concat("ellipse","|").concat(u,"|"):"".concat("arc","|").concat(a,"|").concat(s,"|").concat(l,"|").concat(u,"|"),!this.geometryInHash(t)){var h=new T.default.Geometry(u,1,function(){if(this.strokeIndices=[],a.toFixed(10)!==s.toFixed(10)){l!==d.PIE&&void 0!==l||(this.vertices.push(new T.default.Vector(.5,.5,0)),this.uvs.push([.5,.5]));for(var e=0;e<=u;e++){var t=(s-a)*(e/u)+a,r=.5+Math.cos(t)/2,i=.5+Math.sin(t)/2;this.vertices.push(new T.default.Vector(r,i,0)),this.uvs.push([r,i]),e>5&31)/31,(y>>10&31)/31):(r=a,i=s,l)}for(var b=1;b<=3;b++){var _=p+12*b,x=new S.default.Vector(u.getFloat32(_,!0),u.getFloat32(8+_,!0),u.getFloat32(4+_,!0));e.vertices.push(x),c&&o.push(r,i,n)}var w=new S.default.Vector(m,g,v);e.vertexNormals.push(w,w,w),e.faces.push([3*d,3*d+1,3*d+2]),e.uvs.push([0,0],[0,0],[0,0])}}(e,t);else{var r=new DataView(t);if(!("TextDecoder"in window))return console.warn("Sorry, ASCII STL loading only works in browsers that support TextDecoder (https://caniuse.com/#feat=textencoder)");var i=new TextDecoder("utf-8").decode(r).split("\n");!function(e,t){for(var r,i,n="",o=[],a=0;aMath.PI?l=Math.PI:l<=0&&(l=.001);var u=Math.sin(l)*a*Math.sin(s),h=Math.cos(l)*a,c=Math.sin(l)*a*Math.cos(s);this.camera(u+this.centerX,h+this.centerY,c+this.centerZ,this.centerX,this.centerY,this.centerZ,0,1,0)},m.default.Camera.prototype._isActive=function(){return this===this._renderer._curCamera},m.default.prototype.setCamera=function(e){this._renderer._curCamera=e,this._renderer.uPMatrix.set(e.projMatrix.mat4[0],e.projMatrix.mat4[1],e.projMatrix.mat4[2],e.projMatrix.mat4[3],e.projMatrix.mat4[4],e.projMatrix.mat4[5],e.projMatrix.mat4[6],e.projMatrix.mat4[7],e.projMatrix.mat4[8],e.projMatrix.mat4[9],e.projMatrix.mat4[10],e.projMatrix.mat4[11],e.projMatrix.mat4[12],e.projMatrix.mat4[13],e.projMatrix.mat4[14],e.projMatrix.mat4[15])};var n=m.default.Camera;r.default=n},{"../core/main":49}],98:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i,h=(i=e("../core/main"))&&i.__esModule?i:{default:i};h.default.Geometry=function(e,t,r){return this.vertices=[],this.lineVertices=[],this.lineNormals=[],this.vertexNormals=[],this.faces=[],this.uvs=[],this.edges=[],this.vertexColors=[],this.detailX=void 0!==e?e:1,this.detailY=void 0!==t?t:1,this.dirtyFlags={},r instanceof Function&&r.call(this),this},h.default.Geometry.prototype.reset=function(){this.lineVertices.length=0,this.lineNormals.length=0,this.vertices.length=0,this.edges.length=0,this.vertexColors.length=0,this.vertexNormals.length=0,this.uvs.length=0,this.dirtyFlags={}},h.default.Geometry.prototype.computeFaces=function(){this.faces.length=0;for(var e,t,r,i,n=this.detailX+1,o=0;othis.vertices.length-1-this.detailX;i--)e.add(this.vertexNormals[i]);e=h.default.Vector.div(e,this.detailX);for(var n=this.vertices.length-1;n>this.vertices.length-1-this.detailX;n--)this.vertexNormals[n]=e;return this},h.default.Geometry.prototype._makeTriangleEdges=function(){if(this.edges.length=0,Array.isArray(this.strokeIndices))for(var e=0,t=this.strokeIndices.length;e vTexCoord.y;\n bool y1 = p1.y > vTexCoord.y;\n bool y2 = p2.y > vTexCoord.y;\n\n // could web be under the curve (after t1)?\n if (y1 ? !y2 : y0) {\n // add the coverage for t1\n coverage.x += saturate(C1.x + 0.5);\n // calculate the anti-aliasing for t1\n weight.x = min(weight.x, abs(C1.x));\n }\n\n // are we outside the curve (after t2)?\n if (y1 ? !y0 : y2) {\n // subtract the coverage for t2\n coverage.x -= saturate(C2.x + 0.5);\n // calculate the anti-aliasing for t2\n weight.x = min(weight.x, abs(C2.x));\n }\n}\n\n// this is essentially the same as coverageX, but with the axes swapped\nvoid coverageY(vec2 p0, vec2 p1, vec2 p2) {\n\n vec2 C1, C2;\n calulateCrossings(p0, p1, p2, C1, C2);\n\n bool x0 = p0.x > vTexCoord.x;\n bool x1 = p1.x > vTexCoord.x;\n bool x2 = p2.x > vTexCoord.x;\n\n if (x1 ? !x2 : x0) {\n coverage.y -= saturate(C1.y + 0.5);\n weight.y = min(weight.y, abs(C1.y));\n }\n\n if (x1 ? !x0 : x2) {\n coverage.y += saturate(C2.y + 0.5);\n weight.y = min(weight.y, abs(C2.y));\n }\n}\n\nvoid main() {\n\n // calculate the pixel scale based on screen-coordinates\n pixelScale = hardness / fwidth(vTexCoord);\n\n // which grid cell is this pixel in?\n ivec2 gridCoord = ifloor(vTexCoord * vec2(uGridSize));\n\n // intersect curves in this row\n {\n // the index into the row info bitmap\n int rowIndex = gridCoord.y + uGridOffset.y;\n // fetch the info texel\n vec4 rowInfo = getTexel(uSamplerRows, rowIndex, uGridImageSize);\n // unpack the rowInfo\n int rowStrokeIndex = getInt16(rowInfo.xy);\n int rowStrokeCount = getInt16(rowInfo.zw);\n\n for (int iRowStroke = INT(0); iRowStroke < N; iRowStroke++) {\n if (iRowStroke >= rowStrokeCount)\n break;\n\n // each stroke is made up of 3 points: the start and control point\n // and the start of the next curve.\n // fetch the indices of this pair of strokes:\n vec4 strokeIndices = getTexel(uSamplerRowStrokes, rowStrokeIndex++, uCellsImageSize);\n\n // unpack the stroke index\n int strokePos = getInt16(strokeIndices.xy);\n\n // fetch the two strokes\n vec4 stroke0 = getTexel(uSamplerStrokes, strokePos + INT(0), uStrokeImageSize);\n vec4 stroke1 = getTexel(uSamplerStrokes, strokePos + INT(1), uStrokeImageSize);\n\n // calculate the coverage\n coverageX(stroke0.xy, stroke0.zw, stroke1.xy);\n }\n }\n\n // intersect curves in this column\n {\n int colIndex = gridCoord.x + uGridOffset.x;\n vec4 colInfo = getTexel(uSamplerCols, colIndex, uGridImageSize);\n int colStrokeIndex = getInt16(colInfo.xy);\n int colStrokeCount = getInt16(colInfo.zw);\n \n for (int iColStroke = INT(0); iColStroke < N; iColStroke++) {\n if (iColStroke >= colStrokeCount)\n break;\n\n vec4 strokeIndices = getTexel(uSamplerColStrokes, colStrokeIndex++, uCellsImageSize);\n\n int strokePos = getInt16(strokeIndices.xy);\n vec4 stroke0 = getTexel(uSamplerStrokes, strokePos + INT(0), uStrokeImageSize);\n vec4 stroke1 = getTexel(uSamplerStrokes, strokePos + INT(1), uStrokeImageSize);\n coverageY(stroke0.xy, stroke0.zw, stroke1.xy);\n }\n }\n\n weight = saturate(1.0 - weight * 2.0);\n float distance = max(weight.x + weight.y, minDistance); // manhattan approx.\n float antialias = abs(dot(coverage, weight) / distance);\n float cover = min(abs(coverage.x), abs(coverage.y));\n gl_FragColor = uMaterialColor;\n gl_FragColor.a *= saturate(max(antialias, cover));\n}",lineVert:"/*\n Part of the Processing project - http://processing.org\n Copyright (c) 2012-15 The Processing Foundation\n Copyright (c) 2004-12 Ben Fry and Casey Reas\n Copyright (c) 2001-04 Massachusetts Institute of Technology\n This library is free software; you can redistribute it and/or\n modify it under the terms of the GNU Lesser General Public\n License as published by the Free Software Foundation, version 2.1.\n This library is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n Lesser General Public License for more details.\n You should have received a copy of the GNU Lesser General\n Public License along with this library; if not, write to the\n Free Software Foundation, Inc., 59 Temple Place, Suite 330,\n Boston, MA 02111-1307 USA\n*/\n\n#define PROCESSING_LINE_SHADER\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform float uStrokeWeight;\n\nuniform vec4 uViewport;\nuniform int uPerspective;\n\nattribute vec4 aPosition;\nattribute vec4 aDirection;\n \nvoid main() {\n // using a scale <1 moves the lines towards the camera\n // in order to prevent popping effects due to half of\n // the line disappearing behind the geometry faces.\n vec3 scale = vec3(0.9995);\n\n vec4 posp = uModelViewMatrix * aPosition;\n vec4 posq = uModelViewMatrix * (aPosition + vec4(aDirection.xyz, 0));\n\n // Moving vertices slightly toward the camera\n // to avoid depth-fighting with the fill triangles.\n // Discussed here:\n // http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Number=252848 \n posp.xyz = posp.xyz * scale;\n posq.xyz = posq.xyz * scale;\n\n vec4 p = uProjectionMatrix * posp;\n vec4 q = uProjectionMatrix * posq;\n\n // formula to convert from clip space (range -1..1) to screen space (range 0..[width or height])\n // screen_p = (p.xy/p.w + <1,1>) * 0.5 * uViewport.zw\n\n // prevent division by W by transforming the tangent formula (div by 0 causes\n // the line to disappear, see https://github.com/processing/processing/issues/5183)\n // t = screen_q - screen_p\n //\n // tangent is normalized and we don't care which aDirection it points to (+-)\n // t = +- normalize( screen_q - screen_p )\n // t = +- normalize( (q.xy/q.w+<1,1>)*0.5*uViewport.zw - (p.xy/p.w+<1,1>)*0.5*uViewport.zw )\n //\n // extract common factor, <1,1> - <1,1> cancels out\n // t = +- normalize( (q.xy/q.w - p.xy/p.w) * 0.5 * uViewport.zw )\n //\n // convert to common divisor\n // t = +- normalize( ((q.xy*p.w - p.xy*q.w) / (p.w*q.w)) * 0.5 * uViewport.zw )\n //\n // remove the common scalar divisor/factor, not needed due to normalize and +-\n // (keep uViewport - can't remove because it has different components for x and y\n // and corrects for aspect ratio, see https://github.com/processing/processing/issues/5181)\n // t = +- normalize( (q.xy*p.w - p.xy*q.w) * uViewport.zw )\n\n vec2 tangent = normalize((q.xy*p.w - p.xy*q.w) * uViewport.zw);\n\n // flip tangent to normal (it's already normalized)\n vec2 normal = vec2(-tangent.y, tangent.x);\n\n float thickness = aDirection.w * uStrokeWeight;\n vec2 offset = normal * thickness / 2.0;\n\n vec2 curPerspScale;\n\n if(uPerspective == 1) {\n // Perspective ---\n // convert from world to clip by multiplying with projection scaling factor\n // to get the right thickness (see https://github.com/processing/processing/issues/5182)\n // invert Y, projections in Processing invert Y\n curPerspScale = (uProjectionMatrix * vec4(1, -1, 0, 0)).xy;\n } else {\n // No Perspective ---\n // multiply by W (to cancel out division by W later in the pipeline) and\n // convert from screen to clip (derived from clip to screen above)\n curPerspScale = p.w / (0.5 * uViewport.zw);\n }\n\n gl_Position.xy = p.xy + offset.xy * curPerspScale;\n gl_Position.zw = p.zw;\n}\n",lineFrag:"precision mediump float;\nprecision mediump int;\n\nuniform vec4 uMaterialColor;\n\nvoid main() {\n gl_FragColor = uMaterialColor;\n}",pointVert:"attribute vec3 aPosition;\nuniform float uPointSize;\nvarying float vStrokeWeight;\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nvoid main() {\n\tvec4 positionVec4 = vec4(aPosition, 1.0);\n\tgl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n\tgl_PointSize = uPointSize;\n\tvStrokeWeight = uPointSize;\n}",pointFrag:"precision mediump float;\nprecision mediump int;\nuniform vec4 uMaterialColor;\nvarying float vStrokeWeight;\n\nvoid main(){\n\tfloat mask = 0.0;\n\n\t// make a circular mask using the gl_PointCoord (goes from 0 - 1 on a point)\n // might be able to get a nicer edge on big strokeweights with smoothstep but slightly less performant\n\n\tmask = step(0.98, length(gl_PointCoord * 2.0 - 1.0));\n\n\t// if strokeWeight is 1 or less lets just draw a square\n\t// this prevents weird artifacting from carving circles when our points are really small\n\t// if strokeWeight is larger than 1, we just use it as is\n\n\tmask = mix(0.0, mask, clamp(floor(vStrokeWeight - 0.5),0.0,1.0));\n\n\t// throw away the borders of the mask\n // otherwise we get weird alpha blending issues\n\n\tif(mask > 0.98){\n discard;\n \t}\n\n \tgl_FragColor = vec4(uMaterialColor.rgb * (1.0 - mask), uMaterialColor.a) ;\n}"};u.default.RendererGL=function(e,t,r,i){return u.default.Renderer.call(this,e,t,r),this._setAttributeDefaults(t),this._initContext(),this.isP3D=!0,this.GL=this.drawingContext,this._isErasing=!1,this._enableLighting=!1,this.ambientLightColors=[],this.specularColors=[1,1,1],this.directionalLightDirections=[],this.directionalLightDiffuseColors=[],this.directionalLightSpecularColors=[],this.pointLightPositions=[],this.pointLightDiffuseColors=[],this.pointLightSpecularColors=[],this.spotLightPositions=[],this.spotLightDirections=[],this.spotLightDiffuseColors=[],this.spotLightSpecularColors=[],this.spotLightAngle=[],this.spotLightConc=[],this.drawMode=o.FILL,this.curFillColor=this._cachedFillStyle=[1,1,1,1],this.curStrokeColor=this._cachedStrokeStyle=[0,0,0,1],this.curBlendMode=o.BLEND,this._cachedBlendMode=void 0,this.blendExt=this.GL.getExtension("EXT_blend_minmax"),this._isBlending=!1,this._useSpecularMaterial=!1,this._useEmissiveMaterial=!1,this._useNormalMaterial=!1,this._useShininess=1,this._tint=[255,255,255,255],this.constantAttenuation=1,this.linearAttenuation=0,this.quadraticAttenuation=0,this.uMVMatrix=new u.default.Matrix,this.uPMatrix=new u.default.Matrix,this.uNMatrix=new u.default.Matrix("mat3"),this._curCamera=new u.default.Camera(this),this._curCamera._computeCameraDefaultSettings(),this._curCamera._setDefaultCamera(),this._defaultLightShader=void 0,this._defaultImmediateModeShader=void 0,this._defaultNormalShader=void 0,this._defaultColorShader=void 0,this._defaultPointShader=void 0,this.userFillShader=void 0,this.userStrokeShader=void 0,this.userPointShader=void 0,this.retainedMode={geometry:{},buffers:{stroke:[new u.default.RenderBuffer(3,"lineVertices","lineVertexBuffer","aPosition",this,this._flatten),new u.default.RenderBuffer(4,"lineNormals","lineNormalBuffer","aDirection",this,this._flatten)],fill:[new u.default.RenderBuffer(3,"vertices","vertexBuffer","aPosition",this,this._vToNArray),new u.default.RenderBuffer(3,"vertexNormals","normalBuffer","aNormal",this,this._vToNArray),new u.default.RenderBuffer(4,"vertexColors","colorBuffer","aMaterialColor",this),new u.default.RenderBuffer(3,"vertexAmbients","ambientBuffer","aAmbientColor",this),new u.default.RenderBuffer(2,"uvs","uvBuffer","aTexCoord",this,this._flatten)],text:[new u.default.RenderBuffer(3,"vertices","vertexBuffer","aPosition",this,this._vToNArray),new u.default.RenderBuffer(2,"uvs","uvBuffer","aTexCoord",this,this._flatten)]}},this.immediateMode={geometry:new u.default.Geometry,shapeMode:o.TRIANGLE_FAN,_bezierVertex:[],_quadraticVertex:[],_curveVertex:[],buffers:{fill:[new u.default.RenderBuffer(3,"vertices","vertexBuffer","aPosition",this,this._vToNArray),new u.default.RenderBuffer(3,"vertexNormals","normalBuffer","aNormal",this,this._vToNArray),new u.default.RenderBuffer(4,"vertexColors","colorBuffer","aVertexColor",this),new u.default.RenderBuffer(3,"vertexAmbients","ambientBuffer","aAmbientColor",this),new u.default.RenderBuffer(2,"uvs","uvBuffer","aTexCoord",this,this._flatten)],stroke:[new u.default.RenderBuffer(3,"lineVertices","lineVertexBuffer","aPosition",this,this._flatten),new u.default.RenderBuffer(4,"lineNormals","lineNormalBuffer","aDirection",this,this._flatten)],point:this.GL.createBuffer()}},this.pointSize=5,this.curStrokeWeight=1,this.textures=[],this.textureMode=o.IMAGE,this.textureWrapX=o.CLAMP,this.textureWrapY=o.CLAMP,this._tex=null,this._curveTightness=6,this._lookUpTableBezier=[],this._lookUpTableQuadratic=[],this._lutBezierDetail=0,this._lutQuadraticDetail=0,this._tessy=this._initTessy(),this.fontInfos={},this._curShader=void 0,this},u.default.RendererGL.prototype=Object.create(u.default.Renderer.prototype),u.default.RendererGL.prototype._setAttributeDefaults=function(e){var t={alpha:!0,depth:!0,stencil:!0,antialias:navigator.userAgent.toLowerCase().includes("safari"),premultipliedAlpha:!1,preserveDrawingBuffer:!0,perPixelLighting:!0};null===e._glAttributes?e._glAttributes=t:e._glAttributes=Object.assign(t,e._glAttributes)},u.default.RendererGL.prototype._initContext=function(){try{if(this.drawingContext=this.canvas.getContext("webgl",this._pInst._glAttributes)||this.canvas.getContext("experimental-webgl",this._pInst._glAttributes),null===this.drawingContext)throw new Error("Error creating webgl context");var e=this.drawingContext;e.enable(e.DEPTH_TEST),e.depthFunc(e.LEQUAL),e.viewport(0,0,e.drawingBufferWidth,e.drawingBufferHeight),this._viewport=this.drawingContext.getParameter(this.drawingContext.VIEWPORT)}catch(e){throw e}},u.default.RendererGL.prototype._resetContext=function(e,t){var r=this.width,i=this.height,n=this.canvas.id,o=this._pInst instanceof u.default.Graphics;if(o){var a=this._pInst;a.canvas.parentNode.removeChild(a.canvas),a.canvas=document.createElement("canvas"),(a._pInst._userNode||document.body).appendChild(a.canvas),u.default.Element.call(a,a.canvas,a._pInst),a.width=r,a.height=i}else{var s=this.canvas;s&&s.parentNode.removeChild(s),(s=document.createElement("canvas")).id=n,this._pInst._userNode?this._pInst._userNode.appendChild(s):document.body.appendChild(s),this._pInst.canvas=s}var l=new u.default.RendererGL(this._pInst.canvas,this._pInst,!o);this._pInst._setProperty("_renderer",l),l.resize(r,i),l._applyDefaults(),o||this._pInst._elements.push(l),"function"==typeof t&&setTimeout(function(){t.apply(window._renderer,e)},0)},u.default.prototype.setAttributes=function(e,t){if(void 0!==this._glAttributes){var r=!0;if(void 0!==t?(null===this._glAttributes&&(this._glAttributes={}),this._glAttributes[e]!==t&&(this._glAttributes[e]=t,r=!1)):e instanceof Object&&this._glAttributes!==e&&(this._glAttributes=e,r=!1),this._renderer.isP3D&&!r){if(!this._setupDone)for(var i in this._renderer.retainedMode.geometry)if(this._renderer.retainedMode.geometry.hasOwnProperty(i))return void console.error("Sorry, Could not set the attributes, you need to call setAttributes() before calling the other drawing methods in setup()");this.push(),this._renderer._resetContext(),this.pop(),this._renderer._curCamera&&(this._renderer._curCamera._renderer=this._renderer)}}else console.log("You are trying to use setAttributes on a p5.Graphics object that does not use a WEBGL renderer.")},u.default.RendererGL.prototype._update=function(){this.uMVMatrix.set(this._curCamera.cameraMatrix.mat4[0],this._curCamera.cameraMatrix.mat4[1],this._curCamera.cameraMatrix.mat4[2],this._curCamera.cameraMatrix.mat4[3],this._curCamera.cameraMatrix.mat4[4],this._curCamera.cameraMatrix.mat4[5],this._curCamera.cameraMatrix.mat4[6],this._curCamera.cameraMatrix.mat4[7],this._curCamera.cameraMatrix.mat4[8],this._curCamera.cameraMatrix.mat4[9],this._curCamera.cameraMatrix.mat4[10],this._curCamera.cameraMatrix.mat4[11],this._curCamera.cameraMatrix.mat4[12],this._curCamera.cameraMatrix.mat4[13],this._curCamera.cameraMatrix.mat4[14],this._curCamera.cameraMatrix.mat4[15]),this.ambientLightColors.length=0,this.specularColors=[1,1,1],this.directionalLightDirections.length=0,this.directionalLightDiffuseColors.length=0,this.directionalLightSpecularColors.length=0,this.pointLightPositions.length=0,this.pointLightDiffuseColors.length=0,this.pointLightSpecularColors.length=0,this.spotLightPositions.length=0,this.spotLightDirections.length=0,this.spotLightDiffuseColors.length=0,this.spotLightSpecularColors.length=0,this.spotLightAngle.length=0,this.spotLightConc.length=0,this._enableLighting=!1,this._tint=[255,255,255,255],this.GL.clear(this.GL.DEPTH_BUFFER_BIT)},u.default.RendererGL.prototype.background=function(){var e,t=(e=this._pInst).color.apply(e,arguments),r=t.levels[0]/255,i=t.levels[1]/255,n=t.levels[2]/255,o=t.levels[3]/255;this.GL.clearColor(r,i,n,o),this.GL.clear(this.GL.COLOR_BUFFER_BIT)},u.default.RendererGL.prototype.fill=function(e,t,r,i){var n=u.default.prototype.color.apply(this._pInst,arguments);this.curFillColor=n._array,this.drawMode=o.FILL,this._useNormalMaterial=!1,this._tex=null},u.default.RendererGL.prototype.stroke=function(e,t,r,i){arguments[3]=255;var n=u.default.prototype.color.apply(this._pInst,arguments);this.curStrokeColor=n._array},u.default.RendererGL.prototype.strokeCap=function(e){console.error("Sorry, strokeCap() is not yet implemented in WEBGL mode")},u.default.RendererGL.prototype.strokeJoin=function(e){console.error("Sorry, strokeJoin() is not yet implemented in WEBGL mode")},u.default.RendererGL.prototype.filter=function(e){console.error("filter() does not work in WEBGL mode")},u.default.RendererGL.prototype.blendMode=function(e){e===o.DARKEST||e===o.LIGHTEST||e===o.ADD||e===o.BLEND||e===o.SUBTRACT||e===o.SCREEN||e===o.EXCLUSION||e===o.REPLACE||e===o.MULTIPLY||e===o.REMOVE?this.curBlendMode=e:e!==o.BURN&&e!==o.OVERLAY&&e!==o.HARD_LIGHT&&e!==o.SOFT_LIGHT&&e!==o.DODGE||console.warn("BURN, OVERLAY, HARD_LIGHT, SOFT_LIGHT, and DODGE only work for blendMode in 2D mode.")},u.default.RendererGL.prototype.erase=function(e,t){this._isErasing||(this._cachedBlendMode=this.curBlendMode,this.blendMode(o.REMOVE),this._cachedFillStyle=this.curFillColor.slice(),this.curFillColor=[1,1,1,e/255],this._cachedStrokeStyle=this.curStrokeColor.slice(),this.curStrokeColor=[1,1,1,t/255],this._isErasing=!0)},u.default.RendererGL.prototype.noErase=function(){this._isErasing&&(this.curFillColor=this._cachedFillStyle.slice(),this.curStrokeColor=this._cachedStrokeStyle.slice(),this.blendMode(this._cachedBlendMode),this._isErasing=!1)},u.default.RendererGL.prototype.strokeWeight=function(e){this.curStrokeWeight!==e&&(this.pointSize=e,this.curStrokeWeight=e)},u.default.RendererGL.prototype._getPixel=function(e,t){var r;return r=new Uint8Array(4),this.drawingContext.readPixels(e,t,1,1,this.drawingContext.RGBA,this.drawingContext.UNSIGNED_BYTE,r),[r[0],r[1],r[2],r[3]]},u.default.RendererGL.prototype.loadPixels=function(){var e=this._pixelsState;if(!0===this._pInst._glAttributes.preserveDrawingBuffer){var t=e.pixels,r=this.GL.drawingBufferWidth*this.GL.drawingBufferHeight*4;t instanceof Uint8Array&&t.length===r||(t=new Uint8Array(r),this._pixelsState._setProperty("pixels",t));var i=this._pInst._pixelDensity;this.GL.readPixels(0,0,this.width*i,this.height*i,this.GL.RGBA,this.GL.UNSIGNED_BYTE,t)}else console.log("loadPixels only works in WebGL when preserveDrawingBuffer is true.")},u.default.RendererGL.prototype.geometryInHash=function(e){return void 0!==this.retainedMode.geometry[e]},u.default.RendererGL.prototype.resize=function(e,t){u.default.Renderer.prototype.resize.call(this,e,t),this.GL.viewport(0,0,this.GL.drawingBufferWidth,this.GL.drawingBufferHeight),this._viewport=this.GL.getParameter(this.GL.VIEWPORT),this._curCamera._resize();var r=this._pixelsState;void 0!==r.pixels&&r._setProperty("pixels",new Uint8Array(this.GL.drawingBufferWidth*this.GL.drawingBufferHeight*4))},u.default.RendererGL.prototype.clear=function(){var e=(arguments.length<=0?void 0:arguments[0])||0,t=(arguments.length<=1?void 0:arguments[1])||0,r=(arguments.length<=2?void 0:arguments[2])||0,i=(arguments.length<=3?void 0:arguments[3])||0;this.GL.clearColor(e,t,r,i),this.GL.clear(this.GL.COLOR_BUFFER_BIT|this.GL.DEPTH_BUFFER_BIT)},u.default.RendererGL.prototype.applyMatrix=function(e,t,r,i,n,o){16===arguments.length?u.default.Matrix.prototype.apply.apply(this.uMVMatrix,arguments):this.uMVMatrix.apply([e,t,0,0,r,i,0,0,0,0,1,0,n,o,0,1])},u.default.RendererGL.prototype.translate=function(e,t,r){return e instanceof u.default.Vector&&(r=e.z,t=e.y,e=e.x),this.uMVMatrix.translate([e,t,r]),this},u.default.RendererGL.prototype.scale=function(e,t,r){return this.uMVMatrix.scale(e,t,r),this},u.default.RendererGL.prototype.rotate=function(e,t){return void 0===t?this.rotateZ(e):(u.default.Matrix.prototype.rotate.apply(this.uMVMatrix,arguments),this)},u.default.RendererGL.prototype.rotateX=function(e){return this.rotate(e,1,0,0),this},u.default.RendererGL.prototype.rotateY=function(e){return this.rotate(e,0,1,0),this},u.default.RendererGL.prototype.rotateZ=function(e){return this.rotate(e,0,0,1),this},u.default.RendererGL.prototype.push=function(){var e=u.default.Renderer.prototype.push.apply(this),t=e.properties;return t.uMVMatrix=this.uMVMatrix.copy(),t.uPMatrix=this.uPMatrix.copy(),t._curCamera=this._curCamera,this._curCamera=this._curCamera.copy(),t.ambientLightColors=this.ambientLightColors.slice(),t.specularColors=this.specularColors.slice(),t.directionalLightDirections=this.directionalLightDirections.slice(),t.directionalLightDiffuseColors=this.directionalLightDiffuseColors.slice(),t.directionalLightSpecularColors=this.directionalLightSpecularColors.slice(),t.pointLightPositions=this.pointLightPositions.slice(),t.pointLightDiffuseColors=this.pointLightDiffuseColors.slice(),t.pointLightSpecularColors=this.pointLightSpecularColors.slice(),t.spotLightPositions=this.spotLightPositions.slice(),t.spotLightDirections=this.spotLightDirections.slice(),t.spotLightDiffuseColors=this.spotLightDiffuseColors.slice(),t.spotLightSpecularColors=this.spotLightSpecularColors.slice(),t.spotLightAngle=this.spotLightAngle.slice(),t.spotLightConc=this.spotLightConc.slice(),t.userFillShader=this.userFillShader,t.userStrokeShader=this.userStrokeShader,t.userPointShader=this.userPointShader,t.pointSize=this.pointSize,t.curStrokeWeight=this.curStrokeWeight,t.curStrokeColor=this.curStrokeColor,t.curFillColor=this.curFillColor,t._useSpecularMaterial=this._useSpecularMaterial,t._useEmissiveMaterial=this._useEmissiveMaterial,t._useShininess=this._useShininess,t.constantAttenuation=this.constantAttenuation,t.linearAttenuation=this.linearAttenuation,t.quadraticAttenuation=this.quadraticAttenuation,t._enableLighting=this._enableLighting,t._useNormalMaterial=this._useNormalMaterial,t._tex=this._tex,t.drawMode=this.drawMode,e},u.default.RendererGL.prototype.resetMatrix=function(){return this.uMVMatrix=u.default.Matrix.identity(this._pInst),this},u.default.RendererGL.prototype._getImmediateStrokeShader=function(){var e=this.userStrokeShader;return e&&e.isStrokeShader()?e:this._getLineShader()},u.default.RendererGL.prototype._getRetainedStrokeShader=u.default.RendererGL.prototype._getImmediateStrokeShader,u.default.RendererGL.prototype._getImmediateFillShader=function(){var e=this.userFillShader;if(this._useNormalMaterial&&(!e||!e.isNormalShader()))return this._getNormalShader();if(this._enableLighting){if(!e||!e.isLightShader())return this._getLightShader()}else if(this._tex){if(!e||!e.isTextureShader())return this._getLightShader()}else if(!e)return this._getImmediateModeShader();return e},u.default.RendererGL.prototype._getRetainedFillShader=function(){if(this._useNormalMaterial)return this._getNormalShader();var e=this.userFillShader;if(this._enableLighting){if(!e||!e.isLightShader())return this._getLightShader()}else if(this._tex){if(!e||!e.isTextureShader())return this._getLightShader()}else if(!e)return this._getColorShader();return e},u.default.RendererGL.prototype._getImmediatePointShader=function(){var e=this.userPointShader;return e&&e.isPointShader()?e:this._getPointShader()},u.default.RendererGL.prototype._getRetainedLineShader=u.default.RendererGL.prototype._getImmediateLineShader,u.default.RendererGL.prototype._getLightShader=function(){return this._defaultLightShader||(this._pInst._glAttributes.perPixelLighting?this._defaultLightShader=new u.default.Shader(this,c.phongVert,c.phongFrag):this._defaultLightShader=new u.default.Shader(this,c.lightVert,c.lightTextureFrag)),this._defaultLightShader},u.default.RendererGL.prototype._getImmediateModeShader=function(){return this._defaultImmediateModeShader||(this._defaultImmediateModeShader=new u.default.Shader(this,c.immediateVert,c.vertexColorFrag)),this._defaultImmediateModeShader},u.default.RendererGL.prototype._getNormalShader=function(){return this._defaultNormalShader||(this._defaultNormalShader=new u.default.Shader(this,c.normalVert,c.normalFrag)),this._defaultNormalShader},u.default.RendererGL.prototype._getColorShader=function(){return this._defaultColorShader||(this._defaultColorShader=new u.default.Shader(this,c.normalVert,c.basicFrag)),this._defaultColorShader},u.default.RendererGL.prototype._getPointShader=function(){return this._defaultPointShader||(this._defaultPointShader=new u.default.Shader(this,c.pointVert,c.pointFrag)),this._defaultPointShader},u.default.RendererGL.prototype._getLineShader=function(){return this._defaultLineShader||(this._defaultLineShader=new u.default.Shader(this,c.lineVert,c.lineFrag)),this._defaultLineShader},u.default.RendererGL.prototype._getFontShader=function(){return this._defaultFontShader||(this.GL.getExtension("OES_standard_derivatives"),this._defaultFontShader=new u.default.Shader(this,c.fontVert,c.fontFrag)),this._defaultFontShader},u.default.RendererGL.prototype._getEmptyTexture=function(){if(!this._emptyTexture){var e=new u.default.Image(1,1);e.set(0,0,255),this._emptyTexture=new u.default.Texture(this,e)}return this._emptyTexture},u.default.RendererGL.prototype.getTexture=function(e){var t=this.textures,r=!0,i=!1,n=void 0;try{for(var o,a=t[Symbol.iterator]();!(r=(o=a.next()).done);r=!0){var s=o.value;if(s.src===e)return s}}catch(e){i=!0,n=e}finally{try{r||null==a.return||a.return()}finally{if(i)throw n}}var l=new u.default.Texture(this,e);return t.push(l),l},u.default.RendererGL.prototype._setStrokeUniforms=function(e){e.bindShader(),e.setUniform("uMaterialColor",this.curStrokeColor),e.setUniform("uStrokeWeight",this.curStrokeWeight)},u.default.RendererGL.prototype._setFillUniforms=function(e){e.bindShader(),e.setUniform("uMaterialColor",this.curFillColor),e.setUniform("isTexture",!!this._tex),this._tex&&e.setUniform("uSampler",this._tex),e.setUniform("uTint",this._tint),e.setUniform("uSpecular",this._useSpecularMaterial),e.setUniform("uEmissive",this._useEmissiveMaterial),e.setUniform("uShininess",this._useShininess),e.setUniform("uUseLighting",this._enableLighting);var t=this.pointLightDiffuseColors.length/3;e.setUniform("uPointLightCount",t),e.setUniform("uPointLightLocation",this.pointLightPositions),e.setUniform("uPointLightDiffuseColors",this.pointLightDiffuseColors),e.setUniform("uPointLightSpecularColors",this.pointLightSpecularColors);var r=this.directionalLightDiffuseColors.length/3;e.setUniform("uDirectionalLightCount",r),e.setUniform("uLightingDirection",this.directionalLightDirections),e.setUniform("uDirectionalDiffuseColors",this.directionalLightDiffuseColors),e.setUniform("uDirectionalSpecularColors",this.directionalLightSpecularColors);var i=this.ambientLightColors.length/3;e.setUniform("uAmbientLightCount",i),e.setUniform("uAmbientColor",this.ambientLightColors);var n=this.spotLightDiffuseColors.length/3;e.setUniform("uSpotLightCount",n),e.setUniform("uSpotLightAngle",this.spotLightAngle),e.setUniform("uSpotLightConc",this.spotLightConc),e.setUniform("uSpotLightDiffuseColors",this.spotLightDiffuseColors),e.setUniform("uSpotLightSpecularColors",this.spotLightSpecularColors),e.setUniform("uSpotLightLocation",this.spotLightPositions),e.setUniform("uSpotLightDirection",this.spotLightDirections),e.setUniform("uConstantAttenuation",this.constantAttenuation),e.setUniform("uLinearAttenuation",this.linearAttenuation),e.setUniform("uQuadraticAttenuation",this.quadraticAttenuation),e.bindTextures()},u.default.RendererGL.prototype._setPointUniforms=function(e){e.bindShader(),e.setUniform("uMaterialColor",this.curStrokeColor),e.setUniform("uPointSize",this.pointSize)},u.default.RendererGL.prototype._bindBuffer=function(e,t,r,i,n){if(t=t||this.GL.ARRAY_BUFFER,this.GL.bindBuffer(t,e),void 0!==r){var o=new(i||Float32Array)(r);this.GL.bufferData(t,o,n||this.GL.STATIC_DRAW)}},u.default.RendererGL.prototype._arraysEqual=function(e,t){var r=e.length;if(r!==t.length)return!1;for(var i=0;i>7,127&f,c>>7,127&c);for(var d=0;d>7,127&p,0,0)}}return{cellImageInfo:l,dimOffset:o,dimImageInfo:n}}return(t=this.glyphInfos[e.index]={glyph:e,uGlyphRect:[i.x1,-i.y1,i.x2,-i.y2],strokeImageInfo:U,strokes:d,colInfo:G(m,this.colDimImageInfos,this.colCellImageInfos),rowInfo:G(p,this.rowDimImageInfos,this.rowCellImageInfos)}).uGridOffset=[t.colInfo.dimOffset,t.rowInfo.dimOffset],t}}var z=Math.sqrt(3);j.default.RendererGL.prototype._renderText=function(e,t,r,i,n){if(this._textFont&&"string"!=typeof this._textFont){if(!(n<=i)&&this._doFill){if(!this._isOpenType())return console.log("WEBGL: only Opentype (.otf) and Truetype (.ttf) fonts are supported"),e;e.push();var o=this._doStroke,a=this.drawMode;this._doStroke=!1,this.drawMode=D.TEXTURE;var s=this._textFont.font,l=this._textFont._fontInfo;l=l||(this._textFont._fontInfo=new A(s));var u=this._textFont._handleAlignment(this,t,r,i),h=this._textSize/s.unitsPerEm;this.translate(u.x,u.y,0),this.scale(h,h,1);var c=this.GL,f=!this._defaultFontShader,d=this._getFontShader();d.init(),d.bindShader(),f&&(d.setUniform("uGridImageSize",[64,64]),d.setUniform("uCellsImageSize",[64,64]),d.setUniform("uStrokeImageSize",[64,64]),d.setUniform("uGridSize",[9,9])),this._applyColorBlend(this.curFillColor);var p=this.retainedMode.geometry.glyph;if(!p){var m=this._textGeom=new j.default.Geometry(1,1,function(){for(var e=0;e<=1;e++)for(var t=0;t<=1;t++)this.vertices.push(new j.default.Vector(t,e,0)),this.uvs.push(t,e)});m.computeFaces().computeNormals(),p=this.createBuffers("glyph",m)}var g=!0,v=!1,y=void 0;try{for(var b,_=this.retainedMode.buffers.text[Symbol.iterator]();!(g=(b=_.next()).done);g=!0){b.value._prepareBuffer(p,d)}}catch(e){v=!0,y=e}finally{try{g||null==_.return||_.return()}finally{if(v)throw y}}this._bindBuffer(p.indexBuffer,c.ELEMENT_ARRAY_BUFFER),d.setUniform("uMaterialColor",this.curFillColor);try{var x=0,w=null,S=s.stringToGlyphs(t),M=!0,E=!1,T=void 0;try{for(var C,P=S[Symbol.iterator]();!(M=(C=P.next()).done);M=!0){var L=C.value;w&&(x+=s.getKerningValue(w,L));var k=l.getGlyphInfo(L);if(k.uGlyphRect){var R=k.rowInfo,O=k.colInfo;d.setUniform("uSamplerStrokes",k.strokeImageInfo.imageData),d.setUniform("uSamplerRowStrokes",R.cellImageInfo.imageData),d.setUniform("uSamplerRows",R.dimImageInfo.imageData),d.setUniform("uSamplerColStrokes",O.cellImageInfo.imageData),d.setUniform("uSamplerCols",O.dimImageInfo.imageData),d.setUniform("uGridOffset",k.uGridOffset),d.setUniform("uGlyphRect",k.uGlyphRect),d.setUniform("uGlyphOffset",x),d.bindTextures(),c.drawElements(c.TRIANGLES,6,this.GL.UNSIGNED_SHORT,0)}x+=L.advanceWidth,w=L}}catch(e){E=!0,T=e}finally{try{M||null==P.return||P.return()}finally{if(E)throw T}}}finally{d.unbindShader(),this._doStroke=o,this.drawMode=a,e.pop()}return e}}else console.log("WEBGL: you must load and set a font before drawing text. See `loadFont` and `textFont` for more details.")}},{"../core/constants":42,"../core/main":49,"./p5.RendererGL.Retained":102,"./p5.Shader":104}],107:[function(e,t,r){t.exports={fes:{autoplay:"The media that tried to play (with '{{src}}') wasn't allowed to by this browser, most likely due to the browser's autoplay policy. Check out {{link}} for more information about why.",fileLoadError:{bytes:"It looks like there was a problem loading your file. {{suggestion}}",font:"It looks like there was a problem loading your font. {{suggestion}}",gif:"There was some trouble loading your GIF. Make sure that your GIF is using 87a or 89a encoding.",image:"It looks like there was a problem loading your image. {{suggestion}}",json:"It looks like there was a problem loading your JSON file. {{suggestion}}",large:"If your large file isn't fetched successfully, we recommend splitting the file into smaller segments and fetching those.",strings:"It looks like there was a problem loading your text file. {{suggestion}}",suggestion:"Try checking if the file path ({{filePath}}) is correct, hosting the file online, or running a local server. (More info at {{link}})",table:"It looks like there was a problem loading your table file. {{suggestion}}",xml:"It looks like there was a problem loading your XML file. {{suggestion}}"},misusedTopLevel:"Did you just try to use p5.js's {{symbolName}} {{symbolType}}? If so, you may want to move it into your sketch's setup() function.\n\nFor more details, see: {{link}}",pre:"🌸 p5.js says: {{message}}",welcome:"Welcome! This is your friendly debugger. To turn me off, switch to using p5.min.js."}}},{}],108:[function(e,t,r){t.exports={fes:{autoplay:"Su browser impidío un medio tocar (de '{{src}}'), posiblemente porque las reglas de autoplay. Para aprender más, visite {{link}}.",fileLoadError:{bytes:"",font:"",gif:"",image:"",json:"",large:"",strings:"",suggestion:"",table:"",xml:""},misusedTopLevel:"",pre:"🌸 p5.js dice: {{message}}",welcome:""}}},{}],109:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i=o(e("./en/translation")),n=o(e("./es/translation"));function o(e){return e&&e.__esModule?e:{default:e}}var a={en:{translation:i.default},es:{translation:n.default}};r.default=a},{"./en/translation":107,"./es/translation":108}]},{},[37])(37)}); ================================================ FILE: docs/examples/pyodide/flappybird/target/target_sketch.js ================================================ const wrapperContent = ` class PythonFunctions: pass setattr(PythonFunctions, 'map', map) setattr(PythonFunctions, 'filter', filter) setattr(PythonFunctions, 'set', set) _P5_INSTANCE = None _CTX_MIDDLE = None _DEFAULT_FILL = None _DEFAULT_LEADMULT = None _DEFAULT_STROKE = None _DEFAULT_TEXT_FILL = None ADD = None ALT = None ARROW = None AUDIO = None AUTO = None AXES = None BACKSPACE = None BASELINE = None BEVEL = None BEZIER = None BLEND = None BLUR = None BOLD = None BOLDITALIC = None BOTTOM = None BURN = None CENTER = None CHORD = None CLAMP = None CLOSE = None CONTROL = None CORNER = None CORNERS = None CROSS = None CURVE = None DARKEST = None DEG_TO_RAD = None DEGREES = None DELETE = None DIFFERENCE = None DILATE = None DODGE = None DOWN_ARROW = None ENTER = None ERODE = None ESCAPE = None EXCLUSION = None FILL = None GRAY = None GRID = None HALF_PI = None HAND = None HARD_LIGHT = None HSB = None HSL = None IMAGE = None IMMEDIATE = None INVERT = None ITALIC = None LANDSCAPE = None LEFT = None LEFT_ARROW = None LIGHTEST = None LINE_LOOP = None LINE_STRIP = None LINEAR = None LINES = None MIRROR = None MITER = None MOVE = None MULTIPLY = None NEAREST = None NORMAL = None OPAQUE = None OPEN = None OPTION = None OVERLAY = None PI = None PIE = None POINTS = None PORTRAIT = None POSTERIZE = None PROJECT = None QUAD_STRIP = None QUADRATIC = None QUADS = None QUARTER_PI = None RAD_TO_DEG = None RADIANS = None RADIUS = None REPEAT = None REPLACE = None RETURN = None RGB = None RIGHT = None RIGHT_ARROW = None ROUND = None SCREEN = None SHIFT = None SOFT_LIGHT = None SQUARE = None STROKE = None SUBTRACT = None TAB = None TAU = None TEXT = None TEXTURE = None THRESHOLD = None TOP = None TRIANGLE_FAN = None TRIANGLE_STRIP = None TRIANGLES = None TWO_PI = None UP_ARROW = None VIDEO = None WAIT = None WEBGL = None P2D = None PI = None frameCount = None focused = None displayWidth = None displayHeight = None windowWidth = None windowHeight = None width = None height = None deviceOrientation = None accelerationX = None accelerationY = None accelerationZ = None pAccelerationX = None pAccelerationY = None pAccelerationZ = None rotationX = None rotationY = None rotationZ = None pRotationX = None pRotationY = None pRotationZ = None turnAxis = None keyIsPressed = None key = None keyCode = None mouseX = None mouseY = None pmouseX = None pmouseY = None winMouseX = None winMouseY = None pwinMouseX = None pwinMouseY = None mouseButton = None mouseIsPressed = None touches = None pixels = None def alpha(*args): return _P5_INSTANCE.alpha(*args) def blue(*args): return _P5_INSTANCE.blue(*args) def brightness(*args): return _P5_INSTANCE.brightness(*args) def color(*args): return _P5_INSTANCE.color(*args) def green(*args): return _P5_INSTANCE.green(*args) def hue(*args): return _P5_INSTANCE.hue(*args) def lerpColor(*args): return _P5_INSTANCE.lerpColor(*args) def lightness(*args): return _P5_INSTANCE.lightness(*args) def red(*args): return _P5_INSTANCE.red(*args) def saturation(*args): return _P5_INSTANCE.saturation(*args) def background(*args): return _P5_INSTANCE.background(*args) def clear(*args): p5_clear = _P5_INSTANCE.clear(*args) return p5_clear def erase(*args): return _P5_INSTANCE.erase(*args) def noErase(*args): return _P5_INSTANCE.noErase(*args) def colorMode(*args): return _P5_INSTANCE.colorMode(*args) def fill(*args): return _P5_INSTANCE.fill(*args) def noFill(*args): return _P5_INSTANCE.noFill(*args) def noStroke(*args): return _P5_INSTANCE.noStroke(*args) def stroke(*args): return _P5_INSTANCE.stroke(*args) def arc(*args): return _P5_INSTANCE.arc(*args) def ellipse(*args): return _P5_INSTANCE.ellipse(*args) def circle(*args): return _P5_INSTANCE.circle(*args) def line(*args): return _P5_INSTANCE.line(*args) def point(*args): return _P5_INSTANCE.point(*args) def quad(*args): return _P5_INSTANCE.quad(*args) def rect(*args): return _P5_INSTANCE.rect(*args) def square(*args): return _P5_INSTANCE.square(*args) def triangle(*args): return _P5_INSTANCE.triangle(*args) def plane(*args): return _P5_INSTANCE.plane(*args) def box(*args): return _P5_INSTANCE.box(*args) def sphere(*args): return _P5_INSTANCE.sphere(*args) def cylinder(*args): return _P5_INSTANCE.cylinder(*args) def cone(*args): return _P5_INSTANCE.cone(*args) def ellipsoid(*args): return _P5_INSTANCE.ellipsoid(*args) def torus(*args): return _P5_INSTANCE.torus(*args) def loadModel(*args): return _P5_INSTANCE.loadModel(*args) def model(*args): return _P5_INSTANCE.model(*args) def ellipseMode(*args): return _P5_INSTANCE.ellipseMode(*args) def noSmooth(*args): return _P5_INSTANCE.noSmooth(*args) def rectMode(*args): return _P5_INSTANCE.rectMode(*args) def smooth(*args): return _P5_INSTANCE.smooth(*args) def strokeCap(*args): return _P5_INSTANCE.strokeCap(*args) def strokeJoin(*args): return _P5_INSTANCE.strokeJoin(*args) def strokeWeight(*args): return _P5_INSTANCE.strokeWeight(*args) def bezier(*args): return _P5_INSTANCE.bezier(*args) def bezierDetail(*args): return _P5_INSTANCE.bezierDetail(*args) def bezierPoint(*args): return _P5_INSTANCE.bezierPoint(*args) def bezierTangent(*args): return _P5_INSTANCE.bezierTangent(*args) def curve(*args): return _P5_INSTANCE.curve(*args) def curveDetail(*args): return _P5_INSTANCE.curveDetail(*args) def curveTightness(*args): return _P5_INSTANCE.curveTightness(*args) def curvePoint(*args): return _P5_INSTANCE.curvePoint(*args) def curveTangent(*args): return _P5_INSTANCE.curveTangent(*args) def beginContour(*args): return _P5_INSTANCE.beginContour(*args) def beginShape(*args): return _P5_INSTANCE.beginShape(*args) def bezierVertex(*args): return _P5_INSTANCE.bezierVertex(*args) def curveVertex(*args): return _P5_INSTANCE.curveVertex(*args) def endContour(*args): return _P5_INSTANCE.endContour(*args) def endShape(*args): return _P5_INSTANCE.endShape(*args) def quadraticVertex(*args): return _P5_INSTANCE.quadraticVertex(*args) def vertex(*args): return _P5_INSTANCE.vertex(*args) def cursor(*args): return _P5_INSTANCE.cursor(*args) def frameRate(*args): return _P5_INSTANCE.frameRate(*args) def noCursor(*args): return _P5_INSTANCE.noCursor(*args) def fullscreen(*args): return _P5_INSTANCE.fullscreen(*args) def pixelDensity(*args): return _P5_INSTANCE.pixelDensity(*args) def displayDensity(*args): return _P5_INSTANCE.displayDensity(*args) def getURL(*args): return _P5_INSTANCE.getURL(*args) def getURLPath(*args): return _P5_INSTANCE.getURLPath(*args) def getURLParams(*args): return _P5_INSTANCE.getURLParams(*args) def remove(*args): return _P5_INSTANCE.remove(*args) def noLoop(*args): return _P5_INSTANCE.noLoop(*args) def loop(*args): return _P5_INSTANCE.loop(*args) def push(*args): return _P5_INSTANCE.push(*args) def redraw(*args): return _P5_INSTANCE.redraw(*args) def resizeCanvas(*args): return _P5_INSTANCE.resizeCanvas(*args) def noCanvas(*args): return _P5_INSTANCE.noCanvas(*args) def createGraphics(*args): return _P5_INSTANCE.createGraphics(*args) def blendMode(*args): return _P5_INSTANCE.blendMode(*args) def setAttributes(*args): return _P5_INSTANCE.setAttributes(*args) def applyMatrix(*args): return _P5_INSTANCE.applyMatrix(*args) def resetMatrix(*args): return _P5_INSTANCE.resetMatrix(*args) def rotate(*args): return _P5_INSTANCE.rotate(*args) def rotateX(*args): return _P5_INSTANCE.rotateX(*args) def rotateY(*args): return _P5_INSTANCE.rotateY(*args) def rotateZ(*args): return _P5_INSTANCE.rotateZ(*args) def scale(*args): return _P5_INSTANCE.scale(*args) def shearX(*args): return _P5_INSTANCE.shearX(*args) def shearY(*args): return _P5_INSTANCE.shearY(*args) def translate(*args): return _P5_INSTANCE.translate(*args) def createStringDict(*args): return _P5_INSTANCE.createStringDict(*args) def createNumberDict(*args): return _P5_INSTANCE.createNumberDict(*args) def append(*args): return _P5_INSTANCE.append(*args) def arrayCopy(*args): return _P5_INSTANCE.arrayCopy(*args) def concat(*args): return _P5_INSTANCE.concat(*args) def reverse(*args): return _P5_INSTANCE.reverse(*args) def shorten(*args): return _P5_INSTANCE.shorten(*args) def shuffle(*args): return _P5_INSTANCE.shuffle(*args) def sort(*args): return _P5_INSTANCE.sort(*args) def splice(*args): return _P5_INSTANCE.splice(*args) def subset(*args): return _P5_INSTANCE.subset(*args) def float(*args): return _P5_INSTANCE.float(*args) def int(*args): return _P5_INSTANCE.int(*args) def str(*args): return _P5_INSTANCE.str(*args) def boolean(*args): return _P5_INSTANCE.boolean(*args) def byte(*args): return _P5_INSTANCE.byte(*args) def char(*args): return _P5_INSTANCE.char(*args) def unchar(*args): return _P5_INSTANCE.unchar(*args) def hex(*args): return _P5_INSTANCE.hex(*args) def unhex(*args): return _P5_INSTANCE.unhex(*args) def join(*args): return _P5_INSTANCE.join(*args) def match(*args): return _P5_INSTANCE.match(*args) def matchAll(*args): return _P5_INSTANCE.matchAll(*args) def nf(*args): return _P5_INSTANCE.nf(*args) def nfc(*args): return _P5_INSTANCE.nfc(*args) def nfp(*args): return _P5_INSTANCE.nfp(*args) def nfs(*args): return _P5_INSTANCE.nfs(*args) def split(*args): return _P5_INSTANCE.split(*args) def splitTokens(*args): return _P5_INSTANCE.splitTokens(*args) def trim(*args): return _P5_INSTANCE.trim(*args) def setMoveThreshold(*args): return _P5_INSTANCE.setMoveThreshold(*args) def setShakeThreshold(*args): return _P5_INSTANCE.setShakeThreshold(*args) def keyIsDown(*args): return _P5_INSTANCE.keyIsDown(*args) def createImage(*args): return _P5_INSTANCE.createImage(*args) def saveCanvas(*args): return _P5_INSTANCE.saveCanvas(*args) def saveFrames(*args): return _P5_INSTANCE.saveFrames(*args) def loadImage(*args): return _P5_INSTANCE.loadImage(*args) def image(*args): return _P5_INSTANCE.image(*args) def tint(*args): return _P5_INSTANCE.tint(*args) def noTint(*args): return _P5_INSTANCE.noTint(*args) def imageMode(*args): return _P5_INSTANCE.imageMode(*args) def blend(*args): return _P5_INSTANCE.blend(*args) def copy(*args): return _P5_INSTANCE.copy(*args) def filter(*args): if len(args) > 1 and (args[0] is None or callable(args[0])): return PythonFunctions.filter(*args) else: return _P5_INSTANCE.filter(*args) def get(*args): return _P5_INSTANCE.get(*args) def loadPixels(*args): return _P5_INSTANCE.loadPixels(*args) def set(*args): if len(args) <= 1: return PythonFunctions.set(*args) else: return _P5_INSTANCE.set(*args) def updatePixels(*args): return _P5_INSTANCE.updatePixels(*args) def loadJSON(*args): return _P5_INSTANCE.loadJSON(*args) def loadStrings(*args): return _P5_INSTANCE.loadStrings(*args) def loadTable(*args): return _P5_INSTANCE.loadTable(*args) def loadXML(*args): return _P5_INSTANCE.loadXML(*args) def loadBytes(*args): return _P5_INSTANCE.loadBytes(*args) def httpGet(*args): return _P5_INSTANCE.httpGet(*args) def httpPost(*args): return _P5_INSTANCE.httpPost(*args) def httpDo(*args): return _P5_INSTANCE.httpDo(*args) def createWriter(*args): return _P5_INSTANCE.createWriter(*args) def save(*args): return _P5_INSTANCE.save(*args) def saveJSON(*args): return _P5_INSTANCE.saveJSON(*args) def saveStrings(*args): return _P5_INSTANCE.saveStrings(*args) def saveTable(*args): return _P5_INSTANCE.saveTable(*args) def day(*args): return _P5_INSTANCE.day(*args) def hour(*args): return _P5_INSTANCE.hour(*args) def minute(*args): return _P5_INSTANCE.minute(*args) def millis(*args): return _P5_INSTANCE.millis(*args) def month(*args): return _P5_INSTANCE.month(*args) def second(*args): return _P5_INSTANCE.second(*args) def year(*args): return _P5_INSTANCE.year(*args) def createVector(*args): return _P5_INSTANCE.createVector(*args) def abs(*args): return _P5_INSTANCE.abs(*args) def ceil(*args): return _P5_INSTANCE.ceil(*args) def constrain(*args): return _P5_INSTANCE.constrain(*args) def dist(*args): return _P5_INSTANCE.dist(*args) def exp(*args): return _P5_INSTANCE.exp(*args) def floor(*args): return _P5_INSTANCE.floor(*args) def lerp(*args): return _P5_INSTANCE.lerp(*args) def log(*args): return _P5_INSTANCE.log(*args) def mag(*args): return _P5_INSTANCE.mag(*args) def map(*args): if len(args) > 1 and callable(args[0]): return PythonFunctions.map(*args) else: return _P5_INSTANCE.map(*args) def max(*args): return _P5_INSTANCE.max(*args) def min(*args): return _P5_INSTANCE.min(*args) def norm(*args): return _P5_INSTANCE.norm(*args) def pow(*args): return _P5_INSTANCE.pow(*args) def round(*args): return _P5_INSTANCE.round(*args) def sq(*args): return _P5_INSTANCE.sq(*args) def sqrt(*args): return _P5_INSTANCE.sqrt(*args) def noise(*args): return _P5_INSTANCE.noise(*args) def noiseDetail(*args): return _P5_INSTANCE.noiseDetail(*args) def noiseSeed(*args): return _P5_INSTANCE.noiseSeed(*args) def randomSeed(*args): return _P5_INSTANCE.randomSeed(*args) def random(*args): return _P5_INSTANCE.random(*args) def randomGaussian(*args): return _P5_INSTANCE.randomGaussian(*args) def acos(*args): return _P5_INSTANCE.acos(*args) def asin(*args): return _P5_INSTANCE.asin(*args) def atan(*args): return _P5_INSTANCE.atan(*args) def atan2(*args): return _P5_INSTANCE.atan2(*args) def cos(*args): return _P5_INSTANCE.cos(*args) def sin(*args): return _P5_INSTANCE.sin(*args) def tan(*args): return _P5_INSTANCE.tan(*args) def degrees(*args): return _P5_INSTANCE.degrees(*args) def radians(*args): return _P5_INSTANCE.radians(*args) def angleMode(*args): return _P5_INSTANCE.angleMode(*args) def textAlign(*args): return _P5_INSTANCE.textAlign(*args) def textLeading(*args): return _P5_INSTANCE.textLeading(*args) def textSize(*args): return _P5_INSTANCE.textSize(*args) def textStyle(*args): return _P5_INSTANCE.textStyle(*args) def textWidth(*args): return _P5_INSTANCE.textWidth(*args) def textAscent(*args): return _P5_INSTANCE.textAscent(*args) def textDescent(*args): return _P5_INSTANCE.textDescent(*args) def loadFont(*args): return _P5_INSTANCE.loadFont(*args) def text(*args): return _P5_INSTANCE.text(*args) def textFont(*args): return _P5_INSTANCE.textFont(*args) def orbitControl(*args): return _P5_INSTANCE.orbitControl(*args) def debugMode(*args): return _P5_INSTANCE.debugMode(*args) def noDebugMode(*args): return _P5_INSTANCE.noDebugMode(*args) def ambientLight(*args): return _P5_INSTANCE.ambientLight(*args) def directionalLight(*args): return _P5_INSTANCE.directionalLight(*args) def pointLight(*args): return _P5_INSTANCE.pointLight(*args) def lights(*args): return _P5_INSTANCE.lights(*args) def loadShader(*args): return _P5_INSTANCE.loadShader(*args) def createShader(*args): return _P5_INSTANCE.createShader(*args) def shader(*args): return _P5_INSTANCE.shader(*args) def resetShader(*args): return _P5_INSTANCE.resetShader(*args) def normalMaterial(*args): return _P5_INSTANCE.normalMaterial(*args) def texture(*args): return _P5_INSTANCE.texture(*args) def textureMode(*args): return _P5_INSTANCE.textureMode(*args) def textureWrap(*args): return _P5_INSTANCE.textureWrap(*args) def ambientMaterial(*args): return _P5_INSTANCE.ambientMaterial(*args) def specularMaterial(*args): return _P5_INSTANCE.specularMaterial(*args) def shininess(*args): return _P5_INSTANCE.shininess(*args) def camera(*args): return _P5_INSTANCE.camera(*args) def perspective(*args): return _P5_INSTANCE.perspective(*args) def ortho(*args): return _P5_INSTANCE.ortho(*args) def createCamera(*args): return _P5_INSTANCE.createCamera(*args) def setCamera(*args): return _P5_INSTANCE.setCamera(*args) def select(*args): return _P5_INSTANCE.select(*args) def selectAll(*args): return _P5_INSTANCE.selectAll(*args) def removeElements(*args): return _P5_INSTANCE.removeElements(*args) def changed(*args): return _P5_INSTANCE.changed(*args) def input(*args): return _P5_INSTANCE.input(*args) def createDiv(*args): return _P5_INSTANCE.createDiv(*args) def createP(*args): return _P5_INSTANCE.createP(*args) def createSpan(*args): return _P5_INSTANCE.createSpan(*args) def createImg(*args): return _P5_INSTANCE.createImg(*args) def createA(*args): return _P5_INSTANCE.createA(*args) def createSlider(*args): return _P5_INSTANCE.createSlider(*args) def createButton(*args): return _P5_INSTANCE.createButton(*args) def createCheckbox(*args): return _P5_INSTANCE.createCheckbox(*args) def createSelect(*args): return _P5_INSTANCE.createSelect(*args) def createRadio(*args): return _P5_INSTANCE.createRadio(*args) def createColorPicker(*args): return _P5_INSTANCE.createColorPicker(*args) def createInput(*args): return _P5_INSTANCE.createInput(*args) def createFileInput(*args): return _P5_INSTANCE.createFileInput(*args) def createVideo(*args): return _P5_INSTANCE.createVideo(*args) def createAudio(*args): return _P5_INSTANCE.createAudio(*args) def createCapture(*args): return _P5_INSTANCE.createCapture(*args) def createElement(*args): return _P5_INSTANCE.createElement(*args) def createCanvas(*args): canvas = _P5_INSTANCE.createCanvas(*args) global width, height width = _P5_INSTANCE.width height = _P5_INSTANCE.height return canvas def __deviceMoved(e): try: _bind_event_function(deviceMoved, e) except NameError: pass def __deviceTurned(e): try: _bind_event_function(deviceTurned, e) except NameError: pass def __deviceShaken(e): try: _bind_event_function(deviceShaken, e) except NameError: pass def __touchEnded(e): try: _bind_event_function(deviceShaken, e) except NameError: pass def __touchStarted(e): try: _bind_event_function(touchStarted, e) except NameError: pass def __windowResized(e): try: _bind_event_function(windowResized, e) except NameError: pass def __touchMoved(e): try: _bind_event_function(touchMoved, e) except NameError: pass def __mouseMoved(e): try: _bind_event_function(mouseMoved, e) except NameError: pass def __mouseDragged(e): try: _bind_event_function(mouseDragged, e) except NameError: pass def __mousePressed(e): try: _bind_event_function(mousePressed, e) except NameError: pass def __mouseReleased(e): try: _bind_event_function(mouseReleased, e) except NameError: pass def __mouseClicked(e): try: _bind_event_function(mouseClicked, e) except NameError: pass def __doubleClicked(e): try: _bind_event_function(doubleClicked, e) except NameError: pass def __mouseWheel(e): try: _bind_event_function(mouseWheel, e) except NameError: pass def __keyPressed(e): try: _bind_event_function(keyPressed, e) except NameError: pass def __keyReleased(e): try: _bind_event_function(keyReleased, e) except NameError: pass def __keyTyped(e): try: _bind_event_function(keyTyped, e) except NameError: pass def __keyIsDown(e): try: _bind_event_function(keyIsDown, e) except NameError: pass def pop(*args): p5_pop = _P5_INSTANCE.pop(*args) return p5_pop # Processing Python or Java mode compatibility aliases size = createCanvas popMatrix = pop popStyle = pop pushMatrix = push pushStyle = push # PVector is a wrapper/helper class for p5.Vector objets # providing names similar to Processing Python or Java modes # but mostly keeping p5js functionality from numbers import Number class PVector: def __init__(self, x=0, y=0, z=0): self.__vector = createVector(x, y, z) self.add = self.__instance_add__ self.sub = self.__instance_sub__ self.mult = self.__instance_mult__ self.div = self.__instance_div__ self.cross = self.__instance_cross__ self.dist = self.__instance_dist__ self.dot = self.__instance_dot__ self.lerp = self.__instance_lerp__ @property def x(self): return self.__vector.x @x.setter def x(self, x): self.__vector.x = x @property def y(self): return self.__vector.y @y.setter def y(self, y): self.__vector.y = y @property def z(self): return self.__vector.z @z.setter def z(self, z): self.__vector.z = z def mag(self): return self.__vector.mag() def magSq(self): return self.__vector.magSq() def setMag(self, mag): self.__vector.setMag(mag) return self def normalize(self): self.__vector.normalize() return self def limit(self, max): self.__vector.limit(max) return self def heading(self): return self.__vector.heading() def rotate(self, angle): self.__vector.rotate(angle) return self def __instance_add__(self, *args): if len(args) == 1: return PVector.add(self, args[0], self) else: return PVector.add(self, PVector(*args), self) def __instance_sub__(self, *args): if len(args) == 1: return PVector.sub(self, args[0], self) else: return PVector.sub(self, PVector(*args), self) def __instance_mult__(self, o): return PVector.mult(self, o, self) def __instance_div__(self, f): return PVector.div(self, f, self) def __instance_cross__(self, o): return PVector.cross(self, o, self) def __instance_dist__(self, o): return PVector.dist(self, o) def __instance_dot__(self, *args): if len(args) == 1: v = args[0] else: v = args return self.x * v[0] + self.y * v[1] + self.z * v[2] def __instance_lerp__(self, *args): if len(args) == 2: return PVector.lerp(self, args[0], args[1], self) else: vx, vy, vz, f = args return PVector.lerp(self, PVector(vx, vy, vz), f, self) def get(self): return PVector(self.x, self.y, self.z) def copy(self): return PVector(self.x, self.y, self.z) def __getitem__(self, k): return getattr(self, ('x', 'y', 'z')[k]) def __setitem__(self, k, v): setattr(self, ('x', 'y', 'z')[k], v) def __copy__(self): return PVector(self.x, self.y, self.z) def __deepcopy__(self, memo): return PVector(self.x, self.y, self.z) def __repr__(self): # PROVISÓRIO return f'PVector({self.x}, {self.y}, {self.z})' def set(self, *args): """ Sets the x, y, and z component of the vector using two or three separate variables, the data from a p5.Vector, or the values from a float array. """ self.__vector.set(*args) @classmethod def add(cls, a, b, dest=None): if dest is None: return PVector(a.x + b[0], a.y + b[1], a.z + b[2]) dest.__vector.set(a.x + b[0], a.y + b[1], a.z + b[2]) return dest @classmethod def sub(cls, a, b, dest=None): if dest is None: return PVector(a.x - b[0], a.y - b[1], a.z - b[2]) dest.__vector.set(a.x - b[0], a.y - b[1], a.z - b[2]) return dest @classmethod def mult(cls, a, b, dest=None): if dest is None: return PVector(a.x * b, a.y * b, a.z * b) dest.__vector.set(a.x * b, a.y * b, a.z * b) return dest @classmethod def div(cls, a, b, dest=None): if dest is None: return PVector(a.x / b, a.y / b, a.z / b) dest.__vector.set(a.x / b, a.y / b, a.z / b) return dest @classmethod def dist(cls, a, b): return a.__vector.dist(b.__vector) @classmethod def dot(cls, a, b): return a.__vector.dot(b.__vector) def __add__(a, b): return PVector.add(a, b, None) def __sub__(a, b): return PVector.sub(a, b, None) def __isub__(a, b): a.sub(b) return a def __iadd__(a, b): a.add(b) return a def __mul__(a, b): if not isinstance(b, Number): raise TypeError( "The * operator can only be used to multiply a PVector by a number") return PVector.mult(a, float(b), None) def __rmul__(a, b): if not isinstance(b, Number): raise TypeError( "The * operator can only be used to multiply a PVector by a number") return PVector.mult(a, float(b), None) def __imul__(a, b): if not isinstance(b, Number): raise TypeError( "The *= operator can only be used to multiply a PVector by a number") a.__vector.mult(float(b)) return a def __truediv__(a, b): if not isinstance(b, Number): raise TypeError( "The * operator can only be used to multiply a PVector by a number") return PVector(a.x / float(b), a.y / float(b), a.z / float(b)) def __itruediv__(a, b): if not isinstance(b, Number): raise TypeError( "The /= operator can only be used to multiply a PVector by a number") a.__vector.set(a.x / float(b), a.y / float(b), a.z / float(b)) return a def __eq__(a, b): return a.x == b[0] and a.y == b[1] and a.z == b[2] def __lt__(a, b): return a.magSq() < b.magSq() def __le__(a, b): return a.magSq() <= b.magSq() def __gt__(a, b): return a.magSq() > b.magSq() def __ge__(a, b): return a.magSq() >= b.magSq() # Problematic class methods, we would rather use p5.Vector when possible... @classmethod def lerp(cls, a, b, f, dest=None): v = createVector(a.x, a.y, a.z) v.lerp(b.__vector, f) if dest is None: return PVector(v.x, v.y, v.z) dest.set(v.x, v.y, v.z) return dest @classmethod def cross(cls, a, b, dest=None): x = a.y * b[2] - b[1] * a.z y = a.z * b[0] - b[2] * a.x z = a.x * b[1] - b[0] * a.y if dest is None: return PVector(x, y, z) dest.set(x, y, z) return dest @classmethod def fromAngle(cls, angle, length=1): # https://github.com/processing/p5.js/blob/3f0b2f0fe575dc81c724474154f5b23a517b7233/src/math/p5.Vector.js return PVector(length * cos(angle), length * sin(angle), 0) @classmethod def fromAngles(theta, phi, length=1): # https://github.com/processing/p5.js/blob/3f0b2f0fe575dc81c724474154f5b23a517b7233/src/math/p5.Vector.js cosPhi = cos(phi) sinPhi = sin(phi) cosTheta = cos(theta) sinTheta = sin(theta) return PVector(length * sinTheta * sinPhi, -length * cosTheta, length * sinTheta * cosPhi) @classmethod def random2D(cls): return PVector.fromAngle(random(TWO_PI)) @classmethod def random3D(cls, dest=None): angle = random(TWO_PI) vz = random(2) - 1 mult = sqrt(1 - vz * vz) vx = mult * cos(angle) vy = mult * sin(angle) if dest is None: return PVector(vx, vy, vz) dest.set(vx, vy, vz) return dest @classmethod def angleBetween(cls, a, b): return acos(a.dot(b) / sqrt(a.magSq() * b.magSq())) # Other harmless p5js methods def equals(self, v): return self == v def heading2D(self): return self.__vector.heading() def reflect(self, *args): # Reflect the incoming vector about a normal to a line in 2D, or about # a normal to a plane in 3D This method acts on the vector directly r = self.__vector.reflect(*args) return r def array(self): # Return a representation of this vector as a float array. This is only # for temporary use. If used in any w fashion, the contents should be # copied by using the p5.Vector.copy() method to copy into your own # array. return self.__vector.array() def toString(self): # Returns a string representation of a vector v by calling String(v) or v.toString(). # return self.__vector.toString() would be something like "p5.vector # Object […, …, …]" return str(self) def rem(self, *args): # Gives remainder of a vector when it is divided by anw vector. See # examples for more context. self.__vector.rem(*args) return self def pre_draw(p5_instance, draw_func, *args, **kwargs): """ We need to run this before the actual draw to insert and update p5 env variables """ global _CTX_MIDDLE, _DEFAULT_FILL, _DEFAULT_LEADMULT, _DEFAULT_STROKE, _DEFAULT_TEXT_FILL global ADD, ALT, ARROW, AUTO, AUDIO, AXES, BACKSPACE, BASELINE, BEVEL, BEZIER, BLEND, BLUR, BOLD, BOLDITALIC global BOTTOM, BURN, CENTER, CHORD, CLAMP, CLOSE, CONTROL, CORNER, CORNERS, CROSS, CURVE, DARKEST global DEG_TO_RAD, DEGREES, DELETE, DIFFERENCE, DILATE, DODGE, DOWN_ARROW, ENTER, ERODE, ESCAPE, EXCLUSION global FILL, GRAY, GRID, HALF_PI, HAND, HARD_LIGHT, HSB, HSL, IMAGE, IMMEDIATE, INVERT, ITALIC, LANDSCAPE global LEFT, LEFT_ARROW, LIGHTEST, LINE_LOOP, LINE_STRIP, LINEAR, LINES, MIRROR, MITER, MOVE, MULTIPLY, NEAREST global NORMAL, OPAQUE, OPEN, OPTION, OVERLAY, P2D, P3D, PI, PIE, POINTS, PORTRAIT, POSTERIZE, PROJECT, QUAD_STRIP global QUADRATIC, QUADS, QUARTER_PI, RAD_TO_DEG, RADIANS, RADIUS, REPEAT, REPLACE, RETURN, RGB, RIGHT, RIGHT_ARROW global ROUND, SCREEN, SHIFT, SOFT_LIGHT, SQUARE, STROKE, SUBTRACT, TAB, TAU, TEXT, TEXTURE, THRESHOLD, TOP global TRIANGLE_FAN, TRIANGLE_STRIP, TRIANGLES, TWO_PI, UP_ARROW, VIDEO, WAIT, WEBGL global frameCount, focused, displayWidth, displayHeight, windowWidth, windowHeight, width, height global deviceOrientation, accelerationX, accelerationY, accelerationZ global pAccelerationX, pAccelerationY, pAccelerationZ, rotationX, rotationY, rotationZ global pRotationX, pRotationY, pRotationZ, turnAxis, keyIsPressed, key, keyCode, mouseX, mouseY, pmouseX, pmouseY global winMouseX, winMouseY, pwinMouseX, pwinMouseY, mouseButton, mouseIsPressed, touches, pixels _CTX_MIDDLE = p5_instance._CTX_MIDDLE _DEFAULT_FILL = p5_instance._DEFAULT_FILL _DEFAULT_LEADMULT = p5_instance._DEFAULT_LEADMULT _DEFAULT_STROKE = p5_instance._DEFAULT_STROKE _DEFAULT_TEXT_FILL = p5_instance._DEFAULT_TEXT_FILL ADD = p5_instance.ADD ALT = p5_instance.ALT ARROW = p5_instance.ARROW AUDIO = p5_instance.AUDIO AUTO = p5_instance.AUTO AXES = p5_instance.AXES BACKSPACE = p5_instance.BACKSPACE BASELINE = p5_instance.BASELINE BEVEL = p5_instance.BEVEL BEZIER = p5_instance.BEZIER BLEND = p5_instance.BLEND BLUR = p5_instance.BLUR BOLD = p5_instance.BOLD BOLDITALIC = p5_instance.BOLDITALIC BOTTOM = p5_instance.BOTTOM BURN = p5_instance.BURN CENTER = p5_instance.CENTER CHORD = p5_instance.CHORD CLAMP = p5_instance.CLAMP CLOSE = p5_instance.CLOSE CONTROL = p5_instance.CONTROL CORNER = p5_instance.CORNER CORNERS = p5_instance.CORNERS CROSS = p5_instance.CROSS CURVE = p5_instance.CURVE DARKEST = p5_instance.DARKEST DEG_TO_RAD = p5_instance.DEG_TO_RAD DEGREES = p5_instance.DEGREES DELETE = p5_instance.DELETE DIFFERENCE = p5_instance.DIFFERENCE DILATE = p5_instance.DILATE DODGE = p5_instance.DODGE DOWN_ARROW = p5_instance.DOWN_ARROW ENTER = p5_instance.ENTER ERODE = p5_instance.ERODE ESCAPE = p5_instance.ESCAPE EXCLUSION = p5_instance.EXCLUSION FILL = p5_instance.FILL GRAY = p5_instance.GRAY GRID = p5_instance.GRID HALF_PI = p5_instance.HALF_PI HAND = p5_instance.HAND HARD_LIGHT = p5_instance.HARD_LIGHT HSB = p5_instance.HSB HSL = p5_instance.HSL IMAGE = p5_instance.IMAGE IMMEDIATE = p5_instance.IMMEDIATE INVERT = p5_instance.INVERT ITALIC = p5_instance.ITALIC LANDSCAPE = p5_instance.LANDSCAPE LEFT = p5_instance.LEFT LEFT_ARROW = p5_instance.LEFT_ARROW LIGHTEST = p5_instance.LIGHTEST LINE_LOOP = p5_instance.LINE_LOOP LINE_STRIP = p5_instance.LINE_STRIP LINEAR = p5_instance.LINEAR LINES = p5_instance.LINES MIRROR = p5_instance.MIRROR MITER = p5_instance.MITER MOVE = p5_instance.MOVE MULTIPLY = p5_instance.MULTIPLY NEAREST = p5_instance.NEAREST NORMAL = p5_instance.NORMAL OPAQUE = p5_instance.OPAQUE OPEN = p5_instance.OPEN OPTION = p5_instance.OPTION OVERLAY = p5_instance.OVERLAY P2D = p5_instance.P2D P3D = p5_instance.WEBGL PI = p5_instance.PI PIE = p5_instance.PIE POINTS = p5_instance.POINTS PORTRAIT = p5_instance.PORTRAIT POSTERIZE = p5_instance.POSTERIZE PROJECT = p5_instance.PROJECT QUAD_STRIP = p5_instance.QUAD_STRIP QUADRATIC = p5_instance.QUADRATIC QUADS = p5_instance.QUADS QUARTER_PI = p5_instance.QUARTER_PI RAD_TO_DEG = p5_instance.RAD_TO_DEG RADIANS = p5_instance.RADIANS RADIUS = p5_instance.RADIUS REPEAT = p5_instance.REPEAT REPLACE = p5_instance.REPLACE RETURN = p5_instance.RETURN RGB = p5_instance.RGB RIGHT = p5_instance.RIGHT RIGHT_ARROW = p5_instance.RIGHT_ARROW ROUND = p5_instance.ROUND SCREEN = p5_instance.SCREEN SHIFT = p5_instance.SHIFT SOFT_LIGHT = p5_instance.SOFT_LIGHT SQUARE = p5_instance.SQUARE STROKE = p5_instance.STROKE SUBTRACT = p5_instance.SUBTRACT TAB = p5_instance.TAB TAU = p5_instance.TAU TEXT = p5_instance.TEXT TEXTURE = p5_instance.TEXTURE THRESHOLD = p5_instance.THRESHOLD TOP = p5_instance.TOP TRIANGLE_FAN = p5_instance.TRIANGLE_FAN TRIANGLE_STRIP = p5_instance.TRIANGLE_STRIP TRIANGLES = p5_instance.TRIANGLES TWO_PI = p5_instance.TWO_PI UP_ARROW = p5_instance.UP_ARROW VIDEO = p5_instance.VIDEO WAIT = p5_instance.WAIT WEBGL = p5_instance.WEBGL frameCount = p5_instance.frameCount focused = p5_instance.focused displayWidth = p5_instance.displayWidth displayHeight = p5_instance.displayHeight windowWidth = p5_instance.windowWidth windowHeight = p5_instance.windowHeight width = p5_instance.width height = p5_instance.height deviceOrientation = p5_instance.deviceOrientation accelerationX = p5_instance.accelerationX accelerationY = p5_instance.accelerationY accelerationZ = p5_instance.accelerationZ pAccelerationX = p5_instance.pAccelerationX pAccelerationY = p5_instance.pAccelerationY pAccelerationZ = p5_instance.pAccelerationZ rotationX = p5_instance.rotationX rotationY = p5_instance.rotationY rotationZ = p5_instance.rotationZ pRotationX = p5_instance.pRotationX pRotationY = p5_instance.pRotationY pRotationZ = p5_instance.pRotationZ turnAxis = p5_instance.turnAxis keyIsPressed = p5_instance.keyIsPressed key = p5_instance.key keyCode = p5_instance.keyCode mouseX = p5_instance.mouseX mouseY = p5_instance.mouseY pmouseX = p5_instance.pmouseX pmouseY = p5_instance.pmouseY winMouseX = p5_instance.winMouseX winMouseY = p5_instance.winMouseY pwinMouseX = p5_instance.pwinMouseX pwinMouseY = p5_instance.pwinMouseY mouseButton = p5_instance.mouseButton mouseIsPressed = p5_instance.mouseIsPressed touches = p5_instance.touches pixels = p5_instance.pixels return draw_func(*args, **kwargs) def global_p5_injection(p5_sketch): """ Injects the p5js's skecth instance as a global variable to setup and draw functions """ def decorator(f, *args, **kwargs): def wrapper(*args, **kwargs): global _P5_INSTANCE _P5_INSTANCE = p5_sketch return pre_draw(_P5_INSTANCE, f, *args, **kwargs) return wrapper return decorator def start_p5(preload_func, setup_func, draw_func, event_functions): """ This is the entrypoint function. It accepts 2 parameters: - preload_func: A Python preload callable - setup_func: a Python setup callable - draw_func: a Python draw callable - event_functions: a config dict for the event functions in the format: {"eventFunctionName": python_event_function} This method gets the p5js's sketch instance and injects them """ def sketch_setup(p5_sketch): """ Callback function called to configure new p5 instance """ p5_sketch.preload = global_p5_injection(p5_sketch)(preload_func) p5_sketch.setup = global_p5_injection(p5_sketch)(setup_func) p5_sketch.draw = global_p5_injection(p5_sketch)(draw_func) window.instance = p5.new(sketch_setup, 'sketch-holder') # Register event functions event_function_names = ( "deviceMoved", "deviceTurned", "deviceShaken", "windowResized", "keyPressed", "keyReleased", "keyTyped", "mousePressed", "mouseReleased", "mouseClicked", "doubleClicked", "mouseMoved", "mouseDragged", "mouseWheel", "touchStarted", "touchMoved", "touchEnded", "keyIsDown", ) for f_name in [f for f in event_function_names if event_functions.get(f, None)]: func = event_functions[f_name] event_func = global_p5_injection(window.instance)(func) setattr(window.instance, f_name, event_func) `; const placeholder = ` def preload(): pass def setup(): pass def draw(): pass deviceMoved = None deviceTurned = None deviceShaken = None keyPressed = None keyReleased = None keyTyped = None mouseMoved = None mouseDragged = None mousePressed = None mouseReleased = None mouseClicked = None doubleClicked = None mouseWheel = None touchStarted = None touchMoved = None touchEnded = None windowResized = None `; let userCode = ` def colliderect(im1,im2): x1,y1, w1, h1 = im1.x,im1.y,im1.img.width,im1.img.height x2,y2, w2, h2 = im2.x,im2.y,im2.img.width,im2.img.height return ((x1 < x2 + w2) and (y1 < y2 + h2) and (x1 + w1 > x2) and (y1 + h1 > y2)) def load_image(img_file, im_dir="images",ext="png"): img = loadImage("%s/%s.%s" %(im_dir,img_file,ext)) return img class Actor: def __init__(self,img,x=0,y=0): self.img = load_image(img) self.x = x self.y = y def draw(self): image(self.img,self.x,self.y) WIDTH = 400 HEIGHT = 708 # These constants control the difficulty of the game GAP = 130 GRAVITY = 0.3 FLAP_STRENGTH = 6.5 SPEED = 3 background, bird, pipe_top, pipe_bottom = None, None, None, None bird1, bird2, birddead = None, None, None def setup(): global background, bird, pipe_top, pipe_bottom, bird1, bird2, birddead createCanvas(WIDTH, HEIGHT) noCursor() bird = Actor("bird1",75,200) bird.score = 0 bird.dead = False bird.vy = 0 gap_y = int(random(200, HEIGHT - 200)) pipe_top = Actor("top") pipe_top.x, pipe_top.y = WIDTH, gap_y - GAP // 2 - 500 pipe_bottom = Actor("bottom") pipe_bottom.x, pipe_bottom.y = WIDTH, gap_y + GAP // 2 background = load_image("background") bird1 = load_image("bird1") bird2 = load_image("bird2") birddead = load_image("birddead") image(background,0, 0) bird.draw() pipe_top.draw() pipe_bottom.draw() def draw(): image(background, 0, 0) update_pipes() update_bird() bird.draw() pipe_top.draw() pipe_bottom.draw() fill(255) textSize(24) text("Score: %d" %bird.score, WIDTH-140, 30) def keyPressed(): if keyIsPressed: if not bird.dead: bird.vy = -FLAP_STRENGTH def reset_pipes(create=False): gap_y = int(random(200, HEIGHT - 200)) # anchor - left bottom pipe_top.x, pipe_top.y = WIDTH, gap_y - GAP // 2 - pipe_top.img.height pipe_bottom.x, pipe_bottom.y = WIDTH, gap_y + GAP // 2 def update_pipes(): pipe_top.x -= SPEED pipe_bottom.x -= SPEED if (pipe_top.x < 0): reset_pipes() if not bird.dead: bird.score += 1 def update_bird(): uy = bird.vy bird.vy += GRAVITY bird.y += (uy + bird.vy) / 2 bird.x = 75 if not bird.dead: if bird.vy < -3: bird.img = bird2 else: bird.img = bird1 if colliderect(bird,pipe_top) or colliderect(bird,pipe_bottom): bird.dead = True bird.img = birddead if not (0 < bird.y < HEIGHT + 12): bird.y = 200 bird.dead = False bird.score = bird.vy = 0 reset_pipes() `; const startCode = ` event_functions = { "deviceMoved": deviceMoved, "deviceTurned": deviceTurned, "deviceShaken": deviceShaken, "keyPressed": keyPressed, "keyReleased": keyReleased, "keyTyped": keyTyped, "mouseMoved": mouseMoved, "mouseDragged": mouseDragged, "mousePressed": mousePressed, "mouseReleased": mouseReleased, "mouseClicked": mouseClicked, "doubleClicked": doubleClicked, "mouseWheel": mouseWheel, "touchStarted": touchStarted, "touchMoved": touchMoved, "touchEnded": touchEnded, "windowResized": windowResized, } start_p5(preload, setup, draw, event_functions) `; function runCode() { let code = [ placeholder, userCode, wrapperContent, startCode, ].join('\n'); if (window.instance) { window.instance.canvas.remove(); } console.log("Python execution output:"); window.pyodide.runPython(code); } async function main() { const config = { indexURL : "https://cdn.jsdelivr.net/pyodide/v0.18.1/full/", fullStdLib: false, } window.pyodide = await loadPyodide(config); // Pyodide is now ready to use... console.log(window.pyodide.runPython(` import io, code, sys from js import p5, window, document print(sys.version) `)); window.runSketchCode = (code) => { userCode = code; runCode(); } runCode(); }; // async method main(); ================================================ FILE: docs/examples/pyodide/index.html.template ================================================ {{ sketch_name }} - pyp5js

Python code here.

{{ sketch_content }}
================================================ FILE: docs/examples/pyodide/memory/LICENCE ================================================ The MIT License (MIT) Copyright (c) 2015 Steve Holden Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: docs/examples/pyodide/memory/README.md ================================================ ## “holdenwebs” This game has been played ever since there were cards. I don't know how long that is. As a child I (holdenweb) became aware of the importance of memory by playing games. I used to watch a TV programme called "Picture Book" where one of the regular features showed a scene with about ten objects in it, and then asked you to name all the ones you could remember. Because I was in love with the presenter (I was four, and Patricia Driscoll must have been at least twenty-five) I wanted to do well. This particular game is often played with cards. My mother taught it calling it "Remembrance," but it is also known as "Pairs" and (at least in America) as "Pelmanism." There are probably many other names. It's pretty simple: you click on cards to reveal them until you manage to pair all the cards (I didn't mention there were two of each card in the deck, did I?) #### Game Play The game is played on a rectangular board, with a grid of 200 x 200 "cards". When you click on a card its value is revealed. When you click on a second card the same thing happens, and if the values match they are removed from the game. The object is to match all the cards as quickly as you can. ### Environment This program started out at the June 2015 London Python Dojo, where we were challenged to create programs for the "pygame-zero" environment. [We need to add proper links and so on so someone who just comes across this can find out how to install Python and pygame-zero.] So it should run on most things, but it was originally written on a Macintosh, though it's really targeted at the Raspberry Pi. It's written in Python 3, as all new educational Python programs should be, otherwise where are we going to find the effort to convert all the Python 2? [Evangelism over]. ### Architecture The progam represents the board as a list of lists called `board`. A list calles `STATUS` contains the co-ordinates of clicked cards. A list called `ignore` contains the coordinates of cards that have already been matched in the game and so should be ignored. The game as originally published establishes a list of lists to represent the board. The programmer can change the board size by changing ROWS and COLUMNS, but the will then have to make sure that they make the window the right size (we were lucky the default window appears to be 800 x 600). The `draw()` function clears the screen and then represents each card as * The background image (currently a picture of @holdenweb) if it hasn't been matched or clicked on; * The card value image (stored in the `board` list) if it has been clicked on but not yet matched, or * A checkmark if it has been matched and is therefore no longer in play. The `on_mouse_down()` function is activated when the user clicks a mouse button. It looks at the `STATUS` list to determine how many clicks the player has made this turn so far. If the player has already clicked twice this turn it does nothing, as it is waiting for the turn to be over. Otherwise the card coordinates are added to `STATUS`. If this is the first click, the function then simply returns. If this is the second click, it checks whether the two cells have the same image. If they don't it should play a depressing sound (though at the moment it is boringly silent). If they do then it should (but again doens't) play a cheerful sound, and adds both cells to the `ignore` list so they cannot be selected in subsequent turns. Finally it sets a two-second timeout so the player can see what happened. The rest of the code just supports the functions described above. ### Status The game as it stands is functionally complete but minimally playable. The logic is intended to be simple and incomplete enough to it to be fun for players to extend as they wish. Some suggestions are listed below. ## Opportunities for Developer Players The game has no sound effects, though `print` calls indicate where the sounds should be emitted. This is a rewarding way to change the game since at the moment it seems boring even to me. There is no fanfare of trumpets when all cards are matched. The program just continues to sit there. It doesn't even terminate, which would be logical once there is nothing more the player can achieve. There is no instrumentation or scoring, which would be a major way to add positive feedback for the player. At the moment we select the cards on the board using `board[row][col]`. It would be relatively easy to use a dict and use tuples as indexes, allowing the use of `board[row, col]` instead. A player familiar with Python might enjoy trying that as an alternative. When two cards are matched they currently turn checked immediately. It would be better if the player actually saw the matching cards for a while before play continued. The graphics are unexciting, and those with an interest in such matters should find it easy to replace the images with something that suits their taste better. The programming world needs more people with a good sense of visual design. You only have to look at the current graphics to see that as a graphic artist I am quite a respectable plumber. It's easy to adjust the timings of things, but it would be even easier if the values were _manifest constants_ the same as ROWS and COLS, and this would make the program logic easier to understand. ================================================ FILE: docs/examples/pyodide/memory/index.html ================================================ memory - pyp5js

Python code here.

import random

def load_image(img_file, im_dir="images",ext="png"):
    img = loadImage("%s/%s.%s" %(im_dir,img_file,ext))    
    return img
     
class Actor:
    def __init__(self,img,x=0,y=0):
        self.img = load_image(img)
        self.x = x
        self.y = y

    def draw(self):
        image(self.img,self.x,self.y)

COLS = 4
ROWS= 3
IMSIZE = 200

STATUS = []        # cells that have been clicked on
ignore = []        # cells that have been matches and are no longer in play

# Create two of each card image, then randomize before creating the board
START_IMAGES= [ "im"+str(i+1) for i in range(COLS*ROWS//2)]*2
random.shuffle(START_IMAGES)


board = []                    # initialize the board

steve = None
checkmark = None

def setup():
    global steve, checkmark
    checkmark = Actor('checkmark')
    steve = Actor('card_back')
    steve.x, steve.y = 0, 0

    for row in range(ROWS):
        new_row=[]
        for col in range(COLS):
            image_name = START_IMAGES.pop()
            temp=Actor(image_name, col*IMSIZE, row*IMSIZE)
            temp.image_name = image_name # used to verify matches
            new_row.append(temp)
        board.append(new_row)
        createCanvas(COLS * IMSIZE, ROWS * IMSIZE)
        
def draw():
    background(200)
    for row in range(ROWS):
        for col in range(COLS):
            if (row, col) in ignore:    # already matched
                checkmark.x, checkmark.y = IMSIZE * col, IMSIZE * row
                checkmark.draw()
            elif (row, col) in STATUS:    # clicked this move: show face
                board[row][col].draw()
            else:                        # regular clickable card
                steve.x, steve.y = IMSIZE * col, IMSIZE * row
                steve.draw()

def findTile(pos):
    y, x = pos
    result = x // IMSIZE , y // IMSIZE
    return result


def mousePressed():
    global STATUS, ignore
    if len(STATUS) == 2:
        STATUS = []
    pos = (mouseX, mouseY)    
    if pos in ignore: # has already been matched
        return
    if mouseButton == LEFT:
        coords = findTile(pos)
        xc, yc = coords
        if not ((0 <= xc < ROWS) and (0 <= yc < COLS)):
            return
        if coords not in STATUS:
            STATUS.append(coords) # now they are
            if len(STATUS) == 1:  # 1st click - turn not yet over
                pass
            elif len(STATUS) == 2: # 2nd click - check for match
                (x1, y1), (x2, y2) = STATUS
                if board[x1][y1].image_name == board[x2][y2].image_name:
                    for pos in STATUS:
                        ignore.append(pos)

================================================ FILE: docs/examples/pyodide/memory/memory.py ================================================ import random def load_image(img_file, im_dir="images",ext="png"): img = loadImage("%s/%s.%s" %(im_dir,img_file,ext)) return img class Actor: def __init__(self,img,x=0,y=0): self.img = load_image(img) self.x = x self.y = y def draw(self): image(self.img,self.x,self.y) COLS = 4 ROWS= 3 IMSIZE = 200 STATUS = [] # cells that have been clicked on ignore = [] # cells that have been matches and are no longer in play # Create two of each card image, then randomize before creating the board START_IMAGES= [ "im"+str(i+1) for i in range(COLS*ROWS//2)]*2 random.shuffle(START_IMAGES) board = [] # initialize the board steve = None checkmark = None def setup(): global steve, checkmark checkmark = Actor('checkmark') steve = Actor('card_back') steve.x, steve.y = 0, 0 for row in range(ROWS): new_row=[] for col in range(COLS): image_name = START_IMAGES.pop() temp=Actor(image_name, col*IMSIZE, row*IMSIZE) temp.image_name = image_name # used to verify matches new_row.append(temp) board.append(new_row) createCanvas(COLS * IMSIZE, ROWS * IMSIZE) def draw(): background(200) for row in range(ROWS): for col in range(COLS): if (row, col) in ignore: # already matched checkmark.x, checkmark.y = IMSIZE * col, IMSIZE * row checkmark.draw() elif (row, col) in STATUS: # clicked this move: show face board[row][col].draw() else: # regular clickable card steve.x, steve.y = IMSIZE * col, IMSIZE * row steve.draw() def findTile(pos): y, x = pos result = x // IMSIZE , y // IMSIZE return result def mousePressed(): global STATUS, ignore if len(STATUS) == 2: STATUS = [] pos = (mouseX, mouseY) if pos in ignore: # has already been matched return if mouseButton == LEFT: coords = findTile(pos) xc, yc = coords if not ((0 <= xc < ROWS) and (0 <= yc < COLS)): return if coords not in STATUS: STATUS.append(coords) # now they are if len(STATUS) == 1: # 1st click - turn not yet over pass elif len(STATUS) == 2: # 2nd click - check for match (x1, y1), (x2, y2) = STATUS if board[x1][y1].image_name == board[x2][y2].image_name: for pos in STATUS: ignore.append(pos) ================================================ FILE: docs/examples/pyodide/memory/static/p5.js ================================================ /*! p5.js v1.0.0 February 29, 2020 */ !function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).p5=e()}}(function(){return function o(a,s,l){function u(t,e){if(!s[t]){if(!a[t]){var r="function"==typeof require&&require;if(!e&&r)return r(t,!0);if(h)return h(t,!0);var i=new Error("Cannot find module '"+t+"'");throw i.code="MODULE_NOT_FOUND",i}var n=s[t]={exports:{}};a[t][0].call(n.exports,function(e){return u(a[t][1][e]||e)},n,n.exports,o,a,s,l)}return s[t].exports}for(var h="function"==typeof require&&require,e=0;e>16&255,a[s++]=t>>8&255,a[s++]=255&t;2===o&&(t=u[e.charCodeAt(r)]<<2|u[e.charCodeAt(r+1)]>>4,a[s++]=255&t);1===o&&(t=u[e.charCodeAt(r)]<<10|u[e.charCodeAt(r+1)]<<4|u[e.charCodeAt(r+2)]>>2,a[s++]=t>>8&255,a[s++]=255&t);return a},r.fromByteArray=function(e){for(var t,r=e.length,i=r%3,n=[],o=0,a=r-i;o>2]+s[t<<4&63]+"==")):2==i&&(t=(e[r-2]<<8)+e[r-1],n.push(s[t>>10]+s[t>>4&63]+s[t<<2&63]+"="));return n.join("")};for(var s=[],u=[],h="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=0,o=i.length;n>18&63]+s[n>>12&63]+s[n>>6&63]+s[63&n]);return o.join("")}u["-".charCodeAt(0)]=62,u["_".charCodeAt(0)]=63},{}],20:[function(e,t,r){},{}],21:[function(N,e,F){(function(c){"use strict";var i=N("base64-js"),o=N("ieee754"),e="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;F.Buffer=c,F.SlowBuffer=function(e){+e!=e&&(e=0);return c.alloc(+e)},F.INSPECT_MAX_BYTES=50;var r=2147483647;function a(e){if(r>>1;case"base64":return O(e).length;default:if(n)return i?-1:R(e).length;t=(""+t).toLowerCase(),n=!0}}function d(e,t,r){var i=e[t];e[t]=e[r],e[r]=i}function p(e,t,r,i,n){if(0===e.length)return-1;if("string"==typeof r?(i=r,r=0):2147483647=e.length){if(n)return-1;r=e.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof t&&(t=c.from(t,i)),c.isBuffer(t))return 0===t.length?-1:m(e,t,r,i,n);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):m(e,[t],r,i,n);throw new TypeError("val must be string, number or Buffer")}function m(e,t,r,i,n){var o,a=1,s=e.length,l=t.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(e.length<2||t.length<2)return-1;s/=a=2,l/=2,r/=2}function u(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(n){var h=-1;for(o=r;o>8,n=r%256,o.push(n),o.push(i);return o}(t,e.length-r),e,r,i)}function b(e,t,r){return 0===t&&r===e.length?i.fromByteArray(e):i.fromByteArray(e.slice(t,r))}function _(e,t,r){r=Math.min(e.length,r);for(var i=[],n=t;n>>10&1023|55296),h=56320|1023&h),i.push(h),n+=c}return function(e){var t=e.length;if(t<=x)return String.fromCharCode.apply(String,e);var r="",i=0;for(;ithis.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e=e||"utf8";;)switch(e){case"hex":return M(this,t,r);case"utf8":case"utf-8":return _(this,t,r);case"ascii":return w(this,t,r);case"latin1":case"binary":return S(this,t,r);case"base64":return b(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,t,r);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}.apply(this,arguments)},c.prototype.equals=function(e){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===c.compare(this,e)},c.prototype.inspect=function(){var e="",t=F.INSPECT_MAX_BYTES;return e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(e+=" ... "),""},e&&(c.prototype[e]=c.prototype.inspect),c.prototype.compare=function(e,t,r,i,n){if(A(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),t<0||r>e.length||i<0||n>this.length)throw new RangeError("out of range index");if(n<=i&&r<=t)return 0;if(n<=i)return-1;if(r<=t)return 1;if(this===e)return 0;for(var o=(n>>>=0)-(i>>>=0),a=(r>>>=0)-(t>>>=0),s=Math.min(o,a),l=this.slice(i,n),u=e.slice(t,r),h=0;h>>=0,isFinite(r)?(r>>>=0,void 0===i&&(i="utf8")):(i=r,r=void 0)}var n=this.length-t;if((void 0===r||nthis.length)throw new RangeError("Attempt to write outside buffer bounds");i=i||"utf8";for(var o,a,s,l,u,h,c=!1;;)switch(i){case"hex":return g(this,e,t,r);case"utf8":case"utf-8":return u=t,h=r,D(R(e,(l=this).length-u),l,u,h);case"ascii":return v(this,e,t,r);case"latin1":case"binary":return v(this,e,t,r);case"base64":return o=this,a=t,s=r,D(O(e),o,a,s);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return y(this,e,t,r);default:if(c)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),c=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var x=4096;function w(e,t,r){var i="";r=Math.min(e.length,r);for(var n=t;ne.length)throw new RangeError("Index out of range")}function P(e,t,r,i){if(r+i>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function L(e,t,r,i,n){return t=+t,r>>>=0,n||P(e,0,r,4),o.write(e,t,r,i,23,4),r+4}function k(e,t,r,i,n){return t=+t,r>>>=0,n||P(e,0,r,8),o.write(e,t,r,i,52,8),r+8}c.prototype.slice=function(e,t){var r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):r>>=0,t>>>=0,r||T(e,t,this.length);for(var i=this[e],n=1,o=0;++o>>=0,t>>>=0,r||T(e,t,this.length);for(var i=this[e+--t],n=1;0>>=0,t||T(e,1,this.length),this[e]},c.prototype.readUInt16LE=function(e,t){return e>>>=0,t||T(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUInt16BE=function(e,t){return e>>>=0,t||T(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUInt32LE=function(e,t){return e>>>=0,t||T(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUInt32BE=function(e,t){return e>>>=0,t||T(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||T(e,t,this.length);for(var i=this[e],n=1,o=0;++o>>=0,t>>>=0,r||T(e,t,this.length);for(var i=t,n=1,o=this[e+--i];0>>=0,t||T(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){e>>>=0,t||T(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(e,t){e>>>=0,t||T(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(e,t){return e>>>=0,t||T(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return e>>>=0,t||T(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readFloatLE=function(e,t){return e>>>=0,t||T(e,4,this.length),o.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return e>>>=0,t||T(e,4,this.length),o.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return e>>>=0,t||T(e,8,this.length),o.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return e>>>=0,t||T(e,8,this.length),o.read(this,e,!1,52,8)},c.prototype.writeUIntLE=function(e,t,r,i){e=+e,t>>>=0,r>>>=0,i||C(this,e,t,r,Math.pow(2,8*r)-1,0);var n=1,o=0;for(this[t]=255&e;++o>>=0,r>>>=0,i||C(this,e,t,r,Math.pow(2,8*r)-1,0);var n=r-1,o=1;for(this[t+n]=255&e;0<=--n&&(o*=256);)this[t+n]=e/o&255;return t+r},c.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,1,255,0),this[t]=255&e,t+1},c.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},c.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeIntLE=function(e,t,r,i){if(e=+e,t>>>=0,!i){var n=Math.pow(2,8*r-1);C(this,e,t,r,n-1,-n)}var o=0,a=1,s=0;for(this[t]=255&e;++o>0)-s&255;return t+r},c.prototype.writeIntBE=function(e,t,r,i){if(e=+e,t>>>=0,!i){var n=Math.pow(2,8*r-1);C(this,e,t,r,n-1,-n)}var o=r-1,a=1,s=0;for(this[t+o]=255&e;0<=--o&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+r},c.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},c.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeFloatLE=function(e,t,r){return L(this,e,t,!0,r)},c.prototype.writeFloatBE=function(e,t,r){return L(this,e,t,!1,r)},c.prototype.writeDoubleLE=function(e,t,r){return k(this,e,t,!0,r)},c.prototype.writeDoubleBE=function(e,t,r){return k(this,e,t,!1,r)},c.prototype.copy=function(e,t,r,i){if(!c.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r=r||0,i||0===i||(i=this.length),t>=e.length&&(t=e.length),t=t||0,0=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t>>=0,r=void 0===r?this.length:r>>>0,"number"==typeof(e=e||0))for(o=t;o>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function O(e){return i.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(t,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function D(e,t,r,i){for(var n=0;n=t.length||n>=e.length);++n)t[n+r]=e[n];return n}function A(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function I(e){return e!=e}var U=function(){for(var e="0123456789abcdef",t=new Array(256),r=0;r<16;++r)for(var i=16*r,n=0;n<16;++n)t[i+n]=e[r]+e[n];return t}()}).call(this,N("buffer").Buffer)},{"base64-js":19,buffer:21,ieee754:30}],22:[function(e,t,r){"use strict";t.exports=e("./").polyfill()},{"./":23}],23:[function(z,r,i){(function(j,V){var e,t;e=this,t=function(){"use strict";function l(e){return"function"==typeof e}var r=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},i=0,t=void 0,n=void 0,a=function(e,t){f[i]=e,f[i+1]=t,2===(i+=2)&&(n?n(d):y())};var e="undefined"!=typeof window?window:void 0,o=e||{},s=o.MutationObserver||o.WebKitMutationObserver,u="undefined"==typeof self&&void 0!==j&&"[object process]"==={}.toString.call(j),h="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function c(){var e=setTimeout;return function(){return e(d,1)}}var f=new Array(1e3);function d(){for(var e=0;e":">",'"':""","'":"'","/":"/"};function S(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,function(e){return w[e]}):e}var M=function(){function i(e){var t,r=1=this.maxReplaces)break}for(a=0;r=this.regexp.exec(e);){if(void 0===(i=h(r[1].trim())))if("function"==typeof c){var d=c(e,r,t);i="string"==typeof d?d:""}else this.logger.warn("missed to pass in variable ".concat(r[1]," for interpolating ").concat(e)),i="";else"string"==typeof i||this.useRawValueToEscape||(i=v(i));if(i=this.escapeValue?u(this.escape(i)):u(i),e=e.replace(r[0],i),this.regexp.lastIndex=0,++a>=this.maxReplaces)break}return e}},{key:"nest",value:function(e,t,r){var i,n,o=D({},2>1,h=-7,c=r?n-1:0,f=r?-1:1,d=e[t+c];for(c+=f,o=d&(1<<-h)-1,d>>=-h,h+=s;0>=-h,h+=i;0>1,f=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,d=i?0:o-1,p=i?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=h):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),2<=(t+=1<=a+c?f/l:f*Math.pow(2,1-c))*l&&(a++,l/=2),h<=a+c?(s=0,a=h):1<=a+c?(s=(t*l-1)*Math.pow(2,n),a+=c):(s=t*Math.pow(2,c-1)*Math.pow(2,n),a=0));8<=n;e[r+d]=255&s,d+=p,s/=256,n-=8);for(a=a<Math.abs(e[0])&&(t=1),Math.abs(e[2])>Math.abs(e[t])&&(t=2),t}var C=4e150;function P(e,t){e.f+=t.f,e.b.f+=t.b.f}function u(e,t,r){return e=e.a,t=t.a,r=r.a,t.b.a===e?r.b.a===e?v(t.a,r.a)?b(r.b.a,t.a,r.a)<=0:0<=b(t.b.a,r.a,t.a):b(r.b.a,e,r.a)<=0:r.b.a===e?0<=b(t.b.a,e,t.a):(t=y(t.b.a,e,t.a),(e=y(r.b.a,e,r.a))<=t)}function L(e){e.a.i=null;var t=e.e;t.a.c=t.c,t.c.a=t.a,e.e=null}function h(e,t){c(e.a),e.c=!1,(e.a=t).i=e}function k(e){for(var t=e.a.a;(e=fe(e)).a.a===t;);return e.c&&(h(e,t=f(ce(e).a.b,e.a.e)),e=fe(e)),e}function R(e,t,r){var i=new he;return i.a=r,i.e=W(e.f,t.e,i),r.i=i}function O(e,t){switch(e.s){case 100130:return 0!=(1&t);case 100131:return 0!==t;case 100132:return 0>1]],s[a[u]])?le(r,u):ue(r,u)),s[o]=null,l[o]=r.b,r.b=o}else for(r.c[-(o+1)]=null;0Math.max(a.a,l.a))return!1;if(v(o,a)){if(0i.f&&(i.f*=2,i.c=oe(i.c,i.f+1)),0===i.b?r=n:(r=i.b,i.b=i.c[i.b]),i.e[r]=t,i.c[r]=n,i.d[n]=r,i.h&&ue(i,n),r}return i=e.a++,e.c[i]=t,-(i+1)}function ie(e){if(0===e.a)return se(e.b);var t=e.c[e.d[e.a-1]];if(0!==e.b.a&&v(ae(e.b),t))return se(e.b);for(;--e.a,0e.a||v(i[a],i[l])){n[r[o]=a]=o;break}n[r[o]=l]=o,o=s}}function ue(e,t){for(var r=e.d,i=e.e,n=e.c,o=t,a=r[o];;){var s=o>>1,l=r[s];if(0==s||v(i[l],i[a])){n[r[o]=a]=o;break}n[r[o]=l]=o,o=s}}function he(){this.e=this.a=null,this.f=0,this.c=this.b=this.h=this.d=!1}function ce(e){return e.e.c.b}function fe(e){return e.e.a.b}(i=q.prototype).x=function(){Y(this,0)},i.B=function(e,t){switch(e){case 100142:return;case 100140:switch(t){case 100130:case 100131:case 100132:case 100133:case 100134:return void(this.s=t)}break;case 100141:return void(this.m=!!t);default:return void Z(this,100900)}Z(this,100901)},i.y=function(e){switch(e){case 100142:return 0;case 100140:return this.s;case 100141:return this.m;default:Z(this,100900)}return!1},i.A=function(e,t,r){this.j[0]=e,this.j[1]=t,this.j[2]=r},i.z=function(e,t){var r=t||null;switch(e){case 100100:case 100106:this.h=r;break;case 100104:case 100110:this.l=r;break;case 100101:case 100107:this.k=r;break;case 100102:case 100108:this.i=r;break;case 100103:case 100109:this.p=r;break;case 100105:case 100111:this.o=r;break;case 100112:this.r=r;break;default:Z(this,100900)}},i.C=function(e,t){var r=!1,i=[0,0,0];Y(this,2);for(var n=0;n<3;++n){var o=e[n];o<-1e150&&(o=-1e150,r=!0),1e150n[u]&&(n[u]=h,a[u]=l)}if(l=0,n[1]-o[1]>n[0]-o[0]&&(l=1),n[2]-o[2]>n[l]-o[l]&&(l=2),o[l]>=n[l])i[0]=0,i[1]=0,i[2]=1;else{for(n=0,o=s[l],a=a[l],s=[0,0,0],o=[o.g[0]-a.g[0],o.g[1]-a.g[1],o.g[2]-a.g[2]],u=[0,0,0],l=r.e;l!==r;l=l.e)u[0]=l.g[0]-a.g[0],u[1]=l.g[1]-a.g[1],u[2]=l.g[2]-a.g[2],s[0]=o[1]*u[2]-o[2]*u[1],s[1]=o[2]*u[0]-o[0]*u[2],s[2]=o[0]*u[1]-o[1]*u[0],n<(h=s[0]*s[0]+s[1]*s[1]+s[2]*s[2])&&(n=h,i[0]=s[0],i[1]=s[1],i[2]=s[2]);n<=0&&(i[0]=i[1]=i[2]=0,i[T(o)]=1)}r=!0}for(s=T(i),l=this.b.c,n=(s+1)%3,a=(s+2)%3,s=0>=l,h-=l,g!=o){if(g==a)break;for(var v=g>8,++y;var _=b;if(i>=8;null!==m&&s<4096&&(p[s++]=m<<8|_,u+1<=s&&l<12&&(++l,u=u<<1|1)),m=g}else s=1+a,u=(1<<(l=n+1))-1,m=null}return f!==i&&console.log("Warning, gif stream shorter than expected."),r}try{r.GifWriter=function(v,e,t,r){var y=0,i=void 0===(r=void 0===r?{}:r).loop?null:r.loop,b=void 0===r.palette?null:r.palette;if(e<=0||t<=0||65535>=1;)++n;if(a=1<>8&255,v[y++]=255&t,v[y++]=t>>8&255,v[y++]=(null!==b?128:0)|n,v[y++]=o,v[y++]=0,null!==b)for(var s=0,l=b.length;s>16&255,v[y++]=u>>8&255,v[y++]=255&u}if(null!==i){if(i<0||65535>8&255,v[y++]=0}var x=!1;this.addFrame=function(e,t,r,i,n,o){if(!0===x&&(--y,x=!1),o=void 0===o?{}:o,e<0||t<0||65535>=1;)++u;l=1<>8&255,v[y++]=d,v[y++]=0),v[y++]=44,v[y++]=255&e,v[y++]=e>>8&255,v[y++]=255&t,v[y++]=t>>8&255,v[y++]=255&r,v[y++]=r>>8&255,v[y++]=255&i,v[y++]=i>>8&255,v[y++]=!0===a?128|u-1:0,!0===a)for(var p=0,m=s.length;p>16&255,v[y++]=g>>8&255,v[y++]=255&g}return y=function(t,r,e,i){t[r++]=e;var n=r++,o=1<>=8,h-=8,r===n+256&&(t[n]=255,n=r++)}function d(e){c|=e<>=8,h-=8,r===n+256&&(t[n]=255,n=r++);4096===l?(d(o),l=1+s,u=e+1,m={}):(1<>7,n=1<<1+(7&r);x[e++],x[e++];var o=null,a=null;i&&(o=e,e+=3*(a=n));var s=!0,l=[],u=0,h=null,c=0,f=null;for(this.width=w,this.height=t;s&&e>2&7,e++;break;case 254:for(;;){if(!(0<=(C=x[e++])))throw Error("Invalid block size");if(0===C)break;e+=C}break;default:throw new Error("Unknown graphic control label: 0x"+x[e-1].toString(16))}break;case 44:var p=x[e++]|x[e++]<<8,m=x[e++]|x[e++]<<8,g=x[e++]|x[e++]<<8,v=x[e++]|x[e++]<<8,y=x[e++],b=y>>6&1,_=1<<1+(7&y),S=o,M=a,E=!1;if(y>>7){E=!0;S=e,e+=3*(M=_)}var T=e;for(e++;;){var C;if(!(0<=(C=x[e++])))throw Error("Invalid block size");if(0===C)break;e+=C}l.push({x:p,y:m,width:g,height:v,has_local_palette:E,palette_offset:S,palette_size:M,data_offset:T,data_length:e-T,transparent_index:h,interlaced:!!b,delay:u,disposal:c});break;case 59:s=!1;break;default:throw new Error("Unknown gif block: 0x"+x[e-1].toString(16))}this.numFrames=function(){return l.length},this.loopCount=function(){return f},this.frameInfo=function(e){if(e<0||e>=l.length)throw new Error("Frame index out of range.");return l[e]},this.decodeAndBlitFrameBGRA=function(e,t){var r=this.frameInfo(e),i=r.width*r.height,n=new Uint8Array(i);P(x,r.data_offset,n,i);var o=r.palette_offset,a=r.transparent_index;null===a&&(a=256);var s=r.width,l=w-s,u=s,h=4*(r.y*w+r.x),c=4*((r.y+r.height)*w+r.x),f=h,d=4*l;!0===r.interlaced&&(d+=4*w*7);for(var p=8,m=0,g=n.length;m>=1)),v===a)f+=4;else{var y=x[o+3*v],b=x[o+3*v+1],_=x[o+3*v+2];t[f++]=_,t[f++]=b,t[f++]=y,t[f++]=255}--u}},this.decodeAndBlitFrameRGBA=function(e,t){var r=this.frameInfo(e),i=r.width*r.height,n=new Uint8Array(i);P(x,r.data_offset,n,i);var o=r.palette_offset,a=r.transparent_index;null===a&&(a=256);var s=r.width,l=w-s,u=s,h=4*(r.y*w+r.x),c=4*((r.y+r.height)*w+r.x),f=h,d=4*l;!0===r.interlaced&&(d+=4*w*7);for(var p=8,m=0,g=n.length;m>=1)),v===a)f+=4;else{var y=x[o+3*v],b=x[o+3*v+1],_=x[o+3*v+2];t[f++]=y,t[f++]=b,t[f++]=_,t[f++]=255}--u}}}}catch(e){}},{}],33:[function(jr,t,r){(function(Gr){var e;e=this,function(E){"use strict";function e(e){if(null==this)throw TypeError();var t=String(this),r=t.length,i=e?Number(e):0;if(i!=i&&(i=0),!(i<0||r<=i)){var n,o=t.charCodeAt(i);return 55296<=o&&o<=56319&&i+1>>=1,t}function _(e,t,r){if(!t)return r;for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<>>16-t;return e.tag>>>=t,e.bitcount-=t,i+r}function x(e,t){for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<>>=1,++n,r+=t.table[n],0<=(i-=t.table[n]););return e.tag=o,e.bitcount-=n,t.trans[r+i]}function w(e,t,r){var i,n,o,a,s,l;for(i=_(e,5,257),n=_(e,5,1),o=_(e,4,4),a=0;a<19;++a)g[a]=0;for(a=0;athis.x2&&(this.x2=e)),"number"==typeof t&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=t,this.y2=t),tthis.y2&&(this.y2=t))},C.prototype.addX=function(e){this.addPoint(e,null)},C.prototype.addY=function(e){this.addPoint(null,e)},C.prototype.addBezier=function(e,t,r,i,n,o,a,s){var l=this,u=[e,t],h=[r,i],c=[n,o],f=[a,s];this.addPoint(e,t),this.addPoint(a,s);for(var d=0;d<=1;d++){var p=6*u[d]-12*h[d]+6*c[d],m=-3*u[d]+9*h[d]-9*c[d]+3*f[d],g=3*h[d]-3*u[d];if(0!=m){var v=Math.pow(p,2)-4*g*m;if(!(v<0)){var y=(-p+Math.sqrt(v))/(2*m);0>8&255,255&e]},A.USHORT=U(2),D.SHORT=function(e){return 32768<=e&&(e=-(65536-e)),[e>>8&255,255&e]},A.SHORT=U(2),D.UINT24=function(e){return[e>>16&255,e>>8&255,255&e]},A.UINT24=U(3),D.ULONG=function(e){return[e>>24&255,e>>16&255,e>>8&255,255&e]},A.ULONG=U(4),D.LONG=function(e){return R<=e&&(e=-(2*R-e)),[e>>24&255,e>>16&255,e>>8&255,255&e]},A.LONG=U(4),D.FIXED=D.ULONG,A.FIXED=A.ULONG,D.FWORD=D.SHORT,A.FWORD=A.SHORT,D.UFWORD=D.USHORT,A.UFWORD=A.USHORT,D.LONGDATETIME=function(e){return[0,0,0,0,e>>24&255,e>>16&255,e>>8&255,255&e]},A.LONGDATETIME=U(8),D.TAG=function(e){return k.argument(4===e.length,"Tag should be exactly 4 ASCII characters."),[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]},A.TAG=U(4),D.Card8=D.BYTE,A.Card8=A.BYTE,D.Card16=D.USHORT,A.Card16=A.USHORT,D.OffSize=D.BYTE,A.OffSize=A.BYTE,D.SID=D.USHORT,A.SID=A.USHORT,D.NUMBER=function(e){return-107<=e&&e<=107?[e+139]:108<=e&&e<=1131?[247+((e-=108)>>8),255&e]:-1131<=e&&e<=-108?[251+((e=-e-108)>>8),255&e]:-32768<=e&&e<=32767?D.NUMBER16(e):D.NUMBER32(e)},A.NUMBER=function(e){return D.NUMBER(e).length},D.NUMBER16=function(e){return[28,e>>8&255,255&e]},A.NUMBER16=U(3),D.NUMBER32=function(e){return[29,e>>24&255,e>>16&255,e>>8&255,255&e]},A.NUMBER32=U(5),D.REAL=function(e){var t=e.toString(),r=/\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec(t);if(r){var i=parseFloat("1e"+((r[2]?+r[2]:0)+r[1].length));t=(Math.round(e*i)/i).toString()}for(var n="",o=0,a=t.length;o>8&255,t[t.length]=255&i}return t},A.UTF16=function(e){return 2*e.length};var N={"x-mac-croatian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈ƫȅ ÀÃÕŒœĐ—“”‘’÷◊©⁄€‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ","x-mac-cyrillic":"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю","x-mac-gaelic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØḂ±≤≥ḃĊċḊḋḞḟĠġṀæøṁṖṗɼƒſṠ«»… ÀÃÕŒœ–—“”‘’ṡẛÿŸṪ€‹›Ŷŷṫ·Ỳỳ⁊ÂÊÁËÈÍÎÏÌÓÔ♣ÒÚÛÙıÝýŴŵẄẅẀẁẂẃ","x-mac-greek":"Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦€ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ­","x-mac-icelandic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüݰ¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-inuit":"ᐃᐄᐅᐆᐊᐋᐱᐲᐳᐴᐸᐹᑉᑎᑏᑐᑑᑕᑖᑦᑭᑮᑯᑰᑲᑳᒃᒋᒌᒍᒎᒐᒑ°ᒡᒥᒦ•¶ᒧ®©™ᒨᒪᒫᒻᓂᓃᓄᓅᓇᓈᓐᓯᓰᓱᓲᓴᓵᔅᓕᓖᓗᓘᓚᓛᓪᔨᔩᔪᔫᔭ… ᔮᔾᕕᕖᕗ–—“”‘’ᕘᕙᕚᕝᕆᕇᕈᕉᕋᕌᕐᕿᖀᖁᖂᖃᖄᖅᖏᖐᖑᖒᖓᖔᖕᙱᙲᙳᙴᙵᙶᖖᖠᖡᖢᖣᖤᖥᖦᕼŁł","x-mac-ce":"ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ",macintosh:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-romanian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂȘ∞±≤≥¥µ∂∑∏π∫ªºΩăș¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›Țț‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-turkish":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙˆ˜¯˘˙˚¸˝˛ˇ"};O.MACSTRING=function(e,t,r,i){var n=N[i];if(void 0!==n){for(var o="",a=0;a>8&255,l+256&255)}return o}D.MACSTRING=function(e,t){var r=function(e){if(!F)for(var t in F={},N)F[t]=new String(t);var r=F[e];if(void 0!==r){if(B){var i=B.get(r);if(void 0!==i)return i}var n=N[e];if(void 0!==n){for(var o={},a=0;a>8,t[c+1]=255&f,t=t.concat(i[h])}return t},A.TABLE=function(e){for(var t=0,r=e.fields.length,i=0;i>1,t.skip("uShort",3),e.glyphIndexMap={};for(var a=new se.Parser(r,i+n+14),s=new se.Parser(r,i+n+16+2*o),l=new se.Parser(r,i+n+16+4*o),u=new se.Parser(r,i+n+16+6*o),h=i+n+16+8*o,c=0;c>4,o=15&i;if(15==n)break;if(t+=r[n],15==o)break;t+=r[o]}return parseFloat(t)}(e);if(32<=t&&t<=246)return t-139;if(247<=t&&t<=250)return 256*(t-247)+e.parseByte()+108;if(251<=t&&t<=254)return 256*-(t-251)-e.parseByte()-108;throw new Error("Invalid b0 "+t)}function Te(e,t,r){t=void 0!==t?t:0;var i=new se.Parser(e,t),n=[],o=[];for(r=void 0!==r?r:e.length;i.relativeOffset>1,T.length=0,P=!0}return function e(t){for(var r,i,n,o,a,s,l,u,h,c,f,d,p=0;pMath.abs(d-R)?k=f+T.shift():R=d+T.shift(),E.curveTo(y,b,_,x,l,u),E.curveTo(h,c,f,d,k,R);break;default:console.log("Glyph "+v.index+": unknown operator 1200"+m),T.length=0}break;case 14:0>3;break;case 21:2>16),p+=2;break;case 29:a=T.pop()+g.gsubrsBias,(s=g.gsubrs[a])&&e(s);break;case 30:for(;0=r.begin&&e=fe.length){var a=i.parseChar();r.names.push(i.parseString(a))}break;case 2.5:r.numberOfGlyphs=i.parseUShort(),r.offset=new Array(r.numberOfGlyphs);for(var s=0;st.value.tag?1:-1}),t.fields=t.fields.concat(i),t.fields=t.fields.concat(n),t}function gt(e,t,r){for(var i=0;i 123 are reserved for internal usage");d|=1<>>1,o=e[n].tag;if(o===t)return n;o>>1,o=e[n];if(o===t)return n;o>>1,a=(r=e[o]).start;if(a===t)return r;a(r=e[i-1]).end?0:r}function xt(e,t){this.font=e,this.tableName=t}function wt(e){xt.call(this,e,"gpos")}function St(e){xt.call(this,e,"gsub")}function Mt(e,t){var r=e.length;if(r!==t.length)return!1;for(var i=0;it.points.length-1||i.matchedPoints[1]>n.points.length-1)throw Error("Matched points out of range in "+t.name);var a=t.points[i.matchedPoints[0]],s=n.points[i.matchedPoints[1]],l={xScale:i.xScale,scale01:i.scale01,scale10:i.scale10,yScale:i.yScale,dx:0,dy:0};s=kt([s],l)[0],l.dx=a.x-s.x,l.dy=a.y-s.y,o=kt(n.points,l)}t.points=t.points.concat(o)}}return Rt(t.points)}(wt.prototype=xt.prototype={searchTag:yt,binSearch:bt,getTable:function(e){var t=this.font.tables[this.tableName];return!t&&e&&(t=this.font.tables[this.tableName]=this.createDefaultTable()),t},getScriptNames:function(){var e=this.getTable();return e?e.scripts.map(function(e){return e.tag}):[]},getDefaultScriptName:function(){var e=this.getTable();if(e){for(var t=!1,r=0;r=s[u-1].tag,"Features must be added in alphabetical order."),o={tag:r,feature:{params:0,lookupListIndexes:[]}},s.push(o),a.push(u),o.feature}}},getLookupTables:function(e,t,r,i,n){var o=this.getFeatureTable(e,t,r,n),a=[];if(o){for(var s,l=o.lookupListIndexes,u=this.font.tables[this.tableName].lookups,h=0;h",s),t.stack.push(Math.round(64*s))}function vr(e,t){var r=t.stack,i=r.pop(),n=t.fv,o=t.pv,a=t.ppem,s=t.deltaBase+16*(e-1),l=t.deltaShift,u=t.z0;E.DEBUG&&console.log(t.step,"DELTAP["+e+"]",i,r);for(var h=0;h>4)===a){var d=(15&f)-8;0<=d&&d++,E.DEBUG&&console.log(t.step,"DELTAPFIX",c,"by",d*l);var p=u[c];n.setRelative(p,p,d*l,o)}}}function yr(e,t){var r=t.stack,i=r.pop();E.DEBUG&&console.log(t.step,"ROUND[]"),r.push(64*t.round(i/64))}function br(e,t){var r=t.stack,i=r.pop(),n=t.ppem,o=t.deltaBase+16*(e-1),a=t.deltaShift;E.DEBUG&&console.log(t.step,"DELTAC["+e+"]",i,r);for(var s=0;s>4)===n){var h=(15&u)-8;0<=h&&h++;var c=h*a;E.DEBUG&&console.log(t.step,"DELTACFIX",l,"by",c),t.cvt[l]+=c}}}function _r(e,t){var r,i,n=t.stack,o=n.pop(),a=n.pop(),s=t.z2[o],l=t.z1[a];E.DEBUG&&console.log(t.step,"SDPVTL["+e+"]",o,a),i=e?(r=s.y-l.y,l.x-s.x):(r=l.x-s.x,l.y-s.y),t.dpv=Zt(r,i)}function xr(e,t){var r=t.stack,i=t.prog,n=t.ip;E.DEBUG&&console.log(t.step,"PUSHB["+e+"]");for(var o=0;o":"_")+(i?"R":"_")+(0===n?"Gr":1===n?"Bl":2===n?"Wh":"")+"]",e?c+"("+o.cvt[c]+","+u+")":"",f,"(d =",a,"->",l*s,")"),o.rp1=o.rp0,o.rp2=f,t&&(o.rp0=f)}Ft.prototype.exec=function(e,t){if("number"!=typeof t)throw new Error("Point size is not a number!");if(!(2",i),s.interpolate(c,o,a,l),s.touch(c)}e.loop=1},dr.bind(void 0,0),dr.bind(void 0,1),function(e){for(var t=e.stack,r=e.rp0,i=e.z0[r],n=e.loop,o=e.fv,a=e.pv,s=e.z1;n--;){var l=t.pop(),u=s[l];E.DEBUG&&console.log(e.step,(1=a.width||t>=a.height?[0,0,0,0]:this._getPixel(e,t);var s=new l.default.Image(r,i);return s.canvas.getContext("2d").drawImage(a,e,t,r*o,i*o,0,0,r,i),s},l.default.Renderer.prototype.textLeading=function(e){return"number"==typeof e?(this._setProperty("_textLeading",e),this._pInst):this._textLeading},l.default.Renderer.prototype.textSize=function(e){return"number"==typeof e?(this._setProperty("_textSize",e),this._setProperty("_textLeading",e*y._DEFAULT_LEADMULT),this._applyTextProperties()):this._textSize},l.default.Renderer.prototype.textStyle=function(e){return e?(e!==y.NORMAL&&e!==y.ITALIC&&e!==y.BOLD&&e!==y.BOLDITALIC||this._setProperty("_textStyle",e),this._applyTextProperties()):this._textStyle},l.default.Renderer.prototype.textAscent=function(){return null===this._textAscent&&this._updateTextMetrics(),this._textAscent},l.default.Renderer.prototype.textDescent=function(){return null===this._textDescent&&this._updateTextMetrics(),this._textDescent},l.default.Renderer.prototype.textAlign=function(e,t){return void 0!==e?(this._setProperty("_textAlign",e),void 0!==t&&this._setProperty("_textBaseline",t),this._applyTextProperties()):{horizontal:this._textAlign,vertical:this._textBaseline}},l.default.Renderer.prototype.text=function(e,t,r,i,n){var o,a,s,l,u,h,c,f,d=this._pInst,p=Number.MAX_VALUE;if((this._doFill||this._doStroke)&&void 0!==e){if("string"!=typeof e&&(e=e.toString()),o=(e=e.replace(/(\t)/g," ")).split("\n"),void 0!==i){for(s=f=0;ss.HALF_PI&&e<=3*s.HALF_PI?Math.atan(r/i*Math.tan(e))+s.PI:Math.atan(r/i*Math.tan(e))+s.TWO_PI,t=t<=s.HALF_PI?Math.atan(r/i*Math.tan(t)):t>s.HALF_PI&&t<=3*s.HALF_PI?Math.atan(r/i*Math.tan(t))+s.PI:Math.atan(r/i*Math.tan(t))+s.TWO_PI),tv||Math.abs(this.accelerationY-this.pAccelerationY)>v||Math.abs(this.accelerationZ-this.pAccelerationZ)>v)&&e();var t=this.deviceTurned||window.deviceTurned;if("function"==typeof t){var r=this.rotationX+180,i=this.pRotationX+180,n=c+180;0>>24],i+=x[(16711680&C)>>16],n+=x[(65280&C)>>8],o+=x[255&C],r+=k[_],s++}w[l=T+y]=a/r,S[l]=i/r,M[l]=n/r,E[l]=o/r}T+=d}for(h=(u=-P)*d,b=T=0;b>>16,e[r+1]=(65280&t[i])>>>8,e[r+2]=255&t[i],e[r+3]=(4278190080&t[i])>>>24},O._toImageData=function(e){return e instanceof ImageData?e:e.getContext("2d").getImageData(0,0,e.width,e.height)},O._createImageData=function(e,t){return O._tmpCanvas=document.createElement("canvas"),O._tmpCtx=O._tmpCanvas.getContext("2d"),this._tmpCtx.createImageData(e,t)},O.apply=function(e,t,r){var i=e.getContext("2d"),n=i.getImageData(0,0,e.width,e.height),o=t(n,r);o instanceof ImageData?i.putImageData(o,0,0,0,0,e.width,e.height):i.putImageData(n,0,0,0,0,e.width,e.height)},O.threshold=function(e,t){var r=O._toPixels(e);void 0===t&&(t=.5);for(var i=Math.floor(255*t),n=0;n>8)/i,r[n+1]=255*(a*t>>8)/i,r[n+2]=255*(s*t>>8)/i}},O.dilate=function(e){for(var t,r,i,n,o,a,s,l,u,h,c,f,d,p,m,g,v,y=O._toPixels(e),b=0,_=y.length?y.length/4:0,x=new Int32Array(_);b<_;)for(r=(t=b)+e.width;b>16&255)+151*(i>>8&255)+28*(255&i))<(m=77*(c>>16&255)+151*(c>>8&255)+28*(255&c))&&(n=c,o=m),o<(p=77*((h=O._getARGB(y,a))>>16&255)+151*(h>>8&255)+28*(255&h))&&(n=h,o=p),o<(g=77*(f>>16&255)+151*(f>>8&255)+28*(255&f))&&(n=f,o=g),o<(v=77*(d>>16&255)+151*(d>>8&255)+28*(255&d))&&(n=d,o=v),x[b++]=n;O._setPixels(y,x)},O.erode=function(e){for(var t,r,i,n,o,a,s,l,u,h,c,f,d,p,m,g,v,y=O._toPixels(e),b=0,_=y.length?y.length/4:0,x=new Int32Array(_);b<_;)for(r=(t=b)+e.width;b>16&255)+151*(c>>8&255)+28*(255&c))<(o=77*(i>>16&255)+151*(i>>8&255)+28*(255&i))&&(n=c,o=m),(p=77*((h=O._getARGB(y,a))>>16&255)+151*(h>>8&255)+28*(255&h))>16&255)+151*(f>>8&255)+28*(255&f))>16&255)+151*(d>>8&255)+28*(255&d))=r){var i=Math.floor(t.timeDisplayed/r);if(t.timeDisplayed=0,t.displayIndex+=i,t.loopCount=Math.floor(t.displayIndex/t.numFrames),null!==t.loopLimit&&t.loopCount>=t.loopLimit)t.playing=!1;else{var n=t.displayIndex%t.numFrames;this.drawingContext.putImageData(t.frames[n].image,0,0),t.displayIndex=n,this.setModified(!0)}}}},n.default.Image.prototype._setProperty=function(e,t){this[e]=t,this.setModified(!0)},n.default.Image.prototype.loadPixels=function(){n.default.Renderer2D.prototype.loadPixels.call(this),this.setModified(!0)},n.default.Image.prototype.updatePixels=function(e,t,r,i){n.default.Renderer2D.prototype.updatePixels.call(this,e,t,r,i),this.setModified(!0)},n.default.Image.prototype.get=function(e,t,r,i){return n.default._validateParameters("p5.Image.get",arguments),n.default.Renderer2D.prototype.get.apply(this,arguments)},n.default.Image.prototype._getPixel=n.default.Renderer2D.prototype._getPixel,n.default.Image.prototype.set=function(e,t,r){n.default.Renderer2D.prototype.set.call(this,e,t,r),this.setModified(!0)},n.default.Image.prototype.resize=function(e,t){0===e&&0===t?(e=this.canvas.width,t=this.canvas.height):0===e?e=this.canvas.width*t/this.canvas.height:0===t&&(t=this.canvas.height*e/this.canvas.width),e=Math.floor(e),t=Math.floor(t);var r=document.createElement("canvas");if(r.width=e,r.height=t,this.gifProperties)for(var i=this.gifProperties,n=function(e,t){for(var r=0,i=0;i/g,">").replace(/"/g,""").replace(/'/g,"'")}function l(e,t){t&&!0!==t&&"true"!==t||(t="");var r="";return(e=e||"untitled")&&e.includes(".")&&(r=e.split(".").pop()),t&&r!==t&&(r=t,e="".concat(e,".").concat(r)),[e,r]}e("../core/error_helpers"),v.default.prototype.loadJSON=function(){for(var e=arguments.length,t=new Array(e),r=0;r"),n.print("");if(n.print(' '),n.print(""),n.print(""),n.print(" "),"0"!==o[0]){n.print(" ");for(var h=0;h".concat(c)),n.print(" ")}n.print(" ")}for(var f=0;f");for(var d=0;d".concat(p)),n.print(" ")}n.print(" ")}n.print("
"),n.print(""),n.print("")}n.close(),n.clear()},v.default.prototype.writeFile=function(e,t,r){var i="application/octet-stream";v.default.prototype._isSafari()&&(i="text/plain");var n=new Blob(e,{type:i});v.default.prototype.downloadFile(n,t,r)},v.default.prototype.downloadFile=function(e,t,r){var i=l(t,r),n=i[0];if(e instanceof Blob)s.default.saveAs(e,n);else{var o=document.createElement("a");if(o.href=e,o.download=n,o.onclick=function(e){var t;t=e,document.body.removeChild(t.target),e.stopPropagation()},o.style.display="none",document.body.appendChild(o),v.default.prototype._isSafari()){var a="Hello, Safari user! To download this file...\n";a+="1. Go to File --\x3e Save As.\n",a+='2. Choose "Page Source" as the Format.\n',a+='3. Name it with this extension: ."'.concat(i[1],'"'),alert(a)}o.click()}},v.default.prototype._checkFileExtension=l,v.default.prototype._isSafari=function(){return 0>>0},getSeed:function(){return t},rand:function(){return(r=(1664525*r+1013904223)%i)/i}});n.setSeed(e),_=new Array(4096);for(var o=0;o<4096;o++)_[o]=n.rand()};var o=n.default;r.default=o},{"../core/main":49}],82:[function(e,t,r){"use strict";function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i,l=(i=e("../core/main"))&&i.__esModule?i:{default:i},o=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==a(e)&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var o=i?Object.getOwnPropertyDescriptor(e,n):null;o&&(o.get||o.set)?Object.defineProperty(r,n,o):r[n]=e[n]}r.default=e,t&&t.set(e,r);return r}(e("../core/constants"));function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}l.default.Vector=function(e,t,r){var i,n,o;o=e instanceof l.default?(this.p5=e,i=t[0]||0,n=t[1]||0,t[2]||0):(i=e||0,n=t||0,r||0),this.x=i,this.y=n,this.z=o},l.default.Vector.prototype.toString=function(){return"p5.Vector Object : [".concat(this.x,", ").concat(this.y,", ").concat(this.z,"]")},l.default.Vector.prototype.set=function(e,t,r){return e instanceof l.default.Vector?(this.x=e.x||0,this.y=e.y||0,this.z=e.z||0):e instanceof Array?(this.x=e[0]||0,this.y=e[1]||0,this.z=e[2]||0):(this.x=e||0,this.y=t||0,this.z=r||0),this},l.default.Vector.prototype.copy=function(){return this.p5?new l.default.Vector(this.p5,[this.x,this.y,this.z]):new l.default.Vector(this.x,this.y,this.z)},l.default.Vector.prototype.add=function(e,t,r){return e instanceof l.default.Vector?(this.x+=e.x||0,this.y+=e.y||0,this.z+=e.z||0):e instanceof Array?(this.x+=e[0]||0,this.y+=e[1]||0,this.z+=e[2]||0):(this.x+=e||0,this.y+=t||0,this.z+=r||0),this};function u(e,t){return 0!==e&&(this.x=this.x%e),0!==t&&(this.y=this.y%t),this}function h(e,t,r){return 0!==e&&(this.x=this.x%e),0!==t&&(this.y=this.y%t),0!==r&&(this.z=this.z%r),this}l.default.Vector.prototype.rem=function(e,t,r){if(e instanceof l.default.Vector){if(Number.isFinite(e.x)&&Number.isFinite(e.y)&&Number.isFinite(e.z)){var i=parseFloat(e.x),n=parseFloat(e.y),o=parseFloat(e.z);h.call(this,i,n,o)}}else if(e instanceof Array)e.every(function(e){return Number.isFinite(e)})&&(2===e.length&&u.call(this,e[0],e[1]),3===e.length&&h.call(this,e[0],e[1],e[2]));else if(1===arguments.length){if(Number.isFinite(e)&&0!==e)return this.x=this.x%e,this.y=this.y%e,this.z=this.z%e,this}else if(2===arguments.length){var a=Array.prototype.slice.call(arguments);a.every(function(e){return Number.isFinite(e)})&&2===a.length&&u.call(this,a[0],a[1])}else if(3===arguments.length){var s=Array.prototype.slice.call(arguments);s.every(function(e){return Number.isFinite(e)})&&3===s.length&&h.call(this,s[0],s[1],s[2])}},l.default.Vector.prototype.sub=function(e,t,r){return e instanceof l.default.Vector?(this.x-=e.x||0,this.y-=e.y||0,this.z-=e.z||0):e instanceof Array?(this.x-=e[0]||0,this.y-=e[1]||0,this.z-=e[2]||0):(this.x-=e||0,this.y-=t||0,this.z-=r||0),this},l.default.Vector.prototype.mult=function(e){return"number"==typeof e&&isFinite(e)?(this.x*=e,this.y*=e,this.z*=e):console.warn("p5.Vector.prototype.mult:","n is undefined or not a finite number"),this},l.default.Vector.prototype.div=function(e){return"number"==typeof e&&isFinite(e)?0===e?console.warn("p5.Vector.prototype.div:","divide by 0"):(this.x/=e,this.y/=e,this.z/=e):console.warn("p5.Vector.prototype.div:","n is undefined or not a finite number"),this},l.default.Vector.prototype.mag=function(){return Math.sqrt(this.magSq())},l.default.Vector.prototype.magSq=function(){var e=this.x,t=this.y,r=this.z;return e*e+t*t+r*r},l.default.Vector.prototype.dot=function(e,t,r){return e instanceof l.default.Vector?this.dot(e.x,e.y,e.z):this.x*(e||0)+this.y*(t||0)+this.z*(r||0)},l.default.Vector.prototype.cross=function(e){var t=this.y*e.z-this.z*e.y,r=this.z*e.x-this.x*e.z,i=this.x*e.y-this.y*e.x;return this.p5?new l.default.Vector(this.p5,[t,r,i]):new l.default.Vector(t,r,i)},l.default.Vector.prototype.dist=function(e){return e.copy().sub(this).mag()},l.default.Vector.prototype.normalize=function(){var e=this.mag();return 0!==e&&this.mult(1/e),this},l.default.Vector.prototype.limit=function(e){var t=this.magSq();return e*e>>0},n.default.prototype.randomSeed=function(e){this._lcgSetSeed(o,e),this._gaussian_previous=!1},n.default.prototype.random=function(e,t){var r;if(n.default._validateParameters("random",arguments),r=null!=this[o]?this._lcg(o):Math.random(),void 0===e)return r;if(void 0===t)return e instanceof Array?e[Math.floor(r*e.length)]:r*e;if(tf){var P=p,L=l,k=u;p=d+f*(s&&d=t&&(r=r.substring(r.length-t,r.length)),r}},n.default.prototype.unhex=function(e){return e instanceof Array?e.map(n.default.prototype.unhex):parseInt("0x".concat(e),16)};var o=n.default;r.default=o},{"../core/main":49}],90:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i,a=(i=e("../core/main"))&&i.__esModule?i:{default:i};function n(e,t,r){var i=e<0,n=i?e.toString().substring(1):e.toString(),o=n.indexOf("."),a=-1!==o?n.substring(0,o):n,s=-1!==o?n.substring(o+1):"",l=i?"-":"";if(void 0!==r){var u="";(-1!==o||0r&&(s=s.substring(0,r));for(var h=0;hi.length)for(var o=t-(i+=-1===r?".":"").length+1,a=0;a=d.TWO_PI?"".concat("ellipse","|").concat(u,"|"):"".concat("arc","|").concat(a,"|").concat(s,"|").concat(l,"|").concat(u,"|"),!this.geometryInHash(t)){var h=new T.default.Geometry(u,1,function(){if(this.strokeIndices=[],a.toFixed(10)!==s.toFixed(10)){l!==d.PIE&&void 0!==l||(this.vertices.push(new T.default.Vector(.5,.5,0)),this.uvs.push([.5,.5]));for(var e=0;e<=u;e++){var t=(s-a)*(e/u)+a,r=.5+Math.cos(t)/2,i=.5+Math.sin(t)/2;this.vertices.push(new T.default.Vector(r,i,0)),this.uvs.push([r,i]),e>5&31)/31,(y>>10&31)/31):(r=a,i=s,l)}for(var b=1;b<=3;b++){var _=p+12*b,x=new S.default.Vector(u.getFloat32(_,!0),u.getFloat32(8+_,!0),u.getFloat32(4+_,!0));e.vertices.push(x),c&&o.push(r,i,n)}var w=new S.default.Vector(m,g,v);e.vertexNormals.push(w,w,w),e.faces.push([3*d,3*d+1,3*d+2]),e.uvs.push([0,0],[0,0],[0,0])}}(e,t);else{var r=new DataView(t);if(!("TextDecoder"in window))return console.warn("Sorry, ASCII STL loading only works in browsers that support TextDecoder (https://caniuse.com/#feat=textencoder)");var i=new TextDecoder("utf-8").decode(r).split("\n");!function(e,t){for(var r,i,n="",o=[],a=0;aMath.PI?l=Math.PI:l<=0&&(l=.001);var u=Math.sin(l)*a*Math.sin(s),h=Math.cos(l)*a,c=Math.sin(l)*a*Math.cos(s);this.camera(u+this.centerX,h+this.centerY,c+this.centerZ,this.centerX,this.centerY,this.centerZ,0,1,0)},m.default.Camera.prototype._isActive=function(){return this===this._renderer._curCamera},m.default.prototype.setCamera=function(e){this._renderer._curCamera=e,this._renderer.uPMatrix.set(e.projMatrix.mat4[0],e.projMatrix.mat4[1],e.projMatrix.mat4[2],e.projMatrix.mat4[3],e.projMatrix.mat4[4],e.projMatrix.mat4[5],e.projMatrix.mat4[6],e.projMatrix.mat4[7],e.projMatrix.mat4[8],e.projMatrix.mat4[9],e.projMatrix.mat4[10],e.projMatrix.mat4[11],e.projMatrix.mat4[12],e.projMatrix.mat4[13],e.projMatrix.mat4[14],e.projMatrix.mat4[15])};var n=m.default.Camera;r.default=n},{"../core/main":49}],98:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i,h=(i=e("../core/main"))&&i.__esModule?i:{default:i};h.default.Geometry=function(e,t,r){return this.vertices=[],this.lineVertices=[],this.lineNormals=[],this.vertexNormals=[],this.faces=[],this.uvs=[],this.edges=[],this.vertexColors=[],this.detailX=void 0!==e?e:1,this.detailY=void 0!==t?t:1,this.dirtyFlags={},r instanceof Function&&r.call(this),this},h.default.Geometry.prototype.reset=function(){this.lineVertices.length=0,this.lineNormals.length=0,this.vertices.length=0,this.edges.length=0,this.vertexColors.length=0,this.vertexNormals.length=0,this.uvs.length=0,this.dirtyFlags={}},h.default.Geometry.prototype.computeFaces=function(){this.faces.length=0;for(var e,t,r,i,n=this.detailX+1,o=0;othis.vertices.length-1-this.detailX;i--)e.add(this.vertexNormals[i]);e=h.default.Vector.div(e,this.detailX);for(var n=this.vertices.length-1;n>this.vertices.length-1-this.detailX;n--)this.vertexNormals[n]=e;return this},h.default.Geometry.prototype._makeTriangleEdges=function(){if(this.edges.length=0,Array.isArray(this.strokeIndices))for(var e=0,t=this.strokeIndices.length;e vTexCoord.y;\n bool y1 = p1.y > vTexCoord.y;\n bool y2 = p2.y > vTexCoord.y;\n\n // could web be under the curve (after t1)?\n if (y1 ? !y2 : y0) {\n // add the coverage for t1\n coverage.x += saturate(C1.x + 0.5);\n // calculate the anti-aliasing for t1\n weight.x = min(weight.x, abs(C1.x));\n }\n\n // are we outside the curve (after t2)?\n if (y1 ? !y0 : y2) {\n // subtract the coverage for t2\n coverage.x -= saturate(C2.x + 0.5);\n // calculate the anti-aliasing for t2\n weight.x = min(weight.x, abs(C2.x));\n }\n}\n\n// this is essentially the same as coverageX, but with the axes swapped\nvoid coverageY(vec2 p0, vec2 p1, vec2 p2) {\n\n vec2 C1, C2;\n calulateCrossings(p0, p1, p2, C1, C2);\n\n bool x0 = p0.x > vTexCoord.x;\n bool x1 = p1.x > vTexCoord.x;\n bool x2 = p2.x > vTexCoord.x;\n\n if (x1 ? !x2 : x0) {\n coverage.y -= saturate(C1.y + 0.5);\n weight.y = min(weight.y, abs(C1.y));\n }\n\n if (x1 ? !x0 : x2) {\n coverage.y += saturate(C2.y + 0.5);\n weight.y = min(weight.y, abs(C2.y));\n }\n}\n\nvoid main() {\n\n // calculate the pixel scale based on screen-coordinates\n pixelScale = hardness / fwidth(vTexCoord);\n\n // which grid cell is this pixel in?\n ivec2 gridCoord = ifloor(vTexCoord * vec2(uGridSize));\n\n // intersect curves in this row\n {\n // the index into the row info bitmap\n int rowIndex = gridCoord.y + uGridOffset.y;\n // fetch the info texel\n vec4 rowInfo = getTexel(uSamplerRows, rowIndex, uGridImageSize);\n // unpack the rowInfo\n int rowStrokeIndex = getInt16(rowInfo.xy);\n int rowStrokeCount = getInt16(rowInfo.zw);\n\n for (int iRowStroke = INT(0); iRowStroke < N; iRowStroke++) {\n if (iRowStroke >= rowStrokeCount)\n break;\n\n // each stroke is made up of 3 points: the start and control point\n // and the start of the next curve.\n // fetch the indices of this pair of strokes:\n vec4 strokeIndices = getTexel(uSamplerRowStrokes, rowStrokeIndex++, uCellsImageSize);\n\n // unpack the stroke index\n int strokePos = getInt16(strokeIndices.xy);\n\n // fetch the two strokes\n vec4 stroke0 = getTexel(uSamplerStrokes, strokePos + INT(0), uStrokeImageSize);\n vec4 stroke1 = getTexel(uSamplerStrokes, strokePos + INT(1), uStrokeImageSize);\n\n // calculate the coverage\n coverageX(stroke0.xy, stroke0.zw, stroke1.xy);\n }\n }\n\n // intersect curves in this column\n {\n int colIndex = gridCoord.x + uGridOffset.x;\n vec4 colInfo = getTexel(uSamplerCols, colIndex, uGridImageSize);\n int colStrokeIndex = getInt16(colInfo.xy);\n int colStrokeCount = getInt16(colInfo.zw);\n \n for (int iColStroke = INT(0); iColStroke < N; iColStroke++) {\n if (iColStroke >= colStrokeCount)\n break;\n\n vec4 strokeIndices = getTexel(uSamplerColStrokes, colStrokeIndex++, uCellsImageSize);\n\n int strokePos = getInt16(strokeIndices.xy);\n vec4 stroke0 = getTexel(uSamplerStrokes, strokePos + INT(0), uStrokeImageSize);\n vec4 stroke1 = getTexel(uSamplerStrokes, strokePos + INT(1), uStrokeImageSize);\n coverageY(stroke0.xy, stroke0.zw, stroke1.xy);\n }\n }\n\n weight = saturate(1.0 - weight * 2.0);\n float distance = max(weight.x + weight.y, minDistance); // manhattan approx.\n float antialias = abs(dot(coverage, weight) / distance);\n float cover = min(abs(coverage.x), abs(coverage.y));\n gl_FragColor = uMaterialColor;\n gl_FragColor.a *= saturate(max(antialias, cover));\n}",lineVert:"/*\n Part of the Processing project - http://processing.org\n Copyright (c) 2012-15 The Processing Foundation\n Copyright (c) 2004-12 Ben Fry and Casey Reas\n Copyright (c) 2001-04 Massachusetts Institute of Technology\n This library is free software; you can redistribute it and/or\n modify it under the terms of the GNU Lesser General Public\n License as published by the Free Software Foundation, version 2.1.\n This library is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n Lesser General Public License for more details.\n You should have received a copy of the GNU Lesser General\n Public License along with this library; if not, write to the\n Free Software Foundation, Inc., 59 Temple Place, Suite 330,\n Boston, MA 02111-1307 USA\n*/\n\n#define PROCESSING_LINE_SHADER\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform float uStrokeWeight;\n\nuniform vec4 uViewport;\nuniform int uPerspective;\n\nattribute vec4 aPosition;\nattribute vec4 aDirection;\n \nvoid main() {\n // using a scale <1 moves the lines towards the camera\n // in order to prevent popping effects due to half of\n // the line disappearing behind the geometry faces.\n vec3 scale = vec3(0.9995);\n\n vec4 posp = uModelViewMatrix * aPosition;\n vec4 posq = uModelViewMatrix * (aPosition + vec4(aDirection.xyz, 0));\n\n // Moving vertices slightly toward the camera\n // to avoid depth-fighting with the fill triangles.\n // Discussed here:\n // http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Number=252848 \n posp.xyz = posp.xyz * scale;\n posq.xyz = posq.xyz * scale;\n\n vec4 p = uProjectionMatrix * posp;\n vec4 q = uProjectionMatrix * posq;\n\n // formula to convert from clip space (range -1..1) to screen space (range 0..[width or height])\n // screen_p = (p.xy/p.w + <1,1>) * 0.5 * uViewport.zw\n\n // prevent division by W by transforming the tangent formula (div by 0 causes\n // the line to disappear, see https://github.com/processing/processing/issues/5183)\n // t = screen_q - screen_p\n //\n // tangent is normalized and we don't care which aDirection it points to (+-)\n // t = +- normalize( screen_q - screen_p )\n // t = +- normalize( (q.xy/q.w+<1,1>)*0.5*uViewport.zw - (p.xy/p.w+<1,1>)*0.5*uViewport.zw )\n //\n // extract common factor, <1,1> - <1,1> cancels out\n // t = +- normalize( (q.xy/q.w - p.xy/p.w) * 0.5 * uViewport.zw )\n //\n // convert to common divisor\n // t = +- normalize( ((q.xy*p.w - p.xy*q.w) / (p.w*q.w)) * 0.5 * uViewport.zw )\n //\n // remove the common scalar divisor/factor, not needed due to normalize and +-\n // (keep uViewport - can't remove because it has different components for x and y\n // and corrects for aspect ratio, see https://github.com/processing/processing/issues/5181)\n // t = +- normalize( (q.xy*p.w - p.xy*q.w) * uViewport.zw )\n\n vec2 tangent = normalize((q.xy*p.w - p.xy*q.w) * uViewport.zw);\n\n // flip tangent to normal (it's already normalized)\n vec2 normal = vec2(-tangent.y, tangent.x);\n\n float thickness = aDirection.w * uStrokeWeight;\n vec2 offset = normal * thickness / 2.0;\n\n vec2 curPerspScale;\n\n if(uPerspective == 1) {\n // Perspective ---\n // convert from world to clip by multiplying with projection scaling factor\n // to get the right thickness (see https://github.com/processing/processing/issues/5182)\n // invert Y, projections in Processing invert Y\n curPerspScale = (uProjectionMatrix * vec4(1, -1, 0, 0)).xy;\n } else {\n // No Perspective ---\n // multiply by W (to cancel out division by W later in the pipeline) and\n // convert from screen to clip (derived from clip to screen above)\n curPerspScale = p.w / (0.5 * uViewport.zw);\n }\n\n gl_Position.xy = p.xy + offset.xy * curPerspScale;\n gl_Position.zw = p.zw;\n}\n",lineFrag:"precision mediump float;\nprecision mediump int;\n\nuniform vec4 uMaterialColor;\n\nvoid main() {\n gl_FragColor = uMaterialColor;\n}",pointVert:"attribute vec3 aPosition;\nuniform float uPointSize;\nvarying float vStrokeWeight;\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nvoid main() {\n\tvec4 positionVec4 = vec4(aPosition, 1.0);\n\tgl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n\tgl_PointSize = uPointSize;\n\tvStrokeWeight = uPointSize;\n}",pointFrag:"precision mediump float;\nprecision mediump int;\nuniform vec4 uMaterialColor;\nvarying float vStrokeWeight;\n\nvoid main(){\n\tfloat mask = 0.0;\n\n\t// make a circular mask using the gl_PointCoord (goes from 0 - 1 on a point)\n // might be able to get a nicer edge on big strokeweights with smoothstep but slightly less performant\n\n\tmask = step(0.98, length(gl_PointCoord * 2.0 - 1.0));\n\n\t// if strokeWeight is 1 or less lets just draw a square\n\t// this prevents weird artifacting from carving circles when our points are really small\n\t// if strokeWeight is larger than 1, we just use it as is\n\n\tmask = mix(0.0, mask, clamp(floor(vStrokeWeight - 0.5),0.0,1.0));\n\n\t// throw away the borders of the mask\n // otherwise we get weird alpha blending issues\n\n\tif(mask > 0.98){\n discard;\n \t}\n\n \tgl_FragColor = vec4(uMaterialColor.rgb * (1.0 - mask), uMaterialColor.a) ;\n}"};u.default.RendererGL=function(e,t,r,i){return u.default.Renderer.call(this,e,t,r),this._setAttributeDefaults(t),this._initContext(),this.isP3D=!0,this.GL=this.drawingContext,this._isErasing=!1,this._enableLighting=!1,this.ambientLightColors=[],this.specularColors=[1,1,1],this.directionalLightDirections=[],this.directionalLightDiffuseColors=[],this.directionalLightSpecularColors=[],this.pointLightPositions=[],this.pointLightDiffuseColors=[],this.pointLightSpecularColors=[],this.spotLightPositions=[],this.spotLightDirections=[],this.spotLightDiffuseColors=[],this.spotLightSpecularColors=[],this.spotLightAngle=[],this.spotLightConc=[],this.drawMode=o.FILL,this.curFillColor=this._cachedFillStyle=[1,1,1,1],this.curStrokeColor=this._cachedStrokeStyle=[0,0,0,1],this.curBlendMode=o.BLEND,this._cachedBlendMode=void 0,this.blendExt=this.GL.getExtension("EXT_blend_minmax"),this._isBlending=!1,this._useSpecularMaterial=!1,this._useEmissiveMaterial=!1,this._useNormalMaterial=!1,this._useShininess=1,this._tint=[255,255,255,255],this.constantAttenuation=1,this.linearAttenuation=0,this.quadraticAttenuation=0,this.uMVMatrix=new u.default.Matrix,this.uPMatrix=new u.default.Matrix,this.uNMatrix=new u.default.Matrix("mat3"),this._curCamera=new u.default.Camera(this),this._curCamera._computeCameraDefaultSettings(),this._curCamera._setDefaultCamera(),this._defaultLightShader=void 0,this._defaultImmediateModeShader=void 0,this._defaultNormalShader=void 0,this._defaultColorShader=void 0,this._defaultPointShader=void 0,this.userFillShader=void 0,this.userStrokeShader=void 0,this.userPointShader=void 0,this.retainedMode={geometry:{},buffers:{stroke:[new u.default.RenderBuffer(3,"lineVertices","lineVertexBuffer","aPosition",this,this._flatten),new u.default.RenderBuffer(4,"lineNormals","lineNormalBuffer","aDirection",this,this._flatten)],fill:[new u.default.RenderBuffer(3,"vertices","vertexBuffer","aPosition",this,this._vToNArray),new u.default.RenderBuffer(3,"vertexNormals","normalBuffer","aNormal",this,this._vToNArray),new u.default.RenderBuffer(4,"vertexColors","colorBuffer","aMaterialColor",this),new u.default.RenderBuffer(3,"vertexAmbients","ambientBuffer","aAmbientColor",this),new u.default.RenderBuffer(2,"uvs","uvBuffer","aTexCoord",this,this._flatten)],text:[new u.default.RenderBuffer(3,"vertices","vertexBuffer","aPosition",this,this._vToNArray),new u.default.RenderBuffer(2,"uvs","uvBuffer","aTexCoord",this,this._flatten)]}},this.immediateMode={geometry:new u.default.Geometry,shapeMode:o.TRIANGLE_FAN,_bezierVertex:[],_quadraticVertex:[],_curveVertex:[],buffers:{fill:[new u.default.RenderBuffer(3,"vertices","vertexBuffer","aPosition",this,this._vToNArray),new u.default.RenderBuffer(3,"vertexNormals","normalBuffer","aNormal",this,this._vToNArray),new u.default.RenderBuffer(4,"vertexColors","colorBuffer","aVertexColor",this),new u.default.RenderBuffer(3,"vertexAmbients","ambientBuffer","aAmbientColor",this),new u.default.RenderBuffer(2,"uvs","uvBuffer","aTexCoord",this,this._flatten)],stroke:[new u.default.RenderBuffer(3,"lineVertices","lineVertexBuffer","aPosition",this,this._flatten),new u.default.RenderBuffer(4,"lineNormals","lineNormalBuffer","aDirection",this,this._flatten)],point:this.GL.createBuffer()}},this.pointSize=5,this.curStrokeWeight=1,this.textures=[],this.textureMode=o.IMAGE,this.textureWrapX=o.CLAMP,this.textureWrapY=o.CLAMP,this._tex=null,this._curveTightness=6,this._lookUpTableBezier=[],this._lookUpTableQuadratic=[],this._lutBezierDetail=0,this._lutQuadraticDetail=0,this._tessy=this._initTessy(),this.fontInfos={},this._curShader=void 0,this},u.default.RendererGL.prototype=Object.create(u.default.Renderer.prototype),u.default.RendererGL.prototype._setAttributeDefaults=function(e){var t={alpha:!0,depth:!0,stencil:!0,antialias:navigator.userAgent.toLowerCase().includes("safari"),premultipliedAlpha:!1,preserveDrawingBuffer:!0,perPixelLighting:!0};null===e._glAttributes?e._glAttributes=t:e._glAttributes=Object.assign(t,e._glAttributes)},u.default.RendererGL.prototype._initContext=function(){try{if(this.drawingContext=this.canvas.getContext("webgl",this._pInst._glAttributes)||this.canvas.getContext("experimental-webgl",this._pInst._glAttributes),null===this.drawingContext)throw new Error("Error creating webgl context");var e=this.drawingContext;e.enable(e.DEPTH_TEST),e.depthFunc(e.LEQUAL),e.viewport(0,0,e.drawingBufferWidth,e.drawingBufferHeight),this._viewport=this.drawingContext.getParameter(this.drawingContext.VIEWPORT)}catch(e){throw e}},u.default.RendererGL.prototype._resetContext=function(e,t){var r=this.width,i=this.height,n=this.canvas.id,o=this._pInst instanceof u.default.Graphics;if(o){var a=this._pInst;a.canvas.parentNode.removeChild(a.canvas),a.canvas=document.createElement("canvas"),(a._pInst._userNode||document.body).appendChild(a.canvas),u.default.Element.call(a,a.canvas,a._pInst),a.width=r,a.height=i}else{var s=this.canvas;s&&s.parentNode.removeChild(s),(s=document.createElement("canvas")).id=n,this._pInst._userNode?this._pInst._userNode.appendChild(s):document.body.appendChild(s),this._pInst.canvas=s}var l=new u.default.RendererGL(this._pInst.canvas,this._pInst,!o);this._pInst._setProperty("_renderer",l),l.resize(r,i),l._applyDefaults(),o||this._pInst._elements.push(l),"function"==typeof t&&setTimeout(function(){t.apply(window._renderer,e)},0)},u.default.prototype.setAttributes=function(e,t){if(void 0!==this._glAttributes){var r=!0;if(void 0!==t?(null===this._glAttributes&&(this._glAttributes={}),this._glAttributes[e]!==t&&(this._glAttributes[e]=t,r=!1)):e instanceof Object&&this._glAttributes!==e&&(this._glAttributes=e,r=!1),this._renderer.isP3D&&!r){if(!this._setupDone)for(var i in this._renderer.retainedMode.geometry)if(this._renderer.retainedMode.geometry.hasOwnProperty(i))return void console.error("Sorry, Could not set the attributes, you need to call setAttributes() before calling the other drawing methods in setup()");this.push(),this._renderer._resetContext(),this.pop(),this._renderer._curCamera&&(this._renderer._curCamera._renderer=this._renderer)}}else console.log("You are trying to use setAttributes on a p5.Graphics object that does not use a WEBGL renderer.")},u.default.RendererGL.prototype._update=function(){this.uMVMatrix.set(this._curCamera.cameraMatrix.mat4[0],this._curCamera.cameraMatrix.mat4[1],this._curCamera.cameraMatrix.mat4[2],this._curCamera.cameraMatrix.mat4[3],this._curCamera.cameraMatrix.mat4[4],this._curCamera.cameraMatrix.mat4[5],this._curCamera.cameraMatrix.mat4[6],this._curCamera.cameraMatrix.mat4[7],this._curCamera.cameraMatrix.mat4[8],this._curCamera.cameraMatrix.mat4[9],this._curCamera.cameraMatrix.mat4[10],this._curCamera.cameraMatrix.mat4[11],this._curCamera.cameraMatrix.mat4[12],this._curCamera.cameraMatrix.mat4[13],this._curCamera.cameraMatrix.mat4[14],this._curCamera.cameraMatrix.mat4[15]),this.ambientLightColors.length=0,this.specularColors=[1,1,1],this.directionalLightDirections.length=0,this.directionalLightDiffuseColors.length=0,this.directionalLightSpecularColors.length=0,this.pointLightPositions.length=0,this.pointLightDiffuseColors.length=0,this.pointLightSpecularColors.length=0,this.spotLightPositions.length=0,this.spotLightDirections.length=0,this.spotLightDiffuseColors.length=0,this.spotLightSpecularColors.length=0,this.spotLightAngle.length=0,this.spotLightConc.length=0,this._enableLighting=!1,this._tint=[255,255,255,255],this.GL.clear(this.GL.DEPTH_BUFFER_BIT)},u.default.RendererGL.prototype.background=function(){var e,t=(e=this._pInst).color.apply(e,arguments),r=t.levels[0]/255,i=t.levels[1]/255,n=t.levels[2]/255,o=t.levels[3]/255;this.GL.clearColor(r,i,n,o),this.GL.clear(this.GL.COLOR_BUFFER_BIT)},u.default.RendererGL.prototype.fill=function(e,t,r,i){var n=u.default.prototype.color.apply(this._pInst,arguments);this.curFillColor=n._array,this.drawMode=o.FILL,this._useNormalMaterial=!1,this._tex=null},u.default.RendererGL.prototype.stroke=function(e,t,r,i){arguments[3]=255;var n=u.default.prototype.color.apply(this._pInst,arguments);this.curStrokeColor=n._array},u.default.RendererGL.prototype.strokeCap=function(e){console.error("Sorry, strokeCap() is not yet implemented in WEBGL mode")},u.default.RendererGL.prototype.strokeJoin=function(e){console.error("Sorry, strokeJoin() is not yet implemented in WEBGL mode")},u.default.RendererGL.prototype.filter=function(e){console.error("filter() does not work in WEBGL mode")},u.default.RendererGL.prototype.blendMode=function(e){e===o.DARKEST||e===o.LIGHTEST||e===o.ADD||e===o.BLEND||e===o.SUBTRACT||e===o.SCREEN||e===o.EXCLUSION||e===o.REPLACE||e===o.MULTIPLY||e===o.REMOVE?this.curBlendMode=e:e!==o.BURN&&e!==o.OVERLAY&&e!==o.HARD_LIGHT&&e!==o.SOFT_LIGHT&&e!==o.DODGE||console.warn("BURN, OVERLAY, HARD_LIGHT, SOFT_LIGHT, and DODGE only work for blendMode in 2D mode.")},u.default.RendererGL.prototype.erase=function(e,t){this._isErasing||(this._cachedBlendMode=this.curBlendMode,this.blendMode(o.REMOVE),this._cachedFillStyle=this.curFillColor.slice(),this.curFillColor=[1,1,1,e/255],this._cachedStrokeStyle=this.curStrokeColor.slice(),this.curStrokeColor=[1,1,1,t/255],this._isErasing=!0)},u.default.RendererGL.prototype.noErase=function(){this._isErasing&&(this.curFillColor=this._cachedFillStyle.slice(),this.curStrokeColor=this._cachedStrokeStyle.slice(),this.blendMode(this._cachedBlendMode),this._isErasing=!1)},u.default.RendererGL.prototype.strokeWeight=function(e){this.curStrokeWeight!==e&&(this.pointSize=e,this.curStrokeWeight=e)},u.default.RendererGL.prototype._getPixel=function(e,t){var r;return r=new Uint8Array(4),this.drawingContext.readPixels(e,t,1,1,this.drawingContext.RGBA,this.drawingContext.UNSIGNED_BYTE,r),[r[0],r[1],r[2],r[3]]},u.default.RendererGL.prototype.loadPixels=function(){var e=this._pixelsState;if(!0===this._pInst._glAttributes.preserveDrawingBuffer){var t=e.pixels,r=this.GL.drawingBufferWidth*this.GL.drawingBufferHeight*4;t instanceof Uint8Array&&t.length===r||(t=new Uint8Array(r),this._pixelsState._setProperty("pixels",t));var i=this._pInst._pixelDensity;this.GL.readPixels(0,0,this.width*i,this.height*i,this.GL.RGBA,this.GL.UNSIGNED_BYTE,t)}else console.log("loadPixels only works in WebGL when preserveDrawingBuffer is true.")},u.default.RendererGL.prototype.geometryInHash=function(e){return void 0!==this.retainedMode.geometry[e]},u.default.RendererGL.prototype.resize=function(e,t){u.default.Renderer.prototype.resize.call(this,e,t),this.GL.viewport(0,0,this.GL.drawingBufferWidth,this.GL.drawingBufferHeight),this._viewport=this.GL.getParameter(this.GL.VIEWPORT),this._curCamera._resize();var r=this._pixelsState;void 0!==r.pixels&&r._setProperty("pixels",new Uint8Array(this.GL.drawingBufferWidth*this.GL.drawingBufferHeight*4))},u.default.RendererGL.prototype.clear=function(){var e=(arguments.length<=0?void 0:arguments[0])||0,t=(arguments.length<=1?void 0:arguments[1])||0,r=(arguments.length<=2?void 0:arguments[2])||0,i=(arguments.length<=3?void 0:arguments[3])||0;this.GL.clearColor(e,t,r,i),this.GL.clear(this.GL.COLOR_BUFFER_BIT|this.GL.DEPTH_BUFFER_BIT)},u.default.RendererGL.prototype.applyMatrix=function(e,t,r,i,n,o){16===arguments.length?u.default.Matrix.prototype.apply.apply(this.uMVMatrix,arguments):this.uMVMatrix.apply([e,t,0,0,r,i,0,0,0,0,1,0,n,o,0,1])},u.default.RendererGL.prototype.translate=function(e,t,r){return e instanceof u.default.Vector&&(r=e.z,t=e.y,e=e.x),this.uMVMatrix.translate([e,t,r]),this},u.default.RendererGL.prototype.scale=function(e,t,r){return this.uMVMatrix.scale(e,t,r),this},u.default.RendererGL.prototype.rotate=function(e,t){return void 0===t?this.rotateZ(e):(u.default.Matrix.prototype.rotate.apply(this.uMVMatrix,arguments),this)},u.default.RendererGL.prototype.rotateX=function(e){return this.rotate(e,1,0,0),this},u.default.RendererGL.prototype.rotateY=function(e){return this.rotate(e,0,1,0),this},u.default.RendererGL.prototype.rotateZ=function(e){return this.rotate(e,0,0,1),this},u.default.RendererGL.prototype.push=function(){var e=u.default.Renderer.prototype.push.apply(this),t=e.properties;return t.uMVMatrix=this.uMVMatrix.copy(),t.uPMatrix=this.uPMatrix.copy(),t._curCamera=this._curCamera,this._curCamera=this._curCamera.copy(),t.ambientLightColors=this.ambientLightColors.slice(),t.specularColors=this.specularColors.slice(),t.directionalLightDirections=this.directionalLightDirections.slice(),t.directionalLightDiffuseColors=this.directionalLightDiffuseColors.slice(),t.directionalLightSpecularColors=this.directionalLightSpecularColors.slice(),t.pointLightPositions=this.pointLightPositions.slice(),t.pointLightDiffuseColors=this.pointLightDiffuseColors.slice(),t.pointLightSpecularColors=this.pointLightSpecularColors.slice(),t.spotLightPositions=this.spotLightPositions.slice(),t.spotLightDirections=this.spotLightDirections.slice(),t.spotLightDiffuseColors=this.spotLightDiffuseColors.slice(),t.spotLightSpecularColors=this.spotLightSpecularColors.slice(),t.spotLightAngle=this.spotLightAngle.slice(),t.spotLightConc=this.spotLightConc.slice(),t.userFillShader=this.userFillShader,t.userStrokeShader=this.userStrokeShader,t.userPointShader=this.userPointShader,t.pointSize=this.pointSize,t.curStrokeWeight=this.curStrokeWeight,t.curStrokeColor=this.curStrokeColor,t.curFillColor=this.curFillColor,t._useSpecularMaterial=this._useSpecularMaterial,t._useEmissiveMaterial=this._useEmissiveMaterial,t._useShininess=this._useShininess,t.constantAttenuation=this.constantAttenuation,t.linearAttenuation=this.linearAttenuation,t.quadraticAttenuation=this.quadraticAttenuation,t._enableLighting=this._enableLighting,t._useNormalMaterial=this._useNormalMaterial,t._tex=this._tex,t.drawMode=this.drawMode,e},u.default.RendererGL.prototype.resetMatrix=function(){return this.uMVMatrix=u.default.Matrix.identity(this._pInst),this},u.default.RendererGL.prototype._getImmediateStrokeShader=function(){var e=this.userStrokeShader;return e&&e.isStrokeShader()?e:this._getLineShader()},u.default.RendererGL.prototype._getRetainedStrokeShader=u.default.RendererGL.prototype._getImmediateStrokeShader,u.default.RendererGL.prototype._getImmediateFillShader=function(){var e=this.userFillShader;if(this._useNormalMaterial&&(!e||!e.isNormalShader()))return this._getNormalShader();if(this._enableLighting){if(!e||!e.isLightShader())return this._getLightShader()}else if(this._tex){if(!e||!e.isTextureShader())return this._getLightShader()}else if(!e)return this._getImmediateModeShader();return e},u.default.RendererGL.prototype._getRetainedFillShader=function(){if(this._useNormalMaterial)return this._getNormalShader();var e=this.userFillShader;if(this._enableLighting){if(!e||!e.isLightShader())return this._getLightShader()}else if(this._tex){if(!e||!e.isTextureShader())return this._getLightShader()}else if(!e)return this._getColorShader();return e},u.default.RendererGL.prototype._getImmediatePointShader=function(){var e=this.userPointShader;return e&&e.isPointShader()?e:this._getPointShader()},u.default.RendererGL.prototype._getRetainedLineShader=u.default.RendererGL.prototype._getImmediateLineShader,u.default.RendererGL.prototype._getLightShader=function(){return this._defaultLightShader||(this._pInst._glAttributes.perPixelLighting?this._defaultLightShader=new u.default.Shader(this,c.phongVert,c.phongFrag):this._defaultLightShader=new u.default.Shader(this,c.lightVert,c.lightTextureFrag)),this._defaultLightShader},u.default.RendererGL.prototype._getImmediateModeShader=function(){return this._defaultImmediateModeShader||(this._defaultImmediateModeShader=new u.default.Shader(this,c.immediateVert,c.vertexColorFrag)),this._defaultImmediateModeShader},u.default.RendererGL.prototype._getNormalShader=function(){return this._defaultNormalShader||(this._defaultNormalShader=new u.default.Shader(this,c.normalVert,c.normalFrag)),this._defaultNormalShader},u.default.RendererGL.prototype._getColorShader=function(){return this._defaultColorShader||(this._defaultColorShader=new u.default.Shader(this,c.normalVert,c.basicFrag)),this._defaultColorShader},u.default.RendererGL.prototype._getPointShader=function(){return this._defaultPointShader||(this._defaultPointShader=new u.default.Shader(this,c.pointVert,c.pointFrag)),this._defaultPointShader},u.default.RendererGL.prototype._getLineShader=function(){return this._defaultLineShader||(this._defaultLineShader=new u.default.Shader(this,c.lineVert,c.lineFrag)),this._defaultLineShader},u.default.RendererGL.prototype._getFontShader=function(){return this._defaultFontShader||(this.GL.getExtension("OES_standard_derivatives"),this._defaultFontShader=new u.default.Shader(this,c.fontVert,c.fontFrag)),this._defaultFontShader},u.default.RendererGL.prototype._getEmptyTexture=function(){if(!this._emptyTexture){var e=new u.default.Image(1,1);e.set(0,0,255),this._emptyTexture=new u.default.Texture(this,e)}return this._emptyTexture},u.default.RendererGL.prototype.getTexture=function(e){var t=this.textures,r=!0,i=!1,n=void 0;try{for(var o,a=t[Symbol.iterator]();!(r=(o=a.next()).done);r=!0){var s=o.value;if(s.src===e)return s}}catch(e){i=!0,n=e}finally{try{r||null==a.return||a.return()}finally{if(i)throw n}}var l=new u.default.Texture(this,e);return t.push(l),l},u.default.RendererGL.prototype._setStrokeUniforms=function(e){e.bindShader(),e.setUniform("uMaterialColor",this.curStrokeColor),e.setUniform("uStrokeWeight",this.curStrokeWeight)},u.default.RendererGL.prototype._setFillUniforms=function(e){e.bindShader(),e.setUniform("uMaterialColor",this.curFillColor),e.setUniform("isTexture",!!this._tex),this._tex&&e.setUniform("uSampler",this._tex),e.setUniform("uTint",this._tint),e.setUniform("uSpecular",this._useSpecularMaterial),e.setUniform("uEmissive",this._useEmissiveMaterial),e.setUniform("uShininess",this._useShininess),e.setUniform("uUseLighting",this._enableLighting);var t=this.pointLightDiffuseColors.length/3;e.setUniform("uPointLightCount",t),e.setUniform("uPointLightLocation",this.pointLightPositions),e.setUniform("uPointLightDiffuseColors",this.pointLightDiffuseColors),e.setUniform("uPointLightSpecularColors",this.pointLightSpecularColors);var r=this.directionalLightDiffuseColors.length/3;e.setUniform("uDirectionalLightCount",r),e.setUniform("uLightingDirection",this.directionalLightDirections),e.setUniform("uDirectionalDiffuseColors",this.directionalLightDiffuseColors),e.setUniform("uDirectionalSpecularColors",this.directionalLightSpecularColors);var i=this.ambientLightColors.length/3;e.setUniform("uAmbientLightCount",i),e.setUniform("uAmbientColor",this.ambientLightColors);var n=this.spotLightDiffuseColors.length/3;e.setUniform("uSpotLightCount",n),e.setUniform("uSpotLightAngle",this.spotLightAngle),e.setUniform("uSpotLightConc",this.spotLightConc),e.setUniform("uSpotLightDiffuseColors",this.spotLightDiffuseColors),e.setUniform("uSpotLightSpecularColors",this.spotLightSpecularColors),e.setUniform("uSpotLightLocation",this.spotLightPositions),e.setUniform("uSpotLightDirection",this.spotLightDirections),e.setUniform("uConstantAttenuation",this.constantAttenuation),e.setUniform("uLinearAttenuation",this.linearAttenuation),e.setUniform("uQuadraticAttenuation",this.quadraticAttenuation),e.bindTextures()},u.default.RendererGL.prototype._setPointUniforms=function(e){e.bindShader(),e.setUniform("uMaterialColor",this.curStrokeColor),e.setUniform("uPointSize",this.pointSize)},u.default.RendererGL.prototype._bindBuffer=function(e,t,r,i,n){if(t=t||this.GL.ARRAY_BUFFER,this.GL.bindBuffer(t,e),void 0!==r){var o=new(i||Float32Array)(r);this.GL.bufferData(t,o,n||this.GL.STATIC_DRAW)}},u.default.RendererGL.prototype._arraysEqual=function(e,t){var r=e.length;if(r!==t.length)return!1;for(var i=0;i>7,127&f,c>>7,127&c);for(var d=0;d>7,127&p,0,0)}}return{cellImageInfo:l,dimOffset:o,dimImageInfo:n}}return(t=this.glyphInfos[e.index]={glyph:e,uGlyphRect:[i.x1,-i.y1,i.x2,-i.y2],strokeImageInfo:U,strokes:d,colInfo:G(m,this.colDimImageInfos,this.colCellImageInfos),rowInfo:G(p,this.rowDimImageInfos,this.rowCellImageInfos)}).uGridOffset=[t.colInfo.dimOffset,t.rowInfo.dimOffset],t}}var z=Math.sqrt(3);j.default.RendererGL.prototype._renderText=function(e,t,r,i,n){if(this._textFont&&"string"!=typeof this._textFont){if(!(n<=i)&&this._doFill){if(!this._isOpenType())return console.log("WEBGL: only Opentype (.otf) and Truetype (.ttf) fonts are supported"),e;e.push();var o=this._doStroke,a=this.drawMode;this._doStroke=!1,this.drawMode=D.TEXTURE;var s=this._textFont.font,l=this._textFont._fontInfo;l=l||(this._textFont._fontInfo=new A(s));var u=this._textFont._handleAlignment(this,t,r,i),h=this._textSize/s.unitsPerEm;this.translate(u.x,u.y,0),this.scale(h,h,1);var c=this.GL,f=!this._defaultFontShader,d=this._getFontShader();d.init(),d.bindShader(),f&&(d.setUniform("uGridImageSize",[64,64]),d.setUniform("uCellsImageSize",[64,64]),d.setUniform("uStrokeImageSize",[64,64]),d.setUniform("uGridSize",[9,9])),this._applyColorBlend(this.curFillColor);var p=this.retainedMode.geometry.glyph;if(!p){var m=this._textGeom=new j.default.Geometry(1,1,function(){for(var e=0;e<=1;e++)for(var t=0;t<=1;t++)this.vertices.push(new j.default.Vector(t,e,0)),this.uvs.push(t,e)});m.computeFaces().computeNormals(),p=this.createBuffers("glyph",m)}var g=!0,v=!1,y=void 0;try{for(var b,_=this.retainedMode.buffers.text[Symbol.iterator]();!(g=(b=_.next()).done);g=!0){b.value._prepareBuffer(p,d)}}catch(e){v=!0,y=e}finally{try{g||null==_.return||_.return()}finally{if(v)throw y}}this._bindBuffer(p.indexBuffer,c.ELEMENT_ARRAY_BUFFER),d.setUniform("uMaterialColor",this.curFillColor);try{var x=0,w=null,S=s.stringToGlyphs(t),M=!0,E=!1,T=void 0;try{for(var C,P=S[Symbol.iterator]();!(M=(C=P.next()).done);M=!0){var L=C.value;w&&(x+=s.getKerningValue(w,L));var k=l.getGlyphInfo(L);if(k.uGlyphRect){var R=k.rowInfo,O=k.colInfo;d.setUniform("uSamplerStrokes",k.strokeImageInfo.imageData),d.setUniform("uSamplerRowStrokes",R.cellImageInfo.imageData),d.setUniform("uSamplerRows",R.dimImageInfo.imageData),d.setUniform("uSamplerColStrokes",O.cellImageInfo.imageData),d.setUniform("uSamplerCols",O.dimImageInfo.imageData),d.setUniform("uGridOffset",k.uGridOffset),d.setUniform("uGlyphRect",k.uGlyphRect),d.setUniform("uGlyphOffset",x),d.bindTextures(),c.drawElements(c.TRIANGLES,6,this.GL.UNSIGNED_SHORT,0)}x+=L.advanceWidth,w=L}}catch(e){E=!0,T=e}finally{try{M||null==P.return||P.return()}finally{if(E)throw T}}}finally{d.unbindShader(),this._doStroke=o,this.drawMode=a,e.pop()}return e}}else console.log("WEBGL: you must load and set a font before drawing text. See `loadFont` and `textFont` for more details.")}},{"../core/constants":42,"../core/main":49,"./p5.RendererGL.Retained":102,"./p5.Shader":104}],107:[function(e,t,r){t.exports={fes:{autoplay:"The media that tried to play (with '{{src}}') wasn't allowed to by this browser, most likely due to the browser's autoplay policy. Check out {{link}} for more information about why.",fileLoadError:{bytes:"It looks like there was a problem loading your file. {{suggestion}}",font:"It looks like there was a problem loading your font. {{suggestion}}",gif:"There was some trouble loading your GIF. Make sure that your GIF is using 87a or 89a encoding.",image:"It looks like there was a problem loading your image. {{suggestion}}",json:"It looks like there was a problem loading your JSON file. {{suggestion}}",large:"If your large file isn't fetched successfully, we recommend splitting the file into smaller segments and fetching those.",strings:"It looks like there was a problem loading your text file. {{suggestion}}",suggestion:"Try checking if the file path ({{filePath}}) is correct, hosting the file online, or running a local server. (More info at {{link}})",table:"It looks like there was a problem loading your table file. {{suggestion}}",xml:"It looks like there was a problem loading your XML file. {{suggestion}}"},misusedTopLevel:"Did you just try to use p5.js's {{symbolName}} {{symbolType}}? If so, you may want to move it into your sketch's setup() function.\n\nFor more details, see: {{link}}",pre:"🌸 p5.js says: {{message}}",welcome:"Welcome! This is your friendly debugger. To turn me off, switch to using p5.min.js."}}},{}],108:[function(e,t,r){t.exports={fes:{autoplay:"Su browser impidío un medio tocar (de '{{src}}'), posiblemente porque las reglas de autoplay. Para aprender más, visite {{link}}.",fileLoadError:{bytes:"",font:"",gif:"",image:"",json:"",large:"",strings:"",suggestion:"",table:"",xml:""},misusedTopLevel:"",pre:"🌸 p5.js dice: {{message}}",welcome:""}}},{}],109:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i=o(e("./en/translation")),n=o(e("./es/translation"));function o(e){return e&&e.__esModule?e:{default:e}}var a={en:{translation:i.default},es:{translation:n.default}};r.default=a},{"./en/translation":107,"./es/translation":108}]},{},[37])(37)}); ================================================ FILE: docs/examples/pyodide/memory/target/target_sketch.js ================================================ const wrapperContent = ` class PythonFunctions: pass setattr(PythonFunctions, 'map', map) setattr(PythonFunctions, 'filter', filter) setattr(PythonFunctions, 'set', set) _P5_INSTANCE = None _CTX_MIDDLE = None _DEFAULT_FILL = None _DEFAULT_LEADMULT = None _DEFAULT_STROKE = None _DEFAULT_TEXT_FILL = None ADD = None ALT = None ARROW = None AUDIO = None AUTO = None AXES = None BACKSPACE = None BASELINE = None BEVEL = None BEZIER = None BLEND = None BLUR = None BOLD = None BOLDITALIC = None BOTTOM = None BURN = None CENTER = None CHORD = None CLAMP = None CLOSE = None CONTROL = None CORNER = None CORNERS = None CROSS = None CURVE = None DARKEST = None DEG_TO_RAD = None DEGREES = None DELETE = None DIFFERENCE = None DILATE = None DODGE = None DOWN_ARROW = None ENTER = None ERODE = None ESCAPE = None EXCLUSION = None FILL = None GRAY = None GRID = None HALF_PI = None HAND = None HARD_LIGHT = None HSB = None HSL = None IMAGE = None IMMEDIATE = None INVERT = None ITALIC = None LANDSCAPE = None LEFT = None LEFT_ARROW = None LIGHTEST = None LINE_LOOP = None LINE_STRIP = None LINEAR = None LINES = None MIRROR = None MITER = None MOVE = None MULTIPLY = None NEAREST = None NORMAL = None OPAQUE = None OPEN = None OPTION = None OVERLAY = None PI = None PIE = None POINTS = None PORTRAIT = None POSTERIZE = None PROJECT = None QUAD_STRIP = None QUADRATIC = None QUADS = None QUARTER_PI = None RAD_TO_DEG = None RADIANS = None RADIUS = None REPEAT = None REPLACE = None RETURN = None RGB = None RIGHT = None RIGHT_ARROW = None ROUND = None SCREEN = None SHIFT = None SOFT_LIGHT = None SQUARE = None STROKE = None SUBTRACT = None TAB = None TAU = None TEXT = None TEXTURE = None THRESHOLD = None TOP = None TRIANGLE_FAN = None TRIANGLE_STRIP = None TRIANGLES = None TWO_PI = None UP_ARROW = None VIDEO = None WAIT = None WEBGL = None P2D = None PI = None frameCount = None focused = None displayWidth = None displayHeight = None windowWidth = None windowHeight = None width = None height = None deviceOrientation = None accelerationX = None accelerationY = None accelerationZ = None pAccelerationX = None pAccelerationY = None pAccelerationZ = None rotationX = None rotationY = None rotationZ = None pRotationX = None pRotationY = None pRotationZ = None turnAxis = None keyIsPressed = None key = None keyCode = None mouseX = None mouseY = None pmouseX = None pmouseY = None winMouseX = None winMouseY = None pwinMouseX = None pwinMouseY = None mouseButton = None mouseIsPressed = None touches = None pixels = None def alpha(*args): return _P5_INSTANCE.alpha(*args) def blue(*args): return _P5_INSTANCE.blue(*args) def brightness(*args): return _P5_INSTANCE.brightness(*args) def color(*args): return _P5_INSTANCE.color(*args) def green(*args): return _P5_INSTANCE.green(*args) def hue(*args): return _P5_INSTANCE.hue(*args) def lerpColor(*args): return _P5_INSTANCE.lerpColor(*args) def lightness(*args): return _P5_INSTANCE.lightness(*args) def red(*args): return _P5_INSTANCE.red(*args) def saturation(*args): return _P5_INSTANCE.saturation(*args) def background(*args): return _P5_INSTANCE.background(*args) def clear(*args): p5_clear = _P5_INSTANCE.clear(*args) return p5_clear def erase(*args): return _P5_INSTANCE.erase(*args) def noErase(*args): return _P5_INSTANCE.noErase(*args) def colorMode(*args): return _P5_INSTANCE.colorMode(*args) def fill(*args): return _P5_INSTANCE.fill(*args) def noFill(*args): return _P5_INSTANCE.noFill(*args) def noStroke(*args): return _P5_INSTANCE.noStroke(*args) def stroke(*args): return _P5_INSTANCE.stroke(*args) def arc(*args): return _P5_INSTANCE.arc(*args) def ellipse(*args): return _P5_INSTANCE.ellipse(*args) def circle(*args): return _P5_INSTANCE.circle(*args) def line(*args): return _P5_INSTANCE.line(*args) def point(*args): return _P5_INSTANCE.point(*args) def quad(*args): return _P5_INSTANCE.quad(*args) def rect(*args): return _P5_INSTANCE.rect(*args) def square(*args): return _P5_INSTANCE.square(*args) def triangle(*args): return _P5_INSTANCE.triangle(*args) def plane(*args): return _P5_INSTANCE.plane(*args) def box(*args): return _P5_INSTANCE.box(*args) def sphere(*args): return _P5_INSTANCE.sphere(*args) def cylinder(*args): return _P5_INSTANCE.cylinder(*args) def cone(*args): return _P5_INSTANCE.cone(*args) def ellipsoid(*args): return _P5_INSTANCE.ellipsoid(*args) def torus(*args): return _P5_INSTANCE.torus(*args) def loadModel(*args): return _P5_INSTANCE.loadModel(*args) def model(*args): return _P5_INSTANCE.model(*args) def ellipseMode(*args): return _P5_INSTANCE.ellipseMode(*args) def noSmooth(*args): return _P5_INSTANCE.noSmooth(*args) def rectMode(*args): return _P5_INSTANCE.rectMode(*args) def smooth(*args): return _P5_INSTANCE.smooth(*args) def strokeCap(*args): return _P5_INSTANCE.strokeCap(*args) def strokeJoin(*args): return _P5_INSTANCE.strokeJoin(*args) def strokeWeight(*args): return _P5_INSTANCE.strokeWeight(*args) def bezier(*args): return _P5_INSTANCE.bezier(*args) def bezierDetail(*args): return _P5_INSTANCE.bezierDetail(*args) def bezierPoint(*args): return _P5_INSTANCE.bezierPoint(*args) def bezierTangent(*args): return _P5_INSTANCE.bezierTangent(*args) def curve(*args): return _P5_INSTANCE.curve(*args) def curveDetail(*args): return _P5_INSTANCE.curveDetail(*args) def curveTightness(*args): return _P5_INSTANCE.curveTightness(*args) def curvePoint(*args): return _P5_INSTANCE.curvePoint(*args) def curveTangent(*args): return _P5_INSTANCE.curveTangent(*args) def beginContour(*args): return _P5_INSTANCE.beginContour(*args) def beginShape(*args): return _P5_INSTANCE.beginShape(*args) def bezierVertex(*args): return _P5_INSTANCE.bezierVertex(*args) def curveVertex(*args): return _P5_INSTANCE.curveVertex(*args) def endContour(*args): return _P5_INSTANCE.endContour(*args) def endShape(*args): return _P5_INSTANCE.endShape(*args) def quadraticVertex(*args): return _P5_INSTANCE.quadraticVertex(*args) def vertex(*args): return _P5_INSTANCE.vertex(*args) def cursor(*args): return _P5_INSTANCE.cursor(*args) def frameRate(*args): return _P5_INSTANCE.frameRate(*args) def noCursor(*args): return _P5_INSTANCE.noCursor(*args) def fullscreen(*args): return _P5_INSTANCE.fullscreen(*args) def pixelDensity(*args): return _P5_INSTANCE.pixelDensity(*args) def displayDensity(*args): return _P5_INSTANCE.displayDensity(*args) def getURL(*args): return _P5_INSTANCE.getURL(*args) def getURLPath(*args): return _P5_INSTANCE.getURLPath(*args) def getURLParams(*args): return _P5_INSTANCE.getURLParams(*args) def remove(*args): return _P5_INSTANCE.remove(*args) def noLoop(*args): return _P5_INSTANCE.noLoop(*args) def loop(*args): return _P5_INSTANCE.loop(*args) def push(*args): return _P5_INSTANCE.push(*args) def redraw(*args): return _P5_INSTANCE.redraw(*args) def resizeCanvas(*args): return _P5_INSTANCE.resizeCanvas(*args) def noCanvas(*args): return _P5_INSTANCE.noCanvas(*args) def createGraphics(*args): return _P5_INSTANCE.createGraphics(*args) def blendMode(*args): return _P5_INSTANCE.blendMode(*args) def setAttributes(*args): return _P5_INSTANCE.setAttributes(*args) def applyMatrix(*args): return _P5_INSTANCE.applyMatrix(*args) def resetMatrix(*args): return _P5_INSTANCE.resetMatrix(*args) def rotate(*args): return _P5_INSTANCE.rotate(*args) def rotateX(*args): return _P5_INSTANCE.rotateX(*args) def rotateY(*args): return _P5_INSTANCE.rotateY(*args) def rotateZ(*args): return _P5_INSTANCE.rotateZ(*args) def scale(*args): return _P5_INSTANCE.scale(*args) def shearX(*args): return _P5_INSTANCE.shearX(*args) def shearY(*args): return _P5_INSTANCE.shearY(*args) def translate(*args): return _P5_INSTANCE.translate(*args) def createStringDict(*args): return _P5_INSTANCE.createStringDict(*args) def createNumberDict(*args): return _P5_INSTANCE.createNumberDict(*args) def append(*args): return _P5_INSTANCE.append(*args) def arrayCopy(*args): return _P5_INSTANCE.arrayCopy(*args) def concat(*args): return _P5_INSTANCE.concat(*args) def reverse(*args): return _P5_INSTANCE.reverse(*args) def shorten(*args): return _P5_INSTANCE.shorten(*args) def shuffle(*args): return _P5_INSTANCE.shuffle(*args) def sort(*args): return _P5_INSTANCE.sort(*args) def splice(*args): return _P5_INSTANCE.splice(*args) def subset(*args): return _P5_INSTANCE.subset(*args) def float(*args): return _P5_INSTANCE.float(*args) def int(*args): return _P5_INSTANCE.int(*args) def str(*args): return _P5_INSTANCE.str(*args) def boolean(*args): return _P5_INSTANCE.boolean(*args) def byte(*args): return _P5_INSTANCE.byte(*args) def char(*args): return _P5_INSTANCE.char(*args) def unchar(*args): return _P5_INSTANCE.unchar(*args) def hex(*args): return _P5_INSTANCE.hex(*args) def unhex(*args): return _P5_INSTANCE.unhex(*args) def join(*args): return _P5_INSTANCE.join(*args) def match(*args): return _P5_INSTANCE.match(*args) def matchAll(*args): return _P5_INSTANCE.matchAll(*args) def nf(*args): return _P5_INSTANCE.nf(*args) def nfc(*args): return _P5_INSTANCE.nfc(*args) def nfp(*args): return _P5_INSTANCE.nfp(*args) def nfs(*args): return _P5_INSTANCE.nfs(*args) def split(*args): return _P5_INSTANCE.split(*args) def splitTokens(*args): return _P5_INSTANCE.splitTokens(*args) def trim(*args): return _P5_INSTANCE.trim(*args) def setMoveThreshold(*args): return _P5_INSTANCE.setMoveThreshold(*args) def setShakeThreshold(*args): return _P5_INSTANCE.setShakeThreshold(*args) def keyIsDown(*args): return _P5_INSTANCE.keyIsDown(*args) def createImage(*args): return _P5_INSTANCE.createImage(*args) def saveCanvas(*args): return _P5_INSTANCE.saveCanvas(*args) def saveFrames(*args): return _P5_INSTANCE.saveFrames(*args) def loadImage(*args): return _P5_INSTANCE.loadImage(*args) def image(*args): return _P5_INSTANCE.image(*args) def tint(*args): return _P5_INSTANCE.tint(*args) def noTint(*args): return _P5_INSTANCE.noTint(*args) def imageMode(*args): return _P5_INSTANCE.imageMode(*args) def blend(*args): return _P5_INSTANCE.blend(*args) def copy(*args): return _P5_INSTANCE.copy(*args) def filter(*args): if len(args) > 1 and (args[0] is None or callable(args[0])): return PythonFunctions.filter(*args) else: return _P5_INSTANCE.filter(*args) def get(*args): return _P5_INSTANCE.get(*args) def loadPixels(*args): return _P5_INSTANCE.loadPixels(*args) def set(*args): if len(args) <= 1: return PythonFunctions.set(*args) else: return _P5_INSTANCE.set(*args) def updatePixels(*args): return _P5_INSTANCE.updatePixels(*args) def loadJSON(*args): return _P5_INSTANCE.loadJSON(*args) def loadStrings(*args): return _P5_INSTANCE.loadStrings(*args) def loadTable(*args): return _P5_INSTANCE.loadTable(*args) def loadXML(*args): return _P5_INSTANCE.loadXML(*args) def loadBytes(*args): return _P5_INSTANCE.loadBytes(*args) def httpGet(*args): return _P5_INSTANCE.httpGet(*args) def httpPost(*args): return _P5_INSTANCE.httpPost(*args) def httpDo(*args): return _P5_INSTANCE.httpDo(*args) def createWriter(*args): return _P5_INSTANCE.createWriter(*args) def save(*args): return _P5_INSTANCE.save(*args) def saveJSON(*args): return _P5_INSTANCE.saveJSON(*args) def saveStrings(*args): return _P5_INSTANCE.saveStrings(*args) def saveTable(*args): return _P5_INSTANCE.saveTable(*args) def day(*args): return _P5_INSTANCE.day(*args) def hour(*args): return _P5_INSTANCE.hour(*args) def minute(*args): return _P5_INSTANCE.minute(*args) def millis(*args): return _P5_INSTANCE.millis(*args) def month(*args): return _P5_INSTANCE.month(*args) def second(*args): return _P5_INSTANCE.second(*args) def year(*args): return _P5_INSTANCE.year(*args) def createVector(*args): return _P5_INSTANCE.createVector(*args) def abs(*args): return _P5_INSTANCE.abs(*args) def ceil(*args): return _P5_INSTANCE.ceil(*args) def constrain(*args): return _P5_INSTANCE.constrain(*args) def dist(*args): return _P5_INSTANCE.dist(*args) def exp(*args): return _P5_INSTANCE.exp(*args) def floor(*args): return _P5_INSTANCE.floor(*args) def lerp(*args): return _P5_INSTANCE.lerp(*args) def log(*args): return _P5_INSTANCE.log(*args) def mag(*args): return _P5_INSTANCE.mag(*args) def map(*args): if len(args) > 1 and callable(args[0]): return PythonFunctions.map(*args) else: return _P5_INSTANCE.map(*args) def max(*args): return _P5_INSTANCE.max(*args) def min(*args): return _P5_INSTANCE.min(*args) def norm(*args): return _P5_INSTANCE.norm(*args) def pow(*args): return _P5_INSTANCE.pow(*args) def round(*args): return _P5_INSTANCE.round(*args) def sq(*args): return _P5_INSTANCE.sq(*args) def sqrt(*args): return _P5_INSTANCE.sqrt(*args) def noise(*args): return _P5_INSTANCE.noise(*args) def noiseDetail(*args): return _P5_INSTANCE.noiseDetail(*args) def noiseSeed(*args): return _P5_INSTANCE.noiseSeed(*args) def randomSeed(*args): return _P5_INSTANCE.randomSeed(*args) def random(*args): return _P5_INSTANCE.random(*args) def randomGaussian(*args): return _P5_INSTANCE.randomGaussian(*args) def acos(*args): return _P5_INSTANCE.acos(*args) def asin(*args): return _P5_INSTANCE.asin(*args) def atan(*args): return _P5_INSTANCE.atan(*args) def atan2(*args): return _P5_INSTANCE.atan2(*args) def cos(*args): return _P5_INSTANCE.cos(*args) def sin(*args): return _P5_INSTANCE.sin(*args) def tan(*args): return _P5_INSTANCE.tan(*args) def degrees(*args): return _P5_INSTANCE.degrees(*args) def radians(*args): return _P5_INSTANCE.radians(*args) def angleMode(*args): return _P5_INSTANCE.angleMode(*args) def textAlign(*args): return _P5_INSTANCE.textAlign(*args) def textLeading(*args): return _P5_INSTANCE.textLeading(*args) def textSize(*args): return _P5_INSTANCE.textSize(*args) def textStyle(*args): return _P5_INSTANCE.textStyle(*args) def textWidth(*args): return _P5_INSTANCE.textWidth(*args) def textAscent(*args): return _P5_INSTANCE.textAscent(*args) def textDescent(*args): return _P5_INSTANCE.textDescent(*args) def loadFont(*args): return _P5_INSTANCE.loadFont(*args) def text(*args): return _P5_INSTANCE.text(*args) def textFont(*args): return _P5_INSTANCE.textFont(*args) def orbitControl(*args): return _P5_INSTANCE.orbitControl(*args) def debugMode(*args): return _P5_INSTANCE.debugMode(*args) def noDebugMode(*args): return _P5_INSTANCE.noDebugMode(*args) def ambientLight(*args): return _P5_INSTANCE.ambientLight(*args) def directionalLight(*args): return _P5_INSTANCE.directionalLight(*args) def pointLight(*args): return _P5_INSTANCE.pointLight(*args) def lights(*args): return _P5_INSTANCE.lights(*args) def loadShader(*args): return _P5_INSTANCE.loadShader(*args) def createShader(*args): return _P5_INSTANCE.createShader(*args) def shader(*args): return _P5_INSTANCE.shader(*args) def resetShader(*args): return _P5_INSTANCE.resetShader(*args) def normalMaterial(*args): return _P5_INSTANCE.normalMaterial(*args) def texture(*args): return _P5_INSTANCE.texture(*args) def textureMode(*args): return _P5_INSTANCE.textureMode(*args) def textureWrap(*args): return _P5_INSTANCE.textureWrap(*args) def ambientMaterial(*args): return _P5_INSTANCE.ambientMaterial(*args) def specularMaterial(*args): return _P5_INSTANCE.specularMaterial(*args) def shininess(*args): return _P5_INSTANCE.shininess(*args) def camera(*args): return _P5_INSTANCE.camera(*args) def perspective(*args): return _P5_INSTANCE.perspective(*args) def ortho(*args): return _P5_INSTANCE.ortho(*args) def createCamera(*args): return _P5_INSTANCE.createCamera(*args) def setCamera(*args): return _P5_INSTANCE.setCamera(*args) def select(*args): return _P5_INSTANCE.select(*args) def selectAll(*args): return _P5_INSTANCE.selectAll(*args) def removeElements(*args): return _P5_INSTANCE.removeElements(*args) def changed(*args): return _P5_INSTANCE.changed(*args) def input(*args): return _P5_INSTANCE.input(*args) def createDiv(*args): return _P5_INSTANCE.createDiv(*args) def createP(*args): return _P5_INSTANCE.createP(*args) def createSpan(*args): return _P5_INSTANCE.createSpan(*args) def createImg(*args): return _P5_INSTANCE.createImg(*args) def createA(*args): return _P5_INSTANCE.createA(*args) def createSlider(*args): return _P5_INSTANCE.createSlider(*args) def createButton(*args): return _P5_INSTANCE.createButton(*args) def createCheckbox(*args): return _P5_INSTANCE.createCheckbox(*args) def createSelect(*args): return _P5_INSTANCE.createSelect(*args) def createRadio(*args): return _P5_INSTANCE.createRadio(*args) def createColorPicker(*args): return _P5_INSTANCE.createColorPicker(*args) def createInput(*args): return _P5_INSTANCE.createInput(*args) def createFileInput(*args): return _P5_INSTANCE.createFileInput(*args) def createVideo(*args): return _P5_INSTANCE.createVideo(*args) def createAudio(*args): return _P5_INSTANCE.createAudio(*args) def createCapture(*args): return _P5_INSTANCE.createCapture(*args) def createElement(*args): return _P5_INSTANCE.createElement(*args) def createCanvas(*args): canvas = _P5_INSTANCE.createCanvas(*args) global width, height width = _P5_INSTANCE.width height = _P5_INSTANCE.height return canvas def __deviceMoved(e): try: _bind_event_function(deviceMoved, e) except NameError: pass def __deviceTurned(e): try: _bind_event_function(deviceTurned, e) except NameError: pass def __deviceShaken(e): try: _bind_event_function(deviceShaken, e) except NameError: pass def __touchEnded(e): try: _bind_event_function(deviceShaken, e) except NameError: pass def __touchStarted(e): try: _bind_event_function(touchStarted, e) except NameError: pass def __windowResized(e): try: _bind_event_function(windowResized, e) except NameError: pass def __touchMoved(e): try: _bind_event_function(touchMoved, e) except NameError: pass def __mouseMoved(e): try: _bind_event_function(mouseMoved, e) except NameError: pass def __mouseDragged(e): try: _bind_event_function(mouseDragged, e) except NameError: pass def __mousePressed(e): try: _bind_event_function(mousePressed, e) except NameError: pass def __mouseReleased(e): try: _bind_event_function(mouseReleased, e) except NameError: pass def __mouseClicked(e): try: _bind_event_function(mouseClicked, e) except NameError: pass def __doubleClicked(e): try: _bind_event_function(doubleClicked, e) except NameError: pass def __mouseWheel(e): try: _bind_event_function(mouseWheel, e) except NameError: pass def __keyPressed(e): try: _bind_event_function(keyPressed, e) except NameError: pass def __keyReleased(e): try: _bind_event_function(keyReleased, e) except NameError: pass def __keyTyped(e): try: _bind_event_function(keyTyped, e) except NameError: pass def __keyIsDown(e): try: _bind_event_function(keyIsDown, e) except NameError: pass def pop(*args): p5_pop = _P5_INSTANCE.pop(*args) return p5_pop # Processing Python or Java mode compatibility aliases size = createCanvas popMatrix = pop popStyle = pop pushMatrix = push pushStyle = push # PVector is a wrapper/helper class for p5.Vector objets # providing names similar to Processing Python or Java modes # but mostly keeping p5js functionality from numbers import Number class PVector: def __init__(self, x=0, y=0, z=0): self.__vector = createVector(x, y, z) self.add = self.__instance_add__ self.sub = self.__instance_sub__ self.mult = self.__instance_mult__ self.div = self.__instance_div__ self.cross = self.__instance_cross__ self.dist = self.__instance_dist__ self.dot = self.__instance_dot__ self.lerp = self.__instance_lerp__ @property def x(self): return self.__vector.x @x.setter def x(self, x): self.__vector.x = x @property def y(self): return self.__vector.y @y.setter def y(self, y): self.__vector.y = y @property def z(self): return self.__vector.z @z.setter def z(self, z): self.__vector.z = z def mag(self): return self.__vector.mag() def magSq(self): return self.__vector.magSq() def setMag(self, mag): self.__vector.setMag(mag) return self def normalize(self): self.__vector.normalize() return self def limit(self, max): self.__vector.limit(max) return self def heading(self): return self.__vector.heading() def rotate(self, angle): self.__vector.rotate(angle) return self def __instance_add__(self, *args): if len(args) == 1: return PVector.add(self, args[0], self) else: return PVector.add(self, PVector(*args), self) def __instance_sub__(self, *args): if len(args) == 1: return PVector.sub(self, args[0], self) else: return PVector.sub(self, PVector(*args), self) def __instance_mult__(self, o): return PVector.mult(self, o, self) def __instance_div__(self, f): return PVector.div(self, f, self) def __instance_cross__(self, o): return PVector.cross(self, o, self) def __instance_dist__(self, o): return PVector.dist(self, o) def __instance_dot__(self, *args): if len(args) == 1: v = args[0] else: v = args return self.x * v[0] + self.y * v[1] + self.z * v[2] def __instance_lerp__(self, *args): if len(args) == 2: return PVector.lerp(self, args[0], args[1], self) else: vx, vy, vz, f = args return PVector.lerp(self, PVector(vx, vy, vz), f, self) def get(self): return PVector(self.x, self.y, self.z) def copy(self): return PVector(self.x, self.y, self.z) def __getitem__(self, k): return getattr(self, ('x', 'y', 'z')[k]) def __setitem__(self, k, v): setattr(self, ('x', 'y', 'z')[k], v) def __copy__(self): return PVector(self.x, self.y, self.z) def __deepcopy__(self, memo): return PVector(self.x, self.y, self.z) def __repr__(self): # PROVISÓRIO return f'PVector({self.x}, {self.y}, {self.z})' def set(self, *args): """ Sets the x, y, and z component of the vector using two or three separate variables, the data from a p5.Vector, or the values from a float array. """ self.__vector.set(*args) @classmethod def add(cls, a, b, dest=None): if dest is None: return PVector(a.x + b[0], a.y + b[1], a.z + b[2]) dest.__vector.set(a.x + b[0], a.y + b[1], a.z + b[2]) return dest @classmethod def sub(cls, a, b, dest=None): if dest is None: return PVector(a.x - b[0], a.y - b[1], a.z - b[2]) dest.__vector.set(a.x - b[0], a.y - b[1], a.z - b[2]) return dest @classmethod def mult(cls, a, b, dest=None): if dest is None: return PVector(a.x * b, a.y * b, a.z * b) dest.__vector.set(a.x * b, a.y * b, a.z * b) return dest @classmethod def div(cls, a, b, dest=None): if dest is None: return PVector(a.x / b, a.y / b, a.z / b) dest.__vector.set(a.x / b, a.y / b, a.z / b) return dest @classmethod def dist(cls, a, b): return a.__vector.dist(b.__vector) @classmethod def dot(cls, a, b): return a.__vector.dot(b.__vector) def __add__(a, b): return PVector.add(a, b, None) def __sub__(a, b): return PVector.sub(a, b, None) def __isub__(a, b): a.sub(b) return a def __iadd__(a, b): a.add(b) return a def __mul__(a, b): if not isinstance(b, Number): raise TypeError( "The * operator can only be used to multiply a PVector by a number") return PVector.mult(a, float(b), None) def __rmul__(a, b): if not isinstance(b, Number): raise TypeError( "The * operator can only be used to multiply a PVector by a number") return PVector.mult(a, float(b), None) def __imul__(a, b): if not isinstance(b, Number): raise TypeError( "The *= operator can only be used to multiply a PVector by a number") a.__vector.mult(float(b)) return a def __truediv__(a, b): if not isinstance(b, Number): raise TypeError( "The * operator can only be used to multiply a PVector by a number") return PVector(a.x / float(b), a.y / float(b), a.z / float(b)) def __itruediv__(a, b): if not isinstance(b, Number): raise TypeError( "The /= operator can only be used to multiply a PVector by a number") a.__vector.set(a.x / float(b), a.y / float(b), a.z / float(b)) return a def __eq__(a, b): return a.x == b[0] and a.y == b[1] and a.z == b[2] def __lt__(a, b): return a.magSq() < b.magSq() def __le__(a, b): return a.magSq() <= b.magSq() def __gt__(a, b): return a.magSq() > b.magSq() def __ge__(a, b): return a.magSq() >= b.magSq() # Problematic class methods, we would rather use p5.Vector when possible... @classmethod def lerp(cls, a, b, f, dest=None): v = createVector(a.x, a.y, a.z) v.lerp(b.__vector, f) if dest is None: return PVector(v.x, v.y, v.z) dest.set(v.x, v.y, v.z) return dest @classmethod def cross(cls, a, b, dest=None): x = a.y * b[2] - b[1] * a.z y = a.z * b[0] - b[2] * a.x z = a.x * b[1] - b[0] * a.y if dest is None: return PVector(x, y, z) dest.set(x, y, z) return dest @classmethod def fromAngle(cls, angle, length=1): # https://github.com/processing/p5.js/blob/3f0b2f0fe575dc81c724474154f5b23a517b7233/src/math/p5.Vector.js return PVector(length * cos(angle), length * sin(angle), 0) @classmethod def fromAngles(theta, phi, length=1): # https://github.com/processing/p5.js/blob/3f0b2f0fe575dc81c724474154f5b23a517b7233/src/math/p5.Vector.js cosPhi = cos(phi) sinPhi = sin(phi) cosTheta = cos(theta) sinTheta = sin(theta) return PVector(length * sinTheta * sinPhi, -length * cosTheta, length * sinTheta * cosPhi) @classmethod def random2D(cls): return PVector.fromAngle(random(TWO_PI)) @classmethod def random3D(cls, dest=None): angle = random(TWO_PI) vz = random(2) - 1 mult = sqrt(1 - vz * vz) vx = mult * cos(angle) vy = mult * sin(angle) if dest is None: return PVector(vx, vy, vz) dest.set(vx, vy, vz) return dest @classmethod def angleBetween(cls, a, b): return acos(a.dot(b) / sqrt(a.magSq() * b.magSq())) # Other harmless p5js methods def equals(self, v): return self == v def heading2D(self): return self.__vector.heading() def reflect(self, *args): # Reflect the incoming vector about a normal to a line in 2D, or about # a normal to a plane in 3D This method acts on the vector directly r = self.__vector.reflect(*args) return r def array(self): # Return a representation of this vector as a float array. This is only # for temporary use. If used in any w fashion, the contents should be # copied by using the p5.Vector.copy() method to copy into your own # array. return self.__vector.array() def toString(self): # Returns a string representation of a vector v by calling String(v) or v.toString(). # return self.__vector.toString() would be something like "p5.vector # Object […, …, …]" return str(self) def rem(self, *args): # Gives remainder of a vector when it is divided by anw vector. See # examples for more context. self.__vector.rem(*args) return self def pre_draw(p5_instance, draw_func, *args, **kwargs): """ We need to run this before the actual draw to insert and update p5 env variables """ global _CTX_MIDDLE, _DEFAULT_FILL, _DEFAULT_LEADMULT, _DEFAULT_STROKE, _DEFAULT_TEXT_FILL global ADD, ALT, ARROW, AUTO, AUDIO, AXES, BACKSPACE, BASELINE, BEVEL, BEZIER, BLEND, BLUR, BOLD, BOLDITALIC global BOTTOM, BURN, CENTER, CHORD, CLAMP, CLOSE, CONTROL, CORNER, CORNERS, CROSS, CURVE, DARKEST global DEG_TO_RAD, DEGREES, DELETE, DIFFERENCE, DILATE, DODGE, DOWN_ARROW, ENTER, ERODE, ESCAPE, EXCLUSION global FILL, GRAY, GRID, HALF_PI, HAND, HARD_LIGHT, HSB, HSL, IMAGE, IMMEDIATE, INVERT, ITALIC, LANDSCAPE global LEFT, LEFT_ARROW, LIGHTEST, LINE_LOOP, LINE_STRIP, LINEAR, LINES, MIRROR, MITER, MOVE, MULTIPLY, NEAREST global NORMAL, OPAQUE, OPEN, OPTION, OVERLAY, P2D, P3D, PI, PIE, POINTS, PORTRAIT, POSTERIZE, PROJECT, QUAD_STRIP global QUADRATIC, QUADS, QUARTER_PI, RAD_TO_DEG, RADIANS, RADIUS, REPEAT, REPLACE, RETURN, RGB, RIGHT, RIGHT_ARROW global ROUND, SCREEN, SHIFT, SOFT_LIGHT, SQUARE, STROKE, SUBTRACT, TAB, TAU, TEXT, TEXTURE, THRESHOLD, TOP global TRIANGLE_FAN, TRIANGLE_STRIP, TRIANGLES, TWO_PI, UP_ARROW, VIDEO, WAIT, WEBGL global frameCount, focused, displayWidth, displayHeight, windowWidth, windowHeight, width, height global deviceOrientation, accelerationX, accelerationY, accelerationZ global pAccelerationX, pAccelerationY, pAccelerationZ, rotationX, rotationY, rotationZ global pRotationX, pRotationY, pRotationZ, turnAxis, keyIsPressed, key, keyCode, mouseX, mouseY, pmouseX, pmouseY global winMouseX, winMouseY, pwinMouseX, pwinMouseY, mouseButton, mouseIsPressed, touches, pixels _CTX_MIDDLE = p5_instance._CTX_MIDDLE _DEFAULT_FILL = p5_instance._DEFAULT_FILL _DEFAULT_LEADMULT = p5_instance._DEFAULT_LEADMULT _DEFAULT_STROKE = p5_instance._DEFAULT_STROKE _DEFAULT_TEXT_FILL = p5_instance._DEFAULT_TEXT_FILL ADD = p5_instance.ADD ALT = p5_instance.ALT ARROW = p5_instance.ARROW AUDIO = p5_instance.AUDIO AUTO = p5_instance.AUTO AXES = p5_instance.AXES BACKSPACE = p5_instance.BACKSPACE BASELINE = p5_instance.BASELINE BEVEL = p5_instance.BEVEL BEZIER = p5_instance.BEZIER BLEND = p5_instance.BLEND BLUR = p5_instance.BLUR BOLD = p5_instance.BOLD BOLDITALIC = p5_instance.BOLDITALIC BOTTOM = p5_instance.BOTTOM BURN = p5_instance.BURN CENTER = p5_instance.CENTER CHORD = p5_instance.CHORD CLAMP = p5_instance.CLAMP CLOSE = p5_instance.CLOSE CONTROL = p5_instance.CONTROL CORNER = p5_instance.CORNER CORNERS = p5_instance.CORNERS CROSS = p5_instance.CROSS CURVE = p5_instance.CURVE DARKEST = p5_instance.DARKEST DEG_TO_RAD = p5_instance.DEG_TO_RAD DEGREES = p5_instance.DEGREES DELETE = p5_instance.DELETE DIFFERENCE = p5_instance.DIFFERENCE DILATE = p5_instance.DILATE DODGE = p5_instance.DODGE DOWN_ARROW = p5_instance.DOWN_ARROW ENTER = p5_instance.ENTER ERODE = p5_instance.ERODE ESCAPE = p5_instance.ESCAPE EXCLUSION = p5_instance.EXCLUSION FILL = p5_instance.FILL GRAY = p5_instance.GRAY GRID = p5_instance.GRID HALF_PI = p5_instance.HALF_PI HAND = p5_instance.HAND HARD_LIGHT = p5_instance.HARD_LIGHT HSB = p5_instance.HSB HSL = p5_instance.HSL IMAGE = p5_instance.IMAGE IMMEDIATE = p5_instance.IMMEDIATE INVERT = p5_instance.INVERT ITALIC = p5_instance.ITALIC LANDSCAPE = p5_instance.LANDSCAPE LEFT = p5_instance.LEFT LEFT_ARROW = p5_instance.LEFT_ARROW LIGHTEST = p5_instance.LIGHTEST LINE_LOOP = p5_instance.LINE_LOOP LINE_STRIP = p5_instance.LINE_STRIP LINEAR = p5_instance.LINEAR LINES = p5_instance.LINES MIRROR = p5_instance.MIRROR MITER = p5_instance.MITER MOVE = p5_instance.MOVE MULTIPLY = p5_instance.MULTIPLY NEAREST = p5_instance.NEAREST NORMAL = p5_instance.NORMAL OPAQUE = p5_instance.OPAQUE OPEN = p5_instance.OPEN OPTION = p5_instance.OPTION OVERLAY = p5_instance.OVERLAY P2D = p5_instance.P2D P3D = p5_instance.WEBGL PI = p5_instance.PI PIE = p5_instance.PIE POINTS = p5_instance.POINTS PORTRAIT = p5_instance.PORTRAIT POSTERIZE = p5_instance.POSTERIZE PROJECT = p5_instance.PROJECT QUAD_STRIP = p5_instance.QUAD_STRIP QUADRATIC = p5_instance.QUADRATIC QUADS = p5_instance.QUADS QUARTER_PI = p5_instance.QUARTER_PI RAD_TO_DEG = p5_instance.RAD_TO_DEG RADIANS = p5_instance.RADIANS RADIUS = p5_instance.RADIUS REPEAT = p5_instance.REPEAT REPLACE = p5_instance.REPLACE RETURN = p5_instance.RETURN RGB = p5_instance.RGB RIGHT = p5_instance.RIGHT RIGHT_ARROW = p5_instance.RIGHT_ARROW ROUND = p5_instance.ROUND SCREEN = p5_instance.SCREEN SHIFT = p5_instance.SHIFT SOFT_LIGHT = p5_instance.SOFT_LIGHT SQUARE = p5_instance.SQUARE STROKE = p5_instance.STROKE SUBTRACT = p5_instance.SUBTRACT TAB = p5_instance.TAB TAU = p5_instance.TAU TEXT = p5_instance.TEXT TEXTURE = p5_instance.TEXTURE THRESHOLD = p5_instance.THRESHOLD TOP = p5_instance.TOP TRIANGLE_FAN = p5_instance.TRIANGLE_FAN TRIANGLE_STRIP = p5_instance.TRIANGLE_STRIP TRIANGLES = p5_instance.TRIANGLES TWO_PI = p5_instance.TWO_PI UP_ARROW = p5_instance.UP_ARROW VIDEO = p5_instance.VIDEO WAIT = p5_instance.WAIT WEBGL = p5_instance.WEBGL frameCount = p5_instance.frameCount focused = p5_instance.focused displayWidth = p5_instance.displayWidth displayHeight = p5_instance.displayHeight windowWidth = p5_instance.windowWidth windowHeight = p5_instance.windowHeight width = p5_instance.width height = p5_instance.height deviceOrientation = p5_instance.deviceOrientation accelerationX = p5_instance.accelerationX accelerationY = p5_instance.accelerationY accelerationZ = p5_instance.accelerationZ pAccelerationX = p5_instance.pAccelerationX pAccelerationY = p5_instance.pAccelerationY pAccelerationZ = p5_instance.pAccelerationZ rotationX = p5_instance.rotationX rotationY = p5_instance.rotationY rotationZ = p5_instance.rotationZ pRotationX = p5_instance.pRotationX pRotationY = p5_instance.pRotationY pRotationZ = p5_instance.pRotationZ turnAxis = p5_instance.turnAxis keyIsPressed = p5_instance.keyIsPressed key = p5_instance.key keyCode = p5_instance.keyCode mouseX = p5_instance.mouseX mouseY = p5_instance.mouseY pmouseX = p5_instance.pmouseX pmouseY = p5_instance.pmouseY winMouseX = p5_instance.winMouseX winMouseY = p5_instance.winMouseY pwinMouseX = p5_instance.pwinMouseX pwinMouseY = p5_instance.pwinMouseY mouseButton = p5_instance.mouseButton mouseIsPressed = p5_instance.mouseIsPressed touches = p5_instance.touches pixels = p5_instance.pixels return draw_func(*args, **kwargs) def global_p5_injection(p5_sketch): """ Injects the p5js's skecth instance as a global variable to setup and draw functions """ def decorator(f, *args, **kwargs): def wrapper(*args, **kwargs): global _P5_INSTANCE _P5_INSTANCE = p5_sketch return pre_draw(_P5_INSTANCE, f, *args, **kwargs) return wrapper return decorator def start_p5(preload_func, setup_func, draw_func, event_functions): """ This is the entrypoint function. It accepts 2 parameters: - preload_func: A Python preload callable - setup_func: a Python setup callable - draw_func: a Python draw callable - event_functions: a config dict for the event functions in the format: {"eventFunctionName": python_event_function} This method gets the p5js's sketch instance and injects them """ def sketch_setup(p5_sketch): """ Callback function called to configure new p5 instance """ p5_sketch.preload = global_p5_injection(p5_sketch)(preload_func) p5_sketch.setup = global_p5_injection(p5_sketch)(setup_func) p5_sketch.draw = global_p5_injection(p5_sketch)(draw_func) window.instance = p5.new(sketch_setup, 'sketch-holder') # Register event functions event_function_names = ( "deviceMoved", "deviceTurned", "deviceShaken", "windowResized", "keyPressed", "keyReleased", "keyTyped", "mousePressed", "mouseReleased", "mouseClicked", "doubleClicked", "mouseMoved", "mouseDragged", "mouseWheel", "touchStarted", "touchMoved", "touchEnded", "keyIsDown", ) for f_name in [f for f in event_function_names if event_functions.get(f, None)]: func = event_functions[f_name] event_func = global_p5_injection(window.instance)(func) setattr(window.instance, f_name, event_func) `; const placeholder = ` def preload(): pass def setup(): pass def draw(): pass deviceMoved = None deviceTurned = None deviceShaken = None keyPressed = None keyReleased = None keyTyped = None mouseMoved = None mouseDragged = None mousePressed = None mouseReleased = None mouseClicked = None doubleClicked = None mouseWheel = None touchStarted = None touchMoved = None touchEnded = None windowResized = None `; let userCode = ` import random def load_image(img_file, im_dir="images",ext="png"): img = loadImage("%s/%s.%s" %(im_dir,img_file,ext)) return img class Actor: def __init__(self,img,x=0,y=0): self.img = load_image(img) self.x = x self.y = y def draw(self): image(self.img,self.x,self.y) COLS = 4 ROWS= 3 IMSIZE = 200 STATUS = [] # cells that have been clicked on ignore = [] # cells that have been matches and are no longer in play # Create two of each card image, then randomize before creating the board START_IMAGES= [ "im"+str(i+1) for i in range(COLS*ROWS//2)]*2 random.shuffle(START_IMAGES) board = [] # initialize the board steve = None checkmark = None def setup(): global steve, checkmark checkmark = Actor('checkmark') steve = Actor('card_back') steve.x, steve.y = 0, 0 for row in range(ROWS): new_row=[] for col in range(COLS): image_name = START_IMAGES.pop() temp=Actor(image_name, col*IMSIZE, row*IMSIZE) temp.image_name = image_name # used to verify matches new_row.append(temp) board.append(new_row) createCanvas(COLS * IMSIZE, ROWS * IMSIZE) def draw(): background(200) for row in range(ROWS): for col in range(COLS): if (row, col) in ignore: # already matched checkmark.x, checkmark.y = IMSIZE * col, IMSIZE * row checkmark.draw() elif (row, col) in STATUS: # clicked this move: show face board[row][col].draw() else: # regular clickable card steve.x, steve.y = IMSIZE * col, IMSIZE * row steve.draw() def findTile(pos): y, x = pos result = x // IMSIZE , y // IMSIZE return result def mousePressed(): global STATUS, ignore if len(STATUS) == 2: STATUS = [] pos = (mouseX, mouseY) if pos in ignore: # has already been matched return if mouseButton == LEFT: coords = findTile(pos) xc, yc = coords if not ((0 <= xc < ROWS) and (0 <= yc < COLS)): return if coords not in STATUS: STATUS.append(coords) # now they are if len(STATUS) == 1: # 1st click - turn not yet over pass elif len(STATUS) == 2: # 2nd click - check for match (x1, y1), (x2, y2) = STATUS if board[x1][y1].image_name == board[x2][y2].image_name: for pos in STATUS: ignore.append(pos) `; const startCode = ` event_functions = { "deviceMoved": deviceMoved, "deviceTurned": deviceTurned, "deviceShaken": deviceShaken, "keyPressed": keyPressed, "keyReleased": keyReleased, "keyTyped": keyTyped, "mouseMoved": mouseMoved, "mouseDragged": mouseDragged, "mousePressed": mousePressed, "mouseReleased": mouseReleased, "mouseClicked": mouseClicked, "doubleClicked": doubleClicked, "mouseWheel": mouseWheel, "touchStarted": touchStarted, "touchMoved": touchMoved, "touchEnded": touchEnded, "windowResized": windowResized, } start_p5(preload, setup, draw, event_functions) `; function runCode() { let code = [ placeholder, userCode, wrapperContent, startCode, ].join('\n'); if (window.instance) { window.instance.canvas.remove(); } console.log("Python execution output:"); window.pyodide.runPython(code); } async function main() { const config = { indexURL : "https://cdn.jsdelivr.net/pyodide/v0.18.1/full/", fullStdLib: false, } window.pyodide = await loadPyodide(config); // Pyodide is now ready to use... console.log(window.pyodide.runPython(` import io, code, sys from js import p5, window, document print(sys.version) `)); window.runSketchCode = (code) => { userCode = code; runCode(); } runCode(); }; // async method main(); ================================================ FILE: docs/examples/pyodide/mines/index.html ================================================ mines - pyp5js

Python code here.

from random import randint

def load_image(img_file, im_dir="images",ext="png"):
    img = loadImage("%s/%s.%s" %(im_dir,img_file,ext))
    return img

class Actor:
    def __init__(self,img,x=0,y=0):
        self.img = load_image(img)
        self.x = x
        self.y = y

    def draw(self):
        image(self.img,self.x,self.y)

NCOLS  = 10
NROWS  = 10
NMINES = 10
CELLSIZE = 60
WIDTH =  NCOLS * CELLSIZE + CELLSIZE // 2 + 1
HEIGHT = NROWS * CELLSIZE + CELLSIZE // 2 + 1

top_grid = None
base_grid = None
cover = None
flag = None
tiles = None

def setup():
    global top_grid, base_grid, cover, flag, tiles
    top_grid  = setup_empty_grid(NCOLS, NROWS, 1)
    base_grid = setup_empty_grid(NCOLS, NROWS, 0)
    populate_grid(NMINES, NCOLS, NROWS)
    count_mines()
    createCanvas(WIDTH, HEIGHT)
    cover = Actor('cover')
    flag  = Actor('flag')
    tiles = {0: Actor('blank'), 1: Actor('one'), 2: Actor('two'),
             3: Actor('three'), 4: Actor('four'),5: Actor('five'),
             6: Actor('six'), 7: Actor('seven'), 8: Actor('eight'),
             'M': Actor('mine')}

def draw():
    ypos = -CELLSIZE
    for row in range(NROWS):
        ypos += CELLSIZE
        xpos = -CELLSIZE
        for col in range(NCOLS):
            xpos += CELLSIZE
            gridpos = base_grid[row][col]
            tiles[gridpos].x,tiles[gridpos].y = xpos, ypos
            tiles[gridpos].draw()
    ypos = -CELLSIZE
    for row in range(NROWS):
        ypos += CELLSIZE
        xpos = -CELLSIZE
        for col in range(NCOLS):
            xpos += CELLSIZE
            if top_grid[row][col] == 1:
                cover.x, cover.y = xpos, ypos
                cover.draw()
            elif top_grid[row][col] == 'F':
                flag.x, flag.y = xpos, ypos
                flag.draw()

def mousePressed(*args, **kwargs):
    col, row = mouseX // CELLSIZE, mouseY // CELLSIZE
    if not ((0 <= col < NCOLS) and (0 <= row < NROWS)):
        return
    if mouseButton == LEFT:
        if top_grid[row][col] != 'F':
            top_grid[row][col] = 0
            if base_grid[row][col] == 0:
                edge_detection(col, row)
    elif mouseButton == CENTER:
        if top_grid[row][col] == 1:
            top_grid[row][col] = 'F'
        elif top_grid[row][col] == 'F':
            top_grid[row][col] = 1

def setup_empty_grid(NCOLS, NROWS, filler):
    grid = [[filler] * NCOLS for rows in range(NROWS)]
    return grid

def populate_grid(NMINES, NCOLS, NROWS):
    global base_grid
    for mine in range(NMINES):
        col, row = randint(0, NCOLS - 1), randint(0,NROWS - 1)
        while base_grid[row][col] == 'M':
            col, row = randint(0, NCOLS - 1), randint(0,NROWS - 1)
        base_grid[row][col] = 'M'

def count_mines():
    global base_grid
    for r in range(NROWS):
        for c in range(NCOLS):
            if base_grid[r][c] != 'M':
                neighbors = [(c - 1, r - 1), (c, r - 1), (c + 1, r - 1),
                             (c - 1, r),                     (c + 1, r),
                             (c - 1, r + 1), (c, r + 1), (c + 1, r + 1)]
                for nx, ny in neighbors:
                    try:
                        if ny >= 0 and nx >= 0 and base_grid[ny][nx] == 'M':
                            base_grid[r][c] += 1
                    except IndexError:
                        pass


def edge_detection(col, row):
    zeros = [(col, row)]
    for c, r in zeros:
        top_grid[r][c] = 0
        neighbors = [(c - 1, r - 1), (c, r - 1), (c + 1, r - 1),
                     (c - 1, r    ),             (c + 1, r    ),
                     (c - 1, r + 1), (c, r + 1), (c + 1, r + 1)]
        for nx, ny in neighbors:
            try:
                if ny >= 0 and nx >= 0:
                    if base_grid[ny][nx] == 0 and top_grid[ny][nx] == 1:
                        if top_grid[ny][nx] != 'F':
                            top_grid[ny][nx] = 0
                        if (nx, ny) not in zeros:
                            zeros.append((nx, ny))
                    else:
                        if top_grid[ny][nx] != 'F':
                            top_grid[ny][nx] = 0

            except:
                pass
================================================ FILE: docs/examples/pyodide/mines/mines.py ================================================ from random import randint def load_image(img_file, im_dir="images",ext="png"): img = loadImage("%s/%s.%s" %(im_dir,img_file,ext)) return img class Actor: def __init__(self,img,x=0,y=0): self.img = load_image(img) self.x = x self.y = y def draw(self): image(self.img,self.x,self.y) NCOLS = 10 NROWS = 10 NMINES = 10 CELLSIZE = 60 WIDTH = NCOLS * CELLSIZE + CELLSIZE // 2 + 1 HEIGHT = NROWS * CELLSIZE + CELLSIZE // 2 + 1 top_grid = None base_grid = None cover = None flag = None tiles = None def setup(): global top_grid, base_grid, cover, flag, tiles top_grid = setup_empty_grid(NCOLS, NROWS, 1) base_grid = setup_empty_grid(NCOLS, NROWS, 0) populate_grid(NMINES, NCOLS, NROWS) count_mines() createCanvas(WIDTH, HEIGHT) cover = Actor('cover') flag = Actor('flag') tiles = {0: Actor('blank'), 1: Actor('one'), 2: Actor('two'), 3: Actor('three'), 4: Actor('four'),5: Actor('five'), 6: Actor('six'), 7: Actor('seven'), 8: Actor('eight'), 'M': Actor('mine')} def draw(): ypos = -CELLSIZE for row in range(NROWS): ypos += CELLSIZE xpos = -CELLSIZE for col in range(NCOLS): xpos += CELLSIZE gridpos = base_grid[row][col] tiles[gridpos].x,tiles[gridpos].y = xpos, ypos tiles[gridpos].draw() ypos = -CELLSIZE for row in range(NROWS): ypos += CELLSIZE xpos = -CELLSIZE for col in range(NCOLS): xpos += CELLSIZE if top_grid[row][col] == 1: cover.x, cover.y = xpos, ypos cover.draw() elif top_grid[row][col] == 'F': flag.x, flag.y = xpos, ypos flag.draw() def mousePressed(*args, **kwargs): col, row = mouseX // CELLSIZE, mouseY // CELLSIZE if not ((0 <= col < NCOLS) and (0 <= row < NROWS)): return if mouseButton == LEFT: if top_grid[row][col] != 'F': top_grid[row][col] = 0 if base_grid[row][col] == 0: edge_detection(col, row) elif mouseButton == CENTER: if top_grid[row][col] == 1: top_grid[row][col] = 'F' elif top_grid[row][col] == 'F': top_grid[row][col] = 1 def setup_empty_grid(NCOLS, NROWS, filler): grid = [[filler] * NCOLS for rows in range(NROWS)] return grid def populate_grid(NMINES, NCOLS, NROWS): global base_grid for mine in range(NMINES): col, row = randint(0, NCOLS - 1), randint(0,NROWS - 1) while base_grid[row][col] == 'M': col, row = randint(0, NCOLS - 1), randint(0,NROWS - 1) base_grid[row][col] = 'M' def count_mines(): global base_grid for r in range(NROWS): for c in range(NCOLS): if base_grid[r][c] != 'M': neighbors = [(c - 1, r - 1), (c, r - 1), (c + 1, r - 1), (c - 1, r), (c + 1, r), (c - 1, r + 1), (c, r + 1), (c + 1, r + 1)] for nx, ny in neighbors: try: if ny >= 0 and nx >= 0 and base_grid[ny][nx] == 'M': base_grid[r][c] += 1 except IndexError: pass def edge_detection(col, row): zeros = [(col, row)] for c, r in zeros: top_grid[r][c] = 0 neighbors = [(c - 1, r - 1), (c, r - 1), (c + 1, r - 1), (c - 1, r ), (c + 1, r ), (c - 1, r + 1), (c, r + 1), (c + 1, r + 1)] for nx, ny in neighbors: try: if ny >= 0 and nx >= 0: if base_grid[ny][nx] == 0 and top_grid[ny][nx] == 1: if top_grid[ny][nx] != 'F': top_grid[ny][nx] = 0 if (nx, ny) not in zeros: zeros.append((nx, ny)) else: if top_grid[ny][nx] != 'F': top_grid[ny][nx] = 0 except: pass ================================================ FILE: docs/examples/pyodide/mines/static/p5.js ================================================ /*! p5.js v1.0.0 February 29, 2020 */ !function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).p5=e()}}(function(){return function o(a,s,l){function u(t,e){if(!s[t]){if(!a[t]){var r="function"==typeof require&&require;if(!e&&r)return r(t,!0);if(h)return h(t,!0);var i=new Error("Cannot find module '"+t+"'");throw i.code="MODULE_NOT_FOUND",i}var n=s[t]={exports:{}};a[t][0].call(n.exports,function(e){return u(a[t][1][e]||e)},n,n.exports,o,a,s,l)}return s[t].exports}for(var h="function"==typeof require&&require,e=0;e>16&255,a[s++]=t>>8&255,a[s++]=255&t;2===o&&(t=u[e.charCodeAt(r)]<<2|u[e.charCodeAt(r+1)]>>4,a[s++]=255&t);1===o&&(t=u[e.charCodeAt(r)]<<10|u[e.charCodeAt(r+1)]<<4|u[e.charCodeAt(r+2)]>>2,a[s++]=t>>8&255,a[s++]=255&t);return a},r.fromByteArray=function(e){for(var t,r=e.length,i=r%3,n=[],o=0,a=r-i;o>2]+s[t<<4&63]+"==")):2==i&&(t=(e[r-2]<<8)+e[r-1],n.push(s[t>>10]+s[t>>4&63]+s[t<<2&63]+"="));return n.join("")};for(var s=[],u=[],h="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=0,o=i.length;n>18&63]+s[n>>12&63]+s[n>>6&63]+s[63&n]);return o.join("")}u["-".charCodeAt(0)]=62,u["_".charCodeAt(0)]=63},{}],20:[function(e,t,r){},{}],21:[function(N,e,F){(function(c){"use strict";var i=N("base64-js"),o=N("ieee754"),e="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;F.Buffer=c,F.SlowBuffer=function(e){+e!=e&&(e=0);return c.alloc(+e)},F.INSPECT_MAX_BYTES=50;var r=2147483647;function a(e){if(r>>1;case"base64":return O(e).length;default:if(n)return i?-1:R(e).length;t=(""+t).toLowerCase(),n=!0}}function d(e,t,r){var i=e[t];e[t]=e[r],e[r]=i}function p(e,t,r,i,n){if(0===e.length)return-1;if("string"==typeof r?(i=r,r=0):2147483647=e.length){if(n)return-1;r=e.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof t&&(t=c.from(t,i)),c.isBuffer(t))return 0===t.length?-1:m(e,t,r,i,n);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):m(e,[t],r,i,n);throw new TypeError("val must be string, number or Buffer")}function m(e,t,r,i,n){var o,a=1,s=e.length,l=t.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(e.length<2||t.length<2)return-1;s/=a=2,l/=2,r/=2}function u(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(n){var h=-1;for(o=r;o>8,n=r%256,o.push(n),o.push(i);return o}(t,e.length-r),e,r,i)}function b(e,t,r){return 0===t&&r===e.length?i.fromByteArray(e):i.fromByteArray(e.slice(t,r))}function _(e,t,r){r=Math.min(e.length,r);for(var i=[],n=t;n>>10&1023|55296),h=56320|1023&h),i.push(h),n+=c}return function(e){var t=e.length;if(t<=x)return String.fromCharCode.apply(String,e);var r="",i=0;for(;ithis.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e=e||"utf8";;)switch(e){case"hex":return M(this,t,r);case"utf8":case"utf-8":return _(this,t,r);case"ascii":return w(this,t,r);case"latin1":case"binary":return S(this,t,r);case"base64":return b(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,t,r);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}.apply(this,arguments)},c.prototype.equals=function(e){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===c.compare(this,e)},c.prototype.inspect=function(){var e="",t=F.INSPECT_MAX_BYTES;return e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(e+=" ... "),""},e&&(c.prototype[e]=c.prototype.inspect),c.prototype.compare=function(e,t,r,i,n){if(A(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),t<0||r>e.length||i<0||n>this.length)throw new RangeError("out of range index");if(n<=i&&r<=t)return 0;if(n<=i)return-1;if(r<=t)return 1;if(this===e)return 0;for(var o=(n>>>=0)-(i>>>=0),a=(r>>>=0)-(t>>>=0),s=Math.min(o,a),l=this.slice(i,n),u=e.slice(t,r),h=0;h>>=0,isFinite(r)?(r>>>=0,void 0===i&&(i="utf8")):(i=r,r=void 0)}var n=this.length-t;if((void 0===r||nthis.length)throw new RangeError("Attempt to write outside buffer bounds");i=i||"utf8";for(var o,a,s,l,u,h,c=!1;;)switch(i){case"hex":return g(this,e,t,r);case"utf8":case"utf-8":return u=t,h=r,D(R(e,(l=this).length-u),l,u,h);case"ascii":return v(this,e,t,r);case"latin1":case"binary":return v(this,e,t,r);case"base64":return o=this,a=t,s=r,D(O(e),o,a,s);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return y(this,e,t,r);default:if(c)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),c=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var x=4096;function w(e,t,r){var i="";r=Math.min(e.length,r);for(var n=t;ne.length)throw new RangeError("Index out of range")}function P(e,t,r,i){if(r+i>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function L(e,t,r,i,n){return t=+t,r>>>=0,n||P(e,0,r,4),o.write(e,t,r,i,23,4),r+4}function k(e,t,r,i,n){return t=+t,r>>>=0,n||P(e,0,r,8),o.write(e,t,r,i,52,8),r+8}c.prototype.slice=function(e,t){var r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):r>>=0,t>>>=0,r||T(e,t,this.length);for(var i=this[e],n=1,o=0;++o>>=0,t>>>=0,r||T(e,t,this.length);for(var i=this[e+--t],n=1;0>>=0,t||T(e,1,this.length),this[e]},c.prototype.readUInt16LE=function(e,t){return e>>>=0,t||T(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUInt16BE=function(e,t){return e>>>=0,t||T(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUInt32LE=function(e,t){return e>>>=0,t||T(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUInt32BE=function(e,t){return e>>>=0,t||T(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||T(e,t,this.length);for(var i=this[e],n=1,o=0;++o>>=0,t>>>=0,r||T(e,t,this.length);for(var i=t,n=1,o=this[e+--i];0>>=0,t||T(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){e>>>=0,t||T(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(e,t){e>>>=0,t||T(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(e,t){return e>>>=0,t||T(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return e>>>=0,t||T(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readFloatLE=function(e,t){return e>>>=0,t||T(e,4,this.length),o.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return e>>>=0,t||T(e,4,this.length),o.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return e>>>=0,t||T(e,8,this.length),o.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return e>>>=0,t||T(e,8,this.length),o.read(this,e,!1,52,8)},c.prototype.writeUIntLE=function(e,t,r,i){e=+e,t>>>=0,r>>>=0,i||C(this,e,t,r,Math.pow(2,8*r)-1,0);var n=1,o=0;for(this[t]=255&e;++o>>=0,r>>>=0,i||C(this,e,t,r,Math.pow(2,8*r)-1,0);var n=r-1,o=1;for(this[t+n]=255&e;0<=--n&&(o*=256);)this[t+n]=e/o&255;return t+r},c.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,1,255,0),this[t]=255&e,t+1},c.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},c.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeIntLE=function(e,t,r,i){if(e=+e,t>>>=0,!i){var n=Math.pow(2,8*r-1);C(this,e,t,r,n-1,-n)}var o=0,a=1,s=0;for(this[t]=255&e;++o>0)-s&255;return t+r},c.prototype.writeIntBE=function(e,t,r,i){if(e=+e,t>>>=0,!i){var n=Math.pow(2,8*r-1);C(this,e,t,r,n-1,-n)}var o=r-1,a=1,s=0;for(this[t+o]=255&e;0<=--o&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+r},c.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},c.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeFloatLE=function(e,t,r){return L(this,e,t,!0,r)},c.prototype.writeFloatBE=function(e,t,r){return L(this,e,t,!1,r)},c.prototype.writeDoubleLE=function(e,t,r){return k(this,e,t,!0,r)},c.prototype.writeDoubleBE=function(e,t,r){return k(this,e,t,!1,r)},c.prototype.copy=function(e,t,r,i){if(!c.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r=r||0,i||0===i||(i=this.length),t>=e.length&&(t=e.length),t=t||0,0=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t>>=0,r=void 0===r?this.length:r>>>0,"number"==typeof(e=e||0))for(o=t;o>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function O(e){return i.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(t,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function D(e,t,r,i){for(var n=0;n=t.length||n>=e.length);++n)t[n+r]=e[n];return n}function A(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function I(e){return e!=e}var U=function(){for(var e="0123456789abcdef",t=new Array(256),r=0;r<16;++r)for(var i=16*r,n=0;n<16;++n)t[i+n]=e[r]+e[n];return t}()}).call(this,N("buffer").Buffer)},{"base64-js":19,buffer:21,ieee754:30}],22:[function(e,t,r){"use strict";t.exports=e("./").polyfill()},{"./":23}],23:[function(z,r,i){(function(j,V){var e,t;e=this,t=function(){"use strict";function l(e){return"function"==typeof e}var r=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},i=0,t=void 0,n=void 0,a=function(e,t){f[i]=e,f[i+1]=t,2===(i+=2)&&(n?n(d):y())};var e="undefined"!=typeof window?window:void 0,o=e||{},s=o.MutationObserver||o.WebKitMutationObserver,u="undefined"==typeof self&&void 0!==j&&"[object process]"==={}.toString.call(j),h="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function c(){var e=setTimeout;return function(){return e(d,1)}}var f=new Array(1e3);function d(){for(var e=0;e":">",'"':""","'":"'","/":"/"};function S(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,function(e){return w[e]}):e}var M=function(){function i(e){var t,r=1=this.maxReplaces)break}for(a=0;r=this.regexp.exec(e);){if(void 0===(i=h(r[1].trim())))if("function"==typeof c){var d=c(e,r,t);i="string"==typeof d?d:""}else this.logger.warn("missed to pass in variable ".concat(r[1]," for interpolating ").concat(e)),i="";else"string"==typeof i||this.useRawValueToEscape||(i=v(i));if(i=this.escapeValue?u(this.escape(i)):u(i),e=e.replace(r[0],i),this.regexp.lastIndex=0,++a>=this.maxReplaces)break}return e}},{key:"nest",value:function(e,t,r){var i,n,o=D({},2>1,h=-7,c=r?n-1:0,f=r?-1:1,d=e[t+c];for(c+=f,o=d&(1<<-h)-1,d>>=-h,h+=s;0>=-h,h+=i;0>1,f=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,d=i?0:o-1,p=i?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=h):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),2<=(t+=1<=a+c?f/l:f*Math.pow(2,1-c))*l&&(a++,l/=2),h<=a+c?(s=0,a=h):1<=a+c?(s=(t*l-1)*Math.pow(2,n),a+=c):(s=t*Math.pow(2,c-1)*Math.pow(2,n),a=0));8<=n;e[r+d]=255&s,d+=p,s/=256,n-=8);for(a=a<Math.abs(e[0])&&(t=1),Math.abs(e[2])>Math.abs(e[t])&&(t=2),t}var C=4e150;function P(e,t){e.f+=t.f,e.b.f+=t.b.f}function u(e,t,r){return e=e.a,t=t.a,r=r.a,t.b.a===e?r.b.a===e?v(t.a,r.a)?b(r.b.a,t.a,r.a)<=0:0<=b(t.b.a,r.a,t.a):b(r.b.a,e,r.a)<=0:r.b.a===e?0<=b(t.b.a,e,t.a):(t=y(t.b.a,e,t.a),(e=y(r.b.a,e,r.a))<=t)}function L(e){e.a.i=null;var t=e.e;t.a.c=t.c,t.c.a=t.a,e.e=null}function h(e,t){c(e.a),e.c=!1,(e.a=t).i=e}function k(e){for(var t=e.a.a;(e=fe(e)).a.a===t;);return e.c&&(h(e,t=f(ce(e).a.b,e.a.e)),e=fe(e)),e}function R(e,t,r){var i=new he;return i.a=r,i.e=W(e.f,t.e,i),r.i=i}function O(e,t){switch(e.s){case 100130:return 0!=(1&t);case 100131:return 0!==t;case 100132:return 0>1]],s[a[u]])?le(r,u):ue(r,u)),s[o]=null,l[o]=r.b,r.b=o}else for(r.c[-(o+1)]=null;0Math.max(a.a,l.a))return!1;if(v(o,a)){if(0i.f&&(i.f*=2,i.c=oe(i.c,i.f+1)),0===i.b?r=n:(r=i.b,i.b=i.c[i.b]),i.e[r]=t,i.c[r]=n,i.d[n]=r,i.h&&ue(i,n),r}return i=e.a++,e.c[i]=t,-(i+1)}function ie(e){if(0===e.a)return se(e.b);var t=e.c[e.d[e.a-1]];if(0!==e.b.a&&v(ae(e.b),t))return se(e.b);for(;--e.a,0e.a||v(i[a],i[l])){n[r[o]=a]=o;break}n[r[o]=l]=o,o=s}}function ue(e,t){for(var r=e.d,i=e.e,n=e.c,o=t,a=r[o];;){var s=o>>1,l=r[s];if(0==s||v(i[l],i[a])){n[r[o]=a]=o;break}n[r[o]=l]=o,o=s}}function he(){this.e=this.a=null,this.f=0,this.c=this.b=this.h=this.d=!1}function ce(e){return e.e.c.b}function fe(e){return e.e.a.b}(i=q.prototype).x=function(){Y(this,0)},i.B=function(e,t){switch(e){case 100142:return;case 100140:switch(t){case 100130:case 100131:case 100132:case 100133:case 100134:return void(this.s=t)}break;case 100141:return void(this.m=!!t);default:return void Z(this,100900)}Z(this,100901)},i.y=function(e){switch(e){case 100142:return 0;case 100140:return this.s;case 100141:return this.m;default:Z(this,100900)}return!1},i.A=function(e,t,r){this.j[0]=e,this.j[1]=t,this.j[2]=r},i.z=function(e,t){var r=t||null;switch(e){case 100100:case 100106:this.h=r;break;case 100104:case 100110:this.l=r;break;case 100101:case 100107:this.k=r;break;case 100102:case 100108:this.i=r;break;case 100103:case 100109:this.p=r;break;case 100105:case 100111:this.o=r;break;case 100112:this.r=r;break;default:Z(this,100900)}},i.C=function(e,t){var r=!1,i=[0,0,0];Y(this,2);for(var n=0;n<3;++n){var o=e[n];o<-1e150&&(o=-1e150,r=!0),1e150n[u]&&(n[u]=h,a[u]=l)}if(l=0,n[1]-o[1]>n[0]-o[0]&&(l=1),n[2]-o[2]>n[l]-o[l]&&(l=2),o[l]>=n[l])i[0]=0,i[1]=0,i[2]=1;else{for(n=0,o=s[l],a=a[l],s=[0,0,0],o=[o.g[0]-a.g[0],o.g[1]-a.g[1],o.g[2]-a.g[2]],u=[0,0,0],l=r.e;l!==r;l=l.e)u[0]=l.g[0]-a.g[0],u[1]=l.g[1]-a.g[1],u[2]=l.g[2]-a.g[2],s[0]=o[1]*u[2]-o[2]*u[1],s[1]=o[2]*u[0]-o[0]*u[2],s[2]=o[0]*u[1]-o[1]*u[0],n<(h=s[0]*s[0]+s[1]*s[1]+s[2]*s[2])&&(n=h,i[0]=s[0],i[1]=s[1],i[2]=s[2]);n<=0&&(i[0]=i[1]=i[2]=0,i[T(o)]=1)}r=!0}for(s=T(i),l=this.b.c,n=(s+1)%3,a=(s+2)%3,s=0>=l,h-=l,g!=o){if(g==a)break;for(var v=g>8,++y;var _=b;if(i>=8;null!==m&&s<4096&&(p[s++]=m<<8|_,u+1<=s&&l<12&&(++l,u=u<<1|1)),m=g}else s=1+a,u=(1<<(l=n+1))-1,m=null}return f!==i&&console.log("Warning, gif stream shorter than expected."),r}try{r.GifWriter=function(v,e,t,r){var y=0,i=void 0===(r=void 0===r?{}:r).loop?null:r.loop,b=void 0===r.palette?null:r.palette;if(e<=0||t<=0||65535>=1;)++n;if(a=1<>8&255,v[y++]=255&t,v[y++]=t>>8&255,v[y++]=(null!==b?128:0)|n,v[y++]=o,v[y++]=0,null!==b)for(var s=0,l=b.length;s>16&255,v[y++]=u>>8&255,v[y++]=255&u}if(null!==i){if(i<0||65535>8&255,v[y++]=0}var x=!1;this.addFrame=function(e,t,r,i,n,o){if(!0===x&&(--y,x=!1),o=void 0===o?{}:o,e<0||t<0||65535>=1;)++u;l=1<>8&255,v[y++]=d,v[y++]=0),v[y++]=44,v[y++]=255&e,v[y++]=e>>8&255,v[y++]=255&t,v[y++]=t>>8&255,v[y++]=255&r,v[y++]=r>>8&255,v[y++]=255&i,v[y++]=i>>8&255,v[y++]=!0===a?128|u-1:0,!0===a)for(var p=0,m=s.length;p>16&255,v[y++]=g>>8&255,v[y++]=255&g}return y=function(t,r,e,i){t[r++]=e;var n=r++,o=1<>=8,h-=8,r===n+256&&(t[n]=255,n=r++)}function d(e){c|=e<>=8,h-=8,r===n+256&&(t[n]=255,n=r++);4096===l?(d(o),l=1+s,u=e+1,m={}):(1<>7,n=1<<1+(7&r);x[e++],x[e++];var o=null,a=null;i&&(o=e,e+=3*(a=n));var s=!0,l=[],u=0,h=null,c=0,f=null;for(this.width=w,this.height=t;s&&e>2&7,e++;break;case 254:for(;;){if(!(0<=(C=x[e++])))throw Error("Invalid block size");if(0===C)break;e+=C}break;default:throw new Error("Unknown graphic control label: 0x"+x[e-1].toString(16))}break;case 44:var p=x[e++]|x[e++]<<8,m=x[e++]|x[e++]<<8,g=x[e++]|x[e++]<<8,v=x[e++]|x[e++]<<8,y=x[e++],b=y>>6&1,_=1<<1+(7&y),S=o,M=a,E=!1;if(y>>7){E=!0;S=e,e+=3*(M=_)}var T=e;for(e++;;){var C;if(!(0<=(C=x[e++])))throw Error("Invalid block size");if(0===C)break;e+=C}l.push({x:p,y:m,width:g,height:v,has_local_palette:E,palette_offset:S,palette_size:M,data_offset:T,data_length:e-T,transparent_index:h,interlaced:!!b,delay:u,disposal:c});break;case 59:s=!1;break;default:throw new Error("Unknown gif block: 0x"+x[e-1].toString(16))}this.numFrames=function(){return l.length},this.loopCount=function(){return f},this.frameInfo=function(e){if(e<0||e>=l.length)throw new Error("Frame index out of range.");return l[e]},this.decodeAndBlitFrameBGRA=function(e,t){var r=this.frameInfo(e),i=r.width*r.height,n=new Uint8Array(i);P(x,r.data_offset,n,i);var o=r.palette_offset,a=r.transparent_index;null===a&&(a=256);var s=r.width,l=w-s,u=s,h=4*(r.y*w+r.x),c=4*((r.y+r.height)*w+r.x),f=h,d=4*l;!0===r.interlaced&&(d+=4*w*7);for(var p=8,m=0,g=n.length;m>=1)),v===a)f+=4;else{var y=x[o+3*v],b=x[o+3*v+1],_=x[o+3*v+2];t[f++]=_,t[f++]=b,t[f++]=y,t[f++]=255}--u}},this.decodeAndBlitFrameRGBA=function(e,t){var r=this.frameInfo(e),i=r.width*r.height,n=new Uint8Array(i);P(x,r.data_offset,n,i);var o=r.palette_offset,a=r.transparent_index;null===a&&(a=256);var s=r.width,l=w-s,u=s,h=4*(r.y*w+r.x),c=4*((r.y+r.height)*w+r.x),f=h,d=4*l;!0===r.interlaced&&(d+=4*w*7);for(var p=8,m=0,g=n.length;m>=1)),v===a)f+=4;else{var y=x[o+3*v],b=x[o+3*v+1],_=x[o+3*v+2];t[f++]=y,t[f++]=b,t[f++]=_,t[f++]=255}--u}}}}catch(e){}},{}],33:[function(jr,t,r){(function(Gr){var e;e=this,function(E){"use strict";function e(e){if(null==this)throw TypeError();var t=String(this),r=t.length,i=e?Number(e):0;if(i!=i&&(i=0),!(i<0||r<=i)){var n,o=t.charCodeAt(i);return 55296<=o&&o<=56319&&i+1>>=1,t}function _(e,t,r){if(!t)return r;for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<>>16-t;return e.tag>>>=t,e.bitcount-=t,i+r}function x(e,t){for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<>>=1,++n,r+=t.table[n],0<=(i-=t.table[n]););return e.tag=o,e.bitcount-=n,t.trans[r+i]}function w(e,t,r){var i,n,o,a,s,l;for(i=_(e,5,257),n=_(e,5,1),o=_(e,4,4),a=0;a<19;++a)g[a]=0;for(a=0;athis.x2&&(this.x2=e)),"number"==typeof t&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=t,this.y2=t),tthis.y2&&(this.y2=t))},C.prototype.addX=function(e){this.addPoint(e,null)},C.prototype.addY=function(e){this.addPoint(null,e)},C.prototype.addBezier=function(e,t,r,i,n,o,a,s){var l=this,u=[e,t],h=[r,i],c=[n,o],f=[a,s];this.addPoint(e,t),this.addPoint(a,s);for(var d=0;d<=1;d++){var p=6*u[d]-12*h[d]+6*c[d],m=-3*u[d]+9*h[d]-9*c[d]+3*f[d],g=3*h[d]-3*u[d];if(0!=m){var v=Math.pow(p,2)-4*g*m;if(!(v<0)){var y=(-p+Math.sqrt(v))/(2*m);0>8&255,255&e]},A.USHORT=U(2),D.SHORT=function(e){return 32768<=e&&(e=-(65536-e)),[e>>8&255,255&e]},A.SHORT=U(2),D.UINT24=function(e){return[e>>16&255,e>>8&255,255&e]},A.UINT24=U(3),D.ULONG=function(e){return[e>>24&255,e>>16&255,e>>8&255,255&e]},A.ULONG=U(4),D.LONG=function(e){return R<=e&&(e=-(2*R-e)),[e>>24&255,e>>16&255,e>>8&255,255&e]},A.LONG=U(4),D.FIXED=D.ULONG,A.FIXED=A.ULONG,D.FWORD=D.SHORT,A.FWORD=A.SHORT,D.UFWORD=D.USHORT,A.UFWORD=A.USHORT,D.LONGDATETIME=function(e){return[0,0,0,0,e>>24&255,e>>16&255,e>>8&255,255&e]},A.LONGDATETIME=U(8),D.TAG=function(e){return k.argument(4===e.length,"Tag should be exactly 4 ASCII characters."),[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]},A.TAG=U(4),D.Card8=D.BYTE,A.Card8=A.BYTE,D.Card16=D.USHORT,A.Card16=A.USHORT,D.OffSize=D.BYTE,A.OffSize=A.BYTE,D.SID=D.USHORT,A.SID=A.USHORT,D.NUMBER=function(e){return-107<=e&&e<=107?[e+139]:108<=e&&e<=1131?[247+((e-=108)>>8),255&e]:-1131<=e&&e<=-108?[251+((e=-e-108)>>8),255&e]:-32768<=e&&e<=32767?D.NUMBER16(e):D.NUMBER32(e)},A.NUMBER=function(e){return D.NUMBER(e).length},D.NUMBER16=function(e){return[28,e>>8&255,255&e]},A.NUMBER16=U(3),D.NUMBER32=function(e){return[29,e>>24&255,e>>16&255,e>>8&255,255&e]},A.NUMBER32=U(5),D.REAL=function(e){var t=e.toString(),r=/\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec(t);if(r){var i=parseFloat("1e"+((r[2]?+r[2]:0)+r[1].length));t=(Math.round(e*i)/i).toString()}for(var n="",o=0,a=t.length;o>8&255,t[t.length]=255&i}return t},A.UTF16=function(e){return 2*e.length};var N={"x-mac-croatian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈ƫȅ ÀÃÕŒœĐ—“”‘’÷◊©⁄€‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ","x-mac-cyrillic":"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю","x-mac-gaelic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØḂ±≤≥ḃĊċḊḋḞḟĠġṀæøṁṖṗɼƒſṠ«»… ÀÃÕŒœ–—“”‘’ṡẛÿŸṪ€‹›Ŷŷṫ·Ỳỳ⁊ÂÊÁËÈÍÎÏÌÓÔ♣ÒÚÛÙıÝýŴŵẄẅẀẁẂẃ","x-mac-greek":"Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦€ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ­","x-mac-icelandic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüݰ¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-inuit":"ᐃᐄᐅᐆᐊᐋᐱᐲᐳᐴᐸᐹᑉᑎᑏᑐᑑᑕᑖᑦᑭᑮᑯᑰᑲᑳᒃᒋᒌᒍᒎᒐᒑ°ᒡᒥᒦ•¶ᒧ®©™ᒨᒪᒫᒻᓂᓃᓄᓅᓇᓈᓐᓯᓰᓱᓲᓴᓵᔅᓕᓖᓗᓘᓚᓛᓪᔨᔩᔪᔫᔭ… ᔮᔾᕕᕖᕗ–—“”‘’ᕘᕙᕚᕝᕆᕇᕈᕉᕋᕌᕐᕿᖀᖁᖂᖃᖄᖅᖏᖐᖑᖒᖓᖔᖕᙱᙲᙳᙴᙵᙶᖖᖠᖡᖢᖣᖤᖥᖦᕼŁł","x-mac-ce":"ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ",macintosh:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-romanian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂȘ∞±≤≥¥µ∂∑∏π∫ªºΩăș¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›Țț‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-turkish":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙˆ˜¯˘˙˚¸˝˛ˇ"};O.MACSTRING=function(e,t,r,i){var n=N[i];if(void 0!==n){for(var o="",a=0;a>8&255,l+256&255)}return o}D.MACSTRING=function(e,t){var r=function(e){if(!F)for(var t in F={},N)F[t]=new String(t);var r=F[e];if(void 0!==r){if(B){var i=B.get(r);if(void 0!==i)return i}var n=N[e];if(void 0!==n){for(var o={},a=0;a>8,t[c+1]=255&f,t=t.concat(i[h])}return t},A.TABLE=function(e){for(var t=0,r=e.fields.length,i=0;i>1,t.skip("uShort",3),e.glyphIndexMap={};for(var a=new se.Parser(r,i+n+14),s=new se.Parser(r,i+n+16+2*o),l=new se.Parser(r,i+n+16+4*o),u=new se.Parser(r,i+n+16+6*o),h=i+n+16+8*o,c=0;c>4,o=15&i;if(15==n)break;if(t+=r[n],15==o)break;t+=r[o]}return parseFloat(t)}(e);if(32<=t&&t<=246)return t-139;if(247<=t&&t<=250)return 256*(t-247)+e.parseByte()+108;if(251<=t&&t<=254)return 256*-(t-251)-e.parseByte()-108;throw new Error("Invalid b0 "+t)}function Te(e,t,r){t=void 0!==t?t:0;var i=new se.Parser(e,t),n=[],o=[];for(r=void 0!==r?r:e.length;i.relativeOffset>1,T.length=0,P=!0}return function e(t){for(var r,i,n,o,a,s,l,u,h,c,f,d,p=0;pMath.abs(d-R)?k=f+T.shift():R=d+T.shift(),E.curveTo(y,b,_,x,l,u),E.curveTo(h,c,f,d,k,R);break;default:console.log("Glyph "+v.index+": unknown operator 1200"+m),T.length=0}break;case 14:0>3;break;case 21:2>16),p+=2;break;case 29:a=T.pop()+g.gsubrsBias,(s=g.gsubrs[a])&&e(s);break;case 30:for(;0=r.begin&&e=fe.length){var a=i.parseChar();r.names.push(i.parseString(a))}break;case 2.5:r.numberOfGlyphs=i.parseUShort(),r.offset=new Array(r.numberOfGlyphs);for(var s=0;st.value.tag?1:-1}),t.fields=t.fields.concat(i),t.fields=t.fields.concat(n),t}function gt(e,t,r){for(var i=0;i 123 are reserved for internal usage");d|=1<>>1,o=e[n].tag;if(o===t)return n;o>>1,o=e[n];if(o===t)return n;o>>1,a=(r=e[o]).start;if(a===t)return r;a(r=e[i-1]).end?0:r}function xt(e,t){this.font=e,this.tableName=t}function wt(e){xt.call(this,e,"gpos")}function St(e){xt.call(this,e,"gsub")}function Mt(e,t){var r=e.length;if(r!==t.length)return!1;for(var i=0;it.points.length-1||i.matchedPoints[1]>n.points.length-1)throw Error("Matched points out of range in "+t.name);var a=t.points[i.matchedPoints[0]],s=n.points[i.matchedPoints[1]],l={xScale:i.xScale,scale01:i.scale01,scale10:i.scale10,yScale:i.yScale,dx:0,dy:0};s=kt([s],l)[0],l.dx=a.x-s.x,l.dy=a.y-s.y,o=kt(n.points,l)}t.points=t.points.concat(o)}}return Rt(t.points)}(wt.prototype=xt.prototype={searchTag:yt,binSearch:bt,getTable:function(e){var t=this.font.tables[this.tableName];return!t&&e&&(t=this.font.tables[this.tableName]=this.createDefaultTable()),t},getScriptNames:function(){var e=this.getTable();return e?e.scripts.map(function(e){return e.tag}):[]},getDefaultScriptName:function(){var e=this.getTable();if(e){for(var t=!1,r=0;r=s[u-1].tag,"Features must be added in alphabetical order."),o={tag:r,feature:{params:0,lookupListIndexes:[]}},s.push(o),a.push(u),o.feature}}},getLookupTables:function(e,t,r,i,n){var o=this.getFeatureTable(e,t,r,n),a=[];if(o){for(var s,l=o.lookupListIndexes,u=this.font.tables[this.tableName].lookups,h=0;h",s),t.stack.push(Math.round(64*s))}function vr(e,t){var r=t.stack,i=r.pop(),n=t.fv,o=t.pv,a=t.ppem,s=t.deltaBase+16*(e-1),l=t.deltaShift,u=t.z0;E.DEBUG&&console.log(t.step,"DELTAP["+e+"]",i,r);for(var h=0;h>4)===a){var d=(15&f)-8;0<=d&&d++,E.DEBUG&&console.log(t.step,"DELTAPFIX",c,"by",d*l);var p=u[c];n.setRelative(p,p,d*l,o)}}}function yr(e,t){var r=t.stack,i=r.pop();E.DEBUG&&console.log(t.step,"ROUND[]"),r.push(64*t.round(i/64))}function br(e,t){var r=t.stack,i=r.pop(),n=t.ppem,o=t.deltaBase+16*(e-1),a=t.deltaShift;E.DEBUG&&console.log(t.step,"DELTAC["+e+"]",i,r);for(var s=0;s>4)===n){var h=(15&u)-8;0<=h&&h++;var c=h*a;E.DEBUG&&console.log(t.step,"DELTACFIX",l,"by",c),t.cvt[l]+=c}}}function _r(e,t){var r,i,n=t.stack,o=n.pop(),a=n.pop(),s=t.z2[o],l=t.z1[a];E.DEBUG&&console.log(t.step,"SDPVTL["+e+"]",o,a),i=e?(r=s.y-l.y,l.x-s.x):(r=l.x-s.x,l.y-s.y),t.dpv=Zt(r,i)}function xr(e,t){var r=t.stack,i=t.prog,n=t.ip;E.DEBUG&&console.log(t.step,"PUSHB["+e+"]");for(var o=0;o":"_")+(i?"R":"_")+(0===n?"Gr":1===n?"Bl":2===n?"Wh":"")+"]",e?c+"("+o.cvt[c]+","+u+")":"",f,"(d =",a,"->",l*s,")"),o.rp1=o.rp0,o.rp2=f,t&&(o.rp0=f)}Ft.prototype.exec=function(e,t){if("number"!=typeof t)throw new Error("Point size is not a number!");if(!(2",i),s.interpolate(c,o,a,l),s.touch(c)}e.loop=1},dr.bind(void 0,0),dr.bind(void 0,1),function(e){for(var t=e.stack,r=e.rp0,i=e.z0[r],n=e.loop,o=e.fv,a=e.pv,s=e.z1;n--;){var l=t.pop(),u=s[l];E.DEBUG&&console.log(e.step,(1=a.width||t>=a.height?[0,0,0,0]:this._getPixel(e,t);var s=new l.default.Image(r,i);return s.canvas.getContext("2d").drawImage(a,e,t,r*o,i*o,0,0,r,i),s},l.default.Renderer.prototype.textLeading=function(e){return"number"==typeof e?(this._setProperty("_textLeading",e),this._pInst):this._textLeading},l.default.Renderer.prototype.textSize=function(e){return"number"==typeof e?(this._setProperty("_textSize",e),this._setProperty("_textLeading",e*y._DEFAULT_LEADMULT),this._applyTextProperties()):this._textSize},l.default.Renderer.prototype.textStyle=function(e){return e?(e!==y.NORMAL&&e!==y.ITALIC&&e!==y.BOLD&&e!==y.BOLDITALIC||this._setProperty("_textStyle",e),this._applyTextProperties()):this._textStyle},l.default.Renderer.prototype.textAscent=function(){return null===this._textAscent&&this._updateTextMetrics(),this._textAscent},l.default.Renderer.prototype.textDescent=function(){return null===this._textDescent&&this._updateTextMetrics(),this._textDescent},l.default.Renderer.prototype.textAlign=function(e,t){return void 0!==e?(this._setProperty("_textAlign",e),void 0!==t&&this._setProperty("_textBaseline",t),this._applyTextProperties()):{horizontal:this._textAlign,vertical:this._textBaseline}},l.default.Renderer.prototype.text=function(e,t,r,i,n){var o,a,s,l,u,h,c,f,d=this._pInst,p=Number.MAX_VALUE;if((this._doFill||this._doStroke)&&void 0!==e){if("string"!=typeof e&&(e=e.toString()),o=(e=e.replace(/(\t)/g," ")).split("\n"),void 0!==i){for(s=f=0;ss.HALF_PI&&e<=3*s.HALF_PI?Math.atan(r/i*Math.tan(e))+s.PI:Math.atan(r/i*Math.tan(e))+s.TWO_PI,t=t<=s.HALF_PI?Math.atan(r/i*Math.tan(t)):t>s.HALF_PI&&t<=3*s.HALF_PI?Math.atan(r/i*Math.tan(t))+s.PI:Math.atan(r/i*Math.tan(t))+s.TWO_PI),tv||Math.abs(this.accelerationY-this.pAccelerationY)>v||Math.abs(this.accelerationZ-this.pAccelerationZ)>v)&&e();var t=this.deviceTurned||window.deviceTurned;if("function"==typeof t){var r=this.rotationX+180,i=this.pRotationX+180,n=c+180;0>>24],i+=x[(16711680&C)>>16],n+=x[(65280&C)>>8],o+=x[255&C],r+=k[_],s++}w[l=T+y]=a/r,S[l]=i/r,M[l]=n/r,E[l]=o/r}T+=d}for(h=(u=-P)*d,b=T=0;b>>16,e[r+1]=(65280&t[i])>>>8,e[r+2]=255&t[i],e[r+3]=(4278190080&t[i])>>>24},O._toImageData=function(e){return e instanceof ImageData?e:e.getContext("2d").getImageData(0,0,e.width,e.height)},O._createImageData=function(e,t){return O._tmpCanvas=document.createElement("canvas"),O._tmpCtx=O._tmpCanvas.getContext("2d"),this._tmpCtx.createImageData(e,t)},O.apply=function(e,t,r){var i=e.getContext("2d"),n=i.getImageData(0,0,e.width,e.height),o=t(n,r);o instanceof ImageData?i.putImageData(o,0,0,0,0,e.width,e.height):i.putImageData(n,0,0,0,0,e.width,e.height)},O.threshold=function(e,t){var r=O._toPixels(e);void 0===t&&(t=.5);for(var i=Math.floor(255*t),n=0;n>8)/i,r[n+1]=255*(a*t>>8)/i,r[n+2]=255*(s*t>>8)/i}},O.dilate=function(e){for(var t,r,i,n,o,a,s,l,u,h,c,f,d,p,m,g,v,y=O._toPixels(e),b=0,_=y.length?y.length/4:0,x=new Int32Array(_);b<_;)for(r=(t=b)+e.width;b>16&255)+151*(i>>8&255)+28*(255&i))<(m=77*(c>>16&255)+151*(c>>8&255)+28*(255&c))&&(n=c,o=m),o<(p=77*((h=O._getARGB(y,a))>>16&255)+151*(h>>8&255)+28*(255&h))&&(n=h,o=p),o<(g=77*(f>>16&255)+151*(f>>8&255)+28*(255&f))&&(n=f,o=g),o<(v=77*(d>>16&255)+151*(d>>8&255)+28*(255&d))&&(n=d,o=v),x[b++]=n;O._setPixels(y,x)},O.erode=function(e){for(var t,r,i,n,o,a,s,l,u,h,c,f,d,p,m,g,v,y=O._toPixels(e),b=0,_=y.length?y.length/4:0,x=new Int32Array(_);b<_;)for(r=(t=b)+e.width;b>16&255)+151*(c>>8&255)+28*(255&c))<(o=77*(i>>16&255)+151*(i>>8&255)+28*(255&i))&&(n=c,o=m),(p=77*((h=O._getARGB(y,a))>>16&255)+151*(h>>8&255)+28*(255&h))>16&255)+151*(f>>8&255)+28*(255&f))>16&255)+151*(d>>8&255)+28*(255&d))=r){var i=Math.floor(t.timeDisplayed/r);if(t.timeDisplayed=0,t.displayIndex+=i,t.loopCount=Math.floor(t.displayIndex/t.numFrames),null!==t.loopLimit&&t.loopCount>=t.loopLimit)t.playing=!1;else{var n=t.displayIndex%t.numFrames;this.drawingContext.putImageData(t.frames[n].image,0,0),t.displayIndex=n,this.setModified(!0)}}}},n.default.Image.prototype._setProperty=function(e,t){this[e]=t,this.setModified(!0)},n.default.Image.prototype.loadPixels=function(){n.default.Renderer2D.prototype.loadPixels.call(this),this.setModified(!0)},n.default.Image.prototype.updatePixels=function(e,t,r,i){n.default.Renderer2D.prototype.updatePixels.call(this,e,t,r,i),this.setModified(!0)},n.default.Image.prototype.get=function(e,t,r,i){return n.default._validateParameters("p5.Image.get",arguments),n.default.Renderer2D.prototype.get.apply(this,arguments)},n.default.Image.prototype._getPixel=n.default.Renderer2D.prototype._getPixel,n.default.Image.prototype.set=function(e,t,r){n.default.Renderer2D.prototype.set.call(this,e,t,r),this.setModified(!0)},n.default.Image.prototype.resize=function(e,t){0===e&&0===t?(e=this.canvas.width,t=this.canvas.height):0===e?e=this.canvas.width*t/this.canvas.height:0===t&&(t=this.canvas.height*e/this.canvas.width),e=Math.floor(e),t=Math.floor(t);var r=document.createElement("canvas");if(r.width=e,r.height=t,this.gifProperties)for(var i=this.gifProperties,n=function(e,t){for(var r=0,i=0;i/g,">").replace(/"/g,""").replace(/'/g,"'")}function l(e,t){t&&!0!==t&&"true"!==t||(t="");var r="";return(e=e||"untitled")&&e.includes(".")&&(r=e.split(".").pop()),t&&r!==t&&(r=t,e="".concat(e,".").concat(r)),[e,r]}e("../core/error_helpers"),v.default.prototype.loadJSON=function(){for(var e=arguments.length,t=new Array(e),r=0;r"),n.print("");if(n.print(' '),n.print(""),n.print(""),n.print(" "),"0"!==o[0]){n.print(" ");for(var h=0;h".concat(c)),n.print(" ")}n.print(" ")}for(var f=0;f");for(var d=0;d".concat(p)),n.print(" ")}n.print(" ")}n.print("
"),n.print(""),n.print("")}n.close(),n.clear()},v.default.prototype.writeFile=function(e,t,r){var i="application/octet-stream";v.default.prototype._isSafari()&&(i="text/plain");var n=new Blob(e,{type:i});v.default.prototype.downloadFile(n,t,r)},v.default.prototype.downloadFile=function(e,t,r){var i=l(t,r),n=i[0];if(e instanceof Blob)s.default.saveAs(e,n);else{var o=document.createElement("a");if(o.href=e,o.download=n,o.onclick=function(e){var t;t=e,document.body.removeChild(t.target),e.stopPropagation()},o.style.display="none",document.body.appendChild(o),v.default.prototype._isSafari()){var a="Hello, Safari user! To download this file...\n";a+="1. Go to File --\x3e Save As.\n",a+='2. Choose "Page Source" as the Format.\n',a+='3. Name it with this extension: ."'.concat(i[1],'"'),alert(a)}o.click()}},v.default.prototype._checkFileExtension=l,v.default.prototype._isSafari=function(){return 0>>0},getSeed:function(){return t},rand:function(){return(r=(1664525*r+1013904223)%i)/i}});n.setSeed(e),_=new Array(4096);for(var o=0;o<4096;o++)_[o]=n.rand()};var o=n.default;r.default=o},{"../core/main":49}],82:[function(e,t,r){"use strict";function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i,l=(i=e("../core/main"))&&i.__esModule?i:{default:i},o=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==a(e)&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var o=i?Object.getOwnPropertyDescriptor(e,n):null;o&&(o.get||o.set)?Object.defineProperty(r,n,o):r[n]=e[n]}r.default=e,t&&t.set(e,r);return r}(e("../core/constants"));function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}l.default.Vector=function(e,t,r){var i,n,o;o=e instanceof l.default?(this.p5=e,i=t[0]||0,n=t[1]||0,t[2]||0):(i=e||0,n=t||0,r||0),this.x=i,this.y=n,this.z=o},l.default.Vector.prototype.toString=function(){return"p5.Vector Object : [".concat(this.x,", ").concat(this.y,", ").concat(this.z,"]")},l.default.Vector.prototype.set=function(e,t,r){return e instanceof l.default.Vector?(this.x=e.x||0,this.y=e.y||0,this.z=e.z||0):e instanceof Array?(this.x=e[0]||0,this.y=e[1]||0,this.z=e[2]||0):(this.x=e||0,this.y=t||0,this.z=r||0),this},l.default.Vector.prototype.copy=function(){return this.p5?new l.default.Vector(this.p5,[this.x,this.y,this.z]):new l.default.Vector(this.x,this.y,this.z)},l.default.Vector.prototype.add=function(e,t,r){return e instanceof l.default.Vector?(this.x+=e.x||0,this.y+=e.y||0,this.z+=e.z||0):e instanceof Array?(this.x+=e[0]||0,this.y+=e[1]||0,this.z+=e[2]||0):(this.x+=e||0,this.y+=t||0,this.z+=r||0),this};function u(e,t){return 0!==e&&(this.x=this.x%e),0!==t&&(this.y=this.y%t),this}function h(e,t,r){return 0!==e&&(this.x=this.x%e),0!==t&&(this.y=this.y%t),0!==r&&(this.z=this.z%r),this}l.default.Vector.prototype.rem=function(e,t,r){if(e instanceof l.default.Vector){if(Number.isFinite(e.x)&&Number.isFinite(e.y)&&Number.isFinite(e.z)){var i=parseFloat(e.x),n=parseFloat(e.y),o=parseFloat(e.z);h.call(this,i,n,o)}}else if(e instanceof Array)e.every(function(e){return Number.isFinite(e)})&&(2===e.length&&u.call(this,e[0],e[1]),3===e.length&&h.call(this,e[0],e[1],e[2]));else if(1===arguments.length){if(Number.isFinite(e)&&0!==e)return this.x=this.x%e,this.y=this.y%e,this.z=this.z%e,this}else if(2===arguments.length){var a=Array.prototype.slice.call(arguments);a.every(function(e){return Number.isFinite(e)})&&2===a.length&&u.call(this,a[0],a[1])}else if(3===arguments.length){var s=Array.prototype.slice.call(arguments);s.every(function(e){return Number.isFinite(e)})&&3===s.length&&h.call(this,s[0],s[1],s[2])}},l.default.Vector.prototype.sub=function(e,t,r){return e instanceof l.default.Vector?(this.x-=e.x||0,this.y-=e.y||0,this.z-=e.z||0):e instanceof Array?(this.x-=e[0]||0,this.y-=e[1]||0,this.z-=e[2]||0):(this.x-=e||0,this.y-=t||0,this.z-=r||0),this},l.default.Vector.prototype.mult=function(e){return"number"==typeof e&&isFinite(e)?(this.x*=e,this.y*=e,this.z*=e):console.warn("p5.Vector.prototype.mult:","n is undefined or not a finite number"),this},l.default.Vector.prototype.div=function(e){return"number"==typeof e&&isFinite(e)?0===e?console.warn("p5.Vector.prototype.div:","divide by 0"):(this.x/=e,this.y/=e,this.z/=e):console.warn("p5.Vector.prototype.div:","n is undefined or not a finite number"),this},l.default.Vector.prototype.mag=function(){return Math.sqrt(this.magSq())},l.default.Vector.prototype.magSq=function(){var e=this.x,t=this.y,r=this.z;return e*e+t*t+r*r},l.default.Vector.prototype.dot=function(e,t,r){return e instanceof l.default.Vector?this.dot(e.x,e.y,e.z):this.x*(e||0)+this.y*(t||0)+this.z*(r||0)},l.default.Vector.prototype.cross=function(e){var t=this.y*e.z-this.z*e.y,r=this.z*e.x-this.x*e.z,i=this.x*e.y-this.y*e.x;return this.p5?new l.default.Vector(this.p5,[t,r,i]):new l.default.Vector(t,r,i)},l.default.Vector.prototype.dist=function(e){return e.copy().sub(this).mag()},l.default.Vector.prototype.normalize=function(){var e=this.mag();return 0!==e&&this.mult(1/e),this},l.default.Vector.prototype.limit=function(e){var t=this.magSq();return e*e>>0},n.default.prototype.randomSeed=function(e){this._lcgSetSeed(o,e),this._gaussian_previous=!1},n.default.prototype.random=function(e,t){var r;if(n.default._validateParameters("random",arguments),r=null!=this[o]?this._lcg(o):Math.random(),void 0===e)return r;if(void 0===t)return e instanceof Array?e[Math.floor(r*e.length)]:r*e;if(tf){var P=p,L=l,k=u;p=d+f*(s&&d=t&&(r=r.substring(r.length-t,r.length)),r}},n.default.prototype.unhex=function(e){return e instanceof Array?e.map(n.default.prototype.unhex):parseInt("0x".concat(e),16)};var o=n.default;r.default=o},{"../core/main":49}],90:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i,a=(i=e("../core/main"))&&i.__esModule?i:{default:i};function n(e,t,r){var i=e<0,n=i?e.toString().substring(1):e.toString(),o=n.indexOf("."),a=-1!==o?n.substring(0,o):n,s=-1!==o?n.substring(o+1):"",l=i?"-":"";if(void 0!==r){var u="";(-1!==o||0r&&(s=s.substring(0,r));for(var h=0;hi.length)for(var o=t-(i+=-1===r?".":"").length+1,a=0;a=d.TWO_PI?"".concat("ellipse","|").concat(u,"|"):"".concat("arc","|").concat(a,"|").concat(s,"|").concat(l,"|").concat(u,"|"),!this.geometryInHash(t)){var h=new T.default.Geometry(u,1,function(){if(this.strokeIndices=[],a.toFixed(10)!==s.toFixed(10)){l!==d.PIE&&void 0!==l||(this.vertices.push(new T.default.Vector(.5,.5,0)),this.uvs.push([.5,.5]));for(var e=0;e<=u;e++){var t=(s-a)*(e/u)+a,r=.5+Math.cos(t)/2,i=.5+Math.sin(t)/2;this.vertices.push(new T.default.Vector(r,i,0)),this.uvs.push([r,i]),e>5&31)/31,(y>>10&31)/31):(r=a,i=s,l)}for(var b=1;b<=3;b++){var _=p+12*b,x=new S.default.Vector(u.getFloat32(_,!0),u.getFloat32(8+_,!0),u.getFloat32(4+_,!0));e.vertices.push(x),c&&o.push(r,i,n)}var w=new S.default.Vector(m,g,v);e.vertexNormals.push(w,w,w),e.faces.push([3*d,3*d+1,3*d+2]),e.uvs.push([0,0],[0,0],[0,0])}}(e,t);else{var r=new DataView(t);if(!("TextDecoder"in window))return console.warn("Sorry, ASCII STL loading only works in browsers that support TextDecoder (https://caniuse.com/#feat=textencoder)");var i=new TextDecoder("utf-8").decode(r).split("\n");!function(e,t){for(var r,i,n="",o=[],a=0;aMath.PI?l=Math.PI:l<=0&&(l=.001);var u=Math.sin(l)*a*Math.sin(s),h=Math.cos(l)*a,c=Math.sin(l)*a*Math.cos(s);this.camera(u+this.centerX,h+this.centerY,c+this.centerZ,this.centerX,this.centerY,this.centerZ,0,1,0)},m.default.Camera.prototype._isActive=function(){return this===this._renderer._curCamera},m.default.prototype.setCamera=function(e){this._renderer._curCamera=e,this._renderer.uPMatrix.set(e.projMatrix.mat4[0],e.projMatrix.mat4[1],e.projMatrix.mat4[2],e.projMatrix.mat4[3],e.projMatrix.mat4[4],e.projMatrix.mat4[5],e.projMatrix.mat4[6],e.projMatrix.mat4[7],e.projMatrix.mat4[8],e.projMatrix.mat4[9],e.projMatrix.mat4[10],e.projMatrix.mat4[11],e.projMatrix.mat4[12],e.projMatrix.mat4[13],e.projMatrix.mat4[14],e.projMatrix.mat4[15])};var n=m.default.Camera;r.default=n},{"../core/main":49}],98:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i,h=(i=e("../core/main"))&&i.__esModule?i:{default:i};h.default.Geometry=function(e,t,r){return this.vertices=[],this.lineVertices=[],this.lineNormals=[],this.vertexNormals=[],this.faces=[],this.uvs=[],this.edges=[],this.vertexColors=[],this.detailX=void 0!==e?e:1,this.detailY=void 0!==t?t:1,this.dirtyFlags={},r instanceof Function&&r.call(this),this},h.default.Geometry.prototype.reset=function(){this.lineVertices.length=0,this.lineNormals.length=0,this.vertices.length=0,this.edges.length=0,this.vertexColors.length=0,this.vertexNormals.length=0,this.uvs.length=0,this.dirtyFlags={}},h.default.Geometry.prototype.computeFaces=function(){this.faces.length=0;for(var e,t,r,i,n=this.detailX+1,o=0;othis.vertices.length-1-this.detailX;i--)e.add(this.vertexNormals[i]);e=h.default.Vector.div(e,this.detailX);for(var n=this.vertices.length-1;n>this.vertices.length-1-this.detailX;n--)this.vertexNormals[n]=e;return this},h.default.Geometry.prototype._makeTriangleEdges=function(){if(this.edges.length=0,Array.isArray(this.strokeIndices))for(var e=0,t=this.strokeIndices.length;e vTexCoord.y;\n bool y1 = p1.y > vTexCoord.y;\n bool y2 = p2.y > vTexCoord.y;\n\n // could web be under the curve (after t1)?\n if (y1 ? !y2 : y0) {\n // add the coverage for t1\n coverage.x += saturate(C1.x + 0.5);\n // calculate the anti-aliasing for t1\n weight.x = min(weight.x, abs(C1.x));\n }\n\n // are we outside the curve (after t2)?\n if (y1 ? !y0 : y2) {\n // subtract the coverage for t2\n coverage.x -= saturate(C2.x + 0.5);\n // calculate the anti-aliasing for t2\n weight.x = min(weight.x, abs(C2.x));\n }\n}\n\n// this is essentially the same as coverageX, but with the axes swapped\nvoid coverageY(vec2 p0, vec2 p1, vec2 p2) {\n\n vec2 C1, C2;\n calulateCrossings(p0, p1, p2, C1, C2);\n\n bool x0 = p0.x > vTexCoord.x;\n bool x1 = p1.x > vTexCoord.x;\n bool x2 = p2.x > vTexCoord.x;\n\n if (x1 ? !x2 : x0) {\n coverage.y -= saturate(C1.y + 0.5);\n weight.y = min(weight.y, abs(C1.y));\n }\n\n if (x1 ? !x0 : x2) {\n coverage.y += saturate(C2.y + 0.5);\n weight.y = min(weight.y, abs(C2.y));\n }\n}\n\nvoid main() {\n\n // calculate the pixel scale based on screen-coordinates\n pixelScale = hardness / fwidth(vTexCoord);\n\n // which grid cell is this pixel in?\n ivec2 gridCoord = ifloor(vTexCoord * vec2(uGridSize));\n\n // intersect curves in this row\n {\n // the index into the row info bitmap\n int rowIndex = gridCoord.y + uGridOffset.y;\n // fetch the info texel\n vec4 rowInfo = getTexel(uSamplerRows, rowIndex, uGridImageSize);\n // unpack the rowInfo\n int rowStrokeIndex = getInt16(rowInfo.xy);\n int rowStrokeCount = getInt16(rowInfo.zw);\n\n for (int iRowStroke = INT(0); iRowStroke < N; iRowStroke++) {\n if (iRowStroke >= rowStrokeCount)\n break;\n\n // each stroke is made up of 3 points: the start and control point\n // and the start of the next curve.\n // fetch the indices of this pair of strokes:\n vec4 strokeIndices = getTexel(uSamplerRowStrokes, rowStrokeIndex++, uCellsImageSize);\n\n // unpack the stroke index\n int strokePos = getInt16(strokeIndices.xy);\n\n // fetch the two strokes\n vec4 stroke0 = getTexel(uSamplerStrokes, strokePos + INT(0), uStrokeImageSize);\n vec4 stroke1 = getTexel(uSamplerStrokes, strokePos + INT(1), uStrokeImageSize);\n\n // calculate the coverage\n coverageX(stroke0.xy, stroke0.zw, stroke1.xy);\n }\n }\n\n // intersect curves in this column\n {\n int colIndex = gridCoord.x + uGridOffset.x;\n vec4 colInfo = getTexel(uSamplerCols, colIndex, uGridImageSize);\n int colStrokeIndex = getInt16(colInfo.xy);\n int colStrokeCount = getInt16(colInfo.zw);\n \n for (int iColStroke = INT(0); iColStroke < N; iColStroke++) {\n if (iColStroke >= colStrokeCount)\n break;\n\n vec4 strokeIndices = getTexel(uSamplerColStrokes, colStrokeIndex++, uCellsImageSize);\n\n int strokePos = getInt16(strokeIndices.xy);\n vec4 stroke0 = getTexel(uSamplerStrokes, strokePos + INT(0), uStrokeImageSize);\n vec4 stroke1 = getTexel(uSamplerStrokes, strokePos + INT(1), uStrokeImageSize);\n coverageY(stroke0.xy, stroke0.zw, stroke1.xy);\n }\n }\n\n weight = saturate(1.0 - weight * 2.0);\n float distance = max(weight.x + weight.y, minDistance); // manhattan approx.\n float antialias = abs(dot(coverage, weight) / distance);\n float cover = min(abs(coverage.x), abs(coverage.y));\n gl_FragColor = uMaterialColor;\n gl_FragColor.a *= saturate(max(antialias, cover));\n}",lineVert:"/*\n Part of the Processing project - http://processing.org\n Copyright (c) 2012-15 The Processing Foundation\n Copyright (c) 2004-12 Ben Fry and Casey Reas\n Copyright (c) 2001-04 Massachusetts Institute of Technology\n This library is free software; you can redistribute it and/or\n modify it under the terms of the GNU Lesser General Public\n License as published by the Free Software Foundation, version 2.1.\n This library is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n Lesser General Public License for more details.\n You should have received a copy of the GNU Lesser General\n Public License along with this library; if not, write to the\n Free Software Foundation, Inc., 59 Temple Place, Suite 330,\n Boston, MA 02111-1307 USA\n*/\n\n#define PROCESSING_LINE_SHADER\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform float uStrokeWeight;\n\nuniform vec4 uViewport;\nuniform int uPerspective;\n\nattribute vec4 aPosition;\nattribute vec4 aDirection;\n \nvoid main() {\n // using a scale <1 moves the lines towards the camera\n // in order to prevent popping effects due to half of\n // the line disappearing behind the geometry faces.\n vec3 scale = vec3(0.9995);\n\n vec4 posp = uModelViewMatrix * aPosition;\n vec4 posq = uModelViewMatrix * (aPosition + vec4(aDirection.xyz, 0));\n\n // Moving vertices slightly toward the camera\n // to avoid depth-fighting with the fill triangles.\n // Discussed here:\n // http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Number=252848 \n posp.xyz = posp.xyz * scale;\n posq.xyz = posq.xyz * scale;\n\n vec4 p = uProjectionMatrix * posp;\n vec4 q = uProjectionMatrix * posq;\n\n // formula to convert from clip space (range -1..1) to screen space (range 0..[width or height])\n // screen_p = (p.xy/p.w + <1,1>) * 0.5 * uViewport.zw\n\n // prevent division by W by transforming the tangent formula (div by 0 causes\n // the line to disappear, see https://github.com/processing/processing/issues/5183)\n // t = screen_q - screen_p\n //\n // tangent is normalized and we don't care which aDirection it points to (+-)\n // t = +- normalize( screen_q - screen_p )\n // t = +- normalize( (q.xy/q.w+<1,1>)*0.5*uViewport.zw - (p.xy/p.w+<1,1>)*0.5*uViewport.zw )\n //\n // extract common factor, <1,1> - <1,1> cancels out\n // t = +- normalize( (q.xy/q.w - p.xy/p.w) * 0.5 * uViewport.zw )\n //\n // convert to common divisor\n // t = +- normalize( ((q.xy*p.w - p.xy*q.w) / (p.w*q.w)) * 0.5 * uViewport.zw )\n //\n // remove the common scalar divisor/factor, not needed due to normalize and +-\n // (keep uViewport - can't remove because it has different components for x and y\n // and corrects for aspect ratio, see https://github.com/processing/processing/issues/5181)\n // t = +- normalize( (q.xy*p.w - p.xy*q.w) * uViewport.zw )\n\n vec2 tangent = normalize((q.xy*p.w - p.xy*q.w) * uViewport.zw);\n\n // flip tangent to normal (it's already normalized)\n vec2 normal = vec2(-tangent.y, tangent.x);\n\n float thickness = aDirection.w * uStrokeWeight;\n vec2 offset = normal * thickness / 2.0;\n\n vec2 curPerspScale;\n\n if(uPerspective == 1) {\n // Perspective ---\n // convert from world to clip by multiplying with projection scaling factor\n // to get the right thickness (see https://github.com/processing/processing/issues/5182)\n // invert Y, projections in Processing invert Y\n curPerspScale = (uProjectionMatrix * vec4(1, -1, 0, 0)).xy;\n } else {\n // No Perspective ---\n // multiply by W (to cancel out division by W later in the pipeline) and\n // convert from screen to clip (derived from clip to screen above)\n curPerspScale = p.w / (0.5 * uViewport.zw);\n }\n\n gl_Position.xy = p.xy + offset.xy * curPerspScale;\n gl_Position.zw = p.zw;\n}\n",lineFrag:"precision mediump float;\nprecision mediump int;\n\nuniform vec4 uMaterialColor;\n\nvoid main() {\n gl_FragColor = uMaterialColor;\n}",pointVert:"attribute vec3 aPosition;\nuniform float uPointSize;\nvarying float vStrokeWeight;\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nvoid main() {\n\tvec4 positionVec4 = vec4(aPosition, 1.0);\n\tgl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n\tgl_PointSize = uPointSize;\n\tvStrokeWeight = uPointSize;\n}",pointFrag:"precision mediump float;\nprecision mediump int;\nuniform vec4 uMaterialColor;\nvarying float vStrokeWeight;\n\nvoid main(){\n\tfloat mask = 0.0;\n\n\t// make a circular mask using the gl_PointCoord (goes from 0 - 1 on a point)\n // might be able to get a nicer edge on big strokeweights with smoothstep but slightly less performant\n\n\tmask = step(0.98, length(gl_PointCoord * 2.0 - 1.0));\n\n\t// if strokeWeight is 1 or less lets just draw a square\n\t// this prevents weird artifacting from carving circles when our points are really small\n\t// if strokeWeight is larger than 1, we just use it as is\n\n\tmask = mix(0.0, mask, clamp(floor(vStrokeWeight - 0.5),0.0,1.0));\n\n\t// throw away the borders of the mask\n // otherwise we get weird alpha blending issues\n\n\tif(mask > 0.98){\n discard;\n \t}\n\n \tgl_FragColor = vec4(uMaterialColor.rgb * (1.0 - mask), uMaterialColor.a) ;\n}"};u.default.RendererGL=function(e,t,r,i){return u.default.Renderer.call(this,e,t,r),this._setAttributeDefaults(t),this._initContext(),this.isP3D=!0,this.GL=this.drawingContext,this._isErasing=!1,this._enableLighting=!1,this.ambientLightColors=[],this.specularColors=[1,1,1],this.directionalLightDirections=[],this.directionalLightDiffuseColors=[],this.directionalLightSpecularColors=[],this.pointLightPositions=[],this.pointLightDiffuseColors=[],this.pointLightSpecularColors=[],this.spotLightPositions=[],this.spotLightDirections=[],this.spotLightDiffuseColors=[],this.spotLightSpecularColors=[],this.spotLightAngle=[],this.spotLightConc=[],this.drawMode=o.FILL,this.curFillColor=this._cachedFillStyle=[1,1,1,1],this.curStrokeColor=this._cachedStrokeStyle=[0,0,0,1],this.curBlendMode=o.BLEND,this._cachedBlendMode=void 0,this.blendExt=this.GL.getExtension("EXT_blend_minmax"),this._isBlending=!1,this._useSpecularMaterial=!1,this._useEmissiveMaterial=!1,this._useNormalMaterial=!1,this._useShininess=1,this._tint=[255,255,255,255],this.constantAttenuation=1,this.linearAttenuation=0,this.quadraticAttenuation=0,this.uMVMatrix=new u.default.Matrix,this.uPMatrix=new u.default.Matrix,this.uNMatrix=new u.default.Matrix("mat3"),this._curCamera=new u.default.Camera(this),this._curCamera._computeCameraDefaultSettings(),this._curCamera._setDefaultCamera(),this._defaultLightShader=void 0,this._defaultImmediateModeShader=void 0,this._defaultNormalShader=void 0,this._defaultColorShader=void 0,this._defaultPointShader=void 0,this.userFillShader=void 0,this.userStrokeShader=void 0,this.userPointShader=void 0,this.retainedMode={geometry:{},buffers:{stroke:[new u.default.RenderBuffer(3,"lineVertices","lineVertexBuffer","aPosition",this,this._flatten),new u.default.RenderBuffer(4,"lineNormals","lineNormalBuffer","aDirection",this,this._flatten)],fill:[new u.default.RenderBuffer(3,"vertices","vertexBuffer","aPosition",this,this._vToNArray),new u.default.RenderBuffer(3,"vertexNormals","normalBuffer","aNormal",this,this._vToNArray),new u.default.RenderBuffer(4,"vertexColors","colorBuffer","aMaterialColor",this),new u.default.RenderBuffer(3,"vertexAmbients","ambientBuffer","aAmbientColor",this),new u.default.RenderBuffer(2,"uvs","uvBuffer","aTexCoord",this,this._flatten)],text:[new u.default.RenderBuffer(3,"vertices","vertexBuffer","aPosition",this,this._vToNArray),new u.default.RenderBuffer(2,"uvs","uvBuffer","aTexCoord",this,this._flatten)]}},this.immediateMode={geometry:new u.default.Geometry,shapeMode:o.TRIANGLE_FAN,_bezierVertex:[],_quadraticVertex:[],_curveVertex:[],buffers:{fill:[new u.default.RenderBuffer(3,"vertices","vertexBuffer","aPosition",this,this._vToNArray),new u.default.RenderBuffer(3,"vertexNormals","normalBuffer","aNormal",this,this._vToNArray),new u.default.RenderBuffer(4,"vertexColors","colorBuffer","aVertexColor",this),new u.default.RenderBuffer(3,"vertexAmbients","ambientBuffer","aAmbientColor",this),new u.default.RenderBuffer(2,"uvs","uvBuffer","aTexCoord",this,this._flatten)],stroke:[new u.default.RenderBuffer(3,"lineVertices","lineVertexBuffer","aPosition",this,this._flatten),new u.default.RenderBuffer(4,"lineNormals","lineNormalBuffer","aDirection",this,this._flatten)],point:this.GL.createBuffer()}},this.pointSize=5,this.curStrokeWeight=1,this.textures=[],this.textureMode=o.IMAGE,this.textureWrapX=o.CLAMP,this.textureWrapY=o.CLAMP,this._tex=null,this._curveTightness=6,this._lookUpTableBezier=[],this._lookUpTableQuadratic=[],this._lutBezierDetail=0,this._lutQuadraticDetail=0,this._tessy=this._initTessy(),this.fontInfos={},this._curShader=void 0,this},u.default.RendererGL.prototype=Object.create(u.default.Renderer.prototype),u.default.RendererGL.prototype._setAttributeDefaults=function(e){var t={alpha:!0,depth:!0,stencil:!0,antialias:navigator.userAgent.toLowerCase().includes("safari"),premultipliedAlpha:!1,preserveDrawingBuffer:!0,perPixelLighting:!0};null===e._glAttributes?e._glAttributes=t:e._glAttributes=Object.assign(t,e._glAttributes)},u.default.RendererGL.prototype._initContext=function(){try{if(this.drawingContext=this.canvas.getContext("webgl",this._pInst._glAttributes)||this.canvas.getContext("experimental-webgl",this._pInst._glAttributes),null===this.drawingContext)throw new Error("Error creating webgl context");var e=this.drawingContext;e.enable(e.DEPTH_TEST),e.depthFunc(e.LEQUAL),e.viewport(0,0,e.drawingBufferWidth,e.drawingBufferHeight),this._viewport=this.drawingContext.getParameter(this.drawingContext.VIEWPORT)}catch(e){throw e}},u.default.RendererGL.prototype._resetContext=function(e,t){var r=this.width,i=this.height,n=this.canvas.id,o=this._pInst instanceof u.default.Graphics;if(o){var a=this._pInst;a.canvas.parentNode.removeChild(a.canvas),a.canvas=document.createElement("canvas"),(a._pInst._userNode||document.body).appendChild(a.canvas),u.default.Element.call(a,a.canvas,a._pInst),a.width=r,a.height=i}else{var s=this.canvas;s&&s.parentNode.removeChild(s),(s=document.createElement("canvas")).id=n,this._pInst._userNode?this._pInst._userNode.appendChild(s):document.body.appendChild(s),this._pInst.canvas=s}var l=new u.default.RendererGL(this._pInst.canvas,this._pInst,!o);this._pInst._setProperty("_renderer",l),l.resize(r,i),l._applyDefaults(),o||this._pInst._elements.push(l),"function"==typeof t&&setTimeout(function(){t.apply(window._renderer,e)},0)},u.default.prototype.setAttributes=function(e,t){if(void 0!==this._glAttributes){var r=!0;if(void 0!==t?(null===this._glAttributes&&(this._glAttributes={}),this._glAttributes[e]!==t&&(this._glAttributes[e]=t,r=!1)):e instanceof Object&&this._glAttributes!==e&&(this._glAttributes=e,r=!1),this._renderer.isP3D&&!r){if(!this._setupDone)for(var i in this._renderer.retainedMode.geometry)if(this._renderer.retainedMode.geometry.hasOwnProperty(i))return void console.error("Sorry, Could not set the attributes, you need to call setAttributes() before calling the other drawing methods in setup()");this.push(),this._renderer._resetContext(),this.pop(),this._renderer._curCamera&&(this._renderer._curCamera._renderer=this._renderer)}}else console.log("You are trying to use setAttributes on a p5.Graphics object that does not use a WEBGL renderer.")},u.default.RendererGL.prototype._update=function(){this.uMVMatrix.set(this._curCamera.cameraMatrix.mat4[0],this._curCamera.cameraMatrix.mat4[1],this._curCamera.cameraMatrix.mat4[2],this._curCamera.cameraMatrix.mat4[3],this._curCamera.cameraMatrix.mat4[4],this._curCamera.cameraMatrix.mat4[5],this._curCamera.cameraMatrix.mat4[6],this._curCamera.cameraMatrix.mat4[7],this._curCamera.cameraMatrix.mat4[8],this._curCamera.cameraMatrix.mat4[9],this._curCamera.cameraMatrix.mat4[10],this._curCamera.cameraMatrix.mat4[11],this._curCamera.cameraMatrix.mat4[12],this._curCamera.cameraMatrix.mat4[13],this._curCamera.cameraMatrix.mat4[14],this._curCamera.cameraMatrix.mat4[15]),this.ambientLightColors.length=0,this.specularColors=[1,1,1],this.directionalLightDirections.length=0,this.directionalLightDiffuseColors.length=0,this.directionalLightSpecularColors.length=0,this.pointLightPositions.length=0,this.pointLightDiffuseColors.length=0,this.pointLightSpecularColors.length=0,this.spotLightPositions.length=0,this.spotLightDirections.length=0,this.spotLightDiffuseColors.length=0,this.spotLightSpecularColors.length=0,this.spotLightAngle.length=0,this.spotLightConc.length=0,this._enableLighting=!1,this._tint=[255,255,255,255],this.GL.clear(this.GL.DEPTH_BUFFER_BIT)},u.default.RendererGL.prototype.background=function(){var e,t=(e=this._pInst).color.apply(e,arguments),r=t.levels[0]/255,i=t.levels[1]/255,n=t.levels[2]/255,o=t.levels[3]/255;this.GL.clearColor(r,i,n,o),this.GL.clear(this.GL.COLOR_BUFFER_BIT)},u.default.RendererGL.prototype.fill=function(e,t,r,i){var n=u.default.prototype.color.apply(this._pInst,arguments);this.curFillColor=n._array,this.drawMode=o.FILL,this._useNormalMaterial=!1,this._tex=null},u.default.RendererGL.prototype.stroke=function(e,t,r,i){arguments[3]=255;var n=u.default.prototype.color.apply(this._pInst,arguments);this.curStrokeColor=n._array},u.default.RendererGL.prototype.strokeCap=function(e){console.error("Sorry, strokeCap() is not yet implemented in WEBGL mode")},u.default.RendererGL.prototype.strokeJoin=function(e){console.error("Sorry, strokeJoin() is not yet implemented in WEBGL mode")},u.default.RendererGL.prototype.filter=function(e){console.error("filter() does not work in WEBGL mode")},u.default.RendererGL.prototype.blendMode=function(e){e===o.DARKEST||e===o.LIGHTEST||e===o.ADD||e===o.BLEND||e===o.SUBTRACT||e===o.SCREEN||e===o.EXCLUSION||e===o.REPLACE||e===o.MULTIPLY||e===o.REMOVE?this.curBlendMode=e:e!==o.BURN&&e!==o.OVERLAY&&e!==o.HARD_LIGHT&&e!==o.SOFT_LIGHT&&e!==o.DODGE||console.warn("BURN, OVERLAY, HARD_LIGHT, SOFT_LIGHT, and DODGE only work for blendMode in 2D mode.")},u.default.RendererGL.prototype.erase=function(e,t){this._isErasing||(this._cachedBlendMode=this.curBlendMode,this.blendMode(o.REMOVE),this._cachedFillStyle=this.curFillColor.slice(),this.curFillColor=[1,1,1,e/255],this._cachedStrokeStyle=this.curStrokeColor.slice(),this.curStrokeColor=[1,1,1,t/255],this._isErasing=!0)},u.default.RendererGL.prototype.noErase=function(){this._isErasing&&(this.curFillColor=this._cachedFillStyle.slice(),this.curStrokeColor=this._cachedStrokeStyle.slice(),this.blendMode(this._cachedBlendMode),this._isErasing=!1)},u.default.RendererGL.prototype.strokeWeight=function(e){this.curStrokeWeight!==e&&(this.pointSize=e,this.curStrokeWeight=e)},u.default.RendererGL.prototype._getPixel=function(e,t){var r;return r=new Uint8Array(4),this.drawingContext.readPixels(e,t,1,1,this.drawingContext.RGBA,this.drawingContext.UNSIGNED_BYTE,r),[r[0],r[1],r[2],r[3]]},u.default.RendererGL.prototype.loadPixels=function(){var e=this._pixelsState;if(!0===this._pInst._glAttributes.preserveDrawingBuffer){var t=e.pixels,r=this.GL.drawingBufferWidth*this.GL.drawingBufferHeight*4;t instanceof Uint8Array&&t.length===r||(t=new Uint8Array(r),this._pixelsState._setProperty("pixels",t));var i=this._pInst._pixelDensity;this.GL.readPixels(0,0,this.width*i,this.height*i,this.GL.RGBA,this.GL.UNSIGNED_BYTE,t)}else console.log("loadPixels only works in WebGL when preserveDrawingBuffer is true.")},u.default.RendererGL.prototype.geometryInHash=function(e){return void 0!==this.retainedMode.geometry[e]},u.default.RendererGL.prototype.resize=function(e,t){u.default.Renderer.prototype.resize.call(this,e,t),this.GL.viewport(0,0,this.GL.drawingBufferWidth,this.GL.drawingBufferHeight),this._viewport=this.GL.getParameter(this.GL.VIEWPORT),this._curCamera._resize();var r=this._pixelsState;void 0!==r.pixels&&r._setProperty("pixels",new Uint8Array(this.GL.drawingBufferWidth*this.GL.drawingBufferHeight*4))},u.default.RendererGL.prototype.clear=function(){var e=(arguments.length<=0?void 0:arguments[0])||0,t=(arguments.length<=1?void 0:arguments[1])||0,r=(arguments.length<=2?void 0:arguments[2])||0,i=(arguments.length<=3?void 0:arguments[3])||0;this.GL.clearColor(e,t,r,i),this.GL.clear(this.GL.COLOR_BUFFER_BIT|this.GL.DEPTH_BUFFER_BIT)},u.default.RendererGL.prototype.applyMatrix=function(e,t,r,i,n,o){16===arguments.length?u.default.Matrix.prototype.apply.apply(this.uMVMatrix,arguments):this.uMVMatrix.apply([e,t,0,0,r,i,0,0,0,0,1,0,n,o,0,1])},u.default.RendererGL.prototype.translate=function(e,t,r){return e instanceof u.default.Vector&&(r=e.z,t=e.y,e=e.x),this.uMVMatrix.translate([e,t,r]),this},u.default.RendererGL.prototype.scale=function(e,t,r){return this.uMVMatrix.scale(e,t,r),this},u.default.RendererGL.prototype.rotate=function(e,t){return void 0===t?this.rotateZ(e):(u.default.Matrix.prototype.rotate.apply(this.uMVMatrix,arguments),this)},u.default.RendererGL.prototype.rotateX=function(e){return this.rotate(e,1,0,0),this},u.default.RendererGL.prototype.rotateY=function(e){return this.rotate(e,0,1,0),this},u.default.RendererGL.prototype.rotateZ=function(e){return this.rotate(e,0,0,1),this},u.default.RendererGL.prototype.push=function(){var e=u.default.Renderer.prototype.push.apply(this),t=e.properties;return t.uMVMatrix=this.uMVMatrix.copy(),t.uPMatrix=this.uPMatrix.copy(),t._curCamera=this._curCamera,this._curCamera=this._curCamera.copy(),t.ambientLightColors=this.ambientLightColors.slice(),t.specularColors=this.specularColors.slice(),t.directionalLightDirections=this.directionalLightDirections.slice(),t.directionalLightDiffuseColors=this.directionalLightDiffuseColors.slice(),t.directionalLightSpecularColors=this.directionalLightSpecularColors.slice(),t.pointLightPositions=this.pointLightPositions.slice(),t.pointLightDiffuseColors=this.pointLightDiffuseColors.slice(),t.pointLightSpecularColors=this.pointLightSpecularColors.slice(),t.spotLightPositions=this.spotLightPositions.slice(),t.spotLightDirections=this.spotLightDirections.slice(),t.spotLightDiffuseColors=this.spotLightDiffuseColors.slice(),t.spotLightSpecularColors=this.spotLightSpecularColors.slice(),t.spotLightAngle=this.spotLightAngle.slice(),t.spotLightConc=this.spotLightConc.slice(),t.userFillShader=this.userFillShader,t.userStrokeShader=this.userStrokeShader,t.userPointShader=this.userPointShader,t.pointSize=this.pointSize,t.curStrokeWeight=this.curStrokeWeight,t.curStrokeColor=this.curStrokeColor,t.curFillColor=this.curFillColor,t._useSpecularMaterial=this._useSpecularMaterial,t._useEmissiveMaterial=this._useEmissiveMaterial,t._useShininess=this._useShininess,t.constantAttenuation=this.constantAttenuation,t.linearAttenuation=this.linearAttenuation,t.quadraticAttenuation=this.quadraticAttenuation,t._enableLighting=this._enableLighting,t._useNormalMaterial=this._useNormalMaterial,t._tex=this._tex,t.drawMode=this.drawMode,e},u.default.RendererGL.prototype.resetMatrix=function(){return this.uMVMatrix=u.default.Matrix.identity(this._pInst),this},u.default.RendererGL.prototype._getImmediateStrokeShader=function(){var e=this.userStrokeShader;return e&&e.isStrokeShader()?e:this._getLineShader()},u.default.RendererGL.prototype._getRetainedStrokeShader=u.default.RendererGL.prototype._getImmediateStrokeShader,u.default.RendererGL.prototype._getImmediateFillShader=function(){var e=this.userFillShader;if(this._useNormalMaterial&&(!e||!e.isNormalShader()))return this._getNormalShader();if(this._enableLighting){if(!e||!e.isLightShader())return this._getLightShader()}else if(this._tex){if(!e||!e.isTextureShader())return this._getLightShader()}else if(!e)return this._getImmediateModeShader();return e},u.default.RendererGL.prototype._getRetainedFillShader=function(){if(this._useNormalMaterial)return this._getNormalShader();var e=this.userFillShader;if(this._enableLighting){if(!e||!e.isLightShader())return this._getLightShader()}else if(this._tex){if(!e||!e.isTextureShader())return this._getLightShader()}else if(!e)return this._getColorShader();return e},u.default.RendererGL.prototype._getImmediatePointShader=function(){var e=this.userPointShader;return e&&e.isPointShader()?e:this._getPointShader()},u.default.RendererGL.prototype._getRetainedLineShader=u.default.RendererGL.prototype._getImmediateLineShader,u.default.RendererGL.prototype._getLightShader=function(){return this._defaultLightShader||(this._pInst._glAttributes.perPixelLighting?this._defaultLightShader=new u.default.Shader(this,c.phongVert,c.phongFrag):this._defaultLightShader=new u.default.Shader(this,c.lightVert,c.lightTextureFrag)),this._defaultLightShader},u.default.RendererGL.prototype._getImmediateModeShader=function(){return this._defaultImmediateModeShader||(this._defaultImmediateModeShader=new u.default.Shader(this,c.immediateVert,c.vertexColorFrag)),this._defaultImmediateModeShader},u.default.RendererGL.prototype._getNormalShader=function(){return this._defaultNormalShader||(this._defaultNormalShader=new u.default.Shader(this,c.normalVert,c.normalFrag)),this._defaultNormalShader},u.default.RendererGL.prototype._getColorShader=function(){return this._defaultColorShader||(this._defaultColorShader=new u.default.Shader(this,c.normalVert,c.basicFrag)),this._defaultColorShader},u.default.RendererGL.prototype._getPointShader=function(){return this._defaultPointShader||(this._defaultPointShader=new u.default.Shader(this,c.pointVert,c.pointFrag)),this._defaultPointShader},u.default.RendererGL.prototype._getLineShader=function(){return this._defaultLineShader||(this._defaultLineShader=new u.default.Shader(this,c.lineVert,c.lineFrag)),this._defaultLineShader},u.default.RendererGL.prototype._getFontShader=function(){return this._defaultFontShader||(this.GL.getExtension("OES_standard_derivatives"),this._defaultFontShader=new u.default.Shader(this,c.fontVert,c.fontFrag)),this._defaultFontShader},u.default.RendererGL.prototype._getEmptyTexture=function(){if(!this._emptyTexture){var e=new u.default.Image(1,1);e.set(0,0,255),this._emptyTexture=new u.default.Texture(this,e)}return this._emptyTexture},u.default.RendererGL.prototype.getTexture=function(e){var t=this.textures,r=!0,i=!1,n=void 0;try{for(var o,a=t[Symbol.iterator]();!(r=(o=a.next()).done);r=!0){var s=o.value;if(s.src===e)return s}}catch(e){i=!0,n=e}finally{try{r||null==a.return||a.return()}finally{if(i)throw n}}var l=new u.default.Texture(this,e);return t.push(l),l},u.default.RendererGL.prototype._setStrokeUniforms=function(e){e.bindShader(),e.setUniform("uMaterialColor",this.curStrokeColor),e.setUniform("uStrokeWeight",this.curStrokeWeight)},u.default.RendererGL.prototype._setFillUniforms=function(e){e.bindShader(),e.setUniform("uMaterialColor",this.curFillColor),e.setUniform("isTexture",!!this._tex),this._tex&&e.setUniform("uSampler",this._tex),e.setUniform("uTint",this._tint),e.setUniform("uSpecular",this._useSpecularMaterial),e.setUniform("uEmissive",this._useEmissiveMaterial),e.setUniform("uShininess",this._useShininess),e.setUniform("uUseLighting",this._enableLighting);var t=this.pointLightDiffuseColors.length/3;e.setUniform("uPointLightCount",t),e.setUniform("uPointLightLocation",this.pointLightPositions),e.setUniform("uPointLightDiffuseColors",this.pointLightDiffuseColors),e.setUniform("uPointLightSpecularColors",this.pointLightSpecularColors);var r=this.directionalLightDiffuseColors.length/3;e.setUniform("uDirectionalLightCount",r),e.setUniform("uLightingDirection",this.directionalLightDirections),e.setUniform("uDirectionalDiffuseColors",this.directionalLightDiffuseColors),e.setUniform("uDirectionalSpecularColors",this.directionalLightSpecularColors);var i=this.ambientLightColors.length/3;e.setUniform("uAmbientLightCount",i),e.setUniform("uAmbientColor",this.ambientLightColors);var n=this.spotLightDiffuseColors.length/3;e.setUniform("uSpotLightCount",n),e.setUniform("uSpotLightAngle",this.spotLightAngle),e.setUniform("uSpotLightConc",this.spotLightConc),e.setUniform("uSpotLightDiffuseColors",this.spotLightDiffuseColors),e.setUniform("uSpotLightSpecularColors",this.spotLightSpecularColors),e.setUniform("uSpotLightLocation",this.spotLightPositions),e.setUniform("uSpotLightDirection",this.spotLightDirections),e.setUniform("uConstantAttenuation",this.constantAttenuation),e.setUniform("uLinearAttenuation",this.linearAttenuation),e.setUniform("uQuadraticAttenuation",this.quadraticAttenuation),e.bindTextures()},u.default.RendererGL.prototype._setPointUniforms=function(e){e.bindShader(),e.setUniform("uMaterialColor",this.curStrokeColor),e.setUniform("uPointSize",this.pointSize)},u.default.RendererGL.prototype._bindBuffer=function(e,t,r,i,n){if(t=t||this.GL.ARRAY_BUFFER,this.GL.bindBuffer(t,e),void 0!==r){var o=new(i||Float32Array)(r);this.GL.bufferData(t,o,n||this.GL.STATIC_DRAW)}},u.default.RendererGL.prototype._arraysEqual=function(e,t){var r=e.length;if(r!==t.length)return!1;for(var i=0;i>7,127&f,c>>7,127&c);for(var d=0;d>7,127&p,0,0)}}return{cellImageInfo:l,dimOffset:o,dimImageInfo:n}}return(t=this.glyphInfos[e.index]={glyph:e,uGlyphRect:[i.x1,-i.y1,i.x2,-i.y2],strokeImageInfo:U,strokes:d,colInfo:G(m,this.colDimImageInfos,this.colCellImageInfos),rowInfo:G(p,this.rowDimImageInfos,this.rowCellImageInfos)}).uGridOffset=[t.colInfo.dimOffset,t.rowInfo.dimOffset],t}}var z=Math.sqrt(3);j.default.RendererGL.prototype._renderText=function(e,t,r,i,n){if(this._textFont&&"string"!=typeof this._textFont){if(!(n<=i)&&this._doFill){if(!this._isOpenType())return console.log("WEBGL: only Opentype (.otf) and Truetype (.ttf) fonts are supported"),e;e.push();var o=this._doStroke,a=this.drawMode;this._doStroke=!1,this.drawMode=D.TEXTURE;var s=this._textFont.font,l=this._textFont._fontInfo;l=l||(this._textFont._fontInfo=new A(s));var u=this._textFont._handleAlignment(this,t,r,i),h=this._textSize/s.unitsPerEm;this.translate(u.x,u.y,0),this.scale(h,h,1);var c=this.GL,f=!this._defaultFontShader,d=this._getFontShader();d.init(),d.bindShader(),f&&(d.setUniform("uGridImageSize",[64,64]),d.setUniform("uCellsImageSize",[64,64]),d.setUniform("uStrokeImageSize",[64,64]),d.setUniform("uGridSize",[9,9])),this._applyColorBlend(this.curFillColor);var p=this.retainedMode.geometry.glyph;if(!p){var m=this._textGeom=new j.default.Geometry(1,1,function(){for(var e=0;e<=1;e++)for(var t=0;t<=1;t++)this.vertices.push(new j.default.Vector(t,e,0)),this.uvs.push(t,e)});m.computeFaces().computeNormals(),p=this.createBuffers("glyph",m)}var g=!0,v=!1,y=void 0;try{for(var b,_=this.retainedMode.buffers.text[Symbol.iterator]();!(g=(b=_.next()).done);g=!0){b.value._prepareBuffer(p,d)}}catch(e){v=!0,y=e}finally{try{g||null==_.return||_.return()}finally{if(v)throw y}}this._bindBuffer(p.indexBuffer,c.ELEMENT_ARRAY_BUFFER),d.setUniform("uMaterialColor",this.curFillColor);try{var x=0,w=null,S=s.stringToGlyphs(t),M=!0,E=!1,T=void 0;try{for(var C,P=S[Symbol.iterator]();!(M=(C=P.next()).done);M=!0){var L=C.value;w&&(x+=s.getKerningValue(w,L));var k=l.getGlyphInfo(L);if(k.uGlyphRect){var R=k.rowInfo,O=k.colInfo;d.setUniform("uSamplerStrokes",k.strokeImageInfo.imageData),d.setUniform("uSamplerRowStrokes",R.cellImageInfo.imageData),d.setUniform("uSamplerRows",R.dimImageInfo.imageData),d.setUniform("uSamplerColStrokes",O.cellImageInfo.imageData),d.setUniform("uSamplerCols",O.dimImageInfo.imageData),d.setUniform("uGridOffset",k.uGridOffset),d.setUniform("uGlyphRect",k.uGlyphRect),d.setUniform("uGlyphOffset",x),d.bindTextures(),c.drawElements(c.TRIANGLES,6,this.GL.UNSIGNED_SHORT,0)}x+=L.advanceWidth,w=L}}catch(e){E=!0,T=e}finally{try{M||null==P.return||P.return()}finally{if(E)throw T}}}finally{d.unbindShader(),this._doStroke=o,this.drawMode=a,e.pop()}return e}}else console.log("WEBGL: you must load and set a font before drawing text. See `loadFont` and `textFont` for more details.")}},{"../core/constants":42,"../core/main":49,"./p5.RendererGL.Retained":102,"./p5.Shader":104}],107:[function(e,t,r){t.exports={fes:{autoplay:"The media that tried to play (with '{{src}}') wasn't allowed to by this browser, most likely due to the browser's autoplay policy. Check out {{link}} for more information about why.",fileLoadError:{bytes:"It looks like there was a problem loading your file. {{suggestion}}",font:"It looks like there was a problem loading your font. {{suggestion}}",gif:"There was some trouble loading your GIF. Make sure that your GIF is using 87a or 89a encoding.",image:"It looks like there was a problem loading your image. {{suggestion}}",json:"It looks like there was a problem loading your JSON file. {{suggestion}}",large:"If your large file isn't fetched successfully, we recommend splitting the file into smaller segments and fetching those.",strings:"It looks like there was a problem loading your text file. {{suggestion}}",suggestion:"Try checking if the file path ({{filePath}}) is correct, hosting the file online, or running a local server. (More info at {{link}})",table:"It looks like there was a problem loading your table file. {{suggestion}}",xml:"It looks like there was a problem loading your XML file. {{suggestion}}"},misusedTopLevel:"Did you just try to use p5.js's {{symbolName}} {{symbolType}}? If so, you may want to move it into your sketch's setup() function.\n\nFor more details, see: {{link}}",pre:"🌸 p5.js says: {{message}}",welcome:"Welcome! This is your friendly debugger. To turn me off, switch to using p5.min.js."}}},{}],108:[function(e,t,r){t.exports={fes:{autoplay:"Su browser impidío un medio tocar (de '{{src}}'), posiblemente porque las reglas de autoplay. Para aprender más, visite {{link}}.",fileLoadError:{bytes:"",font:"",gif:"",image:"",json:"",large:"",strings:"",suggestion:"",table:"",xml:""},misusedTopLevel:"",pre:"🌸 p5.js dice: {{message}}",welcome:""}}},{}],109:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i=o(e("./en/translation")),n=o(e("./es/translation"));function o(e){return e&&e.__esModule?e:{default:e}}var a={en:{translation:i.default},es:{translation:n.default}};r.default=a},{"./en/translation":107,"./es/translation":108}]},{},[37])(37)}); ================================================ FILE: docs/examples/pyodide/mines/target/target_sketch.js ================================================ const wrapperContent = ` class PythonFunctions: pass setattr(PythonFunctions, 'map', map) setattr(PythonFunctions, 'filter', filter) setattr(PythonFunctions, 'set', set) _P5_INSTANCE = None _CTX_MIDDLE = None _DEFAULT_FILL = None _DEFAULT_LEADMULT = None _DEFAULT_STROKE = None _DEFAULT_TEXT_FILL = None ADD = None ALT = None ARROW = None AUDIO = None AUTO = None AXES = None BACKSPACE = None BASELINE = None BEVEL = None BEZIER = None BLEND = None BLUR = None BOLD = None BOLDITALIC = None BOTTOM = None BURN = None CENTER = None CHORD = None CLAMP = None CLOSE = None CONTROL = None CORNER = None CORNERS = None CROSS = None CURVE = None DARKEST = None DEG_TO_RAD = None DEGREES = None DELETE = None DIFFERENCE = None DILATE = None DODGE = None DOWN_ARROW = None ENTER = None ERODE = None ESCAPE = None EXCLUSION = None FILL = None GRAY = None GRID = None HALF_PI = None HAND = None HARD_LIGHT = None HSB = None HSL = None IMAGE = None IMMEDIATE = None INVERT = None ITALIC = None LANDSCAPE = None LEFT = None LEFT_ARROW = None LIGHTEST = None LINE_LOOP = None LINE_STRIP = None LINEAR = None LINES = None MIRROR = None MITER = None MOVE = None MULTIPLY = None NEAREST = None NORMAL = None OPAQUE = None OPEN = None OPTION = None OVERLAY = None PI = None PIE = None POINTS = None PORTRAIT = None POSTERIZE = None PROJECT = None QUAD_STRIP = None QUADRATIC = None QUADS = None QUARTER_PI = None RAD_TO_DEG = None RADIANS = None RADIUS = None REPEAT = None REPLACE = None RETURN = None RGB = None RIGHT = None RIGHT_ARROW = None ROUND = None SCREEN = None SHIFT = None SOFT_LIGHT = None SQUARE = None STROKE = None SUBTRACT = None TAB = None TAU = None TEXT = None TEXTURE = None THRESHOLD = None TOP = None TRIANGLE_FAN = None TRIANGLE_STRIP = None TRIANGLES = None TWO_PI = None UP_ARROW = None VIDEO = None WAIT = None WEBGL = None P2D = None PI = None frameCount = None focused = None displayWidth = None displayHeight = None windowWidth = None windowHeight = None width = None height = None deviceOrientation = None accelerationX = None accelerationY = None accelerationZ = None pAccelerationX = None pAccelerationY = None pAccelerationZ = None rotationX = None rotationY = None rotationZ = None pRotationX = None pRotationY = None pRotationZ = None turnAxis = None keyIsPressed = None key = None keyCode = None mouseX = None mouseY = None pmouseX = None pmouseY = None winMouseX = None winMouseY = None pwinMouseX = None pwinMouseY = None mouseButton = None mouseIsPressed = None touches = None pixels = None def alpha(*args): return _P5_INSTANCE.alpha(*args) def blue(*args): return _P5_INSTANCE.blue(*args) def brightness(*args): return _P5_INSTANCE.brightness(*args) def color(*args): return _P5_INSTANCE.color(*args) def green(*args): return _P5_INSTANCE.green(*args) def hue(*args): return _P5_INSTANCE.hue(*args) def lerpColor(*args): return _P5_INSTANCE.lerpColor(*args) def lightness(*args): return _P5_INSTANCE.lightness(*args) def red(*args): return _P5_INSTANCE.red(*args) def saturation(*args): return _P5_INSTANCE.saturation(*args) def background(*args): return _P5_INSTANCE.background(*args) def clear(*args): p5_clear = _P5_INSTANCE.clear(*args) return p5_clear def erase(*args): return _P5_INSTANCE.erase(*args) def noErase(*args): return _P5_INSTANCE.noErase(*args) def colorMode(*args): return _P5_INSTANCE.colorMode(*args) def fill(*args): return _P5_INSTANCE.fill(*args) def noFill(*args): return _P5_INSTANCE.noFill(*args) def noStroke(*args): return _P5_INSTANCE.noStroke(*args) def stroke(*args): return _P5_INSTANCE.stroke(*args) def arc(*args): return _P5_INSTANCE.arc(*args) def ellipse(*args): return _P5_INSTANCE.ellipse(*args) def circle(*args): return _P5_INSTANCE.circle(*args) def line(*args): return _P5_INSTANCE.line(*args) def point(*args): return _P5_INSTANCE.point(*args) def quad(*args): return _P5_INSTANCE.quad(*args) def rect(*args): return _P5_INSTANCE.rect(*args) def square(*args): return _P5_INSTANCE.square(*args) def triangle(*args): return _P5_INSTANCE.triangle(*args) def plane(*args): return _P5_INSTANCE.plane(*args) def box(*args): return _P5_INSTANCE.box(*args) def sphere(*args): return _P5_INSTANCE.sphere(*args) def cylinder(*args): return _P5_INSTANCE.cylinder(*args) def cone(*args): return _P5_INSTANCE.cone(*args) def ellipsoid(*args): return _P5_INSTANCE.ellipsoid(*args) def torus(*args): return _P5_INSTANCE.torus(*args) def loadModel(*args): return _P5_INSTANCE.loadModel(*args) def model(*args): return _P5_INSTANCE.model(*args) def ellipseMode(*args): return _P5_INSTANCE.ellipseMode(*args) def noSmooth(*args): return _P5_INSTANCE.noSmooth(*args) def rectMode(*args): return _P5_INSTANCE.rectMode(*args) def smooth(*args): return _P5_INSTANCE.smooth(*args) def strokeCap(*args): return _P5_INSTANCE.strokeCap(*args) def strokeJoin(*args): return _P5_INSTANCE.strokeJoin(*args) def strokeWeight(*args): return _P5_INSTANCE.strokeWeight(*args) def bezier(*args): return _P5_INSTANCE.bezier(*args) def bezierDetail(*args): return _P5_INSTANCE.bezierDetail(*args) def bezierPoint(*args): return _P5_INSTANCE.bezierPoint(*args) def bezierTangent(*args): return _P5_INSTANCE.bezierTangent(*args) def curve(*args): return _P5_INSTANCE.curve(*args) def curveDetail(*args): return _P5_INSTANCE.curveDetail(*args) def curveTightness(*args): return _P5_INSTANCE.curveTightness(*args) def curvePoint(*args): return _P5_INSTANCE.curvePoint(*args) def curveTangent(*args): return _P5_INSTANCE.curveTangent(*args) def beginContour(*args): return _P5_INSTANCE.beginContour(*args) def beginShape(*args): return _P5_INSTANCE.beginShape(*args) def bezierVertex(*args): return _P5_INSTANCE.bezierVertex(*args) def curveVertex(*args): return _P5_INSTANCE.curveVertex(*args) def endContour(*args): return _P5_INSTANCE.endContour(*args) def endShape(*args): return _P5_INSTANCE.endShape(*args) def quadraticVertex(*args): return _P5_INSTANCE.quadraticVertex(*args) def vertex(*args): return _P5_INSTANCE.vertex(*args) def cursor(*args): return _P5_INSTANCE.cursor(*args) def frameRate(*args): return _P5_INSTANCE.frameRate(*args) def noCursor(*args): return _P5_INSTANCE.noCursor(*args) def fullscreen(*args): return _P5_INSTANCE.fullscreen(*args) def pixelDensity(*args): return _P5_INSTANCE.pixelDensity(*args) def displayDensity(*args): return _P5_INSTANCE.displayDensity(*args) def getURL(*args): return _P5_INSTANCE.getURL(*args) def getURLPath(*args): return _P5_INSTANCE.getURLPath(*args) def getURLParams(*args): return _P5_INSTANCE.getURLParams(*args) def remove(*args): return _P5_INSTANCE.remove(*args) def noLoop(*args): return _P5_INSTANCE.noLoop(*args) def loop(*args): return _P5_INSTANCE.loop(*args) def push(*args): return _P5_INSTANCE.push(*args) def redraw(*args): return _P5_INSTANCE.redraw(*args) def resizeCanvas(*args): return _P5_INSTANCE.resizeCanvas(*args) def noCanvas(*args): return _P5_INSTANCE.noCanvas(*args) def createGraphics(*args): return _P5_INSTANCE.createGraphics(*args) def blendMode(*args): return _P5_INSTANCE.blendMode(*args) def setAttributes(*args): return _P5_INSTANCE.setAttributes(*args) def applyMatrix(*args): return _P5_INSTANCE.applyMatrix(*args) def resetMatrix(*args): return _P5_INSTANCE.resetMatrix(*args) def rotate(*args): return _P5_INSTANCE.rotate(*args) def rotateX(*args): return _P5_INSTANCE.rotateX(*args) def rotateY(*args): return _P5_INSTANCE.rotateY(*args) def rotateZ(*args): return _P5_INSTANCE.rotateZ(*args) def scale(*args): return _P5_INSTANCE.scale(*args) def shearX(*args): return _P5_INSTANCE.shearX(*args) def shearY(*args): return _P5_INSTANCE.shearY(*args) def translate(*args): return _P5_INSTANCE.translate(*args) def createStringDict(*args): return _P5_INSTANCE.createStringDict(*args) def createNumberDict(*args): return _P5_INSTANCE.createNumberDict(*args) def append(*args): return _P5_INSTANCE.append(*args) def arrayCopy(*args): return _P5_INSTANCE.arrayCopy(*args) def concat(*args): return _P5_INSTANCE.concat(*args) def reverse(*args): return _P5_INSTANCE.reverse(*args) def shorten(*args): return _P5_INSTANCE.shorten(*args) def shuffle(*args): return _P5_INSTANCE.shuffle(*args) def sort(*args): return _P5_INSTANCE.sort(*args) def splice(*args): return _P5_INSTANCE.splice(*args) def subset(*args): return _P5_INSTANCE.subset(*args) def float(*args): return _P5_INSTANCE.float(*args) def int(*args): return _P5_INSTANCE.int(*args) def str(*args): return _P5_INSTANCE.str(*args) def boolean(*args): return _P5_INSTANCE.boolean(*args) def byte(*args): return _P5_INSTANCE.byte(*args) def char(*args): return _P5_INSTANCE.char(*args) def unchar(*args): return _P5_INSTANCE.unchar(*args) def hex(*args): return _P5_INSTANCE.hex(*args) def unhex(*args): return _P5_INSTANCE.unhex(*args) def join(*args): return _P5_INSTANCE.join(*args) def match(*args): return _P5_INSTANCE.match(*args) def matchAll(*args): return _P5_INSTANCE.matchAll(*args) def nf(*args): return _P5_INSTANCE.nf(*args) def nfc(*args): return _P5_INSTANCE.nfc(*args) def nfp(*args): return _P5_INSTANCE.nfp(*args) def nfs(*args): return _P5_INSTANCE.nfs(*args) def split(*args): return _P5_INSTANCE.split(*args) def splitTokens(*args): return _P5_INSTANCE.splitTokens(*args) def trim(*args): return _P5_INSTANCE.trim(*args) def setMoveThreshold(*args): return _P5_INSTANCE.setMoveThreshold(*args) def setShakeThreshold(*args): return _P5_INSTANCE.setShakeThreshold(*args) def keyIsDown(*args): return _P5_INSTANCE.keyIsDown(*args) def createImage(*args): return _P5_INSTANCE.createImage(*args) def saveCanvas(*args): return _P5_INSTANCE.saveCanvas(*args) def saveFrames(*args): return _P5_INSTANCE.saveFrames(*args) def loadImage(*args): return _P5_INSTANCE.loadImage(*args) def image(*args): return _P5_INSTANCE.image(*args) def tint(*args): return _P5_INSTANCE.tint(*args) def noTint(*args): return _P5_INSTANCE.noTint(*args) def imageMode(*args): return _P5_INSTANCE.imageMode(*args) def blend(*args): return _P5_INSTANCE.blend(*args) def copy(*args): return _P5_INSTANCE.copy(*args) def filter(*args): if len(args) > 1 and (args[0] is None or callable(args[0])): return PythonFunctions.filter(*args) else: return _P5_INSTANCE.filter(*args) def get(*args): return _P5_INSTANCE.get(*args) def loadPixels(*args): return _P5_INSTANCE.loadPixels(*args) def set(*args): if len(args) <= 1: return PythonFunctions.set(*args) else: return _P5_INSTANCE.set(*args) def updatePixels(*args): return _P5_INSTANCE.updatePixels(*args) def loadJSON(*args): return _P5_INSTANCE.loadJSON(*args) def loadStrings(*args): return _P5_INSTANCE.loadStrings(*args) def loadTable(*args): return _P5_INSTANCE.loadTable(*args) def loadXML(*args): return _P5_INSTANCE.loadXML(*args) def loadBytes(*args): return _P5_INSTANCE.loadBytes(*args) def httpGet(*args): return _P5_INSTANCE.httpGet(*args) def httpPost(*args): return _P5_INSTANCE.httpPost(*args) def httpDo(*args): return _P5_INSTANCE.httpDo(*args) def createWriter(*args): return _P5_INSTANCE.createWriter(*args) def save(*args): return _P5_INSTANCE.save(*args) def saveJSON(*args): return _P5_INSTANCE.saveJSON(*args) def saveStrings(*args): return _P5_INSTANCE.saveStrings(*args) def saveTable(*args): return _P5_INSTANCE.saveTable(*args) def day(*args): return _P5_INSTANCE.day(*args) def hour(*args): return _P5_INSTANCE.hour(*args) def minute(*args): return _P5_INSTANCE.minute(*args) def millis(*args): return _P5_INSTANCE.millis(*args) def month(*args): return _P5_INSTANCE.month(*args) def second(*args): return _P5_INSTANCE.second(*args) def year(*args): return _P5_INSTANCE.year(*args) def createVector(*args): return _P5_INSTANCE.createVector(*args) def abs(*args): return _P5_INSTANCE.abs(*args) def ceil(*args): return _P5_INSTANCE.ceil(*args) def constrain(*args): return _P5_INSTANCE.constrain(*args) def dist(*args): return _P5_INSTANCE.dist(*args) def exp(*args): return _P5_INSTANCE.exp(*args) def floor(*args): return _P5_INSTANCE.floor(*args) def lerp(*args): return _P5_INSTANCE.lerp(*args) def log(*args): return _P5_INSTANCE.log(*args) def mag(*args): return _P5_INSTANCE.mag(*args) def map(*args): if len(args) > 1 and callable(args[0]): return PythonFunctions.map(*args) else: return _P5_INSTANCE.map(*args) def max(*args): return _P5_INSTANCE.max(*args) def min(*args): return _P5_INSTANCE.min(*args) def norm(*args): return _P5_INSTANCE.norm(*args) def pow(*args): return _P5_INSTANCE.pow(*args) def round(*args): return _P5_INSTANCE.round(*args) def sq(*args): return _P5_INSTANCE.sq(*args) def sqrt(*args): return _P5_INSTANCE.sqrt(*args) def noise(*args): return _P5_INSTANCE.noise(*args) def noiseDetail(*args): return _P5_INSTANCE.noiseDetail(*args) def noiseSeed(*args): return _P5_INSTANCE.noiseSeed(*args) def randomSeed(*args): return _P5_INSTANCE.randomSeed(*args) def random(*args): return _P5_INSTANCE.random(*args) def randomGaussian(*args): return _P5_INSTANCE.randomGaussian(*args) def acos(*args): return _P5_INSTANCE.acos(*args) def asin(*args): return _P5_INSTANCE.asin(*args) def atan(*args): return _P5_INSTANCE.atan(*args) def atan2(*args): return _P5_INSTANCE.atan2(*args) def cos(*args): return _P5_INSTANCE.cos(*args) def sin(*args): return _P5_INSTANCE.sin(*args) def tan(*args): return _P5_INSTANCE.tan(*args) def degrees(*args): return _P5_INSTANCE.degrees(*args) def radians(*args): return _P5_INSTANCE.radians(*args) def angleMode(*args): return _P5_INSTANCE.angleMode(*args) def textAlign(*args): return _P5_INSTANCE.textAlign(*args) def textLeading(*args): return _P5_INSTANCE.textLeading(*args) def textSize(*args): return _P5_INSTANCE.textSize(*args) def textStyle(*args): return _P5_INSTANCE.textStyle(*args) def textWidth(*args): return _P5_INSTANCE.textWidth(*args) def textAscent(*args): return _P5_INSTANCE.textAscent(*args) def textDescent(*args): return _P5_INSTANCE.textDescent(*args) def loadFont(*args): return _P5_INSTANCE.loadFont(*args) def text(*args): return _P5_INSTANCE.text(*args) def textFont(*args): return _P5_INSTANCE.textFont(*args) def orbitControl(*args): return _P5_INSTANCE.orbitControl(*args) def debugMode(*args): return _P5_INSTANCE.debugMode(*args) def noDebugMode(*args): return _P5_INSTANCE.noDebugMode(*args) def ambientLight(*args): return _P5_INSTANCE.ambientLight(*args) def directionalLight(*args): return _P5_INSTANCE.directionalLight(*args) def pointLight(*args): return _P5_INSTANCE.pointLight(*args) def lights(*args): return _P5_INSTANCE.lights(*args) def loadShader(*args): return _P5_INSTANCE.loadShader(*args) def createShader(*args): return _P5_INSTANCE.createShader(*args) def shader(*args): return _P5_INSTANCE.shader(*args) def resetShader(*args): return _P5_INSTANCE.resetShader(*args) def normalMaterial(*args): return _P5_INSTANCE.normalMaterial(*args) def texture(*args): return _P5_INSTANCE.texture(*args) def textureMode(*args): return _P5_INSTANCE.textureMode(*args) def textureWrap(*args): return _P5_INSTANCE.textureWrap(*args) def ambientMaterial(*args): return _P5_INSTANCE.ambientMaterial(*args) def specularMaterial(*args): return _P5_INSTANCE.specularMaterial(*args) def shininess(*args): return _P5_INSTANCE.shininess(*args) def camera(*args): return _P5_INSTANCE.camera(*args) def perspective(*args): return _P5_INSTANCE.perspective(*args) def ortho(*args): return _P5_INSTANCE.ortho(*args) def createCamera(*args): return _P5_INSTANCE.createCamera(*args) def setCamera(*args): return _P5_INSTANCE.setCamera(*args) def select(*args): return _P5_INSTANCE.select(*args) def selectAll(*args): return _P5_INSTANCE.selectAll(*args) def removeElements(*args): return _P5_INSTANCE.removeElements(*args) def changed(*args): return _P5_INSTANCE.changed(*args) def input(*args): return _P5_INSTANCE.input(*args) def createDiv(*args): return _P5_INSTANCE.createDiv(*args) def createP(*args): return _P5_INSTANCE.createP(*args) def createSpan(*args): return _P5_INSTANCE.createSpan(*args) def createImg(*args): return _P5_INSTANCE.createImg(*args) def createA(*args): return _P5_INSTANCE.createA(*args) def createSlider(*args): return _P5_INSTANCE.createSlider(*args) def createButton(*args): return _P5_INSTANCE.createButton(*args) def createCheckbox(*args): return _P5_INSTANCE.createCheckbox(*args) def createSelect(*args): return _P5_INSTANCE.createSelect(*args) def createRadio(*args): return _P5_INSTANCE.createRadio(*args) def createColorPicker(*args): return _P5_INSTANCE.createColorPicker(*args) def createInput(*args): return _P5_INSTANCE.createInput(*args) def createFileInput(*args): return _P5_INSTANCE.createFileInput(*args) def createVideo(*args): return _P5_INSTANCE.createVideo(*args) def createAudio(*args): return _P5_INSTANCE.createAudio(*args) def createCapture(*args): return _P5_INSTANCE.createCapture(*args) def createElement(*args): return _P5_INSTANCE.createElement(*args) def createCanvas(*args): canvas = _P5_INSTANCE.createCanvas(*args) global width, height width = _P5_INSTANCE.width height = _P5_INSTANCE.height return canvas def __deviceMoved(e): try: _bind_event_function(deviceMoved, e) except NameError: pass def __deviceTurned(e): try: _bind_event_function(deviceTurned, e) except NameError: pass def __deviceShaken(e): try: _bind_event_function(deviceShaken, e) except NameError: pass def __touchEnded(e): try: _bind_event_function(deviceShaken, e) except NameError: pass def __touchStarted(e): try: _bind_event_function(touchStarted, e) except NameError: pass def __windowResized(e): try: _bind_event_function(windowResized, e) except NameError: pass def __touchMoved(e): try: _bind_event_function(touchMoved, e) except NameError: pass def __mouseMoved(e): try: _bind_event_function(mouseMoved, e) except NameError: pass def __mouseDragged(e): try: _bind_event_function(mouseDragged, e) except NameError: pass def __mousePressed(e): try: _bind_event_function(mousePressed, e) except NameError: pass def __mouseReleased(e): try: _bind_event_function(mouseReleased, e) except NameError: pass def __mouseClicked(e): try: _bind_event_function(mouseClicked, e) except NameError: pass def __doubleClicked(e): try: _bind_event_function(doubleClicked, e) except NameError: pass def __mouseWheel(e): try: _bind_event_function(mouseWheel, e) except NameError: pass def __keyPressed(e): try: _bind_event_function(keyPressed, e) except NameError: pass def __keyReleased(e): try: _bind_event_function(keyReleased, e) except NameError: pass def __keyTyped(e): try: _bind_event_function(keyTyped, e) except NameError: pass def __keyIsDown(e): try: _bind_event_function(keyIsDown, e) except NameError: pass def pop(*args): p5_pop = _P5_INSTANCE.pop(*args) return p5_pop # Processing Python or Java mode compatibility aliases size = createCanvas popMatrix = pop popStyle = pop pushMatrix = push pushStyle = push # PVector is a wrapper/helper class for p5.Vector objets # providing names similar to Processing Python or Java modes # but mostly keeping p5js functionality from numbers import Number class PVector: def __init__(self, x=0, y=0, z=0): self.__vector = createVector(x, y, z) self.add = self.__instance_add__ self.sub = self.__instance_sub__ self.mult = self.__instance_mult__ self.div = self.__instance_div__ self.cross = self.__instance_cross__ self.dist = self.__instance_dist__ self.dot = self.__instance_dot__ self.lerp = self.__instance_lerp__ @property def x(self): return self.__vector.x @x.setter def x(self, x): self.__vector.x = x @property def y(self): return self.__vector.y @y.setter def y(self, y): self.__vector.y = y @property def z(self): return self.__vector.z @z.setter def z(self, z): self.__vector.z = z def mag(self): return self.__vector.mag() def magSq(self): return self.__vector.magSq() def setMag(self, mag): self.__vector.setMag(mag) return self def normalize(self): self.__vector.normalize() return self def limit(self, max): self.__vector.limit(max) return self def heading(self): return self.__vector.heading() def rotate(self, angle): self.__vector.rotate(angle) return self def __instance_add__(self, *args): if len(args) == 1: return PVector.add(self, args[0], self) else: return PVector.add(self, PVector(*args), self) def __instance_sub__(self, *args): if len(args) == 1: return PVector.sub(self, args[0], self) else: return PVector.sub(self, PVector(*args), self) def __instance_mult__(self, o): return PVector.mult(self, o, self) def __instance_div__(self, f): return PVector.div(self, f, self) def __instance_cross__(self, o): return PVector.cross(self, o, self) def __instance_dist__(self, o): return PVector.dist(self, o) def __instance_dot__(self, *args): if len(args) == 1: v = args[0] else: v = args return self.x * v[0] + self.y * v[1] + self.z * v[2] def __instance_lerp__(self, *args): if len(args) == 2: return PVector.lerp(self, args[0], args[1], self) else: vx, vy, vz, f = args return PVector.lerp(self, PVector(vx, vy, vz), f, self) def get(self): return PVector(self.x, self.y, self.z) def copy(self): return PVector(self.x, self.y, self.z) def __getitem__(self, k): return getattr(self, ('x', 'y', 'z')[k]) def __setitem__(self, k, v): setattr(self, ('x', 'y', 'z')[k], v) def __copy__(self): return PVector(self.x, self.y, self.z) def __deepcopy__(self, memo): return PVector(self.x, self.y, self.z) def __repr__(self): # PROVISÓRIO return f'PVector({self.x}, {self.y}, {self.z})' def set(self, *args): """ Sets the x, y, and z component of the vector using two or three separate variables, the data from a p5.Vector, or the values from a float array. """ self.__vector.set(*args) @classmethod def add(cls, a, b, dest=None): if dest is None: return PVector(a.x + b[0], a.y + b[1], a.z + b[2]) dest.__vector.set(a.x + b[0], a.y + b[1], a.z + b[2]) return dest @classmethod def sub(cls, a, b, dest=None): if dest is None: return PVector(a.x - b[0], a.y - b[1], a.z - b[2]) dest.__vector.set(a.x - b[0], a.y - b[1], a.z - b[2]) return dest @classmethod def mult(cls, a, b, dest=None): if dest is None: return PVector(a.x * b, a.y * b, a.z * b) dest.__vector.set(a.x * b, a.y * b, a.z * b) return dest @classmethod def div(cls, a, b, dest=None): if dest is None: return PVector(a.x / b, a.y / b, a.z / b) dest.__vector.set(a.x / b, a.y / b, a.z / b) return dest @classmethod def dist(cls, a, b): return a.__vector.dist(b.__vector) @classmethod def dot(cls, a, b): return a.__vector.dot(b.__vector) def __add__(a, b): return PVector.add(a, b, None) def __sub__(a, b): return PVector.sub(a, b, None) def __isub__(a, b): a.sub(b) return a def __iadd__(a, b): a.add(b) return a def __mul__(a, b): if not isinstance(b, Number): raise TypeError( "The * operator can only be used to multiply a PVector by a number") return PVector.mult(a, float(b), None) def __rmul__(a, b): if not isinstance(b, Number): raise TypeError( "The * operator can only be used to multiply a PVector by a number") return PVector.mult(a, float(b), None) def __imul__(a, b): if not isinstance(b, Number): raise TypeError( "The *= operator can only be used to multiply a PVector by a number") a.__vector.mult(float(b)) return a def __truediv__(a, b): if not isinstance(b, Number): raise TypeError( "The * operator can only be used to multiply a PVector by a number") return PVector(a.x / float(b), a.y / float(b), a.z / float(b)) def __itruediv__(a, b): if not isinstance(b, Number): raise TypeError( "The /= operator can only be used to multiply a PVector by a number") a.__vector.set(a.x / float(b), a.y / float(b), a.z / float(b)) return a def __eq__(a, b): return a.x == b[0] and a.y == b[1] and a.z == b[2] def __lt__(a, b): return a.magSq() < b.magSq() def __le__(a, b): return a.magSq() <= b.magSq() def __gt__(a, b): return a.magSq() > b.magSq() def __ge__(a, b): return a.magSq() >= b.magSq() # Problematic class methods, we would rather use p5.Vector when possible... @classmethod def lerp(cls, a, b, f, dest=None): v = createVector(a.x, a.y, a.z) v.lerp(b.__vector, f) if dest is None: return PVector(v.x, v.y, v.z) dest.set(v.x, v.y, v.z) return dest @classmethod def cross(cls, a, b, dest=None): x = a.y * b[2] - b[1] * a.z y = a.z * b[0] - b[2] * a.x z = a.x * b[1] - b[0] * a.y if dest is None: return PVector(x, y, z) dest.set(x, y, z) return dest @classmethod def fromAngle(cls, angle, length=1): # https://github.com/processing/p5.js/blob/3f0b2f0fe575dc81c724474154f5b23a517b7233/src/math/p5.Vector.js return PVector(length * cos(angle), length * sin(angle), 0) @classmethod def fromAngles(theta, phi, length=1): # https://github.com/processing/p5.js/blob/3f0b2f0fe575dc81c724474154f5b23a517b7233/src/math/p5.Vector.js cosPhi = cos(phi) sinPhi = sin(phi) cosTheta = cos(theta) sinTheta = sin(theta) return PVector(length * sinTheta * sinPhi, -length * cosTheta, length * sinTheta * cosPhi) @classmethod def random2D(cls): return PVector.fromAngle(random(TWO_PI)) @classmethod def random3D(cls, dest=None): angle = random(TWO_PI) vz = random(2) - 1 mult = sqrt(1 - vz * vz) vx = mult * cos(angle) vy = mult * sin(angle) if dest is None: return PVector(vx, vy, vz) dest.set(vx, vy, vz) return dest @classmethod def angleBetween(cls, a, b): return acos(a.dot(b) / sqrt(a.magSq() * b.magSq())) # Other harmless p5js methods def equals(self, v): return self == v def heading2D(self): return self.__vector.heading() def reflect(self, *args): # Reflect the incoming vector about a normal to a line in 2D, or about # a normal to a plane in 3D This method acts on the vector directly r = self.__vector.reflect(*args) return r def array(self): # Return a representation of this vector as a float array. This is only # for temporary use. If used in any w fashion, the contents should be # copied by using the p5.Vector.copy() method to copy into your own # array. return self.__vector.array() def toString(self): # Returns a string representation of a vector v by calling String(v) or v.toString(). # return self.__vector.toString() would be something like "p5.vector # Object […, …, …]" return str(self) def rem(self, *args): # Gives remainder of a vector when it is divided by anw vector. See # examples for more context. self.__vector.rem(*args) return self def pre_draw(p5_instance, draw_func, *args, **kwargs): """ We need to run this before the actual draw to insert and update p5 env variables """ global _CTX_MIDDLE, _DEFAULT_FILL, _DEFAULT_LEADMULT, _DEFAULT_STROKE, _DEFAULT_TEXT_FILL global ADD, ALT, ARROW, AUTO, AUDIO, AXES, BACKSPACE, BASELINE, BEVEL, BEZIER, BLEND, BLUR, BOLD, BOLDITALIC global BOTTOM, BURN, CENTER, CHORD, CLAMP, CLOSE, CONTROL, CORNER, CORNERS, CROSS, CURVE, DARKEST global DEG_TO_RAD, DEGREES, DELETE, DIFFERENCE, DILATE, DODGE, DOWN_ARROW, ENTER, ERODE, ESCAPE, EXCLUSION global FILL, GRAY, GRID, HALF_PI, HAND, HARD_LIGHT, HSB, HSL, IMAGE, IMMEDIATE, INVERT, ITALIC, LANDSCAPE global LEFT, LEFT_ARROW, LIGHTEST, LINE_LOOP, LINE_STRIP, LINEAR, LINES, MIRROR, MITER, MOVE, MULTIPLY, NEAREST global NORMAL, OPAQUE, OPEN, OPTION, OVERLAY, P2D, P3D, PI, PIE, POINTS, PORTRAIT, POSTERIZE, PROJECT, QUAD_STRIP global QUADRATIC, QUADS, QUARTER_PI, RAD_TO_DEG, RADIANS, RADIUS, REPEAT, REPLACE, RETURN, RGB, RIGHT, RIGHT_ARROW global ROUND, SCREEN, SHIFT, SOFT_LIGHT, SQUARE, STROKE, SUBTRACT, TAB, TAU, TEXT, TEXTURE, THRESHOLD, TOP global TRIANGLE_FAN, TRIANGLE_STRIP, TRIANGLES, TWO_PI, UP_ARROW, VIDEO, WAIT, WEBGL global frameCount, focused, displayWidth, displayHeight, windowWidth, windowHeight, width, height global deviceOrientation, accelerationX, accelerationY, accelerationZ global pAccelerationX, pAccelerationY, pAccelerationZ, rotationX, rotationY, rotationZ global pRotationX, pRotationY, pRotationZ, turnAxis, keyIsPressed, key, keyCode, mouseX, mouseY, pmouseX, pmouseY global winMouseX, winMouseY, pwinMouseX, pwinMouseY, mouseButton, mouseIsPressed, touches, pixels _CTX_MIDDLE = p5_instance._CTX_MIDDLE _DEFAULT_FILL = p5_instance._DEFAULT_FILL _DEFAULT_LEADMULT = p5_instance._DEFAULT_LEADMULT _DEFAULT_STROKE = p5_instance._DEFAULT_STROKE _DEFAULT_TEXT_FILL = p5_instance._DEFAULT_TEXT_FILL ADD = p5_instance.ADD ALT = p5_instance.ALT ARROW = p5_instance.ARROW AUDIO = p5_instance.AUDIO AUTO = p5_instance.AUTO AXES = p5_instance.AXES BACKSPACE = p5_instance.BACKSPACE BASELINE = p5_instance.BASELINE BEVEL = p5_instance.BEVEL BEZIER = p5_instance.BEZIER BLEND = p5_instance.BLEND BLUR = p5_instance.BLUR BOLD = p5_instance.BOLD BOLDITALIC = p5_instance.BOLDITALIC BOTTOM = p5_instance.BOTTOM BURN = p5_instance.BURN CENTER = p5_instance.CENTER CHORD = p5_instance.CHORD CLAMP = p5_instance.CLAMP CLOSE = p5_instance.CLOSE CONTROL = p5_instance.CONTROL CORNER = p5_instance.CORNER CORNERS = p5_instance.CORNERS CROSS = p5_instance.CROSS CURVE = p5_instance.CURVE DARKEST = p5_instance.DARKEST DEG_TO_RAD = p5_instance.DEG_TO_RAD DEGREES = p5_instance.DEGREES DELETE = p5_instance.DELETE DIFFERENCE = p5_instance.DIFFERENCE DILATE = p5_instance.DILATE DODGE = p5_instance.DODGE DOWN_ARROW = p5_instance.DOWN_ARROW ENTER = p5_instance.ENTER ERODE = p5_instance.ERODE ESCAPE = p5_instance.ESCAPE EXCLUSION = p5_instance.EXCLUSION FILL = p5_instance.FILL GRAY = p5_instance.GRAY GRID = p5_instance.GRID HALF_PI = p5_instance.HALF_PI HAND = p5_instance.HAND HARD_LIGHT = p5_instance.HARD_LIGHT HSB = p5_instance.HSB HSL = p5_instance.HSL IMAGE = p5_instance.IMAGE IMMEDIATE = p5_instance.IMMEDIATE INVERT = p5_instance.INVERT ITALIC = p5_instance.ITALIC LANDSCAPE = p5_instance.LANDSCAPE LEFT = p5_instance.LEFT LEFT_ARROW = p5_instance.LEFT_ARROW LIGHTEST = p5_instance.LIGHTEST LINE_LOOP = p5_instance.LINE_LOOP LINE_STRIP = p5_instance.LINE_STRIP LINEAR = p5_instance.LINEAR LINES = p5_instance.LINES MIRROR = p5_instance.MIRROR MITER = p5_instance.MITER MOVE = p5_instance.MOVE MULTIPLY = p5_instance.MULTIPLY NEAREST = p5_instance.NEAREST NORMAL = p5_instance.NORMAL OPAQUE = p5_instance.OPAQUE OPEN = p5_instance.OPEN OPTION = p5_instance.OPTION OVERLAY = p5_instance.OVERLAY P2D = p5_instance.P2D P3D = p5_instance.WEBGL PI = p5_instance.PI PIE = p5_instance.PIE POINTS = p5_instance.POINTS PORTRAIT = p5_instance.PORTRAIT POSTERIZE = p5_instance.POSTERIZE PROJECT = p5_instance.PROJECT QUAD_STRIP = p5_instance.QUAD_STRIP QUADRATIC = p5_instance.QUADRATIC QUADS = p5_instance.QUADS QUARTER_PI = p5_instance.QUARTER_PI RAD_TO_DEG = p5_instance.RAD_TO_DEG RADIANS = p5_instance.RADIANS RADIUS = p5_instance.RADIUS REPEAT = p5_instance.REPEAT REPLACE = p5_instance.REPLACE RETURN = p5_instance.RETURN RGB = p5_instance.RGB RIGHT = p5_instance.RIGHT RIGHT_ARROW = p5_instance.RIGHT_ARROW ROUND = p5_instance.ROUND SCREEN = p5_instance.SCREEN SHIFT = p5_instance.SHIFT SOFT_LIGHT = p5_instance.SOFT_LIGHT SQUARE = p5_instance.SQUARE STROKE = p5_instance.STROKE SUBTRACT = p5_instance.SUBTRACT TAB = p5_instance.TAB TAU = p5_instance.TAU TEXT = p5_instance.TEXT TEXTURE = p5_instance.TEXTURE THRESHOLD = p5_instance.THRESHOLD TOP = p5_instance.TOP TRIANGLE_FAN = p5_instance.TRIANGLE_FAN TRIANGLE_STRIP = p5_instance.TRIANGLE_STRIP TRIANGLES = p5_instance.TRIANGLES TWO_PI = p5_instance.TWO_PI UP_ARROW = p5_instance.UP_ARROW VIDEO = p5_instance.VIDEO WAIT = p5_instance.WAIT WEBGL = p5_instance.WEBGL frameCount = p5_instance.frameCount focused = p5_instance.focused displayWidth = p5_instance.displayWidth displayHeight = p5_instance.displayHeight windowWidth = p5_instance.windowWidth windowHeight = p5_instance.windowHeight width = p5_instance.width height = p5_instance.height deviceOrientation = p5_instance.deviceOrientation accelerationX = p5_instance.accelerationX accelerationY = p5_instance.accelerationY accelerationZ = p5_instance.accelerationZ pAccelerationX = p5_instance.pAccelerationX pAccelerationY = p5_instance.pAccelerationY pAccelerationZ = p5_instance.pAccelerationZ rotationX = p5_instance.rotationX rotationY = p5_instance.rotationY rotationZ = p5_instance.rotationZ pRotationX = p5_instance.pRotationX pRotationY = p5_instance.pRotationY pRotationZ = p5_instance.pRotationZ turnAxis = p5_instance.turnAxis keyIsPressed = p5_instance.keyIsPressed key = p5_instance.key keyCode = p5_instance.keyCode mouseX = p5_instance.mouseX mouseY = p5_instance.mouseY pmouseX = p5_instance.pmouseX pmouseY = p5_instance.pmouseY winMouseX = p5_instance.winMouseX winMouseY = p5_instance.winMouseY pwinMouseX = p5_instance.pwinMouseX pwinMouseY = p5_instance.pwinMouseY mouseButton = p5_instance.mouseButton mouseIsPressed = p5_instance.mouseIsPressed touches = p5_instance.touches pixels = p5_instance.pixels return draw_func(*args, **kwargs) def global_p5_injection(p5_sketch): """ Injects the p5js's skecth instance as a global variable to setup and draw functions """ def decorator(f, *args, **kwargs): def wrapper(*args, **kwargs): global _P5_INSTANCE _P5_INSTANCE = p5_sketch return pre_draw(_P5_INSTANCE, f, *args, **kwargs) return wrapper return decorator def start_p5(preload_func, setup_func, draw_func, event_functions): """ This is the entrypoint function. It accepts 2 parameters: - preload_func: A Python preload callable - setup_func: a Python setup callable - draw_func: a Python draw callable - event_functions: a config dict for the event functions in the format: {"eventFunctionName": python_event_function} This method gets the p5js's sketch instance and injects them """ def sketch_setup(p5_sketch): """ Callback function called to configure new p5 instance """ p5_sketch.preload = global_p5_injection(p5_sketch)(preload_func) p5_sketch.setup = global_p5_injection(p5_sketch)(setup_func) p5_sketch.draw = global_p5_injection(p5_sketch)(draw_func) window.instance = p5.new(sketch_setup, 'sketch-holder') # Register event functions event_function_names = ( "deviceMoved", "deviceTurned", "deviceShaken", "windowResized", "keyPressed", "keyReleased", "keyTyped", "mousePressed", "mouseReleased", "mouseClicked", "doubleClicked", "mouseMoved", "mouseDragged", "mouseWheel", "touchStarted", "touchMoved", "touchEnded", "keyIsDown", ) for f_name in [f for f in event_function_names if event_functions.get(f, None)]: func = event_functions[f_name] event_func = global_p5_injection(window.instance)(func) setattr(window.instance, f_name, event_func) `; const placeholder = ` def preload(): pass def setup(): pass def draw(): pass deviceMoved = None deviceTurned = None deviceShaken = None keyPressed = None keyReleased = None keyTyped = None mouseMoved = None mouseDragged = None mousePressed = None mouseReleased = None mouseClicked = None doubleClicked = None mouseWheel = None touchStarted = None touchMoved = None touchEnded = None windowResized = None `; let userCode = ` from random import randint def load_image(img_file, im_dir="images",ext="png"): img = loadImage("%s/%s.%s" %(im_dir,img_file,ext)) return img class Actor: def __init__(self,img,x=0,y=0): self.img = load_image(img) self.x = x self.y = y def draw(self): image(self.img,self.x,self.y) NCOLS = 10 NROWS = 10 NMINES = 10 CELLSIZE = 60 WIDTH = NCOLS * CELLSIZE + CELLSIZE // 2 + 1 HEIGHT = NROWS * CELLSIZE + CELLSIZE // 2 + 1 top_grid = None base_grid = None cover = None flag = None tiles = None def setup(): global top_grid, base_grid, cover, flag, tiles top_grid = setup_empty_grid(NCOLS, NROWS, 1) base_grid = setup_empty_grid(NCOLS, NROWS, 0) populate_grid(NMINES, NCOLS, NROWS) count_mines() createCanvas(WIDTH, HEIGHT) cover = Actor('cover') flag = Actor('flag') tiles = {0: Actor('blank'), 1: Actor('one'), 2: Actor('two'), 3: Actor('three'), 4: Actor('four'),5: Actor('five'), 6: Actor('six'), 7: Actor('seven'), 8: Actor('eight'), 'M': Actor('mine')} def draw(): ypos = -CELLSIZE for row in range(NROWS): ypos += CELLSIZE xpos = -CELLSIZE for col in range(NCOLS): xpos += CELLSIZE gridpos = base_grid[row][col] tiles[gridpos].x,tiles[gridpos].y = xpos, ypos tiles[gridpos].draw() ypos = -CELLSIZE for row in range(NROWS): ypos += CELLSIZE xpos = -CELLSIZE for col in range(NCOLS): xpos += CELLSIZE if top_grid[row][col] == 1: cover.x, cover.y = xpos, ypos cover.draw() elif top_grid[row][col] == 'F': flag.x, flag.y = xpos, ypos flag.draw() def mousePressed(*args, **kwargs): col, row = mouseX // CELLSIZE, mouseY // CELLSIZE if not ((0 <= col < NCOLS) and (0 <= row < NROWS)): return if mouseButton == LEFT: if top_grid[row][col] != 'F': top_grid[row][col] = 0 if base_grid[row][col] == 0: edge_detection(col, row) elif mouseButton == CENTER: if top_grid[row][col] == 1: top_grid[row][col] = 'F' elif top_grid[row][col] == 'F': top_grid[row][col] = 1 def setup_empty_grid(NCOLS, NROWS, filler): grid = [[filler] * NCOLS for rows in range(NROWS)] return grid def populate_grid(NMINES, NCOLS, NROWS): global base_grid for mine in range(NMINES): col, row = randint(0, NCOLS - 1), randint(0,NROWS - 1) while base_grid[row][col] == 'M': col, row = randint(0, NCOLS - 1), randint(0,NROWS - 1) base_grid[row][col] = 'M' def count_mines(): global base_grid for r in range(NROWS): for c in range(NCOLS): if base_grid[r][c] != 'M': neighbors = [(c - 1, r - 1), (c, r - 1), (c + 1, r - 1), (c - 1, r), (c + 1, r), (c - 1, r + 1), (c, r + 1), (c + 1, r + 1)] for nx, ny in neighbors: try: if ny >= 0 and nx >= 0 and base_grid[ny][nx] == 'M': base_grid[r][c] += 1 except IndexError: pass def edge_detection(col, row): zeros = [(col, row)] for c, r in zeros: top_grid[r][c] = 0 neighbors = [(c - 1, r - 1), (c, r - 1), (c + 1, r - 1), (c - 1, r ), (c + 1, r ), (c - 1, r + 1), (c, r + 1), (c + 1, r + 1)] for nx, ny in neighbors: try: if ny >= 0 and nx >= 0: if base_grid[ny][nx] == 0 and top_grid[ny][nx] == 1: if top_grid[ny][nx] != 'F': top_grid[ny][nx] = 0 if (nx, ny) not in zeros: zeros.append((nx, ny)) else: if top_grid[ny][nx] != 'F': top_grid[ny][nx] = 0 except: pass `; const startCode = ` event_functions = { "deviceMoved": deviceMoved, "deviceTurned": deviceTurned, "deviceShaken": deviceShaken, "keyPressed": keyPressed, "keyReleased": keyReleased, "keyTyped": keyTyped, "mouseMoved": mouseMoved, "mouseDragged": mouseDragged, "mousePressed": mousePressed, "mouseReleased": mouseReleased, "mouseClicked": mouseClicked, "doubleClicked": doubleClicked, "mouseWheel": mouseWheel, "touchStarted": touchStarted, "touchMoved": touchMoved, "touchEnded": touchEnded, "windowResized": windowResized, } start_p5(preload, setup, draw, event_functions) `; function runCode() { let code = [ placeholder, userCode, wrapperContent, startCode, ].join('\n'); if (window.instance) { window.instance.canvas.remove(); } console.log("Python execution output:"); window.pyodide.runPython(code); } async function main() { const config = { indexURL : "https://cdn.jsdelivr.net/pyodide/v0.18.1/full/", fullStdLib: false, } window.pyodide = await loadPyodide(config); // Pyodide is now ready to use... console.log(window.pyodide.runPython(` import io, code, sys from js import p5, window, document print(sys.version) `)); window.runSketchCode = (code) => { userCode = code; runCode(); } runCode(); }; // async method main(); ================================================ FILE: docs/examples/pyodide/pong/index.html ================================================ pong - pyp5js

Python code here.

RAD =    10
P_RAD =  30
WIDTH =  600
HEIGHT = 300

class Ball:
    def __init__self(x, y, sx, sy): 
        self.x = x
        self.y = y
        self.sx = sx
        self.sy = sy
        
    def draw(self):
        circle(self.x, self.y, 2 * RAD)
        
    def reset(self):
        self.x = WIDTH // 2
        self.y = HEIGHT // 2
        self.sx = 4
        self.sy = 0
        self.play = True

ball = Ball()

class Player:
    def __init__(self, x, y):
        self.x = x
        self.y = y 

    def reset(self):
        self.y = HEIGHT // 2

    def set_pos(self,y):
        self.y = min(HEIGHT, max(y, 0))

    def draw(self):
        strokeWeight(2)
        line(self.x, self.y - P_RAD, self.x, self.y + P_RAD)


player1 = Player(10, HEIGHT // 2)
player2 = Player(WIDTH - 10, HEIGHT // 2)

game = None

def setup():
    global game
    createCanvas(WIDTH, HEIGHT)
    stroke(255)
    fill(255)
    game = Game()
    game.reset()
    
class Game:
    def __init__(self):
        self.over = False
  
    def reset(self):
        self.over = False
        ball.reset()
        player1.reset()
        player2.reset()

    def tick(self):
        if not self.over:
        #  y: keep ball inside of vertical bounds
            if (ball.y < 10) or (ball.y > height - 10): 
                ball.sy *= -1

            ball.y += ball.sy

            # x: player 2
            if (ball.x + RAD >= player2.x):
                ball.sx *= -1

            # x: player 1
            if (ball.x - RAD <= player1.x):
                if ((ball.y > player1.y - P_RAD) and
                    (ball.y < player1.y + P_RAD)):
                    # player 1 hits the ball

                    # bounce back
                    ball.sx *= -1
                    # get ball-paddle angle
                    angle = ball.y - player1.y
                    ball.sy = angle / 9
                    ball.sx = map(abs(angle), 0, P_RAD, 3, 9)

                else:
                    # player misses the ball
                    self.over = True
              
        if (ball.x < -100):
                game.reset()    
        ball.x += ball.sx
        ball.draw()


def draw(): 
    if not game.over:
        background(0)
    else:
        background(255,0,0)

    player1.set_pos(mouseY)
    player1.draw()

    player2.set_pos(ball.y)
    player2.draw()

    game.tick()
================================================ FILE: docs/examples/pyodide/pong/pong.py ================================================ RAD = 10 P_RAD = 30 WIDTH = 600 HEIGHT = 300 class Ball: def __init__self(x, y, sx, sy): self.x = x self.y = y self.sx = sx self.sy = sy def draw(self): circle(self.x, self.y, 2 * RAD) def reset(self): self.x = WIDTH // 2 self.y = HEIGHT // 2 self.sx = 4 self.sy = 0 self.play = True ball = Ball() class Player: def __init__(self, x, y): self.x = x self.y = y def reset(self): self.y = HEIGHT // 2 def set_pos(self,y): self.y = min(HEIGHT, max(y, 0)) def draw(self): strokeWeight(2) line(self.x, self.y - P_RAD, self.x, self.y + P_RAD) player1 = Player(10, HEIGHT // 2) player2 = Player(WIDTH - 10, HEIGHT // 2) game = None def setup(): global game createCanvas(WIDTH, HEIGHT) stroke(255) fill(255) game = Game() game.reset() class Game: def __init__(self): self.over = False def reset(self): self.over = False ball.reset() player1.reset() player2.reset() def tick(self): if not self.over: # y: keep ball inside of vertical bounds if (ball.y < 10) or (ball.y > height - 10): ball.sy *= -1 ball.y += ball.sy # x: player 2 if (ball.x + RAD >= player2.x): ball.sx *= -1 # x: player 1 if (ball.x - RAD <= player1.x): if ((ball.y > player1.y - P_RAD) and (ball.y < player1.y + P_RAD)): # player 1 hits the ball # bounce back ball.sx *= -1 # get ball-paddle angle angle = ball.y - player1.y ball.sy = angle / 9 ball.sx = map(abs(angle), 0, P_RAD, 3, 9) else: # player misses the ball self.over = True if (ball.x < -100): game.reset() ball.x += ball.sx ball.draw() def draw(): if not game.over: background(0) else: background(255,0,0) player1.set_pos(mouseY) player1.draw() player2.set_pos(ball.y) player2.draw() game.tick() ================================================ FILE: docs/examples/pyodide/pong/static/p5.js ================================================ /*! p5.js v1.0.0 February 29, 2020 */ !function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).p5=e()}}(function(){return function o(a,s,l){function u(t,e){if(!s[t]){if(!a[t]){var r="function"==typeof require&&require;if(!e&&r)return r(t,!0);if(h)return h(t,!0);var i=new Error("Cannot find module '"+t+"'");throw i.code="MODULE_NOT_FOUND",i}var n=s[t]={exports:{}};a[t][0].call(n.exports,function(e){return u(a[t][1][e]||e)},n,n.exports,o,a,s,l)}return s[t].exports}for(var h="function"==typeof require&&require,e=0;e>16&255,a[s++]=t>>8&255,a[s++]=255&t;2===o&&(t=u[e.charCodeAt(r)]<<2|u[e.charCodeAt(r+1)]>>4,a[s++]=255&t);1===o&&(t=u[e.charCodeAt(r)]<<10|u[e.charCodeAt(r+1)]<<4|u[e.charCodeAt(r+2)]>>2,a[s++]=t>>8&255,a[s++]=255&t);return a},r.fromByteArray=function(e){for(var t,r=e.length,i=r%3,n=[],o=0,a=r-i;o>2]+s[t<<4&63]+"==")):2==i&&(t=(e[r-2]<<8)+e[r-1],n.push(s[t>>10]+s[t>>4&63]+s[t<<2&63]+"="));return n.join("")};for(var s=[],u=[],h="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=0,o=i.length;n>18&63]+s[n>>12&63]+s[n>>6&63]+s[63&n]);return o.join("")}u["-".charCodeAt(0)]=62,u["_".charCodeAt(0)]=63},{}],20:[function(e,t,r){},{}],21:[function(N,e,F){(function(c){"use strict";var i=N("base64-js"),o=N("ieee754"),e="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;F.Buffer=c,F.SlowBuffer=function(e){+e!=e&&(e=0);return c.alloc(+e)},F.INSPECT_MAX_BYTES=50;var r=2147483647;function a(e){if(r>>1;case"base64":return O(e).length;default:if(n)return i?-1:R(e).length;t=(""+t).toLowerCase(),n=!0}}function d(e,t,r){var i=e[t];e[t]=e[r],e[r]=i}function p(e,t,r,i,n){if(0===e.length)return-1;if("string"==typeof r?(i=r,r=0):2147483647=e.length){if(n)return-1;r=e.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof t&&(t=c.from(t,i)),c.isBuffer(t))return 0===t.length?-1:m(e,t,r,i,n);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):m(e,[t],r,i,n);throw new TypeError("val must be string, number or Buffer")}function m(e,t,r,i,n){var o,a=1,s=e.length,l=t.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(e.length<2||t.length<2)return-1;s/=a=2,l/=2,r/=2}function u(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(n){var h=-1;for(o=r;o>8,n=r%256,o.push(n),o.push(i);return o}(t,e.length-r),e,r,i)}function b(e,t,r){return 0===t&&r===e.length?i.fromByteArray(e):i.fromByteArray(e.slice(t,r))}function _(e,t,r){r=Math.min(e.length,r);for(var i=[],n=t;n>>10&1023|55296),h=56320|1023&h),i.push(h),n+=c}return function(e){var t=e.length;if(t<=x)return String.fromCharCode.apply(String,e);var r="",i=0;for(;ithis.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e=e||"utf8";;)switch(e){case"hex":return M(this,t,r);case"utf8":case"utf-8":return _(this,t,r);case"ascii":return w(this,t,r);case"latin1":case"binary":return S(this,t,r);case"base64":return b(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,t,r);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}.apply(this,arguments)},c.prototype.equals=function(e){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===c.compare(this,e)},c.prototype.inspect=function(){var e="",t=F.INSPECT_MAX_BYTES;return e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(e+=" ... "),""},e&&(c.prototype[e]=c.prototype.inspect),c.prototype.compare=function(e,t,r,i,n){if(A(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),t<0||r>e.length||i<0||n>this.length)throw new RangeError("out of range index");if(n<=i&&r<=t)return 0;if(n<=i)return-1;if(r<=t)return 1;if(this===e)return 0;for(var o=(n>>>=0)-(i>>>=0),a=(r>>>=0)-(t>>>=0),s=Math.min(o,a),l=this.slice(i,n),u=e.slice(t,r),h=0;h>>=0,isFinite(r)?(r>>>=0,void 0===i&&(i="utf8")):(i=r,r=void 0)}var n=this.length-t;if((void 0===r||nthis.length)throw new RangeError("Attempt to write outside buffer bounds");i=i||"utf8";for(var o,a,s,l,u,h,c=!1;;)switch(i){case"hex":return g(this,e,t,r);case"utf8":case"utf-8":return u=t,h=r,D(R(e,(l=this).length-u),l,u,h);case"ascii":return v(this,e,t,r);case"latin1":case"binary":return v(this,e,t,r);case"base64":return o=this,a=t,s=r,D(O(e),o,a,s);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return y(this,e,t,r);default:if(c)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),c=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var x=4096;function w(e,t,r){var i="";r=Math.min(e.length,r);for(var n=t;ne.length)throw new RangeError("Index out of range")}function P(e,t,r,i){if(r+i>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function L(e,t,r,i,n){return t=+t,r>>>=0,n||P(e,0,r,4),o.write(e,t,r,i,23,4),r+4}function k(e,t,r,i,n){return t=+t,r>>>=0,n||P(e,0,r,8),o.write(e,t,r,i,52,8),r+8}c.prototype.slice=function(e,t){var r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):r>>=0,t>>>=0,r||T(e,t,this.length);for(var i=this[e],n=1,o=0;++o>>=0,t>>>=0,r||T(e,t,this.length);for(var i=this[e+--t],n=1;0>>=0,t||T(e,1,this.length),this[e]},c.prototype.readUInt16LE=function(e,t){return e>>>=0,t||T(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUInt16BE=function(e,t){return e>>>=0,t||T(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUInt32LE=function(e,t){return e>>>=0,t||T(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUInt32BE=function(e,t){return e>>>=0,t||T(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||T(e,t,this.length);for(var i=this[e],n=1,o=0;++o>>=0,t>>>=0,r||T(e,t,this.length);for(var i=t,n=1,o=this[e+--i];0>>=0,t||T(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){e>>>=0,t||T(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(e,t){e>>>=0,t||T(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(e,t){return e>>>=0,t||T(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return e>>>=0,t||T(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readFloatLE=function(e,t){return e>>>=0,t||T(e,4,this.length),o.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return e>>>=0,t||T(e,4,this.length),o.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return e>>>=0,t||T(e,8,this.length),o.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return e>>>=0,t||T(e,8,this.length),o.read(this,e,!1,52,8)},c.prototype.writeUIntLE=function(e,t,r,i){e=+e,t>>>=0,r>>>=0,i||C(this,e,t,r,Math.pow(2,8*r)-1,0);var n=1,o=0;for(this[t]=255&e;++o>>=0,r>>>=0,i||C(this,e,t,r,Math.pow(2,8*r)-1,0);var n=r-1,o=1;for(this[t+n]=255&e;0<=--n&&(o*=256);)this[t+n]=e/o&255;return t+r},c.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,1,255,0),this[t]=255&e,t+1},c.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},c.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeIntLE=function(e,t,r,i){if(e=+e,t>>>=0,!i){var n=Math.pow(2,8*r-1);C(this,e,t,r,n-1,-n)}var o=0,a=1,s=0;for(this[t]=255&e;++o>0)-s&255;return t+r},c.prototype.writeIntBE=function(e,t,r,i){if(e=+e,t>>>=0,!i){var n=Math.pow(2,8*r-1);C(this,e,t,r,n-1,-n)}var o=r-1,a=1,s=0;for(this[t+o]=255&e;0<=--o&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+r},c.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},c.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeFloatLE=function(e,t,r){return L(this,e,t,!0,r)},c.prototype.writeFloatBE=function(e,t,r){return L(this,e,t,!1,r)},c.prototype.writeDoubleLE=function(e,t,r){return k(this,e,t,!0,r)},c.prototype.writeDoubleBE=function(e,t,r){return k(this,e,t,!1,r)},c.prototype.copy=function(e,t,r,i){if(!c.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r=r||0,i||0===i||(i=this.length),t>=e.length&&(t=e.length),t=t||0,0=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t>>=0,r=void 0===r?this.length:r>>>0,"number"==typeof(e=e||0))for(o=t;o>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function O(e){return i.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(t,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function D(e,t,r,i){for(var n=0;n=t.length||n>=e.length);++n)t[n+r]=e[n];return n}function A(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function I(e){return e!=e}var U=function(){for(var e="0123456789abcdef",t=new Array(256),r=0;r<16;++r)for(var i=16*r,n=0;n<16;++n)t[i+n]=e[r]+e[n];return t}()}).call(this,N("buffer").Buffer)},{"base64-js":19,buffer:21,ieee754:30}],22:[function(e,t,r){"use strict";t.exports=e("./").polyfill()},{"./":23}],23:[function(z,r,i){(function(j,V){var e,t;e=this,t=function(){"use strict";function l(e){return"function"==typeof e}var r=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},i=0,t=void 0,n=void 0,a=function(e,t){f[i]=e,f[i+1]=t,2===(i+=2)&&(n?n(d):y())};var e="undefined"!=typeof window?window:void 0,o=e||{},s=o.MutationObserver||o.WebKitMutationObserver,u="undefined"==typeof self&&void 0!==j&&"[object process]"==={}.toString.call(j),h="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function c(){var e=setTimeout;return function(){return e(d,1)}}var f=new Array(1e3);function d(){for(var e=0;e":">",'"':""","'":"'","/":"/"};function S(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,function(e){return w[e]}):e}var M=function(){function i(e){var t,r=1=this.maxReplaces)break}for(a=0;r=this.regexp.exec(e);){if(void 0===(i=h(r[1].trim())))if("function"==typeof c){var d=c(e,r,t);i="string"==typeof d?d:""}else this.logger.warn("missed to pass in variable ".concat(r[1]," for interpolating ").concat(e)),i="";else"string"==typeof i||this.useRawValueToEscape||(i=v(i));if(i=this.escapeValue?u(this.escape(i)):u(i),e=e.replace(r[0],i),this.regexp.lastIndex=0,++a>=this.maxReplaces)break}return e}},{key:"nest",value:function(e,t,r){var i,n,o=D({},2>1,h=-7,c=r?n-1:0,f=r?-1:1,d=e[t+c];for(c+=f,o=d&(1<<-h)-1,d>>=-h,h+=s;0>=-h,h+=i;0>1,f=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,d=i?0:o-1,p=i?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=h):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),2<=(t+=1<=a+c?f/l:f*Math.pow(2,1-c))*l&&(a++,l/=2),h<=a+c?(s=0,a=h):1<=a+c?(s=(t*l-1)*Math.pow(2,n),a+=c):(s=t*Math.pow(2,c-1)*Math.pow(2,n),a=0));8<=n;e[r+d]=255&s,d+=p,s/=256,n-=8);for(a=a<Math.abs(e[0])&&(t=1),Math.abs(e[2])>Math.abs(e[t])&&(t=2),t}var C=4e150;function P(e,t){e.f+=t.f,e.b.f+=t.b.f}function u(e,t,r){return e=e.a,t=t.a,r=r.a,t.b.a===e?r.b.a===e?v(t.a,r.a)?b(r.b.a,t.a,r.a)<=0:0<=b(t.b.a,r.a,t.a):b(r.b.a,e,r.a)<=0:r.b.a===e?0<=b(t.b.a,e,t.a):(t=y(t.b.a,e,t.a),(e=y(r.b.a,e,r.a))<=t)}function L(e){e.a.i=null;var t=e.e;t.a.c=t.c,t.c.a=t.a,e.e=null}function h(e,t){c(e.a),e.c=!1,(e.a=t).i=e}function k(e){for(var t=e.a.a;(e=fe(e)).a.a===t;);return e.c&&(h(e,t=f(ce(e).a.b,e.a.e)),e=fe(e)),e}function R(e,t,r){var i=new he;return i.a=r,i.e=W(e.f,t.e,i),r.i=i}function O(e,t){switch(e.s){case 100130:return 0!=(1&t);case 100131:return 0!==t;case 100132:return 0>1]],s[a[u]])?le(r,u):ue(r,u)),s[o]=null,l[o]=r.b,r.b=o}else for(r.c[-(o+1)]=null;0Math.max(a.a,l.a))return!1;if(v(o,a)){if(0i.f&&(i.f*=2,i.c=oe(i.c,i.f+1)),0===i.b?r=n:(r=i.b,i.b=i.c[i.b]),i.e[r]=t,i.c[r]=n,i.d[n]=r,i.h&&ue(i,n),r}return i=e.a++,e.c[i]=t,-(i+1)}function ie(e){if(0===e.a)return se(e.b);var t=e.c[e.d[e.a-1]];if(0!==e.b.a&&v(ae(e.b),t))return se(e.b);for(;--e.a,0e.a||v(i[a],i[l])){n[r[o]=a]=o;break}n[r[o]=l]=o,o=s}}function ue(e,t){for(var r=e.d,i=e.e,n=e.c,o=t,a=r[o];;){var s=o>>1,l=r[s];if(0==s||v(i[l],i[a])){n[r[o]=a]=o;break}n[r[o]=l]=o,o=s}}function he(){this.e=this.a=null,this.f=0,this.c=this.b=this.h=this.d=!1}function ce(e){return e.e.c.b}function fe(e){return e.e.a.b}(i=q.prototype).x=function(){Y(this,0)},i.B=function(e,t){switch(e){case 100142:return;case 100140:switch(t){case 100130:case 100131:case 100132:case 100133:case 100134:return void(this.s=t)}break;case 100141:return void(this.m=!!t);default:return void Z(this,100900)}Z(this,100901)},i.y=function(e){switch(e){case 100142:return 0;case 100140:return this.s;case 100141:return this.m;default:Z(this,100900)}return!1},i.A=function(e,t,r){this.j[0]=e,this.j[1]=t,this.j[2]=r},i.z=function(e,t){var r=t||null;switch(e){case 100100:case 100106:this.h=r;break;case 100104:case 100110:this.l=r;break;case 100101:case 100107:this.k=r;break;case 100102:case 100108:this.i=r;break;case 100103:case 100109:this.p=r;break;case 100105:case 100111:this.o=r;break;case 100112:this.r=r;break;default:Z(this,100900)}},i.C=function(e,t){var r=!1,i=[0,0,0];Y(this,2);for(var n=0;n<3;++n){var o=e[n];o<-1e150&&(o=-1e150,r=!0),1e150n[u]&&(n[u]=h,a[u]=l)}if(l=0,n[1]-o[1]>n[0]-o[0]&&(l=1),n[2]-o[2]>n[l]-o[l]&&(l=2),o[l]>=n[l])i[0]=0,i[1]=0,i[2]=1;else{for(n=0,o=s[l],a=a[l],s=[0,0,0],o=[o.g[0]-a.g[0],o.g[1]-a.g[1],o.g[2]-a.g[2]],u=[0,0,0],l=r.e;l!==r;l=l.e)u[0]=l.g[0]-a.g[0],u[1]=l.g[1]-a.g[1],u[2]=l.g[2]-a.g[2],s[0]=o[1]*u[2]-o[2]*u[1],s[1]=o[2]*u[0]-o[0]*u[2],s[2]=o[0]*u[1]-o[1]*u[0],n<(h=s[0]*s[0]+s[1]*s[1]+s[2]*s[2])&&(n=h,i[0]=s[0],i[1]=s[1],i[2]=s[2]);n<=0&&(i[0]=i[1]=i[2]=0,i[T(o)]=1)}r=!0}for(s=T(i),l=this.b.c,n=(s+1)%3,a=(s+2)%3,s=0>=l,h-=l,g!=o){if(g==a)break;for(var v=g>8,++y;var _=b;if(i>=8;null!==m&&s<4096&&(p[s++]=m<<8|_,u+1<=s&&l<12&&(++l,u=u<<1|1)),m=g}else s=1+a,u=(1<<(l=n+1))-1,m=null}return f!==i&&console.log("Warning, gif stream shorter than expected."),r}try{r.GifWriter=function(v,e,t,r){var y=0,i=void 0===(r=void 0===r?{}:r).loop?null:r.loop,b=void 0===r.palette?null:r.palette;if(e<=0||t<=0||65535>=1;)++n;if(a=1<>8&255,v[y++]=255&t,v[y++]=t>>8&255,v[y++]=(null!==b?128:0)|n,v[y++]=o,v[y++]=0,null!==b)for(var s=0,l=b.length;s>16&255,v[y++]=u>>8&255,v[y++]=255&u}if(null!==i){if(i<0||65535>8&255,v[y++]=0}var x=!1;this.addFrame=function(e,t,r,i,n,o){if(!0===x&&(--y,x=!1),o=void 0===o?{}:o,e<0||t<0||65535>=1;)++u;l=1<>8&255,v[y++]=d,v[y++]=0),v[y++]=44,v[y++]=255&e,v[y++]=e>>8&255,v[y++]=255&t,v[y++]=t>>8&255,v[y++]=255&r,v[y++]=r>>8&255,v[y++]=255&i,v[y++]=i>>8&255,v[y++]=!0===a?128|u-1:0,!0===a)for(var p=0,m=s.length;p>16&255,v[y++]=g>>8&255,v[y++]=255&g}return y=function(t,r,e,i){t[r++]=e;var n=r++,o=1<>=8,h-=8,r===n+256&&(t[n]=255,n=r++)}function d(e){c|=e<>=8,h-=8,r===n+256&&(t[n]=255,n=r++);4096===l?(d(o),l=1+s,u=e+1,m={}):(1<>7,n=1<<1+(7&r);x[e++],x[e++];var o=null,a=null;i&&(o=e,e+=3*(a=n));var s=!0,l=[],u=0,h=null,c=0,f=null;for(this.width=w,this.height=t;s&&e>2&7,e++;break;case 254:for(;;){if(!(0<=(C=x[e++])))throw Error("Invalid block size");if(0===C)break;e+=C}break;default:throw new Error("Unknown graphic control label: 0x"+x[e-1].toString(16))}break;case 44:var p=x[e++]|x[e++]<<8,m=x[e++]|x[e++]<<8,g=x[e++]|x[e++]<<8,v=x[e++]|x[e++]<<8,y=x[e++],b=y>>6&1,_=1<<1+(7&y),S=o,M=a,E=!1;if(y>>7){E=!0;S=e,e+=3*(M=_)}var T=e;for(e++;;){var C;if(!(0<=(C=x[e++])))throw Error("Invalid block size");if(0===C)break;e+=C}l.push({x:p,y:m,width:g,height:v,has_local_palette:E,palette_offset:S,palette_size:M,data_offset:T,data_length:e-T,transparent_index:h,interlaced:!!b,delay:u,disposal:c});break;case 59:s=!1;break;default:throw new Error("Unknown gif block: 0x"+x[e-1].toString(16))}this.numFrames=function(){return l.length},this.loopCount=function(){return f},this.frameInfo=function(e){if(e<0||e>=l.length)throw new Error("Frame index out of range.");return l[e]},this.decodeAndBlitFrameBGRA=function(e,t){var r=this.frameInfo(e),i=r.width*r.height,n=new Uint8Array(i);P(x,r.data_offset,n,i);var o=r.palette_offset,a=r.transparent_index;null===a&&(a=256);var s=r.width,l=w-s,u=s,h=4*(r.y*w+r.x),c=4*((r.y+r.height)*w+r.x),f=h,d=4*l;!0===r.interlaced&&(d+=4*w*7);for(var p=8,m=0,g=n.length;m>=1)),v===a)f+=4;else{var y=x[o+3*v],b=x[o+3*v+1],_=x[o+3*v+2];t[f++]=_,t[f++]=b,t[f++]=y,t[f++]=255}--u}},this.decodeAndBlitFrameRGBA=function(e,t){var r=this.frameInfo(e),i=r.width*r.height,n=new Uint8Array(i);P(x,r.data_offset,n,i);var o=r.palette_offset,a=r.transparent_index;null===a&&(a=256);var s=r.width,l=w-s,u=s,h=4*(r.y*w+r.x),c=4*((r.y+r.height)*w+r.x),f=h,d=4*l;!0===r.interlaced&&(d+=4*w*7);for(var p=8,m=0,g=n.length;m>=1)),v===a)f+=4;else{var y=x[o+3*v],b=x[o+3*v+1],_=x[o+3*v+2];t[f++]=y,t[f++]=b,t[f++]=_,t[f++]=255}--u}}}}catch(e){}},{}],33:[function(jr,t,r){(function(Gr){var e;e=this,function(E){"use strict";function e(e){if(null==this)throw TypeError();var t=String(this),r=t.length,i=e?Number(e):0;if(i!=i&&(i=0),!(i<0||r<=i)){var n,o=t.charCodeAt(i);return 55296<=o&&o<=56319&&i+1>>=1,t}function _(e,t,r){if(!t)return r;for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<>>16-t;return e.tag>>>=t,e.bitcount-=t,i+r}function x(e,t){for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<>>=1,++n,r+=t.table[n],0<=(i-=t.table[n]););return e.tag=o,e.bitcount-=n,t.trans[r+i]}function w(e,t,r){var i,n,o,a,s,l;for(i=_(e,5,257),n=_(e,5,1),o=_(e,4,4),a=0;a<19;++a)g[a]=0;for(a=0;athis.x2&&(this.x2=e)),"number"==typeof t&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=t,this.y2=t),tthis.y2&&(this.y2=t))},C.prototype.addX=function(e){this.addPoint(e,null)},C.prototype.addY=function(e){this.addPoint(null,e)},C.prototype.addBezier=function(e,t,r,i,n,o,a,s){var l=this,u=[e,t],h=[r,i],c=[n,o],f=[a,s];this.addPoint(e,t),this.addPoint(a,s);for(var d=0;d<=1;d++){var p=6*u[d]-12*h[d]+6*c[d],m=-3*u[d]+9*h[d]-9*c[d]+3*f[d],g=3*h[d]-3*u[d];if(0!=m){var v=Math.pow(p,2)-4*g*m;if(!(v<0)){var y=(-p+Math.sqrt(v))/(2*m);0>8&255,255&e]},A.USHORT=U(2),D.SHORT=function(e){return 32768<=e&&(e=-(65536-e)),[e>>8&255,255&e]},A.SHORT=U(2),D.UINT24=function(e){return[e>>16&255,e>>8&255,255&e]},A.UINT24=U(3),D.ULONG=function(e){return[e>>24&255,e>>16&255,e>>8&255,255&e]},A.ULONG=U(4),D.LONG=function(e){return R<=e&&(e=-(2*R-e)),[e>>24&255,e>>16&255,e>>8&255,255&e]},A.LONG=U(4),D.FIXED=D.ULONG,A.FIXED=A.ULONG,D.FWORD=D.SHORT,A.FWORD=A.SHORT,D.UFWORD=D.USHORT,A.UFWORD=A.USHORT,D.LONGDATETIME=function(e){return[0,0,0,0,e>>24&255,e>>16&255,e>>8&255,255&e]},A.LONGDATETIME=U(8),D.TAG=function(e){return k.argument(4===e.length,"Tag should be exactly 4 ASCII characters."),[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]},A.TAG=U(4),D.Card8=D.BYTE,A.Card8=A.BYTE,D.Card16=D.USHORT,A.Card16=A.USHORT,D.OffSize=D.BYTE,A.OffSize=A.BYTE,D.SID=D.USHORT,A.SID=A.USHORT,D.NUMBER=function(e){return-107<=e&&e<=107?[e+139]:108<=e&&e<=1131?[247+((e-=108)>>8),255&e]:-1131<=e&&e<=-108?[251+((e=-e-108)>>8),255&e]:-32768<=e&&e<=32767?D.NUMBER16(e):D.NUMBER32(e)},A.NUMBER=function(e){return D.NUMBER(e).length},D.NUMBER16=function(e){return[28,e>>8&255,255&e]},A.NUMBER16=U(3),D.NUMBER32=function(e){return[29,e>>24&255,e>>16&255,e>>8&255,255&e]},A.NUMBER32=U(5),D.REAL=function(e){var t=e.toString(),r=/\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec(t);if(r){var i=parseFloat("1e"+((r[2]?+r[2]:0)+r[1].length));t=(Math.round(e*i)/i).toString()}for(var n="",o=0,a=t.length;o>8&255,t[t.length]=255&i}return t},A.UTF16=function(e){return 2*e.length};var N={"x-mac-croatian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈ƫȅ ÀÃÕŒœĐ—“”‘’÷◊©⁄€‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ","x-mac-cyrillic":"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю","x-mac-gaelic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØḂ±≤≥ḃĊċḊḋḞḟĠġṀæøṁṖṗɼƒſṠ«»… ÀÃÕŒœ–—“”‘’ṡẛÿŸṪ€‹›Ŷŷṫ·Ỳỳ⁊ÂÊÁËÈÍÎÏÌÓÔ♣ÒÚÛÙıÝýŴŵẄẅẀẁẂẃ","x-mac-greek":"Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦€ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ­","x-mac-icelandic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüݰ¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-inuit":"ᐃᐄᐅᐆᐊᐋᐱᐲᐳᐴᐸᐹᑉᑎᑏᑐᑑᑕᑖᑦᑭᑮᑯᑰᑲᑳᒃᒋᒌᒍᒎᒐᒑ°ᒡᒥᒦ•¶ᒧ®©™ᒨᒪᒫᒻᓂᓃᓄᓅᓇᓈᓐᓯᓰᓱᓲᓴᓵᔅᓕᓖᓗᓘᓚᓛᓪᔨᔩᔪᔫᔭ… ᔮᔾᕕᕖᕗ–—“”‘’ᕘᕙᕚᕝᕆᕇᕈᕉᕋᕌᕐᕿᖀᖁᖂᖃᖄᖅᖏᖐᖑᖒᖓᖔᖕᙱᙲᙳᙴᙵᙶᖖᖠᖡᖢᖣᖤᖥᖦᕼŁł","x-mac-ce":"ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ",macintosh:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-romanian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂȘ∞±≤≥¥µ∂∑∏π∫ªºΩăș¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›Țț‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-turkish":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙˆ˜¯˘˙˚¸˝˛ˇ"};O.MACSTRING=function(e,t,r,i){var n=N[i];if(void 0!==n){for(var o="",a=0;a>8&255,l+256&255)}return o}D.MACSTRING=function(e,t){var r=function(e){if(!F)for(var t in F={},N)F[t]=new String(t);var r=F[e];if(void 0!==r){if(B){var i=B.get(r);if(void 0!==i)return i}var n=N[e];if(void 0!==n){for(var o={},a=0;a>8,t[c+1]=255&f,t=t.concat(i[h])}return t},A.TABLE=function(e){for(var t=0,r=e.fields.length,i=0;i>1,t.skip("uShort",3),e.glyphIndexMap={};for(var a=new se.Parser(r,i+n+14),s=new se.Parser(r,i+n+16+2*o),l=new se.Parser(r,i+n+16+4*o),u=new se.Parser(r,i+n+16+6*o),h=i+n+16+8*o,c=0;c>4,o=15&i;if(15==n)break;if(t+=r[n],15==o)break;t+=r[o]}return parseFloat(t)}(e);if(32<=t&&t<=246)return t-139;if(247<=t&&t<=250)return 256*(t-247)+e.parseByte()+108;if(251<=t&&t<=254)return 256*-(t-251)-e.parseByte()-108;throw new Error("Invalid b0 "+t)}function Te(e,t,r){t=void 0!==t?t:0;var i=new se.Parser(e,t),n=[],o=[];for(r=void 0!==r?r:e.length;i.relativeOffset>1,T.length=0,P=!0}return function e(t){for(var r,i,n,o,a,s,l,u,h,c,f,d,p=0;pMath.abs(d-R)?k=f+T.shift():R=d+T.shift(),E.curveTo(y,b,_,x,l,u),E.curveTo(h,c,f,d,k,R);break;default:console.log("Glyph "+v.index+": unknown operator 1200"+m),T.length=0}break;case 14:0>3;break;case 21:2>16),p+=2;break;case 29:a=T.pop()+g.gsubrsBias,(s=g.gsubrs[a])&&e(s);break;case 30:for(;0=r.begin&&e=fe.length){var a=i.parseChar();r.names.push(i.parseString(a))}break;case 2.5:r.numberOfGlyphs=i.parseUShort(),r.offset=new Array(r.numberOfGlyphs);for(var s=0;st.value.tag?1:-1}),t.fields=t.fields.concat(i),t.fields=t.fields.concat(n),t}function gt(e,t,r){for(var i=0;i 123 are reserved for internal usage");d|=1<>>1,o=e[n].tag;if(o===t)return n;o>>1,o=e[n];if(o===t)return n;o>>1,a=(r=e[o]).start;if(a===t)return r;a(r=e[i-1]).end?0:r}function xt(e,t){this.font=e,this.tableName=t}function wt(e){xt.call(this,e,"gpos")}function St(e){xt.call(this,e,"gsub")}function Mt(e,t){var r=e.length;if(r!==t.length)return!1;for(var i=0;it.points.length-1||i.matchedPoints[1]>n.points.length-1)throw Error("Matched points out of range in "+t.name);var a=t.points[i.matchedPoints[0]],s=n.points[i.matchedPoints[1]],l={xScale:i.xScale,scale01:i.scale01,scale10:i.scale10,yScale:i.yScale,dx:0,dy:0};s=kt([s],l)[0],l.dx=a.x-s.x,l.dy=a.y-s.y,o=kt(n.points,l)}t.points=t.points.concat(o)}}return Rt(t.points)}(wt.prototype=xt.prototype={searchTag:yt,binSearch:bt,getTable:function(e){var t=this.font.tables[this.tableName];return!t&&e&&(t=this.font.tables[this.tableName]=this.createDefaultTable()),t},getScriptNames:function(){var e=this.getTable();return e?e.scripts.map(function(e){return e.tag}):[]},getDefaultScriptName:function(){var e=this.getTable();if(e){for(var t=!1,r=0;r=s[u-1].tag,"Features must be added in alphabetical order."),o={tag:r,feature:{params:0,lookupListIndexes:[]}},s.push(o),a.push(u),o.feature}}},getLookupTables:function(e,t,r,i,n){var o=this.getFeatureTable(e,t,r,n),a=[];if(o){for(var s,l=o.lookupListIndexes,u=this.font.tables[this.tableName].lookups,h=0;h",s),t.stack.push(Math.round(64*s))}function vr(e,t){var r=t.stack,i=r.pop(),n=t.fv,o=t.pv,a=t.ppem,s=t.deltaBase+16*(e-1),l=t.deltaShift,u=t.z0;E.DEBUG&&console.log(t.step,"DELTAP["+e+"]",i,r);for(var h=0;h>4)===a){var d=(15&f)-8;0<=d&&d++,E.DEBUG&&console.log(t.step,"DELTAPFIX",c,"by",d*l);var p=u[c];n.setRelative(p,p,d*l,o)}}}function yr(e,t){var r=t.stack,i=r.pop();E.DEBUG&&console.log(t.step,"ROUND[]"),r.push(64*t.round(i/64))}function br(e,t){var r=t.stack,i=r.pop(),n=t.ppem,o=t.deltaBase+16*(e-1),a=t.deltaShift;E.DEBUG&&console.log(t.step,"DELTAC["+e+"]",i,r);for(var s=0;s>4)===n){var h=(15&u)-8;0<=h&&h++;var c=h*a;E.DEBUG&&console.log(t.step,"DELTACFIX",l,"by",c),t.cvt[l]+=c}}}function _r(e,t){var r,i,n=t.stack,o=n.pop(),a=n.pop(),s=t.z2[o],l=t.z1[a];E.DEBUG&&console.log(t.step,"SDPVTL["+e+"]",o,a),i=e?(r=s.y-l.y,l.x-s.x):(r=l.x-s.x,l.y-s.y),t.dpv=Zt(r,i)}function xr(e,t){var r=t.stack,i=t.prog,n=t.ip;E.DEBUG&&console.log(t.step,"PUSHB["+e+"]");for(var o=0;o":"_")+(i?"R":"_")+(0===n?"Gr":1===n?"Bl":2===n?"Wh":"")+"]",e?c+"("+o.cvt[c]+","+u+")":"",f,"(d =",a,"->",l*s,")"),o.rp1=o.rp0,o.rp2=f,t&&(o.rp0=f)}Ft.prototype.exec=function(e,t){if("number"!=typeof t)throw new Error("Point size is not a number!");if(!(2",i),s.interpolate(c,o,a,l),s.touch(c)}e.loop=1},dr.bind(void 0,0),dr.bind(void 0,1),function(e){for(var t=e.stack,r=e.rp0,i=e.z0[r],n=e.loop,o=e.fv,a=e.pv,s=e.z1;n--;){var l=t.pop(),u=s[l];E.DEBUG&&console.log(e.step,(1=a.width||t>=a.height?[0,0,0,0]:this._getPixel(e,t);var s=new l.default.Image(r,i);return s.canvas.getContext("2d").drawImage(a,e,t,r*o,i*o,0,0,r,i),s},l.default.Renderer.prototype.textLeading=function(e){return"number"==typeof e?(this._setProperty("_textLeading",e),this._pInst):this._textLeading},l.default.Renderer.prototype.textSize=function(e){return"number"==typeof e?(this._setProperty("_textSize",e),this._setProperty("_textLeading",e*y._DEFAULT_LEADMULT),this._applyTextProperties()):this._textSize},l.default.Renderer.prototype.textStyle=function(e){return e?(e!==y.NORMAL&&e!==y.ITALIC&&e!==y.BOLD&&e!==y.BOLDITALIC||this._setProperty("_textStyle",e),this._applyTextProperties()):this._textStyle},l.default.Renderer.prototype.textAscent=function(){return null===this._textAscent&&this._updateTextMetrics(),this._textAscent},l.default.Renderer.prototype.textDescent=function(){return null===this._textDescent&&this._updateTextMetrics(),this._textDescent},l.default.Renderer.prototype.textAlign=function(e,t){return void 0!==e?(this._setProperty("_textAlign",e),void 0!==t&&this._setProperty("_textBaseline",t),this._applyTextProperties()):{horizontal:this._textAlign,vertical:this._textBaseline}},l.default.Renderer.prototype.text=function(e,t,r,i,n){var o,a,s,l,u,h,c,f,d=this._pInst,p=Number.MAX_VALUE;if((this._doFill||this._doStroke)&&void 0!==e){if("string"!=typeof e&&(e=e.toString()),o=(e=e.replace(/(\t)/g," ")).split("\n"),void 0!==i){for(s=f=0;ss.HALF_PI&&e<=3*s.HALF_PI?Math.atan(r/i*Math.tan(e))+s.PI:Math.atan(r/i*Math.tan(e))+s.TWO_PI,t=t<=s.HALF_PI?Math.atan(r/i*Math.tan(t)):t>s.HALF_PI&&t<=3*s.HALF_PI?Math.atan(r/i*Math.tan(t))+s.PI:Math.atan(r/i*Math.tan(t))+s.TWO_PI),tv||Math.abs(this.accelerationY-this.pAccelerationY)>v||Math.abs(this.accelerationZ-this.pAccelerationZ)>v)&&e();var t=this.deviceTurned||window.deviceTurned;if("function"==typeof t){var r=this.rotationX+180,i=this.pRotationX+180,n=c+180;0>>24],i+=x[(16711680&C)>>16],n+=x[(65280&C)>>8],o+=x[255&C],r+=k[_],s++}w[l=T+y]=a/r,S[l]=i/r,M[l]=n/r,E[l]=o/r}T+=d}for(h=(u=-P)*d,b=T=0;b>>16,e[r+1]=(65280&t[i])>>>8,e[r+2]=255&t[i],e[r+3]=(4278190080&t[i])>>>24},O._toImageData=function(e){return e instanceof ImageData?e:e.getContext("2d").getImageData(0,0,e.width,e.height)},O._createImageData=function(e,t){return O._tmpCanvas=document.createElement("canvas"),O._tmpCtx=O._tmpCanvas.getContext("2d"),this._tmpCtx.createImageData(e,t)},O.apply=function(e,t,r){var i=e.getContext("2d"),n=i.getImageData(0,0,e.width,e.height),o=t(n,r);o instanceof ImageData?i.putImageData(o,0,0,0,0,e.width,e.height):i.putImageData(n,0,0,0,0,e.width,e.height)},O.threshold=function(e,t){var r=O._toPixels(e);void 0===t&&(t=.5);for(var i=Math.floor(255*t),n=0;n>8)/i,r[n+1]=255*(a*t>>8)/i,r[n+2]=255*(s*t>>8)/i}},O.dilate=function(e){for(var t,r,i,n,o,a,s,l,u,h,c,f,d,p,m,g,v,y=O._toPixels(e),b=0,_=y.length?y.length/4:0,x=new Int32Array(_);b<_;)for(r=(t=b)+e.width;b>16&255)+151*(i>>8&255)+28*(255&i))<(m=77*(c>>16&255)+151*(c>>8&255)+28*(255&c))&&(n=c,o=m),o<(p=77*((h=O._getARGB(y,a))>>16&255)+151*(h>>8&255)+28*(255&h))&&(n=h,o=p),o<(g=77*(f>>16&255)+151*(f>>8&255)+28*(255&f))&&(n=f,o=g),o<(v=77*(d>>16&255)+151*(d>>8&255)+28*(255&d))&&(n=d,o=v),x[b++]=n;O._setPixels(y,x)},O.erode=function(e){for(var t,r,i,n,o,a,s,l,u,h,c,f,d,p,m,g,v,y=O._toPixels(e),b=0,_=y.length?y.length/4:0,x=new Int32Array(_);b<_;)for(r=(t=b)+e.width;b>16&255)+151*(c>>8&255)+28*(255&c))<(o=77*(i>>16&255)+151*(i>>8&255)+28*(255&i))&&(n=c,o=m),(p=77*((h=O._getARGB(y,a))>>16&255)+151*(h>>8&255)+28*(255&h))>16&255)+151*(f>>8&255)+28*(255&f))>16&255)+151*(d>>8&255)+28*(255&d))=r){var i=Math.floor(t.timeDisplayed/r);if(t.timeDisplayed=0,t.displayIndex+=i,t.loopCount=Math.floor(t.displayIndex/t.numFrames),null!==t.loopLimit&&t.loopCount>=t.loopLimit)t.playing=!1;else{var n=t.displayIndex%t.numFrames;this.drawingContext.putImageData(t.frames[n].image,0,0),t.displayIndex=n,this.setModified(!0)}}}},n.default.Image.prototype._setProperty=function(e,t){this[e]=t,this.setModified(!0)},n.default.Image.prototype.loadPixels=function(){n.default.Renderer2D.prototype.loadPixels.call(this),this.setModified(!0)},n.default.Image.prototype.updatePixels=function(e,t,r,i){n.default.Renderer2D.prototype.updatePixels.call(this,e,t,r,i),this.setModified(!0)},n.default.Image.prototype.get=function(e,t,r,i){return n.default._validateParameters("p5.Image.get",arguments),n.default.Renderer2D.prototype.get.apply(this,arguments)},n.default.Image.prototype._getPixel=n.default.Renderer2D.prototype._getPixel,n.default.Image.prototype.set=function(e,t,r){n.default.Renderer2D.prototype.set.call(this,e,t,r),this.setModified(!0)},n.default.Image.prototype.resize=function(e,t){0===e&&0===t?(e=this.canvas.width,t=this.canvas.height):0===e?e=this.canvas.width*t/this.canvas.height:0===t&&(t=this.canvas.height*e/this.canvas.width),e=Math.floor(e),t=Math.floor(t);var r=document.createElement("canvas");if(r.width=e,r.height=t,this.gifProperties)for(var i=this.gifProperties,n=function(e,t){for(var r=0,i=0;i/g,">").replace(/"/g,""").replace(/'/g,"'")}function l(e,t){t&&!0!==t&&"true"!==t||(t="");var r="";return(e=e||"untitled")&&e.includes(".")&&(r=e.split(".").pop()),t&&r!==t&&(r=t,e="".concat(e,".").concat(r)),[e,r]}e("../core/error_helpers"),v.default.prototype.loadJSON=function(){for(var e=arguments.length,t=new Array(e),r=0;r"),n.print("");if(n.print(' '),n.print(""),n.print(""),n.print(" "),"0"!==o[0]){n.print(" ");for(var h=0;h".concat(c)),n.print(" ")}n.print(" ")}for(var f=0;f");for(var d=0;d".concat(p)),n.print(" ")}n.print(" ")}n.print("
"),n.print(""),n.print("")}n.close(),n.clear()},v.default.prototype.writeFile=function(e,t,r){var i="application/octet-stream";v.default.prototype._isSafari()&&(i="text/plain");var n=new Blob(e,{type:i});v.default.prototype.downloadFile(n,t,r)},v.default.prototype.downloadFile=function(e,t,r){var i=l(t,r),n=i[0];if(e instanceof Blob)s.default.saveAs(e,n);else{var o=document.createElement("a");if(o.href=e,o.download=n,o.onclick=function(e){var t;t=e,document.body.removeChild(t.target),e.stopPropagation()},o.style.display="none",document.body.appendChild(o),v.default.prototype._isSafari()){var a="Hello, Safari user! To download this file...\n";a+="1. Go to File --\x3e Save As.\n",a+='2. Choose "Page Source" as the Format.\n',a+='3. Name it with this extension: ."'.concat(i[1],'"'),alert(a)}o.click()}},v.default.prototype._checkFileExtension=l,v.default.prototype._isSafari=function(){return 0>>0},getSeed:function(){return t},rand:function(){return(r=(1664525*r+1013904223)%i)/i}});n.setSeed(e),_=new Array(4096);for(var o=0;o<4096;o++)_[o]=n.rand()};var o=n.default;r.default=o},{"../core/main":49}],82:[function(e,t,r){"use strict";function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i,l=(i=e("../core/main"))&&i.__esModule?i:{default:i},o=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==a(e)&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var o=i?Object.getOwnPropertyDescriptor(e,n):null;o&&(o.get||o.set)?Object.defineProperty(r,n,o):r[n]=e[n]}r.default=e,t&&t.set(e,r);return r}(e("../core/constants"));function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}l.default.Vector=function(e,t,r){var i,n,o;o=e instanceof l.default?(this.p5=e,i=t[0]||0,n=t[1]||0,t[2]||0):(i=e||0,n=t||0,r||0),this.x=i,this.y=n,this.z=o},l.default.Vector.prototype.toString=function(){return"p5.Vector Object : [".concat(this.x,", ").concat(this.y,", ").concat(this.z,"]")},l.default.Vector.prototype.set=function(e,t,r){return e instanceof l.default.Vector?(this.x=e.x||0,this.y=e.y||0,this.z=e.z||0):e instanceof Array?(this.x=e[0]||0,this.y=e[1]||0,this.z=e[2]||0):(this.x=e||0,this.y=t||0,this.z=r||0),this},l.default.Vector.prototype.copy=function(){return this.p5?new l.default.Vector(this.p5,[this.x,this.y,this.z]):new l.default.Vector(this.x,this.y,this.z)},l.default.Vector.prototype.add=function(e,t,r){return e instanceof l.default.Vector?(this.x+=e.x||0,this.y+=e.y||0,this.z+=e.z||0):e instanceof Array?(this.x+=e[0]||0,this.y+=e[1]||0,this.z+=e[2]||0):(this.x+=e||0,this.y+=t||0,this.z+=r||0),this};function u(e,t){return 0!==e&&(this.x=this.x%e),0!==t&&(this.y=this.y%t),this}function h(e,t,r){return 0!==e&&(this.x=this.x%e),0!==t&&(this.y=this.y%t),0!==r&&(this.z=this.z%r),this}l.default.Vector.prototype.rem=function(e,t,r){if(e instanceof l.default.Vector){if(Number.isFinite(e.x)&&Number.isFinite(e.y)&&Number.isFinite(e.z)){var i=parseFloat(e.x),n=parseFloat(e.y),o=parseFloat(e.z);h.call(this,i,n,o)}}else if(e instanceof Array)e.every(function(e){return Number.isFinite(e)})&&(2===e.length&&u.call(this,e[0],e[1]),3===e.length&&h.call(this,e[0],e[1],e[2]));else if(1===arguments.length){if(Number.isFinite(e)&&0!==e)return this.x=this.x%e,this.y=this.y%e,this.z=this.z%e,this}else if(2===arguments.length){var a=Array.prototype.slice.call(arguments);a.every(function(e){return Number.isFinite(e)})&&2===a.length&&u.call(this,a[0],a[1])}else if(3===arguments.length){var s=Array.prototype.slice.call(arguments);s.every(function(e){return Number.isFinite(e)})&&3===s.length&&h.call(this,s[0],s[1],s[2])}},l.default.Vector.prototype.sub=function(e,t,r){return e instanceof l.default.Vector?(this.x-=e.x||0,this.y-=e.y||0,this.z-=e.z||0):e instanceof Array?(this.x-=e[0]||0,this.y-=e[1]||0,this.z-=e[2]||0):(this.x-=e||0,this.y-=t||0,this.z-=r||0),this},l.default.Vector.prototype.mult=function(e){return"number"==typeof e&&isFinite(e)?(this.x*=e,this.y*=e,this.z*=e):console.warn("p5.Vector.prototype.mult:","n is undefined or not a finite number"),this},l.default.Vector.prototype.div=function(e){return"number"==typeof e&&isFinite(e)?0===e?console.warn("p5.Vector.prototype.div:","divide by 0"):(this.x/=e,this.y/=e,this.z/=e):console.warn("p5.Vector.prototype.div:","n is undefined or not a finite number"),this},l.default.Vector.prototype.mag=function(){return Math.sqrt(this.magSq())},l.default.Vector.prototype.magSq=function(){var e=this.x,t=this.y,r=this.z;return e*e+t*t+r*r},l.default.Vector.prototype.dot=function(e,t,r){return e instanceof l.default.Vector?this.dot(e.x,e.y,e.z):this.x*(e||0)+this.y*(t||0)+this.z*(r||0)},l.default.Vector.prototype.cross=function(e){var t=this.y*e.z-this.z*e.y,r=this.z*e.x-this.x*e.z,i=this.x*e.y-this.y*e.x;return this.p5?new l.default.Vector(this.p5,[t,r,i]):new l.default.Vector(t,r,i)},l.default.Vector.prototype.dist=function(e){return e.copy().sub(this).mag()},l.default.Vector.prototype.normalize=function(){var e=this.mag();return 0!==e&&this.mult(1/e),this},l.default.Vector.prototype.limit=function(e){var t=this.magSq();return e*e>>0},n.default.prototype.randomSeed=function(e){this._lcgSetSeed(o,e),this._gaussian_previous=!1},n.default.prototype.random=function(e,t){var r;if(n.default._validateParameters("random",arguments),r=null!=this[o]?this._lcg(o):Math.random(),void 0===e)return r;if(void 0===t)return e instanceof Array?e[Math.floor(r*e.length)]:r*e;if(tf){var P=p,L=l,k=u;p=d+f*(s&&d=t&&(r=r.substring(r.length-t,r.length)),r}},n.default.prototype.unhex=function(e){return e instanceof Array?e.map(n.default.prototype.unhex):parseInt("0x".concat(e),16)};var o=n.default;r.default=o},{"../core/main":49}],90:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i,a=(i=e("../core/main"))&&i.__esModule?i:{default:i};function n(e,t,r){var i=e<0,n=i?e.toString().substring(1):e.toString(),o=n.indexOf("."),a=-1!==o?n.substring(0,o):n,s=-1!==o?n.substring(o+1):"",l=i?"-":"";if(void 0!==r){var u="";(-1!==o||0r&&(s=s.substring(0,r));for(var h=0;hi.length)for(var o=t-(i+=-1===r?".":"").length+1,a=0;a=d.TWO_PI?"".concat("ellipse","|").concat(u,"|"):"".concat("arc","|").concat(a,"|").concat(s,"|").concat(l,"|").concat(u,"|"),!this.geometryInHash(t)){var h=new T.default.Geometry(u,1,function(){if(this.strokeIndices=[],a.toFixed(10)!==s.toFixed(10)){l!==d.PIE&&void 0!==l||(this.vertices.push(new T.default.Vector(.5,.5,0)),this.uvs.push([.5,.5]));for(var e=0;e<=u;e++){var t=(s-a)*(e/u)+a,r=.5+Math.cos(t)/2,i=.5+Math.sin(t)/2;this.vertices.push(new T.default.Vector(r,i,0)),this.uvs.push([r,i]),e>5&31)/31,(y>>10&31)/31):(r=a,i=s,l)}for(var b=1;b<=3;b++){var _=p+12*b,x=new S.default.Vector(u.getFloat32(_,!0),u.getFloat32(8+_,!0),u.getFloat32(4+_,!0));e.vertices.push(x),c&&o.push(r,i,n)}var w=new S.default.Vector(m,g,v);e.vertexNormals.push(w,w,w),e.faces.push([3*d,3*d+1,3*d+2]),e.uvs.push([0,0],[0,0],[0,0])}}(e,t);else{var r=new DataView(t);if(!("TextDecoder"in window))return console.warn("Sorry, ASCII STL loading only works in browsers that support TextDecoder (https://caniuse.com/#feat=textencoder)");var i=new TextDecoder("utf-8").decode(r).split("\n");!function(e,t){for(var r,i,n="",o=[],a=0;aMath.PI?l=Math.PI:l<=0&&(l=.001);var u=Math.sin(l)*a*Math.sin(s),h=Math.cos(l)*a,c=Math.sin(l)*a*Math.cos(s);this.camera(u+this.centerX,h+this.centerY,c+this.centerZ,this.centerX,this.centerY,this.centerZ,0,1,0)},m.default.Camera.prototype._isActive=function(){return this===this._renderer._curCamera},m.default.prototype.setCamera=function(e){this._renderer._curCamera=e,this._renderer.uPMatrix.set(e.projMatrix.mat4[0],e.projMatrix.mat4[1],e.projMatrix.mat4[2],e.projMatrix.mat4[3],e.projMatrix.mat4[4],e.projMatrix.mat4[5],e.projMatrix.mat4[6],e.projMatrix.mat4[7],e.projMatrix.mat4[8],e.projMatrix.mat4[9],e.projMatrix.mat4[10],e.projMatrix.mat4[11],e.projMatrix.mat4[12],e.projMatrix.mat4[13],e.projMatrix.mat4[14],e.projMatrix.mat4[15])};var n=m.default.Camera;r.default=n},{"../core/main":49}],98:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i,h=(i=e("../core/main"))&&i.__esModule?i:{default:i};h.default.Geometry=function(e,t,r){return this.vertices=[],this.lineVertices=[],this.lineNormals=[],this.vertexNormals=[],this.faces=[],this.uvs=[],this.edges=[],this.vertexColors=[],this.detailX=void 0!==e?e:1,this.detailY=void 0!==t?t:1,this.dirtyFlags={},r instanceof Function&&r.call(this),this},h.default.Geometry.prototype.reset=function(){this.lineVertices.length=0,this.lineNormals.length=0,this.vertices.length=0,this.edges.length=0,this.vertexColors.length=0,this.vertexNormals.length=0,this.uvs.length=0,this.dirtyFlags={}},h.default.Geometry.prototype.computeFaces=function(){this.faces.length=0;for(var e,t,r,i,n=this.detailX+1,o=0;othis.vertices.length-1-this.detailX;i--)e.add(this.vertexNormals[i]);e=h.default.Vector.div(e,this.detailX);for(var n=this.vertices.length-1;n>this.vertices.length-1-this.detailX;n--)this.vertexNormals[n]=e;return this},h.default.Geometry.prototype._makeTriangleEdges=function(){if(this.edges.length=0,Array.isArray(this.strokeIndices))for(var e=0,t=this.strokeIndices.length;e vTexCoord.y;\n bool y1 = p1.y > vTexCoord.y;\n bool y2 = p2.y > vTexCoord.y;\n\n // could web be under the curve (after t1)?\n if (y1 ? !y2 : y0) {\n // add the coverage for t1\n coverage.x += saturate(C1.x + 0.5);\n // calculate the anti-aliasing for t1\n weight.x = min(weight.x, abs(C1.x));\n }\n\n // are we outside the curve (after t2)?\n if (y1 ? !y0 : y2) {\n // subtract the coverage for t2\n coverage.x -= saturate(C2.x + 0.5);\n // calculate the anti-aliasing for t2\n weight.x = min(weight.x, abs(C2.x));\n }\n}\n\n// this is essentially the same as coverageX, but with the axes swapped\nvoid coverageY(vec2 p0, vec2 p1, vec2 p2) {\n\n vec2 C1, C2;\n calulateCrossings(p0, p1, p2, C1, C2);\n\n bool x0 = p0.x > vTexCoord.x;\n bool x1 = p1.x > vTexCoord.x;\n bool x2 = p2.x > vTexCoord.x;\n\n if (x1 ? !x2 : x0) {\n coverage.y -= saturate(C1.y + 0.5);\n weight.y = min(weight.y, abs(C1.y));\n }\n\n if (x1 ? !x0 : x2) {\n coverage.y += saturate(C2.y + 0.5);\n weight.y = min(weight.y, abs(C2.y));\n }\n}\n\nvoid main() {\n\n // calculate the pixel scale based on screen-coordinates\n pixelScale = hardness / fwidth(vTexCoord);\n\n // which grid cell is this pixel in?\n ivec2 gridCoord = ifloor(vTexCoord * vec2(uGridSize));\n\n // intersect curves in this row\n {\n // the index into the row info bitmap\n int rowIndex = gridCoord.y + uGridOffset.y;\n // fetch the info texel\n vec4 rowInfo = getTexel(uSamplerRows, rowIndex, uGridImageSize);\n // unpack the rowInfo\n int rowStrokeIndex = getInt16(rowInfo.xy);\n int rowStrokeCount = getInt16(rowInfo.zw);\n\n for (int iRowStroke = INT(0); iRowStroke < N; iRowStroke++) {\n if (iRowStroke >= rowStrokeCount)\n break;\n\n // each stroke is made up of 3 points: the start and control point\n // and the start of the next curve.\n // fetch the indices of this pair of strokes:\n vec4 strokeIndices = getTexel(uSamplerRowStrokes, rowStrokeIndex++, uCellsImageSize);\n\n // unpack the stroke index\n int strokePos = getInt16(strokeIndices.xy);\n\n // fetch the two strokes\n vec4 stroke0 = getTexel(uSamplerStrokes, strokePos + INT(0), uStrokeImageSize);\n vec4 stroke1 = getTexel(uSamplerStrokes, strokePos + INT(1), uStrokeImageSize);\n\n // calculate the coverage\n coverageX(stroke0.xy, stroke0.zw, stroke1.xy);\n }\n }\n\n // intersect curves in this column\n {\n int colIndex = gridCoord.x + uGridOffset.x;\n vec4 colInfo = getTexel(uSamplerCols, colIndex, uGridImageSize);\n int colStrokeIndex = getInt16(colInfo.xy);\n int colStrokeCount = getInt16(colInfo.zw);\n \n for (int iColStroke = INT(0); iColStroke < N; iColStroke++) {\n if (iColStroke >= colStrokeCount)\n break;\n\n vec4 strokeIndices = getTexel(uSamplerColStrokes, colStrokeIndex++, uCellsImageSize);\n\n int strokePos = getInt16(strokeIndices.xy);\n vec4 stroke0 = getTexel(uSamplerStrokes, strokePos + INT(0), uStrokeImageSize);\n vec4 stroke1 = getTexel(uSamplerStrokes, strokePos + INT(1), uStrokeImageSize);\n coverageY(stroke0.xy, stroke0.zw, stroke1.xy);\n }\n }\n\n weight = saturate(1.0 - weight * 2.0);\n float distance = max(weight.x + weight.y, minDistance); // manhattan approx.\n float antialias = abs(dot(coverage, weight) / distance);\n float cover = min(abs(coverage.x), abs(coverage.y));\n gl_FragColor = uMaterialColor;\n gl_FragColor.a *= saturate(max(antialias, cover));\n}",lineVert:"/*\n Part of the Processing project - http://processing.org\n Copyright (c) 2012-15 The Processing Foundation\n Copyright (c) 2004-12 Ben Fry and Casey Reas\n Copyright (c) 2001-04 Massachusetts Institute of Technology\n This library is free software; you can redistribute it and/or\n modify it under the terms of the GNU Lesser General Public\n License as published by the Free Software Foundation, version 2.1.\n This library is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n Lesser General Public License for more details.\n You should have received a copy of the GNU Lesser General\n Public License along with this library; if not, write to the\n Free Software Foundation, Inc., 59 Temple Place, Suite 330,\n Boston, MA 02111-1307 USA\n*/\n\n#define PROCESSING_LINE_SHADER\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform float uStrokeWeight;\n\nuniform vec4 uViewport;\nuniform int uPerspective;\n\nattribute vec4 aPosition;\nattribute vec4 aDirection;\n \nvoid main() {\n // using a scale <1 moves the lines towards the camera\n // in order to prevent popping effects due to half of\n // the line disappearing behind the geometry faces.\n vec3 scale = vec3(0.9995);\n\n vec4 posp = uModelViewMatrix * aPosition;\n vec4 posq = uModelViewMatrix * (aPosition + vec4(aDirection.xyz, 0));\n\n // Moving vertices slightly toward the camera\n // to avoid depth-fighting with the fill triangles.\n // Discussed here:\n // http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Number=252848 \n posp.xyz = posp.xyz * scale;\n posq.xyz = posq.xyz * scale;\n\n vec4 p = uProjectionMatrix * posp;\n vec4 q = uProjectionMatrix * posq;\n\n // formula to convert from clip space (range -1..1) to screen space (range 0..[width or height])\n // screen_p = (p.xy/p.w + <1,1>) * 0.5 * uViewport.zw\n\n // prevent division by W by transforming the tangent formula (div by 0 causes\n // the line to disappear, see https://github.com/processing/processing/issues/5183)\n // t = screen_q - screen_p\n //\n // tangent is normalized and we don't care which aDirection it points to (+-)\n // t = +- normalize( screen_q - screen_p )\n // t = +- normalize( (q.xy/q.w+<1,1>)*0.5*uViewport.zw - (p.xy/p.w+<1,1>)*0.5*uViewport.zw )\n //\n // extract common factor, <1,1> - <1,1> cancels out\n // t = +- normalize( (q.xy/q.w - p.xy/p.w) * 0.5 * uViewport.zw )\n //\n // convert to common divisor\n // t = +- normalize( ((q.xy*p.w - p.xy*q.w) / (p.w*q.w)) * 0.5 * uViewport.zw )\n //\n // remove the common scalar divisor/factor, not needed due to normalize and +-\n // (keep uViewport - can't remove because it has different components for x and y\n // and corrects for aspect ratio, see https://github.com/processing/processing/issues/5181)\n // t = +- normalize( (q.xy*p.w - p.xy*q.w) * uViewport.zw )\n\n vec2 tangent = normalize((q.xy*p.w - p.xy*q.w) * uViewport.zw);\n\n // flip tangent to normal (it's already normalized)\n vec2 normal = vec2(-tangent.y, tangent.x);\n\n float thickness = aDirection.w * uStrokeWeight;\n vec2 offset = normal * thickness / 2.0;\n\n vec2 curPerspScale;\n\n if(uPerspective == 1) {\n // Perspective ---\n // convert from world to clip by multiplying with projection scaling factor\n // to get the right thickness (see https://github.com/processing/processing/issues/5182)\n // invert Y, projections in Processing invert Y\n curPerspScale = (uProjectionMatrix * vec4(1, -1, 0, 0)).xy;\n } else {\n // No Perspective ---\n // multiply by W (to cancel out division by W later in the pipeline) and\n // convert from screen to clip (derived from clip to screen above)\n curPerspScale = p.w / (0.5 * uViewport.zw);\n }\n\n gl_Position.xy = p.xy + offset.xy * curPerspScale;\n gl_Position.zw = p.zw;\n}\n",lineFrag:"precision mediump float;\nprecision mediump int;\n\nuniform vec4 uMaterialColor;\n\nvoid main() {\n gl_FragColor = uMaterialColor;\n}",pointVert:"attribute vec3 aPosition;\nuniform float uPointSize;\nvarying float vStrokeWeight;\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nvoid main() {\n\tvec4 positionVec4 = vec4(aPosition, 1.0);\n\tgl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n\tgl_PointSize = uPointSize;\n\tvStrokeWeight = uPointSize;\n}",pointFrag:"precision mediump float;\nprecision mediump int;\nuniform vec4 uMaterialColor;\nvarying float vStrokeWeight;\n\nvoid main(){\n\tfloat mask = 0.0;\n\n\t// make a circular mask using the gl_PointCoord (goes from 0 - 1 on a point)\n // might be able to get a nicer edge on big strokeweights with smoothstep but slightly less performant\n\n\tmask = step(0.98, length(gl_PointCoord * 2.0 - 1.0));\n\n\t// if strokeWeight is 1 or less lets just draw a square\n\t// this prevents weird artifacting from carving circles when our points are really small\n\t// if strokeWeight is larger than 1, we just use it as is\n\n\tmask = mix(0.0, mask, clamp(floor(vStrokeWeight - 0.5),0.0,1.0));\n\n\t// throw away the borders of the mask\n // otherwise we get weird alpha blending issues\n\n\tif(mask > 0.98){\n discard;\n \t}\n\n \tgl_FragColor = vec4(uMaterialColor.rgb * (1.0 - mask), uMaterialColor.a) ;\n}"};u.default.RendererGL=function(e,t,r,i){return u.default.Renderer.call(this,e,t,r),this._setAttributeDefaults(t),this._initContext(),this.isP3D=!0,this.GL=this.drawingContext,this._isErasing=!1,this._enableLighting=!1,this.ambientLightColors=[],this.specularColors=[1,1,1],this.directionalLightDirections=[],this.directionalLightDiffuseColors=[],this.directionalLightSpecularColors=[],this.pointLightPositions=[],this.pointLightDiffuseColors=[],this.pointLightSpecularColors=[],this.spotLightPositions=[],this.spotLightDirections=[],this.spotLightDiffuseColors=[],this.spotLightSpecularColors=[],this.spotLightAngle=[],this.spotLightConc=[],this.drawMode=o.FILL,this.curFillColor=this._cachedFillStyle=[1,1,1,1],this.curStrokeColor=this._cachedStrokeStyle=[0,0,0,1],this.curBlendMode=o.BLEND,this._cachedBlendMode=void 0,this.blendExt=this.GL.getExtension("EXT_blend_minmax"),this._isBlending=!1,this._useSpecularMaterial=!1,this._useEmissiveMaterial=!1,this._useNormalMaterial=!1,this._useShininess=1,this._tint=[255,255,255,255],this.constantAttenuation=1,this.linearAttenuation=0,this.quadraticAttenuation=0,this.uMVMatrix=new u.default.Matrix,this.uPMatrix=new u.default.Matrix,this.uNMatrix=new u.default.Matrix("mat3"),this._curCamera=new u.default.Camera(this),this._curCamera._computeCameraDefaultSettings(),this._curCamera._setDefaultCamera(),this._defaultLightShader=void 0,this._defaultImmediateModeShader=void 0,this._defaultNormalShader=void 0,this._defaultColorShader=void 0,this._defaultPointShader=void 0,this.userFillShader=void 0,this.userStrokeShader=void 0,this.userPointShader=void 0,this.retainedMode={geometry:{},buffers:{stroke:[new u.default.RenderBuffer(3,"lineVertices","lineVertexBuffer","aPosition",this,this._flatten),new u.default.RenderBuffer(4,"lineNormals","lineNormalBuffer","aDirection",this,this._flatten)],fill:[new u.default.RenderBuffer(3,"vertices","vertexBuffer","aPosition",this,this._vToNArray),new u.default.RenderBuffer(3,"vertexNormals","normalBuffer","aNormal",this,this._vToNArray),new u.default.RenderBuffer(4,"vertexColors","colorBuffer","aMaterialColor",this),new u.default.RenderBuffer(3,"vertexAmbients","ambientBuffer","aAmbientColor",this),new u.default.RenderBuffer(2,"uvs","uvBuffer","aTexCoord",this,this._flatten)],text:[new u.default.RenderBuffer(3,"vertices","vertexBuffer","aPosition",this,this._vToNArray),new u.default.RenderBuffer(2,"uvs","uvBuffer","aTexCoord",this,this._flatten)]}},this.immediateMode={geometry:new u.default.Geometry,shapeMode:o.TRIANGLE_FAN,_bezierVertex:[],_quadraticVertex:[],_curveVertex:[],buffers:{fill:[new u.default.RenderBuffer(3,"vertices","vertexBuffer","aPosition",this,this._vToNArray),new u.default.RenderBuffer(3,"vertexNormals","normalBuffer","aNormal",this,this._vToNArray),new u.default.RenderBuffer(4,"vertexColors","colorBuffer","aVertexColor",this),new u.default.RenderBuffer(3,"vertexAmbients","ambientBuffer","aAmbientColor",this),new u.default.RenderBuffer(2,"uvs","uvBuffer","aTexCoord",this,this._flatten)],stroke:[new u.default.RenderBuffer(3,"lineVertices","lineVertexBuffer","aPosition",this,this._flatten),new u.default.RenderBuffer(4,"lineNormals","lineNormalBuffer","aDirection",this,this._flatten)],point:this.GL.createBuffer()}},this.pointSize=5,this.curStrokeWeight=1,this.textures=[],this.textureMode=o.IMAGE,this.textureWrapX=o.CLAMP,this.textureWrapY=o.CLAMP,this._tex=null,this._curveTightness=6,this._lookUpTableBezier=[],this._lookUpTableQuadratic=[],this._lutBezierDetail=0,this._lutQuadraticDetail=0,this._tessy=this._initTessy(),this.fontInfos={},this._curShader=void 0,this},u.default.RendererGL.prototype=Object.create(u.default.Renderer.prototype),u.default.RendererGL.prototype._setAttributeDefaults=function(e){var t={alpha:!0,depth:!0,stencil:!0,antialias:navigator.userAgent.toLowerCase().includes("safari"),premultipliedAlpha:!1,preserveDrawingBuffer:!0,perPixelLighting:!0};null===e._glAttributes?e._glAttributes=t:e._glAttributes=Object.assign(t,e._glAttributes)},u.default.RendererGL.prototype._initContext=function(){try{if(this.drawingContext=this.canvas.getContext("webgl",this._pInst._glAttributes)||this.canvas.getContext("experimental-webgl",this._pInst._glAttributes),null===this.drawingContext)throw new Error("Error creating webgl context");var e=this.drawingContext;e.enable(e.DEPTH_TEST),e.depthFunc(e.LEQUAL),e.viewport(0,0,e.drawingBufferWidth,e.drawingBufferHeight),this._viewport=this.drawingContext.getParameter(this.drawingContext.VIEWPORT)}catch(e){throw e}},u.default.RendererGL.prototype._resetContext=function(e,t){var r=this.width,i=this.height,n=this.canvas.id,o=this._pInst instanceof u.default.Graphics;if(o){var a=this._pInst;a.canvas.parentNode.removeChild(a.canvas),a.canvas=document.createElement("canvas"),(a._pInst._userNode||document.body).appendChild(a.canvas),u.default.Element.call(a,a.canvas,a._pInst),a.width=r,a.height=i}else{var s=this.canvas;s&&s.parentNode.removeChild(s),(s=document.createElement("canvas")).id=n,this._pInst._userNode?this._pInst._userNode.appendChild(s):document.body.appendChild(s),this._pInst.canvas=s}var l=new u.default.RendererGL(this._pInst.canvas,this._pInst,!o);this._pInst._setProperty("_renderer",l),l.resize(r,i),l._applyDefaults(),o||this._pInst._elements.push(l),"function"==typeof t&&setTimeout(function(){t.apply(window._renderer,e)},0)},u.default.prototype.setAttributes=function(e,t){if(void 0!==this._glAttributes){var r=!0;if(void 0!==t?(null===this._glAttributes&&(this._glAttributes={}),this._glAttributes[e]!==t&&(this._glAttributes[e]=t,r=!1)):e instanceof Object&&this._glAttributes!==e&&(this._glAttributes=e,r=!1),this._renderer.isP3D&&!r){if(!this._setupDone)for(var i in this._renderer.retainedMode.geometry)if(this._renderer.retainedMode.geometry.hasOwnProperty(i))return void console.error("Sorry, Could not set the attributes, you need to call setAttributes() before calling the other drawing methods in setup()");this.push(),this._renderer._resetContext(),this.pop(),this._renderer._curCamera&&(this._renderer._curCamera._renderer=this._renderer)}}else console.log("You are trying to use setAttributes on a p5.Graphics object that does not use a WEBGL renderer.")},u.default.RendererGL.prototype._update=function(){this.uMVMatrix.set(this._curCamera.cameraMatrix.mat4[0],this._curCamera.cameraMatrix.mat4[1],this._curCamera.cameraMatrix.mat4[2],this._curCamera.cameraMatrix.mat4[3],this._curCamera.cameraMatrix.mat4[4],this._curCamera.cameraMatrix.mat4[5],this._curCamera.cameraMatrix.mat4[6],this._curCamera.cameraMatrix.mat4[7],this._curCamera.cameraMatrix.mat4[8],this._curCamera.cameraMatrix.mat4[9],this._curCamera.cameraMatrix.mat4[10],this._curCamera.cameraMatrix.mat4[11],this._curCamera.cameraMatrix.mat4[12],this._curCamera.cameraMatrix.mat4[13],this._curCamera.cameraMatrix.mat4[14],this._curCamera.cameraMatrix.mat4[15]),this.ambientLightColors.length=0,this.specularColors=[1,1,1],this.directionalLightDirections.length=0,this.directionalLightDiffuseColors.length=0,this.directionalLightSpecularColors.length=0,this.pointLightPositions.length=0,this.pointLightDiffuseColors.length=0,this.pointLightSpecularColors.length=0,this.spotLightPositions.length=0,this.spotLightDirections.length=0,this.spotLightDiffuseColors.length=0,this.spotLightSpecularColors.length=0,this.spotLightAngle.length=0,this.spotLightConc.length=0,this._enableLighting=!1,this._tint=[255,255,255,255],this.GL.clear(this.GL.DEPTH_BUFFER_BIT)},u.default.RendererGL.prototype.background=function(){var e,t=(e=this._pInst).color.apply(e,arguments),r=t.levels[0]/255,i=t.levels[1]/255,n=t.levels[2]/255,o=t.levels[3]/255;this.GL.clearColor(r,i,n,o),this.GL.clear(this.GL.COLOR_BUFFER_BIT)},u.default.RendererGL.prototype.fill=function(e,t,r,i){var n=u.default.prototype.color.apply(this._pInst,arguments);this.curFillColor=n._array,this.drawMode=o.FILL,this._useNormalMaterial=!1,this._tex=null},u.default.RendererGL.prototype.stroke=function(e,t,r,i){arguments[3]=255;var n=u.default.prototype.color.apply(this._pInst,arguments);this.curStrokeColor=n._array},u.default.RendererGL.prototype.strokeCap=function(e){console.error("Sorry, strokeCap() is not yet implemented in WEBGL mode")},u.default.RendererGL.prototype.strokeJoin=function(e){console.error("Sorry, strokeJoin() is not yet implemented in WEBGL mode")},u.default.RendererGL.prototype.filter=function(e){console.error("filter() does not work in WEBGL mode")},u.default.RendererGL.prototype.blendMode=function(e){e===o.DARKEST||e===o.LIGHTEST||e===o.ADD||e===o.BLEND||e===o.SUBTRACT||e===o.SCREEN||e===o.EXCLUSION||e===o.REPLACE||e===o.MULTIPLY||e===o.REMOVE?this.curBlendMode=e:e!==o.BURN&&e!==o.OVERLAY&&e!==o.HARD_LIGHT&&e!==o.SOFT_LIGHT&&e!==o.DODGE||console.warn("BURN, OVERLAY, HARD_LIGHT, SOFT_LIGHT, and DODGE only work for blendMode in 2D mode.")},u.default.RendererGL.prototype.erase=function(e,t){this._isErasing||(this._cachedBlendMode=this.curBlendMode,this.blendMode(o.REMOVE),this._cachedFillStyle=this.curFillColor.slice(),this.curFillColor=[1,1,1,e/255],this._cachedStrokeStyle=this.curStrokeColor.slice(),this.curStrokeColor=[1,1,1,t/255],this._isErasing=!0)},u.default.RendererGL.prototype.noErase=function(){this._isErasing&&(this.curFillColor=this._cachedFillStyle.slice(),this.curStrokeColor=this._cachedStrokeStyle.slice(),this.blendMode(this._cachedBlendMode),this._isErasing=!1)},u.default.RendererGL.prototype.strokeWeight=function(e){this.curStrokeWeight!==e&&(this.pointSize=e,this.curStrokeWeight=e)},u.default.RendererGL.prototype._getPixel=function(e,t){var r;return r=new Uint8Array(4),this.drawingContext.readPixels(e,t,1,1,this.drawingContext.RGBA,this.drawingContext.UNSIGNED_BYTE,r),[r[0],r[1],r[2],r[3]]},u.default.RendererGL.prototype.loadPixels=function(){var e=this._pixelsState;if(!0===this._pInst._glAttributes.preserveDrawingBuffer){var t=e.pixels,r=this.GL.drawingBufferWidth*this.GL.drawingBufferHeight*4;t instanceof Uint8Array&&t.length===r||(t=new Uint8Array(r),this._pixelsState._setProperty("pixels",t));var i=this._pInst._pixelDensity;this.GL.readPixels(0,0,this.width*i,this.height*i,this.GL.RGBA,this.GL.UNSIGNED_BYTE,t)}else console.log("loadPixels only works in WebGL when preserveDrawingBuffer is true.")},u.default.RendererGL.prototype.geometryInHash=function(e){return void 0!==this.retainedMode.geometry[e]},u.default.RendererGL.prototype.resize=function(e,t){u.default.Renderer.prototype.resize.call(this,e,t),this.GL.viewport(0,0,this.GL.drawingBufferWidth,this.GL.drawingBufferHeight),this._viewport=this.GL.getParameter(this.GL.VIEWPORT),this._curCamera._resize();var r=this._pixelsState;void 0!==r.pixels&&r._setProperty("pixels",new Uint8Array(this.GL.drawingBufferWidth*this.GL.drawingBufferHeight*4))},u.default.RendererGL.prototype.clear=function(){var e=(arguments.length<=0?void 0:arguments[0])||0,t=(arguments.length<=1?void 0:arguments[1])||0,r=(arguments.length<=2?void 0:arguments[2])||0,i=(arguments.length<=3?void 0:arguments[3])||0;this.GL.clearColor(e,t,r,i),this.GL.clear(this.GL.COLOR_BUFFER_BIT|this.GL.DEPTH_BUFFER_BIT)},u.default.RendererGL.prototype.applyMatrix=function(e,t,r,i,n,o){16===arguments.length?u.default.Matrix.prototype.apply.apply(this.uMVMatrix,arguments):this.uMVMatrix.apply([e,t,0,0,r,i,0,0,0,0,1,0,n,o,0,1])},u.default.RendererGL.prototype.translate=function(e,t,r){return e instanceof u.default.Vector&&(r=e.z,t=e.y,e=e.x),this.uMVMatrix.translate([e,t,r]),this},u.default.RendererGL.prototype.scale=function(e,t,r){return this.uMVMatrix.scale(e,t,r),this},u.default.RendererGL.prototype.rotate=function(e,t){return void 0===t?this.rotateZ(e):(u.default.Matrix.prototype.rotate.apply(this.uMVMatrix,arguments),this)},u.default.RendererGL.prototype.rotateX=function(e){return this.rotate(e,1,0,0),this},u.default.RendererGL.prototype.rotateY=function(e){return this.rotate(e,0,1,0),this},u.default.RendererGL.prototype.rotateZ=function(e){return this.rotate(e,0,0,1),this},u.default.RendererGL.prototype.push=function(){var e=u.default.Renderer.prototype.push.apply(this),t=e.properties;return t.uMVMatrix=this.uMVMatrix.copy(),t.uPMatrix=this.uPMatrix.copy(),t._curCamera=this._curCamera,this._curCamera=this._curCamera.copy(),t.ambientLightColors=this.ambientLightColors.slice(),t.specularColors=this.specularColors.slice(),t.directionalLightDirections=this.directionalLightDirections.slice(),t.directionalLightDiffuseColors=this.directionalLightDiffuseColors.slice(),t.directionalLightSpecularColors=this.directionalLightSpecularColors.slice(),t.pointLightPositions=this.pointLightPositions.slice(),t.pointLightDiffuseColors=this.pointLightDiffuseColors.slice(),t.pointLightSpecularColors=this.pointLightSpecularColors.slice(),t.spotLightPositions=this.spotLightPositions.slice(),t.spotLightDirections=this.spotLightDirections.slice(),t.spotLightDiffuseColors=this.spotLightDiffuseColors.slice(),t.spotLightSpecularColors=this.spotLightSpecularColors.slice(),t.spotLightAngle=this.spotLightAngle.slice(),t.spotLightConc=this.spotLightConc.slice(),t.userFillShader=this.userFillShader,t.userStrokeShader=this.userStrokeShader,t.userPointShader=this.userPointShader,t.pointSize=this.pointSize,t.curStrokeWeight=this.curStrokeWeight,t.curStrokeColor=this.curStrokeColor,t.curFillColor=this.curFillColor,t._useSpecularMaterial=this._useSpecularMaterial,t._useEmissiveMaterial=this._useEmissiveMaterial,t._useShininess=this._useShininess,t.constantAttenuation=this.constantAttenuation,t.linearAttenuation=this.linearAttenuation,t.quadraticAttenuation=this.quadraticAttenuation,t._enableLighting=this._enableLighting,t._useNormalMaterial=this._useNormalMaterial,t._tex=this._tex,t.drawMode=this.drawMode,e},u.default.RendererGL.prototype.resetMatrix=function(){return this.uMVMatrix=u.default.Matrix.identity(this._pInst),this},u.default.RendererGL.prototype._getImmediateStrokeShader=function(){var e=this.userStrokeShader;return e&&e.isStrokeShader()?e:this._getLineShader()},u.default.RendererGL.prototype._getRetainedStrokeShader=u.default.RendererGL.prototype._getImmediateStrokeShader,u.default.RendererGL.prototype._getImmediateFillShader=function(){var e=this.userFillShader;if(this._useNormalMaterial&&(!e||!e.isNormalShader()))return this._getNormalShader();if(this._enableLighting){if(!e||!e.isLightShader())return this._getLightShader()}else if(this._tex){if(!e||!e.isTextureShader())return this._getLightShader()}else if(!e)return this._getImmediateModeShader();return e},u.default.RendererGL.prototype._getRetainedFillShader=function(){if(this._useNormalMaterial)return this._getNormalShader();var e=this.userFillShader;if(this._enableLighting){if(!e||!e.isLightShader())return this._getLightShader()}else if(this._tex){if(!e||!e.isTextureShader())return this._getLightShader()}else if(!e)return this._getColorShader();return e},u.default.RendererGL.prototype._getImmediatePointShader=function(){var e=this.userPointShader;return e&&e.isPointShader()?e:this._getPointShader()},u.default.RendererGL.prototype._getRetainedLineShader=u.default.RendererGL.prototype._getImmediateLineShader,u.default.RendererGL.prototype._getLightShader=function(){return this._defaultLightShader||(this._pInst._glAttributes.perPixelLighting?this._defaultLightShader=new u.default.Shader(this,c.phongVert,c.phongFrag):this._defaultLightShader=new u.default.Shader(this,c.lightVert,c.lightTextureFrag)),this._defaultLightShader},u.default.RendererGL.prototype._getImmediateModeShader=function(){return this._defaultImmediateModeShader||(this._defaultImmediateModeShader=new u.default.Shader(this,c.immediateVert,c.vertexColorFrag)),this._defaultImmediateModeShader},u.default.RendererGL.prototype._getNormalShader=function(){return this._defaultNormalShader||(this._defaultNormalShader=new u.default.Shader(this,c.normalVert,c.normalFrag)),this._defaultNormalShader},u.default.RendererGL.prototype._getColorShader=function(){return this._defaultColorShader||(this._defaultColorShader=new u.default.Shader(this,c.normalVert,c.basicFrag)),this._defaultColorShader},u.default.RendererGL.prototype._getPointShader=function(){return this._defaultPointShader||(this._defaultPointShader=new u.default.Shader(this,c.pointVert,c.pointFrag)),this._defaultPointShader},u.default.RendererGL.prototype._getLineShader=function(){return this._defaultLineShader||(this._defaultLineShader=new u.default.Shader(this,c.lineVert,c.lineFrag)),this._defaultLineShader},u.default.RendererGL.prototype._getFontShader=function(){return this._defaultFontShader||(this.GL.getExtension("OES_standard_derivatives"),this._defaultFontShader=new u.default.Shader(this,c.fontVert,c.fontFrag)),this._defaultFontShader},u.default.RendererGL.prototype._getEmptyTexture=function(){if(!this._emptyTexture){var e=new u.default.Image(1,1);e.set(0,0,255),this._emptyTexture=new u.default.Texture(this,e)}return this._emptyTexture},u.default.RendererGL.prototype.getTexture=function(e){var t=this.textures,r=!0,i=!1,n=void 0;try{for(var o,a=t[Symbol.iterator]();!(r=(o=a.next()).done);r=!0){var s=o.value;if(s.src===e)return s}}catch(e){i=!0,n=e}finally{try{r||null==a.return||a.return()}finally{if(i)throw n}}var l=new u.default.Texture(this,e);return t.push(l),l},u.default.RendererGL.prototype._setStrokeUniforms=function(e){e.bindShader(),e.setUniform("uMaterialColor",this.curStrokeColor),e.setUniform("uStrokeWeight",this.curStrokeWeight)},u.default.RendererGL.prototype._setFillUniforms=function(e){e.bindShader(),e.setUniform("uMaterialColor",this.curFillColor),e.setUniform("isTexture",!!this._tex),this._tex&&e.setUniform("uSampler",this._tex),e.setUniform("uTint",this._tint),e.setUniform("uSpecular",this._useSpecularMaterial),e.setUniform("uEmissive",this._useEmissiveMaterial),e.setUniform("uShininess",this._useShininess),e.setUniform("uUseLighting",this._enableLighting);var t=this.pointLightDiffuseColors.length/3;e.setUniform("uPointLightCount",t),e.setUniform("uPointLightLocation",this.pointLightPositions),e.setUniform("uPointLightDiffuseColors",this.pointLightDiffuseColors),e.setUniform("uPointLightSpecularColors",this.pointLightSpecularColors);var r=this.directionalLightDiffuseColors.length/3;e.setUniform("uDirectionalLightCount",r),e.setUniform("uLightingDirection",this.directionalLightDirections),e.setUniform("uDirectionalDiffuseColors",this.directionalLightDiffuseColors),e.setUniform("uDirectionalSpecularColors",this.directionalLightSpecularColors);var i=this.ambientLightColors.length/3;e.setUniform("uAmbientLightCount",i),e.setUniform("uAmbientColor",this.ambientLightColors);var n=this.spotLightDiffuseColors.length/3;e.setUniform("uSpotLightCount",n),e.setUniform("uSpotLightAngle",this.spotLightAngle),e.setUniform("uSpotLightConc",this.spotLightConc),e.setUniform("uSpotLightDiffuseColors",this.spotLightDiffuseColors),e.setUniform("uSpotLightSpecularColors",this.spotLightSpecularColors),e.setUniform("uSpotLightLocation",this.spotLightPositions),e.setUniform("uSpotLightDirection",this.spotLightDirections),e.setUniform("uConstantAttenuation",this.constantAttenuation),e.setUniform("uLinearAttenuation",this.linearAttenuation),e.setUniform("uQuadraticAttenuation",this.quadraticAttenuation),e.bindTextures()},u.default.RendererGL.prototype._setPointUniforms=function(e){e.bindShader(),e.setUniform("uMaterialColor",this.curStrokeColor),e.setUniform("uPointSize",this.pointSize)},u.default.RendererGL.prototype._bindBuffer=function(e,t,r,i,n){if(t=t||this.GL.ARRAY_BUFFER,this.GL.bindBuffer(t,e),void 0!==r){var o=new(i||Float32Array)(r);this.GL.bufferData(t,o,n||this.GL.STATIC_DRAW)}},u.default.RendererGL.prototype._arraysEqual=function(e,t){var r=e.length;if(r!==t.length)return!1;for(var i=0;i>7,127&f,c>>7,127&c);for(var d=0;d>7,127&p,0,0)}}return{cellImageInfo:l,dimOffset:o,dimImageInfo:n}}return(t=this.glyphInfos[e.index]={glyph:e,uGlyphRect:[i.x1,-i.y1,i.x2,-i.y2],strokeImageInfo:U,strokes:d,colInfo:G(m,this.colDimImageInfos,this.colCellImageInfos),rowInfo:G(p,this.rowDimImageInfos,this.rowCellImageInfos)}).uGridOffset=[t.colInfo.dimOffset,t.rowInfo.dimOffset],t}}var z=Math.sqrt(3);j.default.RendererGL.prototype._renderText=function(e,t,r,i,n){if(this._textFont&&"string"!=typeof this._textFont){if(!(n<=i)&&this._doFill){if(!this._isOpenType())return console.log("WEBGL: only Opentype (.otf) and Truetype (.ttf) fonts are supported"),e;e.push();var o=this._doStroke,a=this.drawMode;this._doStroke=!1,this.drawMode=D.TEXTURE;var s=this._textFont.font,l=this._textFont._fontInfo;l=l||(this._textFont._fontInfo=new A(s));var u=this._textFont._handleAlignment(this,t,r,i),h=this._textSize/s.unitsPerEm;this.translate(u.x,u.y,0),this.scale(h,h,1);var c=this.GL,f=!this._defaultFontShader,d=this._getFontShader();d.init(),d.bindShader(),f&&(d.setUniform("uGridImageSize",[64,64]),d.setUniform("uCellsImageSize",[64,64]),d.setUniform("uStrokeImageSize",[64,64]),d.setUniform("uGridSize",[9,9])),this._applyColorBlend(this.curFillColor);var p=this.retainedMode.geometry.glyph;if(!p){var m=this._textGeom=new j.default.Geometry(1,1,function(){for(var e=0;e<=1;e++)for(var t=0;t<=1;t++)this.vertices.push(new j.default.Vector(t,e,0)),this.uvs.push(t,e)});m.computeFaces().computeNormals(),p=this.createBuffers("glyph",m)}var g=!0,v=!1,y=void 0;try{for(var b,_=this.retainedMode.buffers.text[Symbol.iterator]();!(g=(b=_.next()).done);g=!0){b.value._prepareBuffer(p,d)}}catch(e){v=!0,y=e}finally{try{g||null==_.return||_.return()}finally{if(v)throw y}}this._bindBuffer(p.indexBuffer,c.ELEMENT_ARRAY_BUFFER),d.setUniform("uMaterialColor",this.curFillColor);try{var x=0,w=null,S=s.stringToGlyphs(t),M=!0,E=!1,T=void 0;try{for(var C,P=S[Symbol.iterator]();!(M=(C=P.next()).done);M=!0){var L=C.value;w&&(x+=s.getKerningValue(w,L));var k=l.getGlyphInfo(L);if(k.uGlyphRect){var R=k.rowInfo,O=k.colInfo;d.setUniform("uSamplerStrokes",k.strokeImageInfo.imageData),d.setUniform("uSamplerRowStrokes",R.cellImageInfo.imageData),d.setUniform("uSamplerRows",R.dimImageInfo.imageData),d.setUniform("uSamplerColStrokes",O.cellImageInfo.imageData),d.setUniform("uSamplerCols",O.dimImageInfo.imageData),d.setUniform("uGridOffset",k.uGridOffset),d.setUniform("uGlyphRect",k.uGlyphRect),d.setUniform("uGlyphOffset",x),d.bindTextures(),c.drawElements(c.TRIANGLES,6,this.GL.UNSIGNED_SHORT,0)}x+=L.advanceWidth,w=L}}catch(e){E=!0,T=e}finally{try{M||null==P.return||P.return()}finally{if(E)throw T}}}finally{d.unbindShader(),this._doStroke=o,this.drawMode=a,e.pop()}return e}}else console.log("WEBGL: you must load and set a font before drawing text. See `loadFont` and `textFont` for more details.")}},{"../core/constants":42,"../core/main":49,"./p5.RendererGL.Retained":102,"./p5.Shader":104}],107:[function(e,t,r){t.exports={fes:{autoplay:"The media that tried to play (with '{{src}}') wasn't allowed to by this browser, most likely due to the browser's autoplay policy. Check out {{link}} for more information about why.",fileLoadError:{bytes:"It looks like there was a problem loading your file. {{suggestion}}",font:"It looks like there was a problem loading your font. {{suggestion}}",gif:"There was some trouble loading your GIF. Make sure that your GIF is using 87a or 89a encoding.",image:"It looks like there was a problem loading your image. {{suggestion}}",json:"It looks like there was a problem loading your JSON file. {{suggestion}}",large:"If your large file isn't fetched successfully, we recommend splitting the file into smaller segments and fetching those.",strings:"It looks like there was a problem loading your text file. {{suggestion}}",suggestion:"Try checking if the file path ({{filePath}}) is correct, hosting the file online, or running a local server. (More info at {{link}})",table:"It looks like there was a problem loading your table file. {{suggestion}}",xml:"It looks like there was a problem loading your XML file. {{suggestion}}"},misusedTopLevel:"Did you just try to use p5.js's {{symbolName}} {{symbolType}}? If so, you may want to move it into your sketch's setup() function.\n\nFor more details, see: {{link}}",pre:"🌸 p5.js says: {{message}}",welcome:"Welcome! This is your friendly debugger. To turn me off, switch to using p5.min.js."}}},{}],108:[function(e,t,r){t.exports={fes:{autoplay:"Su browser impidío un medio tocar (de '{{src}}'), posiblemente porque las reglas de autoplay. Para aprender más, visite {{link}}.",fileLoadError:{bytes:"",font:"",gif:"",image:"",json:"",large:"",strings:"",suggestion:"",table:"",xml:""},misusedTopLevel:"",pre:"🌸 p5.js dice: {{message}}",welcome:""}}},{}],109:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i=o(e("./en/translation")),n=o(e("./es/translation"));function o(e){return e&&e.__esModule?e:{default:e}}var a={en:{translation:i.default},es:{translation:n.default}};r.default=a},{"./en/translation":107,"./es/translation":108}]},{},[37])(37)}); ================================================ FILE: docs/examples/pyodide/pong/target/target_sketch.js ================================================ const wrapperContent = ` class PythonFunctions: pass setattr(PythonFunctions, 'map', map) setattr(PythonFunctions, 'filter', filter) setattr(PythonFunctions, 'set', set) _P5_INSTANCE = None _CTX_MIDDLE = None _DEFAULT_FILL = None _DEFAULT_LEADMULT = None _DEFAULT_STROKE = None _DEFAULT_TEXT_FILL = None ADD = None ALT = None ARROW = None AUDIO = None AUTO = None AXES = None BACKSPACE = None BASELINE = None BEVEL = None BEZIER = None BLEND = None BLUR = None BOLD = None BOLDITALIC = None BOTTOM = None BURN = None CENTER = None CHORD = None CLAMP = None CLOSE = None CONTROL = None CORNER = None CORNERS = None CROSS = None CURVE = None DARKEST = None DEG_TO_RAD = None DEGREES = None DELETE = None DIFFERENCE = None DILATE = None DODGE = None DOWN_ARROW = None ENTER = None ERODE = None ESCAPE = None EXCLUSION = None FILL = None GRAY = None GRID = None HALF_PI = None HAND = None HARD_LIGHT = None HSB = None HSL = None IMAGE = None IMMEDIATE = None INVERT = None ITALIC = None LANDSCAPE = None LEFT = None LEFT_ARROW = None LIGHTEST = None LINE_LOOP = None LINE_STRIP = None LINEAR = None LINES = None MIRROR = None MITER = None MOVE = None MULTIPLY = None NEAREST = None NORMAL = None OPAQUE = None OPEN = None OPTION = None OVERLAY = None PI = None PIE = None POINTS = None PORTRAIT = None POSTERIZE = None PROJECT = None QUAD_STRIP = None QUADRATIC = None QUADS = None QUARTER_PI = None RAD_TO_DEG = None RADIANS = None RADIUS = None REPEAT = None REPLACE = None RETURN = None RGB = None RIGHT = None RIGHT_ARROW = None ROUND = None SCREEN = None SHIFT = None SOFT_LIGHT = None SQUARE = None STROKE = None SUBTRACT = None TAB = None TAU = None TEXT = None TEXTURE = None THRESHOLD = None TOP = None TRIANGLE_FAN = None TRIANGLE_STRIP = None TRIANGLES = None TWO_PI = None UP_ARROW = None VIDEO = None WAIT = None WEBGL = None P2D = None PI = None frameCount = None focused = None displayWidth = None displayHeight = None windowWidth = None windowHeight = None width = None height = None deviceOrientation = None accelerationX = None accelerationY = None accelerationZ = None pAccelerationX = None pAccelerationY = None pAccelerationZ = None rotationX = None rotationY = None rotationZ = None pRotationX = None pRotationY = None pRotationZ = None turnAxis = None keyIsPressed = None key = None keyCode = None mouseX = None mouseY = None pmouseX = None pmouseY = None winMouseX = None winMouseY = None pwinMouseX = None pwinMouseY = None mouseButton = None mouseIsPressed = None touches = None pixels = None def alpha(*args): return _P5_INSTANCE.alpha(*args) def blue(*args): return _P5_INSTANCE.blue(*args) def brightness(*args): return _P5_INSTANCE.brightness(*args) def color(*args): return _P5_INSTANCE.color(*args) def green(*args): return _P5_INSTANCE.green(*args) def hue(*args): return _P5_INSTANCE.hue(*args) def lerpColor(*args): return _P5_INSTANCE.lerpColor(*args) def lightness(*args): return _P5_INSTANCE.lightness(*args) def red(*args): return _P5_INSTANCE.red(*args) def saturation(*args): return _P5_INSTANCE.saturation(*args) def background(*args): return _P5_INSTANCE.background(*args) def clear(*args): p5_clear = _P5_INSTANCE.clear(*args) return p5_clear def erase(*args): return _P5_INSTANCE.erase(*args) def noErase(*args): return _P5_INSTANCE.noErase(*args) def colorMode(*args): return _P5_INSTANCE.colorMode(*args) def fill(*args): return _P5_INSTANCE.fill(*args) def noFill(*args): return _P5_INSTANCE.noFill(*args) def noStroke(*args): return _P5_INSTANCE.noStroke(*args) def stroke(*args): return _P5_INSTANCE.stroke(*args) def arc(*args): return _P5_INSTANCE.arc(*args) def ellipse(*args): return _P5_INSTANCE.ellipse(*args) def circle(*args): return _P5_INSTANCE.circle(*args) def line(*args): return _P5_INSTANCE.line(*args) def point(*args): return _P5_INSTANCE.point(*args) def quad(*args): return _P5_INSTANCE.quad(*args) def rect(*args): return _P5_INSTANCE.rect(*args) def square(*args): return _P5_INSTANCE.square(*args) def triangle(*args): return _P5_INSTANCE.triangle(*args) def plane(*args): return _P5_INSTANCE.plane(*args) def box(*args): return _P5_INSTANCE.box(*args) def sphere(*args): return _P5_INSTANCE.sphere(*args) def cylinder(*args): return _P5_INSTANCE.cylinder(*args) def cone(*args): return _P5_INSTANCE.cone(*args) def ellipsoid(*args): return _P5_INSTANCE.ellipsoid(*args) def torus(*args): return _P5_INSTANCE.torus(*args) def loadModel(*args): return _P5_INSTANCE.loadModel(*args) def model(*args): return _P5_INSTANCE.model(*args) def ellipseMode(*args): return _P5_INSTANCE.ellipseMode(*args) def noSmooth(*args): return _P5_INSTANCE.noSmooth(*args) def rectMode(*args): return _P5_INSTANCE.rectMode(*args) def smooth(*args): return _P5_INSTANCE.smooth(*args) def strokeCap(*args): return _P5_INSTANCE.strokeCap(*args) def strokeJoin(*args): return _P5_INSTANCE.strokeJoin(*args) def strokeWeight(*args): return _P5_INSTANCE.strokeWeight(*args) def bezier(*args): return _P5_INSTANCE.bezier(*args) def bezierDetail(*args): return _P5_INSTANCE.bezierDetail(*args) def bezierPoint(*args): return _P5_INSTANCE.bezierPoint(*args) def bezierTangent(*args): return _P5_INSTANCE.bezierTangent(*args) def curve(*args): return _P5_INSTANCE.curve(*args) def curveDetail(*args): return _P5_INSTANCE.curveDetail(*args) def curveTightness(*args): return _P5_INSTANCE.curveTightness(*args) def curvePoint(*args): return _P5_INSTANCE.curvePoint(*args) def curveTangent(*args): return _P5_INSTANCE.curveTangent(*args) def beginContour(*args): return _P5_INSTANCE.beginContour(*args) def beginShape(*args): return _P5_INSTANCE.beginShape(*args) def bezierVertex(*args): return _P5_INSTANCE.bezierVertex(*args) def curveVertex(*args): return _P5_INSTANCE.curveVertex(*args) def endContour(*args): return _P5_INSTANCE.endContour(*args) def endShape(*args): return _P5_INSTANCE.endShape(*args) def quadraticVertex(*args): return _P5_INSTANCE.quadraticVertex(*args) def vertex(*args): return _P5_INSTANCE.vertex(*args) def cursor(*args): return _P5_INSTANCE.cursor(*args) def frameRate(*args): return _P5_INSTANCE.frameRate(*args) def noCursor(*args): return _P5_INSTANCE.noCursor(*args) def fullscreen(*args): return _P5_INSTANCE.fullscreen(*args) def pixelDensity(*args): return _P5_INSTANCE.pixelDensity(*args) def displayDensity(*args): return _P5_INSTANCE.displayDensity(*args) def getURL(*args): return _P5_INSTANCE.getURL(*args) def getURLPath(*args): return _P5_INSTANCE.getURLPath(*args) def getURLParams(*args): return _P5_INSTANCE.getURLParams(*args) def remove(*args): return _P5_INSTANCE.remove(*args) def noLoop(*args): return _P5_INSTANCE.noLoop(*args) def loop(*args): return _P5_INSTANCE.loop(*args) def push(*args): return _P5_INSTANCE.push(*args) def redraw(*args): return _P5_INSTANCE.redraw(*args) def resizeCanvas(*args): return _P5_INSTANCE.resizeCanvas(*args) def noCanvas(*args): return _P5_INSTANCE.noCanvas(*args) def createGraphics(*args): return _P5_INSTANCE.createGraphics(*args) def blendMode(*args): return _P5_INSTANCE.blendMode(*args) def setAttributes(*args): return _P5_INSTANCE.setAttributes(*args) def applyMatrix(*args): return _P5_INSTANCE.applyMatrix(*args) def resetMatrix(*args): return _P5_INSTANCE.resetMatrix(*args) def rotate(*args): return _P5_INSTANCE.rotate(*args) def rotateX(*args): return _P5_INSTANCE.rotateX(*args) def rotateY(*args): return _P5_INSTANCE.rotateY(*args) def rotateZ(*args): return _P5_INSTANCE.rotateZ(*args) def scale(*args): return _P5_INSTANCE.scale(*args) def shearX(*args): return _P5_INSTANCE.shearX(*args) def shearY(*args): return _P5_INSTANCE.shearY(*args) def translate(*args): return _P5_INSTANCE.translate(*args) def createStringDict(*args): return _P5_INSTANCE.createStringDict(*args) def createNumberDict(*args): return _P5_INSTANCE.createNumberDict(*args) def append(*args): return _P5_INSTANCE.append(*args) def arrayCopy(*args): return _P5_INSTANCE.arrayCopy(*args) def concat(*args): return _P5_INSTANCE.concat(*args) def reverse(*args): return _P5_INSTANCE.reverse(*args) def shorten(*args): return _P5_INSTANCE.shorten(*args) def shuffle(*args): return _P5_INSTANCE.shuffle(*args) def sort(*args): return _P5_INSTANCE.sort(*args) def splice(*args): return _P5_INSTANCE.splice(*args) def subset(*args): return _P5_INSTANCE.subset(*args) def float(*args): return _P5_INSTANCE.float(*args) def int(*args): return _P5_INSTANCE.int(*args) def str(*args): return _P5_INSTANCE.str(*args) def boolean(*args): return _P5_INSTANCE.boolean(*args) def byte(*args): return _P5_INSTANCE.byte(*args) def char(*args): return _P5_INSTANCE.char(*args) def unchar(*args): return _P5_INSTANCE.unchar(*args) def hex(*args): return _P5_INSTANCE.hex(*args) def unhex(*args): return _P5_INSTANCE.unhex(*args) def join(*args): return _P5_INSTANCE.join(*args) def match(*args): return _P5_INSTANCE.match(*args) def matchAll(*args): return _P5_INSTANCE.matchAll(*args) def nf(*args): return _P5_INSTANCE.nf(*args) def nfc(*args): return _P5_INSTANCE.nfc(*args) def nfp(*args): return _P5_INSTANCE.nfp(*args) def nfs(*args): return _P5_INSTANCE.nfs(*args) def split(*args): return _P5_INSTANCE.split(*args) def splitTokens(*args): return _P5_INSTANCE.splitTokens(*args) def trim(*args): return _P5_INSTANCE.trim(*args) def setMoveThreshold(*args): return _P5_INSTANCE.setMoveThreshold(*args) def setShakeThreshold(*args): return _P5_INSTANCE.setShakeThreshold(*args) def keyIsDown(*args): return _P5_INSTANCE.keyIsDown(*args) def createImage(*args): return _P5_INSTANCE.createImage(*args) def saveCanvas(*args): return _P5_INSTANCE.saveCanvas(*args) def saveFrames(*args): return _P5_INSTANCE.saveFrames(*args) def loadImage(*args): return _P5_INSTANCE.loadImage(*args) def image(*args): return _P5_INSTANCE.image(*args) def tint(*args): return _P5_INSTANCE.tint(*args) def noTint(*args): return _P5_INSTANCE.noTint(*args) def imageMode(*args): return _P5_INSTANCE.imageMode(*args) def blend(*args): return _P5_INSTANCE.blend(*args) def copy(*args): return _P5_INSTANCE.copy(*args) def filter(*args): if len(args) > 1 and (args[0] is None or callable(args[0])): return PythonFunctions.filter(*args) else: return _P5_INSTANCE.filter(*args) def get(*args): return _P5_INSTANCE.get(*args) def loadPixels(*args): return _P5_INSTANCE.loadPixels(*args) def set(*args): if len(args) <= 1: return PythonFunctions.set(*args) else: return _P5_INSTANCE.set(*args) def updatePixels(*args): return _P5_INSTANCE.updatePixels(*args) def loadJSON(*args): return _P5_INSTANCE.loadJSON(*args) def loadStrings(*args): return _P5_INSTANCE.loadStrings(*args) def loadTable(*args): return _P5_INSTANCE.loadTable(*args) def loadXML(*args): return _P5_INSTANCE.loadXML(*args) def loadBytes(*args): return _P5_INSTANCE.loadBytes(*args) def httpGet(*args): return _P5_INSTANCE.httpGet(*args) def httpPost(*args): return _P5_INSTANCE.httpPost(*args) def httpDo(*args): return _P5_INSTANCE.httpDo(*args) def createWriter(*args): return _P5_INSTANCE.createWriter(*args) def save(*args): return _P5_INSTANCE.save(*args) def saveJSON(*args): return _P5_INSTANCE.saveJSON(*args) def saveStrings(*args): return _P5_INSTANCE.saveStrings(*args) def saveTable(*args): return _P5_INSTANCE.saveTable(*args) def day(*args): return _P5_INSTANCE.day(*args) def hour(*args): return _P5_INSTANCE.hour(*args) def minute(*args): return _P5_INSTANCE.minute(*args) def millis(*args): return _P5_INSTANCE.millis(*args) def month(*args): return _P5_INSTANCE.month(*args) def second(*args): return _P5_INSTANCE.second(*args) def year(*args): return _P5_INSTANCE.year(*args) def createVector(*args): return _P5_INSTANCE.createVector(*args) def abs(*args): return _P5_INSTANCE.abs(*args) def ceil(*args): return _P5_INSTANCE.ceil(*args) def constrain(*args): return _P5_INSTANCE.constrain(*args) def dist(*args): return _P5_INSTANCE.dist(*args) def exp(*args): return _P5_INSTANCE.exp(*args) def floor(*args): return _P5_INSTANCE.floor(*args) def lerp(*args): return _P5_INSTANCE.lerp(*args) def log(*args): return _P5_INSTANCE.log(*args) def mag(*args): return _P5_INSTANCE.mag(*args) def map(*args): if len(args) > 1 and callable(args[0]): return PythonFunctions.map(*args) else: return _P5_INSTANCE.map(*args) def max(*args): return _P5_INSTANCE.max(*args) def min(*args): return _P5_INSTANCE.min(*args) def norm(*args): return _P5_INSTANCE.norm(*args) def pow(*args): return _P5_INSTANCE.pow(*args) def round(*args): return _P5_INSTANCE.round(*args) def sq(*args): return _P5_INSTANCE.sq(*args) def sqrt(*args): return _P5_INSTANCE.sqrt(*args) def noise(*args): return _P5_INSTANCE.noise(*args) def noiseDetail(*args): return _P5_INSTANCE.noiseDetail(*args) def noiseSeed(*args): return _P5_INSTANCE.noiseSeed(*args) def randomSeed(*args): return _P5_INSTANCE.randomSeed(*args) def random(*args): return _P5_INSTANCE.random(*args) def randomGaussian(*args): return _P5_INSTANCE.randomGaussian(*args) def acos(*args): return _P5_INSTANCE.acos(*args) def asin(*args): return _P5_INSTANCE.asin(*args) def atan(*args): return _P5_INSTANCE.atan(*args) def atan2(*args): return _P5_INSTANCE.atan2(*args) def cos(*args): return _P5_INSTANCE.cos(*args) def sin(*args): return _P5_INSTANCE.sin(*args) def tan(*args): return _P5_INSTANCE.tan(*args) def degrees(*args): return _P5_INSTANCE.degrees(*args) def radians(*args): return _P5_INSTANCE.radians(*args) def angleMode(*args): return _P5_INSTANCE.angleMode(*args) def textAlign(*args): return _P5_INSTANCE.textAlign(*args) def textLeading(*args): return _P5_INSTANCE.textLeading(*args) def textSize(*args): return _P5_INSTANCE.textSize(*args) def textStyle(*args): return _P5_INSTANCE.textStyle(*args) def textWidth(*args): return _P5_INSTANCE.textWidth(*args) def textAscent(*args): return _P5_INSTANCE.textAscent(*args) def textDescent(*args): return _P5_INSTANCE.textDescent(*args) def loadFont(*args): return _P5_INSTANCE.loadFont(*args) def text(*args): return _P5_INSTANCE.text(*args) def textFont(*args): return _P5_INSTANCE.textFont(*args) def orbitControl(*args): return _P5_INSTANCE.orbitControl(*args) def debugMode(*args): return _P5_INSTANCE.debugMode(*args) def noDebugMode(*args): return _P5_INSTANCE.noDebugMode(*args) def ambientLight(*args): return _P5_INSTANCE.ambientLight(*args) def directionalLight(*args): return _P5_INSTANCE.directionalLight(*args) def pointLight(*args): return _P5_INSTANCE.pointLight(*args) def lights(*args): return _P5_INSTANCE.lights(*args) def loadShader(*args): return _P5_INSTANCE.loadShader(*args) def createShader(*args): return _P5_INSTANCE.createShader(*args) def shader(*args): return _P5_INSTANCE.shader(*args) def resetShader(*args): return _P5_INSTANCE.resetShader(*args) def normalMaterial(*args): return _P5_INSTANCE.normalMaterial(*args) def texture(*args): return _P5_INSTANCE.texture(*args) def textureMode(*args): return _P5_INSTANCE.textureMode(*args) def textureWrap(*args): return _P5_INSTANCE.textureWrap(*args) def ambientMaterial(*args): return _P5_INSTANCE.ambientMaterial(*args) def specularMaterial(*args): return _P5_INSTANCE.specularMaterial(*args) def shininess(*args): return _P5_INSTANCE.shininess(*args) def camera(*args): return _P5_INSTANCE.camera(*args) def perspective(*args): return _P5_INSTANCE.perspective(*args) def ortho(*args): return _P5_INSTANCE.ortho(*args) def createCamera(*args): return _P5_INSTANCE.createCamera(*args) def setCamera(*args): return _P5_INSTANCE.setCamera(*args) def select(*args): return _P5_INSTANCE.select(*args) def selectAll(*args): return _P5_INSTANCE.selectAll(*args) def removeElements(*args): return _P5_INSTANCE.removeElements(*args) def changed(*args): return _P5_INSTANCE.changed(*args) def input(*args): return _P5_INSTANCE.input(*args) def createDiv(*args): return _P5_INSTANCE.createDiv(*args) def createP(*args): return _P5_INSTANCE.createP(*args) def createSpan(*args): return _P5_INSTANCE.createSpan(*args) def createImg(*args): return _P5_INSTANCE.createImg(*args) def createA(*args): return _P5_INSTANCE.createA(*args) def createSlider(*args): return _P5_INSTANCE.createSlider(*args) def createButton(*args): return _P5_INSTANCE.createButton(*args) def createCheckbox(*args): return _P5_INSTANCE.createCheckbox(*args) def createSelect(*args): return _P5_INSTANCE.createSelect(*args) def createRadio(*args): return _P5_INSTANCE.createRadio(*args) def createColorPicker(*args): return _P5_INSTANCE.createColorPicker(*args) def createInput(*args): return _P5_INSTANCE.createInput(*args) def createFileInput(*args): return _P5_INSTANCE.createFileInput(*args) def createVideo(*args): return _P5_INSTANCE.createVideo(*args) def createAudio(*args): return _P5_INSTANCE.createAudio(*args) def createCapture(*args): return _P5_INSTANCE.createCapture(*args) def createElement(*args): return _P5_INSTANCE.createElement(*args) def createCanvas(*args): canvas = _P5_INSTANCE.createCanvas(*args) global width, height width = _P5_INSTANCE.width height = _P5_INSTANCE.height return canvas def __deviceMoved(e): try: _bind_event_function(deviceMoved, e) except NameError: pass def __deviceTurned(e): try: _bind_event_function(deviceTurned, e) except NameError: pass def __deviceShaken(e): try: _bind_event_function(deviceShaken, e) except NameError: pass def __touchEnded(e): try: _bind_event_function(deviceShaken, e) except NameError: pass def __touchStarted(e): try: _bind_event_function(touchStarted, e) except NameError: pass def __windowResized(e): try: _bind_event_function(windowResized, e) except NameError: pass def __touchMoved(e): try: _bind_event_function(touchMoved, e) except NameError: pass def __mouseMoved(e): try: _bind_event_function(mouseMoved, e) except NameError: pass def __mouseDragged(e): try: _bind_event_function(mouseDragged, e) except NameError: pass def __mousePressed(e): try: _bind_event_function(mousePressed, e) except NameError: pass def __mouseReleased(e): try: _bind_event_function(mouseReleased, e) except NameError: pass def __mouseClicked(e): try: _bind_event_function(mouseClicked, e) except NameError: pass def __doubleClicked(e): try: _bind_event_function(doubleClicked, e) except NameError: pass def __mouseWheel(e): try: _bind_event_function(mouseWheel, e) except NameError: pass def __keyPressed(e): try: _bind_event_function(keyPressed, e) except NameError: pass def __keyReleased(e): try: _bind_event_function(keyReleased, e) except NameError: pass def __keyTyped(e): try: _bind_event_function(keyTyped, e) except NameError: pass def __keyIsDown(e): try: _bind_event_function(keyIsDown, e) except NameError: pass def pop(*args): p5_pop = _P5_INSTANCE.pop(*args) return p5_pop # Processing Python or Java mode compatibility aliases size = createCanvas popMatrix = pop popStyle = pop pushMatrix = push pushStyle = push # PVector is a wrapper/helper class for p5.Vector objets # providing names similar to Processing Python or Java modes # but mostly keeping p5js functionality from numbers import Number class PVector: def __init__(self, x=0, y=0, z=0): self.__vector = createVector(x, y, z) self.add = self.__instance_add__ self.sub = self.__instance_sub__ self.mult = self.__instance_mult__ self.div = self.__instance_div__ self.cross = self.__instance_cross__ self.dist = self.__instance_dist__ self.dot = self.__instance_dot__ self.lerp = self.__instance_lerp__ @property def x(self): return self.__vector.x @x.setter def x(self, x): self.__vector.x = x @property def y(self): return self.__vector.y @y.setter def y(self, y): self.__vector.y = y @property def z(self): return self.__vector.z @z.setter def z(self, z): self.__vector.z = z def mag(self): return self.__vector.mag() def magSq(self): return self.__vector.magSq() def setMag(self, mag): self.__vector.setMag(mag) return self def normalize(self): self.__vector.normalize() return self def limit(self, max): self.__vector.limit(max) return self def heading(self): return self.__vector.heading() def rotate(self, angle): self.__vector.rotate(angle) return self def __instance_add__(self, *args): if len(args) == 1: return PVector.add(self, args[0], self) else: return PVector.add(self, PVector(*args), self) def __instance_sub__(self, *args): if len(args) == 1: return PVector.sub(self, args[0], self) else: return PVector.sub(self, PVector(*args), self) def __instance_mult__(self, o): return PVector.mult(self, o, self) def __instance_div__(self, f): return PVector.div(self, f, self) def __instance_cross__(self, o): return PVector.cross(self, o, self) def __instance_dist__(self, o): return PVector.dist(self, o) def __instance_dot__(self, *args): if len(args) == 1: v = args[0] else: v = args return self.x * v[0] + self.y * v[1] + self.z * v[2] def __instance_lerp__(self, *args): if len(args) == 2: return PVector.lerp(self, args[0], args[1], self) else: vx, vy, vz, f = args return PVector.lerp(self, PVector(vx, vy, vz), f, self) def get(self): return PVector(self.x, self.y, self.z) def copy(self): return PVector(self.x, self.y, self.z) def __getitem__(self, k): return getattr(self, ('x', 'y', 'z')[k]) def __setitem__(self, k, v): setattr(self, ('x', 'y', 'z')[k], v) def __copy__(self): return PVector(self.x, self.y, self.z) def __deepcopy__(self, memo): return PVector(self.x, self.y, self.z) def __repr__(self): # PROVISÓRIO return f'PVector({self.x}, {self.y}, {self.z})' def set(self, *args): """ Sets the x, y, and z component of the vector using two or three separate variables, the data from a p5.Vector, or the values from a float array. """ self.__vector.set(*args) @classmethod def add(cls, a, b, dest=None): if dest is None: return PVector(a.x + b[0], a.y + b[1], a.z + b[2]) dest.__vector.set(a.x + b[0], a.y + b[1], a.z + b[2]) return dest @classmethod def sub(cls, a, b, dest=None): if dest is None: return PVector(a.x - b[0], a.y - b[1], a.z - b[2]) dest.__vector.set(a.x - b[0], a.y - b[1], a.z - b[2]) return dest @classmethod def mult(cls, a, b, dest=None): if dest is None: return PVector(a.x * b, a.y * b, a.z * b) dest.__vector.set(a.x * b, a.y * b, a.z * b) return dest @classmethod def div(cls, a, b, dest=None): if dest is None: return PVector(a.x / b, a.y / b, a.z / b) dest.__vector.set(a.x / b, a.y / b, a.z / b) return dest @classmethod def dist(cls, a, b): return a.__vector.dist(b.__vector) @classmethod def dot(cls, a, b): return a.__vector.dot(b.__vector) def __add__(a, b): return PVector.add(a, b, None) def __sub__(a, b): return PVector.sub(a, b, None) def __isub__(a, b): a.sub(b) return a def __iadd__(a, b): a.add(b) return a def __mul__(a, b): if not isinstance(b, Number): raise TypeError( "The * operator can only be used to multiply a PVector by a number") return PVector.mult(a, float(b), None) def __rmul__(a, b): if not isinstance(b, Number): raise TypeError( "The * operator can only be used to multiply a PVector by a number") return PVector.mult(a, float(b), None) def __imul__(a, b): if not isinstance(b, Number): raise TypeError( "The *= operator can only be used to multiply a PVector by a number") a.__vector.mult(float(b)) return a def __truediv__(a, b): if not isinstance(b, Number): raise TypeError( "The * operator can only be used to multiply a PVector by a number") return PVector(a.x / float(b), a.y / float(b), a.z / float(b)) def __itruediv__(a, b): if not isinstance(b, Number): raise TypeError( "The /= operator can only be used to multiply a PVector by a number") a.__vector.set(a.x / float(b), a.y / float(b), a.z / float(b)) return a def __eq__(a, b): return a.x == b[0] and a.y == b[1] and a.z == b[2] def __lt__(a, b): return a.magSq() < b.magSq() def __le__(a, b): return a.magSq() <= b.magSq() def __gt__(a, b): return a.magSq() > b.magSq() def __ge__(a, b): return a.magSq() >= b.magSq() # Problematic class methods, we would rather use p5.Vector when possible... @classmethod def lerp(cls, a, b, f, dest=None): v = createVector(a.x, a.y, a.z) v.lerp(b.__vector, f) if dest is None: return PVector(v.x, v.y, v.z) dest.set(v.x, v.y, v.z) return dest @classmethod def cross(cls, a, b, dest=None): x = a.y * b[2] - b[1] * a.z y = a.z * b[0] - b[2] * a.x z = a.x * b[1] - b[0] * a.y if dest is None: return PVector(x, y, z) dest.set(x, y, z) return dest @classmethod def fromAngle(cls, angle, length=1): # https://github.com/processing/p5.js/blob/3f0b2f0fe575dc81c724474154f5b23a517b7233/src/math/p5.Vector.js return PVector(length * cos(angle), length * sin(angle), 0) @classmethod def fromAngles(theta, phi, length=1): # https://github.com/processing/p5.js/blob/3f0b2f0fe575dc81c724474154f5b23a517b7233/src/math/p5.Vector.js cosPhi = cos(phi) sinPhi = sin(phi) cosTheta = cos(theta) sinTheta = sin(theta) return PVector(length * sinTheta * sinPhi, -length * cosTheta, length * sinTheta * cosPhi) @classmethod def random2D(cls): return PVector.fromAngle(random(TWO_PI)) @classmethod def random3D(cls, dest=None): angle = random(TWO_PI) vz = random(2) - 1 mult = sqrt(1 - vz * vz) vx = mult * cos(angle) vy = mult * sin(angle) if dest is None: return PVector(vx, vy, vz) dest.set(vx, vy, vz) return dest @classmethod def angleBetween(cls, a, b): return acos(a.dot(b) / sqrt(a.magSq() * b.magSq())) # Other harmless p5js methods def equals(self, v): return self == v def heading2D(self): return self.__vector.heading() def reflect(self, *args): # Reflect the incoming vector about a normal to a line in 2D, or about # a normal to a plane in 3D This method acts on the vector directly r = self.__vector.reflect(*args) return r def array(self): # Return a representation of this vector as a float array. This is only # for temporary use. If used in any w fashion, the contents should be # copied by using the p5.Vector.copy() method to copy into your own # array. return self.__vector.array() def toString(self): # Returns a string representation of a vector v by calling String(v) or v.toString(). # return self.__vector.toString() would be something like "p5.vector # Object […, …, …]" return str(self) def rem(self, *args): # Gives remainder of a vector when it is divided by anw vector. See # examples for more context. self.__vector.rem(*args) return self def pre_draw(p5_instance, draw_func, *args, **kwargs): """ We need to run this before the actual draw to insert and update p5 env variables """ global _CTX_MIDDLE, _DEFAULT_FILL, _DEFAULT_LEADMULT, _DEFAULT_STROKE, _DEFAULT_TEXT_FILL global ADD, ALT, ARROW, AUTO, AUDIO, AXES, BACKSPACE, BASELINE, BEVEL, BEZIER, BLEND, BLUR, BOLD, BOLDITALIC global BOTTOM, BURN, CENTER, CHORD, CLAMP, CLOSE, CONTROL, CORNER, CORNERS, CROSS, CURVE, DARKEST global DEG_TO_RAD, DEGREES, DELETE, DIFFERENCE, DILATE, DODGE, DOWN_ARROW, ENTER, ERODE, ESCAPE, EXCLUSION global FILL, GRAY, GRID, HALF_PI, HAND, HARD_LIGHT, HSB, HSL, IMAGE, IMMEDIATE, INVERT, ITALIC, LANDSCAPE global LEFT, LEFT_ARROW, LIGHTEST, LINE_LOOP, LINE_STRIP, LINEAR, LINES, MIRROR, MITER, MOVE, MULTIPLY, NEAREST global NORMAL, OPAQUE, OPEN, OPTION, OVERLAY, P2D, P3D, PI, PIE, POINTS, PORTRAIT, POSTERIZE, PROJECT, QUAD_STRIP global QUADRATIC, QUADS, QUARTER_PI, RAD_TO_DEG, RADIANS, RADIUS, REPEAT, REPLACE, RETURN, RGB, RIGHT, RIGHT_ARROW global ROUND, SCREEN, SHIFT, SOFT_LIGHT, SQUARE, STROKE, SUBTRACT, TAB, TAU, TEXT, TEXTURE, THRESHOLD, TOP global TRIANGLE_FAN, TRIANGLE_STRIP, TRIANGLES, TWO_PI, UP_ARROW, VIDEO, WAIT, WEBGL global frameCount, focused, displayWidth, displayHeight, windowWidth, windowHeight, width, height global deviceOrientation, accelerationX, accelerationY, accelerationZ global pAccelerationX, pAccelerationY, pAccelerationZ, rotationX, rotationY, rotationZ global pRotationX, pRotationY, pRotationZ, turnAxis, keyIsPressed, key, keyCode, mouseX, mouseY, pmouseX, pmouseY global winMouseX, winMouseY, pwinMouseX, pwinMouseY, mouseButton, mouseIsPressed, touches, pixels _CTX_MIDDLE = p5_instance._CTX_MIDDLE _DEFAULT_FILL = p5_instance._DEFAULT_FILL _DEFAULT_LEADMULT = p5_instance._DEFAULT_LEADMULT _DEFAULT_STROKE = p5_instance._DEFAULT_STROKE _DEFAULT_TEXT_FILL = p5_instance._DEFAULT_TEXT_FILL ADD = p5_instance.ADD ALT = p5_instance.ALT ARROW = p5_instance.ARROW AUDIO = p5_instance.AUDIO AUTO = p5_instance.AUTO AXES = p5_instance.AXES BACKSPACE = p5_instance.BACKSPACE BASELINE = p5_instance.BASELINE BEVEL = p5_instance.BEVEL BEZIER = p5_instance.BEZIER BLEND = p5_instance.BLEND BLUR = p5_instance.BLUR BOLD = p5_instance.BOLD BOLDITALIC = p5_instance.BOLDITALIC BOTTOM = p5_instance.BOTTOM BURN = p5_instance.BURN CENTER = p5_instance.CENTER CHORD = p5_instance.CHORD CLAMP = p5_instance.CLAMP CLOSE = p5_instance.CLOSE CONTROL = p5_instance.CONTROL CORNER = p5_instance.CORNER CORNERS = p5_instance.CORNERS CROSS = p5_instance.CROSS CURVE = p5_instance.CURVE DARKEST = p5_instance.DARKEST DEG_TO_RAD = p5_instance.DEG_TO_RAD DEGREES = p5_instance.DEGREES DELETE = p5_instance.DELETE DIFFERENCE = p5_instance.DIFFERENCE DILATE = p5_instance.DILATE DODGE = p5_instance.DODGE DOWN_ARROW = p5_instance.DOWN_ARROW ENTER = p5_instance.ENTER ERODE = p5_instance.ERODE ESCAPE = p5_instance.ESCAPE EXCLUSION = p5_instance.EXCLUSION FILL = p5_instance.FILL GRAY = p5_instance.GRAY GRID = p5_instance.GRID HALF_PI = p5_instance.HALF_PI HAND = p5_instance.HAND HARD_LIGHT = p5_instance.HARD_LIGHT HSB = p5_instance.HSB HSL = p5_instance.HSL IMAGE = p5_instance.IMAGE IMMEDIATE = p5_instance.IMMEDIATE INVERT = p5_instance.INVERT ITALIC = p5_instance.ITALIC LANDSCAPE = p5_instance.LANDSCAPE LEFT = p5_instance.LEFT LEFT_ARROW = p5_instance.LEFT_ARROW LIGHTEST = p5_instance.LIGHTEST LINE_LOOP = p5_instance.LINE_LOOP LINE_STRIP = p5_instance.LINE_STRIP LINEAR = p5_instance.LINEAR LINES = p5_instance.LINES MIRROR = p5_instance.MIRROR MITER = p5_instance.MITER MOVE = p5_instance.MOVE MULTIPLY = p5_instance.MULTIPLY NEAREST = p5_instance.NEAREST NORMAL = p5_instance.NORMAL OPAQUE = p5_instance.OPAQUE OPEN = p5_instance.OPEN OPTION = p5_instance.OPTION OVERLAY = p5_instance.OVERLAY P2D = p5_instance.P2D P3D = p5_instance.WEBGL PI = p5_instance.PI PIE = p5_instance.PIE POINTS = p5_instance.POINTS PORTRAIT = p5_instance.PORTRAIT POSTERIZE = p5_instance.POSTERIZE PROJECT = p5_instance.PROJECT QUAD_STRIP = p5_instance.QUAD_STRIP QUADRATIC = p5_instance.QUADRATIC QUADS = p5_instance.QUADS QUARTER_PI = p5_instance.QUARTER_PI RAD_TO_DEG = p5_instance.RAD_TO_DEG RADIANS = p5_instance.RADIANS RADIUS = p5_instance.RADIUS REPEAT = p5_instance.REPEAT REPLACE = p5_instance.REPLACE RETURN = p5_instance.RETURN RGB = p5_instance.RGB RIGHT = p5_instance.RIGHT RIGHT_ARROW = p5_instance.RIGHT_ARROW ROUND = p5_instance.ROUND SCREEN = p5_instance.SCREEN SHIFT = p5_instance.SHIFT SOFT_LIGHT = p5_instance.SOFT_LIGHT SQUARE = p5_instance.SQUARE STROKE = p5_instance.STROKE SUBTRACT = p5_instance.SUBTRACT TAB = p5_instance.TAB TAU = p5_instance.TAU TEXT = p5_instance.TEXT TEXTURE = p5_instance.TEXTURE THRESHOLD = p5_instance.THRESHOLD TOP = p5_instance.TOP TRIANGLE_FAN = p5_instance.TRIANGLE_FAN TRIANGLE_STRIP = p5_instance.TRIANGLE_STRIP TRIANGLES = p5_instance.TRIANGLES TWO_PI = p5_instance.TWO_PI UP_ARROW = p5_instance.UP_ARROW VIDEO = p5_instance.VIDEO WAIT = p5_instance.WAIT WEBGL = p5_instance.WEBGL frameCount = p5_instance.frameCount focused = p5_instance.focused displayWidth = p5_instance.displayWidth displayHeight = p5_instance.displayHeight windowWidth = p5_instance.windowWidth windowHeight = p5_instance.windowHeight width = p5_instance.width height = p5_instance.height deviceOrientation = p5_instance.deviceOrientation accelerationX = p5_instance.accelerationX accelerationY = p5_instance.accelerationY accelerationZ = p5_instance.accelerationZ pAccelerationX = p5_instance.pAccelerationX pAccelerationY = p5_instance.pAccelerationY pAccelerationZ = p5_instance.pAccelerationZ rotationX = p5_instance.rotationX rotationY = p5_instance.rotationY rotationZ = p5_instance.rotationZ pRotationX = p5_instance.pRotationX pRotationY = p5_instance.pRotationY pRotationZ = p5_instance.pRotationZ turnAxis = p5_instance.turnAxis keyIsPressed = p5_instance.keyIsPressed key = p5_instance.key keyCode = p5_instance.keyCode mouseX = p5_instance.mouseX mouseY = p5_instance.mouseY pmouseX = p5_instance.pmouseX pmouseY = p5_instance.pmouseY winMouseX = p5_instance.winMouseX winMouseY = p5_instance.winMouseY pwinMouseX = p5_instance.pwinMouseX pwinMouseY = p5_instance.pwinMouseY mouseButton = p5_instance.mouseButton mouseIsPressed = p5_instance.mouseIsPressed touches = p5_instance.touches pixels = p5_instance.pixels return draw_func(*args, **kwargs) def global_p5_injection(p5_sketch): """ Injects the p5js's skecth instance as a global variable to setup and draw functions """ def decorator(f, *args, **kwargs): def wrapper(*args, **kwargs): global _P5_INSTANCE _P5_INSTANCE = p5_sketch return pre_draw(_P5_INSTANCE, f, *args, **kwargs) return wrapper return decorator def start_p5(preload_func, setup_func, draw_func, event_functions): """ This is the entrypoint function. It accepts 2 parameters: - preload_func: A Python preload callable - setup_func: a Python setup callable - draw_func: a Python draw callable - event_functions: a config dict for the event functions in the format: {"eventFunctionName": python_event_function} This method gets the p5js's sketch instance and injects them """ def sketch_setup(p5_sketch): """ Callback function called to configure new p5 instance """ p5_sketch.preload = global_p5_injection(p5_sketch)(preload_func) p5_sketch.setup = global_p5_injection(p5_sketch)(setup_func) p5_sketch.draw = global_p5_injection(p5_sketch)(draw_func) window.instance = p5.new(sketch_setup, 'sketch-holder') # Register event functions event_function_names = ( "deviceMoved", "deviceTurned", "deviceShaken", "windowResized", "keyPressed", "keyReleased", "keyTyped", "mousePressed", "mouseReleased", "mouseClicked", "doubleClicked", "mouseMoved", "mouseDragged", "mouseWheel", "touchStarted", "touchMoved", "touchEnded", "keyIsDown", ) for f_name in [f for f in event_function_names if event_functions.get(f, None)]: func = event_functions[f_name] event_func = global_p5_injection(window.instance)(func) setattr(window.instance, f_name, event_func) `; const placeholder = ` def preload(): pass def setup(): pass def draw(): pass deviceMoved = None deviceTurned = None deviceShaken = None keyPressed = None keyReleased = None keyTyped = None mouseMoved = None mouseDragged = None mousePressed = None mouseReleased = None mouseClicked = None doubleClicked = None mouseWheel = None touchStarted = None touchMoved = None touchEnded = None windowResized = None `; let userCode = ` RAD = 10 P_RAD = 30 WIDTH = 600 HEIGHT = 300 class Ball: def __init__self(x, y, sx, sy): self.x = x self.y = y self.sx = sx self.sy = sy def draw(self): circle(self.x, self.y, 2 * RAD) def reset(self): self.x = WIDTH // 2 self.y = HEIGHT // 2 self.sx = 4 self.sy = 0 self.play = True ball = Ball() class Player: def __init__(self, x, y): self.x = x self.y = y def reset(self): self.y = HEIGHT // 2 def set_pos(self,y): self.y = min(HEIGHT, max(y, 0)) def draw(self): strokeWeight(2) line(self.x, self.y - P_RAD, self.x, self.y + P_RAD) player1 = Player(10, HEIGHT // 2) player2 = Player(WIDTH - 10, HEIGHT // 2) game = None def setup(): global game createCanvas(WIDTH, HEIGHT) stroke(255) fill(255) game = Game() game.reset() class Game: def __init__(self): self.over = False def reset(self): self.over = False ball.reset() player1.reset() player2.reset() def tick(self): if not self.over: # y: keep ball inside of vertical bounds if (ball.y < 10) or (ball.y > height - 10): ball.sy *= -1 ball.y += ball.sy # x: player 2 if (ball.x + RAD >= player2.x): ball.sx *= -1 # x: player 1 if (ball.x - RAD <= player1.x): if ((ball.y > player1.y - P_RAD) and (ball.y < player1.y + P_RAD)): # player 1 hits the ball # bounce back ball.sx *= -1 # get ball-paddle angle angle = ball.y - player1.y ball.sy = angle / 9 ball.sx = map(abs(angle), 0, P_RAD, 3, 9) else: # player misses the ball self.over = True if (ball.x < -100): game.reset() ball.x += ball.sx ball.draw() def draw(): if not game.over: background(0) else: background(255,0,0) player1.set_pos(mouseY) player1.draw() player2.set_pos(ball.y) player2.draw() game.tick() `; const startCode = ` event_functions = { "deviceMoved": deviceMoved, "deviceTurned": deviceTurned, "deviceShaken": deviceShaken, "keyPressed": keyPressed, "keyReleased": keyReleased, "keyTyped": keyTyped, "mouseMoved": mouseMoved, "mouseDragged": mouseDragged, "mousePressed": mousePressed, "mouseReleased": mouseReleased, "mouseClicked": mouseClicked, "doubleClicked": doubleClicked, "mouseWheel": mouseWheel, "touchStarted": touchStarted, "touchMoved": touchMoved, "touchEnded": touchEnded, "windowResized": windowResized, } start_p5(preload, setup, draw, event_functions) `; function runCode() { let code = [ placeholder, userCode, wrapperContent, startCode, ].join('\n'); if (window.instance) { window.instance.canvas.remove(); } console.log("Python execution output:"); window.pyodide.runPython(code); } async function main() { const config = { indexURL : "https://cdn.jsdelivr.net/pyodide/v0.18.1/full/", fullStdLib: false, } window.pyodide = await loadPyodide(config); // Pyodide is now ready to use... console.log(window.pyodide.runPython(` import io, code, sys from js import p5, window, document print(sys.version) `)); window.runSketchCode = (code) => { userCode = code; runCode(); } runCode(); }; // async method main(); ================================================ FILE: docs/examples/pyodide/samegame/index.html ================================================ samegame - pyp5js

Python code here.

NROWS =  10      # numer of brick rows 
NCOLS =  20      # number of brick columns
NCOLORS = 4      # 1 .. 5
B_WIDTH = 50     # brick width
FPS = 30         # frames per second
C_WIDTH =  NCOLS * B_WIDTH # canvas width
C_HEIGHT = NROWS * B_WIDTH # canvas height 

game = None

def setup():
    global game
    createCanvas(C_WIDTH, C_HEIGHT, P2D)
    rectMode(CENTER)
    frameRate(FPS)
    game = SameGame()
    
def draw(): 
    global game
    game.plotBoard()
                
def inCell(x,y):
    return (int(x) // (B_WIDTH + 1), int(y) // (B_WIDTH + 1))

def inCanvas(x,y):
    return  (0 <=  x <= C_WIDTH) and (0 <= y <= C_HEIGHT)

def mousePressed():
    global game
    x, y = mouseX, mouseY
    i, j = inCell(x,y)
    if (0 <= i < game.nc) and (0 <= j < game.nr):
        if not game.alone(i,j):
            game.floodfill(i,j)
            game.fall_all()

def keyPressed():
    global game
    if key == "n":
        game = SameGame()
    elif key in ("3","4","5"):
        colors = int(key)    
        game = SameGame(ncolors=colors)
         
cell_colors = {0:"black", 1:"green", 2:"blue", 
               3:"red", 4:"yellow", 5:"magenta"}

def cells(colors_only=False,ncolors=NCOLORS):
    ycent = B_WIDTH // 2
    pos =    [[0] * NROWS for col in range(NCOLS)]
    colors = [[0] * NROWS for col in range(NCOLS)]  
    # store cell centers coordinates and colors, columnwise
    for row in range(NCOLS):
        xcent = -B_WIDTH // 2
        for col in range(NROWS):   
            xcent += B_WIDTH
            pos[row][col] = (ycent,xcent)
            colors[row][col] = int(random(1, ncolors + 1))
        ycent += B_WIDTH
    if not colors_only:    
        return pos, colors
    return colors

class SameGame:
    def __init__(self,nr=NROWS, nc=NCOLS, ncolors=NCOLORS, 
                 colors=None, pos=None, score=0, score_diff=0, 
                 empty_cols = None, to_fill=None,score_corr=0):
        self.nr = nr
        self.nc = nc
        self.ncolors = ncolors
        self.to_fill = set()
        self.score = score
        self.score_diff = score_diff
        self.score_corr = score_corr
        self.empty_cols = []
        self.pos, self.colors = cells(ncolors=ncolors) 
        
    def plotBoard(self):
        for row in range(NROWS):
            for col in range(NCOLS):
                xc, yc = self.pos[col][row]   
                fill(cell_colors[self.colors[col][row]])
                rect(xc,yc,B_WIDTH,B_WIDTH)
                
        fill(255)
        textSize(20)
        textAlign(LEFT)
        text("Score: %d" %self.score, C_WIDTH-140, C_HEIGHT - 6)

        if self.endGame():
            if not self.score_corr: 
                self.score_correction_by_colors()
                self.score_corr = True
            self.compactLeft()
            textSize(36)
            textAlign(CENTER)
            text("End of Game",C_WIDTH // 2, C_HEIGHT // 2 - 10)

    def neighbours(self,i,j):
        possible = [(i-1,j),(i+1,j),(i,j-1),(i,j+1)]
        
        return [p for p in possible if (0 <= p[0] < self.nc) 
                                   and (0 <= p[1] < self.nr)]
    
    def alone(self,i,j):
        # i -column, j - row
        color = self.colors[i][j]
        res = True
        if color == 0:
            return res
        for k,l in self.neighbours(i,j):
            if self.colors[k][l] == color:
                res = False
                break
        return res        
    
    def floodfill(self, x, y):
        value = self.colors[x][y]
        edge = [(x,y)]    
        self.to_fill = set([x])
        self.colors[x][y] = 0
        self.score_diff = 1
        while edge:
            newedge = []
            for (x,y) in edge:
                for s,t in self.neighbours(x,y):
                    if self.colors[s][t] == value:
                        self.to_fill.add(s)
                        self.colors[s][t] = 0
                        self.score_diff += 1
                        newedge.append((s, t))
            edge = newedge

    def fall_column(self,col):
        if sum(self.colors[col]) == 0:
            self.empty_cols.append(col)
            return
        colored = []
        for row in range(self.nr):
            cc = self.colors[col][row]
            if cc:
                colored.append(cc)
        lc = len(colored)
        new_col = [0] *(self.nr - lc) + colored
        self.colors[col] = new_col         
                        
    def compactLeft(self):
        if self.empty_cols == []:
            return 
        for c in sorted(self.empty_cols,reverse=True): 
            for cindex in range(c,self.nc-1):
                    self.colors[cindex] = self.colors[cindex + 1]
            self.colors[self.nc-1] = [0] * self.nr
        self.empty_cols = []
          
    def fall_all(self):
        if self.to_fill == []:
            self.score_diff = 0
            return
        for col in self.to_fill:
            self.fall_column(col)
        self.compactLeft()
        nscore = self.score_diff - 1    
        self.score += (nscore * nscore)
        self.score_diff = 0
            
    def endGame(self):
        return sum([self.alone(i,j) for i in range(self.nc) 
                    for j in range(self.nr)]) == self.nr * self.nc

    def score_correction(self):
    
        rem = sum(bool(self.colors[c][r]) for c in range(self.nc) 
                                          for r in range(self.nr)) 
        if rem == 0:
            self.score += 1000
        else:
            self.score -= (rem-1)*(rem-1)
            self.score = max(0,self.score)

    def score_correction_by_colors(self):
        crange = range(1,self.ncolors + 1) 
        rest = {c:0 for c in crange}
        for col in range(self.nc):
            for row in range(self.nr):
                color = self.colors[col][row]
                if color: 
                    rest[color] += 1
                
        rem = 0
        for c in crange:
            ncells = rest[c]
            if ncells:
                rem += (ncells - 1) * (ncells - 1) 
        if sum(rest.values()) == 0:
            self.score += 1000
        else:
            self.score -= rem
            
            
================================================ FILE: docs/examples/pyodide/samegame/samegame.py ================================================ NROWS = 10 # numer of brick rows NCOLS = 20 # number of brick columns NCOLORS = 4 # 1 .. 5 B_WIDTH = 50 # brick width FPS = 30 # frames per second C_WIDTH = NCOLS * B_WIDTH # canvas width C_HEIGHT = NROWS * B_WIDTH # canvas height game = None def setup(): global game createCanvas(C_WIDTH, C_HEIGHT, P2D) rectMode(CENTER) frameRate(FPS) game = SameGame() def draw(): global game game.plotBoard() def inCell(x,y): return (int(x) // (B_WIDTH + 1), int(y) // (B_WIDTH + 1)) def inCanvas(x,y): return (0 <= x <= C_WIDTH) and (0 <= y <= C_HEIGHT) def mousePressed(): global game x, y = mouseX, mouseY i, j = inCell(x,y) if (0 <= i < game.nc) and (0 <= j < game.nr): if not game.alone(i,j): game.floodfill(i,j) game.fall_all() def keyPressed(): global game if key == "n": game = SameGame() elif key in ("3","4","5"): colors = int(key) game = SameGame(ncolors=colors) cell_colors = {0:"black", 1:"green", 2:"blue", 3:"red", 4:"yellow", 5:"magenta"} def cells(colors_only=False,ncolors=NCOLORS): ycent = B_WIDTH // 2 pos = [[0] * NROWS for col in range(NCOLS)] colors = [[0] * NROWS for col in range(NCOLS)] # store cell centers coordinates and colors, columnwise for row in range(NCOLS): xcent = -B_WIDTH // 2 for col in range(NROWS): xcent += B_WIDTH pos[row][col] = (ycent,xcent) colors[row][col] = int(random(1, ncolors + 1)) ycent += B_WIDTH if not colors_only: return pos, colors return colors class SameGame: def __init__(self,nr=NROWS, nc=NCOLS, ncolors=NCOLORS, colors=None, pos=None, score=0, score_diff=0, empty_cols = None, to_fill=None,score_corr=0): self.nr = nr self.nc = nc self.ncolors = ncolors self.to_fill = set() self.score = score self.score_diff = score_diff self.score_corr = score_corr self.empty_cols = [] self.pos, self.colors = cells(ncolors=ncolors) def plotBoard(self): for row in range(NROWS): for col in range(NCOLS): xc, yc = self.pos[col][row] fill(cell_colors[self.colors[col][row]]) rect(xc,yc,B_WIDTH,B_WIDTH) fill(255) textSize(20) textAlign(LEFT) text("Score: %d" %self.score, C_WIDTH-140, C_HEIGHT - 6) if self.endGame(): if not self.score_corr: self.score_correction_by_colors() self.score_corr = True self.compactLeft() textSize(36) textAlign(CENTER) text("End of Game",C_WIDTH // 2, C_HEIGHT // 2 - 10) def neighbours(self,i,j): possible = [(i-1,j),(i+1,j),(i,j-1),(i,j+1)] return [p for p in possible if (0 <= p[0] < self.nc) and (0 <= p[1] < self.nr)] def alone(self,i,j): # i -column, j - row color = self.colors[i][j] res = True if color == 0: return res for k,l in self.neighbours(i,j): if self.colors[k][l] == color: res = False break return res def floodfill(self, x, y): value = self.colors[x][y] edge = [(x,y)] self.to_fill = set([x]) self.colors[x][y] = 0 self.score_diff = 1 while edge: newedge = [] for (x,y) in edge: for s,t in self.neighbours(x,y): if self.colors[s][t] == value: self.to_fill.add(s) self.colors[s][t] = 0 self.score_diff += 1 newedge.append((s, t)) edge = newedge def fall_column(self,col): if sum(self.colors[col]) == 0: self.empty_cols.append(col) return colored = [] for row in range(self.nr): cc = self.colors[col][row] if cc: colored.append(cc) lc = len(colored) new_col = [0] *(self.nr - lc) + colored self.colors[col] = new_col def compactLeft(self): if self.empty_cols == []: return for c in sorted(self.empty_cols,reverse=True): for cindex in range(c,self.nc-1): self.colors[cindex] = self.colors[cindex + 1] self.colors[self.nc-1] = [0] * self.nr self.empty_cols = [] def fall_all(self): if self.to_fill == []: self.score_diff = 0 return for col in self.to_fill: self.fall_column(col) self.compactLeft() nscore = self.score_diff - 1 self.score += (nscore * nscore) self.score_diff = 0 def endGame(self): return sum([self.alone(i,j) for i in range(self.nc) for j in range(self.nr)]) == self.nr * self.nc def score_correction(self): rem = sum(bool(self.colors[c][r]) for c in range(self.nc) for r in range(self.nr)) if rem == 0: self.score += 1000 else: self.score -= (rem-1)*(rem-1) self.score = max(0,self.score) def score_correction_by_colors(self): crange = range(1,self.ncolors + 1) rest = {c:0 for c in crange} for col in range(self.nc): for row in range(self.nr): color = self.colors[col][row] if color: rest[color] += 1 rem = 0 for c in crange: ncells = rest[c] if ncells: rem += (ncells - 1) * (ncells - 1) if sum(rest.values()) == 0: self.score += 1000 else: self.score -= rem ================================================ FILE: docs/examples/pyodide/samegame/static/p5.js ================================================ /*! p5.js v1.0.0 February 29, 2020 */ !function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).p5=e()}}(function(){return function o(a,s,l){function u(t,e){if(!s[t]){if(!a[t]){var r="function"==typeof require&&require;if(!e&&r)return r(t,!0);if(h)return h(t,!0);var i=new Error("Cannot find module '"+t+"'");throw i.code="MODULE_NOT_FOUND",i}var n=s[t]={exports:{}};a[t][0].call(n.exports,function(e){return u(a[t][1][e]||e)},n,n.exports,o,a,s,l)}return s[t].exports}for(var h="function"==typeof require&&require,e=0;e>16&255,a[s++]=t>>8&255,a[s++]=255&t;2===o&&(t=u[e.charCodeAt(r)]<<2|u[e.charCodeAt(r+1)]>>4,a[s++]=255&t);1===o&&(t=u[e.charCodeAt(r)]<<10|u[e.charCodeAt(r+1)]<<4|u[e.charCodeAt(r+2)]>>2,a[s++]=t>>8&255,a[s++]=255&t);return a},r.fromByteArray=function(e){for(var t,r=e.length,i=r%3,n=[],o=0,a=r-i;o>2]+s[t<<4&63]+"==")):2==i&&(t=(e[r-2]<<8)+e[r-1],n.push(s[t>>10]+s[t>>4&63]+s[t<<2&63]+"="));return n.join("")};for(var s=[],u=[],h="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=0,o=i.length;n>18&63]+s[n>>12&63]+s[n>>6&63]+s[63&n]);return o.join("")}u["-".charCodeAt(0)]=62,u["_".charCodeAt(0)]=63},{}],20:[function(e,t,r){},{}],21:[function(N,e,F){(function(c){"use strict";var i=N("base64-js"),o=N("ieee754"),e="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;F.Buffer=c,F.SlowBuffer=function(e){+e!=e&&(e=0);return c.alloc(+e)},F.INSPECT_MAX_BYTES=50;var r=2147483647;function a(e){if(r>>1;case"base64":return O(e).length;default:if(n)return i?-1:R(e).length;t=(""+t).toLowerCase(),n=!0}}function d(e,t,r){var i=e[t];e[t]=e[r],e[r]=i}function p(e,t,r,i,n){if(0===e.length)return-1;if("string"==typeof r?(i=r,r=0):2147483647=e.length){if(n)return-1;r=e.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof t&&(t=c.from(t,i)),c.isBuffer(t))return 0===t.length?-1:m(e,t,r,i,n);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):m(e,[t],r,i,n);throw new TypeError("val must be string, number or Buffer")}function m(e,t,r,i,n){var o,a=1,s=e.length,l=t.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(e.length<2||t.length<2)return-1;s/=a=2,l/=2,r/=2}function u(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(n){var h=-1;for(o=r;o>8,n=r%256,o.push(n),o.push(i);return o}(t,e.length-r),e,r,i)}function b(e,t,r){return 0===t&&r===e.length?i.fromByteArray(e):i.fromByteArray(e.slice(t,r))}function _(e,t,r){r=Math.min(e.length,r);for(var i=[],n=t;n>>10&1023|55296),h=56320|1023&h),i.push(h),n+=c}return function(e){var t=e.length;if(t<=x)return String.fromCharCode.apply(String,e);var r="",i=0;for(;ithis.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e=e||"utf8";;)switch(e){case"hex":return M(this,t,r);case"utf8":case"utf-8":return _(this,t,r);case"ascii":return w(this,t,r);case"latin1":case"binary":return S(this,t,r);case"base64":return b(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,t,r);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}.apply(this,arguments)},c.prototype.equals=function(e){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===c.compare(this,e)},c.prototype.inspect=function(){var e="",t=F.INSPECT_MAX_BYTES;return e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(e+=" ... "),""},e&&(c.prototype[e]=c.prototype.inspect),c.prototype.compare=function(e,t,r,i,n){if(A(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),t<0||r>e.length||i<0||n>this.length)throw new RangeError("out of range index");if(n<=i&&r<=t)return 0;if(n<=i)return-1;if(r<=t)return 1;if(this===e)return 0;for(var o=(n>>>=0)-(i>>>=0),a=(r>>>=0)-(t>>>=0),s=Math.min(o,a),l=this.slice(i,n),u=e.slice(t,r),h=0;h>>=0,isFinite(r)?(r>>>=0,void 0===i&&(i="utf8")):(i=r,r=void 0)}var n=this.length-t;if((void 0===r||nthis.length)throw new RangeError("Attempt to write outside buffer bounds");i=i||"utf8";for(var o,a,s,l,u,h,c=!1;;)switch(i){case"hex":return g(this,e,t,r);case"utf8":case"utf-8":return u=t,h=r,D(R(e,(l=this).length-u),l,u,h);case"ascii":return v(this,e,t,r);case"latin1":case"binary":return v(this,e,t,r);case"base64":return o=this,a=t,s=r,D(O(e),o,a,s);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return y(this,e,t,r);default:if(c)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),c=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var x=4096;function w(e,t,r){var i="";r=Math.min(e.length,r);for(var n=t;ne.length)throw new RangeError("Index out of range")}function P(e,t,r,i){if(r+i>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function L(e,t,r,i,n){return t=+t,r>>>=0,n||P(e,0,r,4),o.write(e,t,r,i,23,4),r+4}function k(e,t,r,i,n){return t=+t,r>>>=0,n||P(e,0,r,8),o.write(e,t,r,i,52,8),r+8}c.prototype.slice=function(e,t){var r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):r>>=0,t>>>=0,r||T(e,t,this.length);for(var i=this[e],n=1,o=0;++o>>=0,t>>>=0,r||T(e,t,this.length);for(var i=this[e+--t],n=1;0>>=0,t||T(e,1,this.length),this[e]},c.prototype.readUInt16LE=function(e,t){return e>>>=0,t||T(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUInt16BE=function(e,t){return e>>>=0,t||T(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUInt32LE=function(e,t){return e>>>=0,t||T(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUInt32BE=function(e,t){return e>>>=0,t||T(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||T(e,t,this.length);for(var i=this[e],n=1,o=0;++o>>=0,t>>>=0,r||T(e,t,this.length);for(var i=t,n=1,o=this[e+--i];0>>=0,t||T(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){e>>>=0,t||T(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(e,t){e>>>=0,t||T(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(e,t){return e>>>=0,t||T(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return e>>>=0,t||T(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readFloatLE=function(e,t){return e>>>=0,t||T(e,4,this.length),o.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return e>>>=0,t||T(e,4,this.length),o.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return e>>>=0,t||T(e,8,this.length),o.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return e>>>=0,t||T(e,8,this.length),o.read(this,e,!1,52,8)},c.prototype.writeUIntLE=function(e,t,r,i){e=+e,t>>>=0,r>>>=0,i||C(this,e,t,r,Math.pow(2,8*r)-1,0);var n=1,o=0;for(this[t]=255&e;++o>>=0,r>>>=0,i||C(this,e,t,r,Math.pow(2,8*r)-1,0);var n=r-1,o=1;for(this[t+n]=255&e;0<=--n&&(o*=256);)this[t+n]=e/o&255;return t+r},c.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,1,255,0),this[t]=255&e,t+1},c.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},c.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeIntLE=function(e,t,r,i){if(e=+e,t>>>=0,!i){var n=Math.pow(2,8*r-1);C(this,e,t,r,n-1,-n)}var o=0,a=1,s=0;for(this[t]=255&e;++o>0)-s&255;return t+r},c.prototype.writeIntBE=function(e,t,r,i){if(e=+e,t>>>=0,!i){var n=Math.pow(2,8*r-1);C(this,e,t,r,n-1,-n)}var o=r-1,a=1,s=0;for(this[t+o]=255&e;0<=--o&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+r},c.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},c.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeFloatLE=function(e,t,r){return L(this,e,t,!0,r)},c.prototype.writeFloatBE=function(e,t,r){return L(this,e,t,!1,r)},c.prototype.writeDoubleLE=function(e,t,r){return k(this,e,t,!0,r)},c.prototype.writeDoubleBE=function(e,t,r){return k(this,e,t,!1,r)},c.prototype.copy=function(e,t,r,i){if(!c.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r=r||0,i||0===i||(i=this.length),t>=e.length&&(t=e.length),t=t||0,0=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t>>=0,r=void 0===r?this.length:r>>>0,"number"==typeof(e=e||0))for(o=t;o>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function O(e){return i.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(t,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function D(e,t,r,i){for(var n=0;n=t.length||n>=e.length);++n)t[n+r]=e[n];return n}function A(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function I(e){return e!=e}var U=function(){for(var e="0123456789abcdef",t=new Array(256),r=0;r<16;++r)for(var i=16*r,n=0;n<16;++n)t[i+n]=e[r]+e[n];return t}()}).call(this,N("buffer").Buffer)},{"base64-js":19,buffer:21,ieee754:30}],22:[function(e,t,r){"use strict";t.exports=e("./").polyfill()},{"./":23}],23:[function(z,r,i){(function(j,V){var e,t;e=this,t=function(){"use strict";function l(e){return"function"==typeof e}var r=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},i=0,t=void 0,n=void 0,a=function(e,t){f[i]=e,f[i+1]=t,2===(i+=2)&&(n?n(d):y())};var e="undefined"!=typeof window?window:void 0,o=e||{},s=o.MutationObserver||o.WebKitMutationObserver,u="undefined"==typeof self&&void 0!==j&&"[object process]"==={}.toString.call(j),h="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function c(){var e=setTimeout;return function(){return e(d,1)}}var f=new Array(1e3);function d(){for(var e=0;e":">",'"':""","'":"'","/":"/"};function S(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,function(e){return w[e]}):e}var M=function(){function i(e){var t,r=1=this.maxReplaces)break}for(a=0;r=this.regexp.exec(e);){if(void 0===(i=h(r[1].trim())))if("function"==typeof c){var d=c(e,r,t);i="string"==typeof d?d:""}else this.logger.warn("missed to pass in variable ".concat(r[1]," for interpolating ").concat(e)),i="";else"string"==typeof i||this.useRawValueToEscape||(i=v(i));if(i=this.escapeValue?u(this.escape(i)):u(i),e=e.replace(r[0],i),this.regexp.lastIndex=0,++a>=this.maxReplaces)break}return e}},{key:"nest",value:function(e,t,r){var i,n,o=D({},2>1,h=-7,c=r?n-1:0,f=r?-1:1,d=e[t+c];for(c+=f,o=d&(1<<-h)-1,d>>=-h,h+=s;0>=-h,h+=i;0>1,f=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,d=i?0:o-1,p=i?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=h):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),2<=(t+=1<=a+c?f/l:f*Math.pow(2,1-c))*l&&(a++,l/=2),h<=a+c?(s=0,a=h):1<=a+c?(s=(t*l-1)*Math.pow(2,n),a+=c):(s=t*Math.pow(2,c-1)*Math.pow(2,n),a=0));8<=n;e[r+d]=255&s,d+=p,s/=256,n-=8);for(a=a<Math.abs(e[0])&&(t=1),Math.abs(e[2])>Math.abs(e[t])&&(t=2),t}var C=4e150;function P(e,t){e.f+=t.f,e.b.f+=t.b.f}function u(e,t,r){return e=e.a,t=t.a,r=r.a,t.b.a===e?r.b.a===e?v(t.a,r.a)?b(r.b.a,t.a,r.a)<=0:0<=b(t.b.a,r.a,t.a):b(r.b.a,e,r.a)<=0:r.b.a===e?0<=b(t.b.a,e,t.a):(t=y(t.b.a,e,t.a),(e=y(r.b.a,e,r.a))<=t)}function L(e){e.a.i=null;var t=e.e;t.a.c=t.c,t.c.a=t.a,e.e=null}function h(e,t){c(e.a),e.c=!1,(e.a=t).i=e}function k(e){for(var t=e.a.a;(e=fe(e)).a.a===t;);return e.c&&(h(e,t=f(ce(e).a.b,e.a.e)),e=fe(e)),e}function R(e,t,r){var i=new he;return i.a=r,i.e=W(e.f,t.e,i),r.i=i}function O(e,t){switch(e.s){case 100130:return 0!=(1&t);case 100131:return 0!==t;case 100132:return 0>1]],s[a[u]])?le(r,u):ue(r,u)),s[o]=null,l[o]=r.b,r.b=o}else for(r.c[-(o+1)]=null;0Math.max(a.a,l.a))return!1;if(v(o,a)){if(0i.f&&(i.f*=2,i.c=oe(i.c,i.f+1)),0===i.b?r=n:(r=i.b,i.b=i.c[i.b]),i.e[r]=t,i.c[r]=n,i.d[n]=r,i.h&&ue(i,n),r}return i=e.a++,e.c[i]=t,-(i+1)}function ie(e){if(0===e.a)return se(e.b);var t=e.c[e.d[e.a-1]];if(0!==e.b.a&&v(ae(e.b),t))return se(e.b);for(;--e.a,0e.a||v(i[a],i[l])){n[r[o]=a]=o;break}n[r[o]=l]=o,o=s}}function ue(e,t){for(var r=e.d,i=e.e,n=e.c,o=t,a=r[o];;){var s=o>>1,l=r[s];if(0==s||v(i[l],i[a])){n[r[o]=a]=o;break}n[r[o]=l]=o,o=s}}function he(){this.e=this.a=null,this.f=0,this.c=this.b=this.h=this.d=!1}function ce(e){return e.e.c.b}function fe(e){return e.e.a.b}(i=q.prototype).x=function(){Y(this,0)},i.B=function(e,t){switch(e){case 100142:return;case 100140:switch(t){case 100130:case 100131:case 100132:case 100133:case 100134:return void(this.s=t)}break;case 100141:return void(this.m=!!t);default:return void Z(this,100900)}Z(this,100901)},i.y=function(e){switch(e){case 100142:return 0;case 100140:return this.s;case 100141:return this.m;default:Z(this,100900)}return!1},i.A=function(e,t,r){this.j[0]=e,this.j[1]=t,this.j[2]=r},i.z=function(e,t){var r=t||null;switch(e){case 100100:case 100106:this.h=r;break;case 100104:case 100110:this.l=r;break;case 100101:case 100107:this.k=r;break;case 100102:case 100108:this.i=r;break;case 100103:case 100109:this.p=r;break;case 100105:case 100111:this.o=r;break;case 100112:this.r=r;break;default:Z(this,100900)}},i.C=function(e,t){var r=!1,i=[0,0,0];Y(this,2);for(var n=0;n<3;++n){var o=e[n];o<-1e150&&(o=-1e150,r=!0),1e150n[u]&&(n[u]=h,a[u]=l)}if(l=0,n[1]-o[1]>n[0]-o[0]&&(l=1),n[2]-o[2]>n[l]-o[l]&&(l=2),o[l]>=n[l])i[0]=0,i[1]=0,i[2]=1;else{for(n=0,o=s[l],a=a[l],s=[0,0,0],o=[o.g[0]-a.g[0],o.g[1]-a.g[1],o.g[2]-a.g[2]],u=[0,0,0],l=r.e;l!==r;l=l.e)u[0]=l.g[0]-a.g[0],u[1]=l.g[1]-a.g[1],u[2]=l.g[2]-a.g[2],s[0]=o[1]*u[2]-o[2]*u[1],s[1]=o[2]*u[0]-o[0]*u[2],s[2]=o[0]*u[1]-o[1]*u[0],n<(h=s[0]*s[0]+s[1]*s[1]+s[2]*s[2])&&(n=h,i[0]=s[0],i[1]=s[1],i[2]=s[2]);n<=0&&(i[0]=i[1]=i[2]=0,i[T(o)]=1)}r=!0}for(s=T(i),l=this.b.c,n=(s+1)%3,a=(s+2)%3,s=0>=l,h-=l,g!=o){if(g==a)break;for(var v=g>8,++y;var _=b;if(i>=8;null!==m&&s<4096&&(p[s++]=m<<8|_,u+1<=s&&l<12&&(++l,u=u<<1|1)),m=g}else s=1+a,u=(1<<(l=n+1))-1,m=null}return f!==i&&console.log("Warning, gif stream shorter than expected."),r}try{r.GifWriter=function(v,e,t,r){var y=0,i=void 0===(r=void 0===r?{}:r).loop?null:r.loop,b=void 0===r.palette?null:r.palette;if(e<=0||t<=0||65535>=1;)++n;if(a=1<>8&255,v[y++]=255&t,v[y++]=t>>8&255,v[y++]=(null!==b?128:0)|n,v[y++]=o,v[y++]=0,null!==b)for(var s=0,l=b.length;s>16&255,v[y++]=u>>8&255,v[y++]=255&u}if(null!==i){if(i<0||65535>8&255,v[y++]=0}var x=!1;this.addFrame=function(e,t,r,i,n,o){if(!0===x&&(--y,x=!1),o=void 0===o?{}:o,e<0||t<0||65535>=1;)++u;l=1<>8&255,v[y++]=d,v[y++]=0),v[y++]=44,v[y++]=255&e,v[y++]=e>>8&255,v[y++]=255&t,v[y++]=t>>8&255,v[y++]=255&r,v[y++]=r>>8&255,v[y++]=255&i,v[y++]=i>>8&255,v[y++]=!0===a?128|u-1:0,!0===a)for(var p=0,m=s.length;p>16&255,v[y++]=g>>8&255,v[y++]=255&g}return y=function(t,r,e,i){t[r++]=e;var n=r++,o=1<>=8,h-=8,r===n+256&&(t[n]=255,n=r++)}function d(e){c|=e<>=8,h-=8,r===n+256&&(t[n]=255,n=r++);4096===l?(d(o),l=1+s,u=e+1,m={}):(1<>7,n=1<<1+(7&r);x[e++],x[e++];var o=null,a=null;i&&(o=e,e+=3*(a=n));var s=!0,l=[],u=0,h=null,c=0,f=null;for(this.width=w,this.height=t;s&&e>2&7,e++;break;case 254:for(;;){if(!(0<=(C=x[e++])))throw Error("Invalid block size");if(0===C)break;e+=C}break;default:throw new Error("Unknown graphic control label: 0x"+x[e-1].toString(16))}break;case 44:var p=x[e++]|x[e++]<<8,m=x[e++]|x[e++]<<8,g=x[e++]|x[e++]<<8,v=x[e++]|x[e++]<<8,y=x[e++],b=y>>6&1,_=1<<1+(7&y),S=o,M=a,E=!1;if(y>>7){E=!0;S=e,e+=3*(M=_)}var T=e;for(e++;;){var C;if(!(0<=(C=x[e++])))throw Error("Invalid block size");if(0===C)break;e+=C}l.push({x:p,y:m,width:g,height:v,has_local_palette:E,palette_offset:S,palette_size:M,data_offset:T,data_length:e-T,transparent_index:h,interlaced:!!b,delay:u,disposal:c});break;case 59:s=!1;break;default:throw new Error("Unknown gif block: 0x"+x[e-1].toString(16))}this.numFrames=function(){return l.length},this.loopCount=function(){return f},this.frameInfo=function(e){if(e<0||e>=l.length)throw new Error("Frame index out of range.");return l[e]},this.decodeAndBlitFrameBGRA=function(e,t){var r=this.frameInfo(e),i=r.width*r.height,n=new Uint8Array(i);P(x,r.data_offset,n,i);var o=r.palette_offset,a=r.transparent_index;null===a&&(a=256);var s=r.width,l=w-s,u=s,h=4*(r.y*w+r.x),c=4*((r.y+r.height)*w+r.x),f=h,d=4*l;!0===r.interlaced&&(d+=4*w*7);for(var p=8,m=0,g=n.length;m>=1)),v===a)f+=4;else{var y=x[o+3*v],b=x[o+3*v+1],_=x[o+3*v+2];t[f++]=_,t[f++]=b,t[f++]=y,t[f++]=255}--u}},this.decodeAndBlitFrameRGBA=function(e,t){var r=this.frameInfo(e),i=r.width*r.height,n=new Uint8Array(i);P(x,r.data_offset,n,i);var o=r.palette_offset,a=r.transparent_index;null===a&&(a=256);var s=r.width,l=w-s,u=s,h=4*(r.y*w+r.x),c=4*((r.y+r.height)*w+r.x),f=h,d=4*l;!0===r.interlaced&&(d+=4*w*7);for(var p=8,m=0,g=n.length;m>=1)),v===a)f+=4;else{var y=x[o+3*v],b=x[o+3*v+1],_=x[o+3*v+2];t[f++]=y,t[f++]=b,t[f++]=_,t[f++]=255}--u}}}}catch(e){}},{}],33:[function(jr,t,r){(function(Gr){var e;e=this,function(E){"use strict";function e(e){if(null==this)throw TypeError();var t=String(this),r=t.length,i=e?Number(e):0;if(i!=i&&(i=0),!(i<0||r<=i)){var n,o=t.charCodeAt(i);return 55296<=o&&o<=56319&&i+1>>=1,t}function _(e,t,r){if(!t)return r;for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<>>16-t;return e.tag>>>=t,e.bitcount-=t,i+r}function x(e,t){for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<>>=1,++n,r+=t.table[n],0<=(i-=t.table[n]););return e.tag=o,e.bitcount-=n,t.trans[r+i]}function w(e,t,r){var i,n,o,a,s,l;for(i=_(e,5,257),n=_(e,5,1),o=_(e,4,4),a=0;a<19;++a)g[a]=0;for(a=0;athis.x2&&(this.x2=e)),"number"==typeof t&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=t,this.y2=t),tthis.y2&&(this.y2=t))},C.prototype.addX=function(e){this.addPoint(e,null)},C.prototype.addY=function(e){this.addPoint(null,e)},C.prototype.addBezier=function(e,t,r,i,n,o,a,s){var l=this,u=[e,t],h=[r,i],c=[n,o],f=[a,s];this.addPoint(e,t),this.addPoint(a,s);for(var d=0;d<=1;d++){var p=6*u[d]-12*h[d]+6*c[d],m=-3*u[d]+9*h[d]-9*c[d]+3*f[d],g=3*h[d]-3*u[d];if(0!=m){var v=Math.pow(p,2)-4*g*m;if(!(v<0)){var y=(-p+Math.sqrt(v))/(2*m);0>8&255,255&e]},A.USHORT=U(2),D.SHORT=function(e){return 32768<=e&&(e=-(65536-e)),[e>>8&255,255&e]},A.SHORT=U(2),D.UINT24=function(e){return[e>>16&255,e>>8&255,255&e]},A.UINT24=U(3),D.ULONG=function(e){return[e>>24&255,e>>16&255,e>>8&255,255&e]},A.ULONG=U(4),D.LONG=function(e){return R<=e&&(e=-(2*R-e)),[e>>24&255,e>>16&255,e>>8&255,255&e]},A.LONG=U(4),D.FIXED=D.ULONG,A.FIXED=A.ULONG,D.FWORD=D.SHORT,A.FWORD=A.SHORT,D.UFWORD=D.USHORT,A.UFWORD=A.USHORT,D.LONGDATETIME=function(e){return[0,0,0,0,e>>24&255,e>>16&255,e>>8&255,255&e]},A.LONGDATETIME=U(8),D.TAG=function(e){return k.argument(4===e.length,"Tag should be exactly 4 ASCII characters."),[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]},A.TAG=U(4),D.Card8=D.BYTE,A.Card8=A.BYTE,D.Card16=D.USHORT,A.Card16=A.USHORT,D.OffSize=D.BYTE,A.OffSize=A.BYTE,D.SID=D.USHORT,A.SID=A.USHORT,D.NUMBER=function(e){return-107<=e&&e<=107?[e+139]:108<=e&&e<=1131?[247+((e-=108)>>8),255&e]:-1131<=e&&e<=-108?[251+((e=-e-108)>>8),255&e]:-32768<=e&&e<=32767?D.NUMBER16(e):D.NUMBER32(e)},A.NUMBER=function(e){return D.NUMBER(e).length},D.NUMBER16=function(e){return[28,e>>8&255,255&e]},A.NUMBER16=U(3),D.NUMBER32=function(e){return[29,e>>24&255,e>>16&255,e>>8&255,255&e]},A.NUMBER32=U(5),D.REAL=function(e){var t=e.toString(),r=/\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec(t);if(r){var i=parseFloat("1e"+((r[2]?+r[2]:0)+r[1].length));t=(Math.round(e*i)/i).toString()}for(var n="",o=0,a=t.length;o>8&255,t[t.length]=255&i}return t},A.UTF16=function(e){return 2*e.length};var N={"x-mac-croatian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈ƫȅ ÀÃÕŒœĐ—“”‘’÷◊©⁄€‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ","x-mac-cyrillic":"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю","x-mac-gaelic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØḂ±≤≥ḃĊċḊḋḞḟĠġṀæøṁṖṗɼƒſṠ«»… ÀÃÕŒœ–—“”‘’ṡẛÿŸṪ€‹›Ŷŷṫ·Ỳỳ⁊ÂÊÁËÈÍÎÏÌÓÔ♣ÒÚÛÙıÝýŴŵẄẅẀẁẂẃ","x-mac-greek":"Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦€ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ­","x-mac-icelandic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüݰ¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-inuit":"ᐃᐄᐅᐆᐊᐋᐱᐲᐳᐴᐸᐹᑉᑎᑏᑐᑑᑕᑖᑦᑭᑮᑯᑰᑲᑳᒃᒋᒌᒍᒎᒐᒑ°ᒡᒥᒦ•¶ᒧ®©™ᒨᒪᒫᒻᓂᓃᓄᓅᓇᓈᓐᓯᓰᓱᓲᓴᓵᔅᓕᓖᓗᓘᓚᓛᓪᔨᔩᔪᔫᔭ… ᔮᔾᕕᕖᕗ–—“”‘’ᕘᕙᕚᕝᕆᕇᕈᕉᕋᕌᕐᕿᖀᖁᖂᖃᖄᖅᖏᖐᖑᖒᖓᖔᖕᙱᙲᙳᙴᙵᙶᖖᖠᖡᖢᖣᖤᖥᖦᕼŁł","x-mac-ce":"ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ",macintosh:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-romanian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂȘ∞±≤≥¥µ∂∑∏π∫ªºΩăș¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›Țț‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-turkish":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙˆ˜¯˘˙˚¸˝˛ˇ"};O.MACSTRING=function(e,t,r,i){var n=N[i];if(void 0!==n){for(var o="",a=0;a>8&255,l+256&255)}return o}D.MACSTRING=function(e,t){var r=function(e){if(!F)for(var t in F={},N)F[t]=new String(t);var r=F[e];if(void 0!==r){if(B){var i=B.get(r);if(void 0!==i)return i}var n=N[e];if(void 0!==n){for(var o={},a=0;a>8,t[c+1]=255&f,t=t.concat(i[h])}return t},A.TABLE=function(e){for(var t=0,r=e.fields.length,i=0;i>1,t.skip("uShort",3),e.glyphIndexMap={};for(var a=new se.Parser(r,i+n+14),s=new se.Parser(r,i+n+16+2*o),l=new se.Parser(r,i+n+16+4*o),u=new se.Parser(r,i+n+16+6*o),h=i+n+16+8*o,c=0;c>4,o=15&i;if(15==n)break;if(t+=r[n],15==o)break;t+=r[o]}return parseFloat(t)}(e);if(32<=t&&t<=246)return t-139;if(247<=t&&t<=250)return 256*(t-247)+e.parseByte()+108;if(251<=t&&t<=254)return 256*-(t-251)-e.parseByte()-108;throw new Error("Invalid b0 "+t)}function Te(e,t,r){t=void 0!==t?t:0;var i=new se.Parser(e,t),n=[],o=[];for(r=void 0!==r?r:e.length;i.relativeOffset>1,T.length=0,P=!0}return function e(t){for(var r,i,n,o,a,s,l,u,h,c,f,d,p=0;pMath.abs(d-R)?k=f+T.shift():R=d+T.shift(),E.curveTo(y,b,_,x,l,u),E.curveTo(h,c,f,d,k,R);break;default:console.log("Glyph "+v.index+": unknown operator 1200"+m),T.length=0}break;case 14:0>3;break;case 21:2>16),p+=2;break;case 29:a=T.pop()+g.gsubrsBias,(s=g.gsubrs[a])&&e(s);break;case 30:for(;0=r.begin&&e=fe.length){var a=i.parseChar();r.names.push(i.parseString(a))}break;case 2.5:r.numberOfGlyphs=i.parseUShort(),r.offset=new Array(r.numberOfGlyphs);for(var s=0;st.value.tag?1:-1}),t.fields=t.fields.concat(i),t.fields=t.fields.concat(n),t}function gt(e,t,r){for(var i=0;i 123 are reserved for internal usage");d|=1<>>1,o=e[n].tag;if(o===t)return n;o>>1,o=e[n];if(o===t)return n;o>>1,a=(r=e[o]).start;if(a===t)return r;a(r=e[i-1]).end?0:r}function xt(e,t){this.font=e,this.tableName=t}function wt(e){xt.call(this,e,"gpos")}function St(e){xt.call(this,e,"gsub")}function Mt(e,t){var r=e.length;if(r!==t.length)return!1;for(var i=0;it.points.length-1||i.matchedPoints[1]>n.points.length-1)throw Error("Matched points out of range in "+t.name);var a=t.points[i.matchedPoints[0]],s=n.points[i.matchedPoints[1]],l={xScale:i.xScale,scale01:i.scale01,scale10:i.scale10,yScale:i.yScale,dx:0,dy:0};s=kt([s],l)[0],l.dx=a.x-s.x,l.dy=a.y-s.y,o=kt(n.points,l)}t.points=t.points.concat(o)}}return Rt(t.points)}(wt.prototype=xt.prototype={searchTag:yt,binSearch:bt,getTable:function(e){var t=this.font.tables[this.tableName];return!t&&e&&(t=this.font.tables[this.tableName]=this.createDefaultTable()),t},getScriptNames:function(){var e=this.getTable();return e?e.scripts.map(function(e){return e.tag}):[]},getDefaultScriptName:function(){var e=this.getTable();if(e){for(var t=!1,r=0;r=s[u-1].tag,"Features must be added in alphabetical order."),o={tag:r,feature:{params:0,lookupListIndexes:[]}},s.push(o),a.push(u),o.feature}}},getLookupTables:function(e,t,r,i,n){var o=this.getFeatureTable(e,t,r,n),a=[];if(o){for(var s,l=o.lookupListIndexes,u=this.font.tables[this.tableName].lookups,h=0;h",s),t.stack.push(Math.round(64*s))}function vr(e,t){var r=t.stack,i=r.pop(),n=t.fv,o=t.pv,a=t.ppem,s=t.deltaBase+16*(e-1),l=t.deltaShift,u=t.z0;E.DEBUG&&console.log(t.step,"DELTAP["+e+"]",i,r);for(var h=0;h>4)===a){var d=(15&f)-8;0<=d&&d++,E.DEBUG&&console.log(t.step,"DELTAPFIX",c,"by",d*l);var p=u[c];n.setRelative(p,p,d*l,o)}}}function yr(e,t){var r=t.stack,i=r.pop();E.DEBUG&&console.log(t.step,"ROUND[]"),r.push(64*t.round(i/64))}function br(e,t){var r=t.stack,i=r.pop(),n=t.ppem,o=t.deltaBase+16*(e-1),a=t.deltaShift;E.DEBUG&&console.log(t.step,"DELTAC["+e+"]",i,r);for(var s=0;s>4)===n){var h=(15&u)-8;0<=h&&h++;var c=h*a;E.DEBUG&&console.log(t.step,"DELTACFIX",l,"by",c),t.cvt[l]+=c}}}function _r(e,t){var r,i,n=t.stack,o=n.pop(),a=n.pop(),s=t.z2[o],l=t.z1[a];E.DEBUG&&console.log(t.step,"SDPVTL["+e+"]",o,a),i=e?(r=s.y-l.y,l.x-s.x):(r=l.x-s.x,l.y-s.y),t.dpv=Zt(r,i)}function xr(e,t){var r=t.stack,i=t.prog,n=t.ip;E.DEBUG&&console.log(t.step,"PUSHB["+e+"]");for(var o=0;o":"_")+(i?"R":"_")+(0===n?"Gr":1===n?"Bl":2===n?"Wh":"")+"]",e?c+"("+o.cvt[c]+","+u+")":"",f,"(d =",a,"->",l*s,")"),o.rp1=o.rp0,o.rp2=f,t&&(o.rp0=f)}Ft.prototype.exec=function(e,t){if("number"!=typeof t)throw new Error("Point size is not a number!");if(!(2",i),s.interpolate(c,o,a,l),s.touch(c)}e.loop=1},dr.bind(void 0,0),dr.bind(void 0,1),function(e){for(var t=e.stack,r=e.rp0,i=e.z0[r],n=e.loop,o=e.fv,a=e.pv,s=e.z1;n--;){var l=t.pop(),u=s[l];E.DEBUG&&console.log(e.step,(1=a.width||t>=a.height?[0,0,0,0]:this._getPixel(e,t);var s=new l.default.Image(r,i);return s.canvas.getContext("2d").drawImage(a,e,t,r*o,i*o,0,0,r,i),s},l.default.Renderer.prototype.textLeading=function(e){return"number"==typeof e?(this._setProperty("_textLeading",e),this._pInst):this._textLeading},l.default.Renderer.prototype.textSize=function(e){return"number"==typeof e?(this._setProperty("_textSize",e),this._setProperty("_textLeading",e*y._DEFAULT_LEADMULT),this._applyTextProperties()):this._textSize},l.default.Renderer.prototype.textStyle=function(e){return e?(e!==y.NORMAL&&e!==y.ITALIC&&e!==y.BOLD&&e!==y.BOLDITALIC||this._setProperty("_textStyle",e),this._applyTextProperties()):this._textStyle},l.default.Renderer.prototype.textAscent=function(){return null===this._textAscent&&this._updateTextMetrics(),this._textAscent},l.default.Renderer.prototype.textDescent=function(){return null===this._textDescent&&this._updateTextMetrics(),this._textDescent},l.default.Renderer.prototype.textAlign=function(e,t){return void 0!==e?(this._setProperty("_textAlign",e),void 0!==t&&this._setProperty("_textBaseline",t),this._applyTextProperties()):{horizontal:this._textAlign,vertical:this._textBaseline}},l.default.Renderer.prototype.text=function(e,t,r,i,n){var o,a,s,l,u,h,c,f,d=this._pInst,p=Number.MAX_VALUE;if((this._doFill||this._doStroke)&&void 0!==e){if("string"!=typeof e&&(e=e.toString()),o=(e=e.replace(/(\t)/g," ")).split("\n"),void 0!==i){for(s=f=0;ss.HALF_PI&&e<=3*s.HALF_PI?Math.atan(r/i*Math.tan(e))+s.PI:Math.atan(r/i*Math.tan(e))+s.TWO_PI,t=t<=s.HALF_PI?Math.atan(r/i*Math.tan(t)):t>s.HALF_PI&&t<=3*s.HALF_PI?Math.atan(r/i*Math.tan(t))+s.PI:Math.atan(r/i*Math.tan(t))+s.TWO_PI),tv||Math.abs(this.accelerationY-this.pAccelerationY)>v||Math.abs(this.accelerationZ-this.pAccelerationZ)>v)&&e();var t=this.deviceTurned||window.deviceTurned;if("function"==typeof t){var r=this.rotationX+180,i=this.pRotationX+180,n=c+180;0>>24],i+=x[(16711680&C)>>16],n+=x[(65280&C)>>8],o+=x[255&C],r+=k[_],s++}w[l=T+y]=a/r,S[l]=i/r,M[l]=n/r,E[l]=o/r}T+=d}for(h=(u=-P)*d,b=T=0;b>>16,e[r+1]=(65280&t[i])>>>8,e[r+2]=255&t[i],e[r+3]=(4278190080&t[i])>>>24},O._toImageData=function(e){return e instanceof ImageData?e:e.getContext("2d").getImageData(0,0,e.width,e.height)},O._createImageData=function(e,t){return O._tmpCanvas=document.createElement("canvas"),O._tmpCtx=O._tmpCanvas.getContext("2d"),this._tmpCtx.createImageData(e,t)},O.apply=function(e,t,r){var i=e.getContext("2d"),n=i.getImageData(0,0,e.width,e.height),o=t(n,r);o instanceof ImageData?i.putImageData(o,0,0,0,0,e.width,e.height):i.putImageData(n,0,0,0,0,e.width,e.height)},O.threshold=function(e,t){var r=O._toPixels(e);void 0===t&&(t=.5);for(var i=Math.floor(255*t),n=0;n>8)/i,r[n+1]=255*(a*t>>8)/i,r[n+2]=255*(s*t>>8)/i}},O.dilate=function(e){for(var t,r,i,n,o,a,s,l,u,h,c,f,d,p,m,g,v,y=O._toPixels(e),b=0,_=y.length?y.length/4:0,x=new Int32Array(_);b<_;)for(r=(t=b)+e.width;b>16&255)+151*(i>>8&255)+28*(255&i))<(m=77*(c>>16&255)+151*(c>>8&255)+28*(255&c))&&(n=c,o=m),o<(p=77*((h=O._getARGB(y,a))>>16&255)+151*(h>>8&255)+28*(255&h))&&(n=h,o=p),o<(g=77*(f>>16&255)+151*(f>>8&255)+28*(255&f))&&(n=f,o=g),o<(v=77*(d>>16&255)+151*(d>>8&255)+28*(255&d))&&(n=d,o=v),x[b++]=n;O._setPixels(y,x)},O.erode=function(e){for(var t,r,i,n,o,a,s,l,u,h,c,f,d,p,m,g,v,y=O._toPixels(e),b=0,_=y.length?y.length/4:0,x=new Int32Array(_);b<_;)for(r=(t=b)+e.width;b>16&255)+151*(c>>8&255)+28*(255&c))<(o=77*(i>>16&255)+151*(i>>8&255)+28*(255&i))&&(n=c,o=m),(p=77*((h=O._getARGB(y,a))>>16&255)+151*(h>>8&255)+28*(255&h))>16&255)+151*(f>>8&255)+28*(255&f))>16&255)+151*(d>>8&255)+28*(255&d))=r){var i=Math.floor(t.timeDisplayed/r);if(t.timeDisplayed=0,t.displayIndex+=i,t.loopCount=Math.floor(t.displayIndex/t.numFrames),null!==t.loopLimit&&t.loopCount>=t.loopLimit)t.playing=!1;else{var n=t.displayIndex%t.numFrames;this.drawingContext.putImageData(t.frames[n].image,0,0),t.displayIndex=n,this.setModified(!0)}}}},n.default.Image.prototype._setProperty=function(e,t){this[e]=t,this.setModified(!0)},n.default.Image.prototype.loadPixels=function(){n.default.Renderer2D.prototype.loadPixels.call(this),this.setModified(!0)},n.default.Image.prototype.updatePixels=function(e,t,r,i){n.default.Renderer2D.prototype.updatePixels.call(this,e,t,r,i),this.setModified(!0)},n.default.Image.prototype.get=function(e,t,r,i){return n.default._validateParameters("p5.Image.get",arguments),n.default.Renderer2D.prototype.get.apply(this,arguments)},n.default.Image.prototype._getPixel=n.default.Renderer2D.prototype._getPixel,n.default.Image.prototype.set=function(e,t,r){n.default.Renderer2D.prototype.set.call(this,e,t,r),this.setModified(!0)},n.default.Image.prototype.resize=function(e,t){0===e&&0===t?(e=this.canvas.width,t=this.canvas.height):0===e?e=this.canvas.width*t/this.canvas.height:0===t&&(t=this.canvas.height*e/this.canvas.width),e=Math.floor(e),t=Math.floor(t);var r=document.createElement("canvas");if(r.width=e,r.height=t,this.gifProperties)for(var i=this.gifProperties,n=function(e,t){for(var r=0,i=0;i/g,">").replace(/"/g,""").replace(/'/g,"'")}function l(e,t){t&&!0!==t&&"true"!==t||(t="");var r="";return(e=e||"untitled")&&e.includes(".")&&(r=e.split(".").pop()),t&&r!==t&&(r=t,e="".concat(e,".").concat(r)),[e,r]}e("../core/error_helpers"),v.default.prototype.loadJSON=function(){for(var e=arguments.length,t=new Array(e),r=0;r"),n.print("");if(n.print(' '),n.print(""),n.print(""),n.print(" "),"0"!==o[0]){n.print(" ");for(var h=0;h".concat(c)),n.print(" ")}n.print(" ")}for(var f=0;f");for(var d=0;d".concat(p)),n.print(" ")}n.print(" ")}n.print("
"),n.print(""),n.print("")}n.close(),n.clear()},v.default.prototype.writeFile=function(e,t,r){var i="application/octet-stream";v.default.prototype._isSafari()&&(i="text/plain");var n=new Blob(e,{type:i});v.default.prototype.downloadFile(n,t,r)},v.default.prototype.downloadFile=function(e,t,r){var i=l(t,r),n=i[0];if(e instanceof Blob)s.default.saveAs(e,n);else{var o=document.createElement("a");if(o.href=e,o.download=n,o.onclick=function(e){var t;t=e,document.body.removeChild(t.target),e.stopPropagation()},o.style.display="none",document.body.appendChild(o),v.default.prototype._isSafari()){var a="Hello, Safari user! To download this file...\n";a+="1. Go to File --\x3e Save As.\n",a+='2. Choose "Page Source" as the Format.\n',a+='3. Name it with this extension: ."'.concat(i[1],'"'),alert(a)}o.click()}},v.default.prototype._checkFileExtension=l,v.default.prototype._isSafari=function(){return 0>>0},getSeed:function(){return t},rand:function(){return(r=(1664525*r+1013904223)%i)/i}});n.setSeed(e),_=new Array(4096);for(var o=0;o<4096;o++)_[o]=n.rand()};var o=n.default;r.default=o},{"../core/main":49}],82:[function(e,t,r){"use strict";function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i,l=(i=e("../core/main"))&&i.__esModule?i:{default:i},o=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==a(e)&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var o=i?Object.getOwnPropertyDescriptor(e,n):null;o&&(o.get||o.set)?Object.defineProperty(r,n,o):r[n]=e[n]}r.default=e,t&&t.set(e,r);return r}(e("../core/constants"));function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}l.default.Vector=function(e,t,r){var i,n,o;o=e instanceof l.default?(this.p5=e,i=t[0]||0,n=t[1]||0,t[2]||0):(i=e||0,n=t||0,r||0),this.x=i,this.y=n,this.z=o},l.default.Vector.prototype.toString=function(){return"p5.Vector Object : [".concat(this.x,", ").concat(this.y,", ").concat(this.z,"]")},l.default.Vector.prototype.set=function(e,t,r){return e instanceof l.default.Vector?(this.x=e.x||0,this.y=e.y||0,this.z=e.z||0):e instanceof Array?(this.x=e[0]||0,this.y=e[1]||0,this.z=e[2]||0):(this.x=e||0,this.y=t||0,this.z=r||0),this},l.default.Vector.prototype.copy=function(){return this.p5?new l.default.Vector(this.p5,[this.x,this.y,this.z]):new l.default.Vector(this.x,this.y,this.z)},l.default.Vector.prototype.add=function(e,t,r){return e instanceof l.default.Vector?(this.x+=e.x||0,this.y+=e.y||0,this.z+=e.z||0):e instanceof Array?(this.x+=e[0]||0,this.y+=e[1]||0,this.z+=e[2]||0):(this.x+=e||0,this.y+=t||0,this.z+=r||0),this};function u(e,t){return 0!==e&&(this.x=this.x%e),0!==t&&(this.y=this.y%t),this}function h(e,t,r){return 0!==e&&(this.x=this.x%e),0!==t&&(this.y=this.y%t),0!==r&&(this.z=this.z%r),this}l.default.Vector.prototype.rem=function(e,t,r){if(e instanceof l.default.Vector){if(Number.isFinite(e.x)&&Number.isFinite(e.y)&&Number.isFinite(e.z)){var i=parseFloat(e.x),n=parseFloat(e.y),o=parseFloat(e.z);h.call(this,i,n,o)}}else if(e instanceof Array)e.every(function(e){return Number.isFinite(e)})&&(2===e.length&&u.call(this,e[0],e[1]),3===e.length&&h.call(this,e[0],e[1],e[2]));else if(1===arguments.length){if(Number.isFinite(e)&&0!==e)return this.x=this.x%e,this.y=this.y%e,this.z=this.z%e,this}else if(2===arguments.length){var a=Array.prototype.slice.call(arguments);a.every(function(e){return Number.isFinite(e)})&&2===a.length&&u.call(this,a[0],a[1])}else if(3===arguments.length){var s=Array.prototype.slice.call(arguments);s.every(function(e){return Number.isFinite(e)})&&3===s.length&&h.call(this,s[0],s[1],s[2])}},l.default.Vector.prototype.sub=function(e,t,r){return e instanceof l.default.Vector?(this.x-=e.x||0,this.y-=e.y||0,this.z-=e.z||0):e instanceof Array?(this.x-=e[0]||0,this.y-=e[1]||0,this.z-=e[2]||0):(this.x-=e||0,this.y-=t||0,this.z-=r||0),this},l.default.Vector.prototype.mult=function(e){return"number"==typeof e&&isFinite(e)?(this.x*=e,this.y*=e,this.z*=e):console.warn("p5.Vector.prototype.mult:","n is undefined or not a finite number"),this},l.default.Vector.prototype.div=function(e){return"number"==typeof e&&isFinite(e)?0===e?console.warn("p5.Vector.prototype.div:","divide by 0"):(this.x/=e,this.y/=e,this.z/=e):console.warn("p5.Vector.prototype.div:","n is undefined or not a finite number"),this},l.default.Vector.prototype.mag=function(){return Math.sqrt(this.magSq())},l.default.Vector.prototype.magSq=function(){var e=this.x,t=this.y,r=this.z;return e*e+t*t+r*r},l.default.Vector.prototype.dot=function(e,t,r){return e instanceof l.default.Vector?this.dot(e.x,e.y,e.z):this.x*(e||0)+this.y*(t||0)+this.z*(r||0)},l.default.Vector.prototype.cross=function(e){var t=this.y*e.z-this.z*e.y,r=this.z*e.x-this.x*e.z,i=this.x*e.y-this.y*e.x;return this.p5?new l.default.Vector(this.p5,[t,r,i]):new l.default.Vector(t,r,i)},l.default.Vector.prototype.dist=function(e){return e.copy().sub(this).mag()},l.default.Vector.prototype.normalize=function(){var e=this.mag();return 0!==e&&this.mult(1/e),this},l.default.Vector.prototype.limit=function(e){var t=this.magSq();return e*e>>0},n.default.prototype.randomSeed=function(e){this._lcgSetSeed(o,e),this._gaussian_previous=!1},n.default.prototype.random=function(e,t){var r;if(n.default._validateParameters("random",arguments),r=null!=this[o]?this._lcg(o):Math.random(),void 0===e)return r;if(void 0===t)return e instanceof Array?e[Math.floor(r*e.length)]:r*e;if(tf){var P=p,L=l,k=u;p=d+f*(s&&d=t&&(r=r.substring(r.length-t,r.length)),r}},n.default.prototype.unhex=function(e){return e instanceof Array?e.map(n.default.prototype.unhex):parseInt("0x".concat(e),16)};var o=n.default;r.default=o},{"../core/main":49}],90:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i,a=(i=e("../core/main"))&&i.__esModule?i:{default:i};function n(e,t,r){var i=e<0,n=i?e.toString().substring(1):e.toString(),o=n.indexOf("."),a=-1!==o?n.substring(0,o):n,s=-1!==o?n.substring(o+1):"",l=i?"-":"";if(void 0!==r){var u="";(-1!==o||0r&&(s=s.substring(0,r));for(var h=0;hi.length)for(var o=t-(i+=-1===r?".":"").length+1,a=0;a=d.TWO_PI?"".concat("ellipse","|").concat(u,"|"):"".concat("arc","|").concat(a,"|").concat(s,"|").concat(l,"|").concat(u,"|"),!this.geometryInHash(t)){var h=new T.default.Geometry(u,1,function(){if(this.strokeIndices=[],a.toFixed(10)!==s.toFixed(10)){l!==d.PIE&&void 0!==l||(this.vertices.push(new T.default.Vector(.5,.5,0)),this.uvs.push([.5,.5]));for(var e=0;e<=u;e++){var t=(s-a)*(e/u)+a,r=.5+Math.cos(t)/2,i=.5+Math.sin(t)/2;this.vertices.push(new T.default.Vector(r,i,0)),this.uvs.push([r,i]),e>5&31)/31,(y>>10&31)/31):(r=a,i=s,l)}for(var b=1;b<=3;b++){var _=p+12*b,x=new S.default.Vector(u.getFloat32(_,!0),u.getFloat32(8+_,!0),u.getFloat32(4+_,!0));e.vertices.push(x),c&&o.push(r,i,n)}var w=new S.default.Vector(m,g,v);e.vertexNormals.push(w,w,w),e.faces.push([3*d,3*d+1,3*d+2]),e.uvs.push([0,0],[0,0],[0,0])}}(e,t);else{var r=new DataView(t);if(!("TextDecoder"in window))return console.warn("Sorry, ASCII STL loading only works in browsers that support TextDecoder (https://caniuse.com/#feat=textencoder)");var i=new TextDecoder("utf-8").decode(r).split("\n");!function(e,t){for(var r,i,n="",o=[],a=0;aMath.PI?l=Math.PI:l<=0&&(l=.001);var u=Math.sin(l)*a*Math.sin(s),h=Math.cos(l)*a,c=Math.sin(l)*a*Math.cos(s);this.camera(u+this.centerX,h+this.centerY,c+this.centerZ,this.centerX,this.centerY,this.centerZ,0,1,0)},m.default.Camera.prototype._isActive=function(){return this===this._renderer._curCamera},m.default.prototype.setCamera=function(e){this._renderer._curCamera=e,this._renderer.uPMatrix.set(e.projMatrix.mat4[0],e.projMatrix.mat4[1],e.projMatrix.mat4[2],e.projMatrix.mat4[3],e.projMatrix.mat4[4],e.projMatrix.mat4[5],e.projMatrix.mat4[6],e.projMatrix.mat4[7],e.projMatrix.mat4[8],e.projMatrix.mat4[9],e.projMatrix.mat4[10],e.projMatrix.mat4[11],e.projMatrix.mat4[12],e.projMatrix.mat4[13],e.projMatrix.mat4[14],e.projMatrix.mat4[15])};var n=m.default.Camera;r.default=n},{"../core/main":49}],98:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i,h=(i=e("../core/main"))&&i.__esModule?i:{default:i};h.default.Geometry=function(e,t,r){return this.vertices=[],this.lineVertices=[],this.lineNormals=[],this.vertexNormals=[],this.faces=[],this.uvs=[],this.edges=[],this.vertexColors=[],this.detailX=void 0!==e?e:1,this.detailY=void 0!==t?t:1,this.dirtyFlags={},r instanceof Function&&r.call(this),this},h.default.Geometry.prototype.reset=function(){this.lineVertices.length=0,this.lineNormals.length=0,this.vertices.length=0,this.edges.length=0,this.vertexColors.length=0,this.vertexNormals.length=0,this.uvs.length=0,this.dirtyFlags={}},h.default.Geometry.prototype.computeFaces=function(){this.faces.length=0;for(var e,t,r,i,n=this.detailX+1,o=0;othis.vertices.length-1-this.detailX;i--)e.add(this.vertexNormals[i]);e=h.default.Vector.div(e,this.detailX);for(var n=this.vertices.length-1;n>this.vertices.length-1-this.detailX;n--)this.vertexNormals[n]=e;return this},h.default.Geometry.prototype._makeTriangleEdges=function(){if(this.edges.length=0,Array.isArray(this.strokeIndices))for(var e=0,t=this.strokeIndices.length;e vTexCoord.y;\n bool y1 = p1.y > vTexCoord.y;\n bool y2 = p2.y > vTexCoord.y;\n\n // could web be under the curve (after t1)?\n if (y1 ? !y2 : y0) {\n // add the coverage for t1\n coverage.x += saturate(C1.x + 0.5);\n // calculate the anti-aliasing for t1\n weight.x = min(weight.x, abs(C1.x));\n }\n\n // are we outside the curve (after t2)?\n if (y1 ? !y0 : y2) {\n // subtract the coverage for t2\n coverage.x -= saturate(C2.x + 0.5);\n // calculate the anti-aliasing for t2\n weight.x = min(weight.x, abs(C2.x));\n }\n}\n\n// this is essentially the same as coverageX, but with the axes swapped\nvoid coverageY(vec2 p0, vec2 p1, vec2 p2) {\n\n vec2 C1, C2;\n calulateCrossings(p0, p1, p2, C1, C2);\n\n bool x0 = p0.x > vTexCoord.x;\n bool x1 = p1.x > vTexCoord.x;\n bool x2 = p2.x > vTexCoord.x;\n\n if (x1 ? !x2 : x0) {\n coverage.y -= saturate(C1.y + 0.5);\n weight.y = min(weight.y, abs(C1.y));\n }\n\n if (x1 ? !x0 : x2) {\n coverage.y += saturate(C2.y + 0.5);\n weight.y = min(weight.y, abs(C2.y));\n }\n}\n\nvoid main() {\n\n // calculate the pixel scale based on screen-coordinates\n pixelScale = hardness / fwidth(vTexCoord);\n\n // which grid cell is this pixel in?\n ivec2 gridCoord = ifloor(vTexCoord * vec2(uGridSize));\n\n // intersect curves in this row\n {\n // the index into the row info bitmap\n int rowIndex = gridCoord.y + uGridOffset.y;\n // fetch the info texel\n vec4 rowInfo = getTexel(uSamplerRows, rowIndex, uGridImageSize);\n // unpack the rowInfo\n int rowStrokeIndex = getInt16(rowInfo.xy);\n int rowStrokeCount = getInt16(rowInfo.zw);\n\n for (int iRowStroke = INT(0); iRowStroke < N; iRowStroke++) {\n if (iRowStroke >= rowStrokeCount)\n break;\n\n // each stroke is made up of 3 points: the start and control point\n // and the start of the next curve.\n // fetch the indices of this pair of strokes:\n vec4 strokeIndices = getTexel(uSamplerRowStrokes, rowStrokeIndex++, uCellsImageSize);\n\n // unpack the stroke index\n int strokePos = getInt16(strokeIndices.xy);\n\n // fetch the two strokes\n vec4 stroke0 = getTexel(uSamplerStrokes, strokePos + INT(0), uStrokeImageSize);\n vec4 stroke1 = getTexel(uSamplerStrokes, strokePos + INT(1), uStrokeImageSize);\n\n // calculate the coverage\n coverageX(stroke0.xy, stroke0.zw, stroke1.xy);\n }\n }\n\n // intersect curves in this column\n {\n int colIndex = gridCoord.x + uGridOffset.x;\n vec4 colInfo = getTexel(uSamplerCols, colIndex, uGridImageSize);\n int colStrokeIndex = getInt16(colInfo.xy);\n int colStrokeCount = getInt16(colInfo.zw);\n \n for (int iColStroke = INT(0); iColStroke < N; iColStroke++) {\n if (iColStroke >= colStrokeCount)\n break;\n\n vec4 strokeIndices = getTexel(uSamplerColStrokes, colStrokeIndex++, uCellsImageSize);\n\n int strokePos = getInt16(strokeIndices.xy);\n vec4 stroke0 = getTexel(uSamplerStrokes, strokePos + INT(0), uStrokeImageSize);\n vec4 stroke1 = getTexel(uSamplerStrokes, strokePos + INT(1), uStrokeImageSize);\n coverageY(stroke0.xy, stroke0.zw, stroke1.xy);\n }\n }\n\n weight = saturate(1.0 - weight * 2.0);\n float distance = max(weight.x + weight.y, minDistance); // manhattan approx.\n float antialias = abs(dot(coverage, weight) / distance);\n float cover = min(abs(coverage.x), abs(coverage.y));\n gl_FragColor = uMaterialColor;\n gl_FragColor.a *= saturate(max(antialias, cover));\n}",lineVert:"/*\n Part of the Processing project - http://processing.org\n Copyright (c) 2012-15 The Processing Foundation\n Copyright (c) 2004-12 Ben Fry and Casey Reas\n Copyright (c) 2001-04 Massachusetts Institute of Technology\n This library is free software; you can redistribute it and/or\n modify it under the terms of the GNU Lesser General Public\n License as published by the Free Software Foundation, version 2.1.\n This library is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n Lesser General Public License for more details.\n You should have received a copy of the GNU Lesser General\n Public License along with this library; if not, write to the\n Free Software Foundation, Inc., 59 Temple Place, Suite 330,\n Boston, MA 02111-1307 USA\n*/\n\n#define PROCESSING_LINE_SHADER\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform float uStrokeWeight;\n\nuniform vec4 uViewport;\nuniform int uPerspective;\n\nattribute vec4 aPosition;\nattribute vec4 aDirection;\n \nvoid main() {\n // using a scale <1 moves the lines towards the camera\n // in order to prevent popping effects due to half of\n // the line disappearing behind the geometry faces.\n vec3 scale = vec3(0.9995);\n\n vec4 posp = uModelViewMatrix * aPosition;\n vec4 posq = uModelViewMatrix * (aPosition + vec4(aDirection.xyz, 0));\n\n // Moving vertices slightly toward the camera\n // to avoid depth-fighting with the fill triangles.\n // Discussed here:\n // http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Number=252848 \n posp.xyz = posp.xyz * scale;\n posq.xyz = posq.xyz * scale;\n\n vec4 p = uProjectionMatrix * posp;\n vec4 q = uProjectionMatrix * posq;\n\n // formula to convert from clip space (range -1..1) to screen space (range 0..[width or height])\n // screen_p = (p.xy/p.w + <1,1>) * 0.5 * uViewport.zw\n\n // prevent division by W by transforming the tangent formula (div by 0 causes\n // the line to disappear, see https://github.com/processing/processing/issues/5183)\n // t = screen_q - screen_p\n //\n // tangent is normalized and we don't care which aDirection it points to (+-)\n // t = +- normalize( screen_q - screen_p )\n // t = +- normalize( (q.xy/q.w+<1,1>)*0.5*uViewport.zw - (p.xy/p.w+<1,1>)*0.5*uViewport.zw )\n //\n // extract common factor, <1,1> - <1,1> cancels out\n // t = +- normalize( (q.xy/q.w - p.xy/p.w) * 0.5 * uViewport.zw )\n //\n // convert to common divisor\n // t = +- normalize( ((q.xy*p.w - p.xy*q.w) / (p.w*q.w)) * 0.5 * uViewport.zw )\n //\n // remove the common scalar divisor/factor, not needed due to normalize and +-\n // (keep uViewport - can't remove because it has different components for x and y\n // and corrects for aspect ratio, see https://github.com/processing/processing/issues/5181)\n // t = +- normalize( (q.xy*p.w - p.xy*q.w) * uViewport.zw )\n\n vec2 tangent = normalize((q.xy*p.w - p.xy*q.w) * uViewport.zw);\n\n // flip tangent to normal (it's already normalized)\n vec2 normal = vec2(-tangent.y, tangent.x);\n\n float thickness = aDirection.w * uStrokeWeight;\n vec2 offset = normal * thickness / 2.0;\n\n vec2 curPerspScale;\n\n if(uPerspective == 1) {\n // Perspective ---\n // convert from world to clip by multiplying with projection scaling factor\n // to get the right thickness (see https://github.com/processing/processing/issues/5182)\n // invert Y, projections in Processing invert Y\n curPerspScale = (uProjectionMatrix * vec4(1, -1, 0, 0)).xy;\n } else {\n // No Perspective ---\n // multiply by W (to cancel out division by W later in the pipeline) and\n // convert from screen to clip (derived from clip to screen above)\n curPerspScale = p.w / (0.5 * uViewport.zw);\n }\n\n gl_Position.xy = p.xy + offset.xy * curPerspScale;\n gl_Position.zw = p.zw;\n}\n",lineFrag:"precision mediump float;\nprecision mediump int;\n\nuniform vec4 uMaterialColor;\n\nvoid main() {\n gl_FragColor = uMaterialColor;\n}",pointVert:"attribute vec3 aPosition;\nuniform float uPointSize;\nvarying float vStrokeWeight;\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nvoid main() {\n\tvec4 positionVec4 = vec4(aPosition, 1.0);\n\tgl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n\tgl_PointSize = uPointSize;\n\tvStrokeWeight = uPointSize;\n}",pointFrag:"precision mediump float;\nprecision mediump int;\nuniform vec4 uMaterialColor;\nvarying float vStrokeWeight;\n\nvoid main(){\n\tfloat mask = 0.0;\n\n\t// make a circular mask using the gl_PointCoord (goes from 0 - 1 on a point)\n // might be able to get a nicer edge on big strokeweights with smoothstep but slightly less performant\n\n\tmask = step(0.98, length(gl_PointCoord * 2.0 - 1.0));\n\n\t// if strokeWeight is 1 or less lets just draw a square\n\t// this prevents weird artifacting from carving circles when our points are really small\n\t// if strokeWeight is larger than 1, we just use it as is\n\n\tmask = mix(0.0, mask, clamp(floor(vStrokeWeight - 0.5),0.0,1.0));\n\n\t// throw away the borders of the mask\n // otherwise we get weird alpha blending issues\n\n\tif(mask > 0.98){\n discard;\n \t}\n\n \tgl_FragColor = vec4(uMaterialColor.rgb * (1.0 - mask), uMaterialColor.a) ;\n}"};u.default.RendererGL=function(e,t,r,i){return u.default.Renderer.call(this,e,t,r),this._setAttributeDefaults(t),this._initContext(),this.isP3D=!0,this.GL=this.drawingContext,this._isErasing=!1,this._enableLighting=!1,this.ambientLightColors=[],this.specularColors=[1,1,1],this.directionalLightDirections=[],this.directionalLightDiffuseColors=[],this.directionalLightSpecularColors=[],this.pointLightPositions=[],this.pointLightDiffuseColors=[],this.pointLightSpecularColors=[],this.spotLightPositions=[],this.spotLightDirections=[],this.spotLightDiffuseColors=[],this.spotLightSpecularColors=[],this.spotLightAngle=[],this.spotLightConc=[],this.drawMode=o.FILL,this.curFillColor=this._cachedFillStyle=[1,1,1,1],this.curStrokeColor=this._cachedStrokeStyle=[0,0,0,1],this.curBlendMode=o.BLEND,this._cachedBlendMode=void 0,this.blendExt=this.GL.getExtension("EXT_blend_minmax"),this._isBlending=!1,this._useSpecularMaterial=!1,this._useEmissiveMaterial=!1,this._useNormalMaterial=!1,this._useShininess=1,this._tint=[255,255,255,255],this.constantAttenuation=1,this.linearAttenuation=0,this.quadraticAttenuation=0,this.uMVMatrix=new u.default.Matrix,this.uPMatrix=new u.default.Matrix,this.uNMatrix=new u.default.Matrix("mat3"),this._curCamera=new u.default.Camera(this),this._curCamera._computeCameraDefaultSettings(),this._curCamera._setDefaultCamera(),this._defaultLightShader=void 0,this._defaultImmediateModeShader=void 0,this._defaultNormalShader=void 0,this._defaultColorShader=void 0,this._defaultPointShader=void 0,this.userFillShader=void 0,this.userStrokeShader=void 0,this.userPointShader=void 0,this.retainedMode={geometry:{},buffers:{stroke:[new u.default.RenderBuffer(3,"lineVertices","lineVertexBuffer","aPosition",this,this._flatten),new u.default.RenderBuffer(4,"lineNormals","lineNormalBuffer","aDirection",this,this._flatten)],fill:[new u.default.RenderBuffer(3,"vertices","vertexBuffer","aPosition",this,this._vToNArray),new u.default.RenderBuffer(3,"vertexNormals","normalBuffer","aNormal",this,this._vToNArray),new u.default.RenderBuffer(4,"vertexColors","colorBuffer","aMaterialColor",this),new u.default.RenderBuffer(3,"vertexAmbients","ambientBuffer","aAmbientColor",this),new u.default.RenderBuffer(2,"uvs","uvBuffer","aTexCoord",this,this._flatten)],text:[new u.default.RenderBuffer(3,"vertices","vertexBuffer","aPosition",this,this._vToNArray),new u.default.RenderBuffer(2,"uvs","uvBuffer","aTexCoord",this,this._flatten)]}},this.immediateMode={geometry:new u.default.Geometry,shapeMode:o.TRIANGLE_FAN,_bezierVertex:[],_quadraticVertex:[],_curveVertex:[],buffers:{fill:[new u.default.RenderBuffer(3,"vertices","vertexBuffer","aPosition",this,this._vToNArray),new u.default.RenderBuffer(3,"vertexNormals","normalBuffer","aNormal",this,this._vToNArray),new u.default.RenderBuffer(4,"vertexColors","colorBuffer","aVertexColor",this),new u.default.RenderBuffer(3,"vertexAmbients","ambientBuffer","aAmbientColor",this),new u.default.RenderBuffer(2,"uvs","uvBuffer","aTexCoord",this,this._flatten)],stroke:[new u.default.RenderBuffer(3,"lineVertices","lineVertexBuffer","aPosition",this,this._flatten),new u.default.RenderBuffer(4,"lineNormals","lineNormalBuffer","aDirection",this,this._flatten)],point:this.GL.createBuffer()}},this.pointSize=5,this.curStrokeWeight=1,this.textures=[],this.textureMode=o.IMAGE,this.textureWrapX=o.CLAMP,this.textureWrapY=o.CLAMP,this._tex=null,this._curveTightness=6,this._lookUpTableBezier=[],this._lookUpTableQuadratic=[],this._lutBezierDetail=0,this._lutQuadraticDetail=0,this._tessy=this._initTessy(),this.fontInfos={},this._curShader=void 0,this},u.default.RendererGL.prototype=Object.create(u.default.Renderer.prototype),u.default.RendererGL.prototype._setAttributeDefaults=function(e){var t={alpha:!0,depth:!0,stencil:!0,antialias:navigator.userAgent.toLowerCase().includes("safari"),premultipliedAlpha:!1,preserveDrawingBuffer:!0,perPixelLighting:!0};null===e._glAttributes?e._glAttributes=t:e._glAttributes=Object.assign(t,e._glAttributes)},u.default.RendererGL.prototype._initContext=function(){try{if(this.drawingContext=this.canvas.getContext("webgl",this._pInst._glAttributes)||this.canvas.getContext("experimental-webgl",this._pInst._glAttributes),null===this.drawingContext)throw new Error("Error creating webgl context");var e=this.drawingContext;e.enable(e.DEPTH_TEST),e.depthFunc(e.LEQUAL),e.viewport(0,0,e.drawingBufferWidth,e.drawingBufferHeight),this._viewport=this.drawingContext.getParameter(this.drawingContext.VIEWPORT)}catch(e){throw e}},u.default.RendererGL.prototype._resetContext=function(e,t){var r=this.width,i=this.height,n=this.canvas.id,o=this._pInst instanceof u.default.Graphics;if(o){var a=this._pInst;a.canvas.parentNode.removeChild(a.canvas),a.canvas=document.createElement("canvas"),(a._pInst._userNode||document.body).appendChild(a.canvas),u.default.Element.call(a,a.canvas,a._pInst),a.width=r,a.height=i}else{var s=this.canvas;s&&s.parentNode.removeChild(s),(s=document.createElement("canvas")).id=n,this._pInst._userNode?this._pInst._userNode.appendChild(s):document.body.appendChild(s),this._pInst.canvas=s}var l=new u.default.RendererGL(this._pInst.canvas,this._pInst,!o);this._pInst._setProperty("_renderer",l),l.resize(r,i),l._applyDefaults(),o||this._pInst._elements.push(l),"function"==typeof t&&setTimeout(function(){t.apply(window._renderer,e)},0)},u.default.prototype.setAttributes=function(e,t){if(void 0!==this._glAttributes){var r=!0;if(void 0!==t?(null===this._glAttributes&&(this._glAttributes={}),this._glAttributes[e]!==t&&(this._glAttributes[e]=t,r=!1)):e instanceof Object&&this._glAttributes!==e&&(this._glAttributes=e,r=!1),this._renderer.isP3D&&!r){if(!this._setupDone)for(var i in this._renderer.retainedMode.geometry)if(this._renderer.retainedMode.geometry.hasOwnProperty(i))return void console.error("Sorry, Could not set the attributes, you need to call setAttributes() before calling the other drawing methods in setup()");this.push(),this._renderer._resetContext(),this.pop(),this._renderer._curCamera&&(this._renderer._curCamera._renderer=this._renderer)}}else console.log("You are trying to use setAttributes on a p5.Graphics object that does not use a WEBGL renderer.")},u.default.RendererGL.prototype._update=function(){this.uMVMatrix.set(this._curCamera.cameraMatrix.mat4[0],this._curCamera.cameraMatrix.mat4[1],this._curCamera.cameraMatrix.mat4[2],this._curCamera.cameraMatrix.mat4[3],this._curCamera.cameraMatrix.mat4[4],this._curCamera.cameraMatrix.mat4[5],this._curCamera.cameraMatrix.mat4[6],this._curCamera.cameraMatrix.mat4[7],this._curCamera.cameraMatrix.mat4[8],this._curCamera.cameraMatrix.mat4[9],this._curCamera.cameraMatrix.mat4[10],this._curCamera.cameraMatrix.mat4[11],this._curCamera.cameraMatrix.mat4[12],this._curCamera.cameraMatrix.mat4[13],this._curCamera.cameraMatrix.mat4[14],this._curCamera.cameraMatrix.mat4[15]),this.ambientLightColors.length=0,this.specularColors=[1,1,1],this.directionalLightDirections.length=0,this.directionalLightDiffuseColors.length=0,this.directionalLightSpecularColors.length=0,this.pointLightPositions.length=0,this.pointLightDiffuseColors.length=0,this.pointLightSpecularColors.length=0,this.spotLightPositions.length=0,this.spotLightDirections.length=0,this.spotLightDiffuseColors.length=0,this.spotLightSpecularColors.length=0,this.spotLightAngle.length=0,this.spotLightConc.length=0,this._enableLighting=!1,this._tint=[255,255,255,255],this.GL.clear(this.GL.DEPTH_BUFFER_BIT)},u.default.RendererGL.prototype.background=function(){var e,t=(e=this._pInst).color.apply(e,arguments),r=t.levels[0]/255,i=t.levels[1]/255,n=t.levels[2]/255,o=t.levels[3]/255;this.GL.clearColor(r,i,n,o),this.GL.clear(this.GL.COLOR_BUFFER_BIT)},u.default.RendererGL.prototype.fill=function(e,t,r,i){var n=u.default.prototype.color.apply(this._pInst,arguments);this.curFillColor=n._array,this.drawMode=o.FILL,this._useNormalMaterial=!1,this._tex=null},u.default.RendererGL.prototype.stroke=function(e,t,r,i){arguments[3]=255;var n=u.default.prototype.color.apply(this._pInst,arguments);this.curStrokeColor=n._array},u.default.RendererGL.prototype.strokeCap=function(e){console.error("Sorry, strokeCap() is not yet implemented in WEBGL mode")},u.default.RendererGL.prototype.strokeJoin=function(e){console.error("Sorry, strokeJoin() is not yet implemented in WEBGL mode")},u.default.RendererGL.prototype.filter=function(e){console.error("filter() does not work in WEBGL mode")},u.default.RendererGL.prototype.blendMode=function(e){e===o.DARKEST||e===o.LIGHTEST||e===o.ADD||e===o.BLEND||e===o.SUBTRACT||e===o.SCREEN||e===o.EXCLUSION||e===o.REPLACE||e===o.MULTIPLY||e===o.REMOVE?this.curBlendMode=e:e!==o.BURN&&e!==o.OVERLAY&&e!==o.HARD_LIGHT&&e!==o.SOFT_LIGHT&&e!==o.DODGE||console.warn("BURN, OVERLAY, HARD_LIGHT, SOFT_LIGHT, and DODGE only work for blendMode in 2D mode.")},u.default.RendererGL.prototype.erase=function(e,t){this._isErasing||(this._cachedBlendMode=this.curBlendMode,this.blendMode(o.REMOVE),this._cachedFillStyle=this.curFillColor.slice(),this.curFillColor=[1,1,1,e/255],this._cachedStrokeStyle=this.curStrokeColor.slice(),this.curStrokeColor=[1,1,1,t/255],this._isErasing=!0)},u.default.RendererGL.prototype.noErase=function(){this._isErasing&&(this.curFillColor=this._cachedFillStyle.slice(),this.curStrokeColor=this._cachedStrokeStyle.slice(),this.blendMode(this._cachedBlendMode),this._isErasing=!1)},u.default.RendererGL.prototype.strokeWeight=function(e){this.curStrokeWeight!==e&&(this.pointSize=e,this.curStrokeWeight=e)},u.default.RendererGL.prototype._getPixel=function(e,t){var r;return r=new Uint8Array(4),this.drawingContext.readPixels(e,t,1,1,this.drawingContext.RGBA,this.drawingContext.UNSIGNED_BYTE,r),[r[0],r[1],r[2],r[3]]},u.default.RendererGL.prototype.loadPixels=function(){var e=this._pixelsState;if(!0===this._pInst._glAttributes.preserveDrawingBuffer){var t=e.pixels,r=this.GL.drawingBufferWidth*this.GL.drawingBufferHeight*4;t instanceof Uint8Array&&t.length===r||(t=new Uint8Array(r),this._pixelsState._setProperty("pixels",t));var i=this._pInst._pixelDensity;this.GL.readPixels(0,0,this.width*i,this.height*i,this.GL.RGBA,this.GL.UNSIGNED_BYTE,t)}else console.log("loadPixels only works in WebGL when preserveDrawingBuffer is true.")},u.default.RendererGL.prototype.geometryInHash=function(e){return void 0!==this.retainedMode.geometry[e]},u.default.RendererGL.prototype.resize=function(e,t){u.default.Renderer.prototype.resize.call(this,e,t),this.GL.viewport(0,0,this.GL.drawingBufferWidth,this.GL.drawingBufferHeight),this._viewport=this.GL.getParameter(this.GL.VIEWPORT),this._curCamera._resize();var r=this._pixelsState;void 0!==r.pixels&&r._setProperty("pixels",new Uint8Array(this.GL.drawingBufferWidth*this.GL.drawingBufferHeight*4))},u.default.RendererGL.prototype.clear=function(){var e=(arguments.length<=0?void 0:arguments[0])||0,t=(arguments.length<=1?void 0:arguments[1])||0,r=(arguments.length<=2?void 0:arguments[2])||0,i=(arguments.length<=3?void 0:arguments[3])||0;this.GL.clearColor(e,t,r,i),this.GL.clear(this.GL.COLOR_BUFFER_BIT|this.GL.DEPTH_BUFFER_BIT)},u.default.RendererGL.prototype.applyMatrix=function(e,t,r,i,n,o){16===arguments.length?u.default.Matrix.prototype.apply.apply(this.uMVMatrix,arguments):this.uMVMatrix.apply([e,t,0,0,r,i,0,0,0,0,1,0,n,o,0,1])},u.default.RendererGL.prototype.translate=function(e,t,r){return e instanceof u.default.Vector&&(r=e.z,t=e.y,e=e.x),this.uMVMatrix.translate([e,t,r]),this},u.default.RendererGL.prototype.scale=function(e,t,r){return this.uMVMatrix.scale(e,t,r),this},u.default.RendererGL.prototype.rotate=function(e,t){return void 0===t?this.rotateZ(e):(u.default.Matrix.prototype.rotate.apply(this.uMVMatrix,arguments),this)},u.default.RendererGL.prototype.rotateX=function(e){return this.rotate(e,1,0,0),this},u.default.RendererGL.prototype.rotateY=function(e){return this.rotate(e,0,1,0),this},u.default.RendererGL.prototype.rotateZ=function(e){return this.rotate(e,0,0,1),this},u.default.RendererGL.prototype.push=function(){var e=u.default.Renderer.prototype.push.apply(this),t=e.properties;return t.uMVMatrix=this.uMVMatrix.copy(),t.uPMatrix=this.uPMatrix.copy(),t._curCamera=this._curCamera,this._curCamera=this._curCamera.copy(),t.ambientLightColors=this.ambientLightColors.slice(),t.specularColors=this.specularColors.slice(),t.directionalLightDirections=this.directionalLightDirections.slice(),t.directionalLightDiffuseColors=this.directionalLightDiffuseColors.slice(),t.directionalLightSpecularColors=this.directionalLightSpecularColors.slice(),t.pointLightPositions=this.pointLightPositions.slice(),t.pointLightDiffuseColors=this.pointLightDiffuseColors.slice(),t.pointLightSpecularColors=this.pointLightSpecularColors.slice(),t.spotLightPositions=this.spotLightPositions.slice(),t.spotLightDirections=this.spotLightDirections.slice(),t.spotLightDiffuseColors=this.spotLightDiffuseColors.slice(),t.spotLightSpecularColors=this.spotLightSpecularColors.slice(),t.spotLightAngle=this.spotLightAngle.slice(),t.spotLightConc=this.spotLightConc.slice(),t.userFillShader=this.userFillShader,t.userStrokeShader=this.userStrokeShader,t.userPointShader=this.userPointShader,t.pointSize=this.pointSize,t.curStrokeWeight=this.curStrokeWeight,t.curStrokeColor=this.curStrokeColor,t.curFillColor=this.curFillColor,t._useSpecularMaterial=this._useSpecularMaterial,t._useEmissiveMaterial=this._useEmissiveMaterial,t._useShininess=this._useShininess,t.constantAttenuation=this.constantAttenuation,t.linearAttenuation=this.linearAttenuation,t.quadraticAttenuation=this.quadraticAttenuation,t._enableLighting=this._enableLighting,t._useNormalMaterial=this._useNormalMaterial,t._tex=this._tex,t.drawMode=this.drawMode,e},u.default.RendererGL.prototype.resetMatrix=function(){return this.uMVMatrix=u.default.Matrix.identity(this._pInst),this},u.default.RendererGL.prototype._getImmediateStrokeShader=function(){var e=this.userStrokeShader;return e&&e.isStrokeShader()?e:this._getLineShader()},u.default.RendererGL.prototype._getRetainedStrokeShader=u.default.RendererGL.prototype._getImmediateStrokeShader,u.default.RendererGL.prototype._getImmediateFillShader=function(){var e=this.userFillShader;if(this._useNormalMaterial&&(!e||!e.isNormalShader()))return this._getNormalShader();if(this._enableLighting){if(!e||!e.isLightShader())return this._getLightShader()}else if(this._tex){if(!e||!e.isTextureShader())return this._getLightShader()}else if(!e)return this._getImmediateModeShader();return e},u.default.RendererGL.prototype._getRetainedFillShader=function(){if(this._useNormalMaterial)return this._getNormalShader();var e=this.userFillShader;if(this._enableLighting){if(!e||!e.isLightShader())return this._getLightShader()}else if(this._tex){if(!e||!e.isTextureShader())return this._getLightShader()}else if(!e)return this._getColorShader();return e},u.default.RendererGL.prototype._getImmediatePointShader=function(){var e=this.userPointShader;return e&&e.isPointShader()?e:this._getPointShader()},u.default.RendererGL.prototype._getRetainedLineShader=u.default.RendererGL.prototype._getImmediateLineShader,u.default.RendererGL.prototype._getLightShader=function(){return this._defaultLightShader||(this._pInst._glAttributes.perPixelLighting?this._defaultLightShader=new u.default.Shader(this,c.phongVert,c.phongFrag):this._defaultLightShader=new u.default.Shader(this,c.lightVert,c.lightTextureFrag)),this._defaultLightShader},u.default.RendererGL.prototype._getImmediateModeShader=function(){return this._defaultImmediateModeShader||(this._defaultImmediateModeShader=new u.default.Shader(this,c.immediateVert,c.vertexColorFrag)),this._defaultImmediateModeShader},u.default.RendererGL.prototype._getNormalShader=function(){return this._defaultNormalShader||(this._defaultNormalShader=new u.default.Shader(this,c.normalVert,c.normalFrag)),this._defaultNormalShader},u.default.RendererGL.prototype._getColorShader=function(){return this._defaultColorShader||(this._defaultColorShader=new u.default.Shader(this,c.normalVert,c.basicFrag)),this._defaultColorShader},u.default.RendererGL.prototype._getPointShader=function(){return this._defaultPointShader||(this._defaultPointShader=new u.default.Shader(this,c.pointVert,c.pointFrag)),this._defaultPointShader},u.default.RendererGL.prototype._getLineShader=function(){return this._defaultLineShader||(this._defaultLineShader=new u.default.Shader(this,c.lineVert,c.lineFrag)),this._defaultLineShader},u.default.RendererGL.prototype._getFontShader=function(){return this._defaultFontShader||(this.GL.getExtension("OES_standard_derivatives"),this._defaultFontShader=new u.default.Shader(this,c.fontVert,c.fontFrag)),this._defaultFontShader},u.default.RendererGL.prototype._getEmptyTexture=function(){if(!this._emptyTexture){var e=new u.default.Image(1,1);e.set(0,0,255),this._emptyTexture=new u.default.Texture(this,e)}return this._emptyTexture},u.default.RendererGL.prototype.getTexture=function(e){var t=this.textures,r=!0,i=!1,n=void 0;try{for(var o,a=t[Symbol.iterator]();!(r=(o=a.next()).done);r=!0){var s=o.value;if(s.src===e)return s}}catch(e){i=!0,n=e}finally{try{r||null==a.return||a.return()}finally{if(i)throw n}}var l=new u.default.Texture(this,e);return t.push(l),l},u.default.RendererGL.prototype._setStrokeUniforms=function(e){e.bindShader(),e.setUniform("uMaterialColor",this.curStrokeColor),e.setUniform("uStrokeWeight",this.curStrokeWeight)},u.default.RendererGL.prototype._setFillUniforms=function(e){e.bindShader(),e.setUniform("uMaterialColor",this.curFillColor),e.setUniform("isTexture",!!this._tex),this._tex&&e.setUniform("uSampler",this._tex),e.setUniform("uTint",this._tint),e.setUniform("uSpecular",this._useSpecularMaterial),e.setUniform("uEmissive",this._useEmissiveMaterial),e.setUniform("uShininess",this._useShininess),e.setUniform("uUseLighting",this._enableLighting);var t=this.pointLightDiffuseColors.length/3;e.setUniform("uPointLightCount",t),e.setUniform("uPointLightLocation",this.pointLightPositions),e.setUniform("uPointLightDiffuseColors",this.pointLightDiffuseColors),e.setUniform("uPointLightSpecularColors",this.pointLightSpecularColors);var r=this.directionalLightDiffuseColors.length/3;e.setUniform("uDirectionalLightCount",r),e.setUniform("uLightingDirection",this.directionalLightDirections),e.setUniform("uDirectionalDiffuseColors",this.directionalLightDiffuseColors),e.setUniform("uDirectionalSpecularColors",this.directionalLightSpecularColors);var i=this.ambientLightColors.length/3;e.setUniform("uAmbientLightCount",i),e.setUniform("uAmbientColor",this.ambientLightColors);var n=this.spotLightDiffuseColors.length/3;e.setUniform("uSpotLightCount",n),e.setUniform("uSpotLightAngle",this.spotLightAngle),e.setUniform("uSpotLightConc",this.spotLightConc),e.setUniform("uSpotLightDiffuseColors",this.spotLightDiffuseColors),e.setUniform("uSpotLightSpecularColors",this.spotLightSpecularColors),e.setUniform("uSpotLightLocation",this.spotLightPositions),e.setUniform("uSpotLightDirection",this.spotLightDirections),e.setUniform("uConstantAttenuation",this.constantAttenuation),e.setUniform("uLinearAttenuation",this.linearAttenuation),e.setUniform("uQuadraticAttenuation",this.quadraticAttenuation),e.bindTextures()},u.default.RendererGL.prototype._setPointUniforms=function(e){e.bindShader(),e.setUniform("uMaterialColor",this.curStrokeColor),e.setUniform("uPointSize",this.pointSize)},u.default.RendererGL.prototype._bindBuffer=function(e,t,r,i,n){if(t=t||this.GL.ARRAY_BUFFER,this.GL.bindBuffer(t,e),void 0!==r){var o=new(i||Float32Array)(r);this.GL.bufferData(t,o,n||this.GL.STATIC_DRAW)}},u.default.RendererGL.prototype._arraysEqual=function(e,t){var r=e.length;if(r!==t.length)return!1;for(var i=0;i>7,127&f,c>>7,127&c);for(var d=0;d>7,127&p,0,0)}}return{cellImageInfo:l,dimOffset:o,dimImageInfo:n}}return(t=this.glyphInfos[e.index]={glyph:e,uGlyphRect:[i.x1,-i.y1,i.x2,-i.y2],strokeImageInfo:U,strokes:d,colInfo:G(m,this.colDimImageInfos,this.colCellImageInfos),rowInfo:G(p,this.rowDimImageInfos,this.rowCellImageInfos)}).uGridOffset=[t.colInfo.dimOffset,t.rowInfo.dimOffset],t}}var z=Math.sqrt(3);j.default.RendererGL.prototype._renderText=function(e,t,r,i,n){if(this._textFont&&"string"!=typeof this._textFont){if(!(n<=i)&&this._doFill){if(!this._isOpenType())return console.log("WEBGL: only Opentype (.otf) and Truetype (.ttf) fonts are supported"),e;e.push();var o=this._doStroke,a=this.drawMode;this._doStroke=!1,this.drawMode=D.TEXTURE;var s=this._textFont.font,l=this._textFont._fontInfo;l=l||(this._textFont._fontInfo=new A(s));var u=this._textFont._handleAlignment(this,t,r,i),h=this._textSize/s.unitsPerEm;this.translate(u.x,u.y,0),this.scale(h,h,1);var c=this.GL,f=!this._defaultFontShader,d=this._getFontShader();d.init(),d.bindShader(),f&&(d.setUniform("uGridImageSize",[64,64]),d.setUniform("uCellsImageSize",[64,64]),d.setUniform("uStrokeImageSize",[64,64]),d.setUniform("uGridSize",[9,9])),this._applyColorBlend(this.curFillColor);var p=this.retainedMode.geometry.glyph;if(!p){var m=this._textGeom=new j.default.Geometry(1,1,function(){for(var e=0;e<=1;e++)for(var t=0;t<=1;t++)this.vertices.push(new j.default.Vector(t,e,0)),this.uvs.push(t,e)});m.computeFaces().computeNormals(),p=this.createBuffers("glyph",m)}var g=!0,v=!1,y=void 0;try{for(var b,_=this.retainedMode.buffers.text[Symbol.iterator]();!(g=(b=_.next()).done);g=!0){b.value._prepareBuffer(p,d)}}catch(e){v=!0,y=e}finally{try{g||null==_.return||_.return()}finally{if(v)throw y}}this._bindBuffer(p.indexBuffer,c.ELEMENT_ARRAY_BUFFER),d.setUniform("uMaterialColor",this.curFillColor);try{var x=0,w=null,S=s.stringToGlyphs(t),M=!0,E=!1,T=void 0;try{for(var C,P=S[Symbol.iterator]();!(M=(C=P.next()).done);M=!0){var L=C.value;w&&(x+=s.getKerningValue(w,L));var k=l.getGlyphInfo(L);if(k.uGlyphRect){var R=k.rowInfo,O=k.colInfo;d.setUniform("uSamplerStrokes",k.strokeImageInfo.imageData),d.setUniform("uSamplerRowStrokes",R.cellImageInfo.imageData),d.setUniform("uSamplerRows",R.dimImageInfo.imageData),d.setUniform("uSamplerColStrokes",O.cellImageInfo.imageData),d.setUniform("uSamplerCols",O.dimImageInfo.imageData),d.setUniform("uGridOffset",k.uGridOffset),d.setUniform("uGlyphRect",k.uGlyphRect),d.setUniform("uGlyphOffset",x),d.bindTextures(),c.drawElements(c.TRIANGLES,6,this.GL.UNSIGNED_SHORT,0)}x+=L.advanceWidth,w=L}}catch(e){E=!0,T=e}finally{try{M||null==P.return||P.return()}finally{if(E)throw T}}}finally{d.unbindShader(),this._doStroke=o,this.drawMode=a,e.pop()}return e}}else console.log("WEBGL: you must load and set a font before drawing text. See `loadFont` and `textFont` for more details.")}},{"../core/constants":42,"../core/main":49,"./p5.RendererGL.Retained":102,"./p5.Shader":104}],107:[function(e,t,r){t.exports={fes:{autoplay:"The media that tried to play (with '{{src}}') wasn't allowed to by this browser, most likely due to the browser's autoplay policy. Check out {{link}} for more information about why.",fileLoadError:{bytes:"It looks like there was a problem loading your file. {{suggestion}}",font:"It looks like there was a problem loading your font. {{suggestion}}",gif:"There was some trouble loading your GIF. Make sure that your GIF is using 87a or 89a encoding.",image:"It looks like there was a problem loading your image. {{suggestion}}",json:"It looks like there was a problem loading your JSON file. {{suggestion}}",large:"If your large file isn't fetched successfully, we recommend splitting the file into smaller segments and fetching those.",strings:"It looks like there was a problem loading your text file. {{suggestion}}",suggestion:"Try checking if the file path ({{filePath}}) is correct, hosting the file online, or running a local server. (More info at {{link}})",table:"It looks like there was a problem loading your table file. {{suggestion}}",xml:"It looks like there was a problem loading your XML file. {{suggestion}}"},misusedTopLevel:"Did you just try to use p5.js's {{symbolName}} {{symbolType}}? If so, you may want to move it into your sketch's setup() function.\n\nFor more details, see: {{link}}",pre:"🌸 p5.js says: {{message}}",welcome:"Welcome! This is your friendly debugger. To turn me off, switch to using p5.min.js."}}},{}],108:[function(e,t,r){t.exports={fes:{autoplay:"Su browser impidío un medio tocar (de '{{src}}'), posiblemente porque las reglas de autoplay. Para aprender más, visite {{link}}.",fileLoadError:{bytes:"",font:"",gif:"",image:"",json:"",large:"",strings:"",suggestion:"",table:"",xml:""},misusedTopLevel:"",pre:"🌸 p5.js dice: {{message}}",welcome:""}}},{}],109:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i=o(e("./en/translation")),n=o(e("./es/translation"));function o(e){return e&&e.__esModule?e:{default:e}}var a={en:{translation:i.default},es:{translation:n.default}};r.default=a},{"./en/translation":107,"./es/translation":108}]},{},[37])(37)}); ================================================ FILE: docs/examples/pyodide/samegame/target/target_sketch.js ================================================ const wrapperContent = ` class PythonFunctions: pass setattr(PythonFunctions, 'map', map) setattr(PythonFunctions, 'filter', filter) setattr(PythonFunctions, 'set', set) _P5_INSTANCE = None _CTX_MIDDLE = None _DEFAULT_FILL = None _DEFAULT_LEADMULT = None _DEFAULT_STROKE = None _DEFAULT_TEXT_FILL = None ADD = None ALT = None ARROW = None AUDIO = None AUTO = None AXES = None BACKSPACE = None BASELINE = None BEVEL = None BEZIER = None BLEND = None BLUR = None BOLD = None BOLDITALIC = None BOTTOM = None BURN = None CENTER = None CHORD = None CLAMP = None CLOSE = None CONTROL = None CORNER = None CORNERS = None CROSS = None CURVE = None DARKEST = None DEG_TO_RAD = None DEGREES = None DELETE = None DIFFERENCE = None DILATE = None DODGE = None DOWN_ARROW = None ENTER = None ERODE = None ESCAPE = None EXCLUSION = None FILL = None GRAY = None GRID = None HALF_PI = None HAND = None HARD_LIGHT = None HSB = None HSL = None IMAGE = None IMMEDIATE = None INVERT = None ITALIC = None LANDSCAPE = None LEFT = None LEFT_ARROW = None LIGHTEST = None LINE_LOOP = None LINE_STRIP = None LINEAR = None LINES = None MIRROR = None MITER = None MOVE = None MULTIPLY = None NEAREST = None NORMAL = None OPAQUE = None OPEN = None OPTION = None OVERLAY = None PI = None PIE = None POINTS = None PORTRAIT = None POSTERIZE = None PROJECT = None QUAD_STRIP = None QUADRATIC = None QUADS = None QUARTER_PI = None RAD_TO_DEG = None RADIANS = None RADIUS = None REPEAT = None REPLACE = None RETURN = None RGB = None RIGHT = None RIGHT_ARROW = None ROUND = None SCREEN = None SHIFT = None SOFT_LIGHT = None SQUARE = None STROKE = None SUBTRACT = None TAB = None TAU = None TEXT = None TEXTURE = None THRESHOLD = None TOP = None TRIANGLE_FAN = None TRIANGLE_STRIP = None TRIANGLES = None TWO_PI = None UP_ARROW = None VIDEO = None WAIT = None WEBGL = None P2D = None PI = None frameCount = None focused = None displayWidth = None displayHeight = None windowWidth = None windowHeight = None width = None height = None deviceOrientation = None accelerationX = None accelerationY = None accelerationZ = None pAccelerationX = None pAccelerationY = None pAccelerationZ = None rotationX = None rotationY = None rotationZ = None pRotationX = None pRotationY = None pRotationZ = None turnAxis = None keyIsPressed = None key = None keyCode = None mouseX = None mouseY = None pmouseX = None pmouseY = None winMouseX = None winMouseY = None pwinMouseX = None pwinMouseY = None mouseButton = None mouseIsPressed = None touches = None pixels = None def alpha(*args): return _P5_INSTANCE.alpha(*args) def blue(*args): return _P5_INSTANCE.blue(*args) def brightness(*args): return _P5_INSTANCE.brightness(*args) def color(*args): return _P5_INSTANCE.color(*args) def green(*args): return _P5_INSTANCE.green(*args) def hue(*args): return _P5_INSTANCE.hue(*args) def lerpColor(*args): return _P5_INSTANCE.lerpColor(*args) def lightness(*args): return _P5_INSTANCE.lightness(*args) def red(*args): return _P5_INSTANCE.red(*args) def saturation(*args): return _P5_INSTANCE.saturation(*args) def background(*args): return _P5_INSTANCE.background(*args) def clear(*args): p5_clear = _P5_INSTANCE.clear(*args) return p5_clear def erase(*args): return _P5_INSTANCE.erase(*args) def noErase(*args): return _P5_INSTANCE.noErase(*args) def colorMode(*args): return _P5_INSTANCE.colorMode(*args) def fill(*args): return _P5_INSTANCE.fill(*args) def noFill(*args): return _P5_INSTANCE.noFill(*args) def noStroke(*args): return _P5_INSTANCE.noStroke(*args) def stroke(*args): return _P5_INSTANCE.stroke(*args) def arc(*args): return _P5_INSTANCE.arc(*args) def ellipse(*args): return _P5_INSTANCE.ellipse(*args) def circle(*args): return _P5_INSTANCE.circle(*args) def line(*args): return _P5_INSTANCE.line(*args) def point(*args): return _P5_INSTANCE.point(*args) def quad(*args): return _P5_INSTANCE.quad(*args) def rect(*args): return _P5_INSTANCE.rect(*args) def square(*args): return _P5_INSTANCE.square(*args) def triangle(*args): return _P5_INSTANCE.triangle(*args) def plane(*args): return _P5_INSTANCE.plane(*args) def box(*args): return _P5_INSTANCE.box(*args) def sphere(*args): return _P5_INSTANCE.sphere(*args) def cylinder(*args): return _P5_INSTANCE.cylinder(*args) def cone(*args): return _P5_INSTANCE.cone(*args) def ellipsoid(*args): return _P5_INSTANCE.ellipsoid(*args) def torus(*args): return _P5_INSTANCE.torus(*args) def loadModel(*args): return _P5_INSTANCE.loadModel(*args) def model(*args): return _P5_INSTANCE.model(*args) def ellipseMode(*args): return _P5_INSTANCE.ellipseMode(*args) def noSmooth(*args): return _P5_INSTANCE.noSmooth(*args) def rectMode(*args): return _P5_INSTANCE.rectMode(*args) def smooth(*args): return _P5_INSTANCE.smooth(*args) def strokeCap(*args): return _P5_INSTANCE.strokeCap(*args) def strokeJoin(*args): return _P5_INSTANCE.strokeJoin(*args) def strokeWeight(*args): return _P5_INSTANCE.strokeWeight(*args) def bezier(*args): return _P5_INSTANCE.bezier(*args) def bezierDetail(*args): return _P5_INSTANCE.bezierDetail(*args) def bezierPoint(*args): return _P5_INSTANCE.bezierPoint(*args) def bezierTangent(*args): return _P5_INSTANCE.bezierTangent(*args) def curve(*args): return _P5_INSTANCE.curve(*args) def curveDetail(*args): return _P5_INSTANCE.curveDetail(*args) def curveTightness(*args): return _P5_INSTANCE.curveTightness(*args) def curvePoint(*args): return _P5_INSTANCE.curvePoint(*args) def curveTangent(*args): return _P5_INSTANCE.curveTangent(*args) def beginContour(*args): return _P5_INSTANCE.beginContour(*args) def beginShape(*args): return _P5_INSTANCE.beginShape(*args) def bezierVertex(*args): return _P5_INSTANCE.bezierVertex(*args) def curveVertex(*args): return _P5_INSTANCE.curveVertex(*args) def endContour(*args): return _P5_INSTANCE.endContour(*args) def endShape(*args): return _P5_INSTANCE.endShape(*args) def quadraticVertex(*args): return _P5_INSTANCE.quadraticVertex(*args) def vertex(*args): return _P5_INSTANCE.vertex(*args) def cursor(*args): return _P5_INSTANCE.cursor(*args) def frameRate(*args): return _P5_INSTANCE.frameRate(*args) def noCursor(*args): return _P5_INSTANCE.noCursor(*args) def fullscreen(*args): return _P5_INSTANCE.fullscreen(*args) def pixelDensity(*args): return _P5_INSTANCE.pixelDensity(*args) def displayDensity(*args): return _P5_INSTANCE.displayDensity(*args) def getURL(*args): return _P5_INSTANCE.getURL(*args) def getURLPath(*args): return _P5_INSTANCE.getURLPath(*args) def getURLParams(*args): return _P5_INSTANCE.getURLParams(*args) def remove(*args): return _P5_INSTANCE.remove(*args) def noLoop(*args): return _P5_INSTANCE.noLoop(*args) def loop(*args): return _P5_INSTANCE.loop(*args) def push(*args): return _P5_INSTANCE.push(*args) def redraw(*args): return _P5_INSTANCE.redraw(*args) def resizeCanvas(*args): return _P5_INSTANCE.resizeCanvas(*args) def noCanvas(*args): return _P5_INSTANCE.noCanvas(*args) def createGraphics(*args): return _P5_INSTANCE.createGraphics(*args) def blendMode(*args): return _P5_INSTANCE.blendMode(*args) def setAttributes(*args): return _P5_INSTANCE.setAttributes(*args) def applyMatrix(*args): return _P5_INSTANCE.applyMatrix(*args) def resetMatrix(*args): return _P5_INSTANCE.resetMatrix(*args) def rotate(*args): return _P5_INSTANCE.rotate(*args) def rotateX(*args): return _P5_INSTANCE.rotateX(*args) def rotateY(*args): return _P5_INSTANCE.rotateY(*args) def rotateZ(*args): return _P5_INSTANCE.rotateZ(*args) def scale(*args): return _P5_INSTANCE.scale(*args) def shearX(*args): return _P5_INSTANCE.shearX(*args) def shearY(*args): return _P5_INSTANCE.shearY(*args) def translate(*args): return _P5_INSTANCE.translate(*args) def createStringDict(*args): return _P5_INSTANCE.createStringDict(*args) def createNumberDict(*args): return _P5_INSTANCE.createNumberDict(*args) def append(*args): return _P5_INSTANCE.append(*args) def arrayCopy(*args): return _P5_INSTANCE.arrayCopy(*args) def concat(*args): return _P5_INSTANCE.concat(*args) def reverse(*args): return _P5_INSTANCE.reverse(*args) def shorten(*args): return _P5_INSTANCE.shorten(*args) def shuffle(*args): return _P5_INSTANCE.shuffle(*args) def sort(*args): return _P5_INSTANCE.sort(*args) def splice(*args): return _P5_INSTANCE.splice(*args) def subset(*args): return _P5_INSTANCE.subset(*args) def float(*args): return _P5_INSTANCE.float(*args) def int(*args): return _P5_INSTANCE.int(*args) def str(*args): return _P5_INSTANCE.str(*args) def boolean(*args): return _P5_INSTANCE.boolean(*args) def byte(*args): return _P5_INSTANCE.byte(*args) def char(*args): return _P5_INSTANCE.char(*args) def unchar(*args): return _P5_INSTANCE.unchar(*args) def hex(*args): return _P5_INSTANCE.hex(*args) def unhex(*args): return _P5_INSTANCE.unhex(*args) def join(*args): return _P5_INSTANCE.join(*args) def match(*args): return _P5_INSTANCE.match(*args) def matchAll(*args): return _P5_INSTANCE.matchAll(*args) def nf(*args): return _P5_INSTANCE.nf(*args) def nfc(*args): return _P5_INSTANCE.nfc(*args) def nfp(*args): return _P5_INSTANCE.nfp(*args) def nfs(*args): return _P5_INSTANCE.nfs(*args) def split(*args): return _P5_INSTANCE.split(*args) def splitTokens(*args): return _P5_INSTANCE.splitTokens(*args) def trim(*args): return _P5_INSTANCE.trim(*args) def setMoveThreshold(*args): return _P5_INSTANCE.setMoveThreshold(*args) def setShakeThreshold(*args): return _P5_INSTANCE.setShakeThreshold(*args) def keyIsDown(*args): return _P5_INSTANCE.keyIsDown(*args) def createImage(*args): return _P5_INSTANCE.createImage(*args) def saveCanvas(*args): return _P5_INSTANCE.saveCanvas(*args) def saveFrames(*args): return _P5_INSTANCE.saveFrames(*args) def loadImage(*args): return _P5_INSTANCE.loadImage(*args) def image(*args): return _P5_INSTANCE.image(*args) def tint(*args): return _P5_INSTANCE.tint(*args) def noTint(*args): return _P5_INSTANCE.noTint(*args) def imageMode(*args): return _P5_INSTANCE.imageMode(*args) def blend(*args): return _P5_INSTANCE.blend(*args) def copy(*args): return _P5_INSTANCE.copy(*args) def filter(*args): if len(args) > 1 and (args[0] is None or callable(args[0])): return PythonFunctions.filter(*args) else: return _P5_INSTANCE.filter(*args) def get(*args): return _P5_INSTANCE.get(*args) def loadPixels(*args): return _P5_INSTANCE.loadPixels(*args) def set(*args): if len(args) <= 1: return PythonFunctions.set(*args) else: return _P5_INSTANCE.set(*args) def updatePixels(*args): return _P5_INSTANCE.updatePixels(*args) def loadJSON(*args): return _P5_INSTANCE.loadJSON(*args) def loadStrings(*args): return _P5_INSTANCE.loadStrings(*args) def loadTable(*args): return _P5_INSTANCE.loadTable(*args) def loadXML(*args): return _P5_INSTANCE.loadXML(*args) def loadBytes(*args): return _P5_INSTANCE.loadBytes(*args) def httpGet(*args): return _P5_INSTANCE.httpGet(*args) def httpPost(*args): return _P5_INSTANCE.httpPost(*args) def httpDo(*args): return _P5_INSTANCE.httpDo(*args) def createWriter(*args): return _P5_INSTANCE.createWriter(*args) def save(*args): return _P5_INSTANCE.save(*args) def saveJSON(*args): return _P5_INSTANCE.saveJSON(*args) def saveStrings(*args): return _P5_INSTANCE.saveStrings(*args) def saveTable(*args): return _P5_INSTANCE.saveTable(*args) def day(*args): return _P5_INSTANCE.day(*args) def hour(*args): return _P5_INSTANCE.hour(*args) def minute(*args): return _P5_INSTANCE.minute(*args) def millis(*args): return _P5_INSTANCE.millis(*args) def month(*args): return _P5_INSTANCE.month(*args) def second(*args): return _P5_INSTANCE.second(*args) def year(*args): return _P5_INSTANCE.year(*args) def createVector(*args): return _P5_INSTANCE.createVector(*args) def abs(*args): return _P5_INSTANCE.abs(*args) def ceil(*args): return _P5_INSTANCE.ceil(*args) def constrain(*args): return _P5_INSTANCE.constrain(*args) def dist(*args): return _P5_INSTANCE.dist(*args) def exp(*args): return _P5_INSTANCE.exp(*args) def floor(*args): return _P5_INSTANCE.floor(*args) def lerp(*args): return _P5_INSTANCE.lerp(*args) def log(*args): return _P5_INSTANCE.log(*args) def mag(*args): return _P5_INSTANCE.mag(*args) def map(*args): if len(args) > 1 and callable(args[0]): return PythonFunctions.map(*args) else: return _P5_INSTANCE.map(*args) def max(*args): return _P5_INSTANCE.max(*args) def min(*args): return _P5_INSTANCE.min(*args) def norm(*args): return _P5_INSTANCE.norm(*args) def pow(*args): return _P5_INSTANCE.pow(*args) def round(*args): return _P5_INSTANCE.round(*args) def sq(*args): return _P5_INSTANCE.sq(*args) def sqrt(*args): return _P5_INSTANCE.sqrt(*args) def noise(*args): return _P5_INSTANCE.noise(*args) def noiseDetail(*args): return _P5_INSTANCE.noiseDetail(*args) def noiseSeed(*args): return _P5_INSTANCE.noiseSeed(*args) def randomSeed(*args): return _P5_INSTANCE.randomSeed(*args) def random(*args): return _P5_INSTANCE.random(*args) def randomGaussian(*args): return _P5_INSTANCE.randomGaussian(*args) def acos(*args): return _P5_INSTANCE.acos(*args) def asin(*args): return _P5_INSTANCE.asin(*args) def atan(*args): return _P5_INSTANCE.atan(*args) def atan2(*args): return _P5_INSTANCE.atan2(*args) def cos(*args): return _P5_INSTANCE.cos(*args) def sin(*args): return _P5_INSTANCE.sin(*args) def tan(*args): return _P5_INSTANCE.tan(*args) def degrees(*args): return _P5_INSTANCE.degrees(*args) def radians(*args): return _P5_INSTANCE.radians(*args) def angleMode(*args): return _P5_INSTANCE.angleMode(*args) def textAlign(*args): return _P5_INSTANCE.textAlign(*args) def textLeading(*args): return _P5_INSTANCE.textLeading(*args) def textSize(*args): return _P5_INSTANCE.textSize(*args) def textStyle(*args): return _P5_INSTANCE.textStyle(*args) def textWidth(*args): return _P5_INSTANCE.textWidth(*args) def textAscent(*args): return _P5_INSTANCE.textAscent(*args) def textDescent(*args): return _P5_INSTANCE.textDescent(*args) def loadFont(*args): return _P5_INSTANCE.loadFont(*args) def text(*args): return _P5_INSTANCE.text(*args) def textFont(*args): return _P5_INSTANCE.textFont(*args) def orbitControl(*args): return _P5_INSTANCE.orbitControl(*args) def debugMode(*args): return _P5_INSTANCE.debugMode(*args) def noDebugMode(*args): return _P5_INSTANCE.noDebugMode(*args) def ambientLight(*args): return _P5_INSTANCE.ambientLight(*args) def directionalLight(*args): return _P5_INSTANCE.directionalLight(*args) def pointLight(*args): return _P5_INSTANCE.pointLight(*args) def lights(*args): return _P5_INSTANCE.lights(*args) def loadShader(*args): return _P5_INSTANCE.loadShader(*args) def createShader(*args): return _P5_INSTANCE.createShader(*args) def shader(*args): return _P5_INSTANCE.shader(*args) def resetShader(*args): return _P5_INSTANCE.resetShader(*args) def normalMaterial(*args): return _P5_INSTANCE.normalMaterial(*args) def texture(*args): return _P5_INSTANCE.texture(*args) def textureMode(*args): return _P5_INSTANCE.textureMode(*args) def textureWrap(*args): return _P5_INSTANCE.textureWrap(*args) def ambientMaterial(*args): return _P5_INSTANCE.ambientMaterial(*args) def specularMaterial(*args): return _P5_INSTANCE.specularMaterial(*args) def shininess(*args): return _P5_INSTANCE.shininess(*args) def camera(*args): return _P5_INSTANCE.camera(*args) def perspective(*args): return _P5_INSTANCE.perspective(*args) def ortho(*args): return _P5_INSTANCE.ortho(*args) def createCamera(*args): return _P5_INSTANCE.createCamera(*args) def setCamera(*args): return _P5_INSTANCE.setCamera(*args) def select(*args): return _P5_INSTANCE.select(*args) def selectAll(*args): return _P5_INSTANCE.selectAll(*args) def removeElements(*args): return _P5_INSTANCE.removeElements(*args) def changed(*args): return _P5_INSTANCE.changed(*args) def input(*args): return _P5_INSTANCE.input(*args) def createDiv(*args): return _P5_INSTANCE.createDiv(*args) def createP(*args): return _P5_INSTANCE.createP(*args) def createSpan(*args): return _P5_INSTANCE.createSpan(*args) def createImg(*args): return _P5_INSTANCE.createImg(*args) def createA(*args): return _P5_INSTANCE.createA(*args) def createSlider(*args): return _P5_INSTANCE.createSlider(*args) def createButton(*args): return _P5_INSTANCE.createButton(*args) def createCheckbox(*args): return _P5_INSTANCE.createCheckbox(*args) def createSelect(*args): return _P5_INSTANCE.createSelect(*args) def createRadio(*args): return _P5_INSTANCE.createRadio(*args) def createColorPicker(*args): return _P5_INSTANCE.createColorPicker(*args) def createInput(*args): return _P5_INSTANCE.createInput(*args) def createFileInput(*args): return _P5_INSTANCE.createFileInput(*args) def createVideo(*args): return _P5_INSTANCE.createVideo(*args) def createAudio(*args): return _P5_INSTANCE.createAudio(*args) def createCapture(*args): return _P5_INSTANCE.createCapture(*args) def createElement(*args): return _P5_INSTANCE.createElement(*args) def createCanvas(*args): canvas = _P5_INSTANCE.createCanvas(*args) global width, height width = _P5_INSTANCE.width height = _P5_INSTANCE.height return canvas def __deviceMoved(e): try: _bind_event_function(deviceMoved, e) except NameError: pass def __deviceTurned(e): try: _bind_event_function(deviceTurned, e) except NameError: pass def __deviceShaken(e): try: _bind_event_function(deviceShaken, e) except NameError: pass def __touchEnded(e): try: _bind_event_function(deviceShaken, e) except NameError: pass def __touchStarted(e): try: _bind_event_function(touchStarted, e) except NameError: pass def __windowResized(e): try: _bind_event_function(windowResized, e) except NameError: pass def __touchMoved(e): try: _bind_event_function(touchMoved, e) except NameError: pass def __mouseMoved(e): try: _bind_event_function(mouseMoved, e) except NameError: pass def __mouseDragged(e): try: _bind_event_function(mouseDragged, e) except NameError: pass def __mousePressed(e): try: _bind_event_function(mousePressed, e) except NameError: pass def __mouseReleased(e): try: _bind_event_function(mouseReleased, e) except NameError: pass def __mouseClicked(e): try: _bind_event_function(mouseClicked, e) except NameError: pass def __doubleClicked(e): try: _bind_event_function(doubleClicked, e) except NameError: pass def __mouseWheel(e): try: _bind_event_function(mouseWheel, e) except NameError: pass def __keyPressed(e): try: _bind_event_function(keyPressed, e) except NameError: pass def __keyReleased(e): try: _bind_event_function(keyReleased, e) except NameError: pass def __keyTyped(e): try: _bind_event_function(keyTyped, e) except NameError: pass def __keyIsDown(e): try: _bind_event_function(keyIsDown, e) except NameError: pass def pop(*args): p5_pop = _P5_INSTANCE.pop(*args) return p5_pop # Processing Python or Java mode compatibility aliases size = createCanvas popMatrix = pop popStyle = pop pushMatrix = push pushStyle = push # PVector is a wrapper/helper class for p5.Vector objets # providing names similar to Processing Python or Java modes # but mostly keeping p5js functionality from numbers import Number class PVector: def __init__(self, x=0, y=0, z=0): self.__vector = createVector(x, y, z) self.add = self.__instance_add__ self.sub = self.__instance_sub__ self.mult = self.__instance_mult__ self.div = self.__instance_div__ self.cross = self.__instance_cross__ self.dist = self.__instance_dist__ self.dot = self.__instance_dot__ self.lerp = self.__instance_lerp__ @property def x(self): return self.__vector.x @x.setter def x(self, x): self.__vector.x = x @property def y(self): return self.__vector.y @y.setter def y(self, y): self.__vector.y = y @property def z(self): return self.__vector.z @z.setter def z(self, z): self.__vector.z = z def mag(self): return self.__vector.mag() def magSq(self): return self.__vector.magSq() def setMag(self, mag): self.__vector.setMag(mag) return self def normalize(self): self.__vector.normalize() return self def limit(self, max): self.__vector.limit(max) return self def heading(self): return self.__vector.heading() def rotate(self, angle): self.__vector.rotate(angle) return self def __instance_add__(self, *args): if len(args) == 1: return PVector.add(self, args[0], self) else: return PVector.add(self, PVector(*args), self) def __instance_sub__(self, *args): if len(args) == 1: return PVector.sub(self, args[0], self) else: return PVector.sub(self, PVector(*args), self) def __instance_mult__(self, o): return PVector.mult(self, o, self) def __instance_div__(self, f): return PVector.div(self, f, self) def __instance_cross__(self, o): return PVector.cross(self, o, self) def __instance_dist__(self, o): return PVector.dist(self, o) def __instance_dot__(self, *args): if len(args) == 1: v = args[0] else: v = args return self.x * v[0] + self.y * v[1] + self.z * v[2] def __instance_lerp__(self, *args): if len(args) == 2: return PVector.lerp(self, args[0], args[1], self) else: vx, vy, vz, f = args return PVector.lerp(self, PVector(vx, vy, vz), f, self) def get(self): return PVector(self.x, self.y, self.z) def copy(self): return PVector(self.x, self.y, self.z) def __getitem__(self, k): return getattr(self, ('x', 'y', 'z')[k]) def __setitem__(self, k, v): setattr(self, ('x', 'y', 'z')[k], v) def __copy__(self): return PVector(self.x, self.y, self.z) def __deepcopy__(self, memo): return PVector(self.x, self.y, self.z) def __repr__(self): # PROVISÓRIO return f'PVector({self.x}, {self.y}, {self.z})' def set(self, *args): """ Sets the x, y, and z component of the vector using two or three separate variables, the data from a p5.Vector, or the values from a float array. """ self.__vector.set(*args) @classmethod def add(cls, a, b, dest=None): if dest is None: return PVector(a.x + b[0], a.y + b[1], a.z + b[2]) dest.__vector.set(a.x + b[0], a.y + b[1], a.z + b[2]) return dest @classmethod def sub(cls, a, b, dest=None): if dest is None: return PVector(a.x - b[0], a.y - b[1], a.z - b[2]) dest.__vector.set(a.x - b[0], a.y - b[1], a.z - b[2]) return dest @classmethod def mult(cls, a, b, dest=None): if dest is None: return PVector(a.x * b, a.y * b, a.z * b) dest.__vector.set(a.x * b, a.y * b, a.z * b) return dest @classmethod def div(cls, a, b, dest=None): if dest is None: return PVector(a.x / b, a.y / b, a.z / b) dest.__vector.set(a.x / b, a.y / b, a.z / b) return dest @classmethod def dist(cls, a, b): return a.__vector.dist(b.__vector) @classmethod def dot(cls, a, b): return a.__vector.dot(b.__vector) def __add__(a, b): return PVector.add(a, b, None) def __sub__(a, b): return PVector.sub(a, b, None) def __isub__(a, b): a.sub(b) return a def __iadd__(a, b): a.add(b) return a def __mul__(a, b): if not isinstance(b, Number): raise TypeError( "The * operator can only be used to multiply a PVector by a number") return PVector.mult(a, float(b), None) def __rmul__(a, b): if not isinstance(b, Number): raise TypeError( "The * operator can only be used to multiply a PVector by a number") return PVector.mult(a, float(b), None) def __imul__(a, b): if not isinstance(b, Number): raise TypeError( "The *= operator can only be used to multiply a PVector by a number") a.__vector.mult(float(b)) return a def __truediv__(a, b): if not isinstance(b, Number): raise TypeError( "The * operator can only be used to multiply a PVector by a number") return PVector(a.x / float(b), a.y / float(b), a.z / float(b)) def __itruediv__(a, b): if not isinstance(b, Number): raise TypeError( "The /= operator can only be used to multiply a PVector by a number") a.__vector.set(a.x / float(b), a.y / float(b), a.z / float(b)) return a def __eq__(a, b): return a.x == b[0] and a.y == b[1] and a.z == b[2] def __lt__(a, b): return a.magSq() < b.magSq() def __le__(a, b): return a.magSq() <= b.magSq() def __gt__(a, b): return a.magSq() > b.magSq() def __ge__(a, b): return a.magSq() >= b.magSq() # Problematic class methods, we would rather use p5.Vector when possible... @classmethod def lerp(cls, a, b, f, dest=None): v = createVector(a.x, a.y, a.z) v.lerp(b.__vector, f) if dest is None: return PVector(v.x, v.y, v.z) dest.set(v.x, v.y, v.z) return dest @classmethod def cross(cls, a, b, dest=None): x = a.y * b[2] - b[1] * a.z y = a.z * b[0] - b[2] * a.x z = a.x * b[1] - b[0] * a.y if dest is None: return PVector(x, y, z) dest.set(x, y, z) return dest @classmethod def fromAngle(cls, angle, length=1): # https://github.com/processing/p5.js/blob/3f0b2f0fe575dc81c724474154f5b23a517b7233/src/math/p5.Vector.js return PVector(length * cos(angle), length * sin(angle), 0) @classmethod def fromAngles(theta, phi, length=1): # https://github.com/processing/p5.js/blob/3f0b2f0fe575dc81c724474154f5b23a517b7233/src/math/p5.Vector.js cosPhi = cos(phi) sinPhi = sin(phi) cosTheta = cos(theta) sinTheta = sin(theta) return PVector(length * sinTheta * sinPhi, -length * cosTheta, length * sinTheta * cosPhi) @classmethod def random2D(cls): return PVector.fromAngle(random(TWO_PI)) @classmethod def random3D(cls, dest=None): angle = random(TWO_PI) vz = random(2) - 1 mult = sqrt(1 - vz * vz) vx = mult * cos(angle) vy = mult * sin(angle) if dest is None: return PVector(vx, vy, vz) dest.set(vx, vy, vz) return dest @classmethod def angleBetween(cls, a, b): return acos(a.dot(b) / sqrt(a.magSq() * b.magSq())) # Other harmless p5js methods def equals(self, v): return self == v def heading2D(self): return self.__vector.heading() def reflect(self, *args): # Reflect the incoming vector about a normal to a line in 2D, or about # a normal to a plane in 3D This method acts on the vector directly r = self.__vector.reflect(*args) return r def array(self): # Return a representation of this vector as a float array. This is only # for temporary use. If used in any w fashion, the contents should be # copied by using the p5.Vector.copy() method to copy into your own # array. return self.__vector.array() def toString(self): # Returns a string representation of a vector v by calling String(v) or v.toString(). # return self.__vector.toString() would be something like "p5.vector # Object […, …, …]" return str(self) def rem(self, *args): # Gives remainder of a vector when it is divided by anw vector. See # examples for more context. self.__vector.rem(*args) return self def pre_draw(p5_instance, draw_func, *args, **kwargs): """ We need to run this before the actual draw to insert and update p5 env variables """ global _CTX_MIDDLE, _DEFAULT_FILL, _DEFAULT_LEADMULT, _DEFAULT_STROKE, _DEFAULT_TEXT_FILL global ADD, ALT, ARROW, AUTO, AUDIO, AXES, BACKSPACE, BASELINE, BEVEL, BEZIER, BLEND, BLUR, BOLD, BOLDITALIC global BOTTOM, BURN, CENTER, CHORD, CLAMP, CLOSE, CONTROL, CORNER, CORNERS, CROSS, CURVE, DARKEST global DEG_TO_RAD, DEGREES, DELETE, DIFFERENCE, DILATE, DODGE, DOWN_ARROW, ENTER, ERODE, ESCAPE, EXCLUSION global FILL, GRAY, GRID, HALF_PI, HAND, HARD_LIGHT, HSB, HSL, IMAGE, IMMEDIATE, INVERT, ITALIC, LANDSCAPE global LEFT, LEFT_ARROW, LIGHTEST, LINE_LOOP, LINE_STRIP, LINEAR, LINES, MIRROR, MITER, MOVE, MULTIPLY, NEAREST global NORMAL, OPAQUE, OPEN, OPTION, OVERLAY, P2D, P3D, PI, PIE, POINTS, PORTRAIT, POSTERIZE, PROJECT, QUAD_STRIP global QUADRATIC, QUADS, QUARTER_PI, RAD_TO_DEG, RADIANS, RADIUS, REPEAT, REPLACE, RETURN, RGB, RIGHT, RIGHT_ARROW global ROUND, SCREEN, SHIFT, SOFT_LIGHT, SQUARE, STROKE, SUBTRACT, TAB, TAU, TEXT, TEXTURE, THRESHOLD, TOP global TRIANGLE_FAN, TRIANGLE_STRIP, TRIANGLES, TWO_PI, UP_ARROW, VIDEO, WAIT, WEBGL global frameCount, focused, displayWidth, displayHeight, windowWidth, windowHeight, width, height global deviceOrientation, accelerationX, accelerationY, accelerationZ global pAccelerationX, pAccelerationY, pAccelerationZ, rotationX, rotationY, rotationZ global pRotationX, pRotationY, pRotationZ, turnAxis, keyIsPressed, key, keyCode, mouseX, mouseY, pmouseX, pmouseY global winMouseX, winMouseY, pwinMouseX, pwinMouseY, mouseButton, mouseIsPressed, touches, pixels _CTX_MIDDLE = p5_instance._CTX_MIDDLE _DEFAULT_FILL = p5_instance._DEFAULT_FILL _DEFAULT_LEADMULT = p5_instance._DEFAULT_LEADMULT _DEFAULT_STROKE = p5_instance._DEFAULT_STROKE _DEFAULT_TEXT_FILL = p5_instance._DEFAULT_TEXT_FILL ADD = p5_instance.ADD ALT = p5_instance.ALT ARROW = p5_instance.ARROW AUDIO = p5_instance.AUDIO AUTO = p5_instance.AUTO AXES = p5_instance.AXES BACKSPACE = p5_instance.BACKSPACE BASELINE = p5_instance.BASELINE BEVEL = p5_instance.BEVEL BEZIER = p5_instance.BEZIER BLEND = p5_instance.BLEND BLUR = p5_instance.BLUR BOLD = p5_instance.BOLD BOLDITALIC = p5_instance.BOLDITALIC BOTTOM = p5_instance.BOTTOM BURN = p5_instance.BURN CENTER = p5_instance.CENTER CHORD = p5_instance.CHORD CLAMP = p5_instance.CLAMP CLOSE = p5_instance.CLOSE CONTROL = p5_instance.CONTROL CORNER = p5_instance.CORNER CORNERS = p5_instance.CORNERS CROSS = p5_instance.CROSS CURVE = p5_instance.CURVE DARKEST = p5_instance.DARKEST DEG_TO_RAD = p5_instance.DEG_TO_RAD DEGREES = p5_instance.DEGREES DELETE = p5_instance.DELETE DIFFERENCE = p5_instance.DIFFERENCE DILATE = p5_instance.DILATE DODGE = p5_instance.DODGE DOWN_ARROW = p5_instance.DOWN_ARROW ENTER = p5_instance.ENTER ERODE = p5_instance.ERODE ESCAPE = p5_instance.ESCAPE EXCLUSION = p5_instance.EXCLUSION FILL = p5_instance.FILL GRAY = p5_instance.GRAY GRID = p5_instance.GRID HALF_PI = p5_instance.HALF_PI HAND = p5_instance.HAND HARD_LIGHT = p5_instance.HARD_LIGHT HSB = p5_instance.HSB HSL = p5_instance.HSL IMAGE = p5_instance.IMAGE IMMEDIATE = p5_instance.IMMEDIATE INVERT = p5_instance.INVERT ITALIC = p5_instance.ITALIC LANDSCAPE = p5_instance.LANDSCAPE LEFT = p5_instance.LEFT LEFT_ARROW = p5_instance.LEFT_ARROW LIGHTEST = p5_instance.LIGHTEST LINE_LOOP = p5_instance.LINE_LOOP LINE_STRIP = p5_instance.LINE_STRIP LINEAR = p5_instance.LINEAR LINES = p5_instance.LINES MIRROR = p5_instance.MIRROR MITER = p5_instance.MITER MOVE = p5_instance.MOVE MULTIPLY = p5_instance.MULTIPLY NEAREST = p5_instance.NEAREST NORMAL = p5_instance.NORMAL OPAQUE = p5_instance.OPAQUE OPEN = p5_instance.OPEN OPTION = p5_instance.OPTION OVERLAY = p5_instance.OVERLAY P2D = p5_instance.P2D P3D = p5_instance.WEBGL PI = p5_instance.PI PIE = p5_instance.PIE POINTS = p5_instance.POINTS PORTRAIT = p5_instance.PORTRAIT POSTERIZE = p5_instance.POSTERIZE PROJECT = p5_instance.PROJECT QUAD_STRIP = p5_instance.QUAD_STRIP QUADRATIC = p5_instance.QUADRATIC QUADS = p5_instance.QUADS QUARTER_PI = p5_instance.QUARTER_PI RAD_TO_DEG = p5_instance.RAD_TO_DEG RADIANS = p5_instance.RADIANS RADIUS = p5_instance.RADIUS REPEAT = p5_instance.REPEAT REPLACE = p5_instance.REPLACE RETURN = p5_instance.RETURN RGB = p5_instance.RGB RIGHT = p5_instance.RIGHT RIGHT_ARROW = p5_instance.RIGHT_ARROW ROUND = p5_instance.ROUND SCREEN = p5_instance.SCREEN SHIFT = p5_instance.SHIFT SOFT_LIGHT = p5_instance.SOFT_LIGHT SQUARE = p5_instance.SQUARE STROKE = p5_instance.STROKE SUBTRACT = p5_instance.SUBTRACT TAB = p5_instance.TAB TAU = p5_instance.TAU TEXT = p5_instance.TEXT TEXTURE = p5_instance.TEXTURE THRESHOLD = p5_instance.THRESHOLD TOP = p5_instance.TOP TRIANGLE_FAN = p5_instance.TRIANGLE_FAN TRIANGLE_STRIP = p5_instance.TRIANGLE_STRIP TRIANGLES = p5_instance.TRIANGLES TWO_PI = p5_instance.TWO_PI UP_ARROW = p5_instance.UP_ARROW VIDEO = p5_instance.VIDEO WAIT = p5_instance.WAIT WEBGL = p5_instance.WEBGL frameCount = p5_instance.frameCount focused = p5_instance.focused displayWidth = p5_instance.displayWidth displayHeight = p5_instance.displayHeight windowWidth = p5_instance.windowWidth windowHeight = p5_instance.windowHeight width = p5_instance.width height = p5_instance.height deviceOrientation = p5_instance.deviceOrientation accelerationX = p5_instance.accelerationX accelerationY = p5_instance.accelerationY accelerationZ = p5_instance.accelerationZ pAccelerationX = p5_instance.pAccelerationX pAccelerationY = p5_instance.pAccelerationY pAccelerationZ = p5_instance.pAccelerationZ rotationX = p5_instance.rotationX rotationY = p5_instance.rotationY rotationZ = p5_instance.rotationZ pRotationX = p5_instance.pRotationX pRotationY = p5_instance.pRotationY pRotationZ = p5_instance.pRotationZ turnAxis = p5_instance.turnAxis keyIsPressed = p5_instance.keyIsPressed key = p5_instance.key keyCode = p5_instance.keyCode mouseX = p5_instance.mouseX mouseY = p5_instance.mouseY pmouseX = p5_instance.pmouseX pmouseY = p5_instance.pmouseY winMouseX = p5_instance.winMouseX winMouseY = p5_instance.winMouseY pwinMouseX = p5_instance.pwinMouseX pwinMouseY = p5_instance.pwinMouseY mouseButton = p5_instance.mouseButton mouseIsPressed = p5_instance.mouseIsPressed touches = p5_instance.touches pixels = p5_instance.pixels return draw_func(*args, **kwargs) def global_p5_injection(p5_sketch): """ Injects the p5js's skecth instance as a global variable to setup and draw functions """ def decorator(f, *args, **kwargs): def wrapper(*args, **kwargs): global _P5_INSTANCE _P5_INSTANCE = p5_sketch return pre_draw(_P5_INSTANCE, f, *args, **kwargs) return wrapper return decorator def start_p5(preload_func, setup_func, draw_func, event_functions): """ This is the entrypoint function. It accepts 2 parameters: - preload_func: A Python preload callable - setup_func: a Python setup callable - draw_func: a Python draw callable - event_functions: a config dict for the event functions in the format: {"eventFunctionName": python_event_function} This method gets the p5js's sketch instance and injects them """ def sketch_setup(p5_sketch): """ Callback function called to configure new p5 instance """ p5_sketch.preload = global_p5_injection(p5_sketch)(preload_func) p5_sketch.setup = global_p5_injection(p5_sketch)(setup_func) p5_sketch.draw = global_p5_injection(p5_sketch)(draw_func) window.instance = p5.new(sketch_setup, 'sketch-holder') # Register event functions event_function_names = ( "deviceMoved", "deviceTurned", "deviceShaken", "windowResized", "keyPressed", "keyReleased", "keyTyped", "mousePressed", "mouseReleased", "mouseClicked", "doubleClicked", "mouseMoved", "mouseDragged", "mouseWheel", "touchStarted", "touchMoved", "touchEnded", "keyIsDown", ) for f_name in [f for f in event_function_names if event_functions.get(f, None)]: func = event_functions[f_name] event_func = global_p5_injection(window.instance)(func) setattr(window.instance, f_name, event_func) `; const placeholder = ` def preload(): pass def setup(): pass def draw(): pass deviceMoved = None deviceTurned = None deviceShaken = None keyPressed = None keyReleased = None keyTyped = None mouseMoved = None mouseDragged = None mousePressed = None mouseReleased = None mouseClicked = None doubleClicked = None mouseWheel = None touchStarted = None touchMoved = None touchEnded = None windowResized = None `; let userCode = ` NROWS = 10 # numer of brick rows NCOLS = 20 # number of brick columns NCOLORS = 4 # 1 .. 5 B_WIDTH = 50 # brick width FPS = 30 # frames per second C_WIDTH = NCOLS * B_WIDTH # canvas width C_HEIGHT = NROWS * B_WIDTH # canvas height game = None def setup(): global game createCanvas(C_WIDTH, C_HEIGHT, P2D) rectMode(CENTER) frameRate(FPS) game = SameGame() def draw(): global game game.plotBoard() def inCell(x,y): return (int(x) // (B_WIDTH + 1), int(y) // (B_WIDTH + 1)) def inCanvas(x,y): return (0 <= x <= C_WIDTH) and (0 <= y <= C_HEIGHT) def mousePressed(): global game x, y = mouseX, mouseY i, j = inCell(x,y) if (0 <= i < game.nc) and (0 <= j < game.nr): if not game.alone(i,j): game.floodfill(i,j) game.fall_all() def keyPressed(): global game if key == "n": game = SameGame() elif key in ("3","4","5"): colors = int(key) game = SameGame(ncolors=colors) cell_colors = {0:"black", 1:"green", 2:"blue", 3:"red", 4:"yellow", 5:"magenta"} def cells(colors_only=False,ncolors=NCOLORS): ycent = B_WIDTH // 2 pos = [[0] * NROWS for col in range(NCOLS)] colors = [[0] * NROWS for col in range(NCOLS)] # store cell centers coordinates and colors, columnwise for row in range(NCOLS): xcent = -B_WIDTH // 2 for col in range(NROWS): xcent += B_WIDTH pos[row][col] = (ycent,xcent) colors[row][col] = int(random(1, ncolors + 1)) ycent += B_WIDTH if not colors_only: return pos, colors return colors class SameGame: def __init__(self,nr=NROWS, nc=NCOLS, ncolors=NCOLORS, colors=None, pos=None, score=0, score_diff=0, empty_cols = None, to_fill=None,score_corr=0): self.nr = nr self.nc = nc self.ncolors = ncolors self.to_fill = set() self.score = score self.score_diff = score_diff self.score_corr = score_corr self.empty_cols = [] self.pos, self.colors = cells(ncolors=ncolors) def plotBoard(self): for row in range(NROWS): for col in range(NCOLS): xc, yc = self.pos[col][row] fill(cell_colors[self.colors[col][row]]) rect(xc,yc,B_WIDTH,B_WIDTH) fill(255) textSize(20) textAlign(LEFT) text("Score: %d" %self.score, C_WIDTH-140, C_HEIGHT - 6) if self.endGame(): if not self.score_corr: self.score_correction_by_colors() self.score_corr = True self.compactLeft() textSize(36) textAlign(CENTER) text("End of Game",C_WIDTH // 2, C_HEIGHT // 2 - 10) def neighbours(self,i,j): possible = [(i-1,j),(i+1,j),(i,j-1),(i,j+1)] return [p for p in possible if (0 <= p[0] < self.nc) and (0 <= p[1] < self.nr)] def alone(self,i,j): # i -column, j - row color = self.colors[i][j] res = True if color == 0: return res for k,l in self.neighbours(i,j): if self.colors[k][l] == color: res = False break return res def floodfill(self, x, y): value = self.colors[x][y] edge = [(x,y)] self.to_fill = set([x]) self.colors[x][y] = 0 self.score_diff = 1 while edge: newedge = [] for (x,y) in edge: for s,t in self.neighbours(x,y): if self.colors[s][t] == value: self.to_fill.add(s) self.colors[s][t] = 0 self.score_diff += 1 newedge.append((s, t)) edge = newedge def fall_column(self,col): if sum(self.colors[col]) == 0: self.empty_cols.append(col) return colored = [] for row in range(self.nr): cc = self.colors[col][row] if cc: colored.append(cc) lc = len(colored) new_col = [0] *(self.nr - lc) + colored self.colors[col] = new_col def compactLeft(self): if self.empty_cols == []: return for c in sorted(self.empty_cols,reverse=True): for cindex in range(c,self.nc-1): self.colors[cindex] = self.colors[cindex + 1] self.colors[self.nc-1] = [0] * self.nr self.empty_cols = [] def fall_all(self): if self.to_fill == []: self.score_diff = 0 return for col in self.to_fill: self.fall_column(col) self.compactLeft() nscore = self.score_diff - 1 self.score += (nscore * nscore) self.score_diff = 0 def endGame(self): return sum([self.alone(i,j) for i in range(self.nc) for j in range(self.nr)]) == self.nr * self.nc def score_correction(self): rem = sum(bool(self.colors[c][r]) for c in range(self.nc) for r in range(self.nr)) if rem == 0: self.score += 1000 else: self.score -= (rem-1)*(rem-1) self.score = max(0,self.score) def score_correction_by_colors(self): crange = range(1,self.ncolors + 1) rest = {c:0 for c in crange} for col in range(self.nc): for row in range(self.nr): color = self.colors[col][row] if color: rest[color] += 1 rem = 0 for c in crange: ncells = rest[c] if ncells: rem += (ncells - 1) * (ncells - 1) if sum(rest.values()) == 0: self.score += 1000 else: self.score -= rem `; const startCode = ` event_functions = { "deviceMoved": deviceMoved, "deviceTurned": deviceTurned, "deviceShaken": deviceShaken, "keyPressed": keyPressed, "keyReleased": keyReleased, "keyTyped": keyTyped, "mouseMoved": mouseMoved, "mouseDragged": mouseDragged, "mousePressed": mousePressed, "mouseReleased": mouseReleased, "mouseClicked": mouseClicked, "doubleClicked": doubleClicked, "mouseWheel": mouseWheel, "touchStarted": touchStarted, "touchMoved": touchMoved, "touchEnded": touchEnded, "windowResized": windowResized, } start_p5(preload, setup, draw, event_functions) `; function runCode() { let code = [ placeholder, userCode, wrapperContent, startCode, ].join('\n'); if (window.instance) { window.instance.canvas.remove(); } console.log("Python execution output:"); window.pyodide.runPython(code); } async function main() { const config = { indexURL : "https://cdn.jsdelivr.net/pyodide/v0.18.1/full/", fullStdLib: false, } window.pyodide = await loadPyodide(config); // Pyodide is now ready to use... console.log(window.pyodide.runPython(` import io, code, sys from js import p5, window, document print(sys.version) `)); window.runSketchCode = (code) => { userCode = code; runCode(); } runCode(); }; // async method main(); ================================================ FILE: docs/examples/pyodide/sketch_001/index.html ================================================ sketch_001 - pyp5js

Python code here.

# https://p5js.org/examples/interaction-wavemaker.html

t = 0

def setup():
    createCanvas(600, 600)
    stroke(250)
    strokeWeight(3)
    fill(40, 200, 40)


def draw():
    global t
    background(10, 10)

    xAngle = map(mouseX, 0, width, -4 * PI, 4 * PI, True)
    yAngle = map(mouseY, 0, height, -4 * PI, 4 * PI, True)
    for x in range(0, width, 30):
        for y in range(0, height, 30):

            angle = xAngle * (x / width) + yAngle * (y / height)

            myX = x + 20 * cos(2 * PI * t + angle)
            myY = y + 20 * sin(2 * TWO_PI * t + angle)

            ellipse(myX, myY, 10)

    t = t + 0.01
================================================ FILE: docs/examples/pyodide/sketch_001/sketch_001.py ================================================ # https://p5js.org/examples/interaction-wavemaker.html t = 0 def setup(): createCanvas(600, 600) stroke(250) strokeWeight(3) fill(40, 200, 40) def draw(): global t background(10, 10) xAngle = map(mouseX, 0, width, -4 * PI, 4 * PI, True) yAngle = map(mouseY, 0, height, -4 * PI, 4 * PI, True) for x in range(0, width, 30): for y in range(0, height, 30): angle = xAngle * (x / width) + yAngle * (y / height) myX = x + 20 * cos(2 * PI * t + angle) myY = y + 20 * sin(2 * TWO_PI * t + angle) ellipse(myX, myY, 10) t = t + 0.01 ================================================ FILE: docs/examples/pyodide/sketch_001/static/p5.js ================================================ /*! p5.js v1.0.0 February 29, 2020 */ !function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).p5=e()}}(function(){return function o(a,s,l){function u(t,e){if(!s[t]){if(!a[t]){var r="function"==typeof require&&require;if(!e&&r)return r(t,!0);if(h)return h(t,!0);var i=new Error("Cannot find module '"+t+"'");throw i.code="MODULE_NOT_FOUND",i}var n=s[t]={exports:{}};a[t][0].call(n.exports,function(e){return u(a[t][1][e]||e)},n,n.exports,o,a,s,l)}return s[t].exports}for(var h="function"==typeof require&&require,e=0;e>16&255,a[s++]=t>>8&255,a[s++]=255&t;2===o&&(t=u[e.charCodeAt(r)]<<2|u[e.charCodeAt(r+1)]>>4,a[s++]=255&t);1===o&&(t=u[e.charCodeAt(r)]<<10|u[e.charCodeAt(r+1)]<<4|u[e.charCodeAt(r+2)]>>2,a[s++]=t>>8&255,a[s++]=255&t);return a},r.fromByteArray=function(e){for(var t,r=e.length,i=r%3,n=[],o=0,a=r-i;o>2]+s[t<<4&63]+"==")):2==i&&(t=(e[r-2]<<8)+e[r-1],n.push(s[t>>10]+s[t>>4&63]+s[t<<2&63]+"="));return n.join("")};for(var s=[],u=[],h="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=0,o=i.length;n>18&63]+s[n>>12&63]+s[n>>6&63]+s[63&n]);return o.join("")}u["-".charCodeAt(0)]=62,u["_".charCodeAt(0)]=63},{}],20:[function(e,t,r){},{}],21:[function(N,e,F){(function(c){"use strict";var i=N("base64-js"),o=N("ieee754"),e="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;F.Buffer=c,F.SlowBuffer=function(e){+e!=e&&(e=0);return c.alloc(+e)},F.INSPECT_MAX_BYTES=50;var r=2147483647;function a(e){if(r>>1;case"base64":return O(e).length;default:if(n)return i?-1:R(e).length;t=(""+t).toLowerCase(),n=!0}}function d(e,t,r){var i=e[t];e[t]=e[r],e[r]=i}function p(e,t,r,i,n){if(0===e.length)return-1;if("string"==typeof r?(i=r,r=0):2147483647=e.length){if(n)return-1;r=e.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof t&&(t=c.from(t,i)),c.isBuffer(t))return 0===t.length?-1:m(e,t,r,i,n);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):m(e,[t],r,i,n);throw new TypeError("val must be string, number or Buffer")}function m(e,t,r,i,n){var o,a=1,s=e.length,l=t.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(e.length<2||t.length<2)return-1;s/=a=2,l/=2,r/=2}function u(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(n){var h=-1;for(o=r;o>8,n=r%256,o.push(n),o.push(i);return o}(t,e.length-r),e,r,i)}function b(e,t,r){return 0===t&&r===e.length?i.fromByteArray(e):i.fromByteArray(e.slice(t,r))}function _(e,t,r){r=Math.min(e.length,r);for(var i=[],n=t;n>>10&1023|55296),h=56320|1023&h),i.push(h),n+=c}return function(e){var t=e.length;if(t<=x)return String.fromCharCode.apply(String,e);var r="",i=0;for(;ithis.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e=e||"utf8";;)switch(e){case"hex":return M(this,t,r);case"utf8":case"utf-8":return _(this,t,r);case"ascii":return w(this,t,r);case"latin1":case"binary":return S(this,t,r);case"base64":return b(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,t,r);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}.apply(this,arguments)},c.prototype.equals=function(e){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===c.compare(this,e)},c.prototype.inspect=function(){var e="",t=F.INSPECT_MAX_BYTES;return e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(e+=" ... "),""},e&&(c.prototype[e]=c.prototype.inspect),c.prototype.compare=function(e,t,r,i,n){if(A(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),t<0||r>e.length||i<0||n>this.length)throw new RangeError("out of range index");if(n<=i&&r<=t)return 0;if(n<=i)return-1;if(r<=t)return 1;if(this===e)return 0;for(var o=(n>>>=0)-(i>>>=0),a=(r>>>=0)-(t>>>=0),s=Math.min(o,a),l=this.slice(i,n),u=e.slice(t,r),h=0;h>>=0,isFinite(r)?(r>>>=0,void 0===i&&(i="utf8")):(i=r,r=void 0)}var n=this.length-t;if((void 0===r||nthis.length)throw new RangeError("Attempt to write outside buffer bounds");i=i||"utf8";for(var o,a,s,l,u,h,c=!1;;)switch(i){case"hex":return g(this,e,t,r);case"utf8":case"utf-8":return u=t,h=r,D(R(e,(l=this).length-u),l,u,h);case"ascii":return v(this,e,t,r);case"latin1":case"binary":return v(this,e,t,r);case"base64":return o=this,a=t,s=r,D(O(e),o,a,s);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return y(this,e,t,r);default:if(c)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),c=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var x=4096;function w(e,t,r){var i="";r=Math.min(e.length,r);for(var n=t;ne.length)throw new RangeError("Index out of range")}function P(e,t,r,i){if(r+i>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function L(e,t,r,i,n){return t=+t,r>>>=0,n||P(e,0,r,4),o.write(e,t,r,i,23,4),r+4}function k(e,t,r,i,n){return t=+t,r>>>=0,n||P(e,0,r,8),o.write(e,t,r,i,52,8),r+8}c.prototype.slice=function(e,t){var r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):r>>=0,t>>>=0,r||T(e,t,this.length);for(var i=this[e],n=1,o=0;++o>>=0,t>>>=0,r||T(e,t,this.length);for(var i=this[e+--t],n=1;0>>=0,t||T(e,1,this.length),this[e]},c.prototype.readUInt16LE=function(e,t){return e>>>=0,t||T(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUInt16BE=function(e,t){return e>>>=0,t||T(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUInt32LE=function(e,t){return e>>>=0,t||T(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUInt32BE=function(e,t){return e>>>=0,t||T(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||T(e,t,this.length);for(var i=this[e],n=1,o=0;++o>>=0,t>>>=0,r||T(e,t,this.length);for(var i=t,n=1,o=this[e+--i];0>>=0,t||T(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){e>>>=0,t||T(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(e,t){e>>>=0,t||T(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(e,t){return e>>>=0,t||T(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return e>>>=0,t||T(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readFloatLE=function(e,t){return e>>>=0,t||T(e,4,this.length),o.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return e>>>=0,t||T(e,4,this.length),o.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return e>>>=0,t||T(e,8,this.length),o.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return e>>>=0,t||T(e,8,this.length),o.read(this,e,!1,52,8)},c.prototype.writeUIntLE=function(e,t,r,i){e=+e,t>>>=0,r>>>=0,i||C(this,e,t,r,Math.pow(2,8*r)-1,0);var n=1,o=0;for(this[t]=255&e;++o>>=0,r>>>=0,i||C(this,e,t,r,Math.pow(2,8*r)-1,0);var n=r-1,o=1;for(this[t+n]=255&e;0<=--n&&(o*=256);)this[t+n]=e/o&255;return t+r},c.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,1,255,0),this[t]=255&e,t+1},c.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},c.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeIntLE=function(e,t,r,i){if(e=+e,t>>>=0,!i){var n=Math.pow(2,8*r-1);C(this,e,t,r,n-1,-n)}var o=0,a=1,s=0;for(this[t]=255&e;++o>0)-s&255;return t+r},c.prototype.writeIntBE=function(e,t,r,i){if(e=+e,t>>>=0,!i){var n=Math.pow(2,8*r-1);C(this,e,t,r,n-1,-n)}var o=r-1,a=1,s=0;for(this[t+o]=255&e;0<=--o&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+r},c.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},c.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeFloatLE=function(e,t,r){return L(this,e,t,!0,r)},c.prototype.writeFloatBE=function(e,t,r){return L(this,e,t,!1,r)},c.prototype.writeDoubleLE=function(e,t,r){return k(this,e,t,!0,r)},c.prototype.writeDoubleBE=function(e,t,r){return k(this,e,t,!1,r)},c.prototype.copy=function(e,t,r,i){if(!c.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r=r||0,i||0===i||(i=this.length),t>=e.length&&(t=e.length),t=t||0,0=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t>>=0,r=void 0===r?this.length:r>>>0,"number"==typeof(e=e||0))for(o=t;o>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function O(e){return i.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(t,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function D(e,t,r,i){for(var n=0;n=t.length||n>=e.length);++n)t[n+r]=e[n];return n}function A(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function I(e){return e!=e}var U=function(){for(var e="0123456789abcdef",t=new Array(256),r=0;r<16;++r)for(var i=16*r,n=0;n<16;++n)t[i+n]=e[r]+e[n];return t}()}).call(this,N("buffer").Buffer)},{"base64-js":19,buffer:21,ieee754:30}],22:[function(e,t,r){"use strict";t.exports=e("./").polyfill()},{"./":23}],23:[function(z,r,i){(function(j,V){var e,t;e=this,t=function(){"use strict";function l(e){return"function"==typeof e}var r=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},i=0,t=void 0,n=void 0,a=function(e,t){f[i]=e,f[i+1]=t,2===(i+=2)&&(n?n(d):y())};var e="undefined"!=typeof window?window:void 0,o=e||{},s=o.MutationObserver||o.WebKitMutationObserver,u="undefined"==typeof self&&void 0!==j&&"[object process]"==={}.toString.call(j),h="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function c(){var e=setTimeout;return function(){return e(d,1)}}var f=new Array(1e3);function d(){for(var e=0;e":">",'"':""","'":"'","/":"/"};function S(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,function(e){return w[e]}):e}var M=function(){function i(e){var t,r=1=this.maxReplaces)break}for(a=0;r=this.regexp.exec(e);){if(void 0===(i=h(r[1].trim())))if("function"==typeof c){var d=c(e,r,t);i="string"==typeof d?d:""}else this.logger.warn("missed to pass in variable ".concat(r[1]," for interpolating ").concat(e)),i="";else"string"==typeof i||this.useRawValueToEscape||(i=v(i));if(i=this.escapeValue?u(this.escape(i)):u(i),e=e.replace(r[0],i),this.regexp.lastIndex=0,++a>=this.maxReplaces)break}return e}},{key:"nest",value:function(e,t,r){var i,n,o=D({},2>1,h=-7,c=r?n-1:0,f=r?-1:1,d=e[t+c];for(c+=f,o=d&(1<<-h)-1,d>>=-h,h+=s;0>=-h,h+=i;0>1,f=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,d=i?0:o-1,p=i?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=h):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),2<=(t+=1<=a+c?f/l:f*Math.pow(2,1-c))*l&&(a++,l/=2),h<=a+c?(s=0,a=h):1<=a+c?(s=(t*l-1)*Math.pow(2,n),a+=c):(s=t*Math.pow(2,c-1)*Math.pow(2,n),a=0));8<=n;e[r+d]=255&s,d+=p,s/=256,n-=8);for(a=a<Math.abs(e[0])&&(t=1),Math.abs(e[2])>Math.abs(e[t])&&(t=2),t}var C=4e150;function P(e,t){e.f+=t.f,e.b.f+=t.b.f}function u(e,t,r){return e=e.a,t=t.a,r=r.a,t.b.a===e?r.b.a===e?v(t.a,r.a)?b(r.b.a,t.a,r.a)<=0:0<=b(t.b.a,r.a,t.a):b(r.b.a,e,r.a)<=0:r.b.a===e?0<=b(t.b.a,e,t.a):(t=y(t.b.a,e,t.a),(e=y(r.b.a,e,r.a))<=t)}function L(e){e.a.i=null;var t=e.e;t.a.c=t.c,t.c.a=t.a,e.e=null}function h(e,t){c(e.a),e.c=!1,(e.a=t).i=e}function k(e){for(var t=e.a.a;(e=fe(e)).a.a===t;);return e.c&&(h(e,t=f(ce(e).a.b,e.a.e)),e=fe(e)),e}function R(e,t,r){var i=new he;return i.a=r,i.e=W(e.f,t.e,i),r.i=i}function O(e,t){switch(e.s){case 100130:return 0!=(1&t);case 100131:return 0!==t;case 100132:return 0>1]],s[a[u]])?le(r,u):ue(r,u)),s[o]=null,l[o]=r.b,r.b=o}else for(r.c[-(o+1)]=null;0Math.max(a.a,l.a))return!1;if(v(o,a)){if(0i.f&&(i.f*=2,i.c=oe(i.c,i.f+1)),0===i.b?r=n:(r=i.b,i.b=i.c[i.b]),i.e[r]=t,i.c[r]=n,i.d[n]=r,i.h&&ue(i,n),r}return i=e.a++,e.c[i]=t,-(i+1)}function ie(e){if(0===e.a)return se(e.b);var t=e.c[e.d[e.a-1]];if(0!==e.b.a&&v(ae(e.b),t))return se(e.b);for(;--e.a,0e.a||v(i[a],i[l])){n[r[o]=a]=o;break}n[r[o]=l]=o,o=s}}function ue(e,t){for(var r=e.d,i=e.e,n=e.c,o=t,a=r[o];;){var s=o>>1,l=r[s];if(0==s||v(i[l],i[a])){n[r[o]=a]=o;break}n[r[o]=l]=o,o=s}}function he(){this.e=this.a=null,this.f=0,this.c=this.b=this.h=this.d=!1}function ce(e){return e.e.c.b}function fe(e){return e.e.a.b}(i=q.prototype).x=function(){Y(this,0)},i.B=function(e,t){switch(e){case 100142:return;case 100140:switch(t){case 100130:case 100131:case 100132:case 100133:case 100134:return void(this.s=t)}break;case 100141:return void(this.m=!!t);default:return void Z(this,100900)}Z(this,100901)},i.y=function(e){switch(e){case 100142:return 0;case 100140:return this.s;case 100141:return this.m;default:Z(this,100900)}return!1},i.A=function(e,t,r){this.j[0]=e,this.j[1]=t,this.j[2]=r},i.z=function(e,t){var r=t||null;switch(e){case 100100:case 100106:this.h=r;break;case 100104:case 100110:this.l=r;break;case 100101:case 100107:this.k=r;break;case 100102:case 100108:this.i=r;break;case 100103:case 100109:this.p=r;break;case 100105:case 100111:this.o=r;break;case 100112:this.r=r;break;default:Z(this,100900)}},i.C=function(e,t){var r=!1,i=[0,0,0];Y(this,2);for(var n=0;n<3;++n){var o=e[n];o<-1e150&&(o=-1e150,r=!0),1e150n[u]&&(n[u]=h,a[u]=l)}if(l=0,n[1]-o[1]>n[0]-o[0]&&(l=1),n[2]-o[2]>n[l]-o[l]&&(l=2),o[l]>=n[l])i[0]=0,i[1]=0,i[2]=1;else{for(n=0,o=s[l],a=a[l],s=[0,0,0],o=[o.g[0]-a.g[0],o.g[1]-a.g[1],o.g[2]-a.g[2]],u=[0,0,0],l=r.e;l!==r;l=l.e)u[0]=l.g[0]-a.g[0],u[1]=l.g[1]-a.g[1],u[2]=l.g[2]-a.g[2],s[0]=o[1]*u[2]-o[2]*u[1],s[1]=o[2]*u[0]-o[0]*u[2],s[2]=o[0]*u[1]-o[1]*u[0],n<(h=s[0]*s[0]+s[1]*s[1]+s[2]*s[2])&&(n=h,i[0]=s[0],i[1]=s[1],i[2]=s[2]);n<=0&&(i[0]=i[1]=i[2]=0,i[T(o)]=1)}r=!0}for(s=T(i),l=this.b.c,n=(s+1)%3,a=(s+2)%3,s=0>=l,h-=l,g!=o){if(g==a)break;for(var v=g>8,++y;var _=b;if(i>=8;null!==m&&s<4096&&(p[s++]=m<<8|_,u+1<=s&&l<12&&(++l,u=u<<1|1)),m=g}else s=1+a,u=(1<<(l=n+1))-1,m=null}return f!==i&&console.log("Warning, gif stream shorter than expected."),r}try{r.GifWriter=function(v,e,t,r){var y=0,i=void 0===(r=void 0===r?{}:r).loop?null:r.loop,b=void 0===r.palette?null:r.palette;if(e<=0||t<=0||65535>=1;)++n;if(a=1<>8&255,v[y++]=255&t,v[y++]=t>>8&255,v[y++]=(null!==b?128:0)|n,v[y++]=o,v[y++]=0,null!==b)for(var s=0,l=b.length;s>16&255,v[y++]=u>>8&255,v[y++]=255&u}if(null!==i){if(i<0||65535>8&255,v[y++]=0}var x=!1;this.addFrame=function(e,t,r,i,n,o){if(!0===x&&(--y,x=!1),o=void 0===o?{}:o,e<0||t<0||65535>=1;)++u;l=1<>8&255,v[y++]=d,v[y++]=0),v[y++]=44,v[y++]=255&e,v[y++]=e>>8&255,v[y++]=255&t,v[y++]=t>>8&255,v[y++]=255&r,v[y++]=r>>8&255,v[y++]=255&i,v[y++]=i>>8&255,v[y++]=!0===a?128|u-1:0,!0===a)for(var p=0,m=s.length;p>16&255,v[y++]=g>>8&255,v[y++]=255&g}return y=function(t,r,e,i){t[r++]=e;var n=r++,o=1<>=8,h-=8,r===n+256&&(t[n]=255,n=r++)}function d(e){c|=e<>=8,h-=8,r===n+256&&(t[n]=255,n=r++);4096===l?(d(o),l=1+s,u=e+1,m={}):(1<>7,n=1<<1+(7&r);x[e++],x[e++];var o=null,a=null;i&&(o=e,e+=3*(a=n));var s=!0,l=[],u=0,h=null,c=0,f=null;for(this.width=w,this.height=t;s&&e>2&7,e++;break;case 254:for(;;){if(!(0<=(C=x[e++])))throw Error("Invalid block size");if(0===C)break;e+=C}break;default:throw new Error("Unknown graphic control label: 0x"+x[e-1].toString(16))}break;case 44:var p=x[e++]|x[e++]<<8,m=x[e++]|x[e++]<<8,g=x[e++]|x[e++]<<8,v=x[e++]|x[e++]<<8,y=x[e++],b=y>>6&1,_=1<<1+(7&y),S=o,M=a,E=!1;if(y>>7){E=!0;S=e,e+=3*(M=_)}var T=e;for(e++;;){var C;if(!(0<=(C=x[e++])))throw Error("Invalid block size");if(0===C)break;e+=C}l.push({x:p,y:m,width:g,height:v,has_local_palette:E,palette_offset:S,palette_size:M,data_offset:T,data_length:e-T,transparent_index:h,interlaced:!!b,delay:u,disposal:c});break;case 59:s=!1;break;default:throw new Error("Unknown gif block: 0x"+x[e-1].toString(16))}this.numFrames=function(){return l.length},this.loopCount=function(){return f},this.frameInfo=function(e){if(e<0||e>=l.length)throw new Error("Frame index out of range.");return l[e]},this.decodeAndBlitFrameBGRA=function(e,t){var r=this.frameInfo(e),i=r.width*r.height,n=new Uint8Array(i);P(x,r.data_offset,n,i);var o=r.palette_offset,a=r.transparent_index;null===a&&(a=256);var s=r.width,l=w-s,u=s,h=4*(r.y*w+r.x),c=4*((r.y+r.height)*w+r.x),f=h,d=4*l;!0===r.interlaced&&(d+=4*w*7);for(var p=8,m=0,g=n.length;m>=1)),v===a)f+=4;else{var y=x[o+3*v],b=x[o+3*v+1],_=x[o+3*v+2];t[f++]=_,t[f++]=b,t[f++]=y,t[f++]=255}--u}},this.decodeAndBlitFrameRGBA=function(e,t){var r=this.frameInfo(e),i=r.width*r.height,n=new Uint8Array(i);P(x,r.data_offset,n,i);var o=r.palette_offset,a=r.transparent_index;null===a&&(a=256);var s=r.width,l=w-s,u=s,h=4*(r.y*w+r.x),c=4*((r.y+r.height)*w+r.x),f=h,d=4*l;!0===r.interlaced&&(d+=4*w*7);for(var p=8,m=0,g=n.length;m>=1)),v===a)f+=4;else{var y=x[o+3*v],b=x[o+3*v+1],_=x[o+3*v+2];t[f++]=y,t[f++]=b,t[f++]=_,t[f++]=255}--u}}}}catch(e){}},{}],33:[function(jr,t,r){(function(Gr){var e;e=this,function(E){"use strict";function e(e){if(null==this)throw TypeError();var t=String(this),r=t.length,i=e?Number(e):0;if(i!=i&&(i=0),!(i<0||r<=i)){var n,o=t.charCodeAt(i);return 55296<=o&&o<=56319&&i+1>>=1,t}function _(e,t,r){if(!t)return r;for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<>>16-t;return e.tag>>>=t,e.bitcount-=t,i+r}function x(e,t){for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<>>=1,++n,r+=t.table[n],0<=(i-=t.table[n]););return e.tag=o,e.bitcount-=n,t.trans[r+i]}function w(e,t,r){var i,n,o,a,s,l;for(i=_(e,5,257),n=_(e,5,1),o=_(e,4,4),a=0;a<19;++a)g[a]=0;for(a=0;athis.x2&&(this.x2=e)),"number"==typeof t&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=t,this.y2=t),tthis.y2&&(this.y2=t))},C.prototype.addX=function(e){this.addPoint(e,null)},C.prototype.addY=function(e){this.addPoint(null,e)},C.prototype.addBezier=function(e,t,r,i,n,o,a,s){var l=this,u=[e,t],h=[r,i],c=[n,o],f=[a,s];this.addPoint(e,t),this.addPoint(a,s);for(var d=0;d<=1;d++){var p=6*u[d]-12*h[d]+6*c[d],m=-3*u[d]+9*h[d]-9*c[d]+3*f[d],g=3*h[d]-3*u[d];if(0!=m){var v=Math.pow(p,2)-4*g*m;if(!(v<0)){var y=(-p+Math.sqrt(v))/(2*m);0>8&255,255&e]},A.USHORT=U(2),D.SHORT=function(e){return 32768<=e&&(e=-(65536-e)),[e>>8&255,255&e]},A.SHORT=U(2),D.UINT24=function(e){return[e>>16&255,e>>8&255,255&e]},A.UINT24=U(3),D.ULONG=function(e){return[e>>24&255,e>>16&255,e>>8&255,255&e]},A.ULONG=U(4),D.LONG=function(e){return R<=e&&(e=-(2*R-e)),[e>>24&255,e>>16&255,e>>8&255,255&e]},A.LONG=U(4),D.FIXED=D.ULONG,A.FIXED=A.ULONG,D.FWORD=D.SHORT,A.FWORD=A.SHORT,D.UFWORD=D.USHORT,A.UFWORD=A.USHORT,D.LONGDATETIME=function(e){return[0,0,0,0,e>>24&255,e>>16&255,e>>8&255,255&e]},A.LONGDATETIME=U(8),D.TAG=function(e){return k.argument(4===e.length,"Tag should be exactly 4 ASCII characters."),[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]},A.TAG=U(4),D.Card8=D.BYTE,A.Card8=A.BYTE,D.Card16=D.USHORT,A.Card16=A.USHORT,D.OffSize=D.BYTE,A.OffSize=A.BYTE,D.SID=D.USHORT,A.SID=A.USHORT,D.NUMBER=function(e){return-107<=e&&e<=107?[e+139]:108<=e&&e<=1131?[247+((e-=108)>>8),255&e]:-1131<=e&&e<=-108?[251+((e=-e-108)>>8),255&e]:-32768<=e&&e<=32767?D.NUMBER16(e):D.NUMBER32(e)},A.NUMBER=function(e){return D.NUMBER(e).length},D.NUMBER16=function(e){return[28,e>>8&255,255&e]},A.NUMBER16=U(3),D.NUMBER32=function(e){return[29,e>>24&255,e>>16&255,e>>8&255,255&e]},A.NUMBER32=U(5),D.REAL=function(e){var t=e.toString(),r=/\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec(t);if(r){var i=parseFloat("1e"+((r[2]?+r[2]:0)+r[1].length));t=(Math.round(e*i)/i).toString()}for(var n="",o=0,a=t.length;o>8&255,t[t.length]=255&i}return t},A.UTF16=function(e){return 2*e.length};var N={"x-mac-croatian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈ƫȅ ÀÃÕŒœĐ—“”‘’÷◊©⁄€‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ","x-mac-cyrillic":"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю","x-mac-gaelic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØḂ±≤≥ḃĊċḊḋḞḟĠġṀæøṁṖṗɼƒſṠ«»… ÀÃÕŒœ–—“”‘’ṡẛÿŸṪ€‹›Ŷŷṫ·Ỳỳ⁊ÂÊÁËÈÍÎÏÌÓÔ♣ÒÚÛÙıÝýŴŵẄẅẀẁẂẃ","x-mac-greek":"Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦€ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ­","x-mac-icelandic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüݰ¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-inuit":"ᐃᐄᐅᐆᐊᐋᐱᐲᐳᐴᐸᐹᑉᑎᑏᑐᑑᑕᑖᑦᑭᑮᑯᑰᑲᑳᒃᒋᒌᒍᒎᒐᒑ°ᒡᒥᒦ•¶ᒧ®©™ᒨᒪᒫᒻᓂᓃᓄᓅᓇᓈᓐᓯᓰᓱᓲᓴᓵᔅᓕᓖᓗᓘᓚᓛᓪᔨᔩᔪᔫᔭ… ᔮᔾᕕᕖᕗ–—“”‘’ᕘᕙᕚᕝᕆᕇᕈᕉᕋᕌᕐᕿᖀᖁᖂᖃᖄᖅᖏᖐᖑᖒᖓᖔᖕᙱᙲᙳᙴᙵᙶᖖᖠᖡᖢᖣᖤᖥᖦᕼŁł","x-mac-ce":"ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ",macintosh:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-romanian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂȘ∞±≤≥¥µ∂∑∏π∫ªºΩăș¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›Țț‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-turkish":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙˆ˜¯˘˙˚¸˝˛ˇ"};O.MACSTRING=function(e,t,r,i){var n=N[i];if(void 0!==n){for(var o="",a=0;a>8&255,l+256&255)}return o}D.MACSTRING=function(e,t){var r=function(e){if(!F)for(var t in F={},N)F[t]=new String(t);var r=F[e];if(void 0!==r){if(B){var i=B.get(r);if(void 0!==i)return i}var n=N[e];if(void 0!==n){for(var o={},a=0;a>8,t[c+1]=255&f,t=t.concat(i[h])}return t},A.TABLE=function(e){for(var t=0,r=e.fields.length,i=0;i>1,t.skip("uShort",3),e.glyphIndexMap={};for(var a=new se.Parser(r,i+n+14),s=new se.Parser(r,i+n+16+2*o),l=new se.Parser(r,i+n+16+4*o),u=new se.Parser(r,i+n+16+6*o),h=i+n+16+8*o,c=0;c>4,o=15&i;if(15==n)break;if(t+=r[n],15==o)break;t+=r[o]}return parseFloat(t)}(e);if(32<=t&&t<=246)return t-139;if(247<=t&&t<=250)return 256*(t-247)+e.parseByte()+108;if(251<=t&&t<=254)return 256*-(t-251)-e.parseByte()-108;throw new Error("Invalid b0 "+t)}function Te(e,t,r){t=void 0!==t?t:0;var i=new se.Parser(e,t),n=[],o=[];for(r=void 0!==r?r:e.length;i.relativeOffset>1,T.length=0,P=!0}return function e(t){for(var r,i,n,o,a,s,l,u,h,c,f,d,p=0;pMath.abs(d-R)?k=f+T.shift():R=d+T.shift(),E.curveTo(y,b,_,x,l,u),E.curveTo(h,c,f,d,k,R);break;default:console.log("Glyph "+v.index+": unknown operator 1200"+m),T.length=0}break;case 14:0>3;break;case 21:2>16),p+=2;break;case 29:a=T.pop()+g.gsubrsBias,(s=g.gsubrs[a])&&e(s);break;case 30:for(;0=r.begin&&e=fe.length){var a=i.parseChar();r.names.push(i.parseString(a))}break;case 2.5:r.numberOfGlyphs=i.parseUShort(),r.offset=new Array(r.numberOfGlyphs);for(var s=0;st.value.tag?1:-1}),t.fields=t.fields.concat(i),t.fields=t.fields.concat(n),t}function gt(e,t,r){for(var i=0;i 123 are reserved for internal usage");d|=1<>>1,o=e[n].tag;if(o===t)return n;o>>1,o=e[n];if(o===t)return n;o>>1,a=(r=e[o]).start;if(a===t)return r;a(r=e[i-1]).end?0:r}function xt(e,t){this.font=e,this.tableName=t}function wt(e){xt.call(this,e,"gpos")}function St(e){xt.call(this,e,"gsub")}function Mt(e,t){var r=e.length;if(r!==t.length)return!1;for(var i=0;it.points.length-1||i.matchedPoints[1]>n.points.length-1)throw Error("Matched points out of range in "+t.name);var a=t.points[i.matchedPoints[0]],s=n.points[i.matchedPoints[1]],l={xScale:i.xScale,scale01:i.scale01,scale10:i.scale10,yScale:i.yScale,dx:0,dy:0};s=kt([s],l)[0],l.dx=a.x-s.x,l.dy=a.y-s.y,o=kt(n.points,l)}t.points=t.points.concat(o)}}return Rt(t.points)}(wt.prototype=xt.prototype={searchTag:yt,binSearch:bt,getTable:function(e){var t=this.font.tables[this.tableName];return!t&&e&&(t=this.font.tables[this.tableName]=this.createDefaultTable()),t},getScriptNames:function(){var e=this.getTable();return e?e.scripts.map(function(e){return e.tag}):[]},getDefaultScriptName:function(){var e=this.getTable();if(e){for(var t=!1,r=0;r=s[u-1].tag,"Features must be added in alphabetical order."),o={tag:r,feature:{params:0,lookupListIndexes:[]}},s.push(o),a.push(u),o.feature}}},getLookupTables:function(e,t,r,i,n){var o=this.getFeatureTable(e,t,r,n),a=[];if(o){for(var s,l=o.lookupListIndexes,u=this.font.tables[this.tableName].lookups,h=0;h",s),t.stack.push(Math.round(64*s))}function vr(e,t){var r=t.stack,i=r.pop(),n=t.fv,o=t.pv,a=t.ppem,s=t.deltaBase+16*(e-1),l=t.deltaShift,u=t.z0;E.DEBUG&&console.log(t.step,"DELTAP["+e+"]",i,r);for(var h=0;h>4)===a){var d=(15&f)-8;0<=d&&d++,E.DEBUG&&console.log(t.step,"DELTAPFIX",c,"by",d*l);var p=u[c];n.setRelative(p,p,d*l,o)}}}function yr(e,t){var r=t.stack,i=r.pop();E.DEBUG&&console.log(t.step,"ROUND[]"),r.push(64*t.round(i/64))}function br(e,t){var r=t.stack,i=r.pop(),n=t.ppem,o=t.deltaBase+16*(e-1),a=t.deltaShift;E.DEBUG&&console.log(t.step,"DELTAC["+e+"]",i,r);for(var s=0;s>4)===n){var h=(15&u)-8;0<=h&&h++;var c=h*a;E.DEBUG&&console.log(t.step,"DELTACFIX",l,"by",c),t.cvt[l]+=c}}}function _r(e,t){var r,i,n=t.stack,o=n.pop(),a=n.pop(),s=t.z2[o],l=t.z1[a];E.DEBUG&&console.log(t.step,"SDPVTL["+e+"]",o,a),i=e?(r=s.y-l.y,l.x-s.x):(r=l.x-s.x,l.y-s.y),t.dpv=Zt(r,i)}function xr(e,t){var r=t.stack,i=t.prog,n=t.ip;E.DEBUG&&console.log(t.step,"PUSHB["+e+"]");for(var o=0;o":"_")+(i?"R":"_")+(0===n?"Gr":1===n?"Bl":2===n?"Wh":"")+"]",e?c+"("+o.cvt[c]+","+u+")":"",f,"(d =",a,"->",l*s,")"),o.rp1=o.rp0,o.rp2=f,t&&(o.rp0=f)}Ft.prototype.exec=function(e,t){if("number"!=typeof t)throw new Error("Point size is not a number!");if(!(2",i),s.interpolate(c,o,a,l),s.touch(c)}e.loop=1},dr.bind(void 0,0),dr.bind(void 0,1),function(e){for(var t=e.stack,r=e.rp0,i=e.z0[r],n=e.loop,o=e.fv,a=e.pv,s=e.z1;n--;){var l=t.pop(),u=s[l];E.DEBUG&&console.log(e.step,(1=a.width||t>=a.height?[0,0,0,0]:this._getPixel(e,t);var s=new l.default.Image(r,i);return s.canvas.getContext("2d").drawImage(a,e,t,r*o,i*o,0,0,r,i),s},l.default.Renderer.prototype.textLeading=function(e){return"number"==typeof e?(this._setProperty("_textLeading",e),this._pInst):this._textLeading},l.default.Renderer.prototype.textSize=function(e){return"number"==typeof e?(this._setProperty("_textSize",e),this._setProperty("_textLeading",e*y._DEFAULT_LEADMULT),this._applyTextProperties()):this._textSize},l.default.Renderer.prototype.textStyle=function(e){return e?(e!==y.NORMAL&&e!==y.ITALIC&&e!==y.BOLD&&e!==y.BOLDITALIC||this._setProperty("_textStyle",e),this._applyTextProperties()):this._textStyle},l.default.Renderer.prototype.textAscent=function(){return null===this._textAscent&&this._updateTextMetrics(),this._textAscent},l.default.Renderer.prototype.textDescent=function(){return null===this._textDescent&&this._updateTextMetrics(),this._textDescent},l.default.Renderer.prototype.textAlign=function(e,t){return void 0!==e?(this._setProperty("_textAlign",e),void 0!==t&&this._setProperty("_textBaseline",t),this._applyTextProperties()):{horizontal:this._textAlign,vertical:this._textBaseline}},l.default.Renderer.prototype.text=function(e,t,r,i,n){var o,a,s,l,u,h,c,f,d=this._pInst,p=Number.MAX_VALUE;if((this._doFill||this._doStroke)&&void 0!==e){if("string"!=typeof e&&(e=e.toString()),o=(e=e.replace(/(\t)/g," ")).split("\n"),void 0!==i){for(s=f=0;ss.HALF_PI&&e<=3*s.HALF_PI?Math.atan(r/i*Math.tan(e))+s.PI:Math.atan(r/i*Math.tan(e))+s.TWO_PI,t=t<=s.HALF_PI?Math.atan(r/i*Math.tan(t)):t>s.HALF_PI&&t<=3*s.HALF_PI?Math.atan(r/i*Math.tan(t))+s.PI:Math.atan(r/i*Math.tan(t))+s.TWO_PI),tv||Math.abs(this.accelerationY-this.pAccelerationY)>v||Math.abs(this.accelerationZ-this.pAccelerationZ)>v)&&e();var t=this.deviceTurned||window.deviceTurned;if("function"==typeof t){var r=this.rotationX+180,i=this.pRotationX+180,n=c+180;0>>24],i+=x[(16711680&C)>>16],n+=x[(65280&C)>>8],o+=x[255&C],r+=k[_],s++}w[l=T+y]=a/r,S[l]=i/r,M[l]=n/r,E[l]=o/r}T+=d}for(h=(u=-P)*d,b=T=0;b>>16,e[r+1]=(65280&t[i])>>>8,e[r+2]=255&t[i],e[r+3]=(4278190080&t[i])>>>24},O._toImageData=function(e){return e instanceof ImageData?e:e.getContext("2d").getImageData(0,0,e.width,e.height)},O._createImageData=function(e,t){return O._tmpCanvas=document.createElement("canvas"),O._tmpCtx=O._tmpCanvas.getContext("2d"),this._tmpCtx.createImageData(e,t)},O.apply=function(e,t,r){var i=e.getContext("2d"),n=i.getImageData(0,0,e.width,e.height),o=t(n,r);o instanceof ImageData?i.putImageData(o,0,0,0,0,e.width,e.height):i.putImageData(n,0,0,0,0,e.width,e.height)},O.threshold=function(e,t){var r=O._toPixels(e);void 0===t&&(t=.5);for(var i=Math.floor(255*t),n=0;n>8)/i,r[n+1]=255*(a*t>>8)/i,r[n+2]=255*(s*t>>8)/i}},O.dilate=function(e){for(var t,r,i,n,o,a,s,l,u,h,c,f,d,p,m,g,v,y=O._toPixels(e),b=0,_=y.length?y.length/4:0,x=new Int32Array(_);b<_;)for(r=(t=b)+e.width;b>16&255)+151*(i>>8&255)+28*(255&i))<(m=77*(c>>16&255)+151*(c>>8&255)+28*(255&c))&&(n=c,o=m),o<(p=77*((h=O._getARGB(y,a))>>16&255)+151*(h>>8&255)+28*(255&h))&&(n=h,o=p),o<(g=77*(f>>16&255)+151*(f>>8&255)+28*(255&f))&&(n=f,o=g),o<(v=77*(d>>16&255)+151*(d>>8&255)+28*(255&d))&&(n=d,o=v),x[b++]=n;O._setPixels(y,x)},O.erode=function(e){for(var t,r,i,n,o,a,s,l,u,h,c,f,d,p,m,g,v,y=O._toPixels(e),b=0,_=y.length?y.length/4:0,x=new Int32Array(_);b<_;)for(r=(t=b)+e.width;b>16&255)+151*(c>>8&255)+28*(255&c))<(o=77*(i>>16&255)+151*(i>>8&255)+28*(255&i))&&(n=c,o=m),(p=77*((h=O._getARGB(y,a))>>16&255)+151*(h>>8&255)+28*(255&h))>16&255)+151*(f>>8&255)+28*(255&f))>16&255)+151*(d>>8&255)+28*(255&d))=r){var i=Math.floor(t.timeDisplayed/r);if(t.timeDisplayed=0,t.displayIndex+=i,t.loopCount=Math.floor(t.displayIndex/t.numFrames),null!==t.loopLimit&&t.loopCount>=t.loopLimit)t.playing=!1;else{var n=t.displayIndex%t.numFrames;this.drawingContext.putImageData(t.frames[n].image,0,0),t.displayIndex=n,this.setModified(!0)}}}},n.default.Image.prototype._setProperty=function(e,t){this[e]=t,this.setModified(!0)},n.default.Image.prototype.loadPixels=function(){n.default.Renderer2D.prototype.loadPixels.call(this),this.setModified(!0)},n.default.Image.prototype.updatePixels=function(e,t,r,i){n.default.Renderer2D.prototype.updatePixels.call(this,e,t,r,i),this.setModified(!0)},n.default.Image.prototype.get=function(e,t,r,i){return n.default._validateParameters("p5.Image.get",arguments),n.default.Renderer2D.prototype.get.apply(this,arguments)},n.default.Image.prototype._getPixel=n.default.Renderer2D.prototype._getPixel,n.default.Image.prototype.set=function(e,t,r){n.default.Renderer2D.prototype.set.call(this,e,t,r),this.setModified(!0)},n.default.Image.prototype.resize=function(e,t){0===e&&0===t?(e=this.canvas.width,t=this.canvas.height):0===e?e=this.canvas.width*t/this.canvas.height:0===t&&(t=this.canvas.height*e/this.canvas.width),e=Math.floor(e),t=Math.floor(t);var r=document.createElement("canvas");if(r.width=e,r.height=t,this.gifProperties)for(var i=this.gifProperties,n=function(e,t){for(var r=0,i=0;i/g,">").replace(/"/g,""").replace(/'/g,"'")}function l(e,t){t&&!0!==t&&"true"!==t||(t="");var r="";return(e=e||"untitled")&&e.includes(".")&&(r=e.split(".").pop()),t&&r!==t&&(r=t,e="".concat(e,".").concat(r)),[e,r]}e("../core/error_helpers"),v.default.prototype.loadJSON=function(){for(var e=arguments.length,t=new Array(e),r=0;r"),n.print("");if(n.print(' '),n.print(""),n.print(""),n.print(" "),"0"!==o[0]){n.print(" ");for(var h=0;h".concat(c)),n.print(" ")}n.print(" ")}for(var f=0;f");for(var d=0;d".concat(p)),n.print(" ")}n.print(" ")}n.print("
"),n.print(""),n.print("")}n.close(),n.clear()},v.default.prototype.writeFile=function(e,t,r){var i="application/octet-stream";v.default.prototype._isSafari()&&(i="text/plain");var n=new Blob(e,{type:i});v.default.prototype.downloadFile(n,t,r)},v.default.prototype.downloadFile=function(e,t,r){var i=l(t,r),n=i[0];if(e instanceof Blob)s.default.saveAs(e,n);else{var o=document.createElement("a");if(o.href=e,o.download=n,o.onclick=function(e){var t;t=e,document.body.removeChild(t.target),e.stopPropagation()},o.style.display="none",document.body.appendChild(o),v.default.prototype._isSafari()){var a="Hello, Safari user! To download this file...\n";a+="1. Go to File --\x3e Save As.\n",a+='2. Choose "Page Source" as the Format.\n',a+='3. Name it with this extension: ."'.concat(i[1],'"'),alert(a)}o.click()}},v.default.prototype._checkFileExtension=l,v.default.prototype._isSafari=function(){return 0>>0},getSeed:function(){return t},rand:function(){return(r=(1664525*r+1013904223)%i)/i}});n.setSeed(e),_=new Array(4096);for(var o=0;o<4096;o++)_[o]=n.rand()};var o=n.default;r.default=o},{"../core/main":49}],82:[function(e,t,r){"use strict";function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i,l=(i=e("../core/main"))&&i.__esModule?i:{default:i},o=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==a(e)&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var o=i?Object.getOwnPropertyDescriptor(e,n):null;o&&(o.get||o.set)?Object.defineProperty(r,n,o):r[n]=e[n]}r.default=e,t&&t.set(e,r);return r}(e("../core/constants"));function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}l.default.Vector=function(e,t,r){var i,n,o;o=e instanceof l.default?(this.p5=e,i=t[0]||0,n=t[1]||0,t[2]||0):(i=e||0,n=t||0,r||0),this.x=i,this.y=n,this.z=o},l.default.Vector.prototype.toString=function(){return"p5.Vector Object : [".concat(this.x,", ").concat(this.y,", ").concat(this.z,"]")},l.default.Vector.prototype.set=function(e,t,r){return e instanceof l.default.Vector?(this.x=e.x||0,this.y=e.y||0,this.z=e.z||0):e instanceof Array?(this.x=e[0]||0,this.y=e[1]||0,this.z=e[2]||0):(this.x=e||0,this.y=t||0,this.z=r||0),this},l.default.Vector.prototype.copy=function(){return this.p5?new l.default.Vector(this.p5,[this.x,this.y,this.z]):new l.default.Vector(this.x,this.y,this.z)},l.default.Vector.prototype.add=function(e,t,r){return e instanceof l.default.Vector?(this.x+=e.x||0,this.y+=e.y||0,this.z+=e.z||0):e instanceof Array?(this.x+=e[0]||0,this.y+=e[1]||0,this.z+=e[2]||0):(this.x+=e||0,this.y+=t||0,this.z+=r||0),this};function u(e,t){return 0!==e&&(this.x=this.x%e),0!==t&&(this.y=this.y%t),this}function h(e,t,r){return 0!==e&&(this.x=this.x%e),0!==t&&(this.y=this.y%t),0!==r&&(this.z=this.z%r),this}l.default.Vector.prototype.rem=function(e,t,r){if(e instanceof l.default.Vector){if(Number.isFinite(e.x)&&Number.isFinite(e.y)&&Number.isFinite(e.z)){var i=parseFloat(e.x),n=parseFloat(e.y),o=parseFloat(e.z);h.call(this,i,n,o)}}else if(e instanceof Array)e.every(function(e){return Number.isFinite(e)})&&(2===e.length&&u.call(this,e[0],e[1]),3===e.length&&h.call(this,e[0],e[1],e[2]));else if(1===arguments.length){if(Number.isFinite(e)&&0!==e)return this.x=this.x%e,this.y=this.y%e,this.z=this.z%e,this}else if(2===arguments.length){var a=Array.prototype.slice.call(arguments);a.every(function(e){return Number.isFinite(e)})&&2===a.length&&u.call(this,a[0],a[1])}else if(3===arguments.length){var s=Array.prototype.slice.call(arguments);s.every(function(e){return Number.isFinite(e)})&&3===s.length&&h.call(this,s[0],s[1],s[2])}},l.default.Vector.prototype.sub=function(e,t,r){return e instanceof l.default.Vector?(this.x-=e.x||0,this.y-=e.y||0,this.z-=e.z||0):e instanceof Array?(this.x-=e[0]||0,this.y-=e[1]||0,this.z-=e[2]||0):(this.x-=e||0,this.y-=t||0,this.z-=r||0),this},l.default.Vector.prototype.mult=function(e){return"number"==typeof e&&isFinite(e)?(this.x*=e,this.y*=e,this.z*=e):console.warn("p5.Vector.prototype.mult:","n is undefined or not a finite number"),this},l.default.Vector.prototype.div=function(e){return"number"==typeof e&&isFinite(e)?0===e?console.warn("p5.Vector.prototype.div:","divide by 0"):(this.x/=e,this.y/=e,this.z/=e):console.warn("p5.Vector.prototype.div:","n is undefined or not a finite number"),this},l.default.Vector.prototype.mag=function(){return Math.sqrt(this.magSq())},l.default.Vector.prototype.magSq=function(){var e=this.x,t=this.y,r=this.z;return e*e+t*t+r*r},l.default.Vector.prototype.dot=function(e,t,r){return e instanceof l.default.Vector?this.dot(e.x,e.y,e.z):this.x*(e||0)+this.y*(t||0)+this.z*(r||0)},l.default.Vector.prototype.cross=function(e){var t=this.y*e.z-this.z*e.y,r=this.z*e.x-this.x*e.z,i=this.x*e.y-this.y*e.x;return this.p5?new l.default.Vector(this.p5,[t,r,i]):new l.default.Vector(t,r,i)},l.default.Vector.prototype.dist=function(e){return e.copy().sub(this).mag()},l.default.Vector.prototype.normalize=function(){var e=this.mag();return 0!==e&&this.mult(1/e),this},l.default.Vector.prototype.limit=function(e){var t=this.magSq();return e*e>>0},n.default.prototype.randomSeed=function(e){this._lcgSetSeed(o,e),this._gaussian_previous=!1},n.default.prototype.random=function(e,t){var r;if(n.default._validateParameters("random",arguments),r=null!=this[o]?this._lcg(o):Math.random(),void 0===e)return r;if(void 0===t)return e instanceof Array?e[Math.floor(r*e.length)]:r*e;if(tf){var P=p,L=l,k=u;p=d+f*(s&&d=t&&(r=r.substring(r.length-t,r.length)),r}},n.default.prototype.unhex=function(e){return e instanceof Array?e.map(n.default.prototype.unhex):parseInt("0x".concat(e),16)};var o=n.default;r.default=o},{"../core/main":49}],90:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i,a=(i=e("../core/main"))&&i.__esModule?i:{default:i};function n(e,t,r){var i=e<0,n=i?e.toString().substring(1):e.toString(),o=n.indexOf("."),a=-1!==o?n.substring(0,o):n,s=-1!==o?n.substring(o+1):"",l=i?"-":"";if(void 0!==r){var u="";(-1!==o||0r&&(s=s.substring(0,r));for(var h=0;hi.length)for(var o=t-(i+=-1===r?".":"").length+1,a=0;a=d.TWO_PI?"".concat("ellipse","|").concat(u,"|"):"".concat("arc","|").concat(a,"|").concat(s,"|").concat(l,"|").concat(u,"|"),!this.geometryInHash(t)){var h=new T.default.Geometry(u,1,function(){if(this.strokeIndices=[],a.toFixed(10)!==s.toFixed(10)){l!==d.PIE&&void 0!==l||(this.vertices.push(new T.default.Vector(.5,.5,0)),this.uvs.push([.5,.5]));for(var e=0;e<=u;e++){var t=(s-a)*(e/u)+a,r=.5+Math.cos(t)/2,i=.5+Math.sin(t)/2;this.vertices.push(new T.default.Vector(r,i,0)),this.uvs.push([r,i]),e>5&31)/31,(y>>10&31)/31):(r=a,i=s,l)}for(var b=1;b<=3;b++){var _=p+12*b,x=new S.default.Vector(u.getFloat32(_,!0),u.getFloat32(8+_,!0),u.getFloat32(4+_,!0));e.vertices.push(x),c&&o.push(r,i,n)}var w=new S.default.Vector(m,g,v);e.vertexNormals.push(w,w,w),e.faces.push([3*d,3*d+1,3*d+2]),e.uvs.push([0,0],[0,0],[0,0])}}(e,t);else{var r=new DataView(t);if(!("TextDecoder"in window))return console.warn("Sorry, ASCII STL loading only works in browsers that support TextDecoder (https://caniuse.com/#feat=textencoder)");var i=new TextDecoder("utf-8").decode(r).split("\n");!function(e,t){for(var r,i,n="",o=[],a=0;aMath.PI?l=Math.PI:l<=0&&(l=.001);var u=Math.sin(l)*a*Math.sin(s),h=Math.cos(l)*a,c=Math.sin(l)*a*Math.cos(s);this.camera(u+this.centerX,h+this.centerY,c+this.centerZ,this.centerX,this.centerY,this.centerZ,0,1,0)},m.default.Camera.prototype._isActive=function(){return this===this._renderer._curCamera},m.default.prototype.setCamera=function(e){this._renderer._curCamera=e,this._renderer.uPMatrix.set(e.projMatrix.mat4[0],e.projMatrix.mat4[1],e.projMatrix.mat4[2],e.projMatrix.mat4[3],e.projMatrix.mat4[4],e.projMatrix.mat4[5],e.projMatrix.mat4[6],e.projMatrix.mat4[7],e.projMatrix.mat4[8],e.projMatrix.mat4[9],e.projMatrix.mat4[10],e.projMatrix.mat4[11],e.projMatrix.mat4[12],e.projMatrix.mat4[13],e.projMatrix.mat4[14],e.projMatrix.mat4[15])};var n=m.default.Camera;r.default=n},{"../core/main":49}],98:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i,h=(i=e("../core/main"))&&i.__esModule?i:{default:i};h.default.Geometry=function(e,t,r){return this.vertices=[],this.lineVertices=[],this.lineNormals=[],this.vertexNormals=[],this.faces=[],this.uvs=[],this.edges=[],this.vertexColors=[],this.detailX=void 0!==e?e:1,this.detailY=void 0!==t?t:1,this.dirtyFlags={},r instanceof Function&&r.call(this),this},h.default.Geometry.prototype.reset=function(){this.lineVertices.length=0,this.lineNormals.length=0,this.vertices.length=0,this.edges.length=0,this.vertexColors.length=0,this.vertexNormals.length=0,this.uvs.length=0,this.dirtyFlags={}},h.default.Geometry.prototype.computeFaces=function(){this.faces.length=0;for(var e,t,r,i,n=this.detailX+1,o=0;othis.vertices.length-1-this.detailX;i--)e.add(this.vertexNormals[i]);e=h.default.Vector.div(e,this.detailX);for(var n=this.vertices.length-1;n>this.vertices.length-1-this.detailX;n--)this.vertexNormals[n]=e;return this},h.default.Geometry.prototype._makeTriangleEdges=function(){if(this.edges.length=0,Array.isArray(this.strokeIndices))for(var e=0,t=this.strokeIndices.length;e vTexCoord.y;\n bool y1 = p1.y > vTexCoord.y;\n bool y2 = p2.y > vTexCoord.y;\n\n // could web be under the curve (after t1)?\n if (y1 ? !y2 : y0) {\n // add the coverage for t1\n coverage.x += saturate(C1.x + 0.5);\n // calculate the anti-aliasing for t1\n weight.x = min(weight.x, abs(C1.x));\n }\n\n // are we outside the curve (after t2)?\n if (y1 ? !y0 : y2) {\n // subtract the coverage for t2\n coverage.x -= saturate(C2.x + 0.5);\n // calculate the anti-aliasing for t2\n weight.x = min(weight.x, abs(C2.x));\n }\n}\n\n// this is essentially the same as coverageX, but with the axes swapped\nvoid coverageY(vec2 p0, vec2 p1, vec2 p2) {\n\n vec2 C1, C2;\n calulateCrossings(p0, p1, p2, C1, C2);\n\n bool x0 = p0.x > vTexCoord.x;\n bool x1 = p1.x > vTexCoord.x;\n bool x2 = p2.x > vTexCoord.x;\n\n if (x1 ? !x2 : x0) {\n coverage.y -= saturate(C1.y + 0.5);\n weight.y = min(weight.y, abs(C1.y));\n }\n\n if (x1 ? !x0 : x2) {\n coverage.y += saturate(C2.y + 0.5);\n weight.y = min(weight.y, abs(C2.y));\n }\n}\n\nvoid main() {\n\n // calculate the pixel scale based on screen-coordinates\n pixelScale = hardness / fwidth(vTexCoord);\n\n // which grid cell is this pixel in?\n ivec2 gridCoord = ifloor(vTexCoord * vec2(uGridSize));\n\n // intersect curves in this row\n {\n // the index into the row info bitmap\n int rowIndex = gridCoord.y + uGridOffset.y;\n // fetch the info texel\n vec4 rowInfo = getTexel(uSamplerRows, rowIndex, uGridImageSize);\n // unpack the rowInfo\n int rowStrokeIndex = getInt16(rowInfo.xy);\n int rowStrokeCount = getInt16(rowInfo.zw);\n\n for (int iRowStroke = INT(0); iRowStroke < N; iRowStroke++) {\n if (iRowStroke >= rowStrokeCount)\n break;\n\n // each stroke is made up of 3 points: the start and control point\n // and the start of the next curve.\n // fetch the indices of this pair of strokes:\n vec4 strokeIndices = getTexel(uSamplerRowStrokes, rowStrokeIndex++, uCellsImageSize);\n\n // unpack the stroke index\n int strokePos = getInt16(strokeIndices.xy);\n\n // fetch the two strokes\n vec4 stroke0 = getTexel(uSamplerStrokes, strokePos + INT(0), uStrokeImageSize);\n vec4 stroke1 = getTexel(uSamplerStrokes, strokePos + INT(1), uStrokeImageSize);\n\n // calculate the coverage\n coverageX(stroke0.xy, stroke0.zw, stroke1.xy);\n }\n }\n\n // intersect curves in this column\n {\n int colIndex = gridCoord.x + uGridOffset.x;\n vec4 colInfo = getTexel(uSamplerCols, colIndex, uGridImageSize);\n int colStrokeIndex = getInt16(colInfo.xy);\n int colStrokeCount = getInt16(colInfo.zw);\n \n for (int iColStroke = INT(0); iColStroke < N; iColStroke++) {\n if (iColStroke >= colStrokeCount)\n break;\n\n vec4 strokeIndices = getTexel(uSamplerColStrokes, colStrokeIndex++, uCellsImageSize);\n\n int strokePos = getInt16(strokeIndices.xy);\n vec4 stroke0 = getTexel(uSamplerStrokes, strokePos + INT(0), uStrokeImageSize);\n vec4 stroke1 = getTexel(uSamplerStrokes, strokePos + INT(1), uStrokeImageSize);\n coverageY(stroke0.xy, stroke0.zw, stroke1.xy);\n }\n }\n\n weight = saturate(1.0 - weight * 2.0);\n float distance = max(weight.x + weight.y, minDistance); // manhattan approx.\n float antialias = abs(dot(coverage, weight) / distance);\n float cover = min(abs(coverage.x), abs(coverage.y));\n gl_FragColor = uMaterialColor;\n gl_FragColor.a *= saturate(max(antialias, cover));\n}",lineVert:"/*\n Part of the Processing project - http://processing.org\n Copyright (c) 2012-15 The Processing Foundation\n Copyright (c) 2004-12 Ben Fry and Casey Reas\n Copyright (c) 2001-04 Massachusetts Institute of Technology\n This library is free software; you can redistribute it and/or\n modify it under the terms of the GNU Lesser General Public\n License as published by the Free Software Foundation, version 2.1.\n This library is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n Lesser General Public License for more details.\n You should have received a copy of the GNU Lesser General\n Public License along with this library; if not, write to the\n Free Software Foundation, Inc., 59 Temple Place, Suite 330,\n Boston, MA 02111-1307 USA\n*/\n\n#define PROCESSING_LINE_SHADER\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform float uStrokeWeight;\n\nuniform vec4 uViewport;\nuniform int uPerspective;\n\nattribute vec4 aPosition;\nattribute vec4 aDirection;\n \nvoid main() {\n // using a scale <1 moves the lines towards the camera\n // in order to prevent popping effects due to half of\n // the line disappearing behind the geometry faces.\n vec3 scale = vec3(0.9995);\n\n vec4 posp = uModelViewMatrix * aPosition;\n vec4 posq = uModelViewMatrix * (aPosition + vec4(aDirection.xyz, 0));\n\n // Moving vertices slightly toward the camera\n // to avoid depth-fighting with the fill triangles.\n // Discussed here:\n // http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Number=252848 \n posp.xyz = posp.xyz * scale;\n posq.xyz = posq.xyz * scale;\n\n vec4 p = uProjectionMatrix * posp;\n vec4 q = uProjectionMatrix * posq;\n\n // formula to convert from clip space (range -1..1) to screen space (range 0..[width or height])\n // screen_p = (p.xy/p.w + <1,1>) * 0.5 * uViewport.zw\n\n // prevent division by W by transforming the tangent formula (div by 0 causes\n // the line to disappear, see https://github.com/processing/processing/issues/5183)\n // t = screen_q - screen_p\n //\n // tangent is normalized and we don't care which aDirection it points to (+-)\n // t = +- normalize( screen_q - screen_p )\n // t = +- normalize( (q.xy/q.w+<1,1>)*0.5*uViewport.zw - (p.xy/p.w+<1,1>)*0.5*uViewport.zw )\n //\n // extract common factor, <1,1> - <1,1> cancels out\n // t = +- normalize( (q.xy/q.w - p.xy/p.w) * 0.5 * uViewport.zw )\n //\n // convert to common divisor\n // t = +- normalize( ((q.xy*p.w - p.xy*q.w) / (p.w*q.w)) * 0.5 * uViewport.zw )\n //\n // remove the common scalar divisor/factor, not needed due to normalize and +-\n // (keep uViewport - can't remove because it has different components for x and y\n // and corrects for aspect ratio, see https://github.com/processing/processing/issues/5181)\n // t = +- normalize( (q.xy*p.w - p.xy*q.w) * uViewport.zw )\n\n vec2 tangent = normalize((q.xy*p.w - p.xy*q.w) * uViewport.zw);\n\n // flip tangent to normal (it's already normalized)\n vec2 normal = vec2(-tangent.y, tangent.x);\n\n float thickness = aDirection.w * uStrokeWeight;\n vec2 offset = normal * thickness / 2.0;\n\n vec2 curPerspScale;\n\n if(uPerspective == 1) {\n // Perspective ---\n // convert from world to clip by multiplying with projection scaling factor\n // to get the right thickness (see https://github.com/processing/processing/issues/5182)\n // invert Y, projections in Processing invert Y\n curPerspScale = (uProjectionMatrix * vec4(1, -1, 0, 0)).xy;\n } else {\n // No Perspective ---\n // multiply by W (to cancel out division by W later in the pipeline) and\n // convert from screen to clip (derived from clip to screen above)\n curPerspScale = p.w / (0.5 * uViewport.zw);\n }\n\n gl_Position.xy = p.xy + offset.xy * curPerspScale;\n gl_Position.zw = p.zw;\n}\n",lineFrag:"precision mediump float;\nprecision mediump int;\n\nuniform vec4 uMaterialColor;\n\nvoid main() {\n gl_FragColor = uMaterialColor;\n}",pointVert:"attribute vec3 aPosition;\nuniform float uPointSize;\nvarying float vStrokeWeight;\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nvoid main() {\n\tvec4 positionVec4 = vec4(aPosition, 1.0);\n\tgl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n\tgl_PointSize = uPointSize;\n\tvStrokeWeight = uPointSize;\n}",pointFrag:"precision mediump float;\nprecision mediump int;\nuniform vec4 uMaterialColor;\nvarying float vStrokeWeight;\n\nvoid main(){\n\tfloat mask = 0.0;\n\n\t// make a circular mask using the gl_PointCoord (goes from 0 - 1 on a point)\n // might be able to get a nicer edge on big strokeweights with smoothstep but slightly less performant\n\n\tmask = step(0.98, length(gl_PointCoord * 2.0 - 1.0));\n\n\t// if strokeWeight is 1 or less lets just draw a square\n\t// this prevents weird artifacting from carving circles when our points are really small\n\t// if strokeWeight is larger than 1, we just use it as is\n\n\tmask = mix(0.0, mask, clamp(floor(vStrokeWeight - 0.5),0.0,1.0));\n\n\t// throw away the borders of the mask\n // otherwise we get weird alpha blending issues\n\n\tif(mask > 0.98){\n discard;\n \t}\n\n \tgl_FragColor = vec4(uMaterialColor.rgb * (1.0 - mask), uMaterialColor.a) ;\n}"};u.default.RendererGL=function(e,t,r,i){return u.default.Renderer.call(this,e,t,r),this._setAttributeDefaults(t),this._initContext(),this.isP3D=!0,this.GL=this.drawingContext,this._isErasing=!1,this._enableLighting=!1,this.ambientLightColors=[],this.specularColors=[1,1,1],this.directionalLightDirections=[],this.directionalLightDiffuseColors=[],this.directionalLightSpecularColors=[],this.pointLightPositions=[],this.pointLightDiffuseColors=[],this.pointLightSpecularColors=[],this.spotLightPositions=[],this.spotLightDirections=[],this.spotLightDiffuseColors=[],this.spotLightSpecularColors=[],this.spotLightAngle=[],this.spotLightConc=[],this.drawMode=o.FILL,this.curFillColor=this._cachedFillStyle=[1,1,1,1],this.curStrokeColor=this._cachedStrokeStyle=[0,0,0,1],this.curBlendMode=o.BLEND,this._cachedBlendMode=void 0,this.blendExt=this.GL.getExtension("EXT_blend_minmax"),this._isBlending=!1,this._useSpecularMaterial=!1,this._useEmissiveMaterial=!1,this._useNormalMaterial=!1,this._useShininess=1,this._tint=[255,255,255,255],this.constantAttenuation=1,this.linearAttenuation=0,this.quadraticAttenuation=0,this.uMVMatrix=new u.default.Matrix,this.uPMatrix=new u.default.Matrix,this.uNMatrix=new u.default.Matrix("mat3"),this._curCamera=new u.default.Camera(this),this._curCamera._computeCameraDefaultSettings(),this._curCamera._setDefaultCamera(),this._defaultLightShader=void 0,this._defaultImmediateModeShader=void 0,this._defaultNormalShader=void 0,this._defaultColorShader=void 0,this._defaultPointShader=void 0,this.userFillShader=void 0,this.userStrokeShader=void 0,this.userPointShader=void 0,this.retainedMode={geometry:{},buffers:{stroke:[new u.default.RenderBuffer(3,"lineVertices","lineVertexBuffer","aPosition",this,this._flatten),new u.default.RenderBuffer(4,"lineNormals","lineNormalBuffer","aDirection",this,this._flatten)],fill:[new u.default.RenderBuffer(3,"vertices","vertexBuffer","aPosition",this,this._vToNArray),new u.default.RenderBuffer(3,"vertexNormals","normalBuffer","aNormal",this,this._vToNArray),new u.default.RenderBuffer(4,"vertexColors","colorBuffer","aMaterialColor",this),new u.default.RenderBuffer(3,"vertexAmbients","ambientBuffer","aAmbientColor",this),new u.default.RenderBuffer(2,"uvs","uvBuffer","aTexCoord",this,this._flatten)],text:[new u.default.RenderBuffer(3,"vertices","vertexBuffer","aPosition",this,this._vToNArray),new u.default.RenderBuffer(2,"uvs","uvBuffer","aTexCoord",this,this._flatten)]}},this.immediateMode={geometry:new u.default.Geometry,shapeMode:o.TRIANGLE_FAN,_bezierVertex:[],_quadraticVertex:[],_curveVertex:[],buffers:{fill:[new u.default.RenderBuffer(3,"vertices","vertexBuffer","aPosition",this,this._vToNArray),new u.default.RenderBuffer(3,"vertexNormals","normalBuffer","aNormal",this,this._vToNArray),new u.default.RenderBuffer(4,"vertexColors","colorBuffer","aVertexColor",this),new u.default.RenderBuffer(3,"vertexAmbients","ambientBuffer","aAmbientColor",this),new u.default.RenderBuffer(2,"uvs","uvBuffer","aTexCoord",this,this._flatten)],stroke:[new u.default.RenderBuffer(3,"lineVertices","lineVertexBuffer","aPosition",this,this._flatten),new u.default.RenderBuffer(4,"lineNormals","lineNormalBuffer","aDirection",this,this._flatten)],point:this.GL.createBuffer()}},this.pointSize=5,this.curStrokeWeight=1,this.textures=[],this.textureMode=o.IMAGE,this.textureWrapX=o.CLAMP,this.textureWrapY=o.CLAMP,this._tex=null,this._curveTightness=6,this._lookUpTableBezier=[],this._lookUpTableQuadratic=[],this._lutBezierDetail=0,this._lutQuadraticDetail=0,this._tessy=this._initTessy(),this.fontInfos={},this._curShader=void 0,this},u.default.RendererGL.prototype=Object.create(u.default.Renderer.prototype),u.default.RendererGL.prototype._setAttributeDefaults=function(e){var t={alpha:!0,depth:!0,stencil:!0,antialias:navigator.userAgent.toLowerCase().includes("safari"),premultipliedAlpha:!1,preserveDrawingBuffer:!0,perPixelLighting:!0};null===e._glAttributes?e._glAttributes=t:e._glAttributes=Object.assign(t,e._glAttributes)},u.default.RendererGL.prototype._initContext=function(){try{if(this.drawingContext=this.canvas.getContext("webgl",this._pInst._glAttributes)||this.canvas.getContext("experimental-webgl",this._pInst._glAttributes),null===this.drawingContext)throw new Error("Error creating webgl context");var e=this.drawingContext;e.enable(e.DEPTH_TEST),e.depthFunc(e.LEQUAL),e.viewport(0,0,e.drawingBufferWidth,e.drawingBufferHeight),this._viewport=this.drawingContext.getParameter(this.drawingContext.VIEWPORT)}catch(e){throw e}},u.default.RendererGL.prototype._resetContext=function(e,t){var r=this.width,i=this.height,n=this.canvas.id,o=this._pInst instanceof u.default.Graphics;if(o){var a=this._pInst;a.canvas.parentNode.removeChild(a.canvas),a.canvas=document.createElement("canvas"),(a._pInst._userNode||document.body).appendChild(a.canvas),u.default.Element.call(a,a.canvas,a._pInst),a.width=r,a.height=i}else{var s=this.canvas;s&&s.parentNode.removeChild(s),(s=document.createElement("canvas")).id=n,this._pInst._userNode?this._pInst._userNode.appendChild(s):document.body.appendChild(s),this._pInst.canvas=s}var l=new u.default.RendererGL(this._pInst.canvas,this._pInst,!o);this._pInst._setProperty("_renderer",l),l.resize(r,i),l._applyDefaults(),o||this._pInst._elements.push(l),"function"==typeof t&&setTimeout(function(){t.apply(window._renderer,e)},0)},u.default.prototype.setAttributes=function(e,t){if(void 0!==this._glAttributes){var r=!0;if(void 0!==t?(null===this._glAttributes&&(this._glAttributes={}),this._glAttributes[e]!==t&&(this._glAttributes[e]=t,r=!1)):e instanceof Object&&this._glAttributes!==e&&(this._glAttributes=e,r=!1),this._renderer.isP3D&&!r){if(!this._setupDone)for(var i in this._renderer.retainedMode.geometry)if(this._renderer.retainedMode.geometry.hasOwnProperty(i))return void console.error("Sorry, Could not set the attributes, you need to call setAttributes() before calling the other drawing methods in setup()");this.push(),this._renderer._resetContext(),this.pop(),this._renderer._curCamera&&(this._renderer._curCamera._renderer=this._renderer)}}else console.log("You are trying to use setAttributes on a p5.Graphics object that does not use a WEBGL renderer.")},u.default.RendererGL.prototype._update=function(){this.uMVMatrix.set(this._curCamera.cameraMatrix.mat4[0],this._curCamera.cameraMatrix.mat4[1],this._curCamera.cameraMatrix.mat4[2],this._curCamera.cameraMatrix.mat4[3],this._curCamera.cameraMatrix.mat4[4],this._curCamera.cameraMatrix.mat4[5],this._curCamera.cameraMatrix.mat4[6],this._curCamera.cameraMatrix.mat4[7],this._curCamera.cameraMatrix.mat4[8],this._curCamera.cameraMatrix.mat4[9],this._curCamera.cameraMatrix.mat4[10],this._curCamera.cameraMatrix.mat4[11],this._curCamera.cameraMatrix.mat4[12],this._curCamera.cameraMatrix.mat4[13],this._curCamera.cameraMatrix.mat4[14],this._curCamera.cameraMatrix.mat4[15]),this.ambientLightColors.length=0,this.specularColors=[1,1,1],this.directionalLightDirections.length=0,this.directionalLightDiffuseColors.length=0,this.directionalLightSpecularColors.length=0,this.pointLightPositions.length=0,this.pointLightDiffuseColors.length=0,this.pointLightSpecularColors.length=0,this.spotLightPositions.length=0,this.spotLightDirections.length=0,this.spotLightDiffuseColors.length=0,this.spotLightSpecularColors.length=0,this.spotLightAngle.length=0,this.spotLightConc.length=0,this._enableLighting=!1,this._tint=[255,255,255,255],this.GL.clear(this.GL.DEPTH_BUFFER_BIT)},u.default.RendererGL.prototype.background=function(){var e,t=(e=this._pInst).color.apply(e,arguments),r=t.levels[0]/255,i=t.levels[1]/255,n=t.levels[2]/255,o=t.levels[3]/255;this.GL.clearColor(r,i,n,o),this.GL.clear(this.GL.COLOR_BUFFER_BIT)},u.default.RendererGL.prototype.fill=function(e,t,r,i){var n=u.default.prototype.color.apply(this._pInst,arguments);this.curFillColor=n._array,this.drawMode=o.FILL,this._useNormalMaterial=!1,this._tex=null},u.default.RendererGL.prototype.stroke=function(e,t,r,i){arguments[3]=255;var n=u.default.prototype.color.apply(this._pInst,arguments);this.curStrokeColor=n._array},u.default.RendererGL.prototype.strokeCap=function(e){console.error("Sorry, strokeCap() is not yet implemented in WEBGL mode")},u.default.RendererGL.prototype.strokeJoin=function(e){console.error("Sorry, strokeJoin() is not yet implemented in WEBGL mode")},u.default.RendererGL.prototype.filter=function(e){console.error("filter() does not work in WEBGL mode")},u.default.RendererGL.prototype.blendMode=function(e){e===o.DARKEST||e===o.LIGHTEST||e===o.ADD||e===o.BLEND||e===o.SUBTRACT||e===o.SCREEN||e===o.EXCLUSION||e===o.REPLACE||e===o.MULTIPLY||e===o.REMOVE?this.curBlendMode=e:e!==o.BURN&&e!==o.OVERLAY&&e!==o.HARD_LIGHT&&e!==o.SOFT_LIGHT&&e!==o.DODGE||console.warn("BURN, OVERLAY, HARD_LIGHT, SOFT_LIGHT, and DODGE only work for blendMode in 2D mode.")},u.default.RendererGL.prototype.erase=function(e,t){this._isErasing||(this._cachedBlendMode=this.curBlendMode,this.blendMode(o.REMOVE),this._cachedFillStyle=this.curFillColor.slice(),this.curFillColor=[1,1,1,e/255],this._cachedStrokeStyle=this.curStrokeColor.slice(),this.curStrokeColor=[1,1,1,t/255],this._isErasing=!0)},u.default.RendererGL.prototype.noErase=function(){this._isErasing&&(this.curFillColor=this._cachedFillStyle.slice(),this.curStrokeColor=this._cachedStrokeStyle.slice(),this.blendMode(this._cachedBlendMode),this._isErasing=!1)},u.default.RendererGL.prototype.strokeWeight=function(e){this.curStrokeWeight!==e&&(this.pointSize=e,this.curStrokeWeight=e)},u.default.RendererGL.prototype._getPixel=function(e,t){var r;return r=new Uint8Array(4),this.drawingContext.readPixels(e,t,1,1,this.drawingContext.RGBA,this.drawingContext.UNSIGNED_BYTE,r),[r[0],r[1],r[2],r[3]]},u.default.RendererGL.prototype.loadPixels=function(){var e=this._pixelsState;if(!0===this._pInst._glAttributes.preserveDrawingBuffer){var t=e.pixels,r=this.GL.drawingBufferWidth*this.GL.drawingBufferHeight*4;t instanceof Uint8Array&&t.length===r||(t=new Uint8Array(r),this._pixelsState._setProperty("pixels",t));var i=this._pInst._pixelDensity;this.GL.readPixels(0,0,this.width*i,this.height*i,this.GL.RGBA,this.GL.UNSIGNED_BYTE,t)}else console.log("loadPixels only works in WebGL when preserveDrawingBuffer is true.")},u.default.RendererGL.prototype.geometryInHash=function(e){return void 0!==this.retainedMode.geometry[e]},u.default.RendererGL.prototype.resize=function(e,t){u.default.Renderer.prototype.resize.call(this,e,t),this.GL.viewport(0,0,this.GL.drawingBufferWidth,this.GL.drawingBufferHeight),this._viewport=this.GL.getParameter(this.GL.VIEWPORT),this._curCamera._resize();var r=this._pixelsState;void 0!==r.pixels&&r._setProperty("pixels",new Uint8Array(this.GL.drawingBufferWidth*this.GL.drawingBufferHeight*4))},u.default.RendererGL.prototype.clear=function(){var e=(arguments.length<=0?void 0:arguments[0])||0,t=(arguments.length<=1?void 0:arguments[1])||0,r=(arguments.length<=2?void 0:arguments[2])||0,i=(arguments.length<=3?void 0:arguments[3])||0;this.GL.clearColor(e,t,r,i),this.GL.clear(this.GL.COLOR_BUFFER_BIT|this.GL.DEPTH_BUFFER_BIT)},u.default.RendererGL.prototype.applyMatrix=function(e,t,r,i,n,o){16===arguments.length?u.default.Matrix.prototype.apply.apply(this.uMVMatrix,arguments):this.uMVMatrix.apply([e,t,0,0,r,i,0,0,0,0,1,0,n,o,0,1])},u.default.RendererGL.prototype.translate=function(e,t,r){return e instanceof u.default.Vector&&(r=e.z,t=e.y,e=e.x),this.uMVMatrix.translate([e,t,r]),this},u.default.RendererGL.prototype.scale=function(e,t,r){return this.uMVMatrix.scale(e,t,r),this},u.default.RendererGL.prototype.rotate=function(e,t){return void 0===t?this.rotateZ(e):(u.default.Matrix.prototype.rotate.apply(this.uMVMatrix,arguments),this)},u.default.RendererGL.prototype.rotateX=function(e){return this.rotate(e,1,0,0),this},u.default.RendererGL.prototype.rotateY=function(e){return this.rotate(e,0,1,0),this},u.default.RendererGL.prototype.rotateZ=function(e){return this.rotate(e,0,0,1),this},u.default.RendererGL.prototype.push=function(){var e=u.default.Renderer.prototype.push.apply(this),t=e.properties;return t.uMVMatrix=this.uMVMatrix.copy(),t.uPMatrix=this.uPMatrix.copy(),t._curCamera=this._curCamera,this._curCamera=this._curCamera.copy(),t.ambientLightColors=this.ambientLightColors.slice(),t.specularColors=this.specularColors.slice(),t.directionalLightDirections=this.directionalLightDirections.slice(),t.directionalLightDiffuseColors=this.directionalLightDiffuseColors.slice(),t.directionalLightSpecularColors=this.directionalLightSpecularColors.slice(),t.pointLightPositions=this.pointLightPositions.slice(),t.pointLightDiffuseColors=this.pointLightDiffuseColors.slice(),t.pointLightSpecularColors=this.pointLightSpecularColors.slice(),t.spotLightPositions=this.spotLightPositions.slice(),t.spotLightDirections=this.spotLightDirections.slice(),t.spotLightDiffuseColors=this.spotLightDiffuseColors.slice(),t.spotLightSpecularColors=this.spotLightSpecularColors.slice(),t.spotLightAngle=this.spotLightAngle.slice(),t.spotLightConc=this.spotLightConc.slice(),t.userFillShader=this.userFillShader,t.userStrokeShader=this.userStrokeShader,t.userPointShader=this.userPointShader,t.pointSize=this.pointSize,t.curStrokeWeight=this.curStrokeWeight,t.curStrokeColor=this.curStrokeColor,t.curFillColor=this.curFillColor,t._useSpecularMaterial=this._useSpecularMaterial,t._useEmissiveMaterial=this._useEmissiveMaterial,t._useShininess=this._useShininess,t.constantAttenuation=this.constantAttenuation,t.linearAttenuation=this.linearAttenuation,t.quadraticAttenuation=this.quadraticAttenuation,t._enableLighting=this._enableLighting,t._useNormalMaterial=this._useNormalMaterial,t._tex=this._tex,t.drawMode=this.drawMode,e},u.default.RendererGL.prototype.resetMatrix=function(){return this.uMVMatrix=u.default.Matrix.identity(this._pInst),this},u.default.RendererGL.prototype._getImmediateStrokeShader=function(){var e=this.userStrokeShader;return e&&e.isStrokeShader()?e:this._getLineShader()},u.default.RendererGL.prototype._getRetainedStrokeShader=u.default.RendererGL.prototype._getImmediateStrokeShader,u.default.RendererGL.prototype._getImmediateFillShader=function(){var e=this.userFillShader;if(this._useNormalMaterial&&(!e||!e.isNormalShader()))return this._getNormalShader();if(this._enableLighting){if(!e||!e.isLightShader())return this._getLightShader()}else if(this._tex){if(!e||!e.isTextureShader())return this._getLightShader()}else if(!e)return this._getImmediateModeShader();return e},u.default.RendererGL.prototype._getRetainedFillShader=function(){if(this._useNormalMaterial)return this._getNormalShader();var e=this.userFillShader;if(this._enableLighting){if(!e||!e.isLightShader())return this._getLightShader()}else if(this._tex){if(!e||!e.isTextureShader())return this._getLightShader()}else if(!e)return this._getColorShader();return e},u.default.RendererGL.prototype._getImmediatePointShader=function(){var e=this.userPointShader;return e&&e.isPointShader()?e:this._getPointShader()},u.default.RendererGL.prototype._getRetainedLineShader=u.default.RendererGL.prototype._getImmediateLineShader,u.default.RendererGL.prototype._getLightShader=function(){return this._defaultLightShader||(this._pInst._glAttributes.perPixelLighting?this._defaultLightShader=new u.default.Shader(this,c.phongVert,c.phongFrag):this._defaultLightShader=new u.default.Shader(this,c.lightVert,c.lightTextureFrag)),this._defaultLightShader},u.default.RendererGL.prototype._getImmediateModeShader=function(){return this._defaultImmediateModeShader||(this._defaultImmediateModeShader=new u.default.Shader(this,c.immediateVert,c.vertexColorFrag)),this._defaultImmediateModeShader},u.default.RendererGL.prototype._getNormalShader=function(){return this._defaultNormalShader||(this._defaultNormalShader=new u.default.Shader(this,c.normalVert,c.normalFrag)),this._defaultNormalShader},u.default.RendererGL.prototype._getColorShader=function(){return this._defaultColorShader||(this._defaultColorShader=new u.default.Shader(this,c.normalVert,c.basicFrag)),this._defaultColorShader},u.default.RendererGL.prototype._getPointShader=function(){return this._defaultPointShader||(this._defaultPointShader=new u.default.Shader(this,c.pointVert,c.pointFrag)),this._defaultPointShader},u.default.RendererGL.prototype._getLineShader=function(){return this._defaultLineShader||(this._defaultLineShader=new u.default.Shader(this,c.lineVert,c.lineFrag)),this._defaultLineShader},u.default.RendererGL.prototype._getFontShader=function(){return this._defaultFontShader||(this.GL.getExtension("OES_standard_derivatives"),this._defaultFontShader=new u.default.Shader(this,c.fontVert,c.fontFrag)),this._defaultFontShader},u.default.RendererGL.prototype._getEmptyTexture=function(){if(!this._emptyTexture){var e=new u.default.Image(1,1);e.set(0,0,255),this._emptyTexture=new u.default.Texture(this,e)}return this._emptyTexture},u.default.RendererGL.prototype.getTexture=function(e){var t=this.textures,r=!0,i=!1,n=void 0;try{for(var o,a=t[Symbol.iterator]();!(r=(o=a.next()).done);r=!0){var s=o.value;if(s.src===e)return s}}catch(e){i=!0,n=e}finally{try{r||null==a.return||a.return()}finally{if(i)throw n}}var l=new u.default.Texture(this,e);return t.push(l),l},u.default.RendererGL.prototype._setStrokeUniforms=function(e){e.bindShader(),e.setUniform("uMaterialColor",this.curStrokeColor),e.setUniform("uStrokeWeight",this.curStrokeWeight)},u.default.RendererGL.prototype._setFillUniforms=function(e){e.bindShader(),e.setUniform("uMaterialColor",this.curFillColor),e.setUniform("isTexture",!!this._tex),this._tex&&e.setUniform("uSampler",this._tex),e.setUniform("uTint",this._tint),e.setUniform("uSpecular",this._useSpecularMaterial),e.setUniform("uEmissive",this._useEmissiveMaterial),e.setUniform("uShininess",this._useShininess),e.setUniform("uUseLighting",this._enableLighting);var t=this.pointLightDiffuseColors.length/3;e.setUniform("uPointLightCount",t),e.setUniform("uPointLightLocation",this.pointLightPositions),e.setUniform("uPointLightDiffuseColors",this.pointLightDiffuseColors),e.setUniform("uPointLightSpecularColors",this.pointLightSpecularColors);var r=this.directionalLightDiffuseColors.length/3;e.setUniform("uDirectionalLightCount",r),e.setUniform("uLightingDirection",this.directionalLightDirections),e.setUniform("uDirectionalDiffuseColors",this.directionalLightDiffuseColors),e.setUniform("uDirectionalSpecularColors",this.directionalLightSpecularColors);var i=this.ambientLightColors.length/3;e.setUniform("uAmbientLightCount",i),e.setUniform("uAmbientColor",this.ambientLightColors);var n=this.spotLightDiffuseColors.length/3;e.setUniform("uSpotLightCount",n),e.setUniform("uSpotLightAngle",this.spotLightAngle),e.setUniform("uSpotLightConc",this.spotLightConc),e.setUniform("uSpotLightDiffuseColors",this.spotLightDiffuseColors),e.setUniform("uSpotLightSpecularColors",this.spotLightSpecularColors),e.setUniform("uSpotLightLocation",this.spotLightPositions),e.setUniform("uSpotLightDirection",this.spotLightDirections),e.setUniform("uConstantAttenuation",this.constantAttenuation),e.setUniform("uLinearAttenuation",this.linearAttenuation),e.setUniform("uQuadraticAttenuation",this.quadraticAttenuation),e.bindTextures()},u.default.RendererGL.prototype._setPointUniforms=function(e){e.bindShader(),e.setUniform("uMaterialColor",this.curStrokeColor),e.setUniform("uPointSize",this.pointSize)},u.default.RendererGL.prototype._bindBuffer=function(e,t,r,i,n){if(t=t||this.GL.ARRAY_BUFFER,this.GL.bindBuffer(t,e),void 0!==r){var o=new(i||Float32Array)(r);this.GL.bufferData(t,o,n||this.GL.STATIC_DRAW)}},u.default.RendererGL.prototype._arraysEqual=function(e,t){var r=e.length;if(r!==t.length)return!1;for(var i=0;i>7,127&f,c>>7,127&c);for(var d=0;d>7,127&p,0,0)}}return{cellImageInfo:l,dimOffset:o,dimImageInfo:n}}return(t=this.glyphInfos[e.index]={glyph:e,uGlyphRect:[i.x1,-i.y1,i.x2,-i.y2],strokeImageInfo:U,strokes:d,colInfo:G(m,this.colDimImageInfos,this.colCellImageInfos),rowInfo:G(p,this.rowDimImageInfos,this.rowCellImageInfos)}).uGridOffset=[t.colInfo.dimOffset,t.rowInfo.dimOffset],t}}var z=Math.sqrt(3);j.default.RendererGL.prototype._renderText=function(e,t,r,i,n){if(this._textFont&&"string"!=typeof this._textFont){if(!(n<=i)&&this._doFill){if(!this._isOpenType())return console.log("WEBGL: only Opentype (.otf) and Truetype (.ttf) fonts are supported"),e;e.push();var o=this._doStroke,a=this.drawMode;this._doStroke=!1,this.drawMode=D.TEXTURE;var s=this._textFont.font,l=this._textFont._fontInfo;l=l||(this._textFont._fontInfo=new A(s));var u=this._textFont._handleAlignment(this,t,r,i),h=this._textSize/s.unitsPerEm;this.translate(u.x,u.y,0),this.scale(h,h,1);var c=this.GL,f=!this._defaultFontShader,d=this._getFontShader();d.init(),d.bindShader(),f&&(d.setUniform("uGridImageSize",[64,64]),d.setUniform("uCellsImageSize",[64,64]),d.setUniform("uStrokeImageSize",[64,64]),d.setUniform("uGridSize",[9,9])),this._applyColorBlend(this.curFillColor);var p=this.retainedMode.geometry.glyph;if(!p){var m=this._textGeom=new j.default.Geometry(1,1,function(){for(var e=0;e<=1;e++)for(var t=0;t<=1;t++)this.vertices.push(new j.default.Vector(t,e,0)),this.uvs.push(t,e)});m.computeFaces().computeNormals(),p=this.createBuffers("glyph",m)}var g=!0,v=!1,y=void 0;try{for(var b,_=this.retainedMode.buffers.text[Symbol.iterator]();!(g=(b=_.next()).done);g=!0){b.value._prepareBuffer(p,d)}}catch(e){v=!0,y=e}finally{try{g||null==_.return||_.return()}finally{if(v)throw y}}this._bindBuffer(p.indexBuffer,c.ELEMENT_ARRAY_BUFFER),d.setUniform("uMaterialColor",this.curFillColor);try{var x=0,w=null,S=s.stringToGlyphs(t),M=!0,E=!1,T=void 0;try{for(var C,P=S[Symbol.iterator]();!(M=(C=P.next()).done);M=!0){var L=C.value;w&&(x+=s.getKerningValue(w,L));var k=l.getGlyphInfo(L);if(k.uGlyphRect){var R=k.rowInfo,O=k.colInfo;d.setUniform("uSamplerStrokes",k.strokeImageInfo.imageData),d.setUniform("uSamplerRowStrokes",R.cellImageInfo.imageData),d.setUniform("uSamplerRows",R.dimImageInfo.imageData),d.setUniform("uSamplerColStrokes",O.cellImageInfo.imageData),d.setUniform("uSamplerCols",O.dimImageInfo.imageData),d.setUniform("uGridOffset",k.uGridOffset),d.setUniform("uGlyphRect",k.uGlyphRect),d.setUniform("uGlyphOffset",x),d.bindTextures(),c.drawElements(c.TRIANGLES,6,this.GL.UNSIGNED_SHORT,0)}x+=L.advanceWidth,w=L}}catch(e){E=!0,T=e}finally{try{M||null==P.return||P.return()}finally{if(E)throw T}}}finally{d.unbindShader(),this._doStroke=o,this.drawMode=a,e.pop()}return e}}else console.log("WEBGL: you must load and set a font before drawing text. See `loadFont` and `textFont` for more details.")}},{"../core/constants":42,"../core/main":49,"./p5.RendererGL.Retained":102,"./p5.Shader":104}],107:[function(e,t,r){t.exports={fes:{autoplay:"The media that tried to play (with '{{src}}') wasn't allowed to by this browser, most likely due to the browser's autoplay policy. Check out {{link}} for more information about why.",fileLoadError:{bytes:"It looks like there was a problem loading your file. {{suggestion}}",font:"It looks like there was a problem loading your font. {{suggestion}}",gif:"There was some trouble loading your GIF. Make sure that your GIF is using 87a or 89a encoding.",image:"It looks like there was a problem loading your image. {{suggestion}}",json:"It looks like there was a problem loading your JSON file. {{suggestion}}",large:"If your large file isn't fetched successfully, we recommend splitting the file into smaller segments and fetching those.",strings:"It looks like there was a problem loading your text file. {{suggestion}}",suggestion:"Try checking if the file path ({{filePath}}) is correct, hosting the file online, or running a local server. (More info at {{link}})",table:"It looks like there was a problem loading your table file. {{suggestion}}",xml:"It looks like there was a problem loading your XML file. {{suggestion}}"},misusedTopLevel:"Did you just try to use p5.js's {{symbolName}} {{symbolType}}? If so, you may want to move it into your sketch's setup() function.\n\nFor more details, see: {{link}}",pre:"🌸 p5.js says: {{message}}",welcome:"Welcome! This is your friendly debugger. To turn me off, switch to using p5.min.js."}}},{}],108:[function(e,t,r){t.exports={fes:{autoplay:"Su browser impidío un medio tocar (de '{{src}}'), posiblemente porque las reglas de autoplay. Para aprender más, visite {{link}}.",fileLoadError:{bytes:"",font:"",gif:"",image:"",json:"",large:"",strings:"",suggestion:"",table:"",xml:""},misusedTopLevel:"",pre:"🌸 p5.js dice: {{message}}",welcome:""}}},{}],109:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i=o(e("./en/translation")),n=o(e("./es/translation"));function o(e){return e&&e.__esModule?e:{default:e}}var a={en:{translation:i.default},es:{translation:n.default}};r.default=a},{"./en/translation":107,"./es/translation":108}]},{},[37])(37)}); ================================================ FILE: docs/examples/pyodide/sketch_001/target/target_sketch.js ================================================ const wrapperContent = ` class PythonFunctions: pass setattr(PythonFunctions, 'map', map) setattr(PythonFunctions, 'filter', filter) setattr(PythonFunctions, 'set', set) _P5_INSTANCE = None _CTX_MIDDLE = None _DEFAULT_FILL = None _DEFAULT_LEADMULT = None _DEFAULT_STROKE = None _DEFAULT_TEXT_FILL = None ADD = None ALT = None ARROW = None AUDIO = None AUTO = None AXES = None BACKSPACE = None BASELINE = None BEVEL = None BEZIER = None BLEND = None BLUR = None BOLD = None BOLDITALIC = None BOTTOM = None BURN = None CENTER = None CHORD = None CLAMP = None CLOSE = None CONTROL = None CORNER = None CORNERS = None CROSS = None CURVE = None DARKEST = None DEG_TO_RAD = None DEGREES = None DELETE = None DIFFERENCE = None DILATE = None DODGE = None DOWN_ARROW = None ENTER = None ERODE = None ESCAPE = None EXCLUSION = None FILL = None GRAY = None GRID = None HALF_PI = None HAND = None HARD_LIGHT = None HSB = None HSL = None IMAGE = None IMMEDIATE = None INVERT = None ITALIC = None LANDSCAPE = None LEFT = None LEFT_ARROW = None LIGHTEST = None LINE_LOOP = None LINE_STRIP = None LINEAR = None LINES = None MIRROR = None MITER = None MOVE = None MULTIPLY = None NEAREST = None NORMAL = None OPAQUE = None OPEN = None OPTION = None OVERLAY = None PI = None PIE = None POINTS = None PORTRAIT = None POSTERIZE = None PROJECT = None QUAD_STRIP = None QUADRATIC = None QUADS = None QUARTER_PI = None RAD_TO_DEG = None RADIANS = None RADIUS = None REPEAT = None REPLACE = None RETURN = None RGB = None RIGHT = None RIGHT_ARROW = None ROUND = None SCREEN = None SHIFT = None SOFT_LIGHT = None SQUARE = None STROKE = None SUBTRACT = None TAB = None TAU = None TEXT = None TEXTURE = None THRESHOLD = None TOP = None TRIANGLE_FAN = None TRIANGLE_STRIP = None TRIANGLES = None TWO_PI = None UP_ARROW = None VIDEO = None WAIT = None WEBGL = None P2D = None PI = None frameCount = None focused = None displayWidth = None displayHeight = None windowWidth = None windowHeight = None width = None height = None deviceOrientation = None accelerationX = None accelerationY = None accelerationZ = None pAccelerationX = None pAccelerationY = None pAccelerationZ = None rotationX = None rotationY = None rotationZ = None pRotationX = None pRotationY = None pRotationZ = None turnAxis = None keyIsPressed = None key = None keyCode = None mouseX = None mouseY = None pmouseX = None pmouseY = None winMouseX = None winMouseY = None pwinMouseX = None pwinMouseY = None mouseButton = None mouseIsPressed = None touches = None pixels = None def alpha(*args): return _P5_INSTANCE.alpha(*args) def blue(*args): return _P5_INSTANCE.blue(*args) def brightness(*args): return _P5_INSTANCE.brightness(*args) def color(*args): return _P5_INSTANCE.color(*args) def green(*args): return _P5_INSTANCE.green(*args) def hue(*args): return _P5_INSTANCE.hue(*args) def lerpColor(*args): return _P5_INSTANCE.lerpColor(*args) def lightness(*args): return _P5_INSTANCE.lightness(*args) def red(*args): return _P5_INSTANCE.red(*args) def saturation(*args): return _P5_INSTANCE.saturation(*args) def background(*args): return _P5_INSTANCE.background(*args) def clear(*args): p5_clear = _P5_INSTANCE.clear(*args) return p5_clear def erase(*args): return _P5_INSTANCE.erase(*args) def noErase(*args): return _P5_INSTANCE.noErase(*args) def colorMode(*args): return _P5_INSTANCE.colorMode(*args) def fill(*args): return _P5_INSTANCE.fill(*args) def noFill(*args): return _P5_INSTANCE.noFill(*args) def noStroke(*args): return _P5_INSTANCE.noStroke(*args) def stroke(*args): return _P5_INSTANCE.stroke(*args) def arc(*args): return _P5_INSTANCE.arc(*args) def ellipse(*args): return _P5_INSTANCE.ellipse(*args) def circle(*args): return _P5_INSTANCE.circle(*args) def line(*args): return _P5_INSTANCE.line(*args) def point(*args): return _P5_INSTANCE.point(*args) def quad(*args): return _P5_INSTANCE.quad(*args) def rect(*args): return _P5_INSTANCE.rect(*args) def square(*args): return _P5_INSTANCE.square(*args) def triangle(*args): return _P5_INSTANCE.triangle(*args) def plane(*args): return _P5_INSTANCE.plane(*args) def box(*args): return _P5_INSTANCE.box(*args) def sphere(*args): return _P5_INSTANCE.sphere(*args) def cylinder(*args): return _P5_INSTANCE.cylinder(*args) def cone(*args): return _P5_INSTANCE.cone(*args) def ellipsoid(*args): return _P5_INSTANCE.ellipsoid(*args) def torus(*args): return _P5_INSTANCE.torus(*args) def loadModel(*args): return _P5_INSTANCE.loadModel(*args) def model(*args): return _P5_INSTANCE.model(*args) def ellipseMode(*args): return _P5_INSTANCE.ellipseMode(*args) def noSmooth(*args): return _P5_INSTANCE.noSmooth(*args) def rectMode(*args): return _P5_INSTANCE.rectMode(*args) def smooth(*args): return _P5_INSTANCE.smooth(*args) def strokeCap(*args): return _P5_INSTANCE.strokeCap(*args) def strokeJoin(*args): return _P5_INSTANCE.strokeJoin(*args) def strokeWeight(*args): return _P5_INSTANCE.strokeWeight(*args) def bezier(*args): return _P5_INSTANCE.bezier(*args) def bezierDetail(*args): return _P5_INSTANCE.bezierDetail(*args) def bezierPoint(*args): return _P5_INSTANCE.bezierPoint(*args) def bezierTangent(*args): return _P5_INSTANCE.bezierTangent(*args) def curve(*args): return _P5_INSTANCE.curve(*args) def curveDetail(*args): return _P5_INSTANCE.curveDetail(*args) def curveTightness(*args): return _P5_INSTANCE.curveTightness(*args) def curvePoint(*args): return _P5_INSTANCE.curvePoint(*args) def curveTangent(*args): return _P5_INSTANCE.curveTangent(*args) def beginContour(*args): return _P5_INSTANCE.beginContour(*args) def beginShape(*args): return _P5_INSTANCE.beginShape(*args) def bezierVertex(*args): return _P5_INSTANCE.bezierVertex(*args) def curveVertex(*args): return _P5_INSTANCE.curveVertex(*args) def endContour(*args): return _P5_INSTANCE.endContour(*args) def endShape(*args): return _P5_INSTANCE.endShape(*args) def quadraticVertex(*args): return _P5_INSTANCE.quadraticVertex(*args) def vertex(*args): return _P5_INSTANCE.vertex(*args) def cursor(*args): return _P5_INSTANCE.cursor(*args) def frameRate(*args): return _P5_INSTANCE.frameRate(*args) def noCursor(*args): return _P5_INSTANCE.noCursor(*args) def fullscreen(*args): return _P5_INSTANCE.fullscreen(*args) def pixelDensity(*args): return _P5_INSTANCE.pixelDensity(*args) def displayDensity(*args): return _P5_INSTANCE.displayDensity(*args) def getURL(*args): return _P5_INSTANCE.getURL(*args) def getURLPath(*args): return _P5_INSTANCE.getURLPath(*args) def getURLParams(*args): return _P5_INSTANCE.getURLParams(*args) def remove(*args): return _P5_INSTANCE.remove(*args) def noLoop(*args): return _P5_INSTANCE.noLoop(*args) def loop(*args): return _P5_INSTANCE.loop(*args) def push(*args): return _P5_INSTANCE.push(*args) def redraw(*args): return _P5_INSTANCE.redraw(*args) def resizeCanvas(*args): return _P5_INSTANCE.resizeCanvas(*args) def noCanvas(*args): return _P5_INSTANCE.noCanvas(*args) def createGraphics(*args): return _P5_INSTANCE.createGraphics(*args) def blendMode(*args): return _P5_INSTANCE.blendMode(*args) def setAttributes(*args): return _P5_INSTANCE.setAttributes(*args) def applyMatrix(*args): return _P5_INSTANCE.applyMatrix(*args) def resetMatrix(*args): return _P5_INSTANCE.resetMatrix(*args) def rotate(*args): return _P5_INSTANCE.rotate(*args) def rotateX(*args): return _P5_INSTANCE.rotateX(*args) def rotateY(*args): return _P5_INSTANCE.rotateY(*args) def rotateZ(*args): return _P5_INSTANCE.rotateZ(*args) def scale(*args): return _P5_INSTANCE.scale(*args) def shearX(*args): return _P5_INSTANCE.shearX(*args) def shearY(*args): return _P5_INSTANCE.shearY(*args) def translate(*args): return _P5_INSTANCE.translate(*args) def createStringDict(*args): return _P5_INSTANCE.createStringDict(*args) def createNumberDict(*args): return _P5_INSTANCE.createNumberDict(*args) def append(*args): return _P5_INSTANCE.append(*args) def arrayCopy(*args): return _P5_INSTANCE.arrayCopy(*args) def concat(*args): return _P5_INSTANCE.concat(*args) def reverse(*args): return _P5_INSTANCE.reverse(*args) def shorten(*args): return _P5_INSTANCE.shorten(*args) def shuffle(*args): return _P5_INSTANCE.shuffle(*args) def sort(*args): return _P5_INSTANCE.sort(*args) def splice(*args): return _P5_INSTANCE.splice(*args) def subset(*args): return _P5_INSTANCE.subset(*args) def float(*args): return _P5_INSTANCE.float(*args) def int(*args): return _P5_INSTANCE.int(*args) def str(*args): return _P5_INSTANCE.str(*args) def boolean(*args): return _P5_INSTANCE.boolean(*args) def byte(*args): return _P5_INSTANCE.byte(*args) def char(*args): return _P5_INSTANCE.char(*args) def unchar(*args): return _P5_INSTANCE.unchar(*args) def hex(*args): return _P5_INSTANCE.hex(*args) def unhex(*args): return _P5_INSTANCE.unhex(*args) def join(*args): return _P5_INSTANCE.join(*args) def match(*args): return _P5_INSTANCE.match(*args) def matchAll(*args): return _P5_INSTANCE.matchAll(*args) def nf(*args): return _P5_INSTANCE.nf(*args) def nfc(*args): return _P5_INSTANCE.nfc(*args) def nfp(*args): return _P5_INSTANCE.nfp(*args) def nfs(*args): return _P5_INSTANCE.nfs(*args) def split(*args): return _P5_INSTANCE.split(*args) def splitTokens(*args): return _P5_INSTANCE.splitTokens(*args) def trim(*args): return _P5_INSTANCE.trim(*args) def setMoveThreshold(*args): return _P5_INSTANCE.setMoveThreshold(*args) def setShakeThreshold(*args): return _P5_INSTANCE.setShakeThreshold(*args) def keyIsDown(*args): return _P5_INSTANCE.keyIsDown(*args) def createImage(*args): return _P5_INSTANCE.createImage(*args) def saveCanvas(*args): return _P5_INSTANCE.saveCanvas(*args) def saveFrames(*args): return _P5_INSTANCE.saveFrames(*args) def loadImage(*args): return _P5_INSTANCE.loadImage(*args) def image(*args): return _P5_INSTANCE.image(*args) def tint(*args): return _P5_INSTANCE.tint(*args) def noTint(*args): return _P5_INSTANCE.noTint(*args) def imageMode(*args): return _P5_INSTANCE.imageMode(*args) def blend(*args): return _P5_INSTANCE.blend(*args) def copy(*args): return _P5_INSTANCE.copy(*args) def filter(*args): if len(args) > 1 and (args[0] is None or callable(args[0])): return PythonFunctions.filter(*args) else: return _P5_INSTANCE.filter(*args) def get(*args): return _P5_INSTANCE.get(*args) def loadPixels(*args): return _P5_INSTANCE.loadPixels(*args) def set(*args): if len(args) <= 1: return PythonFunctions.set(*args) else: return _P5_INSTANCE.set(*args) def updatePixels(*args): return _P5_INSTANCE.updatePixels(*args) def loadJSON(*args): return _P5_INSTANCE.loadJSON(*args) def loadStrings(*args): return _P5_INSTANCE.loadStrings(*args) def loadTable(*args): return _P5_INSTANCE.loadTable(*args) def loadXML(*args): return _P5_INSTANCE.loadXML(*args) def loadBytes(*args): return _P5_INSTANCE.loadBytes(*args) def httpGet(*args): return _P5_INSTANCE.httpGet(*args) def httpPost(*args): return _P5_INSTANCE.httpPost(*args) def httpDo(*args): return _P5_INSTANCE.httpDo(*args) def createWriter(*args): return _P5_INSTANCE.createWriter(*args) def save(*args): return _P5_INSTANCE.save(*args) def saveJSON(*args): return _P5_INSTANCE.saveJSON(*args) def saveStrings(*args): return _P5_INSTANCE.saveStrings(*args) def saveTable(*args): return _P5_INSTANCE.saveTable(*args) def day(*args): return _P5_INSTANCE.day(*args) def hour(*args): return _P5_INSTANCE.hour(*args) def minute(*args): return _P5_INSTANCE.minute(*args) def millis(*args): return _P5_INSTANCE.millis(*args) def month(*args): return _P5_INSTANCE.month(*args) def second(*args): return _P5_INSTANCE.second(*args) def year(*args): return _P5_INSTANCE.year(*args) def createVector(*args): return _P5_INSTANCE.createVector(*args) def abs(*args): return _P5_INSTANCE.abs(*args) def ceil(*args): return _P5_INSTANCE.ceil(*args) def constrain(*args): return _P5_INSTANCE.constrain(*args) def dist(*args): return _P5_INSTANCE.dist(*args) def exp(*args): return _P5_INSTANCE.exp(*args) def floor(*args): return _P5_INSTANCE.floor(*args) def lerp(*args): return _P5_INSTANCE.lerp(*args) def log(*args): return _P5_INSTANCE.log(*args) def mag(*args): return _P5_INSTANCE.mag(*args) def map(*args): if len(args) > 1 and callable(args[0]): return PythonFunctions.map(*args) else: return _P5_INSTANCE.map(*args) def max(*args): return _P5_INSTANCE.max(*args) def min(*args): return _P5_INSTANCE.min(*args) def norm(*args): return _P5_INSTANCE.norm(*args) def pow(*args): return _P5_INSTANCE.pow(*args) def round(*args): return _P5_INSTANCE.round(*args) def sq(*args): return _P5_INSTANCE.sq(*args) def sqrt(*args): return _P5_INSTANCE.sqrt(*args) def noise(*args): return _P5_INSTANCE.noise(*args) def noiseDetail(*args): return _P5_INSTANCE.noiseDetail(*args) def noiseSeed(*args): return _P5_INSTANCE.noiseSeed(*args) def randomSeed(*args): return _P5_INSTANCE.randomSeed(*args) def random(*args): return _P5_INSTANCE.random(*args) def randomGaussian(*args): return _P5_INSTANCE.randomGaussian(*args) def acos(*args): return _P5_INSTANCE.acos(*args) def asin(*args): return _P5_INSTANCE.asin(*args) def atan(*args): return _P5_INSTANCE.atan(*args) def atan2(*args): return _P5_INSTANCE.atan2(*args) def cos(*args): return _P5_INSTANCE.cos(*args) def sin(*args): return _P5_INSTANCE.sin(*args) def tan(*args): return _P5_INSTANCE.tan(*args) def degrees(*args): return _P5_INSTANCE.degrees(*args) def radians(*args): return _P5_INSTANCE.radians(*args) def angleMode(*args): return _P5_INSTANCE.angleMode(*args) def textAlign(*args): return _P5_INSTANCE.textAlign(*args) def textLeading(*args): return _P5_INSTANCE.textLeading(*args) def textSize(*args): return _P5_INSTANCE.textSize(*args) def textStyle(*args): return _P5_INSTANCE.textStyle(*args) def textWidth(*args): return _P5_INSTANCE.textWidth(*args) def textAscent(*args): return _P5_INSTANCE.textAscent(*args) def textDescent(*args): return _P5_INSTANCE.textDescent(*args) def loadFont(*args): return _P5_INSTANCE.loadFont(*args) def text(*args): return _P5_INSTANCE.text(*args) def textFont(*args): return _P5_INSTANCE.textFont(*args) def orbitControl(*args): return _P5_INSTANCE.orbitControl(*args) def debugMode(*args): return _P5_INSTANCE.debugMode(*args) def noDebugMode(*args): return _P5_INSTANCE.noDebugMode(*args) def ambientLight(*args): return _P5_INSTANCE.ambientLight(*args) def directionalLight(*args): return _P5_INSTANCE.directionalLight(*args) def pointLight(*args): return _P5_INSTANCE.pointLight(*args) def lights(*args): return _P5_INSTANCE.lights(*args) def loadShader(*args): return _P5_INSTANCE.loadShader(*args) def createShader(*args): return _P5_INSTANCE.createShader(*args) def shader(*args): return _P5_INSTANCE.shader(*args) def resetShader(*args): return _P5_INSTANCE.resetShader(*args) def normalMaterial(*args): return _P5_INSTANCE.normalMaterial(*args) def texture(*args): return _P5_INSTANCE.texture(*args) def textureMode(*args): return _P5_INSTANCE.textureMode(*args) def textureWrap(*args): return _P5_INSTANCE.textureWrap(*args) def ambientMaterial(*args): return _P5_INSTANCE.ambientMaterial(*args) def specularMaterial(*args): return _P5_INSTANCE.specularMaterial(*args) def shininess(*args): return _P5_INSTANCE.shininess(*args) def camera(*args): return _P5_INSTANCE.camera(*args) def perspective(*args): return _P5_INSTANCE.perspective(*args) def ortho(*args): return _P5_INSTANCE.ortho(*args) def createCamera(*args): return _P5_INSTANCE.createCamera(*args) def setCamera(*args): return _P5_INSTANCE.setCamera(*args) def select(*args): return _P5_INSTANCE.select(*args) def selectAll(*args): return _P5_INSTANCE.selectAll(*args) def removeElements(*args): return _P5_INSTANCE.removeElements(*args) def changed(*args): return _P5_INSTANCE.changed(*args) def input(*args): return _P5_INSTANCE.input(*args) def createDiv(*args): return _P5_INSTANCE.createDiv(*args) def createP(*args): return _P5_INSTANCE.createP(*args) def createSpan(*args): return _P5_INSTANCE.createSpan(*args) def createImg(*args): return _P5_INSTANCE.createImg(*args) def createA(*args): return _P5_INSTANCE.createA(*args) def createSlider(*args): return _P5_INSTANCE.createSlider(*args) def createButton(*args): return _P5_INSTANCE.createButton(*args) def createCheckbox(*args): return _P5_INSTANCE.createCheckbox(*args) def createSelect(*args): return _P5_INSTANCE.createSelect(*args) def createRadio(*args): return _P5_INSTANCE.createRadio(*args) def createColorPicker(*args): return _P5_INSTANCE.createColorPicker(*args) def createInput(*args): return _P5_INSTANCE.createInput(*args) def createFileInput(*args): return _P5_INSTANCE.createFileInput(*args) def createVideo(*args): return _P5_INSTANCE.createVideo(*args) def createAudio(*args): return _P5_INSTANCE.createAudio(*args) def createCapture(*args): return _P5_INSTANCE.createCapture(*args) def createElement(*args): return _P5_INSTANCE.createElement(*args) def createCanvas(*args): canvas = _P5_INSTANCE.createCanvas(*args) global width, height width = _P5_INSTANCE.width height = _P5_INSTANCE.height return canvas def __deviceMoved(e): try: _bind_event_function(deviceMoved, e) except NameError: pass def __deviceTurned(e): try: _bind_event_function(deviceTurned, e) except NameError: pass def __deviceShaken(e): try: _bind_event_function(deviceShaken, e) except NameError: pass def __touchEnded(e): try: _bind_event_function(deviceShaken, e) except NameError: pass def __touchStarted(e): try: _bind_event_function(touchStarted, e) except NameError: pass def __windowResized(e): try: _bind_event_function(windowResized, e) except NameError: pass def __touchMoved(e): try: _bind_event_function(touchMoved, e) except NameError: pass def __mouseMoved(e): try: _bind_event_function(mouseMoved, e) except NameError: pass def __mouseDragged(e): try: _bind_event_function(mouseDragged, e) except NameError: pass def __mousePressed(e): try: _bind_event_function(mousePressed, e) except NameError: pass def __mouseReleased(e): try: _bind_event_function(mouseReleased, e) except NameError: pass def __mouseClicked(e): try: _bind_event_function(mouseClicked, e) except NameError: pass def __doubleClicked(e): try: _bind_event_function(doubleClicked, e) except NameError: pass def __mouseWheel(e): try: _bind_event_function(mouseWheel, e) except NameError: pass def __keyPressed(e): try: _bind_event_function(keyPressed, e) except NameError: pass def __keyReleased(e): try: _bind_event_function(keyReleased, e) except NameError: pass def __keyTyped(e): try: _bind_event_function(keyTyped, e) except NameError: pass def __keyIsDown(e): try: _bind_event_function(keyIsDown, e) except NameError: pass def pop(*args): p5_pop = _P5_INSTANCE.pop(*args) return p5_pop # Processing Python or Java mode compatibility aliases size = createCanvas popMatrix = pop popStyle = pop pushMatrix = push pushStyle = push # PVector is a wrapper/helper class for p5.Vector objets # providing names similar to Processing Python or Java modes # but mostly keeping p5js functionality from numbers import Number class PVector: def __init__(self, x=0, y=0, z=0): self.__vector = createVector(x, y, z) self.add = self.__instance_add__ self.sub = self.__instance_sub__ self.mult = self.__instance_mult__ self.div = self.__instance_div__ self.cross = self.__instance_cross__ self.dist = self.__instance_dist__ self.dot = self.__instance_dot__ self.lerp = self.__instance_lerp__ @property def x(self): return self.__vector.x @x.setter def x(self, x): self.__vector.x = x @property def y(self): return self.__vector.y @y.setter def y(self, y): self.__vector.y = y @property def z(self): return self.__vector.z @z.setter def z(self, z): self.__vector.z = z def mag(self): return self.__vector.mag() def magSq(self): return self.__vector.magSq() def setMag(self, mag): self.__vector.setMag(mag) return self def normalize(self): self.__vector.normalize() return self def limit(self, max): self.__vector.limit(max) return self def heading(self): return self.__vector.heading() def rotate(self, angle): self.__vector.rotate(angle) return self def __instance_add__(self, *args): if len(args) == 1: return PVector.add(self, args[0], self) else: return PVector.add(self, PVector(*args), self) def __instance_sub__(self, *args): if len(args) == 1: return PVector.sub(self, args[0], self) else: return PVector.sub(self, PVector(*args), self) def __instance_mult__(self, o): return PVector.mult(self, o, self) def __instance_div__(self, f): return PVector.div(self, f, self) def __instance_cross__(self, o): return PVector.cross(self, o, self) def __instance_dist__(self, o): return PVector.dist(self, o) def __instance_dot__(self, *args): if len(args) == 1: v = args[0] else: v = args return self.x * v[0] + self.y * v[1] + self.z * v[2] def __instance_lerp__(self, *args): if len(args) == 2: return PVector.lerp(self, args[0], args[1], self) else: vx, vy, vz, f = args return PVector.lerp(self, PVector(vx, vy, vz), f, self) def get(self): return PVector(self.x, self.y, self.z) def copy(self): return PVector(self.x, self.y, self.z) def __getitem__(self, k): return getattr(self, ('x', 'y', 'z')[k]) def __setitem__(self, k, v): setattr(self, ('x', 'y', 'z')[k], v) def __copy__(self): return PVector(self.x, self.y, self.z) def __deepcopy__(self, memo): return PVector(self.x, self.y, self.z) def __repr__(self): # PROVISÓRIO return f'PVector({self.x}, {self.y}, {self.z})' def set(self, *args): """ Sets the x, y, and z component of the vector using two or three separate variables, the data from a p5.Vector, or the values from a float array. """ self.__vector.set(*args) @classmethod def add(cls, a, b, dest=None): if dest is None: return PVector(a.x + b[0], a.y + b[1], a.z + b[2]) dest.__vector.set(a.x + b[0], a.y + b[1], a.z + b[2]) return dest @classmethod def sub(cls, a, b, dest=None): if dest is None: return PVector(a.x - b[0], a.y - b[1], a.z - b[2]) dest.__vector.set(a.x - b[0], a.y - b[1], a.z - b[2]) return dest @classmethod def mult(cls, a, b, dest=None): if dest is None: return PVector(a.x * b, a.y * b, a.z * b) dest.__vector.set(a.x * b, a.y * b, a.z * b) return dest @classmethod def div(cls, a, b, dest=None): if dest is None: return PVector(a.x / b, a.y / b, a.z / b) dest.__vector.set(a.x / b, a.y / b, a.z / b) return dest @classmethod def dist(cls, a, b): return a.__vector.dist(b.__vector) @classmethod def dot(cls, a, b): return a.__vector.dot(b.__vector) def __add__(a, b): return PVector.add(a, b, None) def __sub__(a, b): return PVector.sub(a, b, None) def __isub__(a, b): a.sub(b) return a def __iadd__(a, b): a.add(b) return a def __mul__(a, b): if not isinstance(b, Number): raise TypeError( "The * operator can only be used to multiply a PVector by a number") return PVector.mult(a, float(b), None) def __rmul__(a, b): if not isinstance(b, Number): raise TypeError( "The * operator can only be used to multiply a PVector by a number") return PVector.mult(a, float(b), None) def __imul__(a, b): if not isinstance(b, Number): raise TypeError( "The *= operator can only be used to multiply a PVector by a number") a.__vector.mult(float(b)) return a def __truediv__(a, b): if not isinstance(b, Number): raise TypeError( "The * operator can only be used to multiply a PVector by a number") return PVector(a.x / float(b), a.y / float(b), a.z / float(b)) def __itruediv__(a, b): if not isinstance(b, Number): raise TypeError( "The /= operator can only be used to multiply a PVector by a number") a.__vector.set(a.x / float(b), a.y / float(b), a.z / float(b)) return a def __eq__(a, b): return a.x == b[0] and a.y == b[1] and a.z == b[2] def __lt__(a, b): return a.magSq() < b.magSq() def __le__(a, b): return a.magSq() <= b.magSq() def __gt__(a, b): return a.magSq() > b.magSq() def __ge__(a, b): return a.magSq() >= b.magSq() # Problematic class methods, we would rather use p5.Vector when possible... @classmethod def lerp(cls, a, b, f, dest=None): v = createVector(a.x, a.y, a.z) v.lerp(b.__vector, f) if dest is None: return PVector(v.x, v.y, v.z) dest.set(v.x, v.y, v.z) return dest @classmethod def cross(cls, a, b, dest=None): x = a.y * b[2] - b[1] * a.z y = a.z * b[0] - b[2] * a.x z = a.x * b[1] - b[0] * a.y if dest is None: return PVector(x, y, z) dest.set(x, y, z) return dest @classmethod def fromAngle(cls, angle, length=1): # https://github.com/processing/p5.js/blob/3f0b2f0fe575dc81c724474154f5b23a517b7233/src/math/p5.Vector.js return PVector(length * cos(angle), length * sin(angle), 0) @classmethod def fromAngles(theta, phi, length=1): # https://github.com/processing/p5.js/blob/3f0b2f0fe575dc81c724474154f5b23a517b7233/src/math/p5.Vector.js cosPhi = cos(phi) sinPhi = sin(phi) cosTheta = cos(theta) sinTheta = sin(theta) return PVector(length * sinTheta * sinPhi, -length * cosTheta, length * sinTheta * cosPhi) @classmethod def random2D(cls): return PVector.fromAngle(random(TWO_PI)) @classmethod def random3D(cls, dest=None): angle = random(TWO_PI) vz = random(2) - 1 mult = sqrt(1 - vz * vz) vx = mult * cos(angle) vy = mult * sin(angle) if dest is None: return PVector(vx, vy, vz) dest.set(vx, vy, vz) return dest @classmethod def angleBetween(cls, a, b): return acos(a.dot(b) / sqrt(a.magSq() * b.magSq())) # Other harmless p5js methods def equals(self, v): return self == v def heading2D(self): return self.__vector.heading() def reflect(self, *args): # Reflect the incoming vector about a normal to a line in 2D, or about # a normal to a plane in 3D This method acts on the vector directly r = self.__vector.reflect(*args) return r def array(self): # Return a representation of this vector as a float array. This is only # for temporary use. If used in any w fashion, the contents should be # copied by using the p5.Vector.copy() method to copy into your own # array. return self.__vector.array() def toString(self): # Returns a string representation of a vector v by calling String(v) or v.toString(). # return self.__vector.toString() would be something like "p5.vector # Object […, …, …]" return str(self) def rem(self, *args): # Gives remainder of a vector when it is divided by anw vector. See # examples for more context. self.__vector.rem(*args) return self def pre_draw(p5_instance, draw_func, *args, **kwargs): """ We need to run this before the actual draw to insert and update p5 env variables """ global _CTX_MIDDLE, _DEFAULT_FILL, _DEFAULT_LEADMULT, _DEFAULT_STROKE, _DEFAULT_TEXT_FILL global ADD, ALT, ARROW, AUTO, AUDIO, AXES, BACKSPACE, BASELINE, BEVEL, BEZIER, BLEND, BLUR, BOLD, BOLDITALIC global BOTTOM, BURN, CENTER, CHORD, CLAMP, CLOSE, CONTROL, CORNER, CORNERS, CROSS, CURVE, DARKEST global DEG_TO_RAD, DEGREES, DELETE, DIFFERENCE, DILATE, DODGE, DOWN_ARROW, ENTER, ERODE, ESCAPE, EXCLUSION global FILL, GRAY, GRID, HALF_PI, HAND, HARD_LIGHT, HSB, HSL, IMAGE, IMMEDIATE, INVERT, ITALIC, LANDSCAPE global LEFT, LEFT_ARROW, LIGHTEST, LINE_LOOP, LINE_STRIP, LINEAR, LINES, MIRROR, MITER, MOVE, MULTIPLY, NEAREST global NORMAL, OPAQUE, OPEN, OPTION, OVERLAY, P2D, P3D, PI, PIE, POINTS, PORTRAIT, POSTERIZE, PROJECT, QUAD_STRIP global QUADRATIC, QUADS, QUARTER_PI, RAD_TO_DEG, RADIANS, RADIUS, REPEAT, REPLACE, RETURN, RGB, RIGHT, RIGHT_ARROW global ROUND, SCREEN, SHIFT, SOFT_LIGHT, SQUARE, STROKE, SUBTRACT, TAB, TAU, TEXT, TEXTURE, THRESHOLD, TOP global TRIANGLE_FAN, TRIANGLE_STRIP, TRIANGLES, TWO_PI, UP_ARROW, VIDEO, WAIT, WEBGL global frameCount, focused, displayWidth, displayHeight, windowWidth, windowHeight, width, height global deviceOrientation, accelerationX, accelerationY, accelerationZ global pAccelerationX, pAccelerationY, pAccelerationZ, rotationX, rotationY, rotationZ global pRotationX, pRotationY, pRotationZ, turnAxis, keyIsPressed, key, keyCode, mouseX, mouseY, pmouseX, pmouseY global winMouseX, winMouseY, pwinMouseX, pwinMouseY, mouseButton, mouseIsPressed, touches, pixels _CTX_MIDDLE = p5_instance._CTX_MIDDLE _DEFAULT_FILL = p5_instance._DEFAULT_FILL _DEFAULT_LEADMULT = p5_instance._DEFAULT_LEADMULT _DEFAULT_STROKE = p5_instance._DEFAULT_STROKE _DEFAULT_TEXT_FILL = p5_instance._DEFAULT_TEXT_FILL ADD = p5_instance.ADD ALT = p5_instance.ALT ARROW = p5_instance.ARROW AUDIO = p5_instance.AUDIO AUTO = p5_instance.AUTO AXES = p5_instance.AXES BACKSPACE = p5_instance.BACKSPACE BASELINE = p5_instance.BASELINE BEVEL = p5_instance.BEVEL BEZIER = p5_instance.BEZIER BLEND = p5_instance.BLEND BLUR = p5_instance.BLUR BOLD = p5_instance.BOLD BOLDITALIC = p5_instance.BOLDITALIC BOTTOM = p5_instance.BOTTOM BURN = p5_instance.BURN CENTER = p5_instance.CENTER CHORD = p5_instance.CHORD CLAMP = p5_instance.CLAMP CLOSE = p5_instance.CLOSE CONTROL = p5_instance.CONTROL CORNER = p5_instance.CORNER CORNERS = p5_instance.CORNERS CROSS = p5_instance.CROSS CURVE = p5_instance.CURVE DARKEST = p5_instance.DARKEST DEG_TO_RAD = p5_instance.DEG_TO_RAD DEGREES = p5_instance.DEGREES DELETE = p5_instance.DELETE DIFFERENCE = p5_instance.DIFFERENCE DILATE = p5_instance.DILATE DODGE = p5_instance.DODGE DOWN_ARROW = p5_instance.DOWN_ARROW ENTER = p5_instance.ENTER ERODE = p5_instance.ERODE ESCAPE = p5_instance.ESCAPE EXCLUSION = p5_instance.EXCLUSION FILL = p5_instance.FILL GRAY = p5_instance.GRAY GRID = p5_instance.GRID HALF_PI = p5_instance.HALF_PI HAND = p5_instance.HAND HARD_LIGHT = p5_instance.HARD_LIGHT HSB = p5_instance.HSB HSL = p5_instance.HSL IMAGE = p5_instance.IMAGE IMMEDIATE = p5_instance.IMMEDIATE INVERT = p5_instance.INVERT ITALIC = p5_instance.ITALIC LANDSCAPE = p5_instance.LANDSCAPE LEFT = p5_instance.LEFT LEFT_ARROW = p5_instance.LEFT_ARROW LIGHTEST = p5_instance.LIGHTEST LINE_LOOP = p5_instance.LINE_LOOP LINE_STRIP = p5_instance.LINE_STRIP LINEAR = p5_instance.LINEAR LINES = p5_instance.LINES MIRROR = p5_instance.MIRROR MITER = p5_instance.MITER MOVE = p5_instance.MOVE MULTIPLY = p5_instance.MULTIPLY NEAREST = p5_instance.NEAREST NORMAL = p5_instance.NORMAL OPAQUE = p5_instance.OPAQUE OPEN = p5_instance.OPEN OPTION = p5_instance.OPTION OVERLAY = p5_instance.OVERLAY P2D = p5_instance.P2D P3D = p5_instance.WEBGL PI = p5_instance.PI PIE = p5_instance.PIE POINTS = p5_instance.POINTS PORTRAIT = p5_instance.PORTRAIT POSTERIZE = p5_instance.POSTERIZE PROJECT = p5_instance.PROJECT QUAD_STRIP = p5_instance.QUAD_STRIP QUADRATIC = p5_instance.QUADRATIC QUADS = p5_instance.QUADS QUARTER_PI = p5_instance.QUARTER_PI RAD_TO_DEG = p5_instance.RAD_TO_DEG RADIANS = p5_instance.RADIANS RADIUS = p5_instance.RADIUS REPEAT = p5_instance.REPEAT REPLACE = p5_instance.REPLACE RETURN = p5_instance.RETURN RGB = p5_instance.RGB RIGHT = p5_instance.RIGHT RIGHT_ARROW = p5_instance.RIGHT_ARROW ROUND = p5_instance.ROUND SCREEN = p5_instance.SCREEN SHIFT = p5_instance.SHIFT SOFT_LIGHT = p5_instance.SOFT_LIGHT SQUARE = p5_instance.SQUARE STROKE = p5_instance.STROKE SUBTRACT = p5_instance.SUBTRACT TAB = p5_instance.TAB TAU = p5_instance.TAU TEXT = p5_instance.TEXT TEXTURE = p5_instance.TEXTURE THRESHOLD = p5_instance.THRESHOLD TOP = p5_instance.TOP TRIANGLE_FAN = p5_instance.TRIANGLE_FAN TRIANGLE_STRIP = p5_instance.TRIANGLE_STRIP TRIANGLES = p5_instance.TRIANGLES TWO_PI = p5_instance.TWO_PI UP_ARROW = p5_instance.UP_ARROW VIDEO = p5_instance.VIDEO WAIT = p5_instance.WAIT WEBGL = p5_instance.WEBGL frameCount = p5_instance.frameCount focused = p5_instance.focused displayWidth = p5_instance.displayWidth displayHeight = p5_instance.displayHeight windowWidth = p5_instance.windowWidth windowHeight = p5_instance.windowHeight width = p5_instance.width height = p5_instance.height deviceOrientation = p5_instance.deviceOrientation accelerationX = p5_instance.accelerationX accelerationY = p5_instance.accelerationY accelerationZ = p5_instance.accelerationZ pAccelerationX = p5_instance.pAccelerationX pAccelerationY = p5_instance.pAccelerationY pAccelerationZ = p5_instance.pAccelerationZ rotationX = p5_instance.rotationX rotationY = p5_instance.rotationY rotationZ = p5_instance.rotationZ pRotationX = p5_instance.pRotationX pRotationY = p5_instance.pRotationY pRotationZ = p5_instance.pRotationZ turnAxis = p5_instance.turnAxis keyIsPressed = p5_instance.keyIsPressed key = p5_instance.key keyCode = p5_instance.keyCode mouseX = p5_instance.mouseX mouseY = p5_instance.mouseY pmouseX = p5_instance.pmouseX pmouseY = p5_instance.pmouseY winMouseX = p5_instance.winMouseX winMouseY = p5_instance.winMouseY pwinMouseX = p5_instance.pwinMouseX pwinMouseY = p5_instance.pwinMouseY mouseButton = p5_instance.mouseButton mouseIsPressed = p5_instance.mouseIsPressed touches = p5_instance.touches pixels = p5_instance.pixels return draw_func(*args, **kwargs) def global_p5_injection(p5_sketch): """ Injects the p5js's skecth instance as a global variable to setup and draw functions """ def decorator(f, *args, **kwargs): def wrapper(*args, **kwargs): global _P5_INSTANCE _P5_INSTANCE = p5_sketch return pre_draw(_P5_INSTANCE, f, *args, **kwargs) return wrapper return decorator def start_p5(preload_func, setup_func, draw_func, event_functions): """ This is the entrypoint function. It accepts 2 parameters: - preload_func: A Python preload callable - setup_func: a Python setup callable - draw_func: a Python draw callable - event_functions: a config dict for the event functions in the format: {"eventFunctionName": python_event_function} This method gets the p5js's sketch instance and injects them """ def sketch_setup(p5_sketch): """ Callback function called to configure new p5 instance """ p5_sketch.preload = global_p5_injection(p5_sketch)(preload_func) p5_sketch.setup = global_p5_injection(p5_sketch)(setup_func) p5_sketch.draw = global_p5_injection(p5_sketch)(draw_func) window.instance = p5.new(sketch_setup, 'sketch-holder') # Register event functions event_function_names = ( "deviceMoved", "deviceTurned", "deviceShaken", "windowResized", "keyPressed", "keyReleased", "keyTyped", "mousePressed", "mouseReleased", "mouseClicked", "doubleClicked", "mouseMoved", "mouseDragged", "mouseWheel", "touchStarted", "touchMoved", "touchEnded", "keyIsDown", ) for f_name in [f for f in event_function_names if event_functions.get(f, None)]: func = event_functions[f_name] event_func = global_p5_injection(window.instance)(func) setattr(window.instance, f_name, event_func) `; const placeholder = ` def preload(): pass def setup(): pass def draw(): pass deviceMoved = None deviceTurned = None deviceShaken = None keyPressed = None keyReleased = None keyTyped = None mouseMoved = None mouseDragged = None mousePressed = None mouseReleased = None mouseClicked = None doubleClicked = None mouseWheel = None touchStarted = None touchMoved = None touchEnded = None windowResized = None `; let userCode = ` # https://p5js.org/examples/interaction-wavemaker.html t = 0 def setup(): createCanvas(600, 600) stroke(250) strokeWeight(3) fill(40, 200, 40) def draw(): global t background(10, 10) xAngle = map(mouseX, 0, width, -4 * PI, 4 * PI, True) yAngle = map(mouseY, 0, height, -4 * PI, 4 * PI, True) for x in range(0, width, 30): for y in range(0, height, 30): angle = xAngle * (x / width) + yAngle * (y / height) myX = x + 20 * cos(2 * PI * t + angle) myY = y + 20 * sin(2 * TWO_PI * t + angle) ellipse(myX, myY, 10) t = t + 0.01 `; const startCode = ` event_functions = { "deviceMoved": deviceMoved, "deviceTurned": deviceTurned, "deviceShaken": deviceShaken, "keyPressed": keyPressed, "keyReleased": keyReleased, "keyTyped": keyTyped, "mouseMoved": mouseMoved, "mouseDragged": mouseDragged, "mousePressed": mousePressed, "mouseReleased": mouseReleased, "mouseClicked": mouseClicked, "doubleClicked": doubleClicked, "mouseWheel": mouseWheel, "touchStarted": touchStarted, "touchMoved": touchMoved, "touchEnded": touchEnded, "windowResized": windowResized, } start_p5(preload, setup, draw, event_functions) `; function runCode() { let code = [ placeholder, userCode, wrapperContent, startCode, ].join('\n'); if (window.instance) { window.instance.canvas.remove(); } console.log("Python execution output:"); window.pyodide.runPython(code); } async function main() { const config = { indexURL : "https://cdn.jsdelivr.net/pyodide/v0.18.1/full/", fullStdLib: false, } window.pyodide = await loadPyodide(config); // Pyodide is now ready to use... console.log(window.pyodide.runPython(` import io, code, sys from js import p5, window, document print(sys.version) `)); window.runSketchCode = (code) => { userCode = code; runCode(); } runCode(); }; // async method main(); ================================================ FILE: docs/examples/pyodide/sketch_002/index.html ================================================ sketch_002 - pyp5js

Python code here.

"""
 * Move Eye.
 * by Simon Greenwold.
 *
 * The camera lifts up (controlled by mouseY) while looking at the same point.
 """

def setup():
    createCanvas(640, 360, WEBGL)
    fill(204)


def draw():
    ambientLight(50)
    directionalLight(255, 0, 0, 0.25, 0.25, 0);
    background(0)

    # Change height of the camera with mouseY
    camera(30.0, mouseY, 220.0,  # eyeX, eyeY, eyeZ
           0.0, 0.0, 0.0,        # centerX, centerY, centerZ
           0.0, 1.0, 0.0)        # upX, upY, upZ

    noStroke()
    box(90)
    stroke(255)
    line(-100, 0, 0, 100, 0, 0)
    line(0, -100, 0, 0, 100, 0)
    line(0, 0, -100, 0, 0, 100)
================================================ FILE: docs/examples/pyodide/sketch_002/sketch_002.py ================================================ """ * Move Eye. * by Simon Greenwold. * * The camera lifts up (controlled by mouseY) while looking at the same point. """ def setup(): createCanvas(640, 360, WEBGL) fill(204) def draw(): ambientLight(50) directionalLight(255, 0, 0, 0.25, 0.25, 0); background(0) # Change height of the camera with mouseY camera(30.0, mouseY, 220.0, # eyeX, eyeY, eyeZ 0.0, 0.0, 0.0, # centerX, centerY, centerZ 0.0, 1.0, 0.0) # upX, upY, upZ noStroke() box(90) stroke(255) line(-100, 0, 0, 100, 0, 0) line(0, -100, 0, 0, 100, 0) line(0, 0, -100, 0, 0, 100) ================================================ FILE: docs/examples/pyodide/sketch_002/static/p5.js ================================================ /*! p5.js v1.0.0 February 29, 2020 */ !function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).p5=e()}}(function(){return function o(a,s,l){function u(t,e){if(!s[t]){if(!a[t]){var r="function"==typeof require&&require;if(!e&&r)return r(t,!0);if(h)return h(t,!0);var i=new Error("Cannot find module '"+t+"'");throw i.code="MODULE_NOT_FOUND",i}var n=s[t]={exports:{}};a[t][0].call(n.exports,function(e){return u(a[t][1][e]||e)},n,n.exports,o,a,s,l)}return s[t].exports}for(var h="function"==typeof require&&require,e=0;e>16&255,a[s++]=t>>8&255,a[s++]=255&t;2===o&&(t=u[e.charCodeAt(r)]<<2|u[e.charCodeAt(r+1)]>>4,a[s++]=255&t);1===o&&(t=u[e.charCodeAt(r)]<<10|u[e.charCodeAt(r+1)]<<4|u[e.charCodeAt(r+2)]>>2,a[s++]=t>>8&255,a[s++]=255&t);return a},r.fromByteArray=function(e){for(var t,r=e.length,i=r%3,n=[],o=0,a=r-i;o>2]+s[t<<4&63]+"==")):2==i&&(t=(e[r-2]<<8)+e[r-1],n.push(s[t>>10]+s[t>>4&63]+s[t<<2&63]+"="));return n.join("")};for(var s=[],u=[],h="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=0,o=i.length;n>18&63]+s[n>>12&63]+s[n>>6&63]+s[63&n]);return o.join("")}u["-".charCodeAt(0)]=62,u["_".charCodeAt(0)]=63},{}],20:[function(e,t,r){},{}],21:[function(N,e,F){(function(c){"use strict";var i=N("base64-js"),o=N("ieee754"),e="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;F.Buffer=c,F.SlowBuffer=function(e){+e!=e&&(e=0);return c.alloc(+e)},F.INSPECT_MAX_BYTES=50;var r=2147483647;function a(e){if(r>>1;case"base64":return O(e).length;default:if(n)return i?-1:R(e).length;t=(""+t).toLowerCase(),n=!0}}function d(e,t,r){var i=e[t];e[t]=e[r],e[r]=i}function p(e,t,r,i,n){if(0===e.length)return-1;if("string"==typeof r?(i=r,r=0):2147483647=e.length){if(n)return-1;r=e.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof t&&(t=c.from(t,i)),c.isBuffer(t))return 0===t.length?-1:m(e,t,r,i,n);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):m(e,[t],r,i,n);throw new TypeError("val must be string, number or Buffer")}function m(e,t,r,i,n){var o,a=1,s=e.length,l=t.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(e.length<2||t.length<2)return-1;s/=a=2,l/=2,r/=2}function u(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(n){var h=-1;for(o=r;o>8,n=r%256,o.push(n),o.push(i);return o}(t,e.length-r),e,r,i)}function b(e,t,r){return 0===t&&r===e.length?i.fromByteArray(e):i.fromByteArray(e.slice(t,r))}function _(e,t,r){r=Math.min(e.length,r);for(var i=[],n=t;n>>10&1023|55296),h=56320|1023&h),i.push(h),n+=c}return function(e){var t=e.length;if(t<=x)return String.fromCharCode.apply(String,e);var r="",i=0;for(;ithis.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e=e||"utf8";;)switch(e){case"hex":return M(this,t,r);case"utf8":case"utf-8":return _(this,t,r);case"ascii":return w(this,t,r);case"latin1":case"binary":return S(this,t,r);case"base64":return b(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,t,r);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}.apply(this,arguments)},c.prototype.equals=function(e){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===c.compare(this,e)},c.prototype.inspect=function(){var e="",t=F.INSPECT_MAX_BYTES;return e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(e+=" ... "),""},e&&(c.prototype[e]=c.prototype.inspect),c.prototype.compare=function(e,t,r,i,n){if(A(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),t<0||r>e.length||i<0||n>this.length)throw new RangeError("out of range index");if(n<=i&&r<=t)return 0;if(n<=i)return-1;if(r<=t)return 1;if(this===e)return 0;for(var o=(n>>>=0)-(i>>>=0),a=(r>>>=0)-(t>>>=0),s=Math.min(o,a),l=this.slice(i,n),u=e.slice(t,r),h=0;h>>=0,isFinite(r)?(r>>>=0,void 0===i&&(i="utf8")):(i=r,r=void 0)}var n=this.length-t;if((void 0===r||nthis.length)throw new RangeError("Attempt to write outside buffer bounds");i=i||"utf8";for(var o,a,s,l,u,h,c=!1;;)switch(i){case"hex":return g(this,e,t,r);case"utf8":case"utf-8":return u=t,h=r,D(R(e,(l=this).length-u),l,u,h);case"ascii":return v(this,e,t,r);case"latin1":case"binary":return v(this,e,t,r);case"base64":return o=this,a=t,s=r,D(O(e),o,a,s);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return y(this,e,t,r);default:if(c)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),c=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var x=4096;function w(e,t,r){var i="";r=Math.min(e.length,r);for(var n=t;ne.length)throw new RangeError("Index out of range")}function P(e,t,r,i){if(r+i>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function L(e,t,r,i,n){return t=+t,r>>>=0,n||P(e,0,r,4),o.write(e,t,r,i,23,4),r+4}function k(e,t,r,i,n){return t=+t,r>>>=0,n||P(e,0,r,8),o.write(e,t,r,i,52,8),r+8}c.prototype.slice=function(e,t){var r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):r>>=0,t>>>=0,r||T(e,t,this.length);for(var i=this[e],n=1,o=0;++o>>=0,t>>>=0,r||T(e,t,this.length);for(var i=this[e+--t],n=1;0>>=0,t||T(e,1,this.length),this[e]},c.prototype.readUInt16LE=function(e,t){return e>>>=0,t||T(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUInt16BE=function(e,t){return e>>>=0,t||T(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUInt32LE=function(e,t){return e>>>=0,t||T(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUInt32BE=function(e,t){return e>>>=0,t||T(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||T(e,t,this.length);for(var i=this[e],n=1,o=0;++o>>=0,t>>>=0,r||T(e,t,this.length);for(var i=t,n=1,o=this[e+--i];0>>=0,t||T(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){e>>>=0,t||T(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(e,t){e>>>=0,t||T(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(e,t){return e>>>=0,t||T(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return e>>>=0,t||T(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readFloatLE=function(e,t){return e>>>=0,t||T(e,4,this.length),o.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return e>>>=0,t||T(e,4,this.length),o.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return e>>>=0,t||T(e,8,this.length),o.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return e>>>=0,t||T(e,8,this.length),o.read(this,e,!1,52,8)},c.prototype.writeUIntLE=function(e,t,r,i){e=+e,t>>>=0,r>>>=0,i||C(this,e,t,r,Math.pow(2,8*r)-1,0);var n=1,o=0;for(this[t]=255&e;++o>>=0,r>>>=0,i||C(this,e,t,r,Math.pow(2,8*r)-1,0);var n=r-1,o=1;for(this[t+n]=255&e;0<=--n&&(o*=256);)this[t+n]=e/o&255;return t+r},c.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,1,255,0),this[t]=255&e,t+1},c.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},c.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeIntLE=function(e,t,r,i){if(e=+e,t>>>=0,!i){var n=Math.pow(2,8*r-1);C(this,e,t,r,n-1,-n)}var o=0,a=1,s=0;for(this[t]=255&e;++o>0)-s&255;return t+r},c.prototype.writeIntBE=function(e,t,r,i){if(e=+e,t>>>=0,!i){var n=Math.pow(2,8*r-1);C(this,e,t,r,n-1,-n)}var o=r-1,a=1,s=0;for(this[t+o]=255&e;0<=--o&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+r},c.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},c.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeFloatLE=function(e,t,r){return L(this,e,t,!0,r)},c.prototype.writeFloatBE=function(e,t,r){return L(this,e,t,!1,r)},c.prototype.writeDoubleLE=function(e,t,r){return k(this,e,t,!0,r)},c.prototype.writeDoubleBE=function(e,t,r){return k(this,e,t,!1,r)},c.prototype.copy=function(e,t,r,i){if(!c.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r=r||0,i||0===i||(i=this.length),t>=e.length&&(t=e.length),t=t||0,0=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t>>=0,r=void 0===r?this.length:r>>>0,"number"==typeof(e=e||0))for(o=t;o>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function O(e){return i.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(t,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function D(e,t,r,i){for(var n=0;n=t.length||n>=e.length);++n)t[n+r]=e[n];return n}function A(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function I(e){return e!=e}var U=function(){for(var e="0123456789abcdef",t=new Array(256),r=0;r<16;++r)for(var i=16*r,n=0;n<16;++n)t[i+n]=e[r]+e[n];return t}()}).call(this,N("buffer").Buffer)},{"base64-js":19,buffer:21,ieee754:30}],22:[function(e,t,r){"use strict";t.exports=e("./").polyfill()},{"./":23}],23:[function(z,r,i){(function(j,V){var e,t;e=this,t=function(){"use strict";function l(e){return"function"==typeof e}var r=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},i=0,t=void 0,n=void 0,a=function(e,t){f[i]=e,f[i+1]=t,2===(i+=2)&&(n?n(d):y())};var e="undefined"!=typeof window?window:void 0,o=e||{},s=o.MutationObserver||o.WebKitMutationObserver,u="undefined"==typeof self&&void 0!==j&&"[object process]"==={}.toString.call(j),h="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function c(){var e=setTimeout;return function(){return e(d,1)}}var f=new Array(1e3);function d(){for(var e=0;e":">",'"':""","'":"'","/":"/"};function S(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,function(e){return w[e]}):e}var M=function(){function i(e){var t,r=1=this.maxReplaces)break}for(a=0;r=this.regexp.exec(e);){if(void 0===(i=h(r[1].trim())))if("function"==typeof c){var d=c(e,r,t);i="string"==typeof d?d:""}else this.logger.warn("missed to pass in variable ".concat(r[1]," for interpolating ").concat(e)),i="";else"string"==typeof i||this.useRawValueToEscape||(i=v(i));if(i=this.escapeValue?u(this.escape(i)):u(i),e=e.replace(r[0],i),this.regexp.lastIndex=0,++a>=this.maxReplaces)break}return e}},{key:"nest",value:function(e,t,r){var i,n,o=D({},2>1,h=-7,c=r?n-1:0,f=r?-1:1,d=e[t+c];for(c+=f,o=d&(1<<-h)-1,d>>=-h,h+=s;0>=-h,h+=i;0>1,f=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,d=i?0:o-1,p=i?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=h):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),2<=(t+=1<=a+c?f/l:f*Math.pow(2,1-c))*l&&(a++,l/=2),h<=a+c?(s=0,a=h):1<=a+c?(s=(t*l-1)*Math.pow(2,n),a+=c):(s=t*Math.pow(2,c-1)*Math.pow(2,n),a=0));8<=n;e[r+d]=255&s,d+=p,s/=256,n-=8);for(a=a<Math.abs(e[0])&&(t=1),Math.abs(e[2])>Math.abs(e[t])&&(t=2),t}var C=4e150;function P(e,t){e.f+=t.f,e.b.f+=t.b.f}function u(e,t,r){return e=e.a,t=t.a,r=r.a,t.b.a===e?r.b.a===e?v(t.a,r.a)?b(r.b.a,t.a,r.a)<=0:0<=b(t.b.a,r.a,t.a):b(r.b.a,e,r.a)<=0:r.b.a===e?0<=b(t.b.a,e,t.a):(t=y(t.b.a,e,t.a),(e=y(r.b.a,e,r.a))<=t)}function L(e){e.a.i=null;var t=e.e;t.a.c=t.c,t.c.a=t.a,e.e=null}function h(e,t){c(e.a),e.c=!1,(e.a=t).i=e}function k(e){for(var t=e.a.a;(e=fe(e)).a.a===t;);return e.c&&(h(e,t=f(ce(e).a.b,e.a.e)),e=fe(e)),e}function R(e,t,r){var i=new he;return i.a=r,i.e=W(e.f,t.e,i),r.i=i}function O(e,t){switch(e.s){case 100130:return 0!=(1&t);case 100131:return 0!==t;case 100132:return 0>1]],s[a[u]])?le(r,u):ue(r,u)),s[o]=null,l[o]=r.b,r.b=o}else for(r.c[-(o+1)]=null;0Math.max(a.a,l.a))return!1;if(v(o,a)){if(0i.f&&(i.f*=2,i.c=oe(i.c,i.f+1)),0===i.b?r=n:(r=i.b,i.b=i.c[i.b]),i.e[r]=t,i.c[r]=n,i.d[n]=r,i.h&&ue(i,n),r}return i=e.a++,e.c[i]=t,-(i+1)}function ie(e){if(0===e.a)return se(e.b);var t=e.c[e.d[e.a-1]];if(0!==e.b.a&&v(ae(e.b),t))return se(e.b);for(;--e.a,0e.a||v(i[a],i[l])){n[r[o]=a]=o;break}n[r[o]=l]=o,o=s}}function ue(e,t){for(var r=e.d,i=e.e,n=e.c,o=t,a=r[o];;){var s=o>>1,l=r[s];if(0==s||v(i[l],i[a])){n[r[o]=a]=o;break}n[r[o]=l]=o,o=s}}function he(){this.e=this.a=null,this.f=0,this.c=this.b=this.h=this.d=!1}function ce(e){return e.e.c.b}function fe(e){return e.e.a.b}(i=q.prototype).x=function(){Y(this,0)},i.B=function(e,t){switch(e){case 100142:return;case 100140:switch(t){case 100130:case 100131:case 100132:case 100133:case 100134:return void(this.s=t)}break;case 100141:return void(this.m=!!t);default:return void Z(this,100900)}Z(this,100901)},i.y=function(e){switch(e){case 100142:return 0;case 100140:return this.s;case 100141:return this.m;default:Z(this,100900)}return!1},i.A=function(e,t,r){this.j[0]=e,this.j[1]=t,this.j[2]=r},i.z=function(e,t){var r=t||null;switch(e){case 100100:case 100106:this.h=r;break;case 100104:case 100110:this.l=r;break;case 100101:case 100107:this.k=r;break;case 100102:case 100108:this.i=r;break;case 100103:case 100109:this.p=r;break;case 100105:case 100111:this.o=r;break;case 100112:this.r=r;break;default:Z(this,100900)}},i.C=function(e,t){var r=!1,i=[0,0,0];Y(this,2);for(var n=0;n<3;++n){var o=e[n];o<-1e150&&(o=-1e150,r=!0),1e150n[u]&&(n[u]=h,a[u]=l)}if(l=0,n[1]-o[1]>n[0]-o[0]&&(l=1),n[2]-o[2]>n[l]-o[l]&&(l=2),o[l]>=n[l])i[0]=0,i[1]=0,i[2]=1;else{for(n=0,o=s[l],a=a[l],s=[0,0,0],o=[o.g[0]-a.g[0],o.g[1]-a.g[1],o.g[2]-a.g[2]],u=[0,0,0],l=r.e;l!==r;l=l.e)u[0]=l.g[0]-a.g[0],u[1]=l.g[1]-a.g[1],u[2]=l.g[2]-a.g[2],s[0]=o[1]*u[2]-o[2]*u[1],s[1]=o[2]*u[0]-o[0]*u[2],s[2]=o[0]*u[1]-o[1]*u[0],n<(h=s[0]*s[0]+s[1]*s[1]+s[2]*s[2])&&(n=h,i[0]=s[0],i[1]=s[1],i[2]=s[2]);n<=0&&(i[0]=i[1]=i[2]=0,i[T(o)]=1)}r=!0}for(s=T(i),l=this.b.c,n=(s+1)%3,a=(s+2)%3,s=0>=l,h-=l,g!=o){if(g==a)break;for(var v=g>8,++y;var _=b;if(i>=8;null!==m&&s<4096&&(p[s++]=m<<8|_,u+1<=s&&l<12&&(++l,u=u<<1|1)),m=g}else s=1+a,u=(1<<(l=n+1))-1,m=null}return f!==i&&console.log("Warning, gif stream shorter than expected."),r}try{r.GifWriter=function(v,e,t,r){var y=0,i=void 0===(r=void 0===r?{}:r).loop?null:r.loop,b=void 0===r.palette?null:r.palette;if(e<=0||t<=0||65535>=1;)++n;if(a=1<>8&255,v[y++]=255&t,v[y++]=t>>8&255,v[y++]=(null!==b?128:0)|n,v[y++]=o,v[y++]=0,null!==b)for(var s=0,l=b.length;s>16&255,v[y++]=u>>8&255,v[y++]=255&u}if(null!==i){if(i<0||65535>8&255,v[y++]=0}var x=!1;this.addFrame=function(e,t,r,i,n,o){if(!0===x&&(--y,x=!1),o=void 0===o?{}:o,e<0||t<0||65535>=1;)++u;l=1<>8&255,v[y++]=d,v[y++]=0),v[y++]=44,v[y++]=255&e,v[y++]=e>>8&255,v[y++]=255&t,v[y++]=t>>8&255,v[y++]=255&r,v[y++]=r>>8&255,v[y++]=255&i,v[y++]=i>>8&255,v[y++]=!0===a?128|u-1:0,!0===a)for(var p=0,m=s.length;p>16&255,v[y++]=g>>8&255,v[y++]=255&g}return y=function(t,r,e,i){t[r++]=e;var n=r++,o=1<>=8,h-=8,r===n+256&&(t[n]=255,n=r++)}function d(e){c|=e<>=8,h-=8,r===n+256&&(t[n]=255,n=r++);4096===l?(d(o),l=1+s,u=e+1,m={}):(1<>7,n=1<<1+(7&r);x[e++],x[e++];var o=null,a=null;i&&(o=e,e+=3*(a=n));var s=!0,l=[],u=0,h=null,c=0,f=null;for(this.width=w,this.height=t;s&&e>2&7,e++;break;case 254:for(;;){if(!(0<=(C=x[e++])))throw Error("Invalid block size");if(0===C)break;e+=C}break;default:throw new Error("Unknown graphic control label: 0x"+x[e-1].toString(16))}break;case 44:var p=x[e++]|x[e++]<<8,m=x[e++]|x[e++]<<8,g=x[e++]|x[e++]<<8,v=x[e++]|x[e++]<<8,y=x[e++],b=y>>6&1,_=1<<1+(7&y),S=o,M=a,E=!1;if(y>>7){E=!0;S=e,e+=3*(M=_)}var T=e;for(e++;;){var C;if(!(0<=(C=x[e++])))throw Error("Invalid block size");if(0===C)break;e+=C}l.push({x:p,y:m,width:g,height:v,has_local_palette:E,palette_offset:S,palette_size:M,data_offset:T,data_length:e-T,transparent_index:h,interlaced:!!b,delay:u,disposal:c});break;case 59:s=!1;break;default:throw new Error("Unknown gif block: 0x"+x[e-1].toString(16))}this.numFrames=function(){return l.length},this.loopCount=function(){return f},this.frameInfo=function(e){if(e<0||e>=l.length)throw new Error("Frame index out of range.");return l[e]},this.decodeAndBlitFrameBGRA=function(e,t){var r=this.frameInfo(e),i=r.width*r.height,n=new Uint8Array(i);P(x,r.data_offset,n,i);var o=r.palette_offset,a=r.transparent_index;null===a&&(a=256);var s=r.width,l=w-s,u=s,h=4*(r.y*w+r.x),c=4*((r.y+r.height)*w+r.x),f=h,d=4*l;!0===r.interlaced&&(d+=4*w*7);for(var p=8,m=0,g=n.length;m>=1)),v===a)f+=4;else{var y=x[o+3*v],b=x[o+3*v+1],_=x[o+3*v+2];t[f++]=_,t[f++]=b,t[f++]=y,t[f++]=255}--u}},this.decodeAndBlitFrameRGBA=function(e,t){var r=this.frameInfo(e),i=r.width*r.height,n=new Uint8Array(i);P(x,r.data_offset,n,i);var o=r.palette_offset,a=r.transparent_index;null===a&&(a=256);var s=r.width,l=w-s,u=s,h=4*(r.y*w+r.x),c=4*((r.y+r.height)*w+r.x),f=h,d=4*l;!0===r.interlaced&&(d+=4*w*7);for(var p=8,m=0,g=n.length;m>=1)),v===a)f+=4;else{var y=x[o+3*v],b=x[o+3*v+1],_=x[o+3*v+2];t[f++]=y,t[f++]=b,t[f++]=_,t[f++]=255}--u}}}}catch(e){}},{}],33:[function(jr,t,r){(function(Gr){var e;e=this,function(E){"use strict";function e(e){if(null==this)throw TypeError();var t=String(this),r=t.length,i=e?Number(e):0;if(i!=i&&(i=0),!(i<0||r<=i)){var n,o=t.charCodeAt(i);return 55296<=o&&o<=56319&&i+1>>=1,t}function _(e,t,r){if(!t)return r;for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<>>16-t;return e.tag>>>=t,e.bitcount-=t,i+r}function x(e,t){for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<>>=1,++n,r+=t.table[n],0<=(i-=t.table[n]););return e.tag=o,e.bitcount-=n,t.trans[r+i]}function w(e,t,r){var i,n,o,a,s,l;for(i=_(e,5,257),n=_(e,5,1),o=_(e,4,4),a=0;a<19;++a)g[a]=0;for(a=0;athis.x2&&(this.x2=e)),"number"==typeof t&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=t,this.y2=t),tthis.y2&&(this.y2=t))},C.prototype.addX=function(e){this.addPoint(e,null)},C.prototype.addY=function(e){this.addPoint(null,e)},C.prototype.addBezier=function(e,t,r,i,n,o,a,s){var l=this,u=[e,t],h=[r,i],c=[n,o],f=[a,s];this.addPoint(e,t),this.addPoint(a,s);for(var d=0;d<=1;d++){var p=6*u[d]-12*h[d]+6*c[d],m=-3*u[d]+9*h[d]-9*c[d]+3*f[d],g=3*h[d]-3*u[d];if(0!=m){var v=Math.pow(p,2)-4*g*m;if(!(v<0)){var y=(-p+Math.sqrt(v))/(2*m);0>8&255,255&e]},A.USHORT=U(2),D.SHORT=function(e){return 32768<=e&&(e=-(65536-e)),[e>>8&255,255&e]},A.SHORT=U(2),D.UINT24=function(e){return[e>>16&255,e>>8&255,255&e]},A.UINT24=U(3),D.ULONG=function(e){return[e>>24&255,e>>16&255,e>>8&255,255&e]},A.ULONG=U(4),D.LONG=function(e){return R<=e&&(e=-(2*R-e)),[e>>24&255,e>>16&255,e>>8&255,255&e]},A.LONG=U(4),D.FIXED=D.ULONG,A.FIXED=A.ULONG,D.FWORD=D.SHORT,A.FWORD=A.SHORT,D.UFWORD=D.USHORT,A.UFWORD=A.USHORT,D.LONGDATETIME=function(e){return[0,0,0,0,e>>24&255,e>>16&255,e>>8&255,255&e]},A.LONGDATETIME=U(8),D.TAG=function(e){return k.argument(4===e.length,"Tag should be exactly 4 ASCII characters."),[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]},A.TAG=U(4),D.Card8=D.BYTE,A.Card8=A.BYTE,D.Card16=D.USHORT,A.Card16=A.USHORT,D.OffSize=D.BYTE,A.OffSize=A.BYTE,D.SID=D.USHORT,A.SID=A.USHORT,D.NUMBER=function(e){return-107<=e&&e<=107?[e+139]:108<=e&&e<=1131?[247+((e-=108)>>8),255&e]:-1131<=e&&e<=-108?[251+((e=-e-108)>>8),255&e]:-32768<=e&&e<=32767?D.NUMBER16(e):D.NUMBER32(e)},A.NUMBER=function(e){return D.NUMBER(e).length},D.NUMBER16=function(e){return[28,e>>8&255,255&e]},A.NUMBER16=U(3),D.NUMBER32=function(e){return[29,e>>24&255,e>>16&255,e>>8&255,255&e]},A.NUMBER32=U(5),D.REAL=function(e){var t=e.toString(),r=/\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec(t);if(r){var i=parseFloat("1e"+((r[2]?+r[2]:0)+r[1].length));t=(Math.round(e*i)/i).toString()}for(var n="",o=0,a=t.length;o>8&255,t[t.length]=255&i}return t},A.UTF16=function(e){return 2*e.length};var N={"x-mac-croatian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈ƫȅ ÀÃÕŒœĐ—“”‘’÷◊©⁄€‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ","x-mac-cyrillic":"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю","x-mac-gaelic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØḂ±≤≥ḃĊċḊḋḞḟĠġṀæøṁṖṗɼƒſṠ«»… ÀÃÕŒœ–—“”‘’ṡẛÿŸṪ€‹›Ŷŷṫ·Ỳỳ⁊ÂÊÁËÈÍÎÏÌÓÔ♣ÒÚÛÙıÝýŴŵẄẅẀẁẂẃ","x-mac-greek":"Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦€ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ­","x-mac-icelandic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüݰ¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-inuit":"ᐃᐄᐅᐆᐊᐋᐱᐲᐳᐴᐸᐹᑉᑎᑏᑐᑑᑕᑖᑦᑭᑮᑯᑰᑲᑳᒃᒋᒌᒍᒎᒐᒑ°ᒡᒥᒦ•¶ᒧ®©™ᒨᒪᒫᒻᓂᓃᓄᓅᓇᓈᓐᓯᓰᓱᓲᓴᓵᔅᓕᓖᓗᓘᓚᓛᓪᔨᔩᔪᔫᔭ… ᔮᔾᕕᕖᕗ–—“”‘’ᕘᕙᕚᕝᕆᕇᕈᕉᕋᕌᕐᕿᖀᖁᖂᖃᖄᖅᖏᖐᖑᖒᖓᖔᖕᙱᙲᙳᙴᙵᙶᖖᖠᖡᖢᖣᖤᖥᖦᕼŁł","x-mac-ce":"ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ",macintosh:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-romanian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂȘ∞±≤≥¥µ∂∑∏π∫ªºΩăș¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›Țț‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-turkish":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙˆ˜¯˘˙˚¸˝˛ˇ"};O.MACSTRING=function(e,t,r,i){var n=N[i];if(void 0!==n){for(var o="",a=0;a>8&255,l+256&255)}return o}D.MACSTRING=function(e,t){var r=function(e){if(!F)for(var t in F={},N)F[t]=new String(t);var r=F[e];if(void 0!==r){if(B){var i=B.get(r);if(void 0!==i)return i}var n=N[e];if(void 0!==n){for(var o={},a=0;a>8,t[c+1]=255&f,t=t.concat(i[h])}return t},A.TABLE=function(e){for(var t=0,r=e.fields.length,i=0;i>1,t.skip("uShort",3),e.glyphIndexMap={};for(var a=new se.Parser(r,i+n+14),s=new se.Parser(r,i+n+16+2*o),l=new se.Parser(r,i+n+16+4*o),u=new se.Parser(r,i+n+16+6*o),h=i+n+16+8*o,c=0;c>4,o=15&i;if(15==n)break;if(t+=r[n],15==o)break;t+=r[o]}return parseFloat(t)}(e);if(32<=t&&t<=246)return t-139;if(247<=t&&t<=250)return 256*(t-247)+e.parseByte()+108;if(251<=t&&t<=254)return 256*-(t-251)-e.parseByte()-108;throw new Error("Invalid b0 "+t)}function Te(e,t,r){t=void 0!==t?t:0;var i=new se.Parser(e,t),n=[],o=[];for(r=void 0!==r?r:e.length;i.relativeOffset>1,T.length=0,P=!0}return function e(t){for(var r,i,n,o,a,s,l,u,h,c,f,d,p=0;pMath.abs(d-R)?k=f+T.shift():R=d+T.shift(),E.curveTo(y,b,_,x,l,u),E.curveTo(h,c,f,d,k,R);break;default:console.log("Glyph "+v.index+": unknown operator 1200"+m),T.length=0}break;case 14:0>3;break;case 21:2>16),p+=2;break;case 29:a=T.pop()+g.gsubrsBias,(s=g.gsubrs[a])&&e(s);break;case 30:for(;0=r.begin&&e=fe.length){var a=i.parseChar();r.names.push(i.parseString(a))}break;case 2.5:r.numberOfGlyphs=i.parseUShort(),r.offset=new Array(r.numberOfGlyphs);for(var s=0;st.value.tag?1:-1}),t.fields=t.fields.concat(i),t.fields=t.fields.concat(n),t}function gt(e,t,r){for(var i=0;i 123 are reserved for internal usage");d|=1<>>1,o=e[n].tag;if(o===t)return n;o>>1,o=e[n];if(o===t)return n;o>>1,a=(r=e[o]).start;if(a===t)return r;a(r=e[i-1]).end?0:r}function xt(e,t){this.font=e,this.tableName=t}function wt(e){xt.call(this,e,"gpos")}function St(e){xt.call(this,e,"gsub")}function Mt(e,t){var r=e.length;if(r!==t.length)return!1;for(var i=0;it.points.length-1||i.matchedPoints[1]>n.points.length-1)throw Error("Matched points out of range in "+t.name);var a=t.points[i.matchedPoints[0]],s=n.points[i.matchedPoints[1]],l={xScale:i.xScale,scale01:i.scale01,scale10:i.scale10,yScale:i.yScale,dx:0,dy:0};s=kt([s],l)[0],l.dx=a.x-s.x,l.dy=a.y-s.y,o=kt(n.points,l)}t.points=t.points.concat(o)}}return Rt(t.points)}(wt.prototype=xt.prototype={searchTag:yt,binSearch:bt,getTable:function(e){var t=this.font.tables[this.tableName];return!t&&e&&(t=this.font.tables[this.tableName]=this.createDefaultTable()),t},getScriptNames:function(){var e=this.getTable();return e?e.scripts.map(function(e){return e.tag}):[]},getDefaultScriptName:function(){var e=this.getTable();if(e){for(var t=!1,r=0;r=s[u-1].tag,"Features must be added in alphabetical order."),o={tag:r,feature:{params:0,lookupListIndexes:[]}},s.push(o),a.push(u),o.feature}}},getLookupTables:function(e,t,r,i,n){var o=this.getFeatureTable(e,t,r,n),a=[];if(o){for(var s,l=o.lookupListIndexes,u=this.font.tables[this.tableName].lookups,h=0;h",s),t.stack.push(Math.round(64*s))}function vr(e,t){var r=t.stack,i=r.pop(),n=t.fv,o=t.pv,a=t.ppem,s=t.deltaBase+16*(e-1),l=t.deltaShift,u=t.z0;E.DEBUG&&console.log(t.step,"DELTAP["+e+"]",i,r);for(var h=0;h>4)===a){var d=(15&f)-8;0<=d&&d++,E.DEBUG&&console.log(t.step,"DELTAPFIX",c,"by",d*l);var p=u[c];n.setRelative(p,p,d*l,o)}}}function yr(e,t){var r=t.stack,i=r.pop();E.DEBUG&&console.log(t.step,"ROUND[]"),r.push(64*t.round(i/64))}function br(e,t){var r=t.stack,i=r.pop(),n=t.ppem,o=t.deltaBase+16*(e-1),a=t.deltaShift;E.DEBUG&&console.log(t.step,"DELTAC["+e+"]",i,r);for(var s=0;s>4)===n){var h=(15&u)-8;0<=h&&h++;var c=h*a;E.DEBUG&&console.log(t.step,"DELTACFIX",l,"by",c),t.cvt[l]+=c}}}function _r(e,t){var r,i,n=t.stack,o=n.pop(),a=n.pop(),s=t.z2[o],l=t.z1[a];E.DEBUG&&console.log(t.step,"SDPVTL["+e+"]",o,a),i=e?(r=s.y-l.y,l.x-s.x):(r=l.x-s.x,l.y-s.y),t.dpv=Zt(r,i)}function xr(e,t){var r=t.stack,i=t.prog,n=t.ip;E.DEBUG&&console.log(t.step,"PUSHB["+e+"]");for(var o=0;o":"_")+(i?"R":"_")+(0===n?"Gr":1===n?"Bl":2===n?"Wh":"")+"]",e?c+"("+o.cvt[c]+","+u+")":"",f,"(d =",a,"->",l*s,")"),o.rp1=o.rp0,o.rp2=f,t&&(o.rp0=f)}Ft.prototype.exec=function(e,t){if("number"!=typeof t)throw new Error("Point size is not a number!");if(!(2",i),s.interpolate(c,o,a,l),s.touch(c)}e.loop=1},dr.bind(void 0,0),dr.bind(void 0,1),function(e){for(var t=e.stack,r=e.rp0,i=e.z0[r],n=e.loop,o=e.fv,a=e.pv,s=e.z1;n--;){var l=t.pop(),u=s[l];E.DEBUG&&console.log(e.step,(1=a.width||t>=a.height?[0,0,0,0]:this._getPixel(e,t);var s=new l.default.Image(r,i);return s.canvas.getContext("2d").drawImage(a,e,t,r*o,i*o,0,0,r,i),s},l.default.Renderer.prototype.textLeading=function(e){return"number"==typeof e?(this._setProperty("_textLeading",e),this._pInst):this._textLeading},l.default.Renderer.prototype.textSize=function(e){return"number"==typeof e?(this._setProperty("_textSize",e),this._setProperty("_textLeading",e*y._DEFAULT_LEADMULT),this._applyTextProperties()):this._textSize},l.default.Renderer.prototype.textStyle=function(e){return e?(e!==y.NORMAL&&e!==y.ITALIC&&e!==y.BOLD&&e!==y.BOLDITALIC||this._setProperty("_textStyle",e),this._applyTextProperties()):this._textStyle},l.default.Renderer.prototype.textAscent=function(){return null===this._textAscent&&this._updateTextMetrics(),this._textAscent},l.default.Renderer.prototype.textDescent=function(){return null===this._textDescent&&this._updateTextMetrics(),this._textDescent},l.default.Renderer.prototype.textAlign=function(e,t){return void 0!==e?(this._setProperty("_textAlign",e),void 0!==t&&this._setProperty("_textBaseline",t),this._applyTextProperties()):{horizontal:this._textAlign,vertical:this._textBaseline}},l.default.Renderer.prototype.text=function(e,t,r,i,n){var o,a,s,l,u,h,c,f,d=this._pInst,p=Number.MAX_VALUE;if((this._doFill||this._doStroke)&&void 0!==e){if("string"!=typeof e&&(e=e.toString()),o=(e=e.replace(/(\t)/g," ")).split("\n"),void 0!==i){for(s=f=0;ss.HALF_PI&&e<=3*s.HALF_PI?Math.atan(r/i*Math.tan(e))+s.PI:Math.atan(r/i*Math.tan(e))+s.TWO_PI,t=t<=s.HALF_PI?Math.atan(r/i*Math.tan(t)):t>s.HALF_PI&&t<=3*s.HALF_PI?Math.atan(r/i*Math.tan(t))+s.PI:Math.atan(r/i*Math.tan(t))+s.TWO_PI),tv||Math.abs(this.accelerationY-this.pAccelerationY)>v||Math.abs(this.accelerationZ-this.pAccelerationZ)>v)&&e();var t=this.deviceTurned||window.deviceTurned;if("function"==typeof t){var r=this.rotationX+180,i=this.pRotationX+180,n=c+180;0>>24],i+=x[(16711680&C)>>16],n+=x[(65280&C)>>8],o+=x[255&C],r+=k[_],s++}w[l=T+y]=a/r,S[l]=i/r,M[l]=n/r,E[l]=o/r}T+=d}for(h=(u=-P)*d,b=T=0;b>>16,e[r+1]=(65280&t[i])>>>8,e[r+2]=255&t[i],e[r+3]=(4278190080&t[i])>>>24},O._toImageData=function(e){return e instanceof ImageData?e:e.getContext("2d").getImageData(0,0,e.width,e.height)},O._createImageData=function(e,t){return O._tmpCanvas=document.createElement("canvas"),O._tmpCtx=O._tmpCanvas.getContext("2d"),this._tmpCtx.createImageData(e,t)},O.apply=function(e,t,r){var i=e.getContext("2d"),n=i.getImageData(0,0,e.width,e.height),o=t(n,r);o instanceof ImageData?i.putImageData(o,0,0,0,0,e.width,e.height):i.putImageData(n,0,0,0,0,e.width,e.height)},O.threshold=function(e,t){var r=O._toPixels(e);void 0===t&&(t=.5);for(var i=Math.floor(255*t),n=0;n>8)/i,r[n+1]=255*(a*t>>8)/i,r[n+2]=255*(s*t>>8)/i}},O.dilate=function(e){for(var t,r,i,n,o,a,s,l,u,h,c,f,d,p,m,g,v,y=O._toPixels(e),b=0,_=y.length?y.length/4:0,x=new Int32Array(_);b<_;)for(r=(t=b)+e.width;b>16&255)+151*(i>>8&255)+28*(255&i))<(m=77*(c>>16&255)+151*(c>>8&255)+28*(255&c))&&(n=c,o=m),o<(p=77*((h=O._getARGB(y,a))>>16&255)+151*(h>>8&255)+28*(255&h))&&(n=h,o=p),o<(g=77*(f>>16&255)+151*(f>>8&255)+28*(255&f))&&(n=f,o=g),o<(v=77*(d>>16&255)+151*(d>>8&255)+28*(255&d))&&(n=d,o=v),x[b++]=n;O._setPixels(y,x)},O.erode=function(e){for(var t,r,i,n,o,a,s,l,u,h,c,f,d,p,m,g,v,y=O._toPixels(e),b=0,_=y.length?y.length/4:0,x=new Int32Array(_);b<_;)for(r=(t=b)+e.width;b>16&255)+151*(c>>8&255)+28*(255&c))<(o=77*(i>>16&255)+151*(i>>8&255)+28*(255&i))&&(n=c,o=m),(p=77*((h=O._getARGB(y,a))>>16&255)+151*(h>>8&255)+28*(255&h))>16&255)+151*(f>>8&255)+28*(255&f))>16&255)+151*(d>>8&255)+28*(255&d))=r){var i=Math.floor(t.timeDisplayed/r);if(t.timeDisplayed=0,t.displayIndex+=i,t.loopCount=Math.floor(t.displayIndex/t.numFrames),null!==t.loopLimit&&t.loopCount>=t.loopLimit)t.playing=!1;else{var n=t.displayIndex%t.numFrames;this.drawingContext.putImageData(t.frames[n].image,0,0),t.displayIndex=n,this.setModified(!0)}}}},n.default.Image.prototype._setProperty=function(e,t){this[e]=t,this.setModified(!0)},n.default.Image.prototype.loadPixels=function(){n.default.Renderer2D.prototype.loadPixels.call(this),this.setModified(!0)},n.default.Image.prototype.updatePixels=function(e,t,r,i){n.default.Renderer2D.prototype.updatePixels.call(this,e,t,r,i),this.setModified(!0)},n.default.Image.prototype.get=function(e,t,r,i){return n.default._validateParameters("p5.Image.get",arguments),n.default.Renderer2D.prototype.get.apply(this,arguments)},n.default.Image.prototype._getPixel=n.default.Renderer2D.prototype._getPixel,n.default.Image.prototype.set=function(e,t,r){n.default.Renderer2D.prototype.set.call(this,e,t,r),this.setModified(!0)},n.default.Image.prototype.resize=function(e,t){0===e&&0===t?(e=this.canvas.width,t=this.canvas.height):0===e?e=this.canvas.width*t/this.canvas.height:0===t&&(t=this.canvas.height*e/this.canvas.width),e=Math.floor(e),t=Math.floor(t);var r=document.createElement("canvas");if(r.width=e,r.height=t,this.gifProperties)for(var i=this.gifProperties,n=function(e,t){for(var r=0,i=0;i/g,">").replace(/"/g,""").replace(/'/g,"'")}function l(e,t){t&&!0!==t&&"true"!==t||(t="");var r="";return(e=e||"untitled")&&e.includes(".")&&(r=e.split(".").pop()),t&&r!==t&&(r=t,e="".concat(e,".").concat(r)),[e,r]}e("../core/error_helpers"),v.default.prototype.loadJSON=function(){for(var e=arguments.length,t=new Array(e),r=0;r"),n.print("");if(n.print(' '),n.print(""),n.print(""),n.print(" "),"0"!==o[0]){n.print(" ");for(var h=0;h".concat(c)),n.print(" ")}n.print(" ")}for(var f=0;f");for(var d=0;d".concat(p)),n.print(" ")}n.print(" ")}n.print("
"),n.print(""),n.print("")}n.close(),n.clear()},v.default.prototype.writeFile=function(e,t,r){var i="application/octet-stream";v.default.prototype._isSafari()&&(i="text/plain");var n=new Blob(e,{type:i});v.default.prototype.downloadFile(n,t,r)},v.default.prototype.downloadFile=function(e,t,r){var i=l(t,r),n=i[0];if(e instanceof Blob)s.default.saveAs(e,n);else{var o=document.createElement("a");if(o.href=e,o.download=n,o.onclick=function(e){var t;t=e,document.body.removeChild(t.target),e.stopPropagation()},o.style.display="none",document.body.appendChild(o),v.default.prototype._isSafari()){var a="Hello, Safari user! To download this file...\n";a+="1. Go to File --\x3e Save As.\n",a+='2. Choose "Page Source" as the Format.\n',a+='3. Name it with this extension: ."'.concat(i[1],'"'),alert(a)}o.click()}},v.default.prototype._checkFileExtension=l,v.default.prototype._isSafari=function(){return 0>>0},getSeed:function(){return t},rand:function(){return(r=(1664525*r+1013904223)%i)/i}});n.setSeed(e),_=new Array(4096);for(var o=0;o<4096;o++)_[o]=n.rand()};var o=n.default;r.default=o},{"../core/main":49}],82:[function(e,t,r){"use strict";function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i,l=(i=e("../core/main"))&&i.__esModule?i:{default:i},o=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==a(e)&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var o=i?Object.getOwnPropertyDescriptor(e,n):null;o&&(o.get||o.set)?Object.defineProperty(r,n,o):r[n]=e[n]}r.default=e,t&&t.set(e,r);return r}(e("../core/constants"));function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}l.default.Vector=function(e,t,r){var i,n,o;o=e instanceof l.default?(this.p5=e,i=t[0]||0,n=t[1]||0,t[2]||0):(i=e||0,n=t||0,r||0),this.x=i,this.y=n,this.z=o},l.default.Vector.prototype.toString=function(){return"p5.Vector Object : [".concat(this.x,", ").concat(this.y,", ").concat(this.z,"]")},l.default.Vector.prototype.set=function(e,t,r){return e instanceof l.default.Vector?(this.x=e.x||0,this.y=e.y||0,this.z=e.z||0):e instanceof Array?(this.x=e[0]||0,this.y=e[1]||0,this.z=e[2]||0):(this.x=e||0,this.y=t||0,this.z=r||0),this},l.default.Vector.prototype.copy=function(){return this.p5?new l.default.Vector(this.p5,[this.x,this.y,this.z]):new l.default.Vector(this.x,this.y,this.z)},l.default.Vector.prototype.add=function(e,t,r){return e instanceof l.default.Vector?(this.x+=e.x||0,this.y+=e.y||0,this.z+=e.z||0):e instanceof Array?(this.x+=e[0]||0,this.y+=e[1]||0,this.z+=e[2]||0):(this.x+=e||0,this.y+=t||0,this.z+=r||0),this};function u(e,t){return 0!==e&&(this.x=this.x%e),0!==t&&(this.y=this.y%t),this}function h(e,t,r){return 0!==e&&(this.x=this.x%e),0!==t&&(this.y=this.y%t),0!==r&&(this.z=this.z%r),this}l.default.Vector.prototype.rem=function(e,t,r){if(e instanceof l.default.Vector){if(Number.isFinite(e.x)&&Number.isFinite(e.y)&&Number.isFinite(e.z)){var i=parseFloat(e.x),n=parseFloat(e.y),o=parseFloat(e.z);h.call(this,i,n,o)}}else if(e instanceof Array)e.every(function(e){return Number.isFinite(e)})&&(2===e.length&&u.call(this,e[0],e[1]),3===e.length&&h.call(this,e[0],e[1],e[2]));else if(1===arguments.length){if(Number.isFinite(e)&&0!==e)return this.x=this.x%e,this.y=this.y%e,this.z=this.z%e,this}else if(2===arguments.length){var a=Array.prototype.slice.call(arguments);a.every(function(e){return Number.isFinite(e)})&&2===a.length&&u.call(this,a[0],a[1])}else if(3===arguments.length){var s=Array.prototype.slice.call(arguments);s.every(function(e){return Number.isFinite(e)})&&3===s.length&&h.call(this,s[0],s[1],s[2])}},l.default.Vector.prototype.sub=function(e,t,r){return e instanceof l.default.Vector?(this.x-=e.x||0,this.y-=e.y||0,this.z-=e.z||0):e instanceof Array?(this.x-=e[0]||0,this.y-=e[1]||0,this.z-=e[2]||0):(this.x-=e||0,this.y-=t||0,this.z-=r||0),this},l.default.Vector.prototype.mult=function(e){return"number"==typeof e&&isFinite(e)?(this.x*=e,this.y*=e,this.z*=e):console.warn("p5.Vector.prototype.mult:","n is undefined or not a finite number"),this},l.default.Vector.prototype.div=function(e){return"number"==typeof e&&isFinite(e)?0===e?console.warn("p5.Vector.prototype.div:","divide by 0"):(this.x/=e,this.y/=e,this.z/=e):console.warn("p5.Vector.prototype.div:","n is undefined or not a finite number"),this},l.default.Vector.prototype.mag=function(){return Math.sqrt(this.magSq())},l.default.Vector.prototype.magSq=function(){var e=this.x,t=this.y,r=this.z;return e*e+t*t+r*r},l.default.Vector.prototype.dot=function(e,t,r){return e instanceof l.default.Vector?this.dot(e.x,e.y,e.z):this.x*(e||0)+this.y*(t||0)+this.z*(r||0)},l.default.Vector.prototype.cross=function(e){var t=this.y*e.z-this.z*e.y,r=this.z*e.x-this.x*e.z,i=this.x*e.y-this.y*e.x;return this.p5?new l.default.Vector(this.p5,[t,r,i]):new l.default.Vector(t,r,i)},l.default.Vector.prototype.dist=function(e){return e.copy().sub(this).mag()},l.default.Vector.prototype.normalize=function(){var e=this.mag();return 0!==e&&this.mult(1/e),this},l.default.Vector.prototype.limit=function(e){var t=this.magSq();return e*e>>0},n.default.prototype.randomSeed=function(e){this._lcgSetSeed(o,e),this._gaussian_previous=!1},n.default.prototype.random=function(e,t){var r;if(n.default._validateParameters("random",arguments),r=null!=this[o]?this._lcg(o):Math.random(),void 0===e)return r;if(void 0===t)return e instanceof Array?e[Math.floor(r*e.length)]:r*e;if(tf){var P=p,L=l,k=u;p=d+f*(s&&d=t&&(r=r.substring(r.length-t,r.length)),r}},n.default.prototype.unhex=function(e){return e instanceof Array?e.map(n.default.prototype.unhex):parseInt("0x".concat(e),16)};var o=n.default;r.default=o},{"../core/main":49}],90:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i,a=(i=e("../core/main"))&&i.__esModule?i:{default:i};function n(e,t,r){var i=e<0,n=i?e.toString().substring(1):e.toString(),o=n.indexOf("."),a=-1!==o?n.substring(0,o):n,s=-1!==o?n.substring(o+1):"",l=i?"-":"";if(void 0!==r){var u="";(-1!==o||0r&&(s=s.substring(0,r));for(var h=0;hi.length)for(var o=t-(i+=-1===r?".":"").length+1,a=0;a=d.TWO_PI?"".concat("ellipse","|").concat(u,"|"):"".concat("arc","|").concat(a,"|").concat(s,"|").concat(l,"|").concat(u,"|"),!this.geometryInHash(t)){var h=new T.default.Geometry(u,1,function(){if(this.strokeIndices=[],a.toFixed(10)!==s.toFixed(10)){l!==d.PIE&&void 0!==l||(this.vertices.push(new T.default.Vector(.5,.5,0)),this.uvs.push([.5,.5]));for(var e=0;e<=u;e++){var t=(s-a)*(e/u)+a,r=.5+Math.cos(t)/2,i=.5+Math.sin(t)/2;this.vertices.push(new T.default.Vector(r,i,0)),this.uvs.push([r,i]),e>5&31)/31,(y>>10&31)/31):(r=a,i=s,l)}for(var b=1;b<=3;b++){var _=p+12*b,x=new S.default.Vector(u.getFloat32(_,!0),u.getFloat32(8+_,!0),u.getFloat32(4+_,!0));e.vertices.push(x),c&&o.push(r,i,n)}var w=new S.default.Vector(m,g,v);e.vertexNormals.push(w,w,w),e.faces.push([3*d,3*d+1,3*d+2]),e.uvs.push([0,0],[0,0],[0,0])}}(e,t);else{var r=new DataView(t);if(!("TextDecoder"in window))return console.warn("Sorry, ASCII STL loading only works in browsers that support TextDecoder (https://caniuse.com/#feat=textencoder)");var i=new TextDecoder("utf-8").decode(r).split("\n");!function(e,t){for(var r,i,n="",o=[],a=0;aMath.PI?l=Math.PI:l<=0&&(l=.001);var u=Math.sin(l)*a*Math.sin(s),h=Math.cos(l)*a,c=Math.sin(l)*a*Math.cos(s);this.camera(u+this.centerX,h+this.centerY,c+this.centerZ,this.centerX,this.centerY,this.centerZ,0,1,0)},m.default.Camera.prototype._isActive=function(){return this===this._renderer._curCamera},m.default.prototype.setCamera=function(e){this._renderer._curCamera=e,this._renderer.uPMatrix.set(e.projMatrix.mat4[0],e.projMatrix.mat4[1],e.projMatrix.mat4[2],e.projMatrix.mat4[3],e.projMatrix.mat4[4],e.projMatrix.mat4[5],e.projMatrix.mat4[6],e.projMatrix.mat4[7],e.projMatrix.mat4[8],e.projMatrix.mat4[9],e.projMatrix.mat4[10],e.projMatrix.mat4[11],e.projMatrix.mat4[12],e.projMatrix.mat4[13],e.projMatrix.mat4[14],e.projMatrix.mat4[15])};var n=m.default.Camera;r.default=n},{"../core/main":49}],98:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i,h=(i=e("../core/main"))&&i.__esModule?i:{default:i};h.default.Geometry=function(e,t,r){return this.vertices=[],this.lineVertices=[],this.lineNormals=[],this.vertexNormals=[],this.faces=[],this.uvs=[],this.edges=[],this.vertexColors=[],this.detailX=void 0!==e?e:1,this.detailY=void 0!==t?t:1,this.dirtyFlags={},r instanceof Function&&r.call(this),this},h.default.Geometry.prototype.reset=function(){this.lineVertices.length=0,this.lineNormals.length=0,this.vertices.length=0,this.edges.length=0,this.vertexColors.length=0,this.vertexNormals.length=0,this.uvs.length=0,this.dirtyFlags={}},h.default.Geometry.prototype.computeFaces=function(){this.faces.length=0;for(var e,t,r,i,n=this.detailX+1,o=0;othis.vertices.length-1-this.detailX;i--)e.add(this.vertexNormals[i]);e=h.default.Vector.div(e,this.detailX);for(var n=this.vertices.length-1;n>this.vertices.length-1-this.detailX;n--)this.vertexNormals[n]=e;return this},h.default.Geometry.prototype._makeTriangleEdges=function(){if(this.edges.length=0,Array.isArray(this.strokeIndices))for(var e=0,t=this.strokeIndices.length;e vTexCoord.y;\n bool y1 = p1.y > vTexCoord.y;\n bool y2 = p2.y > vTexCoord.y;\n\n // could web be under the curve (after t1)?\n if (y1 ? !y2 : y0) {\n // add the coverage for t1\n coverage.x += saturate(C1.x + 0.5);\n // calculate the anti-aliasing for t1\n weight.x = min(weight.x, abs(C1.x));\n }\n\n // are we outside the curve (after t2)?\n if (y1 ? !y0 : y2) {\n // subtract the coverage for t2\n coverage.x -= saturate(C2.x + 0.5);\n // calculate the anti-aliasing for t2\n weight.x = min(weight.x, abs(C2.x));\n }\n}\n\n// this is essentially the same as coverageX, but with the axes swapped\nvoid coverageY(vec2 p0, vec2 p1, vec2 p2) {\n\n vec2 C1, C2;\n calulateCrossings(p0, p1, p2, C1, C2);\n\n bool x0 = p0.x > vTexCoord.x;\n bool x1 = p1.x > vTexCoord.x;\n bool x2 = p2.x > vTexCoord.x;\n\n if (x1 ? !x2 : x0) {\n coverage.y -= saturate(C1.y + 0.5);\n weight.y = min(weight.y, abs(C1.y));\n }\n\n if (x1 ? !x0 : x2) {\n coverage.y += saturate(C2.y + 0.5);\n weight.y = min(weight.y, abs(C2.y));\n }\n}\n\nvoid main() {\n\n // calculate the pixel scale based on screen-coordinates\n pixelScale = hardness / fwidth(vTexCoord);\n\n // which grid cell is this pixel in?\n ivec2 gridCoord = ifloor(vTexCoord * vec2(uGridSize));\n\n // intersect curves in this row\n {\n // the index into the row info bitmap\n int rowIndex = gridCoord.y + uGridOffset.y;\n // fetch the info texel\n vec4 rowInfo = getTexel(uSamplerRows, rowIndex, uGridImageSize);\n // unpack the rowInfo\n int rowStrokeIndex = getInt16(rowInfo.xy);\n int rowStrokeCount = getInt16(rowInfo.zw);\n\n for (int iRowStroke = INT(0); iRowStroke < N; iRowStroke++) {\n if (iRowStroke >= rowStrokeCount)\n break;\n\n // each stroke is made up of 3 points: the start and control point\n // and the start of the next curve.\n // fetch the indices of this pair of strokes:\n vec4 strokeIndices = getTexel(uSamplerRowStrokes, rowStrokeIndex++, uCellsImageSize);\n\n // unpack the stroke index\n int strokePos = getInt16(strokeIndices.xy);\n\n // fetch the two strokes\n vec4 stroke0 = getTexel(uSamplerStrokes, strokePos + INT(0), uStrokeImageSize);\n vec4 stroke1 = getTexel(uSamplerStrokes, strokePos + INT(1), uStrokeImageSize);\n\n // calculate the coverage\n coverageX(stroke0.xy, stroke0.zw, stroke1.xy);\n }\n }\n\n // intersect curves in this column\n {\n int colIndex = gridCoord.x + uGridOffset.x;\n vec4 colInfo = getTexel(uSamplerCols, colIndex, uGridImageSize);\n int colStrokeIndex = getInt16(colInfo.xy);\n int colStrokeCount = getInt16(colInfo.zw);\n \n for (int iColStroke = INT(0); iColStroke < N; iColStroke++) {\n if (iColStroke >= colStrokeCount)\n break;\n\n vec4 strokeIndices = getTexel(uSamplerColStrokes, colStrokeIndex++, uCellsImageSize);\n\n int strokePos = getInt16(strokeIndices.xy);\n vec4 stroke0 = getTexel(uSamplerStrokes, strokePos + INT(0), uStrokeImageSize);\n vec4 stroke1 = getTexel(uSamplerStrokes, strokePos + INT(1), uStrokeImageSize);\n coverageY(stroke0.xy, stroke0.zw, stroke1.xy);\n }\n }\n\n weight = saturate(1.0 - weight * 2.0);\n float distance = max(weight.x + weight.y, minDistance); // manhattan approx.\n float antialias = abs(dot(coverage, weight) / distance);\n float cover = min(abs(coverage.x), abs(coverage.y));\n gl_FragColor = uMaterialColor;\n gl_FragColor.a *= saturate(max(antialias, cover));\n}",lineVert:"/*\n Part of the Processing project - http://processing.org\n Copyright (c) 2012-15 The Processing Foundation\n Copyright (c) 2004-12 Ben Fry and Casey Reas\n Copyright (c) 2001-04 Massachusetts Institute of Technology\n This library is free software; you can redistribute it and/or\n modify it under the terms of the GNU Lesser General Public\n License as published by the Free Software Foundation, version 2.1.\n This library is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n Lesser General Public License for more details.\n You should have received a copy of the GNU Lesser General\n Public License along with this library; if not, write to the\n Free Software Foundation, Inc., 59 Temple Place, Suite 330,\n Boston, MA 02111-1307 USA\n*/\n\n#define PROCESSING_LINE_SHADER\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform float uStrokeWeight;\n\nuniform vec4 uViewport;\nuniform int uPerspective;\n\nattribute vec4 aPosition;\nattribute vec4 aDirection;\n \nvoid main() {\n // using a scale <1 moves the lines towards the camera\n // in order to prevent popping effects due to half of\n // the line disappearing behind the geometry faces.\n vec3 scale = vec3(0.9995);\n\n vec4 posp = uModelViewMatrix * aPosition;\n vec4 posq = uModelViewMatrix * (aPosition + vec4(aDirection.xyz, 0));\n\n // Moving vertices slightly toward the camera\n // to avoid depth-fighting with the fill triangles.\n // Discussed here:\n // http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Number=252848 \n posp.xyz = posp.xyz * scale;\n posq.xyz = posq.xyz * scale;\n\n vec4 p = uProjectionMatrix * posp;\n vec4 q = uProjectionMatrix * posq;\n\n // formula to convert from clip space (range -1..1) to screen space (range 0..[width or height])\n // screen_p = (p.xy/p.w + <1,1>) * 0.5 * uViewport.zw\n\n // prevent division by W by transforming the tangent formula (div by 0 causes\n // the line to disappear, see https://github.com/processing/processing/issues/5183)\n // t = screen_q - screen_p\n //\n // tangent is normalized and we don't care which aDirection it points to (+-)\n // t = +- normalize( screen_q - screen_p )\n // t = +- normalize( (q.xy/q.w+<1,1>)*0.5*uViewport.zw - (p.xy/p.w+<1,1>)*0.5*uViewport.zw )\n //\n // extract common factor, <1,1> - <1,1> cancels out\n // t = +- normalize( (q.xy/q.w - p.xy/p.w) * 0.5 * uViewport.zw )\n //\n // convert to common divisor\n // t = +- normalize( ((q.xy*p.w - p.xy*q.w) / (p.w*q.w)) * 0.5 * uViewport.zw )\n //\n // remove the common scalar divisor/factor, not needed due to normalize and +-\n // (keep uViewport - can't remove because it has different components for x and y\n // and corrects for aspect ratio, see https://github.com/processing/processing/issues/5181)\n // t = +- normalize( (q.xy*p.w - p.xy*q.w) * uViewport.zw )\n\n vec2 tangent = normalize((q.xy*p.w - p.xy*q.w) * uViewport.zw);\n\n // flip tangent to normal (it's already normalized)\n vec2 normal = vec2(-tangent.y, tangent.x);\n\n float thickness = aDirection.w * uStrokeWeight;\n vec2 offset = normal * thickness / 2.0;\n\n vec2 curPerspScale;\n\n if(uPerspective == 1) {\n // Perspective ---\n // convert from world to clip by multiplying with projection scaling factor\n // to get the right thickness (see https://github.com/processing/processing/issues/5182)\n // invert Y, projections in Processing invert Y\n curPerspScale = (uProjectionMatrix * vec4(1, -1, 0, 0)).xy;\n } else {\n // No Perspective ---\n // multiply by W (to cancel out division by W later in the pipeline) and\n // convert from screen to clip (derived from clip to screen above)\n curPerspScale = p.w / (0.5 * uViewport.zw);\n }\n\n gl_Position.xy = p.xy + offset.xy * curPerspScale;\n gl_Position.zw = p.zw;\n}\n",lineFrag:"precision mediump float;\nprecision mediump int;\n\nuniform vec4 uMaterialColor;\n\nvoid main() {\n gl_FragColor = uMaterialColor;\n}",pointVert:"attribute vec3 aPosition;\nuniform float uPointSize;\nvarying float vStrokeWeight;\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nvoid main() {\n\tvec4 positionVec4 = vec4(aPosition, 1.0);\n\tgl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n\tgl_PointSize = uPointSize;\n\tvStrokeWeight = uPointSize;\n}",pointFrag:"precision mediump float;\nprecision mediump int;\nuniform vec4 uMaterialColor;\nvarying float vStrokeWeight;\n\nvoid main(){\n\tfloat mask = 0.0;\n\n\t// make a circular mask using the gl_PointCoord (goes from 0 - 1 on a point)\n // might be able to get a nicer edge on big strokeweights with smoothstep but slightly less performant\n\n\tmask = step(0.98, length(gl_PointCoord * 2.0 - 1.0));\n\n\t// if strokeWeight is 1 or less lets just draw a square\n\t// this prevents weird artifacting from carving circles when our points are really small\n\t// if strokeWeight is larger than 1, we just use it as is\n\n\tmask = mix(0.0, mask, clamp(floor(vStrokeWeight - 0.5),0.0,1.0));\n\n\t// throw away the borders of the mask\n // otherwise we get weird alpha blending issues\n\n\tif(mask > 0.98){\n discard;\n \t}\n\n \tgl_FragColor = vec4(uMaterialColor.rgb * (1.0 - mask), uMaterialColor.a) ;\n}"};u.default.RendererGL=function(e,t,r,i){return u.default.Renderer.call(this,e,t,r),this._setAttributeDefaults(t),this._initContext(),this.isP3D=!0,this.GL=this.drawingContext,this._isErasing=!1,this._enableLighting=!1,this.ambientLightColors=[],this.specularColors=[1,1,1],this.directionalLightDirections=[],this.directionalLightDiffuseColors=[],this.directionalLightSpecularColors=[],this.pointLightPositions=[],this.pointLightDiffuseColors=[],this.pointLightSpecularColors=[],this.spotLightPositions=[],this.spotLightDirections=[],this.spotLightDiffuseColors=[],this.spotLightSpecularColors=[],this.spotLightAngle=[],this.spotLightConc=[],this.drawMode=o.FILL,this.curFillColor=this._cachedFillStyle=[1,1,1,1],this.curStrokeColor=this._cachedStrokeStyle=[0,0,0,1],this.curBlendMode=o.BLEND,this._cachedBlendMode=void 0,this.blendExt=this.GL.getExtension("EXT_blend_minmax"),this._isBlending=!1,this._useSpecularMaterial=!1,this._useEmissiveMaterial=!1,this._useNormalMaterial=!1,this._useShininess=1,this._tint=[255,255,255,255],this.constantAttenuation=1,this.linearAttenuation=0,this.quadraticAttenuation=0,this.uMVMatrix=new u.default.Matrix,this.uPMatrix=new u.default.Matrix,this.uNMatrix=new u.default.Matrix("mat3"),this._curCamera=new u.default.Camera(this),this._curCamera._computeCameraDefaultSettings(),this._curCamera._setDefaultCamera(),this._defaultLightShader=void 0,this._defaultImmediateModeShader=void 0,this._defaultNormalShader=void 0,this._defaultColorShader=void 0,this._defaultPointShader=void 0,this.userFillShader=void 0,this.userStrokeShader=void 0,this.userPointShader=void 0,this.retainedMode={geometry:{},buffers:{stroke:[new u.default.RenderBuffer(3,"lineVertices","lineVertexBuffer","aPosition",this,this._flatten),new u.default.RenderBuffer(4,"lineNormals","lineNormalBuffer","aDirection",this,this._flatten)],fill:[new u.default.RenderBuffer(3,"vertices","vertexBuffer","aPosition",this,this._vToNArray),new u.default.RenderBuffer(3,"vertexNormals","normalBuffer","aNormal",this,this._vToNArray),new u.default.RenderBuffer(4,"vertexColors","colorBuffer","aMaterialColor",this),new u.default.RenderBuffer(3,"vertexAmbients","ambientBuffer","aAmbientColor",this),new u.default.RenderBuffer(2,"uvs","uvBuffer","aTexCoord",this,this._flatten)],text:[new u.default.RenderBuffer(3,"vertices","vertexBuffer","aPosition",this,this._vToNArray),new u.default.RenderBuffer(2,"uvs","uvBuffer","aTexCoord",this,this._flatten)]}},this.immediateMode={geometry:new u.default.Geometry,shapeMode:o.TRIANGLE_FAN,_bezierVertex:[],_quadraticVertex:[],_curveVertex:[],buffers:{fill:[new u.default.RenderBuffer(3,"vertices","vertexBuffer","aPosition",this,this._vToNArray),new u.default.RenderBuffer(3,"vertexNormals","normalBuffer","aNormal",this,this._vToNArray),new u.default.RenderBuffer(4,"vertexColors","colorBuffer","aVertexColor",this),new u.default.RenderBuffer(3,"vertexAmbients","ambientBuffer","aAmbientColor",this),new u.default.RenderBuffer(2,"uvs","uvBuffer","aTexCoord",this,this._flatten)],stroke:[new u.default.RenderBuffer(3,"lineVertices","lineVertexBuffer","aPosition",this,this._flatten),new u.default.RenderBuffer(4,"lineNormals","lineNormalBuffer","aDirection",this,this._flatten)],point:this.GL.createBuffer()}},this.pointSize=5,this.curStrokeWeight=1,this.textures=[],this.textureMode=o.IMAGE,this.textureWrapX=o.CLAMP,this.textureWrapY=o.CLAMP,this._tex=null,this._curveTightness=6,this._lookUpTableBezier=[],this._lookUpTableQuadratic=[],this._lutBezierDetail=0,this._lutQuadraticDetail=0,this._tessy=this._initTessy(),this.fontInfos={},this._curShader=void 0,this},u.default.RendererGL.prototype=Object.create(u.default.Renderer.prototype),u.default.RendererGL.prototype._setAttributeDefaults=function(e){var t={alpha:!0,depth:!0,stencil:!0,antialias:navigator.userAgent.toLowerCase().includes("safari"),premultipliedAlpha:!1,preserveDrawingBuffer:!0,perPixelLighting:!0};null===e._glAttributes?e._glAttributes=t:e._glAttributes=Object.assign(t,e._glAttributes)},u.default.RendererGL.prototype._initContext=function(){try{if(this.drawingContext=this.canvas.getContext("webgl",this._pInst._glAttributes)||this.canvas.getContext("experimental-webgl",this._pInst._glAttributes),null===this.drawingContext)throw new Error("Error creating webgl context");var e=this.drawingContext;e.enable(e.DEPTH_TEST),e.depthFunc(e.LEQUAL),e.viewport(0,0,e.drawingBufferWidth,e.drawingBufferHeight),this._viewport=this.drawingContext.getParameter(this.drawingContext.VIEWPORT)}catch(e){throw e}},u.default.RendererGL.prototype._resetContext=function(e,t){var r=this.width,i=this.height,n=this.canvas.id,o=this._pInst instanceof u.default.Graphics;if(o){var a=this._pInst;a.canvas.parentNode.removeChild(a.canvas),a.canvas=document.createElement("canvas"),(a._pInst._userNode||document.body).appendChild(a.canvas),u.default.Element.call(a,a.canvas,a._pInst),a.width=r,a.height=i}else{var s=this.canvas;s&&s.parentNode.removeChild(s),(s=document.createElement("canvas")).id=n,this._pInst._userNode?this._pInst._userNode.appendChild(s):document.body.appendChild(s),this._pInst.canvas=s}var l=new u.default.RendererGL(this._pInst.canvas,this._pInst,!o);this._pInst._setProperty("_renderer",l),l.resize(r,i),l._applyDefaults(),o||this._pInst._elements.push(l),"function"==typeof t&&setTimeout(function(){t.apply(window._renderer,e)},0)},u.default.prototype.setAttributes=function(e,t){if(void 0!==this._glAttributes){var r=!0;if(void 0!==t?(null===this._glAttributes&&(this._glAttributes={}),this._glAttributes[e]!==t&&(this._glAttributes[e]=t,r=!1)):e instanceof Object&&this._glAttributes!==e&&(this._glAttributes=e,r=!1),this._renderer.isP3D&&!r){if(!this._setupDone)for(var i in this._renderer.retainedMode.geometry)if(this._renderer.retainedMode.geometry.hasOwnProperty(i))return void console.error("Sorry, Could not set the attributes, you need to call setAttributes() before calling the other drawing methods in setup()");this.push(),this._renderer._resetContext(),this.pop(),this._renderer._curCamera&&(this._renderer._curCamera._renderer=this._renderer)}}else console.log("You are trying to use setAttributes on a p5.Graphics object that does not use a WEBGL renderer.")},u.default.RendererGL.prototype._update=function(){this.uMVMatrix.set(this._curCamera.cameraMatrix.mat4[0],this._curCamera.cameraMatrix.mat4[1],this._curCamera.cameraMatrix.mat4[2],this._curCamera.cameraMatrix.mat4[3],this._curCamera.cameraMatrix.mat4[4],this._curCamera.cameraMatrix.mat4[5],this._curCamera.cameraMatrix.mat4[6],this._curCamera.cameraMatrix.mat4[7],this._curCamera.cameraMatrix.mat4[8],this._curCamera.cameraMatrix.mat4[9],this._curCamera.cameraMatrix.mat4[10],this._curCamera.cameraMatrix.mat4[11],this._curCamera.cameraMatrix.mat4[12],this._curCamera.cameraMatrix.mat4[13],this._curCamera.cameraMatrix.mat4[14],this._curCamera.cameraMatrix.mat4[15]),this.ambientLightColors.length=0,this.specularColors=[1,1,1],this.directionalLightDirections.length=0,this.directionalLightDiffuseColors.length=0,this.directionalLightSpecularColors.length=0,this.pointLightPositions.length=0,this.pointLightDiffuseColors.length=0,this.pointLightSpecularColors.length=0,this.spotLightPositions.length=0,this.spotLightDirections.length=0,this.spotLightDiffuseColors.length=0,this.spotLightSpecularColors.length=0,this.spotLightAngle.length=0,this.spotLightConc.length=0,this._enableLighting=!1,this._tint=[255,255,255,255],this.GL.clear(this.GL.DEPTH_BUFFER_BIT)},u.default.RendererGL.prototype.background=function(){var e,t=(e=this._pInst).color.apply(e,arguments),r=t.levels[0]/255,i=t.levels[1]/255,n=t.levels[2]/255,o=t.levels[3]/255;this.GL.clearColor(r,i,n,o),this.GL.clear(this.GL.COLOR_BUFFER_BIT)},u.default.RendererGL.prototype.fill=function(e,t,r,i){var n=u.default.prototype.color.apply(this._pInst,arguments);this.curFillColor=n._array,this.drawMode=o.FILL,this._useNormalMaterial=!1,this._tex=null},u.default.RendererGL.prototype.stroke=function(e,t,r,i){arguments[3]=255;var n=u.default.prototype.color.apply(this._pInst,arguments);this.curStrokeColor=n._array},u.default.RendererGL.prototype.strokeCap=function(e){console.error("Sorry, strokeCap() is not yet implemented in WEBGL mode")},u.default.RendererGL.prototype.strokeJoin=function(e){console.error("Sorry, strokeJoin() is not yet implemented in WEBGL mode")},u.default.RendererGL.prototype.filter=function(e){console.error("filter() does not work in WEBGL mode")},u.default.RendererGL.prototype.blendMode=function(e){e===o.DARKEST||e===o.LIGHTEST||e===o.ADD||e===o.BLEND||e===o.SUBTRACT||e===o.SCREEN||e===o.EXCLUSION||e===o.REPLACE||e===o.MULTIPLY||e===o.REMOVE?this.curBlendMode=e:e!==o.BURN&&e!==o.OVERLAY&&e!==o.HARD_LIGHT&&e!==o.SOFT_LIGHT&&e!==o.DODGE||console.warn("BURN, OVERLAY, HARD_LIGHT, SOFT_LIGHT, and DODGE only work for blendMode in 2D mode.")},u.default.RendererGL.prototype.erase=function(e,t){this._isErasing||(this._cachedBlendMode=this.curBlendMode,this.blendMode(o.REMOVE),this._cachedFillStyle=this.curFillColor.slice(),this.curFillColor=[1,1,1,e/255],this._cachedStrokeStyle=this.curStrokeColor.slice(),this.curStrokeColor=[1,1,1,t/255],this._isErasing=!0)},u.default.RendererGL.prototype.noErase=function(){this._isErasing&&(this.curFillColor=this._cachedFillStyle.slice(),this.curStrokeColor=this._cachedStrokeStyle.slice(),this.blendMode(this._cachedBlendMode),this._isErasing=!1)},u.default.RendererGL.prototype.strokeWeight=function(e){this.curStrokeWeight!==e&&(this.pointSize=e,this.curStrokeWeight=e)},u.default.RendererGL.prototype._getPixel=function(e,t){var r;return r=new Uint8Array(4),this.drawingContext.readPixels(e,t,1,1,this.drawingContext.RGBA,this.drawingContext.UNSIGNED_BYTE,r),[r[0],r[1],r[2],r[3]]},u.default.RendererGL.prototype.loadPixels=function(){var e=this._pixelsState;if(!0===this._pInst._glAttributes.preserveDrawingBuffer){var t=e.pixels,r=this.GL.drawingBufferWidth*this.GL.drawingBufferHeight*4;t instanceof Uint8Array&&t.length===r||(t=new Uint8Array(r),this._pixelsState._setProperty("pixels",t));var i=this._pInst._pixelDensity;this.GL.readPixels(0,0,this.width*i,this.height*i,this.GL.RGBA,this.GL.UNSIGNED_BYTE,t)}else console.log("loadPixels only works in WebGL when preserveDrawingBuffer is true.")},u.default.RendererGL.prototype.geometryInHash=function(e){return void 0!==this.retainedMode.geometry[e]},u.default.RendererGL.prototype.resize=function(e,t){u.default.Renderer.prototype.resize.call(this,e,t),this.GL.viewport(0,0,this.GL.drawingBufferWidth,this.GL.drawingBufferHeight),this._viewport=this.GL.getParameter(this.GL.VIEWPORT),this._curCamera._resize();var r=this._pixelsState;void 0!==r.pixels&&r._setProperty("pixels",new Uint8Array(this.GL.drawingBufferWidth*this.GL.drawingBufferHeight*4))},u.default.RendererGL.prototype.clear=function(){var e=(arguments.length<=0?void 0:arguments[0])||0,t=(arguments.length<=1?void 0:arguments[1])||0,r=(arguments.length<=2?void 0:arguments[2])||0,i=(arguments.length<=3?void 0:arguments[3])||0;this.GL.clearColor(e,t,r,i),this.GL.clear(this.GL.COLOR_BUFFER_BIT|this.GL.DEPTH_BUFFER_BIT)},u.default.RendererGL.prototype.applyMatrix=function(e,t,r,i,n,o){16===arguments.length?u.default.Matrix.prototype.apply.apply(this.uMVMatrix,arguments):this.uMVMatrix.apply([e,t,0,0,r,i,0,0,0,0,1,0,n,o,0,1])},u.default.RendererGL.prototype.translate=function(e,t,r){return e instanceof u.default.Vector&&(r=e.z,t=e.y,e=e.x),this.uMVMatrix.translate([e,t,r]),this},u.default.RendererGL.prototype.scale=function(e,t,r){return this.uMVMatrix.scale(e,t,r),this},u.default.RendererGL.prototype.rotate=function(e,t){return void 0===t?this.rotateZ(e):(u.default.Matrix.prototype.rotate.apply(this.uMVMatrix,arguments),this)},u.default.RendererGL.prototype.rotateX=function(e){return this.rotate(e,1,0,0),this},u.default.RendererGL.prototype.rotateY=function(e){return this.rotate(e,0,1,0),this},u.default.RendererGL.prototype.rotateZ=function(e){return this.rotate(e,0,0,1),this},u.default.RendererGL.prototype.push=function(){var e=u.default.Renderer.prototype.push.apply(this),t=e.properties;return t.uMVMatrix=this.uMVMatrix.copy(),t.uPMatrix=this.uPMatrix.copy(),t._curCamera=this._curCamera,this._curCamera=this._curCamera.copy(),t.ambientLightColors=this.ambientLightColors.slice(),t.specularColors=this.specularColors.slice(),t.directionalLightDirections=this.directionalLightDirections.slice(),t.directionalLightDiffuseColors=this.directionalLightDiffuseColors.slice(),t.directionalLightSpecularColors=this.directionalLightSpecularColors.slice(),t.pointLightPositions=this.pointLightPositions.slice(),t.pointLightDiffuseColors=this.pointLightDiffuseColors.slice(),t.pointLightSpecularColors=this.pointLightSpecularColors.slice(),t.spotLightPositions=this.spotLightPositions.slice(),t.spotLightDirections=this.spotLightDirections.slice(),t.spotLightDiffuseColors=this.spotLightDiffuseColors.slice(),t.spotLightSpecularColors=this.spotLightSpecularColors.slice(),t.spotLightAngle=this.spotLightAngle.slice(),t.spotLightConc=this.spotLightConc.slice(),t.userFillShader=this.userFillShader,t.userStrokeShader=this.userStrokeShader,t.userPointShader=this.userPointShader,t.pointSize=this.pointSize,t.curStrokeWeight=this.curStrokeWeight,t.curStrokeColor=this.curStrokeColor,t.curFillColor=this.curFillColor,t._useSpecularMaterial=this._useSpecularMaterial,t._useEmissiveMaterial=this._useEmissiveMaterial,t._useShininess=this._useShininess,t.constantAttenuation=this.constantAttenuation,t.linearAttenuation=this.linearAttenuation,t.quadraticAttenuation=this.quadraticAttenuation,t._enableLighting=this._enableLighting,t._useNormalMaterial=this._useNormalMaterial,t._tex=this._tex,t.drawMode=this.drawMode,e},u.default.RendererGL.prototype.resetMatrix=function(){return this.uMVMatrix=u.default.Matrix.identity(this._pInst),this},u.default.RendererGL.prototype._getImmediateStrokeShader=function(){var e=this.userStrokeShader;return e&&e.isStrokeShader()?e:this._getLineShader()},u.default.RendererGL.prototype._getRetainedStrokeShader=u.default.RendererGL.prototype._getImmediateStrokeShader,u.default.RendererGL.prototype._getImmediateFillShader=function(){var e=this.userFillShader;if(this._useNormalMaterial&&(!e||!e.isNormalShader()))return this._getNormalShader();if(this._enableLighting){if(!e||!e.isLightShader())return this._getLightShader()}else if(this._tex){if(!e||!e.isTextureShader())return this._getLightShader()}else if(!e)return this._getImmediateModeShader();return e},u.default.RendererGL.prototype._getRetainedFillShader=function(){if(this._useNormalMaterial)return this._getNormalShader();var e=this.userFillShader;if(this._enableLighting){if(!e||!e.isLightShader())return this._getLightShader()}else if(this._tex){if(!e||!e.isTextureShader())return this._getLightShader()}else if(!e)return this._getColorShader();return e},u.default.RendererGL.prototype._getImmediatePointShader=function(){var e=this.userPointShader;return e&&e.isPointShader()?e:this._getPointShader()},u.default.RendererGL.prototype._getRetainedLineShader=u.default.RendererGL.prototype._getImmediateLineShader,u.default.RendererGL.prototype._getLightShader=function(){return this._defaultLightShader||(this._pInst._glAttributes.perPixelLighting?this._defaultLightShader=new u.default.Shader(this,c.phongVert,c.phongFrag):this._defaultLightShader=new u.default.Shader(this,c.lightVert,c.lightTextureFrag)),this._defaultLightShader},u.default.RendererGL.prototype._getImmediateModeShader=function(){return this._defaultImmediateModeShader||(this._defaultImmediateModeShader=new u.default.Shader(this,c.immediateVert,c.vertexColorFrag)),this._defaultImmediateModeShader},u.default.RendererGL.prototype._getNormalShader=function(){return this._defaultNormalShader||(this._defaultNormalShader=new u.default.Shader(this,c.normalVert,c.normalFrag)),this._defaultNormalShader},u.default.RendererGL.prototype._getColorShader=function(){return this._defaultColorShader||(this._defaultColorShader=new u.default.Shader(this,c.normalVert,c.basicFrag)),this._defaultColorShader},u.default.RendererGL.prototype._getPointShader=function(){return this._defaultPointShader||(this._defaultPointShader=new u.default.Shader(this,c.pointVert,c.pointFrag)),this._defaultPointShader},u.default.RendererGL.prototype._getLineShader=function(){return this._defaultLineShader||(this._defaultLineShader=new u.default.Shader(this,c.lineVert,c.lineFrag)),this._defaultLineShader},u.default.RendererGL.prototype._getFontShader=function(){return this._defaultFontShader||(this.GL.getExtension("OES_standard_derivatives"),this._defaultFontShader=new u.default.Shader(this,c.fontVert,c.fontFrag)),this._defaultFontShader},u.default.RendererGL.prototype._getEmptyTexture=function(){if(!this._emptyTexture){var e=new u.default.Image(1,1);e.set(0,0,255),this._emptyTexture=new u.default.Texture(this,e)}return this._emptyTexture},u.default.RendererGL.prototype.getTexture=function(e){var t=this.textures,r=!0,i=!1,n=void 0;try{for(var o,a=t[Symbol.iterator]();!(r=(o=a.next()).done);r=!0){var s=o.value;if(s.src===e)return s}}catch(e){i=!0,n=e}finally{try{r||null==a.return||a.return()}finally{if(i)throw n}}var l=new u.default.Texture(this,e);return t.push(l),l},u.default.RendererGL.prototype._setStrokeUniforms=function(e){e.bindShader(),e.setUniform("uMaterialColor",this.curStrokeColor),e.setUniform("uStrokeWeight",this.curStrokeWeight)},u.default.RendererGL.prototype._setFillUniforms=function(e){e.bindShader(),e.setUniform("uMaterialColor",this.curFillColor),e.setUniform("isTexture",!!this._tex),this._tex&&e.setUniform("uSampler",this._tex),e.setUniform("uTint",this._tint),e.setUniform("uSpecular",this._useSpecularMaterial),e.setUniform("uEmissive",this._useEmissiveMaterial),e.setUniform("uShininess",this._useShininess),e.setUniform("uUseLighting",this._enableLighting);var t=this.pointLightDiffuseColors.length/3;e.setUniform("uPointLightCount",t),e.setUniform("uPointLightLocation",this.pointLightPositions),e.setUniform("uPointLightDiffuseColors",this.pointLightDiffuseColors),e.setUniform("uPointLightSpecularColors",this.pointLightSpecularColors);var r=this.directionalLightDiffuseColors.length/3;e.setUniform("uDirectionalLightCount",r),e.setUniform("uLightingDirection",this.directionalLightDirections),e.setUniform("uDirectionalDiffuseColors",this.directionalLightDiffuseColors),e.setUniform("uDirectionalSpecularColors",this.directionalLightSpecularColors);var i=this.ambientLightColors.length/3;e.setUniform("uAmbientLightCount",i),e.setUniform("uAmbientColor",this.ambientLightColors);var n=this.spotLightDiffuseColors.length/3;e.setUniform("uSpotLightCount",n),e.setUniform("uSpotLightAngle",this.spotLightAngle),e.setUniform("uSpotLightConc",this.spotLightConc),e.setUniform("uSpotLightDiffuseColors",this.spotLightDiffuseColors),e.setUniform("uSpotLightSpecularColors",this.spotLightSpecularColors),e.setUniform("uSpotLightLocation",this.spotLightPositions),e.setUniform("uSpotLightDirection",this.spotLightDirections),e.setUniform("uConstantAttenuation",this.constantAttenuation),e.setUniform("uLinearAttenuation",this.linearAttenuation),e.setUniform("uQuadraticAttenuation",this.quadraticAttenuation),e.bindTextures()},u.default.RendererGL.prototype._setPointUniforms=function(e){e.bindShader(),e.setUniform("uMaterialColor",this.curStrokeColor),e.setUniform("uPointSize",this.pointSize)},u.default.RendererGL.prototype._bindBuffer=function(e,t,r,i,n){if(t=t||this.GL.ARRAY_BUFFER,this.GL.bindBuffer(t,e),void 0!==r){var o=new(i||Float32Array)(r);this.GL.bufferData(t,o,n||this.GL.STATIC_DRAW)}},u.default.RendererGL.prototype._arraysEqual=function(e,t){var r=e.length;if(r!==t.length)return!1;for(var i=0;i>7,127&f,c>>7,127&c);for(var d=0;d>7,127&p,0,0)}}return{cellImageInfo:l,dimOffset:o,dimImageInfo:n}}return(t=this.glyphInfos[e.index]={glyph:e,uGlyphRect:[i.x1,-i.y1,i.x2,-i.y2],strokeImageInfo:U,strokes:d,colInfo:G(m,this.colDimImageInfos,this.colCellImageInfos),rowInfo:G(p,this.rowDimImageInfos,this.rowCellImageInfos)}).uGridOffset=[t.colInfo.dimOffset,t.rowInfo.dimOffset],t}}var z=Math.sqrt(3);j.default.RendererGL.prototype._renderText=function(e,t,r,i,n){if(this._textFont&&"string"!=typeof this._textFont){if(!(n<=i)&&this._doFill){if(!this._isOpenType())return console.log("WEBGL: only Opentype (.otf) and Truetype (.ttf) fonts are supported"),e;e.push();var o=this._doStroke,a=this.drawMode;this._doStroke=!1,this.drawMode=D.TEXTURE;var s=this._textFont.font,l=this._textFont._fontInfo;l=l||(this._textFont._fontInfo=new A(s));var u=this._textFont._handleAlignment(this,t,r,i),h=this._textSize/s.unitsPerEm;this.translate(u.x,u.y,0),this.scale(h,h,1);var c=this.GL,f=!this._defaultFontShader,d=this._getFontShader();d.init(),d.bindShader(),f&&(d.setUniform("uGridImageSize",[64,64]),d.setUniform("uCellsImageSize",[64,64]),d.setUniform("uStrokeImageSize",[64,64]),d.setUniform("uGridSize",[9,9])),this._applyColorBlend(this.curFillColor);var p=this.retainedMode.geometry.glyph;if(!p){var m=this._textGeom=new j.default.Geometry(1,1,function(){for(var e=0;e<=1;e++)for(var t=0;t<=1;t++)this.vertices.push(new j.default.Vector(t,e,0)),this.uvs.push(t,e)});m.computeFaces().computeNormals(),p=this.createBuffers("glyph",m)}var g=!0,v=!1,y=void 0;try{for(var b,_=this.retainedMode.buffers.text[Symbol.iterator]();!(g=(b=_.next()).done);g=!0){b.value._prepareBuffer(p,d)}}catch(e){v=!0,y=e}finally{try{g||null==_.return||_.return()}finally{if(v)throw y}}this._bindBuffer(p.indexBuffer,c.ELEMENT_ARRAY_BUFFER),d.setUniform("uMaterialColor",this.curFillColor);try{var x=0,w=null,S=s.stringToGlyphs(t),M=!0,E=!1,T=void 0;try{for(var C,P=S[Symbol.iterator]();!(M=(C=P.next()).done);M=!0){var L=C.value;w&&(x+=s.getKerningValue(w,L));var k=l.getGlyphInfo(L);if(k.uGlyphRect){var R=k.rowInfo,O=k.colInfo;d.setUniform("uSamplerStrokes",k.strokeImageInfo.imageData),d.setUniform("uSamplerRowStrokes",R.cellImageInfo.imageData),d.setUniform("uSamplerRows",R.dimImageInfo.imageData),d.setUniform("uSamplerColStrokes",O.cellImageInfo.imageData),d.setUniform("uSamplerCols",O.dimImageInfo.imageData),d.setUniform("uGridOffset",k.uGridOffset),d.setUniform("uGlyphRect",k.uGlyphRect),d.setUniform("uGlyphOffset",x),d.bindTextures(),c.drawElements(c.TRIANGLES,6,this.GL.UNSIGNED_SHORT,0)}x+=L.advanceWidth,w=L}}catch(e){E=!0,T=e}finally{try{M||null==P.return||P.return()}finally{if(E)throw T}}}finally{d.unbindShader(),this._doStroke=o,this.drawMode=a,e.pop()}return e}}else console.log("WEBGL: you must load and set a font before drawing text. See `loadFont` and `textFont` for more details.")}},{"../core/constants":42,"../core/main":49,"./p5.RendererGL.Retained":102,"./p5.Shader":104}],107:[function(e,t,r){t.exports={fes:{autoplay:"The media that tried to play (with '{{src}}') wasn't allowed to by this browser, most likely due to the browser's autoplay policy. Check out {{link}} for more information about why.",fileLoadError:{bytes:"It looks like there was a problem loading your file. {{suggestion}}",font:"It looks like there was a problem loading your font. {{suggestion}}",gif:"There was some trouble loading your GIF. Make sure that your GIF is using 87a or 89a encoding.",image:"It looks like there was a problem loading your image. {{suggestion}}",json:"It looks like there was a problem loading your JSON file. {{suggestion}}",large:"If your large file isn't fetched successfully, we recommend splitting the file into smaller segments and fetching those.",strings:"It looks like there was a problem loading your text file. {{suggestion}}",suggestion:"Try checking if the file path ({{filePath}}) is correct, hosting the file online, or running a local server. (More info at {{link}})",table:"It looks like there was a problem loading your table file. {{suggestion}}",xml:"It looks like there was a problem loading your XML file. {{suggestion}}"},misusedTopLevel:"Did you just try to use p5.js's {{symbolName}} {{symbolType}}? If so, you may want to move it into your sketch's setup() function.\n\nFor more details, see: {{link}}",pre:"🌸 p5.js says: {{message}}",welcome:"Welcome! This is your friendly debugger. To turn me off, switch to using p5.min.js."}}},{}],108:[function(e,t,r){t.exports={fes:{autoplay:"Su browser impidío un medio tocar (de '{{src}}'), posiblemente porque las reglas de autoplay. Para aprender más, visite {{link}}.",fileLoadError:{bytes:"",font:"",gif:"",image:"",json:"",large:"",strings:"",suggestion:"",table:"",xml:""},misusedTopLevel:"",pre:"🌸 p5.js dice: {{message}}",welcome:""}}},{}],109:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i=o(e("./en/translation")),n=o(e("./es/translation"));function o(e){return e&&e.__esModule?e:{default:e}}var a={en:{translation:i.default},es:{translation:n.default}};r.default=a},{"./en/translation":107,"./es/translation":108}]},{},[37])(37)}); ================================================ FILE: docs/examples/pyodide/sketch_002/target/target_sketch.js ================================================ const wrapperContent = ` class PythonFunctions: pass setattr(PythonFunctions, 'map', map) setattr(PythonFunctions, 'filter', filter) setattr(PythonFunctions, 'set', set) _P5_INSTANCE = None _CTX_MIDDLE = None _DEFAULT_FILL = None _DEFAULT_LEADMULT = None _DEFAULT_STROKE = None _DEFAULT_TEXT_FILL = None ADD = None ALT = None ARROW = None AUDIO = None AUTO = None AXES = None BACKSPACE = None BASELINE = None BEVEL = None BEZIER = None BLEND = None BLUR = None BOLD = None BOLDITALIC = None BOTTOM = None BURN = None CENTER = None CHORD = None CLAMP = None CLOSE = None CONTROL = None CORNER = None CORNERS = None CROSS = None CURVE = None DARKEST = None DEG_TO_RAD = None DEGREES = None DELETE = None DIFFERENCE = None DILATE = None DODGE = None DOWN_ARROW = None ENTER = None ERODE = None ESCAPE = None EXCLUSION = None FILL = None GRAY = None GRID = None HALF_PI = None HAND = None HARD_LIGHT = None HSB = None HSL = None IMAGE = None IMMEDIATE = None INVERT = None ITALIC = None LANDSCAPE = None LEFT = None LEFT_ARROW = None LIGHTEST = None LINE_LOOP = None LINE_STRIP = None LINEAR = None LINES = None MIRROR = None MITER = None MOVE = None MULTIPLY = None NEAREST = None NORMAL = None OPAQUE = None OPEN = None OPTION = None OVERLAY = None PI = None PIE = None POINTS = None PORTRAIT = None POSTERIZE = None PROJECT = None QUAD_STRIP = None QUADRATIC = None QUADS = None QUARTER_PI = None RAD_TO_DEG = None RADIANS = None RADIUS = None REPEAT = None REPLACE = None RETURN = None RGB = None RIGHT = None RIGHT_ARROW = None ROUND = None SCREEN = None SHIFT = None SOFT_LIGHT = None SQUARE = None STROKE = None SUBTRACT = None TAB = None TAU = None TEXT = None TEXTURE = None THRESHOLD = None TOP = None TRIANGLE_FAN = None TRIANGLE_STRIP = None TRIANGLES = None TWO_PI = None UP_ARROW = None VIDEO = None WAIT = None WEBGL = None P2D = None PI = None frameCount = None focused = None displayWidth = None displayHeight = None windowWidth = None windowHeight = None width = None height = None deviceOrientation = None accelerationX = None accelerationY = None accelerationZ = None pAccelerationX = None pAccelerationY = None pAccelerationZ = None rotationX = None rotationY = None rotationZ = None pRotationX = None pRotationY = None pRotationZ = None turnAxis = None keyIsPressed = None key = None keyCode = None mouseX = None mouseY = None pmouseX = None pmouseY = None winMouseX = None winMouseY = None pwinMouseX = None pwinMouseY = None mouseButton = None mouseIsPressed = None touches = None pixels = None def alpha(*args): return _P5_INSTANCE.alpha(*args) def blue(*args): return _P5_INSTANCE.blue(*args) def brightness(*args): return _P5_INSTANCE.brightness(*args) def color(*args): return _P5_INSTANCE.color(*args) def green(*args): return _P5_INSTANCE.green(*args) def hue(*args): return _P5_INSTANCE.hue(*args) def lerpColor(*args): return _P5_INSTANCE.lerpColor(*args) def lightness(*args): return _P5_INSTANCE.lightness(*args) def red(*args): return _P5_INSTANCE.red(*args) def saturation(*args): return _P5_INSTANCE.saturation(*args) def background(*args): return _P5_INSTANCE.background(*args) def clear(*args): p5_clear = _P5_INSTANCE.clear(*args) return p5_clear def erase(*args): return _P5_INSTANCE.erase(*args) def noErase(*args): return _P5_INSTANCE.noErase(*args) def colorMode(*args): return _P5_INSTANCE.colorMode(*args) def fill(*args): return _P5_INSTANCE.fill(*args) def noFill(*args): return _P5_INSTANCE.noFill(*args) def noStroke(*args): return _P5_INSTANCE.noStroke(*args) def stroke(*args): return _P5_INSTANCE.stroke(*args) def arc(*args): return _P5_INSTANCE.arc(*args) def ellipse(*args): return _P5_INSTANCE.ellipse(*args) def circle(*args): return _P5_INSTANCE.circle(*args) def line(*args): return _P5_INSTANCE.line(*args) def point(*args): return _P5_INSTANCE.point(*args) def quad(*args): return _P5_INSTANCE.quad(*args) def rect(*args): return _P5_INSTANCE.rect(*args) def square(*args): return _P5_INSTANCE.square(*args) def triangle(*args): return _P5_INSTANCE.triangle(*args) def plane(*args): return _P5_INSTANCE.plane(*args) def box(*args): return _P5_INSTANCE.box(*args) def sphere(*args): return _P5_INSTANCE.sphere(*args) def cylinder(*args): return _P5_INSTANCE.cylinder(*args) def cone(*args): return _P5_INSTANCE.cone(*args) def ellipsoid(*args): return _P5_INSTANCE.ellipsoid(*args) def torus(*args): return _P5_INSTANCE.torus(*args) def loadModel(*args): return _P5_INSTANCE.loadModel(*args) def model(*args): return _P5_INSTANCE.model(*args) def ellipseMode(*args): return _P5_INSTANCE.ellipseMode(*args) def noSmooth(*args): return _P5_INSTANCE.noSmooth(*args) def rectMode(*args): return _P5_INSTANCE.rectMode(*args) def smooth(*args): return _P5_INSTANCE.smooth(*args) def strokeCap(*args): return _P5_INSTANCE.strokeCap(*args) def strokeJoin(*args): return _P5_INSTANCE.strokeJoin(*args) def strokeWeight(*args): return _P5_INSTANCE.strokeWeight(*args) def bezier(*args): return _P5_INSTANCE.bezier(*args) def bezierDetail(*args): return _P5_INSTANCE.bezierDetail(*args) def bezierPoint(*args): return _P5_INSTANCE.bezierPoint(*args) def bezierTangent(*args): return _P5_INSTANCE.bezierTangent(*args) def curve(*args): return _P5_INSTANCE.curve(*args) def curveDetail(*args): return _P5_INSTANCE.curveDetail(*args) def curveTightness(*args): return _P5_INSTANCE.curveTightness(*args) def curvePoint(*args): return _P5_INSTANCE.curvePoint(*args) def curveTangent(*args): return _P5_INSTANCE.curveTangent(*args) def beginContour(*args): return _P5_INSTANCE.beginContour(*args) def beginShape(*args): return _P5_INSTANCE.beginShape(*args) def bezierVertex(*args): return _P5_INSTANCE.bezierVertex(*args) def curveVertex(*args): return _P5_INSTANCE.curveVertex(*args) def endContour(*args): return _P5_INSTANCE.endContour(*args) def endShape(*args): return _P5_INSTANCE.endShape(*args) def quadraticVertex(*args): return _P5_INSTANCE.quadraticVertex(*args) def vertex(*args): return _P5_INSTANCE.vertex(*args) def cursor(*args): return _P5_INSTANCE.cursor(*args) def frameRate(*args): return _P5_INSTANCE.frameRate(*args) def noCursor(*args): return _P5_INSTANCE.noCursor(*args) def fullscreen(*args): return _P5_INSTANCE.fullscreen(*args) def pixelDensity(*args): return _P5_INSTANCE.pixelDensity(*args) def displayDensity(*args): return _P5_INSTANCE.displayDensity(*args) def getURL(*args): return _P5_INSTANCE.getURL(*args) def getURLPath(*args): return _P5_INSTANCE.getURLPath(*args) def getURLParams(*args): return _P5_INSTANCE.getURLParams(*args) def remove(*args): return _P5_INSTANCE.remove(*args) def noLoop(*args): return _P5_INSTANCE.noLoop(*args) def loop(*args): return _P5_INSTANCE.loop(*args) def push(*args): return _P5_INSTANCE.push(*args) def redraw(*args): return _P5_INSTANCE.redraw(*args) def resizeCanvas(*args): return _P5_INSTANCE.resizeCanvas(*args) def noCanvas(*args): return _P5_INSTANCE.noCanvas(*args) def createGraphics(*args): return _P5_INSTANCE.createGraphics(*args) def blendMode(*args): return _P5_INSTANCE.blendMode(*args) def setAttributes(*args): return _P5_INSTANCE.setAttributes(*args) def applyMatrix(*args): return _P5_INSTANCE.applyMatrix(*args) def resetMatrix(*args): return _P5_INSTANCE.resetMatrix(*args) def rotate(*args): return _P5_INSTANCE.rotate(*args) def rotateX(*args): return _P5_INSTANCE.rotateX(*args) def rotateY(*args): return _P5_INSTANCE.rotateY(*args) def rotateZ(*args): return _P5_INSTANCE.rotateZ(*args) def scale(*args): return _P5_INSTANCE.scale(*args) def shearX(*args): return _P5_INSTANCE.shearX(*args) def shearY(*args): return _P5_INSTANCE.shearY(*args) def translate(*args): return _P5_INSTANCE.translate(*args) def createStringDict(*args): return _P5_INSTANCE.createStringDict(*args) def createNumberDict(*args): return _P5_INSTANCE.createNumberDict(*args) def append(*args): return _P5_INSTANCE.append(*args) def arrayCopy(*args): return _P5_INSTANCE.arrayCopy(*args) def concat(*args): return _P5_INSTANCE.concat(*args) def reverse(*args): return _P5_INSTANCE.reverse(*args) def shorten(*args): return _P5_INSTANCE.shorten(*args) def shuffle(*args): return _P5_INSTANCE.shuffle(*args) def sort(*args): return _P5_INSTANCE.sort(*args) def splice(*args): return _P5_INSTANCE.splice(*args) def subset(*args): return _P5_INSTANCE.subset(*args) def float(*args): return _P5_INSTANCE.float(*args) def int(*args): return _P5_INSTANCE.int(*args) def str(*args): return _P5_INSTANCE.str(*args) def boolean(*args): return _P5_INSTANCE.boolean(*args) def byte(*args): return _P5_INSTANCE.byte(*args) def char(*args): return _P5_INSTANCE.char(*args) def unchar(*args): return _P5_INSTANCE.unchar(*args) def hex(*args): return _P5_INSTANCE.hex(*args) def unhex(*args): return _P5_INSTANCE.unhex(*args) def join(*args): return _P5_INSTANCE.join(*args) def match(*args): return _P5_INSTANCE.match(*args) def matchAll(*args): return _P5_INSTANCE.matchAll(*args) def nf(*args): return _P5_INSTANCE.nf(*args) def nfc(*args): return _P5_INSTANCE.nfc(*args) def nfp(*args): return _P5_INSTANCE.nfp(*args) def nfs(*args): return _P5_INSTANCE.nfs(*args) def split(*args): return _P5_INSTANCE.split(*args) def splitTokens(*args): return _P5_INSTANCE.splitTokens(*args) def trim(*args): return _P5_INSTANCE.trim(*args) def setMoveThreshold(*args): return _P5_INSTANCE.setMoveThreshold(*args) def setShakeThreshold(*args): return _P5_INSTANCE.setShakeThreshold(*args) def keyIsDown(*args): return _P5_INSTANCE.keyIsDown(*args) def createImage(*args): return _P5_INSTANCE.createImage(*args) def saveCanvas(*args): return _P5_INSTANCE.saveCanvas(*args) def saveFrames(*args): return _P5_INSTANCE.saveFrames(*args) def loadImage(*args): return _P5_INSTANCE.loadImage(*args) def image(*args): return _P5_INSTANCE.image(*args) def tint(*args): return _P5_INSTANCE.tint(*args) def noTint(*args): return _P5_INSTANCE.noTint(*args) def imageMode(*args): return _P5_INSTANCE.imageMode(*args) def blend(*args): return _P5_INSTANCE.blend(*args) def copy(*args): return _P5_INSTANCE.copy(*args) def filter(*args): if len(args) > 1 and (args[0] is None or callable(args[0])): return PythonFunctions.filter(*args) else: return _P5_INSTANCE.filter(*args) def get(*args): return _P5_INSTANCE.get(*args) def loadPixels(*args): return _P5_INSTANCE.loadPixels(*args) def set(*args): if len(args) <= 1: return PythonFunctions.set(*args) else: return _P5_INSTANCE.set(*args) def updatePixels(*args): return _P5_INSTANCE.updatePixels(*args) def loadJSON(*args): return _P5_INSTANCE.loadJSON(*args) def loadStrings(*args): return _P5_INSTANCE.loadStrings(*args) def loadTable(*args): return _P5_INSTANCE.loadTable(*args) def loadXML(*args): return _P5_INSTANCE.loadXML(*args) def loadBytes(*args): return _P5_INSTANCE.loadBytes(*args) def httpGet(*args): return _P5_INSTANCE.httpGet(*args) def httpPost(*args): return _P5_INSTANCE.httpPost(*args) def httpDo(*args): return _P5_INSTANCE.httpDo(*args) def createWriter(*args): return _P5_INSTANCE.createWriter(*args) def save(*args): return _P5_INSTANCE.save(*args) def saveJSON(*args): return _P5_INSTANCE.saveJSON(*args) def saveStrings(*args): return _P5_INSTANCE.saveStrings(*args) def saveTable(*args): return _P5_INSTANCE.saveTable(*args) def day(*args): return _P5_INSTANCE.day(*args) def hour(*args): return _P5_INSTANCE.hour(*args) def minute(*args): return _P5_INSTANCE.minute(*args) def millis(*args): return _P5_INSTANCE.millis(*args) def month(*args): return _P5_INSTANCE.month(*args) def second(*args): return _P5_INSTANCE.second(*args) def year(*args): return _P5_INSTANCE.year(*args) def createVector(*args): return _P5_INSTANCE.createVector(*args) def abs(*args): return _P5_INSTANCE.abs(*args) def ceil(*args): return _P5_INSTANCE.ceil(*args) def constrain(*args): return _P5_INSTANCE.constrain(*args) def dist(*args): return _P5_INSTANCE.dist(*args) def exp(*args): return _P5_INSTANCE.exp(*args) def floor(*args): return _P5_INSTANCE.floor(*args) def lerp(*args): return _P5_INSTANCE.lerp(*args) def log(*args): return _P5_INSTANCE.log(*args) def mag(*args): return _P5_INSTANCE.mag(*args) def map(*args): if len(args) > 1 and callable(args[0]): return PythonFunctions.map(*args) else: return _P5_INSTANCE.map(*args) def max(*args): return _P5_INSTANCE.max(*args) def min(*args): return _P5_INSTANCE.min(*args) def norm(*args): return _P5_INSTANCE.norm(*args) def pow(*args): return _P5_INSTANCE.pow(*args) def round(*args): return _P5_INSTANCE.round(*args) def sq(*args): return _P5_INSTANCE.sq(*args) def sqrt(*args): return _P5_INSTANCE.sqrt(*args) def noise(*args): return _P5_INSTANCE.noise(*args) def noiseDetail(*args): return _P5_INSTANCE.noiseDetail(*args) def noiseSeed(*args): return _P5_INSTANCE.noiseSeed(*args) def randomSeed(*args): return _P5_INSTANCE.randomSeed(*args) def random(*args): return _P5_INSTANCE.random(*args) def randomGaussian(*args): return _P5_INSTANCE.randomGaussian(*args) def acos(*args): return _P5_INSTANCE.acos(*args) def asin(*args): return _P5_INSTANCE.asin(*args) def atan(*args): return _P5_INSTANCE.atan(*args) def atan2(*args): return _P5_INSTANCE.atan2(*args) def cos(*args): return _P5_INSTANCE.cos(*args) def sin(*args): return _P5_INSTANCE.sin(*args) def tan(*args): return _P5_INSTANCE.tan(*args) def degrees(*args): return _P5_INSTANCE.degrees(*args) def radians(*args): return _P5_INSTANCE.radians(*args) def angleMode(*args): return _P5_INSTANCE.angleMode(*args) def textAlign(*args): return _P5_INSTANCE.textAlign(*args) def textLeading(*args): return _P5_INSTANCE.textLeading(*args) def textSize(*args): return _P5_INSTANCE.textSize(*args) def textStyle(*args): return _P5_INSTANCE.textStyle(*args) def textWidth(*args): return _P5_INSTANCE.textWidth(*args) def textAscent(*args): return _P5_INSTANCE.textAscent(*args) def textDescent(*args): return _P5_INSTANCE.textDescent(*args) def loadFont(*args): return _P5_INSTANCE.loadFont(*args) def text(*args): return _P5_INSTANCE.text(*args) def textFont(*args): return _P5_INSTANCE.textFont(*args) def orbitControl(*args): return _P5_INSTANCE.orbitControl(*args) def debugMode(*args): return _P5_INSTANCE.debugMode(*args) def noDebugMode(*args): return _P5_INSTANCE.noDebugMode(*args) def ambientLight(*args): return _P5_INSTANCE.ambientLight(*args) def directionalLight(*args): return _P5_INSTANCE.directionalLight(*args) def pointLight(*args): return _P5_INSTANCE.pointLight(*args) def lights(*args): return _P5_INSTANCE.lights(*args) def loadShader(*args): return _P5_INSTANCE.loadShader(*args) def createShader(*args): return _P5_INSTANCE.createShader(*args) def shader(*args): return _P5_INSTANCE.shader(*args) def resetShader(*args): return _P5_INSTANCE.resetShader(*args) def normalMaterial(*args): return _P5_INSTANCE.normalMaterial(*args) def texture(*args): return _P5_INSTANCE.texture(*args) def textureMode(*args): return _P5_INSTANCE.textureMode(*args) def textureWrap(*args): return _P5_INSTANCE.textureWrap(*args) def ambientMaterial(*args): return _P5_INSTANCE.ambientMaterial(*args) def specularMaterial(*args): return _P5_INSTANCE.specularMaterial(*args) def shininess(*args): return _P5_INSTANCE.shininess(*args) def camera(*args): return _P5_INSTANCE.camera(*args) def perspective(*args): return _P5_INSTANCE.perspective(*args) def ortho(*args): return _P5_INSTANCE.ortho(*args) def createCamera(*args): return _P5_INSTANCE.createCamera(*args) def setCamera(*args): return _P5_INSTANCE.setCamera(*args) def select(*args): return _P5_INSTANCE.select(*args) def selectAll(*args): return _P5_INSTANCE.selectAll(*args) def removeElements(*args): return _P5_INSTANCE.removeElements(*args) def changed(*args): return _P5_INSTANCE.changed(*args) def input(*args): return _P5_INSTANCE.input(*args) def createDiv(*args): return _P5_INSTANCE.createDiv(*args) def createP(*args): return _P5_INSTANCE.createP(*args) def createSpan(*args): return _P5_INSTANCE.createSpan(*args) def createImg(*args): return _P5_INSTANCE.createImg(*args) def createA(*args): return _P5_INSTANCE.createA(*args) def createSlider(*args): return _P5_INSTANCE.createSlider(*args) def createButton(*args): return _P5_INSTANCE.createButton(*args) def createCheckbox(*args): return _P5_INSTANCE.createCheckbox(*args) def createSelect(*args): return _P5_INSTANCE.createSelect(*args) def createRadio(*args): return _P5_INSTANCE.createRadio(*args) def createColorPicker(*args): return _P5_INSTANCE.createColorPicker(*args) def createInput(*args): return _P5_INSTANCE.createInput(*args) def createFileInput(*args): return _P5_INSTANCE.createFileInput(*args) def createVideo(*args): return _P5_INSTANCE.createVideo(*args) def createAudio(*args): return _P5_INSTANCE.createAudio(*args) def createCapture(*args): return _P5_INSTANCE.createCapture(*args) def createElement(*args): return _P5_INSTANCE.createElement(*args) def createCanvas(*args): canvas = _P5_INSTANCE.createCanvas(*args) global width, height width = _P5_INSTANCE.width height = _P5_INSTANCE.height return canvas def __deviceMoved(e): try: _bind_event_function(deviceMoved, e) except NameError: pass def __deviceTurned(e): try: _bind_event_function(deviceTurned, e) except NameError: pass def __deviceShaken(e): try: _bind_event_function(deviceShaken, e) except NameError: pass def __touchEnded(e): try: _bind_event_function(deviceShaken, e) except NameError: pass def __touchStarted(e): try: _bind_event_function(touchStarted, e) except NameError: pass def __windowResized(e): try: _bind_event_function(windowResized, e) except NameError: pass def __touchMoved(e): try: _bind_event_function(touchMoved, e) except NameError: pass def __mouseMoved(e): try: _bind_event_function(mouseMoved, e) except NameError: pass def __mouseDragged(e): try: _bind_event_function(mouseDragged, e) except NameError: pass def __mousePressed(e): try: _bind_event_function(mousePressed, e) except NameError: pass def __mouseReleased(e): try: _bind_event_function(mouseReleased, e) except NameError: pass def __mouseClicked(e): try: _bind_event_function(mouseClicked, e) except NameError: pass def __doubleClicked(e): try: _bind_event_function(doubleClicked, e) except NameError: pass def __mouseWheel(e): try: _bind_event_function(mouseWheel, e) except NameError: pass def __keyPressed(e): try: _bind_event_function(keyPressed, e) except NameError: pass def __keyReleased(e): try: _bind_event_function(keyReleased, e) except NameError: pass def __keyTyped(e): try: _bind_event_function(keyTyped, e) except NameError: pass def __keyIsDown(e): try: _bind_event_function(keyIsDown, e) except NameError: pass def pop(*args): p5_pop = _P5_INSTANCE.pop(*args) return p5_pop # Processing Python or Java mode compatibility aliases size = createCanvas popMatrix = pop popStyle = pop pushMatrix = push pushStyle = push # PVector is a wrapper/helper class for p5.Vector objets # providing names similar to Processing Python or Java modes # but mostly keeping p5js functionality from numbers import Number class PVector: def __init__(self, x=0, y=0, z=0): self.__vector = createVector(x, y, z) self.add = self.__instance_add__ self.sub = self.__instance_sub__ self.mult = self.__instance_mult__ self.div = self.__instance_div__ self.cross = self.__instance_cross__ self.dist = self.__instance_dist__ self.dot = self.__instance_dot__ self.lerp = self.__instance_lerp__ @property def x(self): return self.__vector.x @x.setter def x(self, x): self.__vector.x = x @property def y(self): return self.__vector.y @y.setter def y(self, y): self.__vector.y = y @property def z(self): return self.__vector.z @z.setter def z(self, z): self.__vector.z = z def mag(self): return self.__vector.mag() def magSq(self): return self.__vector.magSq() def setMag(self, mag): self.__vector.setMag(mag) return self def normalize(self): self.__vector.normalize() return self def limit(self, max): self.__vector.limit(max) return self def heading(self): return self.__vector.heading() def rotate(self, angle): self.__vector.rotate(angle) return self def __instance_add__(self, *args): if len(args) == 1: return PVector.add(self, args[0], self) else: return PVector.add(self, PVector(*args), self) def __instance_sub__(self, *args): if len(args) == 1: return PVector.sub(self, args[0], self) else: return PVector.sub(self, PVector(*args), self) def __instance_mult__(self, o): return PVector.mult(self, o, self) def __instance_div__(self, f): return PVector.div(self, f, self) def __instance_cross__(self, o): return PVector.cross(self, o, self) def __instance_dist__(self, o): return PVector.dist(self, o) def __instance_dot__(self, *args): if len(args) == 1: v = args[0] else: v = args return self.x * v[0] + self.y * v[1] + self.z * v[2] def __instance_lerp__(self, *args): if len(args) == 2: return PVector.lerp(self, args[0], args[1], self) else: vx, vy, vz, f = args return PVector.lerp(self, PVector(vx, vy, vz), f, self) def get(self): return PVector(self.x, self.y, self.z) def copy(self): return PVector(self.x, self.y, self.z) def __getitem__(self, k): return getattr(self, ('x', 'y', 'z')[k]) def __setitem__(self, k, v): setattr(self, ('x', 'y', 'z')[k], v) def __copy__(self): return PVector(self.x, self.y, self.z) def __deepcopy__(self, memo): return PVector(self.x, self.y, self.z) def __repr__(self): # PROVISÓRIO return f'PVector({self.x}, {self.y}, {self.z})' def set(self, *args): """ Sets the x, y, and z component of the vector using two or three separate variables, the data from a p5.Vector, or the values from a float array. """ self.__vector.set(*args) @classmethod def add(cls, a, b, dest=None): if dest is None: return PVector(a.x + b[0], a.y + b[1], a.z + b[2]) dest.__vector.set(a.x + b[0], a.y + b[1], a.z + b[2]) return dest @classmethod def sub(cls, a, b, dest=None): if dest is None: return PVector(a.x - b[0], a.y - b[1], a.z - b[2]) dest.__vector.set(a.x - b[0], a.y - b[1], a.z - b[2]) return dest @classmethod def mult(cls, a, b, dest=None): if dest is None: return PVector(a.x * b, a.y * b, a.z * b) dest.__vector.set(a.x * b, a.y * b, a.z * b) return dest @classmethod def div(cls, a, b, dest=None): if dest is None: return PVector(a.x / b, a.y / b, a.z / b) dest.__vector.set(a.x / b, a.y / b, a.z / b) return dest @classmethod def dist(cls, a, b): return a.__vector.dist(b.__vector) @classmethod def dot(cls, a, b): return a.__vector.dot(b.__vector) def __add__(a, b): return PVector.add(a, b, None) def __sub__(a, b): return PVector.sub(a, b, None) def __isub__(a, b): a.sub(b) return a def __iadd__(a, b): a.add(b) return a def __mul__(a, b): if not isinstance(b, Number): raise TypeError( "The * operator can only be used to multiply a PVector by a number") return PVector.mult(a, float(b), None) def __rmul__(a, b): if not isinstance(b, Number): raise TypeError( "The * operator can only be used to multiply a PVector by a number") return PVector.mult(a, float(b), None) def __imul__(a, b): if not isinstance(b, Number): raise TypeError( "The *= operator can only be used to multiply a PVector by a number") a.__vector.mult(float(b)) return a def __truediv__(a, b): if not isinstance(b, Number): raise TypeError( "The * operator can only be used to multiply a PVector by a number") return PVector(a.x / float(b), a.y / float(b), a.z / float(b)) def __itruediv__(a, b): if not isinstance(b, Number): raise TypeError( "The /= operator can only be used to multiply a PVector by a number") a.__vector.set(a.x / float(b), a.y / float(b), a.z / float(b)) return a def __eq__(a, b): return a.x == b[0] and a.y == b[1] and a.z == b[2] def __lt__(a, b): return a.magSq() < b.magSq() def __le__(a, b): return a.magSq() <= b.magSq() def __gt__(a, b): return a.magSq() > b.magSq() def __ge__(a, b): return a.magSq() >= b.magSq() # Problematic class methods, we would rather use p5.Vector when possible... @classmethod def lerp(cls, a, b, f, dest=None): v = createVector(a.x, a.y, a.z) v.lerp(b.__vector, f) if dest is None: return PVector(v.x, v.y, v.z) dest.set(v.x, v.y, v.z) return dest @classmethod def cross(cls, a, b, dest=None): x = a.y * b[2] - b[1] * a.z y = a.z * b[0] - b[2] * a.x z = a.x * b[1] - b[0] * a.y if dest is None: return PVector(x, y, z) dest.set(x, y, z) return dest @classmethod def fromAngle(cls, angle, length=1): # https://github.com/processing/p5.js/blob/3f0b2f0fe575dc81c724474154f5b23a517b7233/src/math/p5.Vector.js return PVector(length * cos(angle), length * sin(angle), 0) @classmethod def fromAngles(theta, phi, length=1): # https://github.com/processing/p5.js/blob/3f0b2f0fe575dc81c724474154f5b23a517b7233/src/math/p5.Vector.js cosPhi = cos(phi) sinPhi = sin(phi) cosTheta = cos(theta) sinTheta = sin(theta) return PVector(length * sinTheta * sinPhi, -length * cosTheta, length * sinTheta * cosPhi) @classmethod def random2D(cls): return PVector.fromAngle(random(TWO_PI)) @classmethod def random3D(cls, dest=None): angle = random(TWO_PI) vz = random(2) - 1 mult = sqrt(1 - vz * vz) vx = mult * cos(angle) vy = mult * sin(angle) if dest is None: return PVector(vx, vy, vz) dest.set(vx, vy, vz) return dest @classmethod def angleBetween(cls, a, b): return acos(a.dot(b) / sqrt(a.magSq() * b.magSq())) # Other harmless p5js methods def equals(self, v): return self == v def heading2D(self): return self.__vector.heading() def reflect(self, *args): # Reflect the incoming vector about a normal to a line in 2D, or about # a normal to a plane in 3D This method acts on the vector directly r = self.__vector.reflect(*args) return r def array(self): # Return a representation of this vector as a float array. This is only # for temporary use. If used in any w fashion, the contents should be # copied by using the p5.Vector.copy() method to copy into your own # array. return self.__vector.array() def toString(self): # Returns a string representation of a vector v by calling String(v) or v.toString(). # return self.__vector.toString() would be something like "p5.vector # Object […, …, …]" return str(self) def rem(self, *args): # Gives remainder of a vector when it is divided by anw vector. See # examples for more context. self.__vector.rem(*args) return self def pre_draw(p5_instance, draw_func, *args, **kwargs): """ We need to run this before the actual draw to insert and update p5 env variables """ global _CTX_MIDDLE, _DEFAULT_FILL, _DEFAULT_LEADMULT, _DEFAULT_STROKE, _DEFAULT_TEXT_FILL global ADD, ALT, ARROW, AUTO, AUDIO, AXES, BACKSPACE, BASELINE, BEVEL, BEZIER, BLEND, BLUR, BOLD, BOLDITALIC global BOTTOM, BURN, CENTER, CHORD, CLAMP, CLOSE, CONTROL, CORNER, CORNERS, CROSS, CURVE, DARKEST global DEG_TO_RAD, DEGREES, DELETE, DIFFERENCE, DILATE, DODGE, DOWN_ARROW, ENTER, ERODE, ESCAPE, EXCLUSION global FILL, GRAY, GRID, HALF_PI, HAND, HARD_LIGHT, HSB, HSL, IMAGE, IMMEDIATE, INVERT, ITALIC, LANDSCAPE global LEFT, LEFT_ARROW, LIGHTEST, LINE_LOOP, LINE_STRIP, LINEAR, LINES, MIRROR, MITER, MOVE, MULTIPLY, NEAREST global NORMAL, OPAQUE, OPEN, OPTION, OVERLAY, P2D, P3D, PI, PIE, POINTS, PORTRAIT, POSTERIZE, PROJECT, QUAD_STRIP global QUADRATIC, QUADS, QUARTER_PI, RAD_TO_DEG, RADIANS, RADIUS, REPEAT, REPLACE, RETURN, RGB, RIGHT, RIGHT_ARROW global ROUND, SCREEN, SHIFT, SOFT_LIGHT, SQUARE, STROKE, SUBTRACT, TAB, TAU, TEXT, TEXTURE, THRESHOLD, TOP global TRIANGLE_FAN, TRIANGLE_STRIP, TRIANGLES, TWO_PI, UP_ARROW, VIDEO, WAIT, WEBGL global frameCount, focused, displayWidth, displayHeight, windowWidth, windowHeight, width, height global deviceOrientation, accelerationX, accelerationY, accelerationZ global pAccelerationX, pAccelerationY, pAccelerationZ, rotationX, rotationY, rotationZ global pRotationX, pRotationY, pRotationZ, turnAxis, keyIsPressed, key, keyCode, mouseX, mouseY, pmouseX, pmouseY global winMouseX, winMouseY, pwinMouseX, pwinMouseY, mouseButton, mouseIsPressed, touches, pixels _CTX_MIDDLE = p5_instance._CTX_MIDDLE _DEFAULT_FILL = p5_instance._DEFAULT_FILL _DEFAULT_LEADMULT = p5_instance._DEFAULT_LEADMULT _DEFAULT_STROKE = p5_instance._DEFAULT_STROKE _DEFAULT_TEXT_FILL = p5_instance._DEFAULT_TEXT_FILL ADD = p5_instance.ADD ALT = p5_instance.ALT ARROW = p5_instance.ARROW AUDIO = p5_instance.AUDIO AUTO = p5_instance.AUTO AXES = p5_instance.AXES BACKSPACE = p5_instance.BACKSPACE BASELINE = p5_instance.BASELINE BEVEL = p5_instance.BEVEL BEZIER = p5_instance.BEZIER BLEND = p5_instance.BLEND BLUR = p5_instance.BLUR BOLD = p5_instance.BOLD BOLDITALIC = p5_instance.BOLDITALIC BOTTOM = p5_instance.BOTTOM BURN = p5_instance.BURN CENTER = p5_instance.CENTER CHORD = p5_instance.CHORD CLAMP = p5_instance.CLAMP CLOSE = p5_instance.CLOSE CONTROL = p5_instance.CONTROL CORNER = p5_instance.CORNER CORNERS = p5_instance.CORNERS CROSS = p5_instance.CROSS CURVE = p5_instance.CURVE DARKEST = p5_instance.DARKEST DEG_TO_RAD = p5_instance.DEG_TO_RAD DEGREES = p5_instance.DEGREES DELETE = p5_instance.DELETE DIFFERENCE = p5_instance.DIFFERENCE DILATE = p5_instance.DILATE DODGE = p5_instance.DODGE DOWN_ARROW = p5_instance.DOWN_ARROW ENTER = p5_instance.ENTER ERODE = p5_instance.ERODE ESCAPE = p5_instance.ESCAPE EXCLUSION = p5_instance.EXCLUSION FILL = p5_instance.FILL GRAY = p5_instance.GRAY GRID = p5_instance.GRID HALF_PI = p5_instance.HALF_PI HAND = p5_instance.HAND HARD_LIGHT = p5_instance.HARD_LIGHT HSB = p5_instance.HSB HSL = p5_instance.HSL IMAGE = p5_instance.IMAGE IMMEDIATE = p5_instance.IMMEDIATE INVERT = p5_instance.INVERT ITALIC = p5_instance.ITALIC LANDSCAPE = p5_instance.LANDSCAPE LEFT = p5_instance.LEFT LEFT_ARROW = p5_instance.LEFT_ARROW LIGHTEST = p5_instance.LIGHTEST LINE_LOOP = p5_instance.LINE_LOOP LINE_STRIP = p5_instance.LINE_STRIP LINEAR = p5_instance.LINEAR LINES = p5_instance.LINES MIRROR = p5_instance.MIRROR MITER = p5_instance.MITER MOVE = p5_instance.MOVE MULTIPLY = p5_instance.MULTIPLY NEAREST = p5_instance.NEAREST NORMAL = p5_instance.NORMAL OPAQUE = p5_instance.OPAQUE OPEN = p5_instance.OPEN OPTION = p5_instance.OPTION OVERLAY = p5_instance.OVERLAY P2D = p5_instance.P2D P3D = p5_instance.WEBGL PI = p5_instance.PI PIE = p5_instance.PIE POINTS = p5_instance.POINTS PORTRAIT = p5_instance.PORTRAIT POSTERIZE = p5_instance.POSTERIZE PROJECT = p5_instance.PROJECT QUAD_STRIP = p5_instance.QUAD_STRIP QUADRATIC = p5_instance.QUADRATIC QUADS = p5_instance.QUADS QUARTER_PI = p5_instance.QUARTER_PI RAD_TO_DEG = p5_instance.RAD_TO_DEG RADIANS = p5_instance.RADIANS RADIUS = p5_instance.RADIUS REPEAT = p5_instance.REPEAT REPLACE = p5_instance.REPLACE RETURN = p5_instance.RETURN RGB = p5_instance.RGB RIGHT = p5_instance.RIGHT RIGHT_ARROW = p5_instance.RIGHT_ARROW ROUND = p5_instance.ROUND SCREEN = p5_instance.SCREEN SHIFT = p5_instance.SHIFT SOFT_LIGHT = p5_instance.SOFT_LIGHT SQUARE = p5_instance.SQUARE STROKE = p5_instance.STROKE SUBTRACT = p5_instance.SUBTRACT TAB = p5_instance.TAB TAU = p5_instance.TAU TEXT = p5_instance.TEXT TEXTURE = p5_instance.TEXTURE THRESHOLD = p5_instance.THRESHOLD TOP = p5_instance.TOP TRIANGLE_FAN = p5_instance.TRIANGLE_FAN TRIANGLE_STRIP = p5_instance.TRIANGLE_STRIP TRIANGLES = p5_instance.TRIANGLES TWO_PI = p5_instance.TWO_PI UP_ARROW = p5_instance.UP_ARROW VIDEO = p5_instance.VIDEO WAIT = p5_instance.WAIT WEBGL = p5_instance.WEBGL frameCount = p5_instance.frameCount focused = p5_instance.focused displayWidth = p5_instance.displayWidth displayHeight = p5_instance.displayHeight windowWidth = p5_instance.windowWidth windowHeight = p5_instance.windowHeight width = p5_instance.width height = p5_instance.height deviceOrientation = p5_instance.deviceOrientation accelerationX = p5_instance.accelerationX accelerationY = p5_instance.accelerationY accelerationZ = p5_instance.accelerationZ pAccelerationX = p5_instance.pAccelerationX pAccelerationY = p5_instance.pAccelerationY pAccelerationZ = p5_instance.pAccelerationZ rotationX = p5_instance.rotationX rotationY = p5_instance.rotationY rotationZ = p5_instance.rotationZ pRotationX = p5_instance.pRotationX pRotationY = p5_instance.pRotationY pRotationZ = p5_instance.pRotationZ turnAxis = p5_instance.turnAxis keyIsPressed = p5_instance.keyIsPressed key = p5_instance.key keyCode = p5_instance.keyCode mouseX = p5_instance.mouseX mouseY = p5_instance.mouseY pmouseX = p5_instance.pmouseX pmouseY = p5_instance.pmouseY winMouseX = p5_instance.winMouseX winMouseY = p5_instance.winMouseY pwinMouseX = p5_instance.pwinMouseX pwinMouseY = p5_instance.pwinMouseY mouseButton = p5_instance.mouseButton mouseIsPressed = p5_instance.mouseIsPressed touches = p5_instance.touches pixels = p5_instance.pixels return draw_func(*args, **kwargs) def global_p5_injection(p5_sketch): """ Injects the p5js's skecth instance as a global variable to setup and draw functions """ def decorator(f, *args, **kwargs): def wrapper(*args, **kwargs): global _P5_INSTANCE _P5_INSTANCE = p5_sketch return pre_draw(_P5_INSTANCE, f, *args, **kwargs) return wrapper return decorator def start_p5(preload_func, setup_func, draw_func, event_functions): """ This is the entrypoint function. It accepts 2 parameters: - preload_func: A Python preload callable - setup_func: a Python setup callable - draw_func: a Python draw callable - event_functions: a config dict for the event functions in the format: {"eventFunctionName": python_event_function} This method gets the p5js's sketch instance and injects them """ def sketch_setup(p5_sketch): """ Callback function called to configure new p5 instance """ p5_sketch.preload = global_p5_injection(p5_sketch)(preload_func) p5_sketch.setup = global_p5_injection(p5_sketch)(setup_func) p5_sketch.draw = global_p5_injection(p5_sketch)(draw_func) window.instance = p5.new(sketch_setup, 'sketch-holder') # Register event functions event_function_names = ( "deviceMoved", "deviceTurned", "deviceShaken", "windowResized", "keyPressed", "keyReleased", "keyTyped", "mousePressed", "mouseReleased", "mouseClicked", "doubleClicked", "mouseMoved", "mouseDragged", "mouseWheel", "touchStarted", "touchMoved", "touchEnded", "keyIsDown", ) for f_name in [f for f in event_function_names if event_functions.get(f, None)]: func = event_functions[f_name] event_func = global_p5_injection(window.instance)(func) setattr(window.instance, f_name, event_func) `; const placeholder = ` def preload(): pass def setup(): pass def draw(): pass deviceMoved = None deviceTurned = None deviceShaken = None keyPressed = None keyReleased = None keyTyped = None mouseMoved = None mouseDragged = None mousePressed = None mouseReleased = None mouseClicked = None doubleClicked = None mouseWheel = None touchStarted = None touchMoved = None touchEnded = None windowResized = None `; let userCode = ` """ * Move Eye. * by Simon Greenwold. * * The camera lifts up (controlled by mouseY) while looking at the same point. """ def setup(): createCanvas(640, 360, WEBGL) fill(204) def draw(): ambientLight(50) directionalLight(255, 0, 0, 0.25, 0.25, 0); background(0) # Change height of the camera with mouseY camera(30.0, mouseY, 220.0, # eyeX, eyeY, eyeZ 0.0, 0.0, 0.0, # centerX, centerY, centerZ 0.0, 1.0, 0.0) # upX, upY, upZ noStroke() box(90) stroke(255) line(-100, 0, 0, 100, 0, 0) line(0, -100, 0, 0, 100, 0) line(0, 0, -100, 0, 0, 100) `; const startCode = ` event_functions = { "deviceMoved": deviceMoved, "deviceTurned": deviceTurned, "deviceShaken": deviceShaken, "keyPressed": keyPressed, "keyReleased": keyReleased, "keyTyped": keyTyped, "mouseMoved": mouseMoved, "mouseDragged": mouseDragged, "mousePressed": mousePressed, "mouseReleased": mouseReleased, "mouseClicked": mouseClicked, "doubleClicked": doubleClicked, "mouseWheel": mouseWheel, "touchStarted": touchStarted, "touchMoved": touchMoved, "touchEnded": touchEnded, "windowResized": windowResized, } start_p5(preload, setup, draw, event_functions) `; function runCode() { let code = [ placeholder, userCode, wrapperContent, startCode, ].join('\n'); if (window.instance) { window.instance.canvas.remove(); } console.log("Python execution output:"); window.pyodide.runPython(code); } async function main() { const config = { indexURL : "https://cdn.jsdelivr.net/pyodide/v0.18.1/full/", fullStdLib: false, } window.pyodide = await loadPyodide(config); // Pyodide is now ready to use... console.log(window.pyodide.runPython(` import io, code, sys from js import p5, window, document print(sys.version) `)); window.runSketchCode = (code) => { userCode = code; runCode(); } runCode(); }; // async method main(); ================================================ FILE: docs/examples/pyodide/sketch_003/index.html ================================================ sketch_003 - pyp5js

Python code here.

# 3d example

def setup():
    createCanvas(600, 600, WEBGL)

def draw():
    background(200)
    translate(-100, -100, 0)
    push()
    normalMaterial()
    rotateZ(frameCount * 0.01)
    rotateX(frameCount * 0.01)
    rotateY(frameCount * 0.01)
    box(50, 70, 100)
    pop()
================================================ FILE: docs/examples/pyodide/sketch_003/sketch_003.py ================================================ # 3d example def setup(): createCanvas(600, 600, WEBGL) def draw(): background(200) translate(-100, -100, 0) push() normalMaterial() rotateZ(frameCount * 0.01) rotateX(frameCount * 0.01) rotateY(frameCount * 0.01) box(50, 70, 100) pop() ================================================ FILE: docs/examples/pyodide/sketch_003/static/p5.js ================================================ /*! p5.js v1.0.0 February 29, 2020 */ !function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).p5=e()}}(function(){return function o(a,s,l){function u(t,e){if(!s[t]){if(!a[t]){var r="function"==typeof require&&require;if(!e&&r)return r(t,!0);if(h)return h(t,!0);var i=new Error("Cannot find module '"+t+"'");throw i.code="MODULE_NOT_FOUND",i}var n=s[t]={exports:{}};a[t][0].call(n.exports,function(e){return u(a[t][1][e]||e)},n,n.exports,o,a,s,l)}return s[t].exports}for(var h="function"==typeof require&&require,e=0;e>16&255,a[s++]=t>>8&255,a[s++]=255&t;2===o&&(t=u[e.charCodeAt(r)]<<2|u[e.charCodeAt(r+1)]>>4,a[s++]=255&t);1===o&&(t=u[e.charCodeAt(r)]<<10|u[e.charCodeAt(r+1)]<<4|u[e.charCodeAt(r+2)]>>2,a[s++]=t>>8&255,a[s++]=255&t);return a},r.fromByteArray=function(e){for(var t,r=e.length,i=r%3,n=[],o=0,a=r-i;o>2]+s[t<<4&63]+"==")):2==i&&(t=(e[r-2]<<8)+e[r-1],n.push(s[t>>10]+s[t>>4&63]+s[t<<2&63]+"="));return n.join("")};for(var s=[],u=[],h="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=0,o=i.length;n>18&63]+s[n>>12&63]+s[n>>6&63]+s[63&n]);return o.join("")}u["-".charCodeAt(0)]=62,u["_".charCodeAt(0)]=63},{}],20:[function(e,t,r){},{}],21:[function(N,e,F){(function(c){"use strict";var i=N("base64-js"),o=N("ieee754"),e="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;F.Buffer=c,F.SlowBuffer=function(e){+e!=e&&(e=0);return c.alloc(+e)},F.INSPECT_MAX_BYTES=50;var r=2147483647;function a(e){if(r>>1;case"base64":return O(e).length;default:if(n)return i?-1:R(e).length;t=(""+t).toLowerCase(),n=!0}}function d(e,t,r){var i=e[t];e[t]=e[r],e[r]=i}function p(e,t,r,i,n){if(0===e.length)return-1;if("string"==typeof r?(i=r,r=0):2147483647=e.length){if(n)return-1;r=e.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof t&&(t=c.from(t,i)),c.isBuffer(t))return 0===t.length?-1:m(e,t,r,i,n);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):m(e,[t],r,i,n);throw new TypeError("val must be string, number or Buffer")}function m(e,t,r,i,n){var o,a=1,s=e.length,l=t.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(e.length<2||t.length<2)return-1;s/=a=2,l/=2,r/=2}function u(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(n){var h=-1;for(o=r;o>8,n=r%256,o.push(n),o.push(i);return o}(t,e.length-r),e,r,i)}function b(e,t,r){return 0===t&&r===e.length?i.fromByteArray(e):i.fromByteArray(e.slice(t,r))}function _(e,t,r){r=Math.min(e.length,r);for(var i=[],n=t;n>>10&1023|55296),h=56320|1023&h),i.push(h),n+=c}return function(e){var t=e.length;if(t<=x)return String.fromCharCode.apply(String,e);var r="",i=0;for(;ithis.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e=e||"utf8";;)switch(e){case"hex":return M(this,t,r);case"utf8":case"utf-8":return _(this,t,r);case"ascii":return w(this,t,r);case"latin1":case"binary":return S(this,t,r);case"base64":return b(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,t,r);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}.apply(this,arguments)},c.prototype.equals=function(e){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===c.compare(this,e)},c.prototype.inspect=function(){var e="",t=F.INSPECT_MAX_BYTES;return e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(e+=" ... "),""},e&&(c.prototype[e]=c.prototype.inspect),c.prototype.compare=function(e,t,r,i,n){if(A(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),t<0||r>e.length||i<0||n>this.length)throw new RangeError("out of range index");if(n<=i&&r<=t)return 0;if(n<=i)return-1;if(r<=t)return 1;if(this===e)return 0;for(var o=(n>>>=0)-(i>>>=0),a=(r>>>=0)-(t>>>=0),s=Math.min(o,a),l=this.slice(i,n),u=e.slice(t,r),h=0;h>>=0,isFinite(r)?(r>>>=0,void 0===i&&(i="utf8")):(i=r,r=void 0)}var n=this.length-t;if((void 0===r||nthis.length)throw new RangeError("Attempt to write outside buffer bounds");i=i||"utf8";for(var o,a,s,l,u,h,c=!1;;)switch(i){case"hex":return g(this,e,t,r);case"utf8":case"utf-8":return u=t,h=r,D(R(e,(l=this).length-u),l,u,h);case"ascii":return v(this,e,t,r);case"latin1":case"binary":return v(this,e,t,r);case"base64":return o=this,a=t,s=r,D(O(e),o,a,s);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return y(this,e,t,r);default:if(c)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),c=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var x=4096;function w(e,t,r){var i="";r=Math.min(e.length,r);for(var n=t;ne.length)throw new RangeError("Index out of range")}function P(e,t,r,i){if(r+i>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function L(e,t,r,i,n){return t=+t,r>>>=0,n||P(e,0,r,4),o.write(e,t,r,i,23,4),r+4}function k(e,t,r,i,n){return t=+t,r>>>=0,n||P(e,0,r,8),o.write(e,t,r,i,52,8),r+8}c.prototype.slice=function(e,t){var r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):r>>=0,t>>>=0,r||T(e,t,this.length);for(var i=this[e],n=1,o=0;++o>>=0,t>>>=0,r||T(e,t,this.length);for(var i=this[e+--t],n=1;0>>=0,t||T(e,1,this.length),this[e]},c.prototype.readUInt16LE=function(e,t){return e>>>=0,t||T(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUInt16BE=function(e,t){return e>>>=0,t||T(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUInt32LE=function(e,t){return e>>>=0,t||T(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUInt32BE=function(e,t){return e>>>=0,t||T(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||T(e,t,this.length);for(var i=this[e],n=1,o=0;++o>>=0,t>>>=0,r||T(e,t,this.length);for(var i=t,n=1,o=this[e+--i];0>>=0,t||T(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){e>>>=0,t||T(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(e,t){e>>>=0,t||T(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(e,t){return e>>>=0,t||T(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return e>>>=0,t||T(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readFloatLE=function(e,t){return e>>>=0,t||T(e,4,this.length),o.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return e>>>=0,t||T(e,4,this.length),o.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return e>>>=0,t||T(e,8,this.length),o.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return e>>>=0,t||T(e,8,this.length),o.read(this,e,!1,52,8)},c.prototype.writeUIntLE=function(e,t,r,i){e=+e,t>>>=0,r>>>=0,i||C(this,e,t,r,Math.pow(2,8*r)-1,0);var n=1,o=0;for(this[t]=255&e;++o>>=0,r>>>=0,i||C(this,e,t,r,Math.pow(2,8*r)-1,0);var n=r-1,o=1;for(this[t+n]=255&e;0<=--n&&(o*=256);)this[t+n]=e/o&255;return t+r},c.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,1,255,0),this[t]=255&e,t+1},c.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},c.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeIntLE=function(e,t,r,i){if(e=+e,t>>>=0,!i){var n=Math.pow(2,8*r-1);C(this,e,t,r,n-1,-n)}var o=0,a=1,s=0;for(this[t]=255&e;++o>0)-s&255;return t+r},c.prototype.writeIntBE=function(e,t,r,i){if(e=+e,t>>>=0,!i){var n=Math.pow(2,8*r-1);C(this,e,t,r,n-1,-n)}var o=r-1,a=1,s=0;for(this[t+o]=255&e;0<=--o&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+r},c.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},c.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeFloatLE=function(e,t,r){return L(this,e,t,!0,r)},c.prototype.writeFloatBE=function(e,t,r){return L(this,e,t,!1,r)},c.prototype.writeDoubleLE=function(e,t,r){return k(this,e,t,!0,r)},c.prototype.writeDoubleBE=function(e,t,r){return k(this,e,t,!1,r)},c.prototype.copy=function(e,t,r,i){if(!c.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r=r||0,i||0===i||(i=this.length),t>=e.length&&(t=e.length),t=t||0,0=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t>>=0,r=void 0===r?this.length:r>>>0,"number"==typeof(e=e||0))for(o=t;o>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function O(e){return i.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(t,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function D(e,t,r,i){for(var n=0;n=t.length||n>=e.length);++n)t[n+r]=e[n];return n}function A(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function I(e){return e!=e}var U=function(){for(var e="0123456789abcdef",t=new Array(256),r=0;r<16;++r)for(var i=16*r,n=0;n<16;++n)t[i+n]=e[r]+e[n];return t}()}).call(this,N("buffer").Buffer)},{"base64-js":19,buffer:21,ieee754:30}],22:[function(e,t,r){"use strict";t.exports=e("./").polyfill()},{"./":23}],23:[function(z,r,i){(function(j,V){var e,t;e=this,t=function(){"use strict";function l(e){return"function"==typeof e}var r=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},i=0,t=void 0,n=void 0,a=function(e,t){f[i]=e,f[i+1]=t,2===(i+=2)&&(n?n(d):y())};var e="undefined"!=typeof window?window:void 0,o=e||{},s=o.MutationObserver||o.WebKitMutationObserver,u="undefined"==typeof self&&void 0!==j&&"[object process]"==={}.toString.call(j),h="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function c(){var e=setTimeout;return function(){return e(d,1)}}var f=new Array(1e3);function d(){for(var e=0;e":">",'"':""","'":"'","/":"/"};function S(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,function(e){return w[e]}):e}var M=function(){function i(e){var t,r=1=this.maxReplaces)break}for(a=0;r=this.regexp.exec(e);){if(void 0===(i=h(r[1].trim())))if("function"==typeof c){var d=c(e,r,t);i="string"==typeof d?d:""}else this.logger.warn("missed to pass in variable ".concat(r[1]," for interpolating ").concat(e)),i="";else"string"==typeof i||this.useRawValueToEscape||(i=v(i));if(i=this.escapeValue?u(this.escape(i)):u(i),e=e.replace(r[0],i),this.regexp.lastIndex=0,++a>=this.maxReplaces)break}return e}},{key:"nest",value:function(e,t,r){var i,n,o=D({},2>1,h=-7,c=r?n-1:0,f=r?-1:1,d=e[t+c];for(c+=f,o=d&(1<<-h)-1,d>>=-h,h+=s;0>=-h,h+=i;0>1,f=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,d=i?0:o-1,p=i?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=h):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),2<=(t+=1<=a+c?f/l:f*Math.pow(2,1-c))*l&&(a++,l/=2),h<=a+c?(s=0,a=h):1<=a+c?(s=(t*l-1)*Math.pow(2,n),a+=c):(s=t*Math.pow(2,c-1)*Math.pow(2,n),a=0));8<=n;e[r+d]=255&s,d+=p,s/=256,n-=8);for(a=a<Math.abs(e[0])&&(t=1),Math.abs(e[2])>Math.abs(e[t])&&(t=2),t}var C=4e150;function P(e,t){e.f+=t.f,e.b.f+=t.b.f}function u(e,t,r){return e=e.a,t=t.a,r=r.a,t.b.a===e?r.b.a===e?v(t.a,r.a)?b(r.b.a,t.a,r.a)<=0:0<=b(t.b.a,r.a,t.a):b(r.b.a,e,r.a)<=0:r.b.a===e?0<=b(t.b.a,e,t.a):(t=y(t.b.a,e,t.a),(e=y(r.b.a,e,r.a))<=t)}function L(e){e.a.i=null;var t=e.e;t.a.c=t.c,t.c.a=t.a,e.e=null}function h(e,t){c(e.a),e.c=!1,(e.a=t).i=e}function k(e){for(var t=e.a.a;(e=fe(e)).a.a===t;);return e.c&&(h(e,t=f(ce(e).a.b,e.a.e)),e=fe(e)),e}function R(e,t,r){var i=new he;return i.a=r,i.e=W(e.f,t.e,i),r.i=i}function O(e,t){switch(e.s){case 100130:return 0!=(1&t);case 100131:return 0!==t;case 100132:return 0>1]],s[a[u]])?le(r,u):ue(r,u)),s[o]=null,l[o]=r.b,r.b=o}else for(r.c[-(o+1)]=null;0Math.max(a.a,l.a))return!1;if(v(o,a)){if(0i.f&&(i.f*=2,i.c=oe(i.c,i.f+1)),0===i.b?r=n:(r=i.b,i.b=i.c[i.b]),i.e[r]=t,i.c[r]=n,i.d[n]=r,i.h&&ue(i,n),r}return i=e.a++,e.c[i]=t,-(i+1)}function ie(e){if(0===e.a)return se(e.b);var t=e.c[e.d[e.a-1]];if(0!==e.b.a&&v(ae(e.b),t))return se(e.b);for(;--e.a,0e.a||v(i[a],i[l])){n[r[o]=a]=o;break}n[r[o]=l]=o,o=s}}function ue(e,t){for(var r=e.d,i=e.e,n=e.c,o=t,a=r[o];;){var s=o>>1,l=r[s];if(0==s||v(i[l],i[a])){n[r[o]=a]=o;break}n[r[o]=l]=o,o=s}}function he(){this.e=this.a=null,this.f=0,this.c=this.b=this.h=this.d=!1}function ce(e){return e.e.c.b}function fe(e){return e.e.a.b}(i=q.prototype).x=function(){Y(this,0)},i.B=function(e,t){switch(e){case 100142:return;case 100140:switch(t){case 100130:case 100131:case 100132:case 100133:case 100134:return void(this.s=t)}break;case 100141:return void(this.m=!!t);default:return void Z(this,100900)}Z(this,100901)},i.y=function(e){switch(e){case 100142:return 0;case 100140:return this.s;case 100141:return this.m;default:Z(this,100900)}return!1},i.A=function(e,t,r){this.j[0]=e,this.j[1]=t,this.j[2]=r},i.z=function(e,t){var r=t||null;switch(e){case 100100:case 100106:this.h=r;break;case 100104:case 100110:this.l=r;break;case 100101:case 100107:this.k=r;break;case 100102:case 100108:this.i=r;break;case 100103:case 100109:this.p=r;break;case 100105:case 100111:this.o=r;break;case 100112:this.r=r;break;default:Z(this,100900)}},i.C=function(e,t){var r=!1,i=[0,0,0];Y(this,2);for(var n=0;n<3;++n){var o=e[n];o<-1e150&&(o=-1e150,r=!0),1e150n[u]&&(n[u]=h,a[u]=l)}if(l=0,n[1]-o[1]>n[0]-o[0]&&(l=1),n[2]-o[2]>n[l]-o[l]&&(l=2),o[l]>=n[l])i[0]=0,i[1]=0,i[2]=1;else{for(n=0,o=s[l],a=a[l],s=[0,0,0],o=[o.g[0]-a.g[0],o.g[1]-a.g[1],o.g[2]-a.g[2]],u=[0,0,0],l=r.e;l!==r;l=l.e)u[0]=l.g[0]-a.g[0],u[1]=l.g[1]-a.g[1],u[2]=l.g[2]-a.g[2],s[0]=o[1]*u[2]-o[2]*u[1],s[1]=o[2]*u[0]-o[0]*u[2],s[2]=o[0]*u[1]-o[1]*u[0],n<(h=s[0]*s[0]+s[1]*s[1]+s[2]*s[2])&&(n=h,i[0]=s[0],i[1]=s[1],i[2]=s[2]);n<=0&&(i[0]=i[1]=i[2]=0,i[T(o)]=1)}r=!0}for(s=T(i),l=this.b.c,n=(s+1)%3,a=(s+2)%3,s=0>=l,h-=l,g!=o){if(g==a)break;for(var v=g>8,++y;var _=b;if(i>=8;null!==m&&s<4096&&(p[s++]=m<<8|_,u+1<=s&&l<12&&(++l,u=u<<1|1)),m=g}else s=1+a,u=(1<<(l=n+1))-1,m=null}return f!==i&&console.log("Warning, gif stream shorter than expected."),r}try{r.GifWriter=function(v,e,t,r){var y=0,i=void 0===(r=void 0===r?{}:r).loop?null:r.loop,b=void 0===r.palette?null:r.palette;if(e<=0||t<=0||65535>=1;)++n;if(a=1<>8&255,v[y++]=255&t,v[y++]=t>>8&255,v[y++]=(null!==b?128:0)|n,v[y++]=o,v[y++]=0,null!==b)for(var s=0,l=b.length;s>16&255,v[y++]=u>>8&255,v[y++]=255&u}if(null!==i){if(i<0||65535>8&255,v[y++]=0}var x=!1;this.addFrame=function(e,t,r,i,n,o){if(!0===x&&(--y,x=!1),o=void 0===o?{}:o,e<0||t<0||65535>=1;)++u;l=1<>8&255,v[y++]=d,v[y++]=0),v[y++]=44,v[y++]=255&e,v[y++]=e>>8&255,v[y++]=255&t,v[y++]=t>>8&255,v[y++]=255&r,v[y++]=r>>8&255,v[y++]=255&i,v[y++]=i>>8&255,v[y++]=!0===a?128|u-1:0,!0===a)for(var p=0,m=s.length;p>16&255,v[y++]=g>>8&255,v[y++]=255&g}return y=function(t,r,e,i){t[r++]=e;var n=r++,o=1<>=8,h-=8,r===n+256&&(t[n]=255,n=r++)}function d(e){c|=e<>=8,h-=8,r===n+256&&(t[n]=255,n=r++);4096===l?(d(o),l=1+s,u=e+1,m={}):(1<>7,n=1<<1+(7&r);x[e++],x[e++];var o=null,a=null;i&&(o=e,e+=3*(a=n));var s=!0,l=[],u=0,h=null,c=0,f=null;for(this.width=w,this.height=t;s&&e>2&7,e++;break;case 254:for(;;){if(!(0<=(C=x[e++])))throw Error("Invalid block size");if(0===C)break;e+=C}break;default:throw new Error("Unknown graphic control label: 0x"+x[e-1].toString(16))}break;case 44:var p=x[e++]|x[e++]<<8,m=x[e++]|x[e++]<<8,g=x[e++]|x[e++]<<8,v=x[e++]|x[e++]<<8,y=x[e++],b=y>>6&1,_=1<<1+(7&y),S=o,M=a,E=!1;if(y>>7){E=!0;S=e,e+=3*(M=_)}var T=e;for(e++;;){var C;if(!(0<=(C=x[e++])))throw Error("Invalid block size");if(0===C)break;e+=C}l.push({x:p,y:m,width:g,height:v,has_local_palette:E,palette_offset:S,palette_size:M,data_offset:T,data_length:e-T,transparent_index:h,interlaced:!!b,delay:u,disposal:c});break;case 59:s=!1;break;default:throw new Error("Unknown gif block: 0x"+x[e-1].toString(16))}this.numFrames=function(){return l.length},this.loopCount=function(){return f},this.frameInfo=function(e){if(e<0||e>=l.length)throw new Error("Frame index out of range.");return l[e]},this.decodeAndBlitFrameBGRA=function(e,t){var r=this.frameInfo(e),i=r.width*r.height,n=new Uint8Array(i);P(x,r.data_offset,n,i);var o=r.palette_offset,a=r.transparent_index;null===a&&(a=256);var s=r.width,l=w-s,u=s,h=4*(r.y*w+r.x),c=4*((r.y+r.height)*w+r.x),f=h,d=4*l;!0===r.interlaced&&(d+=4*w*7);for(var p=8,m=0,g=n.length;m>=1)),v===a)f+=4;else{var y=x[o+3*v],b=x[o+3*v+1],_=x[o+3*v+2];t[f++]=_,t[f++]=b,t[f++]=y,t[f++]=255}--u}},this.decodeAndBlitFrameRGBA=function(e,t){var r=this.frameInfo(e),i=r.width*r.height,n=new Uint8Array(i);P(x,r.data_offset,n,i);var o=r.palette_offset,a=r.transparent_index;null===a&&(a=256);var s=r.width,l=w-s,u=s,h=4*(r.y*w+r.x),c=4*((r.y+r.height)*w+r.x),f=h,d=4*l;!0===r.interlaced&&(d+=4*w*7);for(var p=8,m=0,g=n.length;m>=1)),v===a)f+=4;else{var y=x[o+3*v],b=x[o+3*v+1],_=x[o+3*v+2];t[f++]=y,t[f++]=b,t[f++]=_,t[f++]=255}--u}}}}catch(e){}},{}],33:[function(jr,t,r){(function(Gr){var e;e=this,function(E){"use strict";function e(e){if(null==this)throw TypeError();var t=String(this),r=t.length,i=e?Number(e):0;if(i!=i&&(i=0),!(i<0||r<=i)){var n,o=t.charCodeAt(i);return 55296<=o&&o<=56319&&i+1>>=1,t}function _(e,t,r){if(!t)return r;for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<>>16-t;return e.tag>>>=t,e.bitcount-=t,i+r}function x(e,t){for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<>>=1,++n,r+=t.table[n],0<=(i-=t.table[n]););return e.tag=o,e.bitcount-=n,t.trans[r+i]}function w(e,t,r){var i,n,o,a,s,l;for(i=_(e,5,257),n=_(e,5,1),o=_(e,4,4),a=0;a<19;++a)g[a]=0;for(a=0;athis.x2&&(this.x2=e)),"number"==typeof t&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=t,this.y2=t),tthis.y2&&(this.y2=t))},C.prototype.addX=function(e){this.addPoint(e,null)},C.prototype.addY=function(e){this.addPoint(null,e)},C.prototype.addBezier=function(e,t,r,i,n,o,a,s){var l=this,u=[e,t],h=[r,i],c=[n,o],f=[a,s];this.addPoint(e,t),this.addPoint(a,s);for(var d=0;d<=1;d++){var p=6*u[d]-12*h[d]+6*c[d],m=-3*u[d]+9*h[d]-9*c[d]+3*f[d],g=3*h[d]-3*u[d];if(0!=m){var v=Math.pow(p,2)-4*g*m;if(!(v<0)){var y=(-p+Math.sqrt(v))/(2*m);0>8&255,255&e]},A.USHORT=U(2),D.SHORT=function(e){return 32768<=e&&(e=-(65536-e)),[e>>8&255,255&e]},A.SHORT=U(2),D.UINT24=function(e){return[e>>16&255,e>>8&255,255&e]},A.UINT24=U(3),D.ULONG=function(e){return[e>>24&255,e>>16&255,e>>8&255,255&e]},A.ULONG=U(4),D.LONG=function(e){return R<=e&&(e=-(2*R-e)),[e>>24&255,e>>16&255,e>>8&255,255&e]},A.LONG=U(4),D.FIXED=D.ULONG,A.FIXED=A.ULONG,D.FWORD=D.SHORT,A.FWORD=A.SHORT,D.UFWORD=D.USHORT,A.UFWORD=A.USHORT,D.LONGDATETIME=function(e){return[0,0,0,0,e>>24&255,e>>16&255,e>>8&255,255&e]},A.LONGDATETIME=U(8),D.TAG=function(e){return k.argument(4===e.length,"Tag should be exactly 4 ASCII characters."),[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]},A.TAG=U(4),D.Card8=D.BYTE,A.Card8=A.BYTE,D.Card16=D.USHORT,A.Card16=A.USHORT,D.OffSize=D.BYTE,A.OffSize=A.BYTE,D.SID=D.USHORT,A.SID=A.USHORT,D.NUMBER=function(e){return-107<=e&&e<=107?[e+139]:108<=e&&e<=1131?[247+((e-=108)>>8),255&e]:-1131<=e&&e<=-108?[251+((e=-e-108)>>8),255&e]:-32768<=e&&e<=32767?D.NUMBER16(e):D.NUMBER32(e)},A.NUMBER=function(e){return D.NUMBER(e).length},D.NUMBER16=function(e){return[28,e>>8&255,255&e]},A.NUMBER16=U(3),D.NUMBER32=function(e){return[29,e>>24&255,e>>16&255,e>>8&255,255&e]},A.NUMBER32=U(5),D.REAL=function(e){var t=e.toString(),r=/\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec(t);if(r){var i=parseFloat("1e"+((r[2]?+r[2]:0)+r[1].length));t=(Math.round(e*i)/i).toString()}for(var n="",o=0,a=t.length;o>8&255,t[t.length]=255&i}return t},A.UTF16=function(e){return 2*e.length};var N={"x-mac-croatian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈ƫȅ ÀÃÕŒœĐ—“”‘’÷◊©⁄€‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ","x-mac-cyrillic":"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю","x-mac-gaelic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØḂ±≤≥ḃĊċḊḋḞḟĠġṀæøṁṖṗɼƒſṠ«»… ÀÃÕŒœ–—“”‘’ṡẛÿŸṪ€‹›Ŷŷṫ·Ỳỳ⁊ÂÊÁËÈÍÎÏÌÓÔ♣ÒÚÛÙıÝýŴŵẄẅẀẁẂẃ","x-mac-greek":"Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦€ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ­","x-mac-icelandic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüݰ¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-inuit":"ᐃᐄᐅᐆᐊᐋᐱᐲᐳᐴᐸᐹᑉᑎᑏᑐᑑᑕᑖᑦᑭᑮᑯᑰᑲᑳᒃᒋᒌᒍᒎᒐᒑ°ᒡᒥᒦ•¶ᒧ®©™ᒨᒪᒫᒻᓂᓃᓄᓅᓇᓈᓐᓯᓰᓱᓲᓴᓵᔅᓕᓖᓗᓘᓚᓛᓪᔨᔩᔪᔫᔭ… ᔮᔾᕕᕖᕗ–—“”‘’ᕘᕙᕚᕝᕆᕇᕈᕉᕋᕌᕐᕿᖀᖁᖂᖃᖄᖅᖏᖐᖑᖒᖓᖔᖕᙱᙲᙳᙴᙵᙶᖖᖠᖡᖢᖣᖤᖥᖦᕼŁł","x-mac-ce":"ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ",macintosh:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-romanian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂȘ∞±≤≥¥µ∂∑∏π∫ªºΩăș¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›Țț‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-turkish":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙˆ˜¯˘˙˚¸˝˛ˇ"};O.MACSTRING=function(e,t,r,i){var n=N[i];if(void 0!==n){for(var o="",a=0;a>8&255,l+256&255)}return o}D.MACSTRING=function(e,t){var r=function(e){if(!F)for(var t in F={},N)F[t]=new String(t);var r=F[e];if(void 0!==r){if(B){var i=B.get(r);if(void 0!==i)return i}var n=N[e];if(void 0!==n){for(var o={},a=0;a>8,t[c+1]=255&f,t=t.concat(i[h])}return t},A.TABLE=function(e){for(var t=0,r=e.fields.length,i=0;i>1,t.skip("uShort",3),e.glyphIndexMap={};for(var a=new se.Parser(r,i+n+14),s=new se.Parser(r,i+n+16+2*o),l=new se.Parser(r,i+n+16+4*o),u=new se.Parser(r,i+n+16+6*o),h=i+n+16+8*o,c=0;c>4,o=15&i;if(15==n)break;if(t+=r[n],15==o)break;t+=r[o]}return parseFloat(t)}(e);if(32<=t&&t<=246)return t-139;if(247<=t&&t<=250)return 256*(t-247)+e.parseByte()+108;if(251<=t&&t<=254)return 256*-(t-251)-e.parseByte()-108;throw new Error("Invalid b0 "+t)}function Te(e,t,r){t=void 0!==t?t:0;var i=new se.Parser(e,t),n=[],o=[];for(r=void 0!==r?r:e.length;i.relativeOffset>1,T.length=0,P=!0}return function e(t){for(var r,i,n,o,a,s,l,u,h,c,f,d,p=0;pMath.abs(d-R)?k=f+T.shift():R=d+T.shift(),E.curveTo(y,b,_,x,l,u),E.curveTo(h,c,f,d,k,R);break;default:console.log("Glyph "+v.index+": unknown operator 1200"+m),T.length=0}break;case 14:0>3;break;case 21:2>16),p+=2;break;case 29:a=T.pop()+g.gsubrsBias,(s=g.gsubrs[a])&&e(s);break;case 30:for(;0=r.begin&&e=fe.length){var a=i.parseChar();r.names.push(i.parseString(a))}break;case 2.5:r.numberOfGlyphs=i.parseUShort(),r.offset=new Array(r.numberOfGlyphs);for(var s=0;st.value.tag?1:-1}),t.fields=t.fields.concat(i),t.fields=t.fields.concat(n),t}function gt(e,t,r){for(var i=0;i 123 are reserved for internal usage");d|=1<>>1,o=e[n].tag;if(o===t)return n;o>>1,o=e[n];if(o===t)return n;o>>1,a=(r=e[o]).start;if(a===t)return r;a(r=e[i-1]).end?0:r}function xt(e,t){this.font=e,this.tableName=t}function wt(e){xt.call(this,e,"gpos")}function St(e){xt.call(this,e,"gsub")}function Mt(e,t){var r=e.length;if(r!==t.length)return!1;for(var i=0;it.points.length-1||i.matchedPoints[1]>n.points.length-1)throw Error("Matched points out of range in "+t.name);var a=t.points[i.matchedPoints[0]],s=n.points[i.matchedPoints[1]],l={xScale:i.xScale,scale01:i.scale01,scale10:i.scale10,yScale:i.yScale,dx:0,dy:0};s=kt([s],l)[0],l.dx=a.x-s.x,l.dy=a.y-s.y,o=kt(n.points,l)}t.points=t.points.concat(o)}}return Rt(t.points)}(wt.prototype=xt.prototype={searchTag:yt,binSearch:bt,getTable:function(e){var t=this.font.tables[this.tableName];return!t&&e&&(t=this.font.tables[this.tableName]=this.createDefaultTable()),t},getScriptNames:function(){var e=this.getTable();return e?e.scripts.map(function(e){return e.tag}):[]},getDefaultScriptName:function(){var e=this.getTable();if(e){for(var t=!1,r=0;r=s[u-1].tag,"Features must be added in alphabetical order."),o={tag:r,feature:{params:0,lookupListIndexes:[]}},s.push(o),a.push(u),o.feature}}},getLookupTables:function(e,t,r,i,n){var o=this.getFeatureTable(e,t,r,n),a=[];if(o){for(var s,l=o.lookupListIndexes,u=this.font.tables[this.tableName].lookups,h=0;h",s),t.stack.push(Math.round(64*s))}function vr(e,t){var r=t.stack,i=r.pop(),n=t.fv,o=t.pv,a=t.ppem,s=t.deltaBase+16*(e-1),l=t.deltaShift,u=t.z0;E.DEBUG&&console.log(t.step,"DELTAP["+e+"]",i,r);for(var h=0;h>4)===a){var d=(15&f)-8;0<=d&&d++,E.DEBUG&&console.log(t.step,"DELTAPFIX",c,"by",d*l);var p=u[c];n.setRelative(p,p,d*l,o)}}}function yr(e,t){var r=t.stack,i=r.pop();E.DEBUG&&console.log(t.step,"ROUND[]"),r.push(64*t.round(i/64))}function br(e,t){var r=t.stack,i=r.pop(),n=t.ppem,o=t.deltaBase+16*(e-1),a=t.deltaShift;E.DEBUG&&console.log(t.step,"DELTAC["+e+"]",i,r);for(var s=0;s>4)===n){var h=(15&u)-8;0<=h&&h++;var c=h*a;E.DEBUG&&console.log(t.step,"DELTACFIX",l,"by",c),t.cvt[l]+=c}}}function _r(e,t){var r,i,n=t.stack,o=n.pop(),a=n.pop(),s=t.z2[o],l=t.z1[a];E.DEBUG&&console.log(t.step,"SDPVTL["+e+"]",o,a),i=e?(r=s.y-l.y,l.x-s.x):(r=l.x-s.x,l.y-s.y),t.dpv=Zt(r,i)}function xr(e,t){var r=t.stack,i=t.prog,n=t.ip;E.DEBUG&&console.log(t.step,"PUSHB["+e+"]");for(var o=0;o":"_")+(i?"R":"_")+(0===n?"Gr":1===n?"Bl":2===n?"Wh":"")+"]",e?c+"("+o.cvt[c]+","+u+")":"",f,"(d =",a,"->",l*s,")"),o.rp1=o.rp0,o.rp2=f,t&&(o.rp0=f)}Ft.prototype.exec=function(e,t){if("number"!=typeof t)throw new Error("Point size is not a number!");if(!(2",i),s.interpolate(c,o,a,l),s.touch(c)}e.loop=1},dr.bind(void 0,0),dr.bind(void 0,1),function(e){for(var t=e.stack,r=e.rp0,i=e.z0[r],n=e.loop,o=e.fv,a=e.pv,s=e.z1;n--;){var l=t.pop(),u=s[l];E.DEBUG&&console.log(e.step,(1=a.width||t>=a.height?[0,0,0,0]:this._getPixel(e,t);var s=new l.default.Image(r,i);return s.canvas.getContext("2d").drawImage(a,e,t,r*o,i*o,0,0,r,i),s},l.default.Renderer.prototype.textLeading=function(e){return"number"==typeof e?(this._setProperty("_textLeading",e),this._pInst):this._textLeading},l.default.Renderer.prototype.textSize=function(e){return"number"==typeof e?(this._setProperty("_textSize",e),this._setProperty("_textLeading",e*y._DEFAULT_LEADMULT),this._applyTextProperties()):this._textSize},l.default.Renderer.prototype.textStyle=function(e){return e?(e!==y.NORMAL&&e!==y.ITALIC&&e!==y.BOLD&&e!==y.BOLDITALIC||this._setProperty("_textStyle",e),this._applyTextProperties()):this._textStyle},l.default.Renderer.prototype.textAscent=function(){return null===this._textAscent&&this._updateTextMetrics(),this._textAscent},l.default.Renderer.prototype.textDescent=function(){return null===this._textDescent&&this._updateTextMetrics(),this._textDescent},l.default.Renderer.prototype.textAlign=function(e,t){return void 0!==e?(this._setProperty("_textAlign",e),void 0!==t&&this._setProperty("_textBaseline",t),this._applyTextProperties()):{horizontal:this._textAlign,vertical:this._textBaseline}},l.default.Renderer.prototype.text=function(e,t,r,i,n){var o,a,s,l,u,h,c,f,d=this._pInst,p=Number.MAX_VALUE;if((this._doFill||this._doStroke)&&void 0!==e){if("string"!=typeof e&&(e=e.toString()),o=(e=e.replace(/(\t)/g," ")).split("\n"),void 0!==i){for(s=f=0;ss.HALF_PI&&e<=3*s.HALF_PI?Math.atan(r/i*Math.tan(e))+s.PI:Math.atan(r/i*Math.tan(e))+s.TWO_PI,t=t<=s.HALF_PI?Math.atan(r/i*Math.tan(t)):t>s.HALF_PI&&t<=3*s.HALF_PI?Math.atan(r/i*Math.tan(t))+s.PI:Math.atan(r/i*Math.tan(t))+s.TWO_PI),tv||Math.abs(this.accelerationY-this.pAccelerationY)>v||Math.abs(this.accelerationZ-this.pAccelerationZ)>v)&&e();var t=this.deviceTurned||window.deviceTurned;if("function"==typeof t){var r=this.rotationX+180,i=this.pRotationX+180,n=c+180;0>>24],i+=x[(16711680&C)>>16],n+=x[(65280&C)>>8],o+=x[255&C],r+=k[_],s++}w[l=T+y]=a/r,S[l]=i/r,M[l]=n/r,E[l]=o/r}T+=d}for(h=(u=-P)*d,b=T=0;b>>16,e[r+1]=(65280&t[i])>>>8,e[r+2]=255&t[i],e[r+3]=(4278190080&t[i])>>>24},O._toImageData=function(e){return e instanceof ImageData?e:e.getContext("2d").getImageData(0,0,e.width,e.height)},O._createImageData=function(e,t){return O._tmpCanvas=document.createElement("canvas"),O._tmpCtx=O._tmpCanvas.getContext("2d"),this._tmpCtx.createImageData(e,t)},O.apply=function(e,t,r){var i=e.getContext("2d"),n=i.getImageData(0,0,e.width,e.height),o=t(n,r);o instanceof ImageData?i.putImageData(o,0,0,0,0,e.width,e.height):i.putImageData(n,0,0,0,0,e.width,e.height)},O.threshold=function(e,t){var r=O._toPixels(e);void 0===t&&(t=.5);for(var i=Math.floor(255*t),n=0;n>8)/i,r[n+1]=255*(a*t>>8)/i,r[n+2]=255*(s*t>>8)/i}},O.dilate=function(e){for(var t,r,i,n,o,a,s,l,u,h,c,f,d,p,m,g,v,y=O._toPixels(e),b=0,_=y.length?y.length/4:0,x=new Int32Array(_);b<_;)for(r=(t=b)+e.width;b>16&255)+151*(i>>8&255)+28*(255&i))<(m=77*(c>>16&255)+151*(c>>8&255)+28*(255&c))&&(n=c,o=m),o<(p=77*((h=O._getARGB(y,a))>>16&255)+151*(h>>8&255)+28*(255&h))&&(n=h,o=p),o<(g=77*(f>>16&255)+151*(f>>8&255)+28*(255&f))&&(n=f,o=g),o<(v=77*(d>>16&255)+151*(d>>8&255)+28*(255&d))&&(n=d,o=v),x[b++]=n;O._setPixels(y,x)},O.erode=function(e){for(var t,r,i,n,o,a,s,l,u,h,c,f,d,p,m,g,v,y=O._toPixels(e),b=0,_=y.length?y.length/4:0,x=new Int32Array(_);b<_;)for(r=(t=b)+e.width;b>16&255)+151*(c>>8&255)+28*(255&c))<(o=77*(i>>16&255)+151*(i>>8&255)+28*(255&i))&&(n=c,o=m),(p=77*((h=O._getARGB(y,a))>>16&255)+151*(h>>8&255)+28*(255&h))>16&255)+151*(f>>8&255)+28*(255&f))>16&255)+151*(d>>8&255)+28*(255&d))=r){var i=Math.floor(t.timeDisplayed/r);if(t.timeDisplayed=0,t.displayIndex+=i,t.loopCount=Math.floor(t.displayIndex/t.numFrames),null!==t.loopLimit&&t.loopCount>=t.loopLimit)t.playing=!1;else{var n=t.displayIndex%t.numFrames;this.drawingContext.putImageData(t.frames[n].image,0,0),t.displayIndex=n,this.setModified(!0)}}}},n.default.Image.prototype._setProperty=function(e,t){this[e]=t,this.setModified(!0)},n.default.Image.prototype.loadPixels=function(){n.default.Renderer2D.prototype.loadPixels.call(this),this.setModified(!0)},n.default.Image.prototype.updatePixels=function(e,t,r,i){n.default.Renderer2D.prototype.updatePixels.call(this,e,t,r,i),this.setModified(!0)},n.default.Image.prototype.get=function(e,t,r,i){return n.default._validateParameters("p5.Image.get",arguments),n.default.Renderer2D.prototype.get.apply(this,arguments)},n.default.Image.prototype._getPixel=n.default.Renderer2D.prototype._getPixel,n.default.Image.prototype.set=function(e,t,r){n.default.Renderer2D.prototype.set.call(this,e,t,r),this.setModified(!0)},n.default.Image.prototype.resize=function(e,t){0===e&&0===t?(e=this.canvas.width,t=this.canvas.height):0===e?e=this.canvas.width*t/this.canvas.height:0===t&&(t=this.canvas.height*e/this.canvas.width),e=Math.floor(e),t=Math.floor(t);var r=document.createElement("canvas");if(r.width=e,r.height=t,this.gifProperties)for(var i=this.gifProperties,n=function(e,t){for(var r=0,i=0;i/g,">").replace(/"/g,""").replace(/'/g,"'")}function l(e,t){t&&!0!==t&&"true"!==t||(t="");var r="";return(e=e||"untitled")&&e.includes(".")&&(r=e.split(".").pop()),t&&r!==t&&(r=t,e="".concat(e,".").concat(r)),[e,r]}e("../core/error_helpers"),v.default.prototype.loadJSON=function(){for(var e=arguments.length,t=new Array(e),r=0;r"),n.print("");if(n.print(' '),n.print(""),n.print(""),n.print(" "),"0"!==o[0]){n.print(" ");for(var h=0;h".concat(c)),n.print(" ")}n.print(" ")}for(var f=0;f");for(var d=0;d".concat(p)),n.print(" ")}n.print(" ")}n.print("
"),n.print(""),n.print("")}n.close(),n.clear()},v.default.prototype.writeFile=function(e,t,r){var i="application/octet-stream";v.default.prototype._isSafari()&&(i="text/plain");var n=new Blob(e,{type:i});v.default.prototype.downloadFile(n,t,r)},v.default.prototype.downloadFile=function(e,t,r){var i=l(t,r),n=i[0];if(e instanceof Blob)s.default.saveAs(e,n);else{var o=document.createElement("a");if(o.href=e,o.download=n,o.onclick=function(e){var t;t=e,document.body.removeChild(t.target),e.stopPropagation()},o.style.display="none",document.body.appendChild(o),v.default.prototype._isSafari()){var a="Hello, Safari user! To download this file...\n";a+="1. Go to File --\x3e Save As.\n",a+='2. Choose "Page Source" as the Format.\n',a+='3. Name it with this extension: ."'.concat(i[1],'"'),alert(a)}o.click()}},v.default.prototype._checkFileExtension=l,v.default.prototype._isSafari=function(){return 0>>0},getSeed:function(){return t},rand:function(){return(r=(1664525*r+1013904223)%i)/i}});n.setSeed(e),_=new Array(4096);for(var o=0;o<4096;o++)_[o]=n.rand()};var o=n.default;r.default=o},{"../core/main":49}],82:[function(e,t,r){"use strict";function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i,l=(i=e("../core/main"))&&i.__esModule?i:{default:i},o=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==a(e)&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var o=i?Object.getOwnPropertyDescriptor(e,n):null;o&&(o.get||o.set)?Object.defineProperty(r,n,o):r[n]=e[n]}r.default=e,t&&t.set(e,r);return r}(e("../core/constants"));function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}l.default.Vector=function(e,t,r){var i,n,o;o=e instanceof l.default?(this.p5=e,i=t[0]||0,n=t[1]||0,t[2]||0):(i=e||0,n=t||0,r||0),this.x=i,this.y=n,this.z=o},l.default.Vector.prototype.toString=function(){return"p5.Vector Object : [".concat(this.x,", ").concat(this.y,", ").concat(this.z,"]")},l.default.Vector.prototype.set=function(e,t,r){return e instanceof l.default.Vector?(this.x=e.x||0,this.y=e.y||0,this.z=e.z||0):e instanceof Array?(this.x=e[0]||0,this.y=e[1]||0,this.z=e[2]||0):(this.x=e||0,this.y=t||0,this.z=r||0),this},l.default.Vector.prototype.copy=function(){return this.p5?new l.default.Vector(this.p5,[this.x,this.y,this.z]):new l.default.Vector(this.x,this.y,this.z)},l.default.Vector.prototype.add=function(e,t,r){return e instanceof l.default.Vector?(this.x+=e.x||0,this.y+=e.y||0,this.z+=e.z||0):e instanceof Array?(this.x+=e[0]||0,this.y+=e[1]||0,this.z+=e[2]||0):(this.x+=e||0,this.y+=t||0,this.z+=r||0),this};function u(e,t){return 0!==e&&(this.x=this.x%e),0!==t&&(this.y=this.y%t),this}function h(e,t,r){return 0!==e&&(this.x=this.x%e),0!==t&&(this.y=this.y%t),0!==r&&(this.z=this.z%r),this}l.default.Vector.prototype.rem=function(e,t,r){if(e instanceof l.default.Vector){if(Number.isFinite(e.x)&&Number.isFinite(e.y)&&Number.isFinite(e.z)){var i=parseFloat(e.x),n=parseFloat(e.y),o=parseFloat(e.z);h.call(this,i,n,o)}}else if(e instanceof Array)e.every(function(e){return Number.isFinite(e)})&&(2===e.length&&u.call(this,e[0],e[1]),3===e.length&&h.call(this,e[0],e[1],e[2]));else if(1===arguments.length){if(Number.isFinite(e)&&0!==e)return this.x=this.x%e,this.y=this.y%e,this.z=this.z%e,this}else if(2===arguments.length){var a=Array.prototype.slice.call(arguments);a.every(function(e){return Number.isFinite(e)})&&2===a.length&&u.call(this,a[0],a[1])}else if(3===arguments.length){var s=Array.prototype.slice.call(arguments);s.every(function(e){return Number.isFinite(e)})&&3===s.length&&h.call(this,s[0],s[1],s[2])}},l.default.Vector.prototype.sub=function(e,t,r){return e instanceof l.default.Vector?(this.x-=e.x||0,this.y-=e.y||0,this.z-=e.z||0):e instanceof Array?(this.x-=e[0]||0,this.y-=e[1]||0,this.z-=e[2]||0):(this.x-=e||0,this.y-=t||0,this.z-=r||0),this},l.default.Vector.prototype.mult=function(e){return"number"==typeof e&&isFinite(e)?(this.x*=e,this.y*=e,this.z*=e):console.warn("p5.Vector.prototype.mult:","n is undefined or not a finite number"),this},l.default.Vector.prototype.div=function(e){return"number"==typeof e&&isFinite(e)?0===e?console.warn("p5.Vector.prototype.div:","divide by 0"):(this.x/=e,this.y/=e,this.z/=e):console.warn("p5.Vector.prototype.div:","n is undefined or not a finite number"),this},l.default.Vector.prototype.mag=function(){return Math.sqrt(this.magSq())},l.default.Vector.prototype.magSq=function(){var e=this.x,t=this.y,r=this.z;return e*e+t*t+r*r},l.default.Vector.prototype.dot=function(e,t,r){return e instanceof l.default.Vector?this.dot(e.x,e.y,e.z):this.x*(e||0)+this.y*(t||0)+this.z*(r||0)},l.default.Vector.prototype.cross=function(e){var t=this.y*e.z-this.z*e.y,r=this.z*e.x-this.x*e.z,i=this.x*e.y-this.y*e.x;return this.p5?new l.default.Vector(this.p5,[t,r,i]):new l.default.Vector(t,r,i)},l.default.Vector.prototype.dist=function(e){return e.copy().sub(this).mag()},l.default.Vector.prototype.normalize=function(){var e=this.mag();return 0!==e&&this.mult(1/e),this},l.default.Vector.prototype.limit=function(e){var t=this.magSq();return e*e>>0},n.default.prototype.randomSeed=function(e){this._lcgSetSeed(o,e),this._gaussian_previous=!1},n.default.prototype.random=function(e,t){var r;if(n.default._validateParameters("random",arguments),r=null!=this[o]?this._lcg(o):Math.random(),void 0===e)return r;if(void 0===t)return e instanceof Array?e[Math.floor(r*e.length)]:r*e;if(tf){var P=p,L=l,k=u;p=d+f*(s&&d=t&&(r=r.substring(r.length-t,r.length)),r}},n.default.prototype.unhex=function(e){return e instanceof Array?e.map(n.default.prototype.unhex):parseInt("0x".concat(e),16)};var o=n.default;r.default=o},{"../core/main":49}],90:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i,a=(i=e("../core/main"))&&i.__esModule?i:{default:i};function n(e,t,r){var i=e<0,n=i?e.toString().substring(1):e.toString(),o=n.indexOf("."),a=-1!==o?n.substring(0,o):n,s=-1!==o?n.substring(o+1):"",l=i?"-":"";if(void 0!==r){var u="";(-1!==o||0r&&(s=s.substring(0,r));for(var h=0;hi.length)for(var o=t-(i+=-1===r?".":"").length+1,a=0;a=d.TWO_PI?"".concat("ellipse","|").concat(u,"|"):"".concat("arc","|").concat(a,"|").concat(s,"|").concat(l,"|").concat(u,"|"),!this.geometryInHash(t)){var h=new T.default.Geometry(u,1,function(){if(this.strokeIndices=[],a.toFixed(10)!==s.toFixed(10)){l!==d.PIE&&void 0!==l||(this.vertices.push(new T.default.Vector(.5,.5,0)),this.uvs.push([.5,.5]));for(var e=0;e<=u;e++){var t=(s-a)*(e/u)+a,r=.5+Math.cos(t)/2,i=.5+Math.sin(t)/2;this.vertices.push(new T.default.Vector(r,i,0)),this.uvs.push([r,i]),e>5&31)/31,(y>>10&31)/31):(r=a,i=s,l)}for(var b=1;b<=3;b++){var _=p+12*b,x=new S.default.Vector(u.getFloat32(_,!0),u.getFloat32(8+_,!0),u.getFloat32(4+_,!0));e.vertices.push(x),c&&o.push(r,i,n)}var w=new S.default.Vector(m,g,v);e.vertexNormals.push(w,w,w),e.faces.push([3*d,3*d+1,3*d+2]),e.uvs.push([0,0],[0,0],[0,0])}}(e,t);else{var r=new DataView(t);if(!("TextDecoder"in window))return console.warn("Sorry, ASCII STL loading only works in browsers that support TextDecoder (https://caniuse.com/#feat=textencoder)");var i=new TextDecoder("utf-8").decode(r).split("\n");!function(e,t){for(var r,i,n="",o=[],a=0;aMath.PI?l=Math.PI:l<=0&&(l=.001);var u=Math.sin(l)*a*Math.sin(s),h=Math.cos(l)*a,c=Math.sin(l)*a*Math.cos(s);this.camera(u+this.centerX,h+this.centerY,c+this.centerZ,this.centerX,this.centerY,this.centerZ,0,1,0)},m.default.Camera.prototype._isActive=function(){return this===this._renderer._curCamera},m.default.prototype.setCamera=function(e){this._renderer._curCamera=e,this._renderer.uPMatrix.set(e.projMatrix.mat4[0],e.projMatrix.mat4[1],e.projMatrix.mat4[2],e.projMatrix.mat4[3],e.projMatrix.mat4[4],e.projMatrix.mat4[5],e.projMatrix.mat4[6],e.projMatrix.mat4[7],e.projMatrix.mat4[8],e.projMatrix.mat4[9],e.projMatrix.mat4[10],e.projMatrix.mat4[11],e.projMatrix.mat4[12],e.projMatrix.mat4[13],e.projMatrix.mat4[14],e.projMatrix.mat4[15])};var n=m.default.Camera;r.default=n},{"../core/main":49}],98:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i,h=(i=e("../core/main"))&&i.__esModule?i:{default:i};h.default.Geometry=function(e,t,r){return this.vertices=[],this.lineVertices=[],this.lineNormals=[],this.vertexNormals=[],this.faces=[],this.uvs=[],this.edges=[],this.vertexColors=[],this.detailX=void 0!==e?e:1,this.detailY=void 0!==t?t:1,this.dirtyFlags={},r instanceof Function&&r.call(this),this},h.default.Geometry.prototype.reset=function(){this.lineVertices.length=0,this.lineNormals.length=0,this.vertices.length=0,this.edges.length=0,this.vertexColors.length=0,this.vertexNormals.length=0,this.uvs.length=0,this.dirtyFlags={}},h.default.Geometry.prototype.computeFaces=function(){this.faces.length=0;for(var e,t,r,i,n=this.detailX+1,o=0;othis.vertices.length-1-this.detailX;i--)e.add(this.vertexNormals[i]);e=h.default.Vector.div(e,this.detailX);for(var n=this.vertices.length-1;n>this.vertices.length-1-this.detailX;n--)this.vertexNormals[n]=e;return this},h.default.Geometry.prototype._makeTriangleEdges=function(){if(this.edges.length=0,Array.isArray(this.strokeIndices))for(var e=0,t=this.strokeIndices.length;e vTexCoord.y;\n bool y1 = p1.y > vTexCoord.y;\n bool y2 = p2.y > vTexCoord.y;\n\n // could web be under the curve (after t1)?\n if (y1 ? !y2 : y0) {\n // add the coverage for t1\n coverage.x += saturate(C1.x + 0.5);\n // calculate the anti-aliasing for t1\n weight.x = min(weight.x, abs(C1.x));\n }\n\n // are we outside the curve (after t2)?\n if (y1 ? !y0 : y2) {\n // subtract the coverage for t2\n coverage.x -= saturate(C2.x + 0.5);\n // calculate the anti-aliasing for t2\n weight.x = min(weight.x, abs(C2.x));\n }\n}\n\n// this is essentially the same as coverageX, but with the axes swapped\nvoid coverageY(vec2 p0, vec2 p1, vec2 p2) {\n\n vec2 C1, C2;\n calulateCrossings(p0, p1, p2, C1, C2);\n\n bool x0 = p0.x > vTexCoord.x;\n bool x1 = p1.x > vTexCoord.x;\n bool x2 = p2.x > vTexCoord.x;\n\n if (x1 ? !x2 : x0) {\n coverage.y -= saturate(C1.y + 0.5);\n weight.y = min(weight.y, abs(C1.y));\n }\n\n if (x1 ? !x0 : x2) {\n coverage.y += saturate(C2.y + 0.5);\n weight.y = min(weight.y, abs(C2.y));\n }\n}\n\nvoid main() {\n\n // calculate the pixel scale based on screen-coordinates\n pixelScale = hardness / fwidth(vTexCoord);\n\n // which grid cell is this pixel in?\n ivec2 gridCoord = ifloor(vTexCoord * vec2(uGridSize));\n\n // intersect curves in this row\n {\n // the index into the row info bitmap\n int rowIndex = gridCoord.y + uGridOffset.y;\n // fetch the info texel\n vec4 rowInfo = getTexel(uSamplerRows, rowIndex, uGridImageSize);\n // unpack the rowInfo\n int rowStrokeIndex = getInt16(rowInfo.xy);\n int rowStrokeCount = getInt16(rowInfo.zw);\n\n for (int iRowStroke = INT(0); iRowStroke < N; iRowStroke++) {\n if (iRowStroke >= rowStrokeCount)\n break;\n\n // each stroke is made up of 3 points: the start and control point\n // and the start of the next curve.\n // fetch the indices of this pair of strokes:\n vec4 strokeIndices = getTexel(uSamplerRowStrokes, rowStrokeIndex++, uCellsImageSize);\n\n // unpack the stroke index\n int strokePos = getInt16(strokeIndices.xy);\n\n // fetch the two strokes\n vec4 stroke0 = getTexel(uSamplerStrokes, strokePos + INT(0), uStrokeImageSize);\n vec4 stroke1 = getTexel(uSamplerStrokes, strokePos + INT(1), uStrokeImageSize);\n\n // calculate the coverage\n coverageX(stroke0.xy, stroke0.zw, stroke1.xy);\n }\n }\n\n // intersect curves in this column\n {\n int colIndex = gridCoord.x + uGridOffset.x;\n vec4 colInfo = getTexel(uSamplerCols, colIndex, uGridImageSize);\n int colStrokeIndex = getInt16(colInfo.xy);\n int colStrokeCount = getInt16(colInfo.zw);\n \n for (int iColStroke = INT(0); iColStroke < N; iColStroke++) {\n if (iColStroke >= colStrokeCount)\n break;\n\n vec4 strokeIndices = getTexel(uSamplerColStrokes, colStrokeIndex++, uCellsImageSize);\n\n int strokePos = getInt16(strokeIndices.xy);\n vec4 stroke0 = getTexel(uSamplerStrokes, strokePos + INT(0), uStrokeImageSize);\n vec4 stroke1 = getTexel(uSamplerStrokes, strokePos + INT(1), uStrokeImageSize);\n coverageY(stroke0.xy, stroke0.zw, stroke1.xy);\n }\n }\n\n weight = saturate(1.0 - weight * 2.0);\n float distance = max(weight.x + weight.y, minDistance); // manhattan approx.\n float antialias = abs(dot(coverage, weight) / distance);\n float cover = min(abs(coverage.x), abs(coverage.y));\n gl_FragColor = uMaterialColor;\n gl_FragColor.a *= saturate(max(antialias, cover));\n}",lineVert:"/*\n Part of the Processing project - http://processing.org\n Copyright (c) 2012-15 The Processing Foundation\n Copyright (c) 2004-12 Ben Fry and Casey Reas\n Copyright (c) 2001-04 Massachusetts Institute of Technology\n This library is free software; you can redistribute it and/or\n modify it under the terms of the GNU Lesser General Public\n License as published by the Free Software Foundation, version 2.1.\n This library is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n Lesser General Public License for more details.\n You should have received a copy of the GNU Lesser General\n Public License along with this library; if not, write to the\n Free Software Foundation, Inc., 59 Temple Place, Suite 330,\n Boston, MA 02111-1307 USA\n*/\n\n#define PROCESSING_LINE_SHADER\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform float uStrokeWeight;\n\nuniform vec4 uViewport;\nuniform int uPerspective;\n\nattribute vec4 aPosition;\nattribute vec4 aDirection;\n \nvoid main() {\n // using a scale <1 moves the lines towards the camera\n // in order to prevent popping effects due to half of\n // the line disappearing behind the geometry faces.\n vec3 scale = vec3(0.9995);\n\n vec4 posp = uModelViewMatrix * aPosition;\n vec4 posq = uModelViewMatrix * (aPosition + vec4(aDirection.xyz, 0));\n\n // Moving vertices slightly toward the camera\n // to avoid depth-fighting with the fill triangles.\n // Discussed here:\n // http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Number=252848 \n posp.xyz = posp.xyz * scale;\n posq.xyz = posq.xyz * scale;\n\n vec4 p = uProjectionMatrix * posp;\n vec4 q = uProjectionMatrix * posq;\n\n // formula to convert from clip space (range -1..1) to screen space (range 0..[width or height])\n // screen_p = (p.xy/p.w + <1,1>) * 0.5 * uViewport.zw\n\n // prevent division by W by transforming the tangent formula (div by 0 causes\n // the line to disappear, see https://github.com/processing/processing/issues/5183)\n // t = screen_q - screen_p\n //\n // tangent is normalized and we don't care which aDirection it points to (+-)\n // t = +- normalize( screen_q - screen_p )\n // t = +- normalize( (q.xy/q.w+<1,1>)*0.5*uViewport.zw - (p.xy/p.w+<1,1>)*0.5*uViewport.zw )\n //\n // extract common factor, <1,1> - <1,1> cancels out\n // t = +- normalize( (q.xy/q.w - p.xy/p.w) * 0.5 * uViewport.zw )\n //\n // convert to common divisor\n // t = +- normalize( ((q.xy*p.w - p.xy*q.w) / (p.w*q.w)) * 0.5 * uViewport.zw )\n //\n // remove the common scalar divisor/factor, not needed due to normalize and +-\n // (keep uViewport - can't remove because it has different components for x and y\n // and corrects for aspect ratio, see https://github.com/processing/processing/issues/5181)\n // t = +- normalize( (q.xy*p.w - p.xy*q.w) * uViewport.zw )\n\n vec2 tangent = normalize((q.xy*p.w - p.xy*q.w) * uViewport.zw);\n\n // flip tangent to normal (it's already normalized)\n vec2 normal = vec2(-tangent.y, tangent.x);\n\n float thickness = aDirection.w * uStrokeWeight;\n vec2 offset = normal * thickness / 2.0;\n\n vec2 curPerspScale;\n\n if(uPerspective == 1) {\n // Perspective ---\n // convert from world to clip by multiplying with projection scaling factor\n // to get the right thickness (see https://github.com/processing/processing/issues/5182)\n // invert Y, projections in Processing invert Y\n curPerspScale = (uProjectionMatrix * vec4(1, -1, 0, 0)).xy;\n } else {\n // No Perspective ---\n // multiply by W (to cancel out division by W later in the pipeline) and\n // convert from screen to clip (derived from clip to screen above)\n curPerspScale = p.w / (0.5 * uViewport.zw);\n }\n\n gl_Position.xy = p.xy + offset.xy * curPerspScale;\n gl_Position.zw = p.zw;\n}\n",lineFrag:"precision mediump float;\nprecision mediump int;\n\nuniform vec4 uMaterialColor;\n\nvoid main() {\n gl_FragColor = uMaterialColor;\n}",pointVert:"attribute vec3 aPosition;\nuniform float uPointSize;\nvarying float vStrokeWeight;\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nvoid main() {\n\tvec4 positionVec4 = vec4(aPosition, 1.0);\n\tgl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n\tgl_PointSize = uPointSize;\n\tvStrokeWeight = uPointSize;\n}",pointFrag:"precision mediump float;\nprecision mediump int;\nuniform vec4 uMaterialColor;\nvarying float vStrokeWeight;\n\nvoid main(){\n\tfloat mask = 0.0;\n\n\t// make a circular mask using the gl_PointCoord (goes from 0 - 1 on a point)\n // might be able to get a nicer edge on big strokeweights with smoothstep but slightly less performant\n\n\tmask = step(0.98, length(gl_PointCoord * 2.0 - 1.0));\n\n\t// if strokeWeight is 1 or less lets just draw a square\n\t// this prevents weird artifacting from carving circles when our points are really small\n\t// if strokeWeight is larger than 1, we just use it as is\n\n\tmask = mix(0.0, mask, clamp(floor(vStrokeWeight - 0.5),0.0,1.0));\n\n\t// throw away the borders of the mask\n // otherwise we get weird alpha blending issues\n\n\tif(mask > 0.98){\n discard;\n \t}\n\n \tgl_FragColor = vec4(uMaterialColor.rgb * (1.0 - mask), uMaterialColor.a) ;\n}"};u.default.RendererGL=function(e,t,r,i){return u.default.Renderer.call(this,e,t,r),this._setAttributeDefaults(t),this._initContext(),this.isP3D=!0,this.GL=this.drawingContext,this._isErasing=!1,this._enableLighting=!1,this.ambientLightColors=[],this.specularColors=[1,1,1],this.directionalLightDirections=[],this.directionalLightDiffuseColors=[],this.directionalLightSpecularColors=[],this.pointLightPositions=[],this.pointLightDiffuseColors=[],this.pointLightSpecularColors=[],this.spotLightPositions=[],this.spotLightDirections=[],this.spotLightDiffuseColors=[],this.spotLightSpecularColors=[],this.spotLightAngle=[],this.spotLightConc=[],this.drawMode=o.FILL,this.curFillColor=this._cachedFillStyle=[1,1,1,1],this.curStrokeColor=this._cachedStrokeStyle=[0,0,0,1],this.curBlendMode=o.BLEND,this._cachedBlendMode=void 0,this.blendExt=this.GL.getExtension("EXT_blend_minmax"),this._isBlending=!1,this._useSpecularMaterial=!1,this._useEmissiveMaterial=!1,this._useNormalMaterial=!1,this._useShininess=1,this._tint=[255,255,255,255],this.constantAttenuation=1,this.linearAttenuation=0,this.quadraticAttenuation=0,this.uMVMatrix=new u.default.Matrix,this.uPMatrix=new u.default.Matrix,this.uNMatrix=new u.default.Matrix("mat3"),this._curCamera=new u.default.Camera(this),this._curCamera._computeCameraDefaultSettings(),this._curCamera._setDefaultCamera(),this._defaultLightShader=void 0,this._defaultImmediateModeShader=void 0,this._defaultNormalShader=void 0,this._defaultColorShader=void 0,this._defaultPointShader=void 0,this.userFillShader=void 0,this.userStrokeShader=void 0,this.userPointShader=void 0,this.retainedMode={geometry:{},buffers:{stroke:[new u.default.RenderBuffer(3,"lineVertices","lineVertexBuffer","aPosition",this,this._flatten),new u.default.RenderBuffer(4,"lineNormals","lineNormalBuffer","aDirection",this,this._flatten)],fill:[new u.default.RenderBuffer(3,"vertices","vertexBuffer","aPosition",this,this._vToNArray),new u.default.RenderBuffer(3,"vertexNormals","normalBuffer","aNormal",this,this._vToNArray),new u.default.RenderBuffer(4,"vertexColors","colorBuffer","aMaterialColor",this),new u.default.RenderBuffer(3,"vertexAmbients","ambientBuffer","aAmbientColor",this),new u.default.RenderBuffer(2,"uvs","uvBuffer","aTexCoord",this,this._flatten)],text:[new u.default.RenderBuffer(3,"vertices","vertexBuffer","aPosition",this,this._vToNArray),new u.default.RenderBuffer(2,"uvs","uvBuffer","aTexCoord",this,this._flatten)]}},this.immediateMode={geometry:new u.default.Geometry,shapeMode:o.TRIANGLE_FAN,_bezierVertex:[],_quadraticVertex:[],_curveVertex:[],buffers:{fill:[new u.default.RenderBuffer(3,"vertices","vertexBuffer","aPosition",this,this._vToNArray),new u.default.RenderBuffer(3,"vertexNormals","normalBuffer","aNormal",this,this._vToNArray),new u.default.RenderBuffer(4,"vertexColors","colorBuffer","aVertexColor",this),new u.default.RenderBuffer(3,"vertexAmbients","ambientBuffer","aAmbientColor",this),new u.default.RenderBuffer(2,"uvs","uvBuffer","aTexCoord",this,this._flatten)],stroke:[new u.default.RenderBuffer(3,"lineVertices","lineVertexBuffer","aPosition",this,this._flatten),new u.default.RenderBuffer(4,"lineNormals","lineNormalBuffer","aDirection",this,this._flatten)],point:this.GL.createBuffer()}},this.pointSize=5,this.curStrokeWeight=1,this.textures=[],this.textureMode=o.IMAGE,this.textureWrapX=o.CLAMP,this.textureWrapY=o.CLAMP,this._tex=null,this._curveTightness=6,this._lookUpTableBezier=[],this._lookUpTableQuadratic=[],this._lutBezierDetail=0,this._lutQuadraticDetail=0,this._tessy=this._initTessy(),this.fontInfos={},this._curShader=void 0,this},u.default.RendererGL.prototype=Object.create(u.default.Renderer.prototype),u.default.RendererGL.prototype._setAttributeDefaults=function(e){var t={alpha:!0,depth:!0,stencil:!0,antialias:navigator.userAgent.toLowerCase().includes("safari"),premultipliedAlpha:!1,preserveDrawingBuffer:!0,perPixelLighting:!0};null===e._glAttributes?e._glAttributes=t:e._glAttributes=Object.assign(t,e._glAttributes)},u.default.RendererGL.prototype._initContext=function(){try{if(this.drawingContext=this.canvas.getContext("webgl",this._pInst._glAttributes)||this.canvas.getContext("experimental-webgl",this._pInst._glAttributes),null===this.drawingContext)throw new Error("Error creating webgl context");var e=this.drawingContext;e.enable(e.DEPTH_TEST),e.depthFunc(e.LEQUAL),e.viewport(0,0,e.drawingBufferWidth,e.drawingBufferHeight),this._viewport=this.drawingContext.getParameter(this.drawingContext.VIEWPORT)}catch(e){throw e}},u.default.RendererGL.prototype._resetContext=function(e,t){var r=this.width,i=this.height,n=this.canvas.id,o=this._pInst instanceof u.default.Graphics;if(o){var a=this._pInst;a.canvas.parentNode.removeChild(a.canvas),a.canvas=document.createElement("canvas"),(a._pInst._userNode||document.body).appendChild(a.canvas),u.default.Element.call(a,a.canvas,a._pInst),a.width=r,a.height=i}else{var s=this.canvas;s&&s.parentNode.removeChild(s),(s=document.createElement("canvas")).id=n,this._pInst._userNode?this._pInst._userNode.appendChild(s):document.body.appendChild(s),this._pInst.canvas=s}var l=new u.default.RendererGL(this._pInst.canvas,this._pInst,!o);this._pInst._setProperty("_renderer",l),l.resize(r,i),l._applyDefaults(),o||this._pInst._elements.push(l),"function"==typeof t&&setTimeout(function(){t.apply(window._renderer,e)},0)},u.default.prototype.setAttributes=function(e,t){if(void 0!==this._glAttributes){var r=!0;if(void 0!==t?(null===this._glAttributes&&(this._glAttributes={}),this._glAttributes[e]!==t&&(this._glAttributes[e]=t,r=!1)):e instanceof Object&&this._glAttributes!==e&&(this._glAttributes=e,r=!1),this._renderer.isP3D&&!r){if(!this._setupDone)for(var i in this._renderer.retainedMode.geometry)if(this._renderer.retainedMode.geometry.hasOwnProperty(i))return void console.error("Sorry, Could not set the attributes, you need to call setAttributes() before calling the other drawing methods in setup()");this.push(),this._renderer._resetContext(),this.pop(),this._renderer._curCamera&&(this._renderer._curCamera._renderer=this._renderer)}}else console.log("You are trying to use setAttributes on a p5.Graphics object that does not use a WEBGL renderer.")},u.default.RendererGL.prototype._update=function(){this.uMVMatrix.set(this._curCamera.cameraMatrix.mat4[0],this._curCamera.cameraMatrix.mat4[1],this._curCamera.cameraMatrix.mat4[2],this._curCamera.cameraMatrix.mat4[3],this._curCamera.cameraMatrix.mat4[4],this._curCamera.cameraMatrix.mat4[5],this._curCamera.cameraMatrix.mat4[6],this._curCamera.cameraMatrix.mat4[7],this._curCamera.cameraMatrix.mat4[8],this._curCamera.cameraMatrix.mat4[9],this._curCamera.cameraMatrix.mat4[10],this._curCamera.cameraMatrix.mat4[11],this._curCamera.cameraMatrix.mat4[12],this._curCamera.cameraMatrix.mat4[13],this._curCamera.cameraMatrix.mat4[14],this._curCamera.cameraMatrix.mat4[15]),this.ambientLightColors.length=0,this.specularColors=[1,1,1],this.directionalLightDirections.length=0,this.directionalLightDiffuseColors.length=0,this.directionalLightSpecularColors.length=0,this.pointLightPositions.length=0,this.pointLightDiffuseColors.length=0,this.pointLightSpecularColors.length=0,this.spotLightPositions.length=0,this.spotLightDirections.length=0,this.spotLightDiffuseColors.length=0,this.spotLightSpecularColors.length=0,this.spotLightAngle.length=0,this.spotLightConc.length=0,this._enableLighting=!1,this._tint=[255,255,255,255],this.GL.clear(this.GL.DEPTH_BUFFER_BIT)},u.default.RendererGL.prototype.background=function(){var e,t=(e=this._pInst).color.apply(e,arguments),r=t.levels[0]/255,i=t.levels[1]/255,n=t.levels[2]/255,o=t.levels[3]/255;this.GL.clearColor(r,i,n,o),this.GL.clear(this.GL.COLOR_BUFFER_BIT)},u.default.RendererGL.prototype.fill=function(e,t,r,i){var n=u.default.prototype.color.apply(this._pInst,arguments);this.curFillColor=n._array,this.drawMode=o.FILL,this._useNormalMaterial=!1,this._tex=null},u.default.RendererGL.prototype.stroke=function(e,t,r,i){arguments[3]=255;var n=u.default.prototype.color.apply(this._pInst,arguments);this.curStrokeColor=n._array},u.default.RendererGL.prototype.strokeCap=function(e){console.error("Sorry, strokeCap() is not yet implemented in WEBGL mode")},u.default.RendererGL.prototype.strokeJoin=function(e){console.error("Sorry, strokeJoin() is not yet implemented in WEBGL mode")},u.default.RendererGL.prototype.filter=function(e){console.error("filter() does not work in WEBGL mode")},u.default.RendererGL.prototype.blendMode=function(e){e===o.DARKEST||e===o.LIGHTEST||e===o.ADD||e===o.BLEND||e===o.SUBTRACT||e===o.SCREEN||e===o.EXCLUSION||e===o.REPLACE||e===o.MULTIPLY||e===o.REMOVE?this.curBlendMode=e:e!==o.BURN&&e!==o.OVERLAY&&e!==o.HARD_LIGHT&&e!==o.SOFT_LIGHT&&e!==o.DODGE||console.warn("BURN, OVERLAY, HARD_LIGHT, SOFT_LIGHT, and DODGE only work for blendMode in 2D mode.")},u.default.RendererGL.prototype.erase=function(e,t){this._isErasing||(this._cachedBlendMode=this.curBlendMode,this.blendMode(o.REMOVE),this._cachedFillStyle=this.curFillColor.slice(),this.curFillColor=[1,1,1,e/255],this._cachedStrokeStyle=this.curStrokeColor.slice(),this.curStrokeColor=[1,1,1,t/255],this._isErasing=!0)},u.default.RendererGL.prototype.noErase=function(){this._isErasing&&(this.curFillColor=this._cachedFillStyle.slice(),this.curStrokeColor=this._cachedStrokeStyle.slice(),this.blendMode(this._cachedBlendMode),this._isErasing=!1)},u.default.RendererGL.prototype.strokeWeight=function(e){this.curStrokeWeight!==e&&(this.pointSize=e,this.curStrokeWeight=e)},u.default.RendererGL.prototype._getPixel=function(e,t){var r;return r=new Uint8Array(4),this.drawingContext.readPixels(e,t,1,1,this.drawingContext.RGBA,this.drawingContext.UNSIGNED_BYTE,r),[r[0],r[1],r[2],r[3]]},u.default.RendererGL.prototype.loadPixels=function(){var e=this._pixelsState;if(!0===this._pInst._glAttributes.preserveDrawingBuffer){var t=e.pixels,r=this.GL.drawingBufferWidth*this.GL.drawingBufferHeight*4;t instanceof Uint8Array&&t.length===r||(t=new Uint8Array(r),this._pixelsState._setProperty("pixels",t));var i=this._pInst._pixelDensity;this.GL.readPixels(0,0,this.width*i,this.height*i,this.GL.RGBA,this.GL.UNSIGNED_BYTE,t)}else console.log("loadPixels only works in WebGL when preserveDrawingBuffer is true.")},u.default.RendererGL.prototype.geometryInHash=function(e){return void 0!==this.retainedMode.geometry[e]},u.default.RendererGL.prototype.resize=function(e,t){u.default.Renderer.prototype.resize.call(this,e,t),this.GL.viewport(0,0,this.GL.drawingBufferWidth,this.GL.drawingBufferHeight),this._viewport=this.GL.getParameter(this.GL.VIEWPORT),this._curCamera._resize();var r=this._pixelsState;void 0!==r.pixels&&r._setProperty("pixels",new Uint8Array(this.GL.drawingBufferWidth*this.GL.drawingBufferHeight*4))},u.default.RendererGL.prototype.clear=function(){var e=(arguments.length<=0?void 0:arguments[0])||0,t=(arguments.length<=1?void 0:arguments[1])||0,r=(arguments.length<=2?void 0:arguments[2])||0,i=(arguments.length<=3?void 0:arguments[3])||0;this.GL.clearColor(e,t,r,i),this.GL.clear(this.GL.COLOR_BUFFER_BIT|this.GL.DEPTH_BUFFER_BIT)},u.default.RendererGL.prototype.applyMatrix=function(e,t,r,i,n,o){16===arguments.length?u.default.Matrix.prototype.apply.apply(this.uMVMatrix,arguments):this.uMVMatrix.apply([e,t,0,0,r,i,0,0,0,0,1,0,n,o,0,1])},u.default.RendererGL.prototype.translate=function(e,t,r){return e instanceof u.default.Vector&&(r=e.z,t=e.y,e=e.x),this.uMVMatrix.translate([e,t,r]),this},u.default.RendererGL.prototype.scale=function(e,t,r){return this.uMVMatrix.scale(e,t,r),this},u.default.RendererGL.prototype.rotate=function(e,t){return void 0===t?this.rotateZ(e):(u.default.Matrix.prototype.rotate.apply(this.uMVMatrix,arguments),this)},u.default.RendererGL.prototype.rotateX=function(e){return this.rotate(e,1,0,0),this},u.default.RendererGL.prototype.rotateY=function(e){return this.rotate(e,0,1,0),this},u.default.RendererGL.prototype.rotateZ=function(e){return this.rotate(e,0,0,1),this},u.default.RendererGL.prototype.push=function(){var e=u.default.Renderer.prototype.push.apply(this),t=e.properties;return t.uMVMatrix=this.uMVMatrix.copy(),t.uPMatrix=this.uPMatrix.copy(),t._curCamera=this._curCamera,this._curCamera=this._curCamera.copy(),t.ambientLightColors=this.ambientLightColors.slice(),t.specularColors=this.specularColors.slice(),t.directionalLightDirections=this.directionalLightDirections.slice(),t.directionalLightDiffuseColors=this.directionalLightDiffuseColors.slice(),t.directionalLightSpecularColors=this.directionalLightSpecularColors.slice(),t.pointLightPositions=this.pointLightPositions.slice(),t.pointLightDiffuseColors=this.pointLightDiffuseColors.slice(),t.pointLightSpecularColors=this.pointLightSpecularColors.slice(),t.spotLightPositions=this.spotLightPositions.slice(),t.spotLightDirections=this.spotLightDirections.slice(),t.spotLightDiffuseColors=this.spotLightDiffuseColors.slice(),t.spotLightSpecularColors=this.spotLightSpecularColors.slice(),t.spotLightAngle=this.spotLightAngle.slice(),t.spotLightConc=this.spotLightConc.slice(),t.userFillShader=this.userFillShader,t.userStrokeShader=this.userStrokeShader,t.userPointShader=this.userPointShader,t.pointSize=this.pointSize,t.curStrokeWeight=this.curStrokeWeight,t.curStrokeColor=this.curStrokeColor,t.curFillColor=this.curFillColor,t._useSpecularMaterial=this._useSpecularMaterial,t._useEmissiveMaterial=this._useEmissiveMaterial,t._useShininess=this._useShininess,t.constantAttenuation=this.constantAttenuation,t.linearAttenuation=this.linearAttenuation,t.quadraticAttenuation=this.quadraticAttenuation,t._enableLighting=this._enableLighting,t._useNormalMaterial=this._useNormalMaterial,t._tex=this._tex,t.drawMode=this.drawMode,e},u.default.RendererGL.prototype.resetMatrix=function(){return this.uMVMatrix=u.default.Matrix.identity(this._pInst),this},u.default.RendererGL.prototype._getImmediateStrokeShader=function(){var e=this.userStrokeShader;return e&&e.isStrokeShader()?e:this._getLineShader()},u.default.RendererGL.prototype._getRetainedStrokeShader=u.default.RendererGL.prototype._getImmediateStrokeShader,u.default.RendererGL.prototype._getImmediateFillShader=function(){var e=this.userFillShader;if(this._useNormalMaterial&&(!e||!e.isNormalShader()))return this._getNormalShader();if(this._enableLighting){if(!e||!e.isLightShader())return this._getLightShader()}else if(this._tex){if(!e||!e.isTextureShader())return this._getLightShader()}else if(!e)return this._getImmediateModeShader();return e},u.default.RendererGL.prototype._getRetainedFillShader=function(){if(this._useNormalMaterial)return this._getNormalShader();var e=this.userFillShader;if(this._enableLighting){if(!e||!e.isLightShader())return this._getLightShader()}else if(this._tex){if(!e||!e.isTextureShader())return this._getLightShader()}else if(!e)return this._getColorShader();return e},u.default.RendererGL.prototype._getImmediatePointShader=function(){var e=this.userPointShader;return e&&e.isPointShader()?e:this._getPointShader()},u.default.RendererGL.prototype._getRetainedLineShader=u.default.RendererGL.prototype._getImmediateLineShader,u.default.RendererGL.prototype._getLightShader=function(){return this._defaultLightShader||(this._pInst._glAttributes.perPixelLighting?this._defaultLightShader=new u.default.Shader(this,c.phongVert,c.phongFrag):this._defaultLightShader=new u.default.Shader(this,c.lightVert,c.lightTextureFrag)),this._defaultLightShader},u.default.RendererGL.prototype._getImmediateModeShader=function(){return this._defaultImmediateModeShader||(this._defaultImmediateModeShader=new u.default.Shader(this,c.immediateVert,c.vertexColorFrag)),this._defaultImmediateModeShader},u.default.RendererGL.prototype._getNormalShader=function(){return this._defaultNormalShader||(this._defaultNormalShader=new u.default.Shader(this,c.normalVert,c.normalFrag)),this._defaultNormalShader},u.default.RendererGL.prototype._getColorShader=function(){return this._defaultColorShader||(this._defaultColorShader=new u.default.Shader(this,c.normalVert,c.basicFrag)),this._defaultColorShader},u.default.RendererGL.prototype._getPointShader=function(){return this._defaultPointShader||(this._defaultPointShader=new u.default.Shader(this,c.pointVert,c.pointFrag)),this._defaultPointShader},u.default.RendererGL.prototype._getLineShader=function(){return this._defaultLineShader||(this._defaultLineShader=new u.default.Shader(this,c.lineVert,c.lineFrag)),this._defaultLineShader},u.default.RendererGL.prototype._getFontShader=function(){return this._defaultFontShader||(this.GL.getExtension("OES_standard_derivatives"),this._defaultFontShader=new u.default.Shader(this,c.fontVert,c.fontFrag)),this._defaultFontShader},u.default.RendererGL.prototype._getEmptyTexture=function(){if(!this._emptyTexture){var e=new u.default.Image(1,1);e.set(0,0,255),this._emptyTexture=new u.default.Texture(this,e)}return this._emptyTexture},u.default.RendererGL.prototype.getTexture=function(e){var t=this.textures,r=!0,i=!1,n=void 0;try{for(var o,a=t[Symbol.iterator]();!(r=(o=a.next()).done);r=!0){var s=o.value;if(s.src===e)return s}}catch(e){i=!0,n=e}finally{try{r||null==a.return||a.return()}finally{if(i)throw n}}var l=new u.default.Texture(this,e);return t.push(l),l},u.default.RendererGL.prototype._setStrokeUniforms=function(e){e.bindShader(),e.setUniform("uMaterialColor",this.curStrokeColor),e.setUniform("uStrokeWeight",this.curStrokeWeight)},u.default.RendererGL.prototype._setFillUniforms=function(e){e.bindShader(),e.setUniform("uMaterialColor",this.curFillColor),e.setUniform("isTexture",!!this._tex),this._tex&&e.setUniform("uSampler",this._tex),e.setUniform("uTint",this._tint),e.setUniform("uSpecular",this._useSpecularMaterial),e.setUniform("uEmissive",this._useEmissiveMaterial),e.setUniform("uShininess",this._useShininess),e.setUniform("uUseLighting",this._enableLighting);var t=this.pointLightDiffuseColors.length/3;e.setUniform("uPointLightCount",t),e.setUniform("uPointLightLocation",this.pointLightPositions),e.setUniform("uPointLightDiffuseColors",this.pointLightDiffuseColors),e.setUniform("uPointLightSpecularColors",this.pointLightSpecularColors);var r=this.directionalLightDiffuseColors.length/3;e.setUniform("uDirectionalLightCount",r),e.setUniform("uLightingDirection",this.directionalLightDirections),e.setUniform("uDirectionalDiffuseColors",this.directionalLightDiffuseColors),e.setUniform("uDirectionalSpecularColors",this.directionalLightSpecularColors);var i=this.ambientLightColors.length/3;e.setUniform("uAmbientLightCount",i),e.setUniform("uAmbientColor",this.ambientLightColors);var n=this.spotLightDiffuseColors.length/3;e.setUniform("uSpotLightCount",n),e.setUniform("uSpotLightAngle",this.spotLightAngle),e.setUniform("uSpotLightConc",this.spotLightConc),e.setUniform("uSpotLightDiffuseColors",this.spotLightDiffuseColors),e.setUniform("uSpotLightSpecularColors",this.spotLightSpecularColors),e.setUniform("uSpotLightLocation",this.spotLightPositions),e.setUniform("uSpotLightDirection",this.spotLightDirections),e.setUniform("uConstantAttenuation",this.constantAttenuation),e.setUniform("uLinearAttenuation",this.linearAttenuation),e.setUniform("uQuadraticAttenuation",this.quadraticAttenuation),e.bindTextures()},u.default.RendererGL.prototype._setPointUniforms=function(e){e.bindShader(),e.setUniform("uMaterialColor",this.curStrokeColor),e.setUniform("uPointSize",this.pointSize)},u.default.RendererGL.prototype._bindBuffer=function(e,t,r,i,n){if(t=t||this.GL.ARRAY_BUFFER,this.GL.bindBuffer(t,e),void 0!==r){var o=new(i||Float32Array)(r);this.GL.bufferData(t,o,n||this.GL.STATIC_DRAW)}},u.default.RendererGL.prototype._arraysEqual=function(e,t){var r=e.length;if(r!==t.length)return!1;for(var i=0;i>7,127&f,c>>7,127&c);for(var d=0;d>7,127&p,0,0)}}return{cellImageInfo:l,dimOffset:o,dimImageInfo:n}}return(t=this.glyphInfos[e.index]={glyph:e,uGlyphRect:[i.x1,-i.y1,i.x2,-i.y2],strokeImageInfo:U,strokes:d,colInfo:G(m,this.colDimImageInfos,this.colCellImageInfos),rowInfo:G(p,this.rowDimImageInfos,this.rowCellImageInfos)}).uGridOffset=[t.colInfo.dimOffset,t.rowInfo.dimOffset],t}}var z=Math.sqrt(3);j.default.RendererGL.prototype._renderText=function(e,t,r,i,n){if(this._textFont&&"string"!=typeof this._textFont){if(!(n<=i)&&this._doFill){if(!this._isOpenType())return console.log("WEBGL: only Opentype (.otf) and Truetype (.ttf) fonts are supported"),e;e.push();var o=this._doStroke,a=this.drawMode;this._doStroke=!1,this.drawMode=D.TEXTURE;var s=this._textFont.font,l=this._textFont._fontInfo;l=l||(this._textFont._fontInfo=new A(s));var u=this._textFont._handleAlignment(this,t,r,i),h=this._textSize/s.unitsPerEm;this.translate(u.x,u.y,0),this.scale(h,h,1);var c=this.GL,f=!this._defaultFontShader,d=this._getFontShader();d.init(),d.bindShader(),f&&(d.setUniform("uGridImageSize",[64,64]),d.setUniform("uCellsImageSize",[64,64]),d.setUniform("uStrokeImageSize",[64,64]),d.setUniform("uGridSize",[9,9])),this._applyColorBlend(this.curFillColor);var p=this.retainedMode.geometry.glyph;if(!p){var m=this._textGeom=new j.default.Geometry(1,1,function(){for(var e=0;e<=1;e++)for(var t=0;t<=1;t++)this.vertices.push(new j.default.Vector(t,e,0)),this.uvs.push(t,e)});m.computeFaces().computeNormals(),p=this.createBuffers("glyph",m)}var g=!0,v=!1,y=void 0;try{for(var b,_=this.retainedMode.buffers.text[Symbol.iterator]();!(g=(b=_.next()).done);g=!0){b.value._prepareBuffer(p,d)}}catch(e){v=!0,y=e}finally{try{g||null==_.return||_.return()}finally{if(v)throw y}}this._bindBuffer(p.indexBuffer,c.ELEMENT_ARRAY_BUFFER),d.setUniform("uMaterialColor",this.curFillColor);try{var x=0,w=null,S=s.stringToGlyphs(t),M=!0,E=!1,T=void 0;try{for(var C,P=S[Symbol.iterator]();!(M=(C=P.next()).done);M=!0){var L=C.value;w&&(x+=s.getKerningValue(w,L));var k=l.getGlyphInfo(L);if(k.uGlyphRect){var R=k.rowInfo,O=k.colInfo;d.setUniform("uSamplerStrokes",k.strokeImageInfo.imageData),d.setUniform("uSamplerRowStrokes",R.cellImageInfo.imageData),d.setUniform("uSamplerRows",R.dimImageInfo.imageData),d.setUniform("uSamplerColStrokes",O.cellImageInfo.imageData),d.setUniform("uSamplerCols",O.dimImageInfo.imageData),d.setUniform("uGridOffset",k.uGridOffset),d.setUniform("uGlyphRect",k.uGlyphRect),d.setUniform("uGlyphOffset",x),d.bindTextures(),c.drawElements(c.TRIANGLES,6,this.GL.UNSIGNED_SHORT,0)}x+=L.advanceWidth,w=L}}catch(e){E=!0,T=e}finally{try{M||null==P.return||P.return()}finally{if(E)throw T}}}finally{d.unbindShader(),this._doStroke=o,this.drawMode=a,e.pop()}return e}}else console.log("WEBGL: you must load and set a font before drawing text. See `loadFont` and `textFont` for more details.")}},{"../core/constants":42,"../core/main":49,"./p5.RendererGL.Retained":102,"./p5.Shader":104}],107:[function(e,t,r){t.exports={fes:{autoplay:"The media that tried to play (with '{{src}}') wasn't allowed to by this browser, most likely due to the browser's autoplay policy. Check out {{link}} for more information about why.",fileLoadError:{bytes:"It looks like there was a problem loading your file. {{suggestion}}",font:"It looks like there was a problem loading your font. {{suggestion}}",gif:"There was some trouble loading your GIF. Make sure that your GIF is using 87a or 89a encoding.",image:"It looks like there was a problem loading your image. {{suggestion}}",json:"It looks like there was a problem loading your JSON file. {{suggestion}}",large:"If your large file isn't fetched successfully, we recommend splitting the file into smaller segments and fetching those.",strings:"It looks like there was a problem loading your text file. {{suggestion}}",suggestion:"Try checking if the file path ({{filePath}}) is correct, hosting the file online, or running a local server. (More info at {{link}})",table:"It looks like there was a problem loading your table file. {{suggestion}}",xml:"It looks like there was a problem loading your XML file. {{suggestion}}"},misusedTopLevel:"Did you just try to use p5.js's {{symbolName}} {{symbolType}}? If so, you may want to move it into your sketch's setup() function.\n\nFor more details, see: {{link}}",pre:"🌸 p5.js says: {{message}}",welcome:"Welcome! This is your friendly debugger. To turn me off, switch to using p5.min.js."}}},{}],108:[function(e,t,r){t.exports={fes:{autoplay:"Su browser impidío un medio tocar (de '{{src}}'), posiblemente porque las reglas de autoplay. Para aprender más, visite {{link}}.",fileLoadError:{bytes:"",font:"",gif:"",image:"",json:"",large:"",strings:"",suggestion:"",table:"",xml:""},misusedTopLevel:"",pre:"🌸 p5.js dice: {{message}}",welcome:""}}},{}],109:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i=o(e("./en/translation")),n=o(e("./es/translation"));function o(e){return e&&e.__esModule?e:{default:e}}var a={en:{translation:i.default},es:{translation:n.default}};r.default=a},{"./en/translation":107,"./es/translation":108}]},{},[37])(37)}); ================================================ FILE: docs/examples/pyodide/sketch_003/target/target_sketch.js ================================================ const wrapperContent = ` class PythonFunctions: pass setattr(PythonFunctions, 'map', map) setattr(PythonFunctions, 'filter', filter) setattr(PythonFunctions, 'set', set) _P5_INSTANCE = None _CTX_MIDDLE = None _DEFAULT_FILL = None _DEFAULT_LEADMULT = None _DEFAULT_STROKE = None _DEFAULT_TEXT_FILL = None ADD = None ALT = None ARROW = None AUDIO = None AUTO = None AXES = None BACKSPACE = None BASELINE = None BEVEL = None BEZIER = None BLEND = None BLUR = None BOLD = None BOLDITALIC = None BOTTOM = None BURN = None CENTER = None CHORD = None CLAMP = None CLOSE = None CONTROL = None CORNER = None CORNERS = None CROSS = None CURVE = None DARKEST = None DEG_TO_RAD = None DEGREES = None DELETE = None DIFFERENCE = None DILATE = None DODGE = None DOWN_ARROW = None ENTER = None ERODE = None ESCAPE = None EXCLUSION = None FILL = None GRAY = None GRID = None HALF_PI = None HAND = None HARD_LIGHT = None HSB = None HSL = None IMAGE = None IMMEDIATE = None INVERT = None ITALIC = None LANDSCAPE = None LEFT = None LEFT_ARROW = None LIGHTEST = None LINE_LOOP = None LINE_STRIP = None LINEAR = None LINES = None MIRROR = None MITER = None MOVE = None MULTIPLY = None NEAREST = None NORMAL = None OPAQUE = None OPEN = None OPTION = None OVERLAY = None PI = None PIE = None POINTS = None PORTRAIT = None POSTERIZE = None PROJECT = None QUAD_STRIP = None QUADRATIC = None QUADS = None QUARTER_PI = None RAD_TO_DEG = None RADIANS = None RADIUS = None REPEAT = None REPLACE = None RETURN = None RGB = None RIGHT = None RIGHT_ARROW = None ROUND = None SCREEN = None SHIFT = None SOFT_LIGHT = None SQUARE = None STROKE = None SUBTRACT = None TAB = None TAU = None TEXT = None TEXTURE = None THRESHOLD = None TOP = None TRIANGLE_FAN = None TRIANGLE_STRIP = None TRIANGLES = None TWO_PI = None UP_ARROW = None VIDEO = None WAIT = None WEBGL = None P2D = None PI = None frameCount = None focused = None displayWidth = None displayHeight = None windowWidth = None windowHeight = None width = None height = None deviceOrientation = None accelerationX = None accelerationY = None accelerationZ = None pAccelerationX = None pAccelerationY = None pAccelerationZ = None rotationX = None rotationY = None rotationZ = None pRotationX = None pRotationY = None pRotationZ = None turnAxis = None keyIsPressed = None key = None keyCode = None mouseX = None mouseY = None pmouseX = None pmouseY = None winMouseX = None winMouseY = None pwinMouseX = None pwinMouseY = None mouseButton = None mouseIsPressed = None touches = None pixels = None def alpha(*args): return _P5_INSTANCE.alpha(*args) def blue(*args): return _P5_INSTANCE.blue(*args) def brightness(*args): return _P5_INSTANCE.brightness(*args) def color(*args): return _P5_INSTANCE.color(*args) def green(*args): return _P5_INSTANCE.green(*args) def hue(*args): return _P5_INSTANCE.hue(*args) def lerpColor(*args): return _P5_INSTANCE.lerpColor(*args) def lightness(*args): return _P5_INSTANCE.lightness(*args) def red(*args): return _P5_INSTANCE.red(*args) def saturation(*args): return _P5_INSTANCE.saturation(*args) def background(*args): return _P5_INSTANCE.background(*args) def clear(*args): p5_clear = _P5_INSTANCE.clear(*args) return p5_clear def erase(*args): return _P5_INSTANCE.erase(*args) def noErase(*args): return _P5_INSTANCE.noErase(*args) def colorMode(*args): return _P5_INSTANCE.colorMode(*args) def fill(*args): return _P5_INSTANCE.fill(*args) def noFill(*args): return _P5_INSTANCE.noFill(*args) def noStroke(*args): return _P5_INSTANCE.noStroke(*args) def stroke(*args): return _P5_INSTANCE.stroke(*args) def arc(*args): return _P5_INSTANCE.arc(*args) def ellipse(*args): return _P5_INSTANCE.ellipse(*args) def circle(*args): return _P5_INSTANCE.circle(*args) def line(*args): return _P5_INSTANCE.line(*args) def point(*args): return _P5_INSTANCE.point(*args) def quad(*args): return _P5_INSTANCE.quad(*args) def rect(*args): return _P5_INSTANCE.rect(*args) def square(*args): return _P5_INSTANCE.square(*args) def triangle(*args): return _P5_INSTANCE.triangle(*args) def plane(*args): return _P5_INSTANCE.plane(*args) def box(*args): return _P5_INSTANCE.box(*args) def sphere(*args): return _P5_INSTANCE.sphere(*args) def cylinder(*args): return _P5_INSTANCE.cylinder(*args) def cone(*args): return _P5_INSTANCE.cone(*args) def ellipsoid(*args): return _P5_INSTANCE.ellipsoid(*args) def torus(*args): return _P5_INSTANCE.torus(*args) def loadModel(*args): return _P5_INSTANCE.loadModel(*args) def model(*args): return _P5_INSTANCE.model(*args) def ellipseMode(*args): return _P5_INSTANCE.ellipseMode(*args) def noSmooth(*args): return _P5_INSTANCE.noSmooth(*args) def rectMode(*args): return _P5_INSTANCE.rectMode(*args) def smooth(*args): return _P5_INSTANCE.smooth(*args) def strokeCap(*args): return _P5_INSTANCE.strokeCap(*args) def strokeJoin(*args): return _P5_INSTANCE.strokeJoin(*args) def strokeWeight(*args): return _P5_INSTANCE.strokeWeight(*args) def bezier(*args): return _P5_INSTANCE.bezier(*args) def bezierDetail(*args): return _P5_INSTANCE.bezierDetail(*args) def bezierPoint(*args): return _P5_INSTANCE.bezierPoint(*args) def bezierTangent(*args): return _P5_INSTANCE.bezierTangent(*args) def curve(*args): return _P5_INSTANCE.curve(*args) def curveDetail(*args): return _P5_INSTANCE.curveDetail(*args) def curveTightness(*args): return _P5_INSTANCE.curveTightness(*args) def curvePoint(*args): return _P5_INSTANCE.curvePoint(*args) def curveTangent(*args): return _P5_INSTANCE.curveTangent(*args) def beginContour(*args): return _P5_INSTANCE.beginContour(*args) def beginShape(*args): return _P5_INSTANCE.beginShape(*args) def bezierVertex(*args): return _P5_INSTANCE.bezierVertex(*args) def curveVertex(*args): return _P5_INSTANCE.curveVertex(*args) def endContour(*args): return _P5_INSTANCE.endContour(*args) def endShape(*args): return _P5_INSTANCE.endShape(*args) def quadraticVertex(*args): return _P5_INSTANCE.quadraticVertex(*args) def vertex(*args): return _P5_INSTANCE.vertex(*args) def cursor(*args): return _P5_INSTANCE.cursor(*args) def frameRate(*args): return _P5_INSTANCE.frameRate(*args) def noCursor(*args): return _P5_INSTANCE.noCursor(*args) def fullscreen(*args): return _P5_INSTANCE.fullscreen(*args) def pixelDensity(*args): return _P5_INSTANCE.pixelDensity(*args) def displayDensity(*args): return _P5_INSTANCE.displayDensity(*args) def getURL(*args): return _P5_INSTANCE.getURL(*args) def getURLPath(*args): return _P5_INSTANCE.getURLPath(*args) def getURLParams(*args): return _P5_INSTANCE.getURLParams(*args) def remove(*args): return _P5_INSTANCE.remove(*args) def noLoop(*args): return _P5_INSTANCE.noLoop(*args) def loop(*args): return _P5_INSTANCE.loop(*args) def push(*args): return _P5_INSTANCE.push(*args) def redraw(*args): return _P5_INSTANCE.redraw(*args) def resizeCanvas(*args): return _P5_INSTANCE.resizeCanvas(*args) def noCanvas(*args): return _P5_INSTANCE.noCanvas(*args) def createGraphics(*args): return _P5_INSTANCE.createGraphics(*args) def blendMode(*args): return _P5_INSTANCE.blendMode(*args) def setAttributes(*args): return _P5_INSTANCE.setAttributes(*args) def applyMatrix(*args): return _P5_INSTANCE.applyMatrix(*args) def resetMatrix(*args): return _P5_INSTANCE.resetMatrix(*args) def rotate(*args): return _P5_INSTANCE.rotate(*args) def rotateX(*args): return _P5_INSTANCE.rotateX(*args) def rotateY(*args): return _P5_INSTANCE.rotateY(*args) def rotateZ(*args): return _P5_INSTANCE.rotateZ(*args) def scale(*args): return _P5_INSTANCE.scale(*args) def shearX(*args): return _P5_INSTANCE.shearX(*args) def shearY(*args): return _P5_INSTANCE.shearY(*args) def translate(*args): return _P5_INSTANCE.translate(*args) def createStringDict(*args): return _P5_INSTANCE.createStringDict(*args) def createNumberDict(*args): return _P5_INSTANCE.createNumberDict(*args) def append(*args): return _P5_INSTANCE.append(*args) def arrayCopy(*args): return _P5_INSTANCE.arrayCopy(*args) def concat(*args): return _P5_INSTANCE.concat(*args) def reverse(*args): return _P5_INSTANCE.reverse(*args) def shorten(*args): return _P5_INSTANCE.shorten(*args) def shuffle(*args): return _P5_INSTANCE.shuffle(*args) def sort(*args): return _P5_INSTANCE.sort(*args) def splice(*args): return _P5_INSTANCE.splice(*args) def subset(*args): return _P5_INSTANCE.subset(*args) def float(*args): return _P5_INSTANCE.float(*args) def int(*args): return _P5_INSTANCE.int(*args) def str(*args): return _P5_INSTANCE.str(*args) def boolean(*args): return _P5_INSTANCE.boolean(*args) def byte(*args): return _P5_INSTANCE.byte(*args) def char(*args): return _P5_INSTANCE.char(*args) def unchar(*args): return _P5_INSTANCE.unchar(*args) def hex(*args): return _P5_INSTANCE.hex(*args) def unhex(*args): return _P5_INSTANCE.unhex(*args) def join(*args): return _P5_INSTANCE.join(*args) def match(*args): return _P5_INSTANCE.match(*args) def matchAll(*args): return _P5_INSTANCE.matchAll(*args) def nf(*args): return _P5_INSTANCE.nf(*args) def nfc(*args): return _P5_INSTANCE.nfc(*args) def nfp(*args): return _P5_INSTANCE.nfp(*args) def nfs(*args): return _P5_INSTANCE.nfs(*args) def split(*args): return _P5_INSTANCE.split(*args) def splitTokens(*args): return _P5_INSTANCE.splitTokens(*args) def trim(*args): return _P5_INSTANCE.trim(*args) def setMoveThreshold(*args): return _P5_INSTANCE.setMoveThreshold(*args) def setShakeThreshold(*args): return _P5_INSTANCE.setShakeThreshold(*args) def keyIsDown(*args): return _P5_INSTANCE.keyIsDown(*args) def createImage(*args): return _P5_INSTANCE.createImage(*args) def saveCanvas(*args): return _P5_INSTANCE.saveCanvas(*args) def saveFrames(*args): return _P5_INSTANCE.saveFrames(*args) def loadImage(*args): return _P5_INSTANCE.loadImage(*args) def image(*args): return _P5_INSTANCE.image(*args) def tint(*args): return _P5_INSTANCE.tint(*args) def noTint(*args): return _P5_INSTANCE.noTint(*args) def imageMode(*args): return _P5_INSTANCE.imageMode(*args) def blend(*args): return _P5_INSTANCE.blend(*args) def copy(*args): return _P5_INSTANCE.copy(*args) def filter(*args): if len(args) > 1 and (args[0] is None or callable(args[0])): return PythonFunctions.filter(*args) else: return _P5_INSTANCE.filter(*args) def get(*args): return _P5_INSTANCE.get(*args) def loadPixels(*args): return _P5_INSTANCE.loadPixels(*args) def set(*args): if len(args) <= 1: return PythonFunctions.set(*args) else: return _P5_INSTANCE.set(*args) def updatePixels(*args): return _P5_INSTANCE.updatePixels(*args) def loadJSON(*args): return _P5_INSTANCE.loadJSON(*args) def loadStrings(*args): return _P5_INSTANCE.loadStrings(*args) def loadTable(*args): return _P5_INSTANCE.loadTable(*args) def loadXML(*args): return _P5_INSTANCE.loadXML(*args) def loadBytes(*args): return _P5_INSTANCE.loadBytes(*args) def httpGet(*args): return _P5_INSTANCE.httpGet(*args) def httpPost(*args): return _P5_INSTANCE.httpPost(*args) def httpDo(*args): return _P5_INSTANCE.httpDo(*args) def createWriter(*args): return _P5_INSTANCE.createWriter(*args) def save(*args): return _P5_INSTANCE.save(*args) def saveJSON(*args): return _P5_INSTANCE.saveJSON(*args) def saveStrings(*args): return _P5_INSTANCE.saveStrings(*args) def saveTable(*args): return _P5_INSTANCE.saveTable(*args) def day(*args): return _P5_INSTANCE.day(*args) def hour(*args): return _P5_INSTANCE.hour(*args) def minute(*args): return _P5_INSTANCE.minute(*args) def millis(*args): return _P5_INSTANCE.millis(*args) def month(*args): return _P5_INSTANCE.month(*args) def second(*args): return _P5_INSTANCE.second(*args) def year(*args): return _P5_INSTANCE.year(*args) def createVector(*args): return _P5_INSTANCE.createVector(*args) def abs(*args): return _P5_INSTANCE.abs(*args) def ceil(*args): return _P5_INSTANCE.ceil(*args) def constrain(*args): return _P5_INSTANCE.constrain(*args) def dist(*args): return _P5_INSTANCE.dist(*args) def exp(*args): return _P5_INSTANCE.exp(*args) def floor(*args): return _P5_INSTANCE.floor(*args) def lerp(*args): return _P5_INSTANCE.lerp(*args) def log(*args): return _P5_INSTANCE.log(*args) def mag(*args): return _P5_INSTANCE.mag(*args) def map(*args): if len(args) > 1 and callable(args[0]): return PythonFunctions.map(*args) else: return _P5_INSTANCE.map(*args) def max(*args): return _P5_INSTANCE.max(*args) def min(*args): return _P5_INSTANCE.min(*args) def norm(*args): return _P5_INSTANCE.norm(*args) def pow(*args): return _P5_INSTANCE.pow(*args) def round(*args): return _P5_INSTANCE.round(*args) def sq(*args): return _P5_INSTANCE.sq(*args) def sqrt(*args): return _P5_INSTANCE.sqrt(*args) def noise(*args): return _P5_INSTANCE.noise(*args) def noiseDetail(*args): return _P5_INSTANCE.noiseDetail(*args) def noiseSeed(*args): return _P5_INSTANCE.noiseSeed(*args) def randomSeed(*args): return _P5_INSTANCE.randomSeed(*args) def random(*args): return _P5_INSTANCE.random(*args) def randomGaussian(*args): return _P5_INSTANCE.randomGaussian(*args) def acos(*args): return _P5_INSTANCE.acos(*args) def asin(*args): return _P5_INSTANCE.asin(*args) def atan(*args): return _P5_INSTANCE.atan(*args) def atan2(*args): return _P5_INSTANCE.atan2(*args) def cos(*args): return _P5_INSTANCE.cos(*args) def sin(*args): return _P5_INSTANCE.sin(*args) def tan(*args): return _P5_INSTANCE.tan(*args) def degrees(*args): return _P5_INSTANCE.degrees(*args) def radians(*args): return _P5_INSTANCE.radians(*args) def angleMode(*args): return _P5_INSTANCE.angleMode(*args) def textAlign(*args): return _P5_INSTANCE.textAlign(*args) def textLeading(*args): return _P5_INSTANCE.textLeading(*args) def textSize(*args): return _P5_INSTANCE.textSize(*args) def textStyle(*args): return _P5_INSTANCE.textStyle(*args) def textWidth(*args): return _P5_INSTANCE.textWidth(*args) def textAscent(*args): return _P5_INSTANCE.textAscent(*args) def textDescent(*args): return _P5_INSTANCE.textDescent(*args) def loadFont(*args): return _P5_INSTANCE.loadFont(*args) def text(*args): return _P5_INSTANCE.text(*args) def textFont(*args): return _P5_INSTANCE.textFont(*args) def orbitControl(*args): return _P5_INSTANCE.orbitControl(*args) def debugMode(*args): return _P5_INSTANCE.debugMode(*args) def noDebugMode(*args): return _P5_INSTANCE.noDebugMode(*args) def ambientLight(*args): return _P5_INSTANCE.ambientLight(*args) def directionalLight(*args): return _P5_INSTANCE.directionalLight(*args) def pointLight(*args): return _P5_INSTANCE.pointLight(*args) def lights(*args): return _P5_INSTANCE.lights(*args) def loadShader(*args): return _P5_INSTANCE.loadShader(*args) def createShader(*args): return _P5_INSTANCE.createShader(*args) def shader(*args): return _P5_INSTANCE.shader(*args) def resetShader(*args): return _P5_INSTANCE.resetShader(*args) def normalMaterial(*args): return _P5_INSTANCE.normalMaterial(*args) def texture(*args): return _P5_INSTANCE.texture(*args) def textureMode(*args): return _P5_INSTANCE.textureMode(*args) def textureWrap(*args): return _P5_INSTANCE.textureWrap(*args) def ambientMaterial(*args): return _P5_INSTANCE.ambientMaterial(*args) def specularMaterial(*args): return _P5_INSTANCE.specularMaterial(*args) def shininess(*args): return _P5_INSTANCE.shininess(*args) def camera(*args): return _P5_INSTANCE.camera(*args) def perspective(*args): return _P5_INSTANCE.perspective(*args) def ortho(*args): return _P5_INSTANCE.ortho(*args) def createCamera(*args): return _P5_INSTANCE.createCamera(*args) def setCamera(*args): return _P5_INSTANCE.setCamera(*args) def select(*args): return _P5_INSTANCE.select(*args) def selectAll(*args): return _P5_INSTANCE.selectAll(*args) def removeElements(*args): return _P5_INSTANCE.removeElements(*args) def changed(*args): return _P5_INSTANCE.changed(*args) def input(*args): return _P5_INSTANCE.input(*args) def createDiv(*args): return _P5_INSTANCE.createDiv(*args) def createP(*args): return _P5_INSTANCE.createP(*args) def createSpan(*args): return _P5_INSTANCE.createSpan(*args) def createImg(*args): return _P5_INSTANCE.createImg(*args) def createA(*args): return _P5_INSTANCE.createA(*args) def createSlider(*args): return _P5_INSTANCE.createSlider(*args) def createButton(*args): return _P5_INSTANCE.createButton(*args) def createCheckbox(*args): return _P5_INSTANCE.createCheckbox(*args) def createSelect(*args): return _P5_INSTANCE.createSelect(*args) def createRadio(*args): return _P5_INSTANCE.createRadio(*args) def createColorPicker(*args): return _P5_INSTANCE.createColorPicker(*args) def createInput(*args): return _P5_INSTANCE.createInput(*args) def createFileInput(*args): return _P5_INSTANCE.createFileInput(*args) def createVideo(*args): return _P5_INSTANCE.createVideo(*args) def createAudio(*args): return _P5_INSTANCE.createAudio(*args) def createCapture(*args): return _P5_INSTANCE.createCapture(*args) def createElement(*args): return _P5_INSTANCE.createElement(*args) def createCanvas(*args): canvas = _P5_INSTANCE.createCanvas(*args) global width, height width = _P5_INSTANCE.width height = _P5_INSTANCE.height return canvas def __deviceMoved(e): try: _bind_event_function(deviceMoved, e) except NameError: pass def __deviceTurned(e): try: _bind_event_function(deviceTurned, e) except NameError: pass def __deviceShaken(e): try: _bind_event_function(deviceShaken, e) except NameError: pass def __touchEnded(e): try: _bind_event_function(deviceShaken, e) except NameError: pass def __touchStarted(e): try: _bind_event_function(touchStarted, e) except NameError: pass def __windowResized(e): try: _bind_event_function(windowResized, e) except NameError: pass def __touchMoved(e): try: _bind_event_function(touchMoved, e) except NameError: pass def __mouseMoved(e): try: _bind_event_function(mouseMoved, e) except NameError: pass def __mouseDragged(e): try: _bind_event_function(mouseDragged, e) except NameError: pass def __mousePressed(e): try: _bind_event_function(mousePressed, e) except NameError: pass def __mouseReleased(e): try: _bind_event_function(mouseReleased, e) except NameError: pass def __mouseClicked(e): try: _bind_event_function(mouseClicked, e) except NameError: pass def __doubleClicked(e): try: _bind_event_function(doubleClicked, e) except NameError: pass def __mouseWheel(e): try: _bind_event_function(mouseWheel, e) except NameError: pass def __keyPressed(e): try: _bind_event_function(keyPressed, e) except NameError: pass def __keyReleased(e): try: _bind_event_function(keyReleased, e) except NameError: pass def __keyTyped(e): try: _bind_event_function(keyTyped, e) except NameError: pass def __keyIsDown(e): try: _bind_event_function(keyIsDown, e) except NameError: pass def pop(*args): p5_pop = _P5_INSTANCE.pop(*args) return p5_pop # Processing Python or Java mode compatibility aliases size = createCanvas popMatrix = pop popStyle = pop pushMatrix = push pushStyle = push # PVector is a wrapper/helper class for p5.Vector objets # providing names similar to Processing Python or Java modes # but mostly keeping p5js functionality from numbers import Number class PVector: def __init__(self, x=0, y=0, z=0): self.__vector = createVector(x, y, z) self.add = self.__instance_add__ self.sub = self.__instance_sub__ self.mult = self.__instance_mult__ self.div = self.__instance_div__ self.cross = self.__instance_cross__ self.dist = self.__instance_dist__ self.dot = self.__instance_dot__ self.lerp = self.__instance_lerp__ @property def x(self): return self.__vector.x @x.setter def x(self, x): self.__vector.x = x @property def y(self): return self.__vector.y @y.setter def y(self, y): self.__vector.y = y @property def z(self): return self.__vector.z @z.setter def z(self, z): self.__vector.z = z def mag(self): return self.__vector.mag() def magSq(self): return self.__vector.magSq() def setMag(self, mag): self.__vector.setMag(mag) return self def normalize(self): self.__vector.normalize() return self def limit(self, max): self.__vector.limit(max) return self def heading(self): return self.__vector.heading() def rotate(self, angle): self.__vector.rotate(angle) return self def __instance_add__(self, *args): if len(args) == 1: return PVector.add(self, args[0], self) else: return PVector.add(self, PVector(*args), self) def __instance_sub__(self, *args): if len(args) == 1: return PVector.sub(self, args[0], self) else: return PVector.sub(self, PVector(*args), self) def __instance_mult__(self, o): return PVector.mult(self, o, self) def __instance_div__(self, f): return PVector.div(self, f, self) def __instance_cross__(self, o): return PVector.cross(self, o, self) def __instance_dist__(self, o): return PVector.dist(self, o) def __instance_dot__(self, *args): if len(args) == 1: v = args[0] else: v = args return self.x * v[0] + self.y * v[1] + self.z * v[2] def __instance_lerp__(self, *args): if len(args) == 2: return PVector.lerp(self, args[0], args[1], self) else: vx, vy, vz, f = args return PVector.lerp(self, PVector(vx, vy, vz), f, self) def get(self): return PVector(self.x, self.y, self.z) def copy(self): return PVector(self.x, self.y, self.z) def __getitem__(self, k): return getattr(self, ('x', 'y', 'z')[k]) def __setitem__(self, k, v): setattr(self, ('x', 'y', 'z')[k], v) def __copy__(self): return PVector(self.x, self.y, self.z) def __deepcopy__(self, memo): return PVector(self.x, self.y, self.z) def __repr__(self): # PROVISÓRIO return f'PVector({self.x}, {self.y}, {self.z})' def set(self, *args): """ Sets the x, y, and z component of the vector using two or three separate variables, the data from a p5.Vector, or the values from a float array. """ self.__vector.set(*args) @classmethod def add(cls, a, b, dest=None): if dest is None: return PVector(a.x + b[0], a.y + b[1], a.z + b[2]) dest.__vector.set(a.x + b[0], a.y + b[1], a.z + b[2]) return dest @classmethod def sub(cls, a, b, dest=None): if dest is None: return PVector(a.x - b[0], a.y - b[1], a.z - b[2]) dest.__vector.set(a.x - b[0], a.y - b[1], a.z - b[2]) return dest @classmethod def mult(cls, a, b, dest=None): if dest is None: return PVector(a.x * b, a.y * b, a.z * b) dest.__vector.set(a.x * b, a.y * b, a.z * b) return dest @classmethod def div(cls, a, b, dest=None): if dest is None: return PVector(a.x / b, a.y / b, a.z / b) dest.__vector.set(a.x / b, a.y / b, a.z / b) return dest @classmethod def dist(cls, a, b): return a.__vector.dist(b.__vector) @classmethod def dot(cls, a, b): return a.__vector.dot(b.__vector) def __add__(a, b): return PVector.add(a, b, None) def __sub__(a, b): return PVector.sub(a, b, None) def __isub__(a, b): a.sub(b) return a def __iadd__(a, b): a.add(b) return a def __mul__(a, b): if not isinstance(b, Number): raise TypeError( "The * operator can only be used to multiply a PVector by a number") return PVector.mult(a, float(b), None) def __rmul__(a, b): if not isinstance(b, Number): raise TypeError( "The * operator can only be used to multiply a PVector by a number") return PVector.mult(a, float(b), None) def __imul__(a, b): if not isinstance(b, Number): raise TypeError( "The *= operator can only be used to multiply a PVector by a number") a.__vector.mult(float(b)) return a def __truediv__(a, b): if not isinstance(b, Number): raise TypeError( "The * operator can only be used to multiply a PVector by a number") return PVector(a.x / float(b), a.y / float(b), a.z / float(b)) def __itruediv__(a, b): if not isinstance(b, Number): raise TypeError( "The /= operator can only be used to multiply a PVector by a number") a.__vector.set(a.x / float(b), a.y / float(b), a.z / float(b)) return a def __eq__(a, b): return a.x == b[0] and a.y == b[1] and a.z == b[2] def __lt__(a, b): return a.magSq() < b.magSq() def __le__(a, b): return a.magSq() <= b.magSq() def __gt__(a, b): return a.magSq() > b.magSq() def __ge__(a, b): return a.magSq() >= b.magSq() # Problematic class methods, we would rather use p5.Vector when possible... @classmethod def lerp(cls, a, b, f, dest=None): v = createVector(a.x, a.y, a.z) v.lerp(b.__vector, f) if dest is None: return PVector(v.x, v.y, v.z) dest.set(v.x, v.y, v.z) return dest @classmethod def cross(cls, a, b, dest=None): x = a.y * b[2] - b[1] * a.z y = a.z * b[0] - b[2] * a.x z = a.x * b[1] - b[0] * a.y if dest is None: return PVector(x, y, z) dest.set(x, y, z) return dest @classmethod def fromAngle(cls, angle, length=1): # https://github.com/processing/p5.js/blob/3f0b2f0fe575dc81c724474154f5b23a517b7233/src/math/p5.Vector.js return PVector(length * cos(angle), length * sin(angle), 0) @classmethod def fromAngles(theta, phi, length=1): # https://github.com/processing/p5.js/blob/3f0b2f0fe575dc81c724474154f5b23a517b7233/src/math/p5.Vector.js cosPhi = cos(phi) sinPhi = sin(phi) cosTheta = cos(theta) sinTheta = sin(theta) return PVector(length * sinTheta * sinPhi, -length * cosTheta, length * sinTheta * cosPhi) @classmethod def random2D(cls): return PVector.fromAngle(random(TWO_PI)) @classmethod def random3D(cls, dest=None): angle = random(TWO_PI) vz = random(2) - 1 mult = sqrt(1 - vz * vz) vx = mult * cos(angle) vy = mult * sin(angle) if dest is None: return PVector(vx, vy, vz) dest.set(vx, vy, vz) return dest @classmethod def angleBetween(cls, a, b): return acos(a.dot(b) / sqrt(a.magSq() * b.magSq())) # Other harmless p5js methods def equals(self, v): return self == v def heading2D(self): return self.__vector.heading() def reflect(self, *args): # Reflect the incoming vector about a normal to a line in 2D, or about # a normal to a plane in 3D This method acts on the vector directly r = self.__vector.reflect(*args) return r def array(self): # Return a representation of this vector as a float array. This is only # for temporary use. If used in any w fashion, the contents should be # copied by using the p5.Vector.copy() method to copy into your own # array. return self.__vector.array() def toString(self): # Returns a string representation of a vector v by calling String(v) or v.toString(). # return self.__vector.toString() would be something like "p5.vector # Object […, …, …]" return str(self) def rem(self, *args): # Gives remainder of a vector when it is divided by anw vector. See # examples for more context. self.__vector.rem(*args) return self def pre_draw(p5_instance, draw_func, *args, **kwargs): """ We need to run this before the actual draw to insert and update p5 env variables """ global _CTX_MIDDLE, _DEFAULT_FILL, _DEFAULT_LEADMULT, _DEFAULT_STROKE, _DEFAULT_TEXT_FILL global ADD, ALT, ARROW, AUTO, AUDIO, AXES, BACKSPACE, BASELINE, BEVEL, BEZIER, BLEND, BLUR, BOLD, BOLDITALIC global BOTTOM, BURN, CENTER, CHORD, CLAMP, CLOSE, CONTROL, CORNER, CORNERS, CROSS, CURVE, DARKEST global DEG_TO_RAD, DEGREES, DELETE, DIFFERENCE, DILATE, DODGE, DOWN_ARROW, ENTER, ERODE, ESCAPE, EXCLUSION global FILL, GRAY, GRID, HALF_PI, HAND, HARD_LIGHT, HSB, HSL, IMAGE, IMMEDIATE, INVERT, ITALIC, LANDSCAPE global LEFT, LEFT_ARROW, LIGHTEST, LINE_LOOP, LINE_STRIP, LINEAR, LINES, MIRROR, MITER, MOVE, MULTIPLY, NEAREST global NORMAL, OPAQUE, OPEN, OPTION, OVERLAY, P2D, P3D, PI, PIE, POINTS, PORTRAIT, POSTERIZE, PROJECT, QUAD_STRIP global QUADRATIC, QUADS, QUARTER_PI, RAD_TO_DEG, RADIANS, RADIUS, REPEAT, REPLACE, RETURN, RGB, RIGHT, RIGHT_ARROW global ROUND, SCREEN, SHIFT, SOFT_LIGHT, SQUARE, STROKE, SUBTRACT, TAB, TAU, TEXT, TEXTURE, THRESHOLD, TOP global TRIANGLE_FAN, TRIANGLE_STRIP, TRIANGLES, TWO_PI, UP_ARROW, VIDEO, WAIT, WEBGL global frameCount, focused, displayWidth, displayHeight, windowWidth, windowHeight, width, height global deviceOrientation, accelerationX, accelerationY, accelerationZ global pAccelerationX, pAccelerationY, pAccelerationZ, rotationX, rotationY, rotationZ global pRotationX, pRotationY, pRotationZ, turnAxis, keyIsPressed, key, keyCode, mouseX, mouseY, pmouseX, pmouseY global winMouseX, winMouseY, pwinMouseX, pwinMouseY, mouseButton, mouseIsPressed, touches, pixels _CTX_MIDDLE = p5_instance._CTX_MIDDLE _DEFAULT_FILL = p5_instance._DEFAULT_FILL _DEFAULT_LEADMULT = p5_instance._DEFAULT_LEADMULT _DEFAULT_STROKE = p5_instance._DEFAULT_STROKE _DEFAULT_TEXT_FILL = p5_instance._DEFAULT_TEXT_FILL ADD = p5_instance.ADD ALT = p5_instance.ALT ARROW = p5_instance.ARROW AUDIO = p5_instance.AUDIO AUTO = p5_instance.AUTO AXES = p5_instance.AXES BACKSPACE = p5_instance.BACKSPACE BASELINE = p5_instance.BASELINE BEVEL = p5_instance.BEVEL BEZIER = p5_instance.BEZIER BLEND = p5_instance.BLEND BLUR = p5_instance.BLUR BOLD = p5_instance.BOLD BOLDITALIC = p5_instance.BOLDITALIC BOTTOM = p5_instance.BOTTOM BURN = p5_instance.BURN CENTER = p5_instance.CENTER CHORD = p5_instance.CHORD CLAMP = p5_instance.CLAMP CLOSE = p5_instance.CLOSE CONTROL = p5_instance.CONTROL CORNER = p5_instance.CORNER CORNERS = p5_instance.CORNERS CROSS = p5_instance.CROSS CURVE = p5_instance.CURVE DARKEST = p5_instance.DARKEST DEG_TO_RAD = p5_instance.DEG_TO_RAD DEGREES = p5_instance.DEGREES DELETE = p5_instance.DELETE DIFFERENCE = p5_instance.DIFFERENCE DILATE = p5_instance.DILATE DODGE = p5_instance.DODGE DOWN_ARROW = p5_instance.DOWN_ARROW ENTER = p5_instance.ENTER ERODE = p5_instance.ERODE ESCAPE = p5_instance.ESCAPE EXCLUSION = p5_instance.EXCLUSION FILL = p5_instance.FILL GRAY = p5_instance.GRAY GRID = p5_instance.GRID HALF_PI = p5_instance.HALF_PI HAND = p5_instance.HAND HARD_LIGHT = p5_instance.HARD_LIGHT HSB = p5_instance.HSB HSL = p5_instance.HSL IMAGE = p5_instance.IMAGE IMMEDIATE = p5_instance.IMMEDIATE INVERT = p5_instance.INVERT ITALIC = p5_instance.ITALIC LANDSCAPE = p5_instance.LANDSCAPE LEFT = p5_instance.LEFT LEFT_ARROW = p5_instance.LEFT_ARROW LIGHTEST = p5_instance.LIGHTEST LINE_LOOP = p5_instance.LINE_LOOP LINE_STRIP = p5_instance.LINE_STRIP LINEAR = p5_instance.LINEAR LINES = p5_instance.LINES MIRROR = p5_instance.MIRROR MITER = p5_instance.MITER MOVE = p5_instance.MOVE MULTIPLY = p5_instance.MULTIPLY NEAREST = p5_instance.NEAREST NORMAL = p5_instance.NORMAL OPAQUE = p5_instance.OPAQUE OPEN = p5_instance.OPEN OPTION = p5_instance.OPTION OVERLAY = p5_instance.OVERLAY P2D = p5_instance.P2D P3D = p5_instance.WEBGL PI = p5_instance.PI PIE = p5_instance.PIE POINTS = p5_instance.POINTS PORTRAIT = p5_instance.PORTRAIT POSTERIZE = p5_instance.POSTERIZE PROJECT = p5_instance.PROJECT QUAD_STRIP = p5_instance.QUAD_STRIP QUADRATIC = p5_instance.QUADRATIC QUADS = p5_instance.QUADS QUARTER_PI = p5_instance.QUARTER_PI RAD_TO_DEG = p5_instance.RAD_TO_DEG RADIANS = p5_instance.RADIANS RADIUS = p5_instance.RADIUS REPEAT = p5_instance.REPEAT REPLACE = p5_instance.REPLACE RETURN = p5_instance.RETURN RGB = p5_instance.RGB RIGHT = p5_instance.RIGHT RIGHT_ARROW = p5_instance.RIGHT_ARROW ROUND = p5_instance.ROUND SCREEN = p5_instance.SCREEN SHIFT = p5_instance.SHIFT SOFT_LIGHT = p5_instance.SOFT_LIGHT SQUARE = p5_instance.SQUARE STROKE = p5_instance.STROKE SUBTRACT = p5_instance.SUBTRACT TAB = p5_instance.TAB TAU = p5_instance.TAU TEXT = p5_instance.TEXT TEXTURE = p5_instance.TEXTURE THRESHOLD = p5_instance.THRESHOLD TOP = p5_instance.TOP TRIANGLE_FAN = p5_instance.TRIANGLE_FAN TRIANGLE_STRIP = p5_instance.TRIANGLE_STRIP TRIANGLES = p5_instance.TRIANGLES TWO_PI = p5_instance.TWO_PI UP_ARROW = p5_instance.UP_ARROW VIDEO = p5_instance.VIDEO WAIT = p5_instance.WAIT WEBGL = p5_instance.WEBGL frameCount = p5_instance.frameCount focused = p5_instance.focused displayWidth = p5_instance.displayWidth displayHeight = p5_instance.displayHeight windowWidth = p5_instance.windowWidth windowHeight = p5_instance.windowHeight width = p5_instance.width height = p5_instance.height deviceOrientation = p5_instance.deviceOrientation accelerationX = p5_instance.accelerationX accelerationY = p5_instance.accelerationY accelerationZ = p5_instance.accelerationZ pAccelerationX = p5_instance.pAccelerationX pAccelerationY = p5_instance.pAccelerationY pAccelerationZ = p5_instance.pAccelerationZ rotationX = p5_instance.rotationX rotationY = p5_instance.rotationY rotationZ = p5_instance.rotationZ pRotationX = p5_instance.pRotationX pRotationY = p5_instance.pRotationY pRotationZ = p5_instance.pRotationZ turnAxis = p5_instance.turnAxis keyIsPressed = p5_instance.keyIsPressed key = p5_instance.key keyCode = p5_instance.keyCode mouseX = p5_instance.mouseX mouseY = p5_instance.mouseY pmouseX = p5_instance.pmouseX pmouseY = p5_instance.pmouseY winMouseX = p5_instance.winMouseX winMouseY = p5_instance.winMouseY pwinMouseX = p5_instance.pwinMouseX pwinMouseY = p5_instance.pwinMouseY mouseButton = p5_instance.mouseButton mouseIsPressed = p5_instance.mouseIsPressed touches = p5_instance.touches pixels = p5_instance.pixels return draw_func(*args, **kwargs) def global_p5_injection(p5_sketch): """ Injects the p5js's skecth instance as a global variable to setup and draw functions """ def decorator(f, *args, **kwargs): def wrapper(*args, **kwargs): global _P5_INSTANCE _P5_INSTANCE = p5_sketch return pre_draw(_P5_INSTANCE, f, *args, **kwargs) return wrapper return decorator def start_p5(preload_func, setup_func, draw_func, event_functions): """ This is the entrypoint function. It accepts 2 parameters: - preload_func: A Python preload callable - setup_func: a Python setup callable - draw_func: a Python draw callable - event_functions: a config dict for the event functions in the format: {"eventFunctionName": python_event_function} This method gets the p5js's sketch instance and injects them """ def sketch_setup(p5_sketch): """ Callback function called to configure new p5 instance """ p5_sketch.preload = global_p5_injection(p5_sketch)(preload_func) p5_sketch.setup = global_p5_injection(p5_sketch)(setup_func) p5_sketch.draw = global_p5_injection(p5_sketch)(draw_func) window.instance = p5.new(sketch_setup, 'sketch-holder') # Register event functions event_function_names = ( "deviceMoved", "deviceTurned", "deviceShaken", "windowResized", "keyPressed", "keyReleased", "keyTyped", "mousePressed", "mouseReleased", "mouseClicked", "doubleClicked", "mouseMoved", "mouseDragged", "mouseWheel", "touchStarted", "touchMoved", "touchEnded", "keyIsDown", ) for f_name in [f for f in event_function_names if event_functions.get(f, None)]: func = event_functions[f_name] event_func = global_p5_injection(window.instance)(func) setattr(window.instance, f_name, event_func) `; const placeholder = ` def preload(): pass def setup(): pass def draw(): pass deviceMoved = None deviceTurned = None deviceShaken = None keyPressed = None keyReleased = None keyTyped = None mouseMoved = None mouseDragged = None mousePressed = None mouseReleased = None mouseClicked = None doubleClicked = None mouseWheel = None touchStarted = None touchMoved = None touchEnded = None windowResized = None `; let userCode = ` # 3d example def setup(): createCanvas(600, 600, WEBGL) def draw(): background(200) translate(-100, -100, 0) push() normalMaterial() rotateZ(frameCount * 0.01) rotateX(frameCount * 0.01) rotateY(frameCount * 0.01) box(50, 70, 100) pop() `; const startCode = ` event_functions = { "deviceMoved": deviceMoved, "deviceTurned": deviceTurned, "deviceShaken": deviceShaken, "keyPressed": keyPressed, "keyReleased": keyReleased, "keyTyped": keyTyped, "mouseMoved": mouseMoved, "mouseDragged": mouseDragged, "mousePressed": mousePressed, "mouseReleased": mouseReleased, "mouseClicked": mouseClicked, "doubleClicked": doubleClicked, "mouseWheel": mouseWheel, "touchStarted": touchStarted, "touchMoved": touchMoved, "touchEnded": touchEnded, "windowResized": windowResized, } start_p5(preload, setup, draw, event_functions) `; function runCode() { let code = [ placeholder, userCode, wrapperContent, startCode, ].join('\n'); if (window.instance) { window.instance.canvas.remove(); } console.log("Python execution output:"); window.pyodide.runPython(code); } async function main() { const config = { indexURL : "https://cdn.jsdelivr.net/pyodide/v0.18.1/full/", fullStdLib: false, } window.pyodide = await loadPyodide(config); // Pyodide is now ready to use... console.log(window.pyodide.runPython(` import io, code, sys from js import p5, window, document print(sys.version) `)); window.runSketchCode = (code) => { userCode = code; runCode(); } runCode(); }; // async method main(); ================================================ FILE: docs/examples/pyodide/sketch_004/index.html ================================================ sketch_004 - pyp5js

Python code here.

# From Prof. Claudio Esperança examples for BrythonIDE
# https://github.com/esperanc/brythonide/blob/master/demoSketches/boids.py

boids = []

def setup():
    createCanvas(720, 400)
    # Add an initial set of boids into the system
    for i in range(10):
        boids.append (Boid(random(720), random(400)))
    # frameRate(60)

def draw():
    background(51)
    # Run all the boids
    for boid in boids:
        boid.run(boids)
        fill(255)

    # Display score
    textSize(16)
    textAlign(LEFT)
    text("Frames: %.1f" %frameRate(), 150, 390)

# Boid class
# Methods for Separation, Cohesion, Alignment added
class Boid(object):

    def __init__(self, x, y):
        self.acceleration = PVector(0, 0)
        self.velocity = PVector.random2D()
        self.position = PVector(x, y)
        self.r = 3.0
        self.maxspeed = 3    # Maximum speed
        self.maxforce = 0.05 # Maximum steering force

    def run(self, boids):
        self.flock(boids)
        self.update()
        self.borders()
        self.render()

    # Forces go into acceleration
    def applyForce(self,force):
        self.acceleration = self.acceleration + force

    # We accumulate a new acceleration each time based on three rules
    def flock(self, boids):
        sep = self.separate(boids) # Separation
        ali = self.align(boids)    # Alignment
        coh = self.cohesion(boids) # Cohesion
        # Arbitrarily weight these forces
        sep = 2.5 * sep
        ali = 1.0 * ali
        coh = 1.0 * coh
        # Add the force vectors to acceleration
        self.applyForce(sep)
        self.applyForce(ali)
        self.applyForce(coh)

    # Method to update location
    def update(self):
        # Update velocity
        self.velocity = self.velocity + self.acceleration
        # Limit speed
        self.velocity.limit(self.maxspeed)
        self.position = self.position + self.velocity
        # Reset acceleration to 0 each cycle
        self.acceleration = 0 * self.acceleration

    # A method that calculates and applies a steering force towards a target
    # STEER = DESIRED MINUS VELOCITY
    def seek(self,target):
        desired = target - self.position # A vector pointing from the location to the target
        # Normalize desired and scale to maximum speed
        desired.normalize()
        desired = desired * self.maxspeed
        # Steering = Desired minus Velocity
        steer = desired - self.velocity
        steer.limit(self.maxforce) # Limit to maximum steering force
        return steer

    # Draw boid as a circle
    def render(self):
        fill(127, 127)
        stroke(200)
        ellipse(self.position.x, self.position.y, 16, 16)

    # Wraparound
    def borders(self):
        if (self.position.x < -self.r):
            self.position.x = width + self.r
        if (self.position.y < -self.r):
            self.position.y = height + self.r
        if (self.position.x > width + self.r):
            self.position.x = -self.r
        if (self.position.y > height + self.r):
            self.position.y = -self.r


    # Separation
    # Method checks for nearby boids and steers away
    def separate(self, boids):
        desiredseparation = 25.0
        steer = PVector(0, 0)
        count = 0
        # For every boid in the system, check if it's too close
        for i in range(len(boids)):
            d = PVector.dist(self.position, boids[i].position)
            # If the distance is greater than 0 and less than an arbitrary amount (0 when you are yourself)
            if (0 < d < desiredseparation) :
                # Calculate vector pointing away from neighbor
                diff = self.position - boids[i].position
                diff.normalize()
                diff = diff / d
                steer = steer + diff
                count += 1 # Keep track of how many
        # Average -- divide by how many
        if (count > 0):
            steer = steer/count

        # As long as the vector is greater than 0
        if (steer.mag() > 0):
            # Implement Reynolds: Steering = Desired - Velocity
            steer.normalize()
            steer = steer * self.maxspeed
            steer = steer - self.velocity
            steer.limit(self.maxforce)

        return steer


    # Alignment
    # For every nearby boid in the system, calculate the average velocity
    def align(self, boids):
        neighbordist = 50
        summ = PVector(0, 0)
        count = 0
        for i in range(len(boids)):
            d = PVector.dist(self.position, boids[i].position)
            if (0 < d < neighbordist):
                summ = summ + boids[i].velocity
                count += 1

        if (count > 0) :
            summ = summ/count
            summ.normalize()
            summ = summ * self.maxspeed
            steer = summ - self.velocity
            steer.limit(self.maxforce)
            return steer
        else:
            return PVector(0, 0)

    # Cohesion
    # For the average location (i.e. center) of all nearby boids, calculate steering vector towards that location
    def cohesion(self, boids) :
        neighbordist = 50
        summ = PVector(0, 0) # Start with empty vector to accumulate all locations
        count = 0
        for i in range(len(boids)):
            d = PVector.dist(self.position, boids[i].position)
            if (0 < d < neighbordist) :
                summ = summ + boids[i].position   # Add location
                count += 1

        if (count > 0) :
            summ = summ / count
            return self.seek(summ) # Steer towards the location
        else:
            return PVector(0, 0)
================================================ FILE: docs/examples/pyodide/sketch_004/sketch_004.py ================================================ # From Prof. Claudio Esperança examples for BrythonIDE # https://github.com/esperanc/brythonide/blob/master/demoSketches/boids.py boids = [] def setup(): createCanvas(720, 400) # Add an initial set of boids into the system for i in range(10): boids.append (Boid(random(720), random(400))) # frameRate(60) def draw(): background(51) # Run all the boids for boid in boids: boid.run(boids) fill(255) # Display score textSize(16) textAlign(LEFT) text("Frames: %.1f" %frameRate(), 150, 390) # Boid class # Methods for Separation, Cohesion, Alignment added class Boid(object): def __init__(self, x, y): self.acceleration = PVector(0, 0) self.velocity = PVector.random2D() self.position = PVector(x, y) self.r = 3.0 self.maxspeed = 3 # Maximum speed self.maxforce = 0.05 # Maximum steering force def run(self, boids): self.flock(boids) self.update() self.borders() self.render() # Forces go into acceleration def applyForce(self,force): self.acceleration = self.acceleration + force # We accumulate a new acceleration each time based on three rules def flock(self, boids): sep = self.separate(boids) # Separation ali = self.align(boids) # Alignment coh = self.cohesion(boids) # Cohesion # Arbitrarily weight these forces sep = 2.5 * sep ali = 1.0 * ali coh = 1.0 * coh # Add the force vectors to acceleration self.applyForce(sep) self.applyForce(ali) self.applyForce(coh) # Method to update location def update(self): # Update velocity self.velocity = self.velocity + self.acceleration # Limit speed self.velocity.limit(self.maxspeed) self.position = self.position + self.velocity # Reset acceleration to 0 each cycle self.acceleration = 0 * self.acceleration # A method that calculates and applies a steering force towards a target # STEER = DESIRED MINUS VELOCITY def seek(self,target): desired = target - self.position # A vector pointing from the location to the target # Normalize desired and scale to maximum speed desired.normalize() desired = desired * self.maxspeed # Steering = Desired minus Velocity steer = desired - self.velocity steer.limit(self.maxforce) # Limit to maximum steering force return steer # Draw boid as a circle def render(self): fill(127, 127) stroke(200) ellipse(self.position.x, self.position.y, 16, 16) # Wraparound def borders(self): if (self.position.x < -self.r): self.position.x = width + self.r if (self.position.y < -self.r): self.position.y = height + self.r if (self.position.x > width + self.r): self.position.x = -self.r if (self.position.y > height + self.r): self.position.y = -self.r # Separation # Method checks for nearby boids and steers away def separate(self, boids): desiredseparation = 25.0 steer = PVector(0, 0) count = 0 # For every boid in the system, check if it's too close for i in range(len(boids)): d = PVector.dist(self.position, boids[i].position) # If the distance is greater than 0 and less than an arbitrary amount (0 when you are yourself) if (0 < d < desiredseparation) : # Calculate vector pointing away from neighbor diff = self.position - boids[i].position diff.normalize() diff = diff / d steer = steer + diff count += 1 # Keep track of how many # Average -- divide by how many if (count > 0): steer = steer/count # As long as the vector is greater than 0 if (steer.mag() > 0): # Implement Reynolds: Steering = Desired - Velocity steer.normalize() steer = steer * self.maxspeed steer = steer - self.velocity steer.limit(self.maxforce) return steer # Alignment # For every nearby boid in the system, calculate the average velocity def align(self, boids): neighbordist = 50 summ = PVector(0, 0) count = 0 for i in range(len(boids)): d = PVector.dist(self.position, boids[i].position) if (0 < d < neighbordist): summ = summ + boids[i].velocity count += 1 if (count > 0) : summ = summ/count summ.normalize() summ = summ * self.maxspeed steer = summ - self.velocity steer.limit(self.maxforce) return steer else: return PVector(0, 0) # Cohesion # For the average location (i.e. center) of all nearby boids, calculate steering vector towards that location def cohesion(self, boids) : neighbordist = 50 summ = PVector(0, 0) # Start with empty vector to accumulate all locations count = 0 for i in range(len(boids)): d = PVector.dist(self.position, boids[i].position) if (0 < d < neighbordist) : summ = summ + boids[i].position # Add location count += 1 if (count > 0) : summ = summ / count return self.seek(summ) # Steer towards the location else: return PVector(0, 0) ================================================ FILE: docs/examples/pyodide/sketch_004/static/p5.js ================================================ /*! p5.js v1.0.0 February 29, 2020 */ !function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).p5=e()}}(function(){return function o(a,s,l){function u(t,e){if(!s[t]){if(!a[t]){var r="function"==typeof require&&require;if(!e&&r)return r(t,!0);if(h)return h(t,!0);var i=new Error("Cannot find module '"+t+"'");throw i.code="MODULE_NOT_FOUND",i}var n=s[t]={exports:{}};a[t][0].call(n.exports,function(e){return u(a[t][1][e]||e)},n,n.exports,o,a,s,l)}return s[t].exports}for(var h="function"==typeof require&&require,e=0;e>16&255,a[s++]=t>>8&255,a[s++]=255&t;2===o&&(t=u[e.charCodeAt(r)]<<2|u[e.charCodeAt(r+1)]>>4,a[s++]=255&t);1===o&&(t=u[e.charCodeAt(r)]<<10|u[e.charCodeAt(r+1)]<<4|u[e.charCodeAt(r+2)]>>2,a[s++]=t>>8&255,a[s++]=255&t);return a},r.fromByteArray=function(e){for(var t,r=e.length,i=r%3,n=[],o=0,a=r-i;o>2]+s[t<<4&63]+"==")):2==i&&(t=(e[r-2]<<8)+e[r-1],n.push(s[t>>10]+s[t>>4&63]+s[t<<2&63]+"="));return n.join("")};for(var s=[],u=[],h="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=0,o=i.length;n>18&63]+s[n>>12&63]+s[n>>6&63]+s[63&n]);return o.join("")}u["-".charCodeAt(0)]=62,u["_".charCodeAt(0)]=63},{}],20:[function(e,t,r){},{}],21:[function(N,e,F){(function(c){"use strict";var i=N("base64-js"),o=N("ieee754"),e="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;F.Buffer=c,F.SlowBuffer=function(e){+e!=e&&(e=0);return c.alloc(+e)},F.INSPECT_MAX_BYTES=50;var r=2147483647;function a(e){if(r>>1;case"base64":return O(e).length;default:if(n)return i?-1:R(e).length;t=(""+t).toLowerCase(),n=!0}}function d(e,t,r){var i=e[t];e[t]=e[r],e[r]=i}function p(e,t,r,i,n){if(0===e.length)return-1;if("string"==typeof r?(i=r,r=0):2147483647=e.length){if(n)return-1;r=e.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof t&&(t=c.from(t,i)),c.isBuffer(t))return 0===t.length?-1:m(e,t,r,i,n);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):m(e,[t],r,i,n);throw new TypeError("val must be string, number or Buffer")}function m(e,t,r,i,n){var o,a=1,s=e.length,l=t.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(e.length<2||t.length<2)return-1;s/=a=2,l/=2,r/=2}function u(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(n){var h=-1;for(o=r;o>8,n=r%256,o.push(n),o.push(i);return o}(t,e.length-r),e,r,i)}function b(e,t,r){return 0===t&&r===e.length?i.fromByteArray(e):i.fromByteArray(e.slice(t,r))}function _(e,t,r){r=Math.min(e.length,r);for(var i=[],n=t;n>>10&1023|55296),h=56320|1023&h),i.push(h),n+=c}return function(e){var t=e.length;if(t<=x)return String.fromCharCode.apply(String,e);var r="",i=0;for(;ithis.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e=e||"utf8";;)switch(e){case"hex":return M(this,t,r);case"utf8":case"utf-8":return _(this,t,r);case"ascii":return w(this,t,r);case"latin1":case"binary":return S(this,t,r);case"base64":return b(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,t,r);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}.apply(this,arguments)},c.prototype.equals=function(e){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===c.compare(this,e)},c.prototype.inspect=function(){var e="",t=F.INSPECT_MAX_BYTES;return e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(e+=" ... "),""},e&&(c.prototype[e]=c.prototype.inspect),c.prototype.compare=function(e,t,r,i,n){if(A(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),t<0||r>e.length||i<0||n>this.length)throw new RangeError("out of range index");if(n<=i&&r<=t)return 0;if(n<=i)return-1;if(r<=t)return 1;if(this===e)return 0;for(var o=(n>>>=0)-(i>>>=0),a=(r>>>=0)-(t>>>=0),s=Math.min(o,a),l=this.slice(i,n),u=e.slice(t,r),h=0;h>>=0,isFinite(r)?(r>>>=0,void 0===i&&(i="utf8")):(i=r,r=void 0)}var n=this.length-t;if((void 0===r||nthis.length)throw new RangeError("Attempt to write outside buffer bounds");i=i||"utf8";for(var o,a,s,l,u,h,c=!1;;)switch(i){case"hex":return g(this,e,t,r);case"utf8":case"utf-8":return u=t,h=r,D(R(e,(l=this).length-u),l,u,h);case"ascii":return v(this,e,t,r);case"latin1":case"binary":return v(this,e,t,r);case"base64":return o=this,a=t,s=r,D(O(e),o,a,s);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return y(this,e,t,r);default:if(c)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),c=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var x=4096;function w(e,t,r){var i="";r=Math.min(e.length,r);for(var n=t;ne.length)throw new RangeError("Index out of range")}function P(e,t,r,i){if(r+i>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function L(e,t,r,i,n){return t=+t,r>>>=0,n||P(e,0,r,4),o.write(e,t,r,i,23,4),r+4}function k(e,t,r,i,n){return t=+t,r>>>=0,n||P(e,0,r,8),o.write(e,t,r,i,52,8),r+8}c.prototype.slice=function(e,t){var r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):r>>=0,t>>>=0,r||T(e,t,this.length);for(var i=this[e],n=1,o=0;++o>>=0,t>>>=0,r||T(e,t,this.length);for(var i=this[e+--t],n=1;0>>=0,t||T(e,1,this.length),this[e]},c.prototype.readUInt16LE=function(e,t){return e>>>=0,t||T(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUInt16BE=function(e,t){return e>>>=0,t||T(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUInt32LE=function(e,t){return e>>>=0,t||T(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUInt32BE=function(e,t){return e>>>=0,t||T(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||T(e,t,this.length);for(var i=this[e],n=1,o=0;++o>>=0,t>>>=0,r||T(e,t,this.length);for(var i=t,n=1,o=this[e+--i];0>>=0,t||T(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){e>>>=0,t||T(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(e,t){e>>>=0,t||T(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(e,t){return e>>>=0,t||T(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return e>>>=0,t||T(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readFloatLE=function(e,t){return e>>>=0,t||T(e,4,this.length),o.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return e>>>=0,t||T(e,4,this.length),o.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return e>>>=0,t||T(e,8,this.length),o.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return e>>>=0,t||T(e,8,this.length),o.read(this,e,!1,52,8)},c.prototype.writeUIntLE=function(e,t,r,i){e=+e,t>>>=0,r>>>=0,i||C(this,e,t,r,Math.pow(2,8*r)-1,0);var n=1,o=0;for(this[t]=255&e;++o>>=0,r>>>=0,i||C(this,e,t,r,Math.pow(2,8*r)-1,0);var n=r-1,o=1;for(this[t+n]=255&e;0<=--n&&(o*=256);)this[t+n]=e/o&255;return t+r},c.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,1,255,0),this[t]=255&e,t+1},c.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},c.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeIntLE=function(e,t,r,i){if(e=+e,t>>>=0,!i){var n=Math.pow(2,8*r-1);C(this,e,t,r,n-1,-n)}var o=0,a=1,s=0;for(this[t]=255&e;++o>0)-s&255;return t+r},c.prototype.writeIntBE=function(e,t,r,i){if(e=+e,t>>>=0,!i){var n=Math.pow(2,8*r-1);C(this,e,t,r,n-1,-n)}var o=r-1,a=1,s=0;for(this[t+o]=255&e;0<=--o&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+r},c.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},c.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeFloatLE=function(e,t,r){return L(this,e,t,!0,r)},c.prototype.writeFloatBE=function(e,t,r){return L(this,e,t,!1,r)},c.prototype.writeDoubleLE=function(e,t,r){return k(this,e,t,!0,r)},c.prototype.writeDoubleBE=function(e,t,r){return k(this,e,t,!1,r)},c.prototype.copy=function(e,t,r,i){if(!c.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r=r||0,i||0===i||(i=this.length),t>=e.length&&(t=e.length),t=t||0,0=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t>>=0,r=void 0===r?this.length:r>>>0,"number"==typeof(e=e||0))for(o=t;o>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function O(e){return i.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(t,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function D(e,t,r,i){for(var n=0;n=t.length||n>=e.length);++n)t[n+r]=e[n];return n}function A(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function I(e){return e!=e}var U=function(){for(var e="0123456789abcdef",t=new Array(256),r=0;r<16;++r)for(var i=16*r,n=0;n<16;++n)t[i+n]=e[r]+e[n];return t}()}).call(this,N("buffer").Buffer)},{"base64-js":19,buffer:21,ieee754:30}],22:[function(e,t,r){"use strict";t.exports=e("./").polyfill()},{"./":23}],23:[function(z,r,i){(function(j,V){var e,t;e=this,t=function(){"use strict";function l(e){return"function"==typeof e}var r=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},i=0,t=void 0,n=void 0,a=function(e,t){f[i]=e,f[i+1]=t,2===(i+=2)&&(n?n(d):y())};var e="undefined"!=typeof window?window:void 0,o=e||{},s=o.MutationObserver||o.WebKitMutationObserver,u="undefined"==typeof self&&void 0!==j&&"[object process]"==={}.toString.call(j),h="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function c(){var e=setTimeout;return function(){return e(d,1)}}var f=new Array(1e3);function d(){for(var e=0;e":">",'"':""","'":"'","/":"/"};function S(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,function(e){return w[e]}):e}var M=function(){function i(e){var t,r=1=this.maxReplaces)break}for(a=0;r=this.regexp.exec(e);){if(void 0===(i=h(r[1].trim())))if("function"==typeof c){var d=c(e,r,t);i="string"==typeof d?d:""}else this.logger.warn("missed to pass in variable ".concat(r[1]," for interpolating ").concat(e)),i="";else"string"==typeof i||this.useRawValueToEscape||(i=v(i));if(i=this.escapeValue?u(this.escape(i)):u(i),e=e.replace(r[0],i),this.regexp.lastIndex=0,++a>=this.maxReplaces)break}return e}},{key:"nest",value:function(e,t,r){var i,n,o=D({},2>1,h=-7,c=r?n-1:0,f=r?-1:1,d=e[t+c];for(c+=f,o=d&(1<<-h)-1,d>>=-h,h+=s;0>=-h,h+=i;0>1,f=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,d=i?0:o-1,p=i?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=h):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),2<=(t+=1<=a+c?f/l:f*Math.pow(2,1-c))*l&&(a++,l/=2),h<=a+c?(s=0,a=h):1<=a+c?(s=(t*l-1)*Math.pow(2,n),a+=c):(s=t*Math.pow(2,c-1)*Math.pow(2,n),a=0));8<=n;e[r+d]=255&s,d+=p,s/=256,n-=8);for(a=a<Math.abs(e[0])&&(t=1),Math.abs(e[2])>Math.abs(e[t])&&(t=2),t}var C=4e150;function P(e,t){e.f+=t.f,e.b.f+=t.b.f}function u(e,t,r){return e=e.a,t=t.a,r=r.a,t.b.a===e?r.b.a===e?v(t.a,r.a)?b(r.b.a,t.a,r.a)<=0:0<=b(t.b.a,r.a,t.a):b(r.b.a,e,r.a)<=0:r.b.a===e?0<=b(t.b.a,e,t.a):(t=y(t.b.a,e,t.a),(e=y(r.b.a,e,r.a))<=t)}function L(e){e.a.i=null;var t=e.e;t.a.c=t.c,t.c.a=t.a,e.e=null}function h(e,t){c(e.a),e.c=!1,(e.a=t).i=e}function k(e){for(var t=e.a.a;(e=fe(e)).a.a===t;);return e.c&&(h(e,t=f(ce(e).a.b,e.a.e)),e=fe(e)),e}function R(e,t,r){var i=new he;return i.a=r,i.e=W(e.f,t.e,i),r.i=i}function O(e,t){switch(e.s){case 100130:return 0!=(1&t);case 100131:return 0!==t;case 100132:return 0>1]],s[a[u]])?le(r,u):ue(r,u)),s[o]=null,l[o]=r.b,r.b=o}else for(r.c[-(o+1)]=null;0Math.max(a.a,l.a))return!1;if(v(o,a)){if(0i.f&&(i.f*=2,i.c=oe(i.c,i.f+1)),0===i.b?r=n:(r=i.b,i.b=i.c[i.b]),i.e[r]=t,i.c[r]=n,i.d[n]=r,i.h&&ue(i,n),r}return i=e.a++,e.c[i]=t,-(i+1)}function ie(e){if(0===e.a)return se(e.b);var t=e.c[e.d[e.a-1]];if(0!==e.b.a&&v(ae(e.b),t))return se(e.b);for(;--e.a,0e.a||v(i[a],i[l])){n[r[o]=a]=o;break}n[r[o]=l]=o,o=s}}function ue(e,t){for(var r=e.d,i=e.e,n=e.c,o=t,a=r[o];;){var s=o>>1,l=r[s];if(0==s||v(i[l],i[a])){n[r[o]=a]=o;break}n[r[o]=l]=o,o=s}}function he(){this.e=this.a=null,this.f=0,this.c=this.b=this.h=this.d=!1}function ce(e){return e.e.c.b}function fe(e){return e.e.a.b}(i=q.prototype).x=function(){Y(this,0)},i.B=function(e,t){switch(e){case 100142:return;case 100140:switch(t){case 100130:case 100131:case 100132:case 100133:case 100134:return void(this.s=t)}break;case 100141:return void(this.m=!!t);default:return void Z(this,100900)}Z(this,100901)},i.y=function(e){switch(e){case 100142:return 0;case 100140:return this.s;case 100141:return this.m;default:Z(this,100900)}return!1},i.A=function(e,t,r){this.j[0]=e,this.j[1]=t,this.j[2]=r},i.z=function(e,t){var r=t||null;switch(e){case 100100:case 100106:this.h=r;break;case 100104:case 100110:this.l=r;break;case 100101:case 100107:this.k=r;break;case 100102:case 100108:this.i=r;break;case 100103:case 100109:this.p=r;break;case 100105:case 100111:this.o=r;break;case 100112:this.r=r;break;default:Z(this,100900)}},i.C=function(e,t){var r=!1,i=[0,0,0];Y(this,2);for(var n=0;n<3;++n){var o=e[n];o<-1e150&&(o=-1e150,r=!0),1e150n[u]&&(n[u]=h,a[u]=l)}if(l=0,n[1]-o[1]>n[0]-o[0]&&(l=1),n[2]-o[2]>n[l]-o[l]&&(l=2),o[l]>=n[l])i[0]=0,i[1]=0,i[2]=1;else{for(n=0,o=s[l],a=a[l],s=[0,0,0],o=[o.g[0]-a.g[0],o.g[1]-a.g[1],o.g[2]-a.g[2]],u=[0,0,0],l=r.e;l!==r;l=l.e)u[0]=l.g[0]-a.g[0],u[1]=l.g[1]-a.g[1],u[2]=l.g[2]-a.g[2],s[0]=o[1]*u[2]-o[2]*u[1],s[1]=o[2]*u[0]-o[0]*u[2],s[2]=o[0]*u[1]-o[1]*u[0],n<(h=s[0]*s[0]+s[1]*s[1]+s[2]*s[2])&&(n=h,i[0]=s[0],i[1]=s[1],i[2]=s[2]);n<=0&&(i[0]=i[1]=i[2]=0,i[T(o)]=1)}r=!0}for(s=T(i),l=this.b.c,n=(s+1)%3,a=(s+2)%3,s=0>=l,h-=l,g!=o){if(g==a)break;for(var v=g>8,++y;var _=b;if(i>=8;null!==m&&s<4096&&(p[s++]=m<<8|_,u+1<=s&&l<12&&(++l,u=u<<1|1)),m=g}else s=1+a,u=(1<<(l=n+1))-1,m=null}return f!==i&&console.log("Warning, gif stream shorter than expected."),r}try{r.GifWriter=function(v,e,t,r){var y=0,i=void 0===(r=void 0===r?{}:r).loop?null:r.loop,b=void 0===r.palette?null:r.palette;if(e<=0||t<=0||65535>=1;)++n;if(a=1<>8&255,v[y++]=255&t,v[y++]=t>>8&255,v[y++]=(null!==b?128:0)|n,v[y++]=o,v[y++]=0,null!==b)for(var s=0,l=b.length;s>16&255,v[y++]=u>>8&255,v[y++]=255&u}if(null!==i){if(i<0||65535>8&255,v[y++]=0}var x=!1;this.addFrame=function(e,t,r,i,n,o){if(!0===x&&(--y,x=!1),o=void 0===o?{}:o,e<0||t<0||65535>=1;)++u;l=1<>8&255,v[y++]=d,v[y++]=0),v[y++]=44,v[y++]=255&e,v[y++]=e>>8&255,v[y++]=255&t,v[y++]=t>>8&255,v[y++]=255&r,v[y++]=r>>8&255,v[y++]=255&i,v[y++]=i>>8&255,v[y++]=!0===a?128|u-1:0,!0===a)for(var p=0,m=s.length;p>16&255,v[y++]=g>>8&255,v[y++]=255&g}return y=function(t,r,e,i){t[r++]=e;var n=r++,o=1<>=8,h-=8,r===n+256&&(t[n]=255,n=r++)}function d(e){c|=e<>=8,h-=8,r===n+256&&(t[n]=255,n=r++);4096===l?(d(o),l=1+s,u=e+1,m={}):(1<>7,n=1<<1+(7&r);x[e++],x[e++];var o=null,a=null;i&&(o=e,e+=3*(a=n));var s=!0,l=[],u=0,h=null,c=0,f=null;for(this.width=w,this.height=t;s&&e>2&7,e++;break;case 254:for(;;){if(!(0<=(C=x[e++])))throw Error("Invalid block size");if(0===C)break;e+=C}break;default:throw new Error("Unknown graphic control label: 0x"+x[e-1].toString(16))}break;case 44:var p=x[e++]|x[e++]<<8,m=x[e++]|x[e++]<<8,g=x[e++]|x[e++]<<8,v=x[e++]|x[e++]<<8,y=x[e++],b=y>>6&1,_=1<<1+(7&y),S=o,M=a,E=!1;if(y>>7){E=!0;S=e,e+=3*(M=_)}var T=e;for(e++;;){var C;if(!(0<=(C=x[e++])))throw Error("Invalid block size");if(0===C)break;e+=C}l.push({x:p,y:m,width:g,height:v,has_local_palette:E,palette_offset:S,palette_size:M,data_offset:T,data_length:e-T,transparent_index:h,interlaced:!!b,delay:u,disposal:c});break;case 59:s=!1;break;default:throw new Error("Unknown gif block: 0x"+x[e-1].toString(16))}this.numFrames=function(){return l.length},this.loopCount=function(){return f},this.frameInfo=function(e){if(e<0||e>=l.length)throw new Error("Frame index out of range.");return l[e]},this.decodeAndBlitFrameBGRA=function(e,t){var r=this.frameInfo(e),i=r.width*r.height,n=new Uint8Array(i);P(x,r.data_offset,n,i);var o=r.palette_offset,a=r.transparent_index;null===a&&(a=256);var s=r.width,l=w-s,u=s,h=4*(r.y*w+r.x),c=4*((r.y+r.height)*w+r.x),f=h,d=4*l;!0===r.interlaced&&(d+=4*w*7);for(var p=8,m=0,g=n.length;m>=1)),v===a)f+=4;else{var y=x[o+3*v],b=x[o+3*v+1],_=x[o+3*v+2];t[f++]=_,t[f++]=b,t[f++]=y,t[f++]=255}--u}},this.decodeAndBlitFrameRGBA=function(e,t){var r=this.frameInfo(e),i=r.width*r.height,n=new Uint8Array(i);P(x,r.data_offset,n,i);var o=r.palette_offset,a=r.transparent_index;null===a&&(a=256);var s=r.width,l=w-s,u=s,h=4*(r.y*w+r.x),c=4*((r.y+r.height)*w+r.x),f=h,d=4*l;!0===r.interlaced&&(d+=4*w*7);for(var p=8,m=0,g=n.length;m>=1)),v===a)f+=4;else{var y=x[o+3*v],b=x[o+3*v+1],_=x[o+3*v+2];t[f++]=y,t[f++]=b,t[f++]=_,t[f++]=255}--u}}}}catch(e){}},{}],33:[function(jr,t,r){(function(Gr){var e;e=this,function(E){"use strict";function e(e){if(null==this)throw TypeError();var t=String(this),r=t.length,i=e?Number(e):0;if(i!=i&&(i=0),!(i<0||r<=i)){var n,o=t.charCodeAt(i);return 55296<=o&&o<=56319&&i+1>>=1,t}function _(e,t,r){if(!t)return r;for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<>>16-t;return e.tag>>>=t,e.bitcount-=t,i+r}function x(e,t){for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<>>=1,++n,r+=t.table[n],0<=(i-=t.table[n]););return e.tag=o,e.bitcount-=n,t.trans[r+i]}function w(e,t,r){var i,n,o,a,s,l;for(i=_(e,5,257),n=_(e,5,1),o=_(e,4,4),a=0;a<19;++a)g[a]=0;for(a=0;athis.x2&&(this.x2=e)),"number"==typeof t&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=t,this.y2=t),tthis.y2&&(this.y2=t))},C.prototype.addX=function(e){this.addPoint(e,null)},C.prototype.addY=function(e){this.addPoint(null,e)},C.prototype.addBezier=function(e,t,r,i,n,o,a,s){var l=this,u=[e,t],h=[r,i],c=[n,o],f=[a,s];this.addPoint(e,t),this.addPoint(a,s);for(var d=0;d<=1;d++){var p=6*u[d]-12*h[d]+6*c[d],m=-3*u[d]+9*h[d]-9*c[d]+3*f[d],g=3*h[d]-3*u[d];if(0!=m){var v=Math.pow(p,2)-4*g*m;if(!(v<0)){var y=(-p+Math.sqrt(v))/(2*m);0>8&255,255&e]},A.USHORT=U(2),D.SHORT=function(e){return 32768<=e&&(e=-(65536-e)),[e>>8&255,255&e]},A.SHORT=U(2),D.UINT24=function(e){return[e>>16&255,e>>8&255,255&e]},A.UINT24=U(3),D.ULONG=function(e){return[e>>24&255,e>>16&255,e>>8&255,255&e]},A.ULONG=U(4),D.LONG=function(e){return R<=e&&(e=-(2*R-e)),[e>>24&255,e>>16&255,e>>8&255,255&e]},A.LONG=U(4),D.FIXED=D.ULONG,A.FIXED=A.ULONG,D.FWORD=D.SHORT,A.FWORD=A.SHORT,D.UFWORD=D.USHORT,A.UFWORD=A.USHORT,D.LONGDATETIME=function(e){return[0,0,0,0,e>>24&255,e>>16&255,e>>8&255,255&e]},A.LONGDATETIME=U(8),D.TAG=function(e){return k.argument(4===e.length,"Tag should be exactly 4 ASCII characters."),[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]},A.TAG=U(4),D.Card8=D.BYTE,A.Card8=A.BYTE,D.Card16=D.USHORT,A.Card16=A.USHORT,D.OffSize=D.BYTE,A.OffSize=A.BYTE,D.SID=D.USHORT,A.SID=A.USHORT,D.NUMBER=function(e){return-107<=e&&e<=107?[e+139]:108<=e&&e<=1131?[247+((e-=108)>>8),255&e]:-1131<=e&&e<=-108?[251+((e=-e-108)>>8),255&e]:-32768<=e&&e<=32767?D.NUMBER16(e):D.NUMBER32(e)},A.NUMBER=function(e){return D.NUMBER(e).length},D.NUMBER16=function(e){return[28,e>>8&255,255&e]},A.NUMBER16=U(3),D.NUMBER32=function(e){return[29,e>>24&255,e>>16&255,e>>8&255,255&e]},A.NUMBER32=U(5),D.REAL=function(e){var t=e.toString(),r=/\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec(t);if(r){var i=parseFloat("1e"+((r[2]?+r[2]:0)+r[1].length));t=(Math.round(e*i)/i).toString()}for(var n="",o=0,a=t.length;o>8&255,t[t.length]=255&i}return t},A.UTF16=function(e){return 2*e.length};var N={"x-mac-croatian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈ƫȅ ÀÃÕŒœĐ—“”‘’÷◊©⁄€‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ","x-mac-cyrillic":"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю","x-mac-gaelic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØḂ±≤≥ḃĊċḊḋḞḟĠġṀæøṁṖṗɼƒſṠ«»… ÀÃÕŒœ–—“”‘’ṡẛÿŸṪ€‹›Ŷŷṫ·Ỳỳ⁊ÂÊÁËÈÍÎÏÌÓÔ♣ÒÚÛÙıÝýŴŵẄẅẀẁẂẃ","x-mac-greek":"Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦€ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ­","x-mac-icelandic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüݰ¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-inuit":"ᐃᐄᐅᐆᐊᐋᐱᐲᐳᐴᐸᐹᑉᑎᑏᑐᑑᑕᑖᑦᑭᑮᑯᑰᑲᑳᒃᒋᒌᒍᒎᒐᒑ°ᒡᒥᒦ•¶ᒧ®©™ᒨᒪᒫᒻᓂᓃᓄᓅᓇᓈᓐᓯᓰᓱᓲᓴᓵᔅᓕᓖᓗᓘᓚᓛᓪᔨᔩᔪᔫᔭ… ᔮᔾᕕᕖᕗ–—“”‘’ᕘᕙᕚᕝᕆᕇᕈᕉᕋᕌᕐᕿᖀᖁᖂᖃᖄᖅᖏᖐᖑᖒᖓᖔᖕᙱᙲᙳᙴᙵᙶᖖᖠᖡᖢᖣᖤᖥᖦᕼŁł","x-mac-ce":"ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ",macintosh:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-romanian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂȘ∞±≤≥¥µ∂∑∏π∫ªºΩăș¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›Țț‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-turkish":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙˆ˜¯˘˙˚¸˝˛ˇ"};O.MACSTRING=function(e,t,r,i){var n=N[i];if(void 0!==n){for(var o="",a=0;a>8&255,l+256&255)}return o}D.MACSTRING=function(e,t){var r=function(e){if(!F)for(var t in F={},N)F[t]=new String(t);var r=F[e];if(void 0!==r){if(B){var i=B.get(r);if(void 0!==i)return i}var n=N[e];if(void 0!==n){for(var o={},a=0;a>8,t[c+1]=255&f,t=t.concat(i[h])}return t},A.TABLE=function(e){for(var t=0,r=e.fields.length,i=0;i>1,t.skip("uShort",3),e.glyphIndexMap={};for(var a=new se.Parser(r,i+n+14),s=new se.Parser(r,i+n+16+2*o),l=new se.Parser(r,i+n+16+4*o),u=new se.Parser(r,i+n+16+6*o),h=i+n+16+8*o,c=0;c>4,o=15&i;if(15==n)break;if(t+=r[n],15==o)break;t+=r[o]}return parseFloat(t)}(e);if(32<=t&&t<=246)return t-139;if(247<=t&&t<=250)return 256*(t-247)+e.parseByte()+108;if(251<=t&&t<=254)return 256*-(t-251)-e.parseByte()-108;throw new Error("Invalid b0 "+t)}function Te(e,t,r){t=void 0!==t?t:0;var i=new se.Parser(e,t),n=[],o=[];for(r=void 0!==r?r:e.length;i.relativeOffset>1,T.length=0,P=!0}return function e(t){for(var r,i,n,o,a,s,l,u,h,c,f,d,p=0;pMath.abs(d-R)?k=f+T.shift():R=d+T.shift(),E.curveTo(y,b,_,x,l,u),E.curveTo(h,c,f,d,k,R);break;default:console.log("Glyph "+v.index+": unknown operator 1200"+m),T.length=0}break;case 14:0>3;break;case 21:2>16),p+=2;break;case 29:a=T.pop()+g.gsubrsBias,(s=g.gsubrs[a])&&e(s);break;case 30:for(;0=r.begin&&e=fe.length){var a=i.parseChar();r.names.push(i.parseString(a))}break;case 2.5:r.numberOfGlyphs=i.parseUShort(),r.offset=new Array(r.numberOfGlyphs);for(var s=0;st.value.tag?1:-1}),t.fields=t.fields.concat(i),t.fields=t.fields.concat(n),t}function gt(e,t,r){for(var i=0;i 123 are reserved for internal usage");d|=1<>>1,o=e[n].tag;if(o===t)return n;o>>1,o=e[n];if(o===t)return n;o>>1,a=(r=e[o]).start;if(a===t)return r;a(r=e[i-1]).end?0:r}function xt(e,t){this.font=e,this.tableName=t}function wt(e){xt.call(this,e,"gpos")}function St(e){xt.call(this,e,"gsub")}function Mt(e,t){var r=e.length;if(r!==t.length)return!1;for(var i=0;it.points.length-1||i.matchedPoints[1]>n.points.length-1)throw Error("Matched points out of range in "+t.name);var a=t.points[i.matchedPoints[0]],s=n.points[i.matchedPoints[1]],l={xScale:i.xScale,scale01:i.scale01,scale10:i.scale10,yScale:i.yScale,dx:0,dy:0};s=kt([s],l)[0],l.dx=a.x-s.x,l.dy=a.y-s.y,o=kt(n.points,l)}t.points=t.points.concat(o)}}return Rt(t.points)}(wt.prototype=xt.prototype={searchTag:yt,binSearch:bt,getTable:function(e){var t=this.font.tables[this.tableName];return!t&&e&&(t=this.font.tables[this.tableName]=this.createDefaultTable()),t},getScriptNames:function(){var e=this.getTable();return e?e.scripts.map(function(e){return e.tag}):[]},getDefaultScriptName:function(){var e=this.getTable();if(e){for(var t=!1,r=0;r=s[u-1].tag,"Features must be added in alphabetical order."),o={tag:r,feature:{params:0,lookupListIndexes:[]}},s.push(o),a.push(u),o.feature}}},getLookupTables:function(e,t,r,i,n){var o=this.getFeatureTable(e,t,r,n),a=[];if(o){for(var s,l=o.lookupListIndexes,u=this.font.tables[this.tableName].lookups,h=0;h",s),t.stack.push(Math.round(64*s))}function vr(e,t){var r=t.stack,i=r.pop(),n=t.fv,o=t.pv,a=t.ppem,s=t.deltaBase+16*(e-1),l=t.deltaShift,u=t.z0;E.DEBUG&&console.log(t.step,"DELTAP["+e+"]",i,r);for(var h=0;h>4)===a){var d=(15&f)-8;0<=d&&d++,E.DEBUG&&console.log(t.step,"DELTAPFIX",c,"by",d*l);var p=u[c];n.setRelative(p,p,d*l,o)}}}function yr(e,t){var r=t.stack,i=r.pop();E.DEBUG&&console.log(t.step,"ROUND[]"),r.push(64*t.round(i/64))}function br(e,t){var r=t.stack,i=r.pop(),n=t.ppem,o=t.deltaBase+16*(e-1),a=t.deltaShift;E.DEBUG&&console.log(t.step,"DELTAC["+e+"]",i,r);for(var s=0;s>4)===n){var h=(15&u)-8;0<=h&&h++;var c=h*a;E.DEBUG&&console.log(t.step,"DELTACFIX",l,"by",c),t.cvt[l]+=c}}}function _r(e,t){var r,i,n=t.stack,o=n.pop(),a=n.pop(),s=t.z2[o],l=t.z1[a];E.DEBUG&&console.log(t.step,"SDPVTL["+e+"]",o,a),i=e?(r=s.y-l.y,l.x-s.x):(r=l.x-s.x,l.y-s.y),t.dpv=Zt(r,i)}function xr(e,t){var r=t.stack,i=t.prog,n=t.ip;E.DEBUG&&console.log(t.step,"PUSHB["+e+"]");for(var o=0;o":"_")+(i?"R":"_")+(0===n?"Gr":1===n?"Bl":2===n?"Wh":"")+"]",e?c+"("+o.cvt[c]+","+u+")":"",f,"(d =",a,"->",l*s,")"),o.rp1=o.rp0,o.rp2=f,t&&(o.rp0=f)}Ft.prototype.exec=function(e,t){if("number"!=typeof t)throw new Error("Point size is not a number!");if(!(2",i),s.interpolate(c,o,a,l),s.touch(c)}e.loop=1},dr.bind(void 0,0),dr.bind(void 0,1),function(e){for(var t=e.stack,r=e.rp0,i=e.z0[r],n=e.loop,o=e.fv,a=e.pv,s=e.z1;n--;){var l=t.pop(),u=s[l];E.DEBUG&&console.log(e.step,(1=a.width||t>=a.height?[0,0,0,0]:this._getPixel(e,t);var s=new l.default.Image(r,i);return s.canvas.getContext("2d").drawImage(a,e,t,r*o,i*o,0,0,r,i),s},l.default.Renderer.prototype.textLeading=function(e){return"number"==typeof e?(this._setProperty("_textLeading",e),this._pInst):this._textLeading},l.default.Renderer.prototype.textSize=function(e){return"number"==typeof e?(this._setProperty("_textSize",e),this._setProperty("_textLeading",e*y._DEFAULT_LEADMULT),this._applyTextProperties()):this._textSize},l.default.Renderer.prototype.textStyle=function(e){return e?(e!==y.NORMAL&&e!==y.ITALIC&&e!==y.BOLD&&e!==y.BOLDITALIC||this._setProperty("_textStyle",e),this._applyTextProperties()):this._textStyle},l.default.Renderer.prototype.textAscent=function(){return null===this._textAscent&&this._updateTextMetrics(),this._textAscent},l.default.Renderer.prototype.textDescent=function(){return null===this._textDescent&&this._updateTextMetrics(),this._textDescent},l.default.Renderer.prototype.textAlign=function(e,t){return void 0!==e?(this._setProperty("_textAlign",e),void 0!==t&&this._setProperty("_textBaseline",t),this._applyTextProperties()):{horizontal:this._textAlign,vertical:this._textBaseline}},l.default.Renderer.prototype.text=function(e,t,r,i,n){var o,a,s,l,u,h,c,f,d=this._pInst,p=Number.MAX_VALUE;if((this._doFill||this._doStroke)&&void 0!==e){if("string"!=typeof e&&(e=e.toString()),o=(e=e.replace(/(\t)/g," ")).split("\n"),void 0!==i){for(s=f=0;ss.HALF_PI&&e<=3*s.HALF_PI?Math.atan(r/i*Math.tan(e))+s.PI:Math.atan(r/i*Math.tan(e))+s.TWO_PI,t=t<=s.HALF_PI?Math.atan(r/i*Math.tan(t)):t>s.HALF_PI&&t<=3*s.HALF_PI?Math.atan(r/i*Math.tan(t))+s.PI:Math.atan(r/i*Math.tan(t))+s.TWO_PI),tv||Math.abs(this.accelerationY-this.pAccelerationY)>v||Math.abs(this.accelerationZ-this.pAccelerationZ)>v)&&e();var t=this.deviceTurned||window.deviceTurned;if("function"==typeof t){var r=this.rotationX+180,i=this.pRotationX+180,n=c+180;0>>24],i+=x[(16711680&C)>>16],n+=x[(65280&C)>>8],o+=x[255&C],r+=k[_],s++}w[l=T+y]=a/r,S[l]=i/r,M[l]=n/r,E[l]=o/r}T+=d}for(h=(u=-P)*d,b=T=0;b>>16,e[r+1]=(65280&t[i])>>>8,e[r+2]=255&t[i],e[r+3]=(4278190080&t[i])>>>24},O._toImageData=function(e){return e instanceof ImageData?e:e.getContext("2d").getImageData(0,0,e.width,e.height)},O._createImageData=function(e,t){return O._tmpCanvas=document.createElement("canvas"),O._tmpCtx=O._tmpCanvas.getContext("2d"),this._tmpCtx.createImageData(e,t)},O.apply=function(e,t,r){var i=e.getContext("2d"),n=i.getImageData(0,0,e.width,e.height),o=t(n,r);o instanceof ImageData?i.putImageData(o,0,0,0,0,e.width,e.height):i.putImageData(n,0,0,0,0,e.width,e.height)},O.threshold=function(e,t){var r=O._toPixels(e);void 0===t&&(t=.5);for(var i=Math.floor(255*t),n=0;n>8)/i,r[n+1]=255*(a*t>>8)/i,r[n+2]=255*(s*t>>8)/i}},O.dilate=function(e){for(var t,r,i,n,o,a,s,l,u,h,c,f,d,p,m,g,v,y=O._toPixels(e),b=0,_=y.length?y.length/4:0,x=new Int32Array(_);b<_;)for(r=(t=b)+e.width;b>16&255)+151*(i>>8&255)+28*(255&i))<(m=77*(c>>16&255)+151*(c>>8&255)+28*(255&c))&&(n=c,o=m),o<(p=77*((h=O._getARGB(y,a))>>16&255)+151*(h>>8&255)+28*(255&h))&&(n=h,o=p),o<(g=77*(f>>16&255)+151*(f>>8&255)+28*(255&f))&&(n=f,o=g),o<(v=77*(d>>16&255)+151*(d>>8&255)+28*(255&d))&&(n=d,o=v),x[b++]=n;O._setPixels(y,x)},O.erode=function(e){for(var t,r,i,n,o,a,s,l,u,h,c,f,d,p,m,g,v,y=O._toPixels(e),b=0,_=y.length?y.length/4:0,x=new Int32Array(_);b<_;)for(r=(t=b)+e.width;b>16&255)+151*(c>>8&255)+28*(255&c))<(o=77*(i>>16&255)+151*(i>>8&255)+28*(255&i))&&(n=c,o=m),(p=77*((h=O._getARGB(y,a))>>16&255)+151*(h>>8&255)+28*(255&h))>16&255)+151*(f>>8&255)+28*(255&f))>16&255)+151*(d>>8&255)+28*(255&d))=r){var i=Math.floor(t.timeDisplayed/r);if(t.timeDisplayed=0,t.displayIndex+=i,t.loopCount=Math.floor(t.displayIndex/t.numFrames),null!==t.loopLimit&&t.loopCount>=t.loopLimit)t.playing=!1;else{var n=t.displayIndex%t.numFrames;this.drawingContext.putImageData(t.frames[n].image,0,0),t.displayIndex=n,this.setModified(!0)}}}},n.default.Image.prototype._setProperty=function(e,t){this[e]=t,this.setModified(!0)},n.default.Image.prototype.loadPixels=function(){n.default.Renderer2D.prototype.loadPixels.call(this),this.setModified(!0)},n.default.Image.prototype.updatePixels=function(e,t,r,i){n.default.Renderer2D.prototype.updatePixels.call(this,e,t,r,i),this.setModified(!0)},n.default.Image.prototype.get=function(e,t,r,i){return n.default._validateParameters("p5.Image.get",arguments),n.default.Renderer2D.prototype.get.apply(this,arguments)},n.default.Image.prototype._getPixel=n.default.Renderer2D.prototype._getPixel,n.default.Image.prototype.set=function(e,t,r){n.default.Renderer2D.prototype.set.call(this,e,t,r),this.setModified(!0)},n.default.Image.prototype.resize=function(e,t){0===e&&0===t?(e=this.canvas.width,t=this.canvas.height):0===e?e=this.canvas.width*t/this.canvas.height:0===t&&(t=this.canvas.height*e/this.canvas.width),e=Math.floor(e),t=Math.floor(t);var r=document.createElement("canvas");if(r.width=e,r.height=t,this.gifProperties)for(var i=this.gifProperties,n=function(e,t){for(var r=0,i=0;i/g,">").replace(/"/g,""").replace(/'/g,"'")}function l(e,t){t&&!0!==t&&"true"!==t||(t="");var r="";return(e=e||"untitled")&&e.includes(".")&&(r=e.split(".").pop()),t&&r!==t&&(r=t,e="".concat(e,".").concat(r)),[e,r]}e("../core/error_helpers"),v.default.prototype.loadJSON=function(){for(var e=arguments.length,t=new Array(e),r=0;r"),n.print("");if(n.print(' '),n.print(""),n.print(""),n.print(" "),"0"!==o[0]){n.print(" ");for(var h=0;h".concat(c)),n.print(" ")}n.print(" ")}for(var f=0;f");for(var d=0;d".concat(p)),n.print(" ")}n.print(" ")}n.print("
"),n.print(""),n.print("")}n.close(),n.clear()},v.default.prototype.writeFile=function(e,t,r){var i="application/octet-stream";v.default.prototype._isSafari()&&(i="text/plain");var n=new Blob(e,{type:i});v.default.prototype.downloadFile(n,t,r)},v.default.prototype.downloadFile=function(e,t,r){var i=l(t,r),n=i[0];if(e instanceof Blob)s.default.saveAs(e,n);else{var o=document.createElement("a");if(o.href=e,o.download=n,o.onclick=function(e){var t;t=e,document.body.removeChild(t.target),e.stopPropagation()},o.style.display="none",document.body.appendChild(o),v.default.prototype._isSafari()){var a="Hello, Safari user! To download this file...\n";a+="1. Go to File --\x3e Save As.\n",a+='2. Choose "Page Source" as the Format.\n',a+='3. Name it with this extension: ."'.concat(i[1],'"'),alert(a)}o.click()}},v.default.prototype._checkFileExtension=l,v.default.prototype._isSafari=function(){return 0>>0},getSeed:function(){return t},rand:function(){return(r=(1664525*r+1013904223)%i)/i}});n.setSeed(e),_=new Array(4096);for(var o=0;o<4096;o++)_[o]=n.rand()};var o=n.default;r.default=o},{"../core/main":49}],82:[function(e,t,r){"use strict";function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i,l=(i=e("../core/main"))&&i.__esModule?i:{default:i},o=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==a(e)&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var o=i?Object.getOwnPropertyDescriptor(e,n):null;o&&(o.get||o.set)?Object.defineProperty(r,n,o):r[n]=e[n]}r.default=e,t&&t.set(e,r);return r}(e("../core/constants"));function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}l.default.Vector=function(e,t,r){var i,n,o;o=e instanceof l.default?(this.p5=e,i=t[0]||0,n=t[1]||0,t[2]||0):(i=e||0,n=t||0,r||0),this.x=i,this.y=n,this.z=o},l.default.Vector.prototype.toString=function(){return"p5.Vector Object : [".concat(this.x,", ").concat(this.y,", ").concat(this.z,"]")},l.default.Vector.prototype.set=function(e,t,r){return e instanceof l.default.Vector?(this.x=e.x||0,this.y=e.y||0,this.z=e.z||0):e instanceof Array?(this.x=e[0]||0,this.y=e[1]||0,this.z=e[2]||0):(this.x=e||0,this.y=t||0,this.z=r||0),this},l.default.Vector.prototype.copy=function(){return this.p5?new l.default.Vector(this.p5,[this.x,this.y,this.z]):new l.default.Vector(this.x,this.y,this.z)},l.default.Vector.prototype.add=function(e,t,r){return e instanceof l.default.Vector?(this.x+=e.x||0,this.y+=e.y||0,this.z+=e.z||0):e instanceof Array?(this.x+=e[0]||0,this.y+=e[1]||0,this.z+=e[2]||0):(this.x+=e||0,this.y+=t||0,this.z+=r||0),this};function u(e,t){return 0!==e&&(this.x=this.x%e),0!==t&&(this.y=this.y%t),this}function h(e,t,r){return 0!==e&&(this.x=this.x%e),0!==t&&(this.y=this.y%t),0!==r&&(this.z=this.z%r),this}l.default.Vector.prototype.rem=function(e,t,r){if(e instanceof l.default.Vector){if(Number.isFinite(e.x)&&Number.isFinite(e.y)&&Number.isFinite(e.z)){var i=parseFloat(e.x),n=parseFloat(e.y),o=parseFloat(e.z);h.call(this,i,n,o)}}else if(e instanceof Array)e.every(function(e){return Number.isFinite(e)})&&(2===e.length&&u.call(this,e[0],e[1]),3===e.length&&h.call(this,e[0],e[1],e[2]));else if(1===arguments.length){if(Number.isFinite(e)&&0!==e)return this.x=this.x%e,this.y=this.y%e,this.z=this.z%e,this}else if(2===arguments.length){var a=Array.prototype.slice.call(arguments);a.every(function(e){return Number.isFinite(e)})&&2===a.length&&u.call(this,a[0],a[1])}else if(3===arguments.length){var s=Array.prototype.slice.call(arguments);s.every(function(e){return Number.isFinite(e)})&&3===s.length&&h.call(this,s[0],s[1],s[2])}},l.default.Vector.prototype.sub=function(e,t,r){return e instanceof l.default.Vector?(this.x-=e.x||0,this.y-=e.y||0,this.z-=e.z||0):e instanceof Array?(this.x-=e[0]||0,this.y-=e[1]||0,this.z-=e[2]||0):(this.x-=e||0,this.y-=t||0,this.z-=r||0),this},l.default.Vector.prototype.mult=function(e){return"number"==typeof e&&isFinite(e)?(this.x*=e,this.y*=e,this.z*=e):console.warn("p5.Vector.prototype.mult:","n is undefined or not a finite number"),this},l.default.Vector.prototype.div=function(e){return"number"==typeof e&&isFinite(e)?0===e?console.warn("p5.Vector.prototype.div:","divide by 0"):(this.x/=e,this.y/=e,this.z/=e):console.warn("p5.Vector.prototype.div:","n is undefined or not a finite number"),this},l.default.Vector.prototype.mag=function(){return Math.sqrt(this.magSq())},l.default.Vector.prototype.magSq=function(){var e=this.x,t=this.y,r=this.z;return e*e+t*t+r*r},l.default.Vector.prototype.dot=function(e,t,r){return e instanceof l.default.Vector?this.dot(e.x,e.y,e.z):this.x*(e||0)+this.y*(t||0)+this.z*(r||0)},l.default.Vector.prototype.cross=function(e){var t=this.y*e.z-this.z*e.y,r=this.z*e.x-this.x*e.z,i=this.x*e.y-this.y*e.x;return this.p5?new l.default.Vector(this.p5,[t,r,i]):new l.default.Vector(t,r,i)},l.default.Vector.prototype.dist=function(e){return e.copy().sub(this).mag()},l.default.Vector.prototype.normalize=function(){var e=this.mag();return 0!==e&&this.mult(1/e),this},l.default.Vector.prototype.limit=function(e){var t=this.magSq();return e*e>>0},n.default.prototype.randomSeed=function(e){this._lcgSetSeed(o,e),this._gaussian_previous=!1},n.default.prototype.random=function(e,t){var r;if(n.default._validateParameters("random",arguments),r=null!=this[o]?this._lcg(o):Math.random(),void 0===e)return r;if(void 0===t)return e instanceof Array?e[Math.floor(r*e.length)]:r*e;if(tf){var P=p,L=l,k=u;p=d+f*(s&&d=t&&(r=r.substring(r.length-t,r.length)),r}},n.default.prototype.unhex=function(e){return e instanceof Array?e.map(n.default.prototype.unhex):parseInt("0x".concat(e),16)};var o=n.default;r.default=o},{"../core/main":49}],90:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i,a=(i=e("../core/main"))&&i.__esModule?i:{default:i};function n(e,t,r){var i=e<0,n=i?e.toString().substring(1):e.toString(),o=n.indexOf("."),a=-1!==o?n.substring(0,o):n,s=-1!==o?n.substring(o+1):"",l=i?"-":"";if(void 0!==r){var u="";(-1!==o||0r&&(s=s.substring(0,r));for(var h=0;hi.length)for(var o=t-(i+=-1===r?".":"").length+1,a=0;a=d.TWO_PI?"".concat("ellipse","|").concat(u,"|"):"".concat("arc","|").concat(a,"|").concat(s,"|").concat(l,"|").concat(u,"|"),!this.geometryInHash(t)){var h=new T.default.Geometry(u,1,function(){if(this.strokeIndices=[],a.toFixed(10)!==s.toFixed(10)){l!==d.PIE&&void 0!==l||(this.vertices.push(new T.default.Vector(.5,.5,0)),this.uvs.push([.5,.5]));for(var e=0;e<=u;e++){var t=(s-a)*(e/u)+a,r=.5+Math.cos(t)/2,i=.5+Math.sin(t)/2;this.vertices.push(new T.default.Vector(r,i,0)),this.uvs.push([r,i]),e>5&31)/31,(y>>10&31)/31):(r=a,i=s,l)}for(var b=1;b<=3;b++){var _=p+12*b,x=new S.default.Vector(u.getFloat32(_,!0),u.getFloat32(8+_,!0),u.getFloat32(4+_,!0));e.vertices.push(x),c&&o.push(r,i,n)}var w=new S.default.Vector(m,g,v);e.vertexNormals.push(w,w,w),e.faces.push([3*d,3*d+1,3*d+2]),e.uvs.push([0,0],[0,0],[0,0])}}(e,t);else{var r=new DataView(t);if(!("TextDecoder"in window))return console.warn("Sorry, ASCII STL loading only works in browsers that support TextDecoder (https://caniuse.com/#feat=textencoder)");var i=new TextDecoder("utf-8").decode(r).split("\n");!function(e,t){for(var r,i,n="",o=[],a=0;aMath.PI?l=Math.PI:l<=0&&(l=.001);var u=Math.sin(l)*a*Math.sin(s),h=Math.cos(l)*a,c=Math.sin(l)*a*Math.cos(s);this.camera(u+this.centerX,h+this.centerY,c+this.centerZ,this.centerX,this.centerY,this.centerZ,0,1,0)},m.default.Camera.prototype._isActive=function(){return this===this._renderer._curCamera},m.default.prototype.setCamera=function(e){this._renderer._curCamera=e,this._renderer.uPMatrix.set(e.projMatrix.mat4[0],e.projMatrix.mat4[1],e.projMatrix.mat4[2],e.projMatrix.mat4[3],e.projMatrix.mat4[4],e.projMatrix.mat4[5],e.projMatrix.mat4[6],e.projMatrix.mat4[7],e.projMatrix.mat4[8],e.projMatrix.mat4[9],e.projMatrix.mat4[10],e.projMatrix.mat4[11],e.projMatrix.mat4[12],e.projMatrix.mat4[13],e.projMatrix.mat4[14],e.projMatrix.mat4[15])};var n=m.default.Camera;r.default=n},{"../core/main":49}],98:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i,h=(i=e("../core/main"))&&i.__esModule?i:{default:i};h.default.Geometry=function(e,t,r){return this.vertices=[],this.lineVertices=[],this.lineNormals=[],this.vertexNormals=[],this.faces=[],this.uvs=[],this.edges=[],this.vertexColors=[],this.detailX=void 0!==e?e:1,this.detailY=void 0!==t?t:1,this.dirtyFlags={},r instanceof Function&&r.call(this),this},h.default.Geometry.prototype.reset=function(){this.lineVertices.length=0,this.lineNormals.length=0,this.vertices.length=0,this.edges.length=0,this.vertexColors.length=0,this.vertexNormals.length=0,this.uvs.length=0,this.dirtyFlags={}},h.default.Geometry.prototype.computeFaces=function(){this.faces.length=0;for(var e,t,r,i,n=this.detailX+1,o=0;othis.vertices.length-1-this.detailX;i--)e.add(this.vertexNormals[i]);e=h.default.Vector.div(e,this.detailX);for(var n=this.vertices.length-1;n>this.vertices.length-1-this.detailX;n--)this.vertexNormals[n]=e;return this},h.default.Geometry.prototype._makeTriangleEdges=function(){if(this.edges.length=0,Array.isArray(this.strokeIndices))for(var e=0,t=this.strokeIndices.length;e vTexCoord.y;\n bool y1 = p1.y > vTexCoord.y;\n bool y2 = p2.y > vTexCoord.y;\n\n // could web be under the curve (after t1)?\n if (y1 ? !y2 : y0) {\n // add the coverage for t1\n coverage.x += saturate(C1.x + 0.5);\n // calculate the anti-aliasing for t1\n weight.x = min(weight.x, abs(C1.x));\n }\n\n // are we outside the curve (after t2)?\n if (y1 ? !y0 : y2) {\n // subtract the coverage for t2\n coverage.x -= saturate(C2.x + 0.5);\n // calculate the anti-aliasing for t2\n weight.x = min(weight.x, abs(C2.x));\n }\n}\n\n// this is essentially the same as coverageX, but with the axes swapped\nvoid coverageY(vec2 p0, vec2 p1, vec2 p2) {\n\n vec2 C1, C2;\n calulateCrossings(p0, p1, p2, C1, C2);\n\n bool x0 = p0.x > vTexCoord.x;\n bool x1 = p1.x > vTexCoord.x;\n bool x2 = p2.x > vTexCoord.x;\n\n if (x1 ? !x2 : x0) {\n coverage.y -= saturate(C1.y + 0.5);\n weight.y = min(weight.y, abs(C1.y));\n }\n\n if (x1 ? !x0 : x2) {\n coverage.y += saturate(C2.y + 0.5);\n weight.y = min(weight.y, abs(C2.y));\n }\n}\n\nvoid main() {\n\n // calculate the pixel scale based on screen-coordinates\n pixelScale = hardness / fwidth(vTexCoord);\n\n // which grid cell is this pixel in?\n ivec2 gridCoord = ifloor(vTexCoord * vec2(uGridSize));\n\n // intersect curves in this row\n {\n // the index into the row info bitmap\n int rowIndex = gridCoord.y + uGridOffset.y;\n // fetch the info texel\n vec4 rowInfo = getTexel(uSamplerRows, rowIndex, uGridImageSize);\n // unpack the rowInfo\n int rowStrokeIndex = getInt16(rowInfo.xy);\n int rowStrokeCount = getInt16(rowInfo.zw);\n\n for (int iRowStroke = INT(0); iRowStroke < N; iRowStroke++) {\n if (iRowStroke >= rowStrokeCount)\n break;\n\n // each stroke is made up of 3 points: the start and control point\n // and the start of the next curve.\n // fetch the indices of this pair of strokes:\n vec4 strokeIndices = getTexel(uSamplerRowStrokes, rowStrokeIndex++, uCellsImageSize);\n\n // unpack the stroke index\n int strokePos = getInt16(strokeIndices.xy);\n\n // fetch the two strokes\n vec4 stroke0 = getTexel(uSamplerStrokes, strokePos + INT(0), uStrokeImageSize);\n vec4 stroke1 = getTexel(uSamplerStrokes, strokePos + INT(1), uStrokeImageSize);\n\n // calculate the coverage\n coverageX(stroke0.xy, stroke0.zw, stroke1.xy);\n }\n }\n\n // intersect curves in this column\n {\n int colIndex = gridCoord.x + uGridOffset.x;\n vec4 colInfo = getTexel(uSamplerCols, colIndex, uGridImageSize);\n int colStrokeIndex = getInt16(colInfo.xy);\n int colStrokeCount = getInt16(colInfo.zw);\n \n for (int iColStroke = INT(0); iColStroke < N; iColStroke++) {\n if (iColStroke >= colStrokeCount)\n break;\n\n vec4 strokeIndices = getTexel(uSamplerColStrokes, colStrokeIndex++, uCellsImageSize);\n\n int strokePos = getInt16(strokeIndices.xy);\n vec4 stroke0 = getTexel(uSamplerStrokes, strokePos + INT(0), uStrokeImageSize);\n vec4 stroke1 = getTexel(uSamplerStrokes, strokePos + INT(1), uStrokeImageSize);\n coverageY(stroke0.xy, stroke0.zw, stroke1.xy);\n }\n }\n\n weight = saturate(1.0 - weight * 2.0);\n float distance = max(weight.x + weight.y, minDistance); // manhattan approx.\n float antialias = abs(dot(coverage, weight) / distance);\n float cover = min(abs(coverage.x), abs(coverage.y));\n gl_FragColor = uMaterialColor;\n gl_FragColor.a *= saturate(max(antialias, cover));\n}",lineVert:"/*\n Part of the Processing project - http://processing.org\n Copyright (c) 2012-15 The Processing Foundation\n Copyright (c) 2004-12 Ben Fry and Casey Reas\n Copyright (c) 2001-04 Massachusetts Institute of Technology\n This library is free software; you can redistribute it and/or\n modify it under the terms of the GNU Lesser General Public\n License as published by the Free Software Foundation, version 2.1.\n This library is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n Lesser General Public License for more details.\n You should have received a copy of the GNU Lesser General\n Public License along with this library; if not, write to the\n Free Software Foundation, Inc., 59 Temple Place, Suite 330,\n Boston, MA 02111-1307 USA\n*/\n\n#define PROCESSING_LINE_SHADER\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform float uStrokeWeight;\n\nuniform vec4 uViewport;\nuniform int uPerspective;\n\nattribute vec4 aPosition;\nattribute vec4 aDirection;\n \nvoid main() {\n // using a scale <1 moves the lines towards the camera\n // in order to prevent popping effects due to half of\n // the line disappearing behind the geometry faces.\n vec3 scale = vec3(0.9995);\n\n vec4 posp = uModelViewMatrix * aPosition;\n vec4 posq = uModelViewMatrix * (aPosition + vec4(aDirection.xyz, 0));\n\n // Moving vertices slightly toward the camera\n // to avoid depth-fighting with the fill triangles.\n // Discussed here:\n // http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Number=252848 \n posp.xyz = posp.xyz * scale;\n posq.xyz = posq.xyz * scale;\n\n vec4 p = uProjectionMatrix * posp;\n vec4 q = uProjectionMatrix * posq;\n\n // formula to convert from clip space (range -1..1) to screen space (range 0..[width or height])\n // screen_p = (p.xy/p.w + <1,1>) * 0.5 * uViewport.zw\n\n // prevent division by W by transforming the tangent formula (div by 0 causes\n // the line to disappear, see https://github.com/processing/processing/issues/5183)\n // t = screen_q - screen_p\n //\n // tangent is normalized and we don't care which aDirection it points to (+-)\n // t = +- normalize( screen_q - screen_p )\n // t = +- normalize( (q.xy/q.w+<1,1>)*0.5*uViewport.zw - (p.xy/p.w+<1,1>)*0.5*uViewport.zw )\n //\n // extract common factor, <1,1> - <1,1> cancels out\n // t = +- normalize( (q.xy/q.w - p.xy/p.w) * 0.5 * uViewport.zw )\n //\n // convert to common divisor\n // t = +- normalize( ((q.xy*p.w - p.xy*q.w) / (p.w*q.w)) * 0.5 * uViewport.zw )\n //\n // remove the common scalar divisor/factor, not needed due to normalize and +-\n // (keep uViewport - can't remove because it has different components for x and y\n // and corrects for aspect ratio, see https://github.com/processing/processing/issues/5181)\n // t = +- normalize( (q.xy*p.w - p.xy*q.w) * uViewport.zw )\n\n vec2 tangent = normalize((q.xy*p.w - p.xy*q.w) * uViewport.zw);\n\n // flip tangent to normal (it's already normalized)\n vec2 normal = vec2(-tangent.y, tangent.x);\n\n float thickness = aDirection.w * uStrokeWeight;\n vec2 offset = normal * thickness / 2.0;\n\n vec2 curPerspScale;\n\n if(uPerspective == 1) {\n // Perspective ---\n // convert from world to clip by multiplying with projection scaling factor\n // to get the right thickness (see https://github.com/processing/processing/issues/5182)\n // invert Y, projections in Processing invert Y\n curPerspScale = (uProjectionMatrix * vec4(1, -1, 0, 0)).xy;\n } else {\n // No Perspective ---\n // multiply by W (to cancel out division by W later in the pipeline) and\n // convert from screen to clip (derived from clip to screen above)\n curPerspScale = p.w / (0.5 * uViewport.zw);\n }\n\n gl_Position.xy = p.xy + offset.xy * curPerspScale;\n gl_Position.zw = p.zw;\n}\n",lineFrag:"precision mediump float;\nprecision mediump int;\n\nuniform vec4 uMaterialColor;\n\nvoid main() {\n gl_FragColor = uMaterialColor;\n}",pointVert:"attribute vec3 aPosition;\nuniform float uPointSize;\nvarying float vStrokeWeight;\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nvoid main() {\n\tvec4 positionVec4 = vec4(aPosition, 1.0);\n\tgl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n\tgl_PointSize = uPointSize;\n\tvStrokeWeight = uPointSize;\n}",pointFrag:"precision mediump float;\nprecision mediump int;\nuniform vec4 uMaterialColor;\nvarying float vStrokeWeight;\n\nvoid main(){\n\tfloat mask = 0.0;\n\n\t// make a circular mask using the gl_PointCoord (goes from 0 - 1 on a point)\n // might be able to get a nicer edge on big strokeweights with smoothstep but slightly less performant\n\n\tmask = step(0.98, length(gl_PointCoord * 2.0 - 1.0));\n\n\t// if strokeWeight is 1 or less lets just draw a square\n\t// this prevents weird artifacting from carving circles when our points are really small\n\t// if strokeWeight is larger than 1, we just use it as is\n\n\tmask = mix(0.0, mask, clamp(floor(vStrokeWeight - 0.5),0.0,1.0));\n\n\t// throw away the borders of the mask\n // otherwise we get weird alpha blending issues\n\n\tif(mask > 0.98){\n discard;\n \t}\n\n \tgl_FragColor = vec4(uMaterialColor.rgb * (1.0 - mask), uMaterialColor.a) ;\n}"};u.default.RendererGL=function(e,t,r,i){return u.default.Renderer.call(this,e,t,r),this._setAttributeDefaults(t),this._initContext(),this.isP3D=!0,this.GL=this.drawingContext,this._isErasing=!1,this._enableLighting=!1,this.ambientLightColors=[],this.specularColors=[1,1,1],this.directionalLightDirections=[],this.directionalLightDiffuseColors=[],this.directionalLightSpecularColors=[],this.pointLightPositions=[],this.pointLightDiffuseColors=[],this.pointLightSpecularColors=[],this.spotLightPositions=[],this.spotLightDirections=[],this.spotLightDiffuseColors=[],this.spotLightSpecularColors=[],this.spotLightAngle=[],this.spotLightConc=[],this.drawMode=o.FILL,this.curFillColor=this._cachedFillStyle=[1,1,1,1],this.curStrokeColor=this._cachedStrokeStyle=[0,0,0,1],this.curBlendMode=o.BLEND,this._cachedBlendMode=void 0,this.blendExt=this.GL.getExtension("EXT_blend_minmax"),this._isBlending=!1,this._useSpecularMaterial=!1,this._useEmissiveMaterial=!1,this._useNormalMaterial=!1,this._useShininess=1,this._tint=[255,255,255,255],this.constantAttenuation=1,this.linearAttenuation=0,this.quadraticAttenuation=0,this.uMVMatrix=new u.default.Matrix,this.uPMatrix=new u.default.Matrix,this.uNMatrix=new u.default.Matrix("mat3"),this._curCamera=new u.default.Camera(this),this._curCamera._computeCameraDefaultSettings(),this._curCamera._setDefaultCamera(),this._defaultLightShader=void 0,this._defaultImmediateModeShader=void 0,this._defaultNormalShader=void 0,this._defaultColorShader=void 0,this._defaultPointShader=void 0,this.userFillShader=void 0,this.userStrokeShader=void 0,this.userPointShader=void 0,this.retainedMode={geometry:{},buffers:{stroke:[new u.default.RenderBuffer(3,"lineVertices","lineVertexBuffer","aPosition",this,this._flatten),new u.default.RenderBuffer(4,"lineNormals","lineNormalBuffer","aDirection",this,this._flatten)],fill:[new u.default.RenderBuffer(3,"vertices","vertexBuffer","aPosition",this,this._vToNArray),new u.default.RenderBuffer(3,"vertexNormals","normalBuffer","aNormal",this,this._vToNArray),new u.default.RenderBuffer(4,"vertexColors","colorBuffer","aMaterialColor",this),new u.default.RenderBuffer(3,"vertexAmbients","ambientBuffer","aAmbientColor",this),new u.default.RenderBuffer(2,"uvs","uvBuffer","aTexCoord",this,this._flatten)],text:[new u.default.RenderBuffer(3,"vertices","vertexBuffer","aPosition",this,this._vToNArray),new u.default.RenderBuffer(2,"uvs","uvBuffer","aTexCoord",this,this._flatten)]}},this.immediateMode={geometry:new u.default.Geometry,shapeMode:o.TRIANGLE_FAN,_bezierVertex:[],_quadraticVertex:[],_curveVertex:[],buffers:{fill:[new u.default.RenderBuffer(3,"vertices","vertexBuffer","aPosition",this,this._vToNArray),new u.default.RenderBuffer(3,"vertexNormals","normalBuffer","aNormal",this,this._vToNArray),new u.default.RenderBuffer(4,"vertexColors","colorBuffer","aVertexColor",this),new u.default.RenderBuffer(3,"vertexAmbients","ambientBuffer","aAmbientColor",this),new u.default.RenderBuffer(2,"uvs","uvBuffer","aTexCoord",this,this._flatten)],stroke:[new u.default.RenderBuffer(3,"lineVertices","lineVertexBuffer","aPosition",this,this._flatten),new u.default.RenderBuffer(4,"lineNormals","lineNormalBuffer","aDirection",this,this._flatten)],point:this.GL.createBuffer()}},this.pointSize=5,this.curStrokeWeight=1,this.textures=[],this.textureMode=o.IMAGE,this.textureWrapX=o.CLAMP,this.textureWrapY=o.CLAMP,this._tex=null,this._curveTightness=6,this._lookUpTableBezier=[],this._lookUpTableQuadratic=[],this._lutBezierDetail=0,this._lutQuadraticDetail=0,this._tessy=this._initTessy(),this.fontInfos={},this._curShader=void 0,this},u.default.RendererGL.prototype=Object.create(u.default.Renderer.prototype),u.default.RendererGL.prototype._setAttributeDefaults=function(e){var t={alpha:!0,depth:!0,stencil:!0,antialias:navigator.userAgent.toLowerCase().includes("safari"),premultipliedAlpha:!1,preserveDrawingBuffer:!0,perPixelLighting:!0};null===e._glAttributes?e._glAttributes=t:e._glAttributes=Object.assign(t,e._glAttributes)},u.default.RendererGL.prototype._initContext=function(){try{if(this.drawingContext=this.canvas.getContext("webgl",this._pInst._glAttributes)||this.canvas.getContext("experimental-webgl",this._pInst._glAttributes),null===this.drawingContext)throw new Error("Error creating webgl context");var e=this.drawingContext;e.enable(e.DEPTH_TEST),e.depthFunc(e.LEQUAL),e.viewport(0,0,e.drawingBufferWidth,e.drawingBufferHeight),this._viewport=this.drawingContext.getParameter(this.drawingContext.VIEWPORT)}catch(e){throw e}},u.default.RendererGL.prototype._resetContext=function(e,t){var r=this.width,i=this.height,n=this.canvas.id,o=this._pInst instanceof u.default.Graphics;if(o){var a=this._pInst;a.canvas.parentNode.removeChild(a.canvas),a.canvas=document.createElement("canvas"),(a._pInst._userNode||document.body).appendChild(a.canvas),u.default.Element.call(a,a.canvas,a._pInst),a.width=r,a.height=i}else{var s=this.canvas;s&&s.parentNode.removeChild(s),(s=document.createElement("canvas")).id=n,this._pInst._userNode?this._pInst._userNode.appendChild(s):document.body.appendChild(s),this._pInst.canvas=s}var l=new u.default.RendererGL(this._pInst.canvas,this._pInst,!o);this._pInst._setProperty("_renderer",l),l.resize(r,i),l._applyDefaults(),o||this._pInst._elements.push(l),"function"==typeof t&&setTimeout(function(){t.apply(window._renderer,e)},0)},u.default.prototype.setAttributes=function(e,t){if(void 0!==this._glAttributes){var r=!0;if(void 0!==t?(null===this._glAttributes&&(this._glAttributes={}),this._glAttributes[e]!==t&&(this._glAttributes[e]=t,r=!1)):e instanceof Object&&this._glAttributes!==e&&(this._glAttributes=e,r=!1),this._renderer.isP3D&&!r){if(!this._setupDone)for(var i in this._renderer.retainedMode.geometry)if(this._renderer.retainedMode.geometry.hasOwnProperty(i))return void console.error("Sorry, Could not set the attributes, you need to call setAttributes() before calling the other drawing methods in setup()");this.push(),this._renderer._resetContext(),this.pop(),this._renderer._curCamera&&(this._renderer._curCamera._renderer=this._renderer)}}else console.log("You are trying to use setAttributes on a p5.Graphics object that does not use a WEBGL renderer.")},u.default.RendererGL.prototype._update=function(){this.uMVMatrix.set(this._curCamera.cameraMatrix.mat4[0],this._curCamera.cameraMatrix.mat4[1],this._curCamera.cameraMatrix.mat4[2],this._curCamera.cameraMatrix.mat4[3],this._curCamera.cameraMatrix.mat4[4],this._curCamera.cameraMatrix.mat4[5],this._curCamera.cameraMatrix.mat4[6],this._curCamera.cameraMatrix.mat4[7],this._curCamera.cameraMatrix.mat4[8],this._curCamera.cameraMatrix.mat4[9],this._curCamera.cameraMatrix.mat4[10],this._curCamera.cameraMatrix.mat4[11],this._curCamera.cameraMatrix.mat4[12],this._curCamera.cameraMatrix.mat4[13],this._curCamera.cameraMatrix.mat4[14],this._curCamera.cameraMatrix.mat4[15]),this.ambientLightColors.length=0,this.specularColors=[1,1,1],this.directionalLightDirections.length=0,this.directionalLightDiffuseColors.length=0,this.directionalLightSpecularColors.length=0,this.pointLightPositions.length=0,this.pointLightDiffuseColors.length=0,this.pointLightSpecularColors.length=0,this.spotLightPositions.length=0,this.spotLightDirections.length=0,this.spotLightDiffuseColors.length=0,this.spotLightSpecularColors.length=0,this.spotLightAngle.length=0,this.spotLightConc.length=0,this._enableLighting=!1,this._tint=[255,255,255,255],this.GL.clear(this.GL.DEPTH_BUFFER_BIT)},u.default.RendererGL.prototype.background=function(){var e,t=(e=this._pInst).color.apply(e,arguments),r=t.levels[0]/255,i=t.levels[1]/255,n=t.levels[2]/255,o=t.levels[3]/255;this.GL.clearColor(r,i,n,o),this.GL.clear(this.GL.COLOR_BUFFER_BIT)},u.default.RendererGL.prototype.fill=function(e,t,r,i){var n=u.default.prototype.color.apply(this._pInst,arguments);this.curFillColor=n._array,this.drawMode=o.FILL,this._useNormalMaterial=!1,this._tex=null},u.default.RendererGL.prototype.stroke=function(e,t,r,i){arguments[3]=255;var n=u.default.prototype.color.apply(this._pInst,arguments);this.curStrokeColor=n._array},u.default.RendererGL.prototype.strokeCap=function(e){console.error("Sorry, strokeCap() is not yet implemented in WEBGL mode")},u.default.RendererGL.prototype.strokeJoin=function(e){console.error("Sorry, strokeJoin() is not yet implemented in WEBGL mode")},u.default.RendererGL.prototype.filter=function(e){console.error("filter() does not work in WEBGL mode")},u.default.RendererGL.prototype.blendMode=function(e){e===o.DARKEST||e===o.LIGHTEST||e===o.ADD||e===o.BLEND||e===o.SUBTRACT||e===o.SCREEN||e===o.EXCLUSION||e===o.REPLACE||e===o.MULTIPLY||e===o.REMOVE?this.curBlendMode=e:e!==o.BURN&&e!==o.OVERLAY&&e!==o.HARD_LIGHT&&e!==o.SOFT_LIGHT&&e!==o.DODGE||console.warn("BURN, OVERLAY, HARD_LIGHT, SOFT_LIGHT, and DODGE only work for blendMode in 2D mode.")},u.default.RendererGL.prototype.erase=function(e,t){this._isErasing||(this._cachedBlendMode=this.curBlendMode,this.blendMode(o.REMOVE),this._cachedFillStyle=this.curFillColor.slice(),this.curFillColor=[1,1,1,e/255],this._cachedStrokeStyle=this.curStrokeColor.slice(),this.curStrokeColor=[1,1,1,t/255],this._isErasing=!0)},u.default.RendererGL.prototype.noErase=function(){this._isErasing&&(this.curFillColor=this._cachedFillStyle.slice(),this.curStrokeColor=this._cachedStrokeStyle.slice(),this.blendMode(this._cachedBlendMode),this._isErasing=!1)},u.default.RendererGL.prototype.strokeWeight=function(e){this.curStrokeWeight!==e&&(this.pointSize=e,this.curStrokeWeight=e)},u.default.RendererGL.prototype._getPixel=function(e,t){var r;return r=new Uint8Array(4),this.drawingContext.readPixels(e,t,1,1,this.drawingContext.RGBA,this.drawingContext.UNSIGNED_BYTE,r),[r[0],r[1],r[2],r[3]]},u.default.RendererGL.prototype.loadPixels=function(){var e=this._pixelsState;if(!0===this._pInst._glAttributes.preserveDrawingBuffer){var t=e.pixels,r=this.GL.drawingBufferWidth*this.GL.drawingBufferHeight*4;t instanceof Uint8Array&&t.length===r||(t=new Uint8Array(r),this._pixelsState._setProperty("pixels",t));var i=this._pInst._pixelDensity;this.GL.readPixels(0,0,this.width*i,this.height*i,this.GL.RGBA,this.GL.UNSIGNED_BYTE,t)}else console.log("loadPixels only works in WebGL when preserveDrawingBuffer is true.")},u.default.RendererGL.prototype.geometryInHash=function(e){return void 0!==this.retainedMode.geometry[e]},u.default.RendererGL.prototype.resize=function(e,t){u.default.Renderer.prototype.resize.call(this,e,t),this.GL.viewport(0,0,this.GL.drawingBufferWidth,this.GL.drawingBufferHeight),this._viewport=this.GL.getParameter(this.GL.VIEWPORT),this._curCamera._resize();var r=this._pixelsState;void 0!==r.pixels&&r._setProperty("pixels",new Uint8Array(this.GL.drawingBufferWidth*this.GL.drawingBufferHeight*4))},u.default.RendererGL.prototype.clear=function(){var e=(arguments.length<=0?void 0:arguments[0])||0,t=(arguments.length<=1?void 0:arguments[1])||0,r=(arguments.length<=2?void 0:arguments[2])||0,i=(arguments.length<=3?void 0:arguments[3])||0;this.GL.clearColor(e,t,r,i),this.GL.clear(this.GL.COLOR_BUFFER_BIT|this.GL.DEPTH_BUFFER_BIT)},u.default.RendererGL.prototype.applyMatrix=function(e,t,r,i,n,o){16===arguments.length?u.default.Matrix.prototype.apply.apply(this.uMVMatrix,arguments):this.uMVMatrix.apply([e,t,0,0,r,i,0,0,0,0,1,0,n,o,0,1])},u.default.RendererGL.prototype.translate=function(e,t,r){return e instanceof u.default.Vector&&(r=e.z,t=e.y,e=e.x),this.uMVMatrix.translate([e,t,r]),this},u.default.RendererGL.prototype.scale=function(e,t,r){return this.uMVMatrix.scale(e,t,r),this},u.default.RendererGL.prototype.rotate=function(e,t){return void 0===t?this.rotateZ(e):(u.default.Matrix.prototype.rotate.apply(this.uMVMatrix,arguments),this)},u.default.RendererGL.prototype.rotateX=function(e){return this.rotate(e,1,0,0),this},u.default.RendererGL.prototype.rotateY=function(e){return this.rotate(e,0,1,0),this},u.default.RendererGL.prototype.rotateZ=function(e){return this.rotate(e,0,0,1),this},u.default.RendererGL.prototype.push=function(){var e=u.default.Renderer.prototype.push.apply(this),t=e.properties;return t.uMVMatrix=this.uMVMatrix.copy(),t.uPMatrix=this.uPMatrix.copy(),t._curCamera=this._curCamera,this._curCamera=this._curCamera.copy(),t.ambientLightColors=this.ambientLightColors.slice(),t.specularColors=this.specularColors.slice(),t.directionalLightDirections=this.directionalLightDirections.slice(),t.directionalLightDiffuseColors=this.directionalLightDiffuseColors.slice(),t.directionalLightSpecularColors=this.directionalLightSpecularColors.slice(),t.pointLightPositions=this.pointLightPositions.slice(),t.pointLightDiffuseColors=this.pointLightDiffuseColors.slice(),t.pointLightSpecularColors=this.pointLightSpecularColors.slice(),t.spotLightPositions=this.spotLightPositions.slice(),t.spotLightDirections=this.spotLightDirections.slice(),t.spotLightDiffuseColors=this.spotLightDiffuseColors.slice(),t.spotLightSpecularColors=this.spotLightSpecularColors.slice(),t.spotLightAngle=this.spotLightAngle.slice(),t.spotLightConc=this.spotLightConc.slice(),t.userFillShader=this.userFillShader,t.userStrokeShader=this.userStrokeShader,t.userPointShader=this.userPointShader,t.pointSize=this.pointSize,t.curStrokeWeight=this.curStrokeWeight,t.curStrokeColor=this.curStrokeColor,t.curFillColor=this.curFillColor,t._useSpecularMaterial=this._useSpecularMaterial,t._useEmissiveMaterial=this._useEmissiveMaterial,t._useShininess=this._useShininess,t.constantAttenuation=this.constantAttenuation,t.linearAttenuation=this.linearAttenuation,t.quadraticAttenuation=this.quadraticAttenuation,t._enableLighting=this._enableLighting,t._useNormalMaterial=this._useNormalMaterial,t._tex=this._tex,t.drawMode=this.drawMode,e},u.default.RendererGL.prototype.resetMatrix=function(){return this.uMVMatrix=u.default.Matrix.identity(this._pInst),this},u.default.RendererGL.prototype._getImmediateStrokeShader=function(){var e=this.userStrokeShader;return e&&e.isStrokeShader()?e:this._getLineShader()},u.default.RendererGL.prototype._getRetainedStrokeShader=u.default.RendererGL.prototype._getImmediateStrokeShader,u.default.RendererGL.prototype._getImmediateFillShader=function(){var e=this.userFillShader;if(this._useNormalMaterial&&(!e||!e.isNormalShader()))return this._getNormalShader();if(this._enableLighting){if(!e||!e.isLightShader())return this._getLightShader()}else if(this._tex){if(!e||!e.isTextureShader())return this._getLightShader()}else if(!e)return this._getImmediateModeShader();return e},u.default.RendererGL.prototype._getRetainedFillShader=function(){if(this._useNormalMaterial)return this._getNormalShader();var e=this.userFillShader;if(this._enableLighting){if(!e||!e.isLightShader())return this._getLightShader()}else if(this._tex){if(!e||!e.isTextureShader())return this._getLightShader()}else if(!e)return this._getColorShader();return e},u.default.RendererGL.prototype._getImmediatePointShader=function(){var e=this.userPointShader;return e&&e.isPointShader()?e:this._getPointShader()},u.default.RendererGL.prototype._getRetainedLineShader=u.default.RendererGL.prototype._getImmediateLineShader,u.default.RendererGL.prototype._getLightShader=function(){return this._defaultLightShader||(this._pInst._glAttributes.perPixelLighting?this._defaultLightShader=new u.default.Shader(this,c.phongVert,c.phongFrag):this._defaultLightShader=new u.default.Shader(this,c.lightVert,c.lightTextureFrag)),this._defaultLightShader},u.default.RendererGL.prototype._getImmediateModeShader=function(){return this._defaultImmediateModeShader||(this._defaultImmediateModeShader=new u.default.Shader(this,c.immediateVert,c.vertexColorFrag)),this._defaultImmediateModeShader},u.default.RendererGL.prototype._getNormalShader=function(){return this._defaultNormalShader||(this._defaultNormalShader=new u.default.Shader(this,c.normalVert,c.normalFrag)),this._defaultNormalShader},u.default.RendererGL.prototype._getColorShader=function(){return this._defaultColorShader||(this._defaultColorShader=new u.default.Shader(this,c.normalVert,c.basicFrag)),this._defaultColorShader},u.default.RendererGL.prototype._getPointShader=function(){return this._defaultPointShader||(this._defaultPointShader=new u.default.Shader(this,c.pointVert,c.pointFrag)),this._defaultPointShader},u.default.RendererGL.prototype._getLineShader=function(){return this._defaultLineShader||(this._defaultLineShader=new u.default.Shader(this,c.lineVert,c.lineFrag)),this._defaultLineShader},u.default.RendererGL.prototype._getFontShader=function(){return this._defaultFontShader||(this.GL.getExtension("OES_standard_derivatives"),this._defaultFontShader=new u.default.Shader(this,c.fontVert,c.fontFrag)),this._defaultFontShader},u.default.RendererGL.prototype._getEmptyTexture=function(){if(!this._emptyTexture){var e=new u.default.Image(1,1);e.set(0,0,255),this._emptyTexture=new u.default.Texture(this,e)}return this._emptyTexture},u.default.RendererGL.prototype.getTexture=function(e){var t=this.textures,r=!0,i=!1,n=void 0;try{for(var o,a=t[Symbol.iterator]();!(r=(o=a.next()).done);r=!0){var s=o.value;if(s.src===e)return s}}catch(e){i=!0,n=e}finally{try{r||null==a.return||a.return()}finally{if(i)throw n}}var l=new u.default.Texture(this,e);return t.push(l),l},u.default.RendererGL.prototype._setStrokeUniforms=function(e){e.bindShader(),e.setUniform("uMaterialColor",this.curStrokeColor),e.setUniform("uStrokeWeight",this.curStrokeWeight)},u.default.RendererGL.prototype._setFillUniforms=function(e){e.bindShader(),e.setUniform("uMaterialColor",this.curFillColor),e.setUniform("isTexture",!!this._tex),this._tex&&e.setUniform("uSampler",this._tex),e.setUniform("uTint",this._tint),e.setUniform("uSpecular",this._useSpecularMaterial),e.setUniform("uEmissive",this._useEmissiveMaterial),e.setUniform("uShininess",this._useShininess),e.setUniform("uUseLighting",this._enableLighting);var t=this.pointLightDiffuseColors.length/3;e.setUniform("uPointLightCount",t),e.setUniform("uPointLightLocation",this.pointLightPositions),e.setUniform("uPointLightDiffuseColors",this.pointLightDiffuseColors),e.setUniform("uPointLightSpecularColors",this.pointLightSpecularColors);var r=this.directionalLightDiffuseColors.length/3;e.setUniform("uDirectionalLightCount",r),e.setUniform("uLightingDirection",this.directionalLightDirections),e.setUniform("uDirectionalDiffuseColors",this.directionalLightDiffuseColors),e.setUniform("uDirectionalSpecularColors",this.directionalLightSpecularColors);var i=this.ambientLightColors.length/3;e.setUniform("uAmbientLightCount",i),e.setUniform("uAmbientColor",this.ambientLightColors);var n=this.spotLightDiffuseColors.length/3;e.setUniform("uSpotLightCount",n),e.setUniform("uSpotLightAngle",this.spotLightAngle),e.setUniform("uSpotLightConc",this.spotLightConc),e.setUniform("uSpotLightDiffuseColors",this.spotLightDiffuseColors),e.setUniform("uSpotLightSpecularColors",this.spotLightSpecularColors),e.setUniform("uSpotLightLocation",this.spotLightPositions),e.setUniform("uSpotLightDirection",this.spotLightDirections),e.setUniform("uConstantAttenuation",this.constantAttenuation),e.setUniform("uLinearAttenuation",this.linearAttenuation),e.setUniform("uQuadraticAttenuation",this.quadraticAttenuation),e.bindTextures()},u.default.RendererGL.prototype._setPointUniforms=function(e){e.bindShader(),e.setUniform("uMaterialColor",this.curStrokeColor),e.setUniform("uPointSize",this.pointSize)},u.default.RendererGL.prototype._bindBuffer=function(e,t,r,i,n){if(t=t||this.GL.ARRAY_BUFFER,this.GL.bindBuffer(t,e),void 0!==r){var o=new(i||Float32Array)(r);this.GL.bufferData(t,o,n||this.GL.STATIC_DRAW)}},u.default.RendererGL.prototype._arraysEqual=function(e,t){var r=e.length;if(r!==t.length)return!1;for(var i=0;i>7,127&f,c>>7,127&c);for(var d=0;d>7,127&p,0,0)}}return{cellImageInfo:l,dimOffset:o,dimImageInfo:n}}return(t=this.glyphInfos[e.index]={glyph:e,uGlyphRect:[i.x1,-i.y1,i.x2,-i.y2],strokeImageInfo:U,strokes:d,colInfo:G(m,this.colDimImageInfos,this.colCellImageInfos),rowInfo:G(p,this.rowDimImageInfos,this.rowCellImageInfos)}).uGridOffset=[t.colInfo.dimOffset,t.rowInfo.dimOffset],t}}var z=Math.sqrt(3);j.default.RendererGL.prototype._renderText=function(e,t,r,i,n){if(this._textFont&&"string"!=typeof this._textFont){if(!(n<=i)&&this._doFill){if(!this._isOpenType())return console.log("WEBGL: only Opentype (.otf) and Truetype (.ttf) fonts are supported"),e;e.push();var o=this._doStroke,a=this.drawMode;this._doStroke=!1,this.drawMode=D.TEXTURE;var s=this._textFont.font,l=this._textFont._fontInfo;l=l||(this._textFont._fontInfo=new A(s));var u=this._textFont._handleAlignment(this,t,r,i),h=this._textSize/s.unitsPerEm;this.translate(u.x,u.y,0),this.scale(h,h,1);var c=this.GL,f=!this._defaultFontShader,d=this._getFontShader();d.init(),d.bindShader(),f&&(d.setUniform("uGridImageSize",[64,64]),d.setUniform("uCellsImageSize",[64,64]),d.setUniform("uStrokeImageSize",[64,64]),d.setUniform("uGridSize",[9,9])),this._applyColorBlend(this.curFillColor);var p=this.retainedMode.geometry.glyph;if(!p){var m=this._textGeom=new j.default.Geometry(1,1,function(){for(var e=0;e<=1;e++)for(var t=0;t<=1;t++)this.vertices.push(new j.default.Vector(t,e,0)),this.uvs.push(t,e)});m.computeFaces().computeNormals(),p=this.createBuffers("glyph",m)}var g=!0,v=!1,y=void 0;try{for(var b,_=this.retainedMode.buffers.text[Symbol.iterator]();!(g=(b=_.next()).done);g=!0){b.value._prepareBuffer(p,d)}}catch(e){v=!0,y=e}finally{try{g||null==_.return||_.return()}finally{if(v)throw y}}this._bindBuffer(p.indexBuffer,c.ELEMENT_ARRAY_BUFFER),d.setUniform("uMaterialColor",this.curFillColor);try{var x=0,w=null,S=s.stringToGlyphs(t),M=!0,E=!1,T=void 0;try{for(var C,P=S[Symbol.iterator]();!(M=(C=P.next()).done);M=!0){var L=C.value;w&&(x+=s.getKerningValue(w,L));var k=l.getGlyphInfo(L);if(k.uGlyphRect){var R=k.rowInfo,O=k.colInfo;d.setUniform("uSamplerStrokes",k.strokeImageInfo.imageData),d.setUniform("uSamplerRowStrokes",R.cellImageInfo.imageData),d.setUniform("uSamplerRows",R.dimImageInfo.imageData),d.setUniform("uSamplerColStrokes",O.cellImageInfo.imageData),d.setUniform("uSamplerCols",O.dimImageInfo.imageData),d.setUniform("uGridOffset",k.uGridOffset),d.setUniform("uGlyphRect",k.uGlyphRect),d.setUniform("uGlyphOffset",x),d.bindTextures(),c.drawElements(c.TRIANGLES,6,this.GL.UNSIGNED_SHORT,0)}x+=L.advanceWidth,w=L}}catch(e){E=!0,T=e}finally{try{M||null==P.return||P.return()}finally{if(E)throw T}}}finally{d.unbindShader(),this._doStroke=o,this.drawMode=a,e.pop()}return e}}else console.log("WEBGL: you must load and set a font before drawing text. See `loadFont` and `textFont` for more details.")}},{"../core/constants":42,"../core/main":49,"./p5.RendererGL.Retained":102,"./p5.Shader":104}],107:[function(e,t,r){t.exports={fes:{autoplay:"The media that tried to play (with '{{src}}') wasn't allowed to by this browser, most likely due to the browser's autoplay policy. Check out {{link}} for more information about why.",fileLoadError:{bytes:"It looks like there was a problem loading your file. {{suggestion}}",font:"It looks like there was a problem loading your font. {{suggestion}}",gif:"There was some trouble loading your GIF. Make sure that your GIF is using 87a or 89a encoding.",image:"It looks like there was a problem loading your image. {{suggestion}}",json:"It looks like there was a problem loading your JSON file. {{suggestion}}",large:"If your large file isn't fetched successfully, we recommend splitting the file into smaller segments and fetching those.",strings:"It looks like there was a problem loading your text file. {{suggestion}}",suggestion:"Try checking if the file path ({{filePath}}) is correct, hosting the file online, or running a local server. (More info at {{link}})",table:"It looks like there was a problem loading your table file. {{suggestion}}",xml:"It looks like there was a problem loading your XML file. {{suggestion}}"},misusedTopLevel:"Did you just try to use p5.js's {{symbolName}} {{symbolType}}? If so, you may want to move it into your sketch's setup() function.\n\nFor more details, see: {{link}}",pre:"🌸 p5.js says: {{message}}",welcome:"Welcome! This is your friendly debugger. To turn me off, switch to using p5.min.js."}}},{}],108:[function(e,t,r){t.exports={fes:{autoplay:"Su browser impidío un medio tocar (de '{{src}}'), posiblemente porque las reglas de autoplay. Para aprender más, visite {{link}}.",fileLoadError:{bytes:"",font:"",gif:"",image:"",json:"",large:"",strings:"",suggestion:"",table:"",xml:""},misusedTopLevel:"",pre:"🌸 p5.js dice: {{message}}",welcome:""}}},{}],109:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i=o(e("./en/translation")),n=o(e("./es/translation"));function o(e){return e&&e.__esModule?e:{default:e}}var a={en:{translation:i.default},es:{translation:n.default}};r.default=a},{"./en/translation":107,"./es/translation":108}]},{},[37])(37)}); ================================================ FILE: docs/examples/pyodide/sketch_004/target/target_sketch.js ================================================ const wrapperContent = ` class PythonFunctions: pass setattr(PythonFunctions, 'map', map) setattr(PythonFunctions, 'filter', filter) setattr(PythonFunctions, 'set', set) _P5_INSTANCE = None _CTX_MIDDLE = None _DEFAULT_FILL = None _DEFAULT_LEADMULT = None _DEFAULT_STROKE = None _DEFAULT_TEXT_FILL = None ADD = None ALT = None ARROW = None AUDIO = None AUTO = None AXES = None BACKSPACE = None BASELINE = None BEVEL = None BEZIER = None BLEND = None BLUR = None BOLD = None BOLDITALIC = None BOTTOM = None BURN = None CENTER = None CHORD = None CLAMP = None CLOSE = None CONTROL = None CORNER = None CORNERS = None CROSS = None CURVE = None DARKEST = None DEG_TO_RAD = None DEGREES = None DELETE = None DIFFERENCE = None DILATE = None DODGE = None DOWN_ARROW = None ENTER = None ERODE = None ESCAPE = None EXCLUSION = None FILL = None GRAY = None GRID = None HALF_PI = None HAND = None HARD_LIGHT = None HSB = None HSL = None IMAGE = None IMMEDIATE = None INVERT = None ITALIC = None LANDSCAPE = None LEFT = None LEFT_ARROW = None LIGHTEST = None LINE_LOOP = None LINE_STRIP = None LINEAR = None LINES = None MIRROR = None MITER = None MOVE = None MULTIPLY = None NEAREST = None NORMAL = None OPAQUE = None OPEN = None OPTION = None OVERLAY = None PI = None PIE = None POINTS = None PORTRAIT = None POSTERIZE = None PROJECT = None QUAD_STRIP = None QUADRATIC = None QUADS = None QUARTER_PI = None RAD_TO_DEG = None RADIANS = None RADIUS = None REPEAT = None REPLACE = None RETURN = None RGB = None RIGHT = None RIGHT_ARROW = None ROUND = None SCREEN = None SHIFT = None SOFT_LIGHT = None SQUARE = None STROKE = None SUBTRACT = None TAB = None TAU = None TEXT = None TEXTURE = None THRESHOLD = None TOP = None TRIANGLE_FAN = None TRIANGLE_STRIP = None TRIANGLES = None TWO_PI = None UP_ARROW = None VIDEO = None WAIT = None WEBGL = None P2D = None PI = None frameCount = None focused = None displayWidth = None displayHeight = None windowWidth = None windowHeight = None width = None height = None deviceOrientation = None accelerationX = None accelerationY = None accelerationZ = None pAccelerationX = None pAccelerationY = None pAccelerationZ = None rotationX = None rotationY = None rotationZ = None pRotationX = None pRotationY = None pRotationZ = None turnAxis = None keyIsPressed = None key = None keyCode = None mouseX = None mouseY = None pmouseX = None pmouseY = None winMouseX = None winMouseY = None pwinMouseX = None pwinMouseY = None mouseButton = None mouseIsPressed = None touches = None pixels = None def alpha(*args): return _P5_INSTANCE.alpha(*args) def blue(*args): return _P5_INSTANCE.blue(*args) def brightness(*args): return _P5_INSTANCE.brightness(*args) def color(*args): return _P5_INSTANCE.color(*args) def green(*args): return _P5_INSTANCE.green(*args) def hue(*args): return _P5_INSTANCE.hue(*args) def lerpColor(*args): return _P5_INSTANCE.lerpColor(*args) def lightness(*args): return _P5_INSTANCE.lightness(*args) def red(*args): return _P5_INSTANCE.red(*args) def saturation(*args): return _P5_INSTANCE.saturation(*args) def background(*args): return _P5_INSTANCE.background(*args) def clear(*args): p5_clear = _P5_INSTANCE.clear(*args) return p5_clear def erase(*args): return _P5_INSTANCE.erase(*args) def noErase(*args): return _P5_INSTANCE.noErase(*args) def colorMode(*args): return _P5_INSTANCE.colorMode(*args) def fill(*args): return _P5_INSTANCE.fill(*args) def noFill(*args): return _P5_INSTANCE.noFill(*args) def noStroke(*args): return _P5_INSTANCE.noStroke(*args) def stroke(*args): return _P5_INSTANCE.stroke(*args) def arc(*args): return _P5_INSTANCE.arc(*args) def ellipse(*args): return _P5_INSTANCE.ellipse(*args) def circle(*args): return _P5_INSTANCE.circle(*args) def line(*args): return _P5_INSTANCE.line(*args) def point(*args): return _P5_INSTANCE.point(*args) def quad(*args): return _P5_INSTANCE.quad(*args) def rect(*args): return _P5_INSTANCE.rect(*args) def square(*args): return _P5_INSTANCE.square(*args) def triangle(*args): return _P5_INSTANCE.triangle(*args) def plane(*args): return _P5_INSTANCE.plane(*args) def box(*args): return _P5_INSTANCE.box(*args) def sphere(*args): return _P5_INSTANCE.sphere(*args) def cylinder(*args): return _P5_INSTANCE.cylinder(*args) def cone(*args): return _P5_INSTANCE.cone(*args) def ellipsoid(*args): return _P5_INSTANCE.ellipsoid(*args) def torus(*args): return _P5_INSTANCE.torus(*args) def loadModel(*args): return _P5_INSTANCE.loadModel(*args) def model(*args): return _P5_INSTANCE.model(*args) def ellipseMode(*args): return _P5_INSTANCE.ellipseMode(*args) def noSmooth(*args): return _P5_INSTANCE.noSmooth(*args) def rectMode(*args): return _P5_INSTANCE.rectMode(*args) def smooth(*args): return _P5_INSTANCE.smooth(*args) def strokeCap(*args): return _P5_INSTANCE.strokeCap(*args) def strokeJoin(*args): return _P5_INSTANCE.strokeJoin(*args) def strokeWeight(*args): return _P5_INSTANCE.strokeWeight(*args) def bezier(*args): return _P5_INSTANCE.bezier(*args) def bezierDetail(*args): return _P5_INSTANCE.bezierDetail(*args) def bezierPoint(*args): return _P5_INSTANCE.bezierPoint(*args) def bezierTangent(*args): return _P5_INSTANCE.bezierTangent(*args) def curve(*args): return _P5_INSTANCE.curve(*args) def curveDetail(*args): return _P5_INSTANCE.curveDetail(*args) def curveTightness(*args): return _P5_INSTANCE.curveTightness(*args) def curvePoint(*args): return _P5_INSTANCE.curvePoint(*args) def curveTangent(*args): return _P5_INSTANCE.curveTangent(*args) def beginContour(*args): return _P5_INSTANCE.beginContour(*args) def beginShape(*args): return _P5_INSTANCE.beginShape(*args) def bezierVertex(*args): return _P5_INSTANCE.bezierVertex(*args) def curveVertex(*args): return _P5_INSTANCE.curveVertex(*args) def endContour(*args): return _P5_INSTANCE.endContour(*args) def endShape(*args): return _P5_INSTANCE.endShape(*args) def quadraticVertex(*args): return _P5_INSTANCE.quadraticVertex(*args) def vertex(*args): return _P5_INSTANCE.vertex(*args) def cursor(*args): return _P5_INSTANCE.cursor(*args) def frameRate(*args): return _P5_INSTANCE.frameRate(*args) def noCursor(*args): return _P5_INSTANCE.noCursor(*args) def fullscreen(*args): return _P5_INSTANCE.fullscreen(*args) def pixelDensity(*args): return _P5_INSTANCE.pixelDensity(*args) def displayDensity(*args): return _P5_INSTANCE.displayDensity(*args) def getURL(*args): return _P5_INSTANCE.getURL(*args) def getURLPath(*args): return _P5_INSTANCE.getURLPath(*args) def getURLParams(*args): return _P5_INSTANCE.getURLParams(*args) def remove(*args): return _P5_INSTANCE.remove(*args) def noLoop(*args): return _P5_INSTANCE.noLoop(*args) def loop(*args): return _P5_INSTANCE.loop(*args) def push(*args): return _P5_INSTANCE.push(*args) def redraw(*args): return _P5_INSTANCE.redraw(*args) def resizeCanvas(*args): return _P5_INSTANCE.resizeCanvas(*args) def noCanvas(*args): return _P5_INSTANCE.noCanvas(*args) def createGraphics(*args): return _P5_INSTANCE.createGraphics(*args) def blendMode(*args): return _P5_INSTANCE.blendMode(*args) def setAttributes(*args): return _P5_INSTANCE.setAttributes(*args) def applyMatrix(*args): return _P5_INSTANCE.applyMatrix(*args) def resetMatrix(*args): return _P5_INSTANCE.resetMatrix(*args) def rotate(*args): return _P5_INSTANCE.rotate(*args) def rotateX(*args): return _P5_INSTANCE.rotateX(*args) def rotateY(*args): return _P5_INSTANCE.rotateY(*args) def rotateZ(*args): return _P5_INSTANCE.rotateZ(*args) def scale(*args): return _P5_INSTANCE.scale(*args) def shearX(*args): return _P5_INSTANCE.shearX(*args) def shearY(*args): return _P5_INSTANCE.shearY(*args) def translate(*args): return _P5_INSTANCE.translate(*args) def createStringDict(*args): return _P5_INSTANCE.createStringDict(*args) def createNumberDict(*args): return _P5_INSTANCE.createNumberDict(*args) def append(*args): return _P5_INSTANCE.append(*args) def arrayCopy(*args): return _P5_INSTANCE.arrayCopy(*args) def concat(*args): return _P5_INSTANCE.concat(*args) def reverse(*args): return _P5_INSTANCE.reverse(*args) def shorten(*args): return _P5_INSTANCE.shorten(*args) def shuffle(*args): return _P5_INSTANCE.shuffle(*args) def sort(*args): return _P5_INSTANCE.sort(*args) def splice(*args): return _P5_INSTANCE.splice(*args) def subset(*args): return _P5_INSTANCE.subset(*args) def float(*args): return _P5_INSTANCE.float(*args) def int(*args): return _P5_INSTANCE.int(*args) def str(*args): return _P5_INSTANCE.str(*args) def boolean(*args): return _P5_INSTANCE.boolean(*args) def byte(*args): return _P5_INSTANCE.byte(*args) def char(*args): return _P5_INSTANCE.char(*args) def unchar(*args): return _P5_INSTANCE.unchar(*args) def hex(*args): return _P5_INSTANCE.hex(*args) def unhex(*args): return _P5_INSTANCE.unhex(*args) def join(*args): return _P5_INSTANCE.join(*args) def match(*args): return _P5_INSTANCE.match(*args) def matchAll(*args): return _P5_INSTANCE.matchAll(*args) def nf(*args): return _P5_INSTANCE.nf(*args) def nfc(*args): return _P5_INSTANCE.nfc(*args) def nfp(*args): return _P5_INSTANCE.nfp(*args) def nfs(*args): return _P5_INSTANCE.nfs(*args) def split(*args): return _P5_INSTANCE.split(*args) def splitTokens(*args): return _P5_INSTANCE.splitTokens(*args) def trim(*args): return _P5_INSTANCE.trim(*args) def setMoveThreshold(*args): return _P5_INSTANCE.setMoveThreshold(*args) def setShakeThreshold(*args): return _P5_INSTANCE.setShakeThreshold(*args) def keyIsDown(*args): return _P5_INSTANCE.keyIsDown(*args) def createImage(*args): return _P5_INSTANCE.createImage(*args) def saveCanvas(*args): return _P5_INSTANCE.saveCanvas(*args) def saveFrames(*args): return _P5_INSTANCE.saveFrames(*args) def loadImage(*args): return _P5_INSTANCE.loadImage(*args) def image(*args): return _P5_INSTANCE.image(*args) def tint(*args): return _P5_INSTANCE.tint(*args) def noTint(*args): return _P5_INSTANCE.noTint(*args) def imageMode(*args): return _P5_INSTANCE.imageMode(*args) def blend(*args): return _P5_INSTANCE.blend(*args) def copy(*args): return _P5_INSTANCE.copy(*args) def filter(*args): if len(args) > 1 and (args[0] is None or callable(args[0])): return PythonFunctions.filter(*args) else: return _P5_INSTANCE.filter(*args) def get(*args): return _P5_INSTANCE.get(*args) def loadPixels(*args): return _P5_INSTANCE.loadPixels(*args) def set(*args): if len(args) <= 1: return PythonFunctions.set(*args) else: return _P5_INSTANCE.set(*args) def updatePixels(*args): return _P5_INSTANCE.updatePixels(*args) def loadJSON(*args): return _P5_INSTANCE.loadJSON(*args) def loadStrings(*args): return _P5_INSTANCE.loadStrings(*args) def loadTable(*args): return _P5_INSTANCE.loadTable(*args) def loadXML(*args): return _P5_INSTANCE.loadXML(*args) def loadBytes(*args): return _P5_INSTANCE.loadBytes(*args) def httpGet(*args): return _P5_INSTANCE.httpGet(*args) def httpPost(*args): return _P5_INSTANCE.httpPost(*args) def httpDo(*args): return _P5_INSTANCE.httpDo(*args) def createWriter(*args): return _P5_INSTANCE.createWriter(*args) def save(*args): return _P5_INSTANCE.save(*args) def saveJSON(*args): return _P5_INSTANCE.saveJSON(*args) def saveStrings(*args): return _P5_INSTANCE.saveStrings(*args) def saveTable(*args): return _P5_INSTANCE.saveTable(*args) def day(*args): return _P5_INSTANCE.day(*args) def hour(*args): return _P5_INSTANCE.hour(*args) def minute(*args): return _P5_INSTANCE.minute(*args) def millis(*args): return _P5_INSTANCE.millis(*args) def month(*args): return _P5_INSTANCE.month(*args) def second(*args): return _P5_INSTANCE.second(*args) def year(*args): return _P5_INSTANCE.year(*args) def createVector(*args): return _P5_INSTANCE.createVector(*args) def abs(*args): return _P5_INSTANCE.abs(*args) def ceil(*args): return _P5_INSTANCE.ceil(*args) def constrain(*args): return _P5_INSTANCE.constrain(*args) def dist(*args): return _P5_INSTANCE.dist(*args) def exp(*args): return _P5_INSTANCE.exp(*args) def floor(*args): return _P5_INSTANCE.floor(*args) def lerp(*args): return _P5_INSTANCE.lerp(*args) def log(*args): return _P5_INSTANCE.log(*args) def mag(*args): return _P5_INSTANCE.mag(*args) def map(*args): if len(args) > 1 and callable(args[0]): return PythonFunctions.map(*args) else: return _P5_INSTANCE.map(*args) def max(*args): return _P5_INSTANCE.max(*args) def min(*args): return _P5_INSTANCE.min(*args) def norm(*args): return _P5_INSTANCE.norm(*args) def pow(*args): return _P5_INSTANCE.pow(*args) def round(*args): return _P5_INSTANCE.round(*args) def sq(*args): return _P5_INSTANCE.sq(*args) def sqrt(*args): return _P5_INSTANCE.sqrt(*args) def noise(*args): return _P5_INSTANCE.noise(*args) def noiseDetail(*args): return _P5_INSTANCE.noiseDetail(*args) def noiseSeed(*args): return _P5_INSTANCE.noiseSeed(*args) def randomSeed(*args): return _P5_INSTANCE.randomSeed(*args) def random(*args): return _P5_INSTANCE.random(*args) def randomGaussian(*args): return _P5_INSTANCE.randomGaussian(*args) def acos(*args): return _P5_INSTANCE.acos(*args) def asin(*args): return _P5_INSTANCE.asin(*args) def atan(*args): return _P5_INSTANCE.atan(*args) def atan2(*args): return _P5_INSTANCE.atan2(*args) def cos(*args): return _P5_INSTANCE.cos(*args) def sin(*args): return _P5_INSTANCE.sin(*args) def tan(*args): return _P5_INSTANCE.tan(*args) def degrees(*args): return _P5_INSTANCE.degrees(*args) def radians(*args): return _P5_INSTANCE.radians(*args) def angleMode(*args): return _P5_INSTANCE.angleMode(*args) def textAlign(*args): return _P5_INSTANCE.textAlign(*args) def textLeading(*args): return _P5_INSTANCE.textLeading(*args) def textSize(*args): return _P5_INSTANCE.textSize(*args) def textStyle(*args): return _P5_INSTANCE.textStyle(*args) def textWidth(*args): return _P5_INSTANCE.textWidth(*args) def textAscent(*args): return _P5_INSTANCE.textAscent(*args) def textDescent(*args): return _P5_INSTANCE.textDescent(*args) def loadFont(*args): return _P5_INSTANCE.loadFont(*args) def text(*args): return _P5_INSTANCE.text(*args) def textFont(*args): return _P5_INSTANCE.textFont(*args) def orbitControl(*args): return _P5_INSTANCE.orbitControl(*args) def debugMode(*args): return _P5_INSTANCE.debugMode(*args) def noDebugMode(*args): return _P5_INSTANCE.noDebugMode(*args) def ambientLight(*args): return _P5_INSTANCE.ambientLight(*args) def directionalLight(*args): return _P5_INSTANCE.directionalLight(*args) def pointLight(*args): return _P5_INSTANCE.pointLight(*args) def lights(*args): return _P5_INSTANCE.lights(*args) def loadShader(*args): return _P5_INSTANCE.loadShader(*args) def createShader(*args): return _P5_INSTANCE.createShader(*args) def shader(*args): return _P5_INSTANCE.shader(*args) def resetShader(*args): return _P5_INSTANCE.resetShader(*args) def normalMaterial(*args): return _P5_INSTANCE.normalMaterial(*args) def texture(*args): return _P5_INSTANCE.texture(*args) def textureMode(*args): return _P5_INSTANCE.textureMode(*args) def textureWrap(*args): return _P5_INSTANCE.textureWrap(*args) def ambientMaterial(*args): return _P5_INSTANCE.ambientMaterial(*args) def specularMaterial(*args): return _P5_INSTANCE.specularMaterial(*args) def shininess(*args): return _P5_INSTANCE.shininess(*args) def camera(*args): return _P5_INSTANCE.camera(*args) def perspective(*args): return _P5_INSTANCE.perspective(*args) def ortho(*args): return _P5_INSTANCE.ortho(*args) def createCamera(*args): return _P5_INSTANCE.createCamera(*args) def setCamera(*args): return _P5_INSTANCE.setCamera(*args) def select(*args): return _P5_INSTANCE.select(*args) def selectAll(*args): return _P5_INSTANCE.selectAll(*args) def removeElements(*args): return _P5_INSTANCE.removeElements(*args) def changed(*args): return _P5_INSTANCE.changed(*args) def input(*args): return _P5_INSTANCE.input(*args) def createDiv(*args): return _P5_INSTANCE.createDiv(*args) def createP(*args): return _P5_INSTANCE.createP(*args) def createSpan(*args): return _P5_INSTANCE.createSpan(*args) def createImg(*args): return _P5_INSTANCE.createImg(*args) def createA(*args): return _P5_INSTANCE.createA(*args) def createSlider(*args): return _P5_INSTANCE.createSlider(*args) def createButton(*args): return _P5_INSTANCE.createButton(*args) def createCheckbox(*args): return _P5_INSTANCE.createCheckbox(*args) def createSelect(*args): return _P5_INSTANCE.createSelect(*args) def createRadio(*args): return _P5_INSTANCE.createRadio(*args) def createColorPicker(*args): return _P5_INSTANCE.createColorPicker(*args) def createInput(*args): return _P5_INSTANCE.createInput(*args) def createFileInput(*args): return _P5_INSTANCE.createFileInput(*args) def createVideo(*args): return _P5_INSTANCE.createVideo(*args) def createAudio(*args): return _P5_INSTANCE.createAudio(*args) def createCapture(*args): return _P5_INSTANCE.createCapture(*args) def createElement(*args): return _P5_INSTANCE.createElement(*args) def createCanvas(*args): canvas = _P5_INSTANCE.createCanvas(*args) global width, height width = _P5_INSTANCE.width height = _P5_INSTANCE.height return canvas def __deviceMoved(e): try: _bind_event_function(deviceMoved, e) except NameError: pass def __deviceTurned(e): try: _bind_event_function(deviceTurned, e) except NameError: pass def __deviceShaken(e): try: _bind_event_function(deviceShaken, e) except NameError: pass def __touchEnded(e): try: _bind_event_function(deviceShaken, e) except NameError: pass def __touchStarted(e): try: _bind_event_function(touchStarted, e) except NameError: pass def __windowResized(e): try: _bind_event_function(windowResized, e) except NameError: pass def __touchMoved(e): try: _bind_event_function(touchMoved, e) except NameError: pass def __mouseMoved(e): try: _bind_event_function(mouseMoved, e) except NameError: pass def __mouseDragged(e): try: _bind_event_function(mouseDragged, e) except NameError: pass def __mousePressed(e): try: _bind_event_function(mousePressed, e) except NameError: pass def __mouseReleased(e): try: _bind_event_function(mouseReleased, e) except NameError: pass def __mouseClicked(e): try: _bind_event_function(mouseClicked, e) except NameError: pass def __doubleClicked(e): try: _bind_event_function(doubleClicked, e) except NameError: pass def __mouseWheel(e): try: _bind_event_function(mouseWheel, e) except NameError: pass def __keyPressed(e): try: _bind_event_function(keyPressed, e) except NameError: pass def __keyReleased(e): try: _bind_event_function(keyReleased, e) except NameError: pass def __keyTyped(e): try: _bind_event_function(keyTyped, e) except NameError: pass def __keyIsDown(e): try: _bind_event_function(keyIsDown, e) except NameError: pass def pop(*args): p5_pop = _P5_INSTANCE.pop(*args) return p5_pop # Processing Python or Java mode compatibility aliases size = createCanvas popMatrix = pop popStyle = pop pushMatrix = push pushStyle = push # PVector is a wrapper/helper class for p5.Vector objets # providing names similar to Processing Python or Java modes # but mostly keeping p5js functionality from numbers import Number class PVector: def __init__(self, x=0, y=0, z=0): self.__vector = createVector(x, y, z) self.add = self.__instance_add__ self.sub = self.__instance_sub__ self.mult = self.__instance_mult__ self.div = self.__instance_div__ self.cross = self.__instance_cross__ self.dist = self.__instance_dist__ self.dot = self.__instance_dot__ self.lerp = self.__instance_lerp__ @property def x(self): return self.__vector.x @x.setter def x(self, x): self.__vector.x = x @property def y(self): return self.__vector.y @y.setter def y(self, y): self.__vector.y = y @property def z(self): return self.__vector.z @z.setter def z(self, z): self.__vector.z = z def mag(self): return self.__vector.mag() def magSq(self): return self.__vector.magSq() def setMag(self, mag): self.__vector.setMag(mag) return self def normalize(self): self.__vector.normalize() return self def limit(self, max): self.__vector.limit(max) return self def heading(self): return self.__vector.heading() def rotate(self, angle): self.__vector.rotate(angle) return self def __instance_add__(self, *args): if len(args) == 1: return PVector.add(self, args[0], self) else: return PVector.add(self, PVector(*args), self) def __instance_sub__(self, *args): if len(args) == 1: return PVector.sub(self, args[0], self) else: return PVector.sub(self, PVector(*args), self) def __instance_mult__(self, o): return PVector.mult(self, o, self) def __instance_div__(self, f): return PVector.div(self, f, self) def __instance_cross__(self, o): return PVector.cross(self, o, self) def __instance_dist__(self, o): return PVector.dist(self, o) def __instance_dot__(self, *args): if len(args) == 1: v = args[0] else: v = args return self.x * v[0] + self.y * v[1] + self.z * v[2] def __instance_lerp__(self, *args): if len(args) == 2: return PVector.lerp(self, args[0], args[1], self) else: vx, vy, vz, f = args return PVector.lerp(self, PVector(vx, vy, vz), f, self) def get(self): return PVector(self.x, self.y, self.z) def copy(self): return PVector(self.x, self.y, self.z) def __getitem__(self, k): return getattr(self, ('x', 'y', 'z')[k]) def __setitem__(self, k, v): setattr(self, ('x', 'y', 'z')[k], v) def __copy__(self): return PVector(self.x, self.y, self.z) def __deepcopy__(self, memo): return PVector(self.x, self.y, self.z) def __repr__(self): # PROVISÓRIO return f'PVector({self.x}, {self.y}, {self.z})' def set(self, *args): """ Sets the x, y, and z component of the vector using two or three separate variables, the data from a p5.Vector, or the values from a float array. """ self.__vector.set(*args) @classmethod def add(cls, a, b, dest=None): if dest is None: return PVector(a.x + b[0], a.y + b[1], a.z + b[2]) dest.__vector.set(a.x + b[0], a.y + b[1], a.z + b[2]) return dest @classmethod def sub(cls, a, b, dest=None): if dest is None: return PVector(a.x - b[0], a.y - b[1], a.z - b[2]) dest.__vector.set(a.x - b[0], a.y - b[1], a.z - b[2]) return dest @classmethod def mult(cls, a, b, dest=None): if dest is None: return PVector(a.x * b, a.y * b, a.z * b) dest.__vector.set(a.x * b, a.y * b, a.z * b) return dest @classmethod def div(cls, a, b, dest=None): if dest is None: return PVector(a.x / b, a.y / b, a.z / b) dest.__vector.set(a.x / b, a.y / b, a.z / b) return dest @classmethod def dist(cls, a, b): return a.__vector.dist(b.__vector) @classmethod def dot(cls, a, b): return a.__vector.dot(b.__vector) def __add__(a, b): return PVector.add(a, b, None) def __sub__(a, b): return PVector.sub(a, b, None) def __isub__(a, b): a.sub(b) return a def __iadd__(a, b): a.add(b) return a def __mul__(a, b): if not isinstance(b, Number): raise TypeError( "The * operator can only be used to multiply a PVector by a number") return PVector.mult(a, float(b), None) def __rmul__(a, b): if not isinstance(b, Number): raise TypeError( "The * operator can only be used to multiply a PVector by a number") return PVector.mult(a, float(b), None) def __imul__(a, b): if not isinstance(b, Number): raise TypeError( "The *= operator can only be used to multiply a PVector by a number") a.__vector.mult(float(b)) return a def __truediv__(a, b): if not isinstance(b, Number): raise TypeError( "The * operator can only be used to multiply a PVector by a number") return PVector(a.x / float(b), a.y / float(b), a.z / float(b)) def __itruediv__(a, b): if not isinstance(b, Number): raise TypeError( "The /= operator can only be used to multiply a PVector by a number") a.__vector.set(a.x / float(b), a.y / float(b), a.z / float(b)) return a def __eq__(a, b): return a.x == b[0] and a.y == b[1] and a.z == b[2] def __lt__(a, b): return a.magSq() < b.magSq() def __le__(a, b): return a.magSq() <= b.magSq() def __gt__(a, b): return a.magSq() > b.magSq() def __ge__(a, b): return a.magSq() >= b.magSq() # Problematic class methods, we would rather use p5.Vector when possible... @classmethod def lerp(cls, a, b, f, dest=None): v = createVector(a.x, a.y, a.z) v.lerp(b.__vector, f) if dest is None: return PVector(v.x, v.y, v.z) dest.set(v.x, v.y, v.z) return dest @classmethod def cross(cls, a, b, dest=None): x = a.y * b[2] - b[1] * a.z y = a.z * b[0] - b[2] * a.x z = a.x * b[1] - b[0] * a.y if dest is None: return PVector(x, y, z) dest.set(x, y, z) return dest @classmethod def fromAngle(cls, angle, length=1): # https://github.com/processing/p5.js/blob/3f0b2f0fe575dc81c724474154f5b23a517b7233/src/math/p5.Vector.js return PVector(length * cos(angle), length * sin(angle), 0) @classmethod def fromAngles(theta, phi, length=1): # https://github.com/processing/p5.js/blob/3f0b2f0fe575dc81c724474154f5b23a517b7233/src/math/p5.Vector.js cosPhi = cos(phi) sinPhi = sin(phi) cosTheta = cos(theta) sinTheta = sin(theta) return PVector(length * sinTheta * sinPhi, -length * cosTheta, length * sinTheta * cosPhi) @classmethod def random2D(cls): return PVector.fromAngle(random(TWO_PI)) @classmethod def random3D(cls, dest=None): angle = random(TWO_PI) vz = random(2) - 1 mult = sqrt(1 - vz * vz) vx = mult * cos(angle) vy = mult * sin(angle) if dest is None: return PVector(vx, vy, vz) dest.set(vx, vy, vz) return dest @classmethod def angleBetween(cls, a, b): return acos(a.dot(b) / sqrt(a.magSq() * b.magSq())) # Other harmless p5js methods def equals(self, v): return self == v def heading2D(self): return self.__vector.heading() def reflect(self, *args): # Reflect the incoming vector about a normal to a line in 2D, or about # a normal to a plane in 3D This method acts on the vector directly r = self.__vector.reflect(*args) return r def array(self): # Return a representation of this vector as a float array. This is only # for temporary use. If used in any w fashion, the contents should be # copied by using the p5.Vector.copy() method to copy into your own # array. return self.__vector.array() def toString(self): # Returns a string representation of a vector v by calling String(v) or v.toString(). # return self.__vector.toString() would be something like "p5.vector # Object […, …, …]" return str(self) def rem(self, *args): # Gives remainder of a vector when it is divided by anw vector. See # examples for more context. self.__vector.rem(*args) return self def pre_draw(p5_instance, draw_func, *args, **kwargs): """ We need to run this before the actual draw to insert and update p5 env variables """ global _CTX_MIDDLE, _DEFAULT_FILL, _DEFAULT_LEADMULT, _DEFAULT_STROKE, _DEFAULT_TEXT_FILL global ADD, ALT, ARROW, AUTO, AUDIO, AXES, BACKSPACE, BASELINE, BEVEL, BEZIER, BLEND, BLUR, BOLD, BOLDITALIC global BOTTOM, BURN, CENTER, CHORD, CLAMP, CLOSE, CONTROL, CORNER, CORNERS, CROSS, CURVE, DARKEST global DEG_TO_RAD, DEGREES, DELETE, DIFFERENCE, DILATE, DODGE, DOWN_ARROW, ENTER, ERODE, ESCAPE, EXCLUSION global FILL, GRAY, GRID, HALF_PI, HAND, HARD_LIGHT, HSB, HSL, IMAGE, IMMEDIATE, INVERT, ITALIC, LANDSCAPE global LEFT, LEFT_ARROW, LIGHTEST, LINE_LOOP, LINE_STRIP, LINEAR, LINES, MIRROR, MITER, MOVE, MULTIPLY, NEAREST global NORMAL, OPAQUE, OPEN, OPTION, OVERLAY, P2D, P3D, PI, PIE, POINTS, PORTRAIT, POSTERIZE, PROJECT, QUAD_STRIP global QUADRATIC, QUADS, QUARTER_PI, RAD_TO_DEG, RADIANS, RADIUS, REPEAT, REPLACE, RETURN, RGB, RIGHT, RIGHT_ARROW global ROUND, SCREEN, SHIFT, SOFT_LIGHT, SQUARE, STROKE, SUBTRACT, TAB, TAU, TEXT, TEXTURE, THRESHOLD, TOP global TRIANGLE_FAN, TRIANGLE_STRIP, TRIANGLES, TWO_PI, UP_ARROW, VIDEO, WAIT, WEBGL global frameCount, focused, displayWidth, displayHeight, windowWidth, windowHeight, width, height global deviceOrientation, accelerationX, accelerationY, accelerationZ global pAccelerationX, pAccelerationY, pAccelerationZ, rotationX, rotationY, rotationZ global pRotationX, pRotationY, pRotationZ, turnAxis, keyIsPressed, key, keyCode, mouseX, mouseY, pmouseX, pmouseY global winMouseX, winMouseY, pwinMouseX, pwinMouseY, mouseButton, mouseIsPressed, touches, pixels _CTX_MIDDLE = p5_instance._CTX_MIDDLE _DEFAULT_FILL = p5_instance._DEFAULT_FILL _DEFAULT_LEADMULT = p5_instance._DEFAULT_LEADMULT _DEFAULT_STROKE = p5_instance._DEFAULT_STROKE _DEFAULT_TEXT_FILL = p5_instance._DEFAULT_TEXT_FILL ADD = p5_instance.ADD ALT = p5_instance.ALT ARROW = p5_instance.ARROW AUDIO = p5_instance.AUDIO AUTO = p5_instance.AUTO AXES = p5_instance.AXES BACKSPACE = p5_instance.BACKSPACE BASELINE = p5_instance.BASELINE BEVEL = p5_instance.BEVEL BEZIER = p5_instance.BEZIER BLEND = p5_instance.BLEND BLUR = p5_instance.BLUR BOLD = p5_instance.BOLD BOLDITALIC = p5_instance.BOLDITALIC BOTTOM = p5_instance.BOTTOM BURN = p5_instance.BURN CENTER = p5_instance.CENTER CHORD = p5_instance.CHORD CLAMP = p5_instance.CLAMP CLOSE = p5_instance.CLOSE CONTROL = p5_instance.CONTROL CORNER = p5_instance.CORNER CORNERS = p5_instance.CORNERS CROSS = p5_instance.CROSS CURVE = p5_instance.CURVE DARKEST = p5_instance.DARKEST DEG_TO_RAD = p5_instance.DEG_TO_RAD DEGREES = p5_instance.DEGREES DELETE = p5_instance.DELETE DIFFERENCE = p5_instance.DIFFERENCE DILATE = p5_instance.DILATE DODGE = p5_instance.DODGE DOWN_ARROW = p5_instance.DOWN_ARROW ENTER = p5_instance.ENTER ERODE = p5_instance.ERODE ESCAPE = p5_instance.ESCAPE EXCLUSION = p5_instance.EXCLUSION FILL = p5_instance.FILL GRAY = p5_instance.GRAY GRID = p5_instance.GRID HALF_PI = p5_instance.HALF_PI HAND = p5_instance.HAND HARD_LIGHT = p5_instance.HARD_LIGHT HSB = p5_instance.HSB HSL = p5_instance.HSL IMAGE = p5_instance.IMAGE IMMEDIATE = p5_instance.IMMEDIATE INVERT = p5_instance.INVERT ITALIC = p5_instance.ITALIC LANDSCAPE = p5_instance.LANDSCAPE LEFT = p5_instance.LEFT LEFT_ARROW = p5_instance.LEFT_ARROW LIGHTEST = p5_instance.LIGHTEST LINE_LOOP = p5_instance.LINE_LOOP LINE_STRIP = p5_instance.LINE_STRIP LINEAR = p5_instance.LINEAR LINES = p5_instance.LINES MIRROR = p5_instance.MIRROR MITER = p5_instance.MITER MOVE = p5_instance.MOVE MULTIPLY = p5_instance.MULTIPLY NEAREST = p5_instance.NEAREST NORMAL = p5_instance.NORMAL OPAQUE = p5_instance.OPAQUE OPEN = p5_instance.OPEN OPTION = p5_instance.OPTION OVERLAY = p5_instance.OVERLAY P2D = p5_instance.P2D P3D = p5_instance.WEBGL PI = p5_instance.PI PIE = p5_instance.PIE POINTS = p5_instance.POINTS PORTRAIT = p5_instance.PORTRAIT POSTERIZE = p5_instance.POSTERIZE PROJECT = p5_instance.PROJECT QUAD_STRIP = p5_instance.QUAD_STRIP QUADRATIC = p5_instance.QUADRATIC QUADS = p5_instance.QUADS QUARTER_PI = p5_instance.QUARTER_PI RAD_TO_DEG = p5_instance.RAD_TO_DEG RADIANS = p5_instance.RADIANS RADIUS = p5_instance.RADIUS REPEAT = p5_instance.REPEAT REPLACE = p5_instance.REPLACE RETURN = p5_instance.RETURN RGB = p5_instance.RGB RIGHT = p5_instance.RIGHT RIGHT_ARROW = p5_instance.RIGHT_ARROW ROUND = p5_instance.ROUND SCREEN = p5_instance.SCREEN SHIFT = p5_instance.SHIFT SOFT_LIGHT = p5_instance.SOFT_LIGHT SQUARE = p5_instance.SQUARE STROKE = p5_instance.STROKE SUBTRACT = p5_instance.SUBTRACT TAB = p5_instance.TAB TAU = p5_instance.TAU TEXT = p5_instance.TEXT TEXTURE = p5_instance.TEXTURE THRESHOLD = p5_instance.THRESHOLD TOP = p5_instance.TOP TRIANGLE_FAN = p5_instance.TRIANGLE_FAN TRIANGLE_STRIP = p5_instance.TRIANGLE_STRIP TRIANGLES = p5_instance.TRIANGLES TWO_PI = p5_instance.TWO_PI UP_ARROW = p5_instance.UP_ARROW VIDEO = p5_instance.VIDEO WAIT = p5_instance.WAIT WEBGL = p5_instance.WEBGL frameCount = p5_instance.frameCount focused = p5_instance.focused displayWidth = p5_instance.displayWidth displayHeight = p5_instance.displayHeight windowWidth = p5_instance.windowWidth windowHeight = p5_instance.windowHeight width = p5_instance.width height = p5_instance.height deviceOrientation = p5_instance.deviceOrientation accelerationX = p5_instance.accelerationX accelerationY = p5_instance.accelerationY accelerationZ = p5_instance.accelerationZ pAccelerationX = p5_instance.pAccelerationX pAccelerationY = p5_instance.pAccelerationY pAccelerationZ = p5_instance.pAccelerationZ rotationX = p5_instance.rotationX rotationY = p5_instance.rotationY rotationZ = p5_instance.rotationZ pRotationX = p5_instance.pRotationX pRotationY = p5_instance.pRotationY pRotationZ = p5_instance.pRotationZ turnAxis = p5_instance.turnAxis keyIsPressed = p5_instance.keyIsPressed key = p5_instance.key keyCode = p5_instance.keyCode mouseX = p5_instance.mouseX mouseY = p5_instance.mouseY pmouseX = p5_instance.pmouseX pmouseY = p5_instance.pmouseY winMouseX = p5_instance.winMouseX winMouseY = p5_instance.winMouseY pwinMouseX = p5_instance.pwinMouseX pwinMouseY = p5_instance.pwinMouseY mouseButton = p5_instance.mouseButton mouseIsPressed = p5_instance.mouseIsPressed touches = p5_instance.touches pixels = p5_instance.pixels return draw_func(*args, **kwargs) def global_p5_injection(p5_sketch): """ Injects the p5js's skecth instance as a global variable to setup and draw functions """ def decorator(f, *args, **kwargs): def wrapper(*args, **kwargs): global _P5_INSTANCE _P5_INSTANCE = p5_sketch return pre_draw(_P5_INSTANCE, f, *args, **kwargs) return wrapper return decorator def start_p5(preload_func, setup_func, draw_func, event_functions): """ This is the entrypoint function. It accepts 2 parameters: - preload_func: A Python preload callable - setup_func: a Python setup callable - draw_func: a Python draw callable - event_functions: a config dict for the event functions in the format: {"eventFunctionName": python_event_function} This method gets the p5js's sketch instance and injects them """ def sketch_setup(p5_sketch): """ Callback function called to configure new p5 instance """ p5_sketch.preload = global_p5_injection(p5_sketch)(preload_func) p5_sketch.setup = global_p5_injection(p5_sketch)(setup_func) p5_sketch.draw = global_p5_injection(p5_sketch)(draw_func) window.instance = p5.new(sketch_setup, 'sketch-holder') # Register event functions event_function_names = ( "deviceMoved", "deviceTurned", "deviceShaken", "windowResized", "keyPressed", "keyReleased", "keyTyped", "mousePressed", "mouseReleased", "mouseClicked", "doubleClicked", "mouseMoved", "mouseDragged", "mouseWheel", "touchStarted", "touchMoved", "touchEnded", "keyIsDown", ) for f_name in [f for f in event_function_names if event_functions.get(f, None)]: func = event_functions[f_name] event_func = global_p5_injection(window.instance)(func) setattr(window.instance, f_name, event_func) `; const placeholder = ` def preload(): pass def setup(): pass def draw(): pass deviceMoved = None deviceTurned = None deviceShaken = None keyPressed = None keyReleased = None keyTyped = None mouseMoved = None mouseDragged = None mousePressed = None mouseReleased = None mouseClicked = None doubleClicked = None mouseWheel = None touchStarted = None touchMoved = None touchEnded = None windowResized = None `; let userCode = ` # From Prof. Claudio Esperança examples for BrythonIDE # https://github.com/esperanc/brythonide/blob/master/demoSketches/boids.py boids = [] def setup(): createCanvas(720, 400) # Add an initial set of boids into the system for i in range(10): boids.append (Boid(random(720), random(400))) # frameRate(60) def draw(): background(51) # Run all the boids for boid in boids: boid.run(boids) fill(255) # Display score textSize(16) textAlign(LEFT) text("Frames: %.1f" %frameRate(), 150, 390) # Boid class # Methods for Separation, Cohesion, Alignment added class Boid(object): def __init__(self, x, y): self.acceleration = PVector(0, 0) self.velocity = PVector.random2D() self.position = PVector(x, y) self.r = 3.0 self.maxspeed = 3 # Maximum speed self.maxforce = 0.05 # Maximum steering force def run(self, boids): self.flock(boids) self.update() self.borders() self.render() # Forces go into acceleration def applyForce(self,force): self.acceleration = self.acceleration + force # We accumulate a new acceleration each time based on three rules def flock(self, boids): sep = self.separate(boids) # Separation ali = self.align(boids) # Alignment coh = self.cohesion(boids) # Cohesion # Arbitrarily weight these forces sep = 2.5 * sep ali = 1.0 * ali coh = 1.0 * coh # Add the force vectors to acceleration self.applyForce(sep) self.applyForce(ali) self.applyForce(coh) # Method to update location def update(self): # Update velocity self.velocity = self.velocity + self.acceleration # Limit speed self.velocity.limit(self.maxspeed) self.position = self.position + self.velocity # Reset acceleration to 0 each cycle self.acceleration = 0 * self.acceleration # A method that calculates and applies a steering force towards a target # STEER = DESIRED MINUS VELOCITY def seek(self,target): desired = target - self.position # A vector pointing from the location to the target # Normalize desired and scale to maximum speed desired.normalize() desired = desired * self.maxspeed # Steering = Desired minus Velocity steer = desired - self.velocity steer.limit(self.maxforce) # Limit to maximum steering force return steer # Draw boid as a circle def render(self): fill(127, 127) stroke(200) ellipse(self.position.x, self.position.y, 16, 16) # Wraparound def borders(self): if (self.position.x < -self.r): self.position.x = width + self.r if (self.position.y < -self.r): self.position.y = height + self.r if (self.position.x > width + self.r): self.position.x = -self.r if (self.position.y > height + self.r): self.position.y = -self.r # Separation # Method checks for nearby boids and steers away def separate(self, boids): desiredseparation = 25.0 steer = PVector(0, 0) count = 0 # For every boid in the system, check if it's too close for i in range(len(boids)): d = PVector.dist(self.position, boids[i].position) # If the distance is greater than 0 and less than an arbitrary amount (0 when you are yourself) if (0 < d < desiredseparation) : # Calculate vector pointing away from neighbor diff = self.position - boids[i].position diff.normalize() diff = diff / d steer = steer + diff count += 1 # Keep track of how many # Average -- divide by how many if (count > 0): steer = steer/count # As long as the vector is greater than 0 if (steer.mag() > 0): # Implement Reynolds: Steering = Desired - Velocity steer.normalize() steer = steer * self.maxspeed steer = steer - self.velocity steer.limit(self.maxforce) return steer # Alignment # For every nearby boid in the system, calculate the average velocity def align(self, boids): neighbordist = 50 summ = PVector(0, 0) count = 0 for i in range(len(boids)): d = PVector.dist(self.position, boids[i].position) if (0 < d < neighbordist): summ = summ + boids[i].velocity count += 1 if (count > 0) : summ = summ/count summ.normalize() summ = summ * self.maxspeed steer = summ - self.velocity steer.limit(self.maxforce) return steer else: return PVector(0, 0) # Cohesion # For the average location (i.e. center) of all nearby boids, calculate steering vector towards that location def cohesion(self, boids) : neighbordist = 50 summ = PVector(0, 0) # Start with empty vector to accumulate all locations count = 0 for i in range(len(boids)): d = PVector.dist(self.position, boids[i].position) if (0 < d < neighbordist) : summ = summ + boids[i].position # Add location count += 1 if (count > 0) : summ = summ / count return self.seek(summ) # Steer towards the location else: return PVector(0, 0) `; const startCode = ` event_functions = { "deviceMoved": deviceMoved, "deviceTurned": deviceTurned, "deviceShaken": deviceShaken, "keyPressed": keyPressed, "keyReleased": keyReleased, "keyTyped": keyTyped, "mouseMoved": mouseMoved, "mouseDragged": mouseDragged, "mousePressed": mousePressed, "mouseReleased": mouseReleased, "mouseClicked": mouseClicked, "doubleClicked": doubleClicked, "mouseWheel": mouseWheel, "touchStarted": touchStarted, "touchMoved": touchMoved, "touchEnded": touchEnded, "windowResized": windowResized, } start_p5(preload, setup, draw, event_functions) `; function runCode() { let code = [ placeholder, userCode, wrapperContent, startCode, ].join('\n'); if (window.instance) { window.instance.canvas.remove(); } console.log("Python execution output:"); window.pyodide.runPython(code); } async function main() { const config = { indexURL : "https://cdn.jsdelivr.net/pyodide/v0.18.1/full/", fullStdLib: false, } window.pyodide = await loadPyodide(config); // Pyodide is now ready to use... console.log(window.pyodide.runPython(` import io, code, sys from js import p5, window, document print(sys.version) `)); window.runSketchCode = (code) => { userCode = code; runCode(); } runCode(); }; // async method main(); ================================================ FILE: docs/examples/pyodide/sketch_005/index.html ================================================ sketch_005 - pyp5js

Python code here.


def setup():
    createCanvas(600,600)
    noStroke()
    rectMode(CENTER)


def draw():
    colorMode(HSB,100)
    h = map(mouseY,0,600,0,100)
    background(h,100,100)
    fill(100-h,100,100)
    rect(300,300,mouseX+1,mouseX+1)
================================================ FILE: docs/examples/pyodide/sketch_005/sketch_005.py ================================================ def setup(): createCanvas(600,600) noStroke() rectMode(CENTER) def draw(): colorMode(HSB,100) h = map(mouseY,0,600,0,100) background(h,100,100) fill(100-h,100,100) rect(300,300,mouseX+1,mouseX+1) ================================================ FILE: docs/examples/pyodide/sketch_005/static/p5.js ================================================ /*! p5.js v1.0.0 February 29, 2020 */ !function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).p5=e()}}(function(){return function o(a,s,l){function u(t,e){if(!s[t]){if(!a[t]){var r="function"==typeof require&&require;if(!e&&r)return r(t,!0);if(h)return h(t,!0);var i=new Error("Cannot find module '"+t+"'");throw i.code="MODULE_NOT_FOUND",i}var n=s[t]={exports:{}};a[t][0].call(n.exports,function(e){return u(a[t][1][e]||e)},n,n.exports,o,a,s,l)}return s[t].exports}for(var h="function"==typeof require&&require,e=0;e>16&255,a[s++]=t>>8&255,a[s++]=255&t;2===o&&(t=u[e.charCodeAt(r)]<<2|u[e.charCodeAt(r+1)]>>4,a[s++]=255&t);1===o&&(t=u[e.charCodeAt(r)]<<10|u[e.charCodeAt(r+1)]<<4|u[e.charCodeAt(r+2)]>>2,a[s++]=t>>8&255,a[s++]=255&t);return a},r.fromByteArray=function(e){for(var t,r=e.length,i=r%3,n=[],o=0,a=r-i;o>2]+s[t<<4&63]+"==")):2==i&&(t=(e[r-2]<<8)+e[r-1],n.push(s[t>>10]+s[t>>4&63]+s[t<<2&63]+"="));return n.join("")};for(var s=[],u=[],h="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=0,o=i.length;n>18&63]+s[n>>12&63]+s[n>>6&63]+s[63&n]);return o.join("")}u["-".charCodeAt(0)]=62,u["_".charCodeAt(0)]=63},{}],20:[function(e,t,r){},{}],21:[function(N,e,F){(function(c){"use strict";var i=N("base64-js"),o=N("ieee754"),e="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;F.Buffer=c,F.SlowBuffer=function(e){+e!=e&&(e=0);return c.alloc(+e)},F.INSPECT_MAX_BYTES=50;var r=2147483647;function a(e){if(r>>1;case"base64":return O(e).length;default:if(n)return i?-1:R(e).length;t=(""+t).toLowerCase(),n=!0}}function d(e,t,r){var i=e[t];e[t]=e[r],e[r]=i}function p(e,t,r,i,n){if(0===e.length)return-1;if("string"==typeof r?(i=r,r=0):2147483647=e.length){if(n)return-1;r=e.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof t&&(t=c.from(t,i)),c.isBuffer(t))return 0===t.length?-1:m(e,t,r,i,n);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):m(e,[t],r,i,n);throw new TypeError("val must be string, number or Buffer")}function m(e,t,r,i,n){var o,a=1,s=e.length,l=t.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(e.length<2||t.length<2)return-1;s/=a=2,l/=2,r/=2}function u(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(n){var h=-1;for(o=r;o>8,n=r%256,o.push(n),o.push(i);return o}(t,e.length-r),e,r,i)}function b(e,t,r){return 0===t&&r===e.length?i.fromByteArray(e):i.fromByteArray(e.slice(t,r))}function _(e,t,r){r=Math.min(e.length,r);for(var i=[],n=t;n>>10&1023|55296),h=56320|1023&h),i.push(h),n+=c}return function(e){var t=e.length;if(t<=x)return String.fromCharCode.apply(String,e);var r="",i=0;for(;ithis.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e=e||"utf8";;)switch(e){case"hex":return M(this,t,r);case"utf8":case"utf-8":return _(this,t,r);case"ascii":return w(this,t,r);case"latin1":case"binary":return S(this,t,r);case"base64":return b(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,t,r);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}.apply(this,arguments)},c.prototype.equals=function(e){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===c.compare(this,e)},c.prototype.inspect=function(){var e="",t=F.INSPECT_MAX_BYTES;return e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(e+=" ... "),""},e&&(c.prototype[e]=c.prototype.inspect),c.prototype.compare=function(e,t,r,i,n){if(A(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),t<0||r>e.length||i<0||n>this.length)throw new RangeError("out of range index");if(n<=i&&r<=t)return 0;if(n<=i)return-1;if(r<=t)return 1;if(this===e)return 0;for(var o=(n>>>=0)-(i>>>=0),a=(r>>>=0)-(t>>>=0),s=Math.min(o,a),l=this.slice(i,n),u=e.slice(t,r),h=0;h>>=0,isFinite(r)?(r>>>=0,void 0===i&&(i="utf8")):(i=r,r=void 0)}var n=this.length-t;if((void 0===r||nthis.length)throw new RangeError("Attempt to write outside buffer bounds");i=i||"utf8";for(var o,a,s,l,u,h,c=!1;;)switch(i){case"hex":return g(this,e,t,r);case"utf8":case"utf-8":return u=t,h=r,D(R(e,(l=this).length-u),l,u,h);case"ascii":return v(this,e,t,r);case"latin1":case"binary":return v(this,e,t,r);case"base64":return o=this,a=t,s=r,D(O(e),o,a,s);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return y(this,e,t,r);default:if(c)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),c=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var x=4096;function w(e,t,r){var i="";r=Math.min(e.length,r);for(var n=t;ne.length)throw new RangeError("Index out of range")}function P(e,t,r,i){if(r+i>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function L(e,t,r,i,n){return t=+t,r>>>=0,n||P(e,0,r,4),o.write(e,t,r,i,23,4),r+4}function k(e,t,r,i,n){return t=+t,r>>>=0,n||P(e,0,r,8),o.write(e,t,r,i,52,8),r+8}c.prototype.slice=function(e,t){var r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):r>>=0,t>>>=0,r||T(e,t,this.length);for(var i=this[e],n=1,o=0;++o>>=0,t>>>=0,r||T(e,t,this.length);for(var i=this[e+--t],n=1;0>>=0,t||T(e,1,this.length),this[e]},c.prototype.readUInt16LE=function(e,t){return e>>>=0,t||T(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUInt16BE=function(e,t){return e>>>=0,t||T(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUInt32LE=function(e,t){return e>>>=0,t||T(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUInt32BE=function(e,t){return e>>>=0,t||T(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||T(e,t,this.length);for(var i=this[e],n=1,o=0;++o>>=0,t>>>=0,r||T(e,t,this.length);for(var i=t,n=1,o=this[e+--i];0>>=0,t||T(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){e>>>=0,t||T(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(e,t){e>>>=0,t||T(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(e,t){return e>>>=0,t||T(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return e>>>=0,t||T(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readFloatLE=function(e,t){return e>>>=0,t||T(e,4,this.length),o.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return e>>>=0,t||T(e,4,this.length),o.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return e>>>=0,t||T(e,8,this.length),o.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return e>>>=0,t||T(e,8,this.length),o.read(this,e,!1,52,8)},c.prototype.writeUIntLE=function(e,t,r,i){e=+e,t>>>=0,r>>>=0,i||C(this,e,t,r,Math.pow(2,8*r)-1,0);var n=1,o=0;for(this[t]=255&e;++o>>=0,r>>>=0,i||C(this,e,t,r,Math.pow(2,8*r)-1,0);var n=r-1,o=1;for(this[t+n]=255&e;0<=--n&&(o*=256);)this[t+n]=e/o&255;return t+r},c.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,1,255,0),this[t]=255&e,t+1},c.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},c.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeIntLE=function(e,t,r,i){if(e=+e,t>>>=0,!i){var n=Math.pow(2,8*r-1);C(this,e,t,r,n-1,-n)}var o=0,a=1,s=0;for(this[t]=255&e;++o>0)-s&255;return t+r},c.prototype.writeIntBE=function(e,t,r,i){if(e=+e,t>>>=0,!i){var n=Math.pow(2,8*r-1);C(this,e,t,r,n-1,-n)}var o=r-1,a=1,s=0;for(this[t+o]=255&e;0<=--o&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+r},c.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},c.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeFloatLE=function(e,t,r){return L(this,e,t,!0,r)},c.prototype.writeFloatBE=function(e,t,r){return L(this,e,t,!1,r)},c.prototype.writeDoubleLE=function(e,t,r){return k(this,e,t,!0,r)},c.prototype.writeDoubleBE=function(e,t,r){return k(this,e,t,!1,r)},c.prototype.copy=function(e,t,r,i){if(!c.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r=r||0,i||0===i||(i=this.length),t>=e.length&&(t=e.length),t=t||0,0=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t>>=0,r=void 0===r?this.length:r>>>0,"number"==typeof(e=e||0))for(o=t;o>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function O(e){return i.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(t,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function D(e,t,r,i){for(var n=0;n=t.length||n>=e.length);++n)t[n+r]=e[n];return n}function A(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function I(e){return e!=e}var U=function(){for(var e="0123456789abcdef",t=new Array(256),r=0;r<16;++r)for(var i=16*r,n=0;n<16;++n)t[i+n]=e[r]+e[n];return t}()}).call(this,N("buffer").Buffer)},{"base64-js":19,buffer:21,ieee754:30}],22:[function(e,t,r){"use strict";t.exports=e("./").polyfill()},{"./":23}],23:[function(z,r,i){(function(j,V){var e,t;e=this,t=function(){"use strict";function l(e){return"function"==typeof e}var r=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},i=0,t=void 0,n=void 0,a=function(e,t){f[i]=e,f[i+1]=t,2===(i+=2)&&(n?n(d):y())};var e="undefined"!=typeof window?window:void 0,o=e||{},s=o.MutationObserver||o.WebKitMutationObserver,u="undefined"==typeof self&&void 0!==j&&"[object process]"==={}.toString.call(j),h="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function c(){var e=setTimeout;return function(){return e(d,1)}}var f=new Array(1e3);function d(){for(var e=0;e":">",'"':""","'":"'","/":"/"};function S(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,function(e){return w[e]}):e}var M=function(){function i(e){var t,r=1=this.maxReplaces)break}for(a=0;r=this.regexp.exec(e);){if(void 0===(i=h(r[1].trim())))if("function"==typeof c){var d=c(e,r,t);i="string"==typeof d?d:""}else this.logger.warn("missed to pass in variable ".concat(r[1]," for interpolating ").concat(e)),i="";else"string"==typeof i||this.useRawValueToEscape||(i=v(i));if(i=this.escapeValue?u(this.escape(i)):u(i),e=e.replace(r[0],i),this.regexp.lastIndex=0,++a>=this.maxReplaces)break}return e}},{key:"nest",value:function(e,t,r){var i,n,o=D({},2>1,h=-7,c=r?n-1:0,f=r?-1:1,d=e[t+c];for(c+=f,o=d&(1<<-h)-1,d>>=-h,h+=s;0>=-h,h+=i;0>1,f=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,d=i?0:o-1,p=i?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=h):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),2<=(t+=1<=a+c?f/l:f*Math.pow(2,1-c))*l&&(a++,l/=2),h<=a+c?(s=0,a=h):1<=a+c?(s=(t*l-1)*Math.pow(2,n),a+=c):(s=t*Math.pow(2,c-1)*Math.pow(2,n),a=0));8<=n;e[r+d]=255&s,d+=p,s/=256,n-=8);for(a=a<Math.abs(e[0])&&(t=1),Math.abs(e[2])>Math.abs(e[t])&&(t=2),t}var C=4e150;function P(e,t){e.f+=t.f,e.b.f+=t.b.f}function u(e,t,r){return e=e.a,t=t.a,r=r.a,t.b.a===e?r.b.a===e?v(t.a,r.a)?b(r.b.a,t.a,r.a)<=0:0<=b(t.b.a,r.a,t.a):b(r.b.a,e,r.a)<=0:r.b.a===e?0<=b(t.b.a,e,t.a):(t=y(t.b.a,e,t.a),(e=y(r.b.a,e,r.a))<=t)}function L(e){e.a.i=null;var t=e.e;t.a.c=t.c,t.c.a=t.a,e.e=null}function h(e,t){c(e.a),e.c=!1,(e.a=t).i=e}function k(e){for(var t=e.a.a;(e=fe(e)).a.a===t;);return e.c&&(h(e,t=f(ce(e).a.b,e.a.e)),e=fe(e)),e}function R(e,t,r){var i=new he;return i.a=r,i.e=W(e.f,t.e,i),r.i=i}function O(e,t){switch(e.s){case 100130:return 0!=(1&t);case 100131:return 0!==t;case 100132:return 0>1]],s[a[u]])?le(r,u):ue(r,u)),s[o]=null,l[o]=r.b,r.b=o}else for(r.c[-(o+1)]=null;0Math.max(a.a,l.a))return!1;if(v(o,a)){if(0i.f&&(i.f*=2,i.c=oe(i.c,i.f+1)),0===i.b?r=n:(r=i.b,i.b=i.c[i.b]),i.e[r]=t,i.c[r]=n,i.d[n]=r,i.h&&ue(i,n),r}return i=e.a++,e.c[i]=t,-(i+1)}function ie(e){if(0===e.a)return se(e.b);var t=e.c[e.d[e.a-1]];if(0!==e.b.a&&v(ae(e.b),t))return se(e.b);for(;--e.a,0e.a||v(i[a],i[l])){n[r[o]=a]=o;break}n[r[o]=l]=o,o=s}}function ue(e,t){for(var r=e.d,i=e.e,n=e.c,o=t,a=r[o];;){var s=o>>1,l=r[s];if(0==s||v(i[l],i[a])){n[r[o]=a]=o;break}n[r[o]=l]=o,o=s}}function he(){this.e=this.a=null,this.f=0,this.c=this.b=this.h=this.d=!1}function ce(e){return e.e.c.b}function fe(e){return e.e.a.b}(i=q.prototype).x=function(){Y(this,0)},i.B=function(e,t){switch(e){case 100142:return;case 100140:switch(t){case 100130:case 100131:case 100132:case 100133:case 100134:return void(this.s=t)}break;case 100141:return void(this.m=!!t);default:return void Z(this,100900)}Z(this,100901)},i.y=function(e){switch(e){case 100142:return 0;case 100140:return this.s;case 100141:return this.m;default:Z(this,100900)}return!1},i.A=function(e,t,r){this.j[0]=e,this.j[1]=t,this.j[2]=r},i.z=function(e,t){var r=t||null;switch(e){case 100100:case 100106:this.h=r;break;case 100104:case 100110:this.l=r;break;case 100101:case 100107:this.k=r;break;case 100102:case 100108:this.i=r;break;case 100103:case 100109:this.p=r;break;case 100105:case 100111:this.o=r;break;case 100112:this.r=r;break;default:Z(this,100900)}},i.C=function(e,t){var r=!1,i=[0,0,0];Y(this,2);for(var n=0;n<3;++n){var o=e[n];o<-1e150&&(o=-1e150,r=!0),1e150n[u]&&(n[u]=h,a[u]=l)}if(l=0,n[1]-o[1]>n[0]-o[0]&&(l=1),n[2]-o[2]>n[l]-o[l]&&(l=2),o[l]>=n[l])i[0]=0,i[1]=0,i[2]=1;else{for(n=0,o=s[l],a=a[l],s=[0,0,0],o=[o.g[0]-a.g[0],o.g[1]-a.g[1],o.g[2]-a.g[2]],u=[0,0,0],l=r.e;l!==r;l=l.e)u[0]=l.g[0]-a.g[0],u[1]=l.g[1]-a.g[1],u[2]=l.g[2]-a.g[2],s[0]=o[1]*u[2]-o[2]*u[1],s[1]=o[2]*u[0]-o[0]*u[2],s[2]=o[0]*u[1]-o[1]*u[0],n<(h=s[0]*s[0]+s[1]*s[1]+s[2]*s[2])&&(n=h,i[0]=s[0],i[1]=s[1],i[2]=s[2]);n<=0&&(i[0]=i[1]=i[2]=0,i[T(o)]=1)}r=!0}for(s=T(i),l=this.b.c,n=(s+1)%3,a=(s+2)%3,s=0>=l,h-=l,g!=o){if(g==a)break;for(var v=g>8,++y;var _=b;if(i>=8;null!==m&&s<4096&&(p[s++]=m<<8|_,u+1<=s&&l<12&&(++l,u=u<<1|1)),m=g}else s=1+a,u=(1<<(l=n+1))-1,m=null}return f!==i&&console.log("Warning, gif stream shorter than expected."),r}try{r.GifWriter=function(v,e,t,r){var y=0,i=void 0===(r=void 0===r?{}:r).loop?null:r.loop,b=void 0===r.palette?null:r.palette;if(e<=0||t<=0||65535>=1;)++n;if(a=1<>8&255,v[y++]=255&t,v[y++]=t>>8&255,v[y++]=(null!==b?128:0)|n,v[y++]=o,v[y++]=0,null!==b)for(var s=0,l=b.length;s>16&255,v[y++]=u>>8&255,v[y++]=255&u}if(null!==i){if(i<0||65535>8&255,v[y++]=0}var x=!1;this.addFrame=function(e,t,r,i,n,o){if(!0===x&&(--y,x=!1),o=void 0===o?{}:o,e<0||t<0||65535>=1;)++u;l=1<>8&255,v[y++]=d,v[y++]=0),v[y++]=44,v[y++]=255&e,v[y++]=e>>8&255,v[y++]=255&t,v[y++]=t>>8&255,v[y++]=255&r,v[y++]=r>>8&255,v[y++]=255&i,v[y++]=i>>8&255,v[y++]=!0===a?128|u-1:0,!0===a)for(var p=0,m=s.length;p>16&255,v[y++]=g>>8&255,v[y++]=255&g}return y=function(t,r,e,i){t[r++]=e;var n=r++,o=1<>=8,h-=8,r===n+256&&(t[n]=255,n=r++)}function d(e){c|=e<>=8,h-=8,r===n+256&&(t[n]=255,n=r++);4096===l?(d(o),l=1+s,u=e+1,m={}):(1<>7,n=1<<1+(7&r);x[e++],x[e++];var o=null,a=null;i&&(o=e,e+=3*(a=n));var s=!0,l=[],u=0,h=null,c=0,f=null;for(this.width=w,this.height=t;s&&e>2&7,e++;break;case 254:for(;;){if(!(0<=(C=x[e++])))throw Error("Invalid block size");if(0===C)break;e+=C}break;default:throw new Error("Unknown graphic control label: 0x"+x[e-1].toString(16))}break;case 44:var p=x[e++]|x[e++]<<8,m=x[e++]|x[e++]<<8,g=x[e++]|x[e++]<<8,v=x[e++]|x[e++]<<8,y=x[e++],b=y>>6&1,_=1<<1+(7&y),S=o,M=a,E=!1;if(y>>7){E=!0;S=e,e+=3*(M=_)}var T=e;for(e++;;){var C;if(!(0<=(C=x[e++])))throw Error("Invalid block size");if(0===C)break;e+=C}l.push({x:p,y:m,width:g,height:v,has_local_palette:E,palette_offset:S,palette_size:M,data_offset:T,data_length:e-T,transparent_index:h,interlaced:!!b,delay:u,disposal:c});break;case 59:s=!1;break;default:throw new Error("Unknown gif block: 0x"+x[e-1].toString(16))}this.numFrames=function(){return l.length},this.loopCount=function(){return f},this.frameInfo=function(e){if(e<0||e>=l.length)throw new Error("Frame index out of range.");return l[e]},this.decodeAndBlitFrameBGRA=function(e,t){var r=this.frameInfo(e),i=r.width*r.height,n=new Uint8Array(i);P(x,r.data_offset,n,i);var o=r.palette_offset,a=r.transparent_index;null===a&&(a=256);var s=r.width,l=w-s,u=s,h=4*(r.y*w+r.x),c=4*((r.y+r.height)*w+r.x),f=h,d=4*l;!0===r.interlaced&&(d+=4*w*7);for(var p=8,m=0,g=n.length;m>=1)),v===a)f+=4;else{var y=x[o+3*v],b=x[o+3*v+1],_=x[o+3*v+2];t[f++]=_,t[f++]=b,t[f++]=y,t[f++]=255}--u}},this.decodeAndBlitFrameRGBA=function(e,t){var r=this.frameInfo(e),i=r.width*r.height,n=new Uint8Array(i);P(x,r.data_offset,n,i);var o=r.palette_offset,a=r.transparent_index;null===a&&(a=256);var s=r.width,l=w-s,u=s,h=4*(r.y*w+r.x),c=4*((r.y+r.height)*w+r.x),f=h,d=4*l;!0===r.interlaced&&(d+=4*w*7);for(var p=8,m=0,g=n.length;m>=1)),v===a)f+=4;else{var y=x[o+3*v],b=x[o+3*v+1],_=x[o+3*v+2];t[f++]=y,t[f++]=b,t[f++]=_,t[f++]=255}--u}}}}catch(e){}},{}],33:[function(jr,t,r){(function(Gr){var e;e=this,function(E){"use strict";function e(e){if(null==this)throw TypeError();var t=String(this),r=t.length,i=e?Number(e):0;if(i!=i&&(i=0),!(i<0||r<=i)){var n,o=t.charCodeAt(i);return 55296<=o&&o<=56319&&i+1>>=1,t}function _(e,t,r){if(!t)return r;for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<>>16-t;return e.tag>>>=t,e.bitcount-=t,i+r}function x(e,t){for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<>>=1,++n,r+=t.table[n],0<=(i-=t.table[n]););return e.tag=o,e.bitcount-=n,t.trans[r+i]}function w(e,t,r){var i,n,o,a,s,l;for(i=_(e,5,257),n=_(e,5,1),o=_(e,4,4),a=0;a<19;++a)g[a]=0;for(a=0;athis.x2&&(this.x2=e)),"number"==typeof t&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=t,this.y2=t),tthis.y2&&(this.y2=t))},C.prototype.addX=function(e){this.addPoint(e,null)},C.prototype.addY=function(e){this.addPoint(null,e)},C.prototype.addBezier=function(e,t,r,i,n,o,a,s){var l=this,u=[e,t],h=[r,i],c=[n,o],f=[a,s];this.addPoint(e,t),this.addPoint(a,s);for(var d=0;d<=1;d++){var p=6*u[d]-12*h[d]+6*c[d],m=-3*u[d]+9*h[d]-9*c[d]+3*f[d],g=3*h[d]-3*u[d];if(0!=m){var v=Math.pow(p,2)-4*g*m;if(!(v<0)){var y=(-p+Math.sqrt(v))/(2*m);0>8&255,255&e]},A.USHORT=U(2),D.SHORT=function(e){return 32768<=e&&(e=-(65536-e)),[e>>8&255,255&e]},A.SHORT=U(2),D.UINT24=function(e){return[e>>16&255,e>>8&255,255&e]},A.UINT24=U(3),D.ULONG=function(e){return[e>>24&255,e>>16&255,e>>8&255,255&e]},A.ULONG=U(4),D.LONG=function(e){return R<=e&&(e=-(2*R-e)),[e>>24&255,e>>16&255,e>>8&255,255&e]},A.LONG=U(4),D.FIXED=D.ULONG,A.FIXED=A.ULONG,D.FWORD=D.SHORT,A.FWORD=A.SHORT,D.UFWORD=D.USHORT,A.UFWORD=A.USHORT,D.LONGDATETIME=function(e){return[0,0,0,0,e>>24&255,e>>16&255,e>>8&255,255&e]},A.LONGDATETIME=U(8),D.TAG=function(e){return k.argument(4===e.length,"Tag should be exactly 4 ASCII characters."),[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]},A.TAG=U(4),D.Card8=D.BYTE,A.Card8=A.BYTE,D.Card16=D.USHORT,A.Card16=A.USHORT,D.OffSize=D.BYTE,A.OffSize=A.BYTE,D.SID=D.USHORT,A.SID=A.USHORT,D.NUMBER=function(e){return-107<=e&&e<=107?[e+139]:108<=e&&e<=1131?[247+((e-=108)>>8),255&e]:-1131<=e&&e<=-108?[251+((e=-e-108)>>8),255&e]:-32768<=e&&e<=32767?D.NUMBER16(e):D.NUMBER32(e)},A.NUMBER=function(e){return D.NUMBER(e).length},D.NUMBER16=function(e){return[28,e>>8&255,255&e]},A.NUMBER16=U(3),D.NUMBER32=function(e){return[29,e>>24&255,e>>16&255,e>>8&255,255&e]},A.NUMBER32=U(5),D.REAL=function(e){var t=e.toString(),r=/\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec(t);if(r){var i=parseFloat("1e"+((r[2]?+r[2]:0)+r[1].length));t=(Math.round(e*i)/i).toString()}for(var n="",o=0,a=t.length;o>8&255,t[t.length]=255&i}return t},A.UTF16=function(e){return 2*e.length};var N={"x-mac-croatian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈ƫȅ ÀÃÕŒœĐ—“”‘’÷◊©⁄€‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ","x-mac-cyrillic":"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю","x-mac-gaelic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØḂ±≤≥ḃĊċḊḋḞḟĠġṀæøṁṖṗɼƒſṠ«»… ÀÃÕŒœ–—“”‘’ṡẛÿŸṪ€‹›Ŷŷṫ·Ỳỳ⁊ÂÊÁËÈÍÎÏÌÓÔ♣ÒÚÛÙıÝýŴŵẄẅẀẁẂẃ","x-mac-greek":"Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦€ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ­","x-mac-icelandic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüݰ¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-inuit":"ᐃᐄᐅᐆᐊᐋᐱᐲᐳᐴᐸᐹᑉᑎᑏᑐᑑᑕᑖᑦᑭᑮᑯᑰᑲᑳᒃᒋᒌᒍᒎᒐᒑ°ᒡᒥᒦ•¶ᒧ®©™ᒨᒪᒫᒻᓂᓃᓄᓅᓇᓈᓐᓯᓰᓱᓲᓴᓵᔅᓕᓖᓗᓘᓚᓛᓪᔨᔩᔪᔫᔭ… ᔮᔾᕕᕖᕗ–—“”‘’ᕘᕙᕚᕝᕆᕇᕈᕉᕋᕌᕐᕿᖀᖁᖂᖃᖄᖅᖏᖐᖑᖒᖓᖔᖕᙱᙲᙳᙴᙵᙶᖖᖠᖡᖢᖣᖤᖥᖦᕼŁł","x-mac-ce":"ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ",macintosh:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-romanian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂȘ∞±≤≥¥µ∂∑∏π∫ªºΩăș¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›Țț‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-turkish":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙˆ˜¯˘˙˚¸˝˛ˇ"};O.MACSTRING=function(e,t,r,i){var n=N[i];if(void 0!==n){for(var o="",a=0;a>8&255,l+256&255)}return o}D.MACSTRING=function(e,t){var r=function(e){if(!F)for(var t in F={},N)F[t]=new String(t);var r=F[e];if(void 0!==r){if(B){var i=B.get(r);if(void 0!==i)return i}var n=N[e];if(void 0!==n){for(var o={},a=0;a>8,t[c+1]=255&f,t=t.concat(i[h])}return t},A.TABLE=function(e){for(var t=0,r=e.fields.length,i=0;i>1,t.skip("uShort",3),e.glyphIndexMap={};for(var a=new se.Parser(r,i+n+14),s=new se.Parser(r,i+n+16+2*o),l=new se.Parser(r,i+n+16+4*o),u=new se.Parser(r,i+n+16+6*o),h=i+n+16+8*o,c=0;c>4,o=15&i;if(15==n)break;if(t+=r[n],15==o)break;t+=r[o]}return parseFloat(t)}(e);if(32<=t&&t<=246)return t-139;if(247<=t&&t<=250)return 256*(t-247)+e.parseByte()+108;if(251<=t&&t<=254)return 256*-(t-251)-e.parseByte()-108;throw new Error("Invalid b0 "+t)}function Te(e,t,r){t=void 0!==t?t:0;var i=new se.Parser(e,t),n=[],o=[];for(r=void 0!==r?r:e.length;i.relativeOffset>1,T.length=0,P=!0}return function e(t){for(var r,i,n,o,a,s,l,u,h,c,f,d,p=0;pMath.abs(d-R)?k=f+T.shift():R=d+T.shift(),E.curveTo(y,b,_,x,l,u),E.curveTo(h,c,f,d,k,R);break;default:console.log("Glyph "+v.index+": unknown operator 1200"+m),T.length=0}break;case 14:0>3;break;case 21:2>16),p+=2;break;case 29:a=T.pop()+g.gsubrsBias,(s=g.gsubrs[a])&&e(s);break;case 30:for(;0=r.begin&&e=fe.length){var a=i.parseChar();r.names.push(i.parseString(a))}break;case 2.5:r.numberOfGlyphs=i.parseUShort(),r.offset=new Array(r.numberOfGlyphs);for(var s=0;st.value.tag?1:-1}),t.fields=t.fields.concat(i),t.fields=t.fields.concat(n),t}function gt(e,t,r){for(var i=0;i 123 are reserved for internal usage");d|=1<>>1,o=e[n].tag;if(o===t)return n;o>>1,o=e[n];if(o===t)return n;o>>1,a=(r=e[o]).start;if(a===t)return r;a(r=e[i-1]).end?0:r}function xt(e,t){this.font=e,this.tableName=t}function wt(e){xt.call(this,e,"gpos")}function St(e){xt.call(this,e,"gsub")}function Mt(e,t){var r=e.length;if(r!==t.length)return!1;for(var i=0;it.points.length-1||i.matchedPoints[1]>n.points.length-1)throw Error("Matched points out of range in "+t.name);var a=t.points[i.matchedPoints[0]],s=n.points[i.matchedPoints[1]],l={xScale:i.xScale,scale01:i.scale01,scale10:i.scale10,yScale:i.yScale,dx:0,dy:0};s=kt([s],l)[0],l.dx=a.x-s.x,l.dy=a.y-s.y,o=kt(n.points,l)}t.points=t.points.concat(o)}}return Rt(t.points)}(wt.prototype=xt.prototype={searchTag:yt,binSearch:bt,getTable:function(e){var t=this.font.tables[this.tableName];return!t&&e&&(t=this.font.tables[this.tableName]=this.createDefaultTable()),t},getScriptNames:function(){var e=this.getTable();return e?e.scripts.map(function(e){return e.tag}):[]},getDefaultScriptName:function(){var e=this.getTable();if(e){for(var t=!1,r=0;r=s[u-1].tag,"Features must be added in alphabetical order."),o={tag:r,feature:{params:0,lookupListIndexes:[]}},s.push(o),a.push(u),o.feature}}},getLookupTables:function(e,t,r,i,n){var o=this.getFeatureTable(e,t,r,n),a=[];if(o){for(var s,l=o.lookupListIndexes,u=this.font.tables[this.tableName].lookups,h=0;h",s),t.stack.push(Math.round(64*s))}function vr(e,t){var r=t.stack,i=r.pop(),n=t.fv,o=t.pv,a=t.ppem,s=t.deltaBase+16*(e-1),l=t.deltaShift,u=t.z0;E.DEBUG&&console.log(t.step,"DELTAP["+e+"]",i,r);for(var h=0;h>4)===a){var d=(15&f)-8;0<=d&&d++,E.DEBUG&&console.log(t.step,"DELTAPFIX",c,"by",d*l);var p=u[c];n.setRelative(p,p,d*l,o)}}}function yr(e,t){var r=t.stack,i=r.pop();E.DEBUG&&console.log(t.step,"ROUND[]"),r.push(64*t.round(i/64))}function br(e,t){var r=t.stack,i=r.pop(),n=t.ppem,o=t.deltaBase+16*(e-1),a=t.deltaShift;E.DEBUG&&console.log(t.step,"DELTAC["+e+"]",i,r);for(var s=0;s>4)===n){var h=(15&u)-8;0<=h&&h++;var c=h*a;E.DEBUG&&console.log(t.step,"DELTACFIX",l,"by",c),t.cvt[l]+=c}}}function _r(e,t){var r,i,n=t.stack,o=n.pop(),a=n.pop(),s=t.z2[o],l=t.z1[a];E.DEBUG&&console.log(t.step,"SDPVTL["+e+"]",o,a),i=e?(r=s.y-l.y,l.x-s.x):(r=l.x-s.x,l.y-s.y),t.dpv=Zt(r,i)}function xr(e,t){var r=t.stack,i=t.prog,n=t.ip;E.DEBUG&&console.log(t.step,"PUSHB["+e+"]");for(var o=0;o":"_")+(i?"R":"_")+(0===n?"Gr":1===n?"Bl":2===n?"Wh":"")+"]",e?c+"("+o.cvt[c]+","+u+")":"",f,"(d =",a,"->",l*s,")"),o.rp1=o.rp0,o.rp2=f,t&&(o.rp0=f)}Ft.prototype.exec=function(e,t){if("number"!=typeof t)throw new Error("Point size is not a number!");if(!(2",i),s.interpolate(c,o,a,l),s.touch(c)}e.loop=1},dr.bind(void 0,0),dr.bind(void 0,1),function(e){for(var t=e.stack,r=e.rp0,i=e.z0[r],n=e.loop,o=e.fv,a=e.pv,s=e.z1;n--;){var l=t.pop(),u=s[l];E.DEBUG&&console.log(e.step,(1=a.width||t>=a.height?[0,0,0,0]:this._getPixel(e,t);var s=new l.default.Image(r,i);return s.canvas.getContext("2d").drawImage(a,e,t,r*o,i*o,0,0,r,i),s},l.default.Renderer.prototype.textLeading=function(e){return"number"==typeof e?(this._setProperty("_textLeading",e),this._pInst):this._textLeading},l.default.Renderer.prototype.textSize=function(e){return"number"==typeof e?(this._setProperty("_textSize",e),this._setProperty("_textLeading",e*y._DEFAULT_LEADMULT),this._applyTextProperties()):this._textSize},l.default.Renderer.prototype.textStyle=function(e){return e?(e!==y.NORMAL&&e!==y.ITALIC&&e!==y.BOLD&&e!==y.BOLDITALIC||this._setProperty("_textStyle",e),this._applyTextProperties()):this._textStyle},l.default.Renderer.prototype.textAscent=function(){return null===this._textAscent&&this._updateTextMetrics(),this._textAscent},l.default.Renderer.prototype.textDescent=function(){return null===this._textDescent&&this._updateTextMetrics(),this._textDescent},l.default.Renderer.prototype.textAlign=function(e,t){return void 0!==e?(this._setProperty("_textAlign",e),void 0!==t&&this._setProperty("_textBaseline",t),this._applyTextProperties()):{horizontal:this._textAlign,vertical:this._textBaseline}},l.default.Renderer.prototype.text=function(e,t,r,i,n){var o,a,s,l,u,h,c,f,d=this._pInst,p=Number.MAX_VALUE;if((this._doFill||this._doStroke)&&void 0!==e){if("string"!=typeof e&&(e=e.toString()),o=(e=e.replace(/(\t)/g," ")).split("\n"),void 0!==i){for(s=f=0;ss.HALF_PI&&e<=3*s.HALF_PI?Math.atan(r/i*Math.tan(e))+s.PI:Math.atan(r/i*Math.tan(e))+s.TWO_PI,t=t<=s.HALF_PI?Math.atan(r/i*Math.tan(t)):t>s.HALF_PI&&t<=3*s.HALF_PI?Math.atan(r/i*Math.tan(t))+s.PI:Math.atan(r/i*Math.tan(t))+s.TWO_PI),tv||Math.abs(this.accelerationY-this.pAccelerationY)>v||Math.abs(this.accelerationZ-this.pAccelerationZ)>v)&&e();var t=this.deviceTurned||window.deviceTurned;if("function"==typeof t){var r=this.rotationX+180,i=this.pRotationX+180,n=c+180;0>>24],i+=x[(16711680&C)>>16],n+=x[(65280&C)>>8],o+=x[255&C],r+=k[_],s++}w[l=T+y]=a/r,S[l]=i/r,M[l]=n/r,E[l]=o/r}T+=d}for(h=(u=-P)*d,b=T=0;b>>16,e[r+1]=(65280&t[i])>>>8,e[r+2]=255&t[i],e[r+3]=(4278190080&t[i])>>>24},O._toImageData=function(e){return e instanceof ImageData?e:e.getContext("2d").getImageData(0,0,e.width,e.height)},O._createImageData=function(e,t){return O._tmpCanvas=document.createElement("canvas"),O._tmpCtx=O._tmpCanvas.getContext("2d"),this._tmpCtx.createImageData(e,t)},O.apply=function(e,t,r){var i=e.getContext("2d"),n=i.getImageData(0,0,e.width,e.height),o=t(n,r);o instanceof ImageData?i.putImageData(o,0,0,0,0,e.width,e.height):i.putImageData(n,0,0,0,0,e.width,e.height)},O.threshold=function(e,t){var r=O._toPixels(e);void 0===t&&(t=.5);for(var i=Math.floor(255*t),n=0;n>8)/i,r[n+1]=255*(a*t>>8)/i,r[n+2]=255*(s*t>>8)/i}},O.dilate=function(e){for(var t,r,i,n,o,a,s,l,u,h,c,f,d,p,m,g,v,y=O._toPixels(e),b=0,_=y.length?y.length/4:0,x=new Int32Array(_);b<_;)for(r=(t=b)+e.width;b>16&255)+151*(i>>8&255)+28*(255&i))<(m=77*(c>>16&255)+151*(c>>8&255)+28*(255&c))&&(n=c,o=m),o<(p=77*((h=O._getARGB(y,a))>>16&255)+151*(h>>8&255)+28*(255&h))&&(n=h,o=p),o<(g=77*(f>>16&255)+151*(f>>8&255)+28*(255&f))&&(n=f,o=g),o<(v=77*(d>>16&255)+151*(d>>8&255)+28*(255&d))&&(n=d,o=v),x[b++]=n;O._setPixels(y,x)},O.erode=function(e){for(var t,r,i,n,o,a,s,l,u,h,c,f,d,p,m,g,v,y=O._toPixels(e),b=0,_=y.length?y.length/4:0,x=new Int32Array(_);b<_;)for(r=(t=b)+e.width;b>16&255)+151*(c>>8&255)+28*(255&c))<(o=77*(i>>16&255)+151*(i>>8&255)+28*(255&i))&&(n=c,o=m),(p=77*((h=O._getARGB(y,a))>>16&255)+151*(h>>8&255)+28*(255&h))>16&255)+151*(f>>8&255)+28*(255&f))>16&255)+151*(d>>8&255)+28*(255&d))=r){var i=Math.floor(t.timeDisplayed/r);if(t.timeDisplayed=0,t.displayIndex+=i,t.loopCount=Math.floor(t.displayIndex/t.numFrames),null!==t.loopLimit&&t.loopCount>=t.loopLimit)t.playing=!1;else{var n=t.displayIndex%t.numFrames;this.drawingContext.putImageData(t.frames[n].image,0,0),t.displayIndex=n,this.setModified(!0)}}}},n.default.Image.prototype._setProperty=function(e,t){this[e]=t,this.setModified(!0)},n.default.Image.prototype.loadPixels=function(){n.default.Renderer2D.prototype.loadPixels.call(this),this.setModified(!0)},n.default.Image.prototype.updatePixels=function(e,t,r,i){n.default.Renderer2D.prototype.updatePixels.call(this,e,t,r,i),this.setModified(!0)},n.default.Image.prototype.get=function(e,t,r,i){return n.default._validateParameters("p5.Image.get",arguments),n.default.Renderer2D.prototype.get.apply(this,arguments)},n.default.Image.prototype._getPixel=n.default.Renderer2D.prototype._getPixel,n.default.Image.prototype.set=function(e,t,r){n.default.Renderer2D.prototype.set.call(this,e,t,r),this.setModified(!0)},n.default.Image.prototype.resize=function(e,t){0===e&&0===t?(e=this.canvas.width,t=this.canvas.height):0===e?e=this.canvas.width*t/this.canvas.height:0===t&&(t=this.canvas.height*e/this.canvas.width),e=Math.floor(e),t=Math.floor(t);var r=document.createElement("canvas");if(r.width=e,r.height=t,this.gifProperties)for(var i=this.gifProperties,n=function(e,t){for(var r=0,i=0;i/g,">").replace(/"/g,""").replace(/'/g,"'")}function l(e,t){t&&!0!==t&&"true"!==t||(t="");var r="";return(e=e||"untitled")&&e.includes(".")&&(r=e.split(".").pop()),t&&r!==t&&(r=t,e="".concat(e,".").concat(r)),[e,r]}e("../core/error_helpers"),v.default.prototype.loadJSON=function(){for(var e=arguments.length,t=new Array(e),r=0;r"),n.print("");if(n.print(' '),n.print(""),n.print(""),n.print(" "),"0"!==o[0]){n.print(" ");for(var h=0;h".concat(c)),n.print(" ")}n.print(" ")}for(var f=0;f");for(var d=0;d".concat(p)),n.print(" ")}n.print(" ")}n.print("
"),n.print(""),n.print("")}n.close(),n.clear()},v.default.prototype.writeFile=function(e,t,r){var i="application/octet-stream";v.default.prototype._isSafari()&&(i="text/plain");var n=new Blob(e,{type:i});v.default.prototype.downloadFile(n,t,r)},v.default.prototype.downloadFile=function(e,t,r){var i=l(t,r),n=i[0];if(e instanceof Blob)s.default.saveAs(e,n);else{var o=document.createElement("a");if(o.href=e,o.download=n,o.onclick=function(e){var t;t=e,document.body.removeChild(t.target),e.stopPropagation()},o.style.display="none",document.body.appendChild(o),v.default.prototype._isSafari()){var a="Hello, Safari user! To download this file...\n";a+="1. Go to File --\x3e Save As.\n",a+='2. Choose "Page Source" as the Format.\n',a+='3. Name it with this extension: ."'.concat(i[1],'"'),alert(a)}o.click()}},v.default.prototype._checkFileExtension=l,v.default.prototype._isSafari=function(){return 0>>0},getSeed:function(){return t},rand:function(){return(r=(1664525*r+1013904223)%i)/i}});n.setSeed(e),_=new Array(4096);for(var o=0;o<4096;o++)_[o]=n.rand()};var o=n.default;r.default=o},{"../core/main":49}],82:[function(e,t,r){"use strict";function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i,l=(i=e("../core/main"))&&i.__esModule?i:{default:i},o=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==a(e)&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var o=i?Object.getOwnPropertyDescriptor(e,n):null;o&&(o.get||o.set)?Object.defineProperty(r,n,o):r[n]=e[n]}r.default=e,t&&t.set(e,r);return r}(e("../core/constants"));function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}l.default.Vector=function(e,t,r){var i,n,o;o=e instanceof l.default?(this.p5=e,i=t[0]||0,n=t[1]||0,t[2]||0):(i=e||0,n=t||0,r||0),this.x=i,this.y=n,this.z=o},l.default.Vector.prototype.toString=function(){return"p5.Vector Object : [".concat(this.x,", ").concat(this.y,", ").concat(this.z,"]")},l.default.Vector.prototype.set=function(e,t,r){return e instanceof l.default.Vector?(this.x=e.x||0,this.y=e.y||0,this.z=e.z||0):e instanceof Array?(this.x=e[0]||0,this.y=e[1]||0,this.z=e[2]||0):(this.x=e||0,this.y=t||0,this.z=r||0),this},l.default.Vector.prototype.copy=function(){return this.p5?new l.default.Vector(this.p5,[this.x,this.y,this.z]):new l.default.Vector(this.x,this.y,this.z)},l.default.Vector.prototype.add=function(e,t,r){return e instanceof l.default.Vector?(this.x+=e.x||0,this.y+=e.y||0,this.z+=e.z||0):e instanceof Array?(this.x+=e[0]||0,this.y+=e[1]||0,this.z+=e[2]||0):(this.x+=e||0,this.y+=t||0,this.z+=r||0),this};function u(e,t){return 0!==e&&(this.x=this.x%e),0!==t&&(this.y=this.y%t),this}function h(e,t,r){return 0!==e&&(this.x=this.x%e),0!==t&&(this.y=this.y%t),0!==r&&(this.z=this.z%r),this}l.default.Vector.prototype.rem=function(e,t,r){if(e instanceof l.default.Vector){if(Number.isFinite(e.x)&&Number.isFinite(e.y)&&Number.isFinite(e.z)){var i=parseFloat(e.x),n=parseFloat(e.y),o=parseFloat(e.z);h.call(this,i,n,o)}}else if(e instanceof Array)e.every(function(e){return Number.isFinite(e)})&&(2===e.length&&u.call(this,e[0],e[1]),3===e.length&&h.call(this,e[0],e[1],e[2]));else if(1===arguments.length){if(Number.isFinite(e)&&0!==e)return this.x=this.x%e,this.y=this.y%e,this.z=this.z%e,this}else if(2===arguments.length){var a=Array.prototype.slice.call(arguments);a.every(function(e){return Number.isFinite(e)})&&2===a.length&&u.call(this,a[0],a[1])}else if(3===arguments.length){var s=Array.prototype.slice.call(arguments);s.every(function(e){return Number.isFinite(e)})&&3===s.length&&h.call(this,s[0],s[1],s[2])}},l.default.Vector.prototype.sub=function(e,t,r){return e instanceof l.default.Vector?(this.x-=e.x||0,this.y-=e.y||0,this.z-=e.z||0):e instanceof Array?(this.x-=e[0]||0,this.y-=e[1]||0,this.z-=e[2]||0):(this.x-=e||0,this.y-=t||0,this.z-=r||0),this},l.default.Vector.prototype.mult=function(e){return"number"==typeof e&&isFinite(e)?(this.x*=e,this.y*=e,this.z*=e):console.warn("p5.Vector.prototype.mult:","n is undefined or not a finite number"),this},l.default.Vector.prototype.div=function(e){return"number"==typeof e&&isFinite(e)?0===e?console.warn("p5.Vector.prototype.div:","divide by 0"):(this.x/=e,this.y/=e,this.z/=e):console.warn("p5.Vector.prototype.div:","n is undefined or not a finite number"),this},l.default.Vector.prototype.mag=function(){return Math.sqrt(this.magSq())},l.default.Vector.prototype.magSq=function(){var e=this.x,t=this.y,r=this.z;return e*e+t*t+r*r},l.default.Vector.prototype.dot=function(e,t,r){return e instanceof l.default.Vector?this.dot(e.x,e.y,e.z):this.x*(e||0)+this.y*(t||0)+this.z*(r||0)},l.default.Vector.prototype.cross=function(e){var t=this.y*e.z-this.z*e.y,r=this.z*e.x-this.x*e.z,i=this.x*e.y-this.y*e.x;return this.p5?new l.default.Vector(this.p5,[t,r,i]):new l.default.Vector(t,r,i)},l.default.Vector.prototype.dist=function(e){return e.copy().sub(this).mag()},l.default.Vector.prototype.normalize=function(){var e=this.mag();return 0!==e&&this.mult(1/e),this},l.default.Vector.prototype.limit=function(e){var t=this.magSq();return e*e>>0},n.default.prototype.randomSeed=function(e){this._lcgSetSeed(o,e),this._gaussian_previous=!1},n.default.prototype.random=function(e,t){var r;if(n.default._validateParameters("random",arguments),r=null!=this[o]?this._lcg(o):Math.random(),void 0===e)return r;if(void 0===t)return e instanceof Array?e[Math.floor(r*e.length)]:r*e;if(tf){var P=p,L=l,k=u;p=d+f*(s&&d=t&&(r=r.substring(r.length-t,r.length)),r}},n.default.prototype.unhex=function(e){return e instanceof Array?e.map(n.default.prototype.unhex):parseInt("0x".concat(e),16)};var o=n.default;r.default=o},{"../core/main":49}],90:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i,a=(i=e("../core/main"))&&i.__esModule?i:{default:i};function n(e,t,r){var i=e<0,n=i?e.toString().substring(1):e.toString(),o=n.indexOf("."),a=-1!==o?n.substring(0,o):n,s=-1!==o?n.substring(o+1):"",l=i?"-":"";if(void 0!==r){var u="";(-1!==o||0r&&(s=s.substring(0,r));for(var h=0;hi.length)for(var o=t-(i+=-1===r?".":"").length+1,a=0;a=d.TWO_PI?"".concat("ellipse","|").concat(u,"|"):"".concat("arc","|").concat(a,"|").concat(s,"|").concat(l,"|").concat(u,"|"),!this.geometryInHash(t)){var h=new T.default.Geometry(u,1,function(){if(this.strokeIndices=[],a.toFixed(10)!==s.toFixed(10)){l!==d.PIE&&void 0!==l||(this.vertices.push(new T.default.Vector(.5,.5,0)),this.uvs.push([.5,.5]));for(var e=0;e<=u;e++){var t=(s-a)*(e/u)+a,r=.5+Math.cos(t)/2,i=.5+Math.sin(t)/2;this.vertices.push(new T.default.Vector(r,i,0)),this.uvs.push([r,i]),e>5&31)/31,(y>>10&31)/31):(r=a,i=s,l)}for(var b=1;b<=3;b++){var _=p+12*b,x=new S.default.Vector(u.getFloat32(_,!0),u.getFloat32(8+_,!0),u.getFloat32(4+_,!0));e.vertices.push(x),c&&o.push(r,i,n)}var w=new S.default.Vector(m,g,v);e.vertexNormals.push(w,w,w),e.faces.push([3*d,3*d+1,3*d+2]),e.uvs.push([0,0],[0,0],[0,0])}}(e,t);else{var r=new DataView(t);if(!("TextDecoder"in window))return console.warn("Sorry, ASCII STL loading only works in browsers that support TextDecoder (https://caniuse.com/#feat=textencoder)");var i=new TextDecoder("utf-8").decode(r).split("\n");!function(e,t){for(var r,i,n="",o=[],a=0;aMath.PI?l=Math.PI:l<=0&&(l=.001);var u=Math.sin(l)*a*Math.sin(s),h=Math.cos(l)*a,c=Math.sin(l)*a*Math.cos(s);this.camera(u+this.centerX,h+this.centerY,c+this.centerZ,this.centerX,this.centerY,this.centerZ,0,1,0)},m.default.Camera.prototype._isActive=function(){return this===this._renderer._curCamera},m.default.prototype.setCamera=function(e){this._renderer._curCamera=e,this._renderer.uPMatrix.set(e.projMatrix.mat4[0],e.projMatrix.mat4[1],e.projMatrix.mat4[2],e.projMatrix.mat4[3],e.projMatrix.mat4[4],e.projMatrix.mat4[5],e.projMatrix.mat4[6],e.projMatrix.mat4[7],e.projMatrix.mat4[8],e.projMatrix.mat4[9],e.projMatrix.mat4[10],e.projMatrix.mat4[11],e.projMatrix.mat4[12],e.projMatrix.mat4[13],e.projMatrix.mat4[14],e.projMatrix.mat4[15])};var n=m.default.Camera;r.default=n},{"../core/main":49}],98:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i,h=(i=e("../core/main"))&&i.__esModule?i:{default:i};h.default.Geometry=function(e,t,r){return this.vertices=[],this.lineVertices=[],this.lineNormals=[],this.vertexNormals=[],this.faces=[],this.uvs=[],this.edges=[],this.vertexColors=[],this.detailX=void 0!==e?e:1,this.detailY=void 0!==t?t:1,this.dirtyFlags={},r instanceof Function&&r.call(this),this},h.default.Geometry.prototype.reset=function(){this.lineVertices.length=0,this.lineNormals.length=0,this.vertices.length=0,this.edges.length=0,this.vertexColors.length=0,this.vertexNormals.length=0,this.uvs.length=0,this.dirtyFlags={}},h.default.Geometry.prototype.computeFaces=function(){this.faces.length=0;for(var e,t,r,i,n=this.detailX+1,o=0;othis.vertices.length-1-this.detailX;i--)e.add(this.vertexNormals[i]);e=h.default.Vector.div(e,this.detailX);for(var n=this.vertices.length-1;n>this.vertices.length-1-this.detailX;n--)this.vertexNormals[n]=e;return this},h.default.Geometry.prototype._makeTriangleEdges=function(){if(this.edges.length=0,Array.isArray(this.strokeIndices))for(var e=0,t=this.strokeIndices.length;e vTexCoord.y;\n bool y1 = p1.y > vTexCoord.y;\n bool y2 = p2.y > vTexCoord.y;\n\n // could web be under the curve (after t1)?\n if (y1 ? !y2 : y0) {\n // add the coverage for t1\n coverage.x += saturate(C1.x + 0.5);\n // calculate the anti-aliasing for t1\n weight.x = min(weight.x, abs(C1.x));\n }\n\n // are we outside the curve (after t2)?\n if (y1 ? !y0 : y2) {\n // subtract the coverage for t2\n coverage.x -= saturate(C2.x + 0.5);\n // calculate the anti-aliasing for t2\n weight.x = min(weight.x, abs(C2.x));\n }\n}\n\n// this is essentially the same as coverageX, but with the axes swapped\nvoid coverageY(vec2 p0, vec2 p1, vec2 p2) {\n\n vec2 C1, C2;\n calulateCrossings(p0, p1, p2, C1, C2);\n\n bool x0 = p0.x > vTexCoord.x;\n bool x1 = p1.x > vTexCoord.x;\n bool x2 = p2.x > vTexCoord.x;\n\n if (x1 ? !x2 : x0) {\n coverage.y -= saturate(C1.y + 0.5);\n weight.y = min(weight.y, abs(C1.y));\n }\n\n if (x1 ? !x0 : x2) {\n coverage.y += saturate(C2.y + 0.5);\n weight.y = min(weight.y, abs(C2.y));\n }\n}\n\nvoid main() {\n\n // calculate the pixel scale based on screen-coordinates\n pixelScale = hardness / fwidth(vTexCoord);\n\n // which grid cell is this pixel in?\n ivec2 gridCoord = ifloor(vTexCoord * vec2(uGridSize));\n\n // intersect curves in this row\n {\n // the index into the row info bitmap\n int rowIndex = gridCoord.y + uGridOffset.y;\n // fetch the info texel\n vec4 rowInfo = getTexel(uSamplerRows, rowIndex, uGridImageSize);\n // unpack the rowInfo\n int rowStrokeIndex = getInt16(rowInfo.xy);\n int rowStrokeCount = getInt16(rowInfo.zw);\n\n for (int iRowStroke = INT(0); iRowStroke < N; iRowStroke++) {\n if (iRowStroke >= rowStrokeCount)\n break;\n\n // each stroke is made up of 3 points: the start and control point\n // and the start of the next curve.\n // fetch the indices of this pair of strokes:\n vec4 strokeIndices = getTexel(uSamplerRowStrokes, rowStrokeIndex++, uCellsImageSize);\n\n // unpack the stroke index\n int strokePos = getInt16(strokeIndices.xy);\n\n // fetch the two strokes\n vec4 stroke0 = getTexel(uSamplerStrokes, strokePos + INT(0), uStrokeImageSize);\n vec4 stroke1 = getTexel(uSamplerStrokes, strokePos + INT(1), uStrokeImageSize);\n\n // calculate the coverage\n coverageX(stroke0.xy, stroke0.zw, stroke1.xy);\n }\n }\n\n // intersect curves in this column\n {\n int colIndex = gridCoord.x + uGridOffset.x;\n vec4 colInfo = getTexel(uSamplerCols, colIndex, uGridImageSize);\n int colStrokeIndex = getInt16(colInfo.xy);\n int colStrokeCount = getInt16(colInfo.zw);\n \n for (int iColStroke = INT(0); iColStroke < N; iColStroke++) {\n if (iColStroke >= colStrokeCount)\n break;\n\n vec4 strokeIndices = getTexel(uSamplerColStrokes, colStrokeIndex++, uCellsImageSize);\n\n int strokePos = getInt16(strokeIndices.xy);\n vec4 stroke0 = getTexel(uSamplerStrokes, strokePos + INT(0), uStrokeImageSize);\n vec4 stroke1 = getTexel(uSamplerStrokes, strokePos + INT(1), uStrokeImageSize);\n coverageY(stroke0.xy, stroke0.zw, stroke1.xy);\n }\n }\n\n weight = saturate(1.0 - weight * 2.0);\n float distance = max(weight.x + weight.y, minDistance); // manhattan approx.\n float antialias = abs(dot(coverage, weight) / distance);\n float cover = min(abs(coverage.x), abs(coverage.y));\n gl_FragColor = uMaterialColor;\n gl_FragColor.a *= saturate(max(antialias, cover));\n}",lineVert:"/*\n Part of the Processing project - http://processing.org\n Copyright (c) 2012-15 The Processing Foundation\n Copyright (c) 2004-12 Ben Fry and Casey Reas\n Copyright (c) 2001-04 Massachusetts Institute of Technology\n This library is free software; you can redistribute it and/or\n modify it under the terms of the GNU Lesser General Public\n License as published by the Free Software Foundation, version 2.1.\n This library is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n Lesser General Public License for more details.\n You should have received a copy of the GNU Lesser General\n Public License along with this library; if not, write to the\n Free Software Foundation, Inc., 59 Temple Place, Suite 330,\n Boston, MA 02111-1307 USA\n*/\n\n#define PROCESSING_LINE_SHADER\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform float uStrokeWeight;\n\nuniform vec4 uViewport;\nuniform int uPerspective;\n\nattribute vec4 aPosition;\nattribute vec4 aDirection;\n \nvoid main() {\n // using a scale <1 moves the lines towards the camera\n // in order to prevent popping effects due to half of\n // the line disappearing behind the geometry faces.\n vec3 scale = vec3(0.9995);\n\n vec4 posp = uModelViewMatrix * aPosition;\n vec4 posq = uModelViewMatrix * (aPosition + vec4(aDirection.xyz, 0));\n\n // Moving vertices slightly toward the camera\n // to avoid depth-fighting with the fill triangles.\n // Discussed here:\n // http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Number=252848 \n posp.xyz = posp.xyz * scale;\n posq.xyz = posq.xyz * scale;\n\n vec4 p = uProjectionMatrix * posp;\n vec4 q = uProjectionMatrix * posq;\n\n // formula to convert from clip space (range -1..1) to screen space (range 0..[width or height])\n // screen_p = (p.xy/p.w + <1,1>) * 0.5 * uViewport.zw\n\n // prevent division by W by transforming the tangent formula (div by 0 causes\n // the line to disappear, see https://github.com/processing/processing/issues/5183)\n // t = screen_q - screen_p\n //\n // tangent is normalized and we don't care which aDirection it points to (+-)\n // t = +- normalize( screen_q - screen_p )\n // t = +- normalize( (q.xy/q.w+<1,1>)*0.5*uViewport.zw - (p.xy/p.w+<1,1>)*0.5*uViewport.zw )\n //\n // extract common factor, <1,1> - <1,1> cancels out\n // t = +- normalize( (q.xy/q.w - p.xy/p.w) * 0.5 * uViewport.zw )\n //\n // convert to common divisor\n // t = +- normalize( ((q.xy*p.w - p.xy*q.w) / (p.w*q.w)) * 0.5 * uViewport.zw )\n //\n // remove the common scalar divisor/factor, not needed due to normalize and +-\n // (keep uViewport - can't remove because it has different components for x and y\n // and corrects for aspect ratio, see https://github.com/processing/processing/issues/5181)\n // t = +- normalize( (q.xy*p.w - p.xy*q.w) * uViewport.zw )\n\n vec2 tangent = normalize((q.xy*p.w - p.xy*q.w) * uViewport.zw);\n\n // flip tangent to normal (it's already normalized)\n vec2 normal = vec2(-tangent.y, tangent.x);\n\n float thickness = aDirection.w * uStrokeWeight;\n vec2 offset = normal * thickness / 2.0;\n\n vec2 curPerspScale;\n\n if(uPerspective == 1) {\n // Perspective ---\n // convert from world to clip by multiplying with projection scaling factor\n // to get the right thickness (see https://github.com/processing/processing/issues/5182)\n // invert Y, projections in Processing invert Y\n curPerspScale = (uProjectionMatrix * vec4(1, -1, 0, 0)).xy;\n } else {\n // No Perspective ---\n // multiply by W (to cancel out division by W later in the pipeline) and\n // convert from screen to clip (derived from clip to screen above)\n curPerspScale = p.w / (0.5 * uViewport.zw);\n }\n\n gl_Position.xy = p.xy + offset.xy * curPerspScale;\n gl_Position.zw = p.zw;\n}\n",lineFrag:"precision mediump float;\nprecision mediump int;\n\nuniform vec4 uMaterialColor;\n\nvoid main() {\n gl_FragColor = uMaterialColor;\n}",pointVert:"attribute vec3 aPosition;\nuniform float uPointSize;\nvarying float vStrokeWeight;\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nvoid main() {\n\tvec4 positionVec4 = vec4(aPosition, 1.0);\n\tgl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n\tgl_PointSize = uPointSize;\n\tvStrokeWeight = uPointSize;\n}",pointFrag:"precision mediump float;\nprecision mediump int;\nuniform vec4 uMaterialColor;\nvarying float vStrokeWeight;\n\nvoid main(){\n\tfloat mask = 0.0;\n\n\t// make a circular mask using the gl_PointCoord (goes from 0 - 1 on a point)\n // might be able to get a nicer edge on big strokeweights with smoothstep but slightly less performant\n\n\tmask = step(0.98, length(gl_PointCoord * 2.0 - 1.0));\n\n\t// if strokeWeight is 1 or less lets just draw a square\n\t// this prevents weird artifacting from carving circles when our points are really small\n\t// if strokeWeight is larger than 1, we just use it as is\n\n\tmask = mix(0.0, mask, clamp(floor(vStrokeWeight - 0.5),0.0,1.0));\n\n\t// throw away the borders of the mask\n // otherwise we get weird alpha blending issues\n\n\tif(mask > 0.98){\n discard;\n \t}\n\n \tgl_FragColor = vec4(uMaterialColor.rgb * (1.0 - mask), uMaterialColor.a) ;\n}"};u.default.RendererGL=function(e,t,r,i){return u.default.Renderer.call(this,e,t,r),this._setAttributeDefaults(t),this._initContext(),this.isP3D=!0,this.GL=this.drawingContext,this._isErasing=!1,this._enableLighting=!1,this.ambientLightColors=[],this.specularColors=[1,1,1],this.directionalLightDirections=[],this.directionalLightDiffuseColors=[],this.directionalLightSpecularColors=[],this.pointLightPositions=[],this.pointLightDiffuseColors=[],this.pointLightSpecularColors=[],this.spotLightPositions=[],this.spotLightDirections=[],this.spotLightDiffuseColors=[],this.spotLightSpecularColors=[],this.spotLightAngle=[],this.spotLightConc=[],this.drawMode=o.FILL,this.curFillColor=this._cachedFillStyle=[1,1,1,1],this.curStrokeColor=this._cachedStrokeStyle=[0,0,0,1],this.curBlendMode=o.BLEND,this._cachedBlendMode=void 0,this.blendExt=this.GL.getExtension("EXT_blend_minmax"),this._isBlending=!1,this._useSpecularMaterial=!1,this._useEmissiveMaterial=!1,this._useNormalMaterial=!1,this._useShininess=1,this._tint=[255,255,255,255],this.constantAttenuation=1,this.linearAttenuation=0,this.quadraticAttenuation=0,this.uMVMatrix=new u.default.Matrix,this.uPMatrix=new u.default.Matrix,this.uNMatrix=new u.default.Matrix("mat3"),this._curCamera=new u.default.Camera(this),this._curCamera._computeCameraDefaultSettings(),this._curCamera._setDefaultCamera(),this._defaultLightShader=void 0,this._defaultImmediateModeShader=void 0,this._defaultNormalShader=void 0,this._defaultColorShader=void 0,this._defaultPointShader=void 0,this.userFillShader=void 0,this.userStrokeShader=void 0,this.userPointShader=void 0,this.retainedMode={geometry:{},buffers:{stroke:[new u.default.RenderBuffer(3,"lineVertices","lineVertexBuffer","aPosition",this,this._flatten),new u.default.RenderBuffer(4,"lineNormals","lineNormalBuffer","aDirection",this,this._flatten)],fill:[new u.default.RenderBuffer(3,"vertices","vertexBuffer","aPosition",this,this._vToNArray),new u.default.RenderBuffer(3,"vertexNormals","normalBuffer","aNormal",this,this._vToNArray),new u.default.RenderBuffer(4,"vertexColors","colorBuffer","aMaterialColor",this),new u.default.RenderBuffer(3,"vertexAmbients","ambientBuffer","aAmbientColor",this),new u.default.RenderBuffer(2,"uvs","uvBuffer","aTexCoord",this,this._flatten)],text:[new u.default.RenderBuffer(3,"vertices","vertexBuffer","aPosition",this,this._vToNArray),new u.default.RenderBuffer(2,"uvs","uvBuffer","aTexCoord",this,this._flatten)]}},this.immediateMode={geometry:new u.default.Geometry,shapeMode:o.TRIANGLE_FAN,_bezierVertex:[],_quadraticVertex:[],_curveVertex:[],buffers:{fill:[new u.default.RenderBuffer(3,"vertices","vertexBuffer","aPosition",this,this._vToNArray),new u.default.RenderBuffer(3,"vertexNormals","normalBuffer","aNormal",this,this._vToNArray),new u.default.RenderBuffer(4,"vertexColors","colorBuffer","aVertexColor",this),new u.default.RenderBuffer(3,"vertexAmbients","ambientBuffer","aAmbientColor",this),new u.default.RenderBuffer(2,"uvs","uvBuffer","aTexCoord",this,this._flatten)],stroke:[new u.default.RenderBuffer(3,"lineVertices","lineVertexBuffer","aPosition",this,this._flatten),new u.default.RenderBuffer(4,"lineNormals","lineNormalBuffer","aDirection",this,this._flatten)],point:this.GL.createBuffer()}},this.pointSize=5,this.curStrokeWeight=1,this.textures=[],this.textureMode=o.IMAGE,this.textureWrapX=o.CLAMP,this.textureWrapY=o.CLAMP,this._tex=null,this._curveTightness=6,this._lookUpTableBezier=[],this._lookUpTableQuadratic=[],this._lutBezierDetail=0,this._lutQuadraticDetail=0,this._tessy=this._initTessy(),this.fontInfos={},this._curShader=void 0,this},u.default.RendererGL.prototype=Object.create(u.default.Renderer.prototype),u.default.RendererGL.prototype._setAttributeDefaults=function(e){var t={alpha:!0,depth:!0,stencil:!0,antialias:navigator.userAgent.toLowerCase().includes("safari"),premultipliedAlpha:!1,preserveDrawingBuffer:!0,perPixelLighting:!0};null===e._glAttributes?e._glAttributes=t:e._glAttributes=Object.assign(t,e._glAttributes)},u.default.RendererGL.prototype._initContext=function(){try{if(this.drawingContext=this.canvas.getContext("webgl",this._pInst._glAttributes)||this.canvas.getContext("experimental-webgl",this._pInst._glAttributes),null===this.drawingContext)throw new Error("Error creating webgl context");var e=this.drawingContext;e.enable(e.DEPTH_TEST),e.depthFunc(e.LEQUAL),e.viewport(0,0,e.drawingBufferWidth,e.drawingBufferHeight),this._viewport=this.drawingContext.getParameter(this.drawingContext.VIEWPORT)}catch(e){throw e}},u.default.RendererGL.prototype._resetContext=function(e,t){var r=this.width,i=this.height,n=this.canvas.id,o=this._pInst instanceof u.default.Graphics;if(o){var a=this._pInst;a.canvas.parentNode.removeChild(a.canvas),a.canvas=document.createElement("canvas"),(a._pInst._userNode||document.body).appendChild(a.canvas),u.default.Element.call(a,a.canvas,a._pInst),a.width=r,a.height=i}else{var s=this.canvas;s&&s.parentNode.removeChild(s),(s=document.createElement("canvas")).id=n,this._pInst._userNode?this._pInst._userNode.appendChild(s):document.body.appendChild(s),this._pInst.canvas=s}var l=new u.default.RendererGL(this._pInst.canvas,this._pInst,!o);this._pInst._setProperty("_renderer",l),l.resize(r,i),l._applyDefaults(),o||this._pInst._elements.push(l),"function"==typeof t&&setTimeout(function(){t.apply(window._renderer,e)},0)},u.default.prototype.setAttributes=function(e,t){if(void 0!==this._glAttributes){var r=!0;if(void 0!==t?(null===this._glAttributes&&(this._glAttributes={}),this._glAttributes[e]!==t&&(this._glAttributes[e]=t,r=!1)):e instanceof Object&&this._glAttributes!==e&&(this._glAttributes=e,r=!1),this._renderer.isP3D&&!r){if(!this._setupDone)for(var i in this._renderer.retainedMode.geometry)if(this._renderer.retainedMode.geometry.hasOwnProperty(i))return void console.error("Sorry, Could not set the attributes, you need to call setAttributes() before calling the other drawing methods in setup()");this.push(),this._renderer._resetContext(),this.pop(),this._renderer._curCamera&&(this._renderer._curCamera._renderer=this._renderer)}}else console.log("You are trying to use setAttributes on a p5.Graphics object that does not use a WEBGL renderer.")},u.default.RendererGL.prototype._update=function(){this.uMVMatrix.set(this._curCamera.cameraMatrix.mat4[0],this._curCamera.cameraMatrix.mat4[1],this._curCamera.cameraMatrix.mat4[2],this._curCamera.cameraMatrix.mat4[3],this._curCamera.cameraMatrix.mat4[4],this._curCamera.cameraMatrix.mat4[5],this._curCamera.cameraMatrix.mat4[6],this._curCamera.cameraMatrix.mat4[7],this._curCamera.cameraMatrix.mat4[8],this._curCamera.cameraMatrix.mat4[9],this._curCamera.cameraMatrix.mat4[10],this._curCamera.cameraMatrix.mat4[11],this._curCamera.cameraMatrix.mat4[12],this._curCamera.cameraMatrix.mat4[13],this._curCamera.cameraMatrix.mat4[14],this._curCamera.cameraMatrix.mat4[15]),this.ambientLightColors.length=0,this.specularColors=[1,1,1],this.directionalLightDirections.length=0,this.directionalLightDiffuseColors.length=0,this.directionalLightSpecularColors.length=0,this.pointLightPositions.length=0,this.pointLightDiffuseColors.length=0,this.pointLightSpecularColors.length=0,this.spotLightPositions.length=0,this.spotLightDirections.length=0,this.spotLightDiffuseColors.length=0,this.spotLightSpecularColors.length=0,this.spotLightAngle.length=0,this.spotLightConc.length=0,this._enableLighting=!1,this._tint=[255,255,255,255],this.GL.clear(this.GL.DEPTH_BUFFER_BIT)},u.default.RendererGL.prototype.background=function(){var e,t=(e=this._pInst).color.apply(e,arguments),r=t.levels[0]/255,i=t.levels[1]/255,n=t.levels[2]/255,o=t.levels[3]/255;this.GL.clearColor(r,i,n,o),this.GL.clear(this.GL.COLOR_BUFFER_BIT)},u.default.RendererGL.prototype.fill=function(e,t,r,i){var n=u.default.prototype.color.apply(this._pInst,arguments);this.curFillColor=n._array,this.drawMode=o.FILL,this._useNormalMaterial=!1,this._tex=null},u.default.RendererGL.prototype.stroke=function(e,t,r,i){arguments[3]=255;var n=u.default.prototype.color.apply(this._pInst,arguments);this.curStrokeColor=n._array},u.default.RendererGL.prototype.strokeCap=function(e){console.error("Sorry, strokeCap() is not yet implemented in WEBGL mode")},u.default.RendererGL.prototype.strokeJoin=function(e){console.error("Sorry, strokeJoin() is not yet implemented in WEBGL mode")},u.default.RendererGL.prototype.filter=function(e){console.error("filter() does not work in WEBGL mode")},u.default.RendererGL.prototype.blendMode=function(e){e===o.DARKEST||e===o.LIGHTEST||e===o.ADD||e===o.BLEND||e===o.SUBTRACT||e===o.SCREEN||e===o.EXCLUSION||e===o.REPLACE||e===o.MULTIPLY||e===o.REMOVE?this.curBlendMode=e:e!==o.BURN&&e!==o.OVERLAY&&e!==o.HARD_LIGHT&&e!==o.SOFT_LIGHT&&e!==o.DODGE||console.warn("BURN, OVERLAY, HARD_LIGHT, SOFT_LIGHT, and DODGE only work for blendMode in 2D mode.")},u.default.RendererGL.prototype.erase=function(e,t){this._isErasing||(this._cachedBlendMode=this.curBlendMode,this.blendMode(o.REMOVE),this._cachedFillStyle=this.curFillColor.slice(),this.curFillColor=[1,1,1,e/255],this._cachedStrokeStyle=this.curStrokeColor.slice(),this.curStrokeColor=[1,1,1,t/255],this._isErasing=!0)},u.default.RendererGL.prototype.noErase=function(){this._isErasing&&(this.curFillColor=this._cachedFillStyle.slice(),this.curStrokeColor=this._cachedStrokeStyle.slice(),this.blendMode(this._cachedBlendMode),this._isErasing=!1)},u.default.RendererGL.prototype.strokeWeight=function(e){this.curStrokeWeight!==e&&(this.pointSize=e,this.curStrokeWeight=e)},u.default.RendererGL.prototype._getPixel=function(e,t){var r;return r=new Uint8Array(4),this.drawingContext.readPixels(e,t,1,1,this.drawingContext.RGBA,this.drawingContext.UNSIGNED_BYTE,r),[r[0],r[1],r[2],r[3]]},u.default.RendererGL.prototype.loadPixels=function(){var e=this._pixelsState;if(!0===this._pInst._glAttributes.preserveDrawingBuffer){var t=e.pixels,r=this.GL.drawingBufferWidth*this.GL.drawingBufferHeight*4;t instanceof Uint8Array&&t.length===r||(t=new Uint8Array(r),this._pixelsState._setProperty("pixels",t));var i=this._pInst._pixelDensity;this.GL.readPixels(0,0,this.width*i,this.height*i,this.GL.RGBA,this.GL.UNSIGNED_BYTE,t)}else console.log("loadPixels only works in WebGL when preserveDrawingBuffer is true.")},u.default.RendererGL.prototype.geometryInHash=function(e){return void 0!==this.retainedMode.geometry[e]},u.default.RendererGL.prototype.resize=function(e,t){u.default.Renderer.prototype.resize.call(this,e,t),this.GL.viewport(0,0,this.GL.drawingBufferWidth,this.GL.drawingBufferHeight),this._viewport=this.GL.getParameter(this.GL.VIEWPORT),this._curCamera._resize();var r=this._pixelsState;void 0!==r.pixels&&r._setProperty("pixels",new Uint8Array(this.GL.drawingBufferWidth*this.GL.drawingBufferHeight*4))},u.default.RendererGL.prototype.clear=function(){var e=(arguments.length<=0?void 0:arguments[0])||0,t=(arguments.length<=1?void 0:arguments[1])||0,r=(arguments.length<=2?void 0:arguments[2])||0,i=(arguments.length<=3?void 0:arguments[3])||0;this.GL.clearColor(e,t,r,i),this.GL.clear(this.GL.COLOR_BUFFER_BIT|this.GL.DEPTH_BUFFER_BIT)},u.default.RendererGL.prototype.applyMatrix=function(e,t,r,i,n,o){16===arguments.length?u.default.Matrix.prototype.apply.apply(this.uMVMatrix,arguments):this.uMVMatrix.apply([e,t,0,0,r,i,0,0,0,0,1,0,n,o,0,1])},u.default.RendererGL.prototype.translate=function(e,t,r){return e instanceof u.default.Vector&&(r=e.z,t=e.y,e=e.x),this.uMVMatrix.translate([e,t,r]),this},u.default.RendererGL.prototype.scale=function(e,t,r){return this.uMVMatrix.scale(e,t,r),this},u.default.RendererGL.prototype.rotate=function(e,t){return void 0===t?this.rotateZ(e):(u.default.Matrix.prototype.rotate.apply(this.uMVMatrix,arguments),this)},u.default.RendererGL.prototype.rotateX=function(e){return this.rotate(e,1,0,0),this},u.default.RendererGL.prototype.rotateY=function(e){return this.rotate(e,0,1,0),this},u.default.RendererGL.prototype.rotateZ=function(e){return this.rotate(e,0,0,1),this},u.default.RendererGL.prototype.push=function(){var e=u.default.Renderer.prototype.push.apply(this),t=e.properties;return t.uMVMatrix=this.uMVMatrix.copy(),t.uPMatrix=this.uPMatrix.copy(),t._curCamera=this._curCamera,this._curCamera=this._curCamera.copy(),t.ambientLightColors=this.ambientLightColors.slice(),t.specularColors=this.specularColors.slice(),t.directionalLightDirections=this.directionalLightDirections.slice(),t.directionalLightDiffuseColors=this.directionalLightDiffuseColors.slice(),t.directionalLightSpecularColors=this.directionalLightSpecularColors.slice(),t.pointLightPositions=this.pointLightPositions.slice(),t.pointLightDiffuseColors=this.pointLightDiffuseColors.slice(),t.pointLightSpecularColors=this.pointLightSpecularColors.slice(),t.spotLightPositions=this.spotLightPositions.slice(),t.spotLightDirections=this.spotLightDirections.slice(),t.spotLightDiffuseColors=this.spotLightDiffuseColors.slice(),t.spotLightSpecularColors=this.spotLightSpecularColors.slice(),t.spotLightAngle=this.spotLightAngle.slice(),t.spotLightConc=this.spotLightConc.slice(),t.userFillShader=this.userFillShader,t.userStrokeShader=this.userStrokeShader,t.userPointShader=this.userPointShader,t.pointSize=this.pointSize,t.curStrokeWeight=this.curStrokeWeight,t.curStrokeColor=this.curStrokeColor,t.curFillColor=this.curFillColor,t._useSpecularMaterial=this._useSpecularMaterial,t._useEmissiveMaterial=this._useEmissiveMaterial,t._useShininess=this._useShininess,t.constantAttenuation=this.constantAttenuation,t.linearAttenuation=this.linearAttenuation,t.quadraticAttenuation=this.quadraticAttenuation,t._enableLighting=this._enableLighting,t._useNormalMaterial=this._useNormalMaterial,t._tex=this._tex,t.drawMode=this.drawMode,e},u.default.RendererGL.prototype.resetMatrix=function(){return this.uMVMatrix=u.default.Matrix.identity(this._pInst),this},u.default.RendererGL.prototype._getImmediateStrokeShader=function(){var e=this.userStrokeShader;return e&&e.isStrokeShader()?e:this._getLineShader()},u.default.RendererGL.prototype._getRetainedStrokeShader=u.default.RendererGL.prototype._getImmediateStrokeShader,u.default.RendererGL.prototype._getImmediateFillShader=function(){var e=this.userFillShader;if(this._useNormalMaterial&&(!e||!e.isNormalShader()))return this._getNormalShader();if(this._enableLighting){if(!e||!e.isLightShader())return this._getLightShader()}else if(this._tex){if(!e||!e.isTextureShader())return this._getLightShader()}else if(!e)return this._getImmediateModeShader();return e},u.default.RendererGL.prototype._getRetainedFillShader=function(){if(this._useNormalMaterial)return this._getNormalShader();var e=this.userFillShader;if(this._enableLighting){if(!e||!e.isLightShader())return this._getLightShader()}else if(this._tex){if(!e||!e.isTextureShader())return this._getLightShader()}else if(!e)return this._getColorShader();return e},u.default.RendererGL.prototype._getImmediatePointShader=function(){var e=this.userPointShader;return e&&e.isPointShader()?e:this._getPointShader()},u.default.RendererGL.prototype._getRetainedLineShader=u.default.RendererGL.prototype._getImmediateLineShader,u.default.RendererGL.prototype._getLightShader=function(){return this._defaultLightShader||(this._pInst._glAttributes.perPixelLighting?this._defaultLightShader=new u.default.Shader(this,c.phongVert,c.phongFrag):this._defaultLightShader=new u.default.Shader(this,c.lightVert,c.lightTextureFrag)),this._defaultLightShader},u.default.RendererGL.prototype._getImmediateModeShader=function(){return this._defaultImmediateModeShader||(this._defaultImmediateModeShader=new u.default.Shader(this,c.immediateVert,c.vertexColorFrag)),this._defaultImmediateModeShader},u.default.RendererGL.prototype._getNormalShader=function(){return this._defaultNormalShader||(this._defaultNormalShader=new u.default.Shader(this,c.normalVert,c.normalFrag)),this._defaultNormalShader},u.default.RendererGL.prototype._getColorShader=function(){return this._defaultColorShader||(this._defaultColorShader=new u.default.Shader(this,c.normalVert,c.basicFrag)),this._defaultColorShader},u.default.RendererGL.prototype._getPointShader=function(){return this._defaultPointShader||(this._defaultPointShader=new u.default.Shader(this,c.pointVert,c.pointFrag)),this._defaultPointShader},u.default.RendererGL.prototype._getLineShader=function(){return this._defaultLineShader||(this._defaultLineShader=new u.default.Shader(this,c.lineVert,c.lineFrag)),this._defaultLineShader},u.default.RendererGL.prototype._getFontShader=function(){return this._defaultFontShader||(this.GL.getExtension("OES_standard_derivatives"),this._defaultFontShader=new u.default.Shader(this,c.fontVert,c.fontFrag)),this._defaultFontShader},u.default.RendererGL.prototype._getEmptyTexture=function(){if(!this._emptyTexture){var e=new u.default.Image(1,1);e.set(0,0,255),this._emptyTexture=new u.default.Texture(this,e)}return this._emptyTexture},u.default.RendererGL.prototype.getTexture=function(e){var t=this.textures,r=!0,i=!1,n=void 0;try{for(var o,a=t[Symbol.iterator]();!(r=(o=a.next()).done);r=!0){var s=o.value;if(s.src===e)return s}}catch(e){i=!0,n=e}finally{try{r||null==a.return||a.return()}finally{if(i)throw n}}var l=new u.default.Texture(this,e);return t.push(l),l},u.default.RendererGL.prototype._setStrokeUniforms=function(e){e.bindShader(),e.setUniform("uMaterialColor",this.curStrokeColor),e.setUniform("uStrokeWeight",this.curStrokeWeight)},u.default.RendererGL.prototype._setFillUniforms=function(e){e.bindShader(),e.setUniform("uMaterialColor",this.curFillColor),e.setUniform("isTexture",!!this._tex),this._tex&&e.setUniform("uSampler",this._tex),e.setUniform("uTint",this._tint),e.setUniform("uSpecular",this._useSpecularMaterial),e.setUniform("uEmissive",this._useEmissiveMaterial),e.setUniform("uShininess",this._useShininess),e.setUniform("uUseLighting",this._enableLighting);var t=this.pointLightDiffuseColors.length/3;e.setUniform("uPointLightCount",t),e.setUniform("uPointLightLocation",this.pointLightPositions),e.setUniform("uPointLightDiffuseColors",this.pointLightDiffuseColors),e.setUniform("uPointLightSpecularColors",this.pointLightSpecularColors);var r=this.directionalLightDiffuseColors.length/3;e.setUniform("uDirectionalLightCount",r),e.setUniform("uLightingDirection",this.directionalLightDirections),e.setUniform("uDirectionalDiffuseColors",this.directionalLightDiffuseColors),e.setUniform("uDirectionalSpecularColors",this.directionalLightSpecularColors);var i=this.ambientLightColors.length/3;e.setUniform("uAmbientLightCount",i),e.setUniform("uAmbientColor",this.ambientLightColors);var n=this.spotLightDiffuseColors.length/3;e.setUniform("uSpotLightCount",n),e.setUniform("uSpotLightAngle",this.spotLightAngle),e.setUniform("uSpotLightConc",this.spotLightConc),e.setUniform("uSpotLightDiffuseColors",this.spotLightDiffuseColors),e.setUniform("uSpotLightSpecularColors",this.spotLightSpecularColors),e.setUniform("uSpotLightLocation",this.spotLightPositions),e.setUniform("uSpotLightDirection",this.spotLightDirections),e.setUniform("uConstantAttenuation",this.constantAttenuation),e.setUniform("uLinearAttenuation",this.linearAttenuation),e.setUniform("uQuadraticAttenuation",this.quadraticAttenuation),e.bindTextures()},u.default.RendererGL.prototype._setPointUniforms=function(e){e.bindShader(),e.setUniform("uMaterialColor",this.curStrokeColor),e.setUniform("uPointSize",this.pointSize)},u.default.RendererGL.prototype._bindBuffer=function(e,t,r,i,n){if(t=t||this.GL.ARRAY_BUFFER,this.GL.bindBuffer(t,e),void 0!==r){var o=new(i||Float32Array)(r);this.GL.bufferData(t,o,n||this.GL.STATIC_DRAW)}},u.default.RendererGL.prototype._arraysEqual=function(e,t){var r=e.length;if(r!==t.length)return!1;for(var i=0;i>7,127&f,c>>7,127&c);for(var d=0;d>7,127&p,0,0)}}return{cellImageInfo:l,dimOffset:o,dimImageInfo:n}}return(t=this.glyphInfos[e.index]={glyph:e,uGlyphRect:[i.x1,-i.y1,i.x2,-i.y2],strokeImageInfo:U,strokes:d,colInfo:G(m,this.colDimImageInfos,this.colCellImageInfos),rowInfo:G(p,this.rowDimImageInfos,this.rowCellImageInfos)}).uGridOffset=[t.colInfo.dimOffset,t.rowInfo.dimOffset],t}}var z=Math.sqrt(3);j.default.RendererGL.prototype._renderText=function(e,t,r,i,n){if(this._textFont&&"string"!=typeof this._textFont){if(!(n<=i)&&this._doFill){if(!this._isOpenType())return console.log("WEBGL: only Opentype (.otf) and Truetype (.ttf) fonts are supported"),e;e.push();var o=this._doStroke,a=this.drawMode;this._doStroke=!1,this.drawMode=D.TEXTURE;var s=this._textFont.font,l=this._textFont._fontInfo;l=l||(this._textFont._fontInfo=new A(s));var u=this._textFont._handleAlignment(this,t,r,i),h=this._textSize/s.unitsPerEm;this.translate(u.x,u.y,0),this.scale(h,h,1);var c=this.GL,f=!this._defaultFontShader,d=this._getFontShader();d.init(),d.bindShader(),f&&(d.setUniform("uGridImageSize",[64,64]),d.setUniform("uCellsImageSize",[64,64]),d.setUniform("uStrokeImageSize",[64,64]),d.setUniform("uGridSize",[9,9])),this._applyColorBlend(this.curFillColor);var p=this.retainedMode.geometry.glyph;if(!p){var m=this._textGeom=new j.default.Geometry(1,1,function(){for(var e=0;e<=1;e++)for(var t=0;t<=1;t++)this.vertices.push(new j.default.Vector(t,e,0)),this.uvs.push(t,e)});m.computeFaces().computeNormals(),p=this.createBuffers("glyph",m)}var g=!0,v=!1,y=void 0;try{for(var b,_=this.retainedMode.buffers.text[Symbol.iterator]();!(g=(b=_.next()).done);g=!0){b.value._prepareBuffer(p,d)}}catch(e){v=!0,y=e}finally{try{g||null==_.return||_.return()}finally{if(v)throw y}}this._bindBuffer(p.indexBuffer,c.ELEMENT_ARRAY_BUFFER),d.setUniform("uMaterialColor",this.curFillColor);try{var x=0,w=null,S=s.stringToGlyphs(t),M=!0,E=!1,T=void 0;try{for(var C,P=S[Symbol.iterator]();!(M=(C=P.next()).done);M=!0){var L=C.value;w&&(x+=s.getKerningValue(w,L));var k=l.getGlyphInfo(L);if(k.uGlyphRect){var R=k.rowInfo,O=k.colInfo;d.setUniform("uSamplerStrokes",k.strokeImageInfo.imageData),d.setUniform("uSamplerRowStrokes",R.cellImageInfo.imageData),d.setUniform("uSamplerRows",R.dimImageInfo.imageData),d.setUniform("uSamplerColStrokes",O.cellImageInfo.imageData),d.setUniform("uSamplerCols",O.dimImageInfo.imageData),d.setUniform("uGridOffset",k.uGridOffset),d.setUniform("uGlyphRect",k.uGlyphRect),d.setUniform("uGlyphOffset",x),d.bindTextures(),c.drawElements(c.TRIANGLES,6,this.GL.UNSIGNED_SHORT,0)}x+=L.advanceWidth,w=L}}catch(e){E=!0,T=e}finally{try{M||null==P.return||P.return()}finally{if(E)throw T}}}finally{d.unbindShader(),this._doStroke=o,this.drawMode=a,e.pop()}return e}}else console.log("WEBGL: you must load and set a font before drawing text. See `loadFont` and `textFont` for more details.")}},{"../core/constants":42,"../core/main":49,"./p5.RendererGL.Retained":102,"./p5.Shader":104}],107:[function(e,t,r){t.exports={fes:{autoplay:"The media that tried to play (with '{{src}}') wasn't allowed to by this browser, most likely due to the browser's autoplay policy. Check out {{link}} for more information about why.",fileLoadError:{bytes:"It looks like there was a problem loading your file. {{suggestion}}",font:"It looks like there was a problem loading your font. {{suggestion}}",gif:"There was some trouble loading your GIF. Make sure that your GIF is using 87a or 89a encoding.",image:"It looks like there was a problem loading your image. {{suggestion}}",json:"It looks like there was a problem loading your JSON file. {{suggestion}}",large:"If your large file isn't fetched successfully, we recommend splitting the file into smaller segments and fetching those.",strings:"It looks like there was a problem loading your text file. {{suggestion}}",suggestion:"Try checking if the file path ({{filePath}}) is correct, hosting the file online, or running a local server. (More info at {{link}})",table:"It looks like there was a problem loading your table file. {{suggestion}}",xml:"It looks like there was a problem loading your XML file. {{suggestion}}"},misusedTopLevel:"Did you just try to use p5.js's {{symbolName}} {{symbolType}}? If so, you may want to move it into your sketch's setup() function.\n\nFor more details, see: {{link}}",pre:"🌸 p5.js says: {{message}}",welcome:"Welcome! This is your friendly debugger. To turn me off, switch to using p5.min.js."}}},{}],108:[function(e,t,r){t.exports={fes:{autoplay:"Su browser impidío un medio tocar (de '{{src}}'), posiblemente porque las reglas de autoplay. Para aprender más, visite {{link}}.",fileLoadError:{bytes:"",font:"",gif:"",image:"",json:"",large:"",strings:"",suggestion:"",table:"",xml:""},misusedTopLevel:"",pre:"🌸 p5.js dice: {{message}}",welcome:""}}},{}],109:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i=o(e("./en/translation")),n=o(e("./es/translation"));function o(e){return e&&e.__esModule?e:{default:e}}var a={en:{translation:i.default},es:{translation:n.default}};r.default=a},{"./en/translation":107,"./es/translation":108}]},{},[37])(37)}); ================================================ FILE: docs/examples/pyodide/sketch_005/target/target_sketch.js ================================================ const wrapperContent = ` class PythonFunctions: pass setattr(PythonFunctions, 'map', map) setattr(PythonFunctions, 'filter', filter) setattr(PythonFunctions, 'set', set) _P5_INSTANCE = None _CTX_MIDDLE = None _DEFAULT_FILL = None _DEFAULT_LEADMULT = None _DEFAULT_STROKE = None _DEFAULT_TEXT_FILL = None ADD = None ALT = None ARROW = None AUDIO = None AUTO = None AXES = None BACKSPACE = None BASELINE = None BEVEL = None BEZIER = None BLEND = None BLUR = None BOLD = None BOLDITALIC = None BOTTOM = None BURN = None CENTER = None CHORD = None CLAMP = None CLOSE = None CONTROL = None CORNER = None CORNERS = None CROSS = None CURVE = None DARKEST = None DEG_TO_RAD = None DEGREES = None DELETE = None DIFFERENCE = None DILATE = None DODGE = None DOWN_ARROW = None ENTER = None ERODE = None ESCAPE = None EXCLUSION = None FILL = None GRAY = None GRID = None HALF_PI = None HAND = None HARD_LIGHT = None HSB = None HSL = None IMAGE = None IMMEDIATE = None INVERT = None ITALIC = None LANDSCAPE = None LEFT = None LEFT_ARROW = None LIGHTEST = None LINE_LOOP = None LINE_STRIP = None LINEAR = None LINES = None MIRROR = None MITER = None MOVE = None MULTIPLY = None NEAREST = None NORMAL = None OPAQUE = None OPEN = None OPTION = None OVERLAY = None PI = None PIE = None POINTS = None PORTRAIT = None POSTERIZE = None PROJECT = None QUAD_STRIP = None QUADRATIC = None QUADS = None QUARTER_PI = None RAD_TO_DEG = None RADIANS = None RADIUS = None REPEAT = None REPLACE = None RETURN = None RGB = None RIGHT = None RIGHT_ARROW = None ROUND = None SCREEN = None SHIFT = None SOFT_LIGHT = None SQUARE = None STROKE = None SUBTRACT = None TAB = None TAU = None TEXT = None TEXTURE = None THRESHOLD = None TOP = None TRIANGLE_FAN = None TRIANGLE_STRIP = None TRIANGLES = None TWO_PI = None UP_ARROW = None VIDEO = None WAIT = None WEBGL = None P2D = None PI = None frameCount = None focused = None displayWidth = None displayHeight = None windowWidth = None windowHeight = None width = None height = None deviceOrientation = None accelerationX = None accelerationY = None accelerationZ = None pAccelerationX = None pAccelerationY = None pAccelerationZ = None rotationX = None rotationY = None rotationZ = None pRotationX = None pRotationY = None pRotationZ = None turnAxis = None keyIsPressed = None key = None keyCode = None mouseX = None mouseY = None pmouseX = None pmouseY = None winMouseX = None winMouseY = None pwinMouseX = None pwinMouseY = None mouseButton = None mouseIsPressed = None touches = None pixels = None def alpha(*args): return _P5_INSTANCE.alpha(*args) def blue(*args): return _P5_INSTANCE.blue(*args) def brightness(*args): return _P5_INSTANCE.brightness(*args) def color(*args): return _P5_INSTANCE.color(*args) def green(*args): return _P5_INSTANCE.green(*args) def hue(*args): return _P5_INSTANCE.hue(*args) def lerpColor(*args): return _P5_INSTANCE.lerpColor(*args) def lightness(*args): return _P5_INSTANCE.lightness(*args) def red(*args): return _P5_INSTANCE.red(*args) def saturation(*args): return _P5_INSTANCE.saturation(*args) def background(*args): return _P5_INSTANCE.background(*args) def clear(*args): p5_clear = _P5_INSTANCE.clear(*args) return p5_clear def erase(*args): return _P5_INSTANCE.erase(*args) def noErase(*args): return _P5_INSTANCE.noErase(*args) def colorMode(*args): return _P5_INSTANCE.colorMode(*args) def fill(*args): return _P5_INSTANCE.fill(*args) def noFill(*args): return _P5_INSTANCE.noFill(*args) def noStroke(*args): return _P5_INSTANCE.noStroke(*args) def stroke(*args): return _P5_INSTANCE.stroke(*args) def arc(*args): return _P5_INSTANCE.arc(*args) def ellipse(*args): return _P5_INSTANCE.ellipse(*args) def circle(*args): return _P5_INSTANCE.circle(*args) def line(*args): return _P5_INSTANCE.line(*args) def point(*args): return _P5_INSTANCE.point(*args) def quad(*args): return _P5_INSTANCE.quad(*args) def rect(*args): return _P5_INSTANCE.rect(*args) def square(*args): return _P5_INSTANCE.square(*args) def triangle(*args): return _P5_INSTANCE.triangle(*args) def plane(*args): return _P5_INSTANCE.plane(*args) def box(*args): return _P5_INSTANCE.box(*args) def sphere(*args): return _P5_INSTANCE.sphere(*args) def cylinder(*args): return _P5_INSTANCE.cylinder(*args) def cone(*args): return _P5_INSTANCE.cone(*args) def ellipsoid(*args): return _P5_INSTANCE.ellipsoid(*args) def torus(*args): return _P5_INSTANCE.torus(*args) def loadModel(*args): return _P5_INSTANCE.loadModel(*args) def model(*args): return _P5_INSTANCE.model(*args) def ellipseMode(*args): return _P5_INSTANCE.ellipseMode(*args) def noSmooth(*args): return _P5_INSTANCE.noSmooth(*args) def rectMode(*args): return _P5_INSTANCE.rectMode(*args) def smooth(*args): return _P5_INSTANCE.smooth(*args) def strokeCap(*args): return _P5_INSTANCE.strokeCap(*args) def strokeJoin(*args): return _P5_INSTANCE.strokeJoin(*args) def strokeWeight(*args): return _P5_INSTANCE.strokeWeight(*args) def bezier(*args): return _P5_INSTANCE.bezier(*args) def bezierDetail(*args): return _P5_INSTANCE.bezierDetail(*args) def bezierPoint(*args): return _P5_INSTANCE.bezierPoint(*args) def bezierTangent(*args): return _P5_INSTANCE.bezierTangent(*args) def curve(*args): return _P5_INSTANCE.curve(*args) def curveDetail(*args): return _P5_INSTANCE.curveDetail(*args) def curveTightness(*args): return _P5_INSTANCE.curveTightness(*args) def curvePoint(*args): return _P5_INSTANCE.curvePoint(*args) def curveTangent(*args): return _P5_INSTANCE.curveTangent(*args) def beginContour(*args): return _P5_INSTANCE.beginContour(*args) def beginShape(*args): return _P5_INSTANCE.beginShape(*args) def bezierVertex(*args): return _P5_INSTANCE.bezierVertex(*args) def curveVertex(*args): return _P5_INSTANCE.curveVertex(*args) def endContour(*args): return _P5_INSTANCE.endContour(*args) def endShape(*args): return _P5_INSTANCE.endShape(*args) def quadraticVertex(*args): return _P5_INSTANCE.quadraticVertex(*args) def vertex(*args): return _P5_INSTANCE.vertex(*args) def cursor(*args): return _P5_INSTANCE.cursor(*args) def frameRate(*args): return _P5_INSTANCE.frameRate(*args) def noCursor(*args): return _P5_INSTANCE.noCursor(*args) def fullscreen(*args): return _P5_INSTANCE.fullscreen(*args) def pixelDensity(*args): return _P5_INSTANCE.pixelDensity(*args) def displayDensity(*args): return _P5_INSTANCE.displayDensity(*args) def getURL(*args): return _P5_INSTANCE.getURL(*args) def getURLPath(*args): return _P5_INSTANCE.getURLPath(*args) def getURLParams(*args): return _P5_INSTANCE.getURLParams(*args) def remove(*args): return _P5_INSTANCE.remove(*args) def noLoop(*args): return _P5_INSTANCE.noLoop(*args) def loop(*args): return _P5_INSTANCE.loop(*args) def push(*args): return _P5_INSTANCE.push(*args) def redraw(*args): return _P5_INSTANCE.redraw(*args) def resizeCanvas(*args): return _P5_INSTANCE.resizeCanvas(*args) def noCanvas(*args): return _P5_INSTANCE.noCanvas(*args) def createGraphics(*args): return _P5_INSTANCE.createGraphics(*args) def blendMode(*args): return _P5_INSTANCE.blendMode(*args) def setAttributes(*args): return _P5_INSTANCE.setAttributes(*args) def applyMatrix(*args): return _P5_INSTANCE.applyMatrix(*args) def resetMatrix(*args): return _P5_INSTANCE.resetMatrix(*args) def rotate(*args): return _P5_INSTANCE.rotate(*args) def rotateX(*args): return _P5_INSTANCE.rotateX(*args) def rotateY(*args): return _P5_INSTANCE.rotateY(*args) def rotateZ(*args): return _P5_INSTANCE.rotateZ(*args) def scale(*args): return _P5_INSTANCE.scale(*args) def shearX(*args): return _P5_INSTANCE.shearX(*args) def shearY(*args): return _P5_INSTANCE.shearY(*args) def translate(*args): return _P5_INSTANCE.translate(*args) def createStringDict(*args): return _P5_INSTANCE.createStringDict(*args) def createNumberDict(*args): return _P5_INSTANCE.createNumberDict(*args) def append(*args): return _P5_INSTANCE.append(*args) def arrayCopy(*args): return _P5_INSTANCE.arrayCopy(*args) def concat(*args): return _P5_INSTANCE.concat(*args) def reverse(*args): return _P5_INSTANCE.reverse(*args) def shorten(*args): return _P5_INSTANCE.shorten(*args) def shuffle(*args): return _P5_INSTANCE.shuffle(*args) def sort(*args): return _P5_INSTANCE.sort(*args) def splice(*args): return _P5_INSTANCE.splice(*args) def subset(*args): return _P5_INSTANCE.subset(*args) def float(*args): return _P5_INSTANCE.float(*args) def int(*args): return _P5_INSTANCE.int(*args) def str(*args): return _P5_INSTANCE.str(*args) def boolean(*args): return _P5_INSTANCE.boolean(*args) def byte(*args): return _P5_INSTANCE.byte(*args) def char(*args): return _P5_INSTANCE.char(*args) def unchar(*args): return _P5_INSTANCE.unchar(*args) def hex(*args): return _P5_INSTANCE.hex(*args) def unhex(*args): return _P5_INSTANCE.unhex(*args) def join(*args): return _P5_INSTANCE.join(*args) def match(*args): return _P5_INSTANCE.match(*args) def matchAll(*args): return _P5_INSTANCE.matchAll(*args) def nf(*args): return _P5_INSTANCE.nf(*args) def nfc(*args): return _P5_INSTANCE.nfc(*args) def nfp(*args): return _P5_INSTANCE.nfp(*args) def nfs(*args): return _P5_INSTANCE.nfs(*args) def split(*args): return _P5_INSTANCE.split(*args) def splitTokens(*args): return _P5_INSTANCE.splitTokens(*args) def trim(*args): return _P5_INSTANCE.trim(*args) def setMoveThreshold(*args): return _P5_INSTANCE.setMoveThreshold(*args) def setShakeThreshold(*args): return _P5_INSTANCE.setShakeThreshold(*args) def keyIsDown(*args): return _P5_INSTANCE.keyIsDown(*args) def createImage(*args): return _P5_INSTANCE.createImage(*args) def saveCanvas(*args): return _P5_INSTANCE.saveCanvas(*args) def saveFrames(*args): return _P5_INSTANCE.saveFrames(*args) def loadImage(*args): return _P5_INSTANCE.loadImage(*args) def image(*args): return _P5_INSTANCE.image(*args) def tint(*args): return _P5_INSTANCE.tint(*args) def noTint(*args): return _P5_INSTANCE.noTint(*args) def imageMode(*args): return _P5_INSTANCE.imageMode(*args) def blend(*args): return _P5_INSTANCE.blend(*args) def copy(*args): return _P5_INSTANCE.copy(*args) def filter(*args): if len(args) > 1 and (args[0] is None or callable(args[0])): return PythonFunctions.filter(*args) else: return _P5_INSTANCE.filter(*args) def get(*args): return _P5_INSTANCE.get(*args) def loadPixels(*args): return _P5_INSTANCE.loadPixels(*args) def set(*args): if len(args) <= 1: return PythonFunctions.set(*args) else: return _P5_INSTANCE.set(*args) def updatePixels(*args): return _P5_INSTANCE.updatePixels(*args) def loadJSON(*args): return _P5_INSTANCE.loadJSON(*args) def loadStrings(*args): return _P5_INSTANCE.loadStrings(*args) def loadTable(*args): return _P5_INSTANCE.loadTable(*args) def loadXML(*args): return _P5_INSTANCE.loadXML(*args) def loadBytes(*args): return _P5_INSTANCE.loadBytes(*args) def httpGet(*args): return _P5_INSTANCE.httpGet(*args) def httpPost(*args): return _P5_INSTANCE.httpPost(*args) def httpDo(*args): return _P5_INSTANCE.httpDo(*args) def createWriter(*args): return _P5_INSTANCE.createWriter(*args) def save(*args): return _P5_INSTANCE.save(*args) def saveJSON(*args): return _P5_INSTANCE.saveJSON(*args) def saveStrings(*args): return _P5_INSTANCE.saveStrings(*args) def saveTable(*args): return _P5_INSTANCE.saveTable(*args) def day(*args): return _P5_INSTANCE.day(*args) def hour(*args): return _P5_INSTANCE.hour(*args) def minute(*args): return _P5_INSTANCE.minute(*args) def millis(*args): return _P5_INSTANCE.millis(*args) def month(*args): return _P5_INSTANCE.month(*args) def second(*args): return _P5_INSTANCE.second(*args) def year(*args): return _P5_INSTANCE.year(*args) def createVector(*args): return _P5_INSTANCE.createVector(*args) def abs(*args): return _P5_INSTANCE.abs(*args) def ceil(*args): return _P5_INSTANCE.ceil(*args) def constrain(*args): return _P5_INSTANCE.constrain(*args) def dist(*args): return _P5_INSTANCE.dist(*args) def exp(*args): return _P5_INSTANCE.exp(*args) def floor(*args): return _P5_INSTANCE.floor(*args) def lerp(*args): return _P5_INSTANCE.lerp(*args) def log(*args): return _P5_INSTANCE.log(*args) def mag(*args): return _P5_INSTANCE.mag(*args) def map(*args): if len(args) > 1 and callable(args[0]): return PythonFunctions.map(*args) else: return _P5_INSTANCE.map(*args) def max(*args): return _P5_INSTANCE.max(*args) def min(*args): return _P5_INSTANCE.min(*args) def norm(*args): return _P5_INSTANCE.norm(*args) def pow(*args): return _P5_INSTANCE.pow(*args) def round(*args): return _P5_INSTANCE.round(*args) def sq(*args): return _P5_INSTANCE.sq(*args) def sqrt(*args): return _P5_INSTANCE.sqrt(*args) def noise(*args): return _P5_INSTANCE.noise(*args) def noiseDetail(*args): return _P5_INSTANCE.noiseDetail(*args) def noiseSeed(*args): return _P5_INSTANCE.noiseSeed(*args) def randomSeed(*args): return _P5_INSTANCE.randomSeed(*args) def random(*args): return _P5_INSTANCE.random(*args) def randomGaussian(*args): return _P5_INSTANCE.randomGaussian(*args) def acos(*args): return _P5_INSTANCE.acos(*args) def asin(*args): return _P5_INSTANCE.asin(*args) def atan(*args): return _P5_INSTANCE.atan(*args) def atan2(*args): return _P5_INSTANCE.atan2(*args) def cos(*args): return _P5_INSTANCE.cos(*args) def sin(*args): return _P5_INSTANCE.sin(*args) def tan(*args): return _P5_INSTANCE.tan(*args) def degrees(*args): return _P5_INSTANCE.degrees(*args) def radians(*args): return _P5_INSTANCE.radians(*args) def angleMode(*args): return _P5_INSTANCE.angleMode(*args) def textAlign(*args): return _P5_INSTANCE.textAlign(*args) def textLeading(*args): return _P5_INSTANCE.textLeading(*args) def textSize(*args): return _P5_INSTANCE.textSize(*args) def textStyle(*args): return _P5_INSTANCE.textStyle(*args) def textWidth(*args): return _P5_INSTANCE.textWidth(*args) def textAscent(*args): return _P5_INSTANCE.textAscent(*args) def textDescent(*args): return _P5_INSTANCE.textDescent(*args) def loadFont(*args): return _P5_INSTANCE.loadFont(*args) def text(*args): return _P5_INSTANCE.text(*args) def textFont(*args): return _P5_INSTANCE.textFont(*args) def orbitControl(*args): return _P5_INSTANCE.orbitControl(*args) def debugMode(*args): return _P5_INSTANCE.debugMode(*args) def noDebugMode(*args): return _P5_INSTANCE.noDebugMode(*args) def ambientLight(*args): return _P5_INSTANCE.ambientLight(*args) def directionalLight(*args): return _P5_INSTANCE.directionalLight(*args) def pointLight(*args): return _P5_INSTANCE.pointLight(*args) def lights(*args): return _P5_INSTANCE.lights(*args) def loadShader(*args): return _P5_INSTANCE.loadShader(*args) def createShader(*args): return _P5_INSTANCE.createShader(*args) def shader(*args): return _P5_INSTANCE.shader(*args) def resetShader(*args): return _P5_INSTANCE.resetShader(*args) def normalMaterial(*args): return _P5_INSTANCE.normalMaterial(*args) def texture(*args): return _P5_INSTANCE.texture(*args) def textureMode(*args): return _P5_INSTANCE.textureMode(*args) def textureWrap(*args): return _P5_INSTANCE.textureWrap(*args) def ambientMaterial(*args): return _P5_INSTANCE.ambientMaterial(*args) def specularMaterial(*args): return _P5_INSTANCE.specularMaterial(*args) def shininess(*args): return _P5_INSTANCE.shininess(*args) def camera(*args): return _P5_INSTANCE.camera(*args) def perspective(*args): return _P5_INSTANCE.perspective(*args) def ortho(*args): return _P5_INSTANCE.ortho(*args) def createCamera(*args): return _P5_INSTANCE.createCamera(*args) def setCamera(*args): return _P5_INSTANCE.setCamera(*args) def select(*args): return _P5_INSTANCE.select(*args) def selectAll(*args): return _P5_INSTANCE.selectAll(*args) def removeElements(*args): return _P5_INSTANCE.removeElements(*args) def changed(*args): return _P5_INSTANCE.changed(*args) def input(*args): return _P5_INSTANCE.input(*args) def createDiv(*args): return _P5_INSTANCE.createDiv(*args) def createP(*args): return _P5_INSTANCE.createP(*args) def createSpan(*args): return _P5_INSTANCE.createSpan(*args) def createImg(*args): return _P5_INSTANCE.createImg(*args) def createA(*args): return _P5_INSTANCE.createA(*args) def createSlider(*args): return _P5_INSTANCE.createSlider(*args) def createButton(*args): return _P5_INSTANCE.createButton(*args) def createCheckbox(*args): return _P5_INSTANCE.createCheckbox(*args) def createSelect(*args): return _P5_INSTANCE.createSelect(*args) def createRadio(*args): return _P5_INSTANCE.createRadio(*args) def createColorPicker(*args): return _P5_INSTANCE.createColorPicker(*args) def createInput(*args): return _P5_INSTANCE.createInput(*args) def createFileInput(*args): return _P5_INSTANCE.createFileInput(*args) def createVideo(*args): return _P5_INSTANCE.createVideo(*args) def createAudio(*args): return _P5_INSTANCE.createAudio(*args) def createCapture(*args): return _P5_INSTANCE.createCapture(*args) def createElement(*args): return _P5_INSTANCE.createElement(*args) def createCanvas(*args): canvas = _P5_INSTANCE.createCanvas(*args) global width, height width = _P5_INSTANCE.width height = _P5_INSTANCE.height return canvas def __deviceMoved(e): try: _bind_event_function(deviceMoved, e) except NameError: pass def __deviceTurned(e): try: _bind_event_function(deviceTurned, e) except NameError: pass def __deviceShaken(e): try: _bind_event_function(deviceShaken, e) except NameError: pass def __touchEnded(e): try: _bind_event_function(deviceShaken, e) except NameError: pass def __touchStarted(e): try: _bind_event_function(touchStarted, e) except NameError: pass def __windowResized(e): try: _bind_event_function(windowResized, e) except NameError: pass def __touchMoved(e): try: _bind_event_function(touchMoved, e) except NameError: pass def __mouseMoved(e): try: _bind_event_function(mouseMoved, e) except NameError: pass def __mouseDragged(e): try: _bind_event_function(mouseDragged, e) except NameError: pass def __mousePressed(e): try: _bind_event_function(mousePressed, e) except NameError: pass def __mouseReleased(e): try: _bind_event_function(mouseReleased, e) except NameError: pass def __mouseClicked(e): try: _bind_event_function(mouseClicked, e) except NameError: pass def __doubleClicked(e): try: _bind_event_function(doubleClicked, e) except NameError: pass def __mouseWheel(e): try: _bind_event_function(mouseWheel, e) except NameError: pass def __keyPressed(e): try: _bind_event_function(keyPressed, e) except NameError: pass def __keyReleased(e): try: _bind_event_function(keyReleased, e) except NameError: pass def __keyTyped(e): try: _bind_event_function(keyTyped, e) except NameError: pass def __keyIsDown(e): try: _bind_event_function(keyIsDown, e) except NameError: pass def pop(*args): p5_pop = _P5_INSTANCE.pop(*args) return p5_pop # Processing Python or Java mode compatibility aliases size = createCanvas popMatrix = pop popStyle = pop pushMatrix = push pushStyle = push # PVector is a wrapper/helper class for p5.Vector objets # providing names similar to Processing Python or Java modes # but mostly keeping p5js functionality from numbers import Number class PVector: def __init__(self, x=0, y=0, z=0): self.__vector = createVector(x, y, z) self.add = self.__instance_add__ self.sub = self.__instance_sub__ self.mult = self.__instance_mult__ self.div = self.__instance_div__ self.cross = self.__instance_cross__ self.dist = self.__instance_dist__ self.dot = self.__instance_dot__ self.lerp = self.__instance_lerp__ @property def x(self): return self.__vector.x @x.setter def x(self, x): self.__vector.x = x @property def y(self): return self.__vector.y @y.setter def y(self, y): self.__vector.y = y @property def z(self): return self.__vector.z @z.setter def z(self, z): self.__vector.z = z def mag(self): return self.__vector.mag() def magSq(self): return self.__vector.magSq() def setMag(self, mag): self.__vector.setMag(mag) return self def normalize(self): self.__vector.normalize() return self def limit(self, max): self.__vector.limit(max) return self def heading(self): return self.__vector.heading() def rotate(self, angle): self.__vector.rotate(angle) return self def __instance_add__(self, *args): if len(args) == 1: return PVector.add(self, args[0], self) else: return PVector.add(self, PVector(*args), self) def __instance_sub__(self, *args): if len(args) == 1: return PVector.sub(self, args[0], self) else: return PVector.sub(self, PVector(*args), self) def __instance_mult__(self, o): return PVector.mult(self, o, self) def __instance_div__(self, f): return PVector.div(self, f, self) def __instance_cross__(self, o): return PVector.cross(self, o, self) def __instance_dist__(self, o): return PVector.dist(self, o) def __instance_dot__(self, *args): if len(args) == 1: v = args[0] else: v = args return self.x * v[0] + self.y * v[1] + self.z * v[2] def __instance_lerp__(self, *args): if len(args) == 2: return PVector.lerp(self, args[0], args[1], self) else: vx, vy, vz, f = args return PVector.lerp(self, PVector(vx, vy, vz), f, self) def get(self): return PVector(self.x, self.y, self.z) def copy(self): return PVector(self.x, self.y, self.z) def __getitem__(self, k): return getattr(self, ('x', 'y', 'z')[k]) def __setitem__(self, k, v): setattr(self, ('x', 'y', 'z')[k], v) def __copy__(self): return PVector(self.x, self.y, self.z) def __deepcopy__(self, memo): return PVector(self.x, self.y, self.z) def __repr__(self): # PROVISÓRIO return f'PVector({self.x}, {self.y}, {self.z})' def set(self, *args): """ Sets the x, y, and z component of the vector using two or three separate variables, the data from a p5.Vector, or the values from a float array. """ self.__vector.set(*args) @classmethod def add(cls, a, b, dest=None): if dest is None: return PVector(a.x + b[0], a.y + b[1], a.z + b[2]) dest.__vector.set(a.x + b[0], a.y + b[1], a.z + b[2]) return dest @classmethod def sub(cls, a, b, dest=None): if dest is None: return PVector(a.x - b[0], a.y - b[1], a.z - b[2]) dest.__vector.set(a.x - b[0], a.y - b[1], a.z - b[2]) return dest @classmethod def mult(cls, a, b, dest=None): if dest is None: return PVector(a.x * b, a.y * b, a.z * b) dest.__vector.set(a.x * b, a.y * b, a.z * b) return dest @classmethod def div(cls, a, b, dest=None): if dest is None: return PVector(a.x / b, a.y / b, a.z / b) dest.__vector.set(a.x / b, a.y / b, a.z / b) return dest @classmethod def dist(cls, a, b): return a.__vector.dist(b.__vector) @classmethod def dot(cls, a, b): return a.__vector.dot(b.__vector) def __add__(a, b): return PVector.add(a, b, None) def __sub__(a, b): return PVector.sub(a, b, None) def __isub__(a, b): a.sub(b) return a def __iadd__(a, b): a.add(b) return a def __mul__(a, b): if not isinstance(b, Number): raise TypeError( "The * operator can only be used to multiply a PVector by a number") return PVector.mult(a, float(b), None) def __rmul__(a, b): if not isinstance(b, Number): raise TypeError( "The * operator can only be used to multiply a PVector by a number") return PVector.mult(a, float(b), None) def __imul__(a, b): if not isinstance(b, Number): raise TypeError( "The *= operator can only be used to multiply a PVector by a number") a.__vector.mult(float(b)) return a def __truediv__(a, b): if not isinstance(b, Number): raise TypeError( "The * operator can only be used to multiply a PVector by a number") return PVector(a.x / float(b), a.y / float(b), a.z / float(b)) def __itruediv__(a, b): if not isinstance(b, Number): raise TypeError( "The /= operator can only be used to multiply a PVector by a number") a.__vector.set(a.x / float(b), a.y / float(b), a.z / float(b)) return a def __eq__(a, b): return a.x == b[0] and a.y == b[1] and a.z == b[2] def __lt__(a, b): return a.magSq() < b.magSq() def __le__(a, b): return a.magSq() <= b.magSq() def __gt__(a, b): return a.magSq() > b.magSq() def __ge__(a, b): return a.magSq() >= b.magSq() # Problematic class methods, we would rather use p5.Vector when possible... @classmethod def lerp(cls, a, b, f, dest=None): v = createVector(a.x, a.y, a.z) v.lerp(b.__vector, f) if dest is None: return PVector(v.x, v.y, v.z) dest.set(v.x, v.y, v.z) return dest @classmethod def cross(cls, a, b, dest=None): x = a.y * b[2] - b[1] * a.z y = a.z * b[0] - b[2] * a.x z = a.x * b[1] - b[0] * a.y if dest is None: return PVector(x, y, z) dest.set(x, y, z) return dest @classmethod def fromAngle(cls, angle, length=1): # https://github.com/processing/p5.js/blob/3f0b2f0fe575dc81c724474154f5b23a517b7233/src/math/p5.Vector.js return PVector(length * cos(angle), length * sin(angle), 0) @classmethod def fromAngles(theta, phi, length=1): # https://github.com/processing/p5.js/blob/3f0b2f0fe575dc81c724474154f5b23a517b7233/src/math/p5.Vector.js cosPhi = cos(phi) sinPhi = sin(phi) cosTheta = cos(theta) sinTheta = sin(theta) return PVector(length * sinTheta * sinPhi, -length * cosTheta, length * sinTheta * cosPhi) @classmethod def random2D(cls): return PVector.fromAngle(random(TWO_PI)) @classmethod def random3D(cls, dest=None): angle = random(TWO_PI) vz = random(2) - 1 mult = sqrt(1 - vz * vz) vx = mult * cos(angle) vy = mult * sin(angle) if dest is None: return PVector(vx, vy, vz) dest.set(vx, vy, vz) return dest @classmethod def angleBetween(cls, a, b): return acos(a.dot(b) / sqrt(a.magSq() * b.magSq())) # Other harmless p5js methods def equals(self, v): return self == v def heading2D(self): return self.__vector.heading() def reflect(self, *args): # Reflect the incoming vector about a normal to a line in 2D, or about # a normal to a plane in 3D This method acts on the vector directly r = self.__vector.reflect(*args) return r def array(self): # Return a representation of this vector as a float array. This is only # for temporary use. If used in any w fashion, the contents should be # copied by using the p5.Vector.copy() method to copy into your own # array. return self.__vector.array() def toString(self): # Returns a string representation of a vector v by calling String(v) or v.toString(). # return self.__vector.toString() would be something like "p5.vector # Object […, …, …]" return str(self) def rem(self, *args): # Gives remainder of a vector when it is divided by anw vector. See # examples for more context. self.__vector.rem(*args) return self def pre_draw(p5_instance, draw_func, *args, **kwargs): """ We need to run this before the actual draw to insert and update p5 env variables """ global _CTX_MIDDLE, _DEFAULT_FILL, _DEFAULT_LEADMULT, _DEFAULT_STROKE, _DEFAULT_TEXT_FILL global ADD, ALT, ARROW, AUTO, AUDIO, AXES, BACKSPACE, BASELINE, BEVEL, BEZIER, BLEND, BLUR, BOLD, BOLDITALIC global BOTTOM, BURN, CENTER, CHORD, CLAMP, CLOSE, CONTROL, CORNER, CORNERS, CROSS, CURVE, DARKEST global DEG_TO_RAD, DEGREES, DELETE, DIFFERENCE, DILATE, DODGE, DOWN_ARROW, ENTER, ERODE, ESCAPE, EXCLUSION global FILL, GRAY, GRID, HALF_PI, HAND, HARD_LIGHT, HSB, HSL, IMAGE, IMMEDIATE, INVERT, ITALIC, LANDSCAPE global LEFT, LEFT_ARROW, LIGHTEST, LINE_LOOP, LINE_STRIP, LINEAR, LINES, MIRROR, MITER, MOVE, MULTIPLY, NEAREST global NORMAL, OPAQUE, OPEN, OPTION, OVERLAY, P2D, P3D, PI, PIE, POINTS, PORTRAIT, POSTERIZE, PROJECT, QUAD_STRIP global QUADRATIC, QUADS, QUARTER_PI, RAD_TO_DEG, RADIANS, RADIUS, REPEAT, REPLACE, RETURN, RGB, RIGHT, RIGHT_ARROW global ROUND, SCREEN, SHIFT, SOFT_LIGHT, SQUARE, STROKE, SUBTRACT, TAB, TAU, TEXT, TEXTURE, THRESHOLD, TOP global TRIANGLE_FAN, TRIANGLE_STRIP, TRIANGLES, TWO_PI, UP_ARROW, VIDEO, WAIT, WEBGL global frameCount, focused, displayWidth, displayHeight, windowWidth, windowHeight, width, height global deviceOrientation, accelerationX, accelerationY, accelerationZ global pAccelerationX, pAccelerationY, pAccelerationZ, rotationX, rotationY, rotationZ global pRotationX, pRotationY, pRotationZ, turnAxis, keyIsPressed, key, keyCode, mouseX, mouseY, pmouseX, pmouseY global winMouseX, winMouseY, pwinMouseX, pwinMouseY, mouseButton, mouseIsPressed, touches, pixels _CTX_MIDDLE = p5_instance._CTX_MIDDLE _DEFAULT_FILL = p5_instance._DEFAULT_FILL _DEFAULT_LEADMULT = p5_instance._DEFAULT_LEADMULT _DEFAULT_STROKE = p5_instance._DEFAULT_STROKE _DEFAULT_TEXT_FILL = p5_instance._DEFAULT_TEXT_FILL ADD = p5_instance.ADD ALT = p5_instance.ALT ARROW = p5_instance.ARROW AUDIO = p5_instance.AUDIO AUTO = p5_instance.AUTO AXES = p5_instance.AXES BACKSPACE = p5_instance.BACKSPACE BASELINE = p5_instance.BASELINE BEVEL = p5_instance.BEVEL BEZIER = p5_instance.BEZIER BLEND = p5_instance.BLEND BLUR = p5_instance.BLUR BOLD = p5_instance.BOLD BOLDITALIC = p5_instance.BOLDITALIC BOTTOM = p5_instance.BOTTOM BURN = p5_instance.BURN CENTER = p5_instance.CENTER CHORD = p5_instance.CHORD CLAMP = p5_instance.CLAMP CLOSE = p5_instance.CLOSE CONTROL = p5_instance.CONTROL CORNER = p5_instance.CORNER CORNERS = p5_instance.CORNERS CROSS = p5_instance.CROSS CURVE = p5_instance.CURVE DARKEST = p5_instance.DARKEST DEG_TO_RAD = p5_instance.DEG_TO_RAD DEGREES = p5_instance.DEGREES DELETE = p5_instance.DELETE DIFFERENCE = p5_instance.DIFFERENCE DILATE = p5_instance.DILATE DODGE = p5_instance.DODGE DOWN_ARROW = p5_instance.DOWN_ARROW ENTER = p5_instance.ENTER ERODE = p5_instance.ERODE ESCAPE = p5_instance.ESCAPE EXCLUSION = p5_instance.EXCLUSION FILL = p5_instance.FILL GRAY = p5_instance.GRAY GRID = p5_instance.GRID HALF_PI = p5_instance.HALF_PI HAND = p5_instance.HAND HARD_LIGHT = p5_instance.HARD_LIGHT HSB = p5_instance.HSB HSL = p5_instance.HSL IMAGE = p5_instance.IMAGE IMMEDIATE = p5_instance.IMMEDIATE INVERT = p5_instance.INVERT ITALIC = p5_instance.ITALIC LANDSCAPE = p5_instance.LANDSCAPE LEFT = p5_instance.LEFT LEFT_ARROW = p5_instance.LEFT_ARROW LIGHTEST = p5_instance.LIGHTEST LINE_LOOP = p5_instance.LINE_LOOP LINE_STRIP = p5_instance.LINE_STRIP LINEAR = p5_instance.LINEAR LINES = p5_instance.LINES MIRROR = p5_instance.MIRROR MITER = p5_instance.MITER MOVE = p5_instance.MOVE MULTIPLY = p5_instance.MULTIPLY NEAREST = p5_instance.NEAREST NORMAL = p5_instance.NORMAL OPAQUE = p5_instance.OPAQUE OPEN = p5_instance.OPEN OPTION = p5_instance.OPTION OVERLAY = p5_instance.OVERLAY P2D = p5_instance.P2D P3D = p5_instance.WEBGL PI = p5_instance.PI PIE = p5_instance.PIE POINTS = p5_instance.POINTS PORTRAIT = p5_instance.PORTRAIT POSTERIZE = p5_instance.POSTERIZE PROJECT = p5_instance.PROJECT QUAD_STRIP = p5_instance.QUAD_STRIP QUADRATIC = p5_instance.QUADRATIC QUADS = p5_instance.QUADS QUARTER_PI = p5_instance.QUARTER_PI RAD_TO_DEG = p5_instance.RAD_TO_DEG RADIANS = p5_instance.RADIANS RADIUS = p5_instance.RADIUS REPEAT = p5_instance.REPEAT REPLACE = p5_instance.REPLACE RETURN = p5_instance.RETURN RGB = p5_instance.RGB RIGHT = p5_instance.RIGHT RIGHT_ARROW = p5_instance.RIGHT_ARROW ROUND = p5_instance.ROUND SCREEN = p5_instance.SCREEN SHIFT = p5_instance.SHIFT SOFT_LIGHT = p5_instance.SOFT_LIGHT SQUARE = p5_instance.SQUARE STROKE = p5_instance.STROKE SUBTRACT = p5_instance.SUBTRACT TAB = p5_instance.TAB TAU = p5_instance.TAU TEXT = p5_instance.TEXT TEXTURE = p5_instance.TEXTURE THRESHOLD = p5_instance.THRESHOLD TOP = p5_instance.TOP TRIANGLE_FAN = p5_instance.TRIANGLE_FAN TRIANGLE_STRIP = p5_instance.TRIANGLE_STRIP TRIANGLES = p5_instance.TRIANGLES TWO_PI = p5_instance.TWO_PI UP_ARROW = p5_instance.UP_ARROW VIDEO = p5_instance.VIDEO WAIT = p5_instance.WAIT WEBGL = p5_instance.WEBGL frameCount = p5_instance.frameCount focused = p5_instance.focused displayWidth = p5_instance.displayWidth displayHeight = p5_instance.displayHeight windowWidth = p5_instance.windowWidth windowHeight = p5_instance.windowHeight width = p5_instance.width height = p5_instance.height deviceOrientation = p5_instance.deviceOrientation accelerationX = p5_instance.accelerationX accelerationY = p5_instance.accelerationY accelerationZ = p5_instance.accelerationZ pAccelerationX = p5_instance.pAccelerationX pAccelerationY = p5_instance.pAccelerationY pAccelerationZ = p5_instance.pAccelerationZ rotationX = p5_instance.rotationX rotationY = p5_instance.rotationY rotationZ = p5_instance.rotationZ pRotationX = p5_instance.pRotationX pRotationY = p5_instance.pRotationY pRotationZ = p5_instance.pRotationZ turnAxis = p5_instance.turnAxis keyIsPressed = p5_instance.keyIsPressed key = p5_instance.key keyCode = p5_instance.keyCode mouseX = p5_instance.mouseX mouseY = p5_instance.mouseY pmouseX = p5_instance.pmouseX pmouseY = p5_instance.pmouseY winMouseX = p5_instance.winMouseX winMouseY = p5_instance.winMouseY pwinMouseX = p5_instance.pwinMouseX pwinMouseY = p5_instance.pwinMouseY mouseButton = p5_instance.mouseButton mouseIsPressed = p5_instance.mouseIsPressed touches = p5_instance.touches pixels = p5_instance.pixels return draw_func(*args, **kwargs) def global_p5_injection(p5_sketch): """ Injects the p5js's skecth instance as a global variable to setup and draw functions """ def decorator(f, *args, **kwargs): def wrapper(*args, **kwargs): global _P5_INSTANCE _P5_INSTANCE = p5_sketch return pre_draw(_P5_INSTANCE, f, *args, **kwargs) return wrapper return decorator def start_p5(preload_func, setup_func, draw_func, event_functions): """ This is the entrypoint function. It accepts 2 parameters: - preload_func: A Python preload callable - setup_func: a Python setup callable - draw_func: a Python draw callable - event_functions: a config dict for the event functions in the format: {"eventFunctionName": python_event_function} This method gets the p5js's sketch instance and injects them """ def sketch_setup(p5_sketch): """ Callback function called to configure new p5 instance """ p5_sketch.preload = global_p5_injection(p5_sketch)(preload_func) p5_sketch.setup = global_p5_injection(p5_sketch)(setup_func) p5_sketch.draw = global_p5_injection(p5_sketch)(draw_func) window.instance = p5.new(sketch_setup, 'sketch-holder') # Register event functions event_function_names = ( "deviceMoved", "deviceTurned", "deviceShaken", "windowResized", "keyPressed", "keyReleased", "keyTyped", "mousePressed", "mouseReleased", "mouseClicked", "doubleClicked", "mouseMoved", "mouseDragged", "mouseWheel", "touchStarted", "touchMoved", "touchEnded", "keyIsDown", ) for f_name in [f for f in event_function_names if event_functions.get(f, None)]: func = event_functions[f_name] event_func = global_p5_injection(window.instance)(func) setattr(window.instance, f_name, event_func) `; const placeholder = ` def preload(): pass def setup(): pass def draw(): pass deviceMoved = None deviceTurned = None deviceShaken = None keyPressed = None keyReleased = None keyTyped = None mouseMoved = None mouseDragged = None mousePressed = None mouseReleased = None mouseClicked = None doubleClicked = None mouseWheel = None touchStarted = None touchMoved = None touchEnded = None windowResized = None `; let userCode = ` def setup(): createCanvas(600,600) noStroke() rectMode(CENTER) def draw(): colorMode(HSB,100) h = map(mouseY,0,600,0,100) background(h,100,100) fill(100-h,100,100) rect(300,300,mouseX+1,mouseX+1) `; const startCode = ` event_functions = { "deviceMoved": deviceMoved, "deviceTurned": deviceTurned, "deviceShaken": deviceShaken, "keyPressed": keyPressed, "keyReleased": keyReleased, "keyTyped": keyTyped, "mouseMoved": mouseMoved, "mouseDragged": mouseDragged, "mousePressed": mousePressed, "mouseReleased": mouseReleased, "mouseClicked": mouseClicked, "doubleClicked": doubleClicked, "mouseWheel": mouseWheel, "touchStarted": touchStarted, "touchMoved": touchMoved, "touchEnded": touchEnded, "windowResized": windowResized, } start_p5(preload, setup, draw, event_functions) `; function runCode() { let code = [ placeholder, userCode, wrapperContent, startCode, ].join('\n'); if (window.instance) { window.instance.canvas.remove(); } console.log("Python execution output:"); window.pyodide.runPython(code); } async function main() { const config = { indexURL : "https://cdn.jsdelivr.net/pyodide/v0.18.1/full/", fullStdLib: false, } window.pyodide = await loadPyodide(config); // Pyodide is now ready to use... console.log(window.pyodide.runPython(` import io, code, sys from js import p5, window, document print(sys.version) `)); window.runSketchCode = (code) => { userCode = code; runCode(); } runCode(); }; // async method main(); ================================================ FILE: docs/examples/pyodide/sketch_006/index.html ================================================ sketch_006 - pyp5js

Python code here.

r = None

def setup():
    global r

    createCanvas(900, 900)
    r = random(100, 700)
    noFill()

def draw():
    x, y = 100, 100
    rect(x, y, r, r)

def keyPressed():
    console.log("Key pressed event")

    if key == "n":
        global r
        r = random(100, 700)
        redraw()

def mouseDragged():
    global r
    r = random(100, 700)
    redraw()
================================================ FILE: docs/examples/pyodide/sketch_006/sketch_006.py ================================================ r = None def setup(): global r createCanvas(900, 900) r = random(100, 700) noFill() def draw(): x, y = 100, 100 rect(x, y, r, r) def keyPressed(): console.log("Key pressed event") if key == "n": global r r = random(100, 700) redraw() def mouseDragged(): global r r = random(100, 700) redraw() ================================================ FILE: docs/examples/pyodide/sketch_006/static/p5.js ================================================ /*! p5.js v1.0.0 February 29, 2020 */ !function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).p5=e()}}(function(){return function o(a,s,l){function u(t,e){if(!s[t]){if(!a[t]){var r="function"==typeof require&&require;if(!e&&r)return r(t,!0);if(h)return h(t,!0);var i=new Error("Cannot find module '"+t+"'");throw i.code="MODULE_NOT_FOUND",i}var n=s[t]={exports:{}};a[t][0].call(n.exports,function(e){return u(a[t][1][e]||e)},n,n.exports,o,a,s,l)}return s[t].exports}for(var h="function"==typeof require&&require,e=0;e>16&255,a[s++]=t>>8&255,a[s++]=255&t;2===o&&(t=u[e.charCodeAt(r)]<<2|u[e.charCodeAt(r+1)]>>4,a[s++]=255&t);1===o&&(t=u[e.charCodeAt(r)]<<10|u[e.charCodeAt(r+1)]<<4|u[e.charCodeAt(r+2)]>>2,a[s++]=t>>8&255,a[s++]=255&t);return a},r.fromByteArray=function(e){for(var t,r=e.length,i=r%3,n=[],o=0,a=r-i;o>2]+s[t<<4&63]+"==")):2==i&&(t=(e[r-2]<<8)+e[r-1],n.push(s[t>>10]+s[t>>4&63]+s[t<<2&63]+"="));return n.join("")};for(var s=[],u=[],h="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=0,o=i.length;n>18&63]+s[n>>12&63]+s[n>>6&63]+s[63&n]);return o.join("")}u["-".charCodeAt(0)]=62,u["_".charCodeAt(0)]=63},{}],20:[function(e,t,r){},{}],21:[function(N,e,F){(function(c){"use strict";var i=N("base64-js"),o=N("ieee754"),e="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;F.Buffer=c,F.SlowBuffer=function(e){+e!=e&&(e=0);return c.alloc(+e)},F.INSPECT_MAX_BYTES=50;var r=2147483647;function a(e){if(r>>1;case"base64":return O(e).length;default:if(n)return i?-1:R(e).length;t=(""+t).toLowerCase(),n=!0}}function d(e,t,r){var i=e[t];e[t]=e[r],e[r]=i}function p(e,t,r,i,n){if(0===e.length)return-1;if("string"==typeof r?(i=r,r=0):2147483647=e.length){if(n)return-1;r=e.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof t&&(t=c.from(t,i)),c.isBuffer(t))return 0===t.length?-1:m(e,t,r,i,n);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):m(e,[t],r,i,n);throw new TypeError("val must be string, number or Buffer")}function m(e,t,r,i,n){var o,a=1,s=e.length,l=t.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(e.length<2||t.length<2)return-1;s/=a=2,l/=2,r/=2}function u(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(n){var h=-1;for(o=r;o>8,n=r%256,o.push(n),o.push(i);return o}(t,e.length-r),e,r,i)}function b(e,t,r){return 0===t&&r===e.length?i.fromByteArray(e):i.fromByteArray(e.slice(t,r))}function _(e,t,r){r=Math.min(e.length,r);for(var i=[],n=t;n>>10&1023|55296),h=56320|1023&h),i.push(h),n+=c}return function(e){var t=e.length;if(t<=x)return String.fromCharCode.apply(String,e);var r="",i=0;for(;ithis.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e=e||"utf8";;)switch(e){case"hex":return M(this,t,r);case"utf8":case"utf-8":return _(this,t,r);case"ascii":return w(this,t,r);case"latin1":case"binary":return S(this,t,r);case"base64":return b(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,t,r);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}.apply(this,arguments)},c.prototype.equals=function(e){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===c.compare(this,e)},c.prototype.inspect=function(){var e="",t=F.INSPECT_MAX_BYTES;return e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(e+=" ... "),""},e&&(c.prototype[e]=c.prototype.inspect),c.prototype.compare=function(e,t,r,i,n){if(A(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),t<0||r>e.length||i<0||n>this.length)throw new RangeError("out of range index");if(n<=i&&r<=t)return 0;if(n<=i)return-1;if(r<=t)return 1;if(this===e)return 0;for(var o=(n>>>=0)-(i>>>=0),a=(r>>>=0)-(t>>>=0),s=Math.min(o,a),l=this.slice(i,n),u=e.slice(t,r),h=0;h>>=0,isFinite(r)?(r>>>=0,void 0===i&&(i="utf8")):(i=r,r=void 0)}var n=this.length-t;if((void 0===r||nthis.length)throw new RangeError("Attempt to write outside buffer bounds");i=i||"utf8";for(var o,a,s,l,u,h,c=!1;;)switch(i){case"hex":return g(this,e,t,r);case"utf8":case"utf-8":return u=t,h=r,D(R(e,(l=this).length-u),l,u,h);case"ascii":return v(this,e,t,r);case"latin1":case"binary":return v(this,e,t,r);case"base64":return o=this,a=t,s=r,D(O(e),o,a,s);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return y(this,e,t,r);default:if(c)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),c=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var x=4096;function w(e,t,r){var i="";r=Math.min(e.length,r);for(var n=t;ne.length)throw new RangeError("Index out of range")}function P(e,t,r,i){if(r+i>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function L(e,t,r,i,n){return t=+t,r>>>=0,n||P(e,0,r,4),o.write(e,t,r,i,23,4),r+4}function k(e,t,r,i,n){return t=+t,r>>>=0,n||P(e,0,r,8),o.write(e,t,r,i,52,8),r+8}c.prototype.slice=function(e,t){var r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):r>>=0,t>>>=0,r||T(e,t,this.length);for(var i=this[e],n=1,o=0;++o>>=0,t>>>=0,r||T(e,t,this.length);for(var i=this[e+--t],n=1;0>>=0,t||T(e,1,this.length),this[e]},c.prototype.readUInt16LE=function(e,t){return e>>>=0,t||T(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUInt16BE=function(e,t){return e>>>=0,t||T(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUInt32LE=function(e,t){return e>>>=0,t||T(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUInt32BE=function(e,t){return e>>>=0,t||T(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||T(e,t,this.length);for(var i=this[e],n=1,o=0;++o>>=0,t>>>=0,r||T(e,t,this.length);for(var i=t,n=1,o=this[e+--i];0>>=0,t||T(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){e>>>=0,t||T(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(e,t){e>>>=0,t||T(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(e,t){return e>>>=0,t||T(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return e>>>=0,t||T(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readFloatLE=function(e,t){return e>>>=0,t||T(e,4,this.length),o.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return e>>>=0,t||T(e,4,this.length),o.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return e>>>=0,t||T(e,8,this.length),o.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return e>>>=0,t||T(e,8,this.length),o.read(this,e,!1,52,8)},c.prototype.writeUIntLE=function(e,t,r,i){e=+e,t>>>=0,r>>>=0,i||C(this,e,t,r,Math.pow(2,8*r)-1,0);var n=1,o=0;for(this[t]=255&e;++o>>=0,r>>>=0,i||C(this,e,t,r,Math.pow(2,8*r)-1,0);var n=r-1,o=1;for(this[t+n]=255&e;0<=--n&&(o*=256);)this[t+n]=e/o&255;return t+r},c.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,1,255,0),this[t]=255&e,t+1},c.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},c.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeIntLE=function(e,t,r,i){if(e=+e,t>>>=0,!i){var n=Math.pow(2,8*r-1);C(this,e,t,r,n-1,-n)}var o=0,a=1,s=0;for(this[t]=255&e;++o>0)-s&255;return t+r},c.prototype.writeIntBE=function(e,t,r,i){if(e=+e,t>>>=0,!i){var n=Math.pow(2,8*r-1);C(this,e,t,r,n-1,-n)}var o=r-1,a=1,s=0;for(this[t+o]=255&e;0<=--o&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+r},c.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},c.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeFloatLE=function(e,t,r){return L(this,e,t,!0,r)},c.prototype.writeFloatBE=function(e,t,r){return L(this,e,t,!1,r)},c.prototype.writeDoubleLE=function(e,t,r){return k(this,e,t,!0,r)},c.prototype.writeDoubleBE=function(e,t,r){return k(this,e,t,!1,r)},c.prototype.copy=function(e,t,r,i){if(!c.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r=r||0,i||0===i||(i=this.length),t>=e.length&&(t=e.length),t=t||0,0=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t>>=0,r=void 0===r?this.length:r>>>0,"number"==typeof(e=e||0))for(o=t;o>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function O(e){return i.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(t,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function D(e,t,r,i){for(var n=0;n=t.length||n>=e.length);++n)t[n+r]=e[n];return n}function A(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function I(e){return e!=e}var U=function(){for(var e="0123456789abcdef",t=new Array(256),r=0;r<16;++r)for(var i=16*r,n=0;n<16;++n)t[i+n]=e[r]+e[n];return t}()}).call(this,N("buffer").Buffer)},{"base64-js":19,buffer:21,ieee754:30}],22:[function(e,t,r){"use strict";t.exports=e("./").polyfill()},{"./":23}],23:[function(z,r,i){(function(j,V){var e,t;e=this,t=function(){"use strict";function l(e){return"function"==typeof e}var r=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},i=0,t=void 0,n=void 0,a=function(e,t){f[i]=e,f[i+1]=t,2===(i+=2)&&(n?n(d):y())};var e="undefined"!=typeof window?window:void 0,o=e||{},s=o.MutationObserver||o.WebKitMutationObserver,u="undefined"==typeof self&&void 0!==j&&"[object process]"==={}.toString.call(j),h="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function c(){var e=setTimeout;return function(){return e(d,1)}}var f=new Array(1e3);function d(){for(var e=0;e":">",'"':""","'":"'","/":"/"};function S(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,function(e){return w[e]}):e}var M=function(){function i(e){var t,r=1=this.maxReplaces)break}for(a=0;r=this.regexp.exec(e);){if(void 0===(i=h(r[1].trim())))if("function"==typeof c){var d=c(e,r,t);i="string"==typeof d?d:""}else this.logger.warn("missed to pass in variable ".concat(r[1]," for interpolating ").concat(e)),i="";else"string"==typeof i||this.useRawValueToEscape||(i=v(i));if(i=this.escapeValue?u(this.escape(i)):u(i),e=e.replace(r[0],i),this.regexp.lastIndex=0,++a>=this.maxReplaces)break}return e}},{key:"nest",value:function(e,t,r){var i,n,o=D({},2>1,h=-7,c=r?n-1:0,f=r?-1:1,d=e[t+c];for(c+=f,o=d&(1<<-h)-1,d>>=-h,h+=s;0>=-h,h+=i;0>1,f=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,d=i?0:o-1,p=i?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=h):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),2<=(t+=1<=a+c?f/l:f*Math.pow(2,1-c))*l&&(a++,l/=2),h<=a+c?(s=0,a=h):1<=a+c?(s=(t*l-1)*Math.pow(2,n),a+=c):(s=t*Math.pow(2,c-1)*Math.pow(2,n),a=0));8<=n;e[r+d]=255&s,d+=p,s/=256,n-=8);for(a=a<Math.abs(e[0])&&(t=1),Math.abs(e[2])>Math.abs(e[t])&&(t=2),t}var C=4e150;function P(e,t){e.f+=t.f,e.b.f+=t.b.f}function u(e,t,r){return e=e.a,t=t.a,r=r.a,t.b.a===e?r.b.a===e?v(t.a,r.a)?b(r.b.a,t.a,r.a)<=0:0<=b(t.b.a,r.a,t.a):b(r.b.a,e,r.a)<=0:r.b.a===e?0<=b(t.b.a,e,t.a):(t=y(t.b.a,e,t.a),(e=y(r.b.a,e,r.a))<=t)}function L(e){e.a.i=null;var t=e.e;t.a.c=t.c,t.c.a=t.a,e.e=null}function h(e,t){c(e.a),e.c=!1,(e.a=t).i=e}function k(e){for(var t=e.a.a;(e=fe(e)).a.a===t;);return e.c&&(h(e,t=f(ce(e).a.b,e.a.e)),e=fe(e)),e}function R(e,t,r){var i=new he;return i.a=r,i.e=W(e.f,t.e,i),r.i=i}function O(e,t){switch(e.s){case 100130:return 0!=(1&t);case 100131:return 0!==t;case 100132:return 0>1]],s[a[u]])?le(r,u):ue(r,u)),s[o]=null,l[o]=r.b,r.b=o}else for(r.c[-(o+1)]=null;0Math.max(a.a,l.a))return!1;if(v(o,a)){if(0i.f&&(i.f*=2,i.c=oe(i.c,i.f+1)),0===i.b?r=n:(r=i.b,i.b=i.c[i.b]),i.e[r]=t,i.c[r]=n,i.d[n]=r,i.h&&ue(i,n),r}return i=e.a++,e.c[i]=t,-(i+1)}function ie(e){if(0===e.a)return se(e.b);var t=e.c[e.d[e.a-1]];if(0!==e.b.a&&v(ae(e.b),t))return se(e.b);for(;--e.a,0e.a||v(i[a],i[l])){n[r[o]=a]=o;break}n[r[o]=l]=o,o=s}}function ue(e,t){for(var r=e.d,i=e.e,n=e.c,o=t,a=r[o];;){var s=o>>1,l=r[s];if(0==s||v(i[l],i[a])){n[r[o]=a]=o;break}n[r[o]=l]=o,o=s}}function he(){this.e=this.a=null,this.f=0,this.c=this.b=this.h=this.d=!1}function ce(e){return e.e.c.b}function fe(e){return e.e.a.b}(i=q.prototype).x=function(){Y(this,0)},i.B=function(e,t){switch(e){case 100142:return;case 100140:switch(t){case 100130:case 100131:case 100132:case 100133:case 100134:return void(this.s=t)}break;case 100141:return void(this.m=!!t);default:return void Z(this,100900)}Z(this,100901)},i.y=function(e){switch(e){case 100142:return 0;case 100140:return this.s;case 100141:return this.m;default:Z(this,100900)}return!1},i.A=function(e,t,r){this.j[0]=e,this.j[1]=t,this.j[2]=r},i.z=function(e,t){var r=t||null;switch(e){case 100100:case 100106:this.h=r;break;case 100104:case 100110:this.l=r;break;case 100101:case 100107:this.k=r;break;case 100102:case 100108:this.i=r;break;case 100103:case 100109:this.p=r;break;case 100105:case 100111:this.o=r;break;case 100112:this.r=r;break;default:Z(this,100900)}},i.C=function(e,t){var r=!1,i=[0,0,0];Y(this,2);for(var n=0;n<3;++n){var o=e[n];o<-1e150&&(o=-1e150,r=!0),1e150n[u]&&(n[u]=h,a[u]=l)}if(l=0,n[1]-o[1]>n[0]-o[0]&&(l=1),n[2]-o[2]>n[l]-o[l]&&(l=2),o[l]>=n[l])i[0]=0,i[1]=0,i[2]=1;else{for(n=0,o=s[l],a=a[l],s=[0,0,0],o=[o.g[0]-a.g[0],o.g[1]-a.g[1],o.g[2]-a.g[2]],u=[0,0,0],l=r.e;l!==r;l=l.e)u[0]=l.g[0]-a.g[0],u[1]=l.g[1]-a.g[1],u[2]=l.g[2]-a.g[2],s[0]=o[1]*u[2]-o[2]*u[1],s[1]=o[2]*u[0]-o[0]*u[2],s[2]=o[0]*u[1]-o[1]*u[0],n<(h=s[0]*s[0]+s[1]*s[1]+s[2]*s[2])&&(n=h,i[0]=s[0],i[1]=s[1],i[2]=s[2]);n<=0&&(i[0]=i[1]=i[2]=0,i[T(o)]=1)}r=!0}for(s=T(i),l=this.b.c,n=(s+1)%3,a=(s+2)%3,s=0>=l,h-=l,g!=o){if(g==a)break;for(var v=g>8,++y;var _=b;if(i>=8;null!==m&&s<4096&&(p[s++]=m<<8|_,u+1<=s&&l<12&&(++l,u=u<<1|1)),m=g}else s=1+a,u=(1<<(l=n+1))-1,m=null}return f!==i&&console.log("Warning, gif stream shorter than expected."),r}try{r.GifWriter=function(v,e,t,r){var y=0,i=void 0===(r=void 0===r?{}:r).loop?null:r.loop,b=void 0===r.palette?null:r.palette;if(e<=0||t<=0||65535>=1;)++n;if(a=1<>8&255,v[y++]=255&t,v[y++]=t>>8&255,v[y++]=(null!==b?128:0)|n,v[y++]=o,v[y++]=0,null!==b)for(var s=0,l=b.length;s>16&255,v[y++]=u>>8&255,v[y++]=255&u}if(null!==i){if(i<0||65535>8&255,v[y++]=0}var x=!1;this.addFrame=function(e,t,r,i,n,o){if(!0===x&&(--y,x=!1),o=void 0===o?{}:o,e<0||t<0||65535>=1;)++u;l=1<>8&255,v[y++]=d,v[y++]=0),v[y++]=44,v[y++]=255&e,v[y++]=e>>8&255,v[y++]=255&t,v[y++]=t>>8&255,v[y++]=255&r,v[y++]=r>>8&255,v[y++]=255&i,v[y++]=i>>8&255,v[y++]=!0===a?128|u-1:0,!0===a)for(var p=0,m=s.length;p>16&255,v[y++]=g>>8&255,v[y++]=255&g}return y=function(t,r,e,i){t[r++]=e;var n=r++,o=1<>=8,h-=8,r===n+256&&(t[n]=255,n=r++)}function d(e){c|=e<>=8,h-=8,r===n+256&&(t[n]=255,n=r++);4096===l?(d(o),l=1+s,u=e+1,m={}):(1<>7,n=1<<1+(7&r);x[e++],x[e++];var o=null,a=null;i&&(o=e,e+=3*(a=n));var s=!0,l=[],u=0,h=null,c=0,f=null;for(this.width=w,this.height=t;s&&e>2&7,e++;break;case 254:for(;;){if(!(0<=(C=x[e++])))throw Error("Invalid block size");if(0===C)break;e+=C}break;default:throw new Error("Unknown graphic control label: 0x"+x[e-1].toString(16))}break;case 44:var p=x[e++]|x[e++]<<8,m=x[e++]|x[e++]<<8,g=x[e++]|x[e++]<<8,v=x[e++]|x[e++]<<8,y=x[e++],b=y>>6&1,_=1<<1+(7&y),S=o,M=a,E=!1;if(y>>7){E=!0;S=e,e+=3*(M=_)}var T=e;for(e++;;){var C;if(!(0<=(C=x[e++])))throw Error("Invalid block size");if(0===C)break;e+=C}l.push({x:p,y:m,width:g,height:v,has_local_palette:E,palette_offset:S,palette_size:M,data_offset:T,data_length:e-T,transparent_index:h,interlaced:!!b,delay:u,disposal:c});break;case 59:s=!1;break;default:throw new Error("Unknown gif block: 0x"+x[e-1].toString(16))}this.numFrames=function(){return l.length},this.loopCount=function(){return f},this.frameInfo=function(e){if(e<0||e>=l.length)throw new Error("Frame index out of range.");return l[e]},this.decodeAndBlitFrameBGRA=function(e,t){var r=this.frameInfo(e),i=r.width*r.height,n=new Uint8Array(i);P(x,r.data_offset,n,i);var o=r.palette_offset,a=r.transparent_index;null===a&&(a=256);var s=r.width,l=w-s,u=s,h=4*(r.y*w+r.x),c=4*((r.y+r.height)*w+r.x),f=h,d=4*l;!0===r.interlaced&&(d+=4*w*7);for(var p=8,m=0,g=n.length;m>=1)),v===a)f+=4;else{var y=x[o+3*v],b=x[o+3*v+1],_=x[o+3*v+2];t[f++]=_,t[f++]=b,t[f++]=y,t[f++]=255}--u}},this.decodeAndBlitFrameRGBA=function(e,t){var r=this.frameInfo(e),i=r.width*r.height,n=new Uint8Array(i);P(x,r.data_offset,n,i);var o=r.palette_offset,a=r.transparent_index;null===a&&(a=256);var s=r.width,l=w-s,u=s,h=4*(r.y*w+r.x),c=4*((r.y+r.height)*w+r.x),f=h,d=4*l;!0===r.interlaced&&(d+=4*w*7);for(var p=8,m=0,g=n.length;m>=1)),v===a)f+=4;else{var y=x[o+3*v],b=x[o+3*v+1],_=x[o+3*v+2];t[f++]=y,t[f++]=b,t[f++]=_,t[f++]=255}--u}}}}catch(e){}},{}],33:[function(jr,t,r){(function(Gr){var e;e=this,function(E){"use strict";function e(e){if(null==this)throw TypeError();var t=String(this),r=t.length,i=e?Number(e):0;if(i!=i&&(i=0),!(i<0||r<=i)){var n,o=t.charCodeAt(i);return 55296<=o&&o<=56319&&i+1>>=1,t}function _(e,t,r){if(!t)return r;for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<>>16-t;return e.tag>>>=t,e.bitcount-=t,i+r}function x(e,t){for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<>>=1,++n,r+=t.table[n],0<=(i-=t.table[n]););return e.tag=o,e.bitcount-=n,t.trans[r+i]}function w(e,t,r){var i,n,o,a,s,l;for(i=_(e,5,257),n=_(e,5,1),o=_(e,4,4),a=0;a<19;++a)g[a]=0;for(a=0;athis.x2&&(this.x2=e)),"number"==typeof t&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=t,this.y2=t),tthis.y2&&(this.y2=t))},C.prototype.addX=function(e){this.addPoint(e,null)},C.prototype.addY=function(e){this.addPoint(null,e)},C.prototype.addBezier=function(e,t,r,i,n,o,a,s){var l=this,u=[e,t],h=[r,i],c=[n,o],f=[a,s];this.addPoint(e,t),this.addPoint(a,s);for(var d=0;d<=1;d++){var p=6*u[d]-12*h[d]+6*c[d],m=-3*u[d]+9*h[d]-9*c[d]+3*f[d],g=3*h[d]-3*u[d];if(0!=m){var v=Math.pow(p,2)-4*g*m;if(!(v<0)){var y=(-p+Math.sqrt(v))/(2*m);0>8&255,255&e]},A.USHORT=U(2),D.SHORT=function(e){return 32768<=e&&(e=-(65536-e)),[e>>8&255,255&e]},A.SHORT=U(2),D.UINT24=function(e){return[e>>16&255,e>>8&255,255&e]},A.UINT24=U(3),D.ULONG=function(e){return[e>>24&255,e>>16&255,e>>8&255,255&e]},A.ULONG=U(4),D.LONG=function(e){return R<=e&&(e=-(2*R-e)),[e>>24&255,e>>16&255,e>>8&255,255&e]},A.LONG=U(4),D.FIXED=D.ULONG,A.FIXED=A.ULONG,D.FWORD=D.SHORT,A.FWORD=A.SHORT,D.UFWORD=D.USHORT,A.UFWORD=A.USHORT,D.LONGDATETIME=function(e){return[0,0,0,0,e>>24&255,e>>16&255,e>>8&255,255&e]},A.LONGDATETIME=U(8),D.TAG=function(e){return k.argument(4===e.length,"Tag should be exactly 4 ASCII characters."),[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]},A.TAG=U(4),D.Card8=D.BYTE,A.Card8=A.BYTE,D.Card16=D.USHORT,A.Card16=A.USHORT,D.OffSize=D.BYTE,A.OffSize=A.BYTE,D.SID=D.USHORT,A.SID=A.USHORT,D.NUMBER=function(e){return-107<=e&&e<=107?[e+139]:108<=e&&e<=1131?[247+((e-=108)>>8),255&e]:-1131<=e&&e<=-108?[251+((e=-e-108)>>8),255&e]:-32768<=e&&e<=32767?D.NUMBER16(e):D.NUMBER32(e)},A.NUMBER=function(e){return D.NUMBER(e).length},D.NUMBER16=function(e){return[28,e>>8&255,255&e]},A.NUMBER16=U(3),D.NUMBER32=function(e){return[29,e>>24&255,e>>16&255,e>>8&255,255&e]},A.NUMBER32=U(5),D.REAL=function(e){var t=e.toString(),r=/\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec(t);if(r){var i=parseFloat("1e"+((r[2]?+r[2]:0)+r[1].length));t=(Math.round(e*i)/i).toString()}for(var n="",o=0,a=t.length;o>8&255,t[t.length]=255&i}return t},A.UTF16=function(e){return 2*e.length};var N={"x-mac-croatian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈ƫȅ ÀÃÕŒœĐ—“”‘’÷◊©⁄€‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ","x-mac-cyrillic":"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю","x-mac-gaelic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØḂ±≤≥ḃĊċḊḋḞḟĠġṀæøṁṖṗɼƒſṠ«»… ÀÃÕŒœ–—“”‘’ṡẛÿŸṪ€‹›Ŷŷṫ·Ỳỳ⁊ÂÊÁËÈÍÎÏÌÓÔ♣ÒÚÛÙıÝýŴŵẄẅẀẁẂẃ","x-mac-greek":"Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦€ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ­","x-mac-icelandic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüݰ¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-inuit":"ᐃᐄᐅᐆᐊᐋᐱᐲᐳᐴᐸᐹᑉᑎᑏᑐᑑᑕᑖᑦᑭᑮᑯᑰᑲᑳᒃᒋᒌᒍᒎᒐᒑ°ᒡᒥᒦ•¶ᒧ®©™ᒨᒪᒫᒻᓂᓃᓄᓅᓇᓈᓐᓯᓰᓱᓲᓴᓵᔅᓕᓖᓗᓘᓚᓛᓪᔨᔩᔪᔫᔭ… ᔮᔾᕕᕖᕗ–—“”‘’ᕘᕙᕚᕝᕆᕇᕈᕉᕋᕌᕐᕿᖀᖁᖂᖃᖄᖅᖏᖐᖑᖒᖓᖔᖕᙱᙲᙳᙴᙵᙶᖖᖠᖡᖢᖣᖤᖥᖦᕼŁł","x-mac-ce":"ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ",macintosh:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-romanian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂȘ∞±≤≥¥µ∂∑∏π∫ªºΩăș¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›Țț‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-turkish":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙˆ˜¯˘˙˚¸˝˛ˇ"};O.MACSTRING=function(e,t,r,i){var n=N[i];if(void 0!==n){for(var o="",a=0;a>8&255,l+256&255)}return o}D.MACSTRING=function(e,t){var r=function(e){if(!F)for(var t in F={},N)F[t]=new String(t);var r=F[e];if(void 0!==r){if(B){var i=B.get(r);if(void 0!==i)return i}var n=N[e];if(void 0!==n){for(var o={},a=0;a>8,t[c+1]=255&f,t=t.concat(i[h])}return t},A.TABLE=function(e){for(var t=0,r=e.fields.length,i=0;i>1,t.skip("uShort",3),e.glyphIndexMap={};for(var a=new se.Parser(r,i+n+14),s=new se.Parser(r,i+n+16+2*o),l=new se.Parser(r,i+n+16+4*o),u=new se.Parser(r,i+n+16+6*o),h=i+n+16+8*o,c=0;c>4,o=15&i;if(15==n)break;if(t+=r[n],15==o)break;t+=r[o]}return parseFloat(t)}(e);if(32<=t&&t<=246)return t-139;if(247<=t&&t<=250)return 256*(t-247)+e.parseByte()+108;if(251<=t&&t<=254)return 256*-(t-251)-e.parseByte()-108;throw new Error("Invalid b0 "+t)}function Te(e,t,r){t=void 0!==t?t:0;var i=new se.Parser(e,t),n=[],o=[];for(r=void 0!==r?r:e.length;i.relativeOffset>1,T.length=0,P=!0}return function e(t){for(var r,i,n,o,a,s,l,u,h,c,f,d,p=0;pMath.abs(d-R)?k=f+T.shift():R=d+T.shift(),E.curveTo(y,b,_,x,l,u),E.curveTo(h,c,f,d,k,R);break;default:console.log("Glyph "+v.index+": unknown operator 1200"+m),T.length=0}break;case 14:0>3;break;case 21:2>16),p+=2;break;case 29:a=T.pop()+g.gsubrsBias,(s=g.gsubrs[a])&&e(s);break;case 30:for(;0=r.begin&&e=fe.length){var a=i.parseChar();r.names.push(i.parseString(a))}break;case 2.5:r.numberOfGlyphs=i.parseUShort(),r.offset=new Array(r.numberOfGlyphs);for(var s=0;st.value.tag?1:-1}),t.fields=t.fields.concat(i),t.fields=t.fields.concat(n),t}function gt(e,t,r){for(var i=0;i 123 are reserved for internal usage");d|=1<>>1,o=e[n].tag;if(o===t)return n;o>>1,o=e[n];if(o===t)return n;o>>1,a=(r=e[o]).start;if(a===t)return r;a(r=e[i-1]).end?0:r}function xt(e,t){this.font=e,this.tableName=t}function wt(e){xt.call(this,e,"gpos")}function St(e){xt.call(this,e,"gsub")}function Mt(e,t){var r=e.length;if(r!==t.length)return!1;for(var i=0;it.points.length-1||i.matchedPoints[1]>n.points.length-1)throw Error("Matched points out of range in "+t.name);var a=t.points[i.matchedPoints[0]],s=n.points[i.matchedPoints[1]],l={xScale:i.xScale,scale01:i.scale01,scale10:i.scale10,yScale:i.yScale,dx:0,dy:0};s=kt([s],l)[0],l.dx=a.x-s.x,l.dy=a.y-s.y,o=kt(n.points,l)}t.points=t.points.concat(o)}}return Rt(t.points)}(wt.prototype=xt.prototype={searchTag:yt,binSearch:bt,getTable:function(e){var t=this.font.tables[this.tableName];return!t&&e&&(t=this.font.tables[this.tableName]=this.createDefaultTable()),t},getScriptNames:function(){var e=this.getTable();return e?e.scripts.map(function(e){return e.tag}):[]},getDefaultScriptName:function(){var e=this.getTable();if(e){for(var t=!1,r=0;r=s[u-1].tag,"Features must be added in alphabetical order."),o={tag:r,feature:{params:0,lookupListIndexes:[]}},s.push(o),a.push(u),o.feature}}},getLookupTables:function(e,t,r,i,n){var o=this.getFeatureTable(e,t,r,n),a=[];if(o){for(var s,l=o.lookupListIndexes,u=this.font.tables[this.tableName].lookups,h=0;h",s),t.stack.push(Math.round(64*s))}function vr(e,t){var r=t.stack,i=r.pop(),n=t.fv,o=t.pv,a=t.ppem,s=t.deltaBase+16*(e-1),l=t.deltaShift,u=t.z0;E.DEBUG&&console.log(t.step,"DELTAP["+e+"]",i,r);for(var h=0;h>4)===a){var d=(15&f)-8;0<=d&&d++,E.DEBUG&&console.log(t.step,"DELTAPFIX",c,"by",d*l);var p=u[c];n.setRelative(p,p,d*l,o)}}}function yr(e,t){var r=t.stack,i=r.pop();E.DEBUG&&console.log(t.step,"ROUND[]"),r.push(64*t.round(i/64))}function br(e,t){var r=t.stack,i=r.pop(),n=t.ppem,o=t.deltaBase+16*(e-1),a=t.deltaShift;E.DEBUG&&console.log(t.step,"DELTAC["+e+"]",i,r);for(var s=0;s>4)===n){var h=(15&u)-8;0<=h&&h++;var c=h*a;E.DEBUG&&console.log(t.step,"DELTACFIX",l,"by",c),t.cvt[l]+=c}}}function _r(e,t){var r,i,n=t.stack,o=n.pop(),a=n.pop(),s=t.z2[o],l=t.z1[a];E.DEBUG&&console.log(t.step,"SDPVTL["+e+"]",o,a),i=e?(r=s.y-l.y,l.x-s.x):(r=l.x-s.x,l.y-s.y),t.dpv=Zt(r,i)}function xr(e,t){var r=t.stack,i=t.prog,n=t.ip;E.DEBUG&&console.log(t.step,"PUSHB["+e+"]");for(var o=0;o":"_")+(i?"R":"_")+(0===n?"Gr":1===n?"Bl":2===n?"Wh":"")+"]",e?c+"("+o.cvt[c]+","+u+")":"",f,"(d =",a,"->",l*s,")"),o.rp1=o.rp0,o.rp2=f,t&&(o.rp0=f)}Ft.prototype.exec=function(e,t){if("number"!=typeof t)throw new Error("Point size is not a number!");if(!(2",i),s.interpolate(c,o,a,l),s.touch(c)}e.loop=1},dr.bind(void 0,0),dr.bind(void 0,1),function(e){for(var t=e.stack,r=e.rp0,i=e.z0[r],n=e.loop,o=e.fv,a=e.pv,s=e.z1;n--;){var l=t.pop(),u=s[l];E.DEBUG&&console.log(e.step,(1=a.width||t>=a.height?[0,0,0,0]:this._getPixel(e,t);var s=new l.default.Image(r,i);return s.canvas.getContext("2d").drawImage(a,e,t,r*o,i*o,0,0,r,i),s},l.default.Renderer.prototype.textLeading=function(e){return"number"==typeof e?(this._setProperty("_textLeading",e),this._pInst):this._textLeading},l.default.Renderer.prototype.textSize=function(e){return"number"==typeof e?(this._setProperty("_textSize",e),this._setProperty("_textLeading",e*y._DEFAULT_LEADMULT),this._applyTextProperties()):this._textSize},l.default.Renderer.prototype.textStyle=function(e){return e?(e!==y.NORMAL&&e!==y.ITALIC&&e!==y.BOLD&&e!==y.BOLDITALIC||this._setProperty("_textStyle",e),this._applyTextProperties()):this._textStyle},l.default.Renderer.prototype.textAscent=function(){return null===this._textAscent&&this._updateTextMetrics(),this._textAscent},l.default.Renderer.prototype.textDescent=function(){return null===this._textDescent&&this._updateTextMetrics(),this._textDescent},l.default.Renderer.prototype.textAlign=function(e,t){return void 0!==e?(this._setProperty("_textAlign",e),void 0!==t&&this._setProperty("_textBaseline",t),this._applyTextProperties()):{horizontal:this._textAlign,vertical:this._textBaseline}},l.default.Renderer.prototype.text=function(e,t,r,i,n){var o,a,s,l,u,h,c,f,d=this._pInst,p=Number.MAX_VALUE;if((this._doFill||this._doStroke)&&void 0!==e){if("string"!=typeof e&&(e=e.toString()),o=(e=e.replace(/(\t)/g," ")).split("\n"),void 0!==i){for(s=f=0;ss.HALF_PI&&e<=3*s.HALF_PI?Math.atan(r/i*Math.tan(e))+s.PI:Math.atan(r/i*Math.tan(e))+s.TWO_PI,t=t<=s.HALF_PI?Math.atan(r/i*Math.tan(t)):t>s.HALF_PI&&t<=3*s.HALF_PI?Math.atan(r/i*Math.tan(t))+s.PI:Math.atan(r/i*Math.tan(t))+s.TWO_PI),tv||Math.abs(this.accelerationY-this.pAccelerationY)>v||Math.abs(this.accelerationZ-this.pAccelerationZ)>v)&&e();var t=this.deviceTurned||window.deviceTurned;if("function"==typeof t){var r=this.rotationX+180,i=this.pRotationX+180,n=c+180;0>>24],i+=x[(16711680&C)>>16],n+=x[(65280&C)>>8],o+=x[255&C],r+=k[_],s++}w[l=T+y]=a/r,S[l]=i/r,M[l]=n/r,E[l]=o/r}T+=d}for(h=(u=-P)*d,b=T=0;b>>16,e[r+1]=(65280&t[i])>>>8,e[r+2]=255&t[i],e[r+3]=(4278190080&t[i])>>>24},O._toImageData=function(e){return e instanceof ImageData?e:e.getContext("2d").getImageData(0,0,e.width,e.height)},O._createImageData=function(e,t){return O._tmpCanvas=document.createElement("canvas"),O._tmpCtx=O._tmpCanvas.getContext("2d"),this._tmpCtx.createImageData(e,t)},O.apply=function(e,t,r){var i=e.getContext("2d"),n=i.getImageData(0,0,e.width,e.height),o=t(n,r);o instanceof ImageData?i.putImageData(o,0,0,0,0,e.width,e.height):i.putImageData(n,0,0,0,0,e.width,e.height)},O.threshold=function(e,t){var r=O._toPixels(e);void 0===t&&(t=.5);for(var i=Math.floor(255*t),n=0;n>8)/i,r[n+1]=255*(a*t>>8)/i,r[n+2]=255*(s*t>>8)/i}},O.dilate=function(e){for(var t,r,i,n,o,a,s,l,u,h,c,f,d,p,m,g,v,y=O._toPixels(e),b=0,_=y.length?y.length/4:0,x=new Int32Array(_);b<_;)for(r=(t=b)+e.width;b>16&255)+151*(i>>8&255)+28*(255&i))<(m=77*(c>>16&255)+151*(c>>8&255)+28*(255&c))&&(n=c,o=m),o<(p=77*((h=O._getARGB(y,a))>>16&255)+151*(h>>8&255)+28*(255&h))&&(n=h,o=p),o<(g=77*(f>>16&255)+151*(f>>8&255)+28*(255&f))&&(n=f,o=g),o<(v=77*(d>>16&255)+151*(d>>8&255)+28*(255&d))&&(n=d,o=v),x[b++]=n;O._setPixels(y,x)},O.erode=function(e){for(var t,r,i,n,o,a,s,l,u,h,c,f,d,p,m,g,v,y=O._toPixels(e),b=0,_=y.length?y.length/4:0,x=new Int32Array(_);b<_;)for(r=(t=b)+e.width;b>16&255)+151*(c>>8&255)+28*(255&c))<(o=77*(i>>16&255)+151*(i>>8&255)+28*(255&i))&&(n=c,o=m),(p=77*((h=O._getARGB(y,a))>>16&255)+151*(h>>8&255)+28*(255&h))>16&255)+151*(f>>8&255)+28*(255&f))>16&255)+151*(d>>8&255)+28*(255&d))=r){var i=Math.floor(t.timeDisplayed/r);if(t.timeDisplayed=0,t.displayIndex+=i,t.loopCount=Math.floor(t.displayIndex/t.numFrames),null!==t.loopLimit&&t.loopCount>=t.loopLimit)t.playing=!1;else{var n=t.displayIndex%t.numFrames;this.drawingContext.putImageData(t.frames[n].image,0,0),t.displayIndex=n,this.setModified(!0)}}}},n.default.Image.prototype._setProperty=function(e,t){this[e]=t,this.setModified(!0)},n.default.Image.prototype.loadPixels=function(){n.default.Renderer2D.prototype.loadPixels.call(this),this.setModified(!0)},n.default.Image.prototype.updatePixels=function(e,t,r,i){n.default.Renderer2D.prototype.updatePixels.call(this,e,t,r,i),this.setModified(!0)},n.default.Image.prototype.get=function(e,t,r,i){return n.default._validateParameters("p5.Image.get",arguments),n.default.Renderer2D.prototype.get.apply(this,arguments)},n.default.Image.prototype._getPixel=n.default.Renderer2D.prototype._getPixel,n.default.Image.prototype.set=function(e,t,r){n.default.Renderer2D.prototype.set.call(this,e,t,r),this.setModified(!0)},n.default.Image.prototype.resize=function(e,t){0===e&&0===t?(e=this.canvas.width,t=this.canvas.height):0===e?e=this.canvas.width*t/this.canvas.height:0===t&&(t=this.canvas.height*e/this.canvas.width),e=Math.floor(e),t=Math.floor(t);var r=document.createElement("canvas");if(r.width=e,r.height=t,this.gifProperties)for(var i=this.gifProperties,n=function(e,t){for(var r=0,i=0;i/g,">").replace(/"/g,""").replace(/'/g,"'")}function l(e,t){t&&!0!==t&&"true"!==t||(t="");var r="";return(e=e||"untitled")&&e.includes(".")&&(r=e.split(".").pop()),t&&r!==t&&(r=t,e="".concat(e,".").concat(r)),[e,r]}e("../core/error_helpers"),v.default.prototype.loadJSON=function(){for(var e=arguments.length,t=new Array(e),r=0;r"),n.print("");if(n.print(' '),n.print(""),n.print(""),n.print(" "),"0"!==o[0]){n.print(" ");for(var h=0;h".concat(c)),n.print(" ")}n.print(" ")}for(var f=0;f");for(var d=0;d".concat(p)),n.print(" ")}n.print(" ")}n.print("
"),n.print(""),n.print("")}n.close(),n.clear()},v.default.prototype.writeFile=function(e,t,r){var i="application/octet-stream";v.default.prototype._isSafari()&&(i="text/plain");var n=new Blob(e,{type:i});v.default.prototype.downloadFile(n,t,r)},v.default.prototype.downloadFile=function(e,t,r){var i=l(t,r),n=i[0];if(e instanceof Blob)s.default.saveAs(e,n);else{var o=document.createElement("a");if(o.href=e,o.download=n,o.onclick=function(e){var t;t=e,document.body.removeChild(t.target),e.stopPropagation()},o.style.display="none",document.body.appendChild(o),v.default.prototype._isSafari()){var a="Hello, Safari user! To download this file...\n";a+="1. Go to File --\x3e Save As.\n",a+='2. Choose "Page Source" as the Format.\n',a+='3. Name it with this extension: ."'.concat(i[1],'"'),alert(a)}o.click()}},v.default.prototype._checkFileExtension=l,v.default.prototype._isSafari=function(){return 0>>0},getSeed:function(){return t},rand:function(){return(r=(1664525*r+1013904223)%i)/i}});n.setSeed(e),_=new Array(4096);for(var o=0;o<4096;o++)_[o]=n.rand()};var o=n.default;r.default=o},{"../core/main":49}],82:[function(e,t,r){"use strict";function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i,l=(i=e("../core/main"))&&i.__esModule?i:{default:i},o=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==a(e)&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var o=i?Object.getOwnPropertyDescriptor(e,n):null;o&&(o.get||o.set)?Object.defineProperty(r,n,o):r[n]=e[n]}r.default=e,t&&t.set(e,r);return r}(e("../core/constants"));function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}l.default.Vector=function(e,t,r){var i,n,o;o=e instanceof l.default?(this.p5=e,i=t[0]||0,n=t[1]||0,t[2]||0):(i=e||0,n=t||0,r||0),this.x=i,this.y=n,this.z=o},l.default.Vector.prototype.toString=function(){return"p5.Vector Object : [".concat(this.x,", ").concat(this.y,", ").concat(this.z,"]")},l.default.Vector.prototype.set=function(e,t,r){return e instanceof l.default.Vector?(this.x=e.x||0,this.y=e.y||0,this.z=e.z||0):e instanceof Array?(this.x=e[0]||0,this.y=e[1]||0,this.z=e[2]||0):(this.x=e||0,this.y=t||0,this.z=r||0),this},l.default.Vector.prototype.copy=function(){return this.p5?new l.default.Vector(this.p5,[this.x,this.y,this.z]):new l.default.Vector(this.x,this.y,this.z)},l.default.Vector.prototype.add=function(e,t,r){return e instanceof l.default.Vector?(this.x+=e.x||0,this.y+=e.y||0,this.z+=e.z||0):e instanceof Array?(this.x+=e[0]||0,this.y+=e[1]||0,this.z+=e[2]||0):(this.x+=e||0,this.y+=t||0,this.z+=r||0),this};function u(e,t){return 0!==e&&(this.x=this.x%e),0!==t&&(this.y=this.y%t),this}function h(e,t,r){return 0!==e&&(this.x=this.x%e),0!==t&&(this.y=this.y%t),0!==r&&(this.z=this.z%r),this}l.default.Vector.prototype.rem=function(e,t,r){if(e instanceof l.default.Vector){if(Number.isFinite(e.x)&&Number.isFinite(e.y)&&Number.isFinite(e.z)){var i=parseFloat(e.x),n=parseFloat(e.y),o=parseFloat(e.z);h.call(this,i,n,o)}}else if(e instanceof Array)e.every(function(e){return Number.isFinite(e)})&&(2===e.length&&u.call(this,e[0],e[1]),3===e.length&&h.call(this,e[0],e[1],e[2]));else if(1===arguments.length){if(Number.isFinite(e)&&0!==e)return this.x=this.x%e,this.y=this.y%e,this.z=this.z%e,this}else if(2===arguments.length){var a=Array.prototype.slice.call(arguments);a.every(function(e){return Number.isFinite(e)})&&2===a.length&&u.call(this,a[0],a[1])}else if(3===arguments.length){var s=Array.prototype.slice.call(arguments);s.every(function(e){return Number.isFinite(e)})&&3===s.length&&h.call(this,s[0],s[1],s[2])}},l.default.Vector.prototype.sub=function(e,t,r){return e instanceof l.default.Vector?(this.x-=e.x||0,this.y-=e.y||0,this.z-=e.z||0):e instanceof Array?(this.x-=e[0]||0,this.y-=e[1]||0,this.z-=e[2]||0):(this.x-=e||0,this.y-=t||0,this.z-=r||0),this},l.default.Vector.prototype.mult=function(e){return"number"==typeof e&&isFinite(e)?(this.x*=e,this.y*=e,this.z*=e):console.warn("p5.Vector.prototype.mult:","n is undefined or not a finite number"),this},l.default.Vector.prototype.div=function(e){return"number"==typeof e&&isFinite(e)?0===e?console.warn("p5.Vector.prototype.div:","divide by 0"):(this.x/=e,this.y/=e,this.z/=e):console.warn("p5.Vector.prototype.div:","n is undefined or not a finite number"),this},l.default.Vector.prototype.mag=function(){return Math.sqrt(this.magSq())},l.default.Vector.prototype.magSq=function(){var e=this.x,t=this.y,r=this.z;return e*e+t*t+r*r},l.default.Vector.prototype.dot=function(e,t,r){return e instanceof l.default.Vector?this.dot(e.x,e.y,e.z):this.x*(e||0)+this.y*(t||0)+this.z*(r||0)},l.default.Vector.prototype.cross=function(e){var t=this.y*e.z-this.z*e.y,r=this.z*e.x-this.x*e.z,i=this.x*e.y-this.y*e.x;return this.p5?new l.default.Vector(this.p5,[t,r,i]):new l.default.Vector(t,r,i)},l.default.Vector.prototype.dist=function(e){return e.copy().sub(this).mag()},l.default.Vector.prototype.normalize=function(){var e=this.mag();return 0!==e&&this.mult(1/e),this},l.default.Vector.prototype.limit=function(e){var t=this.magSq();return e*e>>0},n.default.prototype.randomSeed=function(e){this._lcgSetSeed(o,e),this._gaussian_previous=!1},n.default.prototype.random=function(e,t){var r;if(n.default._validateParameters("random",arguments),r=null!=this[o]?this._lcg(o):Math.random(),void 0===e)return r;if(void 0===t)return e instanceof Array?e[Math.floor(r*e.length)]:r*e;if(tf){var P=p,L=l,k=u;p=d+f*(s&&d=t&&(r=r.substring(r.length-t,r.length)),r}},n.default.prototype.unhex=function(e){return e instanceof Array?e.map(n.default.prototype.unhex):parseInt("0x".concat(e),16)};var o=n.default;r.default=o},{"../core/main":49}],90:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i,a=(i=e("../core/main"))&&i.__esModule?i:{default:i};function n(e,t,r){var i=e<0,n=i?e.toString().substring(1):e.toString(),o=n.indexOf("."),a=-1!==o?n.substring(0,o):n,s=-1!==o?n.substring(o+1):"",l=i?"-":"";if(void 0!==r){var u="";(-1!==o||0r&&(s=s.substring(0,r));for(var h=0;hi.length)for(var o=t-(i+=-1===r?".":"").length+1,a=0;a=d.TWO_PI?"".concat("ellipse","|").concat(u,"|"):"".concat("arc","|").concat(a,"|").concat(s,"|").concat(l,"|").concat(u,"|"),!this.geometryInHash(t)){var h=new T.default.Geometry(u,1,function(){if(this.strokeIndices=[],a.toFixed(10)!==s.toFixed(10)){l!==d.PIE&&void 0!==l||(this.vertices.push(new T.default.Vector(.5,.5,0)),this.uvs.push([.5,.5]));for(var e=0;e<=u;e++){var t=(s-a)*(e/u)+a,r=.5+Math.cos(t)/2,i=.5+Math.sin(t)/2;this.vertices.push(new T.default.Vector(r,i,0)),this.uvs.push([r,i]),e>5&31)/31,(y>>10&31)/31):(r=a,i=s,l)}for(var b=1;b<=3;b++){var _=p+12*b,x=new S.default.Vector(u.getFloat32(_,!0),u.getFloat32(8+_,!0),u.getFloat32(4+_,!0));e.vertices.push(x),c&&o.push(r,i,n)}var w=new S.default.Vector(m,g,v);e.vertexNormals.push(w,w,w),e.faces.push([3*d,3*d+1,3*d+2]),e.uvs.push([0,0],[0,0],[0,0])}}(e,t);else{var r=new DataView(t);if(!("TextDecoder"in window))return console.warn("Sorry, ASCII STL loading only works in browsers that support TextDecoder (https://caniuse.com/#feat=textencoder)");var i=new TextDecoder("utf-8").decode(r).split("\n");!function(e,t){for(var r,i,n="",o=[],a=0;aMath.PI?l=Math.PI:l<=0&&(l=.001);var u=Math.sin(l)*a*Math.sin(s),h=Math.cos(l)*a,c=Math.sin(l)*a*Math.cos(s);this.camera(u+this.centerX,h+this.centerY,c+this.centerZ,this.centerX,this.centerY,this.centerZ,0,1,0)},m.default.Camera.prototype._isActive=function(){return this===this._renderer._curCamera},m.default.prototype.setCamera=function(e){this._renderer._curCamera=e,this._renderer.uPMatrix.set(e.projMatrix.mat4[0],e.projMatrix.mat4[1],e.projMatrix.mat4[2],e.projMatrix.mat4[3],e.projMatrix.mat4[4],e.projMatrix.mat4[5],e.projMatrix.mat4[6],e.projMatrix.mat4[7],e.projMatrix.mat4[8],e.projMatrix.mat4[9],e.projMatrix.mat4[10],e.projMatrix.mat4[11],e.projMatrix.mat4[12],e.projMatrix.mat4[13],e.projMatrix.mat4[14],e.projMatrix.mat4[15])};var n=m.default.Camera;r.default=n},{"../core/main":49}],98:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i,h=(i=e("../core/main"))&&i.__esModule?i:{default:i};h.default.Geometry=function(e,t,r){return this.vertices=[],this.lineVertices=[],this.lineNormals=[],this.vertexNormals=[],this.faces=[],this.uvs=[],this.edges=[],this.vertexColors=[],this.detailX=void 0!==e?e:1,this.detailY=void 0!==t?t:1,this.dirtyFlags={},r instanceof Function&&r.call(this),this},h.default.Geometry.prototype.reset=function(){this.lineVertices.length=0,this.lineNormals.length=0,this.vertices.length=0,this.edges.length=0,this.vertexColors.length=0,this.vertexNormals.length=0,this.uvs.length=0,this.dirtyFlags={}},h.default.Geometry.prototype.computeFaces=function(){this.faces.length=0;for(var e,t,r,i,n=this.detailX+1,o=0;othis.vertices.length-1-this.detailX;i--)e.add(this.vertexNormals[i]);e=h.default.Vector.div(e,this.detailX);for(var n=this.vertices.length-1;n>this.vertices.length-1-this.detailX;n--)this.vertexNormals[n]=e;return this},h.default.Geometry.prototype._makeTriangleEdges=function(){if(this.edges.length=0,Array.isArray(this.strokeIndices))for(var e=0,t=this.strokeIndices.length;e vTexCoord.y;\n bool y1 = p1.y > vTexCoord.y;\n bool y2 = p2.y > vTexCoord.y;\n\n // could web be under the curve (after t1)?\n if (y1 ? !y2 : y0) {\n // add the coverage for t1\n coverage.x += saturate(C1.x + 0.5);\n // calculate the anti-aliasing for t1\n weight.x = min(weight.x, abs(C1.x));\n }\n\n // are we outside the curve (after t2)?\n if (y1 ? !y0 : y2) {\n // subtract the coverage for t2\n coverage.x -= saturate(C2.x + 0.5);\n // calculate the anti-aliasing for t2\n weight.x = min(weight.x, abs(C2.x));\n }\n}\n\n// this is essentially the same as coverageX, but with the axes swapped\nvoid coverageY(vec2 p0, vec2 p1, vec2 p2) {\n\n vec2 C1, C2;\n calulateCrossings(p0, p1, p2, C1, C2);\n\n bool x0 = p0.x > vTexCoord.x;\n bool x1 = p1.x > vTexCoord.x;\n bool x2 = p2.x > vTexCoord.x;\n\n if (x1 ? !x2 : x0) {\n coverage.y -= saturate(C1.y + 0.5);\n weight.y = min(weight.y, abs(C1.y));\n }\n\n if (x1 ? !x0 : x2) {\n coverage.y += saturate(C2.y + 0.5);\n weight.y = min(weight.y, abs(C2.y));\n }\n}\n\nvoid main() {\n\n // calculate the pixel scale based on screen-coordinates\n pixelScale = hardness / fwidth(vTexCoord);\n\n // which grid cell is this pixel in?\n ivec2 gridCoord = ifloor(vTexCoord * vec2(uGridSize));\n\n // intersect curves in this row\n {\n // the index into the row info bitmap\n int rowIndex = gridCoord.y + uGridOffset.y;\n // fetch the info texel\n vec4 rowInfo = getTexel(uSamplerRows, rowIndex, uGridImageSize);\n // unpack the rowInfo\n int rowStrokeIndex = getInt16(rowInfo.xy);\n int rowStrokeCount = getInt16(rowInfo.zw);\n\n for (int iRowStroke = INT(0); iRowStroke < N; iRowStroke++) {\n if (iRowStroke >= rowStrokeCount)\n break;\n\n // each stroke is made up of 3 points: the start and control point\n // and the start of the next curve.\n // fetch the indices of this pair of strokes:\n vec4 strokeIndices = getTexel(uSamplerRowStrokes, rowStrokeIndex++, uCellsImageSize);\n\n // unpack the stroke index\n int strokePos = getInt16(strokeIndices.xy);\n\n // fetch the two strokes\n vec4 stroke0 = getTexel(uSamplerStrokes, strokePos + INT(0), uStrokeImageSize);\n vec4 stroke1 = getTexel(uSamplerStrokes, strokePos + INT(1), uStrokeImageSize);\n\n // calculate the coverage\n coverageX(stroke0.xy, stroke0.zw, stroke1.xy);\n }\n }\n\n // intersect curves in this column\n {\n int colIndex = gridCoord.x + uGridOffset.x;\n vec4 colInfo = getTexel(uSamplerCols, colIndex, uGridImageSize);\n int colStrokeIndex = getInt16(colInfo.xy);\n int colStrokeCount = getInt16(colInfo.zw);\n \n for (int iColStroke = INT(0); iColStroke < N; iColStroke++) {\n if (iColStroke >= colStrokeCount)\n break;\n\n vec4 strokeIndices = getTexel(uSamplerColStrokes, colStrokeIndex++, uCellsImageSize);\n\n int strokePos = getInt16(strokeIndices.xy);\n vec4 stroke0 = getTexel(uSamplerStrokes, strokePos + INT(0), uStrokeImageSize);\n vec4 stroke1 = getTexel(uSamplerStrokes, strokePos + INT(1), uStrokeImageSize);\n coverageY(stroke0.xy, stroke0.zw, stroke1.xy);\n }\n }\n\n weight = saturate(1.0 - weight * 2.0);\n float distance = max(weight.x + weight.y, minDistance); // manhattan approx.\n float antialias = abs(dot(coverage, weight) / distance);\n float cover = min(abs(coverage.x), abs(coverage.y));\n gl_FragColor = uMaterialColor;\n gl_FragColor.a *= saturate(max(antialias, cover));\n}",lineVert:"/*\n Part of the Processing project - http://processing.org\n Copyright (c) 2012-15 The Processing Foundation\n Copyright (c) 2004-12 Ben Fry and Casey Reas\n Copyright (c) 2001-04 Massachusetts Institute of Technology\n This library is free software; you can redistribute it and/or\n modify it under the terms of the GNU Lesser General Public\n License as published by the Free Software Foundation, version 2.1.\n This library is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n Lesser General Public License for more details.\n You should have received a copy of the GNU Lesser General\n Public License along with this library; if not, write to the\n Free Software Foundation, Inc., 59 Temple Place, Suite 330,\n Boston, MA 02111-1307 USA\n*/\n\n#define PROCESSING_LINE_SHADER\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform float uStrokeWeight;\n\nuniform vec4 uViewport;\nuniform int uPerspective;\n\nattribute vec4 aPosition;\nattribute vec4 aDirection;\n \nvoid main() {\n // using a scale <1 moves the lines towards the camera\n // in order to prevent popping effects due to half of\n // the line disappearing behind the geometry faces.\n vec3 scale = vec3(0.9995);\n\n vec4 posp = uModelViewMatrix * aPosition;\n vec4 posq = uModelViewMatrix * (aPosition + vec4(aDirection.xyz, 0));\n\n // Moving vertices slightly toward the camera\n // to avoid depth-fighting with the fill triangles.\n // Discussed here:\n // http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Number=252848 \n posp.xyz = posp.xyz * scale;\n posq.xyz = posq.xyz * scale;\n\n vec4 p = uProjectionMatrix * posp;\n vec4 q = uProjectionMatrix * posq;\n\n // formula to convert from clip space (range -1..1) to screen space (range 0..[width or height])\n // screen_p = (p.xy/p.w + <1,1>) * 0.5 * uViewport.zw\n\n // prevent division by W by transforming the tangent formula (div by 0 causes\n // the line to disappear, see https://github.com/processing/processing/issues/5183)\n // t = screen_q - screen_p\n //\n // tangent is normalized and we don't care which aDirection it points to (+-)\n // t = +- normalize( screen_q - screen_p )\n // t = +- normalize( (q.xy/q.w+<1,1>)*0.5*uViewport.zw - (p.xy/p.w+<1,1>)*0.5*uViewport.zw )\n //\n // extract common factor, <1,1> - <1,1> cancels out\n // t = +- normalize( (q.xy/q.w - p.xy/p.w) * 0.5 * uViewport.zw )\n //\n // convert to common divisor\n // t = +- normalize( ((q.xy*p.w - p.xy*q.w) / (p.w*q.w)) * 0.5 * uViewport.zw )\n //\n // remove the common scalar divisor/factor, not needed due to normalize and +-\n // (keep uViewport - can't remove because it has different components for x and y\n // and corrects for aspect ratio, see https://github.com/processing/processing/issues/5181)\n // t = +- normalize( (q.xy*p.w - p.xy*q.w) * uViewport.zw )\n\n vec2 tangent = normalize((q.xy*p.w - p.xy*q.w) * uViewport.zw);\n\n // flip tangent to normal (it's already normalized)\n vec2 normal = vec2(-tangent.y, tangent.x);\n\n float thickness = aDirection.w * uStrokeWeight;\n vec2 offset = normal * thickness / 2.0;\n\n vec2 curPerspScale;\n\n if(uPerspective == 1) {\n // Perspective ---\n // convert from world to clip by multiplying with projection scaling factor\n // to get the right thickness (see https://github.com/processing/processing/issues/5182)\n // invert Y, projections in Processing invert Y\n curPerspScale = (uProjectionMatrix * vec4(1, -1, 0, 0)).xy;\n } else {\n // No Perspective ---\n // multiply by W (to cancel out division by W later in the pipeline) and\n // convert from screen to clip (derived from clip to screen above)\n curPerspScale = p.w / (0.5 * uViewport.zw);\n }\n\n gl_Position.xy = p.xy + offset.xy * curPerspScale;\n gl_Position.zw = p.zw;\n}\n",lineFrag:"precision mediump float;\nprecision mediump int;\n\nuniform vec4 uMaterialColor;\n\nvoid main() {\n gl_FragColor = uMaterialColor;\n}",pointVert:"attribute vec3 aPosition;\nuniform float uPointSize;\nvarying float vStrokeWeight;\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nvoid main() {\n\tvec4 positionVec4 = vec4(aPosition, 1.0);\n\tgl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n\tgl_PointSize = uPointSize;\n\tvStrokeWeight = uPointSize;\n}",pointFrag:"precision mediump float;\nprecision mediump int;\nuniform vec4 uMaterialColor;\nvarying float vStrokeWeight;\n\nvoid main(){\n\tfloat mask = 0.0;\n\n\t// make a circular mask using the gl_PointCoord (goes from 0 - 1 on a point)\n // might be able to get a nicer edge on big strokeweights with smoothstep but slightly less performant\n\n\tmask = step(0.98, length(gl_PointCoord * 2.0 - 1.0));\n\n\t// if strokeWeight is 1 or less lets just draw a square\n\t// this prevents weird artifacting from carving circles when our points are really small\n\t// if strokeWeight is larger than 1, we just use it as is\n\n\tmask = mix(0.0, mask, clamp(floor(vStrokeWeight - 0.5),0.0,1.0));\n\n\t// throw away the borders of the mask\n // otherwise we get weird alpha blending issues\n\n\tif(mask > 0.98){\n discard;\n \t}\n\n \tgl_FragColor = vec4(uMaterialColor.rgb * (1.0 - mask), uMaterialColor.a) ;\n}"};u.default.RendererGL=function(e,t,r,i){return u.default.Renderer.call(this,e,t,r),this._setAttributeDefaults(t),this._initContext(),this.isP3D=!0,this.GL=this.drawingContext,this._isErasing=!1,this._enableLighting=!1,this.ambientLightColors=[],this.specularColors=[1,1,1],this.directionalLightDirections=[],this.directionalLightDiffuseColors=[],this.directionalLightSpecularColors=[],this.pointLightPositions=[],this.pointLightDiffuseColors=[],this.pointLightSpecularColors=[],this.spotLightPositions=[],this.spotLightDirections=[],this.spotLightDiffuseColors=[],this.spotLightSpecularColors=[],this.spotLightAngle=[],this.spotLightConc=[],this.drawMode=o.FILL,this.curFillColor=this._cachedFillStyle=[1,1,1,1],this.curStrokeColor=this._cachedStrokeStyle=[0,0,0,1],this.curBlendMode=o.BLEND,this._cachedBlendMode=void 0,this.blendExt=this.GL.getExtension("EXT_blend_minmax"),this._isBlending=!1,this._useSpecularMaterial=!1,this._useEmissiveMaterial=!1,this._useNormalMaterial=!1,this._useShininess=1,this._tint=[255,255,255,255],this.constantAttenuation=1,this.linearAttenuation=0,this.quadraticAttenuation=0,this.uMVMatrix=new u.default.Matrix,this.uPMatrix=new u.default.Matrix,this.uNMatrix=new u.default.Matrix("mat3"),this._curCamera=new u.default.Camera(this),this._curCamera._computeCameraDefaultSettings(),this._curCamera._setDefaultCamera(),this._defaultLightShader=void 0,this._defaultImmediateModeShader=void 0,this._defaultNormalShader=void 0,this._defaultColorShader=void 0,this._defaultPointShader=void 0,this.userFillShader=void 0,this.userStrokeShader=void 0,this.userPointShader=void 0,this.retainedMode={geometry:{},buffers:{stroke:[new u.default.RenderBuffer(3,"lineVertices","lineVertexBuffer","aPosition",this,this._flatten),new u.default.RenderBuffer(4,"lineNormals","lineNormalBuffer","aDirection",this,this._flatten)],fill:[new u.default.RenderBuffer(3,"vertices","vertexBuffer","aPosition",this,this._vToNArray),new u.default.RenderBuffer(3,"vertexNormals","normalBuffer","aNormal",this,this._vToNArray),new u.default.RenderBuffer(4,"vertexColors","colorBuffer","aMaterialColor",this),new u.default.RenderBuffer(3,"vertexAmbients","ambientBuffer","aAmbientColor",this),new u.default.RenderBuffer(2,"uvs","uvBuffer","aTexCoord",this,this._flatten)],text:[new u.default.RenderBuffer(3,"vertices","vertexBuffer","aPosition",this,this._vToNArray),new u.default.RenderBuffer(2,"uvs","uvBuffer","aTexCoord",this,this._flatten)]}},this.immediateMode={geometry:new u.default.Geometry,shapeMode:o.TRIANGLE_FAN,_bezierVertex:[],_quadraticVertex:[],_curveVertex:[],buffers:{fill:[new u.default.RenderBuffer(3,"vertices","vertexBuffer","aPosition",this,this._vToNArray),new u.default.RenderBuffer(3,"vertexNormals","normalBuffer","aNormal",this,this._vToNArray),new u.default.RenderBuffer(4,"vertexColors","colorBuffer","aVertexColor",this),new u.default.RenderBuffer(3,"vertexAmbients","ambientBuffer","aAmbientColor",this),new u.default.RenderBuffer(2,"uvs","uvBuffer","aTexCoord",this,this._flatten)],stroke:[new u.default.RenderBuffer(3,"lineVertices","lineVertexBuffer","aPosition",this,this._flatten),new u.default.RenderBuffer(4,"lineNormals","lineNormalBuffer","aDirection",this,this._flatten)],point:this.GL.createBuffer()}},this.pointSize=5,this.curStrokeWeight=1,this.textures=[],this.textureMode=o.IMAGE,this.textureWrapX=o.CLAMP,this.textureWrapY=o.CLAMP,this._tex=null,this._curveTightness=6,this._lookUpTableBezier=[],this._lookUpTableQuadratic=[],this._lutBezierDetail=0,this._lutQuadraticDetail=0,this._tessy=this._initTessy(),this.fontInfos={},this._curShader=void 0,this},u.default.RendererGL.prototype=Object.create(u.default.Renderer.prototype),u.default.RendererGL.prototype._setAttributeDefaults=function(e){var t={alpha:!0,depth:!0,stencil:!0,antialias:navigator.userAgent.toLowerCase().includes("safari"),premultipliedAlpha:!1,preserveDrawingBuffer:!0,perPixelLighting:!0};null===e._glAttributes?e._glAttributes=t:e._glAttributes=Object.assign(t,e._glAttributes)},u.default.RendererGL.prototype._initContext=function(){try{if(this.drawingContext=this.canvas.getContext("webgl",this._pInst._glAttributes)||this.canvas.getContext("experimental-webgl",this._pInst._glAttributes),null===this.drawingContext)throw new Error("Error creating webgl context");var e=this.drawingContext;e.enable(e.DEPTH_TEST),e.depthFunc(e.LEQUAL),e.viewport(0,0,e.drawingBufferWidth,e.drawingBufferHeight),this._viewport=this.drawingContext.getParameter(this.drawingContext.VIEWPORT)}catch(e){throw e}},u.default.RendererGL.prototype._resetContext=function(e,t){var r=this.width,i=this.height,n=this.canvas.id,o=this._pInst instanceof u.default.Graphics;if(o){var a=this._pInst;a.canvas.parentNode.removeChild(a.canvas),a.canvas=document.createElement("canvas"),(a._pInst._userNode||document.body).appendChild(a.canvas),u.default.Element.call(a,a.canvas,a._pInst),a.width=r,a.height=i}else{var s=this.canvas;s&&s.parentNode.removeChild(s),(s=document.createElement("canvas")).id=n,this._pInst._userNode?this._pInst._userNode.appendChild(s):document.body.appendChild(s),this._pInst.canvas=s}var l=new u.default.RendererGL(this._pInst.canvas,this._pInst,!o);this._pInst._setProperty("_renderer",l),l.resize(r,i),l._applyDefaults(),o||this._pInst._elements.push(l),"function"==typeof t&&setTimeout(function(){t.apply(window._renderer,e)},0)},u.default.prototype.setAttributes=function(e,t){if(void 0!==this._glAttributes){var r=!0;if(void 0!==t?(null===this._glAttributes&&(this._glAttributes={}),this._glAttributes[e]!==t&&(this._glAttributes[e]=t,r=!1)):e instanceof Object&&this._glAttributes!==e&&(this._glAttributes=e,r=!1),this._renderer.isP3D&&!r){if(!this._setupDone)for(var i in this._renderer.retainedMode.geometry)if(this._renderer.retainedMode.geometry.hasOwnProperty(i))return void console.error("Sorry, Could not set the attributes, you need to call setAttributes() before calling the other drawing methods in setup()");this.push(),this._renderer._resetContext(),this.pop(),this._renderer._curCamera&&(this._renderer._curCamera._renderer=this._renderer)}}else console.log("You are trying to use setAttributes on a p5.Graphics object that does not use a WEBGL renderer.")},u.default.RendererGL.prototype._update=function(){this.uMVMatrix.set(this._curCamera.cameraMatrix.mat4[0],this._curCamera.cameraMatrix.mat4[1],this._curCamera.cameraMatrix.mat4[2],this._curCamera.cameraMatrix.mat4[3],this._curCamera.cameraMatrix.mat4[4],this._curCamera.cameraMatrix.mat4[5],this._curCamera.cameraMatrix.mat4[6],this._curCamera.cameraMatrix.mat4[7],this._curCamera.cameraMatrix.mat4[8],this._curCamera.cameraMatrix.mat4[9],this._curCamera.cameraMatrix.mat4[10],this._curCamera.cameraMatrix.mat4[11],this._curCamera.cameraMatrix.mat4[12],this._curCamera.cameraMatrix.mat4[13],this._curCamera.cameraMatrix.mat4[14],this._curCamera.cameraMatrix.mat4[15]),this.ambientLightColors.length=0,this.specularColors=[1,1,1],this.directionalLightDirections.length=0,this.directionalLightDiffuseColors.length=0,this.directionalLightSpecularColors.length=0,this.pointLightPositions.length=0,this.pointLightDiffuseColors.length=0,this.pointLightSpecularColors.length=0,this.spotLightPositions.length=0,this.spotLightDirections.length=0,this.spotLightDiffuseColors.length=0,this.spotLightSpecularColors.length=0,this.spotLightAngle.length=0,this.spotLightConc.length=0,this._enableLighting=!1,this._tint=[255,255,255,255],this.GL.clear(this.GL.DEPTH_BUFFER_BIT)},u.default.RendererGL.prototype.background=function(){var e,t=(e=this._pInst).color.apply(e,arguments),r=t.levels[0]/255,i=t.levels[1]/255,n=t.levels[2]/255,o=t.levels[3]/255;this.GL.clearColor(r,i,n,o),this.GL.clear(this.GL.COLOR_BUFFER_BIT)},u.default.RendererGL.prototype.fill=function(e,t,r,i){var n=u.default.prototype.color.apply(this._pInst,arguments);this.curFillColor=n._array,this.drawMode=o.FILL,this._useNormalMaterial=!1,this._tex=null},u.default.RendererGL.prototype.stroke=function(e,t,r,i){arguments[3]=255;var n=u.default.prototype.color.apply(this._pInst,arguments);this.curStrokeColor=n._array},u.default.RendererGL.prototype.strokeCap=function(e){console.error("Sorry, strokeCap() is not yet implemented in WEBGL mode")},u.default.RendererGL.prototype.strokeJoin=function(e){console.error("Sorry, strokeJoin() is not yet implemented in WEBGL mode")},u.default.RendererGL.prototype.filter=function(e){console.error("filter() does not work in WEBGL mode")},u.default.RendererGL.prototype.blendMode=function(e){e===o.DARKEST||e===o.LIGHTEST||e===o.ADD||e===o.BLEND||e===o.SUBTRACT||e===o.SCREEN||e===o.EXCLUSION||e===o.REPLACE||e===o.MULTIPLY||e===o.REMOVE?this.curBlendMode=e:e!==o.BURN&&e!==o.OVERLAY&&e!==o.HARD_LIGHT&&e!==o.SOFT_LIGHT&&e!==o.DODGE||console.warn("BURN, OVERLAY, HARD_LIGHT, SOFT_LIGHT, and DODGE only work for blendMode in 2D mode.")},u.default.RendererGL.prototype.erase=function(e,t){this._isErasing||(this._cachedBlendMode=this.curBlendMode,this.blendMode(o.REMOVE),this._cachedFillStyle=this.curFillColor.slice(),this.curFillColor=[1,1,1,e/255],this._cachedStrokeStyle=this.curStrokeColor.slice(),this.curStrokeColor=[1,1,1,t/255],this._isErasing=!0)},u.default.RendererGL.prototype.noErase=function(){this._isErasing&&(this.curFillColor=this._cachedFillStyle.slice(),this.curStrokeColor=this._cachedStrokeStyle.slice(),this.blendMode(this._cachedBlendMode),this._isErasing=!1)},u.default.RendererGL.prototype.strokeWeight=function(e){this.curStrokeWeight!==e&&(this.pointSize=e,this.curStrokeWeight=e)},u.default.RendererGL.prototype._getPixel=function(e,t){var r;return r=new Uint8Array(4),this.drawingContext.readPixels(e,t,1,1,this.drawingContext.RGBA,this.drawingContext.UNSIGNED_BYTE,r),[r[0],r[1],r[2],r[3]]},u.default.RendererGL.prototype.loadPixels=function(){var e=this._pixelsState;if(!0===this._pInst._glAttributes.preserveDrawingBuffer){var t=e.pixels,r=this.GL.drawingBufferWidth*this.GL.drawingBufferHeight*4;t instanceof Uint8Array&&t.length===r||(t=new Uint8Array(r),this._pixelsState._setProperty("pixels",t));var i=this._pInst._pixelDensity;this.GL.readPixels(0,0,this.width*i,this.height*i,this.GL.RGBA,this.GL.UNSIGNED_BYTE,t)}else console.log("loadPixels only works in WebGL when preserveDrawingBuffer is true.")},u.default.RendererGL.prototype.geometryInHash=function(e){return void 0!==this.retainedMode.geometry[e]},u.default.RendererGL.prototype.resize=function(e,t){u.default.Renderer.prototype.resize.call(this,e,t),this.GL.viewport(0,0,this.GL.drawingBufferWidth,this.GL.drawingBufferHeight),this._viewport=this.GL.getParameter(this.GL.VIEWPORT),this._curCamera._resize();var r=this._pixelsState;void 0!==r.pixels&&r._setProperty("pixels",new Uint8Array(this.GL.drawingBufferWidth*this.GL.drawingBufferHeight*4))},u.default.RendererGL.prototype.clear=function(){var e=(arguments.length<=0?void 0:arguments[0])||0,t=(arguments.length<=1?void 0:arguments[1])||0,r=(arguments.length<=2?void 0:arguments[2])||0,i=(arguments.length<=3?void 0:arguments[3])||0;this.GL.clearColor(e,t,r,i),this.GL.clear(this.GL.COLOR_BUFFER_BIT|this.GL.DEPTH_BUFFER_BIT)},u.default.RendererGL.prototype.applyMatrix=function(e,t,r,i,n,o){16===arguments.length?u.default.Matrix.prototype.apply.apply(this.uMVMatrix,arguments):this.uMVMatrix.apply([e,t,0,0,r,i,0,0,0,0,1,0,n,o,0,1])},u.default.RendererGL.prototype.translate=function(e,t,r){return e instanceof u.default.Vector&&(r=e.z,t=e.y,e=e.x),this.uMVMatrix.translate([e,t,r]),this},u.default.RendererGL.prototype.scale=function(e,t,r){return this.uMVMatrix.scale(e,t,r),this},u.default.RendererGL.prototype.rotate=function(e,t){return void 0===t?this.rotateZ(e):(u.default.Matrix.prototype.rotate.apply(this.uMVMatrix,arguments),this)},u.default.RendererGL.prototype.rotateX=function(e){return this.rotate(e,1,0,0),this},u.default.RendererGL.prototype.rotateY=function(e){return this.rotate(e,0,1,0),this},u.default.RendererGL.prototype.rotateZ=function(e){return this.rotate(e,0,0,1),this},u.default.RendererGL.prototype.push=function(){var e=u.default.Renderer.prototype.push.apply(this),t=e.properties;return t.uMVMatrix=this.uMVMatrix.copy(),t.uPMatrix=this.uPMatrix.copy(),t._curCamera=this._curCamera,this._curCamera=this._curCamera.copy(),t.ambientLightColors=this.ambientLightColors.slice(),t.specularColors=this.specularColors.slice(),t.directionalLightDirections=this.directionalLightDirections.slice(),t.directionalLightDiffuseColors=this.directionalLightDiffuseColors.slice(),t.directionalLightSpecularColors=this.directionalLightSpecularColors.slice(),t.pointLightPositions=this.pointLightPositions.slice(),t.pointLightDiffuseColors=this.pointLightDiffuseColors.slice(),t.pointLightSpecularColors=this.pointLightSpecularColors.slice(),t.spotLightPositions=this.spotLightPositions.slice(),t.spotLightDirections=this.spotLightDirections.slice(),t.spotLightDiffuseColors=this.spotLightDiffuseColors.slice(),t.spotLightSpecularColors=this.spotLightSpecularColors.slice(),t.spotLightAngle=this.spotLightAngle.slice(),t.spotLightConc=this.spotLightConc.slice(),t.userFillShader=this.userFillShader,t.userStrokeShader=this.userStrokeShader,t.userPointShader=this.userPointShader,t.pointSize=this.pointSize,t.curStrokeWeight=this.curStrokeWeight,t.curStrokeColor=this.curStrokeColor,t.curFillColor=this.curFillColor,t._useSpecularMaterial=this._useSpecularMaterial,t._useEmissiveMaterial=this._useEmissiveMaterial,t._useShininess=this._useShininess,t.constantAttenuation=this.constantAttenuation,t.linearAttenuation=this.linearAttenuation,t.quadraticAttenuation=this.quadraticAttenuation,t._enableLighting=this._enableLighting,t._useNormalMaterial=this._useNormalMaterial,t._tex=this._tex,t.drawMode=this.drawMode,e},u.default.RendererGL.prototype.resetMatrix=function(){return this.uMVMatrix=u.default.Matrix.identity(this._pInst),this},u.default.RendererGL.prototype._getImmediateStrokeShader=function(){var e=this.userStrokeShader;return e&&e.isStrokeShader()?e:this._getLineShader()},u.default.RendererGL.prototype._getRetainedStrokeShader=u.default.RendererGL.prototype._getImmediateStrokeShader,u.default.RendererGL.prototype._getImmediateFillShader=function(){var e=this.userFillShader;if(this._useNormalMaterial&&(!e||!e.isNormalShader()))return this._getNormalShader();if(this._enableLighting){if(!e||!e.isLightShader())return this._getLightShader()}else if(this._tex){if(!e||!e.isTextureShader())return this._getLightShader()}else if(!e)return this._getImmediateModeShader();return e},u.default.RendererGL.prototype._getRetainedFillShader=function(){if(this._useNormalMaterial)return this._getNormalShader();var e=this.userFillShader;if(this._enableLighting){if(!e||!e.isLightShader())return this._getLightShader()}else if(this._tex){if(!e||!e.isTextureShader())return this._getLightShader()}else if(!e)return this._getColorShader();return e},u.default.RendererGL.prototype._getImmediatePointShader=function(){var e=this.userPointShader;return e&&e.isPointShader()?e:this._getPointShader()},u.default.RendererGL.prototype._getRetainedLineShader=u.default.RendererGL.prototype._getImmediateLineShader,u.default.RendererGL.prototype._getLightShader=function(){return this._defaultLightShader||(this._pInst._glAttributes.perPixelLighting?this._defaultLightShader=new u.default.Shader(this,c.phongVert,c.phongFrag):this._defaultLightShader=new u.default.Shader(this,c.lightVert,c.lightTextureFrag)),this._defaultLightShader},u.default.RendererGL.prototype._getImmediateModeShader=function(){return this._defaultImmediateModeShader||(this._defaultImmediateModeShader=new u.default.Shader(this,c.immediateVert,c.vertexColorFrag)),this._defaultImmediateModeShader},u.default.RendererGL.prototype._getNormalShader=function(){return this._defaultNormalShader||(this._defaultNormalShader=new u.default.Shader(this,c.normalVert,c.normalFrag)),this._defaultNormalShader},u.default.RendererGL.prototype._getColorShader=function(){return this._defaultColorShader||(this._defaultColorShader=new u.default.Shader(this,c.normalVert,c.basicFrag)),this._defaultColorShader},u.default.RendererGL.prototype._getPointShader=function(){return this._defaultPointShader||(this._defaultPointShader=new u.default.Shader(this,c.pointVert,c.pointFrag)),this._defaultPointShader},u.default.RendererGL.prototype._getLineShader=function(){return this._defaultLineShader||(this._defaultLineShader=new u.default.Shader(this,c.lineVert,c.lineFrag)),this._defaultLineShader},u.default.RendererGL.prototype._getFontShader=function(){return this._defaultFontShader||(this.GL.getExtension("OES_standard_derivatives"),this._defaultFontShader=new u.default.Shader(this,c.fontVert,c.fontFrag)),this._defaultFontShader},u.default.RendererGL.prototype._getEmptyTexture=function(){if(!this._emptyTexture){var e=new u.default.Image(1,1);e.set(0,0,255),this._emptyTexture=new u.default.Texture(this,e)}return this._emptyTexture},u.default.RendererGL.prototype.getTexture=function(e){var t=this.textures,r=!0,i=!1,n=void 0;try{for(var o,a=t[Symbol.iterator]();!(r=(o=a.next()).done);r=!0){var s=o.value;if(s.src===e)return s}}catch(e){i=!0,n=e}finally{try{r||null==a.return||a.return()}finally{if(i)throw n}}var l=new u.default.Texture(this,e);return t.push(l),l},u.default.RendererGL.prototype._setStrokeUniforms=function(e){e.bindShader(),e.setUniform("uMaterialColor",this.curStrokeColor),e.setUniform("uStrokeWeight",this.curStrokeWeight)},u.default.RendererGL.prototype._setFillUniforms=function(e){e.bindShader(),e.setUniform("uMaterialColor",this.curFillColor),e.setUniform("isTexture",!!this._tex),this._tex&&e.setUniform("uSampler",this._tex),e.setUniform("uTint",this._tint),e.setUniform("uSpecular",this._useSpecularMaterial),e.setUniform("uEmissive",this._useEmissiveMaterial),e.setUniform("uShininess",this._useShininess),e.setUniform("uUseLighting",this._enableLighting);var t=this.pointLightDiffuseColors.length/3;e.setUniform("uPointLightCount",t),e.setUniform("uPointLightLocation",this.pointLightPositions),e.setUniform("uPointLightDiffuseColors",this.pointLightDiffuseColors),e.setUniform("uPointLightSpecularColors",this.pointLightSpecularColors);var r=this.directionalLightDiffuseColors.length/3;e.setUniform("uDirectionalLightCount",r),e.setUniform("uLightingDirection",this.directionalLightDirections),e.setUniform("uDirectionalDiffuseColors",this.directionalLightDiffuseColors),e.setUniform("uDirectionalSpecularColors",this.directionalLightSpecularColors);var i=this.ambientLightColors.length/3;e.setUniform("uAmbientLightCount",i),e.setUniform("uAmbientColor",this.ambientLightColors);var n=this.spotLightDiffuseColors.length/3;e.setUniform("uSpotLightCount",n),e.setUniform("uSpotLightAngle",this.spotLightAngle),e.setUniform("uSpotLightConc",this.spotLightConc),e.setUniform("uSpotLightDiffuseColors",this.spotLightDiffuseColors),e.setUniform("uSpotLightSpecularColors",this.spotLightSpecularColors),e.setUniform("uSpotLightLocation",this.spotLightPositions),e.setUniform("uSpotLightDirection",this.spotLightDirections),e.setUniform("uConstantAttenuation",this.constantAttenuation),e.setUniform("uLinearAttenuation",this.linearAttenuation),e.setUniform("uQuadraticAttenuation",this.quadraticAttenuation),e.bindTextures()},u.default.RendererGL.prototype._setPointUniforms=function(e){e.bindShader(),e.setUniform("uMaterialColor",this.curStrokeColor),e.setUniform("uPointSize",this.pointSize)},u.default.RendererGL.prototype._bindBuffer=function(e,t,r,i,n){if(t=t||this.GL.ARRAY_BUFFER,this.GL.bindBuffer(t,e),void 0!==r){var o=new(i||Float32Array)(r);this.GL.bufferData(t,o,n||this.GL.STATIC_DRAW)}},u.default.RendererGL.prototype._arraysEqual=function(e,t){var r=e.length;if(r!==t.length)return!1;for(var i=0;i>7,127&f,c>>7,127&c);for(var d=0;d>7,127&p,0,0)}}return{cellImageInfo:l,dimOffset:o,dimImageInfo:n}}return(t=this.glyphInfos[e.index]={glyph:e,uGlyphRect:[i.x1,-i.y1,i.x2,-i.y2],strokeImageInfo:U,strokes:d,colInfo:G(m,this.colDimImageInfos,this.colCellImageInfos),rowInfo:G(p,this.rowDimImageInfos,this.rowCellImageInfos)}).uGridOffset=[t.colInfo.dimOffset,t.rowInfo.dimOffset],t}}var z=Math.sqrt(3);j.default.RendererGL.prototype._renderText=function(e,t,r,i,n){if(this._textFont&&"string"!=typeof this._textFont){if(!(n<=i)&&this._doFill){if(!this._isOpenType())return console.log("WEBGL: only Opentype (.otf) and Truetype (.ttf) fonts are supported"),e;e.push();var o=this._doStroke,a=this.drawMode;this._doStroke=!1,this.drawMode=D.TEXTURE;var s=this._textFont.font,l=this._textFont._fontInfo;l=l||(this._textFont._fontInfo=new A(s));var u=this._textFont._handleAlignment(this,t,r,i),h=this._textSize/s.unitsPerEm;this.translate(u.x,u.y,0),this.scale(h,h,1);var c=this.GL,f=!this._defaultFontShader,d=this._getFontShader();d.init(),d.bindShader(),f&&(d.setUniform("uGridImageSize",[64,64]),d.setUniform("uCellsImageSize",[64,64]),d.setUniform("uStrokeImageSize",[64,64]),d.setUniform("uGridSize",[9,9])),this._applyColorBlend(this.curFillColor);var p=this.retainedMode.geometry.glyph;if(!p){var m=this._textGeom=new j.default.Geometry(1,1,function(){for(var e=0;e<=1;e++)for(var t=0;t<=1;t++)this.vertices.push(new j.default.Vector(t,e,0)),this.uvs.push(t,e)});m.computeFaces().computeNormals(),p=this.createBuffers("glyph",m)}var g=!0,v=!1,y=void 0;try{for(var b,_=this.retainedMode.buffers.text[Symbol.iterator]();!(g=(b=_.next()).done);g=!0){b.value._prepareBuffer(p,d)}}catch(e){v=!0,y=e}finally{try{g||null==_.return||_.return()}finally{if(v)throw y}}this._bindBuffer(p.indexBuffer,c.ELEMENT_ARRAY_BUFFER),d.setUniform("uMaterialColor",this.curFillColor);try{var x=0,w=null,S=s.stringToGlyphs(t),M=!0,E=!1,T=void 0;try{for(var C,P=S[Symbol.iterator]();!(M=(C=P.next()).done);M=!0){var L=C.value;w&&(x+=s.getKerningValue(w,L));var k=l.getGlyphInfo(L);if(k.uGlyphRect){var R=k.rowInfo,O=k.colInfo;d.setUniform("uSamplerStrokes",k.strokeImageInfo.imageData),d.setUniform("uSamplerRowStrokes",R.cellImageInfo.imageData),d.setUniform("uSamplerRows",R.dimImageInfo.imageData),d.setUniform("uSamplerColStrokes",O.cellImageInfo.imageData),d.setUniform("uSamplerCols",O.dimImageInfo.imageData),d.setUniform("uGridOffset",k.uGridOffset),d.setUniform("uGlyphRect",k.uGlyphRect),d.setUniform("uGlyphOffset",x),d.bindTextures(),c.drawElements(c.TRIANGLES,6,this.GL.UNSIGNED_SHORT,0)}x+=L.advanceWidth,w=L}}catch(e){E=!0,T=e}finally{try{M||null==P.return||P.return()}finally{if(E)throw T}}}finally{d.unbindShader(),this._doStroke=o,this.drawMode=a,e.pop()}return e}}else console.log("WEBGL: you must load and set a font before drawing text. See `loadFont` and `textFont` for more details.")}},{"../core/constants":42,"../core/main":49,"./p5.RendererGL.Retained":102,"./p5.Shader":104}],107:[function(e,t,r){t.exports={fes:{autoplay:"The media that tried to play (with '{{src}}') wasn't allowed to by this browser, most likely due to the browser's autoplay policy. Check out {{link}} for more information about why.",fileLoadError:{bytes:"It looks like there was a problem loading your file. {{suggestion}}",font:"It looks like there was a problem loading your font. {{suggestion}}",gif:"There was some trouble loading your GIF. Make sure that your GIF is using 87a or 89a encoding.",image:"It looks like there was a problem loading your image. {{suggestion}}",json:"It looks like there was a problem loading your JSON file. {{suggestion}}",large:"If your large file isn't fetched successfully, we recommend splitting the file into smaller segments and fetching those.",strings:"It looks like there was a problem loading your text file. {{suggestion}}",suggestion:"Try checking if the file path ({{filePath}}) is correct, hosting the file online, or running a local server. (More info at {{link}})",table:"It looks like there was a problem loading your table file. {{suggestion}}",xml:"It looks like there was a problem loading your XML file. {{suggestion}}"},misusedTopLevel:"Did you just try to use p5.js's {{symbolName}} {{symbolType}}? If so, you may want to move it into your sketch's setup() function.\n\nFor more details, see: {{link}}",pre:"🌸 p5.js says: {{message}}",welcome:"Welcome! This is your friendly debugger. To turn me off, switch to using p5.min.js."}}},{}],108:[function(e,t,r){t.exports={fes:{autoplay:"Su browser impidío un medio tocar (de '{{src}}'), posiblemente porque las reglas de autoplay. Para aprender más, visite {{link}}.",fileLoadError:{bytes:"",font:"",gif:"",image:"",json:"",large:"",strings:"",suggestion:"",table:"",xml:""},misusedTopLevel:"",pre:"🌸 p5.js dice: {{message}}",welcome:""}}},{}],109:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i=o(e("./en/translation")),n=o(e("./es/translation"));function o(e){return e&&e.__esModule?e:{default:e}}var a={en:{translation:i.default},es:{translation:n.default}};r.default=a},{"./en/translation":107,"./es/translation":108}]},{},[37])(37)}); ================================================ FILE: docs/examples/pyodide/sketch_006/target/target_sketch.js ================================================ const wrapperContent = ` class PythonFunctions: pass setattr(PythonFunctions, 'map', map) setattr(PythonFunctions, 'filter', filter) setattr(PythonFunctions, 'set', set) _P5_INSTANCE = None _CTX_MIDDLE = None _DEFAULT_FILL = None _DEFAULT_LEADMULT = None _DEFAULT_STROKE = None _DEFAULT_TEXT_FILL = None ADD = None ALT = None ARROW = None AUDIO = None AUTO = None AXES = None BACKSPACE = None BASELINE = None BEVEL = None BEZIER = None BLEND = None BLUR = None BOLD = None BOLDITALIC = None BOTTOM = None BURN = None CENTER = None CHORD = None CLAMP = None CLOSE = None CONTROL = None CORNER = None CORNERS = None CROSS = None CURVE = None DARKEST = None DEG_TO_RAD = None DEGREES = None DELETE = None DIFFERENCE = None DILATE = None DODGE = None DOWN_ARROW = None ENTER = None ERODE = None ESCAPE = None EXCLUSION = None FILL = None GRAY = None GRID = None HALF_PI = None HAND = None HARD_LIGHT = None HSB = None HSL = None IMAGE = None IMMEDIATE = None INVERT = None ITALIC = None LANDSCAPE = None LEFT = None LEFT_ARROW = None LIGHTEST = None LINE_LOOP = None LINE_STRIP = None LINEAR = None LINES = None MIRROR = None MITER = None MOVE = None MULTIPLY = None NEAREST = None NORMAL = None OPAQUE = None OPEN = None OPTION = None OVERLAY = None PI = None PIE = None POINTS = None PORTRAIT = None POSTERIZE = None PROJECT = None QUAD_STRIP = None QUADRATIC = None QUADS = None QUARTER_PI = None RAD_TO_DEG = None RADIANS = None RADIUS = None REPEAT = None REPLACE = None RETURN = None RGB = None RIGHT = None RIGHT_ARROW = None ROUND = None SCREEN = None SHIFT = None SOFT_LIGHT = None SQUARE = None STROKE = None SUBTRACT = None TAB = None TAU = None TEXT = None TEXTURE = None THRESHOLD = None TOP = None TRIANGLE_FAN = None TRIANGLE_STRIP = None TRIANGLES = None TWO_PI = None UP_ARROW = None VIDEO = None WAIT = None WEBGL = None P2D = None PI = None frameCount = None focused = None displayWidth = None displayHeight = None windowWidth = None windowHeight = None width = None height = None deviceOrientation = None accelerationX = None accelerationY = None accelerationZ = None pAccelerationX = None pAccelerationY = None pAccelerationZ = None rotationX = None rotationY = None rotationZ = None pRotationX = None pRotationY = None pRotationZ = None turnAxis = None keyIsPressed = None key = None keyCode = None mouseX = None mouseY = None pmouseX = None pmouseY = None winMouseX = None winMouseY = None pwinMouseX = None pwinMouseY = None mouseButton = None mouseIsPressed = None touches = None pixels = None def alpha(*args): return _P5_INSTANCE.alpha(*args) def blue(*args): return _P5_INSTANCE.blue(*args) def brightness(*args): return _P5_INSTANCE.brightness(*args) def color(*args): return _P5_INSTANCE.color(*args) def green(*args): return _P5_INSTANCE.green(*args) def hue(*args): return _P5_INSTANCE.hue(*args) def lerpColor(*args): return _P5_INSTANCE.lerpColor(*args) def lightness(*args): return _P5_INSTANCE.lightness(*args) def red(*args): return _P5_INSTANCE.red(*args) def saturation(*args): return _P5_INSTANCE.saturation(*args) def background(*args): return _P5_INSTANCE.background(*args) def clear(*args): p5_clear = _P5_INSTANCE.clear(*args) return p5_clear def erase(*args): return _P5_INSTANCE.erase(*args) def noErase(*args): return _P5_INSTANCE.noErase(*args) def colorMode(*args): return _P5_INSTANCE.colorMode(*args) def fill(*args): return _P5_INSTANCE.fill(*args) def noFill(*args): return _P5_INSTANCE.noFill(*args) def noStroke(*args): return _P5_INSTANCE.noStroke(*args) def stroke(*args): return _P5_INSTANCE.stroke(*args) def arc(*args): return _P5_INSTANCE.arc(*args) def ellipse(*args): return _P5_INSTANCE.ellipse(*args) def circle(*args): return _P5_INSTANCE.circle(*args) def line(*args): return _P5_INSTANCE.line(*args) def point(*args): return _P5_INSTANCE.point(*args) def quad(*args): return _P5_INSTANCE.quad(*args) def rect(*args): return _P5_INSTANCE.rect(*args) def square(*args): return _P5_INSTANCE.square(*args) def triangle(*args): return _P5_INSTANCE.triangle(*args) def plane(*args): return _P5_INSTANCE.plane(*args) def box(*args): return _P5_INSTANCE.box(*args) def sphere(*args): return _P5_INSTANCE.sphere(*args) def cylinder(*args): return _P5_INSTANCE.cylinder(*args) def cone(*args): return _P5_INSTANCE.cone(*args) def ellipsoid(*args): return _P5_INSTANCE.ellipsoid(*args) def torus(*args): return _P5_INSTANCE.torus(*args) def loadModel(*args): return _P5_INSTANCE.loadModel(*args) def model(*args): return _P5_INSTANCE.model(*args) def ellipseMode(*args): return _P5_INSTANCE.ellipseMode(*args) def noSmooth(*args): return _P5_INSTANCE.noSmooth(*args) def rectMode(*args): return _P5_INSTANCE.rectMode(*args) def smooth(*args): return _P5_INSTANCE.smooth(*args) def strokeCap(*args): return _P5_INSTANCE.strokeCap(*args) def strokeJoin(*args): return _P5_INSTANCE.strokeJoin(*args) def strokeWeight(*args): return _P5_INSTANCE.strokeWeight(*args) def bezier(*args): return _P5_INSTANCE.bezier(*args) def bezierDetail(*args): return _P5_INSTANCE.bezierDetail(*args) def bezierPoint(*args): return _P5_INSTANCE.bezierPoint(*args) def bezierTangent(*args): return _P5_INSTANCE.bezierTangent(*args) def curve(*args): return _P5_INSTANCE.curve(*args) def curveDetail(*args): return _P5_INSTANCE.curveDetail(*args) def curveTightness(*args): return _P5_INSTANCE.curveTightness(*args) def curvePoint(*args): return _P5_INSTANCE.curvePoint(*args) def curveTangent(*args): return _P5_INSTANCE.curveTangent(*args) def beginContour(*args): return _P5_INSTANCE.beginContour(*args) def beginShape(*args): return _P5_INSTANCE.beginShape(*args) def bezierVertex(*args): return _P5_INSTANCE.bezierVertex(*args) def curveVertex(*args): return _P5_INSTANCE.curveVertex(*args) def endContour(*args): return _P5_INSTANCE.endContour(*args) def endShape(*args): return _P5_INSTANCE.endShape(*args) def quadraticVertex(*args): return _P5_INSTANCE.quadraticVertex(*args) def vertex(*args): return _P5_INSTANCE.vertex(*args) def cursor(*args): return _P5_INSTANCE.cursor(*args) def frameRate(*args): return _P5_INSTANCE.frameRate(*args) def noCursor(*args): return _P5_INSTANCE.noCursor(*args) def fullscreen(*args): return _P5_INSTANCE.fullscreen(*args) def pixelDensity(*args): return _P5_INSTANCE.pixelDensity(*args) def displayDensity(*args): return _P5_INSTANCE.displayDensity(*args) def getURL(*args): return _P5_INSTANCE.getURL(*args) def getURLPath(*args): return _P5_INSTANCE.getURLPath(*args) def getURLParams(*args): return _P5_INSTANCE.getURLParams(*args) def remove(*args): return _P5_INSTANCE.remove(*args) def noLoop(*args): return _P5_INSTANCE.noLoop(*args) def loop(*args): return _P5_INSTANCE.loop(*args) def push(*args): return _P5_INSTANCE.push(*args) def redraw(*args): return _P5_INSTANCE.redraw(*args) def resizeCanvas(*args): return _P5_INSTANCE.resizeCanvas(*args) def noCanvas(*args): return _P5_INSTANCE.noCanvas(*args) def createGraphics(*args): return _P5_INSTANCE.createGraphics(*args) def blendMode(*args): return _P5_INSTANCE.blendMode(*args) def setAttributes(*args): return _P5_INSTANCE.setAttributes(*args) def applyMatrix(*args): return _P5_INSTANCE.applyMatrix(*args) def resetMatrix(*args): return _P5_INSTANCE.resetMatrix(*args) def rotate(*args): return _P5_INSTANCE.rotate(*args) def rotateX(*args): return _P5_INSTANCE.rotateX(*args) def rotateY(*args): return _P5_INSTANCE.rotateY(*args) def rotateZ(*args): return _P5_INSTANCE.rotateZ(*args) def scale(*args): return _P5_INSTANCE.scale(*args) def shearX(*args): return _P5_INSTANCE.shearX(*args) def shearY(*args): return _P5_INSTANCE.shearY(*args) def translate(*args): return _P5_INSTANCE.translate(*args) def createStringDict(*args): return _P5_INSTANCE.createStringDict(*args) def createNumberDict(*args): return _P5_INSTANCE.createNumberDict(*args) def append(*args): return _P5_INSTANCE.append(*args) def arrayCopy(*args): return _P5_INSTANCE.arrayCopy(*args) def concat(*args): return _P5_INSTANCE.concat(*args) def reverse(*args): return _P5_INSTANCE.reverse(*args) def shorten(*args): return _P5_INSTANCE.shorten(*args) def shuffle(*args): return _P5_INSTANCE.shuffle(*args) def sort(*args): return _P5_INSTANCE.sort(*args) def splice(*args): return _P5_INSTANCE.splice(*args) def subset(*args): return _P5_INSTANCE.subset(*args) def float(*args): return _P5_INSTANCE.float(*args) def int(*args): return _P5_INSTANCE.int(*args) def str(*args): return _P5_INSTANCE.str(*args) def boolean(*args): return _P5_INSTANCE.boolean(*args) def byte(*args): return _P5_INSTANCE.byte(*args) def char(*args): return _P5_INSTANCE.char(*args) def unchar(*args): return _P5_INSTANCE.unchar(*args) def hex(*args): return _P5_INSTANCE.hex(*args) def unhex(*args): return _P5_INSTANCE.unhex(*args) def join(*args): return _P5_INSTANCE.join(*args) def match(*args): return _P5_INSTANCE.match(*args) def matchAll(*args): return _P5_INSTANCE.matchAll(*args) def nf(*args): return _P5_INSTANCE.nf(*args) def nfc(*args): return _P5_INSTANCE.nfc(*args) def nfp(*args): return _P5_INSTANCE.nfp(*args) def nfs(*args): return _P5_INSTANCE.nfs(*args) def split(*args): return _P5_INSTANCE.split(*args) def splitTokens(*args): return _P5_INSTANCE.splitTokens(*args) def trim(*args): return _P5_INSTANCE.trim(*args) def setMoveThreshold(*args): return _P5_INSTANCE.setMoveThreshold(*args) def setShakeThreshold(*args): return _P5_INSTANCE.setShakeThreshold(*args) def keyIsDown(*args): return _P5_INSTANCE.keyIsDown(*args) def createImage(*args): return _P5_INSTANCE.createImage(*args) def saveCanvas(*args): return _P5_INSTANCE.saveCanvas(*args) def saveFrames(*args): return _P5_INSTANCE.saveFrames(*args) def loadImage(*args): return _P5_INSTANCE.loadImage(*args) def image(*args): return _P5_INSTANCE.image(*args) def tint(*args): return _P5_INSTANCE.tint(*args) def noTint(*args): return _P5_INSTANCE.noTint(*args) def imageMode(*args): return _P5_INSTANCE.imageMode(*args) def blend(*args): return _P5_INSTANCE.blend(*args) def copy(*args): return _P5_INSTANCE.copy(*args) def filter(*args): if len(args) > 1 and (args[0] is None or callable(args[0])): return PythonFunctions.filter(*args) else: return _P5_INSTANCE.filter(*args) def get(*args): return _P5_INSTANCE.get(*args) def loadPixels(*args): return _P5_INSTANCE.loadPixels(*args) def set(*args): if len(args) <= 1: return PythonFunctions.set(*args) else: return _P5_INSTANCE.set(*args) def updatePixels(*args): return _P5_INSTANCE.updatePixels(*args) def loadJSON(*args): return _P5_INSTANCE.loadJSON(*args) def loadStrings(*args): return _P5_INSTANCE.loadStrings(*args) def loadTable(*args): return _P5_INSTANCE.loadTable(*args) def loadXML(*args): return _P5_INSTANCE.loadXML(*args) def loadBytes(*args): return _P5_INSTANCE.loadBytes(*args) def httpGet(*args): return _P5_INSTANCE.httpGet(*args) def httpPost(*args): return _P5_INSTANCE.httpPost(*args) def httpDo(*args): return _P5_INSTANCE.httpDo(*args) def createWriter(*args): return _P5_INSTANCE.createWriter(*args) def save(*args): return _P5_INSTANCE.save(*args) def saveJSON(*args): return _P5_INSTANCE.saveJSON(*args) def saveStrings(*args): return _P5_INSTANCE.saveStrings(*args) def saveTable(*args): return _P5_INSTANCE.saveTable(*args) def day(*args): return _P5_INSTANCE.day(*args) def hour(*args): return _P5_INSTANCE.hour(*args) def minute(*args): return _P5_INSTANCE.minute(*args) def millis(*args): return _P5_INSTANCE.millis(*args) def month(*args): return _P5_INSTANCE.month(*args) def second(*args): return _P5_INSTANCE.second(*args) def year(*args): return _P5_INSTANCE.year(*args) def createVector(*args): return _P5_INSTANCE.createVector(*args) def abs(*args): return _P5_INSTANCE.abs(*args) def ceil(*args): return _P5_INSTANCE.ceil(*args) def constrain(*args): return _P5_INSTANCE.constrain(*args) def dist(*args): return _P5_INSTANCE.dist(*args) def exp(*args): return _P5_INSTANCE.exp(*args) def floor(*args): return _P5_INSTANCE.floor(*args) def lerp(*args): return _P5_INSTANCE.lerp(*args) def log(*args): return _P5_INSTANCE.log(*args) def mag(*args): return _P5_INSTANCE.mag(*args) def map(*args): if len(args) > 1 and callable(args[0]): return PythonFunctions.map(*args) else: return _P5_INSTANCE.map(*args) def max(*args): return _P5_INSTANCE.max(*args) def min(*args): return _P5_INSTANCE.min(*args) def norm(*args): return _P5_INSTANCE.norm(*args) def pow(*args): return _P5_INSTANCE.pow(*args) def round(*args): return _P5_INSTANCE.round(*args) def sq(*args): return _P5_INSTANCE.sq(*args) def sqrt(*args): return _P5_INSTANCE.sqrt(*args) def noise(*args): return _P5_INSTANCE.noise(*args) def noiseDetail(*args): return _P5_INSTANCE.noiseDetail(*args) def noiseSeed(*args): return _P5_INSTANCE.noiseSeed(*args) def randomSeed(*args): return _P5_INSTANCE.randomSeed(*args) def random(*args): return _P5_INSTANCE.random(*args) def randomGaussian(*args): return _P5_INSTANCE.randomGaussian(*args) def acos(*args): return _P5_INSTANCE.acos(*args) def asin(*args): return _P5_INSTANCE.asin(*args) def atan(*args): return _P5_INSTANCE.atan(*args) def atan2(*args): return _P5_INSTANCE.atan2(*args) def cos(*args): return _P5_INSTANCE.cos(*args) def sin(*args): return _P5_INSTANCE.sin(*args) def tan(*args): return _P5_INSTANCE.tan(*args) def degrees(*args): return _P5_INSTANCE.degrees(*args) def radians(*args): return _P5_INSTANCE.radians(*args) def angleMode(*args): return _P5_INSTANCE.angleMode(*args) def textAlign(*args): return _P5_INSTANCE.textAlign(*args) def textLeading(*args): return _P5_INSTANCE.textLeading(*args) def textSize(*args): return _P5_INSTANCE.textSize(*args) def textStyle(*args): return _P5_INSTANCE.textStyle(*args) def textWidth(*args): return _P5_INSTANCE.textWidth(*args) def textAscent(*args): return _P5_INSTANCE.textAscent(*args) def textDescent(*args): return _P5_INSTANCE.textDescent(*args) def loadFont(*args): return _P5_INSTANCE.loadFont(*args) def text(*args): return _P5_INSTANCE.text(*args) def textFont(*args): return _P5_INSTANCE.textFont(*args) def orbitControl(*args): return _P5_INSTANCE.orbitControl(*args) def debugMode(*args): return _P5_INSTANCE.debugMode(*args) def noDebugMode(*args): return _P5_INSTANCE.noDebugMode(*args) def ambientLight(*args): return _P5_INSTANCE.ambientLight(*args) def directionalLight(*args): return _P5_INSTANCE.directionalLight(*args) def pointLight(*args): return _P5_INSTANCE.pointLight(*args) def lights(*args): return _P5_INSTANCE.lights(*args) def loadShader(*args): return _P5_INSTANCE.loadShader(*args) def createShader(*args): return _P5_INSTANCE.createShader(*args) def shader(*args): return _P5_INSTANCE.shader(*args) def resetShader(*args): return _P5_INSTANCE.resetShader(*args) def normalMaterial(*args): return _P5_INSTANCE.normalMaterial(*args) def texture(*args): return _P5_INSTANCE.texture(*args) def textureMode(*args): return _P5_INSTANCE.textureMode(*args) def textureWrap(*args): return _P5_INSTANCE.textureWrap(*args) def ambientMaterial(*args): return _P5_INSTANCE.ambientMaterial(*args) def specularMaterial(*args): return _P5_INSTANCE.specularMaterial(*args) def shininess(*args): return _P5_INSTANCE.shininess(*args) def camera(*args): return _P5_INSTANCE.camera(*args) def perspective(*args): return _P5_INSTANCE.perspective(*args) def ortho(*args): return _P5_INSTANCE.ortho(*args) def createCamera(*args): return _P5_INSTANCE.createCamera(*args) def setCamera(*args): return _P5_INSTANCE.setCamera(*args) def select(*args): return _P5_INSTANCE.select(*args) def selectAll(*args): return _P5_INSTANCE.selectAll(*args) def removeElements(*args): return _P5_INSTANCE.removeElements(*args) def changed(*args): return _P5_INSTANCE.changed(*args) def input(*args): return _P5_INSTANCE.input(*args) def createDiv(*args): return _P5_INSTANCE.createDiv(*args) def createP(*args): return _P5_INSTANCE.createP(*args) def createSpan(*args): return _P5_INSTANCE.createSpan(*args) def createImg(*args): return _P5_INSTANCE.createImg(*args) def createA(*args): return _P5_INSTANCE.createA(*args) def createSlider(*args): return _P5_INSTANCE.createSlider(*args) def createButton(*args): return _P5_INSTANCE.createButton(*args) def createCheckbox(*args): return _P5_INSTANCE.createCheckbox(*args) def createSelect(*args): return _P5_INSTANCE.createSelect(*args) def createRadio(*args): return _P5_INSTANCE.createRadio(*args) def createColorPicker(*args): return _P5_INSTANCE.createColorPicker(*args) def createInput(*args): return _P5_INSTANCE.createInput(*args) def createFileInput(*args): return _P5_INSTANCE.createFileInput(*args) def createVideo(*args): return _P5_INSTANCE.createVideo(*args) def createAudio(*args): return _P5_INSTANCE.createAudio(*args) def createCapture(*args): return _P5_INSTANCE.createCapture(*args) def createElement(*args): return _P5_INSTANCE.createElement(*args) def createCanvas(*args): canvas = _P5_INSTANCE.createCanvas(*args) global width, height width = _P5_INSTANCE.width height = _P5_INSTANCE.height return canvas def __deviceMoved(e): try: _bind_event_function(deviceMoved, e) except NameError: pass def __deviceTurned(e): try: _bind_event_function(deviceTurned, e) except NameError: pass def __deviceShaken(e): try: _bind_event_function(deviceShaken, e) except NameError: pass def __touchEnded(e): try: _bind_event_function(deviceShaken, e) except NameError: pass def __touchStarted(e): try: _bind_event_function(touchStarted, e) except NameError: pass def __windowResized(e): try: _bind_event_function(windowResized, e) except NameError: pass def __touchMoved(e): try: _bind_event_function(touchMoved, e) except NameError: pass def __mouseMoved(e): try: _bind_event_function(mouseMoved, e) except NameError: pass def __mouseDragged(e): try: _bind_event_function(mouseDragged, e) except NameError: pass def __mousePressed(e): try: _bind_event_function(mousePressed, e) except NameError: pass def __mouseReleased(e): try: _bind_event_function(mouseReleased, e) except NameError: pass def __mouseClicked(e): try: _bind_event_function(mouseClicked, e) except NameError: pass def __doubleClicked(e): try: _bind_event_function(doubleClicked, e) except NameError: pass def __mouseWheel(e): try: _bind_event_function(mouseWheel, e) except NameError: pass def __keyPressed(e): try: _bind_event_function(keyPressed, e) except NameError: pass def __keyReleased(e): try: _bind_event_function(keyReleased, e) except NameError: pass def __keyTyped(e): try: _bind_event_function(keyTyped, e) except NameError: pass def __keyIsDown(e): try: _bind_event_function(keyIsDown, e) except NameError: pass def pop(*args): p5_pop = _P5_INSTANCE.pop(*args) return p5_pop # Processing Python or Java mode compatibility aliases size = createCanvas popMatrix = pop popStyle = pop pushMatrix = push pushStyle = push # PVector is a wrapper/helper class for p5.Vector objets # providing names similar to Processing Python or Java modes # but mostly keeping p5js functionality from numbers import Number class PVector: def __init__(self, x=0, y=0, z=0): self.__vector = createVector(x, y, z) self.add = self.__instance_add__ self.sub = self.__instance_sub__ self.mult = self.__instance_mult__ self.div = self.__instance_div__ self.cross = self.__instance_cross__ self.dist = self.__instance_dist__ self.dot = self.__instance_dot__ self.lerp = self.__instance_lerp__ @property def x(self): return self.__vector.x @x.setter def x(self, x): self.__vector.x = x @property def y(self): return self.__vector.y @y.setter def y(self, y): self.__vector.y = y @property def z(self): return self.__vector.z @z.setter def z(self, z): self.__vector.z = z def mag(self): return self.__vector.mag() def magSq(self): return self.__vector.magSq() def setMag(self, mag): self.__vector.setMag(mag) return self def normalize(self): self.__vector.normalize() return self def limit(self, max): self.__vector.limit(max) return self def heading(self): return self.__vector.heading() def rotate(self, angle): self.__vector.rotate(angle) return self def __instance_add__(self, *args): if len(args) == 1: return PVector.add(self, args[0], self) else: return PVector.add(self, PVector(*args), self) def __instance_sub__(self, *args): if len(args) == 1: return PVector.sub(self, args[0], self) else: return PVector.sub(self, PVector(*args), self) def __instance_mult__(self, o): return PVector.mult(self, o, self) def __instance_div__(self, f): return PVector.div(self, f, self) def __instance_cross__(self, o): return PVector.cross(self, o, self) def __instance_dist__(self, o): return PVector.dist(self, o) def __instance_dot__(self, *args): if len(args) == 1: v = args[0] else: v = args return self.x * v[0] + self.y * v[1] + self.z * v[2] def __instance_lerp__(self, *args): if len(args) == 2: return PVector.lerp(self, args[0], args[1], self) else: vx, vy, vz, f = args return PVector.lerp(self, PVector(vx, vy, vz), f, self) def get(self): return PVector(self.x, self.y, self.z) def copy(self): return PVector(self.x, self.y, self.z) def __getitem__(self, k): return getattr(self, ('x', 'y', 'z')[k]) def __setitem__(self, k, v): setattr(self, ('x', 'y', 'z')[k], v) def __copy__(self): return PVector(self.x, self.y, self.z) def __deepcopy__(self, memo): return PVector(self.x, self.y, self.z) def __repr__(self): # PROVISÓRIO return f'PVector({self.x}, {self.y}, {self.z})' def set(self, *args): """ Sets the x, y, and z component of the vector using two or three separate variables, the data from a p5.Vector, or the values from a float array. """ self.__vector.set(*args) @classmethod def add(cls, a, b, dest=None): if dest is None: return PVector(a.x + b[0], a.y + b[1], a.z + b[2]) dest.__vector.set(a.x + b[0], a.y + b[1], a.z + b[2]) return dest @classmethod def sub(cls, a, b, dest=None): if dest is None: return PVector(a.x - b[0], a.y - b[1], a.z - b[2]) dest.__vector.set(a.x - b[0], a.y - b[1], a.z - b[2]) return dest @classmethod def mult(cls, a, b, dest=None): if dest is None: return PVector(a.x * b, a.y * b, a.z * b) dest.__vector.set(a.x * b, a.y * b, a.z * b) return dest @classmethod def div(cls, a, b, dest=None): if dest is None: return PVector(a.x / b, a.y / b, a.z / b) dest.__vector.set(a.x / b, a.y / b, a.z / b) return dest @classmethod def dist(cls, a, b): return a.__vector.dist(b.__vector) @classmethod def dot(cls, a, b): return a.__vector.dot(b.__vector) def __add__(a, b): return PVector.add(a, b, None) def __sub__(a, b): return PVector.sub(a, b, None) def __isub__(a, b): a.sub(b) return a def __iadd__(a, b): a.add(b) return a def __mul__(a, b): if not isinstance(b, Number): raise TypeError( "The * operator can only be used to multiply a PVector by a number") return PVector.mult(a, float(b), None) def __rmul__(a, b): if not isinstance(b, Number): raise TypeError( "The * operator can only be used to multiply a PVector by a number") return PVector.mult(a, float(b), None) def __imul__(a, b): if not isinstance(b, Number): raise TypeError( "The *= operator can only be used to multiply a PVector by a number") a.__vector.mult(float(b)) return a def __truediv__(a, b): if not isinstance(b, Number): raise TypeError( "The * operator can only be used to multiply a PVector by a number") return PVector(a.x / float(b), a.y / float(b), a.z / float(b)) def __itruediv__(a, b): if not isinstance(b, Number): raise TypeError( "The /= operator can only be used to multiply a PVector by a number") a.__vector.set(a.x / float(b), a.y / float(b), a.z / float(b)) return a def __eq__(a, b): return a.x == b[0] and a.y == b[1] and a.z == b[2] def __lt__(a, b): return a.magSq() < b.magSq() def __le__(a, b): return a.magSq() <= b.magSq() def __gt__(a, b): return a.magSq() > b.magSq() def __ge__(a, b): return a.magSq() >= b.magSq() # Problematic class methods, we would rather use p5.Vector when possible... @classmethod def lerp(cls, a, b, f, dest=None): v = createVector(a.x, a.y, a.z) v.lerp(b.__vector, f) if dest is None: return PVector(v.x, v.y, v.z) dest.set(v.x, v.y, v.z) return dest @classmethod def cross(cls, a, b, dest=None): x = a.y * b[2] - b[1] * a.z y = a.z * b[0] - b[2] * a.x z = a.x * b[1] - b[0] * a.y if dest is None: return PVector(x, y, z) dest.set(x, y, z) return dest @classmethod def fromAngle(cls, angle, length=1): # https://github.com/processing/p5.js/blob/3f0b2f0fe575dc81c724474154f5b23a517b7233/src/math/p5.Vector.js return PVector(length * cos(angle), length * sin(angle), 0) @classmethod def fromAngles(theta, phi, length=1): # https://github.com/processing/p5.js/blob/3f0b2f0fe575dc81c724474154f5b23a517b7233/src/math/p5.Vector.js cosPhi = cos(phi) sinPhi = sin(phi) cosTheta = cos(theta) sinTheta = sin(theta) return PVector(length * sinTheta * sinPhi, -length * cosTheta, length * sinTheta * cosPhi) @classmethod def random2D(cls): return PVector.fromAngle(random(TWO_PI)) @classmethod def random3D(cls, dest=None): angle = random(TWO_PI) vz = random(2) - 1 mult = sqrt(1 - vz * vz) vx = mult * cos(angle) vy = mult * sin(angle) if dest is None: return PVector(vx, vy, vz) dest.set(vx, vy, vz) return dest @classmethod def angleBetween(cls, a, b): return acos(a.dot(b) / sqrt(a.magSq() * b.magSq())) # Other harmless p5js methods def equals(self, v): return self == v def heading2D(self): return self.__vector.heading() def reflect(self, *args): # Reflect the incoming vector about a normal to a line in 2D, or about # a normal to a plane in 3D This method acts on the vector directly r = self.__vector.reflect(*args) return r def array(self): # Return a representation of this vector as a float array. This is only # for temporary use. If used in any w fashion, the contents should be # copied by using the p5.Vector.copy() method to copy into your own # array. return self.__vector.array() def toString(self): # Returns a string representation of a vector v by calling String(v) or v.toString(). # return self.__vector.toString() would be something like "p5.vector # Object […, …, …]" return str(self) def rem(self, *args): # Gives remainder of a vector when it is divided by anw vector. See # examples for more context. self.__vector.rem(*args) return self def pre_draw(p5_instance, draw_func, *args, **kwargs): """ We need to run this before the actual draw to insert and update p5 env variables """ global _CTX_MIDDLE, _DEFAULT_FILL, _DEFAULT_LEADMULT, _DEFAULT_STROKE, _DEFAULT_TEXT_FILL global ADD, ALT, ARROW, AUTO, AUDIO, AXES, BACKSPACE, BASELINE, BEVEL, BEZIER, BLEND, BLUR, BOLD, BOLDITALIC global BOTTOM, BURN, CENTER, CHORD, CLAMP, CLOSE, CONTROL, CORNER, CORNERS, CROSS, CURVE, DARKEST global DEG_TO_RAD, DEGREES, DELETE, DIFFERENCE, DILATE, DODGE, DOWN_ARROW, ENTER, ERODE, ESCAPE, EXCLUSION global FILL, GRAY, GRID, HALF_PI, HAND, HARD_LIGHT, HSB, HSL, IMAGE, IMMEDIATE, INVERT, ITALIC, LANDSCAPE global LEFT, LEFT_ARROW, LIGHTEST, LINE_LOOP, LINE_STRIP, LINEAR, LINES, MIRROR, MITER, MOVE, MULTIPLY, NEAREST global NORMAL, OPAQUE, OPEN, OPTION, OVERLAY, P2D, P3D, PI, PIE, POINTS, PORTRAIT, POSTERIZE, PROJECT, QUAD_STRIP global QUADRATIC, QUADS, QUARTER_PI, RAD_TO_DEG, RADIANS, RADIUS, REPEAT, REPLACE, RETURN, RGB, RIGHT, RIGHT_ARROW global ROUND, SCREEN, SHIFT, SOFT_LIGHT, SQUARE, STROKE, SUBTRACT, TAB, TAU, TEXT, TEXTURE, THRESHOLD, TOP global TRIANGLE_FAN, TRIANGLE_STRIP, TRIANGLES, TWO_PI, UP_ARROW, VIDEO, WAIT, WEBGL global frameCount, focused, displayWidth, displayHeight, windowWidth, windowHeight, width, height global deviceOrientation, accelerationX, accelerationY, accelerationZ global pAccelerationX, pAccelerationY, pAccelerationZ, rotationX, rotationY, rotationZ global pRotationX, pRotationY, pRotationZ, turnAxis, keyIsPressed, key, keyCode, mouseX, mouseY, pmouseX, pmouseY global winMouseX, winMouseY, pwinMouseX, pwinMouseY, mouseButton, mouseIsPressed, touches, pixels _CTX_MIDDLE = p5_instance._CTX_MIDDLE _DEFAULT_FILL = p5_instance._DEFAULT_FILL _DEFAULT_LEADMULT = p5_instance._DEFAULT_LEADMULT _DEFAULT_STROKE = p5_instance._DEFAULT_STROKE _DEFAULT_TEXT_FILL = p5_instance._DEFAULT_TEXT_FILL ADD = p5_instance.ADD ALT = p5_instance.ALT ARROW = p5_instance.ARROW AUDIO = p5_instance.AUDIO AUTO = p5_instance.AUTO AXES = p5_instance.AXES BACKSPACE = p5_instance.BACKSPACE BASELINE = p5_instance.BASELINE BEVEL = p5_instance.BEVEL BEZIER = p5_instance.BEZIER BLEND = p5_instance.BLEND BLUR = p5_instance.BLUR BOLD = p5_instance.BOLD BOLDITALIC = p5_instance.BOLDITALIC BOTTOM = p5_instance.BOTTOM BURN = p5_instance.BURN CENTER = p5_instance.CENTER CHORD = p5_instance.CHORD CLAMP = p5_instance.CLAMP CLOSE = p5_instance.CLOSE CONTROL = p5_instance.CONTROL CORNER = p5_instance.CORNER CORNERS = p5_instance.CORNERS CROSS = p5_instance.CROSS CURVE = p5_instance.CURVE DARKEST = p5_instance.DARKEST DEG_TO_RAD = p5_instance.DEG_TO_RAD DEGREES = p5_instance.DEGREES DELETE = p5_instance.DELETE DIFFERENCE = p5_instance.DIFFERENCE DILATE = p5_instance.DILATE DODGE = p5_instance.DODGE DOWN_ARROW = p5_instance.DOWN_ARROW ENTER = p5_instance.ENTER ERODE = p5_instance.ERODE ESCAPE = p5_instance.ESCAPE EXCLUSION = p5_instance.EXCLUSION FILL = p5_instance.FILL GRAY = p5_instance.GRAY GRID = p5_instance.GRID HALF_PI = p5_instance.HALF_PI HAND = p5_instance.HAND HARD_LIGHT = p5_instance.HARD_LIGHT HSB = p5_instance.HSB HSL = p5_instance.HSL IMAGE = p5_instance.IMAGE IMMEDIATE = p5_instance.IMMEDIATE INVERT = p5_instance.INVERT ITALIC = p5_instance.ITALIC LANDSCAPE = p5_instance.LANDSCAPE LEFT = p5_instance.LEFT LEFT_ARROW = p5_instance.LEFT_ARROW LIGHTEST = p5_instance.LIGHTEST LINE_LOOP = p5_instance.LINE_LOOP LINE_STRIP = p5_instance.LINE_STRIP LINEAR = p5_instance.LINEAR LINES = p5_instance.LINES MIRROR = p5_instance.MIRROR MITER = p5_instance.MITER MOVE = p5_instance.MOVE MULTIPLY = p5_instance.MULTIPLY NEAREST = p5_instance.NEAREST NORMAL = p5_instance.NORMAL OPAQUE = p5_instance.OPAQUE OPEN = p5_instance.OPEN OPTION = p5_instance.OPTION OVERLAY = p5_instance.OVERLAY P2D = p5_instance.P2D P3D = p5_instance.WEBGL PI = p5_instance.PI PIE = p5_instance.PIE POINTS = p5_instance.POINTS PORTRAIT = p5_instance.PORTRAIT POSTERIZE = p5_instance.POSTERIZE PROJECT = p5_instance.PROJECT QUAD_STRIP = p5_instance.QUAD_STRIP QUADRATIC = p5_instance.QUADRATIC QUADS = p5_instance.QUADS QUARTER_PI = p5_instance.QUARTER_PI RAD_TO_DEG = p5_instance.RAD_TO_DEG RADIANS = p5_instance.RADIANS RADIUS = p5_instance.RADIUS REPEAT = p5_instance.REPEAT REPLACE = p5_instance.REPLACE RETURN = p5_instance.RETURN RGB = p5_instance.RGB RIGHT = p5_instance.RIGHT RIGHT_ARROW = p5_instance.RIGHT_ARROW ROUND = p5_instance.ROUND SCREEN = p5_instance.SCREEN SHIFT = p5_instance.SHIFT SOFT_LIGHT = p5_instance.SOFT_LIGHT SQUARE = p5_instance.SQUARE STROKE = p5_instance.STROKE SUBTRACT = p5_instance.SUBTRACT TAB = p5_instance.TAB TAU = p5_instance.TAU TEXT = p5_instance.TEXT TEXTURE = p5_instance.TEXTURE THRESHOLD = p5_instance.THRESHOLD TOP = p5_instance.TOP TRIANGLE_FAN = p5_instance.TRIANGLE_FAN TRIANGLE_STRIP = p5_instance.TRIANGLE_STRIP TRIANGLES = p5_instance.TRIANGLES TWO_PI = p5_instance.TWO_PI UP_ARROW = p5_instance.UP_ARROW VIDEO = p5_instance.VIDEO WAIT = p5_instance.WAIT WEBGL = p5_instance.WEBGL frameCount = p5_instance.frameCount focused = p5_instance.focused displayWidth = p5_instance.displayWidth displayHeight = p5_instance.displayHeight windowWidth = p5_instance.windowWidth windowHeight = p5_instance.windowHeight width = p5_instance.width height = p5_instance.height deviceOrientation = p5_instance.deviceOrientation accelerationX = p5_instance.accelerationX accelerationY = p5_instance.accelerationY accelerationZ = p5_instance.accelerationZ pAccelerationX = p5_instance.pAccelerationX pAccelerationY = p5_instance.pAccelerationY pAccelerationZ = p5_instance.pAccelerationZ rotationX = p5_instance.rotationX rotationY = p5_instance.rotationY rotationZ = p5_instance.rotationZ pRotationX = p5_instance.pRotationX pRotationY = p5_instance.pRotationY pRotationZ = p5_instance.pRotationZ turnAxis = p5_instance.turnAxis keyIsPressed = p5_instance.keyIsPressed key = p5_instance.key keyCode = p5_instance.keyCode mouseX = p5_instance.mouseX mouseY = p5_instance.mouseY pmouseX = p5_instance.pmouseX pmouseY = p5_instance.pmouseY winMouseX = p5_instance.winMouseX winMouseY = p5_instance.winMouseY pwinMouseX = p5_instance.pwinMouseX pwinMouseY = p5_instance.pwinMouseY mouseButton = p5_instance.mouseButton mouseIsPressed = p5_instance.mouseIsPressed touches = p5_instance.touches pixels = p5_instance.pixels return draw_func(*args, **kwargs) def global_p5_injection(p5_sketch): """ Injects the p5js's skecth instance as a global variable to setup and draw functions """ def decorator(f, *args, **kwargs): def wrapper(*args, **kwargs): global _P5_INSTANCE _P5_INSTANCE = p5_sketch return pre_draw(_P5_INSTANCE, f, *args, **kwargs) return wrapper return decorator def start_p5(preload_func, setup_func, draw_func, event_functions): """ This is the entrypoint function. It accepts 2 parameters: - preload_func: A Python preload callable - setup_func: a Python setup callable - draw_func: a Python draw callable - event_functions: a config dict for the event functions in the format: {"eventFunctionName": python_event_function} This method gets the p5js's sketch instance and injects them """ def sketch_setup(p5_sketch): """ Callback function called to configure new p5 instance """ p5_sketch.preload = global_p5_injection(p5_sketch)(preload_func) p5_sketch.setup = global_p5_injection(p5_sketch)(setup_func) p5_sketch.draw = global_p5_injection(p5_sketch)(draw_func) window.instance = p5.new(sketch_setup, 'sketch-holder') # Register event functions event_function_names = ( "deviceMoved", "deviceTurned", "deviceShaken", "windowResized", "keyPressed", "keyReleased", "keyTyped", "mousePressed", "mouseReleased", "mouseClicked", "doubleClicked", "mouseMoved", "mouseDragged", "mouseWheel", "touchStarted", "touchMoved", "touchEnded", "keyIsDown", ) for f_name in [f for f in event_function_names if event_functions.get(f, None)]: func = event_functions[f_name] event_func = global_p5_injection(window.instance)(func) setattr(window.instance, f_name, event_func) `; const placeholder = ` def preload(): pass def setup(): pass def draw(): pass deviceMoved = None deviceTurned = None deviceShaken = None keyPressed = None keyReleased = None keyTyped = None mouseMoved = None mouseDragged = None mousePressed = None mouseReleased = None mouseClicked = None doubleClicked = None mouseWheel = None touchStarted = None touchMoved = None touchEnded = None windowResized = None `; let userCode = ` r = None def setup(): global r createCanvas(900, 900) r = random(100, 700) noFill() def draw(): x, y = 100, 100 rect(x, y, r, r) def keyPressed(): console.log("Key pressed event") if key == "n": global r r = random(100, 700) redraw() def mouseDragged(): global r r = random(100, 700) redraw() `; const startCode = ` event_functions = { "deviceMoved": deviceMoved, "deviceTurned": deviceTurned, "deviceShaken": deviceShaken, "keyPressed": keyPressed, "keyReleased": keyReleased, "keyTyped": keyTyped, "mouseMoved": mouseMoved, "mouseDragged": mouseDragged, "mousePressed": mousePressed, "mouseReleased": mouseReleased, "mouseClicked": mouseClicked, "doubleClicked": doubleClicked, "mouseWheel": mouseWheel, "touchStarted": touchStarted, "touchMoved": touchMoved, "touchEnded": touchEnded, "windowResized": windowResized, } start_p5(preload, setup, draw, event_functions) `; function runCode() { let code = [ placeholder, userCode, wrapperContent, startCode, ].join('\n'); if (window.instance) { window.instance.canvas.remove(); } console.log("Python execution output:"); window.pyodide.runPython(code); } async function main() { const config = { indexURL : "https://cdn.jsdelivr.net/pyodide/v0.18.1/full/", fullStdLib: false, } window.pyodide = await loadPyodide(config); // Pyodide is now ready to use... console.log(window.pyodide.runPython(` import io, code, sys from js import p5, window, document print(sys.version) `)); window.runSketchCode = (code) => { userCode = code; runCode(); } runCode(); }; // async method main(); ================================================ FILE: docs/examples/pyodide/sketch_007/index.html ================================================ sketch_007 - pyp5js

Python code here.


def setup():
    createCanvas(900, 900)
    stroke(27, 27, 27, 10)
    strokeWeight(2)


def draw():
    push()

    translate(width / 2, height / 2)
    v = PVector.random2D()
    v.normalize()
    v = PVector.mult(v,random(100, 400))
    line(0, 0, v.x, v.y)

    pop()
================================================ FILE: docs/examples/pyodide/sketch_007/sketch_007.py ================================================ def setup(): createCanvas(900, 900) stroke(27, 27, 27, 10) strokeWeight(2) def draw(): push() translate(width / 2, height / 2) v = PVector.random2D() v.normalize() v = PVector.mult(v,random(100, 400)) line(0, 0, v.x, v.y) pop() ================================================ FILE: docs/examples/pyodide/sketch_007/static/p5.js ================================================ /*! p5.js v1.0.0 February 29, 2020 */ !function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).p5=e()}}(function(){return function o(a,s,l){function u(t,e){if(!s[t]){if(!a[t]){var r="function"==typeof require&&require;if(!e&&r)return r(t,!0);if(h)return h(t,!0);var i=new Error("Cannot find module '"+t+"'");throw i.code="MODULE_NOT_FOUND",i}var n=s[t]={exports:{}};a[t][0].call(n.exports,function(e){return u(a[t][1][e]||e)},n,n.exports,o,a,s,l)}return s[t].exports}for(var h="function"==typeof require&&require,e=0;e>16&255,a[s++]=t>>8&255,a[s++]=255&t;2===o&&(t=u[e.charCodeAt(r)]<<2|u[e.charCodeAt(r+1)]>>4,a[s++]=255&t);1===o&&(t=u[e.charCodeAt(r)]<<10|u[e.charCodeAt(r+1)]<<4|u[e.charCodeAt(r+2)]>>2,a[s++]=t>>8&255,a[s++]=255&t);return a},r.fromByteArray=function(e){for(var t,r=e.length,i=r%3,n=[],o=0,a=r-i;o>2]+s[t<<4&63]+"==")):2==i&&(t=(e[r-2]<<8)+e[r-1],n.push(s[t>>10]+s[t>>4&63]+s[t<<2&63]+"="));return n.join("")};for(var s=[],u=[],h="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=0,o=i.length;n>18&63]+s[n>>12&63]+s[n>>6&63]+s[63&n]);return o.join("")}u["-".charCodeAt(0)]=62,u["_".charCodeAt(0)]=63},{}],20:[function(e,t,r){},{}],21:[function(N,e,F){(function(c){"use strict";var i=N("base64-js"),o=N("ieee754"),e="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;F.Buffer=c,F.SlowBuffer=function(e){+e!=e&&(e=0);return c.alloc(+e)},F.INSPECT_MAX_BYTES=50;var r=2147483647;function a(e){if(r>>1;case"base64":return O(e).length;default:if(n)return i?-1:R(e).length;t=(""+t).toLowerCase(),n=!0}}function d(e,t,r){var i=e[t];e[t]=e[r],e[r]=i}function p(e,t,r,i,n){if(0===e.length)return-1;if("string"==typeof r?(i=r,r=0):2147483647=e.length){if(n)return-1;r=e.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof t&&(t=c.from(t,i)),c.isBuffer(t))return 0===t.length?-1:m(e,t,r,i,n);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):m(e,[t],r,i,n);throw new TypeError("val must be string, number or Buffer")}function m(e,t,r,i,n){var o,a=1,s=e.length,l=t.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(e.length<2||t.length<2)return-1;s/=a=2,l/=2,r/=2}function u(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(n){var h=-1;for(o=r;o>8,n=r%256,o.push(n),o.push(i);return o}(t,e.length-r),e,r,i)}function b(e,t,r){return 0===t&&r===e.length?i.fromByteArray(e):i.fromByteArray(e.slice(t,r))}function _(e,t,r){r=Math.min(e.length,r);for(var i=[],n=t;n>>10&1023|55296),h=56320|1023&h),i.push(h),n+=c}return function(e){var t=e.length;if(t<=x)return String.fromCharCode.apply(String,e);var r="",i=0;for(;ithis.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e=e||"utf8";;)switch(e){case"hex":return M(this,t,r);case"utf8":case"utf-8":return _(this,t,r);case"ascii":return w(this,t,r);case"latin1":case"binary":return S(this,t,r);case"base64":return b(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,t,r);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}.apply(this,arguments)},c.prototype.equals=function(e){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===c.compare(this,e)},c.prototype.inspect=function(){var e="",t=F.INSPECT_MAX_BYTES;return e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(e+=" ... "),""},e&&(c.prototype[e]=c.prototype.inspect),c.prototype.compare=function(e,t,r,i,n){if(A(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),t<0||r>e.length||i<0||n>this.length)throw new RangeError("out of range index");if(n<=i&&r<=t)return 0;if(n<=i)return-1;if(r<=t)return 1;if(this===e)return 0;for(var o=(n>>>=0)-(i>>>=0),a=(r>>>=0)-(t>>>=0),s=Math.min(o,a),l=this.slice(i,n),u=e.slice(t,r),h=0;h>>=0,isFinite(r)?(r>>>=0,void 0===i&&(i="utf8")):(i=r,r=void 0)}var n=this.length-t;if((void 0===r||nthis.length)throw new RangeError("Attempt to write outside buffer bounds");i=i||"utf8";for(var o,a,s,l,u,h,c=!1;;)switch(i){case"hex":return g(this,e,t,r);case"utf8":case"utf-8":return u=t,h=r,D(R(e,(l=this).length-u),l,u,h);case"ascii":return v(this,e,t,r);case"latin1":case"binary":return v(this,e,t,r);case"base64":return o=this,a=t,s=r,D(O(e),o,a,s);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return y(this,e,t,r);default:if(c)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),c=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var x=4096;function w(e,t,r){var i="";r=Math.min(e.length,r);for(var n=t;ne.length)throw new RangeError("Index out of range")}function P(e,t,r,i){if(r+i>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function L(e,t,r,i,n){return t=+t,r>>>=0,n||P(e,0,r,4),o.write(e,t,r,i,23,4),r+4}function k(e,t,r,i,n){return t=+t,r>>>=0,n||P(e,0,r,8),o.write(e,t,r,i,52,8),r+8}c.prototype.slice=function(e,t){var r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):r>>=0,t>>>=0,r||T(e,t,this.length);for(var i=this[e],n=1,o=0;++o>>=0,t>>>=0,r||T(e,t,this.length);for(var i=this[e+--t],n=1;0>>=0,t||T(e,1,this.length),this[e]},c.prototype.readUInt16LE=function(e,t){return e>>>=0,t||T(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUInt16BE=function(e,t){return e>>>=0,t||T(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUInt32LE=function(e,t){return e>>>=0,t||T(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUInt32BE=function(e,t){return e>>>=0,t||T(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||T(e,t,this.length);for(var i=this[e],n=1,o=0;++o>>=0,t>>>=0,r||T(e,t,this.length);for(var i=t,n=1,o=this[e+--i];0>>=0,t||T(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){e>>>=0,t||T(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(e,t){e>>>=0,t||T(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(e,t){return e>>>=0,t||T(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return e>>>=0,t||T(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readFloatLE=function(e,t){return e>>>=0,t||T(e,4,this.length),o.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return e>>>=0,t||T(e,4,this.length),o.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return e>>>=0,t||T(e,8,this.length),o.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return e>>>=0,t||T(e,8,this.length),o.read(this,e,!1,52,8)},c.prototype.writeUIntLE=function(e,t,r,i){e=+e,t>>>=0,r>>>=0,i||C(this,e,t,r,Math.pow(2,8*r)-1,0);var n=1,o=0;for(this[t]=255&e;++o>>=0,r>>>=0,i||C(this,e,t,r,Math.pow(2,8*r)-1,0);var n=r-1,o=1;for(this[t+n]=255&e;0<=--n&&(o*=256);)this[t+n]=e/o&255;return t+r},c.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,1,255,0),this[t]=255&e,t+1},c.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},c.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeIntLE=function(e,t,r,i){if(e=+e,t>>>=0,!i){var n=Math.pow(2,8*r-1);C(this,e,t,r,n-1,-n)}var o=0,a=1,s=0;for(this[t]=255&e;++o>0)-s&255;return t+r},c.prototype.writeIntBE=function(e,t,r,i){if(e=+e,t>>>=0,!i){var n=Math.pow(2,8*r-1);C(this,e,t,r,n-1,-n)}var o=r-1,a=1,s=0;for(this[t+o]=255&e;0<=--o&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+r},c.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},c.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeFloatLE=function(e,t,r){return L(this,e,t,!0,r)},c.prototype.writeFloatBE=function(e,t,r){return L(this,e,t,!1,r)},c.prototype.writeDoubleLE=function(e,t,r){return k(this,e,t,!0,r)},c.prototype.writeDoubleBE=function(e,t,r){return k(this,e,t,!1,r)},c.prototype.copy=function(e,t,r,i){if(!c.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r=r||0,i||0===i||(i=this.length),t>=e.length&&(t=e.length),t=t||0,0=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t>>=0,r=void 0===r?this.length:r>>>0,"number"==typeof(e=e||0))for(o=t;o>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function O(e){return i.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(t,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function D(e,t,r,i){for(var n=0;n=t.length||n>=e.length);++n)t[n+r]=e[n];return n}function A(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function I(e){return e!=e}var U=function(){for(var e="0123456789abcdef",t=new Array(256),r=0;r<16;++r)for(var i=16*r,n=0;n<16;++n)t[i+n]=e[r]+e[n];return t}()}).call(this,N("buffer").Buffer)},{"base64-js":19,buffer:21,ieee754:30}],22:[function(e,t,r){"use strict";t.exports=e("./").polyfill()},{"./":23}],23:[function(z,r,i){(function(j,V){var e,t;e=this,t=function(){"use strict";function l(e){return"function"==typeof e}var r=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},i=0,t=void 0,n=void 0,a=function(e,t){f[i]=e,f[i+1]=t,2===(i+=2)&&(n?n(d):y())};var e="undefined"!=typeof window?window:void 0,o=e||{},s=o.MutationObserver||o.WebKitMutationObserver,u="undefined"==typeof self&&void 0!==j&&"[object process]"==={}.toString.call(j),h="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function c(){var e=setTimeout;return function(){return e(d,1)}}var f=new Array(1e3);function d(){for(var e=0;e":">",'"':""","'":"'","/":"/"};function S(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,function(e){return w[e]}):e}var M=function(){function i(e){var t,r=1=this.maxReplaces)break}for(a=0;r=this.regexp.exec(e);){if(void 0===(i=h(r[1].trim())))if("function"==typeof c){var d=c(e,r,t);i="string"==typeof d?d:""}else this.logger.warn("missed to pass in variable ".concat(r[1]," for interpolating ").concat(e)),i="";else"string"==typeof i||this.useRawValueToEscape||(i=v(i));if(i=this.escapeValue?u(this.escape(i)):u(i),e=e.replace(r[0],i),this.regexp.lastIndex=0,++a>=this.maxReplaces)break}return e}},{key:"nest",value:function(e,t,r){var i,n,o=D({},2>1,h=-7,c=r?n-1:0,f=r?-1:1,d=e[t+c];for(c+=f,o=d&(1<<-h)-1,d>>=-h,h+=s;0>=-h,h+=i;0>1,f=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,d=i?0:o-1,p=i?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=h):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),2<=(t+=1<=a+c?f/l:f*Math.pow(2,1-c))*l&&(a++,l/=2),h<=a+c?(s=0,a=h):1<=a+c?(s=(t*l-1)*Math.pow(2,n),a+=c):(s=t*Math.pow(2,c-1)*Math.pow(2,n),a=0));8<=n;e[r+d]=255&s,d+=p,s/=256,n-=8);for(a=a<Math.abs(e[0])&&(t=1),Math.abs(e[2])>Math.abs(e[t])&&(t=2),t}var C=4e150;function P(e,t){e.f+=t.f,e.b.f+=t.b.f}function u(e,t,r){return e=e.a,t=t.a,r=r.a,t.b.a===e?r.b.a===e?v(t.a,r.a)?b(r.b.a,t.a,r.a)<=0:0<=b(t.b.a,r.a,t.a):b(r.b.a,e,r.a)<=0:r.b.a===e?0<=b(t.b.a,e,t.a):(t=y(t.b.a,e,t.a),(e=y(r.b.a,e,r.a))<=t)}function L(e){e.a.i=null;var t=e.e;t.a.c=t.c,t.c.a=t.a,e.e=null}function h(e,t){c(e.a),e.c=!1,(e.a=t).i=e}function k(e){for(var t=e.a.a;(e=fe(e)).a.a===t;);return e.c&&(h(e,t=f(ce(e).a.b,e.a.e)),e=fe(e)),e}function R(e,t,r){var i=new he;return i.a=r,i.e=W(e.f,t.e,i),r.i=i}function O(e,t){switch(e.s){case 100130:return 0!=(1&t);case 100131:return 0!==t;case 100132:return 0>1]],s[a[u]])?le(r,u):ue(r,u)),s[o]=null,l[o]=r.b,r.b=o}else for(r.c[-(o+1)]=null;0Math.max(a.a,l.a))return!1;if(v(o,a)){if(0i.f&&(i.f*=2,i.c=oe(i.c,i.f+1)),0===i.b?r=n:(r=i.b,i.b=i.c[i.b]),i.e[r]=t,i.c[r]=n,i.d[n]=r,i.h&&ue(i,n),r}return i=e.a++,e.c[i]=t,-(i+1)}function ie(e){if(0===e.a)return se(e.b);var t=e.c[e.d[e.a-1]];if(0!==e.b.a&&v(ae(e.b),t))return se(e.b);for(;--e.a,0e.a||v(i[a],i[l])){n[r[o]=a]=o;break}n[r[o]=l]=o,o=s}}function ue(e,t){for(var r=e.d,i=e.e,n=e.c,o=t,a=r[o];;){var s=o>>1,l=r[s];if(0==s||v(i[l],i[a])){n[r[o]=a]=o;break}n[r[o]=l]=o,o=s}}function he(){this.e=this.a=null,this.f=0,this.c=this.b=this.h=this.d=!1}function ce(e){return e.e.c.b}function fe(e){return e.e.a.b}(i=q.prototype).x=function(){Y(this,0)},i.B=function(e,t){switch(e){case 100142:return;case 100140:switch(t){case 100130:case 100131:case 100132:case 100133:case 100134:return void(this.s=t)}break;case 100141:return void(this.m=!!t);default:return void Z(this,100900)}Z(this,100901)},i.y=function(e){switch(e){case 100142:return 0;case 100140:return this.s;case 100141:return this.m;default:Z(this,100900)}return!1},i.A=function(e,t,r){this.j[0]=e,this.j[1]=t,this.j[2]=r},i.z=function(e,t){var r=t||null;switch(e){case 100100:case 100106:this.h=r;break;case 100104:case 100110:this.l=r;break;case 100101:case 100107:this.k=r;break;case 100102:case 100108:this.i=r;break;case 100103:case 100109:this.p=r;break;case 100105:case 100111:this.o=r;break;case 100112:this.r=r;break;default:Z(this,100900)}},i.C=function(e,t){var r=!1,i=[0,0,0];Y(this,2);for(var n=0;n<3;++n){var o=e[n];o<-1e150&&(o=-1e150,r=!0),1e150n[u]&&(n[u]=h,a[u]=l)}if(l=0,n[1]-o[1]>n[0]-o[0]&&(l=1),n[2]-o[2]>n[l]-o[l]&&(l=2),o[l]>=n[l])i[0]=0,i[1]=0,i[2]=1;else{for(n=0,o=s[l],a=a[l],s=[0,0,0],o=[o.g[0]-a.g[0],o.g[1]-a.g[1],o.g[2]-a.g[2]],u=[0,0,0],l=r.e;l!==r;l=l.e)u[0]=l.g[0]-a.g[0],u[1]=l.g[1]-a.g[1],u[2]=l.g[2]-a.g[2],s[0]=o[1]*u[2]-o[2]*u[1],s[1]=o[2]*u[0]-o[0]*u[2],s[2]=o[0]*u[1]-o[1]*u[0],n<(h=s[0]*s[0]+s[1]*s[1]+s[2]*s[2])&&(n=h,i[0]=s[0],i[1]=s[1],i[2]=s[2]);n<=0&&(i[0]=i[1]=i[2]=0,i[T(o)]=1)}r=!0}for(s=T(i),l=this.b.c,n=(s+1)%3,a=(s+2)%3,s=0>=l,h-=l,g!=o){if(g==a)break;for(var v=g>8,++y;var _=b;if(i>=8;null!==m&&s<4096&&(p[s++]=m<<8|_,u+1<=s&&l<12&&(++l,u=u<<1|1)),m=g}else s=1+a,u=(1<<(l=n+1))-1,m=null}return f!==i&&console.log("Warning, gif stream shorter than expected."),r}try{r.GifWriter=function(v,e,t,r){var y=0,i=void 0===(r=void 0===r?{}:r).loop?null:r.loop,b=void 0===r.palette?null:r.palette;if(e<=0||t<=0||65535>=1;)++n;if(a=1<>8&255,v[y++]=255&t,v[y++]=t>>8&255,v[y++]=(null!==b?128:0)|n,v[y++]=o,v[y++]=0,null!==b)for(var s=0,l=b.length;s>16&255,v[y++]=u>>8&255,v[y++]=255&u}if(null!==i){if(i<0||65535>8&255,v[y++]=0}var x=!1;this.addFrame=function(e,t,r,i,n,o){if(!0===x&&(--y,x=!1),o=void 0===o?{}:o,e<0||t<0||65535>=1;)++u;l=1<>8&255,v[y++]=d,v[y++]=0),v[y++]=44,v[y++]=255&e,v[y++]=e>>8&255,v[y++]=255&t,v[y++]=t>>8&255,v[y++]=255&r,v[y++]=r>>8&255,v[y++]=255&i,v[y++]=i>>8&255,v[y++]=!0===a?128|u-1:0,!0===a)for(var p=0,m=s.length;p>16&255,v[y++]=g>>8&255,v[y++]=255&g}return y=function(t,r,e,i){t[r++]=e;var n=r++,o=1<>=8,h-=8,r===n+256&&(t[n]=255,n=r++)}function d(e){c|=e<>=8,h-=8,r===n+256&&(t[n]=255,n=r++);4096===l?(d(o),l=1+s,u=e+1,m={}):(1<>7,n=1<<1+(7&r);x[e++],x[e++];var o=null,a=null;i&&(o=e,e+=3*(a=n));var s=!0,l=[],u=0,h=null,c=0,f=null;for(this.width=w,this.height=t;s&&e>2&7,e++;break;case 254:for(;;){if(!(0<=(C=x[e++])))throw Error("Invalid block size");if(0===C)break;e+=C}break;default:throw new Error("Unknown graphic control label: 0x"+x[e-1].toString(16))}break;case 44:var p=x[e++]|x[e++]<<8,m=x[e++]|x[e++]<<8,g=x[e++]|x[e++]<<8,v=x[e++]|x[e++]<<8,y=x[e++],b=y>>6&1,_=1<<1+(7&y),S=o,M=a,E=!1;if(y>>7){E=!0;S=e,e+=3*(M=_)}var T=e;for(e++;;){var C;if(!(0<=(C=x[e++])))throw Error("Invalid block size");if(0===C)break;e+=C}l.push({x:p,y:m,width:g,height:v,has_local_palette:E,palette_offset:S,palette_size:M,data_offset:T,data_length:e-T,transparent_index:h,interlaced:!!b,delay:u,disposal:c});break;case 59:s=!1;break;default:throw new Error("Unknown gif block: 0x"+x[e-1].toString(16))}this.numFrames=function(){return l.length},this.loopCount=function(){return f},this.frameInfo=function(e){if(e<0||e>=l.length)throw new Error("Frame index out of range.");return l[e]},this.decodeAndBlitFrameBGRA=function(e,t){var r=this.frameInfo(e),i=r.width*r.height,n=new Uint8Array(i);P(x,r.data_offset,n,i);var o=r.palette_offset,a=r.transparent_index;null===a&&(a=256);var s=r.width,l=w-s,u=s,h=4*(r.y*w+r.x),c=4*((r.y+r.height)*w+r.x),f=h,d=4*l;!0===r.interlaced&&(d+=4*w*7);for(var p=8,m=0,g=n.length;m>=1)),v===a)f+=4;else{var y=x[o+3*v],b=x[o+3*v+1],_=x[o+3*v+2];t[f++]=_,t[f++]=b,t[f++]=y,t[f++]=255}--u}},this.decodeAndBlitFrameRGBA=function(e,t){var r=this.frameInfo(e),i=r.width*r.height,n=new Uint8Array(i);P(x,r.data_offset,n,i);var o=r.palette_offset,a=r.transparent_index;null===a&&(a=256);var s=r.width,l=w-s,u=s,h=4*(r.y*w+r.x),c=4*((r.y+r.height)*w+r.x),f=h,d=4*l;!0===r.interlaced&&(d+=4*w*7);for(var p=8,m=0,g=n.length;m>=1)),v===a)f+=4;else{var y=x[o+3*v],b=x[o+3*v+1],_=x[o+3*v+2];t[f++]=y,t[f++]=b,t[f++]=_,t[f++]=255}--u}}}}catch(e){}},{}],33:[function(jr,t,r){(function(Gr){var e;e=this,function(E){"use strict";function e(e){if(null==this)throw TypeError();var t=String(this),r=t.length,i=e?Number(e):0;if(i!=i&&(i=0),!(i<0||r<=i)){var n,o=t.charCodeAt(i);return 55296<=o&&o<=56319&&i+1>>=1,t}function _(e,t,r){if(!t)return r;for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<>>16-t;return e.tag>>>=t,e.bitcount-=t,i+r}function x(e,t){for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<>>=1,++n,r+=t.table[n],0<=(i-=t.table[n]););return e.tag=o,e.bitcount-=n,t.trans[r+i]}function w(e,t,r){var i,n,o,a,s,l;for(i=_(e,5,257),n=_(e,5,1),o=_(e,4,4),a=0;a<19;++a)g[a]=0;for(a=0;athis.x2&&(this.x2=e)),"number"==typeof t&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=t,this.y2=t),tthis.y2&&(this.y2=t))},C.prototype.addX=function(e){this.addPoint(e,null)},C.prototype.addY=function(e){this.addPoint(null,e)},C.prototype.addBezier=function(e,t,r,i,n,o,a,s){var l=this,u=[e,t],h=[r,i],c=[n,o],f=[a,s];this.addPoint(e,t),this.addPoint(a,s);for(var d=0;d<=1;d++){var p=6*u[d]-12*h[d]+6*c[d],m=-3*u[d]+9*h[d]-9*c[d]+3*f[d],g=3*h[d]-3*u[d];if(0!=m){var v=Math.pow(p,2)-4*g*m;if(!(v<0)){var y=(-p+Math.sqrt(v))/(2*m);0>8&255,255&e]},A.USHORT=U(2),D.SHORT=function(e){return 32768<=e&&(e=-(65536-e)),[e>>8&255,255&e]},A.SHORT=U(2),D.UINT24=function(e){return[e>>16&255,e>>8&255,255&e]},A.UINT24=U(3),D.ULONG=function(e){return[e>>24&255,e>>16&255,e>>8&255,255&e]},A.ULONG=U(4),D.LONG=function(e){return R<=e&&(e=-(2*R-e)),[e>>24&255,e>>16&255,e>>8&255,255&e]},A.LONG=U(4),D.FIXED=D.ULONG,A.FIXED=A.ULONG,D.FWORD=D.SHORT,A.FWORD=A.SHORT,D.UFWORD=D.USHORT,A.UFWORD=A.USHORT,D.LONGDATETIME=function(e){return[0,0,0,0,e>>24&255,e>>16&255,e>>8&255,255&e]},A.LONGDATETIME=U(8),D.TAG=function(e){return k.argument(4===e.length,"Tag should be exactly 4 ASCII characters."),[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]},A.TAG=U(4),D.Card8=D.BYTE,A.Card8=A.BYTE,D.Card16=D.USHORT,A.Card16=A.USHORT,D.OffSize=D.BYTE,A.OffSize=A.BYTE,D.SID=D.USHORT,A.SID=A.USHORT,D.NUMBER=function(e){return-107<=e&&e<=107?[e+139]:108<=e&&e<=1131?[247+((e-=108)>>8),255&e]:-1131<=e&&e<=-108?[251+((e=-e-108)>>8),255&e]:-32768<=e&&e<=32767?D.NUMBER16(e):D.NUMBER32(e)},A.NUMBER=function(e){return D.NUMBER(e).length},D.NUMBER16=function(e){return[28,e>>8&255,255&e]},A.NUMBER16=U(3),D.NUMBER32=function(e){return[29,e>>24&255,e>>16&255,e>>8&255,255&e]},A.NUMBER32=U(5),D.REAL=function(e){var t=e.toString(),r=/\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec(t);if(r){var i=parseFloat("1e"+((r[2]?+r[2]:0)+r[1].length));t=(Math.round(e*i)/i).toString()}for(var n="",o=0,a=t.length;o>8&255,t[t.length]=255&i}return t},A.UTF16=function(e){return 2*e.length};var N={"x-mac-croatian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈ƫȅ ÀÃÕŒœĐ—“”‘’÷◊©⁄€‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ","x-mac-cyrillic":"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю","x-mac-gaelic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØḂ±≤≥ḃĊċḊḋḞḟĠġṀæøṁṖṗɼƒſṠ«»… ÀÃÕŒœ–—“”‘’ṡẛÿŸṪ€‹›Ŷŷṫ·Ỳỳ⁊ÂÊÁËÈÍÎÏÌÓÔ♣ÒÚÛÙıÝýŴŵẄẅẀẁẂẃ","x-mac-greek":"Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦€ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ­","x-mac-icelandic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüݰ¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-inuit":"ᐃᐄᐅᐆᐊᐋᐱᐲᐳᐴᐸᐹᑉᑎᑏᑐᑑᑕᑖᑦᑭᑮᑯᑰᑲᑳᒃᒋᒌᒍᒎᒐᒑ°ᒡᒥᒦ•¶ᒧ®©™ᒨᒪᒫᒻᓂᓃᓄᓅᓇᓈᓐᓯᓰᓱᓲᓴᓵᔅᓕᓖᓗᓘᓚᓛᓪᔨᔩᔪᔫᔭ… ᔮᔾᕕᕖᕗ–—“”‘’ᕘᕙᕚᕝᕆᕇᕈᕉᕋᕌᕐᕿᖀᖁᖂᖃᖄᖅᖏᖐᖑᖒᖓᖔᖕᙱᙲᙳᙴᙵᙶᖖᖠᖡᖢᖣᖤᖥᖦᕼŁł","x-mac-ce":"ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ",macintosh:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-romanian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂȘ∞±≤≥¥µ∂∑∏π∫ªºΩăș¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›Țț‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-turkish":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙˆ˜¯˘˙˚¸˝˛ˇ"};O.MACSTRING=function(e,t,r,i){var n=N[i];if(void 0!==n){for(var o="",a=0;a>8&255,l+256&255)}return o}D.MACSTRING=function(e,t){var r=function(e){if(!F)for(var t in F={},N)F[t]=new String(t);var r=F[e];if(void 0!==r){if(B){var i=B.get(r);if(void 0!==i)return i}var n=N[e];if(void 0!==n){for(var o={},a=0;a>8,t[c+1]=255&f,t=t.concat(i[h])}return t},A.TABLE=function(e){for(var t=0,r=e.fields.length,i=0;i>1,t.skip("uShort",3),e.glyphIndexMap={};for(var a=new se.Parser(r,i+n+14),s=new se.Parser(r,i+n+16+2*o),l=new se.Parser(r,i+n+16+4*o),u=new se.Parser(r,i+n+16+6*o),h=i+n+16+8*o,c=0;c>4,o=15&i;if(15==n)break;if(t+=r[n],15==o)break;t+=r[o]}return parseFloat(t)}(e);if(32<=t&&t<=246)return t-139;if(247<=t&&t<=250)return 256*(t-247)+e.parseByte()+108;if(251<=t&&t<=254)return 256*-(t-251)-e.parseByte()-108;throw new Error("Invalid b0 "+t)}function Te(e,t,r){t=void 0!==t?t:0;var i=new se.Parser(e,t),n=[],o=[];for(r=void 0!==r?r:e.length;i.relativeOffset>1,T.length=0,P=!0}return function e(t){for(var r,i,n,o,a,s,l,u,h,c,f,d,p=0;pMath.abs(d-R)?k=f+T.shift():R=d+T.shift(),E.curveTo(y,b,_,x,l,u),E.curveTo(h,c,f,d,k,R);break;default:console.log("Glyph "+v.index+": unknown operator 1200"+m),T.length=0}break;case 14:0>3;break;case 21:2>16),p+=2;break;case 29:a=T.pop()+g.gsubrsBias,(s=g.gsubrs[a])&&e(s);break;case 30:for(;0=r.begin&&e=fe.length){var a=i.parseChar();r.names.push(i.parseString(a))}break;case 2.5:r.numberOfGlyphs=i.parseUShort(),r.offset=new Array(r.numberOfGlyphs);for(var s=0;st.value.tag?1:-1}),t.fields=t.fields.concat(i),t.fields=t.fields.concat(n),t}function gt(e,t,r){for(var i=0;i 123 are reserved for internal usage");d|=1<>>1,o=e[n].tag;if(o===t)return n;o>>1,o=e[n];if(o===t)return n;o>>1,a=(r=e[o]).start;if(a===t)return r;a(r=e[i-1]).end?0:r}function xt(e,t){this.font=e,this.tableName=t}function wt(e){xt.call(this,e,"gpos")}function St(e){xt.call(this,e,"gsub")}function Mt(e,t){var r=e.length;if(r!==t.length)return!1;for(var i=0;it.points.length-1||i.matchedPoints[1]>n.points.length-1)throw Error("Matched points out of range in "+t.name);var a=t.points[i.matchedPoints[0]],s=n.points[i.matchedPoints[1]],l={xScale:i.xScale,scale01:i.scale01,scale10:i.scale10,yScale:i.yScale,dx:0,dy:0};s=kt([s],l)[0],l.dx=a.x-s.x,l.dy=a.y-s.y,o=kt(n.points,l)}t.points=t.points.concat(o)}}return Rt(t.points)}(wt.prototype=xt.prototype={searchTag:yt,binSearch:bt,getTable:function(e){var t=this.font.tables[this.tableName];return!t&&e&&(t=this.font.tables[this.tableName]=this.createDefaultTable()),t},getScriptNames:function(){var e=this.getTable();return e?e.scripts.map(function(e){return e.tag}):[]},getDefaultScriptName:function(){var e=this.getTable();if(e){for(var t=!1,r=0;r=s[u-1].tag,"Features must be added in alphabetical order."),o={tag:r,feature:{params:0,lookupListIndexes:[]}},s.push(o),a.push(u),o.feature}}},getLookupTables:function(e,t,r,i,n){var o=this.getFeatureTable(e,t,r,n),a=[];if(o){for(var s,l=o.lookupListIndexes,u=this.font.tables[this.tableName].lookups,h=0;h",s),t.stack.push(Math.round(64*s))}function vr(e,t){var r=t.stack,i=r.pop(),n=t.fv,o=t.pv,a=t.ppem,s=t.deltaBase+16*(e-1),l=t.deltaShift,u=t.z0;E.DEBUG&&console.log(t.step,"DELTAP["+e+"]",i,r);for(var h=0;h>4)===a){var d=(15&f)-8;0<=d&&d++,E.DEBUG&&console.log(t.step,"DELTAPFIX",c,"by",d*l);var p=u[c];n.setRelative(p,p,d*l,o)}}}function yr(e,t){var r=t.stack,i=r.pop();E.DEBUG&&console.log(t.step,"ROUND[]"),r.push(64*t.round(i/64))}function br(e,t){var r=t.stack,i=r.pop(),n=t.ppem,o=t.deltaBase+16*(e-1),a=t.deltaShift;E.DEBUG&&console.log(t.step,"DELTAC["+e+"]",i,r);for(var s=0;s>4)===n){var h=(15&u)-8;0<=h&&h++;var c=h*a;E.DEBUG&&console.log(t.step,"DELTACFIX",l,"by",c),t.cvt[l]+=c}}}function _r(e,t){var r,i,n=t.stack,o=n.pop(),a=n.pop(),s=t.z2[o],l=t.z1[a];E.DEBUG&&console.log(t.step,"SDPVTL["+e+"]",o,a),i=e?(r=s.y-l.y,l.x-s.x):(r=l.x-s.x,l.y-s.y),t.dpv=Zt(r,i)}function xr(e,t){var r=t.stack,i=t.prog,n=t.ip;E.DEBUG&&console.log(t.step,"PUSHB["+e+"]");for(var o=0;o":"_")+(i?"R":"_")+(0===n?"Gr":1===n?"Bl":2===n?"Wh":"")+"]",e?c+"("+o.cvt[c]+","+u+")":"",f,"(d =",a,"->",l*s,")"),o.rp1=o.rp0,o.rp2=f,t&&(o.rp0=f)}Ft.prototype.exec=function(e,t){if("number"!=typeof t)throw new Error("Point size is not a number!");if(!(2",i),s.interpolate(c,o,a,l),s.touch(c)}e.loop=1},dr.bind(void 0,0),dr.bind(void 0,1),function(e){for(var t=e.stack,r=e.rp0,i=e.z0[r],n=e.loop,o=e.fv,a=e.pv,s=e.z1;n--;){var l=t.pop(),u=s[l];E.DEBUG&&console.log(e.step,(1=a.width||t>=a.height?[0,0,0,0]:this._getPixel(e,t);var s=new l.default.Image(r,i);return s.canvas.getContext("2d").drawImage(a,e,t,r*o,i*o,0,0,r,i),s},l.default.Renderer.prototype.textLeading=function(e){return"number"==typeof e?(this._setProperty("_textLeading",e),this._pInst):this._textLeading},l.default.Renderer.prototype.textSize=function(e){return"number"==typeof e?(this._setProperty("_textSize",e),this._setProperty("_textLeading",e*y._DEFAULT_LEADMULT),this._applyTextProperties()):this._textSize},l.default.Renderer.prototype.textStyle=function(e){return e?(e!==y.NORMAL&&e!==y.ITALIC&&e!==y.BOLD&&e!==y.BOLDITALIC||this._setProperty("_textStyle",e),this._applyTextProperties()):this._textStyle},l.default.Renderer.prototype.textAscent=function(){return null===this._textAscent&&this._updateTextMetrics(),this._textAscent},l.default.Renderer.prototype.textDescent=function(){return null===this._textDescent&&this._updateTextMetrics(),this._textDescent},l.default.Renderer.prototype.textAlign=function(e,t){return void 0!==e?(this._setProperty("_textAlign",e),void 0!==t&&this._setProperty("_textBaseline",t),this._applyTextProperties()):{horizontal:this._textAlign,vertical:this._textBaseline}},l.default.Renderer.prototype.text=function(e,t,r,i,n){var o,a,s,l,u,h,c,f,d=this._pInst,p=Number.MAX_VALUE;if((this._doFill||this._doStroke)&&void 0!==e){if("string"!=typeof e&&(e=e.toString()),o=(e=e.replace(/(\t)/g," ")).split("\n"),void 0!==i){for(s=f=0;ss.HALF_PI&&e<=3*s.HALF_PI?Math.atan(r/i*Math.tan(e))+s.PI:Math.atan(r/i*Math.tan(e))+s.TWO_PI,t=t<=s.HALF_PI?Math.atan(r/i*Math.tan(t)):t>s.HALF_PI&&t<=3*s.HALF_PI?Math.atan(r/i*Math.tan(t))+s.PI:Math.atan(r/i*Math.tan(t))+s.TWO_PI),tv||Math.abs(this.accelerationY-this.pAccelerationY)>v||Math.abs(this.accelerationZ-this.pAccelerationZ)>v)&&e();var t=this.deviceTurned||window.deviceTurned;if("function"==typeof t){var r=this.rotationX+180,i=this.pRotationX+180,n=c+180;0>>24],i+=x[(16711680&C)>>16],n+=x[(65280&C)>>8],o+=x[255&C],r+=k[_],s++}w[l=T+y]=a/r,S[l]=i/r,M[l]=n/r,E[l]=o/r}T+=d}for(h=(u=-P)*d,b=T=0;b>>16,e[r+1]=(65280&t[i])>>>8,e[r+2]=255&t[i],e[r+3]=(4278190080&t[i])>>>24},O._toImageData=function(e){return e instanceof ImageData?e:e.getContext("2d").getImageData(0,0,e.width,e.height)},O._createImageData=function(e,t){return O._tmpCanvas=document.createElement("canvas"),O._tmpCtx=O._tmpCanvas.getContext("2d"),this._tmpCtx.createImageData(e,t)},O.apply=function(e,t,r){var i=e.getContext("2d"),n=i.getImageData(0,0,e.width,e.height),o=t(n,r);o instanceof ImageData?i.putImageData(o,0,0,0,0,e.width,e.height):i.putImageData(n,0,0,0,0,e.width,e.height)},O.threshold=function(e,t){var r=O._toPixels(e);void 0===t&&(t=.5);for(var i=Math.floor(255*t),n=0;n>8)/i,r[n+1]=255*(a*t>>8)/i,r[n+2]=255*(s*t>>8)/i}},O.dilate=function(e){for(var t,r,i,n,o,a,s,l,u,h,c,f,d,p,m,g,v,y=O._toPixels(e),b=0,_=y.length?y.length/4:0,x=new Int32Array(_);b<_;)for(r=(t=b)+e.width;b>16&255)+151*(i>>8&255)+28*(255&i))<(m=77*(c>>16&255)+151*(c>>8&255)+28*(255&c))&&(n=c,o=m),o<(p=77*((h=O._getARGB(y,a))>>16&255)+151*(h>>8&255)+28*(255&h))&&(n=h,o=p),o<(g=77*(f>>16&255)+151*(f>>8&255)+28*(255&f))&&(n=f,o=g),o<(v=77*(d>>16&255)+151*(d>>8&255)+28*(255&d))&&(n=d,o=v),x[b++]=n;O._setPixels(y,x)},O.erode=function(e){for(var t,r,i,n,o,a,s,l,u,h,c,f,d,p,m,g,v,y=O._toPixels(e),b=0,_=y.length?y.length/4:0,x=new Int32Array(_);b<_;)for(r=(t=b)+e.width;b>16&255)+151*(c>>8&255)+28*(255&c))<(o=77*(i>>16&255)+151*(i>>8&255)+28*(255&i))&&(n=c,o=m),(p=77*((h=O._getARGB(y,a))>>16&255)+151*(h>>8&255)+28*(255&h))>16&255)+151*(f>>8&255)+28*(255&f))>16&255)+151*(d>>8&255)+28*(255&d))=r){var i=Math.floor(t.timeDisplayed/r);if(t.timeDisplayed=0,t.displayIndex+=i,t.loopCount=Math.floor(t.displayIndex/t.numFrames),null!==t.loopLimit&&t.loopCount>=t.loopLimit)t.playing=!1;else{var n=t.displayIndex%t.numFrames;this.drawingContext.putImageData(t.frames[n].image,0,0),t.displayIndex=n,this.setModified(!0)}}}},n.default.Image.prototype._setProperty=function(e,t){this[e]=t,this.setModified(!0)},n.default.Image.prototype.loadPixels=function(){n.default.Renderer2D.prototype.loadPixels.call(this),this.setModified(!0)},n.default.Image.prototype.updatePixels=function(e,t,r,i){n.default.Renderer2D.prototype.updatePixels.call(this,e,t,r,i),this.setModified(!0)},n.default.Image.prototype.get=function(e,t,r,i){return n.default._validateParameters("p5.Image.get",arguments),n.default.Renderer2D.prototype.get.apply(this,arguments)},n.default.Image.prototype._getPixel=n.default.Renderer2D.prototype._getPixel,n.default.Image.prototype.set=function(e,t,r){n.default.Renderer2D.prototype.set.call(this,e,t,r),this.setModified(!0)},n.default.Image.prototype.resize=function(e,t){0===e&&0===t?(e=this.canvas.width,t=this.canvas.height):0===e?e=this.canvas.width*t/this.canvas.height:0===t&&(t=this.canvas.height*e/this.canvas.width),e=Math.floor(e),t=Math.floor(t);var r=document.createElement("canvas");if(r.width=e,r.height=t,this.gifProperties)for(var i=this.gifProperties,n=function(e,t){for(var r=0,i=0;i/g,">").replace(/"/g,""").replace(/'/g,"'")}function l(e,t){t&&!0!==t&&"true"!==t||(t="");var r="";return(e=e||"untitled")&&e.includes(".")&&(r=e.split(".").pop()),t&&r!==t&&(r=t,e="".concat(e,".").concat(r)),[e,r]}e("../core/error_helpers"),v.default.prototype.loadJSON=function(){for(var e=arguments.length,t=new Array(e),r=0;r"),n.print("");if(n.print(' '),n.print(""),n.print(""),n.print(" "),"0"!==o[0]){n.print(" ");for(var h=0;h".concat(c)),n.print(" ")}n.print(" ")}for(var f=0;f");for(var d=0;d".concat(p)),n.print(" ")}n.print(" ")}n.print("
"),n.print(""),n.print("")}n.close(),n.clear()},v.default.prototype.writeFile=function(e,t,r){var i="application/octet-stream";v.default.prototype._isSafari()&&(i="text/plain");var n=new Blob(e,{type:i});v.default.prototype.downloadFile(n,t,r)},v.default.prototype.downloadFile=function(e,t,r){var i=l(t,r),n=i[0];if(e instanceof Blob)s.default.saveAs(e,n);else{var o=document.createElement("a");if(o.href=e,o.download=n,o.onclick=function(e){var t;t=e,document.body.removeChild(t.target),e.stopPropagation()},o.style.display="none",document.body.appendChild(o),v.default.prototype._isSafari()){var a="Hello, Safari user! To download this file...\n";a+="1. Go to File --\x3e Save As.\n",a+='2. Choose "Page Source" as the Format.\n',a+='3. Name it with this extension: ."'.concat(i[1],'"'),alert(a)}o.click()}},v.default.prototype._checkFileExtension=l,v.default.prototype._isSafari=function(){return 0>>0},getSeed:function(){return t},rand:function(){return(r=(1664525*r+1013904223)%i)/i}});n.setSeed(e),_=new Array(4096);for(var o=0;o<4096;o++)_[o]=n.rand()};var o=n.default;r.default=o},{"../core/main":49}],82:[function(e,t,r){"use strict";function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i,l=(i=e("../core/main"))&&i.__esModule?i:{default:i},o=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==a(e)&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var o=i?Object.getOwnPropertyDescriptor(e,n):null;o&&(o.get||o.set)?Object.defineProperty(r,n,o):r[n]=e[n]}r.default=e,t&&t.set(e,r);return r}(e("../core/constants"));function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}l.default.Vector=function(e,t,r){var i,n,o;o=e instanceof l.default?(this.p5=e,i=t[0]||0,n=t[1]||0,t[2]||0):(i=e||0,n=t||0,r||0),this.x=i,this.y=n,this.z=o},l.default.Vector.prototype.toString=function(){return"p5.Vector Object : [".concat(this.x,", ").concat(this.y,", ").concat(this.z,"]")},l.default.Vector.prototype.set=function(e,t,r){return e instanceof l.default.Vector?(this.x=e.x||0,this.y=e.y||0,this.z=e.z||0):e instanceof Array?(this.x=e[0]||0,this.y=e[1]||0,this.z=e[2]||0):(this.x=e||0,this.y=t||0,this.z=r||0),this},l.default.Vector.prototype.copy=function(){return this.p5?new l.default.Vector(this.p5,[this.x,this.y,this.z]):new l.default.Vector(this.x,this.y,this.z)},l.default.Vector.prototype.add=function(e,t,r){return e instanceof l.default.Vector?(this.x+=e.x||0,this.y+=e.y||0,this.z+=e.z||0):e instanceof Array?(this.x+=e[0]||0,this.y+=e[1]||0,this.z+=e[2]||0):(this.x+=e||0,this.y+=t||0,this.z+=r||0),this};function u(e,t){return 0!==e&&(this.x=this.x%e),0!==t&&(this.y=this.y%t),this}function h(e,t,r){return 0!==e&&(this.x=this.x%e),0!==t&&(this.y=this.y%t),0!==r&&(this.z=this.z%r),this}l.default.Vector.prototype.rem=function(e,t,r){if(e instanceof l.default.Vector){if(Number.isFinite(e.x)&&Number.isFinite(e.y)&&Number.isFinite(e.z)){var i=parseFloat(e.x),n=parseFloat(e.y),o=parseFloat(e.z);h.call(this,i,n,o)}}else if(e instanceof Array)e.every(function(e){return Number.isFinite(e)})&&(2===e.length&&u.call(this,e[0],e[1]),3===e.length&&h.call(this,e[0],e[1],e[2]));else if(1===arguments.length){if(Number.isFinite(e)&&0!==e)return this.x=this.x%e,this.y=this.y%e,this.z=this.z%e,this}else if(2===arguments.length){var a=Array.prototype.slice.call(arguments);a.every(function(e){return Number.isFinite(e)})&&2===a.length&&u.call(this,a[0],a[1])}else if(3===arguments.length){var s=Array.prototype.slice.call(arguments);s.every(function(e){return Number.isFinite(e)})&&3===s.length&&h.call(this,s[0],s[1],s[2])}},l.default.Vector.prototype.sub=function(e,t,r){return e instanceof l.default.Vector?(this.x-=e.x||0,this.y-=e.y||0,this.z-=e.z||0):e instanceof Array?(this.x-=e[0]||0,this.y-=e[1]||0,this.z-=e[2]||0):(this.x-=e||0,this.y-=t||0,this.z-=r||0),this},l.default.Vector.prototype.mult=function(e){return"number"==typeof e&&isFinite(e)?(this.x*=e,this.y*=e,this.z*=e):console.warn("p5.Vector.prototype.mult:","n is undefined or not a finite number"),this},l.default.Vector.prototype.div=function(e){return"number"==typeof e&&isFinite(e)?0===e?console.warn("p5.Vector.prototype.div:","divide by 0"):(this.x/=e,this.y/=e,this.z/=e):console.warn("p5.Vector.prototype.div:","n is undefined or not a finite number"),this},l.default.Vector.prototype.mag=function(){return Math.sqrt(this.magSq())},l.default.Vector.prototype.magSq=function(){var e=this.x,t=this.y,r=this.z;return e*e+t*t+r*r},l.default.Vector.prototype.dot=function(e,t,r){return e instanceof l.default.Vector?this.dot(e.x,e.y,e.z):this.x*(e||0)+this.y*(t||0)+this.z*(r||0)},l.default.Vector.prototype.cross=function(e){var t=this.y*e.z-this.z*e.y,r=this.z*e.x-this.x*e.z,i=this.x*e.y-this.y*e.x;return this.p5?new l.default.Vector(this.p5,[t,r,i]):new l.default.Vector(t,r,i)},l.default.Vector.prototype.dist=function(e){return e.copy().sub(this).mag()},l.default.Vector.prototype.normalize=function(){var e=this.mag();return 0!==e&&this.mult(1/e),this},l.default.Vector.prototype.limit=function(e){var t=this.magSq();return e*e>>0},n.default.prototype.randomSeed=function(e){this._lcgSetSeed(o,e),this._gaussian_previous=!1},n.default.prototype.random=function(e,t){var r;if(n.default._validateParameters("random",arguments),r=null!=this[o]?this._lcg(o):Math.random(),void 0===e)return r;if(void 0===t)return e instanceof Array?e[Math.floor(r*e.length)]:r*e;if(tf){var P=p,L=l,k=u;p=d+f*(s&&d=t&&(r=r.substring(r.length-t,r.length)),r}},n.default.prototype.unhex=function(e){return e instanceof Array?e.map(n.default.prototype.unhex):parseInt("0x".concat(e),16)};var o=n.default;r.default=o},{"../core/main":49}],90:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i,a=(i=e("../core/main"))&&i.__esModule?i:{default:i};function n(e,t,r){var i=e<0,n=i?e.toString().substring(1):e.toString(),o=n.indexOf("."),a=-1!==o?n.substring(0,o):n,s=-1!==o?n.substring(o+1):"",l=i?"-":"";if(void 0!==r){var u="";(-1!==o||0r&&(s=s.substring(0,r));for(var h=0;hi.length)for(var o=t-(i+=-1===r?".":"").length+1,a=0;a=d.TWO_PI?"".concat("ellipse","|").concat(u,"|"):"".concat("arc","|").concat(a,"|").concat(s,"|").concat(l,"|").concat(u,"|"),!this.geometryInHash(t)){var h=new T.default.Geometry(u,1,function(){if(this.strokeIndices=[],a.toFixed(10)!==s.toFixed(10)){l!==d.PIE&&void 0!==l||(this.vertices.push(new T.default.Vector(.5,.5,0)),this.uvs.push([.5,.5]));for(var e=0;e<=u;e++){var t=(s-a)*(e/u)+a,r=.5+Math.cos(t)/2,i=.5+Math.sin(t)/2;this.vertices.push(new T.default.Vector(r,i,0)),this.uvs.push([r,i]),e>5&31)/31,(y>>10&31)/31):(r=a,i=s,l)}for(var b=1;b<=3;b++){var _=p+12*b,x=new S.default.Vector(u.getFloat32(_,!0),u.getFloat32(8+_,!0),u.getFloat32(4+_,!0));e.vertices.push(x),c&&o.push(r,i,n)}var w=new S.default.Vector(m,g,v);e.vertexNormals.push(w,w,w),e.faces.push([3*d,3*d+1,3*d+2]),e.uvs.push([0,0],[0,0],[0,0])}}(e,t);else{var r=new DataView(t);if(!("TextDecoder"in window))return console.warn("Sorry, ASCII STL loading only works in browsers that support TextDecoder (https://caniuse.com/#feat=textencoder)");var i=new TextDecoder("utf-8").decode(r).split("\n");!function(e,t){for(var r,i,n="",o=[],a=0;aMath.PI?l=Math.PI:l<=0&&(l=.001);var u=Math.sin(l)*a*Math.sin(s),h=Math.cos(l)*a,c=Math.sin(l)*a*Math.cos(s);this.camera(u+this.centerX,h+this.centerY,c+this.centerZ,this.centerX,this.centerY,this.centerZ,0,1,0)},m.default.Camera.prototype._isActive=function(){return this===this._renderer._curCamera},m.default.prototype.setCamera=function(e){this._renderer._curCamera=e,this._renderer.uPMatrix.set(e.projMatrix.mat4[0],e.projMatrix.mat4[1],e.projMatrix.mat4[2],e.projMatrix.mat4[3],e.projMatrix.mat4[4],e.projMatrix.mat4[5],e.projMatrix.mat4[6],e.projMatrix.mat4[7],e.projMatrix.mat4[8],e.projMatrix.mat4[9],e.projMatrix.mat4[10],e.projMatrix.mat4[11],e.projMatrix.mat4[12],e.projMatrix.mat4[13],e.projMatrix.mat4[14],e.projMatrix.mat4[15])};var n=m.default.Camera;r.default=n},{"../core/main":49}],98:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i,h=(i=e("../core/main"))&&i.__esModule?i:{default:i};h.default.Geometry=function(e,t,r){return this.vertices=[],this.lineVertices=[],this.lineNormals=[],this.vertexNormals=[],this.faces=[],this.uvs=[],this.edges=[],this.vertexColors=[],this.detailX=void 0!==e?e:1,this.detailY=void 0!==t?t:1,this.dirtyFlags={},r instanceof Function&&r.call(this),this},h.default.Geometry.prototype.reset=function(){this.lineVertices.length=0,this.lineNormals.length=0,this.vertices.length=0,this.edges.length=0,this.vertexColors.length=0,this.vertexNormals.length=0,this.uvs.length=0,this.dirtyFlags={}},h.default.Geometry.prototype.computeFaces=function(){this.faces.length=0;for(var e,t,r,i,n=this.detailX+1,o=0;othis.vertices.length-1-this.detailX;i--)e.add(this.vertexNormals[i]);e=h.default.Vector.div(e,this.detailX);for(var n=this.vertices.length-1;n>this.vertices.length-1-this.detailX;n--)this.vertexNormals[n]=e;return this},h.default.Geometry.prototype._makeTriangleEdges=function(){if(this.edges.length=0,Array.isArray(this.strokeIndices))for(var e=0,t=this.strokeIndices.length;e vTexCoord.y;\n bool y1 = p1.y > vTexCoord.y;\n bool y2 = p2.y > vTexCoord.y;\n\n // could web be under the curve (after t1)?\n if (y1 ? !y2 : y0) {\n // add the coverage for t1\n coverage.x += saturate(C1.x + 0.5);\n // calculate the anti-aliasing for t1\n weight.x = min(weight.x, abs(C1.x));\n }\n\n // are we outside the curve (after t2)?\n if (y1 ? !y0 : y2) {\n // subtract the coverage for t2\n coverage.x -= saturate(C2.x + 0.5);\n // calculate the anti-aliasing for t2\n weight.x = min(weight.x, abs(C2.x));\n }\n}\n\n// this is essentially the same as coverageX, but with the axes swapped\nvoid coverageY(vec2 p0, vec2 p1, vec2 p2) {\n\n vec2 C1, C2;\n calulateCrossings(p0, p1, p2, C1, C2);\n\n bool x0 = p0.x > vTexCoord.x;\n bool x1 = p1.x > vTexCoord.x;\n bool x2 = p2.x > vTexCoord.x;\n\n if (x1 ? !x2 : x0) {\n coverage.y -= saturate(C1.y + 0.5);\n weight.y = min(weight.y, abs(C1.y));\n }\n\n if (x1 ? !x0 : x2) {\n coverage.y += saturate(C2.y + 0.5);\n weight.y = min(weight.y, abs(C2.y));\n }\n}\n\nvoid main() {\n\n // calculate the pixel scale based on screen-coordinates\n pixelScale = hardness / fwidth(vTexCoord);\n\n // which grid cell is this pixel in?\n ivec2 gridCoord = ifloor(vTexCoord * vec2(uGridSize));\n\n // intersect curves in this row\n {\n // the index into the row info bitmap\n int rowIndex = gridCoord.y + uGridOffset.y;\n // fetch the info texel\n vec4 rowInfo = getTexel(uSamplerRows, rowIndex, uGridImageSize);\n // unpack the rowInfo\n int rowStrokeIndex = getInt16(rowInfo.xy);\n int rowStrokeCount = getInt16(rowInfo.zw);\n\n for (int iRowStroke = INT(0); iRowStroke < N; iRowStroke++) {\n if (iRowStroke >= rowStrokeCount)\n break;\n\n // each stroke is made up of 3 points: the start and control point\n // and the start of the next curve.\n // fetch the indices of this pair of strokes:\n vec4 strokeIndices = getTexel(uSamplerRowStrokes, rowStrokeIndex++, uCellsImageSize);\n\n // unpack the stroke index\n int strokePos = getInt16(strokeIndices.xy);\n\n // fetch the two strokes\n vec4 stroke0 = getTexel(uSamplerStrokes, strokePos + INT(0), uStrokeImageSize);\n vec4 stroke1 = getTexel(uSamplerStrokes, strokePos + INT(1), uStrokeImageSize);\n\n // calculate the coverage\n coverageX(stroke0.xy, stroke0.zw, stroke1.xy);\n }\n }\n\n // intersect curves in this column\n {\n int colIndex = gridCoord.x + uGridOffset.x;\n vec4 colInfo = getTexel(uSamplerCols, colIndex, uGridImageSize);\n int colStrokeIndex = getInt16(colInfo.xy);\n int colStrokeCount = getInt16(colInfo.zw);\n \n for (int iColStroke = INT(0); iColStroke < N; iColStroke++) {\n if (iColStroke >= colStrokeCount)\n break;\n\n vec4 strokeIndices = getTexel(uSamplerColStrokes, colStrokeIndex++, uCellsImageSize);\n\n int strokePos = getInt16(strokeIndices.xy);\n vec4 stroke0 = getTexel(uSamplerStrokes, strokePos + INT(0), uStrokeImageSize);\n vec4 stroke1 = getTexel(uSamplerStrokes, strokePos + INT(1), uStrokeImageSize);\n coverageY(stroke0.xy, stroke0.zw, stroke1.xy);\n }\n }\n\n weight = saturate(1.0 - weight * 2.0);\n float distance = max(weight.x + weight.y, minDistance); // manhattan approx.\n float antialias = abs(dot(coverage, weight) / distance);\n float cover = min(abs(coverage.x), abs(coverage.y));\n gl_FragColor = uMaterialColor;\n gl_FragColor.a *= saturate(max(antialias, cover));\n}",lineVert:"/*\n Part of the Processing project - http://processing.org\n Copyright (c) 2012-15 The Processing Foundation\n Copyright (c) 2004-12 Ben Fry and Casey Reas\n Copyright (c) 2001-04 Massachusetts Institute of Technology\n This library is free software; you can redistribute it and/or\n modify it under the terms of the GNU Lesser General Public\n License as published by the Free Software Foundation, version 2.1.\n This library is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n Lesser General Public License for more details.\n You should have received a copy of the GNU Lesser General\n Public License along with this library; if not, write to the\n Free Software Foundation, Inc., 59 Temple Place, Suite 330,\n Boston, MA 02111-1307 USA\n*/\n\n#define PROCESSING_LINE_SHADER\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform float uStrokeWeight;\n\nuniform vec4 uViewport;\nuniform int uPerspective;\n\nattribute vec4 aPosition;\nattribute vec4 aDirection;\n \nvoid main() {\n // using a scale <1 moves the lines towards the camera\n // in order to prevent popping effects due to half of\n // the line disappearing behind the geometry faces.\n vec3 scale = vec3(0.9995);\n\n vec4 posp = uModelViewMatrix * aPosition;\n vec4 posq = uModelViewMatrix * (aPosition + vec4(aDirection.xyz, 0));\n\n // Moving vertices slightly toward the camera\n // to avoid depth-fighting with the fill triangles.\n // Discussed here:\n // http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Number=252848 \n posp.xyz = posp.xyz * scale;\n posq.xyz = posq.xyz * scale;\n\n vec4 p = uProjectionMatrix * posp;\n vec4 q = uProjectionMatrix * posq;\n\n // formula to convert from clip space (range -1..1) to screen space (range 0..[width or height])\n // screen_p = (p.xy/p.w + <1,1>) * 0.5 * uViewport.zw\n\n // prevent division by W by transforming the tangent formula (div by 0 causes\n // the line to disappear, see https://github.com/processing/processing/issues/5183)\n // t = screen_q - screen_p\n //\n // tangent is normalized and we don't care which aDirection it points to (+-)\n // t = +- normalize( screen_q - screen_p )\n // t = +- normalize( (q.xy/q.w+<1,1>)*0.5*uViewport.zw - (p.xy/p.w+<1,1>)*0.5*uViewport.zw )\n //\n // extract common factor, <1,1> - <1,1> cancels out\n // t = +- normalize( (q.xy/q.w - p.xy/p.w) * 0.5 * uViewport.zw )\n //\n // convert to common divisor\n // t = +- normalize( ((q.xy*p.w - p.xy*q.w) / (p.w*q.w)) * 0.5 * uViewport.zw )\n //\n // remove the common scalar divisor/factor, not needed due to normalize and +-\n // (keep uViewport - can't remove because it has different components for x and y\n // and corrects for aspect ratio, see https://github.com/processing/processing/issues/5181)\n // t = +- normalize( (q.xy*p.w - p.xy*q.w) * uViewport.zw )\n\n vec2 tangent = normalize((q.xy*p.w - p.xy*q.w) * uViewport.zw);\n\n // flip tangent to normal (it's already normalized)\n vec2 normal = vec2(-tangent.y, tangent.x);\n\n float thickness = aDirection.w * uStrokeWeight;\n vec2 offset = normal * thickness / 2.0;\n\n vec2 curPerspScale;\n\n if(uPerspective == 1) {\n // Perspective ---\n // convert from world to clip by multiplying with projection scaling factor\n // to get the right thickness (see https://github.com/processing/processing/issues/5182)\n // invert Y, projections in Processing invert Y\n curPerspScale = (uProjectionMatrix * vec4(1, -1, 0, 0)).xy;\n } else {\n // No Perspective ---\n // multiply by W (to cancel out division by W later in the pipeline) and\n // convert from screen to clip (derived from clip to screen above)\n curPerspScale = p.w / (0.5 * uViewport.zw);\n }\n\n gl_Position.xy = p.xy + offset.xy * curPerspScale;\n gl_Position.zw = p.zw;\n}\n",lineFrag:"precision mediump float;\nprecision mediump int;\n\nuniform vec4 uMaterialColor;\n\nvoid main() {\n gl_FragColor = uMaterialColor;\n}",pointVert:"attribute vec3 aPosition;\nuniform float uPointSize;\nvarying float vStrokeWeight;\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nvoid main() {\n\tvec4 positionVec4 = vec4(aPosition, 1.0);\n\tgl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n\tgl_PointSize = uPointSize;\n\tvStrokeWeight = uPointSize;\n}",pointFrag:"precision mediump float;\nprecision mediump int;\nuniform vec4 uMaterialColor;\nvarying float vStrokeWeight;\n\nvoid main(){\n\tfloat mask = 0.0;\n\n\t// make a circular mask using the gl_PointCoord (goes from 0 - 1 on a point)\n // might be able to get a nicer edge on big strokeweights with smoothstep but slightly less performant\n\n\tmask = step(0.98, length(gl_PointCoord * 2.0 - 1.0));\n\n\t// if strokeWeight is 1 or less lets just draw a square\n\t// this prevents weird artifacting from carving circles when our points are really small\n\t// if strokeWeight is larger than 1, we just use it as is\n\n\tmask = mix(0.0, mask, clamp(floor(vStrokeWeight - 0.5),0.0,1.0));\n\n\t// throw away the borders of the mask\n // otherwise we get weird alpha blending issues\n\n\tif(mask > 0.98){\n discard;\n \t}\n\n \tgl_FragColor = vec4(uMaterialColor.rgb * (1.0 - mask), uMaterialColor.a) ;\n}"};u.default.RendererGL=function(e,t,r,i){return u.default.Renderer.call(this,e,t,r),this._setAttributeDefaults(t),this._initContext(),this.isP3D=!0,this.GL=this.drawingContext,this._isErasing=!1,this._enableLighting=!1,this.ambientLightColors=[],this.specularColors=[1,1,1],this.directionalLightDirections=[],this.directionalLightDiffuseColors=[],this.directionalLightSpecularColors=[],this.pointLightPositions=[],this.pointLightDiffuseColors=[],this.pointLightSpecularColors=[],this.spotLightPositions=[],this.spotLightDirections=[],this.spotLightDiffuseColors=[],this.spotLightSpecularColors=[],this.spotLightAngle=[],this.spotLightConc=[],this.drawMode=o.FILL,this.curFillColor=this._cachedFillStyle=[1,1,1,1],this.curStrokeColor=this._cachedStrokeStyle=[0,0,0,1],this.curBlendMode=o.BLEND,this._cachedBlendMode=void 0,this.blendExt=this.GL.getExtension("EXT_blend_minmax"),this._isBlending=!1,this._useSpecularMaterial=!1,this._useEmissiveMaterial=!1,this._useNormalMaterial=!1,this._useShininess=1,this._tint=[255,255,255,255],this.constantAttenuation=1,this.linearAttenuation=0,this.quadraticAttenuation=0,this.uMVMatrix=new u.default.Matrix,this.uPMatrix=new u.default.Matrix,this.uNMatrix=new u.default.Matrix("mat3"),this._curCamera=new u.default.Camera(this),this._curCamera._computeCameraDefaultSettings(),this._curCamera._setDefaultCamera(),this._defaultLightShader=void 0,this._defaultImmediateModeShader=void 0,this._defaultNormalShader=void 0,this._defaultColorShader=void 0,this._defaultPointShader=void 0,this.userFillShader=void 0,this.userStrokeShader=void 0,this.userPointShader=void 0,this.retainedMode={geometry:{},buffers:{stroke:[new u.default.RenderBuffer(3,"lineVertices","lineVertexBuffer","aPosition",this,this._flatten),new u.default.RenderBuffer(4,"lineNormals","lineNormalBuffer","aDirection",this,this._flatten)],fill:[new u.default.RenderBuffer(3,"vertices","vertexBuffer","aPosition",this,this._vToNArray),new u.default.RenderBuffer(3,"vertexNormals","normalBuffer","aNormal",this,this._vToNArray),new u.default.RenderBuffer(4,"vertexColors","colorBuffer","aMaterialColor",this),new u.default.RenderBuffer(3,"vertexAmbients","ambientBuffer","aAmbientColor",this),new u.default.RenderBuffer(2,"uvs","uvBuffer","aTexCoord",this,this._flatten)],text:[new u.default.RenderBuffer(3,"vertices","vertexBuffer","aPosition",this,this._vToNArray),new u.default.RenderBuffer(2,"uvs","uvBuffer","aTexCoord",this,this._flatten)]}},this.immediateMode={geometry:new u.default.Geometry,shapeMode:o.TRIANGLE_FAN,_bezierVertex:[],_quadraticVertex:[],_curveVertex:[],buffers:{fill:[new u.default.RenderBuffer(3,"vertices","vertexBuffer","aPosition",this,this._vToNArray),new u.default.RenderBuffer(3,"vertexNormals","normalBuffer","aNormal",this,this._vToNArray),new u.default.RenderBuffer(4,"vertexColors","colorBuffer","aVertexColor",this),new u.default.RenderBuffer(3,"vertexAmbients","ambientBuffer","aAmbientColor",this),new u.default.RenderBuffer(2,"uvs","uvBuffer","aTexCoord",this,this._flatten)],stroke:[new u.default.RenderBuffer(3,"lineVertices","lineVertexBuffer","aPosition",this,this._flatten),new u.default.RenderBuffer(4,"lineNormals","lineNormalBuffer","aDirection",this,this._flatten)],point:this.GL.createBuffer()}},this.pointSize=5,this.curStrokeWeight=1,this.textures=[],this.textureMode=o.IMAGE,this.textureWrapX=o.CLAMP,this.textureWrapY=o.CLAMP,this._tex=null,this._curveTightness=6,this._lookUpTableBezier=[],this._lookUpTableQuadratic=[],this._lutBezierDetail=0,this._lutQuadraticDetail=0,this._tessy=this._initTessy(),this.fontInfos={},this._curShader=void 0,this},u.default.RendererGL.prototype=Object.create(u.default.Renderer.prototype),u.default.RendererGL.prototype._setAttributeDefaults=function(e){var t={alpha:!0,depth:!0,stencil:!0,antialias:navigator.userAgent.toLowerCase().includes("safari"),premultipliedAlpha:!1,preserveDrawingBuffer:!0,perPixelLighting:!0};null===e._glAttributes?e._glAttributes=t:e._glAttributes=Object.assign(t,e._glAttributes)},u.default.RendererGL.prototype._initContext=function(){try{if(this.drawingContext=this.canvas.getContext("webgl",this._pInst._glAttributes)||this.canvas.getContext("experimental-webgl",this._pInst._glAttributes),null===this.drawingContext)throw new Error("Error creating webgl context");var e=this.drawingContext;e.enable(e.DEPTH_TEST),e.depthFunc(e.LEQUAL),e.viewport(0,0,e.drawingBufferWidth,e.drawingBufferHeight),this._viewport=this.drawingContext.getParameter(this.drawingContext.VIEWPORT)}catch(e){throw e}},u.default.RendererGL.prototype._resetContext=function(e,t){var r=this.width,i=this.height,n=this.canvas.id,o=this._pInst instanceof u.default.Graphics;if(o){var a=this._pInst;a.canvas.parentNode.removeChild(a.canvas),a.canvas=document.createElement("canvas"),(a._pInst._userNode||document.body).appendChild(a.canvas),u.default.Element.call(a,a.canvas,a._pInst),a.width=r,a.height=i}else{var s=this.canvas;s&&s.parentNode.removeChild(s),(s=document.createElement("canvas")).id=n,this._pInst._userNode?this._pInst._userNode.appendChild(s):document.body.appendChild(s),this._pInst.canvas=s}var l=new u.default.RendererGL(this._pInst.canvas,this._pInst,!o);this._pInst._setProperty("_renderer",l),l.resize(r,i),l._applyDefaults(),o||this._pInst._elements.push(l),"function"==typeof t&&setTimeout(function(){t.apply(window._renderer,e)},0)},u.default.prototype.setAttributes=function(e,t){if(void 0!==this._glAttributes){var r=!0;if(void 0!==t?(null===this._glAttributes&&(this._glAttributes={}),this._glAttributes[e]!==t&&(this._glAttributes[e]=t,r=!1)):e instanceof Object&&this._glAttributes!==e&&(this._glAttributes=e,r=!1),this._renderer.isP3D&&!r){if(!this._setupDone)for(var i in this._renderer.retainedMode.geometry)if(this._renderer.retainedMode.geometry.hasOwnProperty(i))return void console.error("Sorry, Could not set the attributes, you need to call setAttributes() before calling the other drawing methods in setup()");this.push(),this._renderer._resetContext(),this.pop(),this._renderer._curCamera&&(this._renderer._curCamera._renderer=this._renderer)}}else console.log("You are trying to use setAttributes on a p5.Graphics object that does not use a WEBGL renderer.")},u.default.RendererGL.prototype._update=function(){this.uMVMatrix.set(this._curCamera.cameraMatrix.mat4[0],this._curCamera.cameraMatrix.mat4[1],this._curCamera.cameraMatrix.mat4[2],this._curCamera.cameraMatrix.mat4[3],this._curCamera.cameraMatrix.mat4[4],this._curCamera.cameraMatrix.mat4[5],this._curCamera.cameraMatrix.mat4[6],this._curCamera.cameraMatrix.mat4[7],this._curCamera.cameraMatrix.mat4[8],this._curCamera.cameraMatrix.mat4[9],this._curCamera.cameraMatrix.mat4[10],this._curCamera.cameraMatrix.mat4[11],this._curCamera.cameraMatrix.mat4[12],this._curCamera.cameraMatrix.mat4[13],this._curCamera.cameraMatrix.mat4[14],this._curCamera.cameraMatrix.mat4[15]),this.ambientLightColors.length=0,this.specularColors=[1,1,1],this.directionalLightDirections.length=0,this.directionalLightDiffuseColors.length=0,this.directionalLightSpecularColors.length=0,this.pointLightPositions.length=0,this.pointLightDiffuseColors.length=0,this.pointLightSpecularColors.length=0,this.spotLightPositions.length=0,this.spotLightDirections.length=0,this.spotLightDiffuseColors.length=0,this.spotLightSpecularColors.length=0,this.spotLightAngle.length=0,this.spotLightConc.length=0,this._enableLighting=!1,this._tint=[255,255,255,255],this.GL.clear(this.GL.DEPTH_BUFFER_BIT)},u.default.RendererGL.prototype.background=function(){var e,t=(e=this._pInst).color.apply(e,arguments),r=t.levels[0]/255,i=t.levels[1]/255,n=t.levels[2]/255,o=t.levels[3]/255;this.GL.clearColor(r,i,n,o),this.GL.clear(this.GL.COLOR_BUFFER_BIT)},u.default.RendererGL.prototype.fill=function(e,t,r,i){var n=u.default.prototype.color.apply(this._pInst,arguments);this.curFillColor=n._array,this.drawMode=o.FILL,this._useNormalMaterial=!1,this._tex=null},u.default.RendererGL.prototype.stroke=function(e,t,r,i){arguments[3]=255;var n=u.default.prototype.color.apply(this._pInst,arguments);this.curStrokeColor=n._array},u.default.RendererGL.prototype.strokeCap=function(e){console.error("Sorry, strokeCap() is not yet implemented in WEBGL mode")},u.default.RendererGL.prototype.strokeJoin=function(e){console.error("Sorry, strokeJoin() is not yet implemented in WEBGL mode")},u.default.RendererGL.prototype.filter=function(e){console.error("filter() does not work in WEBGL mode")},u.default.RendererGL.prototype.blendMode=function(e){e===o.DARKEST||e===o.LIGHTEST||e===o.ADD||e===o.BLEND||e===o.SUBTRACT||e===o.SCREEN||e===o.EXCLUSION||e===o.REPLACE||e===o.MULTIPLY||e===o.REMOVE?this.curBlendMode=e:e!==o.BURN&&e!==o.OVERLAY&&e!==o.HARD_LIGHT&&e!==o.SOFT_LIGHT&&e!==o.DODGE||console.warn("BURN, OVERLAY, HARD_LIGHT, SOFT_LIGHT, and DODGE only work for blendMode in 2D mode.")},u.default.RendererGL.prototype.erase=function(e,t){this._isErasing||(this._cachedBlendMode=this.curBlendMode,this.blendMode(o.REMOVE),this._cachedFillStyle=this.curFillColor.slice(),this.curFillColor=[1,1,1,e/255],this._cachedStrokeStyle=this.curStrokeColor.slice(),this.curStrokeColor=[1,1,1,t/255],this._isErasing=!0)},u.default.RendererGL.prototype.noErase=function(){this._isErasing&&(this.curFillColor=this._cachedFillStyle.slice(),this.curStrokeColor=this._cachedStrokeStyle.slice(),this.blendMode(this._cachedBlendMode),this._isErasing=!1)},u.default.RendererGL.prototype.strokeWeight=function(e){this.curStrokeWeight!==e&&(this.pointSize=e,this.curStrokeWeight=e)},u.default.RendererGL.prototype._getPixel=function(e,t){var r;return r=new Uint8Array(4),this.drawingContext.readPixels(e,t,1,1,this.drawingContext.RGBA,this.drawingContext.UNSIGNED_BYTE,r),[r[0],r[1],r[2],r[3]]},u.default.RendererGL.prototype.loadPixels=function(){var e=this._pixelsState;if(!0===this._pInst._glAttributes.preserveDrawingBuffer){var t=e.pixels,r=this.GL.drawingBufferWidth*this.GL.drawingBufferHeight*4;t instanceof Uint8Array&&t.length===r||(t=new Uint8Array(r),this._pixelsState._setProperty("pixels",t));var i=this._pInst._pixelDensity;this.GL.readPixels(0,0,this.width*i,this.height*i,this.GL.RGBA,this.GL.UNSIGNED_BYTE,t)}else console.log("loadPixels only works in WebGL when preserveDrawingBuffer is true.")},u.default.RendererGL.prototype.geometryInHash=function(e){return void 0!==this.retainedMode.geometry[e]},u.default.RendererGL.prototype.resize=function(e,t){u.default.Renderer.prototype.resize.call(this,e,t),this.GL.viewport(0,0,this.GL.drawingBufferWidth,this.GL.drawingBufferHeight),this._viewport=this.GL.getParameter(this.GL.VIEWPORT),this._curCamera._resize();var r=this._pixelsState;void 0!==r.pixels&&r._setProperty("pixels",new Uint8Array(this.GL.drawingBufferWidth*this.GL.drawingBufferHeight*4))},u.default.RendererGL.prototype.clear=function(){var e=(arguments.length<=0?void 0:arguments[0])||0,t=(arguments.length<=1?void 0:arguments[1])||0,r=(arguments.length<=2?void 0:arguments[2])||0,i=(arguments.length<=3?void 0:arguments[3])||0;this.GL.clearColor(e,t,r,i),this.GL.clear(this.GL.COLOR_BUFFER_BIT|this.GL.DEPTH_BUFFER_BIT)},u.default.RendererGL.prototype.applyMatrix=function(e,t,r,i,n,o){16===arguments.length?u.default.Matrix.prototype.apply.apply(this.uMVMatrix,arguments):this.uMVMatrix.apply([e,t,0,0,r,i,0,0,0,0,1,0,n,o,0,1])},u.default.RendererGL.prototype.translate=function(e,t,r){return e instanceof u.default.Vector&&(r=e.z,t=e.y,e=e.x),this.uMVMatrix.translate([e,t,r]),this},u.default.RendererGL.prototype.scale=function(e,t,r){return this.uMVMatrix.scale(e,t,r),this},u.default.RendererGL.prototype.rotate=function(e,t){return void 0===t?this.rotateZ(e):(u.default.Matrix.prototype.rotate.apply(this.uMVMatrix,arguments),this)},u.default.RendererGL.prototype.rotateX=function(e){return this.rotate(e,1,0,0),this},u.default.RendererGL.prototype.rotateY=function(e){return this.rotate(e,0,1,0),this},u.default.RendererGL.prototype.rotateZ=function(e){return this.rotate(e,0,0,1),this},u.default.RendererGL.prototype.push=function(){var e=u.default.Renderer.prototype.push.apply(this),t=e.properties;return t.uMVMatrix=this.uMVMatrix.copy(),t.uPMatrix=this.uPMatrix.copy(),t._curCamera=this._curCamera,this._curCamera=this._curCamera.copy(),t.ambientLightColors=this.ambientLightColors.slice(),t.specularColors=this.specularColors.slice(),t.directionalLightDirections=this.directionalLightDirections.slice(),t.directionalLightDiffuseColors=this.directionalLightDiffuseColors.slice(),t.directionalLightSpecularColors=this.directionalLightSpecularColors.slice(),t.pointLightPositions=this.pointLightPositions.slice(),t.pointLightDiffuseColors=this.pointLightDiffuseColors.slice(),t.pointLightSpecularColors=this.pointLightSpecularColors.slice(),t.spotLightPositions=this.spotLightPositions.slice(),t.spotLightDirections=this.spotLightDirections.slice(),t.spotLightDiffuseColors=this.spotLightDiffuseColors.slice(),t.spotLightSpecularColors=this.spotLightSpecularColors.slice(),t.spotLightAngle=this.spotLightAngle.slice(),t.spotLightConc=this.spotLightConc.slice(),t.userFillShader=this.userFillShader,t.userStrokeShader=this.userStrokeShader,t.userPointShader=this.userPointShader,t.pointSize=this.pointSize,t.curStrokeWeight=this.curStrokeWeight,t.curStrokeColor=this.curStrokeColor,t.curFillColor=this.curFillColor,t._useSpecularMaterial=this._useSpecularMaterial,t._useEmissiveMaterial=this._useEmissiveMaterial,t._useShininess=this._useShininess,t.constantAttenuation=this.constantAttenuation,t.linearAttenuation=this.linearAttenuation,t.quadraticAttenuation=this.quadraticAttenuation,t._enableLighting=this._enableLighting,t._useNormalMaterial=this._useNormalMaterial,t._tex=this._tex,t.drawMode=this.drawMode,e},u.default.RendererGL.prototype.resetMatrix=function(){return this.uMVMatrix=u.default.Matrix.identity(this._pInst),this},u.default.RendererGL.prototype._getImmediateStrokeShader=function(){var e=this.userStrokeShader;return e&&e.isStrokeShader()?e:this._getLineShader()},u.default.RendererGL.prototype._getRetainedStrokeShader=u.default.RendererGL.prototype._getImmediateStrokeShader,u.default.RendererGL.prototype._getImmediateFillShader=function(){var e=this.userFillShader;if(this._useNormalMaterial&&(!e||!e.isNormalShader()))return this._getNormalShader();if(this._enableLighting){if(!e||!e.isLightShader())return this._getLightShader()}else if(this._tex){if(!e||!e.isTextureShader())return this._getLightShader()}else if(!e)return this._getImmediateModeShader();return e},u.default.RendererGL.prototype._getRetainedFillShader=function(){if(this._useNormalMaterial)return this._getNormalShader();var e=this.userFillShader;if(this._enableLighting){if(!e||!e.isLightShader())return this._getLightShader()}else if(this._tex){if(!e||!e.isTextureShader())return this._getLightShader()}else if(!e)return this._getColorShader();return e},u.default.RendererGL.prototype._getImmediatePointShader=function(){var e=this.userPointShader;return e&&e.isPointShader()?e:this._getPointShader()},u.default.RendererGL.prototype._getRetainedLineShader=u.default.RendererGL.prototype._getImmediateLineShader,u.default.RendererGL.prototype._getLightShader=function(){return this._defaultLightShader||(this._pInst._glAttributes.perPixelLighting?this._defaultLightShader=new u.default.Shader(this,c.phongVert,c.phongFrag):this._defaultLightShader=new u.default.Shader(this,c.lightVert,c.lightTextureFrag)),this._defaultLightShader},u.default.RendererGL.prototype._getImmediateModeShader=function(){return this._defaultImmediateModeShader||(this._defaultImmediateModeShader=new u.default.Shader(this,c.immediateVert,c.vertexColorFrag)),this._defaultImmediateModeShader},u.default.RendererGL.prototype._getNormalShader=function(){return this._defaultNormalShader||(this._defaultNormalShader=new u.default.Shader(this,c.normalVert,c.normalFrag)),this._defaultNormalShader},u.default.RendererGL.prototype._getColorShader=function(){return this._defaultColorShader||(this._defaultColorShader=new u.default.Shader(this,c.normalVert,c.basicFrag)),this._defaultColorShader},u.default.RendererGL.prototype._getPointShader=function(){return this._defaultPointShader||(this._defaultPointShader=new u.default.Shader(this,c.pointVert,c.pointFrag)),this._defaultPointShader},u.default.RendererGL.prototype._getLineShader=function(){return this._defaultLineShader||(this._defaultLineShader=new u.default.Shader(this,c.lineVert,c.lineFrag)),this._defaultLineShader},u.default.RendererGL.prototype._getFontShader=function(){return this._defaultFontShader||(this.GL.getExtension("OES_standard_derivatives"),this._defaultFontShader=new u.default.Shader(this,c.fontVert,c.fontFrag)),this._defaultFontShader},u.default.RendererGL.prototype._getEmptyTexture=function(){if(!this._emptyTexture){var e=new u.default.Image(1,1);e.set(0,0,255),this._emptyTexture=new u.default.Texture(this,e)}return this._emptyTexture},u.default.RendererGL.prototype.getTexture=function(e){var t=this.textures,r=!0,i=!1,n=void 0;try{for(var o,a=t[Symbol.iterator]();!(r=(o=a.next()).done);r=!0){var s=o.value;if(s.src===e)return s}}catch(e){i=!0,n=e}finally{try{r||null==a.return||a.return()}finally{if(i)throw n}}var l=new u.default.Texture(this,e);return t.push(l),l},u.default.RendererGL.prototype._setStrokeUniforms=function(e){e.bindShader(),e.setUniform("uMaterialColor",this.curStrokeColor),e.setUniform("uStrokeWeight",this.curStrokeWeight)},u.default.RendererGL.prototype._setFillUniforms=function(e){e.bindShader(),e.setUniform("uMaterialColor",this.curFillColor),e.setUniform("isTexture",!!this._tex),this._tex&&e.setUniform("uSampler",this._tex),e.setUniform("uTint",this._tint),e.setUniform("uSpecular",this._useSpecularMaterial),e.setUniform("uEmissive",this._useEmissiveMaterial),e.setUniform("uShininess",this._useShininess),e.setUniform("uUseLighting",this._enableLighting);var t=this.pointLightDiffuseColors.length/3;e.setUniform("uPointLightCount",t),e.setUniform("uPointLightLocation",this.pointLightPositions),e.setUniform("uPointLightDiffuseColors",this.pointLightDiffuseColors),e.setUniform("uPointLightSpecularColors",this.pointLightSpecularColors);var r=this.directionalLightDiffuseColors.length/3;e.setUniform("uDirectionalLightCount",r),e.setUniform("uLightingDirection",this.directionalLightDirections),e.setUniform("uDirectionalDiffuseColors",this.directionalLightDiffuseColors),e.setUniform("uDirectionalSpecularColors",this.directionalLightSpecularColors);var i=this.ambientLightColors.length/3;e.setUniform("uAmbientLightCount",i),e.setUniform("uAmbientColor",this.ambientLightColors);var n=this.spotLightDiffuseColors.length/3;e.setUniform("uSpotLightCount",n),e.setUniform("uSpotLightAngle",this.spotLightAngle),e.setUniform("uSpotLightConc",this.spotLightConc),e.setUniform("uSpotLightDiffuseColors",this.spotLightDiffuseColors),e.setUniform("uSpotLightSpecularColors",this.spotLightSpecularColors),e.setUniform("uSpotLightLocation",this.spotLightPositions),e.setUniform("uSpotLightDirection",this.spotLightDirections),e.setUniform("uConstantAttenuation",this.constantAttenuation),e.setUniform("uLinearAttenuation",this.linearAttenuation),e.setUniform("uQuadraticAttenuation",this.quadraticAttenuation),e.bindTextures()},u.default.RendererGL.prototype._setPointUniforms=function(e){e.bindShader(),e.setUniform("uMaterialColor",this.curStrokeColor),e.setUniform("uPointSize",this.pointSize)},u.default.RendererGL.prototype._bindBuffer=function(e,t,r,i,n){if(t=t||this.GL.ARRAY_BUFFER,this.GL.bindBuffer(t,e),void 0!==r){var o=new(i||Float32Array)(r);this.GL.bufferData(t,o,n||this.GL.STATIC_DRAW)}},u.default.RendererGL.prototype._arraysEqual=function(e,t){var r=e.length;if(r!==t.length)return!1;for(var i=0;i>7,127&f,c>>7,127&c);for(var d=0;d>7,127&p,0,0)}}return{cellImageInfo:l,dimOffset:o,dimImageInfo:n}}return(t=this.glyphInfos[e.index]={glyph:e,uGlyphRect:[i.x1,-i.y1,i.x2,-i.y2],strokeImageInfo:U,strokes:d,colInfo:G(m,this.colDimImageInfos,this.colCellImageInfos),rowInfo:G(p,this.rowDimImageInfos,this.rowCellImageInfos)}).uGridOffset=[t.colInfo.dimOffset,t.rowInfo.dimOffset],t}}var z=Math.sqrt(3);j.default.RendererGL.prototype._renderText=function(e,t,r,i,n){if(this._textFont&&"string"!=typeof this._textFont){if(!(n<=i)&&this._doFill){if(!this._isOpenType())return console.log("WEBGL: only Opentype (.otf) and Truetype (.ttf) fonts are supported"),e;e.push();var o=this._doStroke,a=this.drawMode;this._doStroke=!1,this.drawMode=D.TEXTURE;var s=this._textFont.font,l=this._textFont._fontInfo;l=l||(this._textFont._fontInfo=new A(s));var u=this._textFont._handleAlignment(this,t,r,i),h=this._textSize/s.unitsPerEm;this.translate(u.x,u.y,0),this.scale(h,h,1);var c=this.GL,f=!this._defaultFontShader,d=this._getFontShader();d.init(),d.bindShader(),f&&(d.setUniform("uGridImageSize",[64,64]),d.setUniform("uCellsImageSize",[64,64]),d.setUniform("uStrokeImageSize",[64,64]),d.setUniform("uGridSize",[9,9])),this._applyColorBlend(this.curFillColor);var p=this.retainedMode.geometry.glyph;if(!p){var m=this._textGeom=new j.default.Geometry(1,1,function(){for(var e=0;e<=1;e++)for(var t=0;t<=1;t++)this.vertices.push(new j.default.Vector(t,e,0)),this.uvs.push(t,e)});m.computeFaces().computeNormals(),p=this.createBuffers("glyph",m)}var g=!0,v=!1,y=void 0;try{for(var b,_=this.retainedMode.buffers.text[Symbol.iterator]();!(g=(b=_.next()).done);g=!0){b.value._prepareBuffer(p,d)}}catch(e){v=!0,y=e}finally{try{g||null==_.return||_.return()}finally{if(v)throw y}}this._bindBuffer(p.indexBuffer,c.ELEMENT_ARRAY_BUFFER),d.setUniform("uMaterialColor",this.curFillColor);try{var x=0,w=null,S=s.stringToGlyphs(t),M=!0,E=!1,T=void 0;try{for(var C,P=S[Symbol.iterator]();!(M=(C=P.next()).done);M=!0){var L=C.value;w&&(x+=s.getKerningValue(w,L));var k=l.getGlyphInfo(L);if(k.uGlyphRect){var R=k.rowInfo,O=k.colInfo;d.setUniform("uSamplerStrokes",k.strokeImageInfo.imageData),d.setUniform("uSamplerRowStrokes",R.cellImageInfo.imageData),d.setUniform("uSamplerRows",R.dimImageInfo.imageData),d.setUniform("uSamplerColStrokes",O.cellImageInfo.imageData),d.setUniform("uSamplerCols",O.dimImageInfo.imageData),d.setUniform("uGridOffset",k.uGridOffset),d.setUniform("uGlyphRect",k.uGlyphRect),d.setUniform("uGlyphOffset",x),d.bindTextures(),c.drawElements(c.TRIANGLES,6,this.GL.UNSIGNED_SHORT,0)}x+=L.advanceWidth,w=L}}catch(e){E=!0,T=e}finally{try{M||null==P.return||P.return()}finally{if(E)throw T}}}finally{d.unbindShader(),this._doStroke=o,this.drawMode=a,e.pop()}return e}}else console.log("WEBGL: you must load and set a font before drawing text. See `loadFont` and `textFont` for more details.")}},{"../core/constants":42,"../core/main":49,"./p5.RendererGL.Retained":102,"./p5.Shader":104}],107:[function(e,t,r){t.exports={fes:{autoplay:"The media that tried to play (with '{{src}}') wasn't allowed to by this browser, most likely due to the browser's autoplay policy. Check out {{link}} for more information about why.",fileLoadError:{bytes:"It looks like there was a problem loading your file. {{suggestion}}",font:"It looks like there was a problem loading your font. {{suggestion}}",gif:"There was some trouble loading your GIF. Make sure that your GIF is using 87a or 89a encoding.",image:"It looks like there was a problem loading your image. {{suggestion}}",json:"It looks like there was a problem loading your JSON file. {{suggestion}}",large:"If your large file isn't fetched successfully, we recommend splitting the file into smaller segments and fetching those.",strings:"It looks like there was a problem loading your text file. {{suggestion}}",suggestion:"Try checking if the file path ({{filePath}}) is correct, hosting the file online, or running a local server. (More info at {{link}})",table:"It looks like there was a problem loading your table file. {{suggestion}}",xml:"It looks like there was a problem loading your XML file. {{suggestion}}"},misusedTopLevel:"Did you just try to use p5.js's {{symbolName}} {{symbolType}}? If so, you may want to move it into your sketch's setup() function.\n\nFor more details, see: {{link}}",pre:"🌸 p5.js says: {{message}}",welcome:"Welcome! This is your friendly debugger. To turn me off, switch to using p5.min.js."}}},{}],108:[function(e,t,r){t.exports={fes:{autoplay:"Su browser impidío un medio tocar (de '{{src}}'), posiblemente porque las reglas de autoplay. Para aprender más, visite {{link}}.",fileLoadError:{bytes:"",font:"",gif:"",image:"",json:"",large:"",strings:"",suggestion:"",table:"",xml:""},misusedTopLevel:"",pre:"🌸 p5.js dice: {{message}}",welcome:""}}},{}],109:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i=o(e("./en/translation")),n=o(e("./es/translation"));function o(e){return e&&e.__esModule?e:{default:e}}var a={en:{translation:i.default},es:{translation:n.default}};r.default=a},{"./en/translation":107,"./es/translation":108}]},{},[37])(37)}); ================================================ FILE: docs/examples/pyodide/sketch_007/target/target_sketch.js ================================================ const wrapperContent = ` class PythonFunctions: pass setattr(PythonFunctions, 'map', map) setattr(PythonFunctions, 'filter', filter) setattr(PythonFunctions, 'set', set) _P5_INSTANCE = None _CTX_MIDDLE = None _DEFAULT_FILL = None _DEFAULT_LEADMULT = None _DEFAULT_STROKE = None _DEFAULT_TEXT_FILL = None ADD = None ALT = None ARROW = None AUDIO = None AUTO = None AXES = None BACKSPACE = None BASELINE = None BEVEL = None BEZIER = None BLEND = None BLUR = None BOLD = None BOLDITALIC = None BOTTOM = None BURN = None CENTER = None CHORD = None CLAMP = None CLOSE = None CONTROL = None CORNER = None CORNERS = None CROSS = None CURVE = None DARKEST = None DEG_TO_RAD = None DEGREES = None DELETE = None DIFFERENCE = None DILATE = None DODGE = None DOWN_ARROW = None ENTER = None ERODE = None ESCAPE = None EXCLUSION = None FILL = None GRAY = None GRID = None HALF_PI = None HAND = None HARD_LIGHT = None HSB = None HSL = None IMAGE = None IMMEDIATE = None INVERT = None ITALIC = None LANDSCAPE = None LEFT = None LEFT_ARROW = None LIGHTEST = None LINE_LOOP = None LINE_STRIP = None LINEAR = None LINES = None MIRROR = None MITER = None MOVE = None MULTIPLY = None NEAREST = None NORMAL = None OPAQUE = None OPEN = None OPTION = None OVERLAY = None PI = None PIE = None POINTS = None PORTRAIT = None POSTERIZE = None PROJECT = None QUAD_STRIP = None QUADRATIC = None QUADS = None QUARTER_PI = None RAD_TO_DEG = None RADIANS = None RADIUS = None REPEAT = None REPLACE = None RETURN = None RGB = None RIGHT = None RIGHT_ARROW = None ROUND = None SCREEN = None SHIFT = None SOFT_LIGHT = None SQUARE = None STROKE = None SUBTRACT = None TAB = None TAU = None TEXT = None TEXTURE = None THRESHOLD = None TOP = None TRIANGLE_FAN = None TRIANGLE_STRIP = None TRIANGLES = None TWO_PI = None UP_ARROW = None VIDEO = None WAIT = None WEBGL = None P2D = None PI = None frameCount = None focused = None displayWidth = None displayHeight = None windowWidth = None windowHeight = None width = None height = None deviceOrientation = None accelerationX = None accelerationY = None accelerationZ = None pAccelerationX = None pAccelerationY = None pAccelerationZ = None rotationX = None rotationY = None rotationZ = None pRotationX = None pRotationY = None pRotationZ = None turnAxis = None keyIsPressed = None key = None keyCode = None mouseX = None mouseY = None pmouseX = None pmouseY = None winMouseX = None winMouseY = None pwinMouseX = None pwinMouseY = None mouseButton = None mouseIsPressed = None touches = None pixels = None def alpha(*args): return _P5_INSTANCE.alpha(*args) def blue(*args): return _P5_INSTANCE.blue(*args) def brightness(*args): return _P5_INSTANCE.brightness(*args) def color(*args): return _P5_INSTANCE.color(*args) def green(*args): return _P5_INSTANCE.green(*args) def hue(*args): return _P5_INSTANCE.hue(*args) def lerpColor(*args): return _P5_INSTANCE.lerpColor(*args) def lightness(*args): return _P5_INSTANCE.lightness(*args) def red(*args): return _P5_INSTANCE.red(*args) def saturation(*args): return _P5_INSTANCE.saturation(*args) def background(*args): return _P5_INSTANCE.background(*args) def clear(*args): p5_clear = _P5_INSTANCE.clear(*args) return p5_clear def erase(*args): return _P5_INSTANCE.erase(*args) def noErase(*args): return _P5_INSTANCE.noErase(*args) def colorMode(*args): return _P5_INSTANCE.colorMode(*args) def fill(*args): return _P5_INSTANCE.fill(*args) def noFill(*args): return _P5_INSTANCE.noFill(*args) def noStroke(*args): return _P5_INSTANCE.noStroke(*args) def stroke(*args): return _P5_INSTANCE.stroke(*args) def arc(*args): return _P5_INSTANCE.arc(*args) def ellipse(*args): return _P5_INSTANCE.ellipse(*args) def circle(*args): return _P5_INSTANCE.circle(*args) def line(*args): return _P5_INSTANCE.line(*args) def point(*args): return _P5_INSTANCE.point(*args) def quad(*args): return _P5_INSTANCE.quad(*args) def rect(*args): return _P5_INSTANCE.rect(*args) def square(*args): return _P5_INSTANCE.square(*args) def triangle(*args): return _P5_INSTANCE.triangle(*args) def plane(*args): return _P5_INSTANCE.plane(*args) def box(*args): return _P5_INSTANCE.box(*args) def sphere(*args): return _P5_INSTANCE.sphere(*args) def cylinder(*args): return _P5_INSTANCE.cylinder(*args) def cone(*args): return _P5_INSTANCE.cone(*args) def ellipsoid(*args): return _P5_INSTANCE.ellipsoid(*args) def torus(*args): return _P5_INSTANCE.torus(*args) def loadModel(*args): return _P5_INSTANCE.loadModel(*args) def model(*args): return _P5_INSTANCE.model(*args) def ellipseMode(*args): return _P5_INSTANCE.ellipseMode(*args) def noSmooth(*args): return _P5_INSTANCE.noSmooth(*args) def rectMode(*args): return _P5_INSTANCE.rectMode(*args) def smooth(*args): return _P5_INSTANCE.smooth(*args) def strokeCap(*args): return _P5_INSTANCE.strokeCap(*args) def strokeJoin(*args): return _P5_INSTANCE.strokeJoin(*args) def strokeWeight(*args): return _P5_INSTANCE.strokeWeight(*args) def bezier(*args): return _P5_INSTANCE.bezier(*args) def bezierDetail(*args): return _P5_INSTANCE.bezierDetail(*args) def bezierPoint(*args): return _P5_INSTANCE.bezierPoint(*args) def bezierTangent(*args): return _P5_INSTANCE.bezierTangent(*args) def curve(*args): return _P5_INSTANCE.curve(*args) def curveDetail(*args): return _P5_INSTANCE.curveDetail(*args) def curveTightness(*args): return _P5_INSTANCE.curveTightness(*args) def curvePoint(*args): return _P5_INSTANCE.curvePoint(*args) def curveTangent(*args): return _P5_INSTANCE.curveTangent(*args) def beginContour(*args): return _P5_INSTANCE.beginContour(*args) def beginShape(*args): return _P5_INSTANCE.beginShape(*args) def bezierVertex(*args): return _P5_INSTANCE.bezierVertex(*args) def curveVertex(*args): return _P5_INSTANCE.curveVertex(*args) def endContour(*args): return _P5_INSTANCE.endContour(*args) def endShape(*args): return _P5_INSTANCE.endShape(*args) def quadraticVertex(*args): return _P5_INSTANCE.quadraticVertex(*args) def vertex(*args): return _P5_INSTANCE.vertex(*args) def cursor(*args): return _P5_INSTANCE.cursor(*args) def frameRate(*args): return _P5_INSTANCE.frameRate(*args) def noCursor(*args): return _P5_INSTANCE.noCursor(*args) def fullscreen(*args): return _P5_INSTANCE.fullscreen(*args) def pixelDensity(*args): return _P5_INSTANCE.pixelDensity(*args) def displayDensity(*args): return _P5_INSTANCE.displayDensity(*args) def getURL(*args): return _P5_INSTANCE.getURL(*args) def getURLPath(*args): return _P5_INSTANCE.getURLPath(*args) def getURLParams(*args): return _P5_INSTANCE.getURLParams(*args) def remove(*args): return _P5_INSTANCE.remove(*args) def noLoop(*args): return _P5_INSTANCE.noLoop(*args) def loop(*args): return _P5_INSTANCE.loop(*args) def push(*args): return _P5_INSTANCE.push(*args) def redraw(*args): return _P5_INSTANCE.redraw(*args) def resizeCanvas(*args): return _P5_INSTANCE.resizeCanvas(*args) def noCanvas(*args): return _P5_INSTANCE.noCanvas(*args) def createGraphics(*args): return _P5_INSTANCE.createGraphics(*args) def blendMode(*args): return _P5_INSTANCE.blendMode(*args) def setAttributes(*args): return _P5_INSTANCE.setAttributes(*args) def applyMatrix(*args): return _P5_INSTANCE.applyMatrix(*args) def resetMatrix(*args): return _P5_INSTANCE.resetMatrix(*args) def rotate(*args): return _P5_INSTANCE.rotate(*args) def rotateX(*args): return _P5_INSTANCE.rotateX(*args) def rotateY(*args): return _P5_INSTANCE.rotateY(*args) def rotateZ(*args): return _P5_INSTANCE.rotateZ(*args) def scale(*args): return _P5_INSTANCE.scale(*args) def shearX(*args): return _P5_INSTANCE.shearX(*args) def shearY(*args): return _P5_INSTANCE.shearY(*args) def translate(*args): return _P5_INSTANCE.translate(*args) def createStringDict(*args): return _P5_INSTANCE.createStringDict(*args) def createNumberDict(*args): return _P5_INSTANCE.createNumberDict(*args) def append(*args): return _P5_INSTANCE.append(*args) def arrayCopy(*args): return _P5_INSTANCE.arrayCopy(*args) def concat(*args): return _P5_INSTANCE.concat(*args) def reverse(*args): return _P5_INSTANCE.reverse(*args) def shorten(*args): return _P5_INSTANCE.shorten(*args) def shuffle(*args): return _P5_INSTANCE.shuffle(*args) def sort(*args): return _P5_INSTANCE.sort(*args) def splice(*args): return _P5_INSTANCE.splice(*args) def subset(*args): return _P5_INSTANCE.subset(*args) def float(*args): return _P5_INSTANCE.float(*args) def int(*args): return _P5_INSTANCE.int(*args) def str(*args): return _P5_INSTANCE.str(*args) def boolean(*args): return _P5_INSTANCE.boolean(*args) def byte(*args): return _P5_INSTANCE.byte(*args) def char(*args): return _P5_INSTANCE.char(*args) def unchar(*args): return _P5_INSTANCE.unchar(*args) def hex(*args): return _P5_INSTANCE.hex(*args) def unhex(*args): return _P5_INSTANCE.unhex(*args) def join(*args): return _P5_INSTANCE.join(*args) def match(*args): return _P5_INSTANCE.match(*args) def matchAll(*args): return _P5_INSTANCE.matchAll(*args) def nf(*args): return _P5_INSTANCE.nf(*args) def nfc(*args): return _P5_INSTANCE.nfc(*args) def nfp(*args): return _P5_INSTANCE.nfp(*args) def nfs(*args): return _P5_INSTANCE.nfs(*args) def split(*args): return _P5_INSTANCE.split(*args) def splitTokens(*args): return _P5_INSTANCE.splitTokens(*args) def trim(*args): return _P5_INSTANCE.trim(*args) def setMoveThreshold(*args): return _P5_INSTANCE.setMoveThreshold(*args) def setShakeThreshold(*args): return _P5_INSTANCE.setShakeThreshold(*args) def keyIsDown(*args): return _P5_INSTANCE.keyIsDown(*args) def createImage(*args): return _P5_INSTANCE.createImage(*args) def saveCanvas(*args): return _P5_INSTANCE.saveCanvas(*args) def saveFrames(*args): return _P5_INSTANCE.saveFrames(*args) def loadImage(*args): return _P5_INSTANCE.loadImage(*args) def image(*args): return _P5_INSTANCE.image(*args) def tint(*args): return _P5_INSTANCE.tint(*args) def noTint(*args): return _P5_INSTANCE.noTint(*args) def imageMode(*args): return _P5_INSTANCE.imageMode(*args) def blend(*args): return _P5_INSTANCE.blend(*args) def copy(*args): return _P5_INSTANCE.copy(*args) def filter(*args): if len(args) > 1 and (args[0] is None or callable(args[0])): return PythonFunctions.filter(*args) else: return _P5_INSTANCE.filter(*args) def get(*args): return _P5_INSTANCE.get(*args) def loadPixels(*args): return _P5_INSTANCE.loadPixels(*args) def set(*args): if len(args) <= 1: return PythonFunctions.set(*args) else: return _P5_INSTANCE.set(*args) def updatePixels(*args): return _P5_INSTANCE.updatePixels(*args) def loadJSON(*args): return _P5_INSTANCE.loadJSON(*args) def loadStrings(*args): return _P5_INSTANCE.loadStrings(*args) def loadTable(*args): return _P5_INSTANCE.loadTable(*args) def loadXML(*args): return _P5_INSTANCE.loadXML(*args) def loadBytes(*args): return _P5_INSTANCE.loadBytes(*args) def httpGet(*args): return _P5_INSTANCE.httpGet(*args) def httpPost(*args): return _P5_INSTANCE.httpPost(*args) def httpDo(*args): return _P5_INSTANCE.httpDo(*args) def createWriter(*args): return _P5_INSTANCE.createWriter(*args) def save(*args): return _P5_INSTANCE.save(*args) def saveJSON(*args): return _P5_INSTANCE.saveJSON(*args) def saveStrings(*args): return _P5_INSTANCE.saveStrings(*args) def saveTable(*args): return _P5_INSTANCE.saveTable(*args) def day(*args): return _P5_INSTANCE.day(*args) def hour(*args): return _P5_INSTANCE.hour(*args) def minute(*args): return _P5_INSTANCE.minute(*args) def millis(*args): return _P5_INSTANCE.millis(*args) def month(*args): return _P5_INSTANCE.month(*args) def second(*args): return _P5_INSTANCE.second(*args) def year(*args): return _P5_INSTANCE.year(*args) def createVector(*args): return _P5_INSTANCE.createVector(*args) def abs(*args): return _P5_INSTANCE.abs(*args) def ceil(*args): return _P5_INSTANCE.ceil(*args) def constrain(*args): return _P5_INSTANCE.constrain(*args) def dist(*args): return _P5_INSTANCE.dist(*args) def exp(*args): return _P5_INSTANCE.exp(*args) def floor(*args): return _P5_INSTANCE.floor(*args) def lerp(*args): return _P5_INSTANCE.lerp(*args) def log(*args): return _P5_INSTANCE.log(*args) def mag(*args): return _P5_INSTANCE.mag(*args) def map(*args): if len(args) > 1 and callable(args[0]): return PythonFunctions.map(*args) else: return _P5_INSTANCE.map(*args) def max(*args): return _P5_INSTANCE.max(*args) def min(*args): return _P5_INSTANCE.min(*args) def norm(*args): return _P5_INSTANCE.norm(*args) def pow(*args): return _P5_INSTANCE.pow(*args) def round(*args): return _P5_INSTANCE.round(*args) def sq(*args): return _P5_INSTANCE.sq(*args) def sqrt(*args): return _P5_INSTANCE.sqrt(*args) def noise(*args): return _P5_INSTANCE.noise(*args) def noiseDetail(*args): return _P5_INSTANCE.noiseDetail(*args) def noiseSeed(*args): return _P5_INSTANCE.noiseSeed(*args) def randomSeed(*args): return _P5_INSTANCE.randomSeed(*args) def random(*args): return _P5_INSTANCE.random(*args) def randomGaussian(*args): return _P5_INSTANCE.randomGaussian(*args) def acos(*args): return _P5_INSTANCE.acos(*args) def asin(*args): return _P5_INSTANCE.asin(*args) def atan(*args): return _P5_INSTANCE.atan(*args) def atan2(*args): return _P5_INSTANCE.atan2(*args) def cos(*args): return _P5_INSTANCE.cos(*args) def sin(*args): return _P5_INSTANCE.sin(*args) def tan(*args): return _P5_INSTANCE.tan(*args) def degrees(*args): return _P5_INSTANCE.degrees(*args) def radians(*args): return _P5_INSTANCE.radians(*args) def angleMode(*args): return _P5_INSTANCE.angleMode(*args) def textAlign(*args): return _P5_INSTANCE.textAlign(*args) def textLeading(*args): return _P5_INSTANCE.textLeading(*args) def textSize(*args): return _P5_INSTANCE.textSize(*args) def textStyle(*args): return _P5_INSTANCE.textStyle(*args) def textWidth(*args): return _P5_INSTANCE.textWidth(*args) def textAscent(*args): return _P5_INSTANCE.textAscent(*args) def textDescent(*args): return _P5_INSTANCE.textDescent(*args) def loadFont(*args): return _P5_INSTANCE.loadFont(*args) def text(*args): return _P5_INSTANCE.text(*args) def textFont(*args): return _P5_INSTANCE.textFont(*args) def orbitControl(*args): return _P5_INSTANCE.orbitControl(*args) def debugMode(*args): return _P5_INSTANCE.debugMode(*args) def noDebugMode(*args): return _P5_INSTANCE.noDebugMode(*args) def ambientLight(*args): return _P5_INSTANCE.ambientLight(*args) def directionalLight(*args): return _P5_INSTANCE.directionalLight(*args) def pointLight(*args): return _P5_INSTANCE.pointLight(*args) def lights(*args): return _P5_INSTANCE.lights(*args) def loadShader(*args): return _P5_INSTANCE.loadShader(*args) def createShader(*args): return _P5_INSTANCE.createShader(*args) def shader(*args): return _P5_INSTANCE.shader(*args) def resetShader(*args): return _P5_INSTANCE.resetShader(*args) def normalMaterial(*args): return _P5_INSTANCE.normalMaterial(*args) def texture(*args): return _P5_INSTANCE.texture(*args) def textureMode(*args): return _P5_INSTANCE.textureMode(*args) def textureWrap(*args): return _P5_INSTANCE.textureWrap(*args) def ambientMaterial(*args): return _P5_INSTANCE.ambientMaterial(*args) def specularMaterial(*args): return _P5_INSTANCE.specularMaterial(*args) def shininess(*args): return _P5_INSTANCE.shininess(*args) def camera(*args): return _P5_INSTANCE.camera(*args) def perspective(*args): return _P5_INSTANCE.perspective(*args) def ortho(*args): return _P5_INSTANCE.ortho(*args) def createCamera(*args): return _P5_INSTANCE.createCamera(*args) def setCamera(*args): return _P5_INSTANCE.setCamera(*args) def select(*args): return _P5_INSTANCE.select(*args) def selectAll(*args): return _P5_INSTANCE.selectAll(*args) def removeElements(*args): return _P5_INSTANCE.removeElements(*args) def changed(*args): return _P5_INSTANCE.changed(*args) def input(*args): return _P5_INSTANCE.input(*args) def createDiv(*args): return _P5_INSTANCE.createDiv(*args) def createP(*args): return _P5_INSTANCE.createP(*args) def createSpan(*args): return _P5_INSTANCE.createSpan(*args) def createImg(*args): return _P5_INSTANCE.createImg(*args) def createA(*args): return _P5_INSTANCE.createA(*args) def createSlider(*args): return _P5_INSTANCE.createSlider(*args) def createButton(*args): return _P5_INSTANCE.createButton(*args) def createCheckbox(*args): return _P5_INSTANCE.createCheckbox(*args) def createSelect(*args): return _P5_INSTANCE.createSelect(*args) def createRadio(*args): return _P5_INSTANCE.createRadio(*args) def createColorPicker(*args): return _P5_INSTANCE.createColorPicker(*args) def createInput(*args): return _P5_INSTANCE.createInput(*args) def createFileInput(*args): return _P5_INSTANCE.createFileInput(*args) def createVideo(*args): return _P5_INSTANCE.createVideo(*args) def createAudio(*args): return _P5_INSTANCE.createAudio(*args) def createCapture(*args): return _P5_INSTANCE.createCapture(*args) def createElement(*args): return _P5_INSTANCE.createElement(*args) def createCanvas(*args): canvas = _P5_INSTANCE.createCanvas(*args) global width, height width = _P5_INSTANCE.width height = _P5_INSTANCE.height return canvas def __deviceMoved(e): try: _bind_event_function(deviceMoved, e) except NameError: pass def __deviceTurned(e): try: _bind_event_function(deviceTurned, e) except NameError: pass def __deviceShaken(e): try: _bind_event_function(deviceShaken, e) except NameError: pass def __touchEnded(e): try: _bind_event_function(deviceShaken, e) except NameError: pass def __touchStarted(e): try: _bind_event_function(touchStarted, e) except NameError: pass def __windowResized(e): try: _bind_event_function(windowResized, e) except NameError: pass def __touchMoved(e): try: _bind_event_function(touchMoved, e) except NameError: pass def __mouseMoved(e): try: _bind_event_function(mouseMoved, e) except NameError: pass def __mouseDragged(e): try: _bind_event_function(mouseDragged, e) except NameError: pass def __mousePressed(e): try: _bind_event_function(mousePressed, e) except NameError: pass def __mouseReleased(e): try: _bind_event_function(mouseReleased, e) except NameError: pass def __mouseClicked(e): try: _bind_event_function(mouseClicked, e) except NameError: pass def __doubleClicked(e): try: _bind_event_function(doubleClicked, e) except NameError: pass def __mouseWheel(e): try: _bind_event_function(mouseWheel, e) except NameError: pass def __keyPressed(e): try: _bind_event_function(keyPressed, e) except NameError: pass def __keyReleased(e): try: _bind_event_function(keyReleased, e) except NameError: pass def __keyTyped(e): try: _bind_event_function(keyTyped, e) except NameError: pass def __keyIsDown(e): try: _bind_event_function(keyIsDown, e) except NameError: pass def pop(*args): p5_pop = _P5_INSTANCE.pop(*args) return p5_pop # Processing Python or Java mode compatibility aliases size = createCanvas popMatrix = pop popStyle = pop pushMatrix = push pushStyle = push # PVector is a wrapper/helper class for p5.Vector objets # providing names similar to Processing Python or Java modes # but mostly keeping p5js functionality from numbers import Number class PVector: def __init__(self, x=0, y=0, z=0): self.__vector = createVector(x, y, z) self.add = self.__instance_add__ self.sub = self.__instance_sub__ self.mult = self.__instance_mult__ self.div = self.__instance_div__ self.cross = self.__instance_cross__ self.dist = self.__instance_dist__ self.dot = self.__instance_dot__ self.lerp = self.__instance_lerp__ @property def x(self): return self.__vector.x @x.setter def x(self, x): self.__vector.x = x @property def y(self): return self.__vector.y @y.setter def y(self, y): self.__vector.y = y @property def z(self): return self.__vector.z @z.setter def z(self, z): self.__vector.z = z def mag(self): return self.__vector.mag() def magSq(self): return self.__vector.magSq() def setMag(self, mag): self.__vector.setMag(mag) return self def normalize(self): self.__vector.normalize() return self def limit(self, max): self.__vector.limit(max) return self def heading(self): return self.__vector.heading() def rotate(self, angle): self.__vector.rotate(angle) return self def __instance_add__(self, *args): if len(args) == 1: return PVector.add(self, args[0], self) else: return PVector.add(self, PVector(*args), self) def __instance_sub__(self, *args): if len(args) == 1: return PVector.sub(self, args[0], self) else: return PVector.sub(self, PVector(*args), self) def __instance_mult__(self, o): return PVector.mult(self, o, self) def __instance_div__(self, f): return PVector.div(self, f, self) def __instance_cross__(self, o): return PVector.cross(self, o, self) def __instance_dist__(self, o): return PVector.dist(self, o) def __instance_dot__(self, *args): if len(args) == 1: v = args[0] else: v = args return self.x * v[0] + self.y * v[1] + self.z * v[2] def __instance_lerp__(self, *args): if len(args) == 2: return PVector.lerp(self, args[0], args[1], self) else: vx, vy, vz, f = args return PVector.lerp(self, PVector(vx, vy, vz), f, self) def get(self): return PVector(self.x, self.y, self.z) def copy(self): return PVector(self.x, self.y, self.z) def __getitem__(self, k): return getattr(self, ('x', 'y', 'z')[k]) def __setitem__(self, k, v): setattr(self, ('x', 'y', 'z')[k], v) def __copy__(self): return PVector(self.x, self.y, self.z) def __deepcopy__(self, memo): return PVector(self.x, self.y, self.z) def __repr__(self): # PROVISÓRIO return f'PVector({self.x}, {self.y}, {self.z})' def set(self, *args): """ Sets the x, y, and z component of the vector using two or three separate variables, the data from a p5.Vector, or the values from a float array. """ self.__vector.set(*args) @classmethod def add(cls, a, b, dest=None): if dest is None: return PVector(a.x + b[0], a.y + b[1], a.z + b[2]) dest.__vector.set(a.x + b[0], a.y + b[1], a.z + b[2]) return dest @classmethod def sub(cls, a, b, dest=None): if dest is None: return PVector(a.x - b[0], a.y - b[1], a.z - b[2]) dest.__vector.set(a.x - b[0], a.y - b[1], a.z - b[2]) return dest @classmethod def mult(cls, a, b, dest=None): if dest is None: return PVector(a.x * b, a.y * b, a.z * b) dest.__vector.set(a.x * b, a.y * b, a.z * b) return dest @classmethod def div(cls, a, b, dest=None): if dest is None: return PVector(a.x / b, a.y / b, a.z / b) dest.__vector.set(a.x / b, a.y / b, a.z / b) return dest @classmethod def dist(cls, a, b): return a.__vector.dist(b.__vector) @classmethod def dot(cls, a, b): return a.__vector.dot(b.__vector) def __add__(a, b): return PVector.add(a, b, None) def __sub__(a, b): return PVector.sub(a, b, None) def __isub__(a, b): a.sub(b) return a def __iadd__(a, b): a.add(b) return a def __mul__(a, b): if not isinstance(b, Number): raise TypeError( "The * operator can only be used to multiply a PVector by a number") return PVector.mult(a, float(b), None) def __rmul__(a, b): if not isinstance(b, Number): raise TypeError( "The * operator can only be used to multiply a PVector by a number") return PVector.mult(a, float(b), None) def __imul__(a, b): if not isinstance(b, Number): raise TypeError( "The *= operator can only be used to multiply a PVector by a number") a.__vector.mult(float(b)) return a def __truediv__(a, b): if not isinstance(b, Number): raise TypeError( "The * operator can only be used to multiply a PVector by a number") return PVector(a.x / float(b), a.y / float(b), a.z / float(b)) def __itruediv__(a, b): if not isinstance(b, Number): raise TypeError( "The /= operator can only be used to multiply a PVector by a number") a.__vector.set(a.x / float(b), a.y / float(b), a.z / float(b)) return a def __eq__(a, b): return a.x == b[0] and a.y == b[1] and a.z == b[2] def __lt__(a, b): return a.magSq() < b.magSq() def __le__(a, b): return a.magSq() <= b.magSq() def __gt__(a, b): return a.magSq() > b.magSq() def __ge__(a, b): return a.magSq() >= b.magSq() # Problematic class methods, we would rather use p5.Vector when possible... @classmethod def lerp(cls, a, b, f, dest=None): v = createVector(a.x, a.y, a.z) v.lerp(b.__vector, f) if dest is None: return PVector(v.x, v.y, v.z) dest.set(v.x, v.y, v.z) return dest @classmethod def cross(cls, a, b, dest=None): x = a.y * b[2] - b[1] * a.z y = a.z * b[0] - b[2] * a.x z = a.x * b[1] - b[0] * a.y if dest is None: return PVector(x, y, z) dest.set(x, y, z) return dest @classmethod def fromAngle(cls, angle, length=1): # https://github.com/processing/p5.js/blob/3f0b2f0fe575dc81c724474154f5b23a517b7233/src/math/p5.Vector.js return PVector(length * cos(angle), length * sin(angle), 0) @classmethod def fromAngles(theta, phi, length=1): # https://github.com/processing/p5.js/blob/3f0b2f0fe575dc81c724474154f5b23a517b7233/src/math/p5.Vector.js cosPhi = cos(phi) sinPhi = sin(phi) cosTheta = cos(theta) sinTheta = sin(theta) return PVector(length * sinTheta * sinPhi, -length * cosTheta, length * sinTheta * cosPhi) @classmethod def random2D(cls): return PVector.fromAngle(random(TWO_PI)) @classmethod def random3D(cls, dest=None): angle = random(TWO_PI) vz = random(2) - 1 mult = sqrt(1 - vz * vz) vx = mult * cos(angle) vy = mult * sin(angle) if dest is None: return PVector(vx, vy, vz) dest.set(vx, vy, vz) return dest @classmethod def angleBetween(cls, a, b): return acos(a.dot(b) / sqrt(a.magSq() * b.magSq())) # Other harmless p5js methods def equals(self, v): return self == v def heading2D(self): return self.__vector.heading() def reflect(self, *args): # Reflect the incoming vector about a normal to a line in 2D, or about # a normal to a plane in 3D This method acts on the vector directly r = self.__vector.reflect(*args) return r def array(self): # Return a representation of this vector as a float array. This is only # for temporary use. If used in any w fashion, the contents should be # copied by using the p5.Vector.copy() method to copy into your own # array. return self.__vector.array() def toString(self): # Returns a string representation of a vector v by calling String(v) or v.toString(). # return self.__vector.toString() would be something like "p5.vector # Object […, …, …]" return str(self) def rem(self, *args): # Gives remainder of a vector when it is divided by anw vector. See # examples for more context. self.__vector.rem(*args) return self def pre_draw(p5_instance, draw_func, *args, **kwargs): """ We need to run this before the actual draw to insert and update p5 env variables """ global _CTX_MIDDLE, _DEFAULT_FILL, _DEFAULT_LEADMULT, _DEFAULT_STROKE, _DEFAULT_TEXT_FILL global ADD, ALT, ARROW, AUTO, AUDIO, AXES, BACKSPACE, BASELINE, BEVEL, BEZIER, BLEND, BLUR, BOLD, BOLDITALIC global BOTTOM, BURN, CENTER, CHORD, CLAMP, CLOSE, CONTROL, CORNER, CORNERS, CROSS, CURVE, DARKEST global DEG_TO_RAD, DEGREES, DELETE, DIFFERENCE, DILATE, DODGE, DOWN_ARROW, ENTER, ERODE, ESCAPE, EXCLUSION global FILL, GRAY, GRID, HALF_PI, HAND, HARD_LIGHT, HSB, HSL, IMAGE, IMMEDIATE, INVERT, ITALIC, LANDSCAPE global LEFT, LEFT_ARROW, LIGHTEST, LINE_LOOP, LINE_STRIP, LINEAR, LINES, MIRROR, MITER, MOVE, MULTIPLY, NEAREST global NORMAL, OPAQUE, OPEN, OPTION, OVERLAY, P2D, P3D, PI, PIE, POINTS, PORTRAIT, POSTERIZE, PROJECT, QUAD_STRIP global QUADRATIC, QUADS, QUARTER_PI, RAD_TO_DEG, RADIANS, RADIUS, REPEAT, REPLACE, RETURN, RGB, RIGHT, RIGHT_ARROW global ROUND, SCREEN, SHIFT, SOFT_LIGHT, SQUARE, STROKE, SUBTRACT, TAB, TAU, TEXT, TEXTURE, THRESHOLD, TOP global TRIANGLE_FAN, TRIANGLE_STRIP, TRIANGLES, TWO_PI, UP_ARROW, VIDEO, WAIT, WEBGL global frameCount, focused, displayWidth, displayHeight, windowWidth, windowHeight, width, height global deviceOrientation, accelerationX, accelerationY, accelerationZ global pAccelerationX, pAccelerationY, pAccelerationZ, rotationX, rotationY, rotationZ global pRotationX, pRotationY, pRotationZ, turnAxis, keyIsPressed, key, keyCode, mouseX, mouseY, pmouseX, pmouseY global winMouseX, winMouseY, pwinMouseX, pwinMouseY, mouseButton, mouseIsPressed, touches, pixels _CTX_MIDDLE = p5_instance._CTX_MIDDLE _DEFAULT_FILL = p5_instance._DEFAULT_FILL _DEFAULT_LEADMULT = p5_instance._DEFAULT_LEADMULT _DEFAULT_STROKE = p5_instance._DEFAULT_STROKE _DEFAULT_TEXT_FILL = p5_instance._DEFAULT_TEXT_FILL ADD = p5_instance.ADD ALT = p5_instance.ALT ARROW = p5_instance.ARROW AUDIO = p5_instance.AUDIO AUTO = p5_instance.AUTO AXES = p5_instance.AXES BACKSPACE = p5_instance.BACKSPACE BASELINE = p5_instance.BASELINE BEVEL = p5_instance.BEVEL BEZIER = p5_instance.BEZIER BLEND = p5_instance.BLEND BLUR = p5_instance.BLUR BOLD = p5_instance.BOLD BOLDITALIC = p5_instance.BOLDITALIC BOTTOM = p5_instance.BOTTOM BURN = p5_instance.BURN CENTER = p5_instance.CENTER CHORD = p5_instance.CHORD CLAMP = p5_instance.CLAMP CLOSE = p5_instance.CLOSE CONTROL = p5_instance.CONTROL CORNER = p5_instance.CORNER CORNERS = p5_instance.CORNERS CROSS = p5_instance.CROSS CURVE = p5_instance.CURVE DARKEST = p5_instance.DARKEST DEG_TO_RAD = p5_instance.DEG_TO_RAD DEGREES = p5_instance.DEGREES DELETE = p5_instance.DELETE DIFFERENCE = p5_instance.DIFFERENCE DILATE = p5_instance.DILATE DODGE = p5_instance.DODGE DOWN_ARROW = p5_instance.DOWN_ARROW ENTER = p5_instance.ENTER ERODE = p5_instance.ERODE ESCAPE = p5_instance.ESCAPE EXCLUSION = p5_instance.EXCLUSION FILL = p5_instance.FILL GRAY = p5_instance.GRAY GRID = p5_instance.GRID HALF_PI = p5_instance.HALF_PI HAND = p5_instance.HAND HARD_LIGHT = p5_instance.HARD_LIGHT HSB = p5_instance.HSB HSL = p5_instance.HSL IMAGE = p5_instance.IMAGE IMMEDIATE = p5_instance.IMMEDIATE INVERT = p5_instance.INVERT ITALIC = p5_instance.ITALIC LANDSCAPE = p5_instance.LANDSCAPE LEFT = p5_instance.LEFT LEFT_ARROW = p5_instance.LEFT_ARROW LIGHTEST = p5_instance.LIGHTEST LINE_LOOP = p5_instance.LINE_LOOP LINE_STRIP = p5_instance.LINE_STRIP LINEAR = p5_instance.LINEAR LINES = p5_instance.LINES MIRROR = p5_instance.MIRROR MITER = p5_instance.MITER MOVE = p5_instance.MOVE MULTIPLY = p5_instance.MULTIPLY NEAREST = p5_instance.NEAREST NORMAL = p5_instance.NORMAL OPAQUE = p5_instance.OPAQUE OPEN = p5_instance.OPEN OPTION = p5_instance.OPTION OVERLAY = p5_instance.OVERLAY P2D = p5_instance.P2D P3D = p5_instance.WEBGL PI = p5_instance.PI PIE = p5_instance.PIE POINTS = p5_instance.POINTS PORTRAIT = p5_instance.PORTRAIT POSTERIZE = p5_instance.POSTERIZE PROJECT = p5_instance.PROJECT QUAD_STRIP = p5_instance.QUAD_STRIP QUADRATIC = p5_instance.QUADRATIC QUADS = p5_instance.QUADS QUARTER_PI = p5_instance.QUARTER_PI RAD_TO_DEG = p5_instance.RAD_TO_DEG RADIANS = p5_instance.RADIANS RADIUS = p5_instance.RADIUS REPEAT = p5_instance.REPEAT REPLACE = p5_instance.REPLACE RETURN = p5_instance.RETURN RGB = p5_instance.RGB RIGHT = p5_instance.RIGHT RIGHT_ARROW = p5_instance.RIGHT_ARROW ROUND = p5_instance.ROUND SCREEN = p5_instance.SCREEN SHIFT = p5_instance.SHIFT SOFT_LIGHT = p5_instance.SOFT_LIGHT SQUARE = p5_instance.SQUARE STROKE = p5_instance.STROKE SUBTRACT = p5_instance.SUBTRACT TAB = p5_instance.TAB TAU = p5_instance.TAU TEXT = p5_instance.TEXT TEXTURE = p5_instance.TEXTURE THRESHOLD = p5_instance.THRESHOLD TOP = p5_instance.TOP TRIANGLE_FAN = p5_instance.TRIANGLE_FAN TRIANGLE_STRIP = p5_instance.TRIANGLE_STRIP TRIANGLES = p5_instance.TRIANGLES TWO_PI = p5_instance.TWO_PI UP_ARROW = p5_instance.UP_ARROW VIDEO = p5_instance.VIDEO WAIT = p5_instance.WAIT WEBGL = p5_instance.WEBGL frameCount = p5_instance.frameCount focused = p5_instance.focused displayWidth = p5_instance.displayWidth displayHeight = p5_instance.displayHeight windowWidth = p5_instance.windowWidth windowHeight = p5_instance.windowHeight width = p5_instance.width height = p5_instance.height deviceOrientation = p5_instance.deviceOrientation accelerationX = p5_instance.accelerationX accelerationY = p5_instance.accelerationY accelerationZ = p5_instance.accelerationZ pAccelerationX = p5_instance.pAccelerationX pAccelerationY = p5_instance.pAccelerationY pAccelerationZ = p5_instance.pAccelerationZ rotationX = p5_instance.rotationX rotationY = p5_instance.rotationY rotationZ = p5_instance.rotationZ pRotationX = p5_instance.pRotationX pRotationY = p5_instance.pRotationY pRotationZ = p5_instance.pRotationZ turnAxis = p5_instance.turnAxis keyIsPressed = p5_instance.keyIsPressed key = p5_instance.key keyCode = p5_instance.keyCode mouseX = p5_instance.mouseX mouseY = p5_instance.mouseY pmouseX = p5_instance.pmouseX pmouseY = p5_instance.pmouseY winMouseX = p5_instance.winMouseX winMouseY = p5_instance.winMouseY pwinMouseX = p5_instance.pwinMouseX pwinMouseY = p5_instance.pwinMouseY mouseButton = p5_instance.mouseButton mouseIsPressed = p5_instance.mouseIsPressed touches = p5_instance.touches pixels = p5_instance.pixels return draw_func(*args, **kwargs) def global_p5_injection(p5_sketch): """ Injects the p5js's skecth instance as a global variable to setup and draw functions """ def decorator(f, *args, **kwargs): def wrapper(*args, **kwargs): global _P5_INSTANCE _P5_INSTANCE = p5_sketch return pre_draw(_P5_INSTANCE, f, *args, **kwargs) return wrapper return decorator def start_p5(preload_func, setup_func, draw_func, event_functions): """ This is the entrypoint function. It accepts 2 parameters: - preload_func: A Python preload callable - setup_func: a Python setup callable - draw_func: a Python draw callable - event_functions: a config dict for the event functions in the format: {"eventFunctionName": python_event_function} This method gets the p5js's sketch instance and injects them """ def sketch_setup(p5_sketch): """ Callback function called to configure new p5 instance """ p5_sketch.preload = global_p5_injection(p5_sketch)(preload_func) p5_sketch.setup = global_p5_injection(p5_sketch)(setup_func) p5_sketch.draw = global_p5_injection(p5_sketch)(draw_func) window.instance = p5.new(sketch_setup, 'sketch-holder') # Register event functions event_function_names = ( "deviceMoved", "deviceTurned", "deviceShaken", "windowResized", "keyPressed", "keyReleased", "keyTyped", "mousePressed", "mouseReleased", "mouseClicked", "doubleClicked", "mouseMoved", "mouseDragged", "mouseWheel", "touchStarted", "touchMoved", "touchEnded", "keyIsDown", ) for f_name in [f for f in event_function_names if event_functions.get(f, None)]: func = event_functions[f_name] event_func = global_p5_injection(window.instance)(func) setattr(window.instance, f_name, event_func) `; const placeholder = ` def preload(): pass def setup(): pass def draw(): pass deviceMoved = None deviceTurned = None deviceShaken = None keyPressed = None keyReleased = None keyTyped = None mouseMoved = None mouseDragged = None mousePressed = None mouseReleased = None mouseClicked = None doubleClicked = None mouseWheel = None touchStarted = None touchMoved = None touchEnded = None windowResized = None `; let userCode = ` def setup(): createCanvas(900, 900) stroke(27, 27, 27, 10) strokeWeight(2) def draw(): push() translate(width / 2, height / 2) v = PVector.random2D() v.normalize() v = PVector.mult(v,random(100, 400)) line(0, 0, v.x, v.y) pop() `; const startCode = ` event_functions = { "deviceMoved": deviceMoved, "deviceTurned": deviceTurned, "deviceShaken": deviceShaken, "keyPressed": keyPressed, "keyReleased": keyReleased, "keyTyped": keyTyped, "mouseMoved": mouseMoved, "mouseDragged": mouseDragged, "mousePressed": mousePressed, "mouseReleased": mouseReleased, "mouseClicked": mouseClicked, "doubleClicked": doubleClicked, "mouseWheel": mouseWheel, "touchStarted": touchStarted, "touchMoved": touchMoved, "touchEnded": touchEnded, "windowResized": windowResized, } start_p5(preload, setup, draw, event_functions) `; function runCode() { let code = [ placeholder, userCode, wrapperContent, startCode, ].join('\n'); if (window.instance) { window.instance.canvas.remove(); } console.log("Python execution output:"); window.pyodide.runPython(code); } async function main() { const config = { indexURL : "https://cdn.jsdelivr.net/pyodide/v0.18.1/full/", fullStdLib: false, } window.pyodide = await loadPyodide(config); // Pyodide is now ready to use... console.log(window.pyodide.runPython(` import io, code, sys from js import p5, window, document print(sys.version) `)); window.runSketchCode = (code) => { userCode = code; runCode(); } runCode(); }; // async method main(); ================================================ FILE: docs/examples/pyodide/sketch_008/index.html ================================================ sketch_008 - pyp5js

Python code here.

rect_base_size = 30
positions = []
rect_size = None

def setup():
    global rect_size

    createP("Hi! This is an example of how to use p5.dom.js with pyp5js")

    # creates a container div
    slider_div = createDiv()
    slider_div.style("display", "block")

    # creates the slider
    rect_size = createSlider(0, 600, 100)
    rect_size.style('width', '50%')

    # adds the slider to the container div
    slider_div.child(rect_size)

    createCanvas(600, 600)

    for x in range(-rect_base_size, width + rect_base_size, rect_base_size):
        for y in range(-rect_base_size, height + rect_base_size, rect_base_size):
            positions.append((x, y))

    noFill()
    strokeWeight(2)
    rectMode(CENTER)


def draw():
    background(255)
    size = rect_size.value()
    for x, y in positions:
        rect(x, y, size, size)
================================================ FILE: docs/examples/pyodide/sketch_008/sketch_008.py ================================================ rect_base_size = 30 positions = [] rect_size = None def setup(): global rect_size createP("Hi! This is an example of how to use p5.dom.js with pyp5js") # creates a container div slider_div = createDiv() slider_div.style("display", "block") # creates the slider rect_size = createSlider(0, 600, 100) rect_size.style('width', '50%') # adds the slider to the container div slider_div.child(rect_size) createCanvas(600, 600) for x in range(-rect_base_size, width + rect_base_size, rect_base_size): for y in range(-rect_base_size, height + rect_base_size, rect_base_size): positions.append((x, y)) noFill() strokeWeight(2) rectMode(CENTER) def draw(): background(255) size = rect_size.value() for x, y in positions: rect(x, y, size, size) ================================================ FILE: docs/examples/pyodide/sketch_008/static/p5.js ================================================ /*! p5.js v1.0.0 February 29, 2020 */ !function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).p5=e()}}(function(){return function o(a,s,l){function u(t,e){if(!s[t]){if(!a[t]){var r="function"==typeof require&&require;if(!e&&r)return r(t,!0);if(h)return h(t,!0);var i=new Error("Cannot find module '"+t+"'");throw i.code="MODULE_NOT_FOUND",i}var n=s[t]={exports:{}};a[t][0].call(n.exports,function(e){return u(a[t][1][e]||e)},n,n.exports,o,a,s,l)}return s[t].exports}for(var h="function"==typeof require&&require,e=0;e>16&255,a[s++]=t>>8&255,a[s++]=255&t;2===o&&(t=u[e.charCodeAt(r)]<<2|u[e.charCodeAt(r+1)]>>4,a[s++]=255&t);1===o&&(t=u[e.charCodeAt(r)]<<10|u[e.charCodeAt(r+1)]<<4|u[e.charCodeAt(r+2)]>>2,a[s++]=t>>8&255,a[s++]=255&t);return a},r.fromByteArray=function(e){for(var t,r=e.length,i=r%3,n=[],o=0,a=r-i;o>2]+s[t<<4&63]+"==")):2==i&&(t=(e[r-2]<<8)+e[r-1],n.push(s[t>>10]+s[t>>4&63]+s[t<<2&63]+"="));return n.join("")};for(var s=[],u=[],h="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=0,o=i.length;n>18&63]+s[n>>12&63]+s[n>>6&63]+s[63&n]);return o.join("")}u["-".charCodeAt(0)]=62,u["_".charCodeAt(0)]=63},{}],20:[function(e,t,r){},{}],21:[function(N,e,F){(function(c){"use strict";var i=N("base64-js"),o=N("ieee754"),e="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;F.Buffer=c,F.SlowBuffer=function(e){+e!=e&&(e=0);return c.alloc(+e)},F.INSPECT_MAX_BYTES=50;var r=2147483647;function a(e){if(r>>1;case"base64":return O(e).length;default:if(n)return i?-1:R(e).length;t=(""+t).toLowerCase(),n=!0}}function d(e,t,r){var i=e[t];e[t]=e[r],e[r]=i}function p(e,t,r,i,n){if(0===e.length)return-1;if("string"==typeof r?(i=r,r=0):2147483647=e.length){if(n)return-1;r=e.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof t&&(t=c.from(t,i)),c.isBuffer(t))return 0===t.length?-1:m(e,t,r,i,n);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):m(e,[t],r,i,n);throw new TypeError("val must be string, number or Buffer")}function m(e,t,r,i,n){var o,a=1,s=e.length,l=t.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(e.length<2||t.length<2)return-1;s/=a=2,l/=2,r/=2}function u(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(n){var h=-1;for(o=r;o>8,n=r%256,o.push(n),o.push(i);return o}(t,e.length-r),e,r,i)}function b(e,t,r){return 0===t&&r===e.length?i.fromByteArray(e):i.fromByteArray(e.slice(t,r))}function _(e,t,r){r=Math.min(e.length,r);for(var i=[],n=t;n>>10&1023|55296),h=56320|1023&h),i.push(h),n+=c}return function(e){var t=e.length;if(t<=x)return String.fromCharCode.apply(String,e);var r="",i=0;for(;ithis.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e=e||"utf8";;)switch(e){case"hex":return M(this,t,r);case"utf8":case"utf-8":return _(this,t,r);case"ascii":return w(this,t,r);case"latin1":case"binary":return S(this,t,r);case"base64":return b(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,t,r);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}.apply(this,arguments)},c.prototype.equals=function(e){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===c.compare(this,e)},c.prototype.inspect=function(){var e="",t=F.INSPECT_MAX_BYTES;return e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(e+=" ... "),""},e&&(c.prototype[e]=c.prototype.inspect),c.prototype.compare=function(e,t,r,i,n){if(A(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),t<0||r>e.length||i<0||n>this.length)throw new RangeError("out of range index");if(n<=i&&r<=t)return 0;if(n<=i)return-1;if(r<=t)return 1;if(this===e)return 0;for(var o=(n>>>=0)-(i>>>=0),a=(r>>>=0)-(t>>>=0),s=Math.min(o,a),l=this.slice(i,n),u=e.slice(t,r),h=0;h>>=0,isFinite(r)?(r>>>=0,void 0===i&&(i="utf8")):(i=r,r=void 0)}var n=this.length-t;if((void 0===r||nthis.length)throw new RangeError("Attempt to write outside buffer bounds");i=i||"utf8";for(var o,a,s,l,u,h,c=!1;;)switch(i){case"hex":return g(this,e,t,r);case"utf8":case"utf-8":return u=t,h=r,D(R(e,(l=this).length-u),l,u,h);case"ascii":return v(this,e,t,r);case"latin1":case"binary":return v(this,e,t,r);case"base64":return o=this,a=t,s=r,D(O(e),o,a,s);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return y(this,e,t,r);default:if(c)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),c=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var x=4096;function w(e,t,r){var i="";r=Math.min(e.length,r);for(var n=t;ne.length)throw new RangeError("Index out of range")}function P(e,t,r,i){if(r+i>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function L(e,t,r,i,n){return t=+t,r>>>=0,n||P(e,0,r,4),o.write(e,t,r,i,23,4),r+4}function k(e,t,r,i,n){return t=+t,r>>>=0,n||P(e,0,r,8),o.write(e,t,r,i,52,8),r+8}c.prototype.slice=function(e,t){var r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):r>>=0,t>>>=0,r||T(e,t,this.length);for(var i=this[e],n=1,o=0;++o>>=0,t>>>=0,r||T(e,t,this.length);for(var i=this[e+--t],n=1;0>>=0,t||T(e,1,this.length),this[e]},c.prototype.readUInt16LE=function(e,t){return e>>>=0,t||T(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUInt16BE=function(e,t){return e>>>=0,t||T(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUInt32LE=function(e,t){return e>>>=0,t||T(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUInt32BE=function(e,t){return e>>>=0,t||T(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||T(e,t,this.length);for(var i=this[e],n=1,o=0;++o>>=0,t>>>=0,r||T(e,t,this.length);for(var i=t,n=1,o=this[e+--i];0>>=0,t||T(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){e>>>=0,t||T(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(e,t){e>>>=0,t||T(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(e,t){return e>>>=0,t||T(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return e>>>=0,t||T(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readFloatLE=function(e,t){return e>>>=0,t||T(e,4,this.length),o.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return e>>>=0,t||T(e,4,this.length),o.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return e>>>=0,t||T(e,8,this.length),o.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return e>>>=0,t||T(e,8,this.length),o.read(this,e,!1,52,8)},c.prototype.writeUIntLE=function(e,t,r,i){e=+e,t>>>=0,r>>>=0,i||C(this,e,t,r,Math.pow(2,8*r)-1,0);var n=1,o=0;for(this[t]=255&e;++o>>=0,r>>>=0,i||C(this,e,t,r,Math.pow(2,8*r)-1,0);var n=r-1,o=1;for(this[t+n]=255&e;0<=--n&&(o*=256);)this[t+n]=e/o&255;return t+r},c.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,1,255,0),this[t]=255&e,t+1},c.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},c.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeIntLE=function(e,t,r,i){if(e=+e,t>>>=0,!i){var n=Math.pow(2,8*r-1);C(this,e,t,r,n-1,-n)}var o=0,a=1,s=0;for(this[t]=255&e;++o>0)-s&255;return t+r},c.prototype.writeIntBE=function(e,t,r,i){if(e=+e,t>>>=0,!i){var n=Math.pow(2,8*r-1);C(this,e,t,r,n-1,-n)}var o=r-1,a=1,s=0;for(this[t+o]=255&e;0<=--o&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+r},c.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},c.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeFloatLE=function(e,t,r){return L(this,e,t,!0,r)},c.prototype.writeFloatBE=function(e,t,r){return L(this,e,t,!1,r)},c.prototype.writeDoubleLE=function(e,t,r){return k(this,e,t,!0,r)},c.prototype.writeDoubleBE=function(e,t,r){return k(this,e,t,!1,r)},c.prototype.copy=function(e,t,r,i){if(!c.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r=r||0,i||0===i||(i=this.length),t>=e.length&&(t=e.length),t=t||0,0=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t>>=0,r=void 0===r?this.length:r>>>0,"number"==typeof(e=e||0))for(o=t;o>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function O(e){return i.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(t,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function D(e,t,r,i){for(var n=0;n=t.length||n>=e.length);++n)t[n+r]=e[n];return n}function A(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function I(e){return e!=e}var U=function(){for(var e="0123456789abcdef",t=new Array(256),r=0;r<16;++r)for(var i=16*r,n=0;n<16;++n)t[i+n]=e[r]+e[n];return t}()}).call(this,N("buffer").Buffer)},{"base64-js":19,buffer:21,ieee754:30}],22:[function(e,t,r){"use strict";t.exports=e("./").polyfill()},{"./":23}],23:[function(z,r,i){(function(j,V){var e,t;e=this,t=function(){"use strict";function l(e){return"function"==typeof e}var r=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},i=0,t=void 0,n=void 0,a=function(e,t){f[i]=e,f[i+1]=t,2===(i+=2)&&(n?n(d):y())};var e="undefined"!=typeof window?window:void 0,o=e||{},s=o.MutationObserver||o.WebKitMutationObserver,u="undefined"==typeof self&&void 0!==j&&"[object process]"==={}.toString.call(j),h="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function c(){var e=setTimeout;return function(){return e(d,1)}}var f=new Array(1e3);function d(){for(var e=0;e":">",'"':""","'":"'","/":"/"};function S(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,function(e){return w[e]}):e}var M=function(){function i(e){var t,r=1=this.maxReplaces)break}for(a=0;r=this.regexp.exec(e);){if(void 0===(i=h(r[1].trim())))if("function"==typeof c){var d=c(e,r,t);i="string"==typeof d?d:""}else this.logger.warn("missed to pass in variable ".concat(r[1]," for interpolating ").concat(e)),i="";else"string"==typeof i||this.useRawValueToEscape||(i=v(i));if(i=this.escapeValue?u(this.escape(i)):u(i),e=e.replace(r[0],i),this.regexp.lastIndex=0,++a>=this.maxReplaces)break}return e}},{key:"nest",value:function(e,t,r){var i,n,o=D({},2>1,h=-7,c=r?n-1:0,f=r?-1:1,d=e[t+c];for(c+=f,o=d&(1<<-h)-1,d>>=-h,h+=s;0>=-h,h+=i;0>1,f=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,d=i?0:o-1,p=i?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=h):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),2<=(t+=1<=a+c?f/l:f*Math.pow(2,1-c))*l&&(a++,l/=2),h<=a+c?(s=0,a=h):1<=a+c?(s=(t*l-1)*Math.pow(2,n),a+=c):(s=t*Math.pow(2,c-1)*Math.pow(2,n),a=0));8<=n;e[r+d]=255&s,d+=p,s/=256,n-=8);for(a=a<Math.abs(e[0])&&(t=1),Math.abs(e[2])>Math.abs(e[t])&&(t=2),t}var C=4e150;function P(e,t){e.f+=t.f,e.b.f+=t.b.f}function u(e,t,r){return e=e.a,t=t.a,r=r.a,t.b.a===e?r.b.a===e?v(t.a,r.a)?b(r.b.a,t.a,r.a)<=0:0<=b(t.b.a,r.a,t.a):b(r.b.a,e,r.a)<=0:r.b.a===e?0<=b(t.b.a,e,t.a):(t=y(t.b.a,e,t.a),(e=y(r.b.a,e,r.a))<=t)}function L(e){e.a.i=null;var t=e.e;t.a.c=t.c,t.c.a=t.a,e.e=null}function h(e,t){c(e.a),e.c=!1,(e.a=t).i=e}function k(e){for(var t=e.a.a;(e=fe(e)).a.a===t;);return e.c&&(h(e,t=f(ce(e).a.b,e.a.e)),e=fe(e)),e}function R(e,t,r){var i=new he;return i.a=r,i.e=W(e.f,t.e,i),r.i=i}function O(e,t){switch(e.s){case 100130:return 0!=(1&t);case 100131:return 0!==t;case 100132:return 0>1]],s[a[u]])?le(r,u):ue(r,u)),s[o]=null,l[o]=r.b,r.b=o}else for(r.c[-(o+1)]=null;0Math.max(a.a,l.a))return!1;if(v(o,a)){if(0i.f&&(i.f*=2,i.c=oe(i.c,i.f+1)),0===i.b?r=n:(r=i.b,i.b=i.c[i.b]),i.e[r]=t,i.c[r]=n,i.d[n]=r,i.h&&ue(i,n),r}return i=e.a++,e.c[i]=t,-(i+1)}function ie(e){if(0===e.a)return se(e.b);var t=e.c[e.d[e.a-1]];if(0!==e.b.a&&v(ae(e.b),t))return se(e.b);for(;--e.a,0e.a||v(i[a],i[l])){n[r[o]=a]=o;break}n[r[o]=l]=o,o=s}}function ue(e,t){for(var r=e.d,i=e.e,n=e.c,o=t,a=r[o];;){var s=o>>1,l=r[s];if(0==s||v(i[l],i[a])){n[r[o]=a]=o;break}n[r[o]=l]=o,o=s}}function he(){this.e=this.a=null,this.f=0,this.c=this.b=this.h=this.d=!1}function ce(e){return e.e.c.b}function fe(e){return e.e.a.b}(i=q.prototype).x=function(){Y(this,0)},i.B=function(e,t){switch(e){case 100142:return;case 100140:switch(t){case 100130:case 100131:case 100132:case 100133:case 100134:return void(this.s=t)}break;case 100141:return void(this.m=!!t);default:return void Z(this,100900)}Z(this,100901)},i.y=function(e){switch(e){case 100142:return 0;case 100140:return this.s;case 100141:return this.m;default:Z(this,100900)}return!1},i.A=function(e,t,r){this.j[0]=e,this.j[1]=t,this.j[2]=r},i.z=function(e,t){var r=t||null;switch(e){case 100100:case 100106:this.h=r;break;case 100104:case 100110:this.l=r;break;case 100101:case 100107:this.k=r;break;case 100102:case 100108:this.i=r;break;case 100103:case 100109:this.p=r;break;case 100105:case 100111:this.o=r;break;case 100112:this.r=r;break;default:Z(this,100900)}},i.C=function(e,t){var r=!1,i=[0,0,0];Y(this,2);for(var n=0;n<3;++n){var o=e[n];o<-1e150&&(o=-1e150,r=!0),1e150n[u]&&(n[u]=h,a[u]=l)}if(l=0,n[1]-o[1]>n[0]-o[0]&&(l=1),n[2]-o[2]>n[l]-o[l]&&(l=2),o[l]>=n[l])i[0]=0,i[1]=0,i[2]=1;else{for(n=0,o=s[l],a=a[l],s=[0,0,0],o=[o.g[0]-a.g[0],o.g[1]-a.g[1],o.g[2]-a.g[2]],u=[0,0,0],l=r.e;l!==r;l=l.e)u[0]=l.g[0]-a.g[0],u[1]=l.g[1]-a.g[1],u[2]=l.g[2]-a.g[2],s[0]=o[1]*u[2]-o[2]*u[1],s[1]=o[2]*u[0]-o[0]*u[2],s[2]=o[0]*u[1]-o[1]*u[0],n<(h=s[0]*s[0]+s[1]*s[1]+s[2]*s[2])&&(n=h,i[0]=s[0],i[1]=s[1],i[2]=s[2]);n<=0&&(i[0]=i[1]=i[2]=0,i[T(o)]=1)}r=!0}for(s=T(i),l=this.b.c,n=(s+1)%3,a=(s+2)%3,s=0>=l,h-=l,g!=o){if(g==a)break;for(var v=g>8,++y;var _=b;if(i>=8;null!==m&&s<4096&&(p[s++]=m<<8|_,u+1<=s&&l<12&&(++l,u=u<<1|1)),m=g}else s=1+a,u=(1<<(l=n+1))-1,m=null}return f!==i&&console.log("Warning, gif stream shorter than expected."),r}try{r.GifWriter=function(v,e,t,r){var y=0,i=void 0===(r=void 0===r?{}:r).loop?null:r.loop,b=void 0===r.palette?null:r.palette;if(e<=0||t<=0||65535>=1;)++n;if(a=1<>8&255,v[y++]=255&t,v[y++]=t>>8&255,v[y++]=(null!==b?128:0)|n,v[y++]=o,v[y++]=0,null!==b)for(var s=0,l=b.length;s>16&255,v[y++]=u>>8&255,v[y++]=255&u}if(null!==i){if(i<0||65535>8&255,v[y++]=0}var x=!1;this.addFrame=function(e,t,r,i,n,o){if(!0===x&&(--y,x=!1),o=void 0===o?{}:o,e<0||t<0||65535>=1;)++u;l=1<>8&255,v[y++]=d,v[y++]=0),v[y++]=44,v[y++]=255&e,v[y++]=e>>8&255,v[y++]=255&t,v[y++]=t>>8&255,v[y++]=255&r,v[y++]=r>>8&255,v[y++]=255&i,v[y++]=i>>8&255,v[y++]=!0===a?128|u-1:0,!0===a)for(var p=0,m=s.length;p>16&255,v[y++]=g>>8&255,v[y++]=255&g}return y=function(t,r,e,i){t[r++]=e;var n=r++,o=1<>=8,h-=8,r===n+256&&(t[n]=255,n=r++)}function d(e){c|=e<>=8,h-=8,r===n+256&&(t[n]=255,n=r++);4096===l?(d(o),l=1+s,u=e+1,m={}):(1<>7,n=1<<1+(7&r);x[e++],x[e++];var o=null,a=null;i&&(o=e,e+=3*(a=n));var s=!0,l=[],u=0,h=null,c=0,f=null;for(this.width=w,this.height=t;s&&e>2&7,e++;break;case 254:for(;;){if(!(0<=(C=x[e++])))throw Error("Invalid block size");if(0===C)break;e+=C}break;default:throw new Error("Unknown graphic control label: 0x"+x[e-1].toString(16))}break;case 44:var p=x[e++]|x[e++]<<8,m=x[e++]|x[e++]<<8,g=x[e++]|x[e++]<<8,v=x[e++]|x[e++]<<8,y=x[e++],b=y>>6&1,_=1<<1+(7&y),S=o,M=a,E=!1;if(y>>7){E=!0;S=e,e+=3*(M=_)}var T=e;for(e++;;){var C;if(!(0<=(C=x[e++])))throw Error("Invalid block size");if(0===C)break;e+=C}l.push({x:p,y:m,width:g,height:v,has_local_palette:E,palette_offset:S,palette_size:M,data_offset:T,data_length:e-T,transparent_index:h,interlaced:!!b,delay:u,disposal:c});break;case 59:s=!1;break;default:throw new Error("Unknown gif block: 0x"+x[e-1].toString(16))}this.numFrames=function(){return l.length},this.loopCount=function(){return f},this.frameInfo=function(e){if(e<0||e>=l.length)throw new Error("Frame index out of range.");return l[e]},this.decodeAndBlitFrameBGRA=function(e,t){var r=this.frameInfo(e),i=r.width*r.height,n=new Uint8Array(i);P(x,r.data_offset,n,i);var o=r.palette_offset,a=r.transparent_index;null===a&&(a=256);var s=r.width,l=w-s,u=s,h=4*(r.y*w+r.x),c=4*((r.y+r.height)*w+r.x),f=h,d=4*l;!0===r.interlaced&&(d+=4*w*7);for(var p=8,m=0,g=n.length;m>=1)),v===a)f+=4;else{var y=x[o+3*v],b=x[o+3*v+1],_=x[o+3*v+2];t[f++]=_,t[f++]=b,t[f++]=y,t[f++]=255}--u}},this.decodeAndBlitFrameRGBA=function(e,t){var r=this.frameInfo(e),i=r.width*r.height,n=new Uint8Array(i);P(x,r.data_offset,n,i);var o=r.palette_offset,a=r.transparent_index;null===a&&(a=256);var s=r.width,l=w-s,u=s,h=4*(r.y*w+r.x),c=4*((r.y+r.height)*w+r.x),f=h,d=4*l;!0===r.interlaced&&(d+=4*w*7);for(var p=8,m=0,g=n.length;m>=1)),v===a)f+=4;else{var y=x[o+3*v],b=x[o+3*v+1],_=x[o+3*v+2];t[f++]=y,t[f++]=b,t[f++]=_,t[f++]=255}--u}}}}catch(e){}},{}],33:[function(jr,t,r){(function(Gr){var e;e=this,function(E){"use strict";function e(e){if(null==this)throw TypeError();var t=String(this),r=t.length,i=e?Number(e):0;if(i!=i&&(i=0),!(i<0||r<=i)){var n,o=t.charCodeAt(i);return 55296<=o&&o<=56319&&i+1>>=1,t}function _(e,t,r){if(!t)return r;for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<>>16-t;return e.tag>>>=t,e.bitcount-=t,i+r}function x(e,t){for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<>>=1,++n,r+=t.table[n],0<=(i-=t.table[n]););return e.tag=o,e.bitcount-=n,t.trans[r+i]}function w(e,t,r){var i,n,o,a,s,l;for(i=_(e,5,257),n=_(e,5,1),o=_(e,4,4),a=0;a<19;++a)g[a]=0;for(a=0;athis.x2&&(this.x2=e)),"number"==typeof t&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=t,this.y2=t),tthis.y2&&(this.y2=t))},C.prototype.addX=function(e){this.addPoint(e,null)},C.prototype.addY=function(e){this.addPoint(null,e)},C.prototype.addBezier=function(e,t,r,i,n,o,a,s){var l=this,u=[e,t],h=[r,i],c=[n,o],f=[a,s];this.addPoint(e,t),this.addPoint(a,s);for(var d=0;d<=1;d++){var p=6*u[d]-12*h[d]+6*c[d],m=-3*u[d]+9*h[d]-9*c[d]+3*f[d],g=3*h[d]-3*u[d];if(0!=m){var v=Math.pow(p,2)-4*g*m;if(!(v<0)){var y=(-p+Math.sqrt(v))/(2*m);0>8&255,255&e]},A.USHORT=U(2),D.SHORT=function(e){return 32768<=e&&(e=-(65536-e)),[e>>8&255,255&e]},A.SHORT=U(2),D.UINT24=function(e){return[e>>16&255,e>>8&255,255&e]},A.UINT24=U(3),D.ULONG=function(e){return[e>>24&255,e>>16&255,e>>8&255,255&e]},A.ULONG=U(4),D.LONG=function(e){return R<=e&&(e=-(2*R-e)),[e>>24&255,e>>16&255,e>>8&255,255&e]},A.LONG=U(4),D.FIXED=D.ULONG,A.FIXED=A.ULONG,D.FWORD=D.SHORT,A.FWORD=A.SHORT,D.UFWORD=D.USHORT,A.UFWORD=A.USHORT,D.LONGDATETIME=function(e){return[0,0,0,0,e>>24&255,e>>16&255,e>>8&255,255&e]},A.LONGDATETIME=U(8),D.TAG=function(e){return k.argument(4===e.length,"Tag should be exactly 4 ASCII characters."),[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]},A.TAG=U(4),D.Card8=D.BYTE,A.Card8=A.BYTE,D.Card16=D.USHORT,A.Card16=A.USHORT,D.OffSize=D.BYTE,A.OffSize=A.BYTE,D.SID=D.USHORT,A.SID=A.USHORT,D.NUMBER=function(e){return-107<=e&&e<=107?[e+139]:108<=e&&e<=1131?[247+((e-=108)>>8),255&e]:-1131<=e&&e<=-108?[251+((e=-e-108)>>8),255&e]:-32768<=e&&e<=32767?D.NUMBER16(e):D.NUMBER32(e)},A.NUMBER=function(e){return D.NUMBER(e).length},D.NUMBER16=function(e){return[28,e>>8&255,255&e]},A.NUMBER16=U(3),D.NUMBER32=function(e){return[29,e>>24&255,e>>16&255,e>>8&255,255&e]},A.NUMBER32=U(5),D.REAL=function(e){var t=e.toString(),r=/\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec(t);if(r){var i=parseFloat("1e"+((r[2]?+r[2]:0)+r[1].length));t=(Math.round(e*i)/i).toString()}for(var n="",o=0,a=t.length;o>8&255,t[t.length]=255&i}return t},A.UTF16=function(e){return 2*e.length};var N={"x-mac-croatian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈ƫȅ ÀÃÕŒœĐ—“”‘’÷◊©⁄€‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ","x-mac-cyrillic":"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю","x-mac-gaelic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØḂ±≤≥ḃĊċḊḋḞḟĠġṀæøṁṖṗɼƒſṠ«»… ÀÃÕŒœ–—“”‘’ṡẛÿŸṪ€‹›Ŷŷṫ·Ỳỳ⁊ÂÊÁËÈÍÎÏÌÓÔ♣ÒÚÛÙıÝýŴŵẄẅẀẁẂẃ","x-mac-greek":"Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦€ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ­","x-mac-icelandic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüݰ¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-inuit":"ᐃᐄᐅᐆᐊᐋᐱᐲᐳᐴᐸᐹᑉᑎᑏᑐᑑᑕᑖᑦᑭᑮᑯᑰᑲᑳᒃᒋᒌᒍᒎᒐᒑ°ᒡᒥᒦ•¶ᒧ®©™ᒨᒪᒫᒻᓂᓃᓄᓅᓇᓈᓐᓯᓰᓱᓲᓴᓵᔅᓕᓖᓗᓘᓚᓛᓪᔨᔩᔪᔫᔭ… ᔮᔾᕕᕖᕗ–—“”‘’ᕘᕙᕚᕝᕆᕇᕈᕉᕋᕌᕐᕿᖀᖁᖂᖃᖄᖅᖏᖐᖑᖒᖓᖔᖕᙱᙲᙳᙴᙵᙶᖖᖠᖡᖢᖣᖤᖥᖦᕼŁł","x-mac-ce":"ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ",macintosh:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-romanian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂȘ∞±≤≥¥µ∂∑∏π∫ªºΩăș¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›Țț‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-turkish":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙˆ˜¯˘˙˚¸˝˛ˇ"};O.MACSTRING=function(e,t,r,i){var n=N[i];if(void 0!==n){for(var o="",a=0;a>8&255,l+256&255)}return o}D.MACSTRING=function(e,t){var r=function(e){if(!F)for(var t in F={},N)F[t]=new String(t);var r=F[e];if(void 0!==r){if(B){var i=B.get(r);if(void 0!==i)return i}var n=N[e];if(void 0!==n){for(var o={},a=0;a>8,t[c+1]=255&f,t=t.concat(i[h])}return t},A.TABLE=function(e){for(var t=0,r=e.fields.length,i=0;i>1,t.skip("uShort",3),e.glyphIndexMap={};for(var a=new se.Parser(r,i+n+14),s=new se.Parser(r,i+n+16+2*o),l=new se.Parser(r,i+n+16+4*o),u=new se.Parser(r,i+n+16+6*o),h=i+n+16+8*o,c=0;c>4,o=15&i;if(15==n)break;if(t+=r[n],15==o)break;t+=r[o]}return parseFloat(t)}(e);if(32<=t&&t<=246)return t-139;if(247<=t&&t<=250)return 256*(t-247)+e.parseByte()+108;if(251<=t&&t<=254)return 256*-(t-251)-e.parseByte()-108;throw new Error("Invalid b0 "+t)}function Te(e,t,r){t=void 0!==t?t:0;var i=new se.Parser(e,t),n=[],o=[];for(r=void 0!==r?r:e.length;i.relativeOffset>1,T.length=0,P=!0}return function e(t){for(var r,i,n,o,a,s,l,u,h,c,f,d,p=0;pMath.abs(d-R)?k=f+T.shift():R=d+T.shift(),E.curveTo(y,b,_,x,l,u),E.curveTo(h,c,f,d,k,R);break;default:console.log("Glyph "+v.index+": unknown operator 1200"+m),T.length=0}break;case 14:0>3;break;case 21:2>16),p+=2;break;case 29:a=T.pop()+g.gsubrsBias,(s=g.gsubrs[a])&&e(s);break;case 30:for(;0=r.begin&&e=fe.length){var a=i.parseChar();r.names.push(i.parseString(a))}break;case 2.5:r.numberOfGlyphs=i.parseUShort(),r.offset=new Array(r.numberOfGlyphs);for(var s=0;st.value.tag?1:-1}),t.fields=t.fields.concat(i),t.fields=t.fields.concat(n),t}function gt(e,t,r){for(var i=0;i 123 are reserved for internal usage");d|=1<>>1,o=e[n].tag;if(o===t)return n;o>>1,o=e[n];if(o===t)return n;o>>1,a=(r=e[o]).start;if(a===t)return r;a(r=e[i-1]).end?0:r}function xt(e,t){this.font=e,this.tableName=t}function wt(e){xt.call(this,e,"gpos")}function St(e){xt.call(this,e,"gsub")}function Mt(e,t){var r=e.length;if(r!==t.length)return!1;for(var i=0;it.points.length-1||i.matchedPoints[1]>n.points.length-1)throw Error("Matched points out of range in "+t.name);var a=t.points[i.matchedPoints[0]],s=n.points[i.matchedPoints[1]],l={xScale:i.xScale,scale01:i.scale01,scale10:i.scale10,yScale:i.yScale,dx:0,dy:0};s=kt([s],l)[0],l.dx=a.x-s.x,l.dy=a.y-s.y,o=kt(n.points,l)}t.points=t.points.concat(o)}}return Rt(t.points)}(wt.prototype=xt.prototype={searchTag:yt,binSearch:bt,getTable:function(e){var t=this.font.tables[this.tableName];return!t&&e&&(t=this.font.tables[this.tableName]=this.createDefaultTable()),t},getScriptNames:function(){var e=this.getTable();return e?e.scripts.map(function(e){return e.tag}):[]},getDefaultScriptName:function(){var e=this.getTable();if(e){for(var t=!1,r=0;r=s[u-1].tag,"Features must be added in alphabetical order."),o={tag:r,feature:{params:0,lookupListIndexes:[]}},s.push(o),a.push(u),o.feature}}},getLookupTables:function(e,t,r,i,n){var o=this.getFeatureTable(e,t,r,n),a=[];if(o){for(var s,l=o.lookupListIndexes,u=this.font.tables[this.tableName].lookups,h=0;h",s),t.stack.push(Math.round(64*s))}function vr(e,t){var r=t.stack,i=r.pop(),n=t.fv,o=t.pv,a=t.ppem,s=t.deltaBase+16*(e-1),l=t.deltaShift,u=t.z0;E.DEBUG&&console.log(t.step,"DELTAP["+e+"]",i,r);for(var h=0;h>4)===a){var d=(15&f)-8;0<=d&&d++,E.DEBUG&&console.log(t.step,"DELTAPFIX",c,"by",d*l);var p=u[c];n.setRelative(p,p,d*l,o)}}}function yr(e,t){var r=t.stack,i=r.pop();E.DEBUG&&console.log(t.step,"ROUND[]"),r.push(64*t.round(i/64))}function br(e,t){var r=t.stack,i=r.pop(),n=t.ppem,o=t.deltaBase+16*(e-1),a=t.deltaShift;E.DEBUG&&console.log(t.step,"DELTAC["+e+"]",i,r);for(var s=0;s>4)===n){var h=(15&u)-8;0<=h&&h++;var c=h*a;E.DEBUG&&console.log(t.step,"DELTACFIX",l,"by",c),t.cvt[l]+=c}}}function _r(e,t){var r,i,n=t.stack,o=n.pop(),a=n.pop(),s=t.z2[o],l=t.z1[a];E.DEBUG&&console.log(t.step,"SDPVTL["+e+"]",o,a),i=e?(r=s.y-l.y,l.x-s.x):(r=l.x-s.x,l.y-s.y),t.dpv=Zt(r,i)}function xr(e,t){var r=t.stack,i=t.prog,n=t.ip;E.DEBUG&&console.log(t.step,"PUSHB["+e+"]");for(var o=0;o":"_")+(i?"R":"_")+(0===n?"Gr":1===n?"Bl":2===n?"Wh":"")+"]",e?c+"("+o.cvt[c]+","+u+")":"",f,"(d =",a,"->",l*s,")"),o.rp1=o.rp0,o.rp2=f,t&&(o.rp0=f)}Ft.prototype.exec=function(e,t){if("number"!=typeof t)throw new Error("Point size is not a number!");if(!(2",i),s.interpolate(c,o,a,l),s.touch(c)}e.loop=1},dr.bind(void 0,0),dr.bind(void 0,1),function(e){for(var t=e.stack,r=e.rp0,i=e.z0[r],n=e.loop,o=e.fv,a=e.pv,s=e.z1;n--;){var l=t.pop(),u=s[l];E.DEBUG&&console.log(e.step,(1=a.width||t>=a.height?[0,0,0,0]:this._getPixel(e,t);var s=new l.default.Image(r,i);return s.canvas.getContext("2d").drawImage(a,e,t,r*o,i*o,0,0,r,i),s},l.default.Renderer.prototype.textLeading=function(e){return"number"==typeof e?(this._setProperty("_textLeading",e),this._pInst):this._textLeading},l.default.Renderer.prototype.textSize=function(e){return"number"==typeof e?(this._setProperty("_textSize",e),this._setProperty("_textLeading",e*y._DEFAULT_LEADMULT),this._applyTextProperties()):this._textSize},l.default.Renderer.prototype.textStyle=function(e){return e?(e!==y.NORMAL&&e!==y.ITALIC&&e!==y.BOLD&&e!==y.BOLDITALIC||this._setProperty("_textStyle",e),this._applyTextProperties()):this._textStyle},l.default.Renderer.prototype.textAscent=function(){return null===this._textAscent&&this._updateTextMetrics(),this._textAscent},l.default.Renderer.prototype.textDescent=function(){return null===this._textDescent&&this._updateTextMetrics(),this._textDescent},l.default.Renderer.prototype.textAlign=function(e,t){return void 0!==e?(this._setProperty("_textAlign",e),void 0!==t&&this._setProperty("_textBaseline",t),this._applyTextProperties()):{horizontal:this._textAlign,vertical:this._textBaseline}},l.default.Renderer.prototype.text=function(e,t,r,i,n){var o,a,s,l,u,h,c,f,d=this._pInst,p=Number.MAX_VALUE;if((this._doFill||this._doStroke)&&void 0!==e){if("string"!=typeof e&&(e=e.toString()),o=(e=e.replace(/(\t)/g," ")).split("\n"),void 0!==i){for(s=f=0;ss.HALF_PI&&e<=3*s.HALF_PI?Math.atan(r/i*Math.tan(e))+s.PI:Math.atan(r/i*Math.tan(e))+s.TWO_PI,t=t<=s.HALF_PI?Math.atan(r/i*Math.tan(t)):t>s.HALF_PI&&t<=3*s.HALF_PI?Math.atan(r/i*Math.tan(t))+s.PI:Math.atan(r/i*Math.tan(t))+s.TWO_PI),tv||Math.abs(this.accelerationY-this.pAccelerationY)>v||Math.abs(this.accelerationZ-this.pAccelerationZ)>v)&&e();var t=this.deviceTurned||window.deviceTurned;if("function"==typeof t){var r=this.rotationX+180,i=this.pRotationX+180,n=c+180;0>>24],i+=x[(16711680&C)>>16],n+=x[(65280&C)>>8],o+=x[255&C],r+=k[_],s++}w[l=T+y]=a/r,S[l]=i/r,M[l]=n/r,E[l]=o/r}T+=d}for(h=(u=-P)*d,b=T=0;b>>16,e[r+1]=(65280&t[i])>>>8,e[r+2]=255&t[i],e[r+3]=(4278190080&t[i])>>>24},O._toImageData=function(e){return e instanceof ImageData?e:e.getContext("2d").getImageData(0,0,e.width,e.height)},O._createImageData=function(e,t){return O._tmpCanvas=document.createElement("canvas"),O._tmpCtx=O._tmpCanvas.getContext("2d"),this._tmpCtx.createImageData(e,t)},O.apply=function(e,t,r){var i=e.getContext("2d"),n=i.getImageData(0,0,e.width,e.height),o=t(n,r);o instanceof ImageData?i.putImageData(o,0,0,0,0,e.width,e.height):i.putImageData(n,0,0,0,0,e.width,e.height)},O.threshold=function(e,t){var r=O._toPixels(e);void 0===t&&(t=.5);for(var i=Math.floor(255*t),n=0;n>8)/i,r[n+1]=255*(a*t>>8)/i,r[n+2]=255*(s*t>>8)/i}},O.dilate=function(e){for(var t,r,i,n,o,a,s,l,u,h,c,f,d,p,m,g,v,y=O._toPixels(e),b=0,_=y.length?y.length/4:0,x=new Int32Array(_);b<_;)for(r=(t=b)+e.width;b>16&255)+151*(i>>8&255)+28*(255&i))<(m=77*(c>>16&255)+151*(c>>8&255)+28*(255&c))&&(n=c,o=m),o<(p=77*((h=O._getARGB(y,a))>>16&255)+151*(h>>8&255)+28*(255&h))&&(n=h,o=p),o<(g=77*(f>>16&255)+151*(f>>8&255)+28*(255&f))&&(n=f,o=g),o<(v=77*(d>>16&255)+151*(d>>8&255)+28*(255&d))&&(n=d,o=v),x[b++]=n;O._setPixels(y,x)},O.erode=function(e){for(var t,r,i,n,o,a,s,l,u,h,c,f,d,p,m,g,v,y=O._toPixels(e),b=0,_=y.length?y.length/4:0,x=new Int32Array(_);b<_;)for(r=(t=b)+e.width;b>16&255)+151*(c>>8&255)+28*(255&c))<(o=77*(i>>16&255)+151*(i>>8&255)+28*(255&i))&&(n=c,o=m),(p=77*((h=O._getARGB(y,a))>>16&255)+151*(h>>8&255)+28*(255&h))>16&255)+151*(f>>8&255)+28*(255&f))>16&255)+151*(d>>8&255)+28*(255&d))=r){var i=Math.floor(t.timeDisplayed/r);if(t.timeDisplayed=0,t.displayIndex+=i,t.loopCount=Math.floor(t.displayIndex/t.numFrames),null!==t.loopLimit&&t.loopCount>=t.loopLimit)t.playing=!1;else{var n=t.displayIndex%t.numFrames;this.drawingContext.putImageData(t.frames[n].image,0,0),t.displayIndex=n,this.setModified(!0)}}}},n.default.Image.prototype._setProperty=function(e,t){this[e]=t,this.setModified(!0)},n.default.Image.prototype.loadPixels=function(){n.default.Renderer2D.prototype.loadPixels.call(this),this.setModified(!0)},n.default.Image.prototype.updatePixels=function(e,t,r,i){n.default.Renderer2D.prototype.updatePixels.call(this,e,t,r,i),this.setModified(!0)},n.default.Image.prototype.get=function(e,t,r,i){return n.default._validateParameters("p5.Image.get",arguments),n.default.Renderer2D.prototype.get.apply(this,arguments)},n.default.Image.prototype._getPixel=n.default.Renderer2D.prototype._getPixel,n.default.Image.prototype.set=function(e,t,r){n.default.Renderer2D.prototype.set.call(this,e,t,r),this.setModified(!0)},n.default.Image.prototype.resize=function(e,t){0===e&&0===t?(e=this.canvas.width,t=this.canvas.height):0===e?e=this.canvas.width*t/this.canvas.height:0===t&&(t=this.canvas.height*e/this.canvas.width),e=Math.floor(e),t=Math.floor(t);var r=document.createElement("canvas");if(r.width=e,r.height=t,this.gifProperties)for(var i=this.gifProperties,n=function(e,t){for(var r=0,i=0;i/g,">").replace(/"/g,""").replace(/'/g,"'")}function l(e,t){t&&!0!==t&&"true"!==t||(t="");var r="";return(e=e||"untitled")&&e.includes(".")&&(r=e.split(".").pop()),t&&r!==t&&(r=t,e="".concat(e,".").concat(r)),[e,r]}e("../core/error_helpers"),v.default.prototype.loadJSON=function(){for(var e=arguments.length,t=new Array(e),r=0;r"),n.print("");if(n.print(' '),n.print(""),n.print(""),n.print(" "),"0"!==o[0]){n.print(" ");for(var h=0;h".concat(c)),n.print(" ")}n.print(" ")}for(var f=0;f");for(var d=0;d".concat(p)),n.print(" ")}n.print(" ")}n.print("
"),n.print(""),n.print("")}n.close(),n.clear()},v.default.prototype.writeFile=function(e,t,r){var i="application/octet-stream";v.default.prototype._isSafari()&&(i="text/plain");var n=new Blob(e,{type:i});v.default.prototype.downloadFile(n,t,r)},v.default.prototype.downloadFile=function(e,t,r){var i=l(t,r),n=i[0];if(e instanceof Blob)s.default.saveAs(e,n);else{var o=document.createElement("a");if(o.href=e,o.download=n,o.onclick=function(e){var t;t=e,document.body.removeChild(t.target),e.stopPropagation()},o.style.display="none",document.body.appendChild(o),v.default.prototype._isSafari()){var a="Hello, Safari user! To download this file...\n";a+="1. Go to File --\x3e Save As.\n",a+='2. Choose "Page Source" as the Format.\n',a+='3. Name it with this extension: ."'.concat(i[1],'"'),alert(a)}o.click()}},v.default.prototype._checkFileExtension=l,v.default.prototype._isSafari=function(){return 0>>0},getSeed:function(){return t},rand:function(){return(r=(1664525*r+1013904223)%i)/i}});n.setSeed(e),_=new Array(4096);for(var o=0;o<4096;o++)_[o]=n.rand()};var o=n.default;r.default=o},{"../core/main":49}],82:[function(e,t,r){"use strict";function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i,l=(i=e("../core/main"))&&i.__esModule?i:{default:i},o=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==a(e)&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var o=i?Object.getOwnPropertyDescriptor(e,n):null;o&&(o.get||o.set)?Object.defineProperty(r,n,o):r[n]=e[n]}r.default=e,t&&t.set(e,r);return r}(e("../core/constants"));function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}l.default.Vector=function(e,t,r){var i,n,o;o=e instanceof l.default?(this.p5=e,i=t[0]||0,n=t[1]||0,t[2]||0):(i=e||0,n=t||0,r||0),this.x=i,this.y=n,this.z=o},l.default.Vector.prototype.toString=function(){return"p5.Vector Object : [".concat(this.x,", ").concat(this.y,", ").concat(this.z,"]")},l.default.Vector.prototype.set=function(e,t,r){return e instanceof l.default.Vector?(this.x=e.x||0,this.y=e.y||0,this.z=e.z||0):e instanceof Array?(this.x=e[0]||0,this.y=e[1]||0,this.z=e[2]||0):(this.x=e||0,this.y=t||0,this.z=r||0),this},l.default.Vector.prototype.copy=function(){return this.p5?new l.default.Vector(this.p5,[this.x,this.y,this.z]):new l.default.Vector(this.x,this.y,this.z)},l.default.Vector.prototype.add=function(e,t,r){return e instanceof l.default.Vector?(this.x+=e.x||0,this.y+=e.y||0,this.z+=e.z||0):e instanceof Array?(this.x+=e[0]||0,this.y+=e[1]||0,this.z+=e[2]||0):(this.x+=e||0,this.y+=t||0,this.z+=r||0),this};function u(e,t){return 0!==e&&(this.x=this.x%e),0!==t&&(this.y=this.y%t),this}function h(e,t,r){return 0!==e&&(this.x=this.x%e),0!==t&&(this.y=this.y%t),0!==r&&(this.z=this.z%r),this}l.default.Vector.prototype.rem=function(e,t,r){if(e instanceof l.default.Vector){if(Number.isFinite(e.x)&&Number.isFinite(e.y)&&Number.isFinite(e.z)){var i=parseFloat(e.x),n=parseFloat(e.y),o=parseFloat(e.z);h.call(this,i,n,o)}}else if(e instanceof Array)e.every(function(e){return Number.isFinite(e)})&&(2===e.length&&u.call(this,e[0],e[1]),3===e.length&&h.call(this,e[0],e[1],e[2]));else if(1===arguments.length){if(Number.isFinite(e)&&0!==e)return this.x=this.x%e,this.y=this.y%e,this.z=this.z%e,this}else if(2===arguments.length){var a=Array.prototype.slice.call(arguments);a.every(function(e){return Number.isFinite(e)})&&2===a.length&&u.call(this,a[0],a[1])}else if(3===arguments.length){var s=Array.prototype.slice.call(arguments);s.every(function(e){return Number.isFinite(e)})&&3===s.length&&h.call(this,s[0],s[1],s[2])}},l.default.Vector.prototype.sub=function(e,t,r){return e instanceof l.default.Vector?(this.x-=e.x||0,this.y-=e.y||0,this.z-=e.z||0):e instanceof Array?(this.x-=e[0]||0,this.y-=e[1]||0,this.z-=e[2]||0):(this.x-=e||0,this.y-=t||0,this.z-=r||0),this},l.default.Vector.prototype.mult=function(e){return"number"==typeof e&&isFinite(e)?(this.x*=e,this.y*=e,this.z*=e):console.warn("p5.Vector.prototype.mult:","n is undefined or not a finite number"),this},l.default.Vector.prototype.div=function(e){return"number"==typeof e&&isFinite(e)?0===e?console.warn("p5.Vector.prototype.div:","divide by 0"):(this.x/=e,this.y/=e,this.z/=e):console.warn("p5.Vector.prototype.div:","n is undefined or not a finite number"),this},l.default.Vector.prototype.mag=function(){return Math.sqrt(this.magSq())},l.default.Vector.prototype.magSq=function(){var e=this.x,t=this.y,r=this.z;return e*e+t*t+r*r},l.default.Vector.prototype.dot=function(e,t,r){return e instanceof l.default.Vector?this.dot(e.x,e.y,e.z):this.x*(e||0)+this.y*(t||0)+this.z*(r||0)},l.default.Vector.prototype.cross=function(e){var t=this.y*e.z-this.z*e.y,r=this.z*e.x-this.x*e.z,i=this.x*e.y-this.y*e.x;return this.p5?new l.default.Vector(this.p5,[t,r,i]):new l.default.Vector(t,r,i)},l.default.Vector.prototype.dist=function(e){return e.copy().sub(this).mag()},l.default.Vector.prototype.normalize=function(){var e=this.mag();return 0!==e&&this.mult(1/e),this},l.default.Vector.prototype.limit=function(e){var t=this.magSq();return e*e>>0},n.default.prototype.randomSeed=function(e){this._lcgSetSeed(o,e),this._gaussian_previous=!1},n.default.prototype.random=function(e,t){var r;if(n.default._validateParameters("random",arguments),r=null!=this[o]?this._lcg(o):Math.random(),void 0===e)return r;if(void 0===t)return e instanceof Array?e[Math.floor(r*e.length)]:r*e;if(tf){var P=p,L=l,k=u;p=d+f*(s&&d=t&&(r=r.substring(r.length-t,r.length)),r}},n.default.prototype.unhex=function(e){return e instanceof Array?e.map(n.default.prototype.unhex):parseInt("0x".concat(e),16)};var o=n.default;r.default=o},{"../core/main":49}],90:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i,a=(i=e("../core/main"))&&i.__esModule?i:{default:i};function n(e,t,r){var i=e<0,n=i?e.toString().substring(1):e.toString(),o=n.indexOf("."),a=-1!==o?n.substring(0,o):n,s=-1!==o?n.substring(o+1):"",l=i?"-":"";if(void 0!==r){var u="";(-1!==o||0r&&(s=s.substring(0,r));for(var h=0;hi.length)for(var o=t-(i+=-1===r?".":"").length+1,a=0;a=d.TWO_PI?"".concat("ellipse","|").concat(u,"|"):"".concat("arc","|").concat(a,"|").concat(s,"|").concat(l,"|").concat(u,"|"),!this.geometryInHash(t)){var h=new T.default.Geometry(u,1,function(){if(this.strokeIndices=[],a.toFixed(10)!==s.toFixed(10)){l!==d.PIE&&void 0!==l||(this.vertices.push(new T.default.Vector(.5,.5,0)),this.uvs.push([.5,.5]));for(var e=0;e<=u;e++){var t=(s-a)*(e/u)+a,r=.5+Math.cos(t)/2,i=.5+Math.sin(t)/2;this.vertices.push(new T.default.Vector(r,i,0)),this.uvs.push([r,i]),e>5&31)/31,(y>>10&31)/31):(r=a,i=s,l)}for(var b=1;b<=3;b++){var _=p+12*b,x=new S.default.Vector(u.getFloat32(_,!0),u.getFloat32(8+_,!0),u.getFloat32(4+_,!0));e.vertices.push(x),c&&o.push(r,i,n)}var w=new S.default.Vector(m,g,v);e.vertexNormals.push(w,w,w),e.faces.push([3*d,3*d+1,3*d+2]),e.uvs.push([0,0],[0,0],[0,0])}}(e,t);else{var r=new DataView(t);if(!("TextDecoder"in window))return console.warn("Sorry, ASCII STL loading only works in browsers that support TextDecoder (https://caniuse.com/#feat=textencoder)");var i=new TextDecoder("utf-8").decode(r).split("\n");!function(e,t){for(var r,i,n="",o=[],a=0;aMath.PI?l=Math.PI:l<=0&&(l=.001);var u=Math.sin(l)*a*Math.sin(s),h=Math.cos(l)*a,c=Math.sin(l)*a*Math.cos(s);this.camera(u+this.centerX,h+this.centerY,c+this.centerZ,this.centerX,this.centerY,this.centerZ,0,1,0)},m.default.Camera.prototype._isActive=function(){return this===this._renderer._curCamera},m.default.prototype.setCamera=function(e){this._renderer._curCamera=e,this._renderer.uPMatrix.set(e.projMatrix.mat4[0],e.projMatrix.mat4[1],e.projMatrix.mat4[2],e.projMatrix.mat4[3],e.projMatrix.mat4[4],e.projMatrix.mat4[5],e.projMatrix.mat4[6],e.projMatrix.mat4[7],e.projMatrix.mat4[8],e.projMatrix.mat4[9],e.projMatrix.mat4[10],e.projMatrix.mat4[11],e.projMatrix.mat4[12],e.projMatrix.mat4[13],e.projMatrix.mat4[14],e.projMatrix.mat4[15])};var n=m.default.Camera;r.default=n},{"../core/main":49}],98:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i,h=(i=e("../core/main"))&&i.__esModule?i:{default:i};h.default.Geometry=function(e,t,r){return this.vertices=[],this.lineVertices=[],this.lineNormals=[],this.vertexNormals=[],this.faces=[],this.uvs=[],this.edges=[],this.vertexColors=[],this.detailX=void 0!==e?e:1,this.detailY=void 0!==t?t:1,this.dirtyFlags={},r instanceof Function&&r.call(this),this},h.default.Geometry.prototype.reset=function(){this.lineVertices.length=0,this.lineNormals.length=0,this.vertices.length=0,this.edges.length=0,this.vertexColors.length=0,this.vertexNormals.length=0,this.uvs.length=0,this.dirtyFlags={}},h.default.Geometry.prototype.computeFaces=function(){this.faces.length=0;for(var e,t,r,i,n=this.detailX+1,o=0;othis.vertices.length-1-this.detailX;i--)e.add(this.vertexNormals[i]);e=h.default.Vector.div(e,this.detailX);for(var n=this.vertices.length-1;n>this.vertices.length-1-this.detailX;n--)this.vertexNormals[n]=e;return this},h.default.Geometry.prototype._makeTriangleEdges=function(){if(this.edges.length=0,Array.isArray(this.strokeIndices))for(var e=0,t=this.strokeIndices.length;e vTexCoord.y;\n bool y1 = p1.y > vTexCoord.y;\n bool y2 = p2.y > vTexCoord.y;\n\n // could web be under the curve (after t1)?\n if (y1 ? !y2 : y0) {\n // add the coverage for t1\n coverage.x += saturate(C1.x + 0.5);\n // calculate the anti-aliasing for t1\n weight.x = min(weight.x, abs(C1.x));\n }\n\n // are we outside the curve (after t2)?\n if (y1 ? !y0 : y2) {\n // subtract the coverage for t2\n coverage.x -= saturate(C2.x + 0.5);\n // calculate the anti-aliasing for t2\n weight.x = min(weight.x, abs(C2.x));\n }\n}\n\n// this is essentially the same as coverageX, but with the axes swapped\nvoid coverageY(vec2 p0, vec2 p1, vec2 p2) {\n\n vec2 C1, C2;\n calulateCrossings(p0, p1, p2, C1, C2);\n\n bool x0 = p0.x > vTexCoord.x;\n bool x1 = p1.x > vTexCoord.x;\n bool x2 = p2.x > vTexCoord.x;\n\n if (x1 ? !x2 : x0) {\n coverage.y -= saturate(C1.y + 0.5);\n weight.y = min(weight.y, abs(C1.y));\n }\n\n if (x1 ? !x0 : x2) {\n coverage.y += saturate(C2.y + 0.5);\n weight.y = min(weight.y, abs(C2.y));\n }\n}\n\nvoid main() {\n\n // calculate the pixel scale based on screen-coordinates\n pixelScale = hardness / fwidth(vTexCoord);\n\n // which grid cell is this pixel in?\n ivec2 gridCoord = ifloor(vTexCoord * vec2(uGridSize));\n\n // intersect curves in this row\n {\n // the index into the row info bitmap\n int rowIndex = gridCoord.y + uGridOffset.y;\n // fetch the info texel\n vec4 rowInfo = getTexel(uSamplerRows, rowIndex, uGridImageSize);\n // unpack the rowInfo\n int rowStrokeIndex = getInt16(rowInfo.xy);\n int rowStrokeCount = getInt16(rowInfo.zw);\n\n for (int iRowStroke = INT(0); iRowStroke < N; iRowStroke++) {\n if (iRowStroke >= rowStrokeCount)\n break;\n\n // each stroke is made up of 3 points: the start and control point\n // and the start of the next curve.\n // fetch the indices of this pair of strokes:\n vec4 strokeIndices = getTexel(uSamplerRowStrokes, rowStrokeIndex++, uCellsImageSize);\n\n // unpack the stroke index\n int strokePos = getInt16(strokeIndices.xy);\n\n // fetch the two strokes\n vec4 stroke0 = getTexel(uSamplerStrokes, strokePos + INT(0), uStrokeImageSize);\n vec4 stroke1 = getTexel(uSamplerStrokes, strokePos + INT(1), uStrokeImageSize);\n\n // calculate the coverage\n coverageX(stroke0.xy, stroke0.zw, stroke1.xy);\n }\n }\n\n // intersect curves in this column\n {\n int colIndex = gridCoord.x + uGridOffset.x;\n vec4 colInfo = getTexel(uSamplerCols, colIndex, uGridImageSize);\n int colStrokeIndex = getInt16(colInfo.xy);\n int colStrokeCount = getInt16(colInfo.zw);\n \n for (int iColStroke = INT(0); iColStroke < N; iColStroke++) {\n if (iColStroke >= colStrokeCount)\n break;\n\n vec4 strokeIndices = getTexel(uSamplerColStrokes, colStrokeIndex++, uCellsImageSize);\n\n int strokePos = getInt16(strokeIndices.xy);\n vec4 stroke0 = getTexel(uSamplerStrokes, strokePos + INT(0), uStrokeImageSize);\n vec4 stroke1 = getTexel(uSamplerStrokes, strokePos + INT(1), uStrokeImageSize);\n coverageY(stroke0.xy, stroke0.zw, stroke1.xy);\n }\n }\n\n weight = saturate(1.0 - weight * 2.0);\n float distance = max(weight.x + weight.y, minDistance); // manhattan approx.\n float antialias = abs(dot(coverage, weight) / distance);\n float cover = min(abs(coverage.x), abs(coverage.y));\n gl_FragColor = uMaterialColor;\n gl_FragColor.a *= saturate(max(antialias, cover));\n}",lineVert:"/*\n Part of the Processing project - http://processing.org\n Copyright (c) 2012-15 The Processing Foundation\n Copyright (c) 2004-12 Ben Fry and Casey Reas\n Copyright (c) 2001-04 Massachusetts Institute of Technology\n This library is free software; you can redistribute it and/or\n modify it under the terms of the GNU Lesser General Public\n License as published by the Free Software Foundation, version 2.1.\n This library is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n Lesser General Public License for more details.\n You should have received a copy of the GNU Lesser General\n Public License along with this library; if not, write to the\n Free Software Foundation, Inc., 59 Temple Place, Suite 330,\n Boston, MA 02111-1307 USA\n*/\n\n#define PROCESSING_LINE_SHADER\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform float uStrokeWeight;\n\nuniform vec4 uViewport;\nuniform int uPerspective;\n\nattribute vec4 aPosition;\nattribute vec4 aDirection;\n \nvoid main() {\n // using a scale <1 moves the lines towards the camera\n // in order to prevent popping effects due to half of\n // the line disappearing behind the geometry faces.\n vec3 scale = vec3(0.9995);\n\n vec4 posp = uModelViewMatrix * aPosition;\n vec4 posq = uModelViewMatrix * (aPosition + vec4(aDirection.xyz, 0));\n\n // Moving vertices slightly toward the camera\n // to avoid depth-fighting with the fill triangles.\n // Discussed here:\n // http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Number=252848 \n posp.xyz = posp.xyz * scale;\n posq.xyz = posq.xyz * scale;\n\n vec4 p = uProjectionMatrix * posp;\n vec4 q = uProjectionMatrix * posq;\n\n // formula to convert from clip space (range -1..1) to screen space (range 0..[width or height])\n // screen_p = (p.xy/p.w + <1,1>) * 0.5 * uViewport.zw\n\n // prevent division by W by transforming the tangent formula (div by 0 causes\n // the line to disappear, see https://github.com/processing/processing/issues/5183)\n // t = screen_q - screen_p\n //\n // tangent is normalized and we don't care which aDirection it points to (+-)\n // t = +- normalize( screen_q - screen_p )\n // t = +- normalize( (q.xy/q.w+<1,1>)*0.5*uViewport.zw - (p.xy/p.w+<1,1>)*0.5*uViewport.zw )\n //\n // extract common factor, <1,1> - <1,1> cancels out\n // t = +- normalize( (q.xy/q.w - p.xy/p.w) * 0.5 * uViewport.zw )\n //\n // convert to common divisor\n // t = +- normalize( ((q.xy*p.w - p.xy*q.w) / (p.w*q.w)) * 0.5 * uViewport.zw )\n //\n // remove the common scalar divisor/factor, not needed due to normalize and +-\n // (keep uViewport - can't remove because it has different components for x and y\n // and corrects for aspect ratio, see https://github.com/processing/processing/issues/5181)\n // t = +- normalize( (q.xy*p.w - p.xy*q.w) * uViewport.zw )\n\n vec2 tangent = normalize((q.xy*p.w - p.xy*q.w) * uViewport.zw);\n\n // flip tangent to normal (it's already normalized)\n vec2 normal = vec2(-tangent.y, tangent.x);\n\n float thickness = aDirection.w * uStrokeWeight;\n vec2 offset = normal * thickness / 2.0;\n\n vec2 curPerspScale;\n\n if(uPerspective == 1) {\n // Perspective ---\n // convert from world to clip by multiplying with projection scaling factor\n // to get the right thickness (see https://github.com/processing/processing/issues/5182)\n // invert Y, projections in Processing invert Y\n curPerspScale = (uProjectionMatrix * vec4(1, -1, 0, 0)).xy;\n } else {\n // No Perspective ---\n // multiply by W (to cancel out division by W later in the pipeline) and\n // convert from screen to clip (derived from clip to screen above)\n curPerspScale = p.w / (0.5 * uViewport.zw);\n }\n\n gl_Position.xy = p.xy + offset.xy * curPerspScale;\n gl_Position.zw = p.zw;\n}\n",lineFrag:"precision mediump float;\nprecision mediump int;\n\nuniform vec4 uMaterialColor;\n\nvoid main() {\n gl_FragColor = uMaterialColor;\n}",pointVert:"attribute vec3 aPosition;\nuniform float uPointSize;\nvarying float vStrokeWeight;\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nvoid main() {\n\tvec4 positionVec4 = vec4(aPosition, 1.0);\n\tgl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n\tgl_PointSize = uPointSize;\n\tvStrokeWeight = uPointSize;\n}",pointFrag:"precision mediump float;\nprecision mediump int;\nuniform vec4 uMaterialColor;\nvarying float vStrokeWeight;\n\nvoid main(){\n\tfloat mask = 0.0;\n\n\t// make a circular mask using the gl_PointCoord (goes from 0 - 1 on a point)\n // might be able to get a nicer edge on big strokeweights with smoothstep but slightly less performant\n\n\tmask = step(0.98, length(gl_PointCoord * 2.0 - 1.0));\n\n\t// if strokeWeight is 1 or less lets just draw a square\n\t// this prevents weird artifacting from carving circles when our points are really small\n\t// if strokeWeight is larger than 1, we just use it as is\n\n\tmask = mix(0.0, mask, clamp(floor(vStrokeWeight - 0.5),0.0,1.0));\n\n\t// throw away the borders of the mask\n // otherwise we get weird alpha blending issues\n\n\tif(mask > 0.98){\n discard;\n \t}\n\n \tgl_FragColor = vec4(uMaterialColor.rgb * (1.0 - mask), uMaterialColor.a) ;\n}"};u.default.RendererGL=function(e,t,r,i){return u.default.Renderer.call(this,e,t,r),this._setAttributeDefaults(t),this._initContext(),this.isP3D=!0,this.GL=this.drawingContext,this._isErasing=!1,this._enableLighting=!1,this.ambientLightColors=[],this.specularColors=[1,1,1],this.directionalLightDirections=[],this.directionalLightDiffuseColors=[],this.directionalLightSpecularColors=[],this.pointLightPositions=[],this.pointLightDiffuseColors=[],this.pointLightSpecularColors=[],this.spotLightPositions=[],this.spotLightDirections=[],this.spotLightDiffuseColors=[],this.spotLightSpecularColors=[],this.spotLightAngle=[],this.spotLightConc=[],this.drawMode=o.FILL,this.curFillColor=this._cachedFillStyle=[1,1,1,1],this.curStrokeColor=this._cachedStrokeStyle=[0,0,0,1],this.curBlendMode=o.BLEND,this._cachedBlendMode=void 0,this.blendExt=this.GL.getExtension("EXT_blend_minmax"),this._isBlending=!1,this._useSpecularMaterial=!1,this._useEmissiveMaterial=!1,this._useNormalMaterial=!1,this._useShininess=1,this._tint=[255,255,255,255],this.constantAttenuation=1,this.linearAttenuation=0,this.quadraticAttenuation=0,this.uMVMatrix=new u.default.Matrix,this.uPMatrix=new u.default.Matrix,this.uNMatrix=new u.default.Matrix("mat3"),this._curCamera=new u.default.Camera(this),this._curCamera._computeCameraDefaultSettings(),this._curCamera._setDefaultCamera(),this._defaultLightShader=void 0,this._defaultImmediateModeShader=void 0,this._defaultNormalShader=void 0,this._defaultColorShader=void 0,this._defaultPointShader=void 0,this.userFillShader=void 0,this.userStrokeShader=void 0,this.userPointShader=void 0,this.retainedMode={geometry:{},buffers:{stroke:[new u.default.RenderBuffer(3,"lineVertices","lineVertexBuffer","aPosition",this,this._flatten),new u.default.RenderBuffer(4,"lineNormals","lineNormalBuffer","aDirection",this,this._flatten)],fill:[new u.default.RenderBuffer(3,"vertices","vertexBuffer","aPosition",this,this._vToNArray),new u.default.RenderBuffer(3,"vertexNormals","normalBuffer","aNormal",this,this._vToNArray),new u.default.RenderBuffer(4,"vertexColors","colorBuffer","aMaterialColor",this),new u.default.RenderBuffer(3,"vertexAmbients","ambientBuffer","aAmbientColor",this),new u.default.RenderBuffer(2,"uvs","uvBuffer","aTexCoord",this,this._flatten)],text:[new u.default.RenderBuffer(3,"vertices","vertexBuffer","aPosition",this,this._vToNArray),new u.default.RenderBuffer(2,"uvs","uvBuffer","aTexCoord",this,this._flatten)]}},this.immediateMode={geometry:new u.default.Geometry,shapeMode:o.TRIANGLE_FAN,_bezierVertex:[],_quadraticVertex:[],_curveVertex:[],buffers:{fill:[new u.default.RenderBuffer(3,"vertices","vertexBuffer","aPosition",this,this._vToNArray),new u.default.RenderBuffer(3,"vertexNormals","normalBuffer","aNormal",this,this._vToNArray),new u.default.RenderBuffer(4,"vertexColors","colorBuffer","aVertexColor",this),new u.default.RenderBuffer(3,"vertexAmbients","ambientBuffer","aAmbientColor",this),new u.default.RenderBuffer(2,"uvs","uvBuffer","aTexCoord",this,this._flatten)],stroke:[new u.default.RenderBuffer(3,"lineVertices","lineVertexBuffer","aPosition",this,this._flatten),new u.default.RenderBuffer(4,"lineNormals","lineNormalBuffer","aDirection",this,this._flatten)],point:this.GL.createBuffer()}},this.pointSize=5,this.curStrokeWeight=1,this.textures=[],this.textureMode=o.IMAGE,this.textureWrapX=o.CLAMP,this.textureWrapY=o.CLAMP,this._tex=null,this._curveTightness=6,this._lookUpTableBezier=[],this._lookUpTableQuadratic=[],this._lutBezierDetail=0,this._lutQuadraticDetail=0,this._tessy=this._initTessy(),this.fontInfos={},this._curShader=void 0,this},u.default.RendererGL.prototype=Object.create(u.default.Renderer.prototype),u.default.RendererGL.prototype._setAttributeDefaults=function(e){var t={alpha:!0,depth:!0,stencil:!0,antialias:navigator.userAgent.toLowerCase().includes("safari"),premultipliedAlpha:!1,preserveDrawingBuffer:!0,perPixelLighting:!0};null===e._glAttributes?e._glAttributes=t:e._glAttributes=Object.assign(t,e._glAttributes)},u.default.RendererGL.prototype._initContext=function(){try{if(this.drawingContext=this.canvas.getContext("webgl",this._pInst._glAttributes)||this.canvas.getContext("experimental-webgl",this._pInst._glAttributes),null===this.drawingContext)throw new Error("Error creating webgl context");var e=this.drawingContext;e.enable(e.DEPTH_TEST),e.depthFunc(e.LEQUAL),e.viewport(0,0,e.drawingBufferWidth,e.drawingBufferHeight),this._viewport=this.drawingContext.getParameter(this.drawingContext.VIEWPORT)}catch(e){throw e}},u.default.RendererGL.prototype._resetContext=function(e,t){var r=this.width,i=this.height,n=this.canvas.id,o=this._pInst instanceof u.default.Graphics;if(o){var a=this._pInst;a.canvas.parentNode.removeChild(a.canvas),a.canvas=document.createElement("canvas"),(a._pInst._userNode||document.body).appendChild(a.canvas),u.default.Element.call(a,a.canvas,a._pInst),a.width=r,a.height=i}else{var s=this.canvas;s&&s.parentNode.removeChild(s),(s=document.createElement("canvas")).id=n,this._pInst._userNode?this._pInst._userNode.appendChild(s):document.body.appendChild(s),this._pInst.canvas=s}var l=new u.default.RendererGL(this._pInst.canvas,this._pInst,!o);this._pInst._setProperty("_renderer",l),l.resize(r,i),l._applyDefaults(),o||this._pInst._elements.push(l),"function"==typeof t&&setTimeout(function(){t.apply(window._renderer,e)},0)},u.default.prototype.setAttributes=function(e,t){if(void 0!==this._glAttributes){var r=!0;if(void 0!==t?(null===this._glAttributes&&(this._glAttributes={}),this._glAttributes[e]!==t&&(this._glAttributes[e]=t,r=!1)):e instanceof Object&&this._glAttributes!==e&&(this._glAttributes=e,r=!1),this._renderer.isP3D&&!r){if(!this._setupDone)for(var i in this._renderer.retainedMode.geometry)if(this._renderer.retainedMode.geometry.hasOwnProperty(i))return void console.error("Sorry, Could not set the attributes, you need to call setAttributes() before calling the other drawing methods in setup()");this.push(),this._renderer._resetContext(),this.pop(),this._renderer._curCamera&&(this._renderer._curCamera._renderer=this._renderer)}}else console.log("You are trying to use setAttributes on a p5.Graphics object that does not use a WEBGL renderer.")},u.default.RendererGL.prototype._update=function(){this.uMVMatrix.set(this._curCamera.cameraMatrix.mat4[0],this._curCamera.cameraMatrix.mat4[1],this._curCamera.cameraMatrix.mat4[2],this._curCamera.cameraMatrix.mat4[3],this._curCamera.cameraMatrix.mat4[4],this._curCamera.cameraMatrix.mat4[5],this._curCamera.cameraMatrix.mat4[6],this._curCamera.cameraMatrix.mat4[7],this._curCamera.cameraMatrix.mat4[8],this._curCamera.cameraMatrix.mat4[9],this._curCamera.cameraMatrix.mat4[10],this._curCamera.cameraMatrix.mat4[11],this._curCamera.cameraMatrix.mat4[12],this._curCamera.cameraMatrix.mat4[13],this._curCamera.cameraMatrix.mat4[14],this._curCamera.cameraMatrix.mat4[15]),this.ambientLightColors.length=0,this.specularColors=[1,1,1],this.directionalLightDirections.length=0,this.directionalLightDiffuseColors.length=0,this.directionalLightSpecularColors.length=0,this.pointLightPositions.length=0,this.pointLightDiffuseColors.length=0,this.pointLightSpecularColors.length=0,this.spotLightPositions.length=0,this.spotLightDirections.length=0,this.spotLightDiffuseColors.length=0,this.spotLightSpecularColors.length=0,this.spotLightAngle.length=0,this.spotLightConc.length=0,this._enableLighting=!1,this._tint=[255,255,255,255],this.GL.clear(this.GL.DEPTH_BUFFER_BIT)},u.default.RendererGL.prototype.background=function(){var e,t=(e=this._pInst).color.apply(e,arguments),r=t.levels[0]/255,i=t.levels[1]/255,n=t.levels[2]/255,o=t.levels[3]/255;this.GL.clearColor(r,i,n,o),this.GL.clear(this.GL.COLOR_BUFFER_BIT)},u.default.RendererGL.prototype.fill=function(e,t,r,i){var n=u.default.prototype.color.apply(this._pInst,arguments);this.curFillColor=n._array,this.drawMode=o.FILL,this._useNormalMaterial=!1,this._tex=null},u.default.RendererGL.prototype.stroke=function(e,t,r,i){arguments[3]=255;var n=u.default.prototype.color.apply(this._pInst,arguments);this.curStrokeColor=n._array},u.default.RendererGL.prototype.strokeCap=function(e){console.error("Sorry, strokeCap() is not yet implemented in WEBGL mode")},u.default.RendererGL.prototype.strokeJoin=function(e){console.error("Sorry, strokeJoin() is not yet implemented in WEBGL mode")},u.default.RendererGL.prototype.filter=function(e){console.error("filter() does not work in WEBGL mode")},u.default.RendererGL.prototype.blendMode=function(e){e===o.DARKEST||e===o.LIGHTEST||e===o.ADD||e===o.BLEND||e===o.SUBTRACT||e===o.SCREEN||e===o.EXCLUSION||e===o.REPLACE||e===o.MULTIPLY||e===o.REMOVE?this.curBlendMode=e:e!==o.BURN&&e!==o.OVERLAY&&e!==o.HARD_LIGHT&&e!==o.SOFT_LIGHT&&e!==o.DODGE||console.warn("BURN, OVERLAY, HARD_LIGHT, SOFT_LIGHT, and DODGE only work for blendMode in 2D mode.")},u.default.RendererGL.prototype.erase=function(e,t){this._isErasing||(this._cachedBlendMode=this.curBlendMode,this.blendMode(o.REMOVE),this._cachedFillStyle=this.curFillColor.slice(),this.curFillColor=[1,1,1,e/255],this._cachedStrokeStyle=this.curStrokeColor.slice(),this.curStrokeColor=[1,1,1,t/255],this._isErasing=!0)},u.default.RendererGL.prototype.noErase=function(){this._isErasing&&(this.curFillColor=this._cachedFillStyle.slice(),this.curStrokeColor=this._cachedStrokeStyle.slice(),this.blendMode(this._cachedBlendMode),this._isErasing=!1)},u.default.RendererGL.prototype.strokeWeight=function(e){this.curStrokeWeight!==e&&(this.pointSize=e,this.curStrokeWeight=e)},u.default.RendererGL.prototype._getPixel=function(e,t){var r;return r=new Uint8Array(4),this.drawingContext.readPixels(e,t,1,1,this.drawingContext.RGBA,this.drawingContext.UNSIGNED_BYTE,r),[r[0],r[1],r[2],r[3]]},u.default.RendererGL.prototype.loadPixels=function(){var e=this._pixelsState;if(!0===this._pInst._glAttributes.preserveDrawingBuffer){var t=e.pixels,r=this.GL.drawingBufferWidth*this.GL.drawingBufferHeight*4;t instanceof Uint8Array&&t.length===r||(t=new Uint8Array(r),this._pixelsState._setProperty("pixels",t));var i=this._pInst._pixelDensity;this.GL.readPixels(0,0,this.width*i,this.height*i,this.GL.RGBA,this.GL.UNSIGNED_BYTE,t)}else console.log("loadPixels only works in WebGL when preserveDrawingBuffer is true.")},u.default.RendererGL.prototype.geometryInHash=function(e){return void 0!==this.retainedMode.geometry[e]},u.default.RendererGL.prototype.resize=function(e,t){u.default.Renderer.prototype.resize.call(this,e,t),this.GL.viewport(0,0,this.GL.drawingBufferWidth,this.GL.drawingBufferHeight),this._viewport=this.GL.getParameter(this.GL.VIEWPORT),this._curCamera._resize();var r=this._pixelsState;void 0!==r.pixels&&r._setProperty("pixels",new Uint8Array(this.GL.drawingBufferWidth*this.GL.drawingBufferHeight*4))},u.default.RendererGL.prototype.clear=function(){var e=(arguments.length<=0?void 0:arguments[0])||0,t=(arguments.length<=1?void 0:arguments[1])||0,r=(arguments.length<=2?void 0:arguments[2])||0,i=(arguments.length<=3?void 0:arguments[3])||0;this.GL.clearColor(e,t,r,i),this.GL.clear(this.GL.COLOR_BUFFER_BIT|this.GL.DEPTH_BUFFER_BIT)},u.default.RendererGL.prototype.applyMatrix=function(e,t,r,i,n,o){16===arguments.length?u.default.Matrix.prototype.apply.apply(this.uMVMatrix,arguments):this.uMVMatrix.apply([e,t,0,0,r,i,0,0,0,0,1,0,n,o,0,1])},u.default.RendererGL.prototype.translate=function(e,t,r){return e instanceof u.default.Vector&&(r=e.z,t=e.y,e=e.x),this.uMVMatrix.translate([e,t,r]),this},u.default.RendererGL.prototype.scale=function(e,t,r){return this.uMVMatrix.scale(e,t,r),this},u.default.RendererGL.prototype.rotate=function(e,t){return void 0===t?this.rotateZ(e):(u.default.Matrix.prototype.rotate.apply(this.uMVMatrix,arguments),this)},u.default.RendererGL.prototype.rotateX=function(e){return this.rotate(e,1,0,0),this},u.default.RendererGL.prototype.rotateY=function(e){return this.rotate(e,0,1,0),this},u.default.RendererGL.prototype.rotateZ=function(e){return this.rotate(e,0,0,1),this},u.default.RendererGL.prototype.push=function(){var e=u.default.Renderer.prototype.push.apply(this),t=e.properties;return t.uMVMatrix=this.uMVMatrix.copy(),t.uPMatrix=this.uPMatrix.copy(),t._curCamera=this._curCamera,this._curCamera=this._curCamera.copy(),t.ambientLightColors=this.ambientLightColors.slice(),t.specularColors=this.specularColors.slice(),t.directionalLightDirections=this.directionalLightDirections.slice(),t.directionalLightDiffuseColors=this.directionalLightDiffuseColors.slice(),t.directionalLightSpecularColors=this.directionalLightSpecularColors.slice(),t.pointLightPositions=this.pointLightPositions.slice(),t.pointLightDiffuseColors=this.pointLightDiffuseColors.slice(),t.pointLightSpecularColors=this.pointLightSpecularColors.slice(),t.spotLightPositions=this.spotLightPositions.slice(),t.spotLightDirections=this.spotLightDirections.slice(),t.spotLightDiffuseColors=this.spotLightDiffuseColors.slice(),t.spotLightSpecularColors=this.spotLightSpecularColors.slice(),t.spotLightAngle=this.spotLightAngle.slice(),t.spotLightConc=this.spotLightConc.slice(),t.userFillShader=this.userFillShader,t.userStrokeShader=this.userStrokeShader,t.userPointShader=this.userPointShader,t.pointSize=this.pointSize,t.curStrokeWeight=this.curStrokeWeight,t.curStrokeColor=this.curStrokeColor,t.curFillColor=this.curFillColor,t._useSpecularMaterial=this._useSpecularMaterial,t._useEmissiveMaterial=this._useEmissiveMaterial,t._useShininess=this._useShininess,t.constantAttenuation=this.constantAttenuation,t.linearAttenuation=this.linearAttenuation,t.quadraticAttenuation=this.quadraticAttenuation,t._enableLighting=this._enableLighting,t._useNormalMaterial=this._useNormalMaterial,t._tex=this._tex,t.drawMode=this.drawMode,e},u.default.RendererGL.prototype.resetMatrix=function(){return this.uMVMatrix=u.default.Matrix.identity(this._pInst),this},u.default.RendererGL.prototype._getImmediateStrokeShader=function(){var e=this.userStrokeShader;return e&&e.isStrokeShader()?e:this._getLineShader()},u.default.RendererGL.prototype._getRetainedStrokeShader=u.default.RendererGL.prototype._getImmediateStrokeShader,u.default.RendererGL.prototype._getImmediateFillShader=function(){var e=this.userFillShader;if(this._useNormalMaterial&&(!e||!e.isNormalShader()))return this._getNormalShader();if(this._enableLighting){if(!e||!e.isLightShader())return this._getLightShader()}else if(this._tex){if(!e||!e.isTextureShader())return this._getLightShader()}else if(!e)return this._getImmediateModeShader();return e},u.default.RendererGL.prototype._getRetainedFillShader=function(){if(this._useNormalMaterial)return this._getNormalShader();var e=this.userFillShader;if(this._enableLighting){if(!e||!e.isLightShader())return this._getLightShader()}else if(this._tex){if(!e||!e.isTextureShader())return this._getLightShader()}else if(!e)return this._getColorShader();return e},u.default.RendererGL.prototype._getImmediatePointShader=function(){var e=this.userPointShader;return e&&e.isPointShader()?e:this._getPointShader()},u.default.RendererGL.prototype._getRetainedLineShader=u.default.RendererGL.prototype._getImmediateLineShader,u.default.RendererGL.prototype._getLightShader=function(){return this._defaultLightShader||(this._pInst._glAttributes.perPixelLighting?this._defaultLightShader=new u.default.Shader(this,c.phongVert,c.phongFrag):this._defaultLightShader=new u.default.Shader(this,c.lightVert,c.lightTextureFrag)),this._defaultLightShader},u.default.RendererGL.prototype._getImmediateModeShader=function(){return this._defaultImmediateModeShader||(this._defaultImmediateModeShader=new u.default.Shader(this,c.immediateVert,c.vertexColorFrag)),this._defaultImmediateModeShader},u.default.RendererGL.prototype._getNormalShader=function(){return this._defaultNormalShader||(this._defaultNormalShader=new u.default.Shader(this,c.normalVert,c.normalFrag)),this._defaultNormalShader},u.default.RendererGL.prototype._getColorShader=function(){return this._defaultColorShader||(this._defaultColorShader=new u.default.Shader(this,c.normalVert,c.basicFrag)),this._defaultColorShader},u.default.RendererGL.prototype._getPointShader=function(){return this._defaultPointShader||(this._defaultPointShader=new u.default.Shader(this,c.pointVert,c.pointFrag)),this._defaultPointShader},u.default.RendererGL.prototype._getLineShader=function(){return this._defaultLineShader||(this._defaultLineShader=new u.default.Shader(this,c.lineVert,c.lineFrag)),this._defaultLineShader},u.default.RendererGL.prototype._getFontShader=function(){return this._defaultFontShader||(this.GL.getExtension("OES_standard_derivatives"),this._defaultFontShader=new u.default.Shader(this,c.fontVert,c.fontFrag)),this._defaultFontShader},u.default.RendererGL.prototype._getEmptyTexture=function(){if(!this._emptyTexture){var e=new u.default.Image(1,1);e.set(0,0,255),this._emptyTexture=new u.default.Texture(this,e)}return this._emptyTexture},u.default.RendererGL.prototype.getTexture=function(e){var t=this.textures,r=!0,i=!1,n=void 0;try{for(var o,a=t[Symbol.iterator]();!(r=(o=a.next()).done);r=!0){var s=o.value;if(s.src===e)return s}}catch(e){i=!0,n=e}finally{try{r||null==a.return||a.return()}finally{if(i)throw n}}var l=new u.default.Texture(this,e);return t.push(l),l},u.default.RendererGL.prototype._setStrokeUniforms=function(e){e.bindShader(),e.setUniform("uMaterialColor",this.curStrokeColor),e.setUniform("uStrokeWeight",this.curStrokeWeight)},u.default.RendererGL.prototype._setFillUniforms=function(e){e.bindShader(),e.setUniform("uMaterialColor",this.curFillColor),e.setUniform("isTexture",!!this._tex),this._tex&&e.setUniform("uSampler",this._tex),e.setUniform("uTint",this._tint),e.setUniform("uSpecular",this._useSpecularMaterial),e.setUniform("uEmissive",this._useEmissiveMaterial),e.setUniform("uShininess",this._useShininess),e.setUniform("uUseLighting",this._enableLighting);var t=this.pointLightDiffuseColors.length/3;e.setUniform("uPointLightCount",t),e.setUniform("uPointLightLocation",this.pointLightPositions),e.setUniform("uPointLightDiffuseColors",this.pointLightDiffuseColors),e.setUniform("uPointLightSpecularColors",this.pointLightSpecularColors);var r=this.directionalLightDiffuseColors.length/3;e.setUniform("uDirectionalLightCount",r),e.setUniform("uLightingDirection",this.directionalLightDirections),e.setUniform("uDirectionalDiffuseColors",this.directionalLightDiffuseColors),e.setUniform("uDirectionalSpecularColors",this.directionalLightSpecularColors);var i=this.ambientLightColors.length/3;e.setUniform("uAmbientLightCount",i),e.setUniform("uAmbientColor",this.ambientLightColors);var n=this.spotLightDiffuseColors.length/3;e.setUniform("uSpotLightCount",n),e.setUniform("uSpotLightAngle",this.spotLightAngle),e.setUniform("uSpotLightConc",this.spotLightConc),e.setUniform("uSpotLightDiffuseColors",this.spotLightDiffuseColors),e.setUniform("uSpotLightSpecularColors",this.spotLightSpecularColors),e.setUniform("uSpotLightLocation",this.spotLightPositions),e.setUniform("uSpotLightDirection",this.spotLightDirections),e.setUniform("uConstantAttenuation",this.constantAttenuation),e.setUniform("uLinearAttenuation",this.linearAttenuation),e.setUniform("uQuadraticAttenuation",this.quadraticAttenuation),e.bindTextures()},u.default.RendererGL.prototype._setPointUniforms=function(e){e.bindShader(),e.setUniform("uMaterialColor",this.curStrokeColor),e.setUniform("uPointSize",this.pointSize)},u.default.RendererGL.prototype._bindBuffer=function(e,t,r,i,n){if(t=t||this.GL.ARRAY_BUFFER,this.GL.bindBuffer(t,e),void 0!==r){var o=new(i||Float32Array)(r);this.GL.bufferData(t,o,n||this.GL.STATIC_DRAW)}},u.default.RendererGL.prototype._arraysEqual=function(e,t){var r=e.length;if(r!==t.length)return!1;for(var i=0;i>7,127&f,c>>7,127&c);for(var d=0;d>7,127&p,0,0)}}return{cellImageInfo:l,dimOffset:o,dimImageInfo:n}}return(t=this.glyphInfos[e.index]={glyph:e,uGlyphRect:[i.x1,-i.y1,i.x2,-i.y2],strokeImageInfo:U,strokes:d,colInfo:G(m,this.colDimImageInfos,this.colCellImageInfos),rowInfo:G(p,this.rowDimImageInfos,this.rowCellImageInfos)}).uGridOffset=[t.colInfo.dimOffset,t.rowInfo.dimOffset],t}}var z=Math.sqrt(3);j.default.RendererGL.prototype._renderText=function(e,t,r,i,n){if(this._textFont&&"string"!=typeof this._textFont){if(!(n<=i)&&this._doFill){if(!this._isOpenType())return console.log("WEBGL: only Opentype (.otf) and Truetype (.ttf) fonts are supported"),e;e.push();var o=this._doStroke,a=this.drawMode;this._doStroke=!1,this.drawMode=D.TEXTURE;var s=this._textFont.font,l=this._textFont._fontInfo;l=l||(this._textFont._fontInfo=new A(s));var u=this._textFont._handleAlignment(this,t,r,i),h=this._textSize/s.unitsPerEm;this.translate(u.x,u.y,0),this.scale(h,h,1);var c=this.GL,f=!this._defaultFontShader,d=this._getFontShader();d.init(),d.bindShader(),f&&(d.setUniform("uGridImageSize",[64,64]),d.setUniform("uCellsImageSize",[64,64]),d.setUniform("uStrokeImageSize",[64,64]),d.setUniform("uGridSize",[9,9])),this._applyColorBlend(this.curFillColor);var p=this.retainedMode.geometry.glyph;if(!p){var m=this._textGeom=new j.default.Geometry(1,1,function(){for(var e=0;e<=1;e++)for(var t=0;t<=1;t++)this.vertices.push(new j.default.Vector(t,e,0)),this.uvs.push(t,e)});m.computeFaces().computeNormals(),p=this.createBuffers("glyph",m)}var g=!0,v=!1,y=void 0;try{for(var b,_=this.retainedMode.buffers.text[Symbol.iterator]();!(g=(b=_.next()).done);g=!0){b.value._prepareBuffer(p,d)}}catch(e){v=!0,y=e}finally{try{g||null==_.return||_.return()}finally{if(v)throw y}}this._bindBuffer(p.indexBuffer,c.ELEMENT_ARRAY_BUFFER),d.setUniform("uMaterialColor",this.curFillColor);try{var x=0,w=null,S=s.stringToGlyphs(t),M=!0,E=!1,T=void 0;try{for(var C,P=S[Symbol.iterator]();!(M=(C=P.next()).done);M=!0){var L=C.value;w&&(x+=s.getKerningValue(w,L));var k=l.getGlyphInfo(L);if(k.uGlyphRect){var R=k.rowInfo,O=k.colInfo;d.setUniform("uSamplerStrokes",k.strokeImageInfo.imageData),d.setUniform("uSamplerRowStrokes",R.cellImageInfo.imageData),d.setUniform("uSamplerRows",R.dimImageInfo.imageData),d.setUniform("uSamplerColStrokes",O.cellImageInfo.imageData),d.setUniform("uSamplerCols",O.dimImageInfo.imageData),d.setUniform("uGridOffset",k.uGridOffset),d.setUniform("uGlyphRect",k.uGlyphRect),d.setUniform("uGlyphOffset",x),d.bindTextures(),c.drawElements(c.TRIANGLES,6,this.GL.UNSIGNED_SHORT,0)}x+=L.advanceWidth,w=L}}catch(e){E=!0,T=e}finally{try{M||null==P.return||P.return()}finally{if(E)throw T}}}finally{d.unbindShader(),this._doStroke=o,this.drawMode=a,e.pop()}return e}}else console.log("WEBGL: you must load and set a font before drawing text. See `loadFont` and `textFont` for more details.")}},{"../core/constants":42,"../core/main":49,"./p5.RendererGL.Retained":102,"./p5.Shader":104}],107:[function(e,t,r){t.exports={fes:{autoplay:"The media that tried to play (with '{{src}}') wasn't allowed to by this browser, most likely due to the browser's autoplay policy. Check out {{link}} for more information about why.",fileLoadError:{bytes:"It looks like there was a problem loading your file. {{suggestion}}",font:"It looks like there was a problem loading your font. {{suggestion}}",gif:"There was some trouble loading your GIF. Make sure that your GIF is using 87a or 89a encoding.",image:"It looks like there was a problem loading your image. {{suggestion}}",json:"It looks like there was a problem loading your JSON file. {{suggestion}}",large:"If your large file isn't fetched successfully, we recommend splitting the file into smaller segments and fetching those.",strings:"It looks like there was a problem loading your text file. {{suggestion}}",suggestion:"Try checking if the file path ({{filePath}}) is correct, hosting the file online, or running a local server. (More info at {{link}})",table:"It looks like there was a problem loading your table file. {{suggestion}}",xml:"It looks like there was a problem loading your XML file. {{suggestion}}"},misusedTopLevel:"Did you just try to use p5.js's {{symbolName}} {{symbolType}}? If so, you may want to move it into your sketch's setup() function.\n\nFor more details, see: {{link}}",pre:"🌸 p5.js says: {{message}}",welcome:"Welcome! This is your friendly debugger. To turn me off, switch to using p5.min.js."}}},{}],108:[function(e,t,r){t.exports={fes:{autoplay:"Su browser impidío un medio tocar (de '{{src}}'), posiblemente porque las reglas de autoplay. Para aprender más, visite {{link}}.",fileLoadError:{bytes:"",font:"",gif:"",image:"",json:"",large:"",strings:"",suggestion:"",table:"",xml:""},misusedTopLevel:"",pre:"🌸 p5.js dice: {{message}}",welcome:""}}},{}],109:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i=o(e("./en/translation")),n=o(e("./es/translation"));function o(e){return e&&e.__esModule?e:{default:e}}var a={en:{translation:i.default},es:{translation:n.default}};r.default=a},{"./en/translation":107,"./es/translation":108}]},{},[37])(37)}); ================================================ FILE: docs/examples/pyodide/sketch_008/target/target_sketch.js ================================================ const wrapperContent = ` class PythonFunctions: pass setattr(PythonFunctions, 'map', map) setattr(PythonFunctions, 'filter', filter) setattr(PythonFunctions, 'set', set) _P5_INSTANCE = None _CTX_MIDDLE = None _DEFAULT_FILL = None _DEFAULT_LEADMULT = None _DEFAULT_STROKE = None _DEFAULT_TEXT_FILL = None ADD = None ALT = None ARROW = None AUDIO = None AUTO = None AXES = None BACKSPACE = None BASELINE = None BEVEL = None BEZIER = None BLEND = None BLUR = None BOLD = None BOLDITALIC = None BOTTOM = None BURN = None CENTER = None CHORD = None CLAMP = None CLOSE = None CONTROL = None CORNER = None CORNERS = None CROSS = None CURVE = None DARKEST = None DEG_TO_RAD = None DEGREES = None DELETE = None DIFFERENCE = None DILATE = None DODGE = None DOWN_ARROW = None ENTER = None ERODE = None ESCAPE = None EXCLUSION = None FILL = None GRAY = None GRID = None HALF_PI = None HAND = None HARD_LIGHT = None HSB = None HSL = None IMAGE = None IMMEDIATE = None INVERT = None ITALIC = None LANDSCAPE = None LEFT = None LEFT_ARROW = None LIGHTEST = None LINE_LOOP = None LINE_STRIP = None LINEAR = None LINES = None MIRROR = None MITER = None MOVE = None MULTIPLY = None NEAREST = None NORMAL = None OPAQUE = None OPEN = None OPTION = None OVERLAY = None PI = None PIE = None POINTS = None PORTRAIT = None POSTERIZE = None PROJECT = None QUAD_STRIP = None QUADRATIC = None QUADS = None QUARTER_PI = None RAD_TO_DEG = None RADIANS = None RADIUS = None REPEAT = None REPLACE = None RETURN = None RGB = None RIGHT = None RIGHT_ARROW = None ROUND = None SCREEN = None SHIFT = None SOFT_LIGHT = None SQUARE = None STROKE = None SUBTRACT = None TAB = None TAU = None TEXT = None TEXTURE = None THRESHOLD = None TOP = None TRIANGLE_FAN = None TRIANGLE_STRIP = None TRIANGLES = None TWO_PI = None UP_ARROW = None VIDEO = None WAIT = None WEBGL = None P2D = None PI = None frameCount = None focused = None displayWidth = None displayHeight = None windowWidth = None windowHeight = None width = None height = None deviceOrientation = None accelerationX = None accelerationY = None accelerationZ = None pAccelerationX = None pAccelerationY = None pAccelerationZ = None rotationX = None rotationY = None rotationZ = None pRotationX = None pRotationY = None pRotationZ = None turnAxis = None keyIsPressed = None key = None keyCode = None mouseX = None mouseY = None pmouseX = None pmouseY = None winMouseX = None winMouseY = None pwinMouseX = None pwinMouseY = None mouseButton = None mouseIsPressed = None touches = None pixels = None def alpha(*args): return _P5_INSTANCE.alpha(*args) def blue(*args): return _P5_INSTANCE.blue(*args) def brightness(*args): return _P5_INSTANCE.brightness(*args) def color(*args): return _P5_INSTANCE.color(*args) def green(*args): return _P5_INSTANCE.green(*args) def hue(*args): return _P5_INSTANCE.hue(*args) def lerpColor(*args): return _P5_INSTANCE.lerpColor(*args) def lightness(*args): return _P5_INSTANCE.lightness(*args) def red(*args): return _P5_INSTANCE.red(*args) def saturation(*args): return _P5_INSTANCE.saturation(*args) def background(*args): return _P5_INSTANCE.background(*args) def clear(*args): p5_clear = _P5_INSTANCE.clear(*args) return p5_clear def erase(*args): return _P5_INSTANCE.erase(*args) def noErase(*args): return _P5_INSTANCE.noErase(*args) def colorMode(*args): return _P5_INSTANCE.colorMode(*args) def fill(*args): return _P5_INSTANCE.fill(*args) def noFill(*args): return _P5_INSTANCE.noFill(*args) def noStroke(*args): return _P5_INSTANCE.noStroke(*args) def stroke(*args): return _P5_INSTANCE.stroke(*args) def arc(*args): return _P5_INSTANCE.arc(*args) def ellipse(*args): return _P5_INSTANCE.ellipse(*args) def circle(*args): return _P5_INSTANCE.circle(*args) def line(*args): return _P5_INSTANCE.line(*args) def point(*args): return _P5_INSTANCE.point(*args) def quad(*args): return _P5_INSTANCE.quad(*args) def rect(*args): return _P5_INSTANCE.rect(*args) def square(*args): return _P5_INSTANCE.square(*args) def triangle(*args): return _P5_INSTANCE.triangle(*args) def plane(*args): return _P5_INSTANCE.plane(*args) def box(*args): return _P5_INSTANCE.box(*args) def sphere(*args): return _P5_INSTANCE.sphere(*args) def cylinder(*args): return _P5_INSTANCE.cylinder(*args) def cone(*args): return _P5_INSTANCE.cone(*args) def ellipsoid(*args): return _P5_INSTANCE.ellipsoid(*args) def torus(*args): return _P5_INSTANCE.torus(*args) def loadModel(*args): return _P5_INSTANCE.loadModel(*args) def model(*args): return _P5_INSTANCE.model(*args) def ellipseMode(*args): return _P5_INSTANCE.ellipseMode(*args) def noSmooth(*args): return _P5_INSTANCE.noSmooth(*args) def rectMode(*args): return _P5_INSTANCE.rectMode(*args) def smooth(*args): return _P5_INSTANCE.smooth(*args) def strokeCap(*args): return _P5_INSTANCE.strokeCap(*args) def strokeJoin(*args): return _P5_INSTANCE.strokeJoin(*args) def strokeWeight(*args): return _P5_INSTANCE.strokeWeight(*args) def bezier(*args): return _P5_INSTANCE.bezier(*args) def bezierDetail(*args): return _P5_INSTANCE.bezierDetail(*args) def bezierPoint(*args): return _P5_INSTANCE.bezierPoint(*args) def bezierTangent(*args): return _P5_INSTANCE.bezierTangent(*args) def curve(*args): return _P5_INSTANCE.curve(*args) def curveDetail(*args): return _P5_INSTANCE.curveDetail(*args) def curveTightness(*args): return _P5_INSTANCE.curveTightness(*args) def curvePoint(*args): return _P5_INSTANCE.curvePoint(*args) def curveTangent(*args): return _P5_INSTANCE.curveTangent(*args) def beginContour(*args): return _P5_INSTANCE.beginContour(*args) def beginShape(*args): return _P5_INSTANCE.beginShape(*args) def bezierVertex(*args): return _P5_INSTANCE.bezierVertex(*args) def curveVertex(*args): return _P5_INSTANCE.curveVertex(*args) def endContour(*args): return _P5_INSTANCE.endContour(*args) def endShape(*args): return _P5_INSTANCE.endShape(*args) def quadraticVertex(*args): return _P5_INSTANCE.quadraticVertex(*args) def vertex(*args): return _P5_INSTANCE.vertex(*args) def cursor(*args): return _P5_INSTANCE.cursor(*args) def frameRate(*args): return _P5_INSTANCE.frameRate(*args) def noCursor(*args): return _P5_INSTANCE.noCursor(*args) def fullscreen(*args): return _P5_INSTANCE.fullscreen(*args) def pixelDensity(*args): return _P5_INSTANCE.pixelDensity(*args) def displayDensity(*args): return _P5_INSTANCE.displayDensity(*args) def getURL(*args): return _P5_INSTANCE.getURL(*args) def getURLPath(*args): return _P5_INSTANCE.getURLPath(*args) def getURLParams(*args): return _P5_INSTANCE.getURLParams(*args) def remove(*args): return _P5_INSTANCE.remove(*args) def noLoop(*args): return _P5_INSTANCE.noLoop(*args) def loop(*args): return _P5_INSTANCE.loop(*args) def push(*args): return _P5_INSTANCE.push(*args) def redraw(*args): return _P5_INSTANCE.redraw(*args) def resizeCanvas(*args): return _P5_INSTANCE.resizeCanvas(*args) def noCanvas(*args): return _P5_INSTANCE.noCanvas(*args) def createGraphics(*args): return _P5_INSTANCE.createGraphics(*args) def blendMode(*args): return _P5_INSTANCE.blendMode(*args) def setAttributes(*args): return _P5_INSTANCE.setAttributes(*args) def applyMatrix(*args): return _P5_INSTANCE.applyMatrix(*args) def resetMatrix(*args): return _P5_INSTANCE.resetMatrix(*args) def rotate(*args): return _P5_INSTANCE.rotate(*args) def rotateX(*args): return _P5_INSTANCE.rotateX(*args) def rotateY(*args): return _P5_INSTANCE.rotateY(*args) def rotateZ(*args): return _P5_INSTANCE.rotateZ(*args) def scale(*args): return _P5_INSTANCE.scale(*args) def shearX(*args): return _P5_INSTANCE.shearX(*args) def shearY(*args): return _P5_INSTANCE.shearY(*args) def translate(*args): return _P5_INSTANCE.translate(*args) def createStringDict(*args): return _P5_INSTANCE.createStringDict(*args) def createNumberDict(*args): return _P5_INSTANCE.createNumberDict(*args) def append(*args): return _P5_INSTANCE.append(*args) def arrayCopy(*args): return _P5_INSTANCE.arrayCopy(*args) def concat(*args): return _P5_INSTANCE.concat(*args) def reverse(*args): return _P5_INSTANCE.reverse(*args) def shorten(*args): return _P5_INSTANCE.shorten(*args) def shuffle(*args): return _P5_INSTANCE.shuffle(*args) def sort(*args): return _P5_INSTANCE.sort(*args) def splice(*args): return _P5_INSTANCE.splice(*args) def subset(*args): return _P5_INSTANCE.subset(*args) def float(*args): return _P5_INSTANCE.float(*args) def int(*args): return _P5_INSTANCE.int(*args) def str(*args): return _P5_INSTANCE.str(*args) def boolean(*args): return _P5_INSTANCE.boolean(*args) def byte(*args): return _P5_INSTANCE.byte(*args) def char(*args): return _P5_INSTANCE.char(*args) def unchar(*args): return _P5_INSTANCE.unchar(*args) def hex(*args): return _P5_INSTANCE.hex(*args) def unhex(*args): return _P5_INSTANCE.unhex(*args) def join(*args): return _P5_INSTANCE.join(*args) def match(*args): return _P5_INSTANCE.match(*args) def matchAll(*args): return _P5_INSTANCE.matchAll(*args) def nf(*args): return _P5_INSTANCE.nf(*args) def nfc(*args): return _P5_INSTANCE.nfc(*args) def nfp(*args): return _P5_INSTANCE.nfp(*args) def nfs(*args): return _P5_INSTANCE.nfs(*args) def split(*args): return _P5_INSTANCE.split(*args) def splitTokens(*args): return _P5_INSTANCE.splitTokens(*args) def trim(*args): return _P5_INSTANCE.trim(*args) def setMoveThreshold(*args): return _P5_INSTANCE.setMoveThreshold(*args) def setShakeThreshold(*args): return _P5_INSTANCE.setShakeThreshold(*args) def keyIsDown(*args): return _P5_INSTANCE.keyIsDown(*args) def createImage(*args): return _P5_INSTANCE.createImage(*args) def saveCanvas(*args): return _P5_INSTANCE.saveCanvas(*args) def saveFrames(*args): return _P5_INSTANCE.saveFrames(*args) def loadImage(*args): return _P5_INSTANCE.loadImage(*args) def image(*args): return _P5_INSTANCE.image(*args) def tint(*args): return _P5_INSTANCE.tint(*args) def noTint(*args): return _P5_INSTANCE.noTint(*args) def imageMode(*args): return _P5_INSTANCE.imageMode(*args) def blend(*args): return _P5_INSTANCE.blend(*args) def copy(*args): return _P5_INSTANCE.copy(*args) def filter(*args): if len(args) > 1 and (args[0] is None or callable(args[0])): return PythonFunctions.filter(*args) else: return _P5_INSTANCE.filter(*args) def get(*args): return _P5_INSTANCE.get(*args) def loadPixels(*args): return _P5_INSTANCE.loadPixels(*args) def set(*args): if len(args) <= 1: return PythonFunctions.set(*args) else: return _P5_INSTANCE.set(*args) def updatePixels(*args): return _P5_INSTANCE.updatePixels(*args) def loadJSON(*args): return _P5_INSTANCE.loadJSON(*args) def loadStrings(*args): return _P5_INSTANCE.loadStrings(*args) def loadTable(*args): return _P5_INSTANCE.loadTable(*args) def loadXML(*args): return _P5_INSTANCE.loadXML(*args) def loadBytes(*args): return _P5_INSTANCE.loadBytes(*args) def httpGet(*args): return _P5_INSTANCE.httpGet(*args) def httpPost(*args): return _P5_INSTANCE.httpPost(*args) def httpDo(*args): return _P5_INSTANCE.httpDo(*args) def createWriter(*args): return _P5_INSTANCE.createWriter(*args) def save(*args): return _P5_INSTANCE.save(*args) def saveJSON(*args): return _P5_INSTANCE.saveJSON(*args) def saveStrings(*args): return _P5_INSTANCE.saveStrings(*args) def saveTable(*args): return _P5_INSTANCE.saveTable(*args) def day(*args): return _P5_INSTANCE.day(*args) def hour(*args): return _P5_INSTANCE.hour(*args) def minute(*args): return _P5_INSTANCE.minute(*args) def millis(*args): return _P5_INSTANCE.millis(*args) def month(*args): return _P5_INSTANCE.month(*args) def second(*args): return _P5_INSTANCE.second(*args) def year(*args): return _P5_INSTANCE.year(*args) def createVector(*args): return _P5_INSTANCE.createVector(*args) def abs(*args): return _P5_INSTANCE.abs(*args) def ceil(*args): return _P5_INSTANCE.ceil(*args) def constrain(*args): return _P5_INSTANCE.constrain(*args) def dist(*args): return _P5_INSTANCE.dist(*args) def exp(*args): return _P5_INSTANCE.exp(*args) def floor(*args): return _P5_INSTANCE.floor(*args) def lerp(*args): return _P5_INSTANCE.lerp(*args) def log(*args): return _P5_INSTANCE.log(*args) def mag(*args): return _P5_INSTANCE.mag(*args) def map(*args): if len(args) > 1 and callable(args[0]): return PythonFunctions.map(*args) else: return _P5_INSTANCE.map(*args) def max(*args): return _P5_INSTANCE.max(*args) def min(*args): return _P5_INSTANCE.min(*args) def norm(*args): return _P5_INSTANCE.norm(*args) def pow(*args): return _P5_INSTANCE.pow(*args) def round(*args): return _P5_INSTANCE.round(*args) def sq(*args): return _P5_INSTANCE.sq(*args) def sqrt(*args): return _P5_INSTANCE.sqrt(*args) def noise(*args): return _P5_INSTANCE.noise(*args) def noiseDetail(*args): return _P5_INSTANCE.noiseDetail(*args) def noiseSeed(*args): return _P5_INSTANCE.noiseSeed(*args) def randomSeed(*args): return _P5_INSTANCE.randomSeed(*args) def random(*args): return _P5_INSTANCE.random(*args) def randomGaussian(*args): return _P5_INSTANCE.randomGaussian(*args) def acos(*args): return _P5_INSTANCE.acos(*args) def asin(*args): return _P5_INSTANCE.asin(*args) def atan(*args): return _P5_INSTANCE.atan(*args) def atan2(*args): return _P5_INSTANCE.atan2(*args) def cos(*args): return _P5_INSTANCE.cos(*args) def sin(*args): return _P5_INSTANCE.sin(*args) def tan(*args): return _P5_INSTANCE.tan(*args) def degrees(*args): return _P5_INSTANCE.degrees(*args) def radians(*args): return _P5_INSTANCE.radians(*args) def angleMode(*args): return _P5_INSTANCE.angleMode(*args) def textAlign(*args): return _P5_INSTANCE.textAlign(*args) def textLeading(*args): return _P5_INSTANCE.textLeading(*args) def textSize(*args): return _P5_INSTANCE.textSize(*args) def textStyle(*args): return _P5_INSTANCE.textStyle(*args) def textWidth(*args): return _P5_INSTANCE.textWidth(*args) def textAscent(*args): return _P5_INSTANCE.textAscent(*args) def textDescent(*args): return _P5_INSTANCE.textDescent(*args) def loadFont(*args): return _P5_INSTANCE.loadFont(*args) def text(*args): return _P5_INSTANCE.text(*args) def textFont(*args): return _P5_INSTANCE.textFont(*args) def orbitControl(*args): return _P5_INSTANCE.orbitControl(*args) def debugMode(*args): return _P5_INSTANCE.debugMode(*args) def noDebugMode(*args): return _P5_INSTANCE.noDebugMode(*args) def ambientLight(*args): return _P5_INSTANCE.ambientLight(*args) def directionalLight(*args): return _P5_INSTANCE.directionalLight(*args) def pointLight(*args): return _P5_INSTANCE.pointLight(*args) def lights(*args): return _P5_INSTANCE.lights(*args) def loadShader(*args): return _P5_INSTANCE.loadShader(*args) def createShader(*args): return _P5_INSTANCE.createShader(*args) def shader(*args): return _P5_INSTANCE.shader(*args) def resetShader(*args): return _P5_INSTANCE.resetShader(*args) def normalMaterial(*args): return _P5_INSTANCE.normalMaterial(*args) def texture(*args): return _P5_INSTANCE.texture(*args) def textureMode(*args): return _P5_INSTANCE.textureMode(*args) def textureWrap(*args): return _P5_INSTANCE.textureWrap(*args) def ambientMaterial(*args): return _P5_INSTANCE.ambientMaterial(*args) def specularMaterial(*args): return _P5_INSTANCE.specularMaterial(*args) def shininess(*args): return _P5_INSTANCE.shininess(*args) def camera(*args): return _P5_INSTANCE.camera(*args) def perspective(*args): return _P5_INSTANCE.perspective(*args) def ortho(*args): return _P5_INSTANCE.ortho(*args) def createCamera(*args): return _P5_INSTANCE.createCamera(*args) def setCamera(*args): return _P5_INSTANCE.setCamera(*args) def select(*args): return _P5_INSTANCE.select(*args) def selectAll(*args): return _P5_INSTANCE.selectAll(*args) def removeElements(*args): return _P5_INSTANCE.removeElements(*args) def changed(*args): return _P5_INSTANCE.changed(*args) def input(*args): return _P5_INSTANCE.input(*args) def createDiv(*args): return _P5_INSTANCE.createDiv(*args) def createP(*args): return _P5_INSTANCE.createP(*args) def createSpan(*args): return _P5_INSTANCE.createSpan(*args) def createImg(*args): return _P5_INSTANCE.createImg(*args) def createA(*args): return _P5_INSTANCE.createA(*args) def createSlider(*args): return _P5_INSTANCE.createSlider(*args) def createButton(*args): return _P5_INSTANCE.createButton(*args) def createCheckbox(*args): return _P5_INSTANCE.createCheckbox(*args) def createSelect(*args): return _P5_INSTANCE.createSelect(*args) def createRadio(*args): return _P5_INSTANCE.createRadio(*args) def createColorPicker(*args): return _P5_INSTANCE.createColorPicker(*args) def createInput(*args): return _P5_INSTANCE.createInput(*args) def createFileInput(*args): return _P5_INSTANCE.createFileInput(*args) def createVideo(*args): return _P5_INSTANCE.createVideo(*args) def createAudio(*args): return _P5_INSTANCE.createAudio(*args) def createCapture(*args): return _P5_INSTANCE.createCapture(*args) def createElement(*args): return _P5_INSTANCE.createElement(*args) def createCanvas(*args): canvas = _P5_INSTANCE.createCanvas(*args) global width, height width = _P5_INSTANCE.width height = _P5_INSTANCE.height return canvas def __deviceMoved(e): try: _bind_event_function(deviceMoved, e) except NameError: pass def __deviceTurned(e): try: _bind_event_function(deviceTurned, e) except NameError: pass def __deviceShaken(e): try: _bind_event_function(deviceShaken, e) except NameError: pass def __touchEnded(e): try: _bind_event_function(deviceShaken, e) except NameError: pass def __touchStarted(e): try: _bind_event_function(touchStarted, e) except NameError: pass def __windowResized(e): try: _bind_event_function(windowResized, e) except NameError: pass def __touchMoved(e): try: _bind_event_function(touchMoved, e) except NameError: pass def __mouseMoved(e): try: _bind_event_function(mouseMoved, e) except NameError: pass def __mouseDragged(e): try: _bind_event_function(mouseDragged, e) except NameError: pass def __mousePressed(e): try: _bind_event_function(mousePressed, e) except NameError: pass def __mouseReleased(e): try: _bind_event_function(mouseReleased, e) except NameError: pass def __mouseClicked(e): try: _bind_event_function(mouseClicked, e) except NameError: pass def __doubleClicked(e): try: _bind_event_function(doubleClicked, e) except NameError: pass def __mouseWheel(e): try: _bind_event_function(mouseWheel, e) except NameError: pass def __keyPressed(e): try: _bind_event_function(keyPressed, e) except NameError: pass def __keyReleased(e): try: _bind_event_function(keyReleased, e) except NameError: pass def __keyTyped(e): try: _bind_event_function(keyTyped, e) except NameError: pass def __keyIsDown(e): try: _bind_event_function(keyIsDown, e) except NameError: pass def pop(*args): p5_pop = _P5_INSTANCE.pop(*args) return p5_pop # Processing Python or Java mode compatibility aliases size = createCanvas popMatrix = pop popStyle = pop pushMatrix = push pushStyle = push # PVector is a wrapper/helper class for p5.Vector objets # providing names similar to Processing Python or Java modes # but mostly keeping p5js functionality from numbers import Number class PVector: def __init__(self, x=0, y=0, z=0): self.__vector = createVector(x, y, z) self.add = self.__instance_add__ self.sub = self.__instance_sub__ self.mult = self.__instance_mult__ self.div = self.__instance_div__ self.cross = self.__instance_cross__ self.dist = self.__instance_dist__ self.dot = self.__instance_dot__ self.lerp = self.__instance_lerp__ @property def x(self): return self.__vector.x @x.setter def x(self, x): self.__vector.x = x @property def y(self): return self.__vector.y @y.setter def y(self, y): self.__vector.y = y @property def z(self): return self.__vector.z @z.setter def z(self, z): self.__vector.z = z def mag(self): return self.__vector.mag() def magSq(self): return self.__vector.magSq() def setMag(self, mag): self.__vector.setMag(mag) return self def normalize(self): self.__vector.normalize() return self def limit(self, max): self.__vector.limit(max) return self def heading(self): return self.__vector.heading() def rotate(self, angle): self.__vector.rotate(angle) return self def __instance_add__(self, *args): if len(args) == 1: return PVector.add(self, args[0], self) else: return PVector.add(self, PVector(*args), self) def __instance_sub__(self, *args): if len(args) == 1: return PVector.sub(self, args[0], self) else: return PVector.sub(self, PVector(*args), self) def __instance_mult__(self, o): return PVector.mult(self, o, self) def __instance_div__(self, f): return PVector.div(self, f, self) def __instance_cross__(self, o): return PVector.cross(self, o, self) def __instance_dist__(self, o): return PVector.dist(self, o) def __instance_dot__(self, *args): if len(args) == 1: v = args[0] else: v = args return self.x * v[0] + self.y * v[1] + self.z * v[2] def __instance_lerp__(self, *args): if len(args) == 2: return PVector.lerp(self, args[0], args[1], self) else: vx, vy, vz, f = args return PVector.lerp(self, PVector(vx, vy, vz), f, self) def get(self): return PVector(self.x, self.y, self.z) def copy(self): return PVector(self.x, self.y, self.z) def __getitem__(self, k): return getattr(self, ('x', 'y', 'z')[k]) def __setitem__(self, k, v): setattr(self, ('x', 'y', 'z')[k], v) def __copy__(self): return PVector(self.x, self.y, self.z) def __deepcopy__(self, memo): return PVector(self.x, self.y, self.z) def __repr__(self): # PROVISÓRIO return f'PVector({self.x}, {self.y}, {self.z})' def set(self, *args): """ Sets the x, y, and z component of the vector using two or three separate variables, the data from a p5.Vector, or the values from a float array. """ self.__vector.set(*args) @classmethod def add(cls, a, b, dest=None): if dest is None: return PVector(a.x + b[0], a.y + b[1], a.z + b[2]) dest.__vector.set(a.x + b[0], a.y + b[1], a.z + b[2]) return dest @classmethod def sub(cls, a, b, dest=None): if dest is None: return PVector(a.x - b[0], a.y - b[1], a.z - b[2]) dest.__vector.set(a.x - b[0], a.y - b[1], a.z - b[2]) return dest @classmethod def mult(cls, a, b, dest=None): if dest is None: return PVector(a.x * b, a.y * b, a.z * b) dest.__vector.set(a.x * b, a.y * b, a.z * b) return dest @classmethod def div(cls, a, b, dest=None): if dest is None: return PVector(a.x / b, a.y / b, a.z / b) dest.__vector.set(a.x / b, a.y / b, a.z / b) return dest @classmethod def dist(cls, a, b): return a.__vector.dist(b.__vector) @classmethod def dot(cls, a, b): return a.__vector.dot(b.__vector) def __add__(a, b): return PVector.add(a, b, None) def __sub__(a, b): return PVector.sub(a, b, None) def __isub__(a, b): a.sub(b) return a def __iadd__(a, b): a.add(b) return a def __mul__(a, b): if not isinstance(b, Number): raise TypeError( "The * operator can only be used to multiply a PVector by a number") return PVector.mult(a, float(b), None) def __rmul__(a, b): if not isinstance(b, Number): raise TypeError( "The * operator can only be used to multiply a PVector by a number") return PVector.mult(a, float(b), None) def __imul__(a, b): if not isinstance(b, Number): raise TypeError( "The *= operator can only be used to multiply a PVector by a number") a.__vector.mult(float(b)) return a def __truediv__(a, b): if not isinstance(b, Number): raise TypeError( "The * operator can only be used to multiply a PVector by a number") return PVector(a.x / float(b), a.y / float(b), a.z / float(b)) def __itruediv__(a, b): if not isinstance(b, Number): raise TypeError( "The /= operator can only be used to multiply a PVector by a number") a.__vector.set(a.x / float(b), a.y / float(b), a.z / float(b)) return a def __eq__(a, b): return a.x == b[0] and a.y == b[1] and a.z == b[2] def __lt__(a, b): return a.magSq() < b.magSq() def __le__(a, b): return a.magSq() <= b.magSq() def __gt__(a, b): return a.magSq() > b.magSq() def __ge__(a, b): return a.magSq() >= b.magSq() # Problematic class methods, we would rather use p5.Vector when possible... @classmethod def lerp(cls, a, b, f, dest=None): v = createVector(a.x, a.y, a.z) v.lerp(b.__vector, f) if dest is None: return PVector(v.x, v.y, v.z) dest.set(v.x, v.y, v.z) return dest @classmethod def cross(cls, a, b, dest=None): x = a.y * b[2] - b[1] * a.z y = a.z * b[0] - b[2] * a.x z = a.x * b[1] - b[0] * a.y if dest is None: return PVector(x, y, z) dest.set(x, y, z) return dest @classmethod def fromAngle(cls, angle, length=1): # https://github.com/processing/p5.js/blob/3f0b2f0fe575dc81c724474154f5b23a517b7233/src/math/p5.Vector.js return PVector(length * cos(angle), length * sin(angle), 0) @classmethod def fromAngles(theta, phi, length=1): # https://github.com/processing/p5.js/blob/3f0b2f0fe575dc81c724474154f5b23a517b7233/src/math/p5.Vector.js cosPhi = cos(phi) sinPhi = sin(phi) cosTheta = cos(theta) sinTheta = sin(theta) return PVector(length * sinTheta * sinPhi, -length * cosTheta, length * sinTheta * cosPhi) @classmethod def random2D(cls): return PVector.fromAngle(random(TWO_PI)) @classmethod def random3D(cls, dest=None): angle = random(TWO_PI) vz = random(2) - 1 mult = sqrt(1 - vz * vz) vx = mult * cos(angle) vy = mult * sin(angle) if dest is None: return PVector(vx, vy, vz) dest.set(vx, vy, vz) return dest @classmethod def angleBetween(cls, a, b): return acos(a.dot(b) / sqrt(a.magSq() * b.magSq())) # Other harmless p5js methods def equals(self, v): return self == v def heading2D(self): return self.__vector.heading() def reflect(self, *args): # Reflect the incoming vector about a normal to a line in 2D, or about # a normal to a plane in 3D This method acts on the vector directly r = self.__vector.reflect(*args) return r def array(self): # Return a representation of this vector as a float array. This is only # for temporary use. If used in any w fashion, the contents should be # copied by using the p5.Vector.copy() method to copy into your own # array. return self.__vector.array() def toString(self): # Returns a string representation of a vector v by calling String(v) or v.toString(). # return self.__vector.toString() would be something like "p5.vector # Object […, …, …]" return str(self) def rem(self, *args): # Gives remainder of a vector when it is divided by anw vector. See # examples for more context. self.__vector.rem(*args) return self def pre_draw(p5_instance, draw_func, *args, **kwargs): """ We need to run this before the actual draw to insert and update p5 env variables """ global _CTX_MIDDLE, _DEFAULT_FILL, _DEFAULT_LEADMULT, _DEFAULT_STROKE, _DEFAULT_TEXT_FILL global ADD, ALT, ARROW, AUTO, AUDIO, AXES, BACKSPACE, BASELINE, BEVEL, BEZIER, BLEND, BLUR, BOLD, BOLDITALIC global BOTTOM, BURN, CENTER, CHORD, CLAMP, CLOSE, CONTROL, CORNER, CORNERS, CROSS, CURVE, DARKEST global DEG_TO_RAD, DEGREES, DELETE, DIFFERENCE, DILATE, DODGE, DOWN_ARROW, ENTER, ERODE, ESCAPE, EXCLUSION global FILL, GRAY, GRID, HALF_PI, HAND, HARD_LIGHT, HSB, HSL, IMAGE, IMMEDIATE, INVERT, ITALIC, LANDSCAPE global LEFT, LEFT_ARROW, LIGHTEST, LINE_LOOP, LINE_STRIP, LINEAR, LINES, MIRROR, MITER, MOVE, MULTIPLY, NEAREST global NORMAL, OPAQUE, OPEN, OPTION, OVERLAY, P2D, P3D, PI, PIE, POINTS, PORTRAIT, POSTERIZE, PROJECT, QUAD_STRIP global QUADRATIC, QUADS, QUARTER_PI, RAD_TO_DEG, RADIANS, RADIUS, REPEAT, REPLACE, RETURN, RGB, RIGHT, RIGHT_ARROW global ROUND, SCREEN, SHIFT, SOFT_LIGHT, SQUARE, STROKE, SUBTRACT, TAB, TAU, TEXT, TEXTURE, THRESHOLD, TOP global TRIANGLE_FAN, TRIANGLE_STRIP, TRIANGLES, TWO_PI, UP_ARROW, VIDEO, WAIT, WEBGL global frameCount, focused, displayWidth, displayHeight, windowWidth, windowHeight, width, height global deviceOrientation, accelerationX, accelerationY, accelerationZ global pAccelerationX, pAccelerationY, pAccelerationZ, rotationX, rotationY, rotationZ global pRotationX, pRotationY, pRotationZ, turnAxis, keyIsPressed, key, keyCode, mouseX, mouseY, pmouseX, pmouseY global winMouseX, winMouseY, pwinMouseX, pwinMouseY, mouseButton, mouseIsPressed, touches, pixels _CTX_MIDDLE = p5_instance._CTX_MIDDLE _DEFAULT_FILL = p5_instance._DEFAULT_FILL _DEFAULT_LEADMULT = p5_instance._DEFAULT_LEADMULT _DEFAULT_STROKE = p5_instance._DEFAULT_STROKE _DEFAULT_TEXT_FILL = p5_instance._DEFAULT_TEXT_FILL ADD = p5_instance.ADD ALT = p5_instance.ALT ARROW = p5_instance.ARROW AUDIO = p5_instance.AUDIO AUTO = p5_instance.AUTO AXES = p5_instance.AXES BACKSPACE = p5_instance.BACKSPACE BASELINE = p5_instance.BASELINE BEVEL = p5_instance.BEVEL BEZIER = p5_instance.BEZIER BLEND = p5_instance.BLEND BLUR = p5_instance.BLUR BOLD = p5_instance.BOLD BOLDITALIC = p5_instance.BOLDITALIC BOTTOM = p5_instance.BOTTOM BURN = p5_instance.BURN CENTER = p5_instance.CENTER CHORD = p5_instance.CHORD CLAMP = p5_instance.CLAMP CLOSE = p5_instance.CLOSE CONTROL = p5_instance.CONTROL CORNER = p5_instance.CORNER CORNERS = p5_instance.CORNERS CROSS = p5_instance.CROSS CURVE = p5_instance.CURVE DARKEST = p5_instance.DARKEST DEG_TO_RAD = p5_instance.DEG_TO_RAD DEGREES = p5_instance.DEGREES DELETE = p5_instance.DELETE DIFFERENCE = p5_instance.DIFFERENCE DILATE = p5_instance.DILATE DODGE = p5_instance.DODGE DOWN_ARROW = p5_instance.DOWN_ARROW ENTER = p5_instance.ENTER ERODE = p5_instance.ERODE ESCAPE = p5_instance.ESCAPE EXCLUSION = p5_instance.EXCLUSION FILL = p5_instance.FILL GRAY = p5_instance.GRAY GRID = p5_instance.GRID HALF_PI = p5_instance.HALF_PI HAND = p5_instance.HAND HARD_LIGHT = p5_instance.HARD_LIGHT HSB = p5_instance.HSB HSL = p5_instance.HSL IMAGE = p5_instance.IMAGE IMMEDIATE = p5_instance.IMMEDIATE INVERT = p5_instance.INVERT ITALIC = p5_instance.ITALIC LANDSCAPE = p5_instance.LANDSCAPE LEFT = p5_instance.LEFT LEFT_ARROW = p5_instance.LEFT_ARROW LIGHTEST = p5_instance.LIGHTEST LINE_LOOP = p5_instance.LINE_LOOP LINE_STRIP = p5_instance.LINE_STRIP LINEAR = p5_instance.LINEAR LINES = p5_instance.LINES MIRROR = p5_instance.MIRROR MITER = p5_instance.MITER MOVE = p5_instance.MOVE MULTIPLY = p5_instance.MULTIPLY NEAREST = p5_instance.NEAREST NORMAL = p5_instance.NORMAL OPAQUE = p5_instance.OPAQUE OPEN = p5_instance.OPEN OPTION = p5_instance.OPTION OVERLAY = p5_instance.OVERLAY P2D = p5_instance.P2D P3D = p5_instance.WEBGL PI = p5_instance.PI PIE = p5_instance.PIE POINTS = p5_instance.POINTS PORTRAIT = p5_instance.PORTRAIT POSTERIZE = p5_instance.POSTERIZE PROJECT = p5_instance.PROJECT QUAD_STRIP = p5_instance.QUAD_STRIP QUADRATIC = p5_instance.QUADRATIC QUADS = p5_instance.QUADS QUARTER_PI = p5_instance.QUARTER_PI RAD_TO_DEG = p5_instance.RAD_TO_DEG RADIANS = p5_instance.RADIANS RADIUS = p5_instance.RADIUS REPEAT = p5_instance.REPEAT REPLACE = p5_instance.REPLACE RETURN = p5_instance.RETURN RGB = p5_instance.RGB RIGHT = p5_instance.RIGHT RIGHT_ARROW = p5_instance.RIGHT_ARROW ROUND = p5_instance.ROUND SCREEN = p5_instance.SCREEN SHIFT = p5_instance.SHIFT SOFT_LIGHT = p5_instance.SOFT_LIGHT SQUARE = p5_instance.SQUARE STROKE = p5_instance.STROKE SUBTRACT = p5_instance.SUBTRACT TAB = p5_instance.TAB TAU = p5_instance.TAU TEXT = p5_instance.TEXT TEXTURE = p5_instance.TEXTURE THRESHOLD = p5_instance.THRESHOLD TOP = p5_instance.TOP TRIANGLE_FAN = p5_instance.TRIANGLE_FAN TRIANGLE_STRIP = p5_instance.TRIANGLE_STRIP TRIANGLES = p5_instance.TRIANGLES TWO_PI = p5_instance.TWO_PI UP_ARROW = p5_instance.UP_ARROW VIDEO = p5_instance.VIDEO WAIT = p5_instance.WAIT WEBGL = p5_instance.WEBGL frameCount = p5_instance.frameCount focused = p5_instance.focused displayWidth = p5_instance.displayWidth displayHeight = p5_instance.displayHeight windowWidth = p5_instance.windowWidth windowHeight = p5_instance.windowHeight width = p5_instance.width height = p5_instance.height deviceOrientation = p5_instance.deviceOrientation accelerationX = p5_instance.accelerationX accelerationY = p5_instance.accelerationY accelerationZ = p5_instance.accelerationZ pAccelerationX = p5_instance.pAccelerationX pAccelerationY = p5_instance.pAccelerationY pAccelerationZ = p5_instance.pAccelerationZ rotationX = p5_instance.rotationX rotationY = p5_instance.rotationY rotationZ = p5_instance.rotationZ pRotationX = p5_instance.pRotationX pRotationY = p5_instance.pRotationY pRotationZ = p5_instance.pRotationZ turnAxis = p5_instance.turnAxis keyIsPressed = p5_instance.keyIsPressed key = p5_instance.key keyCode = p5_instance.keyCode mouseX = p5_instance.mouseX mouseY = p5_instance.mouseY pmouseX = p5_instance.pmouseX pmouseY = p5_instance.pmouseY winMouseX = p5_instance.winMouseX winMouseY = p5_instance.winMouseY pwinMouseX = p5_instance.pwinMouseX pwinMouseY = p5_instance.pwinMouseY mouseButton = p5_instance.mouseButton mouseIsPressed = p5_instance.mouseIsPressed touches = p5_instance.touches pixels = p5_instance.pixels return draw_func(*args, **kwargs) def global_p5_injection(p5_sketch): """ Injects the p5js's skecth instance as a global variable to setup and draw functions """ def decorator(f, *args, **kwargs): def wrapper(*args, **kwargs): global _P5_INSTANCE _P5_INSTANCE = p5_sketch return pre_draw(_P5_INSTANCE, f, *args, **kwargs) return wrapper return decorator def start_p5(preload_func, setup_func, draw_func, event_functions): """ This is the entrypoint function. It accepts 2 parameters: - preload_func: A Python preload callable - setup_func: a Python setup callable - draw_func: a Python draw callable - event_functions: a config dict for the event functions in the format: {"eventFunctionName": python_event_function} This method gets the p5js's sketch instance and injects them """ def sketch_setup(p5_sketch): """ Callback function called to configure new p5 instance """ p5_sketch.preload = global_p5_injection(p5_sketch)(preload_func) p5_sketch.setup = global_p5_injection(p5_sketch)(setup_func) p5_sketch.draw = global_p5_injection(p5_sketch)(draw_func) window.instance = p5.new(sketch_setup, 'sketch-holder') # Register event functions event_function_names = ( "deviceMoved", "deviceTurned", "deviceShaken", "windowResized", "keyPressed", "keyReleased", "keyTyped", "mousePressed", "mouseReleased", "mouseClicked", "doubleClicked", "mouseMoved", "mouseDragged", "mouseWheel", "touchStarted", "touchMoved", "touchEnded", "keyIsDown", ) for f_name in [f for f in event_function_names if event_functions.get(f, None)]: func = event_functions[f_name] event_func = global_p5_injection(window.instance)(func) setattr(window.instance, f_name, event_func) `; const placeholder = ` def preload(): pass def setup(): pass def draw(): pass deviceMoved = None deviceTurned = None deviceShaken = None keyPressed = None keyReleased = None keyTyped = None mouseMoved = None mouseDragged = None mousePressed = None mouseReleased = None mouseClicked = None doubleClicked = None mouseWheel = None touchStarted = None touchMoved = None touchEnded = None windowResized = None `; let userCode = ` rect_base_size = 30 positions = [] rect_size = None def setup(): global rect_size createP("Hi! This is an example of how to use p5.dom.js with pyp5js") # creates a container div slider_div = createDiv() slider_div.style("display", "block") # creates the slider rect_size = createSlider(0, 600, 100) rect_size.style('width', '50%') # adds the slider to the container div slider_div.child(rect_size) createCanvas(600, 600) for x in range(-rect_base_size, width + rect_base_size, rect_base_size): for y in range(-rect_base_size, height + rect_base_size, rect_base_size): positions.append((x, y)) noFill() strokeWeight(2) rectMode(CENTER) def draw(): background(255) size = rect_size.value() for x, y in positions: rect(x, y, size, size) `; const startCode = ` event_functions = { "deviceMoved": deviceMoved, "deviceTurned": deviceTurned, "deviceShaken": deviceShaken, "keyPressed": keyPressed, "keyReleased": keyReleased, "keyTyped": keyTyped, "mouseMoved": mouseMoved, "mouseDragged": mouseDragged, "mousePressed": mousePressed, "mouseReleased": mouseReleased, "mouseClicked": mouseClicked, "doubleClicked": doubleClicked, "mouseWheel": mouseWheel, "touchStarted": touchStarted, "touchMoved": touchMoved, "touchEnded": touchEnded, "windowResized": windowResized, } start_p5(preload, setup, draw, event_functions) `; function runCode() { let code = [ placeholder, userCode, wrapperContent, startCode, ].join('\n'); if (window.instance) { window.instance.canvas.remove(); } console.log("Python execution output:"); window.pyodide.runPython(code); } async function main() { const config = { indexURL : "https://cdn.jsdelivr.net/pyodide/v0.18.1/full/", fullStdLib: false, } window.pyodide = await loadPyodide(config); // Pyodide is now ready to use... console.log(window.pyodide.runPython(` import io, code, sys from js import p5, window, document print(sys.version) `)); window.runSketchCode = (code) => { userCode = code; runCode(); } runCode(); }; // async method main(); ================================================ FILE: docs/examples/pyodide/sketch_009/index.html ================================================ sketch_009 - pyp5js

Python code here.

from random import choice

images = []

def setup():
    global images

    createP("Click to add a new image")
    createCanvas(600, 600)
    background(200)
    images = [
        loadImage('smile.png'),
        loadImage('alien.png'),
        loadImage('rainbow.png'),
    ]


def mousePressed():
    x, y = mouseX, mouseY
    img = choice(images)
    image(img, x, y)


def draw():
    pass
================================================ FILE: docs/examples/pyodide/sketch_009/sketch_009.py ================================================ from random import choice images = [] def setup(): global images createP("Click to add a new image") createCanvas(600, 600) background(200) images = [ loadImage('smile.png'), loadImage('alien.png'), loadImage('rainbow.png'), ] def mousePressed(): x, y = mouseX, mouseY img = choice(images) image(img, x, y) def draw(): pass ================================================ FILE: docs/examples/pyodide/sketch_009/static/p5.js ================================================ /*! p5.js v1.0.0 February 29, 2020 */ !function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).p5=e()}}(function(){return function o(a,s,l){function u(t,e){if(!s[t]){if(!a[t]){var r="function"==typeof require&&require;if(!e&&r)return r(t,!0);if(h)return h(t,!0);var i=new Error("Cannot find module '"+t+"'");throw i.code="MODULE_NOT_FOUND",i}var n=s[t]={exports:{}};a[t][0].call(n.exports,function(e){return u(a[t][1][e]||e)},n,n.exports,o,a,s,l)}return s[t].exports}for(var h="function"==typeof require&&require,e=0;e>16&255,a[s++]=t>>8&255,a[s++]=255&t;2===o&&(t=u[e.charCodeAt(r)]<<2|u[e.charCodeAt(r+1)]>>4,a[s++]=255&t);1===o&&(t=u[e.charCodeAt(r)]<<10|u[e.charCodeAt(r+1)]<<4|u[e.charCodeAt(r+2)]>>2,a[s++]=t>>8&255,a[s++]=255&t);return a},r.fromByteArray=function(e){for(var t,r=e.length,i=r%3,n=[],o=0,a=r-i;o>2]+s[t<<4&63]+"==")):2==i&&(t=(e[r-2]<<8)+e[r-1],n.push(s[t>>10]+s[t>>4&63]+s[t<<2&63]+"="));return n.join("")};for(var s=[],u=[],h="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=0,o=i.length;n>18&63]+s[n>>12&63]+s[n>>6&63]+s[63&n]);return o.join("")}u["-".charCodeAt(0)]=62,u["_".charCodeAt(0)]=63},{}],20:[function(e,t,r){},{}],21:[function(N,e,F){(function(c){"use strict";var i=N("base64-js"),o=N("ieee754"),e="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;F.Buffer=c,F.SlowBuffer=function(e){+e!=e&&(e=0);return c.alloc(+e)},F.INSPECT_MAX_BYTES=50;var r=2147483647;function a(e){if(r>>1;case"base64":return O(e).length;default:if(n)return i?-1:R(e).length;t=(""+t).toLowerCase(),n=!0}}function d(e,t,r){var i=e[t];e[t]=e[r],e[r]=i}function p(e,t,r,i,n){if(0===e.length)return-1;if("string"==typeof r?(i=r,r=0):2147483647=e.length){if(n)return-1;r=e.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof t&&(t=c.from(t,i)),c.isBuffer(t))return 0===t.length?-1:m(e,t,r,i,n);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):m(e,[t],r,i,n);throw new TypeError("val must be string, number or Buffer")}function m(e,t,r,i,n){var o,a=1,s=e.length,l=t.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(e.length<2||t.length<2)return-1;s/=a=2,l/=2,r/=2}function u(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(n){var h=-1;for(o=r;o>8,n=r%256,o.push(n),o.push(i);return o}(t,e.length-r),e,r,i)}function b(e,t,r){return 0===t&&r===e.length?i.fromByteArray(e):i.fromByteArray(e.slice(t,r))}function _(e,t,r){r=Math.min(e.length,r);for(var i=[],n=t;n>>10&1023|55296),h=56320|1023&h),i.push(h),n+=c}return function(e){var t=e.length;if(t<=x)return String.fromCharCode.apply(String,e);var r="",i=0;for(;ithis.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e=e||"utf8";;)switch(e){case"hex":return M(this,t,r);case"utf8":case"utf-8":return _(this,t,r);case"ascii":return w(this,t,r);case"latin1":case"binary":return S(this,t,r);case"base64":return b(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,t,r);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}.apply(this,arguments)},c.prototype.equals=function(e){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===c.compare(this,e)},c.prototype.inspect=function(){var e="",t=F.INSPECT_MAX_BYTES;return e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(e+=" ... "),""},e&&(c.prototype[e]=c.prototype.inspect),c.prototype.compare=function(e,t,r,i,n){if(A(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),t<0||r>e.length||i<0||n>this.length)throw new RangeError("out of range index");if(n<=i&&r<=t)return 0;if(n<=i)return-1;if(r<=t)return 1;if(this===e)return 0;for(var o=(n>>>=0)-(i>>>=0),a=(r>>>=0)-(t>>>=0),s=Math.min(o,a),l=this.slice(i,n),u=e.slice(t,r),h=0;h>>=0,isFinite(r)?(r>>>=0,void 0===i&&(i="utf8")):(i=r,r=void 0)}var n=this.length-t;if((void 0===r||nthis.length)throw new RangeError("Attempt to write outside buffer bounds");i=i||"utf8";for(var o,a,s,l,u,h,c=!1;;)switch(i){case"hex":return g(this,e,t,r);case"utf8":case"utf-8":return u=t,h=r,D(R(e,(l=this).length-u),l,u,h);case"ascii":return v(this,e,t,r);case"latin1":case"binary":return v(this,e,t,r);case"base64":return o=this,a=t,s=r,D(O(e),o,a,s);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return y(this,e,t,r);default:if(c)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),c=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var x=4096;function w(e,t,r){var i="";r=Math.min(e.length,r);for(var n=t;ne.length)throw new RangeError("Index out of range")}function P(e,t,r,i){if(r+i>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function L(e,t,r,i,n){return t=+t,r>>>=0,n||P(e,0,r,4),o.write(e,t,r,i,23,4),r+4}function k(e,t,r,i,n){return t=+t,r>>>=0,n||P(e,0,r,8),o.write(e,t,r,i,52,8),r+8}c.prototype.slice=function(e,t){var r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):r>>=0,t>>>=0,r||T(e,t,this.length);for(var i=this[e],n=1,o=0;++o>>=0,t>>>=0,r||T(e,t,this.length);for(var i=this[e+--t],n=1;0>>=0,t||T(e,1,this.length),this[e]},c.prototype.readUInt16LE=function(e,t){return e>>>=0,t||T(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUInt16BE=function(e,t){return e>>>=0,t||T(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUInt32LE=function(e,t){return e>>>=0,t||T(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUInt32BE=function(e,t){return e>>>=0,t||T(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||T(e,t,this.length);for(var i=this[e],n=1,o=0;++o>>=0,t>>>=0,r||T(e,t,this.length);for(var i=t,n=1,o=this[e+--i];0>>=0,t||T(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){e>>>=0,t||T(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(e,t){e>>>=0,t||T(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(e,t){return e>>>=0,t||T(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return e>>>=0,t||T(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readFloatLE=function(e,t){return e>>>=0,t||T(e,4,this.length),o.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return e>>>=0,t||T(e,4,this.length),o.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return e>>>=0,t||T(e,8,this.length),o.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return e>>>=0,t||T(e,8,this.length),o.read(this,e,!1,52,8)},c.prototype.writeUIntLE=function(e,t,r,i){e=+e,t>>>=0,r>>>=0,i||C(this,e,t,r,Math.pow(2,8*r)-1,0);var n=1,o=0;for(this[t]=255&e;++o>>=0,r>>>=0,i||C(this,e,t,r,Math.pow(2,8*r)-1,0);var n=r-1,o=1;for(this[t+n]=255&e;0<=--n&&(o*=256);)this[t+n]=e/o&255;return t+r},c.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,1,255,0),this[t]=255&e,t+1},c.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},c.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeIntLE=function(e,t,r,i){if(e=+e,t>>>=0,!i){var n=Math.pow(2,8*r-1);C(this,e,t,r,n-1,-n)}var o=0,a=1,s=0;for(this[t]=255&e;++o>0)-s&255;return t+r},c.prototype.writeIntBE=function(e,t,r,i){if(e=+e,t>>>=0,!i){var n=Math.pow(2,8*r-1);C(this,e,t,r,n-1,-n)}var o=r-1,a=1,s=0;for(this[t+o]=255&e;0<=--o&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+r},c.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},c.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeFloatLE=function(e,t,r){return L(this,e,t,!0,r)},c.prototype.writeFloatBE=function(e,t,r){return L(this,e,t,!1,r)},c.prototype.writeDoubleLE=function(e,t,r){return k(this,e,t,!0,r)},c.prototype.writeDoubleBE=function(e,t,r){return k(this,e,t,!1,r)},c.prototype.copy=function(e,t,r,i){if(!c.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r=r||0,i||0===i||(i=this.length),t>=e.length&&(t=e.length),t=t||0,0=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t>>=0,r=void 0===r?this.length:r>>>0,"number"==typeof(e=e||0))for(o=t;o>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function O(e){return i.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(t,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function D(e,t,r,i){for(var n=0;n=t.length||n>=e.length);++n)t[n+r]=e[n];return n}function A(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function I(e){return e!=e}var U=function(){for(var e="0123456789abcdef",t=new Array(256),r=0;r<16;++r)for(var i=16*r,n=0;n<16;++n)t[i+n]=e[r]+e[n];return t}()}).call(this,N("buffer").Buffer)},{"base64-js":19,buffer:21,ieee754:30}],22:[function(e,t,r){"use strict";t.exports=e("./").polyfill()},{"./":23}],23:[function(z,r,i){(function(j,V){var e,t;e=this,t=function(){"use strict";function l(e){return"function"==typeof e}var r=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},i=0,t=void 0,n=void 0,a=function(e,t){f[i]=e,f[i+1]=t,2===(i+=2)&&(n?n(d):y())};var e="undefined"!=typeof window?window:void 0,o=e||{},s=o.MutationObserver||o.WebKitMutationObserver,u="undefined"==typeof self&&void 0!==j&&"[object process]"==={}.toString.call(j),h="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function c(){var e=setTimeout;return function(){return e(d,1)}}var f=new Array(1e3);function d(){for(var e=0;e":">",'"':""","'":"'","/":"/"};function S(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,function(e){return w[e]}):e}var M=function(){function i(e){var t,r=1=this.maxReplaces)break}for(a=0;r=this.regexp.exec(e);){if(void 0===(i=h(r[1].trim())))if("function"==typeof c){var d=c(e,r,t);i="string"==typeof d?d:""}else this.logger.warn("missed to pass in variable ".concat(r[1]," for interpolating ").concat(e)),i="";else"string"==typeof i||this.useRawValueToEscape||(i=v(i));if(i=this.escapeValue?u(this.escape(i)):u(i),e=e.replace(r[0],i),this.regexp.lastIndex=0,++a>=this.maxReplaces)break}return e}},{key:"nest",value:function(e,t,r){var i,n,o=D({},2>1,h=-7,c=r?n-1:0,f=r?-1:1,d=e[t+c];for(c+=f,o=d&(1<<-h)-1,d>>=-h,h+=s;0>=-h,h+=i;0>1,f=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,d=i?0:o-1,p=i?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=h):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),2<=(t+=1<=a+c?f/l:f*Math.pow(2,1-c))*l&&(a++,l/=2),h<=a+c?(s=0,a=h):1<=a+c?(s=(t*l-1)*Math.pow(2,n),a+=c):(s=t*Math.pow(2,c-1)*Math.pow(2,n),a=0));8<=n;e[r+d]=255&s,d+=p,s/=256,n-=8);for(a=a<Math.abs(e[0])&&(t=1),Math.abs(e[2])>Math.abs(e[t])&&(t=2),t}var C=4e150;function P(e,t){e.f+=t.f,e.b.f+=t.b.f}function u(e,t,r){return e=e.a,t=t.a,r=r.a,t.b.a===e?r.b.a===e?v(t.a,r.a)?b(r.b.a,t.a,r.a)<=0:0<=b(t.b.a,r.a,t.a):b(r.b.a,e,r.a)<=0:r.b.a===e?0<=b(t.b.a,e,t.a):(t=y(t.b.a,e,t.a),(e=y(r.b.a,e,r.a))<=t)}function L(e){e.a.i=null;var t=e.e;t.a.c=t.c,t.c.a=t.a,e.e=null}function h(e,t){c(e.a),e.c=!1,(e.a=t).i=e}function k(e){for(var t=e.a.a;(e=fe(e)).a.a===t;);return e.c&&(h(e,t=f(ce(e).a.b,e.a.e)),e=fe(e)),e}function R(e,t,r){var i=new he;return i.a=r,i.e=W(e.f,t.e,i),r.i=i}function O(e,t){switch(e.s){case 100130:return 0!=(1&t);case 100131:return 0!==t;case 100132:return 0>1]],s[a[u]])?le(r,u):ue(r,u)),s[o]=null,l[o]=r.b,r.b=o}else for(r.c[-(o+1)]=null;0Math.max(a.a,l.a))return!1;if(v(o,a)){if(0i.f&&(i.f*=2,i.c=oe(i.c,i.f+1)),0===i.b?r=n:(r=i.b,i.b=i.c[i.b]),i.e[r]=t,i.c[r]=n,i.d[n]=r,i.h&&ue(i,n),r}return i=e.a++,e.c[i]=t,-(i+1)}function ie(e){if(0===e.a)return se(e.b);var t=e.c[e.d[e.a-1]];if(0!==e.b.a&&v(ae(e.b),t))return se(e.b);for(;--e.a,0e.a||v(i[a],i[l])){n[r[o]=a]=o;break}n[r[o]=l]=o,o=s}}function ue(e,t){for(var r=e.d,i=e.e,n=e.c,o=t,a=r[o];;){var s=o>>1,l=r[s];if(0==s||v(i[l],i[a])){n[r[o]=a]=o;break}n[r[o]=l]=o,o=s}}function he(){this.e=this.a=null,this.f=0,this.c=this.b=this.h=this.d=!1}function ce(e){return e.e.c.b}function fe(e){return e.e.a.b}(i=q.prototype).x=function(){Y(this,0)},i.B=function(e,t){switch(e){case 100142:return;case 100140:switch(t){case 100130:case 100131:case 100132:case 100133:case 100134:return void(this.s=t)}break;case 100141:return void(this.m=!!t);default:return void Z(this,100900)}Z(this,100901)},i.y=function(e){switch(e){case 100142:return 0;case 100140:return this.s;case 100141:return this.m;default:Z(this,100900)}return!1},i.A=function(e,t,r){this.j[0]=e,this.j[1]=t,this.j[2]=r},i.z=function(e,t){var r=t||null;switch(e){case 100100:case 100106:this.h=r;break;case 100104:case 100110:this.l=r;break;case 100101:case 100107:this.k=r;break;case 100102:case 100108:this.i=r;break;case 100103:case 100109:this.p=r;break;case 100105:case 100111:this.o=r;break;case 100112:this.r=r;break;default:Z(this,100900)}},i.C=function(e,t){var r=!1,i=[0,0,0];Y(this,2);for(var n=0;n<3;++n){var o=e[n];o<-1e150&&(o=-1e150,r=!0),1e150n[u]&&(n[u]=h,a[u]=l)}if(l=0,n[1]-o[1]>n[0]-o[0]&&(l=1),n[2]-o[2]>n[l]-o[l]&&(l=2),o[l]>=n[l])i[0]=0,i[1]=0,i[2]=1;else{for(n=0,o=s[l],a=a[l],s=[0,0,0],o=[o.g[0]-a.g[0],o.g[1]-a.g[1],o.g[2]-a.g[2]],u=[0,0,0],l=r.e;l!==r;l=l.e)u[0]=l.g[0]-a.g[0],u[1]=l.g[1]-a.g[1],u[2]=l.g[2]-a.g[2],s[0]=o[1]*u[2]-o[2]*u[1],s[1]=o[2]*u[0]-o[0]*u[2],s[2]=o[0]*u[1]-o[1]*u[0],n<(h=s[0]*s[0]+s[1]*s[1]+s[2]*s[2])&&(n=h,i[0]=s[0],i[1]=s[1],i[2]=s[2]);n<=0&&(i[0]=i[1]=i[2]=0,i[T(o)]=1)}r=!0}for(s=T(i),l=this.b.c,n=(s+1)%3,a=(s+2)%3,s=0>=l,h-=l,g!=o){if(g==a)break;for(var v=g>8,++y;var _=b;if(i>=8;null!==m&&s<4096&&(p[s++]=m<<8|_,u+1<=s&&l<12&&(++l,u=u<<1|1)),m=g}else s=1+a,u=(1<<(l=n+1))-1,m=null}return f!==i&&console.log("Warning, gif stream shorter than expected."),r}try{r.GifWriter=function(v,e,t,r){var y=0,i=void 0===(r=void 0===r?{}:r).loop?null:r.loop,b=void 0===r.palette?null:r.palette;if(e<=0||t<=0||65535>=1;)++n;if(a=1<>8&255,v[y++]=255&t,v[y++]=t>>8&255,v[y++]=(null!==b?128:0)|n,v[y++]=o,v[y++]=0,null!==b)for(var s=0,l=b.length;s>16&255,v[y++]=u>>8&255,v[y++]=255&u}if(null!==i){if(i<0||65535>8&255,v[y++]=0}var x=!1;this.addFrame=function(e,t,r,i,n,o){if(!0===x&&(--y,x=!1),o=void 0===o?{}:o,e<0||t<0||65535>=1;)++u;l=1<>8&255,v[y++]=d,v[y++]=0),v[y++]=44,v[y++]=255&e,v[y++]=e>>8&255,v[y++]=255&t,v[y++]=t>>8&255,v[y++]=255&r,v[y++]=r>>8&255,v[y++]=255&i,v[y++]=i>>8&255,v[y++]=!0===a?128|u-1:0,!0===a)for(var p=0,m=s.length;p>16&255,v[y++]=g>>8&255,v[y++]=255&g}return y=function(t,r,e,i){t[r++]=e;var n=r++,o=1<>=8,h-=8,r===n+256&&(t[n]=255,n=r++)}function d(e){c|=e<>=8,h-=8,r===n+256&&(t[n]=255,n=r++);4096===l?(d(o),l=1+s,u=e+1,m={}):(1<>7,n=1<<1+(7&r);x[e++],x[e++];var o=null,a=null;i&&(o=e,e+=3*(a=n));var s=!0,l=[],u=0,h=null,c=0,f=null;for(this.width=w,this.height=t;s&&e>2&7,e++;break;case 254:for(;;){if(!(0<=(C=x[e++])))throw Error("Invalid block size");if(0===C)break;e+=C}break;default:throw new Error("Unknown graphic control label: 0x"+x[e-1].toString(16))}break;case 44:var p=x[e++]|x[e++]<<8,m=x[e++]|x[e++]<<8,g=x[e++]|x[e++]<<8,v=x[e++]|x[e++]<<8,y=x[e++],b=y>>6&1,_=1<<1+(7&y),S=o,M=a,E=!1;if(y>>7){E=!0;S=e,e+=3*(M=_)}var T=e;for(e++;;){var C;if(!(0<=(C=x[e++])))throw Error("Invalid block size");if(0===C)break;e+=C}l.push({x:p,y:m,width:g,height:v,has_local_palette:E,palette_offset:S,palette_size:M,data_offset:T,data_length:e-T,transparent_index:h,interlaced:!!b,delay:u,disposal:c});break;case 59:s=!1;break;default:throw new Error("Unknown gif block: 0x"+x[e-1].toString(16))}this.numFrames=function(){return l.length},this.loopCount=function(){return f},this.frameInfo=function(e){if(e<0||e>=l.length)throw new Error("Frame index out of range.");return l[e]},this.decodeAndBlitFrameBGRA=function(e,t){var r=this.frameInfo(e),i=r.width*r.height,n=new Uint8Array(i);P(x,r.data_offset,n,i);var o=r.palette_offset,a=r.transparent_index;null===a&&(a=256);var s=r.width,l=w-s,u=s,h=4*(r.y*w+r.x),c=4*((r.y+r.height)*w+r.x),f=h,d=4*l;!0===r.interlaced&&(d+=4*w*7);for(var p=8,m=0,g=n.length;m>=1)),v===a)f+=4;else{var y=x[o+3*v],b=x[o+3*v+1],_=x[o+3*v+2];t[f++]=_,t[f++]=b,t[f++]=y,t[f++]=255}--u}},this.decodeAndBlitFrameRGBA=function(e,t){var r=this.frameInfo(e),i=r.width*r.height,n=new Uint8Array(i);P(x,r.data_offset,n,i);var o=r.palette_offset,a=r.transparent_index;null===a&&(a=256);var s=r.width,l=w-s,u=s,h=4*(r.y*w+r.x),c=4*((r.y+r.height)*w+r.x),f=h,d=4*l;!0===r.interlaced&&(d+=4*w*7);for(var p=8,m=0,g=n.length;m>=1)),v===a)f+=4;else{var y=x[o+3*v],b=x[o+3*v+1],_=x[o+3*v+2];t[f++]=y,t[f++]=b,t[f++]=_,t[f++]=255}--u}}}}catch(e){}},{}],33:[function(jr,t,r){(function(Gr){var e;e=this,function(E){"use strict";function e(e){if(null==this)throw TypeError();var t=String(this),r=t.length,i=e?Number(e):0;if(i!=i&&(i=0),!(i<0||r<=i)){var n,o=t.charCodeAt(i);return 55296<=o&&o<=56319&&i+1>>=1,t}function _(e,t,r){if(!t)return r;for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<>>16-t;return e.tag>>>=t,e.bitcount-=t,i+r}function x(e,t){for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<>>=1,++n,r+=t.table[n],0<=(i-=t.table[n]););return e.tag=o,e.bitcount-=n,t.trans[r+i]}function w(e,t,r){var i,n,o,a,s,l;for(i=_(e,5,257),n=_(e,5,1),o=_(e,4,4),a=0;a<19;++a)g[a]=0;for(a=0;athis.x2&&(this.x2=e)),"number"==typeof t&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=t,this.y2=t),tthis.y2&&(this.y2=t))},C.prototype.addX=function(e){this.addPoint(e,null)},C.prototype.addY=function(e){this.addPoint(null,e)},C.prototype.addBezier=function(e,t,r,i,n,o,a,s){var l=this,u=[e,t],h=[r,i],c=[n,o],f=[a,s];this.addPoint(e,t),this.addPoint(a,s);for(var d=0;d<=1;d++){var p=6*u[d]-12*h[d]+6*c[d],m=-3*u[d]+9*h[d]-9*c[d]+3*f[d],g=3*h[d]-3*u[d];if(0!=m){var v=Math.pow(p,2)-4*g*m;if(!(v<0)){var y=(-p+Math.sqrt(v))/(2*m);0>8&255,255&e]},A.USHORT=U(2),D.SHORT=function(e){return 32768<=e&&(e=-(65536-e)),[e>>8&255,255&e]},A.SHORT=U(2),D.UINT24=function(e){return[e>>16&255,e>>8&255,255&e]},A.UINT24=U(3),D.ULONG=function(e){return[e>>24&255,e>>16&255,e>>8&255,255&e]},A.ULONG=U(4),D.LONG=function(e){return R<=e&&(e=-(2*R-e)),[e>>24&255,e>>16&255,e>>8&255,255&e]},A.LONG=U(4),D.FIXED=D.ULONG,A.FIXED=A.ULONG,D.FWORD=D.SHORT,A.FWORD=A.SHORT,D.UFWORD=D.USHORT,A.UFWORD=A.USHORT,D.LONGDATETIME=function(e){return[0,0,0,0,e>>24&255,e>>16&255,e>>8&255,255&e]},A.LONGDATETIME=U(8),D.TAG=function(e){return k.argument(4===e.length,"Tag should be exactly 4 ASCII characters."),[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]},A.TAG=U(4),D.Card8=D.BYTE,A.Card8=A.BYTE,D.Card16=D.USHORT,A.Card16=A.USHORT,D.OffSize=D.BYTE,A.OffSize=A.BYTE,D.SID=D.USHORT,A.SID=A.USHORT,D.NUMBER=function(e){return-107<=e&&e<=107?[e+139]:108<=e&&e<=1131?[247+((e-=108)>>8),255&e]:-1131<=e&&e<=-108?[251+((e=-e-108)>>8),255&e]:-32768<=e&&e<=32767?D.NUMBER16(e):D.NUMBER32(e)},A.NUMBER=function(e){return D.NUMBER(e).length},D.NUMBER16=function(e){return[28,e>>8&255,255&e]},A.NUMBER16=U(3),D.NUMBER32=function(e){return[29,e>>24&255,e>>16&255,e>>8&255,255&e]},A.NUMBER32=U(5),D.REAL=function(e){var t=e.toString(),r=/\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec(t);if(r){var i=parseFloat("1e"+((r[2]?+r[2]:0)+r[1].length));t=(Math.round(e*i)/i).toString()}for(var n="",o=0,a=t.length;o>8&255,t[t.length]=255&i}return t},A.UTF16=function(e){return 2*e.length};var N={"x-mac-croatian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈ƫȅ ÀÃÕŒœĐ—“”‘’÷◊©⁄€‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ","x-mac-cyrillic":"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю","x-mac-gaelic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØḂ±≤≥ḃĊċḊḋḞḟĠġṀæøṁṖṗɼƒſṠ«»… ÀÃÕŒœ–—“”‘’ṡẛÿŸṪ€‹›Ŷŷṫ·Ỳỳ⁊ÂÊÁËÈÍÎÏÌÓÔ♣ÒÚÛÙıÝýŴŵẄẅẀẁẂẃ","x-mac-greek":"Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦€ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ­","x-mac-icelandic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüݰ¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-inuit":"ᐃᐄᐅᐆᐊᐋᐱᐲᐳᐴᐸᐹᑉᑎᑏᑐᑑᑕᑖᑦᑭᑮᑯᑰᑲᑳᒃᒋᒌᒍᒎᒐᒑ°ᒡᒥᒦ•¶ᒧ®©™ᒨᒪᒫᒻᓂᓃᓄᓅᓇᓈᓐᓯᓰᓱᓲᓴᓵᔅᓕᓖᓗᓘᓚᓛᓪᔨᔩᔪᔫᔭ… ᔮᔾᕕᕖᕗ–—“”‘’ᕘᕙᕚᕝᕆᕇᕈᕉᕋᕌᕐᕿᖀᖁᖂᖃᖄᖅᖏᖐᖑᖒᖓᖔᖕᙱᙲᙳᙴᙵᙶᖖᖠᖡᖢᖣᖤᖥᖦᕼŁł","x-mac-ce":"ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ",macintosh:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-romanian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂȘ∞±≤≥¥µ∂∑∏π∫ªºΩăș¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›Țț‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-turkish":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙˆ˜¯˘˙˚¸˝˛ˇ"};O.MACSTRING=function(e,t,r,i){var n=N[i];if(void 0!==n){for(var o="",a=0;a>8&255,l+256&255)}return o}D.MACSTRING=function(e,t){var r=function(e){if(!F)for(var t in F={},N)F[t]=new String(t);var r=F[e];if(void 0!==r){if(B){var i=B.get(r);if(void 0!==i)return i}var n=N[e];if(void 0!==n){for(var o={},a=0;a>8,t[c+1]=255&f,t=t.concat(i[h])}return t},A.TABLE=function(e){for(var t=0,r=e.fields.length,i=0;i>1,t.skip("uShort",3),e.glyphIndexMap={};for(var a=new se.Parser(r,i+n+14),s=new se.Parser(r,i+n+16+2*o),l=new se.Parser(r,i+n+16+4*o),u=new se.Parser(r,i+n+16+6*o),h=i+n+16+8*o,c=0;c>4,o=15&i;if(15==n)break;if(t+=r[n],15==o)break;t+=r[o]}return parseFloat(t)}(e);if(32<=t&&t<=246)return t-139;if(247<=t&&t<=250)return 256*(t-247)+e.parseByte()+108;if(251<=t&&t<=254)return 256*-(t-251)-e.parseByte()-108;throw new Error("Invalid b0 "+t)}function Te(e,t,r){t=void 0!==t?t:0;var i=new se.Parser(e,t),n=[],o=[];for(r=void 0!==r?r:e.length;i.relativeOffset>1,T.length=0,P=!0}return function e(t){for(var r,i,n,o,a,s,l,u,h,c,f,d,p=0;pMath.abs(d-R)?k=f+T.shift():R=d+T.shift(),E.curveTo(y,b,_,x,l,u),E.curveTo(h,c,f,d,k,R);break;default:console.log("Glyph "+v.index+": unknown operator 1200"+m),T.length=0}break;case 14:0>3;break;case 21:2>16),p+=2;break;case 29:a=T.pop()+g.gsubrsBias,(s=g.gsubrs[a])&&e(s);break;case 30:for(;0=r.begin&&e=fe.length){var a=i.parseChar();r.names.push(i.parseString(a))}break;case 2.5:r.numberOfGlyphs=i.parseUShort(),r.offset=new Array(r.numberOfGlyphs);for(var s=0;st.value.tag?1:-1}),t.fields=t.fields.concat(i),t.fields=t.fields.concat(n),t}function gt(e,t,r){for(var i=0;i 123 are reserved for internal usage");d|=1<>>1,o=e[n].tag;if(o===t)return n;o>>1,o=e[n];if(o===t)return n;o>>1,a=(r=e[o]).start;if(a===t)return r;a(r=e[i-1]).end?0:r}function xt(e,t){this.font=e,this.tableName=t}function wt(e){xt.call(this,e,"gpos")}function St(e){xt.call(this,e,"gsub")}function Mt(e,t){var r=e.length;if(r!==t.length)return!1;for(var i=0;it.points.length-1||i.matchedPoints[1]>n.points.length-1)throw Error("Matched points out of range in "+t.name);var a=t.points[i.matchedPoints[0]],s=n.points[i.matchedPoints[1]],l={xScale:i.xScale,scale01:i.scale01,scale10:i.scale10,yScale:i.yScale,dx:0,dy:0};s=kt([s],l)[0],l.dx=a.x-s.x,l.dy=a.y-s.y,o=kt(n.points,l)}t.points=t.points.concat(o)}}return Rt(t.points)}(wt.prototype=xt.prototype={searchTag:yt,binSearch:bt,getTable:function(e){var t=this.font.tables[this.tableName];return!t&&e&&(t=this.font.tables[this.tableName]=this.createDefaultTable()),t},getScriptNames:function(){var e=this.getTable();return e?e.scripts.map(function(e){return e.tag}):[]},getDefaultScriptName:function(){var e=this.getTable();if(e){for(var t=!1,r=0;r=s[u-1].tag,"Features must be added in alphabetical order."),o={tag:r,feature:{params:0,lookupListIndexes:[]}},s.push(o),a.push(u),o.feature}}},getLookupTables:function(e,t,r,i,n){var o=this.getFeatureTable(e,t,r,n),a=[];if(o){for(var s,l=o.lookupListIndexes,u=this.font.tables[this.tableName].lookups,h=0;h",s),t.stack.push(Math.round(64*s))}function vr(e,t){var r=t.stack,i=r.pop(),n=t.fv,o=t.pv,a=t.ppem,s=t.deltaBase+16*(e-1),l=t.deltaShift,u=t.z0;E.DEBUG&&console.log(t.step,"DELTAP["+e+"]",i,r);for(var h=0;h>4)===a){var d=(15&f)-8;0<=d&&d++,E.DEBUG&&console.log(t.step,"DELTAPFIX",c,"by",d*l);var p=u[c];n.setRelative(p,p,d*l,o)}}}function yr(e,t){var r=t.stack,i=r.pop();E.DEBUG&&console.log(t.step,"ROUND[]"),r.push(64*t.round(i/64))}function br(e,t){var r=t.stack,i=r.pop(),n=t.ppem,o=t.deltaBase+16*(e-1),a=t.deltaShift;E.DEBUG&&console.log(t.step,"DELTAC["+e+"]",i,r);for(var s=0;s>4)===n){var h=(15&u)-8;0<=h&&h++;var c=h*a;E.DEBUG&&console.log(t.step,"DELTACFIX",l,"by",c),t.cvt[l]+=c}}}function _r(e,t){var r,i,n=t.stack,o=n.pop(),a=n.pop(),s=t.z2[o],l=t.z1[a];E.DEBUG&&console.log(t.step,"SDPVTL["+e+"]",o,a),i=e?(r=s.y-l.y,l.x-s.x):(r=l.x-s.x,l.y-s.y),t.dpv=Zt(r,i)}function xr(e,t){var r=t.stack,i=t.prog,n=t.ip;E.DEBUG&&console.log(t.step,"PUSHB["+e+"]");for(var o=0;o":"_")+(i?"R":"_")+(0===n?"Gr":1===n?"Bl":2===n?"Wh":"")+"]",e?c+"("+o.cvt[c]+","+u+")":"",f,"(d =",a,"->",l*s,")"),o.rp1=o.rp0,o.rp2=f,t&&(o.rp0=f)}Ft.prototype.exec=function(e,t){if("number"!=typeof t)throw new Error("Point size is not a number!");if(!(2",i),s.interpolate(c,o,a,l),s.touch(c)}e.loop=1},dr.bind(void 0,0),dr.bind(void 0,1),function(e){for(var t=e.stack,r=e.rp0,i=e.z0[r],n=e.loop,o=e.fv,a=e.pv,s=e.z1;n--;){var l=t.pop(),u=s[l];E.DEBUG&&console.log(e.step,(1=a.width||t>=a.height?[0,0,0,0]:this._getPixel(e,t);var s=new l.default.Image(r,i);return s.canvas.getContext("2d").drawImage(a,e,t,r*o,i*o,0,0,r,i),s},l.default.Renderer.prototype.textLeading=function(e){return"number"==typeof e?(this._setProperty("_textLeading",e),this._pInst):this._textLeading},l.default.Renderer.prototype.textSize=function(e){return"number"==typeof e?(this._setProperty("_textSize",e),this._setProperty("_textLeading",e*y._DEFAULT_LEADMULT),this._applyTextProperties()):this._textSize},l.default.Renderer.prototype.textStyle=function(e){return e?(e!==y.NORMAL&&e!==y.ITALIC&&e!==y.BOLD&&e!==y.BOLDITALIC||this._setProperty("_textStyle",e),this._applyTextProperties()):this._textStyle},l.default.Renderer.prototype.textAscent=function(){return null===this._textAscent&&this._updateTextMetrics(),this._textAscent},l.default.Renderer.prototype.textDescent=function(){return null===this._textDescent&&this._updateTextMetrics(),this._textDescent},l.default.Renderer.prototype.textAlign=function(e,t){return void 0!==e?(this._setProperty("_textAlign",e),void 0!==t&&this._setProperty("_textBaseline",t),this._applyTextProperties()):{horizontal:this._textAlign,vertical:this._textBaseline}},l.default.Renderer.prototype.text=function(e,t,r,i,n){var o,a,s,l,u,h,c,f,d=this._pInst,p=Number.MAX_VALUE;if((this._doFill||this._doStroke)&&void 0!==e){if("string"!=typeof e&&(e=e.toString()),o=(e=e.replace(/(\t)/g," ")).split("\n"),void 0!==i){for(s=f=0;ss.HALF_PI&&e<=3*s.HALF_PI?Math.atan(r/i*Math.tan(e))+s.PI:Math.atan(r/i*Math.tan(e))+s.TWO_PI,t=t<=s.HALF_PI?Math.atan(r/i*Math.tan(t)):t>s.HALF_PI&&t<=3*s.HALF_PI?Math.atan(r/i*Math.tan(t))+s.PI:Math.atan(r/i*Math.tan(t))+s.TWO_PI),tv||Math.abs(this.accelerationY-this.pAccelerationY)>v||Math.abs(this.accelerationZ-this.pAccelerationZ)>v)&&e();var t=this.deviceTurned||window.deviceTurned;if("function"==typeof t){var r=this.rotationX+180,i=this.pRotationX+180,n=c+180;0>>24],i+=x[(16711680&C)>>16],n+=x[(65280&C)>>8],o+=x[255&C],r+=k[_],s++}w[l=T+y]=a/r,S[l]=i/r,M[l]=n/r,E[l]=o/r}T+=d}for(h=(u=-P)*d,b=T=0;b>>16,e[r+1]=(65280&t[i])>>>8,e[r+2]=255&t[i],e[r+3]=(4278190080&t[i])>>>24},O._toImageData=function(e){return e instanceof ImageData?e:e.getContext("2d").getImageData(0,0,e.width,e.height)},O._createImageData=function(e,t){return O._tmpCanvas=document.createElement("canvas"),O._tmpCtx=O._tmpCanvas.getContext("2d"),this._tmpCtx.createImageData(e,t)},O.apply=function(e,t,r){var i=e.getContext("2d"),n=i.getImageData(0,0,e.width,e.height),o=t(n,r);o instanceof ImageData?i.putImageData(o,0,0,0,0,e.width,e.height):i.putImageData(n,0,0,0,0,e.width,e.height)},O.threshold=function(e,t){var r=O._toPixels(e);void 0===t&&(t=.5);for(var i=Math.floor(255*t),n=0;n>8)/i,r[n+1]=255*(a*t>>8)/i,r[n+2]=255*(s*t>>8)/i}},O.dilate=function(e){for(var t,r,i,n,o,a,s,l,u,h,c,f,d,p,m,g,v,y=O._toPixels(e),b=0,_=y.length?y.length/4:0,x=new Int32Array(_);b<_;)for(r=(t=b)+e.width;b>16&255)+151*(i>>8&255)+28*(255&i))<(m=77*(c>>16&255)+151*(c>>8&255)+28*(255&c))&&(n=c,o=m),o<(p=77*((h=O._getARGB(y,a))>>16&255)+151*(h>>8&255)+28*(255&h))&&(n=h,o=p),o<(g=77*(f>>16&255)+151*(f>>8&255)+28*(255&f))&&(n=f,o=g),o<(v=77*(d>>16&255)+151*(d>>8&255)+28*(255&d))&&(n=d,o=v),x[b++]=n;O._setPixels(y,x)},O.erode=function(e){for(var t,r,i,n,o,a,s,l,u,h,c,f,d,p,m,g,v,y=O._toPixels(e),b=0,_=y.length?y.length/4:0,x=new Int32Array(_);b<_;)for(r=(t=b)+e.width;b>16&255)+151*(c>>8&255)+28*(255&c))<(o=77*(i>>16&255)+151*(i>>8&255)+28*(255&i))&&(n=c,o=m),(p=77*((h=O._getARGB(y,a))>>16&255)+151*(h>>8&255)+28*(255&h))>16&255)+151*(f>>8&255)+28*(255&f))>16&255)+151*(d>>8&255)+28*(255&d))=r){var i=Math.floor(t.timeDisplayed/r);if(t.timeDisplayed=0,t.displayIndex+=i,t.loopCount=Math.floor(t.displayIndex/t.numFrames),null!==t.loopLimit&&t.loopCount>=t.loopLimit)t.playing=!1;else{var n=t.displayIndex%t.numFrames;this.drawingContext.putImageData(t.frames[n].image,0,0),t.displayIndex=n,this.setModified(!0)}}}},n.default.Image.prototype._setProperty=function(e,t){this[e]=t,this.setModified(!0)},n.default.Image.prototype.loadPixels=function(){n.default.Renderer2D.prototype.loadPixels.call(this),this.setModified(!0)},n.default.Image.prototype.updatePixels=function(e,t,r,i){n.default.Renderer2D.prototype.updatePixels.call(this,e,t,r,i),this.setModified(!0)},n.default.Image.prototype.get=function(e,t,r,i){return n.default._validateParameters("p5.Image.get",arguments),n.default.Renderer2D.prototype.get.apply(this,arguments)},n.default.Image.prototype._getPixel=n.default.Renderer2D.prototype._getPixel,n.default.Image.prototype.set=function(e,t,r){n.default.Renderer2D.prototype.set.call(this,e,t,r),this.setModified(!0)},n.default.Image.prototype.resize=function(e,t){0===e&&0===t?(e=this.canvas.width,t=this.canvas.height):0===e?e=this.canvas.width*t/this.canvas.height:0===t&&(t=this.canvas.height*e/this.canvas.width),e=Math.floor(e),t=Math.floor(t);var r=document.createElement("canvas");if(r.width=e,r.height=t,this.gifProperties)for(var i=this.gifProperties,n=function(e,t){for(var r=0,i=0;i/g,">").replace(/"/g,""").replace(/'/g,"'")}function l(e,t){t&&!0!==t&&"true"!==t||(t="");var r="";return(e=e||"untitled")&&e.includes(".")&&(r=e.split(".").pop()),t&&r!==t&&(r=t,e="".concat(e,".").concat(r)),[e,r]}e("../core/error_helpers"),v.default.prototype.loadJSON=function(){for(var e=arguments.length,t=new Array(e),r=0;r"),n.print("");if(n.print(' '),n.print(""),n.print(""),n.print(" "),"0"!==o[0]){n.print(" ");for(var h=0;h".concat(c)),n.print(" ")}n.print(" ")}for(var f=0;f");for(var d=0;d".concat(p)),n.print(" ")}n.print(" ")}n.print("
"),n.print(""),n.print("")}n.close(),n.clear()},v.default.prototype.writeFile=function(e,t,r){var i="application/octet-stream";v.default.prototype._isSafari()&&(i="text/plain");var n=new Blob(e,{type:i});v.default.prototype.downloadFile(n,t,r)},v.default.prototype.downloadFile=function(e,t,r){var i=l(t,r),n=i[0];if(e instanceof Blob)s.default.saveAs(e,n);else{var o=document.createElement("a");if(o.href=e,o.download=n,o.onclick=function(e){var t;t=e,document.body.removeChild(t.target),e.stopPropagation()},o.style.display="none",document.body.appendChild(o),v.default.prototype._isSafari()){var a="Hello, Safari user! To download this file...\n";a+="1. Go to File --\x3e Save As.\n",a+='2. Choose "Page Source" as the Format.\n',a+='3. Name it with this extension: ."'.concat(i[1],'"'),alert(a)}o.click()}},v.default.prototype._checkFileExtension=l,v.default.prototype._isSafari=function(){return 0>>0},getSeed:function(){return t},rand:function(){return(r=(1664525*r+1013904223)%i)/i}});n.setSeed(e),_=new Array(4096);for(var o=0;o<4096;o++)_[o]=n.rand()};var o=n.default;r.default=o},{"../core/main":49}],82:[function(e,t,r){"use strict";function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i,l=(i=e("../core/main"))&&i.__esModule?i:{default:i},o=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==a(e)&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var o=i?Object.getOwnPropertyDescriptor(e,n):null;o&&(o.get||o.set)?Object.defineProperty(r,n,o):r[n]=e[n]}r.default=e,t&&t.set(e,r);return r}(e("../core/constants"));function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}l.default.Vector=function(e,t,r){var i,n,o;o=e instanceof l.default?(this.p5=e,i=t[0]||0,n=t[1]||0,t[2]||0):(i=e||0,n=t||0,r||0),this.x=i,this.y=n,this.z=o},l.default.Vector.prototype.toString=function(){return"p5.Vector Object : [".concat(this.x,", ").concat(this.y,", ").concat(this.z,"]")},l.default.Vector.prototype.set=function(e,t,r){return e instanceof l.default.Vector?(this.x=e.x||0,this.y=e.y||0,this.z=e.z||0):e instanceof Array?(this.x=e[0]||0,this.y=e[1]||0,this.z=e[2]||0):(this.x=e||0,this.y=t||0,this.z=r||0),this},l.default.Vector.prototype.copy=function(){return this.p5?new l.default.Vector(this.p5,[this.x,this.y,this.z]):new l.default.Vector(this.x,this.y,this.z)},l.default.Vector.prototype.add=function(e,t,r){return e instanceof l.default.Vector?(this.x+=e.x||0,this.y+=e.y||0,this.z+=e.z||0):e instanceof Array?(this.x+=e[0]||0,this.y+=e[1]||0,this.z+=e[2]||0):(this.x+=e||0,this.y+=t||0,this.z+=r||0),this};function u(e,t){return 0!==e&&(this.x=this.x%e),0!==t&&(this.y=this.y%t),this}function h(e,t,r){return 0!==e&&(this.x=this.x%e),0!==t&&(this.y=this.y%t),0!==r&&(this.z=this.z%r),this}l.default.Vector.prototype.rem=function(e,t,r){if(e instanceof l.default.Vector){if(Number.isFinite(e.x)&&Number.isFinite(e.y)&&Number.isFinite(e.z)){var i=parseFloat(e.x),n=parseFloat(e.y),o=parseFloat(e.z);h.call(this,i,n,o)}}else if(e instanceof Array)e.every(function(e){return Number.isFinite(e)})&&(2===e.length&&u.call(this,e[0],e[1]),3===e.length&&h.call(this,e[0],e[1],e[2]));else if(1===arguments.length){if(Number.isFinite(e)&&0!==e)return this.x=this.x%e,this.y=this.y%e,this.z=this.z%e,this}else if(2===arguments.length){var a=Array.prototype.slice.call(arguments);a.every(function(e){return Number.isFinite(e)})&&2===a.length&&u.call(this,a[0],a[1])}else if(3===arguments.length){var s=Array.prototype.slice.call(arguments);s.every(function(e){return Number.isFinite(e)})&&3===s.length&&h.call(this,s[0],s[1],s[2])}},l.default.Vector.prototype.sub=function(e,t,r){return e instanceof l.default.Vector?(this.x-=e.x||0,this.y-=e.y||0,this.z-=e.z||0):e instanceof Array?(this.x-=e[0]||0,this.y-=e[1]||0,this.z-=e[2]||0):(this.x-=e||0,this.y-=t||0,this.z-=r||0),this},l.default.Vector.prototype.mult=function(e){return"number"==typeof e&&isFinite(e)?(this.x*=e,this.y*=e,this.z*=e):console.warn("p5.Vector.prototype.mult:","n is undefined or not a finite number"),this},l.default.Vector.prototype.div=function(e){return"number"==typeof e&&isFinite(e)?0===e?console.warn("p5.Vector.prototype.div:","divide by 0"):(this.x/=e,this.y/=e,this.z/=e):console.warn("p5.Vector.prototype.div:","n is undefined or not a finite number"),this},l.default.Vector.prototype.mag=function(){return Math.sqrt(this.magSq())},l.default.Vector.prototype.magSq=function(){var e=this.x,t=this.y,r=this.z;return e*e+t*t+r*r},l.default.Vector.prototype.dot=function(e,t,r){return e instanceof l.default.Vector?this.dot(e.x,e.y,e.z):this.x*(e||0)+this.y*(t||0)+this.z*(r||0)},l.default.Vector.prototype.cross=function(e){var t=this.y*e.z-this.z*e.y,r=this.z*e.x-this.x*e.z,i=this.x*e.y-this.y*e.x;return this.p5?new l.default.Vector(this.p5,[t,r,i]):new l.default.Vector(t,r,i)},l.default.Vector.prototype.dist=function(e){return e.copy().sub(this).mag()},l.default.Vector.prototype.normalize=function(){var e=this.mag();return 0!==e&&this.mult(1/e),this},l.default.Vector.prototype.limit=function(e){var t=this.magSq();return e*e>>0},n.default.prototype.randomSeed=function(e){this._lcgSetSeed(o,e),this._gaussian_previous=!1},n.default.prototype.random=function(e,t){var r;if(n.default._validateParameters("random",arguments),r=null!=this[o]?this._lcg(o):Math.random(),void 0===e)return r;if(void 0===t)return e instanceof Array?e[Math.floor(r*e.length)]:r*e;if(tf){var P=p,L=l,k=u;p=d+f*(s&&d=t&&(r=r.substring(r.length-t,r.length)),r}},n.default.prototype.unhex=function(e){return e instanceof Array?e.map(n.default.prototype.unhex):parseInt("0x".concat(e),16)};var o=n.default;r.default=o},{"../core/main":49}],90:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i,a=(i=e("../core/main"))&&i.__esModule?i:{default:i};function n(e,t,r){var i=e<0,n=i?e.toString().substring(1):e.toString(),o=n.indexOf("."),a=-1!==o?n.substring(0,o):n,s=-1!==o?n.substring(o+1):"",l=i?"-":"";if(void 0!==r){var u="";(-1!==o||0r&&(s=s.substring(0,r));for(var h=0;hi.length)for(var o=t-(i+=-1===r?".":"").length+1,a=0;a=d.TWO_PI?"".concat("ellipse","|").concat(u,"|"):"".concat("arc","|").concat(a,"|").concat(s,"|").concat(l,"|").concat(u,"|"),!this.geometryInHash(t)){var h=new T.default.Geometry(u,1,function(){if(this.strokeIndices=[],a.toFixed(10)!==s.toFixed(10)){l!==d.PIE&&void 0!==l||(this.vertices.push(new T.default.Vector(.5,.5,0)),this.uvs.push([.5,.5]));for(var e=0;e<=u;e++){var t=(s-a)*(e/u)+a,r=.5+Math.cos(t)/2,i=.5+Math.sin(t)/2;this.vertices.push(new T.default.Vector(r,i,0)),this.uvs.push([r,i]),e>5&31)/31,(y>>10&31)/31):(r=a,i=s,l)}for(var b=1;b<=3;b++){var _=p+12*b,x=new S.default.Vector(u.getFloat32(_,!0),u.getFloat32(8+_,!0),u.getFloat32(4+_,!0));e.vertices.push(x),c&&o.push(r,i,n)}var w=new S.default.Vector(m,g,v);e.vertexNormals.push(w,w,w),e.faces.push([3*d,3*d+1,3*d+2]),e.uvs.push([0,0],[0,0],[0,0])}}(e,t);else{var r=new DataView(t);if(!("TextDecoder"in window))return console.warn("Sorry, ASCII STL loading only works in browsers that support TextDecoder (https://caniuse.com/#feat=textencoder)");var i=new TextDecoder("utf-8").decode(r).split("\n");!function(e,t){for(var r,i,n="",o=[],a=0;aMath.PI?l=Math.PI:l<=0&&(l=.001);var u=Math.sin(l)*a*Math.sin(s),h=Math.cos(l)*a,c=Math.sin(l)*a*Math.cos(s);this.camera(u+this.centerX,h+this.centerY,c+this.centerZ,this.centerX,this.centerY,this.centerZ,0,1,0)},m.default.Camera.prototype._isActive=function(){return this===this._renderer._curCamera},m.default.prototype.setCamera=function(e){this._renderer._curCamera=e,this._renderer.uPMatrix.set(e.projMatrix.mat4[0],e.projMatrix.mat4[1],e.projMatrix.mat4[2],e.projMatrix.mat4[3],e.projMatrix.mat4[4],e.projMatrix.mat4[5],e.projMatrix.mat4[6],e.projMatrix.mat4[7],e.projMatrix.mat4[8],e.projMatrix.mat4[9],e.projMatrix.mat4[10],e.projMatrix.mat4[11],e.projMatrix.mat4[12],e.projMatrix.mat4[13],e.projMatrix.mat4[14],e.projMatrix.mat4[15])};var n=m.default.Camera;r.default=n},{"../core/main":49}],98:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i,h=(i=e("../core/main"))&&i.__esModule?i:{default:i};h.default.Geometry=function(e,t,r){return this.vertices=[],this.lineVertices=[],this.lineNormals=[],this.vertexNormals=[],this.faces=[],this.uvs=[],this.edges=[],this.vertexColors=[],this.detailX=void 0!==e?e:1,this.detailY=void 0!==t?t:1,this.dirtyFlags={},r instanceof Function&&r.call(this),this},h.default.Geometry.prototype.reset=function(){this.lineVertices.length=0,this.lineNormals.length=0,this.vertices.length=0,this.edges.length=0,this.vertexColors.length=0,this.vertexNormals.length=0,this.uvs.length=0,this.dirtyFlags={}},h.default.Geometry.prototype.computeFaces=function(){this.faces.length=0;for(var e,t,r,i,n=this.detailX+1,o=0;othis.vertices.length-1-this.detailX;i--)e.add(this.vertexNormals[i]);e=h.default.Vector.div(e,this.detailX);for(var n=this.vertices.length-1;n>this.vertices.length-1-this.detailX;n--)this.vertexNormals[n]=e;return this},h.default.Geometry.prototype._makeTriangleEdges=function(){if(this.edges.length=0,Array.isArray(this.strokeIndices))for(var e=0,t=this.strokeIndices.length;e vTexCoord.y;\n bool y1 = p1.y > vTexCoord.y;\n bool y2 = p2.y > vTexCoord.y;\n\n // could web be under the curve (after t1)?\n if (y1 ? !y2 : y0) {\n // add the coverage for t1\n coverage.x += saturate(C1.x + 0.5);\n // calculate the anti-aliasing for t1\n weight.x = min(weight.x, abs(C1.x));\n }\n\n // are we outside the curve (after t2)?\n if (y1 ? !y0 : y2) {\n // subtract the coverage for t2\n coverage.x -= saturate(C2.x + 0.5);\n // calculate the anti-aliasing for t2\n weight.x = min(weight.x, abs(C2.x));\n }\n}\n\n// this is essentially the same as coverageX, but with the axes swapped\nvoid coverageY(vec2 p0, vec2 p1, vec2 p2) {\n\n vec2 C1, C2;\n calulateCrossings(p0, p1, p2, C1, C2);\n\n bool x0 = p0.x > vTexCoord.x;\n bool x1 = p1.x > vTexCoord.x;\n bool x2 = p2.x > vTexCoord.x;\n\n if (x1 ? !x2 : x0) {\n coverage.y -= saturate(C1.y + 0.5);\n weight.y = min(weight.y, abs(C1.y));\n }\n\n if (x1 ? !x0 : x2) {\n coverage.y += saturate(C2.y + 0.5);\n weight.y = min(weight.y, abs(C2.y));\n }\n}\n\nvoid main() {\n\n // calculate the pixel scale based on screen-coordinates\n pixelScale = hardness / fwidth(vTexCoord);\n\n // which grid cell is this pixel in?\n ivec2 gridCoord = ifloor(vTexCoord * vec2(uGridSize));\n\n // intersect curves in this row\n {\n // the index into the row info bitmap\n int rowIndex = gridCoord.y + uGridOffset.y;\n // fetch the info texel\n vec4 rowInfo = getTexel(uSamplerRows, rowIndex, uGridImageSize);\n // unpack the rowInfo\n int rowStrokeIndex = getInt16(rowInfo.xy);\n int rowStrokeCount = getInt16(rowInfo.zw);\n\n for (int iRowStroke = INT(0); iRowStroke < N; iRowStroke++) {\n if (iRowStroke >= rowStrokeCount)\n break;\n\n // each stroke is made up of 3 points: the start and control point\n // and the start of the next curve.\n // fetch the indices of this pair of strokes:\n vec4 strokeIndices = getTexel(uSamplerRowStrokes, rowStrokeIndex++, uCellsImageSize);\n\n // unpack the stroke index\n int strokePos = getInt16(strokeIndices.xy);\n\n // fetch the two strokes\n vec4 stroke0 = getTexel(uSamplerStrokes, strokePos + INT(0), uStrokeImageSize);\n vec4 stroke1 = getTexel(uSamplerStrokes, strokePos + INT(1), uStrokeImageSize);\n\n // calculate the coverage\n coverageX(stroke0.xy, stroke0.zw, stroke1.xy);\n }\n }\n\n // intersect curves in this column\n {\n int colIndex = gridCoord.x + uGridOffset.x;\n vec4 colInfo = getTexel(uSamplerCols, colIndex, uGridImageSize);\n int colStrokeIndex = getInt16(colInfo.xy);\n int colStrokeCount = getInt16(colInfo.zw);\n \n for (int iColStroke = INT(0); iColStroke < N; iColStroke++) {\n if (iColStroke >= colStrokeCount)\n break;\n\n vec4 strokeIndices = getTexel(uSamplerColStrokes, colStrokeIndex++, uCellsImageSize);\n\n int strokePos = getInt16(strokeIndices.xy);\n vec4 stroke0 = getTexel(uSamplerStrokes, strokePos + INT(0), uStrokeImageSize);\n vec4 stroke1 = getTexel(uSamplerStrokes, strokePos + INT(1), uStrokeImageSize);\n coverageY(stroke0.xy, stroke0.zw, stroke1.xy);\n }\n }\n\n weight = saturate(1.0 - weight * 2.0);\n float distance = max(weight.x + weight.y, minDistance); // manhattan approx.\n float antialias = abs(dot(coverage, weight) / distance);\n float cover = min(abs(coverage.x), abs(coverage.y));\n gl_FragColor = uMaterialColor;\n gl_FragColor.a *= saturate(max(antialias, cover));\n}",lineVert:"/*\n Part of the Processing project - http://processing.org\n Copyright (c) 2012-15 The Processing Foundation\n Copyright (c) 2004-12 Ben Fry and Casey Reas\n Copyright (c) 2001-04 Massachusetts Institute of Technology\n This library is free software; you can redistribute it and/or\n modify it under the terms of the GNU Lesser General Public\n License as published by the Free Software Foundation, version 2.1.\n This library is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n Lesser General Public License for more details.\n You should have received a copy of the GNU Lesser General\n Public License along with this library; if not, write to the\n Free Software Foundation, Inc., 59 Temple Place, Suite 330,\n Boston, MA 02111-1307 USA\n*/\n\n#define PROCESSING_LINE_SHADER\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform float uStrokeWeight;\n\nuniform vec4 uViewport;\nuniform int uPerspective;\n\nattribute vec4 aPosition;\nattribute vec4 aDirection;\n \nvoid main() {\n // using a scale <1 moves the lines towards the camera\n // in order to prevent popping effects due to half of\n // the line disappearing behind the geometry faces.\n vec3 scale = vec3(0.9995);\n\n vec4 posp = uModelViewMatrix * aPosition;\n vec4 posq = uModelViewMatrix * (aPosition + vec4(aDirection.xyz, 0));\n\n // Moving vertices slightly toward the camera\n // to avoid depth-fighting with the fill triangles.\n // Discussed here:\n // http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Number=252848 \n posp.xyz = posp.xyz * scale;\n posq.xyz = posq.xyz * scale;\n\n vec4 p = uProjectionMatrix * posp;\n vec4 q = uProjectionMatrix * posq;\n\n // formula to convert from clip space (range -1..1) to screen space (range 0..[width or height])\n // screen_p = (p.xy/p.w + <1,1>) * 0.5 * uViewport.zw\n\n // prevent division by W by transforming the tangent formula (div by 0 causes\n // the line to disappear, see https://github.com/processing/processing/issues/5183)\n // t = screen_q - screen_p\n //\n // tangent is normalized and we don't care which aDirection it points to (+-)\n // t = +- normalize( screen_q - screen_p )\n // t = +- normalize( (q.xy/q.w+<1,1>)*0.5*uViewport.zw - (p.xy/p.w+<1,1>)*0.5*uViewport.zw )\n //\n // extract common factor, <1,1> - <1,1> cancels out\n // t = +- normalize( (q.xy/q.w - p.xy/p.w) * 0.5 * uViewport.zw )\n //\n // convert to common divisor\n // t = +- normalize( ((q.xy*p.w - p.xy*q.w) / (p.w*q.w)) * 0.5 * uViewport.zw )\n //\n // remove the common scalar divisor/factor, not needed due to normalize and +-\n // (keep uViewport - can't remove because it has different components for x and y\n // and corrects for aspect ratio, see https://github.com/processing/processing/issues/5181)\n // t = +- normalize( (q.xy*p.w - p.xy*q.w) * uViewport.zw )\n\n vec2 tangent = normalize((q.xy*p.w - p.xy*q.w) * uViewport.zw);\n\n // flip tangent to normal (it's already normalized)\n vec2 normal = vec2(-tangent.y, tangent.x);\n\n float thickness = aDirection.w * uStrokeWeight;\n vec2 offset = normal * thickness / 2.0;\n\n vec2 curPerspScale;\n\n if(uPerspective == 1) {\n // Perspective ---\n // convert from world to clip by multiplying with projection scaling factor\n // to get the right thickness (see https://github.com/processing/processing/issues/5182)\n // invert Y, projections in Processing invert Y\n curPerspScale = (uProjectionMatrix * vec4(1, -1, 0, 0)).xy;\n } else {\n // No Perspective ---\n // multiply by W (to cancel out division by W later in the pipeline) and\n // convert from screen to clip (derived from clip to screen above)\n curPerspScale = p.w / (0.5 * uViewport.zw);\n }\n\n gl_Position.xy = p.xy + offset.xy * curPerspScale;\n gl_Position.zw = p.zw;\n}\n",lineFrag:"precision mediump float;\nprecision mediump int;\n\nuniform vec4 uMaterialColor;\n\nvoid main() {\n gl_FragColor = uMaterialColor;\n}",pointVert:"attribute vec3 aPosition;\nuniform float uPointSize;\nvarying float vStrokeWeight;\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nvoid main() {\n\tvec4 positionVec4 = vec4(aPosition, 1.0);\n\tgl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n\tgl_PointSize = uPointSize;\n\tvStrokeWeight = uPointSize;\n}",pointFrag:"precision mediump float;\nprecision mediump int;\nuniform vec4 uMaterialColor;\nvarying float vStrokeWeight;\n\nvoid main(){\n\tfloat mask = 0.0;\n\n\t// make a circular mask using the gl_PointCoord (goes from 0 - 1 on a point)\n // might be able to get a nicer edge on big strokeweights with smoothstep but slightly less performant\n\n\tmask = step(0.98, length(gl_PointCoord * 2.0 - 1.0));\n\n\t// if strokeWeight is 1 or less lets just draw a square\n\t// this prevents weird artifacting from carving circles when our points are really small\n\t// if strokeWeight is larger than 1, we just use it as is\n\n\tmask = mix(0.0, mask, clamp(floor(vStrokeWeight - 0.5),0.0,1.0));\n\n\t// throw away the borders of the mask\n // otherwise we get weird alpha blending issues\n\n\tif(mask > 0.98){\n discard;\n \t}\n\n \tgl_FragColor = vec4(uMaterialColor.rgb * (1.0 - mask), uMaterialColor.a) ;\n}"};u.default.RendererGL=function(e,t,r,i){return u.default.Renderer.call(this,e,t,r),this._setAttributeDefaults(t),this._initContext(),this.isP3D=!0,this.GL=this.drawingContext,this._isErasing=!1,this._enableLighting=!1,this.ambientLightColors=[],this.specularColors=[1,1,1],this.directionalLightDirections=[],this.directionalLightDiffuseColors=[],this.directionalLightSpecularColors=[],this.pointLightPositions=[],this.pointLightDiffuseColors=[],this.pointLightSpecularColors=[],this.spotLightPositions=[],this.spotLightDirections=[],this.spotLightDiffuseColors=[],this.spotLightSpecularColors=[],this.spotLightAngle=[],this.spotLightConc=[],this.drawMode=o.FILL,this.curFillColor=this._cachedFillStyle=[1,1,1,1],this.curStrokeColor=this._cachedStrokeStyle=[0,0,0,1],this.curBlendMode=o.BLEND,this._cachedBlendMode=void 0,this.blendExt=this.GL.getExtension("EXT_blend_minmax"),this._isBlending=!1,this._useSpecularMaterial=!1,this._useEmissiveMaterial=!1,this._useNormalMaterial=!1,this._useShininess=1,this._tint=[255,255,255,255],this.constantAttenuation=1,this.linearAttenuation=0,this.quadraticAttenuation=0,this.uMVMatrix=new u.default.Matrix,this.uPMatrix=new u.default.Matrix,this.uNMatrix=new u.default.Matrix("mat3"),this._curCamera=new u.default.Camera(this),this._curCamera._computeCameraDefaultSettings(),this._curCamera._setDefaultCamera(),this._defaultLightShader=void 0,this._defaultImmediateModeShader=void 0,this._defaultNormalShader=void 0,this._defaultColorShader=void 0,this._defaultPointShader=void 0,this.userFillShader=void 0,this.userStrokeShader=void 0,this.userPointShader=void 0,this.retainedMode={geometry:{},buffers:{stroke:[new u.default.RenderBuffer(3,"lineVertices","lineVertexBuffer","aPosition",this,this._flatten),new u.default.RenderBuffer(4,"lineNormals","lineNormalBuffer","aDirection",this,this._flatten)],fill:[new u.default.RenderBuffer(3,"vertices","vertexBuffer","aPosition",this,this._vToNArray),new u.default.RenderBuffer(3,"vertexNormals","normalBuffer","aNormal",this,this._vToNArray),new u.default.RenderBuffer(4,"vertexColors","colorBuffer","aMaterialColor",this),new u.default.RenderBuffer(3,"vertexAmbients","ambientBuffer","aAmbientColor",this),new u.default.RenderBuffer(2,"uvs","uvBuffer","aTexCoord",this,this._flatten)],text:[new u.default.RenderBuffer(3,"vertices","vertexBuffer","aPosition",this,this._vToNArray),new u.default.RenderBuffer(2,"uvs","uvBuffer","aTexCoord",this,this._flatten)]}},this.immediateMode={geometry:new u.default.Geometry,shapeMode:o.TRIANGLE_FAN,_bezierVertex:[],_quadraticVertex:[],_curveVertex:[],buffers:{fill:[new u.default.RenderBuffer(3,"vertices","vertexBuffer","aPosition",this,this._vToNArray),new u.default.RenderBuffer(3,"vertexNormals","normalBuffer","aNormal",this,this._vToNArray),new u.default.RenderBuffer(4,"vertexColors","colorBuffer","aVertexColor",this),new u.default.RenderBuffer(3,"vertexAmbients","ambientBuffer","aAmbientColor",this),new u.default.RenderBuffer(2,"uvs","uvBuffer","aTexCoord",this,this._flatten)],stroke:[new u.default.RenderBuffer(3,"lineVertices","lineVertexBuffer","aPosition",this,this._flatten),new u.default.RenderBuffer(4,"lineNormals","lineNormalBuffer","aDirection",this,this._flatten)],point:this.GL.createBuffer()}},this.pointSize=5,this.curStrokeWeight=1,this.textures=[],this.textureMode=o.IMAGE,this.textureWrapX=o.CLAMP,this.textureWrapY=o.CLAMP,this._tex=null,this._curveTightness=6,this._lookUpTableBezier=[],this._lookUpTableQuadratic=[],this._lutBezierDetail=0,this._lutQuadraticDetail=0,this._tessy=this._initTessy(),this.fontInfos={},this._curShader=void 0,this},u.default.RendererGL.prototype=Object.create(u.default.Renderer.prototype),u.default.RendererGL.prototype._setAttributeDefaults=function(e){var t={alpha:!0,depth:!0,stencil:!0,antialias:navigator.userAgent.toLowerCase().includes("safari"),premultipliedAlpha:!1,preserveDrawingBuffer:!0,perPixelLighting:!0};null===e._glAttributes?e._glAttributes=t:e._glAttributes=Object.assign(t,e._glAttributes)},u.default.RendererGL.prototype._initContext=function(){try{if(this.drawingContext=this.canvas.getContext("webgl",this._pInst._glAttributes)||this.canvas.getContext("experimental-webgl",this._pInst._glAttributes),null===this.drawingContext)throw new Error("Error creating webgl context");var e=this.drawingContext;e.enable(e.DEPTH_TEST),e.depthFunc(e.LEQUAL),e.viewport(0,0,e.drawingBufferWidth,e.drawingBufferHeight),this._viewport=this.drawingContext.getParameter(this.drawingContext.VIEWPORT)}catch(e){throw e}},u.default.RendererGL.prototype._resetContext=function(e,t){var r=this.width,i=this.height,n=this.canvas.id,o=this._pInst instanceof u.default.Graphics;if(o){var a=this._pInst;a.canvas.parentNode.removeChild(a.canvas),a.canvas=document.createElement("canvas"),(a._pInst._userNode||document.body).appendChild(a.canvas),u.default.Element.call(a,a.canvas,a._pInst),a.width=r,a.height=i}else{var s=this.canvas;s&&s.parentNode.removeChild(s),(s=document.createElement("canvas")).id=n,this._pInst._userNode?this._pInst._userNode.appendChild(s):document.body.appendChild(s),this._pInst.canvas=s}var l=new u.default.RendererGL(this._pInst.canvas,this._pInst,!o);this._pInst._setProperty("_renderer",l),l.resize(r,i),l._applyDefaults(),o||this._pInst._elements.push(l),"function"==typeof t&&setTimeout(function(){t.apply(window._renderer,e)},0)},u.default.prototype.setAttributes=function(e,t){if(void 0!==this._glAttributes){var r=!0;if(void 0!==t?(null===this._glAttributes&&(this._glAttributes={}),this._glAttributes[e]!==t&&(this._glAttributes[e]=t,r=!1)):e instanceof Object&&this._glAttributes!==e&&(this._glAttributes=e,r=!1),this._renderer.isP3D&&!r){if(!this._setupDone)for(var i in this._renderer.retainedMode.geometry)if(this._renderer.retainedMode.geometry.hasOwnProperty(i))return void console.error("Sorry, Could not set the attributes, you need to call setAttributes() before calling the other drawing methods in setup()");this.push(),this._renderer._resetContext(),this.pop(),this._renderer._curCamera&&(this._renderer._curCamera._renderer=this._renderer)}}else console.log("You are trying to use setAttributes on a p5.Graphics object that does not use a WEBGL renderer.")},u.default.RendererGL.prototype._update=function(){this.uMVMatrix.set(this._curCamera.cameraMatrix.mat4[0],this._curCamera.cameraMatrix.mat4[1],this._curCamera.cameraMatrix.mat4[2],this._curCamera.cameraMatrix.mat4[3],this._curCamera.cameraMatrix.mat4[4],this._curCamera.cameraMatrix.mat4[5],this._curCamera.cameraMatrix.mat4[6],this._curCamera.cameraMatrix.mat4[7],this._curCamera.cameraMatrix.mat4[8],this._curCamera.cameraMatrix.mat4[9],this._curCamera.cameraMatrix.mat4[10],this._curCamera.cameraMatrix.mat4[11],this._curCamera.cameraMatrix.mat4[12],this._curCamera.cameraMatrix.mat4[13],this._curCamera.cameraMatrix.mat4[14],this._curCamera.cameraMatrix.mat4[15]),this.ambientLightColors.length=0,this.specularColors=[1,1,1],this.directionalLightDirections.length=0,this.directionalLightDiffuseColors.length=0,this.directionalLightSpecularColors.length=0,this.pointLightPositions.length=0,this.pointLightDiffuseColors.length=0,this.pointLightSpecularColors.length=0,this.spotLightPositions.length=0,this.spotLightDirections.length=0,this.spotLightDiffuseColors.length=0,this.spotLightSpecularColors.length=0,this.spotLightAngle.length=0,this.spotLightConc.length=0,this._enableLighting=!1,this._tint=[255,255,255,255],this.GL.clear(this.GL.DEPTH_BUFFER_BIT)},u.default.RendererGL.prototype.background=function(){var e,t=(e=this._pInst).color.apply(e,arguments),r=t.levels[0]/255,i=t.levels[1]/255,n=t.levels[2]/255,o=t.levels[3]/255;this.GL.clearColor(r,i,n,o),this.GL.clear(this.GL.COLOR_BUFFER_BIT)},u.default.RendererGL.prototype.fill=function(e,t,r,i){var n=u.default.prototype.color.apply(this._pInst,arguments);this.curFillColor=n._array,this.drawMode=o.FILL,this._useNormalMaterial=!1,this._tex=null},u.default.RendererGL.prototype.stroke=function(e,t,r,i){arguments[3]=255;var n=u.default.prototype.color.apply(this._pInst,arguments);this.curStrokeColor=n._array},u.default.RendererGL.prototype.strokeCap=function(e){console.error("Sorry, strokeCap() is not yet implemented in WEBGL mode")},u.default.RendererGL.prototype.strokeJoin=function(e){console.error("Sorry, strokeJoin() is not yet implemented in WEBGL mode")},u.default.RendererGL.prototype.filter=function(e){console.error("filter() does not work in WEBGL mode")},u.default.RendererGL.prototype.blendMode=function(e){e===o.DARKEST||e===o.LIGHTEST||e===o.ADD||e===o.BLEND||e===o.SUBTRACT||e===o.SCREEN||e===o.EXCLUSION||e===o.REPLACE||e===o.MULTIPLY||e===o.REMOVE?this.curBlendMode=e:e!==o.BURN&&e!==o.OVERLAY&&e!==o.HARD_LIGHT&&e!==o.SOFT_LIGHT&&e!==o.DODGE||console.warn("BURN, OVERLAY, HARD_LIGHT, SOFT_LIGHT, and DODGE only work for blendMode in 2D mode.")},u.default.RendererGL.prototype.erase=function(e,t){this._isErasing||(this._cachedBlendMode=this.curBlendMode,this.blendMode(o.REMOVE),this._cachedFillStyle=this.curFillColor.slice(),this.curFillColor=[1,1,1,e/255],this._cachedStrokeStyle=this.curStrokeColor.slice(),this.curStrokeColor=[1,1,1,t/255],this._isErasing=!0)},u.default.RendererGL.prototype.noErase=function(){this._isErasing&&(this.curFillColor=this._cachedFillStyle.slice(),this.curStrokeColor=this._cachedStrokeStyle.slice(),this.blendMode(this._cachedBlendMode),this._isErasing=!1)},u.default.RendererGL.prototype.strokeWeight=function(e){this.curStrokeWeight!==e&&(this.pointSize=e,this.curStrokeWeight=e)},u.default.RendererGL.prototype._getPixel=function(e,t){var r;return r=new Uint8Array(4),this.drawingContext.readPixels(e,t,1,1,this.drawingContext.RGBA,this.drawingContext.UNSIGNED_BYTE,r),[r[0],r[1],r[2],r[3]]},u.default.RendererGL.prototype.loadPixels=function(){var e=this._pixelsState;if(!0===this._pInst._glAttributes.preserveDrawingBuffer){var t=e.pixels,r=this.GL.drawingBufferWidth*this.GL.drawingBufferHeight*4;t instanceof Uint8Array&&t.length===r||(t=new Uint8Array(r),this._pixelsState._setProperty("pixels",t));var i=this._pInst._pixelDensity;this.GL.readPixels(0,0,this.width*i,this.height*i,this.GL.RGBA,this.GL.UNSIGNED_BYTE,t)}else console.log("loadPixels only works in WebGL when preserveDrawingBuffer is true.")},u.default.RendererGL.prototype.geometryInHash=function(e){return void 0!==this.retainedMode.geometry[e]},u.default.RendererGL.prototype.resize=function(e,t){u.default.Renderer.prototype.resize.call(this,e,t),this.GL.viewport(0,0,this.GL.drawingBufferWidth,this.GL.drawingBufferHeight),this._viewport=this.GL.getParameter(this.GL.VIEWPORT),this._curCamera._resize();var r=this._pixelsState;void 0!==r.pixels&&r._setProperty("pixels",new Uint8Array(this.GL.drawingBufferWidth*this.GL.drawingBufferHeight*4))},u.default.RendererGL.prototype.clear=function(){var e=(arguments.length<=0?void 0:arguments[0])||0,t=(arguments.length<=1?void 0:arguments[1])||0,r=(arguments.length<=2?void 0:arguments[2])||0,i=(arguments.length<=3?void 0:arguments[3])||0;this.GL.clearColor(e,t,r,i),this.GL.clear(this.GL.COLOR_BUFFER_BIT|this.GL.DEPTH_BUFFER_BIT)},u.default.RendererGL.prototype.applyMatrix=function(e,t,r,i,n,o){16===arguments.length?u.default.Matrix.prototype.apply.apply(this.uMVMatrix,arguments):this.uMVMatrix.apply([e,t,0,0,r,i,0,0,0,0,1,0,n,o,0,1])},u.default.RendererGL.prototype.translate=function(e,t,r){return e instanceof u.default.Vector&&(r=e.z,t=e.y,e=e.x),this.uMVMatrix.translate([e,t,r]),this},u.default.RendererGL.prototype.scale=function(e,t,r){return this.uMVMatrix.scale(e,t,r),this},u.default.RendererGL.prototype.rotate=function(e,t){return void 0===t?this.rotateZ(e):(u.default.Matrix.prototype.rotate.apply(this.uMVMatrix,arguments),this)},u.default.RendererGL.prototype.rotateX=function(e){return this.rotate(e,1,0,0),this},u.default.RendererGL.prototype.rotateY=function(e){return this.rotate(e,0,1,0),this},u.default.RendererGL.prototype.rotateZ=function(e){return this.rotate(e,0,0,1),this},u.default.RendererGL.prototype.push=function(){var e=u.default.Renderer.prototype.push.apply(this),t=e.properties;return t.uMVMatrix=this.uMVMatrix.copy(),t.uPMatrix=this.uPMatrix.copy(),t._curCamera=this._curCamera,this._curCamera=this._curCamera.copy(),t.ambientLightColors=this.ambientLightColors.slice(),t.specularColors=this.specularColors.slice(),t.directionalLightDirections=this.directionalLightDirections.slice(),t.directionalLightDiffuseColors=this.directionalLightDiffuseColors.slice(),t.directionalLightSpecularColors=this.directionalLightSpecularColors.slice(),t.pointLightPositions=this.pointLightPositions.slice(),t.pointLightDiffuseColors=this.pointLightDiffuseColors.slice(),t.pointLightSpecularColors=this.pointLightSpecularColors.slice(),t.spotLightPositions=this.spotLightPositions.slice(),t.spotLightDirections=this.spotLightDirections.slice(),t.spotLightDiffuseColors=this.spotLightDiffuseColors.slice(),t.spotLightSpecularColors=this.spotLightSpecularColors.slice(),t.spotLightAngle=this.spotLightAngle.slice(),t.spotLightConc=this.spotLightConc.slice(),t.userFillShader=this.userFillShader,t.userStrokeShader=this.userStrokeShader,t.userPointShader=this.userPointShader,t.pointSize=this.pointSize,t.curStrokeWeight=this.curStrokeWeight,t.curStrokeColor=this.curStrokeColor,t.curFillColor=this.curFillColor,t._useSpecularMaterial=this._useSpecularMaterial,t._useEmissiveMaterial=this._useEmissiveMaterial,t._useShininess=this._useShininess,t.constantAttenuation=this.constantAttenuation,t.linearAttenuation=this.linearAttenuation,t.quadraticAttenuation=this.quadraticAttenuation,t._enableLighting=this._enableLighting,t._useNormalMaterial=this._useNormalMaterial,t._tex=this._tex,t.drawMode=this.drawMode,e},u.default.RendererGL.prototype.resetMatrix=function(){return this.uMVMatrix=u.default.Matrix.identity(this._pInst),this},u.default.RendererGL.prototype._getImmediateStrokeShader=function(){var e=this.userStrokeShader;return e&&e.isStrokeShader()?e:this._getLineShader()},u.default.RendererGL.prototype._getRetainedStrokeShader=u.default.RendererGL.prototype._getImmediateStrokeShader,u.default.RendererGL.prototype._getImmediateFillShader=function(){var e=this.userFillShader;if(this._useNormalMaterial&&(!e||!e.isNormalShader()))return this._getNormalShader();if(this._enableLighting){if(!e||!e.isLightShader())return this._getLightShader()}else if(this._tex){if(!e||!e.isTextureShader())return this._getLightShader()}else if(!e)return this._getImmediateModeShader();return e},u.default.RendererGL.prototype._getRetainedFillShader=function(){if(this._useNormalMaterial)return this._getNormalShader();var e=this.userFillShader;if(this._enableLighting){if(!e||!e.isLightShader())return this._getLightShader()}else if(this._tex){if(!e||!e.isTextureShader())return this._getLightShader()}else if(!e)return this._getColorShader();return e},u.default.RendererGL.prototype._getImmediatePointShader=function(){var e=this.userPointShader;return e&&e.isPointShader()?e:this._getPointShader()},u.default.RendererGL.prototype._getRetainedLineShader=u.default.RendererGL.prototype._getImmediateLineShader,u.default.RendererGL.prototype._getLightShader=function(){return this._defaultLightShader||(this._pInst._glAttributes.perPixelLighting?this._defaultLightShader=new u.default.Shader(this,c.phongVert,c.phongFrag):this._defaultLightShader=new u.default.Shader(this,c.lightVert,c.lightTextureFrag)),this._defaultLightShader},u.default.RendererGL.prototype._getImmediateModeShader=function(){return this._defaultImmediateModeShader||(this._defaultImmediateModeShader=new u.default.Shader(this,c.immediateVert,c.vertexColorFrag)),this._defaultImmediateModeShader},u.default.RendererGL.prototype._getNormalShader=function(){return this._defaultNormalShader||(this._defaultNormalShader=new u.default.Shader(this,c.normalVert,c.normalFrag)),this._defaultNormalShader},u.default.RendererGL.prototype._getColorShader=function(){return this._defaultColorShader||(this._defaultColorShader=new u.default.Shader(this,c.normalVert,c.basicFrag)),this._defaultColorShader},u.default.RendererGL.prototype._getPointShader=function(){return this._defaultPointShader||(this._defaultPointShader=new u.default.Shader(this,c.pointVert,c.pointFrag)),this._defaultPointShader},u.default.RendererGL.prototype._getLineShader=function(){return this._defaultLineShader||(this._defaultLineShader=new u.default.Shader(this,c.lineVert,c.lineFrag)),this._defaultLineShader},u.default.RendererGL.prototype._getFontShader=function(){return this._defaultFontShader||(this.GL.getExtension("OES_standard_derivatives"),this._defaultFontShader=new u.default.Shader(this,c.fontVert,c.fontFrag)),this._defaultFontShader},u.default.RendererGL.prototype._getEmptyTexture=function(){if(!this._emptyTexture){var e=new u.default.Image(1,1);e.set(0,0,255),this._emptyTexture=new u.default.Texture(this,e)}return this._emptyTexture},u.default.RendererGL.prototype.getTexture=function(e){var t=this.textures,r=!0,i=!1,n=void 0;try{for(var o,a=t[Symbol.iterator]();!(r=(o=a.next()).done);r=!0){var s=o.value;if(s.src===e)return s}}catch(e){i=!0,n=e}finally{try{r||null==a.return||a.return()}finally{if(i)throw n}}var l=new u.default.Texture(this,e);return t.push(l),l},u.default.RendererGL.prototype._setStrokeUniforms=function(e){e.bindShader(),e.setUniform("uMaterialColor",this.curStrokeColor),e.setUniform("uStrokeWeight",this.curStrokeWeight)},u.default.RendererGL.prototype._setFillUniforms=function(e){e.bindShader(),e.setUniform("uMaterialColor",this.curFillColor),e.setUniform("isTexture",!!this._tex),this._tex&&e.setUniform("uSampler",this._tex),e.setUniform("uTint",this._tint),e.setUniform("uSpecular",this._useSpecularMaterial),e.setUniform("uEmissive",this._useEmissiveMaterial),e.setUniform("uShininess",this._useShininess),e.setUniform("uUseLighting",this._enableLighting);var t=this.pointLightDiffuseColors.length/3;e.setUniform("uPointLightCount",t),e.setUniform("uPointLightLocation",this.pointLightPositions),e.setUniform("uPointLightDiffuseColors",this.pointLightDiffuseColors),e.setUniform("uPointLightSpecularColors",this.pointLightSpecularColors);var r=this.directionalLightDiffuseColors.length/3;e.setUniform("uDirectionalLightCount",r),e.setUniform("uLightingDirection",this.directionalLightDirections),e.setUniform("uDirectionalDiffuseColors",this.directionalLightDiffuseColors),e.setUniform("uDirectionalSpecularColors",this.directionalLightSpecularColors);var i=this.ambientLightColors.length/3;e.setUniform("uAmbientLightCount",i),e.setUniform("uAmbientColor",this.ambientLightColors);var n=this.spotLightDiffuseColors.length/3;e.setUniform("uSpotLightCount",n),e.setUniform("uSpotLightAngle",this.spotLightAngle),e.setUniform("uSpotLightConc",this.spotLightConc),e.setUniform("uSpotLightDiffuseColors",this.spotLightDiffuseColors),e.setUniform("uSpotLightSpecularColors",this.spotLightSpecularColors),e.setUniform("uSpotLightLocation",this.spotLightPositions),e.setUniform("uSpotLightDirection",this.spotLightDirections),e.setUniform("uConstantAttenuation",this.constantAttenuation),e.setUniform("uLinearAttenuation",this.linearAttenuation),e.setUniform("uQuadraticAttenuation",this.quadraticAttenuation),e.bindTextures()},u.default.RendererGL.prototype._setPointUniforms=function(e){e.bindShader(),e.setUniform("uMaterialColor",this.curStrokeColor),e.setUniform("uPointSize",this.pointSize)},u.default.RendererGL.prototype._bindBuffer=function(e,t,r,i,n){if(t=t||this.GL.ARRAY_BUFFER,this.GL.bindBuffer(t,e),void 0!==r){var o=new(i||Float32Array)(r);this.GL.bufferData(t,o,n||this.GL.STATIC_DRAW)}},u.default.RendererGL.prototype._arraysEqual=function(e,t){var r=e.length;if(r!==t.length)return!1;for(var i=0;i>7,127&f,c>>7,127&c);for(var d=0;d>7,127&p,0,0)}}return{cellImageInfo:l,dimOffset:o,dimImageInfo:n}}return(t=this.glyphInfos[e.index]={glyph:e,uGlyphRect:[i.x1,-i.y1,i.x2,-i.y2],strokeImageInfo:U,strokes:d,colInfo:G(m,this.colDimImageInfos,this.colCellImageInfos),rowInfo:G(p,this.rowDimImageInfos,this.rowCellImageInfos)}).uGridOffset=[t.colInfo.dimOffset,t.rowInfo.dimOffset],t}}var z=Math.sqrt(3);j.default.RendererGL.prototype._renderText=function(e,t,r,i,n){if(this._textFont&&"string"!=typeof this._textFont){if(!(n<=i)&&this._doFill){if(!this._isOpenType())return console.log("WEBGL: only Opentype (.otf) and Truetype (.ttf) fonts are supported"),e;e.push();var o=this._doStroke,a=this.drawMode;this._doStroke=!1,this.drawMode=D.TEXTURE;var s=this._textFont.font,l=this._textFont._fontInfo;l=l||(this._textFont._fontInfo=new A(s));var u=this._textFont._handleAlignment(this,t,r,i),h=this._textSize/s.unitsPerEm;this.translate(u.x,u.y,0),this.scale(h,h,1);var c=this.GL,f=!this._defaultFontShader,d=this._getFontShader();d.init(),d.bindShader(),f&&(d.setUniform("uGridImageSize",[64,64]),d.setUniform("uCellsImageSize",[64,64]),d.setUniform("uStrokeImageSize",[64,64]),d.setUniform("uGridSize",[9,9])),this._applyColorBlend(this.curFillColor);var p=this.retainedMode.geometry.glyph;if(!p){var m=this._textGeom=new j.default.Geometry(1,1,function(){for(var e=0;e<=1;e++)for(var t=0;t<=1;t++)this.vertices.push(new j.default.Vector(t,e,0)),this.uvs.push(t,e)});m.computeFaces().computeNormals(),p=this.createBuffers("glyph",m)}var g=!0,v=!1,y=void 0;try{for(var b,_=this.retainedMode.buffers.text[Symbol.iterator]();!(g=(b=_.next()).done);g=!0){b.value._prepareBuffer(p,d)}}catch(e){v=!0,y=e}finally{try{g||null==_.return||_.return()}finally{if(v)throw y}}this._bindBuffer(p.indexBuffer,c.ELEMENT_ARRAY_BUFFER),d.setUniform("uMaterialColor",this.curFillColor);try{var x=0,w=null,S=s.stringToGlyphs(t),M=!0,E=!1,T=void 0;try{for(var C,P=S[Symbol.iterator]();!(M=(C=P.next()).done);M=!0){var L=C.value;w&&(x+=s.getKerningValue(w,L));var k=l.getGlyphInfo(L);if(k.uGlyphRect){var R=k.rowInfo,O=k.colInfo;d.setUniform("uSamplerStrokes",k.strokeImageInfo.imageData),d.setUniform("uSamplerRowStrokes",R.cellImageInfo.imageData),d.setUniform("uSamplerRows",R.dimImageInfo.imageData),d.setUniform("uSamplerColStrokes",O.cellImageInfo.imageData),d.setUniform("uSamplerCols",O.dimImageInfo.imageData),d.setUniform("uGridOffset",k.uGridOffset),d.setUniform("uGlyphRect",k.uGlyphRect),d.setUniform("uGlyphOffset",x),d.bindTextures(),c.drawElements(c.TRIANGLES,6,this.GL.UNSIGNED_SHORT,0)}x+=L.advanceWidth,w=L}}catch(e){E=!0,T=e}finally{try{M||null==P.return||P.return()}finally{if(E)throw T}}}finally{d.unbindShader(),this._doStroke=o,this.drawMode=a,e.pop()}return e}}else console.log("WEBGL: you must load and set a font before drawing text. See `loadFont` and `textFont` for more details.")}},{"../core/constants":42,"../core/main":49,"./p5.RendererGL.Retained":102,"./p5.Shader":104}],107:[function(e,t,r){t.exports={fes:{autoplay:"The media that tried to play (with '{{src}}') wasn't allowed to by this browser, most likely due to the browser's autoplay policy. Check out {{link}} for more information about why.",fileLoadError:{bytes:"It looks like there was a problem loading your file. {{suggestion}}",font:"It looks like there was a problem loading your font. {{suggestion}}",gif:"There was some trouble loading your GIF. Make sure that your GIF is using 87a or 89a encoding.",image:"It looks like there was a problem loading your image. {{suggestion}}",json:"It looks like there was a problem loading your JSON file. {{suggestion}}",large:"If your large file isn't fetched successfully, we recommend splitting the file into smaller segments and fetching those.",strings:"It looks like there was a problem loading your text file. {{suggestion}}",suggestion:"Try checking if the file path ({{filePath}}) is correct, hosting the file online, or running a local server. (More info at {{link}})",table:"It looks like there was a problem loading your table file. {{suggestion}}",xml:"It looks like there was a problem loading your XML file. {{suggestion}}"},misusedTopLevel:"Did you just try to use p5.js's {{symbolName}} {{symbolType}}? If so, you may want to move it into your sketch's setup() function.\n\nFor more details, see: {{link}}",pre:"🌸 p5.js says: {{message}}",welcome:"Welcome! This is your friendly debugger. To turn me off, switch to using p5.min.js."}}},{}],108:[function(e,t,r){t.exports={fes:{autoplay:"Su browser impidío un medio tocar (de '{{src}}'), posiblemente porque las reglas de autoplay. Para aprender más, visite {{link}}.",fileLoadError:{bytes:"",font:"",gif:"",image:"",json:"",large:"",strings:"",suggestion:"",table:"",xml:""},misusedTopLevel:"",pre:"🌸 p5.js dice: {{message}}",welcome:""}}},{}],109:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i=o(e("./en/translation")),n=o(e("./es/translation"));function o(e){return e&&e.__esModule?e:{default:e}}var a={en:{translation:i.default},es:{translation:n.default}};r.default=a},{"./en/translation":107,"./es/translation":108}]},{},[37])(37)}); ================================================ FILE: docs/examples/pyodide/sketch_009/target/target_sketch.js ================================================ const wrapperContent = ` class PythonFunctions: pass setattr(PythonFunctions, 'map', map) setattr(PythonFunctions, 'filter', filter) setattr(PythonFunctions, 'set', set) _P5_INSTANCE = None _CTX_MIDDLE = None _DEFAULT_FILL = None _DEFAULT_LEADMULT = None _DEFAULT_STROKE = None _DEFAULT_TEXT_FILL = None ADD = None ALT = None ARROW = None AUDIO = None AUTO = None AXES = None BACKSPACE = None BASELINE = None BEVEL = None BEZIER = None BLEND = None BLUR = None BOLD = None BOLDITALIC = None BOTTOM = None BURN = None CENTER = None CHORD = None CLAMP = None CLOSE = None CONTROL = None CORNER = None CORNERS = None CROSS = None CURVE = None DARKEST = None DEG_TO_RAD = None DEGREES = None DELETE = None DIFFERENCE = None DILATE = None DODGE = None DOWN_ARROW = None ENTER = None ERODE = None ESCAPE = None EXCLUSION = None FILL = None GRAY = None GRID = None HALF_PI = None HAND = None HARD_LIGHT = None HSB = None HSL = None IMAGE = None IMMEDIATE = None INVERT = None ITALIC = None LANDSCAPE = None LEFT = None LEFT_ARROW = None LIGHTEST = None LINE_LOOP = None LINE_STRIP = None LINEAR = None LINES = None MIRROR = None MITER = None MOVE = None MULTIPLY = None NEAREST = None NORMAL = None OPAQUE = None OPEN = None OPTION = None OVERLAY = None PI = None PIE = None POINTS = None PORTRAIT = None POSTERIZE = None PROJECT = None QUAD_STRIP = None QUADRATIC = None QUADS = None QUARTER_PI = None RAD_TO_DEG = None RADIANS = None RADIUS = None REPEAT = None REPLACE = None RETURN = None RGB = None RIGHT = None RIGHT_ARROW = None ROUND = None SCREEN = None SHIFT = None SOFT_LIGHT = None SQUARE = None STROKE = None SUBTRACT = None TAB = None TAU = None TEXT = None TEXTURE = None THRESHOLD = None TOP = None TRIANGLE_FAN = None TRIANGLE_STRIP = None TRIANGLES = None TWO_PI = None UP_ARROW = None VIDEO = None WAIT = None WEBGL = None P2D = None PI = None frameCount = None focused = None displayWidth = None displayHeight = None windowWidth = None windowHeight = None width = None height = None deviceOrientation = None accelerationX = None accelerationY = None accelerationZ = None pAccelerationX = None pAccelerationY = None pAccelerationZ = None rotationX = None rotationY = None rotationZ = None pRotationX = None pRotationY = None pRotationZ = None turnAxis = None keyIsPressed = None key = None keyCode = None mouseX = None mouseY = None pmouseX = None pmouseY = None winMouseX = None winMouseY = None pwinMouseX = None pwinMouseY = None mouseButton = None mouseIsPressed = None touches = None pixels = None def alpha(*args): return _P5_INSTANCE.alpha(*args) def blue(*args): return _P5_INSTANCE.blue(*args) def brightness(*args): return _P5_INSTANCE.brightness(*args) def color(*args): return _P5_INSTANCE.color(*args) def green(*args): return _P5_INSTANCE.green(*args) def hue(*args): return _P5_INSTANCE.hue(*args) def lerpColor(*args): return _P5_INSTANCE.lerpColor(*args) def lightness(*args): return _P5_INSTANCE.lightness(*args) def red(*args): return _P5_INSTANCE.red(*args) def saturation(*args): return _P5_INSTANCE.saturation(*args) def background(*args): return _P5_INSTANCE.background(*args) def clear(*args): p5_clear = _P5_INSTANCE.clear(*args) return p5_clear def erase(*args): return _P5_INSTANCE.erase(*args) def noErase(*args): return _P5_INSTANCE.noErase(*args) def colorMode(*args): return _P5_INSTANCE.colorMode(*args) def fill(*args): return _P5_INSTANCE.fill(*args) def noFill(*args): return _P5_INSTANCE.noFill(*args) def noStroke(*args): return _P5_INSTANCE.noStroke(*args) def stroke(*args): return _P5_INSTANCE.stroke(*args) def arc(*args): return _P5_INSTANCE.arc(*args) def ellipse(*args): return _P5_INSTANCE.ellipse(*args) def circle(*args): return _P5_INSTANCE.circle(*args) def line(*args): return _P5_INSTANCE.line(*args) def point(*args): return _P5_INSTANCE.point(*args) def quad(*args): return _P5_INSTANCE.quad(*args) def rect(*args): return _P5_INSTANCE.rect(*args) def square(*args): return _P5_INSTANCE.square(*args) def triangle(*args): return _P5_INSTANCE.triangle(*args) def plane(*args): return _P5_INSTANCE.plane(*args) def box(*args): return _P5_INSTANCE.box(*args) def sphere(*args): return _P5_INSTANCE.sphere(*args) def cylinder(*args): return _P5_INSTANCE.cylinder(*args) def cone(*args): return _P5_INSTANCE.cone(*args) def ellipsoid(*args): return _P5_INSTANCE.ellipsoid(*args) def torus(*args): return _P5_INSTANCE.torus(*args) def loadModel(*args): return _P5_INSTANCE.loadModel(*args) def model(*args): return _P5_INSTANCE.model(*args) def ellipseMode(*args): return _P5_INSTANCE.ellipseMode(*args) def noSmooth(*args): return _P5_INSTANCE.noSmooth(*args) def rectMode(*args): return _P5_INSTANCE.rectMode(*args) def smooth(*args): return _P5_INSTANCE.smooth(*args) def strokeCap(*args): return _P5_INSTANCE.strokeCap(*args) def strokeJoin(*args): return _P5_INSTANCE.strokeJoin(*args) def strokeWeight(*args): return _P5_INSTANCE.strokeWeight(*args) def bezier(*args): return _P5_INSTANCE.bezier(*args) def bezierDetail(*args): return _P5_INSTANCE.bezierDetail(*args) def bezierPoint(*args): return _P5_INSTANCE.bezierPoint(*args) def bezierTangent(*args): return _P5_INSTANCE.bezierTangent(*args) def curve(*args): return _P5_INSTANCE.curve(*args) def curveDetail(*args): return _P5_INSTANCE.curveDetail(*args) def curveTightness(*args): return _P5_INSTANCE.curveTightness(*args) def curvePoint(*args): return _P5_INSTANCE.curvePoint(*args) def curveTangent(*args): return _P5_INSTANCE.curveTangent(*args) def beginContour(*args): return _P5_INSTANCE.beginContour(*args) def beginShape(*args): return _P5_INSTANCE.beginShape(*args) def bezierVertex(*args): return _P5_INSTANCE.bezierVertex(*args) def curveVertex(*args): return _P5_INSTANCE.curveVertex(*args) def endContour(*args): return _P5_INSTANCE.endContour(*args) def endShape(*args): return _P5_INSTANCE.endShape(*args) def quadraticVertex(*args): return _P5_INSTANCE.quadraticVertex(*args) def vertex(*args): return _P5_INSTANCE.vertex(*args) def cursor(*args): return _P5_INSTANCE.cursor(*args) def frameRate(*args): return _P5_INSTANCE.frameRate(*args) def noCursor(*args): return _P5_INSTANCE.noCursor(*args) def fullscreen(*args): return _P5_INSTANCE.fullscreen(*args) def pixelDensity(*args): return _P5_INSTANCE.pixelDensity(*args) def displayDensity(*args): return _P5_INSTANCE.displayDensity(*args) def getURL(*args): return _P5_INSTANCE.getURL(*args) def getURLPath(*args): return _P5_INSTANCE.getURLPath(*args) def getURLParams(*args): return _P5_INSTANCE.getURLParams(*args) def remove(*args): return _P5_INSTANCE.remove(*args) def noLoop(*args): return _P5_INSTANCE.noLoop(*args) def loop(*args): return _P5_INSTANCE.loop(*args) def push(*args): return _P5_INSTANCE.push(*args) def redraw(*args): return _P5_INSTANCE.redraw(*args) def resizeCanvas(*args): return _P5_INSTANCE.resizeCanvas(*args) def noCanvas(*args): return _P5_INSTANCE.noCanvas(*args) def createGraphics(*args): return _P5_INSTANCE.createGraphics(*args) def blendMode(*args): return _P5_INSTANCE.blendMode(*args) def setAttributes(*args): return _P5_INSTANCE.setAttributes(*args) def applyMatrix(*args): return _P5_INSTANCE.applyMatrix(*args) def resetMatrix(*args): return _P5_INSTANCE.resetMatrix(*args) def rotate(*args): return _P5_INSTANCE.rotate(*args) def rotateX(*args): return _P5_INSTANCE.rotateX(*args) def rotateY(*args): return _P5_INSTANCE.rotateY(*args) def rotateZ(*args): return _P5_INSTANCE.rotateZ(*args) def scale(*args): return _P5_INSTANCE.scale(*args) def shearX(*args): return _P5_INSTANCE.shearX(*args) def shearY(*args): return _P5_INSTANCE.shearY(*args) def translate(*args): return _P5_INSTANCE.translate(*args) def createStringDict(*args): return _P5_INSTANCE.createStringDict(*args) def createNumberDict(*args): return _P5_INSTANCE.createNumberDict(*args) def append(*args): return _P5_INSTANCE.append(*args) def arrayCopy(*args): return _P5_INSTANCE.arrayCopy(*args) def concat(*args): return _P5_INSTANCE.concat(*args) def reverse(*args): return _P5_INSTANCE.reverse(*args) def shorten(*args): return _P5_INSTANCE.shorten(*args) def shuffle(*args): return _P5_INSTANCE.shuffle(*args) def sort(*args): return _P5_INSTANCE.sort(*args) def splice(*args): return _P5_INSTANCE.splice(*args) def subset(*args): return _P5_INSTANCE.subset(*args) def float(*args): return _P5_INSTANCE.float(*args) def int(*args): return _P5_INSTANCE.int(*args) def str(*args): return _P5_INSTANCE.str(*args) def boolean(*args): return _P5_INSTANCE.boolean(*args) def byte(*args): return _P5_INSTANCE.byte(*args) def char(*args): return _P5_INSTANCE.char(*args) def unchar(*args): return _P5_INSTANCE.unchar(*args) def hex(*args): return _P5_INSTANCE.hex(*args) def unhex(*args): return _P5_INSTANCE.unhex(*args) def join(*args): return _P5_INSTANCE.join(*args) def match(*args): return _P5_INSTANCE.match(*args) def matchAll(*args): return _P5_INSTANCE.matchAll(*args) def nf(*args): return _P5_INSTANCE.nf(*args) def nfc(*args): return _P5_INSTANCE.nfc(*args) def nfp(*args): return _P5_INSTANCE.nfp(*args) def nfs(*args): return _P5_INSTANCE.nfs(*args) def split(*args): return _P5_INSTANCE.split(*args) def splitTokens(*args): return _P5_INSTANCE.splitTokens(*args) def trim(*args): return _P5_INSTANCE.trim(*args) def setMoveThreshold(*args): return _P5_INSTANCE.setMoveThreshold(*args) def setShakeThreshold(*args): return _P5_INSTANCE.setShakeThreshold(*args) def keyIsDown(*args): return _P5_INSTANCE.keyIsDown(*args) def createImage(*args): return _P5_INSTANCE.createImage(*args) def saveCanvas(*args): return _P5_INSTANCE.saveCanvas(*args) def saveFrames(*args): return _P5_INSTANCE.saveFrames(*args) def loadImage(*args): return _P5_INSTANCE.loadImage(*args) def image(*args): return _P5_INSTANCE.image(*args) def tint(*args): return _P5_INSTANCE.tint(*args) def noTint(*args): return _P5_INSTANCE.noTint(*args) def imageMode(*args): return _P5_INSTANCE.imageMode(*args) def blend(*args): return _P5_INSTANCE.blend(*args) def copy(*args): return _P5_INSTANCE.copy(*args) def filter(*args): if len(args) > 1 and (args[0] is None or callable(args[0])): return PythonFunctions.filter(*args) else: return _P5_INSTANCE.filter(*args) def get(*args): return _P5_INSTANCE.get(*args) def loadPixels(*args): return _P5_INSTANCE.loadPixels(*args) def set(*args): if len(args) <= 1: return PythonFunctions.set(*args) else: return _P5_INSTANCE.set(*args) def updatePixels(*args): return _P5_INSTANCE.updatePixels(*args) def loadJSON(*args): return _P5_INSTANCE.loadJSON(*args) def loadStrings(*args): return _P5_INSTANCE.loadStrings(*args) def loadTable(*args): return _P5_INSTANCE.loadTable(*args) def loadXML(*args): return _P5_INSTANCE.loadXML(*args) def loadBytes(*args): return _P5_INSTANCE.loadBytes(*args) def httpGet(*args): return _P5_INSTANCE.httpGet(*args) def httpPost(*args): return _P5_INSTANCE.httpPost(*args) def httpDo(*args): return _P5_INSTANCE.httpDo(*args) def createWriter(*args): return _P5_INSTANCE.createWriter(*args) def save(*args): return _P5_INSTANCE.save(*args) def saveJSON(*args): return _P5_INSTANCE.saveJSON(*args) def saveStrings(*args): return _P5_INSTANCE.saveStrings(*args) def saveTable(*args): return _P5_INSTANCE.saveTable(*args) def day(*args): return _P5_INSTANCE.day(*args) def hour(*args): return _P5_INSTANCE.hour(*args) def minute(*args): return _P5_INSTANCE.minute(*args) def millis(*args): return _P5_INSTANCE.millis(*args) def month(*args): return _P5_INSTANCE.month(*args) def second(*args): return _P5_INSTANCE.second(*args) def year(*args): return _P5_INSTANCE.year(*args) def createVector(*args): return _P5_INSTANCE.createVector(*args) def abs(*args): return _P5_INSTANCE.abs(*args) def ceil(*args): return _P5_INSTANCE.ceil(*args) def constrain(*args): return _P5_INSTANCE.constrain(*args) def dist(*args): return _P5_INSTANCE.dist(*args) def exp(*args): return _P5_INSTANCE.exp(*args) def floor(*args): return _P5_INSTANCE.floor(*args) def lerp(*args): return _P5_INSTANCE.lerp(*args) def log(*args): return _P5_INSTANCE.log(*args) def mag(*args): return _P5_INSTANCE.mag(*args) def map(*args): if len(args) > 1 and callable(args[0]): return PythonFunctions.map(*args) else: return _P5_INSTANCE.map(*args) def max(*args): return _P5_INSTANCE.max(*args) def min(*args): return _P5_INSTANCE.min(*args) def norm(*args): return _P5_INSTANCE.norm(*args) def pow(*args): return _P5_INSTANCE.pow(*args) def round(*args): return _P5_INSTANCE.round(*args) def sq(*args): return _P5_INSTANCE.sq(*args) def sqrt(*args): return _P5_INSTANCE.sqrt(*args) def noise(*args): return _P5_INSTANCE.noise(*args) def noiseDetail(*args): return _P5_INSTANCE.noiseDetail(*args) def noiseSeed(*args): return _P5_INSTANCE.noiseSeed(*args) def randomSeed(*args): return _P5_INSTANCE.randomSeed(*args) def random(*args): return _P5_INSTANCE.random(*args) def randomGaussian(*args): return _P5_INSTANCE.randomGaussian(*args) def acos(*args): return _P5_INSTANCE.acos(*args) def asin(*args): return _P5_INSTANCE.asin(*args) def atan(*args): return _P5_INSTANCE.atan(*args) def atan2(*args): return _P5_INSTANCE.atan2(*args) def cos(*args): return _P5_INSTANCE.cos(*args) def sin(*args): return _P5_INSTANCE.sin(*args) def tan(*args): return _P5_INSTANCE.tan(*args) def degrees(*args): return _P5_INSTANCE.degrees(*args) def radians(*args): return _P5_INSTANCE.radians(*args) def angleMode(*args): return _P5_INSTANCE.angleMode(*args) def textAlign(*args): return _P5_INSTANCE.textAlign(*args) def textLeading(*args): return _P5_INSTANCE.textLeading(*args) def textSize(*args): return _P5_INSTANCE.textSize(*args) def textStyle(*args): return _P5_INSTANCE.textStyle(*args) def textWidth(*args): return _P5_INSTANCE.textWidth(*args) def textAscent(*args): return _P5_INSTANCE.textAscent(*args) def textDescent(*args): return _P5_INSTANCE.textDescent(*args) def loadFont(*args): return _P5_INSTANCE.loadFont(*args) def text(*args): return _P5_INSTANCE.text(*args) def textFont(*args): return _P5_INSTANCE.textFont(*args) def orbitControl(*args): return _P5_INSTANCE.orbitControl(*args) def debugMode(*args): return _P5_INSTANCE.debugMode(*args) def noDebugMode(*args): return _P5_INSTANCE.noDebugMode(*args) def ambientLight(*args): return _P5_INSTANCE.ambientLight(*args) def directionalLight(*args): return _P5_INSTANCE.directionalLight(*args) def pointLight(*args): return _P5_INSTANCE.pointLight(*args) def lights(*args): return _P5_INSTANCE.lights(*args) def loadShader(*args): return _P5_INSTANCE.loadShader(*args) def createShader(*args): return _P5_INSTANCE.createShader(*args) def shader(*args): return _P5_INSTANCE.shader(*args) def resetShader(*args): return _P5_INSTANCE.resetShader(*args) def normalMaterial(*args): return _P5_INSTANCE.normalMaterial(*args) def texture(*args): return _P5_INSTANCE.texture(*args) def textureMode(*args): return _P5_INSTANCE.textureMode(*args) def textureWrap(*args): return _P5_INSTANCE.textureWrap(*args) def ambientMaterial(*args): return _P5_INSTANCE.ambientMaterial(*args) def specularMaterial(*args): return _P5_INSTANCE.specularMaterial(*args) def shininess(*args): return _P5_INSTANCE.shininess(*args) def camera(*args): return _P5_INSTANCE.camera(*args) def perspective(*args): return _P5_INSTANCE.perspective(*args) def ortho(*args): return _P5_INSTANCE.ortho(*args) def createCamera(*args): return _P5_INSTANCE.createCamera(*args) def setCamera(*args): return _P5_INSTANCE.setCamera(*args) def select(*args): return _P5_INSTANCE.select(*args) def selectAll(*args): return _P5_INSTANCE.selectAll(*args) def removeElements(*args): return _P5_INSTANCE.removeElements(*args) def changed(*args): return _P5_INSTANCE.changed(*args) def input(*args): return _P5_INSTANCE.input(*args) def createDiv(*args): return _P5_INSTANCE.createDiv(*args) def createP(*args): return _P5_INSTANCE.createP(*args) def createSpan(*args): return _P5_INSTANCE.createSpan(*args) def createImg(*args): return _P5_INSTANCE.createImg(*args) def createA(*args): return _P5_INSTANCE.createA(*args) def createSlider(*args): return _P5_INSTANCE.createSlider(*args) def createButton(*args): return _P5_INSTANCE.createButton(*args) def createCheckbox(*args): return _P5_INSTANCE.createCheckbox(*args) def createSelect(*args): return _P5_INSTANCE.createSelect(*args) def createRadio(*args): return _P5_INSTANCE.createRadio(*args) def createColorPicker(*args): return _P5_INSTANCE.createColorPicker(*args) def createInput(*args): return _P5_INSTANCE.createInput(*args) def createFileInput(*args): return _P5_INSTANCE.createFileInput(*args) def createVideo(*args): return _P5_INSTANCE.createVideo(*args) def createAudio(*args): return _P5_INSTANCE.createAudio(*args) def createCapture(*args): return _P5_INSTANCE.createCapture(*args) def createElement(*args): return _P5_INSTANCE.createElement(*args) def createCanvas(*args): canvas = _P5_INSTANCE.createCanvas(*args) global width, height width = _P5_INSTANCE.width height = _P5_INSTANCE.height return canvas def __deviceMoved(e): try: _bind_event_function(deviceMoved, e) except NameError: pass def __deviceTurned(e): try: _bind_event_function(deviceTurned, e) except NameError: pass def __deviceShaken(e): try: _bind_event_function(deviceShaken, e) except NameError: pass def __touchEnded(e): try: _bind_event_function(deviceShaken, e) except NameError: pass def __touchStarted(e): try: _bind_event_function(touchStarted, e) except NameError: pass def __windowResized(e): try: _bind_event_function(windowResized, e) except NameError: pass def __touchMoved(e): try: _bind_event_function(touchMoved, e) except NameError: pass def __mouseMoved(e): try: _bind_event_function(mouseMoved, e) except NameError: pass def __mouseDragged(e): try: _bind_event_function(mouseDragged, e) except NameError: pass def __mousePressed(e): try: _bind_event_function(mousePressed, e) except NameError: pass def __mouseReleased(e): try: _bind_event_function(mouseReleased, e) except NameError: pass def __mouseClicked(e): try: _bind_event_function(mouseClicked, e) except NameError: pass def __doubleClicked(e): try: _bind_event_function(doubleClicked, e) except NameError: pass def __mouseWheel(e): try: _bind_event_function(mouseWheel, e) except NameError: pass def __keyPressed(e): try: _bind_event_function(keyPressed, e) except NameError: pass def __keyReleased(e): try: _bind_event_function(keyReleased, e) except NameError: pass def __keyTyped(e): try: _bind_event_function(keyTyped, e) except NameError: pass def __keyIsDown(e): try: _bind_event_function(keyIsDown, e) except NameError: pass def pop(*args): p5_pop = _P5_INSTANCE.pop(*args) return p5_pop # Processing Python or Java mode compatibility aliases size = createCanvas popMatrix = pop popStyle = pop pushMatrix = push pushStyle = push # PVector is a wrapper/helper class for p5.Vector objets # providing names similar to Processing Python or Java modes # but mostly keeping p5js functionality from numbers import Number class PVector: def __init__(self, x=0, y=0, z=0): self.__vector = createVector(x, y, z) self.add = self.__instance_add__ self.sub = self.__instance_sub__ self.mult = self.__instance_mult__ self.div = self.__instance_div__ self.cross = self.__instance_cross__ self.dist = self.__instance_dist__ self.dot = self.__instance_dot__ self.lerp = self.__instance_lerp__ @property def x(self): return self.__vector.x @x.setter def x(self, x): self.__vector.x = x @property def y(self): return self.__vector.y @y.setter def y(self, y): self.__vector.y = y @property def z(self): return self.__vector.z @z.setter def z(self, z): self.__vector.z = z def mag(self): return self.__vector.mag() def magSq(self): return self.__vector.magSq() def setMag(self, mag): self.__vector.setMag(mag) return self def normalize(self): self.__vector.normalize() return self def limit(self, max): self.__vector.limit(max) return self def heading(self): return self.__vector.heading() def rotate(self, angle): self.__vector.rotate(angle) return self def __instance_add__(self, *args): if len(args) == 1: return PVector.add(self, args[0], self) else: return PVector.add(self, PVector(*args), self) def __instance_sub__(self, *args): if len(args) == 1: return PVector.sub(self, args[0], self) else: return PVector.sub(self, PVector(*args), self) def __instance_mult__(self, o): return PVector.mult(self, o, self) def __instance_div__(self, f): return PVector.div(self, f, self) def __instance_cross__(self, o): return PVector.cross(self, o, self) def __instance_dist__(self, o): return PVector.dist(self, o) def __instance_dot__(self, *args): if len(args) == 1: v = args[0] else: v = args return self.x * v[0] + self.y * v[1] + self.z * v[2] def __instance_lerp__(self, *args): if len(args) == 2: return PVector.lerp(self, args[0], args[1], self) else: vx, vy, vz, f = args return PVector.lerp(self, PVector(vx, vy, vz), f, self) def get(self): return PVector(self.x, self.y, self.z) def copy(self): return PVector(self.x, self.y, self.z) def __getitem__(self, k): return getattr(self, ('x', 'y', 'z')[k]) def __setitem__(self, k, v): setattr(self, ('x', 'y', 'z')[k], v) def __copy__(self): return PVector(self.x, self.y, self.z) def __deepcopy__(self, memo): return PVector(self.x, self.y, self.z) def __repr__(self): # PROVISÓRIO return f'PVector({self.x}, {self.y}, {self.z})' def set(self, *args): """ Sets the x, y, and z component of the vector using two or three separate variables, the data from a p5.Vector, or the values from a float array. """ self.__vector.set(*args) @classmethod def add(cls, a, b, dest=None): if dest is None: return PVector(a.x + b[0], a.y + b[1], a.z + b[2]) dest.__vector.set(a.x + b[0], a.y + b[1], a.z + b[2]) return dest @classmethod def sub(cls, a, b, dest=None): if dest is None: return PVector(a.x - b[0], a.y - b[1], a.z - b[2]) dest.__vector.set(a.x - b[0], a.y - b[1], a.z - b[2]) return dest @classmethod def mult(cls, a, b, dest=None): if dest is None: return PVector(a.x * b, a.y * b, a.z * b) dest.__vector.set(a.x * b, a.y * b, a.z * b) return dest @classmethod def div(cls, a, b, dest=None): if dest is None: return PVector(a.x / b, a.y / b, a.z / b) dest.__vector.set(a.x / b, a.y / b, a.z / b) return dest @classmethod def dist(cls, a, b): return a.__vector.dist(b.__vector) @classmethod def dot(cls, a, b): return a.__vector.dot(b.__vector) def __add__(a, b): return PVector.add(a, b, None) def __sub__(a, b): return PVector.sub(a, b, None) def __isub__(a, b): a.sub(b) return a def __iadd__(a, b): a.add(b) return a def __mul__(a, b): if not isinstance(b, Number): raise TypeError( "The * operator can only be used to multiply a PVector by a number") return PVector.mult(a, float(b), None) def __rmul__(a, b): if not isinstance(b, Number): raise TypeError( "The * operator can only be used to multiply a PVector by a number") return PVector.mult(a, float(b), None) def __imul__(a, b): if not isinstance(b, Number): raise TypeError( "The *= operator can only be used to multiply a PVector by a number") a.__vector.mult(float(b)) return a def __truediv__(a, b): if not isinstance(b, Number): raise TypeError( "The * operator can only be used to multiply a PVector by a number") return PVector(a.x / float(b), a.y / float(b), a.z / float(b)) def __itruediv__(a, b): if not isinstance(b, Number): raise TypeError( "The /= operator can only be used to multiply a PVector by a number") a.__vector.set(a.x / float(b), a.y / float(b), a.z / float(b)) return a def __eq__(a, b): return a.x == b[0] and a.y == b[1] and a.z == b[2] def __lt__(a, b): return a.magSq() < b.magSq() def __le__(a, b): return a.magSq() <= b.magSq() def __gt__(a, b): return a.magSq() > b.magSq() def __ge__(a, b): return a.magSq() >= b.magSq() # Problematic class methods, we would rather use p5.Vector when possible... @classmethod def lerp(cls, a, b, f, dest=None): v = createVector(a.x, a.y, a.z) v.lerp(b.__vector, f) if dest is None: return PVector(v.x, v.y, v.z) dest.set(v.x, v.y, v.z) return dest @classmethod def cross(cls, a, b, dest=None): x = a.y * b[2] - b[1] * a.z y = a.z * b[0] - b[2] * a.x z = a.x * b[1] - b[0] * a.y if dest is None: return PVector(x, y, z) dest.set(x, y, z) return dest @classmethod def fromAngle(cls, angle, length=1): # https://github.com/processing/p5.js/blob/3f0b2f0fe575dc81c724474154f5b23a517b7233/src/math/p5.Vector.js return PVector(length * cos(angle), length * sin(angle), 0) @classmethod def fromAngles(theta, phi, length=1): # https://github.com/processing/p5.js/blob/3f0b2f0fe575dc81c724474154f5b23a517b7233/src/math/p5.Vector.js cosPhi = cos(phi) sinPhi = sin(phi) cosTheta = cos(theta) sinTheta = sin(theta) return PVector(length * sinTheta * sinPhi, -length * cosTheta, length * sinTheta * cosPhi) @classmethod def random2D(cls): return PVector.fromAngle(random(TWO_PI)) @classmethod def random3D(cls, dest=None): angle = random(TWO_PI) vz = random(2) - 1 mult = sqrt(1 - vz * vz) vx = mult * cos(angle) vy = mult * sin(angle) if dest is None: return PVector(vx, vy, vz) dest.set(vx, vy, vz) return dest @classmethod def angleBetween(cls, a, b): return acos(a.dot(b) / sqrt(a.magSq() * b.magSq())) # Other harmless p5js methods def equals(self, v): return self == v def heading2D(self): return self.__vector.heading() def reflect(self, *args): # Reflect the incoming vector about a normal to a line in 2D, or about # a normal to a plane in 3D This method acts on the vector directly r = self.__vector.reflect(*args) return r def array(self): # Return a representation of this vector as a float array. This is only # for temporary use. If used in any w fashion, the contents should be # copied by using the p5.Vector.copy() method to copy into your own # array. return self.__vector.array() def toString(self): # Returns a string representation of a vector v by calling String(v) or v.toString(). # return self.__vector.toString() would be something like "p5.vector # Object […, …, …]" return str(self) def rem(self, *args): # Gives remainder of a vector when it is divided by anw vector. See # examples for more context. self.__vector.rem(*args) return self def pre_draw(p5_instance, draw_func, *args, **kwargs): """ We need to run this before the actual draw to insert and update p5 env variables """ global _CTX_MIDDLE, _DEFAULT_FILL, _DEFAULT_LEADMULT, _DEFAULT_STROKE, _DEFAULT_TEXT_FILL global ADD, ALT, ARROW, AUTO, AUDIO, AXES, BACKSPACE, BASELINE, BEVEL, BEZIER, BLEND, BLUR, BOLD, BOLDITALIC global BOTTOM, BURN, CENTER, CHORD, CLAMP, CLOSE, CONTROL, CORNER, CORNERS, CROSS, CURVE, DARKEST global DEG_TO_RAD, DEGREES, DELETE, DIFFERENCE, DILATE, DODGE, DOWN_ARROW, ENTER, ERODE, ESCAPE, EXCLUSION global FILL, GRAY, GRID, HALF_PI, HAND, HARD_LIGHT, HSB, HSL, IMAGE, IMMEDIATE, INVERT, ITALIC, LANDSCAPE global LEFT, LEFT_ARROW, LIGHTEST, LINE_LOOP, LINE_STRIP, LINEAR, LINES, MIRROR, MITER, MOVE, MULTIPLY, NEAREST global NORMAL, OPAQUE, OPEN, OPTION, OVERLAY, P2D, P3D, PI, PIE, POINTS, PORTRAIT, POSTERIZE, PROJECT, QUAD_STRIP global QUADRATIC, QUADS, QUARTER_PI, RAD_TO_DEG, RADIANS, RADIUS, REPEAT, REPLACE, RETURN, RGB, RIGHT, RIGHT_ARROW global ROUND, SCREEN, SHIFT, SOFT_LIGHT, SQUARE, STROKE, SUBTRACT, TAB, TAU, TEXT, TEXTURE, THRESHOLD, TOP global TRIANGLE_FAN, TRIANGLE_STRIP, TRIANGLES, TWO_PI, UP_ARROW, VIDEO, WAIT, WEBGL global frameCount, focused, displayWidth, displayHeight, windowWidth, windowHeight, width, height global deviceOrientation, accelerationX, accelerationY, accelerationZ global pAccelerationX, pAccelerationY, pAccelerationZ, rotationX, rotationY, rotationZ global pRotationX, pRotationY, pRotationZ, turnAxis, keyIsPressed, key, keyCode, mouseX, mouseY, pmouseX, pmouseY global winMouseX, winMouseY, pwinMouseX, pwinMouseY, mouseButton, mouseIsPressed, touches, pixels _CTX_MIDDLE = p5_instance._CTX_MIDDLE _DEFAULT_FILL = p5_instance._DEFAULT_FILL _DEFAULT_LEADMULT = p5_instance._DEFAULT_LEADMULT _DEFAULT_STROKE = p5_instance._DEFAULT_STROKE _DEFAULT_TEXT_FILL = p5_instance._DEFAULT_TEXT_FILL ADD = p5_instance.ADD ALT = p5_instance.ALT ARROW = p5_instance.ARROW AUDIO = p5_instance.AUDIO AUTO = p5_instance.AUTO AXES = p5_instance.AXES BACKSPACE = p5_instance.BACKSPACE BASELINE = p5_instance.BASELINE BEVEL = p5_instance.BEVEL BEZIER = p5_instance.BEZIER BLEND = p5_instance.BLEND BLUR = p5_instance.BLUR BOLD = p5_instance.BOLD BOLDITALIC = p5_instance.BOLDITALIC BOTTOM = p5_instance.BOTTOM BURN = p5_instance.BURN CENTER = p5_instance.CENTER CHORD = p5_instance.CHORD CLAMP = p5_instance.CLAMP CLOSE = p5_instance.CLOSE CONTROL = p5_instance.CONTROL CORNER = p5_instance.CORNER CORNERS = p5_instance.CORNERS CROSS = p5_instance.CROSS CURVE = p5_instance.CURVE DARKEST = p5_instance.DARKEST DEG_TO_RAD = p5_instance.DEG_TO_RAD DEGREES = p5_instance.DEGREES DELETE = p5_instance.DELETE DIFFERENCE = p5_instance.DIFFERENCE DILATE = p5_instance.DILATE DODGE = p5_instance.DODGE DOWN_ARROW = p5_instance.DOWN_ARROW ENTER = p5_instance.ENTER ERODE = p5_instance.ERODE ESCAPE = p5_instance.ESCAPE EXCLUSION = p5_instance.EXCLUSION FILL = p5_instance.FILL GRAY = p5_instance.GRAY GRID = p5_instance.GRID HALF_PI = p5_instance.HALF_PI HAND = p5_instance.HAND HARD_LIGHT = p5_instance.HARD_LIGHT HSB = p5_instance.HSB HSL = p5_instance.HSL IMAGE = p5_instance.IMAGE IMMEDIATE = p5_instance.IMMEDIATE INVERT = p5_instance.INVERT ITALIC = p5_instance.ITALIC LANDSCAPE = p5_instance.LANDSCAPE LEFT = p5_instance.LEFT LEFT_ARROW = p5_instance.LEFT_ARROW LIGHTEST = p5_instance.LIGHTEST LINE_LOOP = p5_instance.LINE_LOOP LINE_STRIP = p5_instance.LINE_STRIP LINEAR = p5_instance.LINEAR LINES = p5_instance.LINES MIRROR = p5_instance.MIRROR MITER = p5_instance.MITER MOVE = p5_instance.MOVE MULTIPLY = p5_instance.MULTIPLY NEAREST = p5_instance.NEAREST NORMAL = p5_instance.NORMAL OPAQUE = p5_instance.OPAQUE OPEN = p5_instance.OPEN OPTION = p5_instance.OPTION OVERLAY = p5_instance.OVERLAY P2D = p5_instance.P2D P3D = p5_instance.WEBGL PI = p5_instance.PI PIE = p5_instance.PIE POINTS = p5_instance.POINTS PORTRAIT = p5_instance.PORTRAIT POSTERIZE = p5_instance.POSTERIZE PROJECT = p5_instance.PROJECT QUAD_STRIP = p5_instance.QUAD_STRIP QUADRATIC = p5_instance.QUADRATIC QUADS = p5_instance.QUADS QUARTER_PI = p5_instance.QUARTER_PI RAD_TO_DEG = p5_instance.RAD_TO_DEG RADIANS = p5_instance.RADIANS RADIUS = p5_instance.RADIUS REPEAT = p5_instance.REPEAT REPLACE = p5_instance.REPLACE RETURN = p5_instance.RETURN RGB = p5_instance.RGB RIGHT = p5_instance.RIGHT RIGHT_ARROW = p5_instance.RIGHT_ARROW ROUND = p5_instance.ROUND SCREEN = p5_instance.SCREEN SHIFT = p5_instance.SHIFT SOFT_LIGHT = p5_instance.SOFT_LIGHT SQUARE = p5_instance.SQUARE STROKE = p5_instance.STROKE SUBTRACT = p5_instance.SUBTRACT TAB = p5_instance.TAB TAU = p5_instance.TAU TEXT = p5_instance.TEXT TEXTURE = p5_instance.TEXTURE THRESHOLD = p5_instance.THRESHOLD TOP = p5_instance.TOP TRIANGLE_FAN = p5_instance.TRIANGLE_FAN TRIANGLE_STRIP = p5_instance.TRIANGLE_STRIP TRIANGLES = p5_instance.TRIANGLES TWO_PI = p5_instance.TWO_PI UP_ARROW = p5_instance.UP_ARROW VIDEO = p5_instance.VIDEO WAIT = p5_instance.WAIT WEBGL = p5_instance.WEBGL frameCount = p5_instance.frameCount focused = p5_instance.focused displayWidth = p5_instance.displayWidth displayHeight = p5_instance.displayHeight windowWidth = p5_instance.windowWidth windowHeight = p5_instance.windowHeight width = p5_instance.width height = p5_instance.height deviceOrientation = p5_instance.deviceOrientation accelerationX = p5_instance.accelerationX accelerationY = p5_instance.accelerationY accelerationZ = p5_instance.accelerationZ pAccelerationX = p5_instance.pAccelerationX pAccelerationY = p5_instance.pAccelerationY pAccelerationZ = p5_instance.pAccelerationZ rotationX = p5_instance.rotationX rotationY = p5_instance.rotationY rotationZ = p5_instance.rotationZ pRotationX = p5_instance.pRotationX pRotationY = p5_instance.pRotationY pRotationZ = p5_instance.pRotationZ turnAxis = p5_instance.turnAxis keyIsPressed = p5_instance.keyIsPressed key = p5_instance.key keyCode = p5_instance.keyCode mouseX = p5_instance.mouseX mouseY = p5_instance.mouseY pmouseX = p5_instance.pmouseX pmouseY = p5_instance.pmouseY winMouseX = p5_instance.winMouseX winMouseY = p5_instance.winMouseY pwinMouseX = p5_instance.pwinMouseX pwinMouseY = p5_instance.pwinMouseY mouseButton = p5_instance.mouseButton mouseIsPressed = p5_instance.mouseIsPressed touches = p5_instance.touches pixels = p5_instance.pixels return draw_func(*args, **kwargs) def global_p5_injection(p5_sketch): """ Injects the p5js's skecth instance as a global variable to setup and draw functions """ def decorator(f, *args, **kwargs): def wrapper(*args, **kwargs): global _P5_INSTANCE _P5_INSTANCE = p5_sketch return pre_draw(_P5_INSTANCE, f, *args, **kwargs) return wrapper return decorator def start_p5(preload_func, setup_func, draw_func, event_functions): """ This is the entrypoint function. It accepts 2 parameters: - preload_func: A Python preload callable - setup_func: a Python setup callable - draw_func: a Python draw callable - event_functions: a config dict for the event functions in the format: {"eventFunctionName": python_event_function} This method gets the p5js's sketch instance and injects them """ def sketch_setup(p5_sketch): """ Callback function called to configure new p5 instance """ p5_sketch.preload = global_p5_injection(p5_sketch)(preload_func) p5_sketch.setup = global_p5_injection(p5_sketch)(setup_func) p5_sketch.draw = global_p5_injection(p5_sketch)(draw_func) window.instance = p5.new(sketch_setup, 'sketch-holder') # Register event functions event_function_names = ( "deviceMoved", "deviceTurned", "deviceShaken", "windowResized", "keyPressed", "keyReleased", "keyTyped", "mousePressed", "mouseReleased", "mouseClicked", "doubleClicked", "mouseMoved", "mouseDragged", "mouseWheel", "touchStarted", "touchMoved", "touchEnded", "keyIsDown", ) for f_name in [f for f in event_function_names if event_functions.get(f, None)]: func = event_functions[f_name] event_func = global_p5_injection(window.instance)(func) setattr(window.instance, f_name, event_func) `; const placeholder = ` def preload(): pass def setup(): pass def draw(): pass deviceMoved = None deviceTurned = None deviceShaken = None keyPressed = None keyReleased = None keyTyped = None mouseMoved = None mouseDragged = None mousePressed = None mouseReleased = None mouseClicked = None doubleClicked = None mouseWheel = None touchStarted = None touchMoved = None touchEnded = None windowResized = None `; let userCode = ` from random import choice images = [] def setup(): global images createP("Click to add a new image") createCanvas(600, 600) background(200) images = [ loadImage('smile.png'), loadImage('alien.png'), loadImage('rainbow.png'), ] def mousePressed(): x, y = mouseX, mouseY img = choice(images) image(img, x, y) def draw(): pass `; const startCode = ` event_functions = { "deviceMoved": deviceMoved, "deviceTurned": deviceTurned, "deviceShaken": deviceShaken, "keyPressed": keyPressed, "keyReleased": keyReleased, "keyTyped": keyTyped, "mouseMoved": mouseMoved, "mouseDragged": mouseDragged, "mousePressed": mousePressed, "mouseReleased": mouseReleased, "mouseClicked": mouseClicked, "doubleClicked": doubleClicked, "mouseWheel": mouseWheel, "touchStarted": touchStarted, "touchMoved": touchMoved, "touchEnded": touchEnded, "windowResized": windowResized, } start_p5(preload, setup, draw, event_functions) `; function runCode() { let code = [ placeholder, userCode, wrapperContent, startCode, ].join('\n'); if (window.instance) { window.instance.canvas.remove(); } console.log("Python execution output:"); window.pyodide.runPython(code); } async function main() { const config = { indexURL : "https://cdn.jsdelivr.net/pyodide/v0.18.1/full/", fullStdLib: false, } window.pyodide = await loadPyodide(config); // Pyodide is now ready to use... console.log(window.pyodide.runPython(` import io, code, sys from js import p5, window, document print(sys.version) `)); window.runSketchCode = (code) => { userCode = code; runCode(); } runCode(); }; // async method main(); ================================================ FILE: docs/examples/pyodide/sketch_010/index.html ================================================ sketch_010 - pyp5js

Python code here.

MY_POINTS = [(100, 50), (300, 100), (200, 300), (100, 300)]

WIDTH =  400
HEIGHT = 400
FRAME_IDX = 0
POINT_SIZE = 10
BUTT_Y = HEIGHT
BUTT_PREV_X = 0
BUTT_NEXT_X = WIDTH // 2
BUTT_WIDTH  = WIDTH // 2 - 1
BUTT_HEIGHT = 30

buttons = {"prev": (BUTT_PREV_X, BUTT_Y, BUTT_WIDTH, BUTT_HEIGHT),
           "next": (BUTT_NEXT_X, BUTT_Y, BUTT_WIDTH, BUTT_HEIGHT)} # x, y, w, h
cnv = None

def setup():

    global cnv
    cnv = createCanvas(400, 400)

    button_prev = createButton('Previous frame')
    button_prev.position(BUTT_PREV_X, BUTT_Y)
    button_prev.size(BUTT_WIDTH,BUTT_HEIGHT)
    
    button_next = createButton('Next frame')
    button_next.position(BUTT_NEXT_X, BUTT_Y)
    button_next.size(BUTT_WIDTH,BUTT_HEIGHT)
    
    background(190)
    draw_labels(MY_POINTS)

def inButton(butt_kind, x, y):
    try:
        bx, by, bw, bh = buttons[butt_kind]
    except:
        return False
    return (bx < x < bx + bw ) and (by < y < by + bh)
     
def draw():
    background(190)
    draw_closed_curve_vertex(MY_POINTS, FRAME_IDX)
    draw_labels(MY_POINTS)

def mouseClicked():
    global FRAME_IDX
    global MY_POINTS
    x, y = mouseX, mouseY
    if inCanvas(x, y):
        i = get_point_index(y, y)
        if i != None:
            MY_POINTS.pop(i)
            if FRAME_IDX >= len(MY_POINTS):
                # cap i if it exceeds maximum length now.
                FRAME_IDX = len(MY_POINTS) - 1
        else:
            MY_POINTS.append((x, y))
    elif inButton("prev", x, y):
        FRAME_IDX = max(0, FRAME_IDX - 1)
    elif inButton("next", x, y):
        FRAME_IDX = min(len(MY_POINTS) -1, FRAME_IDX + 1) 
    
def get_point_index(x, y):
    for idx, (p_x, p_y) in enumerate(MY_POINTS):
        if ((p_x - POINT_SIZE < x < p_x + POINT_SIZE) and 
            (p_y - POINT_SIZE < y < p_y + POINT_SIZE)):
            return idx

def inCanvas(x, y):
    return  (0 <=  x <= WIDTH) and (0 <= y <= HEIGHT)


def draw_closed_curve_vertex(points, max_idx):
    if len(points) < 2:
        return
    used_points = []
    beginShape()

    # start by using the last point as the initial control point
    idx = len(points) - 1
    curveVertex(*points[idx])
    used_points.append(idx)

    # add each point to the curve
    for idx,p in enumerate(points):
        if idx > max_idx:
            break
        curveVertex(*p)
        used_points.append(idx)

    # to close the curve, we need to create the last curve.
    # for that, we must go to the first point
    idx = 0
    curveVertex(*points[idx])
    used_points.append(idx)

    # and use the next point as a control point.
    idx = 1
    curveVertex(*points[idx])
    used_points.append(idx)
    endShape()

    textSize(10)
    noStroke()
    text('Points used to draw this curve (first and last are control points only)', 5, cnv.height - 30)

    textSize(20)
    text(', '.join([str(p) for p in used_points]), 10, cnv.height - 10)
    stroke(0)

    for i in range(len(used_points) - 1):
        draw_dotted_line(points[used_points[i]],
                         points[used_points[i + 1]])

def draw_labels(points):
    strokeWeight(POINT_SIZE)
    for idx, (px, py) in enumerate(points):
        ts = 32
        textSize(ts)
        textY = py - ts / 2

        if py > cnv.height / 2:
            textY = py + ts

        noStroke()
        text(idx, px, textY)
        stroke(0)
        point(px, py)

    strokeWeight(1)

def draw_dotted_line(p1, p2):
    stroke(100)
    strokeWeight(3)
    for i in range(11):
        x = lerp(p1[0], p2[0], i/10)
        y = lerp(p1[1], p2[1], i/10)
        point(x, y)

    stroke(0)
    strokeWeight(1)
================================================ FILE: docs/examples/pyodide/sketch_010/sketch_010.py ================================================ MY_POINTS = [(100, 50), (300, 100), (200, 300), (100, 300)] WIDTH = 400 HEIGHT = 400 FRAME_IDX = 0 POINT_SIZE = 10 BUTT_Y = HEIGHT BUTT_PREV_X = 0 BUTT_NEXT_X = WIDTH // 2 BUTT_WIDTH = WIDTH // 2 - 1 BUTT_HEIGHT = 30 buttons = {"prev": (BUTT_PREV_X, BUTT_Y, BUTT_WIDTH, BUTT_HEIGHT), "next": (BUTT_NEXT_X, BUTT_Y, BUTT_WIDTH, BUTT_HEIGHT)} # x, y, w, h cnv = None def setup(): global cnv cnv = createCanvas(400, 400) button_prev = createButton('Previous frame') button_prev.position(BUTT_PREV_X, BUTT_Y) button_prev.size(BUTT_WIDTH,BUTT_HEIGHT) button_next = createButton('Next frame') button_next.position(BUTT_NEXT_X, BUTT_Y) button_next.size(BUTT_WIDTH,BUTT_HEIGHT) background(190) draw_labels(MY_POINTS) def inButton(butt_kind, x, y): try: bx, by, bw, bh = buttons[butt_kind] except: return False return (bx < x < bx + bw ) and (by < y < by + bh) def draw(): background(190) draw_closed_curve_vertex(MY_POINTS, FRAME_IDX) draw_labels(MY_POINTS) def mouseClicked(): global FRAME_IDX global MY_POINTS x, y = mouseX, mouseY if inCanvas(x, y): i = get_point_index(y, y) if i != None: MY_POINTS.pop(i) if FRAME_IDX >= len(MY_POINTS): # cap i if it exceeds maximum length now. FRAME_IDX = len(MY_POINTS) - 1 else: MY_POINTS.append((x, y)) elif inButton("prev", x, y): FRAME_IDX = max(0, FRAME_IDX - 1) elif inButton("next", x, y): FRAME_IDX = min(len(MY_POINTS) -1, FRAME_IDX + 1) def get_point_index(x, y): for idx, (p_x, p_y) in enumerate(MY_POINTS): if ((p_x - POINT_SIZE < x < p_x + POINT_SIZE) and (p_y - POINT_SIZE < y < p_y + POINT_SIZE)): return idx def inCanvas(x, y): return (0 <= x <= WIDTH) and (0 <= y <= HEIGHT) def draw_closed_curve_vertex(points, max_idx): if len(points) < 2: return used_points = [] beginShape() # start by using the last point as the initial control point idx = len(points) - 1 curveVertex(*points[idx]) used_points.append(idx) # add each point to the curve for idx,p in enumerate(points): if idx > max_idx: break curveVertex(*p) used_points.append(idx) # to close the curve, we need to create the last curve. # for that, we must go to the first point idx = 0 curveVertex(*points[idx]) used_points.append(idx) # and use the next point as a control point. idx = 1 curveVertex(*points[idx]) used_points.append(idx) endShape() textSize(10) noStroke() text('Points used to draw this curve (first and last are control points only)', 5, cnv.height - 30) textSize(20) text(', '.join([str(p) for p in used_points]), 10, cnv.height - 10) stroke(0) for i in range(len(used_points) - 1): draw_dotted_line(points[used_points[i]], points[used_points[i + 1]]) def draw_labels(points): strokeWeight(POINT_SIZE) for idx, (px, py) in enumerate(points): ts = 32 textSize(ts) textY = py - ts / 2 if py > cnv.height / 2: textY = py + ts noStroke() text(idx, px, textY) stroke(0) point(px, py) strokeWeight(1) def draw_dotted_line(p1, p2): stroke(100) strokeWeight(3) for i in range(11): x = lerp(p1[0], p2[0], i/10) y = lerp(p1[1], p2[1], i/10) point(x, y) stroke(0) strokeWeight(1) ================================================ FILE: docs/examples/pyodide/sketch_010/static/p5.js ================================================ /*! p5.js v1.0.0 February 29, 2020 */ !function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).p5=e()}}(function(){return function o(a,s,l){function u(t,e){if(!s[t]){if(!a[t]){var r="function"==typeof require&&require;if(!e&&r)return r(t,!0);if(h)return h(t,!0);var i=new Error("Cannot find module '"+t+"'");throw i.code="MODULE_NOT_FOUND",i}var n=s[t]={exports:{}};a[t][0].call(n.exports,function(e){return u(a[t][1][e]||e)},n,n.exports,o,a,s,l)}return s[t].exports}for(var h="function"==typeof require&&require,e=0;e>16&255,a[s++]=t>>8&255,a[s++]=255&t;2===o&&(t=u[e.charCodeAt(r)]<<2|u[e.charCodeAt(r+1)]>>4,a[s++]=255&t);1===o&&(t=u[e.charCodeAt(r)]<<10|u[e.charCodeAt(r+1)]<<4|u[e.charCodeAt(r+2)]>>2,a[s++]=t>>8&255,a[s++]=255&t);return a},r.fromByteArray=function(e){for(var t,r=e.length,i=r%3,n=[],o=0,a=r-i;o>2]+s[t<<4&63]+"==")):2==i&&(t=(e[r-2]<<8)+e[r-1],n.push(s[t>>10]+s[t>>4&63]+s[t<<2&63]+"="));return n.join("")};for(var s=[],u=[],h="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=0,o=i.length;n>18&63]+s[n>>12&63]+s[n>>6&63]+s[63&n]);return o.join("")}u["-".charCodeAt(0)]=62,u["_".charCodeAt(0)]=63},{}],20:[function(e,t,r){},{}],21:[function(N,e,F){(function(c){"use strict";var i=N("base64-js"),o=N("ieee754"),e="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;F.Buffer=c,F.SlowBuffer=function(e){+e!=e&&(e=0);return c.alloc(+e)},F.INSPECT_MAX_BYTES=50;var r=2147483647;function a(e){if(r>>1;case"base64":return O(e).length;default:if(n)return i?-1:R(e).length;t=(""+t).toLowerCase(),n=!0}}function d(e,t,r){var i=e[t];e[t]=e[r],e[r]=i}function p(e,t,r,i,n){if(0===e.length)return-1;if("string"==typeof r?(i=r,r=0):2147483647=e.length){if(n)return-1;r=e.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof t&&(t=c.from(t,i)),c.isBuffer(t))return 0===t.length?-1:m(e,t,r,i,n);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):m(e,[t],r,i,n);throw new TypeError("val must be string, number or Buffer")}function m(e,t,r,i,n){var o,a=1,s=e.length,l=t.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(e.length<2||t.length<2)return-1;s/=a=2,l/=2,r/=2}function u(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(n){var h=-1;for(o=r;o>8,n=r%256,o.push(n),o.push(i);return o}(t,e.length-r),e,r,i)}function b(e,t,r){return 0===t&&r===e.length?i.fromByteArray(e):i.fromByteArray(e.slice(t,r))}function _(e,t,r){r=Math.min(e.length,r);for(var i=[],n=t;n>>10&1023|55296),h=56320|1023&h),i.push(h),n+=c}return function(e){var t=e.length;if(t<=x)return String.fromCharCode.apply(String,e);var r="",i=0;for(;ithis.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e=e||"utf8";;)switch(e){case"hex":return M(this,t,r);case"utf8":case"utf-8":return _(this,t,r);case"ascii":return w(this,t,r);case"latin1":case"binary":return S(this,t,r);case"base64":return b(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,t,r);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}.apply(this,arguments)},c.prototype.equals=function(e){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===c.compare(this,e)},c.prototype.inspect=function(){var e="",t=F.INSPECT_MAX_BYTES;return e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(e+=" ... "),""},e&&(c.prototype[e]=c.prototype.inspect),c.prototype.compare=function(e,t,r,i,n){if(A(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),t<0||r>e.length||i<0||n>this.length)throw new RangeError("out of range index");if(n<=i&&r<=t)return 0;if(n<=i)return-1;if(r<=t)return 1;if(this===e)return 0;for(var o=(n>>>=0)-(i>>>=0),a=(r>>>=0)-(t>>>=0),s=Math.min(o,a),l=this.slice(i,n),u=e.slice(t,r),h=0;h>>=0,isFinite(r)?(r>>>=0,void 0===i&&(i="utf8")):(i=r,r=void 0)}var n=this.length-t;if((void 0===r||nthis.length)throw new RangeError("Attempt to write outside buffer bounds");i=i||"utf8";for(var o,a,s,l,u,h,c=!1;;)switch(i){case"hex":return g(this,e,t,r);case"utf8":case"utf-8":return u=t,h=r,D(R(e,(l=this).length-u),l,u,h);case"ascii":return v(this,e,t,r);case"latin1":case"binary":return v(this,e,t,r);case"base64":return o=this,a=t,s=r,D(O(e),o,a,s);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return y(this,e,t,r);default:if(c)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),c=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var x=4096;function w(e,t,r){var i="";r=Math.min(e.length,r);for(var n=t;ne.length)throw new RangeError("Index out of range")}function P(e,t,r,i){if(r+i>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function L(e,t,r,i,n){return t=+t,r>>>=0,n||P(e,0,r,4),o.write(e,t,r,i,23,4),r+4}function k(e,t,r,i,n){return t=+t,r>>>=0,n||P(e,0,r,8),o.write(e,t,r,i,52,8),r+8}c.prototype.slice=function(e,t){var r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):r>>=0,t>>>=0,r||T(e,t,this.length);for(var i=this[e],n=1,o=0;++o>>=0,t>>>=0,r||T(e,t,this.length);for(var i=this[e+--t],n=1;0>>=0,t||T(e,1,this.length),this[e]},c.prototype.readUInt16LE=function(e,t){return e>>>=0,t||T(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUInt16BE=function(e,t){return e>>>=0,t||T(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUInt32LE=function(e,t){return e>>>=0,t||T(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUInt32BE=function(e,t){return e>>>=0,t||T(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||T(e,t,this.length);for(var i=this[e],n=1,o=0;++o>>=0,t>>>=0,r||T(e,t,this.length);for(var i=t,n=1,o=this[e+--i];0>>=0,t||T(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){e>>>=0,t||T(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(e,t){e>>>=0,t||T(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(e,t){return e>>>=0,t||T(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return e>>>=0,t||T(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readFloatLE=function(e,t){return e>>>=0,t||T(e,4,this.length),o.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return e>>>=0,t||T(e,4,this.length),o.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return e>>>=0,t||T(e,8,this.length),o.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return e>>>=0,t||T(e,8,this.length),o.read(this,e,!1,52,8)},c.prototype.writeUIntLE=function(e,t,r,i){e=+e,t>>>=0,r>>>=0,i||C(this,e,t,r,Math.pow(2,8*r)-1,0);var n=1,o=0;for(this[t]=255&e;++o>>=0,r>>>=0,i||C(this,e,t,r,Math.pow(2,8*r)-1,0);var n=r-1,o=1;for(this[t+n]=255&e;0<=--n&&(o*=256);)this[t+n]=e/o&255;return t+r},c.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,1,255,0),this[t]=255&e,t+1},c.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},c.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeIntLE=function(e,t,r,i){if(e=+e,t>>>=0,!i){var n=Math.pow(2,8*r-1);C(this,e,t,r,n-1,-n)}var o=0,a=1,s=0;for(this[t]=255&e;++o>0)-s&255;return t+r},c.prototype.writeIntBE=function(e,t,r,i){if(e=+e,t>>>=0,!i){var n=Math.pow(2,8*r-1);C(this,e,t,r,n-1,-n)}var o=r-1,a=1,s=0;for(this[t+o]=255&e;0<=--o&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+r},c.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},c.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeFloatLE=function(e,t,r){return L(this,e,t,!0,r)},c.prototype.writeFloatBE=function(e,t,r){return L(this,e,t,!1,r)},c.prototype.writeDoubleLE=function(e,t,r){return k(this,e,t,!0,r)},c.prototype.writeDoubleBE=function(e,t,r){return k(this,e,t,!1,r)},c.prototype.copy=function(e,t,r,i){if(!c.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r=r||0,i||0===i||(i=this.length),t>=e.length&&(t=e.length),t=t||0,0=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t>>=0,r=void 0===r?this.length:r>>>0,"number"==typeof(e=e||0))for(o=t;o>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function O(e){return i.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(t,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function D(e,t,r,i){for(var n=0;n=t.length||n>=e.length);++n)t[n+r]=e[n];return n}function A(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function I(e){return e!=e}var U=function(){for(var e="0123456789abcdef",t=new Array(256),r=0;r<16;++r)for(var i=16*r,n=0;n<16;++n)t[i+n]=e[r]+e[n];return t}()}).call(this,N("buffer").Buffer)},{"base64-js":19,buffer:21,ieee754:30}],22:[function(e,t,r){"use strict";t.exports=e("./").polyfill()},{"./":23}],23:[function(z,r,i){(function(j,V){var e,t;e=this,t=function(){"use strict";function l(e){return"function"==typeof e}var r=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},i=0,t=void 0,n=void 0,a=function(e,t){f[i]=e,f[i+1]=t,2===(i+=2)&&(n?n(d):y())};var e="undefined"!=typeof window?window:void 0,o=e||{},s=o.MutationObserver||o.WebKitMutationObserver,u="undefined"==typeof self&&void 0!==j&&"[object process]"==={}.toString.call(j),h="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function c(){var e=setTimeout;return function(){return e(d,1)}}var f=new Array(1e3);function d(){for(var e=0;e":">",'"':""","'":"'","/":"/"};function S(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,function(e){return w[e]}):e}var M=function(){function i(e){var t,r=1=this.maxReplaces)break}for(a=0;r=this.regexp.exec(e);){if(void 0===(i=h(r[1].trim())))if("function"==typeof c){var d=c(e,r,t);i="string"==typeof d?d:""}else this.logger.warn("missed to pass in variable ".concat(r[1]," for interpolating ").concat(e)),i="";else"string"==typeof i||this.useRawValueToEscape||(i=v(i));if(i=this.escapeValue?u(this.escape(i)):u(i),e=e.replace(r[0],i),this.regexp.lastIndex=0,++a>=this.maxReplaces)break}return e}},{key:"nest",value:function(e,t,r){var i,n,o=D({},2>1,h=-7,c=r?n-1:0,f=r?-1:1,d=e[t+c];for(c+=f,o=d&(1<<-h)-1,d>>=-h,h+=s;0>=-h,h+=i;0>1,f=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,d=i?0:o-1,p=i?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=h):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),2<=(t+=1<=a+c?f/l:f*Math.pow(2,1-c))*l&&(a++,l/=2),h<=a+c?(s=0,a=h):1<=a+c?(s=(t*l-1)*Math.pow(2,n),a+=c):(s=t*Math.pow(2,c-1)*Math.pow(2,n),a=0));8<=n;e[r+d]=255&s,d+=p,s/=256,n-=8);for(a=a<Math.abs(e[0])&&(t=1),Math.abs(e[2])>Math.abs(e[t])&&(t=2),t}var C=4e150;function P(e,t){e.f+=t.f,e.b.f+=t.b.f}function u(e,t,r){return e=e.a,t=t.a,r=r.a,t.b.a===e?r.b.a===e?v(t.a,r.a)?b(r.b.a,t.a,r.a)<=0:0<=b(t.b.a,r.a,t.a):b(r.b.a,e,r.a)<=0:r.b.a===e?0<=b(t.b.a,e,t.a):(t=y(t.b.a,e,t.a),(e=y(r.b.a,e,r.a))<=t)}function L(e){e.a.i=null;var t=e.e;t.a.c=t.c,t.c.a=t.a,e.e=null}function h(e,t){c(e.a),e.c=!1,(e.a=t).i=e}function k(e){for(var t=e.a.a;(e=fe(e)).a.a===t;);return e.c&&(h(e,t=f(ce(e).a.b,e.a.e)),e=fe(e)),e}function R(e,t,r){var i=new he;return i.a=r,i.e=W(e.f,t.e,i),r.i=i}function O(e,t){switch(e.s){case 100130:return 0!=(1&t);case 100131:return 0!==t;case 100132:return 0>1]],s[a[u]])?le(r,u):ue(r,u)),s[o]=null,l[o]=r.b,r.b=o}else for(r.c[-(o+1)]=null;0Math.max(a.a,l.a))return!1;if(v(o,a)){if(0i.f&&(i.f*=2,i.c=oe(i.c,i.f+1)),0===i.b?r=n:(r=i.b,i.b=i.c[i.b]),i.e[r]=t,i.c[r]=n,i.d[n]=r,i.h&&ue(i,n),r}return i=e.a++,e.c[i]=t,-(i+1)}function ie(e){if(0===e.a)return se(e.b);var t=e.c[e.d[e.a-1]];if(0!==e.b.a&&v(ae(e.b),t))return se(e.b);for(;--e.a,0e.a||v(i[a],i[l])){n[r[o]=a]=o;break}n[r[o]=l]=o,o=s}}function ue(e,t){for(var r=e.d,i=e.e,n=e.c,o=t,a=r[o];;){var s=o>>1,l=r[s];if(0==s||v(i[l],i[a])){n[r[o]=a]=o;break}n[r[o]=l]=o,o=s}}function he(){this.e=this.a=null,this.f=0,this.c=this.b=this.h=this.d=!1}function ce(e){return e.e.c.b}function fe(e){return e.e.a.b}(i=q.prototype).x=function(){Y(this,0)},i.B=function(e,t){switch(e){case 100142:return;case 100140:switch(t){case 100130:case 100131:case 100132:case 100133:case 100134:return void(this.s=t)}break;case 100141:return void(this.m=!!t);default:return void Z(this,100900)}Z(this,100901)},i.y=function(e){switch(e){case 100142:return 0;case 100140:return this.s;case 100141:return this.m;default:Z(this,100900)}return!1},i.A=function(e,t,r){this.j[0]=e,this.j[1]=t,this.j[2]=r},i.z=function(e,t){var r=t||null;switch(e){case 100100:case 100106:this.h=r;break;case 100104:case 100110:this.l=r;break;case 100101:case 100107:this.k=r;break;case 100102:case 100108:this.i=r;break;case 100103:case 100109:this.p=r;break;case 100105:case 100111:this.o=r;break;case 100112:this.r=r;break;default:Z(this,100900)}},i.C=function(e,t){var r=!1,i=[0,0,0];Y(this,2);for(var n=0;n<3;++n){var o=e[n];o<-1e150&&(o=-1e150,r=!0),1e150n[u]&&(n[u]=h,a[u]=l)}if(l=0,n[1]-o[1]>n[0]-o[0]&&(l=1),n[2]-o[2]>n[l]-o[l]&&(l=2),o[l]>=n[l])i[0]=0,i[1]=0,i[2]=1;else{for(n=0,o=s[l],a=a[l],s=[0,0,0],o=[o.g[0]-a.g[0],o.g[1]-a.g[1],o.g[2]-a.g[2]],u=[0,0,0],l=r.e;l!==r;l=l.e)u[0]=l.g[0]-a.g[0],u[1]=l.g[1]-a.g[1],u[2]=l.g[2]-a.g[2],s[0]=o[1]*u[2]-o[2]*u[1],s[1]=o[2]*u[0]-o[0]*u[2],s[2]=o[0]*u[1]-o[1]*u[0],n<(h=s[0]*s[0]+s[1]*s[1]+s[2]*s[2])&&(n=h,i[0]=s[0],i[1]=s[1],i[2]=s[2]);n<=0&&(i[0]=i[1]=i[2]=0,i[T(o)]=1)}r=!0}for(s=T(i),l=this.b.c,n=(s+1)%3,a=(s+2)%3,s=0>=l,h-=l,g!=o){if(g==a)break;for(var v=g>8,++y;var _=b;if(i>=8;null!==m&&s<4096&&(p[s++]=m<<8|_,u+1<=s&&l<12&&(++l,u=u<<1|1)),m=g}else s=1+a,u=(1<<(l=n+1))-1,m=null}return f!==i&&console.log("Warning, gif stream shorter than expected."),r}try{r.GifWriter=function(v,e,t,r){var y=0,i=void 0===(r=void 0===r?{}:r).loop?null:r.loop,b=void 0===r.palette?null:r.palette;if(e<=0||t<=0||65535>=1;)++n;if(a=1<>8&255,v[y++]=255&t,v[y++]=t>>8&255,v[y++]=(null!==b?128:0)|n,v[y++]=o,v[y++]=0,null!==b)for(var s=0,l=b.length;s>16&255,v[y++]=u>>8&255,v[y++]=255&u}if(null!==i){if(i<0||65535>8&255,v[y++]=0}var x=!1;this.addFrame=function(e,t,r,i,n,o){if(!0===x&&(--y,x=!1),o=void 0===o?{}:o,e<0||t<0||65535>=1;)++u;l=1<>8&255,v[y++]=d,v[y++]=0),v[y++]=44,v[y++]=255&e,v[y++]=e>>8&255,v[y++]=255&t,v[y++]=t>>8&255,v[y++]=255&r,v[y++]=r>>8&255,v[y++]=255&i,v[y++]=i>>8&255,v[y++]=!0===a?128|u-1:0,!0===a)for(var p=0,m=s.length;p>16&255,v[y++]=g>>8&255,v[y++]=255&g}return y=function(t,r,e,i){t[r++]=e;var n=r++,o=1<>=8,h-=8,r===n+256&&(t[n]=255,n=r++)}function d(e){c|=e<>=8,h-=8,r===n+256&&(t[n]=255,n=r++);4096===l?(d(o),l=1+s,u=e+1,m={}):(1<>7,n=1<<1+(7&r);x[e++],x[e++];var o=null,a=null;i&&(o=e,e+=3*(a=n));var s=!0,l=[],u=0,h=null,c=0,f=null;for(this.width=w,this.height=t;s&&e>2&7,e++;break;case 254:for(;;){if(!(0<=(C=x[e++])))throw Error("Invalid block size");if(0===C)break;e+=C}break;default:throw new Error("Unknown graphic control label: 0x"+x[e-1].toString(16))}break;case 44:var p=x[e++]|x[e++]<<8,m=x[e++]|x[e++]<<8,g=x[e++]|x[e++]<<8,v=x[e++]|x[e++]<<8,y=x[e++],b=y>>6&1,_=1<<1+(7&y),S=o,M=a,E=!1;if(y>>7){E=!0;S=e,e+=3*(M=_)}var T=e;for(e++;;){var C;if(!(0<=(C=x[e++])))throw Error("Invalid block size");if(0===C)break;e+=C}l.push({x:p,y:m,width:g,height:v,has_local_palette:E,palette_offset:S,palette_size:M,data_offset:T,data_length:e-T,transparent_index:h,interlaced:!!b,delay:u,disposal:c});break;case 59:s=!1;break;default:throw new Error("Unknown gif block: 0x"+x[e-1].toString(16))}this.numFrames=function(){return l.length},this.loopCount=function(){return f},this.frameInfo=function(e){if(e<0||e>=l.length)throw new Error("Frame index out of range.");return l[e]},this.decodeAndBlitFrameBGRA=function(e,t){var r=this.frameInfo(e),i=r.width*r.height,n=new Uint8Array(i);P(x,r.data_offset,n,i);var o=r.palette_offset,a=r.transparent_index;null===a&&(a=256);var s=r.width,l=w-s,u=s,h=4*(r.y*w+r.x),c=4*((r.y+r.height)*w+r.x),f=h,d=4*l;!0===r.interlaced&&(d+=4*w*7);for(var p=8,m=0,g=n.length;m>=1)),v===a)f+=4;else{var y=x[o+3*v],b=x[o+3*v+1],_=x[o+3*v+2];t[f++]=_,t[f++]=b,t[f++]=y,t[f++]=255}--u}},this.decodeAndBlitFrameRGBA=function(e,t){var r=this.frameInfo(e),i=r.width*r.height,n=new Uint8Array(i);P(x,r.data_offset,n,i);var o=r.palette_offset,a=r.transparent_index;null===a&&(a=256);var s=r.width,l=w-s,u=s,h=4*(r.y*w+r.x),c=4*((r.y+r.height)*w+r.x),f=h,d=4*l;!0===r.interlaced&&(d+=4*w*7);for(var p=8,m=0,g=n.length;m>=1)),v===a)f+=4;else{var y=x[o+3*v],b=x[o+3*v+1],_=x[o+3*v+2];t[f++]=y,t[f++]=b,t[f++]=_,t[f++]=255}--u}}}}catch(e){}},{}],33:[function(jr,t,r){(function(Gr){var e;e=this,function(E){"use strict";function e(e){if(null==this)throw TypeError();var t=String(this),r=t.length,i=e?Number(e):0;if(i!=i&&(i=0),!(i<0||r<=i)){var n,o=t.charCodeAt(i);return 55296<=o&&o<=56319&&i+1>>=1,t}function _(e,t,r){if(!t)return r;for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<>>16-t;return e.tag>>>=t,e.bitcount-=t,i+r}function x(e,t){for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<>>=1,++n,r+=t.table[n],0<=(i-=t.table[n]););return e.tag=o,e.bitcount-=n,t.trans[r+i]}function w(e,t,r){var i,n,o,a,s,l;for(i=_(e,5,257),n=_(e,5,1),o=_(e,4,4),a=0;a<19;++a)g[a]=0;for(a=0;athis.x2&&(this.x2=e)),"number"==typeof t&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=t,this.y2=t),tthis.y2&&(this.y2=t))},C.prototype.addX=function(e){this.addPoint(e,null)},C.prototype.addY=function(e){this.addPoint(null,e)},C.prototype.addBezier=function(e,t,r,i,n,o,a,s){var l=this,u=[e,t],h=[r,i],c=[n,o],f=[a,s];this.addPoint(e,t),this.addPoint(a,s);for(var d=0;d<=1;d++){var p=6*u[d]-12*h[d]+6*c[d],m=-3*u[d]+9*h[d]-9*c[d]+3*f[d],g=3*h[d]-3*u[d];if(0!=m){var v=Math.pow(p,2)-4*g*m;if(!(v<0)){var y=(-p+Math.sqrt(v))/(2*m);0>8&255,255&e]},A.USHORT=U(2),D.SHORT=function(e){return 32768<=e&&(e=-(65536-e)),[e>>8&255,255&e]},A.SHORT=U(2),D.UINT24=function(e){return[e>>16&255,e>>8&255,255&e]},A.UINT24=U(3),D.ULONG=function(e){return[e>>24&255,e>>16&255,e>>8&255,255&e]},A.ULONG=U(4),D.LONG=function(e){return R<=e&&(e=-(2*R-e)),[e>>24&255,e>>16&255,e>>8&255,255&e]},A.LONG=U(4),D.FIXED=D.ULONG,A.FIXED=A.ULONG,D.FWORD=D.SHORT,A.FWORD=A.SHORT,D.UFWORD=D.USHORT,A.UFWORD=A.USHORT,D.LONGDATETIME=function(e){return[0,0,0,0,e>>24&255,e>>16&255,e>>8&255,255&e]},A.LONGDATETIME=U(8),D.TAG=function(e){return k.argument(4===e.length,"Tag should be exactly 4 ASCII characters."),[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]},A.TAG=U(4),D.Card8=D.BYTE,A.Card8=A.BYTE,D.Card16=D.USHORT,A.Card16=A.USHORT,D.OffSize=D.BYTE,A.OffSize=A.BYTE,D.SID=D.USHORT,A.SID=A.USHORT,D.NUMBER=function(e){return-107<=e&&e<=107?[e+139]:108<=e&&e<=1131?[247+((e-=108)>>8),255&e]:-1131<=e&&e<=-108?[251+((e=-e-108)>>8),255&e]:-32768<=e&&e<=32767?D.NUMBER16(e):D.NUMBER32(e)},A.NUMBER=function(e){return D.NUMBER(e).length},D.NUMBER16=function(e){return[28,e>>8&255,255&e]},A.NUMBER16=U(3),D.NUMBER32=function(e){return[29,e>>24&255,e>>16&255,e>>8&255,255&e]},A.NUMBER32=U(5),D.REAL=function(e){var t=e.toString(),r=/\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec(t);if(r){var i=parseFloat("1e"+((r[2]?+r[2]:0)+r[1].length));t=(Math.round(e*i)/i).toString()}for(var n="",o=0,a=t.length;o>8&255,t[t.length]=255&i}return t},A.UTF16=function(e){return 2*e.length};var N={"x-mac-croatian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈ƫȅ ÀÃÕŒœĐ—“”‘’÷◊©⁄€‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ","x-mac-cyrillic":"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю","x-mac-gaelic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØḂ±≤≥ḃĊċḊḋḞḟĠġṀæøṁṖṗɼƒſṠ«»… ÀÃÕŒœ–—“”‘’ṡẛÿŸṪ€‹›Ŷŷṫ·Ỳỳ⁊ÂÊÁËÈÍÎÏÌÓÔ♣ÒÚÛÙıÝýŴŵẄẅẀẁẂẃ","x-mac-greek":"Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦€ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ­","x-mac-icelandic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüݰ¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-inuit":"ᐃᐄᐅᐆᐊᐋᐱᐲᐳᐴᐸᐹᑉᑎᑏᑐᑑᑕᑖᑦᑭᑮᑯᑰᑲᑳᒃᒋᒌᒍᒎᒐᒑ°ᒡᒥᒦ•¶ᒧ®©™ᒨᒪᒫᒻᓂᓃᓄᓅᓇᓈᓐᓯᓰᓱᓲᓴᓵᔅᓕᓖᓗᓘᓚᓛᓪᔨᔩᔪᔫᔭ… ᔮᔾᕕᕖᕗ–—“”‘’ᕘᕙᕚᕝᕆᕇᕈᕉᕋᕌᕐᕿᖀᖁᖂᖃᖄᖅᖏᖐᖑᖒᖓᖔᖕᙱᙲᙳᙴᙵᙶᖖᖠᖡᖢᖣᖤᖥᖦᕼŁł","x-mac-ce":"ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ",macintosh:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-romanian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂȘ∞±≤≥¥µ∂∑∏π∫ªºΩăș¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›Țț‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-turkish":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙˆ˜¯˘˙˚¸˝˛ˇ"};O.MACSTRING=function(e,t,r,i){var n=N[i];if(void 0!==n){for(var o="",a=0;a>8&255,l+256&255)}return o}D.MACSTRING=function(e,t){var r=function(e){if(!F)for(var t in F={},N)F[t]=new String(t);var r=F[e];if(void 0!==r){if(B){var i=B.get(r);if(void 0!==i)return i}var n=N[e];if(void 0!==n){for(var o={},a=0;a>8,t[c+1]=255&f,t=t.concat(i[h])}return t},A.TABLE=function(e){for(var t=0,r=e.fields.length,i=0;i>1,t.skip("uShort",3),e.glyphIndexMap={};for(var a=new se.Parser(r,i+n+14),s=new se.Parser(r,i+n+16+2*o),l=new se.Parser(r,i+n+16+4*o),u=new se.Parser(r,i+n+16+6*o),h=i+n+16+8*o,c=0;c>4,o=15&i;if(15==n)break;if(t+=r[n],15==o)break;t+=r[o]}return parseFloat(t)}(e);if(32<=t&&t<=246)return t-139;if(247<=t&&t<=250)return 256*(t-247)+e.parseByte()+108;if(251<=t&&t<=254)return 256*-(t-251)-e.parseByte()-108;throw new Error("Invalid b0 "+t)}function Te(e,t,r){t=void 0!==t?t:0;var i=new se.Parser(e,t),n=[],o=[];for(r=void 0!==r?r:e.length;i.relativeOffset>1,T.length=0,P=!0}return function e(t){for(var r,i,n,o,a,s,l,u,h,c,f,d,p=0;pMath.abs(d-R)?k=f+T.shift():R=d+T.shift(),E.curveTo(y,b,_,x,l,u),E.curveTo(h,c,f,d,k,R);break;default:console.log("Glyph "+v.index+": unknown operator 1200"+m),T.length=0}break;case 14:0>3;break;case 21:2>16),p+=2;break;case 29:a=T.pop()+g.gsubrsBias,(s=g.gsubrs[a])&&e(s);break;case 30:for(;0=r.begin&&e=fe.length){var a=i.parseChar();r.names.push(i.parseString(a))}break;case 2.5:r.numberOfGlyphs=i.parseUShort(),r.offset=new Array(r.numberOfGlyphs);for(var s=0;st.value.tag?1:-1}),t.fields=t.fields.concat(i),t.fields=t.fields.concat(n),t}function gt(e,t,r){for(var i=0;i 123 are reserved for internal usage");d|=1<>>1,o=e[n].tag;if(o===t)return n;o>>1,o=e[n];if(o===t)return n;o>>1,a=(r=e[o]).start;if(a===t)return r;a(r=e[i-1]).end?0:r}function xt(e,t){this.font=e,this.tableName=t}function wt(e){xt.call(this,e,"gpos")}function St(e){xt.call(this,e,"gsub")}function Mt(e,t){var r=e.length;if(r!==t.length)return!1;for(var i=0;it.points.length-1||i.matchedPoints[1]>n.points.length-1)throw Error("Matched points out of range in "+t.name);var a=t.points[i.matchedPoints[0]],s=n.points[i.matchedPoints[1]],l={xScale:i.xScale,scale01:i.scale01,scale10:i.scale10,yScale:i.yScale,dx:0,dy:0};s=kt([s],l)[0],l.dx=a.x-s.x,l.dy=a.y-s.y,o=kt(n.points,l)}t.points=t.points.concat(o)}}return Rt(t.points)}(wt.prototype=xt.prototype={searchTag:yt,binSearch:bt,getTable:function(e){var t=this.font.tables[this.tableName];return!t&&e&&(t=this.font.tables[this.tableName]=this.createDefaultTable()),t},getScriptNames:function(){var e=this.getTable();return e?e.scripts.map(function(e){return e.tag}):[]},getDefaultScriptName:function(){var e=this.getTable();if(e){for(var t=!1,r=0;r=s[u-1].tag,"Features must be added in alphabetical order."),o={tag:r,feature:{params:0,lookupListIndexes:[]}},s.push(o),a.push(u),o.feature}}},getLookupTables:function(e,t,r,i,n){var o=this.getFeatureTable(e,t,r,n),a=[];if(o){for(var s,l=o.lookupListIndexes,u=this.font.tables[this.tableName].lookups,h=0;h",s),t.stack.push(Math.round(64*s))}function vr(e,t){var r=t.stack,i=r.pop(),n=t.fv,o=t.pv,a=t.ppem,s=t.deltaBase+16*(e-1),l=t.deltaShift,u=t.z0;E.DEBUG&&console.log(t.step,"DELTAP["+e+"]",i,r);for(var h=0;h>4)===a){var d=(15&f)-8;0<=d&&d++,E.DEBUG&&console.log(t.step,"DELTAPFIX",c,"by",d*l);var p=u[c];n.setRelative(p,p,d*l,o)}}}function yr(e,t){var r=t.stack,i=r.pop();E.DEBUG&&console.log(t.step,"ROUND[]"),r.push(64*t.round(i/64))}function br(e,t){var r=t.stack,i=r.pop(),n=t.ppem,o=t.deltaBase+16*(e-1),a=t.deltaShift;E.DEBUG&&console.log(t.step,"DELTAC["+e+"]",i,r);for(var s=0;s>4)===n){var h=(15&u)-8;0<=h&&h++;var c=h*a;E.DEBUG&&console.log(t.step,"DELTACFIX",l,"by",c),t.cvt[l]+=c}}}function _r(e,t){var r,i,n=t.stack,o=n.pop(),a=n.pop(),s=t.z2[o],l=t.z1[a];E.DEBUG&&console.log(t.step,"SDPVTL["+e+"]",o,a),i=e?(r=s.y-l.y,l.x-s.x):(r=l.x-s.x,l.y-s.y),t.dpv=Zt(r,i)}function xr(e,t){var r=t.stack,i=t.prog,n=t.ip;E.DEBUG&&console.log(t.step,"PUSHB["+e+"]");for(var o=0;o":"_")+(i?"R":"_")+(0===n?"Gr":1===n?"Bl":2===n?"Wh":"")+"]",e?c+"("+o.cvt[c]+","+u+")":"",f,"(d =",a,"->",l*s,")"),o.rp1=o.rp0,o.rp2=f,t&&(o.rp0=f)}Ft.prototype.exec=function(e,t){if("number"!=typeof t)throw new Error("Point size is not a number!");if(!(2",i),s.interpolate(c,o,a,l),s.touch(c)}e.loop=1},dr.bind(void 0,0),dr.bind(void 0,1),function(e){for(var t=e.stack,r=e.rp0,i=e.z0[r],n=e.loop,o=e.fv,a=e.pv,s=e.z1;n--;){var l=t.pop(),u=s[l];E.DEBUG&&console.log(e.step,(1=a.width||t>=a.height?[0,0,0,0]:this._getPixel(e,t);var s=new l.default.Image(r,i);return s.canvas.getContext("2d").drawImage(a,e,t,r*o,i*o,0,0,r,i),s},l.default.Renderer.prototype.textLeading=function(e){return"number"==typeof e?(this._setProperty("_textLeading",e),this._pInst):this._textLeading},l.default.Renderer.prototype.textSize=function(e){return"number"==typeof e?(this._setProperty("_textSize",e),this._setProperty("_textLeading",e*y._DEFAULT_LEADMULT),this._applyTextProperties()):this._textSize},l.default.Renderer.prototype.textStyle=function(e){return e?(e!==y.NORMAL&&e!==y.ITALIC&&e!==y.BOLD&&e!==y.BOLDITALIC||this._setProperty("_textStyle",e),this._applyTextProperties()):this._textStyle},l.default.Renderer.prototype.textAscent=function(){return null===this._textAscent&&this._updateTextMetrics(),this._textAscent},l.default.Renderer.prototype.textDescent=function(){return null===this._textDescent&&this._updateTextMetrics(),this._textDescent},l.default.Renderer.prototype.textAlign=function(e,t){return void 0!==e?(this._setProperty("_textAlign",e),void 0!==t&&this._setProperty("_textBaseline",t),this._applyTextProperties()):{horizontal:this._textAlign,vertical:this._textBaseline}},l.default.Renderer.prototype.text=function(e,t,r,i,n){var o,a,s,l,u,h,c,f,d=this._pInst,p=Number.MAX_VALUE;if((this._doFill||this._doStroke)&&void 0!==e){if("string"!=typeof e&&(e=e.toString()),o=(e=e.replace(/(\t)/g," ")).split("\n"),void 0!==i){for(s=f=0;ss.HALF_PI&&e<=3*s.HALF_PI?Math.atan(r/i*Math.tan(e))+s.PI:Math.atan(r/i*Math.tan(e))+s.TWO_PI,t=t<=s.HALF_PI?Math.atan(r/i*Math.tan(t)):t>s.HALF_PI&&t<=3*s.HALF_PI?Math.atan(r/i*Math.tan(t))+s.PI:Math.atan(r/i*Math.tan(t))+s.TWO_PI),tv||Math.abs(this.accelerationY-this.pAccelerationY)>v||Math.abs(this.accelerationZ-this.pAccelerationZ)>v)&&e();var t=this.deviceTurned||window.deviceTurned;if("function"==typeof t){var r=this.rotationX+180,i=this.pRotationX+180,n=c+180;0>>24],i+=x[(16711680&C)>>16],n+=x[(65280&C)>>8],o+=x[255&C],r+=k[_],s++}w[l=T+y]=a/r,S[l]=i/r,M[l]=n/r,E[l]=o/r}T+=d}for(h=(u=-P)*d,b=T=0;b>>16,e[r+1]=(65280&t[i])>>>8,e[r+2]=255&t[i],e[r+3]=(4278190080&t[i])>>>24},O._toImageData=function(e){return e instanceof ImageData?e:e.getContext("2d").getImageData(0,0,e.width,e.height)},O._createImageData=function(e,t){return O._tmpCanvas=document.createElement("canvas"),O._tmpCtx=O._tmpCanvas.getContext("2d"),this._tmpCtx.createImageData(e,t)},O.apply=function(e,t,r){var i=e.getContext("2d"),n=i.getImageData(0,0,e.width,e.height),o=t(n,r);o instanceof ImageData?i.putImageData(o,0,0,0,0,e.width,e.height):i.putImageData(n,0,0,0,0,e.width,e.height)},O.threshold=function(e,t){var r=O._toPixels(e);void 0===t&&(t=.5);for(var i=Math.floor(255*t),n=0;n>8)/i,r[n+1]=255*(a*t>>8)/i,r[n+2]=255*(s*t>>8)/i}},O.dilate=function(e){for(var t,r,i,n,o,a,s,l,u,h,c,f,d,p,m,g,v,y=O._toPixels(e),b=0,_=y.length?y.length/4:0,x=new Int32Array(_);b<_;)for(r=(t=b)+e.width;b>16&255)+151*(i>>8&255)+28*(255&i))<(m=77*(c>>16&255)+151*(c>>8&255)+28*(255&c))&&(n=c,o=m),o<(p=77*((h=O._getARGB(y,a))>>16&255)+151*(h>>8&255)+28*(255&h))&&(n=h,o=p),o<(g=77*(f>>16&255)+151*(f>>8&255)+28*(255&f))&&(n=f,o=g),o<(v=77*(d>>16&255)+151*(d>>8&255)+28*(255&d))&&(n=d,o=v),x[b++]=n;O._setPixels(y,x)},O.erode=function(e){for(var t,r,i,n,o,a,s,l,u,h,c,f,d,p,m,g,v,y=O._toPixels(e),b=0,_=y.length?y.length/4:0,x=new Int32Array(_);b<_;)for(r=(t=b)+e.width;b>16&255)+151*(c>>8&255)+28*(255&c))<(o=77*(i>>16&255)+151*(i>>8&255)+28*(255&i))&&(n=c,o=m),(p=77*((h=O._getARGB(y,a))>>16&255)+151*(h>>8&255)+28*(255&h))>16&255)+151*(f>>8&255)+28*(255&f))>16&255)+151*(d>>8&255)+28*(255&d))=r){var i=Math.floor(t.timeDisplayed/r);if(t.timeDisplayed=0,t.displayIndex+=i,t.loopCount=Math.floor(t.displayIndex/t.numFrames),null!==t.loopLimit&&t.loopCount>=t.loopLimit)t.playing=!1;else{var n=t.displayIndex%t.numFrames;this.drawingContext.putImageData(t.frames[n].image,0,0),t.displayIndex=n,this.setModified(!0)}}}},n.default.Image.prototype._setProperty=function(e,t){this[e]=t,this.setModified(!0)},n.default.Image.prototype.loadPixels=function(){n.default.Renderer2D.prototype.loadPixels.call(this),this.setModified(!0)},n.default.Image.prototype.updatePixels=function(e,t,r,i){n.default.Renderer2D.prototype.updatePixels.call(this,e,t,r,i),this.setModified(!0)},n.default.Image.prototype.get=function(e,t,r,i){return n.default._validateParameters("p5.Image.get",arguments),n.default.Renderer2D.prototype.get.apply(this,arguments)},n.default.Image.prototype._getPixel=n.default.Renderer2D.prototype._getPixel,n.default.Image.prototype.set=function(e,t,r){n.default.Renderer2D.prototype.set.call(this,e,t,r),this.setModified(!0)},n.default.Image.prototype.resize=function(e,t){0===e&&0===t?(e=this.canvas.width,t=this.canvas.height):0===e?e=this.canvas.width*t/this.canvas.height:0===t&&(t=this.canvas.height*e/this.canvas.width),e=Math.floor(e),t=Math.floor(t);var r=document.createElement("canvas");if(r.width=e,r.height=t,this.gifProperties)for(var i=this.gifProperties,n=function(e,t){for(var r=0,i=0;i/g,">").replace(/"/g,""").replace(/'/g,"'")}function l(e,t){t&&!0!==t&&"true"!==t||(t="");var r="";return(e=e||"untitled")&&e.includes(".")&&(r=e.split(".").pop()),t&&r!==t&&(r=t,e="".concat(e,".").concat(r)),[e,r]}e("../core/error_helpers"),v.default.prototype.loadJSON=function(){for(var e=arguments.length,t=new Array(e),r=0;r"),n.print("");if(n.print(' '),n.print(""),n.print(""),n.print(" "),"0"!==o[0]){n.print(" ");for(var h=0;h".concat(c)),n.print(" ")}n.print(" ")}for(var f=0;f");for(var d=0;d".concat(p)),n.print(" ")}n.print(" ")}n.print("
"),n.print(""),n.print("")}n.close(),n.clear()},v.default.prototype.writeFile=function(e,t,r){var i="application/octet-stream";v.default.prototype._isSafari()&&(i="text/plain");var n=new Blob(e,{type:i});v.default.prototype.downloadFile(n,t,r)},v.default.prototype.downloadFile=function(e,t,r){var i=l(t,r),n=i[0];if(e instanceof Blob)s.default.saveAs(e,n);else{var o=document.createElement("a");if(o.href=e,o.download=n,o.onclick=function(e){var t;t=e,document.body.removeChild(t.target),e.stopPropagation()},o.style.display="none",document.body.appendChild(o),v.default.prototype._isSafari()){var a="Hello, Safari user! To download this file...\n";a+="1. Go to File --\x3e Save As.\n",a+='2. Choose "Page Source" as the Format.\n',a+='3. Name it with this extension: ."'.concat(i[1],'"'),alert(a)}o.click()}},v.default.prototype._checkFileExtension=l,v.default.prototype._isSafari=function(){return 0>>0},getSeed:function(){return t},rand:function(){return(r=(1664525*r+1013904223)%i)/i}});n.setSeed(e),_=new Array(4096);for(var o=0;o<4096;o++)_[o]=n.rand()};var o=n.default;r.default=o},{"../core/main":49}],82:[function(e,t,r){"use strict";function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i,l=(i=e("../core/main"))&&i.__esModule?i:{default:i},o=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==a(e)&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var o=i?Object.getOwnPropertyDescriptor(e,n):null;o&&(o.get||o.set)?Object.defineProperty(r,n,o):r[n]=e[n]}r.default=e,t&&t.set(e,r);return r}(e("../core/constants"));function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}l.default.Vector=function(e,t,r){var i,n,o;o=e instanceof l.default?(this.p5=e,i=t[0]||0,n=t[1]||0,t[2]||0):(i=e||0,n=t||0,r||0),this.x=i,this.y=n,this.z=o},l.default.Vector.prototype.toString=function(){return"p5.Vector Object : [".concat(this.x,", ").concat(this.y,", ").concat(this.z,"]")},l.default.Vector.prototype.set=function(e,t,r){return e instanceof l.default.Vector?(this.x=e.x||0,this.y=e.y||0,this.z=e.z||0):e instanceof Array?(this.x=e[0]||0,this.y=e[1]||0,this.z=e[2]||0):(this.x=e||0,this.y=t||0,this.z=r||0),this},l.default.Vector.prototype.copy=function(){return this.p5?new l.default.Vector(this.p5,[this.x,this.y,this.z]):new l.default.Vector(this.x,this.y,this.z)},l.default.Vector.prototype.add=function(e,t,r){return e instanceof l.default.Vector?(this.x+=e.x||0,this.y+=e.y||0,this.z+=e.z||0):e instanceof Array?(this.x+=e[0]||0,this.y+=e[1]||0,this.z+=e[2]||0):(this.x+=e||0,this.y+=t||0,this.z+=r||0),this};function u(e,t){return 0!==e&&(this.x=this.x%e),0!==t&&(this.y=this.y%t),this}function h(e,t,r){return 0!==e&&(this.x=this.x%e),0!==t&&(this.y=this.y%t),0!==r&&(this.z=this.z%r),this}l.default.Vector.prototype.rem=function(e,t,r){if(e instanceof l.default.Vector){if(Number.isFinite(e.x)&&Number.isFinite(e.y)&&Number.isFinite(e.z)){var i=parseFloat(e.x),n=parseFloat(e.y),o=parseFloat(e.z);h.call(this,i,n,o)}}else if(e instanceof Array)e.every(function(e){return Number.isFinite(e)})&&(2===e.length&&u.call(this,e[0],e[1]),3===e.length&&h.call(this,e[0],e[1],e[2]));else if(1===arguments.length){if(Number.isFinite(e)&&0!==e)return this.x=this.x%e,this.y=this.y%e,this.z=this.z%e,this}else if(2===arguments.length){var a=Array.prototype.slice.call(arguments);a.every(function(e){return Number.isFinite(e)})&&2===a.length&&u.call(this,a[0],a[1])}else if(3===arguments.length){var s=Array.prototype.slice.call(arguments);s.every(function(e){return Number.isFinite(e)})&&3===s.length&&h.call(this,s[0],s[1],s[2])}},l.default.Vector.prototype.sub=function(e,t,r){return e instanceof l.default.Vector?(this.x-=e.x||0,this.y-=e.y||0,this.z-=e.z||0):e instanceof Array?(this.x-=e[0]||0,this.y-=e[1]||0,this.z-=e[2]||0):(this.x-=e||0,this.y-=t||0,this.z-=r||0),this},l.default.Vector.prototype.mult=function(e){return"number"==typeof e&&isFinite(e)?(this.x*=e,this.y*=e,this.z*=e):console.warn("p5.Vector.prototype.mult:","n is undefined or not a finite number"),this},l.default.Vector.prototype.div=function(e){return"number"==typeof e&&isFinite(e)?0===e?console.warn("p5.Vector.prototype.div:","divide by 0"):(this.x/=e,this.y/=e,this.z/=e):console.warn("p5.Vector.prototype.div:","n is undefined or not a finite number"),this},l.default.Vector.prototype.mag=function(){return Math.sqrt(this.magSq())},l.default.Vector.prototype.magSq=function(){var e=this.x,t=this.y,r=this.z;return e*e+t*t+r*r},l.default.Vector.prototype.dot=function(e,t,r){return e instanceof l.default.Vector?this.dot(e.x,e.y,e.z):this.x*(e||0)+this.y*(t||0)+this.z*(r||0)},l.default.Vector.prototype.cross=function(e){var t=this.y*e.z-this.z*e.y,r=this.z*e.x-this.x*e.z,i=this.x*e.y-this.y*e.x;return this.p5?new l.default.Vector(this.p5,[t,r,i]):new l.default.Vector(t,r,i)},l.default.Vector.prototype.dist=function(e){return e.copy().sub(this).mag()},l.default.Vector.prototype.normalize=function(){var e=this.mag();return 0!==e&&this.mult(1/e),this},l.default.Vector.prototype.limit=function(e){var t=this.magSq();return e*e>>0},n.default.prototype.randomSeed=function(e){this._lcgSetSeed(o,e),this._gaussian_previous=!1},n.default.prototype.random=function(e,t){var r;if(n.default._validateParameters("random",arguments),r=null!=this[o]?this._lcg(o):Math.random(),void 0===e)return r;if(void 0===t)return e instanceof Array?e[Math.floor(r*e.length)]:r*e;if(tf){var P=p,L=l,k=u;p=d+f*(s&&d=t&&(r=r.substring(r.length-t,r.length)),r}},n.default.prototype.unhex=function(e){return e instanceof Array?e.map(n.default.prototype.unhex):parseInt("0x".concat(e),16)};var o=n.default;r.default=o},{"../core/main":49}],90:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i,a=(i=e("../core/main"))&&i.__esModule?i:{default:i};function n(e,t,r){var i=e<0,n=i?e.toString().substring(1):e.toString(),o=n.indexOf("."),a=-1!==o?n.substring(0,o):n,s=-1!==o?n.substring(o+1):"",l=i?"-":"";if(void 0!==r){var u="";(-1!==o||0r&&(s=s.substring(0,r));for(var h=0;hi.length)for(var o=t-(i+=-1===r?".":"").length+1,a=0;a=d.TWO_PI?"".concat("ellipse","|").concat(u,"|"):"".concat("arc","|").concat(a,"|").concat(s,"|").concat(l,"|").concat(u,"|"),!this.geometryInHash(t)){var h=new T.default.Geometry(u,1,function(){if(this.strokeIndices=[],a.toFixed(10)!==s.toFixed(10)){l!==d.PIE&&void 0!==l||(this.vertices.push(new T.default.Vector(.5,.5,0)),this.uvs.push([.5,.5]));for(var e=0;e<=u;e++){var t=(s-a)*(e/u)+a,r=.5+Math.cos(t)/2,i=.5+Math.sin(t)/2;this.vertices.push(new T.default.Vector(r,i,0)),this.uvs.push([r,i]),e>5&31)/31,(y>>10&31)/31):(r=a,i=s,l)}for(var b=1;b<=3;b++){var _=p+12*b,x=new S.default.Vector(u.getFloat32(_,!0),u.getFloat32(8+_,!0),u.getFloat32(4+_,!0));e.vertices.push(x),c&&o.push(r,i,n)}var w=new S.default.Vector(m,g,v);e.vertexNormals.push(w,w,w),e.faces.push([3*d,3*d+1,3*d+2]),e.uvs.push([0,0],[0,0],[0,0])}}(e,t);else{var r=new DataView(t);if(!("TextDecoder"in window))return console.warn("Sorry, ASCII STL loading only works in browsers that support TextDecoder (https://caniuse.com/#feat=textencoder)");var i=new TextDecoder("utf-8").decode(r).split("\n");!function(e,t){for(var r,i,n="",o=[],a=0;aMath.PI?l=Math.PI:l<=0&&(l=.001);var u=Math.sin(l)*a*Math.sin(s),h=Math.cos(l)*a,c=Math.sin(l)*a*Math.cos(s);this.camera(u+this.centerX,h+this.centerY,c+this.centerZ,this.centerX,this.centerY,this.centerZ,0,1,0)},m.default.Camera.prototype._isActive=function(){return this===this._renderer._curCamera},m.default.prototype.setCamera=function(e){this._renderer._curCamera=e,this._renderer.uPMatrix.set(e.projMatrix.mat4[0],e.projMatrix.mat4[1],e.projMatrix.mat4[2],e.projMatrix.mat4[3],e.projMatrix.mat4[4],e.projMatrix.mat4[5],e.projMatrix.mat4[6],e.projMatrix.mat4[7],e.projMatrix.mat4[8],e.projMatrix.mat4[9],e.projMatrix.mat4[10],e.projMatrix.mat4[11],e.projMatrix.mat4[12],e.projMatrix.mat4[13],e.projMatrix.mat4[14],e.projMatrix.mat4[15])};var n=m.default.Camera;r.default=n},{"../core/main":49}],98:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i,h=(i=e("../core/main"))&&i.__esModule?i:{default:i};h.default.Geometry=function(e,t,r){return this.vertices=[],this.lineVertices=[],this.lineNormals=[],this.vertexNormals=[],this.faces=[],this.uvs=[],this.edges=[],this.vertexColors=[],this.detailX=void 0!==e?e:1,this.detailY=void 0!==t?t:1,this.dirtyFlags={},r instanceof Function&&r.call(this),this},h.default.Geometry.prototype.reset=function(){this.lineVertices.length=0,this.lineNormals.length=0,this.vertices.length=0,this.edges.length=0,this.vertexColors.length=0,this.vertexNormals.length=0,this.uvs.length=0,this.dirtyFlags={}},h.default.Geometry.prototype.computeFaces=function(){this.faces.length=0;for(var e,t,r,i,n=this.detailX+1,o=0;othis.vertices.length-1-this.detailX;i--)e.add(this.vertexNormals[i]);e=h.default.Vector.div(e,this.detailX);for(var n=this.vertices.length-1;n>this.vertices.length-1-this.detailX;n--)this.vertexNormals[n]=e;return this},h.default.Geometry.prototype._makeTriangleEdges=function(){if(this.edges.length=0,Array.isArray(this.strokeIndices))for(var e=0,t=this.strokeIndices.length;e vTexCoord.y;\n bool y1 = p1.y > vTexCoord.y;\n bool y2 = p2.y > vTexCoord.y;\n\n // could web be under the curve (after t1)?\n if (y1 ? !y2 : y0) {\n // add the coverage for t1\n coverage.x += saturate(C1.x + 0.5);\n // calculate the anti-aliasing for t1\n weight.x = min(weight.x, abs(C1.x));\n }\n\n // are we outside the curve (after t2)?\n if (y1 ? !y0 : y2) {\n // subtract the coverage for t2\n coverage.x -= saturate(C2.x + 0.5);\n // calculate the anti-aliasing for t2\n weight.x = min(weight.x, abs(C2.x));\n }\n}\n\n// this is essentially the same as coverageX, but with the axes swapped\nvoid coverageY(vec2 p0, vec2 p1, vec2 p2) {\n\n vec2 C1, C2;\n calulateCrossings(p0, p1, p2, C1, C2);\n\n bool x0 = p0.x > vTexCoord.x;\n bool x1 = p1.x > vTexCoord.x;\n bool x2 = p2.x > vTexCoord.x;\n\n if (x1 ? !x2 : x0) {\n coverage.y -= saturate(C1.y + 0.5);\n weight.y = min(weight.y, abs(C1.y));\n }\n\n if (x1 ? !x0 : x2) {\n coverage.y += saturate(C2.y + 0.5);\n weight.y = min(weight.y, abs(C2.y));\n }\n}\n\nvoid main() {\n\n // calculate the pixel scale based on screen-coordinates\n pixelScale = hardness / fwidth(vTexCoord);\n\n // which grid cell is this pixel in?\n ivec2 gridCoord = ifloor(vTexCoord * vec2(uGridSize));\n\n // intersect curves in this row\n {\n // the index into the row info bitmap\n int rowIndex = gridCoord.y + uGridOffset.y;\n // fetch the info texel\n vec4 rowInfo = getTexel(uSamplerRows, rowIndex, uGridImageSize);\n // unpack the rowInfo\n int rowStrokeIndex = getInt16(rowInfo.xy);\n int rowStrokeCount = getInt16(rowInfo.zw);\n\n for (int iRowStroke = INT(0); iRowStroke < N; iRowStroke++) {\n if (iRowStroke >= rowStrokeCount)\n break;\n\n // each stroke is made up of 3 points: the start and control point\n // and the start of the next curve.\n // fetch the indices of this pair of strokes:\n vec4 strokeIndices = getTexel(uSamplerRowStrokes, rowStrokeIndex++, uCellsImageSize);\n\n // unpack the stroke index\n int strokePos = getInt16(strokeIndices.xy);\n\n // fetch the two strokes\n vec4 stroke0 = getTexel(uSamplerStrokes, strokePos + INT(0), uStrokeImageSize);\n vec4 stroke1 = getTexel(uSamplerStrokes, strokePos + INT(1), uStrokeImageSize);\n\n // calculate the coverage\n coverageX(stroke0.xy, stroke0.zw, stroke1.xy);\n }\n }\n\n // intersect curves in this column\n {\n int colIndex = gridCoord.x + uGridOffset.x;\n vec4 colInfo = getTexel(uSamplerCols, colIndex, uGridImageSize);\n int colStrokeIndex = getInt16(colInfo.xy);\n int colStrokeCount = getInt16(colInfo.zw);\n \n for (int iColStroke = INT(0); iColStroke < N; iColStroke++) {\n if (iColStroke >= colStrokeCount)\n break;\n\n vec4 strokeIndices = getTexel(uSamplerColStrokes, colStrokeIndex++, uCellsImageSize);\n\n int strokePos = getInt16(strokeIndices.xy);\n vec4 stroke0 = getTexel(uSamplerStrokes, strokePos + INT(0), uStrokeImageSize);\n vec4 stroke1 = getTexel(uSamplerStrokes, strokePos + INT(1), uStrokeImageSize);\n coverageY(stroke0.xy, stroke0.zw, stroke1.xy);\n }\n }\n\n weight = saturate(1.0 - weight * 2.0);\n float distance = max(weight.x + weight.y, minDistance); // manhattan approx.\n float antialias = abs(dot(coverage, weight) / distance);\n float cover = min(abs(coverage.x), abs(coverage.y));\n gl_FragColor = uMaterialColor;\n gl_FragColor.a *= saturate(max(antialias, cover));\n}",lineVert:"/*\n Part of the Processing project - http://processing.org\n Copyright (c) 2012-15 The Processing Foundation\n Copyright (c) 2004-12 Ben Fry and Casey Reas\n Copyright (c) 2001-04 Massachusetts Institute of Technology\n This library is free software; you can redistribute it and/or\n modify it under the terms of the GNU Lesser General Public\n License as published by the Free Software Foundation, version 2.1.\n This library is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n Lesser General Public License for more details.\n You should have received a copy of the GNU Lesser General\n Public License along with this library; if not, write to the\n Free Software Foundation, Inc., 59 Temple Place, Suite 330,\n Boston, MA 02111-1307 USA\n*/\n\n#define PROCESSING_LINE_SHADER\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform float uStrokeWeight;\n\nuniform vec4 uViewport;\nuniform int uPerspective;\n\nattribute vec4 aPosition;\nattribute vec4 aDirection;\n \nvoid main() {\n // using a scale <1 moves the lines towards the camera\n // in order to prevent popping effects due to half of\n // the line disappearing behind the geometry faces.\n vec3 scale = vec3(0.9995);\n\n vec4 posp = uModelViewMatrix * aPosition;\n vec4 posq = uModelViewMatrix * (aPosition + vec4(aDirection.xyz, 0));\n\n // Moving vertices slightly toward the camera\n // to avoid depth-fighting with the fill triangles.\n // Discussed here:\n // http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Number=252848 \n posp.xyz = posp.xyz * scale;\n posq.xyz = posq.xyz * scale;\n\n vec4 p = uProjectionMatrix * posp;\n vec4 q = uProjectionMatrix * posq;\n\n // formula to convert from clip space (range -1..1) to screen space (range 0..[width or height])\n // screen_p = (p.xy/p.w + <1,1>) * 0.5 * uViewport.zw\n\n // prevent division by W by transforming the tangent formula (div by 0 causes\n // the line to disappear, see https://github.com/processing/processing/issues/5183)\n // t = screen_q - screen_p\n //\n // tangent is normalized and we don't care which aDirection it points to (+-)\n // t = +- normalize( screen_q - screen_p )\n // t = +- normalize( (q.xy/q.w+<1,1>)*0.5*uViewport.zw - (p.xy/p.w+<1,1>)*0.5*uViewport.zw )\n //\n // extract common factor, <1,1> - <1,1> cancels out\n // t = +- normalize( (q.xy/q.w - p.xy/p.w) * 0.5 * uViewport.zw )\n //\n // convert to common divisor\n // t = +- normalize( ((q.xy*p.w - p.xy*q.w) / (p.w*q.w)) * 0.5 * uViewport.zw )\n //\n // remove the common scalar divisor/factor, not needed due to normalize and +-\n // (keep uViewport - can't remove because it has different components for x and y\n // and corrects for aspect ratio, see https://github.com/processing/processing/issues/5181)\n // t = +- normalize( (q.xy*p.w - p.xy*q.w) * uViewport.zw )\n\n vec2 tangent = normalize((q.xy*p.w - p.xy*q.w) * uViewport.zw);\n\n // flip tangent to normal (it's already normalized)\n vec2 normal = vec2(-tangent.y, tangent.x);\n\n float thickness = aDirection.w * uStrokeWeight;\n vec2 offset = normal * thickness / 2.0;\n\n vec2 curPerspScale;\n\n if(uPerspective == 1) {\n // Perspective ---\n // convert from world to clip by multiplying with projection scaling factor\n // to get the right thickness (see https://github.com/processing/processing/issues/5182)\n // invert Y, projections in Processing invert Y\n curPerspScale = (uProjectionMatrix * vec4(1, -1, 0, 0)).xy;\n } else {\n // No Perspective ---\n // multiply by W (to cancel out division by W later in the pipeline) and\n // convert from screen to clip (derived from clip to screen above)\n curPerspScale = p.w / (0.5 * uViewport.zw);\n }\n\n gl_Position.xy = p.xy + offset.xy * curPerspScale;\n gl_Position.zw = p.zw;\n}\n",lineFrag:"precision mediump float;\nprecision mediump int;\n\nuniform vec4 uMaterialColor;\n\nvoid main() {\n gl_FragColor = uMaterialColor;\n}",pointVert:"attribute vec3 aPosition;\nuniform float uPointSize;\nvarying float vStrokeWeight;\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nvoid main() {\n\tvec4 positionVec4 = vec4(aPosition, 1.0);\n\tgl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n\tgl_PointSize = uPointSize;\n\tvStrokeWeight = uPointSize;\n}",pointFrag:"precision mediump float;\nprecision mediump int;\nuniform vec4 uMaterialColor;\nvarying float vStrokeWeight;\n\nvoid main(){\n\tfloat mask = 0.0;\n\n\t// make a circular mask using the gl_PointCoord (goes from 0 - 1 on a point)\n // might be able to get a nicer edge on big strokeweights with smoothstep but slightly less performant\n\n\tmask = step(0.98, length(gl_PointCoord * 2.0 - 1.0));\n\n\t// if strokeWeight is 1 or less lets just draw a square\n\t// this prevents weird artifacting from carving circles when our points are really small\n\t// if strokeWeight is larger than 1, we just use it as is\n\n\tmask = mix(0.0, mask, clamp(floor(vStrokeWeight - 0.5),0.0,1.0));\n\n\t// throw away the borders of the mask\n // otherwise we get weird alpha blending issues\n\n\tif(mask > 0.98){\n discard;\n \t}\n\n \tgl_FragColor = vec4(uMaterialColor.rgb * (1.0 - mask), uMaterialColor.a) ;\n}"};u.default.RendererGL=function(e,t,r,i){return u.default.Renderer.call(this,e,t,r),this._setAttributeDefaults(t),this._initContext(),this.isP3D=!0,this.GL=this.drawingContext,this._isErasing=!1,this._enableLighting=!1,this.ambientLightColors=[],this.specularColors=[1,1,1],this.directionalLightDirections=[],this.directionalLightDiffuseColors=[],this.directionalLightSpecularColors=[],this.pointLightPositions=[],this.pointLightDiffuseColors=[],this.pointLightSpecularColors=[],this.spotLightPositions=[],this.spotLightDirections=[],this.spotLightDiffuseColors=[],this.spotLightSpecularColors=[],this.spotLightAngle=[],this.spotLightConc=[],this.drawMode=o.FILL,this.curFillColor=this._cachedFillStyle=[1,1,1,1],this.curStrokeColor=this._cachedStrokeStyle=[0,0,0,1],this.curBlendMode=o.BLEND,this._cachedBlendMode=void 0,this.blendExt=this.GL.getExtension("EXT_blend_minmax"),this._isBlending=!1,this._useSpecularMaterial=!1,this._useEmissiveMaterial=!1,this._useNormalMaterial=!1,this._useShininess=1,this._tint=[255,255,255,255],this.constantAttenuation=1,this.linearAttenuation=0,this.quadraticAttenuation=0,this.uMVMatrix=new u.default.Matrix,this.uPMatrix=new u.default.Matrix,this.uNMatrix=new u.default.Matrix("mat3"),this._curCamera=new u.default.Camera(this),this._curCamera._computeCameraDefaultSettings(),this._curCamera._setDefaultCamera(),this._defaultLightShader=void 0,this._defaultImmediateModeShader=void 0,this._defaultNormalShader=void 0,this._defaultColorShader=void 0,this._defaultPointShader=void 0,this.userFillShader=void 0,this.userStrokeShader=void 0,this.userPointShader=void 0,this.retainedMode={geometry:{},buffers:{stroke:[new u.default.RenderBuffer(3,"lineVertices","lineVertexBuffer","aPosition",this,this._flatten),new u.default.RenderBuffer(4,"lineNormals","lineNormalBuffer","aDirection",this,this._flatten)],fill:[new u.default.RenderBuffer(3,"vertices","vertexBuffer","aPosition",this,this._vToNArray),new u.default.RenderBuffer(3,"vertexNormals","normalBuffer","aNormal",this,this._vToNArray),new u.default.RenderBuffer(4,"vertexColors","colorBuffer","aMaterialColor",this),new u.default.RenderBuffer(3,"vertexAmbients","ambientBuffer","aAmbientColor",this),new u.default.RenderBuffer(2,"uvs","uvBuffer","aTexCoord",this,this._flatten)],text:[new u.default.RenderBuffer(3,"vertices","vertexBuffer","aPosition",this,this._vToNArray),new u.default.RenderBuffer(2,"uvs","uvBuffer","aTexCoord",this,this._flatten)]}},this.immediateMode={geometry:new u.default.Geometry,shapeMode:o.TRIANGLE_FAN,_bezierVertex:[],_quadraticVertex:[],_curveVertex:[],buffers:{fill:[new u.default.RenderBuffer(3,"vertices","vertexBuffer","aPosition",this,this._vToNArray),new u.default.RenderBuffer(3,"vertexNormals","normalBuffer","aNormal",this,this._vToNArray),new u.default.RenderBuffer(4,"vertexColors","colorBuffer","aVertexColor",this),new u.default.RenderBuffer(3,"vertexAmbients","ambientBuffer","aAmbientColor",this),new u.default.RenderBuffer(2,"uvs","uvBuffer","aTexCoord",this,this._flatten)],stroke:[new u.default.RenderBuffer(3,"lineVertices","lineVertexBuffer","aPosition",this,this._flatten),new u.default.RenderBuffer(4,"lineNormals","lineNormalBuffer","aDirection",this,this._flatten)],point:this.GL.createBuffer()}},this.pointSize=5,this.curStrokeWeight=1,this.textures=[],this.textureMode=o.IMAGE,this.textureWrapX=o.CLAMP,this.textureWrapY=o.CLAMP,this._tex=null,this._curveTightness=6,this._lookUpTableBezier=[],this._lookUpTableQuadratic=[],this._lutBezierDetail=0,this._lutQuadraticDetail=0,this._tessy=this._initTessy(),this.fontInfos={},this._curShader=void 0,this},u.default.RendererGL.prototype=Object.create(u.default.Renderer.prototype),u.default.RendererGL.prototype._setAttributeDefaults=function(e){var t={alpha:!0,depth:!0,stencil:!0,antialias:navigator.userAgent.toLowerCase().includes("safari"),premultipliedAlpha:!1,preserveDrawingBuffer:!0,perPixelLighting:!0};null===e._glAttributes?e._glAttributes=t:e._glAttributes=Object.assign(t,e._glAttributes)},u.default.RendererGL.prototype._initContext=function(){try{if(this.drawingContext=this.canvas.getContext("webgl",this._pInst._glAttributes)||this.canvas.getContext("experimental-webgl",this._pInst._glAttributes),null===this.drawingContext)throw new Error("Error creating webgl context");var e=this.drawingContext;e.enable(e.DEPTH_TEST),e.depthFunc(e.LEQUAL),e.viewport(0,0,e.drawingBufferWidth,e.drawingBufferHeight),this._viewport=this.drawingContext.getParameter(this.drawingContext.VIEWPORT)}catch(e){throw e}},u.default.RendererGL.prototype._resetContext=function(e,t){var r=this.width,i=this.height,n=this.canvas.id,o=this._pInst instanceof u.default.Graphics;if(o){var a=this._pInst;a.canvas.parentNode.removeChild(a.canvas),a.canvas=document.createElement("canvas"),(a._pInst._userNode||document.body).appendChild(a.canvas),u.default.Element.call(a,a.canvas,a._pInst),a.width=r,a.height=i}else{var s=this.canvas;s&&s.parentNode.removeChild(s),(s=document.createElement("canvas")).id=n,this._pInst._userNode?this._pInst._userNode.appendChild(s):document.body.appendChild(s),this._pInst.canvas=s}var l=new u.default.RendererGL(this._pInst.canvas,this._pInst,!o);this._pInst._setProperty("_renderer",l),l.resize(r,i),l._applyDefaults(),o||this._pInst._elements.push(l),"function"==typeof t&&setTimeout(function(){t.apply(window._renderer,e)},0)},u.default.prototype.setAttributes=function(e,t){if(void 0!==this._glAttributes){var r=!0;if(void 0!==t?(null===this._glAttributes&&(this._glAttributes={}),this._glAttributes[e]!==t&&(this._glAttributes[e]=t,r=!1)):e instanceof Object&&this._glAttributes!==e&&(this._glAttributes=e,r=!1),this._renderer.isP3D&&!r){if(!this._setupDone)for(var i in this._renderer.retainedMode.geometry)if(this._renderer.retainedMode.geometry.hasOwnProperty(i))return void console.error("Sorry, Could not set the attributes, you need to call setAttributes() before calling the other drawing methods in setup()");this.push(),this._renderer._resetContext(),this.pop(),this._renderer._curCamera&&(this._renderer._curCamera._renderer=this._renderer)}}else console.log("You are trying to use setAttributes on a p5.Graphics object that does not use a WEBGL renderer.")},u.default.RendererGL.prototype._update=function(){this.uMVMatrix.set(this._curCamera.cameraMatrix.mat4[0],this._curCamera.cameraMatrix.mat4[1],this._curCamera.cameraMatrix.mat4[2],this._curCamera.cameraMatrix.mat4[3],this._curCamera.cameraMatrix.mat4[4],this._curCamera.cameraMatrix.mat4[5],this._curCamera.cameraMatrix.mat4[6],this._curCamera.cameraMatrix.mat4[7],this._curCamera.cameraMatrix.mat4[8],this._curCamera.cameraMatrix.mat4[9],this._curCamera.cameraMatrix.mat4[10],this._curCamera.cameraMatrix.mat4[11],this._curCamera.cameraMatrix.mat4[12],this._curCamera.cameraMatrix.mat4[13],this._curCamera.cameraMatrix.mat4[14],this._curCamera.cameraMatrix.mat4[15]),this.ambientLightColors.length=0,this.specularColors=[1,1,1],this.directionalLightDirections.length=0,this.directionalLightDiffuseColors.length=0,this.directionalLightSpecularColors.length=0,this.pointLightPositions.length=0,this.pointLightDiffuseColors.length=0,this.pointLightSpecularColors.length=0,this.spotLightPositions.length=0,this.spotLightDirections.length=0,this.spotLightDiffuseColors.length=0,this.spotLightSpecularColors.length=0,this.spotLightAngle.length=0,this.spotLightConc.length=0,this._enableLighting=!1,this._tint=[255,255,255,255],this.GL.clear(this.GL.DEPTH_BUFFER_BIT)},u.default.RendererGL.prototype.background=function(){var e,t=(e=this._pInst).color.apply(e,arguments),r=t.levels[0]/255,i=t.levels[1]/255,n=t.levels[2]/255,o=t.levels[3]/255;this.GL.clearColor(r,i,n,o),this.GL.clear(this.GL.COLOR_BUFFER_BIT)},u.default.RendererGL.prototype.fill=function(e,t,r,i){var n=u.default.prototype.color.apply(this._pInst,arguments);this.curFillColor=n._array,this.drawMode=o.FILL,this._useNormalMaterial=!1,this._tex=null},u.default.RendererGL.prototype.stroke=function(e,t,r,i){arguments[3]=255;var n=u.default.prototype.color.apply(this._pInst,arguments);this.curStrokeColor=n._array},u.default.RendererGL.prototype.strokeCap=function(e){console.error("Sorry, strokeCap() is not yet implemented in WEBGL mode")},u.default.RendererGL.prototype.strokeJoin=function(e){console.error("Sorry, strokeJoin() is not yet implemented in WEBGL mode")},u.default.RendererGL.prototype.filter=function(e){console.error("filter() does not work in WEBGL mode")},u.default.RendererGL.prototype.blendMode=function(e){e===o.DARKEST||e===o.LIGHTEST||e===o.ADD||e===o.BLEND||e===o.SUBTRACT||e===o.SCREEN||e===o.EXCLUSION||e===o.REPLACE||e===o.MULTIPLY||e===o.REMOVE?this.curBlendMode=e:e!==o.BURN&&e!==o.OVERLAY&&e!==o.HARD_LIGHT&&e!==o.SOFT_LIGHT&&e!==o.DODGE||console.warn("BURN, OVERLAY, HARD_LIGHT, SOFT_LIGHT, and DODGE only work for blendMode in 2D mode.")},u.default.RendererGL.prototype.erase=function(e,t){this._isErasing||(this._cachedBlendMode=this.curBlendMode,this.blendMode(o.REMOVE),this._cachedFillStyle=this.curFillColor.slice(),this.curFillColor=[1,1,1,e/255],this._cachedStrokeStyle=this.curStrokeColor.slice(),this.curStrokeColor=[1,1,1,t/255],this._isErasing=!0)},u.default.RendererGL.prototype.noErase=function(){this._isErasing&&(this.curFillColor=this._cachedFillStyle.slice(),this.curStrokeColor=this._cachedStrokeStyle.slice(),this.blendMode(this._cachedBlendMode),this._isErasing=!1)},u.default.RendererGL.prototype.strokeWeight=function(e){this.curStrokeWeight!==e&&(this.pointSize=e,this.curStrokeWeight=e)},u.default.RendererGL.prototype._getPixel=function(e,t){var r;return r=new Uint8Array(4),this.drawingContext.readPixels(e,t,1,1,this.drawingContext.RGBA,this.drawingContext.UNSIGNED_BYTE,r),[r[0],r[1],r[2],r[3]]},u.default.RendererGL.prototype.loadPixels=function(){var e=this._pixelsState;if(!0===this._pInst._glAttributes.preserveDrawingBuffer){var t=e.pixels,r=this.GL.drawingBufferWidth*this.GL.drawingBufferHeight*4;t instanceof Uint8Array&&t.length===r||(t=new Uint8Array(r),this._pixelsState._setProperty("pixels",t));var i=this._pInst._pixelDensity;this.GL.readPixels(0,0,this.width*i,this.height*i,this.GL.RGBA,this.GL.UNSIGNED_BYTE,t)}else console.log("loadPixels only works in WebGL when preserveDrawingBuffer is true.")},u.default.RendererGL.prototype.geometryInHash=function(e){return void 0!==this.retainedMode.geometry[e]},u.default.RendererGL.prototype.resize=function(e,t){u.default.Renderer.prototype.resize.call(this,e,t),this.GL.viewport(0,0,this.GL.drawingBufferWidth,this.GL.drawingBufferHeight),this._viewport=this.GL.getParameter(this.GL.VIEWPORT),this._curCamera._resize();var r=this._pixelsState;void 0!==r.pixels&&r._setProperty("pixels",new Uint8Array(this.GL.drawingBufferWidth*this.GL.drawingBufferHeight*4))},u.default.RendererGL.prototype.clear=function(){var e=(arguments.length<=0?void 0:arguments[0])||0,t=(arguments.length<=1?void 0:arguments[1])||0,r=(arguments.length<=2?void 0:arguments[2])||0,i=(arguments.length<=3?void 0:arguments[3])||0;this.GL.clearColor(e,t,r,i),this.GL.clear(this.GL.COLOR_BUFFER_BIT|this.GL.DEPTH_BUFFER_BIT)},u.default.RendererGL.prototype.applyMatrix=function(e,t,r,i,n,o){16===arguments.length?u.default.Matrix.prototype.apply.apply(this.uMVMatrix,arguments):this.uMVMatrix.apply([e,t,0,0,r,i,0,0,0,0,1,0,n,o,0,1])},u.default.RendererGL.prototype.translate=function(e,t,r){return e instanceof u.default.Vector&&(r=e.z,t=e.y,e=e.x),this.uMVMatrix.translate([e,t,r]),this},u.default.RendererGL.prototype.scale=function(e,t,r){return this.uMVMatrix.scale(e,t,r),this},u.default.RendererGL.prototype.rotate=function(e,t){return void 0===t?this.rotateZ(e):(u.default.Matrix.prototype.rotate.apply(this.uMVMatrix,arguments),this)},u.default.RendererGL.prototype.rotateX=function(e){return this.rotate(e,1,0,0),this},u.default.RendererGL.prototype.rotateY=function(e){return this.rotate(e,0,1,0),this},u.default.RendererGL.prototype.rotateZ=function(e){return this.rotate(e,0,0,1),this},u.default.RendererGL.prototype.push=function(){var e=u.default.Renderer.prototype.push.apply(this),t=e.properties;return t.uMVMatrix=this.uMVMatrix.copy(),t.uPMatrix=this.uPMatrix.copy(),t._curCamera=this._curCamera,this._curCamera=this._curCamera.copy(),t.ambientLightColors=this.ambientLightColors.slice(),t.specularColors=this.specularColors.slice(),t.directionalLightDirections=this.directionalLightDirections.slice(),t.directionalLightDiffuseColors=this.directionalLightDiffuseColors.slice(),t.directionalLightSpecularColors=this.directionalLightSpecularColors.slice(),t.pointLightPositions=this.pointLightPositions.slice(),t.pointLightDiffuseColors=this.pointLightDiffuseColors.slice(),t.pointLightSpecularColors=this.pointLightSpecularColors.slice(),t.spotLightPositions=this.spotLightPositions.slice(),t.spotLightDirections=this.spotLightDirections.slice(),t.spotLightDiffuseColors=this.spotLightDiffuseColors.slice(),t.spotLightSpecularColors=this.spotLightSpecularColors.slice(),t.spotLightAngle=this.spotLightAngle.slice(),t.spotLightConc=this.spotLightConc.slice(),t.userFillShader=this.userFillShader,t.userStrokeShader=this.userStrokeShader,t.userPointShader=this.userPointShader,t.pointSize=this.pointSize,t.curStrokeWeight=this.curStrokeWeight,t.curStrokeColor=this.curStrokeColor,t.curFillColor=this.curFillColor,t._useSpecularMaterial=this._useSpecularMaterial,t._useEmissiveMaterial=this._useEmissiveMaterial,t._useShininess=this._useShininess,t.constantAttenuation=this.constantAttenuation,t.linearAttenuation=this.linearAttenuation,t.quadraticAttenuation=this.quadraticAttenuation,t._enableLighting=this._enableLighting,t._useNormalMaterial=this._useNormalMaterial,t._tex=this._tex,t.drawMode=this.drawMode,e},u.default.RendererGL.prototype.resetMatrix=function(){return this.uMVMatrix=u.default.Matrix.identity(this._pInst),this},u.default.RendererGL.prototype._getImmediateStrokeShader=function(){var e=this.userStrokeShader;return e&&e.isStrokeShader()?e:this._getLineShader()},u.default.RendererGL.prototype._getRetainedStrokeShader=u.default.RendererGL.prototype._getImmediateStrokeShader,u.default.RendererGL.prototype._getImmediateFillShader=function(){var e=this.userFillShader;if(this._useNormalMaterial&&(!e||!e.isNormalShader()))return this._getNormalShader();if(this._enableLighting){if(!e||!e.isLightShader())return this._getLightShader()}else if(this._tex){if(!e||!e.isTextureShader())return this._getLightShader()}else if(!e)return this._getImmediateModeShader();return e},u.default.RendererGL.prototype._getRetainedFillShader=function(){if(this._useNormalMaterial)return this._getNormalShader();var e=this.userFillShader;if(this._enableLighting){if(!e||!e.isLightShader())return this._getLightShader()}else if(this._tex){if(!e||!e.isTextureShader())return this._getLightShader()}else if(!e)return this._getColorShader();return e},u.default.RendererGL.prototype._getImmediatePointShader=function(){var e=this.userPointShader;return e&&e.isPointShader()?e:this._getPointShader()},u.default.RendererGL.prototype._getRetainedLineShader=u.default.RendererGL.prototype._getImmediateLineShader,u.default.RendererGL.prototype._getLightShader=function(){return this._defaultLightShader||(this._pInst._glAttributes.perPixelLighting?this._defaultLightShader=new u.default.Shader(this,c.phongVert,c.phongFrag):this._defaultLightShader=new u.default.Shader(this,c.lightVert,c.lightTextureFrag)),this._defaultLightShader},u.default.RendererGL.prototype._getImmediateModeShader=function(){return this._defaultImmediateModeShader||(this._defaultImmediateModeShader=new u.default.Shader(this,c.immediateVert,c.vertexColorFrag)),this._defaultImmediateModeShader},u.default.RendererGL.prototype._getNormalShader=function(){return this._defaultNormalShader||(this._defaultNormalShader=new u.default.Shader(this,c.normalVert,c.normalFrag)),this._defaultNormalShader},u.default.RendererGL.prototype._getColorShader=function(){return this._defaultColorShader||(this._defaultColorShader=new u.default.Shader(this,c.normalVert,c.basicFrag)),this._defaultColorShader},u.default.RendererGL.prototype._getPointShader=function(){return this._defaultPointShader||(this._defaultPointShader=new u.default.Shader(this,c.pointVert,c.pointFrag)),this._defaultPointShader},u.default.RendererGL.prototype._getLineShader=function(){return this._defaultLineShader||(this._defaultLineShader=new u.default.Shader(this,c.lineVert,c.lineFrag)),this._defaultLineShader},u.default.RendererGL.prototype._getFontShader=function(){return this._defaultFontShader||(this.GL.getExtension("OES_standard_derivatives"),this._defaultFontShader=new u.default.Shader(this,c.fontVert,c.fontFrag)),this._defaultFontShader},u.default.RendererGL.prototype._getEmptyTexture=function(){if(!this._emptyTexture){var e=new u.default.Image(1,1);e.set(0,0,255),this._emptyTexture=new u.default.Texture(this,e)}return this._emptyTexture},u.default.RendererGL.prototype.getTexture=function(e){var t=this.textures,r=!0,i=!1,n=void 0;try{for(var o,a=t[Symbol.iterator]();!(r=(o=a.next()).done);r=!0){var s=o.value;if(s.src===e)return s}}catch(e){i=!0,n=e}finally{try{r||null==a.return||a.return()}finally{if(i)throw n}}var l=new u.default.Texture(this,e);return t.push(l),l},u.default.RendererGL.prototype._setStrokeUniforms=function(e){e.bindShader(),e.setUniform("uMaterialColor",this.curStrokeColor),e.setUniform("uStrokeWeight",this.curStrokeWeight)},u.default.RendererGL.prototype._setFillUniforms=function(e){e.bindShader(),e.setUniform("uMaterialColor",this.curFillColor),e.setUniform("isTexture",!!this._tex),this._tex&&e.setUniform("uSampler",this._tex),e.setUniform("uTint",this._tint),e.setUniform("uSpecular",this._useSpecularMaterial),e.setUniform("uEmissive",this._useEmissiveMaterial),e.setUniform("uShininess",this._useShininess),e.setUniform("uUseLighting",this._enableLighting);var t=this.pointLightDiffuseColors.length/3;e.setUniform("uPointLightCount",t),e.setUniform("uPointLightLocation",this.pointLightPositions),e.setUniform("uPointLightDiffuseColors",this.pointLightDiffuseColors),e.setUniform("uPointLightSpecularColors",this.pointLightSpecularColors);var r=this.directionalLightDiffuseColors.length/3;e.setUniform("uDirectionalLightCount",r),e.setUniform("uLightingDirection",this.directionalLightDirections),e.setUniform("uDirectionalDiffuseColors",this.directionalLightDiffuseColors),e.setUniform("uDirectionalSpecularColors",this.directionalLightSpecularColors);var i=this.ambientLightColors.length/3;e.setUniform("uAmbientLightCount",i),e.setUniform("uAmbientColor",this.ambientLightColors);var n=this.spotLightDiffuseColors.length/3;e.setUniform("uSpotLightCount",n),e.setUniform("uSpotLightAngle",this.spotLightAngle),e.setUniform("uSpotLightConc",this.spotLightConc),e.setUniform("uSpotLightDiffuseColors",this.spotLightDiffuseColors),e.setUniform("uSpotLightSpecularColors",this.spotLightSpecularColors),e.setUniform("uSpotLightLocation",this.spotLightPositions),e.setUniform("uSpotLightDirection",this.spotLightDirections),e.setUniform("uConstantAttenuation",this.constantAttenuation),e.setUniform("uLinearAttenuation",this.linearAttenuation),e.setUniform("uQuadraticAttenuation",this.quadraticAttenuation),e.bindTextures()},u.default.RendererGL.prototype._setPointUniforms=function(e){e.bindShader(),e.setUniform("uMaterialColor",this.curStrokeColor),e.setUniform("uPointSize",this.pointSize)},u.default.RendererGL.prototype._bindBuffer=function(e,t,r,i,n){if(t=t||this.GL.ARRAY_BUFFER,this.GL.bindBuffer(t,e),void 0!==r){var o=new(i||Float32Array)(r);this.GL.bufferData(t,o,n||this.GL.STATIC_DRAW)}},u.default.RendererGL.prototype._arraysEqual=function(e,t){var r=e.length;if(r!==t.length)return!1;for(var i=0;i>7,127&f,c>>7,127&c);for(var d=0;d>7,127&p,0,0)}}return{cellImageInfo:l,dimOffset:o,dimImageInfo:n}}return(t=this.glyphInfos[e.index]={glyph:e,uGlyphRect:[i.x1,-i.y1,i.x2,-i.y2],strokeImageInfo:U,strokes:d,colInfo:G(m,this.colDimImageInfos,this.colCellImageInfos),rowInfo:G(p,this.rowDimImageInfos,this.rowCellImageInfos)}).uGridOffset=[t.colInfo.dimOffset,t.rowInfo.dimOffset],t}}var z=Math.sqrt(3);j.default.RendererGL.prototype._renderText=function(e,t,r,i,n){if(this._textFont&&"string"!=typeof this._textFont){if(!(n<=i)&&this._doFill){if(!this._isOpenType())return console.log("WEBGL: only Opentype (.otf) and Truetype (.ttf) fonts are supported"),e;e.push();var o=this._doStroke,a=this.drawMode;this._doStroke=!1,this.drawMode=D.TEXTURE;var s=this._textFont.font,l=this._textFont._fontInfo;l=l||(this._textFont._fontInfo=new A(s));var u=this._textFont._handleAlignment(this,t,r,i),h=this._textSize/s.unitsPerEm;this.translate(u.x,u.y,0),this.scale(h,h,1);var c=this.GL,f=!this._defaultFontShader,d=this._getFontShader();d.init(),d.bindShader(),f&&(d.setUniform("uGridImageSize",[64,64]),d.setUniform("uCellsImageSize",[64,64]),d.setUniform("uStrokeImageSize",[64,64]),d.setUniform("uGridSize",[9,9])),this._applyColorBlend(this.curFillColor);var p=this.retainedMode.geometry.glyph;if(!p){var m=this._textGeom=new j.default.Geometry(1,1,function(){for(var e=0;e<=1;e++)for(var t=0;t<=1;t++)this.vertices.push(new j.default.Vector(t,e,0)),this.uvs.push(t,e)});m.computeFaces().computeNormals(),p=this.createBuffers("glyph",m)}var g=!0,v=!1,y=void 0;try{for(var b,_=this.retainedMode.buffers.text[Symbol.iterator]();!(g=(b=_.next()).done);g=!0){b.value._prepareBuffer(p,d)}}catch(e){v=!0,y=e}finally{try{g||null==_.return||_.return()}finally{if(v)throw y}}this._bindBuffer(p.indexBuffer,c.ELEMENT_ARRAY_BUFFER),d.setUniform("uMaterialColor",this.curFillColor);try{var x=0,w=null,S=s.stringToGlyphs(t),M=!0,E=!1,T=void 0;try{for(var C,P=S[Symbol.iterator]();!(M=(C=P.next()).done);M=!0){var L=C.value;w&&(x+=s.getKerningValue(w,L));var k=l.getGlyphInfo(L);if(k.uGlyphRect){var R=k.rowInfo,O=k.colInfo;d.setUniform("uSamplerStrokes",k.strokeImageInfo.imageData),d.setUniform("uSamplerRowStrokes",R.cellImageInfo.imageData),d.setUniform("uSamplerRows",R.dimImageInfo.imageData),d.setUniform("uSamplerColStrokes",O.cellImageInfo.imageData),d.setUniform("uSamplerCols",O.dimImageInfo.imageData),d.setUniform("uGridOffset",k.uGridOffset),d.setUniform("uGlyphRect",k.uGlyphRect),d.setUniform("uGlyphOffset",x),d.bindTextures(),c.drawElements(c.TRIANGLES,6,this.GL.UNSIGNED_SHORT,0)}x+=L.advanceWidth,w=L}}catch(e){E=!0,T=e}finally{try{M||null==P.return||P.return()}finally{if(E)throw T}}}finally{d.unbindShader(),this._doStroke=o,this.drawMode=a,e.pop()}return e}}else console.log("WEBGL: you must load and set a font before drawing text. See `loadFont` and `textFont` for more details.")}},{"../core/constants":42,"../core/main":49,"./p5.RendererGL.Retained":102,"./p5.Shader":104}],107:[function(e,t,r){t.exports={fes:{autoplay:"The media that tried to play (with '{{src}}') wasn't allowed to by this browser, most likely due to the browser's autoplay policy. Check out {{link}} for more information about why.",fileLoadError:{bytes:"It looks like there was a problem loading your file. {{suggestion}}",font:"It looks like there was a problem loading your font. {{suggestion}}",gif:"There was some trouble loading your GIF. Make sure that your GIF is using 87a or 89a encoding.",image:"It looks like there was a problem loading your image. {{suggestion}}",json:"It looks like there was a problem loading your JSON file. {{suggestion}}",large:"If your large file isn't fetched successfully, we recommend splitting the file into smaller segments and fetching those.",strings:"It looks like there was a problem loading your text file. {{suggestion}}",suggestion:"Try checking if the file path ({{filePath}}) is correct, hosting the file online, or running a local server. (More info at {{link}})",table:"It looks like there was a problem loading your table file. {{suggestion}}",xml:"It looks like there was a problem loading your XML file. {{suggestion}}"},misusedTopLevel:"Did you just try to use p5.js's {{symbolName}} {{symbolType}}? If so, you may want to move it into your sketch's setup() function.\n\nFor more details, see: {{link}}",pre:"🌸 p5.js says: {{message}}",welcome:"Welcome! This is your friendly debugger. To turn me off, switch to using p5.min.js."}}},{}],108:[function(e,t,r){t.exports={fes:{autoplay:"Su browser impidío un medio tocar (de '{{src}}'), posiblemente porque las reglas de autoplay. Para aprender más, visite {{link}}.",fileLoadError:{bytes:"",font:"",gif:"",image:"",json:"",large:"",strings:"",suggestion:"",table:"",xml:""},misusedTopLevel:"",pre:"🌸 p5.js dice: {{message}}",welcome:""}}},{}],109:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i=o(e("./en/translation")),n=o(e("./es/translation"));function o(e){return e&&e.__esModule?e:{default:e}}var a={en:{translation:i.default},es:{translation:n.default}};r.default=a},{"./en/translation":107,"./es/translation":108}]},{},[37])(37)}); ================================================ FILE: docs/examples/pyodide/sketch_010/target/target_sketch.js ================================================ const wrapperContent = ` class PythonFunctions: pass setattr(PythonFunctions, 'map', map) setattr(PythonFunctions, 'filter', filter) setattr(PythonFunctions, 'set', set) _P5_INSTANCE = None _CTX_MIDDLE = None _DEFAULT_FILL = None _DEFAULT_LEADMULT = None _DEFAULT_STROKE = None _DEFAULT_TEXT_FILL = None ADD = None ALT = None ARROW = None AUDIO = None AUTO = None AXES = None BACKSPACE = None BASELINE = None BEVEL = None BEZIER = None BLEND = None BLUR = None BOLD = None BOLDITALIC = None BOTTOM = None BURN = None CENTER = None CHORD = None CLAMP = None CLOSE = None CONTROL = None CORNER = None CORNERS = None CROSS = None CURVE = None DARKEST = None DEG_TO_RAD = None DEGREES = None DELETE = None DIFFERENCE = None DILATE = None DODGE = None DOWN_ARROW = None ENTER = None ERODE = None ESCAPE = None EXCLUSION = None FILL = None GRAY = None GRID = None HALF_PI = None HAND = None HARD_LIGHT = None HSB = None HSL = None IMAGE = None IMMEDIATE = None INVERT = None ITALIC = None LANDSCAPE = None LEFT = None LEFT_ARROW = None LIGHTEST = None LINE_LOOP = None LINE_STRIP = None LINEAR = None LINES = None MIRROR = None MITER = None MOVE = None MULTIPLY = None NEAREST = None NORMAL = None OPAQUE = None OPEN = None OPTION = None OVERLAY = None PI = None PIE = None POINTS = None PORTRAIT = None POSTERIZE = None PROJECT = None QUAD_STRIP = None QUADRATIC = None QUADS = None QUARTER_PI = None RAD_TO_DEG = None RADIANS = None RADIUS = None REPEAT = None REPLACE = None RETURN = None RGB = None RIGHT = None RIGHT_ARROW = None ROUND = None SCREEN = None SHIFT = None SOFT_LIGHT = None SQUARE = None STROKE = None SUBTRACT = None TAB = None TAU = None TEXT = None TEXTURE = None THRESHOLD = None TOP = None TRIANGLE_FAN = None TRIANGLE_STRIP = None TRIANGLES = None TWO_PI = None UP_ARROW = None VIDEO = None WAIT = None WEBGL = None P2D = None PI = None frameCount = None focused = None displayWidth = None displayHeight = None windowWidth = None windowHeight = None width = None height = None deviceOrientation = None accelerationX = None accelerationY = None accelerationZ = None pAccelerationX = None pAccelerationY = None pAccelerationZ = None rotationX = None rotationY = None rotationZ = None pRotationX = None pRotationY = None pRotationZ = None turnAxis = None keyIsPressed = None key = None keyCode = None mouseX = None mouseY = None pmouseX = None pmouseY = None winMouseX = None winMouseY = None pwinMouseX = None pwinMouseY = None mouseButton = None mouseIsPressed = None touches = None pixels = None def alpha(*args): return _P5_INSTANCE.alpha(*args) def blue(*args): return _P5_INSTANCE.blue(*args) def brightness(*args): return _P5_INSTANCE.brightness(*args) def color(*args): return _P5_INSTANCE.color(*args) def green(*args): return _P5_INSTANCE.green(*args) def hue(*args): return _P5_INSTANCE.hue(*args) def lerpColor(*args): return _P5_INSTANCE.lerpColor(*args) def lightness(*args): return _P5_INSTANCE.lightness(*args) def red(*args): return _P5_INSTANCE.red(*args) def saturation(*args): return _P5_INSTANCE.saturation(*args) def background(*args): return _P5_INSTANCE.background(*args) def clear(*args): p5_clear = _P5_INSTANCE.clear(*args) return p5_clear def erase(*args): return _P5_INSTANCE.erase(*args) def noErase(*args): return _P5_INSTANCE.noErase(*args) def colorMode(*args): return _P5_INSTANCE.colorMode(*args) def fill(*args): return _P5_INSTANCE.fill(*args) def noFill(*args): return _P5_INSTANCE.noFill(*args) def noStroke(*args): return _P5_INSTANCE.noStroke(*args) def stroke(*args): return _P5_INSTANCE.stroke(*args) def arc(*args): return _P5_INSTANCE.arc(*args) def ellipse(*args): return _P5_INSTANCE.ellipse(*args) def circle(*args): return _P5_INSTANCE.circle(*args) def line(*args): return _P5_INSTANCE.line(*args) def point(*args): return _P5_INSTANCE.point(*args) def quad(*args): return _P5_INSTANCE.quad(*args) def rect(*args): return _P5_INSTANCE.rect(*args) def square(*args): return _P5_INSTANCE.square(*args) def triangle(*args): return _P5_INSTANCE.triangle(*args) def plane(*args): return _P5_INSTANCE.plane(*args) def box(*args): return _P5_INSTANCE.box(*args) def sphere(*args): return _P5_INSTANCE.sphere(*args) def cylinder(*args): return _P5_INSTANCE.cylinder(*args) def cone(*args): return _P5_INSTANCE.cone(*args) def ellipsoid(*args): return _P5_INSTANCE.ellipsoid(*args) def torus(*args): return _P5_INSTANCE.torus(*args) def loadModel(*args): return _P5_INSTANCE.loadModel(*args) def model(*args): return _P5_INSTANCE.model(*args) def ellipseMode(*args): return _P5_INSTANCE.ellipseMode(*args) def noSmooth(*args): return _P5_INSTANCE.noSmooth(*args) def rectMode(*args): return _P5_INSTANCE.rectMode(*args) def smooth(*args): return _P5_INSTANCE.smooth(*args) def strokeCap(*args): return _P5_INSTANCE.strokeCap(*args) def strokeJoin(*args): return _P5_INSTANCE.strokeJoin(*args) def strokeWeight(*args): return _P5_INSTANCE.strokeWeight(*args) def bezier(*args): return _P5_INSTANCE.bezier(*args) def bezierDetail(*args): return _P5_INSTANCE.bezierDetail(*args) def bezierPoint(*args): return _P5_INSTANCE.bezierPoint(*args) def bezierTangent(*args): return _P5_INSTANCE.bezierTangent(*args) def curve(*args): return _P5_INSTANCE.curve(*args) def curveDetail(*args): return _P5_INSTANCE.curveDetail(*args) def curveTightness(*args): return _P5_INSTANCE.curveTightness(*args) def curvePoint(*args): return _P5_INSTANCE.curvePoint(*args) def curveTangent(*args): return _P5_INSTANCE.curveTangent(*args) def beginContour(*args): return _P5_INSTANCE.beginContour(*args) def beginShape(*args): return _P5_INSTANCE.beginShape(*args) def bezierVertex(*args): return _P5_INSTANCE.bezierVertex(*args) def curveVertex(*args): return _P5_INSTANCE.curveVertex(*args) def endContour(*args): return _P5_INSTANCE.endContour(*args) def endShape(*args): return _P5_INSTANCE.endShape(*args) def quadraticVertex(*args): return _P5_INSTANCE.quadraticVertex(*args) def vertex(*args): return _P5_INSTANCE.vertex(*args) def cursor(*args): return _P5_INSTANCE.cursor(*args) def frameRate(*args): return _P5_INSTANCE.frameRate(*args) def noCursor(*args): return _P5_INSTANCE.noCursor(*args) def fullscreen(*args): return _P5_INSTANCE.fullscreen(*args) def pixelDensity(*args): return _P5_INSTANCE.pixelDensity(*args) def displayDensity(*args): return _P5_INSTANCE.displayDensity(*args) def getURL(*args): return _P5_INSTANCE.getURL(*args) def getURLPath(*args): return _P5_INSTANCE.getURLPath(*args) def getURLParams(*args): return _P5_INSTANCE.getURLParams(*args) def remove(*args): return _P5_INSTANCE.remove(*args) def noLoop(*args): return _P5_INSTANCE.noLoop(*args) def loop(*args): return _P5_INSTANCE.loop(*args) def push(*args): return _P5_INSTANCE.push(*args) def redraw(*args): return _P5_INSTANCE.redraw(*args) def resizeCanvas(*args): return _P5_INSTANCE.resizeCanvas(*args) def noCanvas(*args): return _P5_INSTANCE.noCanvas(*args) def createGraphics(*args): return _P5_INSTANCE.createGraphics(*args) def blendMode(*args): return _P5_INSTANCE.blendMode(*args) def setAttributes(*args): return _P5_INSTANCE.setAttributes(*args) def applyMatrix(*args): return _P5_INSTANCE.applyMatrix(*args) def resetMatrix(*args): return _P5_INSTANCE.resetMatrix(*args) def rotate(*args): return _P5_INSTANCE.rotate(*args) def rotateX(*args): return _P5_INSTANCE.rotateX(*args) def rotateY(*args): return _P5_INSTANCE.rotateY(*args) def rotateZ(*args): return _P5_INSTANCE.rotateZ(*args) def scale(*args): return _P5_INSTANCE.scale(*args) def shearX(*args): return _P5_INSTANCE.shearX(*args) def shearY(*args): return _P5_INSTANCE.shearY(*args) def translate(*args): return _P5_INSTANCE.translate(*args) def createStringDict(*args): return _P5_INSTANCE.createStringDict(*args) def createNumberDict(*args): return _P5_INSTANCE.createNumberDict(*args) def append(*args): return _P5_INSTANCE.append(*args) def arrayCopy(*args): return _P5_INSTANCE.arrayCopy(*args) def concat(*args): return _P5_INSTANCE.concat(*args) def reverse(*args): return _P5_INSTANCE.reverse(*args) def shorten(*args): return _P5_INSTANCE.shorten(*args) def shuffle(*args): return _P5_INSTANCE.shuffle(*args) def sort(*args): return _P5_INSTANCE.sort(*args) def splice(*args): return _P5_INSTANCE.splice(*args) def subset(*args): return _P5_INSTANCE.subset(*args) def float(*args): return _P5_INSTANCE.float(*args) def int(*args): return _P5_INSTANCE.int(*args) def str(*args): return _P5_INSTANCE.str(*args) def boolean(*args): return _P5_INSTANCE.boolean(*args) def byte(*args): return _P5_INSTANCE.byte(*args) def char(*args): return _P5_INSTANCE.char(*args) def unchar(*args): return _P5_INSTANCE.unchar(*args) def hex(*args): return _P5_INSTANCE.hex(*args) def unhex(*args): return _P5_INSTANCE.unhex(*args) def join(*args): return _P5_INSTANCE.join(*args) def match(*args): return _P5_INSTANCE.match(*args) def matchAll(*args): return _P5_INSTANCE.matchAll(*args) def nf(*args): return _P5_INSTANCE.nf(*args) def nfc(*args): return _P5_INSTANCE.nfc(*args) def nfp(*args): return _P5_INSTANCE.nfp(*args) def nfs(*args): return _P5_INSTANCE.nfs(*args) def split(*args): return _P5_INSTANCE.split(*args) def splitTokens(*args): return _P5_INSTANCE.splitTokens(*args) def trim(*args): return _P5_INSTANCE.trim(*args) def setMoveThreshold(*args): return _P5_INSTANCE.setMoveThreshold(*args) def setShakeThreshold(*args): return _P5_INSTANCE.setShakeThreshold(*args) def keyIsDown(*args): return _P5_INSTANCE.keyIsDown(*args) def createImage(*args): return _P5_INSTANCE.createImage(*args) def saveCanvas(*args): return _P5_INSTANCE.saveCanvas(*args) def saveFrames(*args): return _P5_INSTANCE.saveFrames(*args) def loadImage(*args): return _P5_INSTANCE.loadImage(*args) def image(*args): return _P5_INSTANCE.image(*args) def tint(*args): return _P5_INSTANCE.tint(*args) def noTint(*args): return _P5_INSTANCE.noTint(*args) def imageMode(*args): return _P5_INSTANCE.imageMode(*args) def blend(*args): return _P5_INSTANCE.blend(*args) def copy(*args): return _P5_INSTANCE.copy(*args) def filter(*args): if len(args) > 1 and (args[0] is None or callable(args[0])): return PythonFunctions.filter(*args) else: return _P5_INSTANCE.filter(*args) def get(*args): return _P5_INSTANCE.get(*args) def loadPixels(*args): return _P5_INSTANCE.loadPixels(*args) def set(*args): if len(args) <= 1: return PythonFunctions.set(*args) else: return _P5_INSTANCE.set(*args) def updatePixels(*args): return _P5_INSTANCE.updatePixels(*args) def loadJSON(*args): return _P5_INSTANCE.loadJSON(*args) def loadStrings(*args): return _P5_INSTANCE.loadStrings(*args) def loadTable(*args): return _P5_INSTANCE.loadTable(*args) def loadXML(*args): return _P5_INSTANCE.loadXML(*args) def loadBytes(*args): return _P5_INSTANCE.loadBytes(*args) def httpGet(*args): return _P5_INSTANCE.httpGet(*args) def httpPost(*args): return _P5_INSTANCE.httpPost(*args) def httpDo(*args): return _P5_INSTANCE.httpDo(*args) def createWriter(*args): return _P5_INSTANCE.createWriter(*args) def save(*args): return _P5_INSTANCE.save(*args) def saveJSON(*args): return _P5_INSTANCE.saveJSON(*args) def saveStrings(*args): return _P5_INSTANCE.saveStrings(*args) def saveTable(*args): return _P5_INSTANCE.saveTable(*args) def day(*args): return _P5_INSTANCE.day(*args) def hour(*args): return _P5_INSTANCE.hour(*args) def minute(*args): return _P5_INSTANCE.minute(*args) def millis(*args): return _P5_INSTANCE.millis(*args) def month(*args): return _P5_INSTANCE.month(*args) def second(*args): return _P5_INSTANCE.second(*args) def year(*args): return _P5_INSTANCE.year(*args) def createVector(*args): return _P5_INSTANCE.createVector(*args) def abs(*args): return _P5_INSTANCE.abs(*args) def ceil(*args): return _P5_INSTANCE.ceil(*args) def constrain(*args): return _P5_INSTANCE.constrain(*args) def dist(*args): return _P5_INSTANCE.dist(*args) def exp(*args): return _P5_INSTANCE.exp(*args) def floor(*args): return _P5_INSTANCE.floor(*args) def lerp(*args): return _P5_INSTANCE.lerp(*args) def log(*args): return _P5_INSTANCE.log(*args) def mag(*args): return _P5_INSTANCE.mag(*args) def map(*args): if len(args) > 1 and callable(args[0]): return PythonFunctions.map(*args) else: return _P5_INSTANCE.map(*args) def max(*args): return _P5_INSTANCE.max(*args) def min(*args): return _P5_INSTANCE.min(*args) def norm(*args): return _P5_INSTANCE.norm(*args) def pow(*args): return _P5_INSTANCE.pow(*args) def round(*args): return _P5_INSTANCE.round(*args) def sq(*args): return _P5_INSTANCE.sq(*args) def sqrt(*args): return _P5_INSTANCE.sqrt(*args) def noise(*args): return _P5_INSTANCE.noise(*args) def noiseDetail(*args): return _P5_INSTANCE.noiseDetail(*args) def noiseSeed(*args): return _P5_INSTANCE.noiseSeed(*args) def randomSeed(*args): return _P5_INSTANCE.randomSeed(*args) def random(*args): return _P5_INSTANCE.random(*args) def randomGaussian(*args): return _P5_INSTANCE.randomGaussian(*args) def acos(*args): return _P5_INSTANCE.acos(*args) def asin(*args): return _P5_INSTANCE.asin(*args) def atan(*args): return _P5_INSTANCE.atan(*args) def atan2(*args): return _P5_INSTANCE.atan2(*args) def cos(*args): return _P5_INSTANCE.cos(*args) def sin(*args): return _P5_INSTANCE.sin(*args) def tan(*args): return _P5_INSTANCE.tan(*args) def degrees(*args): return _P5_INSTANCE.degrees(*args) def radians(*args): return _P5_INSTANCE.radians(*args) def angleMode(*args): return _P5_INSTANCE.angleMode(*args) def textAlign(*args): return _P5_INSTANCE.textAlign(*args) def textLeading(*args): return _P5_INSTANCE.textLeading(*args) def textSize(*args): return _P5_INSTANCE.textSize(*args) def textStyle(*args): return _P5_INSTANCE.textStyle(*args) def textWidth(*args): return _P5_INSTANCE.textWidth(*args) def textAscent(*args): return _P5_INSTANCE.textAscent(*args) def textDescent(*args): return _P5_INSTANCE.textDescent(*args) def loadFont(*args): return _P5_INSTANCE.loadFont(*args) def text(*args): return _P5_INSTANCE.text(*args) def textFont(*args): return _P5_INSTANCE.textFont(*args) def orbitControl(*args): return _P5_INSTANCE.orbitControl(*args) def debugMode(*args): return _P5_INSTANCE.debugMode(*args) def noDebugMode(*args): return _P5_INSTANCE.noDebugMode(*args) def ambientLight(*args): return _P5_INSTANCE.ambientLight(*args) def directionalLight(*args): return _P5_INSTANCE.directionalLight(*args) def pointLight(*args): return _P5_INSTANCE.pointLight(*args) def lights(*args): return _P5_INSTANCE.lights(*args) def loadShader(*args): return _P5_INSTANCE.loadShader(*args) def createShader(*args): return _P5_INSTANCE.createShader(*args) def shader(*args): return _P5_INSTANCE.shader(*args) def resetShader(*args): return _P5_INSTANCE.resetShader(*args) def normalMaterial(*args): return _P5_INSTANCE.normalMaterial(*args) def texture(*args): return _P5_INSTANCE.texture(*args) def textureMode(*args): return _P5_INSTANCE.textureMode(*args) def textureWrap(*args): return _P5_INSTANCE.textureWrap(*args) def ambientMaterial(*args): return _P5_INSTANCE.ambientMaterial(*args) def specularMaterial(*args): return _P5_INSTANCE.specularMaterial(*args) def shininess(*args): return _P5_INSTANCE.shininess(*args) def camera(*args): return _P5_INSTANCE.camera(*args) def perspective(*args): return _P5_INSTANCE.perspective(*args) def ortho(*args): return _P5_INSTANCE.ortho(*args) def createCamera(*args): return _P5_INSTANCE.createCamera(*args) def setCamera(*args): return _P5_INSTANCE.setCamera(*args) def select(*args): return _P5_INSTANCE.select(*args) def selectAll(*args): return _P5_INSTANCE.selectAll(*args) def removeElements(*args): return _P5_INSTANCE.removeElements(*args) def changed(*args): return _P5_INSTANCE.changed(*args) def input(*args): return _P5_INSTANCE.input(*args) def createDiv(*args): return _P5_INSTANCE.createDiv(*args) def createP(*args): return _P5_INSTANCE.createP(*args) def createSpan(*args): return _P5_INSTANCE.createSpan(*args) def createImg(*args): return _P5_INSTANCE.createImg(*args) def createA(*args): return _P5_INSTANCE.createA(*args) def createSlider(*args): return _P5_INSTANCE.createSlider(*args) def createButton(*args): return _P5_INSTANCE.createButton(*args) def createCheckbox(*args): return _P5_INSTANCE.createCheckbox(*args) def createSelect(*args): return _P5_INSTANCE.createSelect(*args) def createRadio(*args): return _P5_INSTANCE.createRadio(*args) def createColorPicker(*args): return _P5_INSTANCE.createColorPicker(*args) def createInput(*args): return _P5_INSTANCE.createInput(*args) def createFileInput(*args): return _P5_INSTANCE.createFileInput(*args) def createVideo(*args): return _P5_INSTANCE.createVideo(*args) def createAudio(*args): return _P5_INSTANCE.createAudio(*args) def createCapture(*args): return _P5_INSTANCE.createCapture(*args) def createElement(*args): return _P5_INSTANCE.createElement(*args) def createCanvas(*args): canvas = _P5_INSTANCE.createCanvas(*args) global width, height width = _P5_INSTANCE.width height = _P5_INSTANCE.height return canvas def __deviceMoved(e): try: _bind_event_function(deviceMoved, e) except NameError: pass def __deviceTurned(e): try: _bind_event_function(deviceTurned, e) except NameError: pass def __deviceShaken(e): try: _bind_event_function(deviceShaken, e) except NameError: pass def __touchEnded(e): try: _bind_event_function(deviceShaken, e) except NameError: pass def __touchStarted(e): try: _bind_event_function(touchStarted, e) except NameError: pass def __windowResized(e): try: _bind_event_function(windowResized, e) except NameError: pass def __touchMoved(e): try: _bind_event_function(touchMoved, e) except NameError: pass def __mouseMoved(e): try: _bind_event_function(mouseMoved, e) except NameError: pass def __mouseDragged(e): try: _bind_event_function(mouseDragged, e) except NameError: pass def __mousePressed(e): try: _bind_event_function(mousePressed, e) except NameError: pass def __mouseReleased(e): try: _bind_event_function(mouseReleased, e) except NameError: pass def __mouseClicked(e): try: _bind_event_function(mouseClicked, e) except NameError: pass def __doubleClicked(e): try: _bind_event_function(doubleClicked, e) except NameError: pass def __mouseWheel(e): try: _bind_event_function(mouseWheel, e) except NameError: pass def __keyPressed(e): try: _bind_event_function(keyPressed, e) except NameError: pass def __keyReleased(e): try: _bind_event_function(keyReleased, e) except NameError: pass def __keyTyped(e): try: _bind_event_function(keyTyped, e) except NameError: pass def __keyIsDown(e): try: _bind_event_function(keyIsDown, e) except NameError: pass def pop(*args): p5_pop = _P5_INSTANCE.pop(*args) return p5_pop # Processing Python or Java mode compatibility aliases size = createCanvas popMatrix = pop popStyle = pop pushMatrix = push pushStyle = push # PVector is a wrapper/helper class for p5.Vector objets # providing names similar to Processing Python or Java modes # but mostly keeping p5js functionality from numbers import Number class PVector: def __init__(self, x=0, y=0, z=0): self.__vector = createVector(x, y, z) self.add = self.__instance_add__ self.sub = self.__instance_sub__ self.mult = self.__instance_mult__ self.div = self.__instance_div__ self.cross = self.__instance_cross__ self.dist = self.__instance_dist__ self.dot = self.__instance_dot__ self.lerp = self.__instance_lerp__ @property def x(self): return self.__vector.x @x.setter def x(self, x): self.__vector.x = x @property def y(self): return self.__vector.y @y.setter def y(self, y): self.__vector.y = y @property def z(self): return self.__vector.z @z.setter def z(self, z): self.__vector.z = z def mag(self): return self.__vector.mag() def magSq(self): return self.__vector.magSq() def setMag(self, mag): self.__vector.setMag(mag) return self def normalize(self): self.__vector.normalize() return self def limit(self, max): self.__vector.limit(max) return self def heading(self): return self.__vector.heading() def rotate(self, angle): self.__vector.rotate(angle) return self def __instance_add__(self, *args): if len(args) == 1: return PVector.add(self, args[0], self) else: return PVector.add(self, PVector(*args), self) def __instance_sub__(self, *args): if len(args) == 1: return PVector.sub(self, args[0], self) else: return PVector.sub(self, PVector(*args), self) def __instance_mult__(self, o): return PVector.mult(self, o, self) def __instance_div__(self, f): return PVector.div(self, f, self) def __instance_cross__(self, o): return PVector.cross(self, o, self) def __instance_dist__(self, o): return PVector.dist(self, o) def __instance_dot__(self, *args): if len(args) == 1: v = args[0] else: v = args return self.x * v[0] + self.y * v[1] + self.z * v[2] def __instance_lerp__(self, *args): if len(args) == 2: return PVector.lerp(self, args[0], args[1], self) else: vx, vy, vz, f = args return PVector.lerp(self, PVector(vx, vy, vz), f, self) def get(self): return PVector(self.x, self.y, self.z) def copy(self): return PVector(self.x, self.y, self.z) def __getitem__(self, k): return getattr(self, ('x', 'y', 'z')[k]) def __setitem__(self, k, v): setattr(self, ('x', 'y', 'z')[k], v) def __copy__(self): return PVector(self.x, self.y, self.z) def __deepcopy__(self, memo): return PVector(self.x, self.y, self.z) def __repr__(self): # PROVISÓRIO return f'PVector({self.x}, {self.y}, {self.z})' def set(self, *args): """ Sets the x, y, and z component of the vector using two or three separate variables, the data from a p5.Vector, or the values from a float array. """ self.__vector.set(*args) @classmethod def add(cls, a, b, dest=None): if dest is None: return PVector(a.x + b[0], a.y + b[1], a.z + b[2]) dest.__vector.set(a.x + b[0], a.y + b[1], a.z + b[2]) return dest @classmethod def sub(cls, a, b, dest=None): if dest is None: return PVector(a.x - b[0], a.y - b[1], a.z - b[2]) dest.__vector.set(a.x - b[0], a.y - b[1], a.z - b[2]) return dest @classmethod def mult(cls, a, b, dest=None): if dest is None: return PVector(a.x * b, a.y * b, a.z * b) dest.__vector.set(a.x * b, a.y * b, a.z * b) return dest @classmethod def div(cls, a, b, dest=None): if dest is None: return PVector(a.x / b, a.y / b, a.z / b) dest.__vector.set(a.x / b, a.y / b, a.z / b) return dest @classmethod def dist(cls, a, b): return a.__vector.dist(b.__vector) @classmethod def dot(cls, a, b): return a.__vector.dot(b.__vector) def __add__(a, b): return PVector.add(a, b, None) def __sub__(a, b): return PVector.sub(a, b, None) def __isub__(a, b): a.sub(b) return a def __iadd__(a, b): a.add(b) return a def __mul__(a, b): if not isinstance(b, Number): raise TypeError( "The * operator can only be used to multiply a PVector by a number") return PVector.mult(a, float(b), None) def __rmul__(a, b): if not isinstance(b, Number): raise TypeError( "The * operator can only be used to multiply a PVector by a number") return PVector.mult(a, float(b), None) def __imul__(a, b): if not isinstance(b, Number): raise TypeError( "The *= operator can only be used to multiply a PVector by a number") a.__vector.mult(float(b)) return a def __truediv__(a, b): if not isinstance(b, Number): raise TypeError( "The * operator can only be used to multiply a PVector by a number") return PVector(a.x / float(b), a.y / float(b), a.z / float(b)) def __itruediv__(a, b): if not isinstance(b, Number): raise TypeError( "The /= operator can only be used to multiply a PVector by a number") a.__vector.set(a.x / float(b), a.y / float(b), a.z / float(b)) return a def __eq__(a, b): return a.x == b[0] and a.y == b[1] and a.z == b[2] def __lt__(a, b): return a.magSq() < b.magSq() def __le__(a, b): return a.magSq() <= b.magSq() def __gt__(a, b): return a.magSq() > b.magSq() def __ge__(a, b): return a.magSq() >= b.magSq() # Problematic class methods, we would rather use p5.Vector when possible... @classmethod def lerp(cls, a, b, f, dest=None): v = createVector(a.x, a.y, a.z) v.lerp(b.__vector, f) if dest is None: return PVector(v.x, v.y, v.z) dest.set(v.x, v.y, v.z) return dest @classmethod def cross(cls, a, b, dest=None): x = a.y * b[2] - b[1] * a.z y = a.z * b[0] - b[2] * a.x z = a.x * b[1] - b[0] * a.y if dest is None: return PVector(x, y, z) dest.set(x, y, z) return dest @classmethod def fromAngle(cls, angle, length=1): # https://github.com/processing/p5.js/blob/3f0b2f0fe575dc81c724474154f5b23a517b7233/src/math/p5.Vector.js return PVector(length * cos(angle), length * sin(angle), 0) @classmethod def fromAngles(theta, phi, length=1): # https://github.com/processing/p5.js/blob/3f0b2f0fe575dc81c724474154f5b23a517b7233/src/math/p5.Vector.js cosPhi = cos(phi) sinPhi = sin(phi) cosTheta = cos(theta) sinTheta = sin(theta) return PVector(length * sinTheta * sinPhi, -length * cosTheta, length * sinTheta * cosPhi) @classmethod def random2D(cls): return PVector.fromAngle(random(TWO_PI)) @classmethod def random3D(cls, dest=None): angle = random(TWO_PI) vz = random(2) - 1 mult = sqrt(1 - vz * vz) vx = mult * cos(angle) vy = mult * sin(angle) if dest is None: return PVector(vx, vy, vz) dest.set(vx, vy, vz) return dest @classmethod def angleBetween(cls, a, b): return acos(a.dot(b) / sqrt(a.magSq() * b.magSq())) # Other harmless p5js methods def equals(self, v): return self == v def heading2D(self): return self.__vector.heading() def reflect(self, *args): # Reflect the incoming vector about a normal to a line in 2D, or about # a normal to a plane in 3D This method acts on the vector directly r = self.__vector.reflect(*args) return r def array(self): # Return a representation of this vector as a float array. This is only # for temporary use. If used in any w fashion, the contents should be # copied by using the p5.Vector.copy() method to copy into your own # array. return self.__vector.array() def toString(self): # Returns a string representation of a vector v by calling String(v) or v.toString(). # return self.__vector.toString() would be something like "p5.vector # Object […, …, …]" return str(self) def rem(self, *args): # Gives remainder of a vector when it is divided by anw vector. See # examples for more context. self.__vector.rem(*args) return self def pre_draw(p5_instance, draw_func, *args, **kwargs): """ We need to run this before the actual draw to insert and update p5 env variables """ global _CTX_MIDDLE, _DEFAULT_FILL, _DEFAULT_LEADMULT, _DEFAULT_STROKE, _DEFAULT_TEXT_FILL global ADD, ALT, ARROW, AUTO, AUDIO, AXES, BACKSPACE, BASELINE, BEVEL, BEZIER, BLEND, BLUR, BOLD, BOLDITALIC global BOTTOM, BURN, CENTER, CHORD, CLAMP, CLOSE, CONTROL, CORNER, CORNERS, CROSS, CURVE, DARKEST global DEG_TO_RAD, DEGREES, DELETE, DIFFERENCE, DILATE, DODGE, DOWN_ARROW, ENTER, ERODE, ESCAPE, EXCLUSION global FILL, GRAY, GRID, HALF_PI, HAND, HARD_LIGHT, HSB, HSL, IMAGE, IMMEDIATE, INVERT, ITALIC, LANDSCAPE global LEFT, LEFT_ARROW, LIGHTEST, LINE_LOOP, LINE_STRIP, LINEAR, LINES, MIRROR, MITER, MOVE, MULTIPLY, NEAREST global NORMAL, OPAQUE, OPEN, OPTION, OVERLAY, P2D, P3D, PI, PIE, POINTS, PORTRAIT, POSTERIZE, PROJECT, QUAD_STRIP global QUADRATIC, QUADS, QUARTER_PI, RAD_TO_DEG, RADIANS, RADIUS, REPEAT, REPLACE, RETURN, RGB, RIGHT, RIGHT_ARROW global ROUND, SCREEN, SHIFT, SOFT_LIGHT, SQUARE, STROKE, SUBTRACT, TAB, TAU, TEXT, TEXTURE, THRESHOLD, TOP global TRIANGLE_FAN, TRIANGLE_STRIP, TRIANGLES, TWO_PI, UP_ARROW, VIDEO, WAIT, WEBGL global frameCount, focused, displayWidth, displayHeight, windowWidth, windowHeight, width, height global deviceOrientation, accelerationX, accelerationY, accelerationZ global pAccelerationX, pAccelerationY, pAccelerationZ, rotationX, rotationY, rotationZ global pRotationX, pRotationY, pRotationZ, turnAxis, keyIsPressed, key, keyCode, mouseX, mouseY, pmouseX, pmouseY global winMouseX, winMouseY, pwinMouseX, pwinMouseY, mouseButton, mouseIsPressed, touches, pixels _CTX_MIDDLE = p5_instance._CTX_MIDDLE _DEFAULT_FILL = p5_instance._DEFAULT_FILL _DEFAULT_LEADMULT = p5_instance._DEFAULT_LEADMULT _DEFAULT_STROKE = p5_instance._DEFAULT_STROKE _DEFAULT_TEXT_FILL = p5_instance._DEFAULT_TEXT_FILL ADD = p5_instance.ADD ALT = p5_instance.ALT ARROW = p5_instance.ARROW AUDIO = p5_instance.AUDIO AUTO = p5_instance.AUTO AXES = p5_instance.AXES BACKSPACE = p5_instance.BACKSPACE BASELINE = p5_instance.BASELINE BEVEL = p5_instance.BEVEL BEZIER = p5_instance.BEZIER BLEND = p5_instance.BLEND BLUR = p5_instance.BLUR BOLD = p5_instance.BOLD BOLDITALIC = p5_instance.BOLDITALIC BOTTOM = p5_instance.BOTTOM BURN = p5_instance.BURN CENTER = p5_instance.CENTER CHORD = p5_instance.CHORD CLAMP = p5_instance.CLAMP CLOSE = p5_instance.CLOSE CONTROL = p5_instance.CONTROL CORNER = p5_instance.CORNER CORNERS = p5_instance.CORNERS CROSS = p5_instance.CROSS CURVE = p5_instance.CURVE DARKEST = p5_instance.DARKEST DEG_TO_RAD = p5_instance.DEG_TO_RAD DEGREES = p5_instance.DEGREES DELETE = p5_instance.DELETE DIFFERENCE = p5_instance.DIFFERENCE DILATE = p5_instance.DILATE DODGE = p5_instance.DODGE DOWN_ARROW = p5_instance.DOWN_ARROW ENTER = p5_instance.ENTER ERODE = p5_instance.ERODE ESCAPE = p5_instance.ESCAPE EXCLUSION = p5_instance.EXCLUSION FILL = p5_instance.FILL GRAY = p5_instance.GRAY GRID = p5_instance.GRID HALF_PI = p5_instance.HALF_PI HAND = p5_instance.HAND HARD_LIGHT = p5_instance.HARD_LIGHT HSB = p5_instance.HSB HSL = p5_instance.HSL IMAGE = p5_instance.IMAGE IMMEDIATE = p5_instance.IMMEDIATE INVERT = p5_instance.INVERT ITALIC = p5_instance.ITALIC LANDSCAPE = p5_instance.LANDSCAPE LEFT = p5_instance.LEFT LEFT_ARROW = p5_instance.LEFT_ARROW LIGHTEST = p5_instance.LIGHTEST LINE_LOOP = p5_instance.LINE_LOOP LINE_STRIP = p5_instance.LINE_STRIP LINEAR = p5_instance.LINEAR LINES = p5_instance.LINES MIRROR = p5_instance.MIRROR MITER = p5_instance.MITER MOVE = p5_instance.MOVE MULTIPLY = p5_instance.MULTIPLY NEAREST = p5_instance.NEAREST NORMAL = p5_instance.NORMAL OPAQUE = p5_instance.OPAQUE OPEN = p5_instance.OPEN OPTION = p5_instance.OPTION OVERLAY = p5_instance.OVERLAY P2D = p5_instance.P2D P3D = p5_instance.WEBGL PI = p5_instance.PI PIE = p5_instance.PIE POINTS = p5_instance.POINTS PORTRAIT = p5_instance.PORTRAIT POSTERIZE = p5_instance.POSTERIZE PROJECT = p5_instance.PROJECT QUAD_STRIP = p5_instance.QUAD_STRIP QUADRATIC = p5_instance.QUADRATIC QUADS = p5_instance.QUADS QUARTER_PI = p5_instance.QUARTER_PI RAD_TO_DEG = p5_instance.RAD_TO_DEG RADIANS = p5_instance.RADIANS RADIUS = p5_instance.RADIUS REPEAT = p5_instance.REPEAT REPLACE = p5_instance.REPLACE RETURN = p5_instance.RETURN RGB = p5_instance.RGB RIGHT = p5_instance.RIGHT RIGHT_ARROW = p5_instance.RIGHT_ARROW ROUND = p5_instance.ROUND SCREEN = p5_instance.SCREEN SHIFT = p5_instance.SHIFT SOFT_LIGHT = p5_instance.SOFT_LIGHT SQUARE = p5_instance.SQUARE STROKE = p5_instance.STROKE SUBTRACT = p5_instance.SUBTRACT TAB = p5_instance.TAB TAU = p5_instance.TAU TEXT = p5_instance.TEXT TEXTURE = p5_instance.TEXTURE THRESHOLD = p5_instance.THRESHOLD TOP = p5_instance.TOP TRIANGLE_FAN = p5_instance.TRIANGLE_FAN TRIANGLE_STRIP = p5_instance.TRIANGLE_STRIP TRIANGLES = p5_instance.TRIANGLES TWO_PI = p5_instance.TWO_PI UP_ARROW = p5_instance.UP_ARROW VIDEO = p5_instance.VIDEO WAIT = p5_instance.WAIT WEBGL = p5_instance.WEBGL frameCount = p5_instance.frameCount focused = p5_instance.focused displayWidth = p5_instance.displayWidth displayHeight = p5_instance.displayHeight windowWidth = p5_instance.windowWidth windowHeight = p5_instance.windowHeight width = p5_instance.width height = p5_instance.height deviceOrientation = p5_instance.deviceOrientation accelerationX = p5_instance.accelerationX accelerationY = p5_instance.accelerationY accelerationZ = p5_instance.accelerationZ pAccelerationX = p5_instance.pAccelerationX pAccelerationY = p5_instance.pAccelerationY pAccelerationZ = p5_instance.pAccelerationZ rotationX = p5_instance.rotationX rotationY = p5_instance.rotationY rotationZ = p5_instance.rotationZ pRotationX = p5_instance.pRotationX pRotationY = p5_instance.pRotationY pRotationZ = p5_instance.pRotationZ turnAxis = p5_instance.turnAxis keyIsPressed = p5_instance.keyIsPressed key = p5_instance.key keyCode = p5_instance.keyCode mouseX = p5_instance.mouseX mouseY = p5_instance.mouseY pmouseX = p5_instance.pmouseX pmouseY = p5_instance.pmouseY winMouseX = p5_instance.winMouseX winMouseY = p5_instance.winMouseY pwinMouseX = p5_instance.pwinMouseX pwinMouseY = p5_instance.pwinMouseY mouseButton = p5_instance.mouseButton mouseIsPressed = p5_instance.mouseIsPressed touches = p5_instance.touches pixels = p5_instance.pixels return draw_func(*args, **kwargs) def global_p5_injection(p5_sketch): """ Injects the p5js's skecth instance as a global variable to setup and draw functions """ def decorator(f, *args, **kwargs): def wrapper(*args, **kwargs): global _P5_INSTANCE _P5_INSTANCE = p5_sketch return pre_draw(_P5_INSTANCE, f, *args, **kwargs) return wrapper return decorator def start_p5(preload_func, setup_func, draw_func, event_functions): """ This is the entrypoint function. It accepts 2 parameters: - preload_func: A Python preload callable - setup_func: a Python setup callable - draw_func: a Python draw callable - event_functions: a config dict for the event functions in the format: {"eventFunctionName": python_event_function} This method gets the p5js's sketch instance and injects them """ def sketch_setup(p5_sketch): """ Callback function called to configure new p5 instance """ p5_sketch.preload = global_p5_injection(p5_sketch)(preload_func) p5_sketch.setup = global_p5_injection(p5_sketch)(setup_func) p5_sketch.draw = global_p5_injection(p5_sketch)(draw_func) window.instance = p5.new(sketch_setup, 'sketch-holder') # Register event functions event_function_names = ( "deviceMoved", "deviceTurned", "deviceShaken", "windowResized", "keyPressed", "keyReleased", "keyTyped", "mousePressed", "mouseReleased", "mouseClicked", "doubleClicked", "mouseMoved", "mouseDragged", "mouseWheel", "touchStarted", "touchMoved", "touchEnded", "keyIsDown", ) for f_name in [f for f in event_function_names if event_functions.get(f, None)]: func = event_functions[f_name] event_func = global_p5_injection(window.instance)(func) setattr(window.instance, f_name, event_func) `; const placeholder = ` def preload(): pass def setup(): pass def draw(): pass deviceMoved = None deviceTurned = None deviceShaken = None keyPressed = None keyReleased = None keyTyped = None mouseMoved = None mouseDragged = None mousePressed = None mouseReleased = None mouseClicked = None doubleClicked = None mouseWheel = None touchStarted = None touchMoved = None touchEnded = None windowResized = None `; let userCode = ` MY_POINTS = [(100, 50), (300, 100), (200, 300), (100, 300)] WIDTH = 400 HEIGHT = 400 FRAME_IDX = 0 POINT_SIZE = 10 BUTT_Y = HEIGHT BUTT_PREV_X = 0 BUTT_NEXT_X = WIDTH // 2 BUTT_WIDTH = WIDTH // 2 - 1 BUTT_HEIGHT = 30 buttons = {"prev": (BUTT_PREV_X, BUTT_Y, BUTT_WIDTH, BUTT_HEIGHT), "next": (BUTT_NEXT_X, BUTT_Y, BUTT_WIDTH, BUTT_HEIGHT)} # x, y, w, h cnv = None def setup(): global cnv cnv = createCanvas(400, 400) button_prev = createButton('Previous frame') button_prev.position(BUTT_PREV_X, BUTT_Y) button_prev.size(BUTT_WIDTH,BUTT_HEIGHT) button_next = createButton('Next frame') button_next.position(BUTT_NEXT_X, BUTT_Y) button_next.size(BUTT_WIDTH,BUTT_HEIGHT) background(190) draw_labels(MY_POINTS) def inButton(butt_kind, x, y): try: bx, by, bw, bh = buttons[butt_kind] except: return False return (bx < x < bx + bw ) and (by < y < by + bh) def draw(): background(190) draw_closed_curve_vertex(MY_POINTS, FRAME_IDX) draw_labels(MY_POINTS) def mouseClicked(): global FRAME_IDX global MY_POINTS x, y = mouseX, mouseY if inCanvas(x, y): i = get_point_index(y, y) if i != None: MY_POINTS.pop(i) if FRAME_IDX >= len(MY_POINTS): # cap i if it exceeds maximum length now. FRAME_IDX = len(MY_POINTS) - 1 else: MY_POINTS.append((x, y)) elif inButton("prev", x, y): FRAME_IDX = max(0, FRAME_IDX - 1) elif inButton("next", x, y): FRAME_IDX = min(len(MY_POINTS) -1, FRAME_IDX + 1) def get_point_index(x, y): for idx, (p_x, p_y) in enumerate(MY_POINTS): if ((p_x - POINT_SIZE < x < p_x + POINT_SIZE) and (p_y - POINT_SIZE < y < p_y + POINT_SIZE)): return idx def inCanvas(x, y): return (0 <= x <= WIDTH) and (0 <= y <= HEIGHT) def draw_closed_curve_vertex(points, max_idx): if len(points) < 2: return used_points = [] beginShape() # start by using the last point as the initial control point idx = len(points) - 1 curveVertex(*points[idx]) used_points.append(idx) # add each point to the curve for idx,p in enumerate(points): if idx > max_idx: break curveVertex(*p) used_points.append(idx) # to close the curve, we need to create the last curve. # for that, we must go to the first point idx = 0 curveVertex(*points[idx]) used_points.append(idx) # and use the next point as a control point. idx = 1 curveVertex(*points[idx]) used_points.append(idx) endShape() textSize(10) noStroke() text('Points used to draw this curve (first and last are control points only)', 5, cnv.height - 30) textSize(20) text(', '.join([str(p) for p in used_points]), 10, cnv.height - 10) stroke(0) for i in range(len(used_points) - 1): draw_dotted_line(points[used_points[i]], points[used_points[i + 1]]) def draw_labels(points): strokeWeight(POINT_SIZE) for idx, (px, py) in enumerate(points): ts = 32 textSize(ts) textY = py - ts / 2 if py > cnv.height / 2: textY = py + ts noStroke() text(idx, px, textY) stroke(0) point(px, py) strokeWeight(1) def draw_dotted_line(p1, p2): stroke(100) strokeWeight(3) for i in range(11): x = lerp(p1[0], p2[0], i/10) y = lerp(p1[1], p2[1], i/10) point(x, y) stroke(0) strokeWeight(1) `; const startCode = ` event_functions = { "deviceMoved": deviceMoved, "deviceTurned": deviceTurned, "deviceShaken": deviceShaken, "keyPressed": keyPressed, "keyReleased": keyReleased, "keyTyped": keyTyped, "mouseMoved": mouseMoved, "mouseDragged": mouseDragged, "mousePressed": mousePressed, "mouseReleased": mouseReleased, "mouseClicked": mouseClicked, "doubleClicked": doubleClicked, "mouseWheel": mouseWheel, "touchStarted": touchStarted, "touchMoved": touchMoved, "touchEnded": touchEnded, "windowResized": windowResized, } start_p5(preload, setup, draw, event_functions) `; function runCode() { let code = [ placeholder, userCode, wrapperContent, startCode, ].join('\n'); if (window.instance) { window.instance.canvas.remove(); } console.log("Python execution output:"); window.pyodide.runPython(code); } async function main() { const config = { indexURL : "https://cdn.jsdelivr.net/pyodide/v0.18.1/full/", fullStdLib: false, } window.pyodide = await loadPyodide(config); // Pyodide is now ready to use... console.log(window.pyodide.runPython(` import io, code, sys from js import p5, window, document print(sys.version) `)); window.runSketchCode = (code) => { userCode = code; runCode(); } runCode(); }; // async method main(); ================================================ FILE: docs/examples/pyodide/sketch_011/index.html ================================================ sketch_011 - pyp5js

Python code here.

# Made for  https://berinhard.github.io/pyp5js/pyodide/

def setup():
    size(500, 500)
    test()

def test():
    """
    Mostly from JDF py.processing tests
    """
    a = PVector()
    assert a.x == 0
    assert a.y == 0
    assert a.z == 0

    a = PVector(5, 7, 11)
    b = PVector(13, 17, 23)
    assert a - b == PVector(-8.0, -10.0, -12.0)
    assert b - a == PVector(8, 10, 12)
    c = PVector(18, 24, 34)
    assert b + a == c
    assert a + b == c
    assert PVector.add(a, b) == c
    assert PVector.add(a, b) == c
    a.add(b)
    assert a == c
    a.add(b)
    assert a == PVector(31.0, 41.0, 57.0)

    c = PVector(310.0, 410.0, 570.0)
    assert a * 10 == c
    assert a * 10 == c
    assert PVector.mult(a, 10) == c

    assert PVector.mult(a, 10) == c
    a.mult(10)
    assert a == c

    assert int(1000 * PVector.dist(a, b)) == 736116
    assert PVector.cross(a, b) == PVector(-260.0, 280.0, -60.0)
    assert a.cross(b) == PVector(-260.0, 280.0, -60.0)
    assert PVector.dot(a, b) == 0

    d = a.get()
    d += b
    assert d == a + b
    d = a.get()
    d -= c
    assert d == a - c
    d = a.get()
    d *= 5.0
    assert d == a * 5.0
    d = a.get()

    d /= 5.0
    assert d == a / 5.0

    assert b * 5 == b * 5.0
    assert b / 5 == b / 5.0
    d = b.get()
    d *= 391
    assert d == b * 391.0
    d = b.get()
    d /= 10203
    assert d == b / 10203.0

    d = a.get()
    d += a + a
    assert d == a + a + a

    assert a * 57.0 == 57.0 * a

    assert (a / 5.0) == (1.0 / 5.0) * a

    m, n = b, c
    a += b * 5 - c / 2 + PVector(0, 1, 2)
    assert (m, n) == (b, c)

    import copy
    x = [a, b]
    y = copy.deepcopy(x)

    assert x == y
    x[0].sub(PVector(100, 100, 100))
    assert x != y

    a = PVector(1, 1)
    b = PVector(-2, -2)
    assert a < b
    assert a <= b
    assert b > a
    assert b >= a
    a = PVector(1, 2, 3)
    b = PVector(3, 2, 1)
    assert a != b
    assert a >= b
    assert b >= a
    assert a.magSq() == b.magSq()

    v1 = PVector(10, 20)
    v2 = PVector(60, 80)
    a = PVector.angleBetween(v1, v2)
    # Java implementation gives slightly different value:
    # assert a == 0.17985349893569946  # more or less
    assert int(a * 1e8) == 17985349  # more or less

    # Regression test for https://github.com/jdf/Processing.py-Bugs/issues/67
    assert isinstance(PVector(1, 2), PVector)

    # Regression test for https://github.com/jdf/Processing.py-Bugs/issues/101
    v = PVector(10, 20, 0)
    d = v.dot(60, 80, 0)
    assert d == 2200.0
    v2 = PVector(60, 80, 0)
    d = v.dot(v2)
    assert d == 2200.0

    # PVector.add w/multiple arguments
    v = PVector(40, 20, 0)
    v.add(25, 50, 0)
    assert (v.x, v.y, v.z) == (65, 70, 0)

    # PVector.sub w/multiple arguments
    v = PVector(40, 20, 0)
    v.sub(25, 50, 0)
    assert (v.x, v.y, v.z) == (15, -30, 0)

    # Regression test for https://github.com/jdf/Processing.py-Bugs/issues/102
    start = PVector(0.0, 0.0)
    end = PVector(100.0, 100.0)
    middle = PVector.lerp(start, end, 0.5)
    assert middle == PVector(50.0, 50.0)
    assert start == PVector(0, 0)
    start.lerp(end, .75)
    assert start == PVector(75, 75)
    assert end == PVector(100.0, 100.0)
    end.lerp(200, 200, 0, .5)
    assert end == PVector(150.0, 150.0)

    # test that instance op returns self
    a = PVector(3, 5, 7)
    b = a * 10
    assert a.mult(10) == b

    # test that a vector can do arithmetic with a tuple
    assert PVector(1, 2, 3) == (1, 2, 3)
    assert (PVector(1, 2, 3) + (3, 3, 3)) == (4, 5, 6)
    assert (PVector(5, 5, 5) - (1, 2, 3)) == (4, 3, 2)

    # Regression test for https://github.com/jdf/processing.py/issues/317
    r = PVector.random2D() * 10
    assert -10 <= r.x <= 10
    assert -10 <= r.y <= 10
    assert r.z == 0

    PVector.random3D(r)
    r += (1, 1, 1)
    assert 0 <= r.x <= 2
    assert 0 <= r.y <= 2
    assert 0 <= r.z <= 2

    # Regression test for https://github.com/jdf/processing.py/issues/334
    r = PVector.fromAngle(0) * 10
    assert r.x == 10
    assert r.y == 0
    assert r.z == 0

    # Other p5js methods
    text(r.toString(), 120, 120)
    r.setMag(100)
    assert r.mag() == 100
    r.normalize()
    assert r.mag() == 1
    r.limit(10)
    assert r.mag() == 1
    r.limit(0.1)
    assert r.mag() == 0.1

    assert r.heading() == 0
    r.rotate(PI)
    assert r.heading() == PI

    text('OK - ALL PASSED!', 100, 200)
================================================ FILE: docs/examples/pyodide/sketch_011/sketch_011.py ================================================ # Made for https://berinhard.github.io/pyp5js/pyodide/ def setup(): size(500, 500) test() def test(): """ Mostly from JDF py.processing tests """ a = PVector() assert a.x == 0 assert a.y == 0 assert a.z == 0 a = PVector(5, 7, 11) b = PVector(13, 17, 23) assert a - b == PVector(-8.0, -10.0, -12.0) assert b - a == PVector(8, 10, 12) c = PVector(18, 24, 34) assert b + a == c assert a + b == c assert PVector.add(a, b) == c assert PVector.add(a, b) == c a.add(b) assert a == c a.add(b) assert a == PVector(31.0, 41.0, 57.0) c = PVector(310.0, 410.0, 570.0) assert a * 10 == c assert a * 10 == c assert PVector.mult(a, 10) == c assert PVector.mult(a, 10) == c a.mult(10) assert a == c assert int(1000 * PVector.dist(a, b)) == 736116 assert PVector.cross(a, b) == PVector(-260.0, 280.0, -60.0) assert a.cross(b) == PVector(-260.0, 280.0, -60.0) assert PVector.dot(a, b) == 0 d = a.get() d += b assert d == a + b d = a.get() d -= c assert d == a - c d = a.get() d *= 5.0 assert d == a * 5.0 d = a.get() d /= 5.0 assert d == a / 5.0 assert b * 5 == b * 5.0 assert b / 5 == b / 5.0 d = b.get() d *= 391 assert d == b * 391.0 d = b.get() d /= 10203 assert d == b / 10203.0 d = a.get() d += a + a assert d == a + a + a assert a * 57.0 == 57.0 * a assert (a / 5.0) == (1.0 / 5.0) * a m, n = b, c a += b * 5 - c / 2 + PVector(0, 1, 2) assert (m, n) == (b, c) import copy x = [a, b] y = copy.deepcopy(x) assert x == y x[0].sub(PVector(100, 100, 100)) assert x != y a = PVector(1, 1) b = PVector(-2, -2) assert a < b assert a <= b assert b > a assert b >= a a = PVector(1, 2, 3) b = PVector(3, 2, 1) assert a != b assert a >= b assert b >= a assert a.magSq() == b.magSq() v1 = PVector(10, 20) v2 = PVector(60, 80) a = PVector.angleBetween(v1, v2) # Java implementation gives slightly different value: # assert a == 0.17985349893569946 # more or less assert int(a * 1e8) == 17985349 # more or less # Regression test for https://github.com/jdf/Processing.py-Bugs/issues/67 assert isinstance(PVector(1, 2), PVector) # Regression test for https://github.com/jdf/Processing.py-Bugs/issues/101 v = PVector(10, 20, 0) d = v.dot(60, 80, 0) assert d == 2200.0 v2 = PVector(60, 80, 0) d = v.dot(v2) assert d == 2200.0 # PVector.add w/multiple arguments v = PVector(40, 20, 0) v.add(25, 50, 0) assert (v.x, v.y, v.z) == (65, 70, 0) # PVector.sub w/multiple arguments v = PVector(40, 20, 0) v.sub(25, 50, 0) assert (v.x, v.y, v.z) == (15, -30, 0) # Regression test for https://github.com/jdf/Processing.py-Bugs/issues/102 start = PVector(0.0, 0.0) end = PVector(100.0, 100.0) middle = PVector.lerp(start, end, 0.5) assert middle == PVector(50.0, 50.0) assert start == PVector(0, 0) start.lerp(end, .75) assert start == PVector(75, 75) assert end == PVector(100.0, 100.0) end.lerp(200, 200, 0, .5) assert end == PVector(150.0, 150.0) # test that instance op returns self a = PVector(3, 5, 7) b = a * 10 assert a.mult(10) == b # test that a vector can do arithmetic with a tuple assert PVector(1, 2, 3) == (1, 2, 3) assert (PVector(1, 2, 3) + (3, 3, 3)) == (4, 5, 6) assert (PVector(5, 5, 5) - (1, 2, 3)) == (4, 3, 2) # Regression test for https://github.com/jdf/processing.py/issues/317 r = PVector.random2D() * 10 assert -10 <= r.x <= 10 assert -10 <= r.y <= 10 assert r.z == 0 PVector.random3D(r) r += (1, 1, 1) assert 0 <= r.x <= 2 assert 0 <= r.y <= 2 assert 0 <= r.z <= 2 # Regression test for https://github.com/jdf/processing.py/issues/334 r = PVector.fromAngle(0) * 10 assert r.x == 10 assert r.y == 0 assert r.z == 0 # Other p5js methods text(r.toString(), 120, 120) r.setMag(100) assert r.mag() == 100 r.normalize() assert r.mag() == 1 r.limit(10) assert r.mag() == 1 r.limit(0.1) assert r.mag() == 0.1 assert r.heading() == 0 r.rotate(PI) assert r.heading() == PI text('OK - ALL PASSED!', 100, 200) ================================================ FILE: docs/examples/pyodide/sketch_011/static/p5.js ================================================ /*! p5.js v1.0.0 February 29, 2020 */ !function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).p5=e()}}(function(){return function o(a,s,l){function u(t,e){if(!s[t]){if(!a[t]){var r="function"==typeof require&&require;if(!e&&r)return r(t,!0);if(h)return h(t,!0);var i=new Error("Cannot find module '"+t+"'");throw i.code="MODULE_NOT_FOUND",i}var n=s[t]={exports:{}};a[t][0].call(n.exports,function(e){return u(a[t][1][e]||e)},n,n.exports,o,a,s,l)}return s[t].exports}for(var h="function"==typeof require&&require,e=0;e>16&255,a[s++]=t>>8&255,a[s++]=255&t;2===o&&(t=u[e.charCodeAt(r)]<<2|u[e.charCodeAt(r+1)]>>4,a[s++]=255&t);1===o&&(t=u[e.charCodeAt(r)]<<10|u[e.charCodeAt(r+1)]<<4|u[e.charCodeAt(r+2)]>>2,a[s++]=t>>8&255,a[s++]=255&t);return a},r.fromByteArray=function(e){for(var t,r=e.length,i=r%3,n=[],o=0,a=r-i;o>2]+s[t<<4&63]+"==")):2==i&&(t=(e[r-2]<<8)+e[r-1],n.push(s[t>>10]+s[t>>4&63]+s[t<<2&63]+"="));return n.join("")};for(var s=[],u=[],h="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=0,o=i.length;n>18&63]+s[n>>12&63]+s[n>>6&63]+s[63&n]);return o.join("")}u["-".charCodeAt(0)]=62,u["_".charCodeAt(0)]=63},{}],20:[function(e,t,r){},{}],21:[function(N,e,F){(function(c){"use strict";var i=N("base64-js"),o=N("ieee754"),e="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;F.Buffer=c,F.SlowBuffer=function(e){+e!=e&&(e=0);return c.alloc(+e)},F.INSPECT_MAX_BYTES=50;var r=2147483647;function a(e){if(r>>1;case"base64":return O(e).length;default:if(n)return i?-1:R(e).length;t=(""+t).toLowerCase(),n=!0}}function d(e,t,r){var i=e[t];e[t]=e[r],e[r]=i}function p(e,t,r,i,n){if(0===e.length)return-1;if("string"==typeof r?(i=r,r=0):2147483647=e.length){if(n)return-1;r=e.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof t&&(t=c.from(t,i)),c.isBuffer(t))return 0===t.length?-1:m(e,t,r,i,n);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):m(e,[t],r,i,n);throw new TypeError("val must be string, number or Buffer")}function m(e,t,r,i,n){var o,a=1,s=e.length,l=t.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(e.length<2||t.length<2)return-1;s/=a=2,l/=2,r/=2}function u(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(n){var h=-1;for(o=r;o>8,n=r%256,o.push(n),o.push(i);return o}(t,e.length-r),e,r,i)}function b(e,t,r){return 0===t&&r===e.length?i.fromByteArray(e):i.fromByteArray(e.slice(t,r))}function _(e,t,r){r=Math.min(e.length,r);for(var i=[],n=t;n>>10&1023|55296),h=56320|1023&h),i.push(h),n+=c}return function(e){var t=e.length;if(t<=x)return String.fromCharCode.apply(String,e);var r="",i=0;for(;ithis.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e=e||"utf8";;)switch(e){case"hex":return M(this,t,r);case"utf8":case"utf-8":return _(this,t,r);case"ascii":return w(this,t,r);case"latin1":case"binary":return S(this,t,r);case"base64":return b(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,t,r);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}.apply(this,arguments)},c.prototype.equals=function(e){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===c.compare(this,e)},c.prototype.inspect=function(){var e="",t=F.INSPECT_MAX_BYTES;return e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(e+=" ... "),""},e&&(c.prototype[e]=c.prototype.inspect),c.prototype.compare=function(e,t,r,i,n){if(A(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),t<0||r>e.length||i<0||n>this.length)throw new RangeError("out of range index");if(n<=i&&r<=t)return 0;if(n<=i)return-1;if(r<=t)return 1;if(this===e)return 0;for(var o=(n>>>=0)-(i>>>=0),a=(r>>>=0)-(t>>>=0),s=Math.min(o,a),l=this.slice(i,n),u=e.slice(t,r),h=0;h>>=0,isFinite(r)?(r>>>=0,void 0===i&&(i="utf8")):(i=r,r=void 0)}var n=this.length-t;if((void 0===r||nthis.length)throw new RangeError("Attempt to write outside buffer bounds");i=i||"utf8";for(var o,a,s,l,u,h,c=!1;;)switch(i){case"hex":return g(this,e,t,r);case"utf8":case"utf-8":return u=t,h=r,D(R(e,(l=this).length-u),l,u,h);case"ascii":return v(this,e,t,r);case"latin1":case"binary":return v(this,e,t,r);case"base64":return o=this,a=t,s=r,D(O(e),o,a,s);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return y(this,e,t,r);default:if(c)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),c=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var x=4096;function w(e,t,r){var i="";r=Math.min(e.length,r);for(var n=t;ne.length)throw new RangeError("Index out of range")}function P(e,t,r,i){if(r+i>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function L(e,t,r,i,n){return t=+t,r>>>=0,n||P(e,0,r,4),o.write(e,t,r,i,23,4),r+4}function k(e,t,r,i,n){return t=+t,r>>>=0,n||P(e,0,r,8),o.write(e,t,r,i,52,8),r+8}c.prototype.slice=function(e,t){var r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):r>>=0,t>>>=0,r||T(e,t,this.length);for(var i=this[e],n=1,o=0;++o>>=0,t>>>=0,r||T(e,t,this.length);for(var i=this[e+--t],n=1;0>>=0,t||T(e,1,this.length),this[e]},c.prototype.readUInt16LE=function(e,t){return e>>>=0,t||T(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUInt16BE=function(e,t){return e>>>=0,t||T(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUInt32LE=function(e,t){return e>>>=0,t||T(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUInt32BE=function(e,t){return e>>>=0,t||T(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||T(e,t,this.length);for(var i=this[e],n=1,o=0;++o>>=0,t>>>=0,r||T(e,t,this.length);for(var i=t,n=1,o=this[e+--i];0>>=0,t||T(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){e>>>=0,t||T(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(e,t){e>>>=0,t||T(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(e,t){return e>>>=0,t||T(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return e>>>=0,t||T(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readFloatLE=function(e,t){return e>>>=0,t||T(e,4,this.length),o.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return e>>>=0,t||T(e,4,this.length),o.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return e>>>=0,t||T(e,8,this.length),o.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return e>>>=0,t||T(e,8,this.length),o.read(this,e,!1,52,8)},c.prototype.writeUIntLE=function(e,t,r,i){e=+e,t>>>=0,r>>>=0,i||C(this,e,t,r,Math.pow(2,8*r)-1,0);var n=1,o=0;for(this[t]=255&e;++o>>=0,r>>>=0,i||C(this,e,t,r,Math.pow(2,8*r)-1,0);var n=r-1,o=1;for(this[t+n]=255&e;0<=--n&&(o*=256);)this[t+n]=e/o&255;return t+r},c.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,1,255,0),this[t]=255&e,t+1},c.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},c.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeIntLE=function(e,t,r,i){if(e=+e,t>>>=0,!i){var n=Math.pow(2,8*r-1);C(this,e,t,r,n-1,-n)}var o=0,a=1,s=0;for(this[t]=255&e;++o>0)-s&255;return t+r},c.prototype.writeIntBE=function(e,t,r,i){if(e=+e,t>>>=0,!i){var n=Math.pow(2,8*r-1);C(this,e,t,r,n-1,-n)}var o=r-1,a=1,s=0;for(this[t+o]=255&e;0<=--o&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+r},c.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},c.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeFloatLE=function(e,t,r){return L(this,e,t,!0,r)},c.prototype.writeFloatBE=function(e,t,r){return L(this,e,t,!1,r)},c.prototype.writeDoubleLE=function(e,t,r){return k(this,e,t,!0,r)},c.prototype.writeDoubleBE=function(e,t,r){return k(this,e,t,!1,r)},c.prototype.copy=function(e,t,r,i){if(!c.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r=r||0,i||0===i||(i=this.length),t>=e.length&&(t=e.length),t=t||0,0=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t>>=0,r=void 0===r?this.length:r>>>0,"number"==typeof(e=e||0))for(o=t;o>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function O(e){return i.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(t,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function D(e,t,r,i){for(var n=0;n=t.length||n>=e.length);++n)t[n+r]=e[n];return n}function A(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function I(e){return e!=e}var U=function(){for(var e="0123456789abcdef",t=new Array(256),r=0;r<16;++r)for(var i=16*r,n=0;n<16;++n)t[i+n]=e[r]+e[n];return t}()}).call(this,N("buffer").Buffer)},{"base64-js":19,buffer:21,ieee754:30}],22:[function(e,t,r){"use strict";t.exports=e("./").polyfill()},{"./":23}],23:[function(z,r,i){(function(j,V){var e,t;e=this,t=function(){"use strict";function l(e){return"function"==typeof e}var r=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},i=0,t=void 0,n=void 0,a=function(e,t){f[i]=e,f[i+1]=t,2===(i+=2)&&(n?n(d):y())};var e="undefined"!=typeof window?window:void 0,o=e||{},s=o.MutationObserver||o.WebKitMutationObserver,u="undefined"==typeof self&&void 0!==j&&"[object process]"==={}.toString.call(j),h="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function c(){var e=setTimeout;return function(){return e(d,1)}}var f=new Array(1e3);function d(){for(var e=0;e":">",'"':""","'":"'","/":"/"};function S(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,function(e){return w[e]}):e}var M=function(){function i(e){var t,r=1=this.maxReplaces)break}for(a=0;r=this.regexp.exec(e);){if(void 0===(i=h(r[1].trim())))if("function"==typeof c){var d=c(e,r,t);i="string"==typeof d?d:""}else this.logger.warn("missed to pass in variable ".concat(r[1]," for interpolating ").concat(e)),i="";else"string"==typeof i||this.useRawValueToEscape||(i=v(i));if(i=this.escapeValue?u(this.escape(i)):u(i),e=e.replace(r[0],i),this.regexp.lastIndex=0,++a>=this.maxReplaces)break}return e}},{key:"nest",value:function(e,t,r){var i,n,o=D({},2>1,h=-7,c=r?n-1:0,f=r?-1:1,d=e[t+c];for(c+=f,o=d&(1<<-h)-1,d>>=-h,h+=s;0>=-h,h+=i;0>1,f=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,d=i?0:o-1,p=i?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=h):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),2<=(t+=1<=a+c?f/l:f*Math.pow(2,1-c))*l&&(a++,l/=2),h<=a+c?(s=0,a=h):1<=a+c?(s=(t*l-1)*Math.pow(2,n),a+=c):(s=t*Math.pow(2,c-1)*Math.pow(2,n),a=0));8<=n;e[r+d]=255&s,d+=p,s/=256,n-=8);for(a=a<Math.abs(e[0])&&(t=1),Math.abs(e[2])>Math.abs(e[t])&&(t=2),t}var C=4e150;function P(e,t){e.f+=t.f,e.b.f+=t.b.f}function u(e,t,r){return e=e.a,t=t.a,r=r.a,t.b.a===e?r.b.a===e?v(t.a,r.a)?b(r.b.a,t.a,r.a)<=0:0<=b(t.b.a,r.a,t.a):b(r.b.a,e,r.a)<=0:r.b.a===e?0<=b(t.b.a,e,t.a):(t=y(t.b.a,e,t.a),(e=y(r.b.a,e,r.a))<=t)}function L(e){e.a.i=null;var t=e.e;t.a.c=t.c,t.c.a=t.a,e.e=null}function h(e,t){c(e.a),e.c=!1,(e.a=t).i=e}function k(e){for(var t=e.a.a;(e=fe(e)).a.a===t;);return e.c&&(h(e,t=f(ce(e).a.b,e.a.e)),e=fe(e)),e}function R(e,t,r){var i=new he;return i.a=r,i.e=W(e.f,t.e,i),r.i=i}function O(e,t){switch(e.s){case 100130:return 0!=(1&t);case 100131:return 0!==t;case 100132:return 0>1]],s[a[u]])?le(r,u):ue(r,u)),s[o]=null,l[o]=r.b,r.b=o}else for(r.c[-(o+1)]=null;0Math.max(a.a,l.a))return!1;if(v(o,a)){if(0i.f&&(i.f*=2,i.c=oe(i.c,i.f+1)),0===i.b?r=n:(r=i.b,i.b=i.c[i.b]),i.e[r]=t,i.c[r]=n,i.d[n]=r,i.h&&ue(i,n),r}return i=e.a++,e.c[i]=t,-(i+1)}function ie(e){if(0===e.a)return se(e.b);var t=e.c[e.d[e.a-1]];if(0!==e.b.a&&v(ae(e.b),t))return se(e.b);for(;--e.a,0e.a||v(i[a],i[l])){n[r[o]=a]=o;break}n[r[o]=l]=o,o=s}}function ue(e,t){for(var r=e.d,i=e.e,n=e.c,o=t,a=r[o];;){var s=o>>1,l=r[s];if(0==s||v(i[l],i[a])){n[r[o]=a]=o;break}n[r[o]=l]=o,o=s}}function he(){this.e=this.a=null,this.f=0,this.c=this.b=this.h=this.d=!1}function ce(e){return e.e.c.b}function fe(e){return e.e.a.b}(i=q.prototype).x=function(){Y(this,0)},i.B=function(e,t){switch(e){case 100142:return;case 100140:switch(t){case 100130:case 100131:case 100132:case 100133:case 100134:return void(this.s=t)}break;case 100141:return void(this.m=!!t);default:return void Z(this,100900)}Z(this,100901)},i.y=function(e){switch(e){case 100142:return 0;case 100140:return this.s;case 100141:return this.m;default:Z(this,100900)}return!1},i.A=function(e,t,r){this.j[0]=e,this.j[1]=t,this.j[2]=r},i.z=function(e,t){var r=t||null;switch(e){case 100100:case 100106:this.h=r;break;case 100104:case 100110:this.l=r;break;case 100101:case 100107:this.k=r;break;case 100102:case 100108:this.i=r;break;case 100103:case 100109:this.p=r;break;case 100105:case 100111:this.o=r;break;case 100112:this.r=r;break;default:Z(this,100900)}},i.C=function(e,t){var r=!1,i=[0,0,0];Y(this,2);for(var n=0;n<3;++n){var o=e[n];o<-1e150&&(o=-1e150,r=!0),1e150n[u]&&(n[u]=h,a[u]=l)}if(l=0,n[1]-o[1]>n[0]-o[0]&&(l=1),n[2]-o[2]>n[l]-o[l]&&(l=2),o[l]>=n[l])i[0]=0,i[1]=0,i[2]=1;else{for(n=0,o=s[l],a=a[l],s=[0,0,0],o=[o.g[0]-a.g[0],o.g[1]-a.g[1],o.g[2]-a.g[2]],u=[0,0,0],l=r.e;l!==r;l=l.e)u[0]=l.g[0]-a.g[0],u[1]=l.g[1]-a.g[1],u[2]=l.g[2]-a.g[2],s[0]=o[1]*u[2]-o[2]*u[1],s[1]=o[2]*u[0]-o[0]*u[2],s[2]=o[0]*u[1]-o[1]*u[0],n<(h=s[0]*s[0]+s[1]*s[1]+s[2]*s[2])&&(n=h,i[0]=s[0],i[1]=s[1],i[2]=s[2]);n<=0&&(i[0]=i[1]=i[2]=0,i[T(o)]=1)}r=!0}for(s=T(i),l=this.b.c,n=(s+1)%3,a=(s+2)%3,s=0>=l,h-=l,g!=o){if(g==a)break;for(var v=g>8,++y;var _=b;if(i>=8;null!==m&&s<4096&&(p[s++]=m<<8|_,u+1<=s&&l<12&&(++l,u=u<<1|1)),m=g}else s=1+a,u=(1<<(l=n+1))-1,m=null}return f!==i&&console.log("Warning, gif stream shorter than expected."),r}try{r.GifWriter=function(v,e,t,r){var y=0,i=void 0===(r=void 0===r?{}:r).loop?null:r.loop,b=void 0===r.palette?null:r.palette;if(e<=0||t<=0||65535>=1;)++n;if(a=1<>8&255,v[y++]=255&t,v[y++]=t>>8&255,v[y++]=(null!==b?128:0)|n,v[y++]=o,v[y++]=0,null!==b)for(var s=0,l=b.length;s>16&255,v[y++]=u>>8&255,v[y++]=255&u}if(null!==i){if(i<0||65535>8&255,v[y++]=0}var x=!1;this.addFrame=function(e,t,r,i,n,o){if(!0===x&&(--y,x=!1),o=void 0===o?{}:o,e<0||t<0||65535>=1;)++u;l=1<>8&255,v[y++]=d,v[y++]=0),v[y++]=44,v[y++]=255&e,v[y++]=e>>8&255,v[y++]=255&t,v[y++]=t>>8&255,v[y++]=255&r,v[y++]=r>>8&255,v[y++]=255&i,v[y++]=i>>8&255,v[y++]=!0===a?128|u-1:0,!0===a)for(var p=0,m=s.length;p>16&255,v[y++]=g>>8&255,v[y++]=255&g}return y=function(t,r,e,i){t[r++]=e;var n=r++,o=1<>=8,h-=8,r===n+256&&(t[n]=255,n=r++)}function d(e){c|=e<>=8,h-=8,r===n+256&&(t[n]=255,n=r++);4096===l?(d(o),l=1+s,u=e+1,m={}):(1<>7,n=1<<1+(7&r);x[e++],x[e++];var o=null,a=null;i&&(o=e,e+=3*(a=n));var s=!0,l=[],u=0,h=null,c=0,f=null;for(this.width=w,this.height=t;s&&e>2&7,e++;break;case 254:for(;;){if(!(0<=(C=x[e++])))throw Error("Invalid block size");if(0===C)break;e+=C}break;default:throw new Error("Unknown graphic control label: 0x"+x[e-1].toString(16))}break;case 44:var p=x[e++]|x[e++]<<8,m=x[e++]|x[e++]<<8,g=x[e++]|x[e++]<<8,v=x[e++]|x[e++]<<8,y=x[e++],b=y>>6&1,_=1<<1+(7&y),S=o,M=a,E=!1;if(y>>7){E=!0;S=e,e+=3*(M=_)}var T=e;for(e++;;){var C;if(!(0<=(C=x[e++])))throw Error("Invalid block size");if(0===C)break;e+=C}l.push({x:p,y:m,width:g,height:v,has_local_palette:E,palette_offset:S,palette_size:M,data_offset:T,data_length:e-T,transparent_index:h,interlaced:!!b,delay:u,disposal:c});break;case 59:s=!1;break;default:throw new Error("Unknown gif block: 0x"+x[e-1].toString(16))}this.numFrames=function(){return l.length},this.loopCount=function(){return f},this.frameInfo=function(e){if(e<0||e>=l.length)throw new Error("Frame index out of range.");return l[e]},this.decodeAndBlitFrameBGRA=function(e,t){var r=this.frameInfo(e),i=r.width*r.height,n=new Uint8Array(i);P(x,r.data_offset,n,i);var o=r.palette_offset,a=r.transparent_index;null===a&&(a=256);var s=r.width,l=w-s,u=s,h=4*(r.y*w+r.x),c=4*((r.y+r.height)*w+r.x),f=h,d=4*l;!0===r.interlaced&&(d+=4*w*7);for(var p=8,m=0,g=n.length;m>=1)),v===a)f+=4;else{var y=x[o+3*v],b=x[o+3*v+1],_=x[o+3*v+2];t[f++]=_,t[f++]=b,t[f++]=y,t[f++]=255}--u}},this.decodeAndBlitFrameRGBA=function(e,t){var r=this.frameInfo(e),i=r.width*r.height,n=new Uint8Array(i);P(x,r.data_offset,n,i);var o=r.palette_offset,a=r.transparent_index;null===a&&(a=256);var s=r.width,l=w-s,u=s,h=4*(r.y*w+r.x),c=4*((r.y+r.height)*w+r.x),f=h,d=4*l;!0===r.interlaced&&(d+=4*w*7);for(var p=8,m=0,g=n.length;m>=1)),v===a)f+=4;else{var y=x[o+3*v],b=x[o+3*v+1],_=x[o+3*v+2];t[f++]=y,t[f++]=b,t[f++]=_,t[f++]=255}--u}}}}catch(e){}},{}],33:[function(jr,t,r){(function(Gr){var e;e=this,function(E){"use strict";function e(e){if(null==this)throw TypeError();var t=String(this),r=t.length,i=e?Number(e):0;if(i!=i&&(i=0),!(i<0||r<=i)){var n,o=t.charCodeAt(i);return 55296<=o&&o<=56319&&i+1>>=1,t}function _(e,t,r){if(!t)return r;for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<>>16-t;return e.tag>>>=t,e.bitcount-=t,i+r}function x(e,t){for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<>>=1,++n,r+=t.table[n],0<=(i-=t.table[n]););return e.tag=o,e.bitcount-=n,t.trans[r+i]}function w(e,t,r){var i,n,o,a,s,l;for(i=_(e,5,257),n=_(e,5,1),o=_(e,4,4),a=0;a<19;++a)g[a]=0;for(a=0;athis.x2&&(this.x2=e)),"number"==typeof t&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=t,this.y2=t),tthis.y2&&(this.y2=t))},C.prototype.addX=function(e){this.addPoint(e,null)},C.prototype.addY=function(e){this.addPoint(null,e)},C.prototype.addBezier=function(e,t,r,i,n,o,a,s){var l=this,u=[e,t],h=[r,i],c=[n,o],f=[a,s];this.addPoint(e,t),this.addPoint(a,s);for(var d=0;d<=1;d++){var p=6*u[d]-12*h[d]+6*c[d],m=-3*u[d]+9*h[d]-9*c[d]+3*f[d],g=3*h[d]-3*u[d];if(0!=m){var v=Math.pow(p,2)-4*g*m;if(!(v<0)){var y=(-p+Math.sqrt(v))/(2*m);0>8&255,255&e]},A.USHORT=U(2),D.SHORT=function(e){return 32768<=e&&(e=-(65536-e)),[e>>8&255,255&e]},A.SHORT=U(2),D.UINT24=function(e){return[e>>16&255,e>>8&255,255&e]},A.UINT24=U(3),D.ULONG=function(e){return[e>>24&255,e>>16&255,e>>8&255,255&e]},A.ULONG=U(4),D.LONG=function(e){return R<=e&&(e=-(2*R-e)),[e>>24&255,e>>16&255,e>>8&255,255&e]},A.LONG=U(4),D.FIXED=D.ULONG,A.FIXED=A.ULONG,D.FWORD=D.SHORT,A.FWORD=A.SHORT,D.UFWORD=D.USHORT,A.UFWORD=A.USHORT,D.LONGDATETIME=function(e){return[0,0,0,0,e>>24&255,e>>16&255,e>>8&255,255&e]},A.LONGDATETIME=U(8),D.TAG=function(e){return k.argument(4===e.length,"Tag should be exactly 4 ASCII characters."),[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]},A.TAG=U(4),D.Card8=D.BYTE,A.Card8=A.BYTE,D.Card16=D.USHORT,A.Card16=A.USHORT,D.OffSize=D.BYTE,A.OffSize=A.BYTE,D.SID=D.USHORT,A.SID=A.USHORT,D.NUMBER=function(e){return-107<=e&&e<=107?[e+139]:108<=e&&e<=1131?[247+((e-=108)>>8),255&e]:-1131<=e&&e<=-108?[251+((e=-e-108)>>8),255&e]:-32768<=e&&e<=32767?D.NUMBER16(e):D.NUMBER32(e)},A.NUMBER=function(e){return D.NUMBER(e).length},D.NUMBER16=function(e){return[28,e>>8&255,255&e]},A.NUMBER16=U(3),D.NUMBER32=function(e){return[29,e>>24&255,e>>16&255,e>>8&255,255&e]},A.NUMBER32=U(5),D.REAL=function(e){var t=e.toString(),r=/\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec(t);if(r){var i=parseFloat("1e"+((r[2]?+r[2]:0)+r[1].length));t=(Math.round(e*i)/i).toString()}for(var n="",o=0,a=t.length;o>8&255,t[t.length]=255&i}return t},A.UTF16=function(e){return 2*e.length};var N={"x-mac-croatian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈ƫȅ ÀÃÕŒœĐ—“”‘’÷◊©⁄€‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ","x-mac-cyrillic":"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю","x-mac-gaelic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØḂ±≤≥ḃĊċḊḋḞḟĠġṀæøṁṖṗɼƒſṠ«»… ÀÃÕŒœ–—“”‘’ṡẛÿŸṪ€‹›Ŷŷṫ·Ỳỳ⁊ÂÊÁËÈÍÎÏÌÓÔ♣ÒÚÛÙıÝýŴŵẄẅẀẁẂẃ","x-mac-greek":"Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦€ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ­","x-mac-icelandic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüݰ¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-inuit":"ᐃᐄᐅᐆᐊᐋᐱᐲᐳᐴᐸᐹᑉᑎᑏᑐᑑᑕᑖᑦᑭᑮᑯᑰᑲᑳᒃᒋᒌᒍᒎᒐᒑ°ᒡᒥᒦ•¶ᒧ®©™ᒨᒪᒫᒻᓂᓃᓄᓅᓇᓈᓐᓯᓰᓱᓲᓴᓵᔅᓕᓖᓗᓘᓚᓛᓪᔨᔩᔪᔫᔭ… ᔮᔾᕕᕖᕗ–—“”‘’ᕘᕙᕚᕝᕆᕇᕈᕉᕋᕌᕐᕿᖀᖁᖂᖃᖄᖅᖏᖐᖑᖒᖓᖔᖕᙱᙲᙳᙴᙵᙶᖖᖠᖡᖢᖣᖤᖥᖦᕼŁł","x-mac-ce":"ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ",macintosh:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-romanian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂȘ∞±≤≥¥µ∂∑∏π∫ªºΩăș¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›Țț‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-turkish":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙˆ˜¯˘˙˚¸˝˛ˇ"};O.MACSTRING=function(e,t,r,i){var n=N[i];if(void 0!==n){for(var o="",a=0;a>8&255,l+256&255)}return o}D.MACSTRING=function(e,t){var r=function(e){if(!F)for(var t in F={},N)F[t]=new String(t);var r=F[e];if(void 0!==r){if(B){var i=B.get(r);if(void 0!==i)return i}var n=N[e];if(void 0!==n){for(var o={},a=0;a>8,t[c+1]=255&f,t=t.concat(i[h])}return t},A.TABLE=function(e){for(var t=0,r=e.fields.length,i=0;i>1,t.skip("uShort",3),e.glyphIndexMap={};for(var a=new se.Parser(r,i+n+14),s=new se.Parser(r,i+n+16+2*o),l=new se.Parser(r,i+n+16+4*o),u=new se.Parser(r,i+n+16+6*o),h=i+n+16+8*o,c=0;c>4,o=15&i;if(15==n)break;if(t+=r[n],15==o)break;t+=r[o]}return parseFloat(t)}(e);if(32<=t&&t<=246)return t-139;if(247<=t&&t<=250)return 256*(t-247)+e.parseByte()+108;if(251<=t&&t<=254)return 256*-(t-251)-e.parseByte()-108;throw new Error("Invalid b0 "+t)}function Te(e,t,r){t=void 0!==t?t:0;var i=new se.Parser(e,t),n=[],o=[];for(r=void 0!==r?r:e.length;i.relativeOffset>1,T.length=0,P=!0}return function e(t){for(var r,i,n,o,a,s,l,u,h,c,f,d,p=0;pMath.abs(d-R)?k=f+T.shift():R=d+T.shift(),E.curveTo(y,b,_,x,l,u),E.curveTo(h,c,f,d,k,R);break;default:console.log("Glyph "+v.index+": unknown operator 1200"+m),T.length=0}break;case 14:0>3;break;case 21:2>16),p+=2;break;case 29:a=T.pop()+g.gsubrsBias,(s=g.gsubrs[a])&&e(s);break;case 30:for(;0=r.begin&&e=fe.length){var a=i.parseChar();r.names.push(i.parseString(a))}break;case 2.5:r.numberOfGlyphs=i.parseUShort(),r.offset=new Array(r.numberOfGlyphs);for(var s=0;st.value.tag?1:-1}),t.fields=t.fields.concat(i),t.fields=t.fields.concat(n),t}function gt(e,t,r){for(var i=0;i 123 are reserved for internal usage");d|=1<>>1,o=e[n].tag;if(o===t)return n;o>>1,o=e[n];if(o===t)return n;o>>1,a=(r=e[o]).start;if(a===t)return r;a(r=e[i-1]).end?0:r}function xt(e,t){this.font=e,this.tableName=t}function wt(e){xt.call(this,e,"gpos")}function St(e){xt.call(this,e,"gsub")}function Mt(e,t){var r=e.length;if(r!==t.length)return!1;for(var i=0;it.points.length-1||i.matchedPoints[1]>n.points.length-1)throw Error("Matched points out of range in "+t.name);var a=t.points[i.matchedPoints[0]],s=n.points[i.matchedPoints[1]],l={xScale:i.xScale,scale01:i.scale01,scale10:i.scale10,yScale:i.yScale,dx:0,dy:0};s=kt([s],l)[0],l.dx=a.x-s.x,l.dy=a.y-s.y,o=kt(n.points,l)}t.points=t.points.concat(o)}}return Rt(t.points)}(wt.prototype=xt.prototype={searchTag:yt,binSearch:bt,getTable:function(e){var t=this.font.tables[this.tableName];return!t&&e&&(t=this.font.tables[this.tableName]=this.createDefaultTable()),t},getScriptNames:function(){var e=this.getTable();return e?e.scripts.map(function(e){return e.tag}):[]},getDefaultScriptName:function(){var e=this.getTable();if(e){for(var t=!1,r=0;r=s[u-1].tag,"Features must be added in alphabetical order."),o={tag:r,feature:{params:0,lookupListIndexes:[]}},s.push(o),a.push(u),o.feature}}},getLookupTables:function(e,t,r,i,n){var o=this.getFeatureTable(e,t,r,n),a=[];if(o){for(var s,l=o.lookupListIndexes,u=this.font.tables[this.tableName].lookups,h=0;h",s),t.stack.push(Math.round(64*s))}function vr(e,t){var r=t.stack,i=r.pop(),n=t.fv,o=t.pv,a=t.ppem,s=t.deltaBase+16*(e-1),l=t.deltaShift,u=t.z0;E.DEBUG&&console.log(t.step,"DELTAP["+e+"]",i,r);for(var h=0;h>4)===a){var d=(15&f)-8;0<=d&&d++,E.DEBUG&&console.log(t.step,"DELTAPFIX",c,"by",d*l);var p=u[c];n.setRelative(p,p,d*l,o)}}}function yr(e,t){var r=t.stack,i=r.pop();E.DEBUG&&console.log(t.step,"ROUND[]"),r.push(64*t.round(i/64))}function br(e,t){var r=t.stack,i=r.pop(),n=t.ppem,o=t.deltaBase+16*(e-1),a=t.deltaShift;E.DEBUG&&console.log(t.step,"DELTAC["+e+"]",i,r);for(var s=0;s>4)===n){var h=(15&u)-8;0<=h&&h++;var c=h*a;E.DEBUG&&console.log(t.step,"DELTACFIX",l,"by",c),t.cvt[l]+=c}}}function _r(e,t){var r,i,n=t.stack,o=n.pop(),a=n.pop(),s=t.z2[o],l=t.z1[a];E.DEBUG&&console.log(t.step,"SDPVTL["+e+"]",o,a),i=e?(r=s.y-l.y,l.x-s.x):(r=l.x-s.x,l.y-s.y),t.dpv=Zt(r,i)}function xr(e,t){var r=t.stack,i=t.prog,n=t.ip;E.DEBUG&&console.log(t.step,"PUSHB["+e+"]");for(var o=0;o":"_")+(i?"R":"_")+(0===n?"Gr":1===n?"Bl":2===n?"Wh":"")+"]",e?c+"("+o.cvt[c]+","+u+")":"",f,"(d =",a,"->",l*s,")"),o.rp1=o.rp0,o.rp2=f,t&&(o.rp0=f)}Ft.prototype.exec=function(e,t){if("number"!=typeof t)throw new Error("Point size is not a number!");if(!(2",i),s.interpolate(c,o,a,l),s.touch(c)}e.loop=1},dr.bind(void 0,0),dr.bind(void 0,1),function(e){for(var t=e.stack,r=e.rp0,i=e.z0[r],n=e.loop,o=e.fv,a=e.pv,s=e.z1;n--;){var l=t.pop(),u=s[l];E.DEBUG&&console.log(e.step,(1=a.width||t>=a.height?[0,0,0,0]:this._getPixel(e,t);var s=new l.default.Image(r,i);return s.canvas.getContext("2d").drawImage(a,e,t,r*o,i*o,0,0,r,i),s},l.default.Renderer.prototype.textLeading=function(e){return"number"==typeof e?(this._setProperty("_textLeading",e),this._pInst):this._textLeading},l.default.Renderer.prototype.textSize=function(e){return"number"==typeof e?(this._setProperty("_textSize",e),this._setProperty("_textLeading",e*y._DEFAULT_LEADMULT),this._applyTextProperties()):this._textSize},l.default.Renderer.prototype.textStyle=function(e){return e?(e!==y.NORMAL&&e!==y.ITALIC&&e!==y.BOLD&&e!==y.BOLDITALIC||this._setProperty("_textStyle",e),this._applyTextProperties()):this._textStyle},l.default.Renderer.prototype.textAscent=function(){return null===this._textAscent&&this._updateTextMetrics(),this._textAscent},l.default.Renderer.prototype.textDescent=function(){return null===this._textDescent&&this._updateTextMetrics(),this._textDescent},l.default.Renderer.prototype.textAlign=function(e,t){return void 0!==e?(this._setProperty("_textAlign",e),void 0!==t&&this._setProperty("_textBaseline",t),this._applyTextProperties()):{horizontal:this._textAlign,vertical:this._textBaseline}},l.default.Renderer.prototype.text=function(e,t,r,i,n){var o,a,s,l,u,h,c,f,d=this._pInst,p=Number.MAX_VALUE;if((this._doFill||this._doStroke)&&void 0!==e){if("string"!=typeof e&&(e=e.toString()),o=(e=e.replace(/(\t)/g," ")).split("\n"),void 0!==i){for(s=f=0;ss.HALF_PI&&e<=3*s.HALF_PI?Math.atan(r/i*Math.tan(e))+s.PI:Math.atan(r/i*Math.tan(e))+s.TWO_PI,t=t<=s.HALF_PI?Math.atan(r/i*Math.tan(t)):t>s.HALF_PI&&t<=3*s.HALF_PI?Math.atan(r/i*Math.tan(t))+s.PI:Math.atan(r/i*Math.tan(t))+s.TWO_PI),tv||Math.abs(this.accelerationY-this.pAccelerationY)>v||Math.abs(this.accelerationZ-this.pAccelerationZ)>v)&&e();var t=this.deviceTurned||window.deviceTurned;if("function"==typeof t){var r=this.rotationX+180,i=this.pRotationX+180,n=c+180;0>>24],i+=x[(16711680&C)>>16],n+=x[(65280&C)>>8],o+=x[255&C],r+=k[_],s++}w[l=T+y]=a/r,S[l]=i/r,M[l]=n/r,E[l]=o/r}T+=d}for(h=(u=-P)*d,b=T=0;b>>16,e[r+1]=(65280&t[i])>>>8,e[r+2]=255&t[i],e[r+3]=(4278190080&t[i])>>>24},O._toImageData=function(e){return e instanceof ImageData?e:e.getContext("2d").getImageData(0,0,e.width,e.height)},O._createImageData=function(e,t){return O._tmpCanvas=document.createElement("canvas"),O._tmpCtx=O._tmpCanvas.getContext("2d"),this._tmpCtx.createImageData(e,t)},O.apply=function(e,t,r){var i=e.getContext("2d"),n=i.getImageData(0,0,e.width,e.height),o=t(n,r);o instanceof ImageData?i.putImageData(o,0,0,0,0,e.width,e.height):i.putImageData(n,0,0,0,0,e.width,e.height)},O.threshold=function(e,t){var r=O._toPixels(e);void 0===t&&(t=.5);for(var i=Math.floor(255*t),n=0;n>8)/i,r[n+1]=255*(a*t>>8)/i,r[n+2]=255*(s*t>>8)/i}},O.dilate=function(e){for(var t,r,i,n,o,a,s,l,u,h,c,f,d,p,m,g,v,y=O._toPixels(e),b=0,_=y.length?y.length/4:0,x=new Int32Array(_);b<_;)for(r=(t=b)+e.width;b>16&255)+151*(i>>8&255)+28*(255&i))<(m=77*(c>>16&255)+151*(c>>8&255)+28*(255&c))&&(n=c,o=m),o<(p=77*((h=O._getARGB(y,a))>>16&255)+151*(h>>8&255)+28*(255&h))&&(n=h,o=p),o<(g=77*(f>>16&255)+151*(f>>8&255)+28*(255&f))&&(n=f,o=g),o<(v=77*(d>>16&255)+151*(d>>8&255)+28*(255&d))&&(n=d,o=v),x[b++]=n;O._setPixels(y,x)},O.erode=function(e){for(var t,r,i,n,o,a,s,l,u,h,c,f,d,p,m,g,v,y=O._toPixels(e),b=0,_=y.length?y.length/4:0,x=new Int32Array(_);b<_;)for(r=(t=b)+e.width;b>16&255)+151*(c>>8&255)+28*(255&c))<(o=77*(i>>16&255)+151*(i>>8&255)+28*(255&i))&&(n=c,o=m),(p=77*((h=O._getARGB(y,a))>>16&255)+151*(h>>8&255)+28*(255&h))>16&255)+151*(f>>8&255)+28*(255&f))>16&255)+151*(d>>8&255)+28*(255&d))=r){var i=Math.floor(t.timeDisplayed/r);if(t.timeDisplayed=0,t.displayIndex+=i,t.loopCount=Math.floor(t.displayIndex/t.numFrames),null!==t.loopLimit&&t.loopCount>=t.loopLimit)t.playing=!1;else{var n=t.displayIndex%t.numFrames;this.drawingContext.putImageData(t.frames[n].image,0,0),t.displayIndex=n,this.setModified(!0)}}}},n.default.Image.prototype._setProperty=function(e,t){this[e]=t,this.setModified(!0)},n.default.Image.prototype.loadPixels=function(){n.default.Renderer2D.prototype.loadPixels.call(this),this.setModified(!0)},n.default.Image.prototype.updatePixels=function(e,t,r,i){n.default.Renderer2D.prototype.updatePixels.call(this,e,t,r,i),this.setModified(!0)},n.default.Image.prototype.get=function(e,t,r,i){return n.default._validateParameters("p5.Image.get",arguments),n.default.Renderer2D.prototype.get.apply(this,arguments)},n.default.Image.prototype._getPixel=n.default.Renderer2D.prototype._getPixel,n.default.Image.prototype.set=function(e,t,r){n.default.Renderer2D.prototype.set.call(this,e,t,r),this.setModified(!0)},n.default.Image.prototype.resize=function(e,t){0===e&&0===t?(e=this.canvas.width,t=this.canvas.height):0===e?e=this.canvas.width*t/this.canvas.height:0===t&&(t=this.canvas.height*e/this.canvas.width),e=Math.floor(e),t=Math.floor(t);var r=document.createElement("canvas");if(r.width=e,r.height=t,this.gifProperties)for(var i=this.gifProperties,n=function(e,t){for(var r=0,i=0;i/g,">").replace(/"/g,""").replace(/'/g,"'")}function l(e,t){t&&!0!==t&&"true"!==t||(t="");var r="";return(e=e||"untitled")&&e.includes(".")&&(r=e.split(".").pop()),t&&r!==t&&(r=t,e="".concat(e,".").concat(r)),[e,r]}e("../core/error_helpers"),v.default.prototype.loadJSON=function(){for(var e=arguments.length,t=new Array(e),r=0;r"),n.print("");if(n.print(' '),n.print(""),n.print(""),n.print(" "),"0"!==o[0]){n.print(" ");for(var h=0;h".concat(c)),n.print(" ")}n.print(" ")}for(var f=0;f");for(var d=0;d".concat(p)),n.print(" ")}n.print(" ")}n.print("
"),n.print(""),n.print("")}n.close(),n.clear()},v.default.prototype.writeFile=function(e,t,r){var i="application/octet-stream";v.default.prototype._isSafari()&&(i="text/plain");var n=new Blob(e,{type:i});v.default.prototype.downloadFile(n,t,r)},v.default.prototype.downloadFile=function(e,t,r){var i=l(t,r),n=i[0];if(e instanceof Blob)s.default.saveAs(e,n);else{var o=document.createElement("a");if(o.href=e,o.download=n,o.onclick=function(e){var t;t=e,document.body.removeChild(t.target),e.stopPropagation()},o.style.display="none",document.body.appendChild(o),v.default.prototype._isSafari()){var a="Hello, Safari user! To download this file...\n";a+="1. Go to File --\x3e Save As.\n",a+='2. Choose "Page Source" as the Format.\n',a+='3. Name it with this extension: ."'.concat(i[1],'"'),alert(a)}o.click()}},v.default.prototype._checkFileExtension=l,v.default.prototype._isSafari=function(){return 0>>0},getSeed:function(){return t},rand:function(){return(r=(1664525*r+1013904223)%i)/i}});n.setSeed(e),_=new Array(4096);for(var o=0;o<4096;o++)_[o]=n.rand()};var o=n.default;r.default=o},{"../core/main":49}],82:[function(e,t,r){"use strict";function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i,l=(i=e("../core/main"))&&i.__esModule?i:{default:i},o=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==a(e)&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var o=i?Object.getOwnPropertyDescriptor(e,n):null;o&&(o.get||o.set)?Object.defineProperty(r,n,o):r[n]=e[n]}r.default=e,t&&t.set(e,r);return r}(e("../core/constants"));function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}l.default.Vector=function(e,t,r){var i,n,o;o=e instanceof l.default?(this.p5=e,i=t[0]||0,n=t[1]||0,t[2]||0):(i=e||0,n=t||0,r||0),this.x=i,this.y=n,this.z=o},l.default.Vector.prototype.toString=function(){return"p5.Vector Object : [".concat(this.x,", ").concat(this.y,", ").concat(this.z,"]")},l.default.Vector.prototype.set=function(e,t,r){return e instanceof l.default.Vector?(this.x=e.x||0,this.y=e.y||0,this.z=e.z||0):e instanceof Array?(this.x=e[0]||0,this.y=e[1]||0,this.z=e[2]||0):(this.x=e||0,this.y=t||0,this.z=r||0),this},l.default.Vector.prototype.copy=function(){return this.p5?new l.default.Vector(this.p5,[this.x,this.y,this.z]):new l.default.Vector(this.x,this.y,this.z)},l.default.Vector.prototype.add=function(e,t,r){return e instanceof l.default.Vector?(this.x+=e.x||0,this.y+=e.y||0,this.z+=e.z||0):e instanceof Array?(this.x+=e[0]||0,this.y+=e[1]||0,this.z+=e[2]||0):(this.x+=e||0,this.y+=t||0,this.z+=r||0),this};function u(e,t){return 0!==e&&(this.x=this.x%e),0!==t&&(this.y=this.y%t),this}function h(e,t,r){return 0!==e&&(this.x=this.x%e),0!==t&&(this.y=this.y%t),0!==r&&(this.z=this.z%r),this}l.default.Vector.prototype.rem=function(e,t,r){if(e instanceof l.default.Vector){if(Number.isFinite(e.x)&&Number.isFinite(e.y)&&Number.isFinite(e.z)){var i=parseFloat(e.x),n=parseFloat(e.y),o=parseFloat(e.z);h.call(this,i,n,o)}}else if(e instanceof Array)e.every(function(e){return Number.isFinite(e)})&&(2===e.length&&u.call(this,e[0],e[1]),3===e.length&&h.call(this,e[0],e[1],e[2]));else if(1===arguments.length){if(Number.isFinite(e)&&0!==e)return this.x=this.x%e,this.y=this.y%e,this.z=this.z%e,this}else if(2===arguments.length){var a=Array.prototype.slice.call(arguments);a.every(function(e){return Number.isFinite(e)})&&2===a.length&&u.call(this,a[0],a[1])}else if(3===arguments.length){var s=Array.prototype.slice.call(arguments);s.every(function(e){return Number.isFinite(e)})&&3===s.length&&h.call(this,s[0],s[1],s[2])}},l.default.Vector.prototype.sub=function(e,t,r){return e instanceof l.default.Vector?(this.x-=e.x||0,this.y-=e.y||0,this.z-=e.z||0):e instanceof Array?(this.x-=e[0]||0,this.y-=e[1]||0,this.z-=e[2]||0):(this.x-=e||0,this.y-=t||0,this.z-=r||0),this},l.default.Vector.prototype.mult=function(e){return"number"==typeof e&&isFinite(e)?(this.x*=e,this.y*=e,this.z*=e):console.warn("p5.Vector.prototype.mult:","n is undefined or not a finite number"),this},l.default.Vector.prototype.div=function(e){return"number"==typeof e&&isFinite(e)?0===e?console.warn("p5.Vector.prototype.div:","divide by 0"):(this.x/=e,this.y/=e,this.z/=e):console.warn("p5.Vector.prototype.div:","n is undefined or not a finite number"),this},l.default.Vector.prototype.mag=function(){return Math.sqrt(this.magSq())},l.default.Vector.prototype.magSq=function(){var e=this.x,t=this.y,r=this.z;return e*e+t*t+r*r},l.default.Vector.prototype.dot=function(e,t,r){return e instanceof l.default.Vector?this.dot(e.x,e.y,e.z):this.x*(e||0)+this.y*(t||0)+this.z*(r||0)},l.default.Vector.prototype.cross=function(e){var t=this.y*e.z-this.z*e.y,r=this.z*e.x-this.x*e.z,i=this.x*e.y-this.y*e.x;return this.p5?new l.default.Vector(this.p5,[t,r,i]):new l.default.Vector(t,r,i)},l.default.Vector.prototype.dist=function(e){return e.copy().sub(this).mag()},l.default.Vector.prototype.normalize=function(){var e=this.mag();return 0!==e&&this.mult(1/e),this},l.default.Vector.prototype.limit=function(e){var t=this.magSq();return e*e>>0},n.default.prototype.randomSeed=function(e){this._lcgSetSeed(o,e),this._gaussian_previous=!1},n.default.prototype.random=function(e,t){var r;if(n.default._validateParameters("random",arguments),r=null!=this[o]?this._lcg(o):Math.random(),void 0===e)return r;if(void 0===t)return e instanceof Array?e[Math.floor(r*e.length)]:r*e;if(tf){var P=p,L=l,k=u;p=d+f*(s&&d=t&&(r=r.substring(r.length-t,r.length)),r}},n.default.prototype.unhex=function(e){return e instanceof Array?e.map(n.default.prototype.unhex):parseInt("0x".concat(e),16)};var o=n.default;r.default=o},{"../core/main":49}],90:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i,a=(i=e("../core/main"))&&i.__esModule?i:{default:i};function n(e,t,r){var i=e<0,n=i?e.toString().substring(1):e.toString(),o=n.indexOf("."),a=-1!==o?n.substring(0,o):n,s=-1!==o?n.substring(o+1):"",l=i?"-":"";if(void 0!==r){var u="";(-1!==o||0r&&(s=s.substring(0,r));for(var h=0;hi.length)for(var o=t-(i+=-1===r?".":"").length+1,a=0;a=d.TWO_PI?"".concat("ellipse","|").concat(u,"|"):"".concat("arc","|").concat(a,"|").concat(s,"|").concat(l,"|").concat(u,"|"),!this.geometryInHash(t)){var h=new T.default.Geometry(u,1,function(){if(this.strokeIndices=[],a.toFixed(10)!==s.toFixed(10)){l!==d.PIE&&void 0!==l||(this.vertices.push(new T.default.Vector(.5,.5,0)),this.uvs.push([.5,.5]));for(var e=0;e<=u;e++){var t=(s-a)*(e/u)+a,r=.5+Math.cos(t)/2,i=.5+Math.sin(t)/2;this.vertices.push(new T.default.Vector(r,i,0)),this.uvs.push([r,i]),e>5&31)/31,(y>>10&31)/31):(r=a,i=s,l)}for(var b=1;b<=3;b++){var _=p+12*b,x=new S.default.Vector(u.getFloat32(_,!0),u.getFloat32(8+_,!0),u.getFloat32(4+_,!0));e.vertices.push(x),c&&o.push(r,i,n)}var w=new S.default.Vector(m,g,v);e.vertexNormals.push(w,w,w),e.faces.push([3*d,3*d+1,3*d+2]),e.uvs.push([0,0],[0,0],[0,0])}}(e,t);else{var r=new DataView(t);if(!("TextDecoder"in window))return console.warn("Sorry, ASCII STL loading only works in browsers that support TextDecoder (https://caniuse.com/#feat=textencoder)");var i=new TextDecoder("utf-8").decode(r).split("\n");!function(e,t){for(var r,i,n="",o=[],a=0;aMath.PI?l=Math.PI:l<=0&&(l=.001);var u=Math.sin(l)*a*Math.sin(s),h=Math.cos(l)*a,c=Math.sin(l)*a*Math.cos(s);this.camera(u+this.centerX,h+this.centerY,c+this.centerZ,this.centerX,this.centerY,this.centerZ,0,1,0)},m.default.Camera.prototype._isActive=function(){return this===this._renderer._curCamera},m.default.prototype.setCamera=function(e){this._renderer._curCamera=e,this._renderer.uPMatrix.set(e.projMatrix.mat4[0],e.projMatrix.mat4[1],e.projMatrix.mat4[2],e.projMatrix.mat4[3],e.projMatrix.mat4[4],e.projMatrix.mat4[5],e.projMatrix.mat4[6],e.projMatrix.mat4[7],e.projMatrix.mat4[8],e.projMatrix.mat4[9],e.projMatrix.mat4[10],e.projMatrix.mat4[11],e.projMatrix.mat4[12],e.projMatrix.mat4[13],e.projMatrix.mat4[14],e.projMatrix.mat4[15])};var n=m.default.Camera;r.default=n},{"../core/main":49}],98:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i,h=(i=e("../core/main"))&&i.__esModule?i:{default:i};h.default.Geometry=function(e,t,r){return this.vertices=[],this.lineVertices=[],this.lineNormals=[],this.vertexNormals=[],this.faces=[],this.uvs=[],this.edges=[],this.vertexColors=[],this.detailX=void 0!==e?e:1,this.detailY=void 0!==t?t:1,this.dirtyFlags={},r instanceof Function&&r.call(this),this},h.default.Geometry.prototype.reset=function(){this.lineVertices.length=0,this.lineNormals.length=0,this.vertices.length=0,this.edges.length=0,this.vertexColors.length=0,this.vertexNormals.length=0,this.uvs.length=0,this.dirtyFlags={}},h.default.Geometry.prototype.computeFaces=function(){this.faces.length=0;for(var e,t,r,i,n=this.detailX+1,o=0;othis.vertices.length-1-this.detailX;i--)e.add(this.vertexNormals[i]);e=h.default.Vector.div(e,this.detailX);for(var n=this.vertices.length-1;n>this.vertices.length-1-this.detailX;n--)this.vertexNormals[n]=e;return this},h.default.Geometry.prototype._makeTriangleEdges=function(){if(this.edges.length=0,Array.isArray(this.strokeIndices))for(var e=0,t=this.strokeIndices.length;e vTexCoord.y;\n bool y1 = p1.y > vTexCoord.y;\n bool y2 = p2.y > vTexCoord.y;\n\n // could web be under the curve (after t1)?\n if (y1 ? !y2 : y0) {\n // add the coverage for t1\n coverage.x += saturate(C1.x + 0.5);\n // calculate the anti-aliasing for t1\n weight.x = min(weight.x, abs(C1.x));\n }\n\n // are we outside the curve (after t2)?\n if (y1 ? !y0 : y2) {\n // subtract the coverage for t2\n coverage.x -= saturate(C2.x + 0.5);\n // calculate the anti-aliasing for t2\n weight.x = min(weight.x, abs(C2.x));\n }\n}\n\n// this is essentially the same as coverageX, but with the axes swapped\nvoid coverageY(vec2 p0, vec2 p1, vec2 p2) {\n\n vec2 C1, C2;\n calulateCrossings(p0, p1, p2, C1, C2);\n\n bool x0 = p0.x > vTexCoord.x;\n bool x1 = p1.x > vTexCoord.x;\n bool x2 = p2.x > vTexCoord.x;\n\n if (x1 ? !x2 : x0) {\n coverage.y -= saturate(C1.y + 0.5);\n weight.y = min(weight.y, abs(C1.y));\n }\n\n if (x1 ? !x0 : x2) {\n coverage.y += saturate(C2.y + 0.5);\n weight.y = min(weight.y, abs(C2.y));\n }\n}\n\nvoid main() {\n\n // calculate the pixel scale based on screen-coordinates\n pixelScale = hardness / fwidth(vTexCoord);\n\n // which grid cell is this pixel in?\n ivec2 gridCoord = ifloor(vTexCoord * vec2(uGridSize));\n\n // intersect curves in this row\n {\n // the index into the row info bitmap\n int rowIndex = gridCoord.y + uGridOffset.y;\n // fetch the info texel\n vec4 rowInfo = getTexel(uSamplerRows, rowIndex, uGridImageSize);\n // unpack the rowInfo\n int rowStrokeIndex = getInt16(rowInfo.xy);\n int rowStrokeCount = getInt16(rowInfo.zw);\n\n for (int iRowStroke = INT(0); iRowStroke < N; iRowStroke++) {\n if (iRowStroke >= rowStrokeCount)\n break;\n\n // each stroke is made up of 3 points: the start and control point\n // and the start of the next curve.\n // fetch the indices of this pair of strokes:\n vec4 strokeIndices = getTexel(uSamplerRowStrokes, rowStrokeIndex++, uCellsImageSize);\n\n // unpack the stroke index\n int strokePos = getInt16(strokeIndices.xy);\n\n // fetch the two strokes\n vec4 stroke0 = getTexel(uSamplerStrokes, strokePos + INT(0), uStrokeImageSize);\n vec4 stroke1 = getTexel(uSamplerStrokes, strokePos + INT(1), uStrokeImageSize);\n\n // calculate the coverage\n coverageX(stroke0.xy, stroke0.zw, stroke1.xy);\n }\n }\n\n // intersect curves in this column\n {\n int colIndex = gridCoord.x + uGridOffset.x;\n vec4 colInfo = getTexel(uSamplerCols, colIndex, uGridImageSize);\n int colStrokeIndex = getInt16(colInfo.xy);\n int colStrokeCount = getInt16(colInfo.zw);\n \n for (int iColStroke = INT(0); iColStroke < N; iColStroke++) {\n if (iColStroke >= colStrokeCount)\n break;\n\n vec4 strokeIndices = getTexel(uSamplerColStrokes, colStrokeIndex++, uCellsImageSize);\n\n int strokePos = getInt16(strokeIndices.xy);\n vec4 stroke0 = getTexel(uSamplerStrokes, strokePos + INT(0), uStrokeImageSize);\n vec4 stroke1 = getTexel(uSamplerStrokes, strokePos + INT(1), uStrokeImageSize);\n coverageY(stroke0.xy, stroke0.zw, stroke1.xy);\n }\n }\n\n weight = saturate(1.0 - weight * 2.0);\n float distance = max(weight.x + weight.y, minDistance); // manhattan approx.\n float antialias = abs(dot(coverage, weight) / distance);\n float cover = min(abs(coverage.x), abs(coverage.y));\n gl_FragColor = uMaterialColor;\n gl_FragColor.a *= saturate(max(antialias, cover));\n}",lineVert:"/*\n Part of the Processing project - http://processing.org\n Copyright (c) 2012-15 The Processing Foundation\n Copyright (c) 2004-12 Ben Fry and Casey Reas\n Copyright (c) 2001-04 Massachusetts Institute of Technology\n This library is free software; you can redistribute it and/or\n modify it under the terms of the GNU Lesser General Public\n License as published by the Free Software Foundation, version 2.1.\n This library is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n Lesser General Public License for more details.\n You should have received a copy of the GNU Lesser General\n Public License along with this library; if not, write to the\n Free Software Foundation, Inc., 59 Temple Place, Suite 330,\n Boston, MA 02111-1307 USA\n*/\n\n#define PROCESSING_LINE_SHADER\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform float uStrokeWeight;\n\nuniform vec4 uViewport;\nuniform int uPerspective;\n\nattribute vec4 aPosition;\nattribute vec4 aDirection;\n \nvoid main() {\n // using a scale <1 moves the lines towards the camera\n // in order to prevent popping effects due to half of\n // the line disappearing behind the geometry faces.\n vec3 scale = vec3(0.9995);\n\n vec4 posp = uModelViewMatrix * aPosition;\n vec4 posq = uModelViewMatrix * (aPosition + vec4(aDirection.xyz, 0));\n\n // Moving vertices slightly toward the camera\n // to avoid depth-fighting with the fill triangles.\n // Discussed here:\n // http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Number=252848 \n posp.xyz = posp.xyz * scale;\n posq.xyz = posq.xyz * scale;\n\n vec4 p = uProjectionMatrix * posp;\n vec4 q = uProjectionMatrix * posq;\n\n // formula to convert from clip space (range -1..1) to screen space (range 0..[width or height])\n // screen_p = (p.xy/p.w + <1,1>) * 0.5 * uViewport.zw\n\n // prevent division by W by transforming the tangent formula (div by 0 causes\n // the line to disappear, see https://github.com/processing/processing/issues/5183)\n // t = screen_q - screen_p\n //\n // tangent is normalized and we don't care which aDirection it points to (+-)\n // t = +- normalize( screen_q - screen_p )\n // t = +- normalize( (q.xy/q.w+<1,1>)*0.5*uViewport.zw - (p.xy/p.w+<1,1>)*0.5*uViewport.zw )\n //\n // extract common factor, <1,1> - <1,1> cancels out\n // t = +- normalize( (q.xy/q.w - p.xy/p.w) * 0.5 * uViewport.zw )\n //\n // convert to common divisor\n // t = +- normalize( ((q.xy*p.w - p.xy*q.w) / (p.w*q.w)) * 0.5 * uViewport.zw )\n //\n // remove the common scalar divisor/factor, not needed due to normalize and +-\n // (keep uViewport - can't remove because it has different components for x and y\n // and corrects for aspect ratio, see https://github.com/processing/processing/issues/5181)\n // t = +- normalize( (q.xy*p.w - p.xy*q.w) * uViewport.zw )\n\n vec2 tangent = normalize((q.xy*p.w - p.xy*q.w) * uViewport.zw);\n\n // flip tangent to normal (it's already normalized)\n vec2 normal = vec2(-tangent.y, tangent.x);\n\n float thickness = aDirection.w * uStrokeWeight;\n vec2 offset = normal * thickness / 2.0;\n\n vec2 curPerspScale;\n\n if(uPerspective == 1) {\n // Perspective ---\n // convert from world to clip by multiplying with projection scaling factor\n // to get the right thickness (see https://github.com/processing/processing/issues/5182)\n // invert Y, projections in Processing invert Y\n curPerspScale = (uProjectionMatrix * vec4(1, -1, 0, 0)).xy;\n } else {\n // No Perspective ---\n // multiply by W (to cancel out division by W later in the pipeline) and\n // convert from screen to clip (derived from clip to screen above)\n curPerspScale = p.w / (0.5 * uViewport.zw);\n }\n\n gl_Position.xy = p.xy + offset.xy * curPerspScale;\n gl_Position.zw = p.zw;\n}\n",lineFrag:"precision mediump float;\nprecision mediump int;\n\nuniform vec4 uMaterialColor;\n\nvoid main() {\n gl_FragColor = uMaterialColor;\n}",pointVert:"attribute vec3 aPosition;\nuniform float uPointSize;\nvarying float vStrokeWeight;\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nvoid main() {\n\tvec4 positionVec4 = vec4(aPosition, 1.0);\n\tgl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n\tgl_PointSize = uPointSize;\n\tvStrokeWeight = uPointSize;\n}",pointFrag:"precision mediump float;\nprecision mediump int;\nuniform vec4 uMaterialColor;\nvarying float vStrokeWeight;\n\nvoid main(){\n\tfloat mask = 0.0;\n\n\t// make a circular mask using the gl_PointCoord (goes from 0 - 1 on a point)\n // might be able to get a nicer edge on big strokeweights with smoothstep but slightly less performant\n\n\tmask = step(0.98, length(gl_PointCoord * 2.0 - 1.0));\n\n\t// if strokeWeight is 1 or less lets just draw a square\n\t// this prevents weird artifacting from carving circles when our points are really small\n\t// if strokeWeight is larger than 1, we just use it as is\n\n\tmask = mix(0.0, mask, clamp(floor(vStrokeWeight - 0.5),0.0,1.0));\n\n\t// throw away the borders of the mask\n // otherwise we get weird alpha blending issues\n\n\tif(mask > 0.98){\n discard;\n \t}\n\n \tgl_FragColor = vec4(uMaterialColor.rgb * (1.0 - mask), uMaterialColor.a) ;\n}"};u.default.RendererGL=function(e,t,r,i){return u.default.Renderer.call(this,e,t,r),this._setAttributeDefaults(t),this._initContext(),this.isP3D=!0,this.GL=this.drawingContext,this._isErasing=!1,this._enableLighting=!1,this.ambientLightColors=[],this.specularColors=[1,1,1],this.directionalLightDirections=[],this.directionalLightDiffuseColors=[],this.directionalLightSpecularColors=[],this.pointLightPositions=[],this.pointLightDiffuseColors=[],this.pointLightSpecularColors=[],this.spotLightPositions=[],this.spotLightDirections=[],this.spotLightDiffuseColors=[],this.spotLightSpecularColors=[],this.spotLightAngle=[],this.spotLightConc=[],this.drawMode=o.FILL,this.curFillColor=this._cachedFillStyle=[1,1,1,1],this.curStrokeColor=this._cachedStrokeStyle=[0,0,0,1],this.curBlendMode=o.BLEND,this._cachedBlendMode=void 0,this.blendExt=this.GL.getExtension("EXT_blend_minmax"),this._isBlending=!1,this._useSpecularMaterial=!1,this._useEmissiveMaterial=!1,this._useNormalMaterial=!1,this._useShininess=1,this._tint=[255,255,255,255],this.constantAttenuation=1,this.linearAttenuation=0,this.quadraticAttenuation=0,this.uMVMatrix=new u.default.Matrix,this.uPMatrix=new u.default.Matrix,this.uNMatrix=new u.default.Matrix("mat3"),this._curCamera=new u.default.Camera(this),this._curCamera._computeCameraDefaultSettings(),this._curCamera._setDefaultCamera(),this._defaultLightShader=void 0,this._defaultImmediateModeShader=void 0,this._defaultNormalShader=void 0,this._defaultColorShader=void 0,this._defaultPointShader=void 0,this.userFillShader=void 0,this.userStrokeShader=void 0,this.userPointShader=void 0,this.retainedMode={geometry:{},buffers:{stroke:[new u.default.RenderBuffer(3,"lineVertices","lineVertexBuffer","aPosition",this,this._flatten),new u.default.RenderBuffer(4,"lineNormals","lineNormalBuffer","aDirection",this,this._flatten)],fill:[new u.default.RenderBuffer(3,"vertices","vertexBuffer","aPosition",this,this._vToNArray),new u.default.RenderBuffer(3,"vertexNormals","normalBuffer","aNormal",this,this._vToNArray),new u.default.RenderBuffer(4,"vertexColors","colorBuffer","aMaterialColor",this),new u.default.RenderBuffer(3,"vertexAmbients","ambientBuffer","aAmbientColor",this),new u.default.RenderBuffer(2,"uvs","uvBuffer","aTexCoord",this,this._flatten)],text:[new u.default.RenderBuffer(3,"vertices","vertexBuffer","aPosition",this,this._vToNArray),new u.default.RenderBuffer(2,"uvs","uvBuffer","aTexCoord",this,this._flatten)]}},this.immediateMode={geometry:new u.default.Geometry,shapeMode:o.TRIANGLE_FAN,_bezierVertex:[],_quadraticVertex:[],_curveVertex:[],buffers:{fill:[new u.default.RenderBuffer(3,"vertices","vertexBuffer","aPosition",this,this._vToNArray),new u.default.RenderBuffer(3,"vertexNormals","normalBuffer","aNormal",this,this._vToNArray),new u.default.RenderBuffer(4,"vertexColors","colorBuffer","aVertexColor",this),new u.default.RenderBuffer(3,"vertexAmbients","ambientBuffer","aAmbientColor",this),new u.default.RenderBuffer(2,"uvs","uvBuffer","aTexCoord",this,this._flatten)],stroke:[new u.default.RenderBuffer(3,"lineVertices","lineVertexBuffer","aPosition",this,this._flatten),new u.default.RenderBuffer(4,"lineNormals","lineNormalBuffer","aDirection",this,this._flatten)],point:this.GL.createBuffer()}},this.pointSize=5,this.curStrokeWeight=1,this.textures=[],this.textureMode=o.IMAGE,this.textureWrapX=o.CLAMP,this.textureWrapY=o.CLAMP,this._tex=null,this._curveTightness=6,this._lookUpTableBezier=[],this._lookUpTableQuadratic=[],this._lutBezierDetail=0,this._lutQuadraticDetail=0,this._tessy=this._initTessy(),this.fontInfos={},this._curShader=void 0,this},u.default.RendererGL.prototype=Object.create(u.default.Renderer.prototype),u.default.RendererGL.prototype._setAttributeDefaults=function(e){var t={alpha:!0,depth:!0,stencil:!0,antialias:navigator.userAgent.toLowerCase().includes("safari"),premultipliedAlpha:!1,preserveDrawingBuffer:!0,perPixelLighting:!0};null===e._glAttributes?e._glAttributes=t:e._glAttributes=Object.assign(t,e._glAttributes)},u.default.RendererGL.prototype._initContext=function(){try{if(this.drawingContext=this.canvas.getContext("webgl",this._pInst._glAttributes)||this.canvas.getContext("experimental-webgl",this._pInst._glAttributes),null===this.drawingContext)throw new Error("Error creating webgl context");var e=this.drawingContext;e.enable(e.DEPTH_TEST),e.depthFunc(e.LEQUAL),e.viewport(0,0,e.drawingBufferWidth,e.drawingBufferHeight),this._viewport=this.drawingContext.getParameter(this.drawingContext.VIEWPORT)}catch(e){throw e}},u.default.RendererGL.prototype._resetContext=function(e,t){var r=this.width,i=this.height,n=this.canvas.id,o=this._pInst instanceof u.default.Graphics;if(o){var a=this._pInst;a.canvas.parentNode.removeChild(a.canvas),a.canvas=document.createElement("canvas"),(a._pInst._userNode||document.body).appendChild(a.canvas),u.default.Element.call(a,a.canvas,a._pInst),a.width=r,a.height=i}else{var s=this.canvas;s&&s.parentNode.removeChild(s),(s=document.createElement("canvas")).id=n,this._pInst._userNode?this._pInst._userNode.appendChild(s):document.body.appendChild(s),this._pInst.canvas=s}var l=new u.default.RendererGL(this._pInst.canvas,this._pInst,!o);this._pInst._setProperty("_renderer",l),l.resize(r,i),l._applyDefaults(),o||this._pInst._elements.push(l),"function"==typeof t&&setTimeout(function(){t.apply(window._renderer,e)},0)},u.default.prototype.setAttributes=function(e,t){if(void 0!==this._glAttributes){var r=!0;if(void 0!==t?(null===this._glAttributes&&(this._glAttributes={}),this._glAttributes[e]!==t&&(this._glAttributes[e]=t,r=!1)):e instanceof Object&&this._glAttributes!==e&&(this._glAttributes=e,r=!1),this._renderer.isP3D&&!r){if(!this._setupDone)for(var i in this._renderer.retainedMode.geometry)if(this._renderer.retainedMode.geometry.hasOwnProperty(i))return void console.error("Sorry, Could not set the attributes, you need to call setAttributes() before calling the other drawing methods in setup()");this.push(),this._renderer._resetContext(),this.pop(),this._renderer._curCamera&&(this._renderer._curCamera._renderer=this._renderer)}}else console.log("You are trying to use setAttributes on a p5.Graphics object that does not use a WEBGL renderer.")},u.default.RendererGL.prototype._update=function(){this.uMVMatrix.set(this._curCamera.cameraMatrix.mat4[0],this._curCamera.cameraMatrix.mat4[1],this._curCamera.cameraMatrix.mat4[2],this._curCamera.cameraMatrix.mat4[3],this._curCamera.cameraMatrix.mat4[4],this._curCamera.cameraMatrix.mat4[5],this._curCamera.cameraMatrix.mat4[6],this._curCamera.cameraMatrix.mat4[7],this._curCamera.cameraMatrix.mat4[8],this._curCamera.cameraMatrix.mat4[9],this._curCamera.cameraMatrix.mat4[10],this._curCamera.cameraMatrix.mat4[11],this._curCamera.cameraMatrix.mat4[12],this._curCamera.cameraMatrix.mat4[13],this._curCamera.cameraMatrix.mat4[14],this._curCamera.cameraMatrix.mat4[15]),this.ambientLightColors.length=0,this.specularColors=[1,1,1],this.directionalLightDirections.length=0,this.directionalLightDiffuseColors.length=0,this.directionalLightSpecularColors.length=0,this.pointLightPositions.length=0,this.pointLightDiffuseColors.length=0,this.pointLightSpecularColors.length=0,this.spotLightPositions.length=0,this.spotLightDirections.length=0,this.spotLightDiffuseColors.length=0,this.spotLightSpecularColors.length=0,this.spotLightAngle.length=0,this.spotLightConc.length=0,this._enableLighting=!1,this._tint=[255,255,255,255],this.GL.clear(this.GL.DEPTH_BUFFER_BIT)},u.default.RendererGL.prototype.background=function(){var e,t=(e=this._pInst).color.apply(e,arguments),r=t.levels[0]/255,i=t.levels[1]/255,n=t.levels[2]/255,o=t.levels[3]/255;this.GL.clearColor(r,i,n,o),this.GL.clear(this.GL.COLOR_BUFFER_BIT)},u.default.RendererGL.prototype.fill=function(e,t,r,i){var n=u.default.prototype.color.apply(this._pInst,arguments);this.curFillColor=n._array,this.drawMode=o.FILL,this._useNormalMaterial=!1,this._tex=null},u.default.RendererGL.prototype.stroke=function(e,t,r,i){arguments[3]=255;var n=u.default.prototype.color.apply(this._pInst,arguments);this.curStrokeColor=n._array},u.default.RendererGL.prototype.strokeCap=function(e){console.error("Sorry, strokeCap() is not yet implemented in WEBGL mode")},u.default.RendererGL.prototype.strokeJoin=function(e){console.error("Sorry, strokeJoin() is not yet implemented in WEBGL mode")},u.default.RendererGL.prototype.filter=function(e){console.error("filter() does not work in WEBGL mode")},u.default.RendererGL.prototype.blendMode=function(e){e===o.DARKEST||e===o.LIGHTEST||e===o.ADD||e===o.BLEND||e===o.SUBTRACT||e===o.SCREEN||e===o.EXCLUSION||e===o.REPLACE||e===o.MULTIPLY||e===o.REMOVE?this.curBlendMode=e:e!==o.BURN&&e!==o.OVERLAY&&e!==o.HARD_LIGHT&&e!==o.SOFT_LIGHT&&e!==o.DODGE||console.warn("BURN, OVERLAY, HARD_LIGHT, SOFT_LIGHT, and DODGE only work for blendMode in 2D mode.")},u.default.RendererGL.prototype.erase=function(e,t){this._isErasing||(this._cachedBlendMode=this.curBlendMode,this.blendMode(o.REMOVE),this._cachedFillStyle=this.curFillColor.slice(),this.curFillColor=[1,1,1,e/255],this._cachedStrokeStyle=this.curStrokeColor.slice(),this.curStrokeColor=[1,1,1,t/255],this._isErasing=!0)},u.default.RendererGL.prototype.noErase=function(){this._isErasing&&(this.curFillColor=this._cachedFillStyle.slice(),this.curStrokeColor=this._cachedStrokeStyle.slice(),this.blendMode(this._cachedBlendMode),this._isErasing=!1)},u.default.RendererGL.prototype.strokeWeight=function(e){this.curStrokeWeight!==e&&(this.pointSize=e,this.curStrokeWeight=e)},u.default.RendererGL.prototype._getPixel=function(e,t){var r;return r=new Uint8Array(4),this.drawingContext.readPixels(e,t,1,1,this.drawingContext.RGBA,this.drawingContext.UNSIGNED_BYTE,r),[r[0],r[1],r[2],r[3]]},u.default.RendererGL.prototype.loadPixels=function(){var e=this._pixelsState;if(!0===this._pInst._glAttributes.preserveDrawingBuffer){var t=e.pixels,r=this.GL.drawingBufferWidth*this.GL.drawingBufferHeight*4;t instanceof Uint8Array&&t.length===r||(t=new Uint8Array(r),this._pixelsState._setProperty("pixels",t));var i=this._pInst._pixelDensity;this.GL.readPixels(0,0,this.width*i,this.height*i,this.GL.RGBA,this.GL.UNSIGNED_BYTE,t)}else console.log("loadPixels only works in WebGL when preserveDrawingBuffer is true.")},u.default.RendererGL.prototype.geometryInHash=function(e){return void 0!==this.retainedMode.geometry[e]},u.default.RendererGL.prototype.resize=function(e,t){u.default.Renderer.prototype.resize.call(this,e,t),this.GL.viewport(0,0,this.GL.drawingBufferWidth,this.GL.drawingBufferHeight),this._viewport=this.GL.getParameter(this.GL.VIEWPORT),this._curCamera._resize();var r=this._pixelsState;void 0!==r.pixels&&r._setProperty("pixels",new Uint8Array(this.GL.drawingBufferWidth*this.GL.drawingBufferHeight*4))},u.default.RendererGL.prototype.clear=function(){var e=(arguments.length<=0?void 0:arguments[0])||0,t=(arguments.length<=1?void 0:arguments[1])||0,r=(arguments.length<=2?void 0:arguments[2])||0,i=(arguments.length<=3?void 0:arguments[3])||0;this.GL.clearColor(e,t,r,i),this.GL.clear(this.GL.COLOR_BUFFER_BIT|this.GL.DEPTH_BUFFER_BIT)},u.default.RendererGL.prototype.applyMatrix=function(e,t,r,i,n,o){16===arguments.length?u.default.Matrix.prototype.apply.apply(this.uMVMatrix,arguments):this.uMVMatrix.apply([e,t,0,0,r,i,0,0,0,0,1,0,n,o,0,1])},u.default.RendererGL.prototype.translate=function(e,t,r){return e instanceof u.default.Vector&&(r=e.z,t=e.y,e=e.x),this.uMVMatrix.translate([e,t,r]),this},u.default.RendererGL.prototype.scale=function(e,t,r){return this.uMVMatrix.scale(e,t,r),this},u.default.RendererGL.prototype.rotate=function(e,t){return void 0===t?this.rotateZ(e):(u.default.Matrix.prototype.rotate.apply(this.uMVMatrix,arguments),this)},u.default.RendererGL.prototype.rotateX=function(e){return this.rotate(e,1,0,0),this},u.default.RendererGL.prototype.rotateY=function(e){return this.rotate(e,0,1,0),this},u.default.RendererGL.prototype.rotateZ=function(e){return this.rotate(e,0,0,1),this},u.default.RendererGL.prototype.push=function(){var e=u.default.Renderer.prototype.push.apply(this),t=e.properties;return t.uMVMatrix=this.uMVMatrix.copy(),t.uPMatrix=this.uPMatrix.copy(),t._curCamera=this._curCamera,this._curCamera=this._curCamera.copy(),t.ambientLightColors=this.ambientLightColors.slice(),t.specularColors=this.specularColors.slice(),t.directionalLightDirections=this.directionalLightDirections.slice(),t.directionalLightDiffuseColors=this.directionalLightDiffuseColors.slice(),t.directionalLightSpecularColors=this.directionalLightSpecularColors.slice(),t.pointLightPositions=this.pointLightPositions.slice(),t.pointLightDiffuseColors=this.pointLightDiffuseColors.slice(),t.pointLightSpecularColors=this.pointLightSpecularColors.slice(),t.spotLightPositions=this.spotLightPositions.slice(),t.spotLightDirections=this.spotLightDirections.slice(),t.spotLightDiffuseColors=this.spotLightDiffuseColors.slice(),t.spotLightSpecularColors=this.spotLightSpecularColors.slice(),t.spotLightAngle=this.spotLightAngle.slice(),t.spotLightConc=this.spotLightConc.slice(),t.userFillShader=this.userFillShader,t.userStrokeShader=this.userStrokeShader,t.userPointShader=this.userPointShader,t.pointSize=this.pointSize,t.curStrokeWeight=this.curStrokeWeight,t.curStrokeColor=this.curStrokeColor,t.curFillColor=this.curFillColor,t._useSpecularMaterial=this._useSpecularMaterial,t._useEmissiveMaterial=this._useEmissiveMaterial,t._useShininess=this._useShininess,t.constantAttenuation=this.constantAttenuation,t.linearAttenuation=this.linearAttenuation,t.quadraticAttenuation=this.quadraticAttenuation,t._enableLighting=this._enableLighting,t._useNormalMaterial=this._useNormalMaterial,t._tex=this._tex,t.drawMode=this.drawMode,e},u.default.RendererGL.prototype.resetMatrix=function(){return this.uMVMatrix=u.default.Matrix.identity(this._pInst),this},u.default.RendererGL.prototype._getImmediateStrokeShader=function(){var e=this.userStrokeShader;return e&&e.isStrokeShader()?e:this._getLineShader()},u.default.RendererGL.prototype._getRetainedStrokeShader=u.default.RendererGL.prototype._getImmediateStrokeShader,u.default.RendererGL.prototype._getImmediateFillShader=function(){var e=this.userFillShader;if(this._useNormalMaterial&&(!e||!e.isNormalShader()))return this._getNormalShader();if(this._enableLighting){if(!e||!e.isLightShader())return this._getLightShader()}else if(this._tex){if(!e||!e.isTextureShader())return this._getLightShader()}else if(!e)return this._getImmediateModeShader();return e},u.default.RendererGL.prototype._getRetainedFillShader=function(){if(this._useNormalMaterial)return this._getNormalShader();var e=this.userFillShader;if(this._enableLighting){if(!e||!e.isLightShader())return this._getLightShader()}else if(this._tex){if(!e||!e.isTextureShader())return this._getLightShader()}else if(!e)return this._getColorShader();return e},u.default.RendererGL.prototype._getImmediatePointShader=function(){var e=this.userPointShader;return e&&e.isPointShader()?e:this._getPointShader()},u.default.RendererGL.prototype._getRetainedLineShader=u.default.RendererGL.prototype._getImmediateLineShader,u.default.RendererGL.prototype._getLightShader=function(){return this._defaultLightShader||(this._pInst._glAttributes.perPixelLighting?this._defaultLightShader=new u.default.Shader(this,c.phongVert,c.phongFrag):this._defaultLightShader=new u.default.Shader(this,c.lightVert,c.lightTextureFrag)),this._defaultLightShader},u.default.RendererGL.prototype._getImmediateModeShader=function(){return this._defaultImmediateModeShader||(this._defaultImmediateModeShader=new u.default.Shader(this,c.immediateVert,c.vertexColorFrag)),this._defaultImmediateModeShader},u.default.RendererGL.prototype._getNormalShader=function(){return this._defaultNormalShader||(this._defaultNormalShader=new u.default.Shader(this,c.normalVert,c.normalFrag)),this._defaultNormalShader},u.default.RendererGL.prototype._getColorShader=function(){return this._defaultColorShader||(this._defaultColorShader=new u.default.Shader(this,c.normalVert,c.basicFrag)),this._defaultColorShader},u.default.RendererGL.prototype._getPointShader=function(){return this._defaultPointShader||(this._defaultPointShader=new u.default.Shader(this,c.pointVert,c.pointFrag)),this._defaultPointShader},u.default.RendererGL.prototype._getLineShader=function(){return this._defaultLineShader||(this._defaultLineShader=new u.default.Shader(this,c.lineVert,c.lineFrag)),this._defaultLineShader},u.default.RendererGL.prototype._getFontShader=function(){return this._defaultFontShader||(this.GL.getExtension("OES_standard_derivatives"),this._defaultFontShader=new u.default.Shader(this,c.fontVert,c.fontFrag)),this._defaultFontShader},u.default.RendererGL.prototype._getEmptyTexture=function(){if(!this._emptyTexture){var e=new u.default.Image(1,1);e.set(0,0,255),this._emptyTexture=new u.default.Texture(this,e)}return this._emptyTexture},u.default.RendererGL.prototype.getTexture=function(e){var t=this.textures,r=!0,i=!1,n=void 0;try{for(var o,a=t[Symbol.iterator]();!(r=(o=a.next()).done);r=!0){var s=o.value;if(s.src===e)return s}}catch(e){i=!0,n=e}finally{try{r||null==a.return||a.return()}finally{if(i)throw n}}var l=new u.default.Texture(this,e);return t.push(l),l},u.default.RendererGL.prototype._setStrokeUniforms=function(e){e.bindShader(),e.setUniform("uMaterialColor",this.curStrokeColor),e.setUniform("uStrokeWeight",this.curStrokeWeight)},u.default.RendererGL.prototype._setFillUniforms=function(e){e.bindShader(),e.setUniform("uMaterialColor",this.curFillColor),e.setUniform("isTexture",!!this._tex),this._tex&&e.setUniform("uSampler",this._tex),e.setUniform("uTint",this._tint),e.setUniform("uSpecular",this._useSpecularMaterial),e.setUniform("uEmissive",this._useEmissiveMaterial),e.setUniform("uShininess",this._useShininess),e.setUniform("uUseLighting",this._enableLighting);var t=this.pointLightDiffuseColors.length/3;e.setUniform("uPointLightCount",t),e.setUniform("uPointLightLocation",this.pointLightPositions),e.setUniform("uPointLightDiffuseColors",this.pointLightDiffuseColors),e.setUniform("uPointLightSpecularColors",this.pointLightSpecularColors);var r=this.directionalLightDiffuseColors.length/3;e.setUniform("uDirectionalLightCount",r),e.setUniform("uLightingDirection",this.directionalLightDirections),e.setUniform("uDirectionalDiffuseColors",this.directionalLightDiffuseColors),e.setUniform("uDirectionalSpecularColors",this.directionalLightSpecularColors);var i=this.ambientLightColors.length/3;e.setUniform("uAmbientLightCount",i),e.setUniform("uAmbientColor",this.ambientLightColors);var n=this.spotLightDiffuseColors.length/3;e.setUniform("uSpotLightCount",n),e.setUniform("uSpotLightAngle",this.spotLightAngle),e.setUniform("uSpotLightConc",this.spotLightConc),e.setUniform("uSpotLightDiffuseColors",this.spotLightDiffuseColors),e.setUniform("uSpotLightSpecularColors",this.spotLightSpecularColors),e.setUniform("uSpotLightLocation",this.spotLightPositions),e.setUniform("uSpotLightDirection",this.spotLightDirections),e.setUniform("uConstantAttenuation",this.constantAttenuation),e.setUniform("uLinearAttenuation",this.linearAttenuation),e.setUniform("uQuadraticAttenuation",this.quadraticAttenuation),e.bindTextures()},u.default.RendererGL.prototype._setPointUniforms=function(e){e.bindShader(),e.setUniform("uMaterialColor",this.curStrokeColor),e.setUniform("uPointSize",this.pointSize)},u.default.RendererGL.prototype._bindBuffer=function(e,t,r,i,n){if(t=t||this.GL.ARRAY_BUFFER,this.GL.bindBuffer(t,e),void 0!==r){var o=new(i||Float32Array)(r);this.GL.bufferData(t,o,n||this.GL.STATIC_DRAW)}},u.default.RendererGL.prototype._arraysEqual=function(e,t){var r=e.length;if(r!==t.length)return!1;for(var i=0;i>7,127&f,c>>7,127&c);for(var d=0;d>7,127&p,0,0)}}return{cellImageInfo:l,dimOffset:o,dimImageInfo:n}}return(t=this.glyphInfos[e.index]={glyph:e,uGlyphRect:[i.x1,-i.y1,i.x2,-i.y2],strokeImageInfo:U,strokes:d,colInfo:G(m,this.colDimImageInfos,this.colCellImageInfos),rowInfo:G(p,this.rowDimImageInfos,this.rowCellImageInfos)}).uGridOffset=[t.colInfo.dimOffset,t.rowInfo.dimOffset],t}}var z=Math.sqrt(3);j.default.RendererGL.prototype._renderText=function(e,t,r,i,n){if(this._textFont&&"string"!=typeof this._textFont){if(!(n<=i)&&this._doFill){if(!this._isOpenType())return console.log("WEBGL: only Opentype (.otf) and Truetype (.ttf) fonts are supported"),e;e.push();var o=this._doStroke,a=this.drawMode;this._doStroke=!1,this.drawMode=D.TEXTURE;var s=this._textFont.font,l=this._textFont._fontInfo;l=l||(this._textFont._fontInfo=new A(s));var u=this._textFont._handleAlignment(this,t,r,i),h=this._textSize/s.unitsPerEm;this.translate(u.x,u.y,0),this.scale(h,h,1);var c=this.GL,f=!this._defaultFontShader,d=this._getFontShader();d.init(),d.bindShader(),f&&(d.setUniform("uGridImageSize",[64,64]),d.setUniform("uCellsImageSize",[64,64]),d.setUniform("uStrokeImageSize",[64,64]),d.setUniform("uGridSize",[9,9])),this._applyColorBlend(this.curFillColor);var p=this.retainedMode.geometry.glyph;if(!p){var m=this._textGeom=new j.default.Geometry(1,1,function(){for(var e=0;e<=1;e++)for(var t=0;t<=1;t++)this.vertices.push(new j.default.Vector(t,e,0)),this.uvs.push(t,e)});m.computeFaces().computeNormals(),p=this.createBuffers("glyph",m)}var g=!0,v=!1,y=void 0;try{for(var b,_=this.retainedMode.buffers.text[Symbol.iterator]();!(g=(b=_.next()).done);g=!0){b.value._prepareBuffer(p,d)}}catch(e){v=!0,y=e}finally{try{g||null==_.return||_.return()}finally{if(v)throw y}}this._bindBuffer(p.indexBuffer,c.ELEMENT_ARRAY_BUFFER),d.setUniform("uMaterialColor",this.curFillColor);try{var x=0,w=null,S=s.stringToGlyphs(t),M=!0,E=!1,T=void 0;try{for(var C,P=S[Symbol.iterator]();!(M=(C=P.next()).done);M=!0){var L=C.value;w&&(x+=s.getKerningValue(w,L));var k=l.getGlyphInfo(L);if(k.uGlyphRect){var R=k.rowInfo,O=k.colInfo;d.setUniform("uSamplerStrokes",k.strokeImageInfo.imageData),d.setUniform("uSamplerRowStrokes",R.cellImageInfo.imageData),d.setUniform("uSamplerRows",R.dimImageInfo.imageData),d.setUniform("uSamplerColStrokes",O.cellImageInfo.imageData),d.setUniform("uSamplerCols",O.dimImageInfo.imageData),d.setUniform("uGridOffset",k.uGridOffset),d.setUniform("uGlyphRect",k.uGlyphRect),d.setUniform("uGlyphOffset",x),d.bindTextures(),c.drawElements(c.TRIANGLES,6,this.GL.UNSIGNED_SHORT,0)}x+=L.advanceWidth,w=L}}catch(e){E=!0,T=e}finally{try{M||null==P.return||P.return()}finally{if(E)throw T}}}finally{d.unbindShader(),this._doStroke=o,this.drawMode=a,e.pop()}return e}}else console.log("WEBGL: you must load and set a font before drawing text. See `loadFont` and `textFont` for more details.")}},{"../core/constants":42,"../core/main":49,"./p5.RendererGL.Retained":102,"./p5.Shader":104}],107:[function(e,t,r){t.exports={fes:{autoplay:"The media that tried to play (with '{{src}}') wasn't allowed to by this browser, most likely due to the browser's autoplay policy. Check out {{link}} for more information about why.",fileLoadError:{bytes:"It looks like there was a problem loading your file. {{suggestion}}",font:"It looks like there was a problem loading your font. {{suggestion}}",gif:"There was some trouble loading your GIF. Make sure that your GIF is using 87a or 89a encoding.",image:"It looks like there was a problem loading your image. {{suggestion}}",json:"It looks like there was a problem loading your JSON file. {{suggestion}}",large:"If your large file isn't fetched successfully, we recommend splitting the file into smaller segments and fetching those.",strings:"It looks like there was a problem loading your text file. {{suggestion}}",suggestion:"Try checking if the file path ({{filePath}}) is correct, hosting the file online, or running a local server. (More info at {{link}})",table:"It looks like there was a problem loading your table file. {{suggestion}}",xml:"It looks like there was a problem loading your XML file. {{suggestion}}"},misusedTopLevel:"Did you just try to use p5.js's {{symbolName}} {{symbolType}}? If so, you may want to move it into your sketch's setup() function.\n\nFor more details, see: {{link}}",pre:"🌸 p5.js says: {{message}}",welcome:"Welcome! This is your friendly debugger. To turn me off, switch to using p5.min.js."}}},{}],108:[function(e,t,r){t.exports={fes:{autoplay:"Su browser impidío un medio tocar (de '{{src}}'), posiblemente porque las reglas de autoplay. Para aprender más, visite {{link}}.",fileLoadError:{bytes:"",font:"",gif:"",image:"",json:"",large:"",strings:"",suggestion:"",table:"",xml:""},misusedTopLevel:"",pre:"🌸 p5.js dice: {{message}}",welcome:""}}},{}],109:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i=o(e("./en/translation")),n=o(e("./es/translation"));function o(e){return e&&e.__esModule?e:{default:e}}var a={en:{translation:i.default},es:{translation:n.default}};r.default=a},{"./en/translation":107,"./es/translation":108}]},{},[37])(37)}); ================================================ FILE: docs/examples/pyodide/sketch_011/target/target_sketch.js ================================================ const wrapperContent = ` class PythonFunctions: pass setattr(PythonFunctions, 'map', map) setattr(PythonFunctions, 'filter', filter) setattr(PythonFunctions, 'set', set) _P5_INSTANCE = None _CTX_MIDDLE = None _DEFAULT_FILL = None _DEFAULT_LEADMULT = None _DEFAULT_STROKE = None _DEFAULT_TEXT_FILL = None ADD = None ALT = None ARROW = None AUDIO = None AUTO = None AXES = None BACKSPACE = None BASELINE = None BEVEL = None BEZIER = None BLEND = None BLUR = None BOLD = None BOLDITALIC = None BOTTOM = None BURN = None CENTER = None CHORD = None CLAMP = None CLOSE = None CONTROL = None CORNER = None CORNERS = None CROSS = None CURVE = None DARKEST = None DEG_TO_RAD = None DEGREES = None DELETE = None DIFFERENCE = None DILATE = None DODGE = None DOWN_ARROW = None ENTER = None ERODE = None ESCAPE = None EXCLUSION = None FILL = None GRAY = None GRID = None HALF_PI = None HAND = None HARD_LIGHT = None HSB = None HSL = None IMAGE = None IMMEDIATE = None INVERT = None ITALIC = None LANDSCAPE = None LEFT = None LEFT_ARROW = None LIGHTEST = None LINE_LOOP = None LINE_STRIP = None LINEAR = None LINES = None MIRROR = None MITER = None MOVE = None MULTIPLY = None NEAREST = None NORMAL = None OPAQUE = None OPEN = None OPTION = None OVERLAY = None PI = None PIE = None POINTS = None PORTRAIT = None POSTERIZE = None PROJECT = None QUAD_STRIP = None QUADRATIC = None QUADS = None QUARTER_PI = None RAD_TO_DEG = None RADIANS = None RADIUS = None REPEAT = None REPLACE = None RETURN = None RGB = None RIGHT = None RIGHT_ARROW = None ROUND = None SCREEN = None SHIFT = None SOFT_LIGHT = None SQUARE = None STROKE = None SUBTRACT = None TAB = None TAU = None TEXT = None TEXTURE = None THRESHOLD = None TOP = None TRIANGLE_FAN = None TRIANGLE_STRIP = None TRIANGLES = None TWO_PI = None UP_ARROW = None VIDEO = None WAIT = None WEBGL = None P2D = None PI = None frameCount = None focused = None displayWidth = None displayHeight = None windowWidth = None windowHeight = None width = None height = None deviceOrientation = None accelerationX = None accelerationY = None accelerationZ = None pAccelerationX = None pAccelerationY = None pAccelerationZ = None rotationX = None rotationY = None rotationZ = None pRotationX = None pRotationY = None pRotationZ = None turnAxis = None keyIsPressed = None key = None keyCode = None mouseX = None mouseY = None pmouseX = None pmouseY = None winMouseX = None winMouseY = None pwinMouseX = None pwinMouseY = None mouseButton = None mouseIsPressed = None touches = None pixels = None def alpha(*args): return _P5_INSTANCE.alpha(*args) def blue(*args): return _P5_INSTANCE.blue(*args) def brightness(*args): return _P5_INSTANCE.brightness(*args) def color(*args): return _P5_INSTANCE.color(*args) def green(*args): return _P5_INSTANCE.green(*args) def hue(*args): return _P5_INSTANCE.hue(*args) def lerpColor(*args): return _P5_INSTANCE.lerpColor(*args) def lightness(*args): return _P5_INSTANCE.lightness(*args) def red(*args): return _P5_INSTANCE.red(*args) def saturation(*args): return _P5_INSTANCE.saturation(*args) def background(*args): return _P5_INSTANCE.background(*args) def clear(*args): p5_clear = _P5_INSTANCE.clear(*args) return p5_clear def erase(*args): return _P5_INSTANCE.erase(*args) def noErase(*args): return _P5_INSTANCE.noErase(*args) def colorMode(*args): return _P5_INSTANCE.colorMode(*args) def fill(*args): return _P5_INSTANCE.fill(*args) def noFill(*args): return _P5_INSTANCE.noFill(*args) def noStroke(*args): return _P5_INSTANCE.noStroke(*args) def stroke(*args): return _P5_INSTANCE.stroke(*args) def arc(*args): return _P5_INSTANCE.arc(*args) def ellipse(*args): return _P5_INSTANCE.ellipse(*args) def circle(*args): return _P5_INSTANCE.circle(*args) def line(*args): return _P5_INSTANCE.line(*args) def point(*args): return _P5_INSTANCE.point(*args) def quad(*args): return _P5_INSTANCE.quad(*args) def rect(*args): return _P5_INSTANCE.rect(*args) def square(*args): return _P5_INSTANCE.square(*args) def triangle(*args): return _P5_INSTANCE.triangle(*args) def plane(*args): return _P5_INSTANCE.plane(*args) def box(*args): return _P5_INSTANCE.box(*args) def sphere(*args): return _P5_INSTANCE.sphere(*args) def cylinder(*args): return _P5_INSTANCE.cylinder(*args) def cone(*args): return _P5_INSTANCE.cone(*args) def ellipsoid(*args): return _P5_INSTANCE.ellipsoid(*args) def torus(*args): return _P5_INSTANCE.torus(*args) def loadModel(*args): return _P5_INSTANCE.loadModel(*args) def model(*args): return _P5_INSTANCE.model(*args) def ellipseMode(*args): return _P5_INSTANCE.ellipseMode(*args) def noSmooth(*args): return _P5_INSTANCE.noSmooth(*args) def rectMode(*args): return _P5_INSTANCE.rectMode(*args) def smooth(*args): return _P5_INSTANCE.smooth(*args) def strokeCap(*args): return _P5_INSTANCE.strokeCap(*args) def strokeJoin(*args): return _P5_INSTANCE.strokeJoin(*args) def strokeWeight(*args): return _P5_INSTANCE.strokeWeight(*args) def bezier(*args): return _P5_INSTANCE.bezier(*args) def bezierDetail(*args): return _P5_INSTANCE.bezierDetail(*args) def bezierPoint(*args): return _P5_INSTANCE.bezierPoint(*args) def bezierTangent(*args): return _P5_INSTANCE.bezierTangent(*args) def curve(*args): return _P5_INSTANCE.curve(*args) def curveDetail(*args): return _P5_INSTANCE.curveDetail(*args) def curveTightness(*args): return _P5_INSTANCE.curveTightness(*args) def curvePoint(*args): return _P5_INSTANCE.curvePoint(*args) def curveTangent(*args): return _P5_INSTANCE.curveTangent(*args) def beginContour(*args): return _P5_INSTANCE.beginContour(*args) def beginShape(*args): return _P5_INSTANCE.beginShape(*args) def bezierVertex(*args): return _P5_INSTANCE.bezierVertex(*args) def curveVertex(*args): return _P5_INSTANCE.curveVertex(*args) def endContour(*args): return _P5_INSTANCE.endContour(*args) def endShape(*args): return _P5_INSTANCE.endShape(*args) def quadraticVertex(*args): return _P5_INSTANCE.quadraticVertex(*args) def vertex(*args): return _P5_INSTANCE.vertex(*args) def cursor(*args): return _P5_INSTANCE.cursor(*args) def frameRate(*args): return _P5_INSTANCE.frameRate(*args) def noCursor(*args): return _P5_INSTANCE.noCursor(*args) def fullscreen(*args): return _P5_INSTANCE.fullscreen(*args) def pixelDensity(*args): return _P5_INSTANCE.pixelDensity(*args) def displayDensity(*args): return _P5_INSTANCE.displayDensity(*args) def getURL(*args): return _P5_INSTANCE.getURL(*args) def getURLPath(*args): return _P5_INSTANCE.getURLPath(*args) def getURLParams(*args): return _P5_INSTANCE.getURLParams(*args) def remove(*args): return _P5_INSTANCE.remove(*args) def noLoop(*args): return _P5_INSTANCE.noLoop(*args) def loop(*args): return _P5_INSTANCE.loop(*args) def push(*args): return _P5_INSTANCE.push(*args) def redraw(*args): return _P5_INSTANCE.redraw(*args) def resizeCanvas(*args): return _P5_INSTANCE.resizeCanvas(*args) def noCanvas(*args): return _P5_INSTANCE.noCanvas(*args) def createGraphics(*args): return _P5_INSTANCE.createGraphics(*args) def blendMode(*args): return _P5_INSTANCE.blendMode(*args) def setAttributes(*args): return _P5_INSTANCE.setAttributes(*args) def applyMatrix(*args): return _P5_INSTANCE.applyMatrix(*args) def resetMatrix(*args): return _P5_INSTANCE.resetMatrix(*args) def rotate(*args): return _P5_INSTANCE.rotate(*args) def rotateX(*args): return _P5_INSTANCE.rotateX(*args) def rotateY(*args): return _P5_INSTANCE.rotateY(*args) def rotateZ(*args): return _P5_INSTANCE.rotateZ(*args) def scale(*args): return _P5_INSTANCE.scale(*args) def shearX(*args): return _P5_INSTANCE.shearX(*args) def shearY(*args): return _P5_INSTANCE.shearY(*args) def translate(*args): return _P5_INSTANCE.translate(*args) def createStringDict(*args): return _P5_INSTANCE.createStringDict(*args) def createNumberDict(*args): return _P5_INSTANCE.createNumberDict(*args) def append(*args): return _P5_INSTANCE.append(*args) def arrayCopy(*args): return _P5_INSTANCE.arrayCopy(*args) def concat(*args): return _P5_INSTANCE.concat(*args) def reverse(*args): return _P5_INSTANCE.reverse(*args) def shorten(*args): return _P5_INSTANCE.shorten(*args) def shuffle(*args): return _P5_INSTANCE.shuffle(*args) def sort(*args): return _P5_INSTANCE.sort(*args) def splice(*args): return _P5_INSTANCE.splice(*args) def subset(*args): return _P5_INSTANCE.subset(*args) def float(*args): return _P5_INSTANCE.float(*args) def int(*args): return _P5_INSTANCE.int(*args) def str(*args): return _P5_INSTANCE.str(*args) def boolean(*args): return _P5_INSTANCE.boolean(*args) def byte(*args): return _P5_INSTANCE.byte(*args) def char(*args): return _P5_INSTANCE.char(*args) def unchar(*args): return _P5_INSTANCE.unchar(*args) def hex(*args): return _P5_INSTANCE.hex(*args) def unhex(*args): return _P5_INSTANCE.unhex(*args) def join(*args): return _P5_INSTANCE.join(*args) def match(*args): return _P5_INSTANCE.match(*args) def matchAll(*args): return _P5_INSTANCE.matchAll(*args) def nf(*args): return _P5_INSTANCE.nf(*args) def nfc(*args): return _P5_INSTANCE.nfc(*args) def nfp(*args): return _P5_INSTANCE.nfp(*args) def nfs(*args): return _P5_INSTANCE.nfs(*args) def split(*args): return _P5_INSTANCE.split(*args) def splitTokens(*args): return _P5_INSTANCE.splitTokens(*args) def trim(*args): return _P5_INSTANCE.trim(*args) def setMoveThreshold(*args): return _P5_INSTANCE.setMoveThreshold(*args) def setShakeThreshold(*args): return _P5_INSTANCE.setShakeThreshold(*args) def keyIsDown(*args): return _P5_INSTANCE.keyIsDown(*args) def createImage(*args): return _P5_INSTANCE.createImage(*args) def saveCanvas(*args): return _P5_INSTANCE.saveCanvas(*args) def saveFrames(*args): return _P5_INSTANCE.saveFrames(*args) def loadImage(*args): return _P5_INSTANCE.loadImage(*args) def image(*args): return _P5_INSTANCE.image(*args) def tint(*args): return _P5_INSTANCE.tint(*args) def noTint(*args): return _P5_INSTANCE.noTint(*args) def imageMode(*args): return _P5_INSTANCE.imageMode(*args) def blend(*args): return _P5_INSTANCE.blend(*args) def copy(*args): return _P5_INSTANCE.copy(*args) def filter(*args): if len(args) > 1 and (args[0] is None or callable(args[0])): return PythonFunctions.filter(*args) else: return _P5_INSTANCE.filter(*args) def get(*args): return _P5_INSTANCE.get(*args) def loadPixels(*args): return _P5_INSTANCE.loadPixels(*args) def set(*args): if len(args) <= 1: return PythonFunctions.set(*args) else: return _P5_INSTANCE.set(*args) def updatePixels(*args): return _P5_INSTANCE.updatePixels(*args) def loadJSON(*args): return _P5_INSTANCE.loadJSON(*args) def loadStrings(*args): return _P5_INSTANCE.loadStrings(*args) def loadTable(*args): return _P5_INSTANCE.loadTable(*args) def loadXML(*args): return _P5_INSTANCE.loadXML(*args) def loadBytes(*args): return _P5_INSTANCE.loadBytes(*args) def httpGet(*args): return _P5_INSTANCE.httpGet(*args) def httpPost(*args): return _P5_INSTANCE.httpPost(*args) def httpDo(*args): return _P5_INSTANCE.httpDo(*args) def createWriter(*args): return _P5_INSTANCE.createWriter(*args) def save(*args): return _P5_INSTANCE.save(*args) def saveJSON(*args): return _P5_INSTANCE.saveJSON(*args) def saveStrings(*args): return _P5_INSTANCE.saveStrings(*args) def saveTable(*args): return _P5_INSTANCE.saveTable(*args) def day(*args): return _P5_INSTANCE.day(*args) def hour(*args): return _P5_INSTANCE.hour(*args) def minute(*args): return _P5_INSTANCE.minute(*args) def millis(*args): return _P5_INSTANCE.millis(*args) def month(*args): return _P5_INSTANCE.month(*args) def second(*args): return _P5_INSTANCE.second(*args) def year(*args): return _P5_INSTANCE.year(*args) def createVector(*args): return _P5_INSTANCE.createVector(*args) def abs(*args): return _P5_INSTANCE.abs(*args) def ceil(*args): return _P5_INSTANCE.ceil(*args) def constrain(*args): return _P5_INSTANCE.constrain(*args) def dist(*args): return _P5_INSTANCE.dist(*args) def exp(*args): return _P5_INSTANCE.exp(*args) def floor(*args): return _P5_INSTANCE.floor(*args) def lerp(*args): return _P5_INSTANCE.lerp(*args) def log(*args): return _P5_INSTANCE.log(*args) def mag(*args): return _P5_INSTANCE.mag(*args) def map(*args): if len(args) > 1 and callable(args[0]): return PythonFunctions.map(*args) else: return _P5_INSTANCE.map(*args) def max(*args): return _P5_INSTANCE.max(*args) def min(*args): return _P5_INSTANCE.min(*args) def norm(*args): return _P5_INSTANCE.norm(*args) def pow(*args): return _P5_INSTANCE.pow(*args) def round(*args): return _P5_INSTANCE.round(*args) def sq(*args): return _P5_INSTANCE.sq(*args) def sqrt(*args): return _P5_INSTANCE.sqrt(*args) def noise(*args): return _P5_INSTANCE.noise(*args) def noiseDetail(*args): return _P5_INSTANCE.noiseDetail(*args) def noiseSeed(*args): return _P5_INSTANCE.noiseSeed(*args) def randomSeed(*args): return _P5_INSTANCE.randomSeed(*args) def random(*args): return _P5_INSTANCE.random(*args) def randomGaussian(*args): return _P5_INSTANCE.randomGaussian(*args) def acos(*args): return _P5_INSTANCE.acos(*args) def asin(*args): return _P5_INSTANCE.asin(*args) def atan(*args): return _P5_INSTANCE.atan(*args) def atan2(*args): return _P5_INSTANCE.atan2(*args) def cos(*args): return _P5_INSTANCE.cos(*args) def sin(*args): return _P5_INSTANCE.sin(*args) def tan(*args): return _P5_INSTANCE.tan(*args) def degrees(*args): return _P5_INSTANCE.degrees(*args) def radians(*args): return _P5_INSTANCE.radians(*args) def angleMode(*args): return _P5_INSTANCE.angleMode(*args) def textAlign(*args): return _P5_INSTANCE.textAlign(*args) def textLeading(*args): return _P5_INSTANCE.textLeading(*args) def textSize(*args): return _P5_INSTANCE.textSize(*args) def textStyle(*args): return _P5_INSTANCE.textStyle(*args) def textWidth(*args): return _P5_INSTANCE.textWidth(*args) def textAscent(*args): return _P5_INSTANCE.textAscent(*args) def textDescent(*args): return _P5_INSTANCE.textDescent(*args) def loadFont(*args): return _P5_INSTANCE.loadFont(*args) def text(*args): return _P5_INSTANCE.text(*args) def textFont(*args): return _P5_INSTANCE.textFont(*args) def orbitControl(*args): return _P5_INSTANCE.orbitControl(*args) def debugMode(*args): return _P5_INSTANCE.debugMode(*args) def noDebugMode(*args): return _P5_INSTANCE.noDebugMode(*args) def ambientLight(*args): return _P5_INSTANCE.ambientLight(*args) def directionalLight(*args): return _P5_INSTANCE.directionalLight(*args) def pointLight(*args): return _P5_INSTANCE.pointLight(*args) def lights(*args): return _P5_INSTANCE.lights(*args) def loadShader(*args): return _P5_INSTANCE.loadShader(*args) def createShader(*args): return _P5_INSTANCE.createShader(*args) def shader(*args): return _P5_INSTANCE.shader(*args) def resetShader(*args): return _P5_INSTANCE.resetShader(*args) def normalMaterial(*args): return _P5_INSTANCE.normalMaterial(*args) def texture(*args): return _P5_INSTANCE.texture(*args) def textureMode(*args): return _P5_INSTANCE.textureMode(*args) def textureWrap(*args): return _P5_INSTANCE.textureWrap(*args) def ambientMaterial(*args): return _P5_INSTANCE.ambientMaterial(*args) def specularMaterial(*args): return _P5_INSTANCE.specularMaterial(*args) def shininess(*args): return _P5_INSTANCE.shininess(*args) def camera(*args): return _P5_INSTANCE.camera(*args) def perspective(*args): return _P5_INSTANCE.perspective(*args) def ortho(*args): return _P5_INSTANCE.ortho(*args) def createCamera(*args): return _P5_INSTANCE.createCamera(*args) def setCamera(*args): return _P5_INSTANCE.setCamera(*args) def select(*args): return _P5_INSTANCE.select(*args) def selectAll(*args): return _P5_INSTANCE.selectAll(*args) def removeElements(*args): return _P5_INSTANCE.removeElements(*args) def changed(*args): return _P5_INSTANCE.changed(*args) def input(*args): return _P5_INSTANCE.input(*args) def createDiv(*args): return _P5_INSTANCE.createDiv(*args) def createP(*args): return _P5_INSTANCE.createP(*args) def createSpan(*args): return _P5_INSTANCE.createSpan(*args) def createImg(*args): return _P5_INSTANCE.createImg(*args) def createA(*args): return _P5_INSTANCE.createA(*args) def createSlider(*args): return _P5_INSTANCE.createSlider(*args) def createButton(*args): return _P5_INSTANCE.createButton(*args) def createCheckbox(*args): return _P5_INSTANCE.createCheckbox(*args) def createSelect(*args): return _P5_INSTANCE.createSelect(*args) def createRadio(*args): return _P5_INSTANCE.createRadio(*args) def createColorPicker(*args): return _P5_INSTANCE.createColorPicker(*args) def createInput(*args): return _P5_INSTANCE.createInput(*args) def createFileInput(*args): return _P5_INSTANCE.createFileInput(*args) def createVideo(*args): return _P5_INSTANCE.createVideo(*args) def createAudio(*args): return _P5_INSTANCE.createAudio(*args) def createCapture(*args): return _P5_INSTANCE.createCapture(*args) def createElement(*args): return _P5_INSTANCE.createElement(*args) def createCanvas(*args): canvas = _P5_INSTANCE.createCanvas(*args) global width, height width = _P5_INSTANCE.width height = _P5_INSTANCE.height return canvas def __deviceMoved(e): try: _bind_event_function(deviceMoved, e) except NameError: pass def __deviceTurned(e): try: _bind_event_function(deviceTurned, e) except NameError: pass def __deviceShaken(e): try: _bind_event_function(deviceShaken, e) except NameError: pass def __touchEnded(e): try: _bind_event_function(deviceShaken, e) except NameError: pass def __touchStarted(e): try: _bind_event_function(touchStarted, e) except NameError: pass def __windowResized(e): try: _bind_event_function(windowResized, e) except NameError: pass def __touchMoved(e): try: _bind_event_function(touchMoved, e) except NameError: pass def __mouseMoved(e): try: _bind_event_function(mouseMoved, e) except NameError: pass def __mouseDragged(e): try: _bind_event_function(mouseDragged, e) except NameError: pass def __mousePressed(e): try: _bind_event_function(mousePressed, e) except NameError: pass def __mouseReleased(e): try: _bind_event_function(mouseReleased, e) except NameError: pass def __mouseClicked(e): try: _bind_event_function(mouseClicked, e) except NameError: pass def __doubleClicked(e): try: _bind_event_function(doubleClicked, e) except NameError: pass def __mouseWheel(e): try: _bind_event_function(mouseWheel, e) except NameError: pass def __keyPressed(e): try: _bind_event_function(keyPressed, e) except NameError: pass def __keyReleased(e): try: _bind_event_function(keyReleased, e) except NameError: pass def __keyTyped(e): try: _bind_event_function(keyTyped, e) except NameError: pass def __keyIsDown(e): try: _bind_event_function(keyIsDown, e) except NameError: pass def pop(*args): p5_pop = _P5_INSTANCE.pop(*args) return p5_pop # Processing Python or Java mode compatibility aliases size = createCanvas popMatrix = pop popStyle = pop pushMatrix = push pushStyle = push # PVector is a wrapper/helper class for p5.Vector objets # providing names similar to Processing Python or Java modes # but mostly keeping p5js functionality from numbers import Number class PVector: def __init__(self, x=0, y=0, z=0): self.__vector = createVector(x, y, z) self.add = self.__instance_add__ self.sub = self.__instance_sub__ self.mult = self.__instance_mult__ self.div = self.__instance_div__ self.cross = self.__instance_cross__ self.dist = self.__instance_dist__ self.dot = self.__instance_dot__ self.lerp = self.__instance_lerp__ @property def x(self): return self.__vector.x @x.setter def x(self, x): self.__vector.x = x @property def y(self): return self.__vector.y @y.setter def y(self, y): self.__vector.y = y @property def z(self): return self.__vector.z @z.setter def z(self, z): self.__vector.z = z def mag(self): return self.__vector.mag() def magSq(self): return self.__vector.magSq() def setMag(self, mag): self.__vector.setMag(mag) return self def normalize(self): self.__vector.normalize() return self def limit(self, max): self.__vector.limit(max) return self def heading(self): return self.__vector.heading() def rotate(self, angle): self.__vector.rotate(angle) return self def __instance_add__(self, *args): if len(args) == 1: return PVector.add(self, args[0], self) else: return PVector.add(self, PVector(*args), self) def __instance_sub__(self, *args): if len(args) == 1: return PVector.sub(self, args[0], self) else: return PVector.sub(self, PVector(*args), self) def __instance_mult__(self, o): return PVector.mult(self, o, self) def __instance_div__(self, f): return PVector.div(self, f, self) def __instance_cross__(self, o): return PVector.cross(self, o, self) def __instance_dist__(self, o): return PVector.dist(self, o) def __instance_dot__(self, *args): if len(args) == 1: v = args[0] else: v = args return self.x * v[0] + self.y * v[1] + self.z * v[2] def __instance_lerp__(self, *args): if len(args) == 2: return PVector.lerp(self, args[0], args[1], self) else: vx, vy, vz, f = args return PVector.lerp(self, PVector(vx, vy, vz), f, self) def get(self): return PVector(self.x, self.y, self.z) def copy(self): return PVector(self.x, self.y, self.z) def __getitem__(self, k): return getattr(self, ('x', 'y', 'z')[k]) def __setitem__(self, k, v): setattr(self, ('x', 'y', 'z')[k], v) def __copy__(self): return PVector(self.x, self.y, self.z) def __deepcopy__(self, memo): return PVector(self.x, self.y, self.z) def __repr__(self): # PROVISÓRIO return f'PVector({self.x}, {self.y}, {self.z})' def set(self, *args): """ Sets the x, y, and z component of the vector using two or three separate variables, the data from a p5.Vector, or the values from a float array. """ self.__vector.set(*args) @classmethod def add(cls, a, b, dest=None): if dest is None: return PVector(a.x + b[0], a.y + b[1], a.z + b[2]) dest.__vector.set(a.x + b[0], a.y + b[1], a.z + b[2]) return dest @classmethod def sub(cls, a, b, dest=None): if dest is None: return PVector(a.x - b[0], a.y - b[1], a.z - b[2]) dest.__vector.set(a.x - b[0], a.y - b[1], a.z - b[2]) return dest @classmethod def mult(cls, a, b, dest=None): if dest is None: return PVector(a.x * b, a.y * b, a.z * b) dest.__vector.set(a.x * b, a.y * b, a.z * b) return dest @classmethod def div(cls, a, b, dest=None): if dest is None: return PVector(a.x / b, a.y / b, a.z / b) dest.__vector.set(a.x / b, a.y / b, a.z / b) return dest @classmethod def dist(cls, a, b): return a.__vector.dist(b.__vector) @classmethod def dot(cls, a, b): return a.__vector.dot(b.__vector) def __add__(a, b): return PVector.add(a, b, None) def __sub__(a, b): return PVector.sub(a, b, None) def __isub__(a, b): a.sub(b) return a def __iadd__(a, b): a.add(b) return a def __mul__(a, b): if not isinstance(b, Number): raise TypeError( "The * operator can only be used to multiply a PVector by a number") return PVector.mult(a, float(b), None) def __rmul__(a, b): if not isinstance(b, Number): raise TypeError( "The * operator can only be used to multiply a PVector by a number") return PVector.mult(a, float(b), None) def __imul__(a, b): if not isinstance(b, Number): raise TypeError( "The *= operator can only be used to multiply a PVector by a number") a.__vector.mult(float(b)) return a def __truediv__(a, b): if not isinstance(b, Number): raise TypeError( "The * operator can only be used to multiply a PVector by a number") return PVector(a.x / float(b), a.y / float(b), a.z / float(b)) def __itruediv__(a, b): if not isinstance(b, Number): raise TypeError( "The /= operator can only be used to multiply a PVector by a number") a.__vector.set(a.x / float(b), a.y / float(b), a.z / float(b)) return a def __eq__(a, b): return a.x == b[0] and a.y == b[1] and a.z == b[2] def __lt__(a, b): return a.magSq() < b.magSq() def __le__(a, b): return a.magSq() <= b.magSq() def __gt__(a, b): return a.magSq() > b.magSq() def __ge__(a, b): return a.magSq() >= b.magSq() # Problematic class methods, we would rather use p5.Vector when possible... @classmethod def lerp(cls, a, b, f, dest=None): v = createVector(a.x, a.y, a.z) v.lerp(b.__vector, f) if dest is None: return PVector(v.x, v.y, v.z) dest.set(v.x, v.y, v.z) return dest @classmethod def cross(cls, a, b, dest=None): x = a.y * b[2] - b[1] * a.z y = a.z * b[0] - b[2] * a.x z = a.x * b[1] - b[0] * a.y if dest is None: return PVector(x, y, z) dest.set(x, y, z) return dest @classmethod def fromAngle(cls, angle, length=1): # https://github.com/processing/p5.js/blob/3f0b2f0fe575dc81c724474154f5b23a517b7233/src/math/p5.Vector.js return PVector(length * cos(angle), length * sin(angle), 0) @classmethod def fromAngles(theta, phi, length=1): # https://github.com/processing/p5.js/blob/3f0b2f0fe575dc81c724474154f5b23a517b7233/src/math/p5.Vector.js cosPhi = cos(phi) sinPhi = sin(phi) cosTheta = cos(theta) sinTheta = sin(theta) return PVector(length * sinTheta * sinPhi, -length * cosTheta, length * sinTheta * cosPhi) @classmethod def random2D(cls): return PVector.fromAngle(random(TWO_PI)) @classmethod def random3D(cls, dest=None): angle = random(TWO_PI) vz = random(2) - 1 mult = sqrt(1 - vz * vz) vx = mult * cos(angle) vy = mult * sin(angle) if dest is None: return PVector(vx, vy, vz) dest.set(vx, vy, vz) return dest @classmethod def angleBetween(cls, a, b): return acos(a.dot(b) / sqrt(a.magSq() * b.magSq())) # Other harmless p5js methods def equals(self, v): return self == v def heading2D(self): return self.__vector.heading() def reflect(self, *args): # Reflect the incoming vector about a normal to a line in 2D, or about # a normal to a plane in 3D This method acts on the vector directly r = self.__vector.reflect(*args) return r def array(self): # Return a representation of this vector as a float array. This is only # for temporary use. If used in any w fashion, the contents should be # copied by using the p5.Vector.copy() method to copy into your own # array. return self.__vector.array() def toString(self): # Returns a string representation of a vector v by calling String(v) or v.toString(). # return self.__vector.toString() would be something like "p5.vector # Object […, …, …]" return str(self) def rem(self, *args): # Gives remainder of a vector when it is divided by anw vector. See # examples for more context. self.__vector.rem(*args) return self def pre_draw(p5_instance, draw_func, *args, **kwargs): """ We need to run this before the actual draw to insert and update p5 env variables """ global _CTX_MIDDLE, _DEFAULT_FILL, _DEFAULT_LEADMULT, _DEFAULT_STROKE, _DEFAULT_TEXT_FILL global ADD, ALT, ARROW, AUTO, AUDIO, AXES, BACKSPACE, BASELINE, BEVEL, BEZIER, BLEND, BLUR, BOLD, BOLDITALIC global BOTTOM, BURN, CENTER, CHORD, CLAMP, CLOSE, CONTROL, CORNER, CORNERS, CROSS, CURVE, DARKEST global DEG_TO_RAD, DEGREES, DELETE, DIFFERENCE, DILATE, DODGE, DOWN_ARROW, ENTER, ERODE, ESCAPE, EXCLUSION global FILL, GRAY, GRID, HALF_PI, HAND, HARD_LIGHT, HSB, HSL, IMAGE, IMMEDIATE, INVERT, ITALIC, LANDSCAPE global LEFT, LEFT_ARROW, LIGHTEST, LINE_LOOP, LINE_STRIP, LINEAR, LINES, MIRROR, MITER, MOVE, MULTIPLY, NEAREST global NORMAL, OPAQUE, OPEN, OPTION, OVERLAY, P2D, P3D, PI, PIE, POINTS, PORTRAIT, POSTERIZE, PROJECT, QUAD_STRIP global QUADRATIC, QUADS, QUARTER_PI, RAD_TO_DEG, RADIANS, RADIUS, REPEAT, REPLACE, RETURN, RGB, RIGHT, RIGHT_ARROW global ROUND, SCREEN, SHIFT, SOFT_LIGHT, SQUARE, STROKE, SUBTRACT, TAB, TAU, TEXT, TEXTURE, THRESHOLD, TOP global TRIANGLE_FAN, TRIANGLE_STRIP, TRIANGLES, TWO_PI, UP_ARROW, VIDEO, WAIT, WEBGL global frameCount, focused, displayWidth, displayHeight, windowWidth, windowHeight, width, height global deviceOrientation, accelerationX, accelerationY, accelerationZ global pAccelerationX, pAccelerationY, pAccelerationZ, rotationX, rotationY, rotationZ global pRotationX, pRotationY, pRotationZ, turnAxis, keyIsPressed, key, keyCode, mouseX, mouseY, pmouseX, pmouseY global winMouseX, winMouseY, pwinMouseX, pwinMouseY, mouseButton, mouseIsPressed, touches, pixels _CTX_MIDDLE = p5_instance._CTX_MIDDLE _DEFAULT_FILL = p5_instance._DEFAULT_FILL _DEFAULT_LEADMULT = p5_instance._DEFAULT_LEADMULT _DEFAULT_STROKE = p5_instance._DEFAULT_STROKE _DEFAULT_TEXT_FILL = p5_instance._DEFAULT_TEXT_FILL ADD = p5_instance.ADD ALT = p5_instance.ALT ARROW = p5_instance.ARROW AUDIO = p5_instance.AUDIO AUTO = p5_instance.AUTO AXES = p5_instance.AXES BACKSPACE = p5_instance.BACKSPACE BASELINE = p5_instance.BASELINE BEVEL = p5_instance.BEVEL BEZIER = p5_instance.BEZIER BLEND = p5_instance.BLEND BLUR = p5_instance.BLUR BOLD = p5_instance.BOLD BOLDITALIC = p5_instance.BOLDITALIC BOTTOM = p5_instance.BOTTOM BURN = p5_instance.BURN CENTER = p5_instance.CENTER CHORD = p5_instance.CHORD CLAMP = p5_instance.CLAMP CLOSE = p5_instance.CLOSE CONTROL = p5_instance.CONTROL CORNER = p5_instance.CORNER CORNERS = p5_instance.CORNERS CROSS = p5_instance.CROSS CURVE = p5_instance.CURVE DARKEST = p5_instance.DARKEST DEG_TO_RAD = p5_instance.DEG_TO_RAD DEGREES = p5_instance.DEGREES DELETE = p5_instance.DELETE DIFFERENCE = p5_instance.DIFFERENCE DILATE = p5_instance.DILATE DODGE = p5_instance.DODGE DOWN_ARROW = p5_instance.DOWN_ARROW ENTER = p5_instance.ENTER ERODE = p5_instance.ERODE ESCAPE = p5_instance.ESCAPE EXCLUSION = p5_instance.EXCLUSION FILL = p5_instance.FILL GRAY = p5_instance.GRAY GRID = p5_instance.GRID HALF_PI = p5_instance.HALF_PI HAND = p5_instance.HAND HARD_LIGHT = p5_instance.HARD_LIGHT HSB = p5_instance.HSB HSL = p5_instance.HSL IMAGE = p5_instance.IMAGE IMMEDIATE = p5_instance.IMMEDIATE INVERT = p5_instance.INVERT ITALIC = p5_instance.ITALIC LANDSCAPE = p5_instance.LANDSCAPE LEFT = p5_instance.LEFT LEFT_ARROW = p5_instance.LEFT_ARROW LIGHTEST = p5_instance.LIGHTEST LINE_LOOP = p5_instance.LINE_LOOP LINE_STRIP = p5_instance.LINE_STRIP LINEAR = p5_instance.LINEAR LINES = p5_instance.LINES MIRROR = p5_instance.MIRROR MITER = p5_instance.MITER MOVE = p5_instance.MOVE MULTIPLY = p5_instance.MULTIPLY NEAREST = p5_instance.NEAREST NORMAL = p5_instance.NORMAL OPAQUE = p5_instance.OPAQUE OPEN = p5_instance.OPEN OPTION = p5_instance.OPTION OVERLAY = p5_instance.OVERLAY P2D = p5_instance.P2D P3D = p5_instance.WEBGL PI = p5_instance.PI PIE = p5_instance.PIE POINTS = p5_instance.POINTS PORTRAIT = p5_instance.PORTRAIT POSTERIZE = p5_instance.POSTERIZE PROJECT = p5_instance.PROJECT QUAD_STRIP = p5_instance.QUAD_STRIP QUADRATIC = p5_instance.QUADRATIC QUADS = p5_instance.QUADS QUARTER_PI = p5_instance.QUARTER_PI RAD_TO_DEG = p5_instance.RAD_TO_DEG RADIANS = p5_instance.RADIANS RADIUS = p5_instance.RADIUS REPEAT = p5_instance.REPEAT REPLACE = p5_instance.REPLACE RETURN = p5_instance.RETURN RGB = p5_instance.RGB RIGHT = p5_instance.RIGHT RIGHT_ARROW = p5_instance.RIGHT_ARROW ROUND = p5_instance.ROUND SCREEN = p5_instance.SCREEN SHIFT = p5_instance.SHIFT SOFT_LIGHT = p5_instance.SOFT_LIGHT SQUARE = p5_instance.SQUARE STROKE = p5_instance.STROKE SUBTRACT = p5_instance.SUBTRACT TAB = p5_instance.TAB TAU = p5_instance.TAU TEXT = p5_instance.TEXT TEXTURE = p5_instance.TEXTURE THRESHOLD = p5_instance.THRESHOLD TOP = p5_instance.TOP TRIANGLE_FAN = p5_instance.TRIANGLE_FAN TRIANGLE_STRIP = p5_instance.TRIANGLE_STRIP TRIANGLES = p5_instance.TRIANGLES TWO_PI = p5_instance.TWO_PI UP_ARROW = p5_instance.UP_ARROW VIDEO = p5_instance.VIDEO WAIT = p5_instance.WAIT WEBGL = p5_instance.WEBGL frameCount = p5_instance.frameCount focused = p5_instance.focused displayWidth = p5_instance.displayWidth displayHeight = p5_instance.displayHeight windowWidth = p5_instance.windowWidth windowHeight = p5_instance.windowHeight width = p5_instance.width height = p5_instance.height deviceOrientation = p5_instance.deviceOrientation accelerationX = p5_instance.accelerationX accelerationY = p5_instance.accelerationY accelerationZ = p5_instance.accelerationZ pAccelerationX = p5_instance.pAccelerationX pAccelerationY = p5_instance.pAccelerationY pAccelerationZ = p5_instance.pAccelerationZ rotationX = p5_instance.rotationX rotationY = p5_instance.rotationY rotationZ = p5_instance.rotationZ pRotationX = p5_instance.pRotationX pRotationY = p5_instance.pRotationY pRotationZ = p5_instance.pRotationZ turnAxis = p5_instance.turnAxis keyIsPressed = p5_instance.keyIsPressed key = p5_instance.key keyCode = p5_instance.keyCode mouseX = p5_instance.mouseX mouseY = p5_instance.mouseY pmouseX = p5_instance.pmouseX pmouseY = p5_instance.pmouseY winMouseX = p5_instance.winMouseX winMouseY = p5_instance.winMouseY pwinMouseX = p5_instance.pwinMouseX pwinMouseY = p5_instance.pwinMouseY mouseButton = p5_instance.mouseButton mouseIsPressed = p5_instance.mouseIsPressed touches = p5_instance.touches pixels = p5_instance.pixels return draw_func(*args, **kwargs) def global_p5_injection(p5_sketch): """ Injects the p5js's skecth instance as a global variable to setup and draw functions """ def decorator(f, *args, **kwargs): def wrapper(*args, **kwargs): global _P5_INSTANCE _P5_INSTANCE = p5_sketch return pre_draw(_P5_INSTANCE, f, *args, **kwargs) return wrapper return decorator def start_p5(preload_func, setup_func, draw_func, event_functions): """ This is the entrypoint function. It accepts 2 parameters: - preload_func: A Python preload callable - setup_func: a Python setup callable - draw_func: a Python draw callable - event_functions: a config dict for the event functions in the format: {"eventFunctionName": python_event_function} This method gets the p5js's sketch instance and injects them """ def sketch_setup(p5_sketch): """ Callback function called to configure new p5 instance """ p5_sketch.preload = global_p5_injection(p5_sketch)(preload_func) p5_sketch.setup = global_p5_injection(p5_sketch)(setup_func) p5_sketch.draw = global_p5_injection(p5_sketch)(draw_func) window.instance = p5.new(sketch_setup, 'sketch-holder') # Register event functions event_function_names = ( "deviceMoved", "deviceTurned", "deviceShaken", "windowResized", "keyPressed", "keyReleased", "keyTyped", "mousePressed", "mouseReleased", "mouseClicked", "doubleClicked", "mouseMoved", "mouseDragged", "mouseWheel", "touchStarted", "touchMoved", "touchEnded", "keyIsDown", ) for f_name in [f for f in event_function_names if event_functions.get(f, None)]: func = event_functions[f_name] event_func = global_p5_injection(window.instance)(func) setattr(window.instance, f_name, event_func) `; const placeholder = ` def preload(): pass def setup(): pass def draw(): pass deviceMoved = None deviceTurned = None deviceShaken = None keyPressed = None keyReleased = None keyTyped = None mouseMoved = None mouseDragged = None mousePressed = None mouseReleased = None mouseClicked = None doubleClicked = None mouseWheel = None touchStarted = None touchMoved = None touchEnded = None windowResized = None `; let userCode = ` # Made for https://berinhard.github.io/pyp5js/pyodide/ def setup(): size(500, 500) test() def test(): """ Mostly from JDF py.processing tests """ a = PVector() assert a.x == 0 assert a.y == 0 assert a.z == 0 a = PVector(5, 7, 11) b = PVector(13, 17, 23) assert a - b == PVector(-8.0, -10.0, -12.0) assert b - a == PVector(8, 10, 12) c = PVector(18, 24, 34) assert b + a == c assert a + b == c assert PVector.add(a, b) == c assert PVector.add(a, b) == c a.add(b) assert a == c a.add(b) assert a == PVector(31.0, 41.0, 57.0) c = PVector(310.0, 410.0, 570.0) assert a * 10 == c assert a * 10 == c assert PVector.mult(a, 10) == c assert PVector.mult(a, 10) == c a.mult(10) assert a == c assert int(1000 * PVector.dist(a, b)) == 736116 assert PVector.cross(a, b) == PVector(-260.0, 280.0, -60.0) assert a.cross(b) == PVector(-260.0, 280.0, -60.0) assert PVector.dot(a, b) == 0 d = a.get() d += b assert d == a + b d = a.get() d -= c assert d == a - c d = a.get() d *= 5.0 assert d == a * 5.0 d = a.get() d /= 5.0 assert d == a / 5.0 assert b * 5 == b * 5.0 assert b / 5 == b / 5.0 d = b.get() d *= 391 assert d == b * 391.0 d = b.get() d /= 10203 assert d == b / 10203.0 d = a.get() d += a + a assert d == a + a + a assert a * 57.0 == 57.0 * a assert (a / 5.0) == (1.0 / 5.0) * a m, n = b, c a += b * 5 - c / 2 + PVector(0, 1, 2) assert (m, n) == (b, c) import copy x = [a, b] y = copy.deepcopy(x) assert x == y x[0].sub(PVector(100, 100, 100)) assert x != y a = PVector(1, 1) b = PVector(-2, -2) assert a < b assert a <= b assert b > a assert b >= a a = PVector(1, 2, 3) b = PVector(3, 2, 1) assert a != b assert a >= b assert b >= a assert a.magSq() == b.magSq() v1 = PVector(10, 20) v2 = PVector(60, 80) a = PVector.angleBetween(v1, v2) # Java implementation gives slightly different value: # assert a == 0.17985349893569946 # more or less assert int(a * 1e8) == 17985349 # more or less # Regression test for https://github.com/jdf/Processing.py-Bugs/issues/67 assert isinstance(PVector(1, 2), PVector) # Regression test for https://github.com/jdf/Processing.py-Bugs/issues/101 v = PVector(10, 20, 0) d = v.dot(60, 80, 0) assert d == 2200.0 v2 = PVector(60, 80, 0) d = v.dot(v2) assert d == 2200.0 # PVector.add w/multiple arguments v = PVector(40, 20, 0) v.add(25, 50, 0) assert (v.x, v.y, v.z) == (65, 70, 0) # PVector.sub w/multiple arguments v = PVector(40, 20, 0) v.sub(25, 50, 0) assert (v.x, v.y, v.z) == (15, -30, 0) # Regression test for https://github.com/jdf/Processing.py-Bugs/issues/102 start = PVector(0.0, 0.0) end = PVector(100.0, 100.0) middle = PVector.lerp(start, end, 0.5) assert middle == PVector(50.0, 50.0) assert start == PVector(0, 0) start.lerp(end, .75) assert start == PVector(75, 75) assert end == PVector(100.0, 100.0) end.lerp(200, 200, 0, .5) assert end == PVector(150.0, 150.0) # test that instance op returns self a = PVector(3, 5, 7) b = a * 10 assert a.mult(10) == b # test that a vector can do arithmetic with a tuple assert PVector(1, 2, 3) == (1, 2, 3) assert (PVector(1, 2, 3) + (3, 3, 3)) == (4, 5, 6) assert (PVector(5, 5, 5) - (1, 2, 3)) == (4, 3, 2) # Regression test for https://github.com/jdf/processing.py/issues/317 r = PVector.random2D() * 10 assert -10 <= r.x <= 10 assert -10 <= r.y <= 10 assert r.z == 0 PVector.random3D(r) r += (1, 1, 1) assert 0 <= r.x <= 2 assert 0 <= r.y <= 2 assert 0 <= r.z <= 2 # Regression test for https://github.com/jdf/processing.py/issues/334 r = PVector.fromAngle(0) * 10 assert r.x == 10 assert r.y == 0 assert r.z == 0 # Other p5js methods text(r.toString(), 120, 120) r.setMag(100) assert r.mag() == 100 r.normalize() assert r.mag() == 1 r.limit(10) assert r.mag() == 1 r.limit(0.1) assert r.mag() == 0.1 assert r.heading() == 0 r.rotate(PI) assert r.heading() == PI text('OK - ALL PASSED!', 100, 200) `; const startCode = ` event_functions = { "deviceMoved": deviceMoved, "deviceTurned": deviceTurned, "deviceShaken": deviceShaken, "keyPressed": keyPressed, "keyReleased": keyReleased, "keyTyped": keyTyped, "mouseMoved": mouseMoved, "mouseDragged": mouseDragged, "mousePressed": mousePressed, "mouseReleased": mouseReleased, "mouseClicked": mouseClicked, "doubleClicked": doubleClicked, "mouseWheel": mouseWheel, "touchStarted": touchStarted, "touchMoved": touchMoved, "touchEnded": touchEnded, "windowResized": windowResized, } start_p5(preload, setup, draw, event_functions) `; function runCode() { let code = [ placeholder, userCode, wrapperContent, startCode, ].join('\n'); if (window.instance) { window.instance.canvas.remove(); } console.log("Python execution output:"); window.pyodide.runPython(code); } async function main() { const config = { indexURL : "https://cdn.jsdelivr.net/pyodide/v0.18.1/full/", fullStdLib: false, } window.pyodide = await loadPyodide(config); // Pyodide is now ready to use... console.log(window.pyodide.runPython(` import io, code, sys from js import p5, window, document print(sys.version) `)); window.runSketchCode = (code) => { userCode = code; runCode(); } runCode(); }; // async method main(); ================================================ FILE: docs/examples/pyodide/sketch_012/index.html ================================================ sketch_012 - pyp5js

Python code here.

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
@author: A.Akdogan
"""
from random import randint
import os
import sys 
import time
from time import sleep
print(sys.path)

class Node:

    def __init__(self, x, y):

        self.x = x 
        self.y = y
        self.f = 0
        self.g = 0
        self.h = 0
        self.neighbors = []
        self.previous = None
        self. obstacle = False


    def add_neighbors(self,grid, columns, rows):

        neighbor_x = self.x
        neighbor_y = self.y
    
        if neighbor_x < columns - 1:
            self.neighbors.append(grid[neighbor_x+1][neighbor_y])
        if neighbor_x > 0:
            self.neighbors.append(grid[neighbor_x-1][neighbor_y])
        if neighbor_y < rows -1:
            self.neighbors.append(grid[neighbor_x][neighbor_y +1])
        if neighbor_y > 0: 
            self.neighbors.append(grid[neighbor_x][neighbor_y-1])
        #diagonals
        """ if neighbor_x > 0 and neighbor_y > 0:
            self.neighbors.append(grid[neighbor_x-1][neighbor_y-1])
        if neighbor_x < columns -1 and neighbor_y > 0:
            self.neighbors.append(grid[neighbor_x+1][neighbor_y-1])
        if neighbor_x > 0 and neighbor_y  0:
            open_set, closed_set, current_node, final_path = AStar.start_path(open_set, closed_set, current_node, self.end)
            if len(final_path) > 0:
                break

        return final_path


cols = 25
rows = 25 
start = [0,0]
end = [24,24]
open_set  = []
closed_set  = []
current_node = None
final_path  = []
grid = []


def show_func(grid_element,color, width,height): 
    if grid_element.obstacle == True:
            fill("black")
    else:
        fill(color)
    noStroke()
    rect(grid_element.x * width, grid_element.y * height, width-1 , height-1)


def setup():
    global grid
    createCanvas(500, 500)
    background(160)

        
    
flag = False   


def draw():
    
    global grid
    global end
    global open_set
    global closed_set
    global final_path
    global current_node
    global flag
    global start

    global cols 
    global rows 
  
    frameRate(60)
    w = width / cols
    h = height / rows
    if flag == False:
        
 

        grid = AStar.create_grid(cols, rows)   
        grid = AStar.fill_grids(grid, cols, rows, obstacle_ratio = 30)
        grid = AStar.get_neighbors(grid, cols, rows)
        start = grid[start[0]][start[1]]
        end = grid[end[0]][end[1]]
        end.obstacle = False
        start.obstacle = False

        background(0)
        for i in range(cols):
            for j in range(rows):
                show_func(grid[i][j], color(255),w,h)
        stroke(0,0,0)
        line(0, 0, 0, width)
        line(0,0,height, 1)
        open_set.append(start)

        
        flag = True

    if len(open_set) > 0:
        open_set, closed_set, current_node, final_path = AStar.start_path(open_set, closed_set, current_node, end)

    
    #grid
        show_func(start, "green", w,h)
        show_func(end, "red",w,h)
        for i in range(len(open_set)):
            #show_func(open_set[i], "#00ffbf",w,h)
            show_func(open_set[i], "#00ffbf",w,h)

        for i in range(len(closed_set)):
            show_func(closed_set[i], "#ffa500",w,h)
            show_func(start, "green", w,h)

        show_func(current_node, "#8a2be2",w,h)

        if len(open_set) == 0:
            print("No way!")
            #noLoop()
    
            frameRate(1)
            cols = 25
            rows = 25 
            start = [0,0]
            end = [24,24]
            open_set  = []
            closed_set  = []
            current_node = None
            final_path  = []
            grid = []
            flag = False
            

        if len(final_path) > 0:
            for i in range(len(final_path)):
                show_func(final_path[i], "#8a2be2",w,h)
                #show_func(final_path[i], "red",w,h)
            show_func(start, "green", w,h)
            show_func(end, "red",w,h)

            print("Done!!")
            frameRate(1)
            cols = 25
            rows = 25 
            start = [0,0]
            end = [24,24]
            open_set  = []
            closed_set  = []
            current_node = None
            final_path  = []
            grid = []
            flag = False
            
   
            
================================================ FILE: docs/examples/pyodide/sketch_012/sketch_012.py ================================================ #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ @author: A.Akdogan """ from random import randint import os import sys import time from time import sleep print(sys.path) class Node: def __init__(self, x, y): self.x = x self.y = y self.f = 0 self.g = 0 self.h = 0 self.neighbors = [] self.previous = None self. obstacle = False def add_neighbors(self,grid, columns, rows): neighbor_x = self.x neighbor_y = self.y if neighbor_x < columns - 1: self.neighbors.append(grid[neighbor_x+1][neighbor_y]) if neighbor_x > 0: self.neighbors.append(grid[neighbor_x-1][neighbor_y]) if neighbor_y < rows -1: self.neighbors.append(grid[neighbor_x][neighbor_y +1]) if neighbor_y > 0: self.neighbors.append(grid[neighbor_x][neighbor_y-1]) #diagonals """ if neighbor_x > 0 and neighbor_y > 0: self.neighbors.append(grid[neighbor_x-1][neighbor_y-1]) if neighbor_x < columns -1 and neighbor_y > 0: self.neighbors.append(grid[neighbor_x+1][neighbor_y-1]) if neighbor_x > 0 and neighbor_y 0: open_set, closed_set, current_node, final_path = AStar.start_path(open_set, closed_set, current_node, self.end) if len(final_path) > 0: break return final_path cols = 25 rows = 25 start = [0,0] end = [24,24] open_set = [] closed_set = [] current_node = None final_path = [] grid = [] def show_func(grid_element,color, width,height): if grid_element.obstacle == True: fill("black") else: fill(color) noStroke() rect(grid_element.x * width, grid_element.y * height, width-1 , height-1) def setup(): global grid createCanvas(500, 500) background(160) flag = False def draw(): global grid global end global open_set global closed_set global final_path global current_node global flag global start global cols global rows frameRate(60) w = width / cols h = height / rows if flag == False: grid = AStar.create_grid(cols, rows) grid = AStar.fill_grids(grid, cols, rows, obstacle_ratio = 30) grid = AStar.get_neighbors(grid, cols, rows) start = grid[start[0]][start[1]] end = grid[end[0]][end[1]] end.obstacle = False start.obstacle = False background(0) for i in range(cols): for j in range(rows): show_func(grid[i][j], color(255),w,h) stroke(0,0,0) line(0, 0, 0, width) line(0,0,height, 1) open_set.append(start) flag = True if len(open_set) > 0: open_set, closed_set, current_node, final_path = AStar.start_path(open_set, closed_set, current_node, end) #grid show_func(start, "green", w,h) show_func(end, "red",w,h) for i in range(len(open_set)): #show_func(open_set[i], "#00ffbf",w,h) show_func(open_set[i], "#00ffbf",w,h) for i in range(len(closed_set)): show_func(closed_set[i], "#ffa500",w,h) show_func(start, "green", w,h) show_func(current_node, "#8a2be2",w,h) if len(open_set) == 0: print("No way!") #noLoop() frameRate(1) cols = 25 rows = 25 start = [0,0] end = [24,24] open_set = [] closed_set = [] current_node = None final_path = [] grid = [] flag = False if len(final_path) > 0: for i in range(len(final_path)): show_func(final_path[i], "#8a2be2",w,h) #show_func(final_path[i], "red",w,h) show_func(start, "green", w,h) show_func(end, "red",w,h) print("Done!!") frameRate(1) cols = 25 rows = 25 start = [0,0] end = [24,24] open_set = [] closed_set = [] current_node = None final_path = [] grid = [] flag = False ================================================ FILE: docs/examples/pyodide/sketch_012/static/p5.js ================================================ /*! p5.js v1.0.0 February 29, 2020 */ !function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).p5=e()}}(function(){return function o(a,s,l){function u(t,e){if(!s[t]){if(!a[t]){var r="function"==typeof require&&require;if(!e&&r)return r(t,!0);if(h)return h(t,!0);var i=new Error("Cannot find module '"+t+"'");throw i.code="MODULE_NOT_FOUND",i}var n=s[t]={exports:{}};a[t][0].call(n.exports,function(e){return u(a[t][1][e]||e)},n,n.exports,o,a,s,l)}return s[t].exports}for(var h="function"==typeof require&&require,e=0;e>16&255,a[s++]=t>>8&255,a[s++]=255&t;2===o&&(t=u[e.charCodeAt(r)]<<2|u[e.charCodeAt(r+1)]>>4,a[s++]=255&t);1===o&&(t=u[e.charCodeAt(r)]<<10|u[e.charCodeAt(r+1)]<<4|u[e.charCodeAt(r+2)]>>2,a[s++]=t>>8&255,a[s++]=255&t);return a},r.fromByteArray=function(e){for(var t,r=e.length,i=r%3,n=[],o=0,a=r-i;o>2]+s[t<<4&63]+"==")):2==i&&(t=(e[r-2]<<8)+e[r-1],n.push(s[t>>10]+s[t>>4&63]+s[t<<2&63]+"="));return n.join("")};for(var s=[],u=[],h="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=0,o=i.length;n>18&63]+s[n>>12&63]+s[n>>6&63]+s[63&n]);return o.join("")}u["-".charCodeAt(0)]=62,u["_".charCodeAt(0)]=63},{}],20:[function(e,t,r){},{}],21:[function(N,e,F){(function(c){"use strict";var i=N("base64-js"),o=N("ieee754"),e="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;F.Buffer=c,F.SlowBuffer=function(e){+e!=e&&(e=0);return c.alloc(+e)},F.INSPECT_MAX_BYTES=50;var r=2147483647;function a(e){if(r>>1;case"base64":return O(e).length;default:if(n)return i?-1:R(e).length;t=(""+t).toLowerCase(),n=!0}}function d(e,t,r){var i=e[t];e[t]=e[r],e[r]=i}function p(e,t,r,i,n){if(0===e.length)return-1;if("string"==typeof r?(i=r,r=0):2147483647=e.length){if(n)return-1;r=e.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof t&&(t=c.from(t,i)),c.isBuffer(t))return 0===t.length?-1:m(e,t,r,i,n);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):m(e,[t],r,i,n);throw new TypeError("val must be string, number or Buffer")}function m(e,t,r,i,n){var o,a=1,s=e.length,l=t.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(e.length<2||t.length<2)return-1;s/=a=2,l/=2,r/=2}function u(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(n){var h=-1;for(o=r;o>8,n=r%256,o.push(n),o.push(i);return o}(t,e.length-r),e,r,i)}function b(e,t,r){return 0===t&&r===e.length?i.fromByteArray(e):i.fromByteArray(e.slice(t,r))}function _(e,t,r){r=Math.min(e.length,r);for(var i=[],n=t;n>>10&1023|55296),h=56320|1023&h),i.push(h),n+=c}return function(e){var t=e.length;if(t<=x)return String.fromCharCode.apply(String,e);var r="",i=0;for(;ithis.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e=e||"utf8";;)switch(e){case"hex":return M(this,t,r);case"utf8":case"utf-8":return _(this,t,r);case"ascii":return w(this,t,r);case"latin1":case"binary":return S(this,t,r);case"base64":return b(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,t,r);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}.apply(this,arguments)},c.prototype.equals=function(e){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===c.compare(this,e)},c.prototype.inspect=function(){var e="",t=F.INSPECT_MAX_BYTES;return e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(e+=" ... "),""},e&&(c.prototype[e]=c.prototype.inspect),c.prototype.compare=function(e,t,r,i,n){if(A(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),t<0||r>e.length||i<0||n>this.length)throw new RangeError("out of range index");if(n<=i&&r<=t)return 0;if(n<=i)return-1;if(r<=t)return 1;if(this===e)return 0;for(var o=(n>>>=0)-(i>>>=0),a=(r>>>=0)-(t>>>=0),s=Math.min(o,a),l=this.slice(i,n),u=e.slice(t,r),h=0;h>>=0,isFinite(r)?(r>>>=0,void 0===i&&(i="utf8")):(i=r,r=void 0)}var n=this.length-t;if((void 0===r||nthis.length)throw new RangeError("Attempt to write outside buffer bounds");i=i||"utf8";for(var o,a,s,l,u,h,c=!1;;)switch(i){case"hex":return g(this,e,t,r);case"utf8":case"utf-8":return u=t,h=r,D(R(e,(l=this).length-u),l,u,h);case"ascii":return v(this,e,t,r);case"latin1":case"binary":return v(this,e,t,r);case"base64":return o=this,a=t,s=r,D(O(e),o,a,s);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return y(this,e,t,r);default:if(c)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),c=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var x=4096;function w(e,t,r){var i="";r=Math.min(e.length,r);for(var n=t;ne.length)throw new RangeError("Index out of range")}function P(e,t,r,i){if(r+i>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function L(e,t,r,i,n){return t=+t,r>>>=0,n||P(e,0,r,4),o.write(e,t,r,i,23,4),r+4}function k(e,t,r,i,n){return t=+t,r>>>=0,n||P(e,0,r,8),o.write(e,t,r,i,52,8),r+8}c.prototype.slice=function(e,t){var r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):r>>=0,t>>>=0,r||T(e,t,this.length);for(var i=this[e],n=1,o=0;++o>>=0,t>>>=0,r||T(e,t,this.length);for(var i=this[e+--t],n=1;0>>=0,t||T(e,1,this.length),this[e]},c.prototype.readUInt16LE=function(e,t){return e>>>=0,t||T(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUInt16BE=function(e,t){return e>>>=0,t||T(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUInt32LE=function(e,t){return e>>>=0,t||T(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUInt32BE=function(e,t){return e>>>=0,t||T(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||T(e,t,this.length);for(var i=this[e],n=1,o=0;++o>>=0,t>>>=0,r||T(e,t,this.length);for(var i=t,n=1,o=this[e+--i];0>>=0,t||T(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){e>>>=0,t||T(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(e,t){e>>>=0,t||T(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(e,t){return e>>>=0,t||T(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return e>>>=0,t||T(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readFloatLE=function(e,t){return e>>>=0,t||T(e,4,this.length),o.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return e>>>=0,t||T(e,4,this.length),o.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return e>>>=0,t||T(e,8,this.length),o.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return e>>>=0,t||T(e,8,this.length),o.read(this,e,!1,52,8)},c.prototype.writeUIntLE=function(e,t,r,i){e=+e,t>>>=0,r>>>=0,i||C(this,e,t,r,Math.pow(2,8*r)-1,0);var n=1,o=0;for(this[t]=255&e;++o>>=0,r>>>=0,i||C(this,e,t,r,Math.pow(2,8*r)-1,0);var n=r-1,o=1;for(this[t+n]=255&e;0<=--n&&(o*=256);)this[t+n]=e/o&255;return t+r},c.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,1,255,0),this[t]=255&e,t+1},c.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},c.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeIntLE=function(e,t,r,i){if(e=+e,t>>>=0,!i){var n=Math.pow(2,8*r-1);C(this,e,t,r,n-1,-n)}var o=0,a=1,s=0;for(this[t]=255&e;++o>0)-s&255;return t+r},c.prototype.writeIntBE=function(e,t,r,i){if(e=+e,t>>>=0,!i){var n=Math.pow(2,8*r-1);C(this,e,t,r,n-1,-n)}var o=r-1,a=1,s=0;for(this[t+o]=255&e;0<=--o&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+r},c.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},c.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeFloatLE=function(e,t,r){return L(this,e,t,!0,r)},c.prototype.writeFloatBE=function(e,t,r){return L(this,e,t,!1,r)},c.prototype.writeDoubleLE=function(e,t,r){return k(this,e,t,!0,r)},c.prototype.writeDoubleBE=function(e,t,r){return k(this,e,t,!1,r)},c.prototype.copy=function(e,t,r,i){if(!c.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r=r||0,i||0===i||(i=this.length),t>=e.length&&(t=e.length),t=t||0,0=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t>>=0,r=void 0===r?this.length:r>>>0,"number"==typeof(e=e||0))for(o=t;o>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function O(e){return i.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(t,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function D(e,t,r,i){for(var n=0;n=t.length||n>=e.length);++n)t[n+r]=e[n];return n}function A(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function I(e){return e!=e}var U=function(){for(var e="0123456789abcdef",t=new Array(256),r=0;r<16;++r)for(var i=16*r,n=0;n<16;++n)t[i+n]=e[r]+e[n];return t}()}).call(this,N("buffer").Buffer)},{"base64-js":19,buffer:21,ieee754:30}],22:[function(e,t,r){"use strict";t.exports=e("./").polyfill()},{"./":23}],23:[function(z,r,i){(function(j,V){var e,t;e=this,t=function(){"use strict";function l(e){return"function"==typeof e}var r=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},i=0,t=void 0,n=void 0,a=function(e,t){f[i]=e,f[i+1]=t,2===(i+=2)&&(n?n(d):y())};var e="undefined"!=typeof window?window:void 0,o=e||{},s=o.MutationObserver||o.WebKitMutationObserver,u="undefined"==typeof self&&void 0!==j&&"[object process]"==={}.toString.call(j),h="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function c(){var e=setTimeout;return function(){return e(d,1)}}var f=new Array(1e3);function d(){for(var e=0;e":">",'"':""","'":"'","/":"/"};function S(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,function(e){return w[e]}):e}var M=function(){function i(e){var t,r=1=this.maxReplaces)break}for(a=0;r=this.regexp.exec(e);){if(void 0===(i=h(r[1].trim())))if("function"==typeof c){var d=c(e,r,t);i="string"==typeof d?d:""}else this.logger.warn("missed to pass in variable ".concat(r[1]," for interpolating ").concat(e)),i="";else"string"==typeof i||this.useRawValueToEscape||(i=v(i));if(i=this.escapeValue?u(this.escape(i)):u(i),e=e.replace(r[0],i),this.regexp.lastIndex=0,++a>=this.maxReplaces)break}return e}},{key:"nest",value:function(e,t,r){var i,n,o=D({},2>1,h=-7,c=r?n-1:0,f=r?-1:1,d=e[t+c];for(c+=f,o=d&(1<<-h)-1,d>>=-h,h+=s;0>=-h,h+=i;0>1,f=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,d=i?0:o-1,p=i?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=h):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),2<=(t+=1<=a+c?f/l:f*Math.pow(2,1-c))*l&&(a++,l/=2),h<=a+c?(s=0,a=h):1<=a+c?(s=(t*l-1)*Math.pow(2,n),a+=c):(s=t*Math.pow(2,c-1)*Math.pow(2,n),a=0));8<=n;e[r+d]=255&s,d+=p,s/=256,n-=8);for(a=a<Math.abs(e[0])&&(t=1),Math.abs(e[2])>Math.abs(e[t])&&(t=2),t}var C=4e150;function P(e,t){e.f+=t.f,e.b.f+=t.b.f}function u(e,t,r){return e=e.a,t=t.a,r=r.a,t.b.a===e?r.b.a===e?v(t.a,r.a)?b(r.b.a,t.a,r.a)<=0:0<=b(t.b.a,r.a,t.a):b(r.b.a,e,r.a)<=0:r.b.a===e?0<=b(t.b.a,e,t.a):(t=y(t.b.a,e,t.a),(e=y(r.b.a,e,r.a))<=t)}function L(e){e.a.i=null;var t=e.e;t.a.c=t.c,t.c.a=t.a,e.e=null}function h(e,t){c(e.a),e.c=!1,(e.a=t).i=e}function k(e){for(var t=e.a.a;(e=fe(e)).a.a===t;);return e.c&&(h(e,t=f(ce(e).a.b,e.a.e)),e=fe(e)),e}function R(e,t,r){var i=new he;return i.a=r,i.e=W(e.f,t.e,i),r.i=i}function O(e,t){switch(e.s){case 100130:return 0!=(1&t);case 100131:return 0!==t;case 100132:return 0>1]],s[a[u]])?le(r,u):ue(r,u)),s[o]=null,l[o]=r.b,r.b=o}else for(r.c[-(o+1)]=null;0Math.max(a.a,l.a))return!1;if(v(o,a)){if(0i.f&&(i.f*=2,i.c=oe(i.c,i.f+1)),0===i.b?r=n:(r=i.b,i.b=i.c[i.b]),i.e[r]=t,i.c[r]=n,i.d[n]=r,i.h&&ue(i,n),r}return i=e.a++,e.c[i]=t,-(i+1)}function ie(e){if(0===e.a)return se(e.b);var t=e.c[e.d[e.a-1]];if(0!==e.b.a&&v(ae(e.b),t))return se(e.b);for(;--e.a,0e.a||v(i[a],i[l])){n[r[o]=a]=o;break}n[r[o]=l]=o,o=s}}function ue(e,t){for(var r=e.d,i=e.e,n=e.c,o=t,a=r[o];;){var s=o>>1,l=r[s];if(0==s||v(i[l],i[a])){n[r[o]=a]=o;break}n[r[o]=l]=o,o=s}}function he(){this.e=this.a=null,this.f=0,this.c=this.b=this.h=this.d=!1}function ce(e){return e.e.c.b}function fe(e){return e.e.a.b}(i=q.prototype).x=function(){Y(this,0)},i.B=function(e,t){switch(e){case 100142:return;case 100140:switch(t){case 100130:case 100131:case 100132:case 100133:case 100134:return void(this.s=t)}break;case 100141:return void(this.m=!!t);default:return void Z(this,100900)}Z(this,100901)},i.y=function(e){switch(e){case 100142:return 0;case 100140:return this.s;case 100141:return this.m;default:Z(this,100900)}return!1},i.A=function(e,t,r){this.j[0]=e,this.j[1]=t,this.j[2]=r},i.z=function(e,t){var r=t||null;switch(e){case 100100:case 100106:this.h=r;break;case 100104:case 100110:this.l=r;break;case 100101:case 100107:this.k=r;break;case 100102:case 100108:this.i=r;break;case 100103:case 100109:this.p=r;break;case 100105:case 100111:this.o=r;break;case 100112:this.r=r;break;default:Z(this,100900)}},i.C=function(e,t){var r=!1,i=[0,0,0];Y(this,2);for(var n=0;n<3;++n){var o=e[n];o<-1e150&&(o=-1e150,r=!0),1e150n[u]&&(n[u]=h,a[u]=l)}if(l=0,n[1]-o[1]>n[0]-o[0]&&(l=1),n[2]-o[2]>n[l]-o[l]&&(l=2),o[l]>=n[l])i[0]=0,i[1]=0,i[2]=1;else{for(n=0,o=s[l],a=a[l],s=[0,0,0],o=[o.g[0]-a.g[0],o.g[1]-a.g[1],o.g[2]-a.g[2]],u=[0,0,0],l=r.e;l!==r;l=l.e)u[0]=l.g[0]-a.g[0],u[1]=l.g[1]-a.g[1],u[2]=l.g[2]-a.g[2],s[0]=o[1]*u[2]-o[2]*u[1],s[1]=o[2]*u[0]-o[0]*u[2],s[2]=o[0]*u[1]-o[1]*u[0],n<(h=s[0]*s[0]+s[1]*s[1]+s[2]*s[2])&&(n=h,i[0]=s[0],i[1]=s[1],i[2]=s[2]);n<=0&&(i[0]=i[1]=i[2]=0,i[T(o)]=1)}r=!0}for(s=T(i),l=this.b.c,n=(s+1)%3,a=(s+2)%3,s=0>=l,h-=l,g!=o){if(g==a)break;for(var v=g>8,++y;var _=b;if(i>=8;null!==m&&s<4096&&(p[s++]=m<<8|_,u+1<=s&&l<12&&(++l,u=u<<1|1)),m=g}else s=1+a,u=(1<<(l=n+1))-1,m=null}return f!==i&&console.log("Warning, gif stream shorter than expected."),r}try{r.GifWriter=function(v,e,t,r){var y=0,i=void 0===(r=void 0===r?{}:r).loop?null:r.loop,b=void 0===r.palette?null:r.palette;if(e<=0||t<=0||65535>=1;)++n;if(a=1<>8&255,v[y++]=255&t,v[y++]=t>>8&255,v[y++]=(null!==b?128:0)|n,v[y++]=o,v[y++]=0,null!==b)for(var s=0,l=b.length;s>16&255,v[y++]=u>>8&255,v[y++]=255&u}if(null!==i){if(i<0||65535>8&255,v[y++]=0}var x=!1;this.addFrame=function(e,t,r,i,n,o){if(!0===x&&(--y,x=!1),o=void 0===o?{}:o,e<0||t<0||65535>=1;)++u;l=1<>8&255,v[y++]=d,v[y++]=0),v[y++]=44,v[y++]=255&e,v[y++]=e>>8&255,v[y++]=255&t,v[y++]=t>>8&255,v[y++]=255&r,v[y++]=r>>8&255,v[y++]=255&i,v[y++]=i>>8&255,v[y++]=!0===a?128|u-1:0,!0===a)for(var p=0,m=s.length;p>16&255,v[y++]=g>>8&255,v[y++]=255&g}return y=function(t,r,e,i){t[r++]=e;var n=r++,o=1<>=8,h-=8,r===n+256&&(t[n]=255,n=r++)}function d(e){c|=e<>=8,h-=8,r===n+256&&(t[n]=255,n=r++);4096===l?(d(o),l=1+s,u=e+1,m={}):(1<>7,n=1<<1+(7&r);x[e++],x[e++];var o=null,a=null;i&&(o=e,e+=3*(a=n));var s=!0,l=[],u=0,h=null,c=0,f=null;for(this.width=w,this.height=t;s&&e>2&7,e++;break;case 254:for(;;){if(!(0<=(C=x[e++])))throw Error("Invalid block size");if(0===C)break;e+=C}break;default:throw new Error("Unknown graphic control label: 0x"+x[e-1].toString(16))}break;case 44:var p=x[e++]|x[e++]<<8,m=x[e++]|x[e++]<<8,g=x[e++]|x[e++]<<8,v=x[e++]|x[e++]<<8,y=x[e++],b=y>>6&1,_=1<<1+(7&y),S=o,M=a,E=!1;if(y>>7){E=!0;S=e,e+=3*(M=_)}var T=e;for(e++;;){var C;if(!(0<=(C=x[e++])))throw Error("Invalid block size");if(0===C)break;e+=C}l.push({x:p,y:m,width:g,height:v,has_local_palette:E,palette_offset:S,palette_size:M,data_offset:T,data_length:e-T,transparent_index:h,interlaced:!!b,delay:u,disposal:c});break;case 59:s=!1;break;default:throw new Error("Unknown gif block: 0x"+x[e-1].toString(16))}this.numFrames=function(){return l.length},this.loopCount=function(){return f},this.frameInfo=function(e){if(e<0||e>=l.length)throw new Error("Frame index out of range.");return l[e]},this.decodeAndBlitFrameBGRA=function(e,t){var r=this.frameInfo(e),i=r.width*r.height,n=new Uint8Array(i);P(x,r.data_offset,n,i);var o=r.palette_offset,a=r.transparent_index;null===a&&(a=256);var s=r.width,l=w-s,u=s,h=4*(r.y*w+r.x),c=4*((r.y+r.height)*w+r.x),f=h,d=4*l;!0===r.interlaced&&(d+=4*w*7);for(var p=8,m=0,g=n.length;m>=1)),v===a)f+=4;else{var y=x[o+3*v],b=x[o+3*v+1],_=x[o+3*v+2];t[f++]=_,t[f++]=b,t[f++]=y,t[f++]=255}--u}},this.decodeAndBlitFrameRGBA=function(e,t){var r=this.frameInfo(e),i=r.width*r.height,n=new Uint8Array(i);P(x,r.data_offset,n,i);var o=r.palette_offset,a=r.transparent_index;null===a&&(a=256);var s=r.width,l=w-s,u=s,h=4*(r.y*w+r.x),c=4*((r.y+r.height)*w+r.x),f=h,d=4*l;!0===r.interlaced&&(d+=4*w*7);for(var p=8,m=0,g=n.length;m>=1)),v===a)f+=4;else{var y=x[o+3*v],b=x[o+3*v+1],_=x[o+3*v+2];t[f++]=y,t[f++]=b,t[f++]=_,t[f++]=255}--u}}}}catch(e){}},{}],33:[function(jr,t,r){(function(Gr){var e;e=this,function(E){"use strict";function e(e){if(null==this)throw TypeError();var t=String(this),r=t.length,i=e?Number(e):0;if(i!=i&&(i=0),!(i<0||r<=i)){var n,o=t.charCodeAt(i);return 55296<=o&&o<=56319&&i+1>>=1,t}function _(e,t,r){if(!t)return r;for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<>>16-t;return e.tag>>>=t,e.bitcount-=t,i+r}function x(e,t){for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<>>=1,++n,r+=t.table[n],0<=(i-=t.table[n]););return e.tag=o,e.bitcount-=n,t.trans[r+i]}function w(e,t,r){var i,n,o,a,s,l;for(i=_(e,5,257),n=_(e,5,1),o=_(e,4,4),a=0;a<19;++a)g[a]=0;for(a=0;athis.x2&&(this.x2=e)),"number"==typeof t&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=t,this.y2=t),tthis.y2&&(this.y2=t))},C.prototype.addX=function(e){this.addPoint(e,null)},C.prototype.addY=function(e){this.addPoint(null,e)},C.prototype.addBezier=function(e,t,r,i,n,o,a,s){var l=this,u=[e,t],h=[r,i],c=[n,o],f=[a,s];this.addPoint(e,t),this.addPoint(a,s);for(var d=0;d<=1;d++){var p=6*u[d]-12*h[d]+6*c[d],m=-3*u[d]+9*h[d]-9*c[d]+3*f[d],g=3*h[d]-3*u[d];if(0!=m){var v=Math.pow(p,2)-4*g*m;if(!(v<0)){var y=(-p+Math.sqrt(v))/(2*m);0>8&255,255&e]},A.USHORT=U(2),D.SHORT=function(e){return 32768<=e&&(e=-(65536-e)),[e>>8&255,255&e]},A.SHORT=U(2),D.UINT24=function(e){return[e>>16&255,e>>8&255,255&e]},A.UINT24=U(3),D.ULONG=function(e){return[e>>24&255,e>>16&255,e>>8&255,255&e]},A.ULONG=U(4),D.LONG=function(e){return R<=e&&(e=-(2*R-e)),[e>>24&255,e>>16&255,e>>8&255,255&e]},A.LONG=U(4),D.FIXED=D.ULONG,A.FIXED=A.ULONG,D.FWORD=D.SHORT,A.FWORD=A.SHORT,D.UFWORD=D.USHORT,A.UFWORD=A.USHORT,D.LONGDATETIME=function(e){return[0,0,0,0,e>>24&255,e>>16&255,e>>8&255,255&e]},A.LONGDATETIME=U(8),D.TAG=function(e){return k.argument(4===e.length,"Tag should be exactly 4 ASCII characters."),[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]},A.TAG=U(4),D.Card8=D.BYTE,A.Card8=A.BYTE,D.Card16=D.USHORT,A.Card16=A.USHORT,D.OffSize=D.BYTE,A.OffSize=A.BYTE,D.SID=D.USHORT,A.SID=A.USHORT,D.NUMBER=function(e){return-107<=e&&e<=107?[e+139]:108<=e&&e<=1131?[247+((e-=108)>>8),255&e]:-1131<=e&&e<=-108?[251+((e=-e-108)>>8),255&e]:-32768<=e&&e<=32767?D.NUMBER16(e):D.NUMBER32(e)},A.NUMBER=function(e){return D.NUMBER(e).length},D.NUMBER16=function(e){return[28,e>>8&255,255&e]},A.NUMBER16=U(3),D.NUMBER32=function(e){return[29,e>>24&255,e>>16&255,e>>8&255,255&e]},A.NUMBER32=U(5),D.REAL=function(e){var t=e.toString(),r=/\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec(t);if(r){var i=parseFloat("1e"+((r[2]?+r[2]:0)+r[1].length));t=(Math.round(e*i)/i).toString()}for(var n="",o=0,a=t.length;o>8&255,t[t.length]=255&i}return t},A.UTF16=function(e){return 2*e.length};var N={"x-mac-croatian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈ƫȅ ÀÃÕŒœĐ—“”‘’÷◊©⁄€‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ","x-mac-cyrillic":"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю","x-mac-gaelic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØḂ±≤≥ḃĊċḊḋḞḟĠġṀæøṁṖṗɼƒſṠ«»… ÀÃÕŒœ–—“”‘’ṡẛÿŸṪ€‹›Ŷŷṫ·Ỳỳ⁊ÂÊÁËÈÍÎÏÌÓÔ♣ÒÚÛÙıÝýŴŵẄẅẀẁẂẃ","x-mac-greek":"Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦€ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ­","x-mac-icelandic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüݰ¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-inuit":"ᐃᐄᐅᐆᐊᐋᐱᐲᐳᐴᐸᐹᑉᑎᑏᑐᑑᑕᑖᑦᑭᑮᑯᑰᑲᑳᒃᒋᒌᒍᒎᒐᒑ°ᒡᒥᒦ•¶ᒧ®©™ᒨᒪᒫᒻᓂᓃᓄᓅᓇᓈᓐᓯᓰᓱᓲᓴᓵᔅᓕᓖᓗᓘᓚᓛᓪᔨᔩᔪᔫᔭ… ᔮᔾᕕᕖᕗ–—“”‘’ᕘᕙᕚᕝᕆᕇᕈᕉᕋᕌᕐᕿᖀᖁᖂᖃᖄᖅᖏᖐᖑᖒᖓᖔᖕᙱᙲᙳᙴᙵᙶᖖᖠᖡᖢᖣᖤᖥᖦᕼŁł","x-mac-ce":"ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ",macintosh:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-romanian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂȘ∞±≤≥¥µ∂∑∏π∫ªºΩăș¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›Țț‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-turkish":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙˆ˜¯˘˙˚¸˝˛ˇ"};O.MACSTRING=function(e,t,r,i){var n=N[i];if(void 0!==n){for(var o="",a=0;a>8&255,l+256&255)}return o}D.MACSTRING=function(e,t){var r=function(e){if(!F)for(var t in F={},N)F[t]=new String(t);var r=F[e];if(void 0!==r){if(B){var i=B.get(r);if(void 0!==i)return i}var n=N[e];if(void 0!==n){for(var o={},a=0;a>8,t[c+1]=255&f,t=t.concat(i[h])}return t},A.TABLE=function(e){for(var t=0,r=e.fields.length,i=0;i>1,t.skip("uShort",3),e.glyphIndexMap={};for(var a=new se.Parser(r,i+n+14),s=new se.Parser(r,i+n+16+2*o),l=new se.Parser(r,i+n+16+4*o),u=new se.Parser(r,i+n+16+6*o),h=i+n+16+8*o,c=0;c>4,o=15&i;if(15==n)break;if(t+=r[n],15==o)break;t+=r[o]}return parseFloat(t)}(e);if(32<=t&&t<=246)return t-139;if(247<=t&&t<=250)return 256*(t-247)+e.parseByte()+108;if(251<=t&&t<=254)return 256*-(t-251)-e.parseByte()-108;throw new Error("Invalid b0 "+t)}function Te(e,t,r){t=void 0!==t?t:0;var i=new se.Parser(e,t),n=[],o=[];for(r=void 0!==r?r:e.length;i.relativeOffset>1,T.length=0,P=!0}return function e(t){for(var r,i,n,o,a,s,l,u,h,c,f,d,p=0;pMath.abs(d-R)?k=f+T.shift():R=d+T.shift(),E.curveTo(y,b,_,x,l,u),E.curveTo(h,c,f,d,k,R);break;default:console.log("Glyph "+v.index+": unknown operator 1200"+m),T.length=0}break;case 14:0>3;break;case 21:2>16),p+=2;break;case 29:a=T.pop()+g.gsubrsBias,(s=g.gsubrs[a])&&e(s);break;case 30:for(;0=r.begin&&e=fe.length){var a=i.parseChar();r.names.push(i.parseString(a))}break;case 2.5:r.numberOfGlyphs=i.parseUShort(),r.offset=new Array(r.numberOfGlyphs);for(var s=0;st.value.tag?1:-1}),t.fields=t.fields.concat(i),t.fields=t.fields.concat(n),t}function gt(e,t,r){for(var i=0;i 123 are reserved for internal usage");d|=1<>>1,o=e[n].tag;if(o===t)return n;o>>1,o=e[n];if(o===t)return n;o>>1,a=(r=e[o]).start;if(a===t)return r;a(r=e[i-1]).end?0:r}function xt(e,t){this.font=e,this.tableName=t}function wt(e){xt.call(this,e,"gpos")}function St(e){xt.call(this,e,"gsub")}function Mt(e,t){var r=e.length;if(r!==t.length)return!1;for(var i=0;it.points.length-1||i.matchedPoints[1]>n.points.length-1)throw Error("Matched points out of range in "+t.name);var a=t.points[i.matchedPoints[0]],s=n.points[i.matchedPoints[1]],l={xScale:i.xScale,scale01:i.scale01,scale10:i.scale10,yScale:i.yScale,dx:0,dy:0};s=kt([s],l)[0],l.dx=a.x-s.x,l.dy=a.y-s.y,o=kt(n.points,l)}t.points=t.points.concat(o)}}return Rt(t.points)}(wt.prototype=xt.prototype={searchTag:yt,binSearch:bt,getTable:function(e){var t=this.font.tables[this.tableName];return!t&&e&&(t=this.font.tables[this.tableName]=this.createDefaultTable()),t},getScriptNames:function(){var e=this.getTable();return e?e.scripts.map(function(e){return e.tag}):[]},getDefaultScriptName:function(){var e=this.getTable();if(e){for(var t=!1,r=0;r=s[u-1].tag,"Features must be added in alphabetical order."),o={tag:r,feature:{params:0,lookupListIndexes:[]}},s.push(o),a.push(u),o.feature}}},getLookupTables:function(e,t,r,i,n){var o=this.getFeatureTable(e,t,r,n),a=[];if(o){for(var s,l=o.lookupListIndexes,u=this.font.tables[this.tableName].lookups,h=0;h",s),t.stack.push(Math.round(64*s))}function vr(e,t){var r=t.stack,i=r.pop(),n=t.fv,o=t.pv,a=t.ppem,s=t.deltaBase+16*(e-1),l=t.deltaShift,u=t.z0;E.DEBUG&&console.log(t.step,"DELTAP["+e+"]",i,r);for(var h=0;h>4)===a){var d=(15&f)-8;0<=d&&d++,E.DEBUG&&console.log(t.step,"DELTAPFIX",c,"by",d*l);var p=u[c];n.setRelative(p,p,d*l,o)}}}function yr(e,t){var r=t.stack,i=r.pop();E.DEBUG&&console.log(t.step,"ROUND[]"),r.push(64*t.round(i/64))}function br(e,t){var r=t.stack,i=r.pop(),n=t.ppem,o=t.deltaBase+16*(e-1),a=t.deltaShift;E.DEBUG&&console.log(t.step,"DELTAC["+e+"]",i,r);for(var s=0;s>4)===n){var h=(15&u)-8;0<=h&&h++;var c=h*a;E.DEBUG&&console.log(t.step,"DELTACFIX",l,"by",c),t.cvt[l]+=c}}}function _r(e,t){var r,i,n=t.stack,o=n.pop(),a=n.pop(),s=t.z2[o],l=t.z1[a];E.DEBUG&&console.log(t.step,"SDPVTL["+e+"]",o,a),i=e?(r=s.y-l.y,l.x-s.x):(r=l.x-s.x,l.y-s.y),t.dpv=Zt(r,i)}function xr(e,t){var r=t.stack,i=t.prog,n=t.ip;E.DEBUG&&console.log(t.step,"PUSHB["+e+"]");for(var o=0;o":"_")+(i?"R":"_")+(0===n?"Gr":1===n?"Bl":2===n?"Wh":"")+"]",e?c+"("+o.cvt[c]+","+u+")":"",f,"(d =",a,"->",l*s,")"),o.rp1=o.rp0,o.rp2=f,t&&(o.rp0=f)}Ft.prototype.exec=function(e,t){if("number"!=typeof t)throw new Error("Point size is not a number!");if(!(2",i),s.interpolate(c,o,a,l),s.touch(c)}e.loop=1},dr.bind(void 0,0),dr.bind(void 0,1),function(e){for(var t=e.stack,r=e.rp0,i=e.z0[r],n=e.loop,o=e.fv,a=e.pv,s=e.z1;n--;){var l=t.pop(),u=s[l];E.DEBUG&&console.log(e.step,(1=a.width||t>=a.height?[0,0,0,0]:this._getPixel(e,t);var s=new l.default.Image(r,i);return s.canvas.getContext("2d").drawImage(a,e,t,r*o,i*o,0,0,r,i),s},l.default.Renderer.prototype.textLeading=function(e){return"number"==typeof e?(this._setProperty("_textLeading",e),this._pInst):this._textLeading},l.default.Renderer.prototype.textSize=function(e){return"number"==typeof e?(this._setProperty("_textSize",e),this._setProperty("_textLeading",e*y._DEFAULT_LEADMULT),this._applyTextProperties()):this._textSize},l.default.Renderer.prototype.textStyle=function(e){return e?(e!==y.NORMAL&&e!==y.ITALIC&&e!==y.BOLD&&e!==y.BOLDITALIC||this._setProperty("_textStyle",e),this._applyTextProperties()):this._textStyle},l.default.Renderer.prototype.textAscent=function(){return null===this._textAscent&&this._updateTextMetrics(),this._textAscent},l.default.Renderer.prototype.textDescent=function(){return null===this._textDescent&&this._updateTextMetrics(),this._textDescent},l.default.Renderer.prototype.textAlign=function(e,t){return void 0!==e?(this._setProperty("_textAlign",e),void 0!==t&&this._setProperty("_textBaseline",t),this._applyTextProperties()):{horizontal:this._textAlign,vertical:this._textBaseline}},l.default.Renderer.prototype.text=function(e,t,r,i,n){var o,a,s,l,u,h,c,f,d=this._pInst,p=Number.MAX_VALUE;if((this._doFill||this._doStroke)&&void 0!==e){if("string"!=typeof e&&(e=e.toString()),o=(e=e.replace(/(\t)/g," ")).split("\n"),void 0!==i){for(s=f=0;ss.HALF_PI&&e<=3*s.HALF_PI?Math.atan(r/i*Math.tan(e))+s.PI:Math.atan(r/i*Math.tan(e))+s.TWO_PI,t=t<=s.HALF_PI?Math.atan(r/i*Math.tan(t)):t>s.HALF_PI&&t<=3*s.HALF_PI?Math.atan(r/i*Math.tan(t))+s.PI:Math.atan(r/i*Math.tan(t))+s.TWO_PI),tv||Math.abs(this.accelerationY-this.pAccelerationY)>v||Math.abs(this.accelerationZ-this.pAccelerationZ)>v)&&e();var t=this.deviceTurned||window.deviceTurned;if("function"==typeof t){var r=this.rotationX+180,i=this.pRotationX+180,n=c+180;0>>24],i+=x[(16711680&C)>>16],n+=x[(65280&C)>>8],o+=x[255&C],r+=k[_],s++}w[l=T+y]=a/r,S[l]=i/r,M[l]=n/r,E[l]=o/r}T+=d}for(h=(u=-P)*d,b=T=0;b>>16,e[r+1]=(65280&t[i])>>>8,e[r+2]=255&t[i],e[r+3]=(4278190080&t[i])>>>24},O._toImageData=function(e){return e instanceof ImageData?e:e.getContext("2d").getImageData(0,0,e.width,e.height)},O._createImageData=function(e,t){return O._tmpCanvas=document.createElement("canvas"),O._tmpCtx=O._tmpCanvas.getContext("2d"),this._tmpCtx.createImageData(e,t)},O.apply=function(e,t,r){var i=e.getContext("2d"),n=i.getImageData(0,0,e.width,e.height),o=t(n,r);o instanceof ImageData?i.putImageData(o,0,0,0,0,e.width,e.height):i.putImageData(n,0,0,0,0,e.width,e.height)},O.threshold=function(e,t){var r=O._toPixels(e);void 0===t&&(t=.5);for(var i=Math.floor(255*t),n=0;n>8)/i,r[n+1]=255*(a*t>>8)/i,r[n+2]=255*(s*t>>8)/i}},O.dilate=function(e){for(var t,r,i,n,o,a,s,l,u,h,c,f,d,p,m,g,v,y=O._toPixels(e),b=0,_=y.length?y.length/4:0,x=new Int32Array(_);b<_;)for(r=(t=b)+e.width;b>16&255)+151*(i>>8&255)+28*(255&i))<(m=77*(c>>16&255)+151*(c>>8&255)+28*(255&c))&&(n=c,o=m),o<(p=77*((h=O._getARGB(y,a))>>16&255)+151*(h>>8&255)+28*(255&h))&&(n=h,o=p),o<(g=77*(f>>16&255)+151*(f>>8&255)+28*(255&f))&&(n=f,o=g),o<(v=77*(d>>16&255)+151*(d>>8&255)+28*(255&d))&&(n=d,o=v),x[b++]=n;O._setPixels(y,x)},O.erode=function(e){for(var t,r,i,n,o,a,s,l,u,h,c,f,d,p,m,g,v,y=O._toPixels(e),b=0,_=y.length?y.length/4:0,x=new Int32Array(_);b<_;)for(r=(t=b)+e.width;b>16&255)+151*(c>>8&255)+28*(255&c))<(o=77*(i>>16&255)+151*(i>>8&255)+28*(255&i))&&(n=c,o=m),(p=77*((h=O._getARGB(y,a))>>16&255)+151*(h>>8&255)+28*(255&h))>16&255)+151*(f>>8&255)+28*(255&f))>16&255)+151*(d>>8&255)+28*(255&d))=r){var i=Math.floor(t.timeDisplayed/r);if(t.timeDisplayed=0,t.displayIndex+=i,t.loopCount=Math.floor(t.displayIndex/t.numFrames),null!==t.loopLimit&&t.loopCount>=t.loopLimit)t.playing=!1;else{var n=t.displayIndex%t.numFrames;this.drawingContext.putImageData(t.frames[n].image,0,0),t.displayIndex=n,this.setModified(!0)}}}},n.default.Image.prototype._setProperty=function(e,t){this[e]=t,this.setModified(!0)},n.default.Image.prototype.loadPixels=function(){n.default.Renderer2D.prototype.loadPixels.call(this),this.setModified(!0)},n.default.Image.prototype.updatePixels=function(e,t,r,i){n.default.Renderer2D.prototype.updatePixels.call(this,e,t,r,i),this.setModified(!0)},n.default.Image.prototype.get=function(e,t,r,i){return n.default._validateParameters("p5.Image.get",arguments),n.default.Renderer2D.prototype.get.apply(this,arguments)},n.default.Image.prototype._getPixel=n.default.Renderer2D.prototype._getPixel,n.default.Image.prototype.set=function(e,t,r){n.default.Renderer2D.prototype.set.call(this,e,t,r),this.setModified(!0)},n.default.Image.prototype.resize=function(e,t){0===e&&0===t?(e=this.canvas.width,t=this.canvas.height):0===e?e=this.canvas.width*t/this.canvas.height:0===t&&(t=this.canvas.height*e/this.canvas.width),e=Math.floor(e),t=Math.floor(t);var r=document.createElement("canvas");if(r.width=e,r.height=t,this.gifProperties)for(var i=this.gifProperties,n=function(e,t){for(var r=0,i=0;i/g,">").replace(/"/g,""").replace(/'/g,"'")}function l(e,t){t&&!0!==t&&"true"!==t||(t="");var r="";return(e=e||"untitled")&&e.includes(".")&&(r=e.split(".").pop()),t&&r!==t&&(r=t,e="".concat(e,".").concat(r)),[e,r]}e("../core/error_helpers"),v.default.prototype.loadJSON=function(){for(var e=arguments.length,t=new Array(e),r=0;r"),n.print("");if(n.print(' '),n.print(""),n.print(""),n.print(" "),"0"!==o[0]){n.print(" ");for(var h=0;h".concat(c)),n.print(" ")}n.print(" ")}for(var f=0;f");for(var d=0;d".concat(p)),n.print(" ")}n.print(" ")}n.print("
"),n.print(""),n.print("")}n.close(),n.clear()},v.default.prototype.writeFile=function(e,t,r){var i="application/octet-stream";v.default.prototype._isSafari()&&(i="text/plain");var n=new Blob(e,{type:i});v.default.prototype.downloadFile(n,t,r)},v.default.prototype.downloadFile=function(e,t,r){var i=l(t,r),n=i[0];if(e instanceof Blob)s.default.saveAs(e,n);else{var o=document.createElement("a");if(o.href=e,o.download=n,o.onclick=function(e){var t;t=e,document.body.removeChild(t.target),e.stopPropagation()},o.style.display="none",document.body.appendChild(o),v.default.prototype._isSafari()){var a="Hello, Safari user! To download this file...\n";a+="1. Go to File --\x3e Save As.\n",a+='2. Choose "Page Source" as the Format.\n',a+='3. Name it with this extension: ."'.concat(i[1],'"'),alert(a)}o.click()}},v.default.prototype._checkFileExtension=l,v.default.prototype._isSafari=function(){return 0>>0},getSeed:function(){return t},rand:function(){return(r=(1664525*r+1013904223)%i)/i}});n.setSeed(e),_=new Array(4096);for(var o=0;o<4096;o++)_[o]=n.rand()};var o=n.default;r.default=o},{"../core/main":49}],82:[function(e,t,r){"use strict";function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i,l=(i=e("../core/main"))&&i.__esModule?i:{default:i},o=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==a(e)&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var o=i?Object.getOwnPropertyDescriptor(e,n):null;o&&(o.get||o.set)?Object.defineProperty(r,n,o):r[n]=e[n]}r.default=e,t&&t.set(e,r);return r}(e("../core/constants"));function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}l.default.Vector=function(e,t,r){var i,n,o;o=e instanceof l.default?(this.p5=e,i=t[0]||0,n=t[1]||0,t[2]||0):(i=e||0,n=t||0,r||0),this.x=i,this.y=n,this.z=o},l.default.Vector.prototype.toString=function(){return"p5.Vector Object : [".concat(this.x,", ").concat(this.y,", ").concat(this.z,"]")},l.default.Vector.prototype.set=function(e,t,r){return e instanceof l.default.Vector?(this.x=e.x||0,this.y=e.y||0,this.z=e.z||0):e instanceof Array?(this.x=e[0]||0,this.y=e[1]||0,this.z=e[2]||0):(this.x=e||0,this.y=t||0,this.z=r||0),this},l.default.Vector.prototype.copy=function(){return this.p5?new l.default.Vector(this.p5,[this.x,this.y,this.z]):new l.default.Vector(this.x,this.y,this.z)},l.default.Vector.prototype.add=function(e,t,r){return e instanceof l.default.Vector?(this.x+=e.x||0,this.y+=e.y||0,this.z+=e.z||0):e instanceof Array?(this.x+=e[0]||0,this.y+=e[1]||0,this.z+=e[2]||0):(this.x+=e||0,this.y+=t||0,this.z+=r||0),this};function u(e,t){return 0!==e&&(this.x=this.x%e),0!==t&&(this.y=this.y%t),this}function h(e,t,r){return 0!==e&&(this.x=this.x%e),0!==t&&(this.y=this.y%t),0!==r&&(this.z=this.z%r),this}l.default.Vector.prototype.rem=function(e,t,r){if(e instanceof l.default.Vector){if(Number.isFinite(e.x)&&Number.isFinite(e.y)&&Number.isFinite(e.z)){var i=parseFloat(e.x),n=parseFloat(e.y),o=parseFloat(e.z);h.call(this,i,n,o)}}else if(e instanceof Array)e.every(function(e){return Number.isFinite(e)})&&(2===e.length&&u.call(this,e[0],e[1]),3===e.length&&h.call(this,e[0],e[1],e[2]));else if(1===arguments.length){if(Number.isFinite(e)&&0!==e)return this.x=this.x%e,this.y=this.y%e,this.z=this.z%e,this}else if(2===arguments.length){var a=Array.prototype.slice.call(arguments);a.every(function(e){return Number.isFinite(e)})&&2===a.length&&u.call(this,a[0],a[1])}else if(3===arguments.length){var s=Array.prototype.slice.call(arguments);s.every(function(e){return Number.isFinite(e)})&&3===s.length&&h.call(this,s[0],s[1],s[2])}},l.default.Vector.prototype.sub=function(e,t,r){return e instanceof l.default.Vector?(this.x-=e.x||0,this.y-=e.y||0,this.z-=e.z||0):e instanceof Array?(this.x-=e[0]||0,this.y-=e[1]||0,this.z-=e[2]||0):(this.x-=e||0,this.y-=t||0,this.z-=r||0),this},l.default.Vector.prototype.mult=function(e){return"number"==typeof e&&isFinite(e)?(this.x*=e,this.y*=e,this.z*=e):console.warn("p5.Vector.prototype.mult:","n is undefined or not a finite number"),this},l.default.Vector.prototype.div=function(e){return"number"==typeof e&&isFinite(e)?0===e?console.warn("p5.Vector.prototype.div:","divide by 0"):(this.x/=e,this.y/=e,this.z/=e):console.warn("p5.Vector.prototype.div:","n is undefined or not a finite number"),this},l.default.Vector.prototype.mag=function(){return Math.sqrt(this.magSq())},l.default.Vector.prototype.magSq=function(){var e=this.x,t=this.y,r=this.z;return e*e+t*t+r*r},l.default.Vector.prototype.dot=function(e,t,r){return e instanceof l.default.Vector?this.dot(e.x,e.y,e.z):this.x*(e||0)+this.y*(t||0)+this.z*(r||0)},l.default.Vector.prototype.cross=function(e){var t=this.y*e.z-this.z*e.y,r=this.z*e.x-this.x*e.z,i=this.x*e.y-this.y*e.x;return this.p5?new l.default.Vector(this.p5,[t,r,i]):new l.default.Vector(t,r,i)},l.default.Vector.prototype.dist=function(e){return e.copy().sub(this).mag()},l.default.Vector.prototype.normalize=function(){var e=this.mag();return 0!==e&&this.mult(1/e),this},l.default.Vector.prototype.limit=function(e){var t=this.magSq();return e*e>>0},n.default.prototype.randomSeed=function(e){this._lcgSetSeed(o,e),this._gaussian_previous=!1},n.default.prototype.random=function(e,t){var r;if(n.default._validateParameters("random",arguments),r=null!=this[o]?this._lcg(o):Math.random(),void 0===e)return r;if(void 0===t)return e instanceof Array?e[Math.floor(r*e.length)]:r*e;if(tf){var P=p,L=l,k=u;p=d+f*(s&&d=t&&(r=r.substring(r.length-t,r.length)),r}},n.default.prototype.unhex=function(e){return e instanceof Array?e.map(n.default.prototype.unhex):parseInt("0x".concat(e),16)};var o=n.default;r.default=o},{"../core/main":49}],90:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i,a=(i=e("../core/main"))&&i.__esModule?i:{default:i};function n(e,t,r){var i=e<0,n=i?e.toString().substring(1):e.toString(),o=n.indexOf("."),a=-1!==o?n.substring(0,o):n,s=-1!==o?n.substring(o+1):"",l=i?"-":"";if(void 0!==r){var u="";(-1!==o||0r&&(s=s.substring(0,r));for(var h=0;hi.length)for(var o=t-(i+=-1===r?".":"").length+1,a=0;a=d.TWO_PI?"".concat("ellipse","|").concat(u,"|"):"".concat("arc","|").concat(a,"|").concat(s,"|").concat(l,"|").concat(u,"|"),!this.geometryInHash(t)){var h=new T.default.Geometry(u,1,function(){if(this.strokeIndices=[],a.toFixed(10)!==s.toFixed(10)){l!==d.PIE&&void 0!==l||(this.vertices.push(new T.default.Vector(.5,.5,0)),this.uvs.push([.5,.5]));for(var e=0;e<=u;e++){var t=(s-a)*(e/u)+a,r=.5+Math.cos(t)/2,i=.5+Math.sin(t)/2;this.vertices.push(new T.default.Vector(r,i,0)),this.uvs.push([r,i]),e>5&31)/31,(y>>10&31)/31):(r=a,i=s,l)}for(var b=1;b<=3;b++){var _=p+12*b,x=new S.default.Vector(u.getFloat32(_,!0),u.getFloat32(8+_,!0),u.getFloat32(4+_,!0));e.vertices.push(x),c&&o.push(r,i,n)}var w=new S.default.Vector(m,g,v);e.vertexNormals.push(w,w,w),e.faces.push([3*d,3*d+1,3*d+2]),e.uvs.push([0,0],[0,0],[0,0])}}(e,t);else{var r=new DataView(t);if(!("TextDecoder"in window))return console.warn("Sorry, ASCII STL loading only works in browsers that support TextDecoder (https://caniuse.com/#feat=textencoder)");var i=new TextDecoder("utf-8").decode(r).split("\n");!function(e,t){for(var r,i,n="",o=[],a=0;aMath.PI?l=Math.PI:l<=0&&(l=.001);var u=Math.sin(l)*a*Math.sin(s),h=Math.cos(l)*a,c=Math.sin(l)*a*Math.cos(s);this.camera(u+this.centerX,h+this.centerY,c+this.centerZ,this.centerX,this.centerY,this.centerZ,0,1,0)},m.default.Camera.prototype._isActive=function(){return this===this._renderer._curCamera},m.default.prototype.setCamera=function(e){this._renderer._curCamera=e,this._renderer.uPMatrix.set(e.projMatrix.mat4[0],e.projMatrix.mat4[1],e.projMatrix.mat4[2],e.projMatrix.mat4[3],e.projMatrix.mat4[4],e.projMatrix.mat4[5],e.projMatrix.mat4[6],e.projMatrix.mat4[7],e.projMatrix.mat4[8],e.projMatrix.mat4[9],e.projMatrix.mat4[10],e.projMatrix.mat4[11],e.projMatrix.mat4[12],e.projMatrix.mat4[13],e.projMatrix.mat4[14],e.projMatrix.mat4[15])};var n=m.default.Camera;r.default=n},{"../core/main":49}],98:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i,h=(i=e("../core/main"))&&i.__esModule?i:{default:i};h.default.Geometry=function(e,t,r){return this.vertices=[],this.lineVertices=[],this.lineNormals=[],this.vertexNormals=[],this.faces=[],this.uvs=[],this.edges=[],this.vertexColors=[],this.detailX=void 0!==e?e:1,this.detailY=void 0!==t?t:1,this.dirtyFlags={},r instanceof Function&&r.call(this),this},h.default.Geometry.prototype.reset=function(){this.lineVertices.length=0,this.lineNormals.length=0,this.vertices.length=0,this.edges.length=0,this.vertexColors.length=0,this.vertexNormals.length=0,this.uvs.length=0,this.dirtyFlags={}},h.default.Geometry.prototype.computeFaces=function(){this.faces.length=0;for(var e,t,r,i,n=this.detailX+1,o=0;othis.vertices.length-1-this.detailX;i--)e.add(this.vertexNormals[i]);e=h.default.Vector.div(e,this.detailX);for(var n=this.vertices.length-1;n>this.vertices.length-1-this.detailX;n--)this.vertexNormals[n]=e;return this},h.default.Geometry.prototype._makeTriangleEdges=function(){if(this.edges.length=0,Array.isArray(this.strokeIndices))for(var e=0,t=this.strokeIndices.length;e vTexCoord.y;\n bool y1 = p1.y > vTexCoord.y;\n bool y2 = p2.y > vTexCoord.y;\n\n // could web be under the curve (after t1)?\n if (y1 ? !y2 : y0) {\n // add the coverage for t1\n coverage.x += saturate(C1.x + 0.5);\n // calculate the anti-aliasing for t1\n weight.x = min(weight.x, abs(C1.x));\n }\n\n // are we outside the curve (after t2)?\n if (y1 ? !y0 : y2) {\n // subtract the coverage for t2\n coverage.x -= saturate(C2.x + 0.5);\n // calculate the anti-aliasing for t2\n weight.x = min(weight.x, abs(C2.x));\n }\n}\n\n// this is essentially the same as coverageX, but with the axes swapped\nvoid coverageY(vec2 p0, vec2 p1, vec2 p2) {\n\n vec2 C1, C2;\n calulateCrossings(p0, p1, p2, C1, C2);\n\n bool x0 = p0.x > vTexCoord.x;\n bool x1 = p1.x > vTexCoord.x;\n bool x2 = p2.x > vTexCoord.x;\n\n if (x1 ? !x2 : x0) {\n coverage.y -= saturate(C1.y + 0.5);\n weight.y = min(weight.y, abs(C1.y));\n }\n\n if (x1 ? !x0 : x2) {\n coverage.y += saturate(C2.y + 0.5);\n weight.y = min(weight.y, abs(C2.y));\n }\n}\n\nvoid main() {\n\n // calculate the pixel scale based on screen-coordinates\n pixelScale = hardness / fwidth(vTexCoord);\n\n // which grid cell is this pixel in?\n ivec2 gridCoord = ifloor(vTexCoord * vec2(uGridSize));\n\n // intersect curves in this row\n {\n // the index into the row info bitmap\n int rowIndex = gridCoord.y + uGridOffset.y;\n // fetch the info texel\n vec4 rowInfo = getTexel(uSamplerRows, rowIndex, uGridImageSize);\n // unpack the rowInfo\n int rowStrokeIndex = getInt16(rowInfo.xy);\n int rowStrokeCount = getInt16(rowInfo.zw);\n\n for (int iRowStroke = INT(0); iRowStroke < N; iRowStroke++) {\n if (iRowStroke >= rowStrokeCount)\n break;\n\n // each stroke is made up of 3 points: the start and control point\n // and the start of the next curve.\n // fetch the indices of this pair of strokes:\n vec4 strokeIndices = getTexel(uSamplerRowStrokes, rowStrokeIndex++, uCellsImageSize);\n\n // unpack the stroke index\n int strokePos = getInt16(strokeIndices.xy);\n\n // fetch the two strokes\n vec4 stroke0 = getTexel(uSamplerStrokes, strokePos + INT(0), uStrokeImageSize);\n vec4 stroke1 = getTexel(uSamplerStrokes, strokePos + INT(1), uStrokeImageSize);\n\n // calculate the coverage\n coverageX(stroke0.xy, stroke0.zw, stroke1.xy);\n }\n }\n\n // intersect curves in this column\n {\n int colIndex = gridCoord.x + uGridOffset.x;\n vec4 colInfo = getTexel(uSamplerCols, colIndex, uGridImageSize);\n int colStrokeIndex = getInt16(colInfo.xy);\n int colStrokeCount = getInt16(colInfo.zw);\n \n for (int iColStroke = INT(0); iColStroke < N; iColStroke++) {\n if (iColStroke >= colStrokeCount)\n break;\n\n vec4 strokeIndices = getTexel(uSamplerColStrokes, colStrokeIndex++, uCellsImageSize);\n\n int strokePos = getInt16(strokeIndices.xy);\n vec4 stroke0 = getTexel(uSamplerStrokes, strokePos + INT(0), uStrokeImageSize);\n vec4 stroke1 = getTexel(uSamplerStrokes, strokePos + INT(1), uStrokeImageSize);\n coverageY(stroke0.xy, stroke0.zw, stroke1.xy);\n }\n }\n\n weight = saturate(1.0 - weight * 2.0);\n float distance = max(weight.x + weight.y, minDistance); // manhattan approx.\n float antialias = abs(dot(coverage, weight) / distance);\n float cover = min(abs(coverage.x), abs(coverage.y));\n gl_FragColor = uMaterialColor;\n gl_FragColor.a *= saturate(max(antialias, cover));\n}",lineVert:"/*\n Part of the Processing project - http://processing.org\n Copyright (c) 2012-15 The Processing Foundation\n Copyright (c) 2004-12 Ben Fry and Casey Reas\n Copyright (c) 2001-04 Massachusetts Institute of Technology\n This library is free software; you can redistribute it and/or\n modify it under the terms of the GNU Lesser General Public\n License as published by the Free Software Foundation, version 2.1.\n This library is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n Lesser General Public License for more details.\n You should have received a copy of the GNU Lesser General\n Public License along with this library; if not, write to the\n Free Software Foundation, Inc., 59 Temple Place, Suite 330,\n Boston, MA 02111-1307 USA\n*/\n\n#define PROCESSING_LINE_SHADER\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform float uStrokeWeight;\n\nuniform vec4 uViewport;\nuniform int uPerspective;\n\nattribute vec4 aPosition;\nattribute vec4 aDirection;\n \nvoid main() {\n // using a scale <1 moves the lines towards the camera\n // in order to prevent popping effects due to half of\n // the line disappearing behind the geometry faces.\n vec3 scale = vec3(0.9995);\n\n vec4 posp = uModelViewMatrix * aPosition;\n vec4 posq = uModelViewMatrix * (aPosition + vec4(aDirection.xyz, 0));\n\n // Moving vertices slightly toward the camera\n // to avoid depth-fighting with the fill triangles.\n // Discussed here:\n // http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Number=252848 \n posp.xyz = posp.xyz * scale;\n posq.xyz = posq.xyz * scale;\n\n vec4 p = uProjectionMatrix * posp;\n vec4 q = uProjectionMatrix * posq;\n\n // formula to convert from clip space (range -1..1) to screen space (range 0..[width or height])\n // screen_p = (p.xy/p.w + <1,1>) * 0.5 * uViewport.zw\n\n // prevent division by W by transforming the tangent formula (div by 0 causes\n // the line to disappear, see https://github.com/processing/processing/issues/5183)\n // t = screen_q - screen_p\n //\n // tangent is normalized and we don't care which aDirection it points to (+-)\n // t = +- normalize( screen_q - screen_p )\n // t = +- normalize( (q.xy/q.w+<1,1>)*0.5*uViewport.zw - (p.xy/p.w+<1,1>)*0.5*uViewport.zw )\n //\n // extract common factor, <1,1> - <1,1> cancels out\n // t = +- normalize( (q.xy/q.w - p.xy/p.w) * 0.5 * uViewport.zw )\n //\n // convert to common divisor\n // t = +- normalize( ((q.xy*p.w - p.xy*q.w) / (p.w*q.w)) * 0.5 * uViewport.zw )\n //\n // remove the common scalar divisor/factor, not needed due to normalize and +-\n // (keep uViewport - can't remove because it has different components for x and y\n // and corrects for aspect ratio, see https://github.com/processing/processing/issues/5181)\n // t = +- normalize( (q.xy*p.w - p.xy*q.w) * uViewport.zw )\n\n vec2 tangent = normalize((q.xy*p.w - p.xy*q.w) * uViewport.zw);\n\n // flip tangent to normal (it's already normalized)\n vec2 normal = vec2(-tangent.y, tangent.x);\n\n float thickness = aDirection.w * uStrokeWeight;\n vec2 offset = normal * thickness / 2.0;\n\n vec2 curPerspScale;\n\n if(uPerspective == 1) {\n // Perspective ---\n // convert from world to clip by multiplying with projection scaling factor\n // to get the right thickness (see https://github.com/processing/processing/issues/5182)\n // invert Y, projections in Processing invert Y\n curPerspScale = (uProjectionMatrix * vec4(1, -1, 0, 0)).xy;\n } else {\n // No Perspective ---\n // multiply by W (to cancel out division by W later in the pipeline) and\n // convert from screen to clip (derived from clip to screen above)\n curPerspScale = p.w / (0.5 * uViewport.zw);\n }\n\n gl_Position.xy = p.xy + offset.xy * curPerspScale;\n gl_Position.zw = p.zw;\n}\n",lineFrag:"precision mediump float;\nprecision mediump int;\n\nuniform vec4 uMaterialColor;\n\nvoid main() {\n gl_FragColor = uMaterialColor;\n}",pointVert:"attribute vec3 aPosition;\nuniform float uPointSize;\nvarying float vStrokeWeight;\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nvoid main() {\n\tvec4 positionVec4 = vec4(aPosition, 1.0);\n\tgl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n\tgl_PointSize = uPointSize;\n\tvStrokeWeight = uPointSize;\n}",pointFrag:"precision mediump float;\nprecision mediump int;\nuniform vec4 uMaterialColor;\nvarying float vStrokeWeight;\n\nvoid main(){\n\tfloat mask = 0.0;\n\n\t// make a circular mask using the gl_PointCoord (goes from 0 - 1 on a point)\n // might be able to get a nicer edge on big strokeweights with smoothstep but slightly less performant\n\n\tmask = step(0.98, length(gl_PointCoord * 2.0 - 1.0));\n\n\t// if strokeWeight is 1 or less lets just draw a square\n\t// this prevents weird artifacting from carving circles when our points are really small\n\t// if strokeWeight is larger than 1, we just use it as is\n\n\tmask = mix(0.0, mask, clamp(floor(vStrokeWeight - 0.5),0.0,1.0));\n\n\t// throw away the borders of the mask\n // otherwise we get weird alpha blending issues\n\n\tif(mask > 0.98){\n discard;\n \t}\n\n \tgl_FragColor = vec4(uMaterialColor.rgb * (1.0 - mask), uMaterialColor.a) ;\n}"};u.default.RendererGL=function(e,t,r,i){return u.default.Renderer.call(this,e,t,r),this._setAttributeDefaults(t),this._initContext(),this.isP3D=!0,this.GL=this.drawingContext,this._isErasing=!1,this._enableLighting=!1,this.ambientLightColors=[],this.specularColors=[1,1,1],this.directionalLightDirections=[],this.directionalLightDiffuseColors=[],this.directionalLightSpecularColors=[],this.pointLightPositions=[],this.pointLightDiffuseColors=[],this.pointLightSpecularColors=[],this.spotLightPositions=[],this.spotLightDirections=[],this.spotLightDiffuseColors=[],this.spotLightSpecularColors=[],this.spotLightAngle=[],this.spotLightConc=[],this.drawMode=o.FILL,this.curFillColor=this._cachedFillStyle=[1,1,1,1],this.curStrokeColor=this._cachedStrokeStyle=[0,0,0,1],this.curBlendMode=o.BLEND,this._cachedBlendMode=void 0,this.blendExt=this.GL.getExtension("EXT_blend_minmax"),this._isBlending=!1,this._useSpecularMaterial=!1,this._useEmissiveMaterial=!1,this._useNormalMaterial=!1,this._useShininess=1,this._tint=[255,255,255,255],this.constantAttenuation=1,this.linearAttenuation=0,this.quadraticAttenuation=0,this.uMVMatrix=new u.default.Matrix,this.uPMatrix=new u.default.Matrix,this.uNMatrix=new u.default.Matrix("mat3"),this._curCamera=new u.default.Camera(this),this._curCamera._computeCameraDefaultSettings(),this._curCamera._setDefaultCamera(),this._defaultLightShader=void 0,this._defaultImmediateModeShader=void 0,this._defaultNormalShader=void 0,this._defaultColorShader=void 0,this._defaultPointShader=void 0,this.userFillShader=void 0,this.userStrokeShader=void 0,this.userPointShader=void 0,this.retainedMode={geometry:{},buffers:{stroke:[new u.default.RenderBuffer(3,"lineVertices","lineVertexBuffer","aPosition",this,this._flatten),new u.default.RenderBuffer(4,"lineNormals","lineNormalBuffer","aDirection",this,this._flatten)],fill:[new u.default.RenderBuffer(3,"vertices","vertexBuffer","aPosition",this,this._vToNArray),new u.default.RenderBuffer(3,"vertexNormals","normalBuffer","aNormal",this,this._vToNArray),new u.default.RenderBuffer(4,"vertexColors","colorBuffer","aMaterialColor",this),new u.default.RenderBuffer(3,"vertexAmbients","ambientBuffer","aAmbientColor",this),new u.default.RenderBuffer(2,"uvs","uvBuffer","aTexCoord",this,this._flatten)],text:[new u.default.RenderBuffer(3,"vertices","vertexBuffer","aPosition",this,this._vToNArray),new u.default.RenderBuffer(2,"uvs","uvBuffer","aTexCoord",this,this._flatten)]}},this.immediateMode={geometry:new u.default.Geometry,shapeMode:o.TRIANGLE_FAN,_bezierVertex:[],_quadraticVertex:[],_curveVertex:[],buffers:{fill:[new u.default.RenderBuffer(3,"vertices","vertexBuffer","aPosition",this,this._vToNArray),new u.default.RenderBuffer(3,"vertexNormals","normalBuffer","aNormal",this,this._vToNArray),new u.default.RenderBuffer(4,"vertexColors","colorBuffer","aVertexColor",this),new u.default.RenderBuffer(3,"vertexAmbients","ambientBuffer","aAmbientColor",this),new u.default.RenderBuffer(2,"uvs","uvBuffer","aTexCoord",this,this._flatten)],stroke:[new u.default.RenderBuffer(3,"lineVertices","lineVertexBuffer","aPosition",this,this._flatten),new u.default.RenderBuffer(4,"lineNormals","lineNormalBuffer","aDirection",this,this._flatten)],point:this.GL.createBuffer()}},this.pointSize=5,this.curStrokeWeight=1,this.textures=[],this.textureMode=o.IMAGE,this.textureWrapX=o.CLAMP,this.textureWrapY=o.CLAMP,this._tex=null,this._curveTightness=6,this._lookUpTableBezier=[],this._lookUpTableQuadratic=[],this._lutBezierDetail=0,this._lutQuadraticDetail=0,this._tessy=this._initTessy(),this.fontInfos={},this._curShader=void 0,this},u.default.RendererGL.prototype=Object.create(u.default.Renderer.prototype),u.default.RendererGL.prototype._setAttributeDefaults=function(e){var t={alpha:!0,depth:!0,stencil:!0,antialias:navigator.userAgent.toLowerCase().includes("safari"),premultipliedAlpha:!1,preserveDrawingBuffer:!0,perPixelLighting:!0};null===e._glAttributes?e._glAttributes=t:e._glAttributes=Object.assign(t,e._glAttributes)},u.default.RendererGL.prototype._initContext=function(){try{if(this.drawingContext=this.canvas.getContext("webgl",this._pInst._glAttributes)||this.canvas.getContext("experimental-webgl",this._pInst._glAttributes),null===this.drawingContext)throw new Error("Error creating webgl context");var e=this.drawingContext;e.enable(e.DEPTH_TEST),e.depthFunc(e.LEQUAL),e.viewport(0,0,e.drawingBufferWidth,e.drawingBufferHeight),this._viewport=this.drawingContext.getParameter(this.drawingContext.VIEWPORT)}catch(e){throw e}},u.default.RendererGL.prototype._resetContext=function(e,t){var r=this.width,i=this.height,n=this.canvas.id,o=this._pInst instanceof u.default.Graphics;if(o){var a=this._pInst;a.canvas.parentNode.removeChild(a.canvas),a.canvas=document.createElement("canvas"),(a._pInst._userNode||document.body).appendChild(a.canvas),u.default.Element.call(a,a.canvas,a._pInst),a.width=r,a.height=i}else{var s=this.canvas;s&&s.parentNode.removeChild(s),(s=document.createElement("canvas")).id=n,this._pInst._userNode?this._pInst._userNode.appendChild(s):document.body.appendChild(s),this._pInst.canvas=s}var l=new u.default.RendererGL(this._pInst.canvas,this._pInst,!o);this._pInst._setProperty("_renderer",l),l.resize(r,i),l._applyDefaults(),o||this._pInst._elements.push(l),"function"==typeof t&&setTimeout(function(){t.apply(window._renderer,e)},0)},u.default.prototype.setAttributes=function(e,t){if(void 0!==this._glAttributes){var r=!0;if(void 0!==t?(null===this._glAttributes&&(this._glAttributes={}),this._glAttributes[e]!==t&&(this._glAttributes[e]=t,r=!1)):e instanceof Object&&this._glAttributes!==e&&(this._glAttributes=e,r=!1),this._renderer.isP3D&&!r){if(!this._setupDone)for(var i in this._renderer.retainedMode.geometry)if(this._renderer.retainedMode.geometry.hasOwnProperty(i))return void console.error("Sorry, Could not set the attributes, you need to call setAttributes() before calling the other drawing methods in setup()");this.push(),this._renderer._resetContext(),this.pop(),this._renderer._curCamera&&(this._renderer._curCamera._renderer=this._renderer)}}else console.log("You are trying to use setAttributes on a p5.Graphics object that does not use a WEBGL renderer.")},u.default.RendererGL.prototype._update=function(){this.uMVMatrix.set(this._curCamera.cameraMatrix.mat4[0],this._curCamera.cameraMatrix.mat4[1],this._curCamera.cameraMatrix.mat4[2],this._curCamera.cameraMatrix.mat4[3],this._curCamera.cameraMatrix.mat4[4],this._curCamera.cameraMatrix.mat4[5],this._curCamera.cameraMatrix.mat4[6],this._curCamera.cameraMatrix.mat4[7],this._curCamera.cameraMatrix.mat4[8],this._curCamera.cameraMatrix.mat4[9],this._curCamera.cameraMatrix.mat4[10],this._curCamera.cameraMatrix.mat4[11],this._curCamera.cameraMatrix.mat4[12],this._curCamera.cameraMatrix.mat4[13],this._curCamera.cameraMatrix.mat4[14],this._curCamera.cameraMatrix.mat4[15]),this.ambientLightColors.length=0,this.specularColors=[1,1,1],this.directionalLightDirections.length=0,this.directionalLightDiffuseColors.length=0,this.directionalLightSpecularColors.length=0,this.pointLightPositions.length=0,this.pointLightDiffuseColors.length=0,this.pointLightSpecularColors.length=0,this.spotLightPositions.length=0,this.spotLightDirections.length=0,this.spotLightDiffuseColors.length=0,this.spotLightSpecularColors.length=0,this.spotLightAngle.length=0,this.spotLightConc.length=0,this._enableLighting=!1,this._tint=[255,255,255,255],this.GL.clear(this.GL.DEPTH_BUFFER_BIT)},u.default.RendererGL.prototype.background=function(){var e,t=(e=this._pInst).color.apply(e,arguments),r=t.levels[0]/255,i=t.levels[1]/255,n=t.levels[2]/255,o=t.levels[3]/255;this.GL.clearColor(r,i,n,o),this.GL.clear(this.GL.COLOR_BUFFER_BIT)},u.default.RendererGL.prototype.fill=function(e,t,r,i){var n=u.default.prototype.color.apply(this._pInst,arguments);this.curFillColor=n._array,this.drawMode=o.FILL,this._useNormalMaterial=!1,this._tex=null},u.default.RendererGL.prototype.stroke=function(e,t,r,i){arguments[3]=255;var n=u.default.prototype.color.apply(this._pInst,arguments);this.curStrokeColor=n._array},u.default.RendererGL.prototype.strokeCap=function(e){console.error("Sorry, strokeCap() is not yet implemented in WEBGL mode")},u.default.RendererGL.prototype.strokeJoin=function(e){console.error("Sorry, strokeJoin() is not yet implemented in WEBGL mode")},u.default.RendererGL.prototype.filter=function(e){console.error("filter() does not work in WEBGL mode")},u.default.RendererGL.prototype.blendMode=function(e){e===o.DARKEST||e===o.LIGHTEST||e===o.ADD||e===o.BLEND||e===o.SUBTRACT||e===o.SCREEN||e===o.EXCLUSION||e===o.REPLACE||e===o.MULTIPLY||e===o.REMOVE?this.curBlendMode=e:e!==o.BURN&&e!==o.OVERLAY&&e!==o.HARD_LIGHT&&e!==o.SOFT_LIGHT&&e!==o.DODGE||console.warn("BURN, OVERLAY, HARD_LIGHT, SOFT_LIGHT, and DODGE only work for blendMode in 2D mode.")},u.default.RendererGL.prototype.erase=function(e,t){this._isErasing||(this._cachedBlendMode=this.curBlendMode,this.blendMode(o.REMOVE),this._cachedFillStyle=this.curFillColor.slice(),this.curFillColor=[1,1,1,e/255],this._cachedStrokeStyle=this.curStrokeColor.slice(),this.curStrokeColor=[1,1,1,t/255],this._isErasing=!0)},u.default.RendererGL.prototype.noErase=function(){this._isErasing&&(this.curFillColor=this._cachedFillStyle.slice(),this.curStrokeColor=this._cachedStrokeStyle.slice(),this.blendMode(this._cachedBlendMode),this._isErasing=!1)},u.default.RendererGL.prototype.strokeWeight=function(e){this.curStrokeWeight!==e&&(this.pointSize=e,this.curStrokeWeight=e)},u.default.RendererGL.prototype._getPixel=function(e,t){var r;return r=new Uint8Array(4),this.drawingContext.readPixels(e,t,1,1,this.drawingContext.RGBA,this.drawingContext.UNSIGNED_BYTE,r),[r[0],r[1],r[2],r[3]]},u.default.RendererGL.prototype.loadPixels=function(){var e=this._pixelsState;if(!0===this._pInst._glAttributes.preserveDrawingBuffer){var t=e.pixels,r=this.GL.drawingBufferWidth*this.GL.drawingBufferHeight*4;t instanceof Uint8Array&&t.length===r||(t=new Uint8Array(r),this._pixelsState._setProperty("pixels",t));var i=this._pInst._pixelDensity;this.GL.readPixels(0,0,this.width*i,this.height*i,this.GL.RGBA,this.GL.UNSIGNED_BYTE,t)}else console.log("loadPixels only works in WebGL when preserveDrawingBuffer is true.")},u.default.RendererGL.prototype.geometryInHash=function(e){return void 0!==this.retainedMode.geometry[e]},u.default.RendererGL.prototype.resize=function(e,t){u.default.Renderer.prototype.resize.call(this,e,t),this.GL.viewport(0,0,this.GL.drawingBufferWidth,this.GL.drawingBufferHeight),this._viewport=this.GL.getParameter(this.GL.VIEWPORT),this._curCamera._resize();var r=this._pixelsState;void 0!==r.pixels&&r._setProperty("pixels",new Uint8Array(this.GL.drawingBufferWidth*this.GL.drawingBufferHeight*4))},u.default.RendererGL.prototype.clear=function(){var e=(arguments.length<=0?void 0:arguments[0])||0,t=(arguments.length<=1?void 0:arguments[1])||0,r=(arguments.length<=2?void 0:arguments[2])||0,i=(arguments.length<=3?void 0:arguments[3])||0;this.GL.clearColor(e,t,r,i),this.GL.clear(this.GL.COLOR_BUFFER_BIT|this.GL.DEPTH_BUFFER_BIT)},u.default.RendererGL.prototype.applyMatrix=function(e,t,r,i,n,o){16===arguments.length?u.default.Matrix.prototype.apply.apply(this.uMVMatrix,arguments):this.uMVMatrix.apply([e,t,0,0,r,i,0,0,0,0,1,0,n,o,0,1])},u.default.RendererGL.prototype.translate=function(e,t,r){return e instanceof u.default.Vector&&(r=e.z,t=e.y,e=e.x),this.uMVMatrix.translate([e,t,r]),this},u.default.RendererGL.prototype.scale=function(e,t,r){return this.uMVMatrix.scale(e,t,r),this},u.default.RendererGL.prototype.rotate=function(e,t){return void 0===t?this.rotateZ(e):(u.default.Matrix.prototype.rotate.apply(this.uMVMatrix,arguments),this)},u.default.RendererGL.prototype.rotateX=function(e){return this.rotate(e,1,0,0),this},u.default.RendererGL.prototype.rotateY=function(e){return this.rotate(e,0,1,0),this},u.default.RendererGL.prototype.rotateZ=function(e){return this.rotate(e,0,0,1),this},u.default.RendererGL.prototype.push=function(){var e=u.default.Renderer.prototype.push.apply(this),t=e.properties;return t.uMVMatrix=this.uMVMatrix.copy(),t.uPMatrix=this.uPMatrix.copy(),t._curCamera=this._curCamera,this._curCamera=this._curCamera.copy(),t.ambientLightColors=this.ambientLightColors.slice(),t.specularColors=this.specularColors.slice(),t.directionalLightDirections=this.directionalLightDirections.slice(),t.directionalLightDiffuseColors=this.directionalLightDiffuseColors.slice(),t.directionalLightSpecularColors=this.directionalLightSpecularColors.slice(),t.pointLightPositions=this.pointLightPositions.slice(),t.pointLightDiffuseColors=this.pointLightDiffuseColors.slice(),t.pointLightSpecularColors=this.pointLightSpecularColors.slice(),t.spotLightPositions=this.spotLightPositions.slice(),t.spotLightDirections=this.spotLightDirections.slice(),t.spotLightDiffuseColors=this.spotLightDiffuseColors.slice(),t.spotLightSpecularColors=this.spotLightSpecularColors.slice(),t.spotLightAngle=this.spotLightAngle.slice(),t.spotLightConc=this.spotLightConc.slice(),t.userFillShader=this.userFillShader,t.userStrokeShader=this.userStrokeShader,t.userPointShader=this.userPointShader,t.pointSize=this.pointSize,t.curStrokeWeight=this.curStrokeWeight,t.curStrokeColor=this.curStrokeColor,t.curFillColor=this.curFillColor,t._useSpecularMaterial=this._useSpecularMaterial,t._useEmissiveMaterial=this._useEmissiveMaterial,t._useShininess=this._useShininess,t.constantAttenuation=this.constantAttenuation,t.linearAttenuation=this.linearAttenuation,t.quadraticAttenuation=this.quadraticAttenuation,t._enableLighting=this._enableLighting,t._useNormalMaterial=this._useNormalMaterial,t._tex=this._tex,t.drawMode=this.drawMode,e},u.default.RendererGL.prototype.resetMatrix=function(){return this.uMVMatrix=u.default.Matrix.identity(this._pInst),this},u.default.RendererGL.prototype._getImmediateStrokeShader=function(){var e=this.userStrokeShader;return e&&e.isStrokeShader()?e:this._getLineShader()},u.default.RendererGL.prototype._getRetainedStrokeShader=u.default.RendererGL.prototype._getImmediateStrokeShader,u.default.RendererGL.prototype._getImmediateFillShader=function(){var e=this.userFillShader;if(this._useNormalMaterial&&(!e||!e.isNormalShader()))return this._getNormalShader();if(this._enableLighting){if(!e||!e.isLightShader())return this._getLightShader()}else if(this._tex){if(!e||!e.isTextureShader())return this._getLightShader()}else if(!e)return this._getImmediateModeShader();return e},u.default.RendererGL.prototype._getRetainedFillShader=function(){if(this._useNormalMaterial)return this._getNormalShader();var e=this.userFillShader;if(this._enableLighting){if(!e||!e.isLightShader())return this._getLightShader()}else if(this._tex){if(!e||!e.isTextureShader())return this._getLightShader()}else if(!e)return this._getColorShader();return e},u.default.RendererGL.prototype._getImmediatePointShader=function(){var e=this.userPointShader;return e&&e.isPointShader()?e:this._getPointShader()},u.default.RendererGL.prototype._getRetainedLineShader=u.default.RendererGL.prototype._getImmediateLineShader,u.default.RendererGL.prototype._getLightShader=function(){return this._defaultLightShader||(this._pInst._glAttributes.perPixelLighting?this._defaultLightShader=new u.default.Shader(this,c.phongVert,c.phongFrag):this._defaultLightShader=new u.default.Shader(this,c.lightVert,c.lightTextureFrag)),this._defaultLightShader},u.default.RendererGL.prototype._getImmediateModeShader=function(){return this._defaultImmediateModeShader||(this._defaultImmediateModeShader=new u.default.Shader(this,c.immediateVert,c.vertexColorFrag)),this._defaultImmediateModeShader},u.default.RendererGL.prototype._getNormalShader=function(){return this._defaultNormalShader||(this._defaultNormalShader=new u.default.Shader(this,c.normalVert,c.normalFrag)),this._defaultNormalShader},u.default.RendererGL.prototype._getColorShader=function(){return this._defaultColorShader||(this._defaultColorShader=new u.default.Shader(this,c.normalVert,c.basicFrag)),this._defaultColorShader},u.default.RendererGL.prototype._getPointShader=function(){return this._defaultPointShader||(this._defaultPointShader=new u.default.Shader(this,c.pointVert,c.pointFrag)),this._defaultPointShader},u.default.RendererGL.prototype._getLineShader=function(){return this._defaultLineShader||(this._defaultLineShader=new u.default.Shader(this,c.lineVert,c.lineFrag)),this._defaultLineShader},u.default.RendererGL.prototype._getFontShader=function(){return this._defaultFontShader||(this.GL.getExtension("OES_standard_derivatives"),this._defaultFontShader=new u.default.Shader(this,c.fontVert,c.fontFrag)),this._defaultFontShader},u.default.RendererGL.prototype._getEmptyTexture=function(){if(!this._emptyTexture){var e=new u.default.Image(1,1);e.set(0,0,255),this._emptyTexture=new u.default.Texture(this,e)}return this._emptyTexture},u.default.RendererGL.prototype.getTexture=function(e){var t=this.textures,r=!0,i=!1,n=void 0;try{for(var o,a=t[Symbol.iterator]();!(r=(o=a.next()).done);r=!0){var s=o.value;if(s.src===e)return s}}catch(e){i=!0,n=e}finally{try{r||null==a.return||a.return()}finally{if(i)throw n}}var l=new u.default.Texture(this,e);return t.push(l),l},u.default.RendererGL.prototype._setStrokeUniforms=function(e){e.bindShader(),e.setUniform("uMaterialColor",this.curStrokeColor),e.setUniform("uStrokeWeight",this.curStrokeWeight)},u.default.RendererGL.prototype._setFillUniforms=function(e){e.bindShader(),e.setUniform("uMaterialColor",this.curFillColor),e.setUniform("isTexture",!!this._tex),this._tex&&e.setUniform("uSampler",this._tex),e.setUniform("uTint",this._tint),e.setUniform("uSpecular",this._useSpecularMaterial),e.setUniform("uEmissive",this._useEmissiveMaterial),e.setUniform("uShininess",this._useShininess),e.setUniform("uUseLighting",this._enableLighting);var t=this.pointLightDiffuseColors.length/3;e.setUniform("uPointLightCount",t),e.setUniform("uPointLightLocation",this.pointLightPositions),e.setUniform("uPointLightDiffuseColors",this.pointLightDiffuseColors),e.setUniform("uPointLightSpecularColors",this.pointLightSpecularColors);var r=this.directionalLightDiffuseColors.length/3;e.setUniform("uDirectionalLightCount",r),e.setUniform("uLightingDirection",this.directionalLightDirections),e.setUniform("uDirectionalDiffuseColors",this.directionalLightDiffuseColors),e.setUniform("uDirectionalSpecularColors",this.directionalLightSpecularColors);var i=this.ambientLightColors.length/3;e.setUniform("uAmbientLightCount",i),e.setUniform("uAmbientColor",this.ambientLightColors);var n=this.spotLightDiffuseColors.length/3;e.setUniform("uSpotLightCount",n),e.setUniform("uSpotLightAngle",this.spotLightAngle),e.setUniform("uSpotLightConc",this.spotLightConc),e.setUniform("uSpotLightDiffuseColors",this.spotLightDiffuseColors),e.setUniform("uSpotLightSpecularColors",this.spotLightSpecularColors),e.setUniform("uSpotLightLocation",this.spotLightPositions),e.setUniform("uSpotLightDirection",this.spotLightDirections),e.setUniform("uConstantAttenuation",this.constantAttenuation),e.setUniform("uLinearAttenuation",this.linearAttenuation),e.setUniform("uQuadraticAttenuation",this.quadraticAttenuation),e.bindTextures()},u.default.RendererGL.prototype._setPointUniforms=function(e){e.bindShader(),e.setUniform("uMaterialColor",this.curStrokeColor),e.setUniform("uPointSize",this.pointSize)},u.default.RendererGL.prototype._bindBuffer=function(e,t,r,i,n){if(t=t||this.GL.ARRAY_BUFFER,this.GL.bindBuffer(t,e),void 0!==r){var o=new(i||Float32Array)(r);this.GL.bufferData(t,o,n||this.GL.STATIC_DRAW)}},u.default.RendererGL.prototype._arraysEqual=function(e,t){var r=e.length;if(r!==t.length)return!1;for(var i=0;i>7,127&f,c>>7,127&c);for(var d=0;d>7,127&p,0,0)}}return{cellImageInfo:l,dimOffset:o,dimImageInfo:n}}return(t=this.glyphInfos[e.index]={glyph:e,uGlyphRect:[i.x1,-i.y1,i.x2,-i.y2],strokeImageInfo:U,strokes:d,colInfo:G(m,this.colDimImageInfos,this.colCellImageInfos),rowInfo:G(p,this.rowDimImageInfos,this.rowCellImageInfos)}).uGridOffset=[t.colInfo.dimOffset,t.rowInfo.dimOffset],t}}var z=Math.sqrt(3);j.default.RendererGL.prototype._renderText=function(e,t,r,i,n){if(this._textFont&&"string"!=typeof this._textFont){if(!(n<=i)&&this._doFill){if(!this._isOpenType())return console.log("WEBGL: only Opentype (.otf) and Truetype (.ttf) fonts are supported"),e;e.push();var o=this._doStroke,a=this.drawMode;this._doStroke=!1,this.drawMode=D.TEXTURE;var s=this._textFont.font,l=this._textFont._fontInfo;l=l||(this._textFont._fontInfo=new A(s));var u=this._textFont._handleAlignment(this,t,r,i),h=this._textSize/s.unitsPerEm;this.translate(u.x,u.y,0),this.scale(h,h,1);var c=this.GL,f=!this._defaultFontShader,d=this._getFontShader();d.init(),d.bindShader(),f&&(d.setUniform("uGridImageSize",[64,64]),d.setUniform("uCellsImageSize",[64,64]),d.setUniform("uStrokeImageSize",[64,64]),d.setUniform("uGridSize",[9,9])),this._applyColorBlend(this.curFillColor);var p=this.retainedMode.geometry.glyph;if(!p){var m=this._textGeom=new j.default.Geometry(1,1,function(){for(var e=0;e<=1;e++)for(var t=0;t<=1;t++)this.vertices.push(new j.default.Vector(t,e,0)),this.uvs.push(t,e)});m.computeFaces().computeNormals(),p=this.createBuffers("glyph",m)}var g=!0,v=!1,y=void 0;try{for(var b,_=this.retainedMode.buffers.text[Symbol.iterator]();!(g=(b=_.next()).done);g=!0){b.value._prepareBuffer(p,d)}}catch(e){v=!0,y=e}finally{try{g||null==_.return||_.return()}finally{if(v)throw y}}this._bindBuffer(p.indexBuffer,c.ELEMENT_ARRAY_BUFFER),d.setUniform("uMaterialColor",this.curFillColor);try{var x=0,w=null,S=s.stringToGlyphs(t),M=!0,E=!1,T=void 0;try{for(var C,P=S[Symbol.iterator]();!(M=(C=P.next()).done);M=!0){var L=C.value;w&&(x+=s.getKerningValue(w,L));var k=l.getGlyphInfo(L);if(k.uGlyphRect){var R=k.rowInfo,O=k.colInfo;d.setUniform("uSamplerStrokes",k.strokeImageInfo.imageData),d.setUniform("uSamplerRowStrokes",R.cellImageInfo.imageData),d.setUniform("uSamplerRows",R.dimImageInfo.imageData),d.setUniform("uSamplerColStrokes",O.cellImageInfo.imageData),d.setUniform("uSamplerCols",O.dimImageInfo.imageData),d.setUniform("uGridOffset",k.uGridOffset),d.setUniform("uGlyphRect",k.uGlyphRect),d.setUniform("uGlyphOffset",x),d.bindTextures(),c.drawElements(c.TRIANGLES,6,this.GL.UNSIGNED_SHORT,0)}x+=L.advanceWidth,w=L}}catch(e){E=!0,T=e}finally{try{M||null==P.return||P.return()}finally{if(E)throw T}}}finally{d.unbindShader(),this._doStroke=o,this.drawMode=a,e.pop()}return e}}else console.log("WEBGL: you must load and set a font before drawing text. See `loadFont` and `textFont` for more details.")}},{"../core/constants":42,"../core/main":49,"./p5.RendererGL.Retained":102,"./p5.Shader":104}],107:[function(e,t,r){t.exports={fes:{autoplay:"The media that tried to play (with '{{src}}') wasn't allowed to by this browser, most likely due to the browser's autoplay policy. Check out {{link}} for more information about why.",fileLoadError:{bytes:"It looks like there was a problem loading your file. {{suggestion}}",font:"It looks like there was a problem loading your font. {{suggestion}}",gif:"There was some trouble loading your GIF. Make sure that your GIF is using 87a or 89a encoding.",image:"It looks like there was a problem loading your image. {{suggestion}}",json:"It looks like there was a problem loading your JSON file. {{suggestion}}",large:"If your large file isn't fetched successfully, we recommend splitting the file into smaller segments and fetching those.",strings:"It looks like there was a problem loading your text file. {{suggestion}}",suggestion:"Try checking if the file path ({{filePath}}) is correct, hosting the file online, or running a local server. (More info at {{link}})",table:"It looks like there was a problem loading your table file. {{suggestion}}",xml:"It looks like there was a problem loading your XML file. {{suggestion}}"},misusedTopLevel:"Did you just try to use p5.js's {{symbolName}} {{symbolType}}? If so, you may want to move it into your sketch's setup() function.\n\nFor more details, see: {{link}}",pre:"🌸 p5.js says: {{message}}",welcome:"Welcome! This is your friendly debugger. To turn me off, switch to using p5.min.js."}}},{}],108:[function(e,t,r){t.exports={fes:{autoplay:"Su browser impidío un medio tocar (de '{{src}}'), posiblemente porque las reglas de autoplay. Para aprender más, visite {{link}}.",fileLoadError:{bytes:"",font:"",gif:"",image:"",json:"",large:"",strings:"",suggestion:"",table:"",xml:""},misusedTopLevel:"",pre:"🌸 p5.js dice: {{message}}",welcome:""}}},{}],109:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i=o(e("./en/translation")),n=o(e("./es/translation"));function o(e){return e&&e.__esModule?e:{default:e}}var a={en:{translation:i.default},es:{translation:n.default}};r.default=a},{"./en/translation":107,"./es/translation":108}]},{},[37])(37)}); ================================================ FILE: docs/examples/pyodide/sketch_012/target/target_sketch.js ================================================ const wrapperContent = ` class PythonFunctions: pass setattr(PythonFunctions, 'map', map) setattr(PythonFunctions, 'filter', filter) setattr(PythonFunctions, 'set', set) _P5_INSTANCE = None _CTX_MIDDLE = None _DEFAULT_FILL = None _DEFAULT_LEADMULT = None _DEFAULT_STROKE = None _DEFAULT_TEXT_FILL = None ADD = None ALT = None ARROW = None AUDIO = None AUTO = None AXES = None BACKSPACE = None BASELINE = None BEVEL = None BEZIER = None BLEND = None BLUR = None BOLD = None BOLDITALIC = None BOTTOM = None BURN = None CENTER = None CHORD = None CLAMP = None CLOSE = None CONTROL = None CORNER = None CORNERS = None CROSS = None CURVE = None DARKEST = None DEG_TO_RAD = None DEGREES = None DELETE = None DIFFERENCE = None DILATE = None DODGE = None DOWN_ARROW = None ENTER = None ERODE = None ESCAPE = None EXCLUSION = None FILL = None GRAY = None GRID = None HALF_PI = None HAND = None HARD_LIGHT = None HSB = None HSL = None IMAGE = None IMMEDIATE = None INVERT = None ITALIC = None LANDSCAPE = None LEFT = None LEFT_ARROW = None LIGHTEST = None LINE_LOOP = None LINE_STRIP = None LINEAR = None LINES = None MIRROR = None MITER = None MOVE = None MULTIPLY = None NEAREST = None NORMAL = None OPAQUE = None OPEN = None OPTION = None OVERLAY = None PI = None PIE = None POINTS = None PORTRAIT = None POSTERIZE = None PROJECT = None QUAD_STRIP = None QUADRATIC = None QUADS = None QUARTER_PI = None RAD_TO_DEG = None RADIANS = None RADIUS = None REPEAT = None REPLACE = None RETURN = None RGB = None RIGHT = None RIGHT_ARROW = None ROUND = None SCREEN = None SHIFT = None SOFT_LIGHT = None SQUARE = None STROKE = None SUBTRACT = None TAB = None TAU = None TEXT = None TEXTURE = None THRESHOLD = None TOP = None TRIANGLE_FAN = None TRIANGLE_STRIP = None TRIANGLES = None TWO_PI = None UP_ARROW = None VIDEO = None WAIT = None WEBGL = None P2D = None PI = None frameCount = None focused = None displayWidth = None displayHeight = None windowWidth = None windowHeight = None width = None height = None deviceOrientation = None accelerationX = None accelerationY = None accelerationZ = None pAccelerationX = None pAccelerationY = None pAccelerationZ = None rotationX = None rotationY = None rotationZ = None pRotationX = None pRotationY = None pRotationZ = None turnAxis = None keyIsPressed = None key = None keyCode = None mouseX = None mouseY = None pmouseX = None pmouseY = None winMouseX = None winMouseY = None pwinMouseX = None pwinMouseY = None mouseButton = None mouseIsPressed = None touches = None pixels = None def alpha(*args): return _P5_INSTANCE.alpha(*args) def blue(*args): return _P5_INSTANCE.blue(*args) def brightness(*args): return _P5_INSTANCE.brightness(*args) def color(*args): return _P5_INSTANCE.color(*args) def green(*args): return _P5_INSTANCE.green(*args) def hue(*args): return _P5_INSTANCE.hue(*args) def lerpColor(*args): return _P5_INSTANCE.lerpColor(*args) def lightness(*args): return _P5_INSTANCE.lightness(*args) def red(*args): return _P5_INSTANCE.red(*args) def saturation(*args): return _P5_INSTANCE.saturation(*args) def background(*args): return _P5_INSTANCE.background(*args) def clear(*args): p5_clear = _P5_INSTANCE.clear(*args) return p5_clear def erase(*args): return _P5_INSTANCE.erase(*args) def noErase(*args): return _P5_INSTANCE.noErase(*args) def colorMode(*args): return _P5_INSTANCE.colorMode(*args) def fill(*args): return _P5_INSTANCE.fill(*args) def noFill(*args): return _P5_INSTANCE.noFill(*args) def noStroke(*args): return _P5_INSTANCE.noStroke(*args) def stroke(*args): return _P5_INSTANCE.stroke(*args) def arc(*args): return _P5_INSTANCE.arc(*args) def ellipse(*args): return _P5_INSTANCE.ellipse(*args) def circle(*args): return _P5_INSTANCE.circle(*args) def line(*args): return _P5_INSTANCE.line(*args) def point(*args): return _P5_INSTANCE.point(*args) def quad(*args): return _P5_INSTANCE.quad(*args) def rect(*args): return _P5_INSTANCE.rect(*args) def square(*args): return _P5_INSTANCE.square(*args) def triangle(*args): return _P5_INSTANCE.triangle(*args) def plane(*args): return _P5_INSTANCE.plane(*args) def box(*args): return _P5_INSTANCE.box(*args) def sphere(*args): return _P5_INSTANCE.sphere(*args) def cylinder(*args): return _P5_INSTANCE.cylinder(*args) def cone(*args): return _P5_INSTANCE.cone(*args) def ellipsoid(*args): return _P5_INSTANCE.ellipsoid(*args) def torus(*args): return _P5_INSTANCE.torus(*args) def loadModel(*args): return _P5_INSTANCE.loadModel(*args) def model(*args): return _P5_INSTANCE.model(*args) def ellipseMode(*args): return _P5_INSTANCE.ellipseMode(*args) def noSmooth(*args): return _P5_INSTANCE.noSmooth(*args) def rectMode(*args): return _P5_INSTANCE.rectMode(*args) def smooth(*args): return _P5_INSTANCE.smooth(*args) def strokeCap(*args): return _P5_INSTANCE.strokeCap(*args) def strokeJoin(*args): return _P5_INSTANCE.strokeJoin(*args) def strokeWeight(*args): return _P5_INSTANCE.strokeWeight(*args) def bezier(*args): return _P5_INSTANCE.bezier(*args) def bezierDetail(*args): return _P5_INSTANCE.bezierDetail(*args) def bezierPoint(*args): return _P5_INSTANCE.bezierPoint(*args) def bezierTangent(*args): return _P5_INSTANCE.bezierTangent(*args) def curve(*args): return _P5_INSTANCE.curve(*args) def curveDetail(*args): return _P5_INSTANCE.curveDetail(*args) def curveTightness(*args): return _P5_INSTANCE.curveTightness(*args) def curvePoint(*args): return _P5_INSTANCE.curvePoint(*args) def curveTangent(*args): return _P5_INSTANCE.curveTangent(*args) def beginContour(*args): return _P5_INSTANCE.beginContour(*args) def beginShape(*args): return _P5_INSTANCE.beginShape(*args) def bezierVertex(*args): return _P5_INSTANCE.bezierVertex(*args) def curveVertex(*args): return _P5_INSTANCE.curveVertex(*args) def endContour(*args): return _P5_INSTANCE.endContour(*args) def endShape(*args): return _P5_INSTANCE.endShape(*args) def quadraticVertex(*args): return _P5_INSTANCE.quadraticVertex(*args) def vertex(*args): return _P5_INSTANCE.vertex(*args) def cursor(*args): return _P5_INSTANCE.cursor(*args) def frameRate(*args): return _P5_INSTANCE.frameRate(*args) def noCursor(*args): return _P5_INSTANCE.noCursor(*args) def fullscreen(*args): return _P5_INSTANCE.fullscreen(*args) def pixelDensity(*args): return _P5_INSTANCE.pixelDensity(*args) def displayDensity(*args): return _P5_INSTANCE.displayDensity(*args) def getURL(*args): return _P5_INSTANCE.getURL(*args) def getURLPath(*args): return _P5_INSTANCE.getURLPath(*args) def getURLParams(*args): return _P5_INSTANCE.getURLParams(*args) def remove(*args): return _P5_INSTANCE.remove(*args) def noLoop(*args): return _P5_INSTANCE.noLoop(*args) def loop(*args): return _P5_INSTANCE.loop(*args) def push(*args): return _P5_INSTANCE.push(*args) def redraw(*args): return _P5_INSTANCE.redraw(*args) def resizeCanvas(*args): return _P5_INSTANCE.resizeCanvas(*args) def noCanvas(*args): return _P5_INSTANCE.noCanvas(*args) def createGraphics(*args): return _P5_INSTANCE.createGraphics(*args) def blendMode(*args): return _P5_INSTANCE.blendMode(*args) def setAttributes(*args): return _P5_INSTANCE.setAttributes(*args) def applyMatrix(*args): return _P5_INSTANCE.applyMatrix(*args) def resetMatrix(*args): return _P5_INSTANCE.resetMatrix(*args) def rotate(*args): return _P5_INSTANCE.rotate(*args) def rotateX(*args): return _P5_INSTANCE.rotateX(*args) def rotateY(*args): return _P5_INSTANCE.rotateY(*args) def rotateZ(*args): return _P5_INSTANCE.rotateZ(*args) def scale(*args): return _P5_INSTANCE.scale(*args) def shearX(*args): return _P5_INSTANCE.shearX(*args) def shearY(*args): return _P5_INSTANCE.shearY(*args) def translate(*args): return _P5_INSTANCE.translate(*args) def createStringDict(*args): return _P5_INSTANCE.createStringDict(*args) def createNumberDict(*args): return _P5_INSTANCE.createNumberDict(*args) def append(*args): return _P5_INSTANCE.append(*args) def arrayCopy(*args): return _P5_INSTANCE.arrayCopy(*args) def concat(*args): return _P5_INSTANCE.concat(*args) def reverse(*args): return _P5_INSTANCE.reverse(*args) def shorten(*args): return _P5_INSTANCE.shorten(*args) def shuffle(*args): return _P5_INSTANCE.shuffle(*args) def sort(*args): return _P5_INSTANCE.sort(*args) def splice(*args): return _P5_INSTANCE.splice(*args) def subset(*args): return _P5_INSTANCE.subset(*args) def float(*args): return _P5_INSTANCE.float(*args) def int(*args): return _P5_INSTANCE.int(*args) def str(*args): return _P5_INSTANCE.str(*args) def boolean(*args): return _P5_INSTANCE.boolean(*args) def byte(*args): return _P5_INSTANCE.byte(*args) def char(*args): return _P5_INSTANCE.char(*args) def unchar(*args): return _P5_INSTANCE.unchar(*args) def hex(*args): return _P5_INSTANCE.hex(*args) def unhex(*args): return _P5_INSTANCE.unhex(*args) def join(*args): return _P5_INSTANCE.join(*args) def match(*args): return _P5_INSTANCE.match(*args) def matchAll(*args): return _P5_INSTANCE.matchAll(*args) def nf(*args): return _P5_INSTANCE.nf(*args) def nfc(*args): return _P5_INSTANCE.nfc(*args) def nfp(*args): return _P5_INSTANCE.nfp(*args) def nfs(*args): return _P5_INSTANCE.nfs(*args) def split(*args): return _P5_INSTANCE.split(*args) def splitTokens(*args): return _P5_INSTANCE.splitTokens(*args) def trim(*args): return _P5_INSTANCE.trim(*args) def setMoveThreshold(*args): return _P5_INSTANCE.setMoveThreshold(*args) def setShakeThreshold(*args): return _P5_INSTANCE.setShakeThreshold(*args) def keyIsDown(*args): return _P5_INSTANCE.keyIsDown(*args) def createImage(*args): return _P5_INSTANCE.createImage(*args) def saveCanvas(*args): return _P5_INSTANCE.saveCanvas(*args) def saveFrames(*args): return _P5_INSTANCE.saveFrames(*args) def loadImage(*args): return _P5_INSTANCE.loadImage(*args) def image(*args): return _P5_INSTANCE.image(*args) def tint(*args): return _P5_INSTANCE.tint(*args) def noTint(*args): return _P5_INSTANCE.noTint(*args) def imageMode(*args): return _P5_INSTANCE.imageMode(*args) def blend(*args): return _P5_INSTANCE.blend(*args) def copy(*args): return _P5_INSTANCE.copy(*args) def filter(*args): if len(args) > 1 and (args[0] is None or callable(args[0])): return PythonFunctions.filter(*args) else: return _P5_INSTANCE.filter(*args) def get(*args): return _P5_INSTANCE.get(*args) def loadPixels(*args): return _P5_INSTANCE.loadPixels(*args) def set(*args): if len(args) <= 1: return PythonFunctions.set(*args) else: return _P5_INSTANCE.set(*args) def updatePixels(*args): return _P5_INSTANCE.updatePixels(*args) def loadJSON(*args): return _P5_INSTANCE.loadJSON(*args) def loadStrings(*args): return _P5_INSTANCE.loadStrings(*args) def loadTable(*args): return _P5_INSTANCE.loadTable(*args) def loadXML(*args): return _P5_INSTANCE.loadXML(*args) def loadBytes(*args): return _P5_INSTANCE.loadBytes(*args) def httpGet(*args): return _P5_INSTANCE.httpGet(*args) def httpPost(*args): return _P5_INSTANCE.httpPost(*args) def httpDo(*args): return _P5_INSTANCE.httpDo(*args) def createWriter(*args): return _P5_INSTANCE.createWriter(*args) def save(*args): return _P5_INSTANCE.save(*args) def saveJSON(*args): return _P5_INSTANCE.saveJSON(*args) def saveStrings(*args): return _P5_INSTANCE.saveStrings(*args) def saveTable(*args): return _P5_INSTANCE.saveTable(*args) def day(*args): return _P5_INSTANCE.day(*args) def hour(*args): return _P5_INSTANCE.hour(*args) def minute(*args): return _P5_INSTANCE.minute(*args) def millis(*args): return _P5_INSTANCE.millis(*args) def month(*args): return _P5_INSTANCE.month(*args) def second(*args): return _P5_INSTANCE.second(*args) def year(*args): return _P5_INSTANCE.year(*args) def createVector(*args): return _P5_INSTANCE.createVector(*args) def abs(*args): return _P5_INSTANCE.abs(*args) def ceil(*args): return _P5_INSTANCE.ceil(*args) def constrain(*args): return _P5_INSTANCE.constrain(*args) def dist(*args): return _P5_INSTANCE.dist(*args) def exp(*args): return _P5_INSTANCE.exp(*args) def floor(*args): return _P5_INSTANCE.floor(*args) def lerp(*args): return _P5_INSTANCE.lerp(*args) def log(*args): return _P5_INSTANCE.log(*args) def mag(*args): return _P5_INSTANCE.mag(*args) def map(*args): if len(args) > 1 and callable(args[0]): return PythonFunctions.map(*args) else: return _P5_INSTANCE.map(*args) def max(*args): return _P5_INSTANCE.max(*args) def min(*args): return _P5_INSTANCE.min(*args) def norm(*args): return _P5_INSTANCE.norm(*args) def pow(*args): return _P5_INSTANCE.pow(*args) def round(*args): return _P5_INSTANCE.round(*args) def sq(*args): return _P5_INSTANCE.sq(*args) def sqrt(*args): return _P5_INSTANCE.sqrt(*args) def noise(*args): return _P5_INSTANCE.noise(*args) def noiseDetail(*args): return _P5_INSTANCE.noiseDetail(*args) def noiseSeed(*args): return _P5_INSTANCE.noiseSeed(*args) def randomSeed(*args): return _P5_INSTANCE.randomSeed(*args) def random(*args): return _P5_INSTANCE.random(*args) def randomGaussian(*args): return _P5_INSTANCE.randomGaussian(*args) def acos(*args): return _P5_INSTANCE.acos(*args) def asin(*args): return _P5_INSTANCE.asin(*args) def atan(*args): return _P5_INSTANCE.atan(*args) def atan2(*args): return _P5_INSTANCE.atan2(*args) def cos(*args): return _P5_INSTANCE.cos(*args) def sin(*args): return _P5_INSTANCE.sin(*args) def tan(*args): return _P5_INSTANCE.tan(*args) def degrees(*args): return _P5_INSTANCE.degrees(*args) def radians(*args): return _P5_INSTANCE.radians(*args) def angleMode(*args): return _P5_INSTANCE.angleMode(*args) def textAlign(*args): return _P5_INSTANCE.textAlign(*args) def textLeading(*args): return _P5_INSTANCE.textLeading(*args) def textSize(*args): return _P5_INSTANCE.textSize(*args) def textStyle(*args): return _P5_INSTANCE.textStyle(*args) def textWidth(*args): return _P5_INSTANCE.textWidth(*args) def textAscent(*args): return _P5_INSTANCE.textAscent(*args) def textDescent(*args): return _P5_INSTANCE.textDescent(*args) def loadFont(*args): return _P5_INSTANCE.loadFont(*args) def text(*args): return _P5_INSTANCE.text(*args) def textFont(*args): return _P5_INSTANCE.textFont(*args) def orbitControl(*args): return _P5_INSTANCE.orbitControl(*args) def debugMode(*args): return _P5_INSTANCE.debugMode(*args) def noDebugMode(*args): return _P5_INSTANCE.noDebugMode(*args) def ambientLight(*args): return _P5_INSTANCE.ambientLight(*args) def directionalLight(*args): return _P5_INSTANCE.directionalLight(*args) def pointLight(*args): return _P5_INSTANCE.pointLight(*args) def lights(*args): return _P5_INSTANCE.lights(*args) def loadShader(*args): return _P5_INSTANCE.loadShader(*args) def createShader(*args): return _P5_INSTANCE.createShader(*args) def shader(*args): return _P5_INSTANCE.shader(*args) def resetShader(*args): return _P5_INSTANCE.resetShader(*args) def normalMaterial(*args): return _P5_INSTANCE.normalMaterial(*args) def texture(*args): return _P5_INSTANCE.texture(*args) def textureMode(*args): return _P5_INSTANCE.textureMode(*args) def textureWrap(*args): return _P5_INSTANCE.textureWrap(*args) def ambientMaterial(*args): return _P5_INSTANCE.ambientMaterial(*args) def specularMaterial(*args): return _P5_INSTANCE.specularMaterial(*args) def shininess(*args): return _P5_INSTANCE.shininess(*args) def camera(*args): return _P5_INSTANCE.camera(*args) def perspective(*args): return _P5_INSTANCE.perspective(*args) def ortho(*args): return _P5_INSTANCE.ortho(*args) def createCamera(*args): return _P5_INSTANCE.createCamera(*args) def setCamera(*args): return _P5_INSTANCE.setCamera(*args) def select(*args): return _P5_INSTANCE.select(*args) def selectAll(*args): return _P5_INSTANCE.selectAll(*args) def removeElements(*args): return _P5_INSTANCE.removeElements(*args) def changed(*args): return _P5_INSTANCE.changed(*args) def input(*args): return _P5_INSTANCE.input(*args) def createDiv(*args): return _P5_INSTANCE.createDiv(*args) def createP(*args): return _P5_INSTANCE.createP(*args) def createSpan(*args): return _P5_INSTANCE.createSpan(*args) def createImg(*args): return _P5_INSTANCE.createImg(*args) def createA(*args): return _P5_INSTANCE.createA(*args) def createSlider(*args): return _P5_INSTANCE.createSlider(*args) def createButton(*args): return _P5_INSTANCE.createButton(*args) def createCheckbox(*args): return _P5_INSTANCE.createCheckbox(*args) def createSelect(*args): return _P5_INSTANCE.createSelect(*args) def createRadio(*args): return _P5_INSTANCE.createRadio(*args) def createColorPicker(*args): return _P5_INSTANCE.createColorPicker(*args) def createInput(*args): return _P5_INSTANCE.createInput(*args) def createFileInput(*args): return _P5_INSTANCE.createFileInput(*args) def createVideo(*args): return _P5_INSTANCE.createVideo(*args) def createAudio(*args): return _P5_INSTANCE.createAudio(*args) def createCapture(*args): return _P5_INSTANCE.createCapture(*args) def createElement(*args): return _P5_INSTANCE.createElement(*args) def createCanvas(*args): canvas = _P5_INSTANCE.createCanvas(*args) global width, height width = _P5_INSTANCE.width height = _P5_INSTANCE.height return canvas def __deviceMoved(e): try: _bind_event_function(deviceMoved, e) except NameError: pass def __deviceTurned(e): try: _bind_event_function(deviceTurned, e) except NameError: pass def __deviceShaken(e): try: _bind_event_function(deviceShaken, e) except NameError: pass def __touchEnded(e): try: _bind_event_function(deviceShaken, e) except NameError: pass def __touchStarted(e): try: _bind_event_function(touchStarted, e) except NameError: pass def __windowResized(e): try: _bind_event_function(windowResized, e) except NameError: pass def __touchMoved(e): try: _bind_event_function(touchMoved, e) except NameError: pass def __mouseMoved(e): try: _bind_event_function(mouseMoved, e) except NameError: pass def __mouseDragged(e): try: _bind_event_function(mouseDragged, e) except NameError: pass def __mousePressed(e): try: _bind_event_function(mousePressed, e) except NameError: pass def __mouseReleased(e): try: _bind_event_function(mouseReleased, e) except NameError: pass def __mouseClicked(e): try: _bind_event_function(mouseClicked, e) except NameError: pass def __doubleClicked(e): try: _bind_event_function(doubleClicked, e) except NameError: pass def __mouseWheel(e): try: _bind_event_function(mouseWheel, e) except NameError: pass def __keyPressed(e): try: _bind_event_function(keyPressed, e) except NameError: pass def __keyReleased(e): try: _bind_event_function(keyReleased, e) except NameError: pass def __keyTyped(e): try: _bind_event_function(keyTyped, e) except NameError: pass def __keyIsDown(e): try: _bind_event_function(keyIsDown, e) except NameError: pass def pop(*args): p5_pop = _P5_INSTANCE.pop(*args) return p5_pop # Processing Python or Java mode compatibility aliases size = createCanvas popMatrix = pop popStyle = pop pushMatrix = push pushStyle = push # PVector is a wrapper/helper class for p5.Vector objets # providing names similar to Processing Python or Java modes # but mostly keeping p5js functionality from numbers import Number class PVector: def __init__(self, x=0, y=0, z=0): self.__vector = createVector(x, y, z) self.add = self.__instance_add__ self.sub = self.__instance_sub__ self.mult = self.__instance_mult__ self.div = self.__instance_div__ self.cross = self.__instance_cross__ self.dist = self.__instance_dist__ self.dot = self.__instance_dot__ self.lerp = self.__instance_lerp__ @property def x(self): return self.__vector.x @x.setter def x(self, x): self.__vector.x = x @property def y(self): return self.__vector.y @y.setter def y(self, y): self.__vector.y = y @property def z(self): return self.__vector.z @z.setter def z(self, z): self.__vector.z = z def mag(self): return self.__vector.mag() def magSq(self): return self.__vector.magSq() def setMag(self, mag): self.__vector.setMag(mag) return self def normalize(self): self.__vector.normalize() return self def limit(self, max): self.__vector.limit(max) return self def heading(self): return self.__vector.heading() def rotate(self, angle): self.__vector.rotate(angle) return self def __instance_add__(self, *args): if len(args) == 1: return PVector.add(self, args[0], self) else: return PVector.add(self, PVector(*args), self) def __instance_sub__(self, *args): if len(args) == 1: return PVector.sub(self, args[0], self) else: return PVector.sub(self, PVector(*args), self) def __instance_mult__(self, o): return PVector.mult(self, o, self) def __instance_div__(self, f): return PVector.div(self, f, self) def __instance_cross__(self, o): return PVector.cross(self, o, self) def __instance_dist__(self, o): return PVector.dist(self, o) def __instance_dot__(self, *args): if len(args) == 1: v = args[0] else: v = args return self.x * v[0] + self.y * v[1] + self.z * v[2] def __instance_lerp__(self, *args): if len(args) == 2: return PVector.lerp(self, args[0], args[1], self) else: vx, vy, vz, f = args return PVector.lerp(self, PVector(vx, vy, vz), f, self) def get(self): return PVector(self.x, self.y, self.z) def copy(self): return PVector(self.x, self.y, self.z) def __getitem__(self, k): return getattr(self, ('x', 'y', 'z')[k]) def __setitem__(self, k, v): setattr(self, ('x', 'y', 'z')[k], v) def __copy__(self): return PVector(self.x, self.y, self.z) def __deepcopy__(self, memo): return PVector(self.x, self.y, self.z) def __repr__(self): # PROVISÓRIO return f'PVector({self.x}, {self.y}, {self.z})' def set(self, *args): """ Sets the x, y, and z component of the vector using two or three separate variables, the data from a p5.Vector, or the values from a float array. """ self.__vector.set(*args) @classmethod def add(cls, a, b, dest=None): if dest is None: return PVector(a.x + b[0], a.y + b[1], a.z + b[2]) dest.__vector.set(a.x + b[0], a.y + b[1], a.z + b[2]) return dest @classmethod def sub(cls, a, b, dest=None): if dest is None: return PVector(a.x - b[0], a.y - b[1], a.z - b[2]) dest.__vector.set(a.x - b[0], a.y - b[1], a.z - b[2]) return dest @classmethod def mult(cls, a, b, dest=None): if dest is None: return PVector(a.x * b, a.y * b, a.z * b) dest.__vector.set(a.x * b, a.y * b, a.z * b) return dest @classmethod def div(cls, a, b, dest=None): if dest is None: return PVector(a.x / b, a.y / b, a.z / b) dest.__vector.set(a.x / b, a.y / b, a.z / b) return dest @classmethod def dist(cls, a, b): return a.__vector.dist(b.__vector) @classmethod def dot(cls, a, b): return a.__vector.dot(b.__vector) def __add__(a, b): return PVector.add(a, b, None) def __sub__(a, b): return PVector.sub(a, b, None) def __isub__(a, b): a.sub(b) return a def __iadd__(a, b): a.add(b) return a def __mul__(a, b): if not isinstance(b, Number): raise TypeError( "The * operator can only be used to multiply a PVector by a number") return PVector.mult(a, float(b), None) def __rmul__(a, b): if not isinstance(b, Number): raise TypeError( "The * operator can only be used to multiply a PVector by a number") return PVector.mult(a, float(b), None) def __imul__(a, b): if not isinstance(b, Number): raise TypeError( "The *= operator can only be used to multiply a PVector by a number") a.__vector.mult(float(b)) return a def __truediv__(a, b): if not isinstance(b, Number): raise TypeError( "The * operator can only be used to multiply a PVector by a number") return PVector(a.x / float(b), a.y / float(b), a.z / float(b)) def __itruediv__(a, b): if not isinstance(b, Number): raise TypeError( "The /= operator can only be used to multiply a PVector by a number") a.__vector.set(a.x / float(b), a.y / float(b), a.z / float(b)) return a def __eq__(a, b): return a.x == b[0] and a.y == b[1] and a.z == b[2] def __lt__(a, b): return a.magSq() < b.magSq() def __le__(a, b): return a.magSq() <= b.magSq() def __gt__(a, b): return a.magSq() > b.magSq() def __ge__(a, b): return a.magSq() >= b.magSq() # Problematic class methods, we would rather use p5.Vector when possible... @classmethod def lerp(cls, a, b, f, dest=None): v = createVector(a.x, a.y, a.z) v.lerp(b.__vector, f) if dest is None: return PVector(v.x, v.y, v.z) dest.set(v.x, v.y, v.z) return dest @classmethod def cross(cls, a, b, dest=None): x = a.y * b[2] - b[1] * a.z y = a.z * b[0] - b[2] * a.x z = a.x * b[1] - b[0] * a.y if dest is None: return PVector(x, y, z) dest.set(x, y, z) return dest @classmethod def fromAngle(cls, angle, length=1): # https://github.com/processing/p5.js/blob/3f0b2f0fe575dc81c724474154f5b23a517b7233/src/math/p5.Vector.js return PVector(length * cos(angle), length * sin(angle), 0) @classmethod def fromAngles(theta, phi, length=1): # https://github.com/processing/p5.js/blob/3f0b2f0fe575dc81c724474154f5b23a517b7233/src/math/p5.Vector.js cosPhi = cos(phi) sinPhi = sin(phi) cosTheta = cos(theta) sinTheta = sin(theta) return PVector(length * sinTheta * sinPhi, -length * cosTheta, length * sinTheta * cosPhi) @classmethod def random2D(cls): return PVector.fromAngle(random(TWO_PI)) @classmethod def random3D(cls, dest=None): angle = random(TWO_PI) vz = random(2) - 1 mult = sqrt(1 - vz * vz) vx = mult * cos(angle) vy = mult * sin(angle) if dest is None: return PVector(vx, vy, vz) dest.set(vx, vy, vz) return dest @classmethod def angleBetween(cls, a, b): return acos(a.dot(b) / sqrt(a.magSq() * b.magSq())) # Other harmless p5js methods def equals(self, v): return self == v def heading2D(self): return self.__vector.heading() def reflect(self, *args): # Reflect the incoming vector about a normal to a line in 2D, or about # a normal to a plane in 3D This method acts on the vector directly r = self.__vector.reflect(*args) return r def array(self): # Return a representation of this vector as a float array. This is only # for temporary use. If used in any w fashion, the contents should be # copied by using the p5.Vector.copy() method to copy into your own # array. return self.__vector.array() def toString(self): # Returns a string representation of a vector v by calling String(v) or v.toString(). # return self.__vector.toString() would be something like "p5.vector # Object […, …, …]" return str(self) def rem(self, *args): # Gives remainder of a vector when it is divided by anw vector. See # examples for more context. self.__vector.rem(*args) return self def pre_draw(p5_instance, draw_func, *args, **kwargs): """ We need to run this before the actual draw to insert and update p5 env variables """ global _CTX_MIDDLE, _DEFAULT_FILL, _DEFAULT_LEADMULT, _DEFAULT_STROKE, _DEFAULT_TEXT_FILL global ADD, ALT, ARROW, AUTO, AUDIO, AXES, BACKSPACE, BASELINE, BEVEL, BEZIER, BLEND, BLUR, BOLD, BOLDITALIC global BOTTOM, BURN, CENTER, CHORD, CLAMP, CLOSE, CONTROL, CORNER, CORNERS, CROSS, CURVE, DARKEST global DEG_TO_RAD, DEGREES, DELETE, DIFFERENCE, DILATE, DODGE, DOWN_ARROW, ENTER, ERODE, ESCAPE, EXCLUSION global FILL, GRAY, GRID, HALF_PI, HAND, HARD_LIGHT, HSB, HSL, IMAGE, IMMEDIATE, INVERT, ITALIC, LANDSCAPE global LEFT, LEFT_ARROW, LIGHTEST, LINE_LOOP, LINE_STRIP, LINEAR, LINES, MIRROR, MITER, MOVE, MULTIPLY, NEAREST global NORMAL, OPAQUE, OPEN, OPTION, OVERLAY, P2D, P3D, PI, PIE, POINTS, PORTRAIT, POSTERIZE, PROJECT, QUAD_STRIP global QUADRATIC, QUADS, QUARTER_PI, RAD_TO_DEG, RADIANS, RADIUS, REPEAT, REPLACE, RETURN, RGB, RIGHT, RIGHT_ARROW global ROUND, SCREEN, SHIFT, SOFT_LIGHT, SQUARE, STROKE, SUBTRACT, TAB, TAU, TEXT, TEXTURE, THRESHOLD, TOP global TRIANGLE_FAN, TRIANGLE_STRIP, TRIANGLES, TWO_PI, UP_ARROW, VIDEO, WAIT, WEBGL global frameCount, focused, displayWidth, displayHeight, windowWidth, windowHeight, width, height global deviceOrientation, accelerationX, accelerationY, accelerationZ global pAccelerationX, pAccelerationY, pAccelerationZ, rotationX, rotationY, rotationZ global pRotationX, pRotationY, pRotationZ, turnAxis, keyIsPressed, key, keyCode, mouseX, mouseY, pmouseX, pmouseY global winMouseX, winMouseY, pwinMouseX, pwinMouseY, mouseButton, mouseIsPressed, touches, pixels _CTX_MIDDLE = p5_instance._CTX_MIDDLE _DEFAULT_FILL = p5_instance._DEFAULT_FILL _DEFAULT_LEADMULT = p5_instance._DEFAULT_LEADMULT _DEFAULT_STROKE = p5_instance._DEFAULT_STROKE _DEFAULT_TEXT_FILL = p5_instance._DEFAULT_TEXT_FILL ADD = p5_instance.ADD ALT = p5_instance.ALT ARROW = p5_instance.ARROW AUDIO = p5_instance.AUDIO AUTO = p5_instance.AUTO AXES = p5_instance.AXES BACKSPACE = p5_instance.BACKSPACE BASELINE = p5_instance.BASELINE BEVEL = p5_instance.BEVEL BEZIER = p5_instance.BEZIER BLEND = p5_instance.BLEND BLUR = p5_instance.BLUR BOLD = p5_instance.BOLD BOLDITALIC = p5_instance.BOLDITALIC BOTTOM = p5_instance.BOTTOM BURN = p5_instance.BURN CENTER = p5_instance.CENTER CHORD = p5_instance.CHORD CLAMP = p5_instance.CLAMP CLOSE = p5_instance.CLOSE CONTROL = p5_instance.CONTROL CORNER = p5_instance.CORNER CORNERS = p5_instance.CORNERS CROSS = p5_instance.CROSS CURVE = p5_instance.CURVE DARKEST = p5_instance.DARKEST DEG_TO_RAD = p5_instance.DEG_TO_RAD DEGREES = p5_instance.DEGREES DELETE = p5_instance.DELETE DIFFERENCE = p5_instance.DIFFERENCE DILATE = p5_instance.DILATE DODGE = p5_instance.DODGE DOWN_ARROW = p5_instance.DOWN_ARROW ENTER = p5_instance.ENTER ERODE = p5_instance.ERODE ESCAPE = p5_instance.ESCAPE EXCLUSION = p5_instance.EXCLUSION FILL = p5_instance.FILL GRAY = p5_instance.GRAY GRID = p5_instance.GRID HALF_PI = p5_instance.HALF_PI HAND = p5_instance.HAND HARD_LIGHT = p5_instance.HARD_LIGHT HSB = p5_instance.HSB HSL = p5_instance.HSL IMAGE = p5_instance.IMAGE IMMEDIATE = p5_instance.IMMEDIATE INVERT = p5_instance.INVERT ITALIC = p5_instance.ITALIC LANDSCAPE = p5_instance.LANDSCAPE LEFT = p5_instance.LEFT LEFT_ARROW = p5_instance.LEFT_ARROW LIGHTEST = p5_instance.LIGHTEST LINE_LOOP = p5_instance.LINE_LOOP LINE_STRIP = p5_instance.LINE_STRIP LINEAR = p5_instance.LINEAR LINES = p5_instance.LINES MIRROR = p5_instance.MIRROR MITER = p5_instance.MITER MOVE = p5_instance.MOVE MULTIPLY = p5_instance.MULTIPLY NEAREST = p5_instance.NEAREST NORMAL = p5_instance.NORMAL OPAQUE = p5_instance.OPAQUE OPEN = p5_instance.OPEN OPTION = p5_instance.OPTION OVERLAY = p5_instance.OVERLAY P2D = p5_instance.P2D P3D = p5_instance.WEBGL PI = p5_instance.PI PIE = p5_instance.PIE POINTS = p5_instance.POINTS PORTRAIT = p5_instance.PORTRAIT POSTERIZE = p5_instance.POSTERIZE PROJECT = p5_instance.PROJECT QUAD_STRIP = p5_instance.QUAD_STRIP QUADRATIC = p5_instance.QUADRATIC QUADS = p5_instance.QUADS QUARTER_PI = p5_instance.QUARTER_PI RAD_TO_DEG = p5_instance.RAD_TO_DEG RADIANS = p5_instance.RADIANS RADIUS = p5_instance.RADIUS REPEAT = p5_instance.REPEAT REPLACE = p5_instance.REPLACE RETURN = p5_instance.RETURN RGB = p5_instance.RGB RIGHT = p5_instance.RIGHT RIGHT_ARROW = p5_instance.RIGHT_ARROW ROUND = p5_instance.ROUND SCREEN = p5_instance.SCREEN SHIFT = p5_instance.SHIFT SOFT_LIGHT = p5_instance.SOFT_LIGHT SQUARE = p5_instance.SQUARE STROKE = p5_instance.STROKE SUBTRACT = p5_instance.SUBTRACT TAB = p5_instance.TAB TAU = p5_instance.TAU TEXT = p5_instance.TEXT TEXTURE = p5_instance.TEXTURE THRESHOLD = p5_instance.THRESHOLD TOP = p5_instance.TOP TRIANGLE_FAN = p5_instance.TRIANGLE_FAN TRIANGLE_STRIP = p5_instance.TRIANGLE_STRIP TRIANGLES = p5_instance.TRIANGLES TWO_PI = p5_instance.TWO_PI UP_ARROW = p5_instance.UP_ARROW VIDEO = p5_instance.VIDEO WAIT = p5_instance.WAIT WEBGL = p5_instance.WEBGL frameCount = p5_instance.frameCount focused = p5_instance.focused displayWidth = p5_instance.displayWidth displayHeight = p5_instance.displayHeight windowWidth = p5_instance.windowWidth windowHeight = p5_instance.windowHeight width = p5_instance.width height = p5_instance.height deviceOrientation = p5_instance.deviceOrientation accelerationX = p5_instance.accelerationX accelerationY = p5_instance.accelerationY accelerationZ = p5_instance.accelerationZ pAccelerationX = p5_instance.pAccelerationX pAccelerationY = p5_instance.pAccelerationY pAccelerationZ = p5_instance.pAccelerationZ rotationX = p5_instance.rotationX rotationY = p5_instance.rotationY rotationZ = p5_instance.rotationZ pRotationX = p5_instance.pRotationX pRotationY = p5_instance.pRotationY pRotationZ = p5_instance.pRotationZ turnAxis = p5_instance.turnAxis keyIsPressed = p5_instance.keyIsPressed key = p5_instance.key keyCode = p5_instance.keyCode mouseX = p5_instance.mouseX mouseY = p5_instance.mouseY pmouseX = p5_instance.pmouseX pmouseY = p5_instance.pmouseY winMouseX = p5_instance.winMouseX winMouseY = p5_instance.winMouseY pwinMouseX = p5_instance.pwinMouseX pwinMouseY = p5_instance.pwinMouseY mouseButton = p5_instance.mouseButton mouseIsPressed = p5_instance.mouseIsPressed touches = p5_instance.touches pixels = p5_instance.pixels return draw_func(*args, **kwargs) def global_p5_injection(p5_sketch): """ Injects the p5js's skecth instance as a global variable to setup and draw functions """ def decorator(f, *args, **kwargs): def wrapper(*args, **kwargs): global _P5_INSTANCE _P5_INSTANCE = p5_sketch return pre_draw(_P5_INSTANCE, f, *args, **kwargs) return wrapper return decorator def start_p5(preload_func, setup_func, draw_func, event_functions): """ This is the entrypoint function. It accepts 2 parameters: - preload_func: A Python preload callable - setup_func: a Python setup callable - draw_func: a Python draw callable - event_functions: a config dict for the event functions in the format: {"eventFunctionName": python_event_function} This method gets the p5js's sketch instance and injects them """ def sketch_setup(p5_sketch): """ Callback function called to configure new p5 instance """ p5_sketch.preload = global_p5_injection(p5_sketch)(preload_func) p5_sketch.setup = global_p5_injection(p5_sketch)(setup_func) p5_sketch.draw = global_p5_injection(p5_sketch)(draw_func) window.instance = p5.new(sketch_setup, 'sketch-holder') # Register event functions event_function_names = ( "deviceMoved", "deviceTurned", "deviceShaken", "windowResized", "keyPressed", "keyReleased", "keyTyped", "mousePressed", "mouseReleased", "mouseClicked", "doubleClicked", "mouseMoved", "mouseDragged", "mouseWheel", "touchStarted", "touchMoved", "touchEnded", "keyIsDown", ) for f_name in [f for f in event_function_names if event_functions.get(f, None)]: func = event_functions[f_name] event_func = global_p5_injection(window.instance)(func) setattr(window.instance, f_name, event_func) `; const placeholder = ` def preload(): pass def setup(): pass def draw(): pass deviceMoved = None deviceTurned = None deviceShaken = None keyPressed = None keyReleased = None keyTyped = None mouseMoved = None mouseDragged = None mousePressed = None mouseReleased = None mouseClicked = None doubleClicked = None mouseWheel = None touchStarted = None touchMoved = None touchEnded = None windowResized = None `; let userCode = ` #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ @author: A.Akdogan """ from random import randint import os import sys import time from time import sleep print(sys.path) class Node: def __init__(self, x, y): self.x = x self.y = y self.f = 0 self.g = 0 self.h = 0 self.neighbors = [] self.previous = None self. obstacle = False def add_neighbors(self,grid, columns, rows): neighbor_x = self.x neighbor_y = self.y if neighbor_x < columns - 1: self.neighbors.append(grid[neighbor_x+1][neighbor_y]) if neighbor_x > 0: self.neighbors.append(grid[neighbor_x-1][neighbor_y]) if neighbor_y < rows -1: self.neighbors.append(grid[neighbor_x][neighbor_y +1]) if neighbor_y > 0: self.neighbors.append(grid[neighbor_x][neighbor_y-1]) #diagonals """ if neighbor_x > 0 and neighbor_y > 0: self.neighbors.append(grid[neighbor_x-1][neighbor_y-1]) if neighbor_x < columns -1 and neighbor_y > 0: self.neighbors.append(grid[neighbor_x+1][neighbor_y-1]) if neighbor_x > 0 and neighbor_y 0: open_set, closed_set, current_node, final_path = AStar.start_path(open_set, closed_set, current_node, self.end) if len(final_path) > 0: break return final_path cols = 25 rows = 25 start = [0,0] end = [24,24] open_set = [] closed_set = [] current_node = None final_path = [] grid = [] def show_func(grid_element,color, width,height): if grid_element.obstacle == True: fill("black") else: fill(color) noStroke() rect(grid_element.x * width, grid_element.y * height, width-1 , height-1) def setup(): global grid createCanvas(500, 500) background(160) flag = False def draw(): global grid global end global open_set global closed_set global final_path global current_node global flag global start global cols global rows frameRate(60) w = width / cols h = height / rows if flag == False: grid = AStar.create_grid(cols, rows) grid = AStar.fill_grids(grid, cols, rows, obstacle_ratio = 30) grid = AStar.get_neighbors(grid, cols, rows) start = grid[start[0]][start[1]] end = grid[end[0]][end[1]] end.obstacle = False start.obstacle = False background(0) for i in range(cols): for j in range(rows): show_func(grid[i][j], color(255),w,h) stroke(0,0,0) line(0, 0, 0, width) line(0,0,height, 1) open_set.append(start) flag = True if len(open_set) > 0: open_set, closed_set, current_node, final_path = AStar.start_path(open_set, closed_set, current_node, end) #grid show_func(start, "green", w,h) show_func(end, "red",w,h) for i in range(len(open_set)): #show_func(open_set[i], "#00ffbf",w,h) show_func(open_set[i], "#00ffbf",w,h) for i in range(len(closed_set)): show_func(closed_set[i], "#ffa500",w,h) show_func(start, "green", w,h) show_func(current_node, "#8a2be2",w,h) if len(open_set) == 0: print("No way!") #noLoop() frameRate(1) cols = 25 rows = 25 start = [0,0] end = [24,24] open_set = [] closed_set = [] current_node = None final_path = [] grid = [] flag = False if len(final_path) > 0: for i in range(len(final_path)): show_func(final_path[i], "#8a2be2",w,h) #show_func(final_path[i], "red",w,h) show_func(start, "green", w,h) show_func(end, "red",w,h) print("Done!!") frameRate(1) cols = 25 rows = 25 start = [0,0] end = [24,24] open_set = [] closed_set = [] current_node = None final_path = [] grid = [] flag = False `; const startCode = ` event_functions = { "deviceMoved": deviceMoved, "deviceTurned": deviceTurned, "deviceShaken": deviceShaken, "keyPressed": keyPressed, "keyReleased": keyReleased, "keyTyped": keyTyped, "mouseMoved": mouseMoved, "mouseDragged": mouseDragged, "mousePressed": mousePressed, "mouseReleased": mouseReleased, "mouseClicked": mouseClicked, "doubleClicked": doubleClicked, "mouseWheel": mouseWheel, "touchStarted": touchStarted, "touchMoved": touchMoved, "touchEnded": touchEnded, "windowResized": windowResized, } start_p5(preload, setup, draw, event_functions) `; function runCode() { let code = [ placeholder, userCode, wrapperContent, startCode, ].join('\n'); if (window.instance) { window.instance.canvas.remove(); } console.log("Python execution output:"); window.pyodide.runPython(code); } async function main() { const config = { indexURL : "https://cdn.jsdelivr.net/pyodide/v0.18.1/full/", fullStdLib: false, } window.pyodide = await loadPyodide(config); // Pyodide is now ready to use... console.log(window.pyodide.runPython(` import io, code, sys from js import p5, window, document print(sys.version) `)); window.runSketchCode = (code) => { userCode = code; runCode(); } runCode(); }; // async method main(); ================================================ FILE: docs/examples/sketch_000/index.html ================================================ sketch_000 - pyp5js
================================================ FILE: docs/examples/sketch_000/sketch_000.py ================================================ from pyp5js import * def setup(): createCanvas(200, 200) def draw(): background(200) diameter = sin(frameCount / 60) * 50 + 50 fill("blue") ellipse(100, 100, diameter, diameter) ================================================ FILE: docs/examples/sketch_000/static/p5.js ================================================ /*! p5.js v1.0.0 February 29, 2020 */ !function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).p5=e()}}(function(){return function o(a,s,l){function u(t,e){if(!s[t]){if(!a[t]){var r="function"==typeof require&&require;if(!e&&r)return r(t,!0);if(h)return h(t,!0);var i=new Error("Cannot find module '"+t+"'");throw i.code="MODULE_NOT_FOUND",i}var n=s[t]={exports:{}};a[t][0].call(n.exports,function(e){return u(a[t][1][e]||e)},n,n.exports,o,a,s,l)}return s[t].exports}for(var h="function"==typeof require&&require,e=0;e>16&255,a[s++]=t>>8&255,a[s++]=255&t;2===o&&(t=u[e.charCodeAt(r)]<<2|u[e.charCodeAt(r+1)]>>4,a[s++]=255&t);1===o&&(t=u[e.charCodeAt(r)]<<10|u[e.charCodeAt(r+1)]<<4|u[e.charCodeAt(r+2)]>>2,a[s++]=t>>8&255,a[s++]=255&t);return a},r.fromByteArray=function(e){for(var t,r=e.length,i=r%3,n=[],o=0,a=r-i;o>2]+s[t<<4&63]+"==")):2==i&&(t=(e[r-2]<<8)+e[r-1],n.push(s[t>>10]+s[t>>4&63]+s[t<<2&63]+"="));return n.join("")};for(var s=[],u=[],h="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=0,o=i.length;n>18&63]+s[n>>12&63]+s[n>>6&63]+s[63&n]);return o.join("")}u["-".charCodeAt(0)]=62,u["_".charCodeAt(0)]=63},{}],20:[function(e,t,r){},{}],21:[function(N,e,F){(function(c){"use strict";var i=N("base64-js"),o=N("ieee754"),e="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;F.Buffer=c,F.SlowBuffer=function(e){+e!=e&&(e=0);return c.alloc(+e)},F.INSPECT_MAX_BYTES=50;var r=2147483647;function a(e){if(r>>1;case"base64":return O(e).length;default:if(n)return i?-1:R(e).length;t=(""+t).toLowerCase(),n=!0}}function d(e,t,r){var i=e[t];e[t]=e[r],e[r]=i}function p(e,t,r,i,n){if(0===e.length)return-1;if("string"==typeof r?(i=r,r=0):2147483647=e.length){if(n)return-1;r=e.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof t&&(t=c.from(t,i)),c.isBuffer(t))return 0===t.length?-1:m(e,t,r,i,n);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):m(e,[t],r,i,n);throw new TypeError("val must be string, number or Buffer")}function m(e,t,r,i,n){var o,a=1,s=e.length,l=t.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(e.length<2||t.length<2)return-1;s/=a=2,l/=2,r/=2}function u(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(n){var h=-1;for(o=r;o>8,n=r%256,o.push(n),o.push(i);return o}(t,e.length-r),e,r,i)}function b(e,t,r){return 0===t&&r===e.length?i.fromByteArray(e):i.fromByteArray(e.slice(t,r))}function _(e,t,r){r=Math.min(e.length,r);for(var i=[],n=t;n>>10&1023|55296),h=56320|1023&h),i.push(h),n+=c}return function(e){var t=e.length;if(t<=x)return String.fromCharCode.apply(String,e);var r="",i=0;for(;ithis.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e=e||"utf8";;)switch(e){case"hex":return M(this,t,r);case"utf8":case"utf-8":return _(this,t,r);case"ascii":return w(this,t,r);case"latin1":case"binary":return S(this,t,r);case"base64":return b(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,t,r);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}.apply(this,arguments)},c.prototype.equals=function(e){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===c.compare(this,e)},c.prototype.inspect=function(){var e="",t=F.INSPECT_MAX_BYTES;return e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(e+=" ... "),""},e&&(c.prototype[e]=c.prototype.inspect),c.prototype.compare=function(e,t,r,i,n){if(A(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),t<0||r>e.length||i<0||n>this.length)throw new RangeError("out of range index");if(n<=i&&r<=t)return 0;if(n<=i)return-1;if(r<=t)return 1;if(this===e)return 0;for(var o=(n>>>=0)-(i>>>=0),a=(r>>>=0)-(t>>>=0),s=Math.min(o,a),l=this.slice(i,n),u=e.slice(t,r),h=0;h>>=0,isFinite(r)?(r>>>=0,void 0===i&&(i="utf8")):(i=r,r=void 0)}var n=this.length-t;if((void 0===r||nthis.length)throw new RangeError("Attempt to write outside buffer bounds");i=i||"utf8";for(var o,a,s,l,u,h,c=!1;;)switch(i){case"hex":return g(this,e,t,r);case"utf8":case"utf-8":return u=t,h=r,D(R(e,(l=this).length-u),l,u,h);case"ascii":return v(this,e,t,r);case"latin1":case"binary":return v(this,e,t,r);case"base64":return o=this,a=t,s=r,D(O(e),o,a,s);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return y(this,e,t,r);default:if(c)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),c=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var x=4096;function w(e,t,r){var i="";r=Math.min(e.length,r);for(var n=t;ne.length)throw new RangeError("Index out of range")}function P(e,t,r,i){if(r+i>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function L(e,t,r,i,n){return t=+t,r>>>=0,n||P(e,0,r,4),o.write(e,t,r,i,23,4),r+4}function k(e,t,r,i,n){return t=+t,r>>>=0,n||P(e,0,r,8),o.write(e,t,r,i,52,8),r+8}c.prototype.slice=function(e,t){var r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):r>>=0,t>>>=0,r||T(e,t,this.length);for(var i=this[e],n=1,o=0;++o>>=0,t>>>=0,r||T(e,t,this.length);for(var i=this[e+--t],n=1;0>>=0,t||T(e,1,this.length),this[e]},c.prototype.readUInt16LE=function(e,t){return e>>>=0,t||T(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUInt16BE=function(e,t){return e>>>=0,t||T(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUInt32LE=function(e,t){return e>>>=0,t||T(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUInt32BE=function(e,t){return e>>>=0,t||T(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||T(e,t,this.length);for(var i=this[e],n=1,o=0;++o>>=0,t>>>=0,r||T(e,t,this.length);for(var i=t,n=1,o=this[e+--i];0>>=0,t||T(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){e>>>=0,t||T(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(e,t){e>>>=0,t||T(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(e,t){return e>>>=0,t||T(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return e>>>=0,t||T(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readFloatLE=function(e,t){return e>>>=0,t||T(e,4,this.length),o.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return e>>>=0,t||T(e,4,this.length),o.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return e>>>=0,t||T(e,8,this.length),o.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return e>>>=0,t||T(e,8,this.length),o.read(this,e,!1,52,8)},c.prototype.writeUIntLE=function(e,t,r,i){e=+e,t>>>=0,r>>>=0,i||C(this,e,t,r,Math.pow(2,8*r)-1,0);var n=1,o=0;for(this[t]=255&e;++o>>=0,r>>>=0,i||C(this,e,t,r,Math.pow(2,8*r)-1,0);var n=r-1,o=1;for(this[t+n]=255&e;0<=--n&&(o*=256);)this[t+n]=e/o&255;return t+r},c.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,1,255,0),this[t]=255&e,t+1},c.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},c.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeIntLE=function(e,t,r,i){if(e=+e,t>>>=0,!i){var n=Math.pow(2,8*r-1);C(this,e,t,r,n-1,-n)}var o=0,a=1,s=0;for(this[t]=255&e;++o>0)-s&255;return t+r},c.prototype.writeIntBE=function(e,t,r,i){if(e=+e,t>>>=0,!i){var n=Math.pow(2,8*r-1);C(this,e,t,r,n-1,-n)}var o=r-1,a=1,s=0;for(this[t+o]=255&e;0<=--o&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+r},c.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},c.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeFloatLE=function(e,t,r){return L(this,e,t,!0,r)},c.prototype.writeFloatBE=function(e,t,r){return L(this,e,t,!1,r)},c.prototype.writeDoubleLE=function(e,t,r){return k(this,e,t,!0,r)},c.prototype.writeDoubleBE=function(e,t,r){return k(this,e,t,!1,r)},c.prototype.copy=function(e,t,r,i){if(!c.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r=r||0,i||0===i||(i=this.length),t>=e.length&&(t=e.length),t=t||0,0=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t>>=0,r=void 0===r?this.length:r>>>0,"number"==typeof(e=e||0))for(o=t;o>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function O(e){return i.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(t,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function D(e,t,r,i){for(var n=0;n=t.length||n>=e.length);++n)t[n+r]=e[n];return n}function A(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function I(e){return e!=e}var U=function(){for(var e="0123456789abcdef",t=new Array(256),r=0;r<16;++r)for(var i=16*r,n=0;n<16;++n)t[i+n]=e[r]+e[n];return t}()}).call(this,N("buffer").Buffer)},{"base64-js":19,buffer:21,ieee754:30}],22:[function(e,t,r){"use strict";t.exports=e("./").polyfill()},{"./":23}],23:[function(z,r,i){(function(j,V){var e,t;e=this,t=function(){"use strict";function l(e){return"function"==typeof e}var r=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},i=0,t=void 0,n=void 0,a=function(e,t){f[i]=e,f[i+1]=t,2===(i+=2)&&(n?n(d):y())};var e="undefined"!=typeof window?window:void 0,o=e||{},s=o.MutationObserver||o.WebKitMutationObserver,u="undefined"==typeof self&&void 0!==j&&"[object process]"==={}.toString.call(j),h="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function c(){var e=setTimeout;return function(){return e(d,1)}}var f=new Array(1e3);function d(){for(var e=0;e":">",'"':""","'":"'","/":"/"};function S(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,function(e){return w[e]}):e}var M=function(){function i(e){var t,r=1=this.maxReplaces)break}for(a=0;r=this.regexp.exec(e);){if(void 0===(i=h(r[1].trim())))if("function"==typeof c){var d=c(e,r,t);i="string"==typeof d?d:""}else this.logger.warn("missed to pass in variable ".concat(r[1]," for interpolating ").concat(e)),i="";else"string"==typeof i||this.useRawValueToEscape||(i=v(i));if(i=this.escapeValue?u(this.escape(i)):u(i),e=e.replace(r[0],i),this.regexp.lastIndex=0,++a>=this.maxReplaces)break}return e}},{key:"nest",value:function(e,t,r){var i,n,o=D({},2>1,h=-7,c=r?n-1:0,f=r?-1:1,d=e[t+c];for(c+=f,o=d&(1<<-h)-1,d>>=-h,h+=s;0>=-h,h+=i;0>1,f=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,d=i?0:o-1,p=i?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=h):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),2<=(t+=1<=a+c?f/l:f*Math.pow(2,1-c))*l&&(a++,l/=2),h<=a+c?(s=0,a=h):1<=a+c?(s=(t*l-1)*Math.pow(2,n),a+=c):(s=t*Math.pow(2,c-1)*Math.pow(2,n),a=0));8<=n;e[r+d]=255&s,d+=p,s/=256,n-=8);for(a=a<Math.abs(e[0])&&(t=1),Math.abs(e[2])>Math.abs(e[t])&&(t=2),t}var C=4e150;function P(e,t){e.f+=t.f,e.b.f+=t.b.f}function u(e,t,r){return e=e.a,t=t.a,r=r.a,t.b.a===e?r.b.a===e?v(t.a,r.a)?b(r.b.a,t.a,r.a)<=0:0<=b(t.b.a,r.a,t.a):b(r.b.a,e,r.a)<=0:r.b.a===e?0<=b(t.b.a,e,t.a):(t=y(t.b.a,e,t.a),(e=y(r.b.a,e,r.a))<=t)}function L(e){e.a.i=null;var t=e.e;t.a.c=t.c,t.c.a=t.a,e.e=null}function h(e,t){c(e.a),e.c=!1,(e.a=t).i=e}function k(e){for(var t=e.a.a;(e=fe(e)).a.a===t;);return e.c&&(h(e,t=f(ce(e).a.b,e.a.e)),e=fe(e)),e}function R(e,t,r){var i=new he;return i.a=r,i.e=W(e.f,t.e,i),r.i=i}function O(e,t){switch(e.s){case 100130:return 0!=(1&t);case 100131:return 0!==t;case 100132:return 0>1]],s[a[u]])?le(r,u):ue(r,u)),s[o]=null,l[o]=r.b,r.b=o}else for(r.c[-(o+1)]=null;0Math.max(a.a,l.a))return!1;if(v(o,a)){if(0i.f&&(i.f*=2,i.c=oe(i.c,i.f+1)),0===i.b?r=n:(r=i.b,i.b=i.c[i.b]),i.e[r]=t,i.c[r]=n,i.d[n]=r,i.h&&ue(i,n),r}return i=e.a++,e.c[i]=t,-(i+1)}function ie(e){if(0===e.a)return se(e.b);var t=e.c[e.d[e.a-1]];if(0!==e.b.a&&v(ae(e.b),t))return se(e.b);for(;--e.a,0e.a||v(i[a],i[l])){n[r[o]=a]=o;break}n[r[o]=l]=o,o=s}}function ue(e,t){for(var r=e.d,i=e.e,n=e.c,o=t,a=r[o];;){var s=o>>1,l=r[s];if(0==s||v(i[l],i[a])){n[r[o]=a]=o;break}n[r[o]=l]=o,o=s}}function he(){this.e=this.a=null,this.f=0,this.c=this.b=this.h=this.d=!1}function ce(e){return e.e.c.b}function fe(e){return e.e.a.b}(i=q.prototype).x=function(){Y(this,0)},i.B=function(e,t){switch(e){case 100142:return;case 100140:switch(t){case 100130:case 100131:case 100132:case 100133:case 100134:return void(this.s=t)}break;case 100141:return void(this.m=!!t);default:return void Z(this,100900)}Z(this,100901)},i.y=function(e){switch(e){case 100142:return 0;case 100140:return this.s;case 100141:return this.m;default:Z(this,100900)}return!1},i.A=function(e,t,r){this.j[0]=e,this.j[1]=t,this.j[2]=r},i.z=function(e,t){var r=t||null;switch(e){case 100100:case 100106:this.h=r;break;case 100104:case 100110:this.l=r;break;case 100101:case 100107:this.k=r;break;case 100102:case 100108:this.i=r;break;case 100103:case 100109:this.p=r;break;case 100105:case 100111:this.o=r;break;case 100112:this.r=r;break;default:Z(this,100900)}},i.C=function(e,t){var r=!1,i=[0,0,0];Y(this,2);for(var n=0;n<3;++n){var o=e[n];o<-1e150&&(o=-1e150,r=!0),1e150n[u]&&(n[u]=h,a[u]=l)}if(l=0,n[1]-o[1]>n[0]-o[0]&&(l=1),n[2]-o[2]>n[l]-o[l]&&(l=2),o[l]>=n[l])i[0]=0,i[1]=0,i[2]=1;else{for(n=0,o=s[l],a=a[l],s=[0,0,0],o=[o.g[0]-a.g[0],o.g[1]-a.g[1],o.g[2]-a.g[2]],u=[0,0,0],l=r.e;l!==r;l=l.e)u[0]=l.g[0]-a.g[0],u[1]=l.g[1]-a.g[1],u[2]=l.g[2]-a.g[2],s[0]=o[1]*u[2]-o[2]*u[1],s[1]=o[2]*u[0]-o[0]*u[2],s[2]=o[0]*u[1]-o[1]*u[0],n<(h=s[0]*s[0]+s[1]*s[1]+s[2]*s[2])&&(n=h,i[0]=s[0],i[1]=s[1],i[2]=s[2]);n<=0&&(i[0]=i[1]=i[2]=0,i[T(o)]=1)}r=!0}for(s=T(i),l=this.b.c,n=(s+1)%3,a=(s+2)%3,s=0>=l,h-=l,g!=o){if(g==a)break;for(var v=g>8,++y;var _=b;if(i>=8;null!==m&&s<4096&&(p[s++]=m<<8|_,u+1<=s&&l<12&&(++l,u=u<<1|1)),m=g}else s=1+a,u=(1<<(l=n+1))-1,m=null}return f!==i&&console.log("Warning, gif stream shorter than expected."),r}try{r.GifWriter=function(v,e,t,r){var y=0,i=void 0===(r=void 0===r?{}:r).loop?null:r.loop,b=void 0===r.palette?null:r.palette;if(e<=0||t<=0||65535>=1;)++n;if(a=1<>8&255,v[y++]=255&t,v[y++]=t>>8&255,v[y++]=(null!==b?128:0)|n,v[y++]=o,v[y++]=0,null!==b)for(var s=0,l=b.length;s>16&255,v[y++]=u>>8&255,v[y++]=255&u}if(null!==i){if(i<0||65535>8&255,v[y++]=0}var x=!1;this.addFrame=function(e,t,r,i,n,o){if(!0===x&&(--y,x=!1),o=void 0===o?{}:o,e<0||t<0||65535>=1;)++u;l=1<>8&255,v[y++]=d,v[y++]=0),v[y++]=44,v[y++]=255&e,v[y++]=e>>8&255,v[y++]=255&t,v[y++]=t>>8&255,v[y++]=255&r,v[y++]=r>>8&255,v[y++]=255&i,v[y++]=i>>8&255,v[y++]=!0===a?128|u-1:0,!0===a)for(var p=0,m=s.length;p>16&255,v[y++]=g>>8&255,v[y++]=255&g}return y=function(t,r,e,i){t[r++]=e;var n=r++,o=1<>=8,h-=8,r===n+256&&(t[n]=255,n=r++)}function d(e){c|=e<>=8,h-=8,r===n+256&&(t[n]=255,n=r++);4096===l?(d(o),l=1+s,u=e+1,m={}):(1<>7,n=1<<1+(7&r);x[e++],x[e++];var o=null,a=null;i&&(o=e,e+=3*(a=n));var s=!0,l=[],u=0,h=null,c=0,f=null;for(this.width=w,this.height=t;s&&e>2&7,e++;break;case 254:for(;;){if(!(0<=(C=x[e++])))throw Error("Invalid block size");if(0===C)break;e+=C}break;default:throw new Error("Unknown graphic control label: 0x"+x[e-1].toString(16))}break;case 44:var p=x[e++]|x[e++]<<8,m=x[e++]|x[e++]<<8,g=x[e++]|x[e++]<<8,v=x[e++]|x[e++]<<8,y=x[e++],b=y>>6&1,_=1<<1+(7&y),S=o,M=a,E=!1;if(y>>7){E=!0;S=e,e+=3*(M=_)}var T=e;for(e++;;){var C;if(!(0<=(C=x[e++])))throw Error("Invalid block size");if(0===C)break;e+=C}l.push({x:p,y:m,width:g,height:v,has_local_palette:E,palette_offset:S,palette_size:M,data_offset:T,data_length:e-T,transparent_index:h,interlaced:!!b,delay:u,disposal:c});break;case 59:s=!1;break;default:throw new Error("Unknown gif block: 0x"+x[e-1].toString(16))}this.numFrames=function(){return l.length},this.loopCount=function(){return f},this.frameInfo=function(e){if(e<0||e>=l.length)throw new Error("Frame index out of range.");return l[e]},this.decodeAndBlitFrameBGRA=function(e,t){var r=this.frameInfo(e),i=r.width*r.height,n=new Uint8Array(i);P(x,r.data_offset,n,i);var o=r.palette_offset,a=r.transparent_index;null===a&&(a=256);var s=r.width,l=w-s,u=s,h=4*(r.y*w+r.x),c=4*((r.y+r.height)*w+r.x),f=h,d=4*l;!0===r.interlaced&&(d+=4*w*7);for(var p=8,m=0,g=n.length;m>=1)),v===a)f+=4;else{var y=x[o+3*v],b=x[o+3*v+1],_=x[o+3*v+2];t[f++]=_,t[f++]=b,t[f++]=y,t[f++]=255}--u}},this.decodeAndBlitFrameRGBA=function(e,t){var r=this.frameInfo(e),i=r.width*r.height,n=new Uint8Array(i);P(x,r.data_offset,n,i);var o=r.palette_offset,a=r.transparent_index;null===a&&(a=256);var s=r.width,l=w-s,u=s,h=4*(r.y*w+r.x),c=4*((r.y+r.height)*w+r.x),f=h,d=4*l;!0===r.interlaced&&(d+=4*w*7);for(var p=8,m=0,g=n.length;m>=1)),v===a)f+=4;else{var y=x[o+3*v],b=x[o+3*v+1],_=x[o+3*v+2];t[f++]=y,t[f++]=b,t[f++]=_,t[f++]=255}--u}}}}catch(e){}},{}],33:[function(jr,t,r){(function(Gr){var e;e=this,function(E){"use strict";function e(e){if(null==this)throw TypeError();var t=String(this),r=t.length,i=e?Number(e):0;if(i!=i&&(i=0),!(i<0||r<=i)){var n,o=t.charCodeAt(i);return 55296<=o&&o<=56319&&i+1>>=1,t}function _(e,t,r){if(!t)return r;for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<>>16-t;return e.tag>>>=t,e.bitcount-=t,i+r}function x(e,t){for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<>>=1,++n,r+=t.table[n],0<=(i-=t.table[n]););return e.tag=o,e.bitcount-=n,t.trans[r+i]}function w(e,t,r){var i,n,o,a,s,l;for(i=_(e,5,257),n=_(e,5,1),o=_(e,4,4),a=0;a<19;++a)g[a]=0;for(a=0;athis.x2&&(this.x2=e)),"number"==typeof t&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=t,this.y2=t),tthis.y2&&(this.y2=t))},C.prototype.addX=function(e){this.addPoint(e,null)},C.prototype.addY=function(e){this.addPoint(null,e)},C.prototype.addBezier=function(e,t,r,i,n,o,a,s){var l=this,u=[e,t],h=[r,i],c=[n,o],f=[a,s];this.addPoint(e,t),this.addPoint(a,s);for(var d=0;d<=1;d++){var p=6*u[d]-12*h[d]+6*c[d],m=-3*u[d]+9*h[d]-9*c[d]+3*f[d],g=3*h[d]-3*u[d];if(0!=m){var v=Math.pow(p,2)-4*g*m;if(!(v<0)){var y=(-p+Math.sqrt(v))/(2*m);0>8&255,255&e]},A.USHORT=U(2),D.SHORT=function(e){return 32768<=e&&(e=-(65536-e)),[e>>8&255,255&e]},A.SHORT=U(2),D.UINT24=function(e){return[e>>16&255,e>>8&255,255&e]},A.UINT24=U(3),D.ULONG=function(e){return[e>>24&255,e>>16&255,e>>8&255,255&e]},A.ULONG=U(4),D.LONG=function(e){return R<=e&&(e=-(2*R-e)),[e>>24&255,e>>16&255,e>>8&255,255&e]},A.LONG=U(4),D.FIXED=D.ULONG,A.FIXED=A.ULONG,D.FWORD=D.SHORT,A.FWORD=A.SHORT,D.UFWORD=D.USHORT,A.UFWORD=A.USHORT,D.LONGDATETIME=function(e){return[0,0,0,0,e>>24&255,e>>16&255,e>>8&255,255&e]},A.LONGDATETIME=U(8),D.TAG=function(e){return k.argument(4===e.length,"Tag should be exactly 4 ASCII characters."),[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]},A.TAG=U(4),D.Card8=D.BYTE,A.Card8=A.BYTE,D.Card16=D.USHORT,A.Card16=A.USHORT,D.OffSize=D.BYTE,A.OffSize=A.BYTE,D.SID=D.USHORT,A.SID=A.USHORT,D.NUMBER=function(e){return-107<=e&&e<=107?[e+139]:108<=e&&e<=1131?[247+((e-=108)>>8),255&e]:-1131<=e&&e<=-108?[251+((e=-e-108)>>8),255&e]:-32768<=e&&e<=32767?D.NUMBER16(e):D.NUMBER32(e)},A.NUMBER=function(e){return D.NUMBER(e).length},D.NUMBER16=function(e){return[28,e>>8&255,255&e]},A.NUMBER16=U(3),D.NUMBER32=function(e){return[29,e>>24&255,e>>16&255,e>>8&255,255&e]},A.NUMBER32=U(5),D.REAL=function(e){var t=e.toString(),r=/\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec(t);if(r){var i=parseFloat("1e"+((r[2]?+r[2]:0)+r[1].length));t=(Math.round(e*i)/i).toString()}for(var n="",o=0,a=t.length;o>8&255,t[t.length]=255&i}return t},A.UTF16=function(e){return 2*e.length};var N={"x-mac-croatian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈ƫȅ ÀÃÕŒœĐ—“”‘’÷◊©⁄€‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ","x-mac-cyrillic":"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю","x-mac-gaelic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØḂ±≤≥ḃĊċḊḋḞḟĠġṀæøṁṖṗɼƒſṠ«»… ÀÃÕŒœ–—“”‘’ṡẛÿŸṪ€‹›Ŷŷṫ·Ỳỳ⁊ÂÊÁËÈÍÎÏÌÓÔ♣ÒÚÛÙıÝýŴŵẄẅẀẁẂẃ","x-mac-greek":"Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦€ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ­","x-mac-icelandic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüݰ¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-inuit":"ᐃᐄᐅᐆᐊᐋᐱᐲᐳᐴᐸᐹᑉᑎᑏᑐᑑᑕᑖᑦᑭᑮᑯᑰᑲᑳᒃᒋᒌᒍᒎᒐᒑ°ᒡᒥᒦ•¶ᒧ®©™ᒨᒪᒫᒻᓂᓃᓄᓅᓇᓈᓐᓯᓰᓱᓲᓴᓵᔅᓕᓖᓗᓘᓚᓛᓪᔨᔩᔪᔫᔭ… ᔮᔾᕕᕖᕗ–—“”‘’ᕘᕙᕚᕝᕆᕇᕈᕉᕋᕌᕐᕿᖀᖁᖂᖃᖄᖅᖏᖐᖑᖒᖓᖔᖕᙱᙲᙳᙴᙵᙶᖖᖠᖡᖢᖣᖤᖥᖦᕼŁł","x-mac-ce":"ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ",macintosh:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-romanian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂȘ∞±≤≥¥µ∂∑∏π∫ªºΩăș¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›Țț‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-turkish":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙˆ˜¯˘˙˚¸˝˛ˇ"};O.MACSTRING=function(e,t,r,i){var n=N[i];if(void 0!==n){for(var o="",a=0;a>8&255,l+256&255)}return o}D.MACSTRING=function(e,t){var r=function(e){if(!F)for(var t in F={},N)F[t]=new String(t);var r=F[e];if(void 0!==r){if(B){var i=B.get(r);if(void 0!==i)return i}var n=N[e];if(void 0!==n){for(var o={},a=0;a>8,t[c+1]=255&f,t=t.concat(i[h])}return t},A.TABLE=function(e){for(var t=0,r=e.fields.length,i=0;i>1,t.skip("uShort",3),e.glyphIndexMap={};for(var a=new se.Parser(r,i+n+14),s=new se.Parser(r,i+n+16+2*o),l=new se.Parser(r,i+n+16+4*o),u=new se.Parser(r,i+n+16+6*o),h=i+n+16+8*o,c=0;c>4,o=15&i;if(15==n)break;if(t+=r[n],15==o)break;t+=r[o]}return parseFloat(t)}(e);if(32<=t&&t<=246)return t-139;if(247<=t&&t<=250)return 256*(t-247)+e.parseByte()+108;if(251<=t&&t<=254)return 256*-(t-251)-e.parseByte()-108;throw new Error("Invalid b0 "+t)}function Te(e,t,r){t=void 0!==t?t:0;var i=new se.Parser(e,t),n=[],o=[];for(r=void 0!==r?r:e.length;i.relativeOffset>1,T.length=0,P=!0}return function e(t){for(var r,i,n,o,a,s,l,u,h,c,f,d,p=0;pMath.abs(d-R)?k=f+T.shift():R=d+T.shift(),E.curveTo(y,b,_,x,l,u),E.curveTo(h,c,f,d,k,R);break;default:console.log("Glyph "+v.index+": unknown operator 1200"+m),T.length=0}break;case 14:0>3;break;case 21:2>16),p+=2;break;case 29:a=T.pop()+g.gsubrsBias,(s=g.gsubrs[a])&&e(s);break;case 30:for(;0=r.begin&&e=fe.length){var a=i.parseChar();r.names.push(i.parseString(a))}break;case 2.5:r.numberOfGlyphs=i.parseUShort(),r.offset=new Array(r.numberOfGlyphs);for(var s=0;st.value.tag?1:-1}),t.fields=t.fields.concat(i),t.fields=t.fields.concat(n),t}function gt(e,t,r){for(var i=0;i 123 are reserved for internal usage");d|=1<>>1,o=e[n].tag;if(o===t)return n;o>>1,o=e[n];if(o===t)return n;o>>1,a=(r=e[o]).start;if(a===t)return r;a(r=e[i-1]).end?0:r}function xt(e,t){this.font=e,this.tableName=t}function wt(e){xt.call(this,e,"gpos")}function St(e){xt.call(this,e,"gsub")}function Mt(e,t){var r=e.length;if(r!==t.length)return!1;for(var i=0;it.points.length-1||i.matchedPoints[1]>n.points.length-1)throw Error("Matched points out of range in "+t.name);var a=t.points[i.matchedPoints[0]],s=n.points[i.matchedPoints[1]],l={xScale:i.xScale,scale01:i.scale01,scale10:i.scale10,yScale:i.yScale,dx:0,dy:0};s=kt([s],l)[0],l.dx=a.x-s.x,l.dy=a.y-s.y,o=kt(n.points,l)}t.points=t.points.concat(o)}}return Rt(t.points)}(wt.prototype=xt.prototype={searchTag:yt,binSearch:bt,getTable:function(e){var t=this.font.tables[this.tableName];return!t&&e&&(t=this.font.tables[this.tableName]=this.createDefaultTable()),t},getScriptNames:function(){var e=this.getTable();return e?e.scripts.map(function(e){return e.tag}):[]},getDefaultScriptName:function(){var e=this.getTable();if(e){for(var t=!1,r=0;r=s[u-1].tag,"Features must be added in alphabetical order."),o={tag:r,feature:{params:0,lookupListIndexes:[]}},s.push(o),a.push(u),o.feature}}},getLookupTables:function(e,t,r,i,n){var o=this.getFeatureTable(e,t,r,n),a=[];if(o){for(var s,l=o.lookupListIndexes,u=this.font.tables[this.tableName].lookups,h=0;h",s),t.stack.push(Math.round(64*s))}function vr(e,t){var r=t.stack,i=r.pop(),n=t.fv,o=t.pv,a=t.ppem,s=t.deltaBase+16*(e-1),l=t.deltaShift,u=t.z0;E.DEBUG&&console.log(t.step,"DELTAP["+e+"]",i,r);for(var h=0;h>4)===a){var d=(15&f)-8;0<=d&&d++,E.DEBUG&&console.log(t.step,"DELTAPFIX",c,"by",d*l);var p=u[c];n.setRelative(p,p,d*l,o)}}}function yr(e,t){var r=t.stack,i=r.pop();E.DEBUG&&console.log(t.step,"ROUND[]"),r.push(64*t.round(i/64))}function br(e,t){var r=t.stack,i=r.pop(),n=t.ppem,o=t.deltaBase+16*(e-1),a=t.deltaShift;E.DEBUG&&console.log(t.step,"DELTAC["+e+"]",i,r);for(var s=0;s>4)===n){var h=(15&u)-8;0<=h&&h++;var c=h*a;E.DEBUG&&console.log(t.step,"DELTACFIX",l,"by",c),t.cvt[l]+=c}}}function _r(e,t){var r,i,n=t.stack,o=n.pop(),a=n.pop(),s=t.z2[o],l=t.z1[a];E.DEBUG&&console.log(t.step,"SDPVTL["+e+"]",o,a),i=e?(r=s.y-l.y,l.x-s.x):(r=l.x-s.x,l.y-s.y),t.dpv=Zt(r,i)}function xr(e,t){var r=t.stack,i=t.prog,n=t.ip;E.DEBUG&&console.log(t.step,"PUSHB["+e+"]");for(var o=0;o":"_")+(i?"R":"_")+(0===n?"Gr":1===n?"Bl":2===n?"Wh":"")+"]",e?c+"("+o.cvt[c]+","+u+")":"",f,"(d =",a,"->",l*s,")"),o.rp1=o.rp0,o.rp2=f,t&&(o.rp0=f)}Ft.prototype.exec=function(e,t){if("number"!=typeof t)throw new Error("Point size is not a number!");if(!(2",i),s.interpolate(c,o,a,l),s.touch(c)}e.loop=1},dr.bind(void 0,0),dr.bind(void 0,1),function(e){for(var t=e.stack,r=e.rp0,i=e.z0[r],n=e.loop,o=e.fv,a=e.pv,s=e.z1;n--;){var l=t.pop(),u=s[l];E.DEBUG&&console.log(e.step,(1=a.width||t>=a.height?[0,0,0,0]:this._getPixel(e,t);var s=new l.default.Image(r,i);return s.canvas.getContext("2d").drawImage(a,e,t,r*o,i*o,0,0,r,i),s},l.default.Renderer.prototype.textLeading=function(e){return"number"==typeof e?(this._setProperty("_textLeading",e),this._pInst):this._textLeading},l.default.Renderer.prototype.textSize=function(e){return"number"==typeof e?(this._setProperty("_textSize",e),this._setProperty("_textLeading",e*y._DEFAULT_LEADMULT),this._applyTextProperties()):this._textSize},l.default.Renderer.prototype.textStyle=function(e){return e?(e!==y.NORMAL&&e!==y.ITALIC&&e!==y.BOLD&&e!==y.BOLDITALIC||this._setProperty("_textStyle",e),this._applyTextProperties()):this._textStyle},l.default.Renderer.prototype.textAscent=function(){return null===this._textAscent&&this._updateTextMetrics(),this._textAscent},l.default.Renderer.prototype.textDescent=function(){return null===this._textDescent&&this._updateTextMetrics(),this._textDescent},l.default.Renderer.prototype.textAlign=function(e,t){return void 0!==e?(this._setProperty("_textAlign",e),void 0!==t&&this._setProperty("_textBaseline",t),this._applyTextProperties()):{horizontal:this._textAlign,vertical:this._textBaseline}},l.default.Renderer.prototype.text=function(e,t,r,i,n){var o,a,s,l,u,h,c,f,d=this._pInst,p=Number.MAX_VALUE;if((this._doFill||this._doStroke)&&void 0!==e){if("string"!=typeof e&&(e=e.toString()),o=(e=e.replace(/(\t)/g," ")).split("\n"),void 0!==i){for(s=f=0;ss.HALF_PI&&e<=3*s.HALF_PI?Math.atan(r/i*Math.tan(e))+s.PI:Math.atan(r/i*Math.tan(e))+s.TWO_PI,t=t<=s.HALF_PI?Math.atan(r/i*Math.tan(t)):t>s.HALF_PI&&t<=3*s.HALF_PI?Math.atan(r/i*Math.tan(t))+s.PI:Math.atan(r/i*Math.tan(t))+s.TWO_PI),tv||Math.abs(this.accelerationY-this.pAccelerationY)>v||Math.abs(this.accelerationZ-this.pAccelerationZ)>v)&&e();var t=this.deviceTurned||window.deviceTurned;if("function"==typeof t){var r=this.rotationX+180,i=this.pRotationX+180,n=c+180;0>>24],i+=x[(16711680&C)>>16],n+=x[(65280&C)>>8],o+=x[255&C],r+=k[_],s++}w[l=T+y]=a/r,S[l]=i/r,M[l]=n/r,E[l]=o/r}T+=d}for(h=(u=-P)*d,b=T=0;b>>16,e[r+1]=(65280&t[i])>>>8,e[r+2]=255&t[i],e[r+3]=(4278190080&t[i])>>>24},O._toImageData=function(e){return e instanceof ImageData?e:e.getContext("2d").getImageData(0,0,e.width,e.height)},O._createImageData=function(e,t){return O._tmpCanvas=document.createElement("canvas"),O._tmpCtx=O._tmpCanvas.getContext("2d"),this._tmpCtx.createImageData(e,t)},O.apply=function(e,t,r){var i=e.getContext("2d"),n=i.getImageData(0,0,e.width,e.height),o=t(n,r);o instanceof ImageData?i.putImageData(o,0,0,0,0,e.width,e.height):i.putImageData(n,0,0,0,0,e.width,e.height)},O.threshold=function(e,t){var r=O._toPixels(e);void 0===t&&(t=.5);for(var i=Math.floor(255*t),n=0;n>8)/i,r[n+1]=255*(a*t>>8)/i,r[n+2]=255*(s*t>>8)/i}},O.dilate=function(e){for(var t,r,i,n,o,a,s,l,u,h,c,f,d,p,m,g,v,y=O._toPixels(e),b=0,_=y.length?y.length/4:0,x=new Int32Array(_);b<_;)for(r=(t=b)+e.width;b>16&255)+151*(i>>8&255)+28*(255&i))<(m=77*(c>>16&255)+151*(c>>8&255)+28*(255&c))&&(n=c,o=m),o<(p=77*((h=O._getARGB(y,a))>>16&255)+151*(h>>8&255)+28*(255&h))&&(n=h,o=p),o<(g=77*(f>>16&255)+151*(f>>8&255)+28*(255&f))&&(n=f,o=g),o<(v=77*(d>>16&255)+151*(d>>8&255)+28*(255&d))&&(n=d,o=v),x[b++]=n;O._setPixels(y,x)},O.erode=function(e){for(var t,r,i,n,o,a,s,l,u,h,c,f,d,p,m,g,v,y=O._toPixels(e),b=0,_=y.length?y.length/4:0,x=new Int32Array(_);b<_;)for(r=(t=b)+e.width;b>16&255)+151*(c>>8&255)+28*(255&c))<(o=77*(i>>16&255)+151*(i>>8&255)+28*(255&i))&&(n=c,o=m),(p=77*((h=O._getARGB(y,a))>>16&255)+151*(h>>8&255)+28*(255&h))>16&255)+151*(f>>8&255)+28*(255&f))>16&255)+151*(d>>8&255)+28*(255&d))=r){var i=Math.floor(t.timeDisplayed/r);if(t.timeDisplayed=0,t.displayIndex+=i,t.loopCount=Math.floor(t.displayIndex/t.numFrames),null!==t.loopLimit&&t.loopCount>=t.loopLimit)t.playing=!1;else{var n=t.displayIndex%t.numFrames;this.drawingContext.putImageData(t.frames[n].image,0,0),t.displayIndex=n,this.setModified(!0)}}}},n.default.Image.prototype._setProperty=function(e,t){this[e]=t,this.setModified(!0)},n.default.Image.prototype.loadPixels=function(){n.default.Renderer2D.prototype.loadPixels.call(this),this.setModified(!0)},n.default.Image.prototype.updatePixels=function(e,t,r,i){n.default.Renderer2D.prototype.updatePixels.call(this,e,t,r,i),this.setModified(!0)},n.default.Image.prototype.get=function(e,t,r,i){return n.default._validateParameters("p5.Image.get",arguments),n.default.Renderer2D.prototype.get.apply(this,arguments)},n.default.Image.prototype._getPixel=n.default.Renderer2D.prototype._getPixel,n.default.Image.prototype.set=function(e,t,r){n.default.Renderer2D.prototype.set.call(this,e,t,r),this.setModified(!0)},n.default.Image.prototype.resize=function(e,t){0===e&&0===t?(e=this.canvas.width,t=this.canvas.height):0===e?e=this.canvas.width*t/this.canvas.height:0===t&&(t=this.canvas.height*e/this.canvas.width),e=Math.floor(e),t=Math.floor(t);var r=document.createElement("canvas");if(r.width=e,r.height=t,this.gifProperties)for(var i=this.gifProperties,n=function(e,t){for(var r=0,i=0;i/g,">").replace(/"/g,""").replace(/'/g,"'")}function l(e,t){t&&!0!==t&&"true"!==t||(t="");var r="";return(e=e||"untitled")&&e.includes(".")&&(r=e.split(".").pop()),t&&r!==t&&(r=t,e="".concat(e,".").concat(r)),[e,r]}e("../core/error_helpers"),v.default.prototype.loadJSON=function(){for(var e=arguments.length,t=new Array(e),r=0;r"),n.print("");if(n.print(' '),n.print(""),n.print(""),n.print(" "),"0"!==o[0]){n.print(" ");for(var h=0;h".concat(c)),n.print(" ")}n.print(" ")}for(var f=0;f");for(var d=0;d".concat(p)),n.print(" ")}n.print(" ")}n.print("
"),n.print(""),n.print("")}n.close(),n.clear()},v.default.prototype.writeFile=function(e,t,r){var i="application/octet-stream";v.default.prototype._isSafari()&&(i="text/plain");var n=new Blob(e,{type:i});v.default.prototype.downloadFile(n,t,r)},v.default.prototype.downloadFile=function(e,t,r){var i=l(t,r),n=i[0];if(e instanceof Blob)s.default.saveAs(e,n);else{var o=document.createElement("a");if(o.href=e,o.download=n,o.onclick=function(e){var t;t=e,document.body.removeChild(t.target),e.stopPropagation()},o.style.display="none",document.body.appendChild(o),v.default.prototype._isSafari()){var a="Hello, Safari user! To download this file...\n";a+="1. Go to File --\x3e Save As.\n",a+='2. Choose "Page Source" as the Format.\n',a+='3. Name it with this extension: ."'.concat(i[1],'"'),alert(a)}o.click()}},v.default.prototype._checkFileExtension=l,v.default.prototype._isSafari=function(){return 0>>0},getSeed:function(){return t},rand:function(){return(r=(1664525*r+1013904223)%i)/i}});n.setSeed(e),_=new Array(4096);for(var o=0;o<4096;o++)_[o]=n.rand()};var o=n.default;r.default=o},{"../core/main":49}],82:[function(e,t,r){"use strict";function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i,l=(i=e("../core/main"))&&i.__esModule?i:{default:i},o=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==a(e)&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var o=i?Object.getOwnPropertyDescriptor(e,n):null;o&&(o.get||o.set)?Object.defineProperty(r,n,o):r[n]=e[n]}r.default=e,t&&t.set(e,r);return r}(e("../core/constants"));function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}l.default.Vector=function(e,t,r){var i,n,o;o=e instanceof l.default?(this.p5=e,i=t[0]||0,n=t[1]||0,t[2]||0):(i=e||0,n=t||0,r||0),this.x=i,this.y=n,this.z=o},l.default.Vector.prototype.toString=function(){return"p5.Vector Object : [".concat(this.x,", ").concat(this.y,", ").concat(this.z,"]")},l.default.Vector.prototype.set=function(e,t,r){return e instanceof l.default.Vector?(this.x=e.x||0,this.y=e.y||0,this.z=e.z||0):e instanceof Array?(this.x=e[0]||0,this.y=e[1]||0,this.z=e[2]||0):(this.x=e||0,this.y=t||0,this.z=r||0),this},l.default.Vector.prototype.copy=function(){return this.p5?new l.default.Vector(this.p5,[this.x,this.y,this.z]):new l.default.Vector(this.x,this.y,this.z)},l.default.Vector.prototype.add=function(e,t,r){return e instanceof l.default.Vector?(this.x+=e.x||0,this.y+=e.y||0,this.z+=e.z||0):e instanceof Array?(this.x+=e[0]||0,this.y+=e[1]||0,this.z+=e[2]||0):(this.x+=e||0,this.y+=t||0,this.z+=r||0),this};function u(e,t){return 0!==e&&(this.x=this.x%e),0!==t&&(this.y=this.y%t),this}function h(e,t,r){return 0!==e&&(this.x=this.x%e),0!==t&&(this.y=this.y%t),0!==r&&(this.z=this.z%r),this}l.default.Vector.prototype.rem=function(e,t,r){if(e instanceof l.default.Vector){if(Number.isFinite(e.x)&&Number.isFinite(e.y)&&Number.isFinite(e.z)){var i=parseFloat(e.x),n=parseFloat(e.y),o=parseFloat(e.z);h.call(this,i,n,o)}}else if(e instanceof Array)e.every(function(e){return Number.isFinite(e)})&&(2===e.length&&u.call(this,e[0],e[1]),3===e.length&&h.call(this,e[0],e[1],e[2]));else if(1===arguments.length){if(Number.isFinite(e)&&0!==e)return this.x=this.x%e,this.y=this.y%e,this.z=this.z%e,this}else if(2===arguments.length){var a=Array.prototype.slice.call(arguments);a.every(function(e){return Number.isFinite(e)})&&2===a.length&&u.call(this,a[0],a[1])}else if(3===arguments.length){var s=Array.prototype.slice.call(arguments);s.every(function(e){return Number.isFinite(e)})&&3===s.length&&h.call(this,s[0],s[1],s[2])}},l.default.Vector.prototype.sub=function(e,t,r){return e instanceof l.default.Vector?(this.x-=e.x||0,this.y-=e.y||0,this.z-=e.z||0):e instanceof Array?(this.x-=e[0]||0,this.y-=e[1]||0,this.z-=e[2]||0):(this.x-=e||0,this.y-=t||0,this.z-=r||0),this},l.default.Vector.prototype.mult=function(e){return"number"==typeof e&&isFinite(e)?(this.x*=e,this.y*=e,this.z*=e):console.warn("p5.Vector.prototype.mult:","n is undefined or not a finite number"),this},l.default.Vector.prototype.div=function(e){return"number"==typeof e&&isFinite(e)?0===e?console.warn("p5.Vector.prototype.div:","divide by 0"):(this.x/=e,this.y/=e,this.z/=e):console.warn("p5.Vector.prototype.div:","n is undefined or not a finite number"),this},l.default.Vector.prototype.mag=function(){return Math.sqrt(this.magSq())},l.default.Vector.prototype.magSq=function(){var e=this.x,t=this.y,r=this.z;return e*e+t*t+r*r},l.default.Vector.prototype.dot=function(e,t,r){return e instanceof l.default.Vector?this.dot(e.x,e.y,e.z):this.x*(e||0)+this.y*(t||0)+this.z*(r||0)},l.default.Vector.prototype.cross=function(e){var t=this.y*e.z-this.z*e.y,r=this.z*e.x-this.x*e.z,i=this.x*e.y-this.y*e.x;return this.p5?new l.default.Vector(this.p5,[t,r,i]):new l.default.Vector(t,r,i)},l.default.Vector.prototype.dist=function(e){return e.copy().sub(this).mag()},l.default.Vector.prototype.normalize=function(){var e=this.mag();return 0!==e&&this.mult(1/e),this},l.default.Vector.prototype.limit=function(e){var t=this.magSq();return e*e>>0},n.default.prototype.randomSeed=function(e){this._lcgSetSeed(o,e),this._gaussian_previous=!1},n.default.prototype.random=function(e,t){var r;if(n.default._validateParameters("random",arguments),r=null!=this[o]?this._lcg(o):Math.random(),void 0===e)return r;if(void 0===t)return e instanceof Array?e[Math.floor(r*e.length)]:r*e;if(tf){var P=p,L=l,k=u;p=d+f*(s&&d=t&&(r=r.substring(r.length-t,r.length)),r}},n.default.prototype.unhex=function(e){return e instanceof Array?e.map(n.default.prototype.unhex):parseInt("0x".concat(e),16)};var o=n.default;r.default=o},{"../core/main":49}],90:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i,a=(i=e("../core/main"))&&i.__esModule?i:{default:i};function n(e,t,r){var i=e<0,n=i?e.toString().substring(1):e.toString(),o=n.indexOf("."),a=-1!==o?n.substring(0,o):n,s=-1!==o?n.substring(o+1):"",l=i?"-":"";if(void 0!==r){var u="";(-1!==o||0r&&(s=s.substring(0,r));for(var h=0;hi.length)for(var o=t-(i+=-1===r?".":"").length+1,a=0;a=d.TWO_PI?"".concat("ellipse","|").concat(u,"|"):"".concat("arc","|").concat(a,"|").concat(s,"|").concat(l,"|").concat(u,"|"),!this.geometryInHash(t)){var h=new T.default.Geometry(u,1,function(){if(this.strokeIndices=[],a.toFixed(10)!==s.toFixed(10)){l!==d.PIE&&void 0!==l||(this.vertices.push(new T.default.Vector(.5,.5,0)),this.uvs.push([.5,.5]));for(var e=0;e<=u;e++){var t=(s-a)*(e/u)+a,r=.5+Math.cos(t)/2,i=.5+Math.sin(t)/2;this.vertices.push(new T.default.Vector(r,i,0)),this.uvs.push([r,i]),e>5&31)/31,(y>>10&31)/31):(r=a,i=s,l)}for(var b=1;b<=3;b++){var _=p+12*b,x=new S.default.Vector(u.getFloat32(_,!0),u.getFloat32(8+_,!0),u.getFloat32(4+_,!0));e.vertices.push(x),c&&o.push(r,i,n)}var w=new S.default.Vector(m,g,v);e.vertexNormals.push(w,w,w),e.faces.push([3*d,3*d+1,3*d+2]),e.uvs.push([0,0],[0,0],[0,0])}}(e,t);else{var r=new DataView(t);if(!("TextDecoder"in window))return console.warn("Sorry, ASCII STL loading only works in browsers that support TextDecoder (https://caniuse.com/#feat=textencoder)");var i=new TextDecoder("utf-8").decode(r).split("\n");!function(e,t){for(var r,i,n="",o=[],a=0;aMath.PI?l=Math.PI:l<=0&&(l=.001);var u=Math.sin(l)*a*Math.sin(s),h=Math.cos(l)*a,c=Math.sin(l)*a*Math.cos(s);this.camera(u+this.centerX,h+this.centerY,c+this.centerZ,this.centerX,this.centerY,this.centerZ,0,1,0)},m.default.Camera.prototype._isActive=function(){return this===this._renderer._curCamera},m.default.prototype.setCamera=function(e){this._renderer._curCamera=e,this._renderer.uPMatrix.set(e.projMatrix.mat4[0],e.projMatrix.mat4[1],e.projMatrix.mat4[2],e.projMatrix.mat4[3],e.projMatrix.mat4[4],e.projMatrix.mat4[5],e.projMatrix.mat4[6],e.projMatrix.mat4[7],e.projMatrix.mat4[8],e.projMatrix.mat4[9],e.projMatrix.mat4[10],e.projMatrix.mat4[11],e.projMatrix.mat4[12],e.projMatrix.mat4[13],e.projMatrix.mat4[14],e.projMatrix.mat4[15])};var n=m.default.Camera;r.default=n},{"../core/main":49}],98:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i,h=(i=e("../core/main"))&&i.__esModule?i:{default:i};h.default.Geometry=function(e,t,r){return this.vertices=[],this.lineVertices=[],this.lineNormals=[],this.vertexNormals=[],this.faces=[],this.uvs=[],this.edges=[],this.vertexColors=[],this.detailX=void 0!==e?e:1,this.detailY=void 0!==t?t:1,this.dirtyFlags={},r instanceof Function&&r.call(this),this},h.default.Geometry.prototype.reset=function(){this.lineVertices.length=0,this.lineNormals.length=0,this.vertices.length=0,this.edges.length=0,this.vertexColors.length=0,this.vertexNormals.length=0,this.uvs.length=0,this.dirtyFlags={}},h.default.Geometry.prototype.computeFaces=function(){this.faces.length=0;for(var e,t,r,i,n=this.detailX+1,o=0;othis.vertices.length-1-this.detailX;i--)e.add(this.vertexNormals[i]);e=h.default.Vector.div(e,this.detailX);for(var n=this.vertices.length-1;n>this.vertices.length-1-this.detailX;n--)this.vertexNormals[n]=e;return this},h.default.Geometry.prototype._makeTriangleEdges=function(){if(this.edges.length=0,Array.isArray(this.strokeIndices))for(var e=0,t=this.strokeIndices.length;e vTexCoord.y;\n bool y1 = p1.y > vTexCoord.y;\n bool y2 = p2.y > vTexCoord.y;\n\n // could web be under the curve (after t1)?\n if (y1 ? !y2 : y0) {\n // add the coverage for t1\n coverage.x += saturate(C1.x + 0.5);\n // calculate the anti-aliasing for t1\n weight.x = min(weight.x, abs(C1.x));\n }\n\n // are we outside the curve (after t2)?\n if (y1 ? !y0 : y2) {\n // subtract the coverage for t2\n coverage.x -= saturate(C2.x + 0.5);\n // calculate the anti-aliasing for t2\n weight.x = min(weight.x, abs(C2.x));\n }\n}\n\n// this is essentially the same as coverageX, but with the axes swapped\nvoid coverageY(vec2 p0, vec2 p1, vec2 p2) {\n\n vec2 C1, C2;\n calulateCrossings(p0, p1, p2, C1, C2);\n\n bool x0 = p0.x > vTexCoord.x;\n bool x1 = p1.x > vTexCoord.x;\n bool x2 = p2.x > vTexCoord.x;\n\n if (x1 ? !x2 : x0) {\n coverage.y -= saturate(C1.y + 0.5);\n weight.y = min(weight.y, abs(C1.y));\n }\n\n if (x1 ? !x0 : x2) {\n coverage.y += saturate(C2.y + 0.5);\n weight.y = min(weight.y, abs(C2.y));\n }\n}\n\nvoid main() {\n\n // calculate the pixel scale based on screen-coordinates\n pixelScale = hardness / fwidth(vTexCoord);\n\n // which grid cell is this pixel in?\n ivec2 gridCoord = ifloor(vTexCoord * vec2(uGridSize));\n\n // intersect curves in this row\n {\n // the index into the row info bitmap\n int rowIndex = gridCoord.y + uGridOffset.y;\n // fetch the info texel\n vec4 rowInfo = getTexel(uSamplerRows, rowIndex, uGridImageSize);\n // unpack the rowInfo\n int rowStrokeIndex = getInt16(rowInfo.xy);\n int rowStrokeCount = getInt16(rowInfo.zw);\n\n for (int iRowStroke = INT(0); iRowStroke < N; iRowStroke++) {\n if (iRowStroke >= rowStrokeCount)\n break;\n\n // each stroke is made up of 3 points: the start and control point\n // and the start of the next curve.\n // fetch the indices of this pair of strokes:\n vec4 strokeIndices = getTexel(uSamplerRowStrokes, rowStrokeIndex++, uCellsImageSize);\n\n // unpack the stroke index\n int strokePos = getInt16(strokeIndices.xy);\n\n // fetch the two strokes\n vec4 stroke0 = getTexel(uSamplerStrokes, strokePos + INT(0), uStrokeImageSize);\n vec4 stroke1 = getTexel(uSamplerStrokes, strokePos + INT(1), uStrokeImageSize);\n\n // calculate the coverage\n coverageX(stroke0.xy, stroke0.zw, stroke1.xy);\n }\n }\n\n // intersect curves in this column\n {\n int colIndex = gridCoord.x + uGridOffset.x;\n vec4 colInfo = getTexel(uSamplerCols, colIndex, uGridImageSize);\n int colStrokeIndex = getInt16(colInfo.xy);\n int colStrokeCount = getInt16(colInfo.zw);\n \n for (int iColStroke = INT(0); iColStroke < N; iColStroke++) {\n if (iColStroke >= colStrokeCount)\n break;\n\n vec4 strokeIndices = getTexel(uSamplerColStrokes, colStrokeIndex++, uCellsImageSize);\n\n int strokePos = getInt16(strokeIndices.xy);\n vec4 stroke0 = getTexel(uSamplerStrokes, strokePos + INT(0), uStrokeImageSize);\n vec4 stroke1 = getTexel(uSamplerStrokes, strokePos + INT(1), uStrokeImageSize);\n coverageY(stroke0.xy, stroke0.zw, stroke1.xy);\n }\n }\n\n weight = saturate(1.0 - weight * 2.0);\n float distance = max(weight.x + weight.y, minDistance); // manhattan approx.\n float antialias = abs(dot(coverage, weight) / distance);\n float cover = min(abs(coverage.x), abs(coverage.y));\n gl_FragColor = uMaterialColor;\n gl_FragColor.a *= saturate(max(antialias, cover));\n}",lineVert:"/*\n Part of the Processing project - http://processing.org\n Copyright (c) 2012-15 The Processing Foundation\n Copyright (c) 2004-12 Ben Fry and Casey Reas\n Copyright (c) 2001-04 Massachusetts Institute of Technology\n This library is free software; you can redistribute it and/or\n modify it under the terms of the GNU Lesser General Public\n License as published by the Free Software Foundation, version 2.1.\n This library is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n Lesser General Public License for more details.\n You should have received a copy of the GNU Lesser General\n Public License along with this library; if not, write to the\n Free Software Foundation, Inc., 59 Temple Place, Suite 330,\n Boston, MA 02111-1307 USA\n*/\n\n#define PROCESSING_LINE_SHADER\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform float uStrokeWeight;\n\nuniform vec4 uViewport;\nuniform int uPerspective;\n\nattribute vec4 aPosition;\nattribute vec4 aDirection;\n \nvoid main() {\n // using a scale <1 moves the lines towards the camera\n // in order to prevent popping effects due to half of\n // the line disappearing behind the geometry faces.\n vec3 scale = vec3(0.9995);\n\n vec4 posp = uModelViewMatrix * aPosition;\n vec4 posq = uModelViewMatrix * (aPosition + vec4(aDirection.xyz, 0));\n\n // Moving vertices slightly toward the camera\n // to avoid depth-fighting with the fill triangles.\n // Discussed here:\n // http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Number=252848 \n posp.xyz = posp.xyz * scale;\n posq.xyz = posq.xyz * scale;\n\n vec4 p = uProjectionMatrix * posp;\n vec4 q = uProjectionMatrix * posq;\n\n // formula to convert from clip space (range -1..1) to screen space (range 0..[width or height])\n // screen_p = (p.xy/p.w + <1,1>) * 0.5 * uViewport.zw\n\n // prevent division by W by transforming the tangent formula (div by 0 causes\n // the line to disappear, see https://github.com/processing/processing/issues/5183)\n // t = screen_q - screen_p\n //\n // tangent is normalized and we don't care which aDirection it points to (+-)\n // t = +- normalize( screen_q - screen_p )\n // t = +- normalize( (q.xy/q.w+<1,1>)*0.5*uViewport.zw - (p.xy/p.w+<1,1>)*0.5*uViewport.zw )\n //\n // extract common factor, <1,1> - <1,1> cancels out\n // t = +- normalize( (q.xy/q.w - p.xy/p.w) * 0.5 * uViewport.zw )\n //\n // convert to common divisor\n // t = +- normalize( ((q.xy*p.w - p.xy*q.w) / (p.w*q.w)) * 0.5 * uViewport.zw )\n //\n // remove the common scalar divisor/factor, not needed due to normalize and +-\n // (keep uViewport - can't remove because it has different components for x and y\n // and corrects for aspect ratio, see https://github.com/processing/processing/issues/5181)\n // t = +- normalize( (q.xy*p.w - p.xy*q.w) * uViewport.zw )\n\n vec2 tangent = normalize((q.xy*p.w - p.xy*q.w) * uViewport.zw);\n\n // flip tangent to normal (it's already normalized)\n vec2 normal = vec2(-tangent.y, tangent.x);\n\n float thickness = aDirection.w * uStrokeWeight;\n vec2 offset = normal * thickness / 2.0;\n\n vec2 curPerspScale;\n\n if(uPerspective == 1) {\n // Perspective ---\n // convert from world to clip by multiplying with projection scaling factor\n // to get the right thickness (see https://github.com/processing/processing/issues/5182)\n // invert Y, projections in Processing invert Y\n curPerspScale = (uProjectionMatrix * vec4(1, -1, 0, 0)).xy;\n } else {\n // No Perspective ---\n // multiply by W (to cancel out division by W later in the pipeline) and\n // convert from screen to clip (derived from clip to screen above)\n curPerspScale = p.w / (0.5 * uViewport.zw);\n }\n\n gl_Position.xy = p.xy + offset.xy * curPerspScale;\n gl_Position.zw = p.zw;\n}\n",lineFrag:"precision mediump float;\nprecision mediump int;\n\nuniform vec4 uMaterialColor;\n\nvoid main() {\n gl_FragColor = uMaterialColor;\n}",pointVert:"attribute vec3 aPosition;\nuniform float uPointSize;\nvarying float vStrokeWeight;\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nvoid main() {\n\tvec4 positionVec4 = vec4(aPosition, 1.0);\n\tgl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n\tgl_PointSize = uPointSize;\n\tvStrokeWeight = uPointSize;\n}",pointFrag:"precision mediump float;\nprecision mediump int;\nuniform vec4 uMaterialColor;\nvarying float vStrokeWeight;\n\nvoid main(){\n\tfloat mask = 0.0;\n\n\t// make a circular mask using the gl_PointCoord (goes from 0 - 1 on a point)\n // might be able to get a nicer edge on big strokeweights with smoothstep but slightly less performant\n\n\tmask = step(0.98, length(gl_PointCoord * 2.0 - 1.0));\n\n\t// if strokeWeight is 1 or less lets just draw a square\n\t// this prevents weird artifacting from carving circles when our points are really small\n\t// if strokeWeight is larger than 1, we just use it as is\n\n\tmask = mix(0.0, mask, clamp(floor(vStrokeWeight - 0.5),0.0,1.0));\n\n\t// throw away the borders of the mask\n // otherwise we get weird alpha blending issues\n\n\tif(mask > 0.98){\n discard;\n \t}\n\n \tgl_FragColor = vec4(uMaterialColor.rgb * (1.0 - mask), uMaterialColor.a) ;\n}"};u.default.RendererGL=function(e,t,r,i){return u.default.Renderer.call(this,e,t,r),this._setAttributeDefaults(t),this._initContext(),this.isP3D=!0,this.GL=this.drawingContext,this._isErasing=!1,this._enableLighting=!1,this.ambientLightColors=[],this.specularColors=[1,1,1],this.directionalLightDirections=[],this.directionalLightDiffuseColors=[],this.directionalLightSpecularColors=[],this.pointLightPositions=[],this.pointLightDiffuseColors=[],this.pointLightSpecularColors=[],this.spotLightPositions=[],this.spotLightDirections=[],this.spotLightDiffuseColors=[],this.spotLightSpecularColors=[],this.spotLightAngle=[],this.spotLightConc=[],this.drawMode=o.FILL,this.curFillColor=this._cachedFillStyle=[1,1,1,1],this.curStrokeColor=this._cachedStrokeStyle=[0,0,0,1],this.curBlendMode=o.BLEND,this._cachedBlendMode=void 0,this.blendExt=this.GL.getExtension("EXT_blend_minmax"),this._isBlending=!1,this._useSpecularMaterial=!1,this._useEmissiveMaterial=!1,this._useNormalMaterial=!1,this._useShininess=1,this._tint=[255,255,255,255],this.constantAttenuation=1,this.linearAttenuation=0,this.quadraticAttenuation=0,this.uMVMatrix=new u.default.Matrix,this.uPMatrix=new u.default.Matrix,this.uNMatrix=new u.default.Matrix("mat3"),this._curCamera=new u.default.Camera(this),this._curCamera._computeCameraDefaultSettings(),this._curCamera._setDefaultCamera(),this._defaultLightShader=void 0,this._defaultImmediateModeShader=void 0,this._defaultNormalShader=void 0,this._defaultColorShader=void 0,this._defaultPointShader=void 0,this.userFillShader=void 0,this.userStrokeShader=void 0,this.userPointShader=void 0,this.retainedMode={geometry:{},buffers:{stroke:[new u.default.RenderBuffer(3,"lineVertices","lineVertexBuffer","aPosition",this,this._flatten),new u.default.RenderBuffer(4,"lineNormals","lineNormalBuffer","aDirection",this,this._flatten)],fill:[new u.default.RenderBuffer(3,"vertices","vertexBuffer","aPosition",this,this._vToNArray),new u.default.RenderBuffer(3,"vertexNormals","normalBuffer","aNormal",this,this._vToNArray),new u.default.RenderBuffer(4,"vertexColors","colorBuffer","aMaterialColor",this),new u.default.RenderBuffer(3,"vertexAmbients","ambientBuffer","aAmbientColor",this),new u.default.RenderBuffer(2,"uvs","uvBuffer","aTexCoord",this,this._flatten)],text:[new u.default.RenderBuffer(3,"vertices","vertexBuffer","aPosition",this,this._vToNArray),new u.default.RenderBuffer(2,"uvs","uvBuffer","aTexCoord",this,this._flatten)]}},this.immediateMode={geometry:new u.default.Geometry,shapeMode:o.TRIANGLE_FAN,_bezierVertex:[],_quadraticVertex:[],_curveVertex:[],buffers:{fill:[new u.default.RenderBuffer(3,"vertices","vertexBuffer","aPosition",this,this._vToNArray),new u.default.RenderBuffer(3,"vertexNormals","normalBuffer","aNormal",this,this._vToNArray),new u.default.RenderBuffer(4,"vertexColors","colorBuffer","aVertexColor",this),new u.default.RenderBuffer(3,"vertexAmbients","ambientBuffer","aAmbientColor",this),new u.default.RenderBuffer(2,"uvs","uvBuffer","aTexCoord",this,this._flatten)],stroke:[new u.default.RenderBuffer(3,"lineVertices","lineVertexBuffer","aPosition",this,this._flatten),new u.default.RenderBuffer(4,"lineNormals","lineNormalBuffer","aDirection",this,this._flatten)],point:this.GL.createBuffer()}},this.pointSize=5,this.curStrokeWeight=1,this.textures=[],this.textureMode=o.IMAGE,this.textureWrapX=o.CLAMP,this.textureWrapY=o.CLAMP,this._tex=null,this._curveTightness=6,this._lookUpTableBezier=[],this._lookUpTableQuadratic=[],this._lutBezierDetail=0,this._lutQuadraticDetail=0,this._tessy=this._initTessy(),this.fontInfos={},this._curShader=void 0,this},u.default.RendererGL.prototype=Object.create(u.default.Renderer.prototype),u.default.RendererGL.prototype._setAttributeDefaults=function(e){var t={alpha:!0,depth:!0,stencil:!0,antialias:navigator.userAgent.toLowerCase().includes("safari"),premultipliedAlpha:!1,preserveDrawingBuffer:!0,perPixelLighting:!0};null===e._glAttributes?e._glAttributes=t:e._glAttributes=Object.assign(t,e._glAttributes)},u.default.RendererGL.prototype._initContext=function(){try{if(this.drawingContext=this.canvas.getContext("webgl",this._pInst._glAttributes)||this.canvas.getContext("experimental-webgl",this._pInst._glAttributes),null===this.drawingContext)throw new Error("Error creating webgl context");var e=this.drawingContext;e.enable(e.DEPTH_TEST),e.depthFunc(e.LEQUAL),e.viewport(0,0,e.drawingBufferWidth,e.drawingBufferHeight),this._viewport=this.drawingContext.getParameter(this.drawingContext.VIEWPORT)}catch(e){throw e}},u.default.RendererGL.prototype._resetContext=function(e,t){var r=this.width,i=this.height,n=this.canvas.id,o=this._pInst instanceof u.default.Graphics;if(o){var a=this._pInst;a.canvas.parentNode.removeChild(a.canvas),a.canvas=document.createElement("canvas"),(a._pInst._userNode||document.body).appendChild(a.canvas),u.default.Element.call(a,a.canvas,a._pInst),a.width=r,a.height=i}else{var s=this.canvas;s&&s.parentNode.removeChild(s),(s=document.createElement("canvas")).id=n,this._pInst._userNode?this._pInst._userNode.appendChild(s):document.body.appendChild(s),this._pInst.canvas=s}var l=new u.default.RendererGL(this._pInst.canvas,this._pInst,!o);this._pInst._setProperty("_renderer",l),l.resize(r,i),l._applyDefaults(),o||this._pInst._elements.push(l),"function"==typeof t&&setTimeout(function(){t.apply(window._renderer,e)},0)},u.default.prototype.setAttributes=function(e,t){if(void 0!==this._glAttributes){var r=!0;if(void 0!==t?(null===this._glAttributes&&(this._glAttributes={}),this._glAttributes[e]!==t&&(this._glAttributes[e]=t,r=!1)):e instanceof Object&&this._glAttributes!==e&&(this._glAttributes=e,r=!1),this._renderer.isP3D&&!r){if(!this._setupDone)for(var i in this._renderer.retainedMode.geometry)if(this._renderer.retainedMode.geometry.hasOwnProperty(i))return void console.error("Sorry, Could not set the attributes, you need to call setAttributes() before calling the other drawing methods in setup()");this.push(),this._renderer._resetContext(),this.pop(),this._renderer._curCamera&&(this._renderer._curCamera._renderer=this._renderer)}}else console.log("You are trying to use setAttributes on a p5.Graphics object that does not use a WEBGL renderer.")},u.default.RendererGL.prototype._update=function(){this.uMVMatrix.set(this._curCamera.cameraMatrix.mat4[0],this._curCamera.cameraMatrix.mat4[1],this._curCamera.cameraMatrix.mat4[2],this._curCamera.cameraMatrix.mat4[3],this._curCamera.cameraMatrix.mat4[4],this._curCamera.cameraMatrix.mat4[5],this._curCamera.cameraMatrix.mat4[6],this._curCamera.cameraMatrix.mat4[7],this._curCamera.cameraMatrix.mat4[8],this._curCamera.cameraMatrix.mat4[9],this._curCamera.cameraMatrix.mat4[10],this._curCamera.cameraMatrix.mat4[11],this._curCamera.cameraMatrix.mat4[12],this._curCamera.cameraMatrix.mat4[13],this._curCamera.cameraMatrix.mat4[14],this._curCamera.cameraMatrix.mat4[15]),this.ambientLightColors.length=0,this.specularColors=[1,1,1],this.directionalLightDirections.length=0,this.directionalLightDiffuseColors.length=0,this.directionalLightSpecularColors.length=0,this.pointLightPositions.length=0,this.pointLightDiffuseColors.length=0,this.pointLightSpecularColors.length=0,this.spotLightPositions.length=0,this.spotLightDirections.length=0,this.spotLightDiffuseColors.length=0,this.spotLightSpecularColors.length=0,this.spotLightAngle.length=0,this.spotLightConc.length=0,this._enableLighting=!1,this._tint=[255,255,255,255],this.GL.clear(this.GL.DEPTH_BUFFER_BIT)},u.default.RendererGL.prototype.background=function(){var e,t=(e=this._pInst).color.apply(e,arguments),r=t.levels[0]/255,i=t.levels[1]/255,n=t.levels[2]/255,o=t.levels[3]/255;this.GL.clearColor(r,i,n,o),this.GL.clear(this.GL.COLOR_BUFFER_BIT)},u.default.RendererGL.prototype.fill=function(e,t,r,i){var n=u.default.prototype.color.apply(this._pInst,arguments);this.curFillColor=n._array,this.drawMode=o.FILL,this._useNormalMaterial=!1,this._tex=null},u.default.RendererGL.prototype.stroke=function(e,t,r,i){arguments[3]=255;var n=u.default.prototype.color.apply(this._pInst,arguments);this.curStrokeColor=n._array},u.default.RendererGL.prototype.strokeCap=function(e){console.error("Sorry, strokeCap() is not yet implemented in WEBGL mode")},u.default.RendererGL.prototype.strokeJoin=function(e){console.error("Sorry, strokeJoin() is not yet implemented in WEBGL mode")},u.default.RendererGL.prototype.filter=function(e){console.error("filter() does not work in WEBGL mode")},u.default.RendererGL.prototype.blendMode=function(e){e===o.DARKEST||e===o.LIGHTEST||e===o.ADD||e===o.BLEND||e===o.SUBTRACT||e===o.SCREEN||e===o.EXCLUSION||e===o.REPLACE||e===o.MULTIPLY||e===o.REMOVE?this.curBlendMode=e:e!==o.BURN&&e!==o.OVERLAY&&e!==o.HARD_LIGHT&&e!==o.SOFT_LIGHT&&e!==o.DODGE||console.warn("BURN, OVERLAY, HARD_LIGHT, SOFT_LIGHT, and DODGE only work for blendMode in 2D mode.")},u.default.RendererGL.prototype.erase=function(e,t){this._isErasing||(this._cachedBlendMode=this.curBlendMode,this.blendMode(o.REMOVE),this._cachedFillStyle=this.curFillColor.slice(),this.curFillColor=[1,1,1,e/255],this._cachedStrokeStyle=this.curStrokeColor.slice(),this.curStrokeColor=[1,1,1,t/255],this._isErasing=!0)},u.default.RendererGL.prototype.noErase=function(){this._isErasing&&(this.curFillColor=this._cachedFillStyle.slice(),this.curStrokeColor=this._cachedStrokeStyle.slice(),this.blendMode(this._cachedBlendMode),this._isErasing=!1)},u.default.RendererGL.prototype.strokeWeight=function(e){this.curStrokeWeight!==e&&(this.pointSize=e,this.curStrokeWeight=e)},u.default.RendererGL.prototype._getPixel=function(e,t){var r;return r=new Uint8Array(4),this.drawingContext.readPixels(e,t,1,1,this.drawingContext.RGBA,this.drawingContext.UNSIGNED_BYTE,r),[r[0],r[1],r[2],r[3]]},u.default.RendererGL.prototype.loadPixels=function(){var e=this._pixelsState;if(!0===this._pInst._glAttributes.preserveDrawingBuffer){var t=e.pixels,r=this.GL.drawingBufferWidth*this.GL.drawingBufferHeight*4;t instanceof Uint8Array&&t.length===r||(t=new Uint8Array(r),this._pixelsState._setProperty("pixels",t));var i=this._pInst._pixelDensity;this.GL.readPixels(0,0,this.width*i,this.height*i,this.GL.RGBA,this.GL.UNSIGNED_BYTE,t)}else console.log("loadPixels only works in WebGL when preserveDrawingBuffer is true.")},u.default.RendererGL.prototype.geometryInHash=function(e){return void 0!==this.retainedMode.geometry[e]},u.default.RendererGL.prototype.resize=function(e,t){u.default.Renderer.prototype.resize.call(this,e,t),this.GL.viewport(0,0,this.GL.drawingBufferWidth,this.GL.drawingBufferHeight),this._viewport=this.GL.getParameter(this.GL.VIEWPORT),this._curCamera._resize();var r=this._pixelsState;void 0!==r.pixels&&r._setProperty("pixels",new Uint8Array(this.GL.drawingBufferWidth*this.GL.drawingBufferHeight*4))},u.default.RendererGL.prototype.clear=function(){var e=(arguments.length<=0?void 0:arguments[0])||0,t=(arguments.length<=1?void 0:arguments[1])||0,r=(arguments.length<=2?void 0:arguments[2])||0,i=(arguments.length<=3?void 0:arguments[3])||0;this.GL.clearColor(e,t,r,i),this.GL.clear(this.GL.COLOR_BUFFER_BIT|this.GL.DEPTH_BUFFER_BIT)},u.default.RendererGL.prototype.applyMatrix=function(e,t,r,i,n,o){16===arguments.length?u.default.Matrix.prototype.apply.apply(this.uMVMatrix,arguments):this.uMVMatrix.apply([e,t,0,0,r,i,0,0,0,0,1,0,n,o,0,1])},u.default.RendererGL.prototype.translate=function(e,t,r){return e instanceof u.default.Vector&&(r=e.z,t=e.y,e=e.x),this.uMVMatrix.translate([e,t,r]),this},u.default.RendererGL.prototype.scale=function(e,t,r){return this.uMVMatrix.scale(e,t,r),this},u.default.RendererGL.prototype.rotate=function(e,t){return void 0===t?this.rotateZ(e):(u.default.Matrix.prototype.rotate.apply(this.uMVMatrix,arguments),this)},u.default.RendererGL.prototype.rotateX=function(e){return this.rotate(e,1,0,0),this},u.default.RendererGL.prototype.rotateY=function(e){return this.rotate(e,0,1,0),this},u.default.RendererGL.prototype.rotateZ=function(e){return this.rotate(e,0,0,1),this},u.default.RendererGL.prototype.push=function(){var e=u.default.Renderer.prototype.push.apply(this),t=e.properties;return t.uMVMatrix=this.uMVMatrix.copy(),t.uPMatrix=this.uPMatrix.copy(),t._curCamera=this._curCamera,this._curCamera=this._curCamera.copy(),t.ambientLightColors=this.ambientLightColors.slice(),t.specularColors=this.specularColors.slice(),t.directionalLightDirections=this.directionalLightDirections.slice(),t.directionalLightDiffuseColors=this.directionalLightDiffuseColors.slice(),t.directionalLightSpecularColors=this.directionalLightSpecularColors.slice(),t.pointLightPositions=this.pointLightPositions.slice(),t.pointLightDiffuseColors=this.pointLightDiffuseColors.slice(),t.pointLightSpecularColors=this.pointLightSpecularColors.slice(),t.spotLightPositions=this.spotLightPositions.slice(),t.spotLightDirections=this.spotLightDirections.slice(),t.spotLightDiffuseColors=this.spotLightDiffuseColors.slice(),t.spotLightSpecularColors=this.spotLightSpecularColors.slice(),t.spotLightAngle=this.spotLightAngle.slice(),t.spotLightConc=this.spotLightConc.slice(),t.userFillShader=this.userFillShader,t.userStrokeShader=this.userStrokeShader,t.userPointShader=this.userPointShader,t.pointSize=this.pointSize,t.curStrokeWeight=this.curStrokeWeight,t.curStrokeColor=this.curStrokeColor,t.curFillColor=this.curFillColor,t._useSpecularMaterial=this._useSpecularMaterial,t._useEmissiveMaterial=this._useEmissiveMaterial,t._useShininess=this._useShininess,t.constantAttenuation=this.constantAttenuation,t.linearAttenuation=this.linearAttenuation,t.quadraticAttenuation=this.quadraticAttenuation,t._enableLighting=this._enableLighting,t._useNormalMaterial=this._useNormalMaterial,t._tex=this._tex,t.drawMode=this.drawMode,e},u.default.RendererGL.prototype.resetMatrix=function(){return this.uMVMatrix=u.default.Matrix.identity(this._pInst),this},u.default.RendererGL.prototype._getImmediateStrokeShader=function(){var e=this.userStrokeShader;return e&&e.isStrokeShader()?e:this._getLineShader()},u.default.RendererGL.prototype._getRetainedStrokeShader=u.default.RendererGL.prototype._getImmediateStrokeShader,u.default.RendererGL.prototype._getImmediateFillShader=function(){var e=this.userFillShader;if(this._useNormalMaterial&&(!e||!e.isNormalShader()))return this._getNormalShader();if(this._enableLighting){if(!e||!e.isLightShader())return this._getLightShader()}else if(this._tex){if(!e||!e.isTextureShader())return this._getLightShader()}else if(!e)return this._getImmediateModeShader();return e},u.default.RendererGL.prototype._getRetainedFillShader=function(){if(this._useNormalMaterial)return this._getNormalShader();var e=this.userFillShader;if(this._enableLighting){if(!e||!e.isLightShader())return this._getLightShader()}else if(this._tex){if(!e||!e.isTextureShader())return this._getLightShader()}else if(!e)return this._getColorShader();return e},u.default.RendererGL.prototype._getImmediatePointShader=function(){var e=this.userPointShader;return e&&e.isPointShader()?e:this._getPointShader()},u.default.RendererGL.prototype._getRetainedLineShader=u.default.RendererGL.prototype._getImmediateLineShader,u.default.RendererGL.prototype._getLightShader=function(){return this._defaultLightShader||(this._pInst._glAttributes.perPixelLighting?this._defaultLightShader=new u.default.Shader(this,c.phongVert,c.phongFrag):this._defaultLightShader=new u.default.Shader(this,c.lightVert,c.lightTextureFrag)),this._defaultLightShader},u.default.RendererGL.prototype._getImmediateModeShader=function(){return this._defaultImmediateModeShader||(this._defaultImmediateModeShader=new u.default.Shader(this,c.immediateVert,c.vertexColorFrag)),this._defaultImmediateModeShader},u.default.RendererGL.prototype._getNormalShader=function(){return this._defaultNormalShader||(this._defaultNormalShader=new u.default.Shader(this,c.normalVert,c.normalFrag)),this._defaultNormalShader},u.default.RendererGL.prototype._getColorShader=function(){return this._defaultColorShader||(this._defaultColorShader=new u.default.Shader(this,c.normalVert,c.basicFrag)),this._defaultColorShader},u.default.RendererGL.prototype._getPointShader=function(){return this._defaultPointShader||(this._defaultPointShader=new u.default.Shader(this,c.pointVert,c.pointFrag)),this._defaultPointShader},u.default.RendererGL.prototype._getLineShader=function(){return this._defaultLineShader||(this._defaultLineShader=new u.default.Shader(this,c.lineVert,c.lineFrag)),this._defaultLineShader},u.default.RendererGL.prototype._getFontShader=function(){return this._defaultFontShader||(this.GL.getExtension("OES_standard_derivatives"),this._defaultFontShader=new u.default.Shader(this,c.fontVert,c.fontFrag)),this._defaultFontShader},u.default.RendererGL.prototype._getEmptyTexture=function(){if(!this._emptyTexture){var e=new u.default.Image(1,1);e.set(0,0,255),this._emptyTexture=new u.default.Texture(this,e)}return this._emptyTexture},u.default.RendererGL.prototype.getTexture=function(e){var t=this.textures,r=!0,i=!1,n=void 0;try{for(var o,a=t[Symbol.iterator]();!(r=(o=a.next()).done);r=!0){var s=o.value;if(s.src===e)return s}}catch(e){i=!0,n=e}finally{try{r||null==a.return||a.return()}finally{if(i)throw n}}var l=new u.default.Texture(this,e);return t.push(l),l},u.default.RendererGL.prototype._setStrokeUniforms=function(e){e.bindShader(),e.setUniform("uMaterialColor",this.curStrokeColor),e.setUniform("uStrokeWeight",this.curStrokeWeight)},u.default.RendererGL.prototype._setFillUniforms=function(e){e.bindShader(),e.setUniform("uMaterialColor",this.curFillColor),e.setUniform("isTexture",!!this._tex),this._tex&&e.setUniform("uSampler",this._tex),e.setUniform("uTint",this._tint),e.setUniform("uSpecular",this._useSpecularMaterial),e.setUniform("uEmissive",this._useEmissiveMaterial),e.setUniform("uShininess",this._useShininess),e.setUniform("uUseLighting",this._enableLighting);var t=this.pointLightDiffuseColors.length/3;e.setUniform("uPointLightCount",t),e.setUniform("uPointLightLocation",this.pointLightPositions),e.setUniform("uPointLightDiffuseColors",this.pointLightDiffuseColors),e.setUniform("uPointLightSpecularColors",this.pointLightSpecularColors);var r=this.directionalLightDiffuseColors.length/3;e.setUniform("uDirectionalLightCount",r),e.setUniform("uLightingDirection",this.directionalLightDirections),e.setUniform("uDirectionalDiffuseColors",this.directionalLightDiffuseColors),e.setUniform("uDirectionalSpecularColors",this.directionalLightSpecularColors);var i=this.ambientLightColors.length/3;e.setUniform("uAmbientLightCount",i),e.setUniform("uAmbientColor",this.ambientLightColors);var n=this.spotLightDiffuseColors.length/3;e.setUniform("uSpotLightCount",n),e.setUniform("uSpotLightAngle",this.spotLightAngle),e.setUniform("uSpotLightConc",this.spotLightConc),e.setUniform("uSpotLightDiffuseColors",this.spotLightDiffuseColors),e.setUniform("uSpotLightSpecularColors",this.spotLightSpecularColors),e.setUniform("uSpotLightLocation",this.spotLightPositions),e.setUniform("uSpotLightDirection",this.spotLightDirections),e.setUniform("uConstantAttenuation",this.constantAttenuation),e.setUniform("uLinearAttenuation",this.linearAttenuation),e.setUniform("uQuadraticAttenuation",this.quadraticAttenuation),e.bindTextures()},u.default.RendererGL.prototype._setPointUniforms=function(e){e.bindShader(),e.setUniform("uMaterialColor",this.curStrokeColor),e.setUniform("uPointSize",this.pointSize)},u.default.RendererGL.prototype._bindBuffer=function(e,t,r,i,n){if(t=t||this.GL.ARRAY_BUFFER,this.GL.bindBuffer(t,e),void 0!==r){var o=new(i||Float32Array)(r);this.GL.bufferData(t,o,n||this.GL.STATIC_DRAW)}},u.default.RendererGL.prototype._arraysEqual=function(e,t){var r=e.length;if(r!==t.length)return!1;for(var i=0;i>7,127&f,c>>7,127&c);for(var d=0;d>7,127&p,0,0)}}return{cellImageInfo:l,dimOffset:o,dimImageInfo:n}}return(t=this.glyphInfos[e.index]={glyph:e,uGlyphRect:[i.x1,-i.y1,i.x2,-i.y2],strokeImageInfo:U,strokes:d,colInfo:G(m,this.colDimImageInfos,this.colCellImageInfos),rowInfo:G(p,this.rowDimImageInfos,this.rowCellImageInfos)}).uGridOffset=[t.colInfo.dimOffset,t.rowInfo.dimOffset],t}}var z=Math.sqrt(3);j.default.RendererGL.prototype._renderText=function(e,t,r,i,n){if(this._textFont&&"string"!=typeof this._textFont){if(!(n<=i)&&this._doFill){if(!this._isOpenType())return console.log("WEBGL: only Opentype (.otf) and Truetype (.ttf) fonts are supported"),e;e.push();var o=this._doStroke,a=this.drawMode;this._doStroke=!1,this.drawMode=D.TEXTURE;var s=this._textFont.font,l=this._textFont._fontInfo;l=l||(this._textFont._fontInfo=new A(s));var u=this._textFont._handleAlignment(this,t,r,i),h=this._textSize/s.unitsPerEm;this.translate(u.x,u.y,0),this.scale(h,h,1);var c=this.GL,f=!this._defaultFontShader,d=this._getFontShader();d.init(),d.bindShader(),f&&(d.setUniform("uGridImageSize",[64,64]),d.setUniform("uCellsImageSize",[64,64]),d.setUniform("uStrokeImageSize",[64,64]),d.setUniform("uGridSize",[9,9])),this._applyColorBlend(this.curFillColor);var p=this.retainedMode.geometry.glyph;if(!p){var m=this._textGeom=new j.default.Geometry(1,1,function(){for(var e=0;e<=1;e++)for(var t=0;t<=1;t++)this.vertices.push(new j.default.Vector(t,e,0)),this.uvs.push(t,e)});m.computeFaces().computeNormals(),p=this.createBuffers("glyph",m)}var g=!0,v=!1,y=void 0;try{for(var b,_=this.retainedMode.buffers.text[Symbol.iterator]();!(g=(b=_.next()).done);g=!0){b.value._prepareBuffer(p,d)}}catch(e){v=!0,y=e}finally{try{g||null==_.return||_.return()}finally{if(v)throw y}}this._bindBuffer(p.indexBuffer,c.ELEMENT_ARRAY_BUFFER),d.setUniform("uMaterialColor",this.curFillColor);try{var x=0,w=null,S=s.stringToGlyphs(t),M=!0,E=!1,T=void 0;try{for(var C,P=S[Symbol.iterator]();!(M=(C=P.next()).done);M=!0){var L=C.value;w&&(x+=s.getKerningValue(w,L));var k=l.getGlyphInfo(L);if(k.uGlyphRect){var R=k.rowInfo,O=k.colInfo;d.setUniform("uSamplerStrokes",k.strokeImageInfo.imageData),d.setUniform("uSamplerRowStrokes",R.cellImageInfo.imageData),d.setUniform("uSamplerRows",R.dimImageInfo.imageData),d.setUniform("uSamplerColStrokes",O.cellImageInfo.imageData),d.setUniform("uSamplerCols",O.dimImageInfo.imageData),d.setUniform("uGridOffset",k.uGridOffset),d.setUniform("uGlyphRect",k.uGlyphRect),d.setUniform("uGlyphOffset",x),d.bindTextures(),c.drawElements(c.TRIANGLES,6,this.GL.UNSIGNED_SHORT,0)}x+=L.advanceWidth,w=L}}catch(e){E=!0,T=e}finally{try{M||null==P.return||P.return()}finally{if(E)throw T}}}finally{d.unbindShader(),this._doStroke=o,this.drawMode=a,e.pop()}return e}}else console.log("WEBGL: you must load and set a font before drawing text. See `loadFont` and `textFont` for more details.")}},{"../core/constants":42,"../core/main":49,"./p5.RendererGL.Retained":102,"./p5.Shader":104}],107:[function(e,t,r){t.exports={fes:{autoplay:"The media that tried to play (with '{{src}}') wasn't allowed to by this browser, most likely due to the browser's autoplay policy. Check out {{link}} for more information about why.",fileLoadError:{bytes:"It looks like there was a problem loading your file. {{suggestion}}",font:"It looks like there was a problem loading your font. {{suggestion}}",gif:"There was some trouble loading your GIF. Make sure that your GIF is using 87a or 89a encoding.",image:"It looks like there was a problem loading your image. {{suggestion}}",json:"It looks like there was a problem loading your JSON file. {{suggestion}}",large:"If your large file isn't fetched successfully, we recommend splitting the file into smaller segments and fetching those.",strings:"It looks like there was a problem loading your text file. {{suggestion}}",suggestion:"Try checking if the file path ({{filePath}}) is correct, hosting the file online, or running a local server. (More info at {{link}})",table:"It looks like there was a problem loading your table file. {{suggestion}}",xml:"It looks like there was a problem loading your XML file. {{suggestion}}"},misusedTopLevel:"Did you just try to use p5.js's {{symbolName}} {{symbolType}}? If so, you may want to move it into your sketch's setup() function.\n\nFor more details, see: {{link}}",pre:"🌸 p5.js says: {{message}}",welcome:"Welcome! This is your friendly debugger. To turn me off, switch to using p5.min.js."}}},{}],108:[function(e,t,r){t.exports={fes:{autoplay:"Su browser impidío un medio tocar (de '{{src}}'), posiblemente porque las reglas de autoplay. Para aprender más, visite {{link}}.",fileLoadError:{bytes:"",font:"",gif:"",image:"",json:"",large:"",strings:"",suggestion:"",table:"",xml:""},misusedTopLevel:"",pre:"🌸 p5.js dice: {{message}}",welcome:""}}},{}],109:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i=o(e("./en/translation")),n=o(e("./es/translation"));function o(e){return e&&e.__esModule?e:{default:e}}var a={en:{translation:i.default},es:{translation:n.default}};r.default=a},{"./en/translation":107,"./es/translation":108}]},{},[37])(37)}); ================================================ FILE: docs/examples/sketch_000/target/org.transcrypt.__runtime__.js ================================================ // Transcrypt'ed from Python, 2020-04-28 21:56:45 var __name__ = 'org.transcrypt.__runtime__'; export var __envir__ = {}; __envir__.interpreter_name = 'python'; __envir__.transpiler_name = 'transcrypt'; __envir__.executor_name = __envir__.transpiler_name; __envir__.transpiler_version = '3.7.16'; export function __nest__ (headObject, tailNames, value) { var current = headObject; if (tailNames != '') { var tailChain = tailNames.split ('.'); var firstNewIndex = tailChain.length; for (var index = 0; index < tailChain.length; index++) { if (!current.hasOwnProperty (tailChain [index])) { firstNewIndex = index; break; } current = current [tailChain [index]]; } for (var index = firstNewIndex; index < tailChain.length; index++) { current [tailChain [index]] = {}; current = current [tailChain [index]]; } } for (let attrib of Object.getOwnPropertyNames (value)) { Object.defineProperty (current, attrib, { get () {return value [attrib];}, enumerable: true, configurable: true }); } }; export function __init__ (module) { if (!module.__inited__) { module.__all__.__init__ (module.__all__); module.__inited__ = true; } return module.__all__; }; export var __proxy__ = false; export function __get__ (self, func, quotedFuncName) { if (self) { if (self.hasOwnProperty ('__class__') || typeof self == 'string' || self instanceof String) { if (quotedFuncName) { Object.defineProperty (self, quotedFuncName, { value: function () { var args = [] .slice.apply (arguments); return func.apply (null, [self] .concat (args)); }, writable: true, enumerable: true, configurable: true }); } return function () { var args = [] .slice.apply (arguments); return func.apply (null, [self] .concat (args)); }; } else { return func; } } else { return func; } }; export function __getcm__ (self, func, quotedFuncName) { if (self.hasOwnProperty ('__class__')) { return function () { var args = [] .slice.apply (arguments); return func.apply (null, [self.__class__] .concat (args)); }; } else { return function () { var args = [] .slice.apply (arguments); return func.apply (null, [self] .concat (args)); }; } }; export function __getsm__ (self, func, quotedFuncName) { return func; }; export var py_metatype = { __name__: 'type', __bases__: [], __new__: function (meta, name, bases, attribs) { var cls = function () { var args = [] .slice.apply (arguments); return cls.__new__ (args); }; for (var index = bases.length - 1; index >= 0; index--) { var base = bases [index]; for (var attrib in base) { var descrip = Object.getOwnPropertyDescriptor (base, attrib); Object.defineProperty (cls, attrib, descrip); } for (let symbol of Object.getOwnPropertySymbols (base)) { let descrip = Object.getOwnPropertyDescriptor (base, symbol); Object.defineProperty (cls, symbol, descrip); } } cls.__metaclass__ = meta; cls.__name__ = name.startsWith ('py_') ? name.slice (3) : name; cls.__bases__ = bases; for (var attrib in attribs) { var descrip = Object.getOwnPropertyDescriptor (attribs, attrib); Object.defineProperty (cls, attrib, descrip); } for (let symbol of Object.getOwnPropertySymbols (attribs)) { let descrip = Object.getOwnPropertyDescriptor (attribs, symbol); Object.defineProperty (cls, symbol, descrip); } return cls; } }; py_metatype.__metaclass__ = py_metatype; export var object = { __init__: function (self) {}, __metaclass__: py_metatype, __name__: 'object', __bases__: [], __new__: function (args) { var instance = Object.create (this, {__class__: {value: this, enumerable: true}}); if ('__getattr__' in this || '__setattr__' in this) { instance = new Proxy (instance, { get: function (target, name) { let result = target [name]; if (result == undefined) { return target.__getattr__ (name); } else { return result; } }, set: function (target, name, value) { try { target.__setattr__ (name, value); } catch (exception) { target [name] = value; } return true; } }) } this.__init__.apply (null, [instance] .concat (args)); return instance; } }; export function __class__ (name, bases, attribs, meta) { if (meta === undefined) { meta = bases [0] .__metaclass__; } return meta.__new__ (meta, name, bases, attribs); }; export function __pragma__ () {}; export function __call__ (/* , , * */) { var args = [] .slice.apply (arguments); if (typeof args [0] == 'object' && '__call__' in args [0]) { return args [0] .__call__ .apply (args [1], args.slice (2)); } else { return args [0] .apply (args [1], args.slice (2)); } }; __envir__.executor_name = __envir__.transpiler_name; var __main__ = {__file__: ''}; var __except__ = null; export function __kwargtrans__ (anObject) { anObject.__kwargtrans__ = null; anObject.constructor = Object; return anObject; } export function __super__ (aClass, methodName) { for (let base of aClass.__bases__) { if (methodName in base) { return base [methodName]; } } throw new Exception ('Superclass method not found'); } export function property (getter, setter) { if (!setter) { setter = function () {}; } return {get: function () {return getter (this)}, set: function (value) {setter (this, value)}, enumerable: true}; } export function __setproperty__ (anObject, name, descriptor) { if (!anObject.hasOwnProperty (name)) { Object.defineProperty (anObject, name, descriptor); } } export function assert (condition, message) { if (!condition) { throw AssertionError (message, new Error ()); } } export function __mergekwargtrans__ (object0, object1) { var result = {}; for (var attrib in object0) { result [attrib] = object0 [attrib]; } for (var attrib in object1) { result [attrib] = object1 [attrib]; } return result; }; export function __mergefields__ (targetClass, sourceClass) { let fieldNames = ['__reprfields__', '__comparefields__', '__initfields__'] if (sourceClass [fieldNames [0]]) { if (targetClass [fieldNames [0]]) { for (let fieldName of fieldNames) { targetClass [fieldName] = new Set ([...targetClass [fieldName], ...sourceClass [fieldName]]); } } else { for (let fieldName of fieldNames) { targetClass [fieldName] = new Set (sourceClass [fieldName]); } } } } export function __withblock__ (manager, statements) { if (hasattr (manager, '__enter__')) { try { manager.__enter__ (); statements (); manager.__exit__ (); } catch (exception) { if (! (manager.__exit__ (exception.name, exception, exception.stack))) { throw exception; } } } else { statements (); manager.close (); } }; export function dir (obj) { var aList = []; for (var aKey in obj) { aList.push (aKey.startsWith ('py_') ? aKey.slice (3) : aKey); } aList.sort (); return aList; }; export function setattr (obj, name, value) { obj [name] = value; }; export function getattr (obj, name) { return name in obj ? obj [name] : obj ['py_' + name]; }; export function hasattr (obj, name) { try { return name in obj || 'py_' + name in obj; } catch (exception) { return false; } }; export function delattr (obj, name) { if (name in obj) { delete obj [name]; } else { delete obj ['py_' + name]; } }; export function __in__ (element, container) { if (container === undefined || container === null) { return false; } if (container.__contains__ instanceof Function) { return container.__contains__ (element); } else { return ( container.indexOf ? container.indexOf (element) > -1 : container.hasOwnProperty (element) ); } }; export function __specialattrib__ (attrib) { return (attrib.startswith ('__') && attrib.endswith ('__')) || attrib == 'constructor' || attrib.startswith ('py_'); }; export function len (anObject) { if (anObject === undefined || anObject === null) { return 0; } if (anObject.__len__ instanceof Function) { return anObject.__len__ (); } if (anObject.length !== undefined) { return anObject.length; } var length = 0; for (var attr in anObject) { if (!__specialattrib__ (attr)) { length++; } } return length; }; export function __i__ (any) { return py_typeof (any) == dict ? any.py_keys () : any; } export function __k__ (keyed, key) { var result = keyed [key]; if (typeof result == 'undefined') { if (keyed instanceof Array) if (key == +key && key >= 0 && keyed.length > key) return result; else throw IndexError (key, new Error()); else throw KeyError (key, new Error()); } return result; } export function __t__ (target) { return ( target === undefined || target === null ? false : ['boolean', 'number'] .indexOf (typeof target) >= 0 ? target : target.__bool__ instanceof Function ? (target.__bool__ () ? target : false) : target.__len__ instanceof Function ? (target.__len__ () !== 0 ? target : false) : target instanceof Function ? target : len (target) !== 0 ? target : false ); } export function float (any) { if (any == 'inf') { return Infinity; } else if (any == '-inf') { return -Infinity; } else if (any == 'nan') { return NaN; } else if (isNaN (parseFloat (any))) { if (any === false) { return 0; } else if (any === true) { return 1; } else { throw ValueError ("could not convert string to float: '" + str(any) + "'", new Error ()); } } else { return +any; } }; float.__name__ = 'float'; float.__bases__ = [object]; export function int (any) { return float (any) | 0 }; int.__name__ = 'int'; int.__bases__ = [object]; export function bool (any) { return !!__t__ (any); }; bool.__name__ = 'bool'; bool.__bases__ = [int]; export function py_typeof (anObject) { var aType = typeof anObject; if (aType == 'object') { try { return '__class__' in anObject ? anObject.__class__ : object; } catch (exception) { return aType; } } else { return ( aType == 'boolean' ? bool : aType == 'string' ? str : aType == 'number' ? (anObject % 1 == 0 ? int : float) : null ); } }; export function issubclass (aClass, classinfo) { if (classinfo instanceof Array) { for (let aClass2 of classinfo) { if (issubclass (aClass, aClass2)) { return true; } } return false; } try { var aClass2 = aClass; if (aClass2 == classinfo) { return true; } else { var bases = [].slice.call (aClass2.__bases__); while (bases.length) { aClass2 = bases.shift (); if (aClass2 == classinfo) { return true; } if (aClass2.__bases__.length) { bases = [].slice.call (aClass2.__bases__).concat (bases); } } return false; } } catch (exception) { return aClass == classinfo || classinfo == object; } }; export function isinstance (anObject, classinfo) { try { return '__class__' in anObject ? issubclass (anObject.__class__, classinfo) : issubclass (py_typeof (anObject), classinfo); } catch (exception) { return issubclass (py_typeof (anObject), classinfo); } }; export function callable (anObject) { return anObject && typeof anObject == 'object' && '__call__' in anObject ? true : typeof anObject === 'function'; }; export function repr (anObject) { try { return anObject.__repr__ (); } catch (exception) { try { return anObject.__str__ (); } catch (exception) { try { if (anObject == null) { return 'None'; } else if (anObject.constructor == Object) { var result = '{'; var comma = false; for (var attrib in anObject) { if (!__specialattrib__ (attrib)) { if (attrib.isnumeric ()) { var attribRepr = attrib; } else { var attribRepr = '\'' + attrib + '\''; } if (comma) { result += ', '; } else { comma = true; } result += attribRepr + ': ' + repr (anObject [attrib]); } } result += '}'; return result; } else { return typeof anObject == 'boolean' ? anObject.toString () .capitalize () : anObject.toString (); } } catch (exception) { return ''; } } } }; export function chr (charCode) { return String.fromCharCode (charCode); }; export function ord (aChar) { return aChar.charCodeAt (0); }; export function max (nrOrSeq) { return arguments.length == 1 ? Math.max (...nrOrSeq) : Math.max (...arguments); }; export function min (nrOrSeq) { return arguments.length == 1 ? Math.min (...nrOrSeq) : Math.min (...arguments); }; export var abs = Math.abs; export function round (number, ndigits) { if (ndigits) { var scale = Math.pow (10, ndigits); number *= scale; } var rounded = Math.round (number); if (rounded - number == 0.5 && rounded % 2) { rounded -= 1; } if (ndigits) { rounded /= scale; } return rounded; }; export function __jsUsePyNext__ () { try { var result = this.__next__ (); return {value: result, done: false}; } catch (exception) { return {value: undefined, done: true}; } } export function __pyUseJsNext__ () { var result = this.next (); if (result.done) { throw StopIteration (new Error ()); } else { return result.value; } } export function py_iter (iterable) { if (typeof iterable == 'string' || '__iter__' in iterable) { var result = iterable.__iter__ (); result.next = __jsUsePyNext__; } else if ('selector' in iterable) { var result = list (iterable) .__iter__ (); result.next = __jsUsePyNext__; } else if ('next' in iterable) { var result = iterable if (! ('__next__' in result)) { result.__next__ = __pyUseJsNext__; } } else if (Symbol.iterator in iterable) { var result = iterable [Symbol.iterator] (); result.__next__ = __pyUseJsNext__; } else { throw IterableError (new Error ()); } result [Symbol.iterator] = function () {return result;}; return result; } export function py_next (iterator) { try { var result = iterator.__next__ (); } catch (exception) { var result = iterator.next (); if (result.done) { throw StopIteration (new Error ()); } else { return result.value; } } if (result == undefined) { throw StopIteration (new Error ()); } else { return result; } } export function __PyIterator__ (iterable) { this.iterable = iterable; this.index = 0; } __PyIterator__.prototype.__next__ = function() { if (this.index < this.iterable.length) { return this.iterable [this.index++]; } else { throw StopIteration (new Error ()); } }; export function __JsIterator__ (iterable) { this.iterable = iterable; this.index = 0; } __JsIterator__.prototype.next = function () { if (this.index < this.iterable.py_keys.length) { return {value: this.index++, done: false}; } else { return {value: undefined, done: true}; } }; export function py_reversed (iterable) { iterable = iterable.slice (); iterable.reverse (); return iterable; }; export function zip () { var args = [] .slice.call (arguments); for (var i = 0; i < args.length; i++) { if (typeof args [i] == 'string') { args [i] = args [i] .split (''); } else if (!Array.isArray (args [i])) { args [i] = Array.from (args [i]); } } var shortest = args.length == 0 ? [] : args.reduce ( function (array0, array1) { return array0.length < array1.length ? array0 : array1; } ); return shortest.map ( function (current, index) { return args.map ( function (current) { return current [index]; } ); } ); }; export function range (start, stop, step) { if (stop == undefined) { stop = start; start = 0; } if (step == undefined) { step = 1; } if ((step > 0 && start >= stop) || (step < 0 && start <= stop)) { return []; } var result = []; for (var i = start; step > 0 ? i < stop : i > stop; i += step) { result.push(i); } return result; }; export function any (iterable) { for (let item of iterable) { if (bool (item)) { return true; } } return false; } export function all (iterable) { for (let item of iterable) { if (! bool (item)) { return false; } } return true; } export function sum (iterable) { let result = 0; for (let item of iterable) { result += item; } return result; } export function enumerate (iterable) { return zip (range (len (iterable)), iterable); } export function copy (anObject) { if (anObject == null || typeof anObject == "object") { return anObject; } else { var result = {}; for (var attrib in obj) { if (anObject.hasOwnProperty (attrib)) { result [attrib] = anObject [attrib]; } } return result; } } export function deepcopy (anObject) { if (anObject == null || typeof anObject == "object") { return anObject; } else { var result = {}; for (var attrib in obj) { if (anObject.hasOwnProperty (attrib)) { result [attrib] = deepcopy (anObject [attrib]); } } return result; } } export function list (iterable) { let instance = iterable ? Array.from (iterable) : []; return instance; } Array.prototype.__class__ = list; list.__name__ = 'list'; list.__bases__ = [object]; Array.prototype.__iter__ = function () {return new __PyIterator__ (this);}; Array.prototype.__getslice__ = function (start, stop, step) { if (start < 0) { start = this.length + start; } if (stop == null) { stop = this.length; } else if (stop < 0) { stop = this.length + stop; } else if (stop > this.length) { stop = this.length; } if (step == 1) { return Array.prototype.slice.call(this, start, stop); } let result = list ([]); for (let index = start; index < stop; index += step) { result.push (this [index]); } return result; }; Array.prototype.__setslice__ = function (start, stop, step, source) { if (start < 0) { start = this.length + start; } if (stop == null) { stop = this.length; } else if (stop < 0) { stop = this.length + stop; } if (step == null) { Array.prototype.splice.apply (this, [start, stop - start] .concat (source)); } else { let sourceIndex = 0; for (let targetIndex = start; targetIndex < stop; targetIndex += step) { this [targetIndex] = source [sourceIndex++]; } } }; Array.prototype.__repr__ = function () { if (this.__class__ == set && !this.length) { return 'set()'; } let result = !this.__class__ || this.__class__ == list ? '[' : this.__class__ == tuple ? '(' : '{'; for (let index = 0; index < this.length; index++) { if (index) { result += ', '; } result += repr (this [index]); } if (this.__class__ == tuple && this.length == 1) { result += ','; } result += !this.__class__ || this.__class__ == list ? ']' : this.__class__ == tuple ? ')' : '}';; return result; }; Array.prototype.__str__ = Array.prototype.__repr__; Array.prototype.append = function (element) { this.push (element); }; Array.prototype.py_clear = function () { this.length = 0; }; Array.prototype.extend = function (aList) { this.push.apply (this, aList); }; Array.prototype.insert = function (index, element) { this.splice (index, 0, element); }; Array.prototype.remove = function (element) { let index = this.indexOf (element); if (index == -1) { throw ValueError ("list.remove(x): x not in list", new Error ()); } this.splice (index, 1); }; Array.prototype.index = function (element) { return this.indexOf (element); }; Array.prototype.py_pop = function (index) { if (index == undefined) { return this.pop (); } else { return this.splice (index, 1) [0]; } }; Array.prototype.py_sort = function () { __sort__.apply (null, [this].concat ([] .slice.apply (arguments))); }; Array.prototype.__add__ = function (aList) { return list (this.concat (aList)); }; Array.prototype.__mul__ = function (scalar) { let result = this; for (let i = 1; i < scalar; i++) { result = result.concat (this); } return result; }; Array.prototype.__rmul__ = Array.prototype.__mul__; export function tuple (iterable) { let instance = iterable ? [] .slice.apply (iterable) : []; instance.__class__ = tuple; return instance; } tuple.__name__ = 'tuple'; tuple.__bases__ = [object]; export function set (iterable) { let instance = []; if (iterable) { for (let index = 0; index < iterable.length; index++) { instance.add (iterable [index]); } } instance.__class__ = set; return instance; } set.__name__ = 'set'; set.__bases__ = [object]; Array.prototype.__bindexOf__ = function (element) { element += ''; let mindex = 0; let maxdex = this.length - 1; while (mindex <= maxdex) { let index = (mindex + maxdex) / 2 | 0; let middle = this [index] + ''; if (middle < element) { mindex = index + 1; } else if (middle > element) { maxdex = index - 1; } else { return index; } } return -1; }; Array.prototype.add = function (element) { if (this.indexOf (element) == -1) { this.push (element); } }; Array.prototype.discard = function (element) { var index = this.indexOf (element); if (index != -1) { this.splice (index, 1); } }; Array.prototype.isdisjoint = function (other) { this.sort (); for (let i = 0; i < other.length; i++) { if (this.__bindexOf__ (other [i]) != -1) { return false; } } return true; }; Array.prototype.issuperset = function (other) { this.sort (); for (let i = 0; i < other.length; i++) { if (this.__bindexOf__ (other [i]) == -1) { return false; } } return true; }; Array.prototype.issubset = function (other) { return set (other.slice ()) .issuperset (this); }; Array.prototype.union = function (other) { let result = set (this.slice () .sort ()); for (let i = 0; i < other.length; i++) { if (result.__bindexOf__ (other [i]) == -1) { result.push (other [i]); } } return result; }; Array.prototype.intersection = function (other) { this.sort (); let result = set (); for (let i = 0; i < other.length; i++) { if (this.__bindexOf__ (other [i]) != -1) { result.push (other [i]); } } return result; }; Array.prototype.difference = function (other) { let sother = set (other.slice () .sort ()); let result = set (); for (let i = 0; i < this.length; i++) { if (sother.__bindexOf__ (this [i]) == -1) { result.push (this [i]); } } return result; }; Array.prototype.symmetric_difference = function (other) { return this.union (other) .difference (this.intersection (other)); }; Array.prototype.py_update = function () { let updated = [] .concat.apply (this.slice (), arguments) .sort (); this.py_clear (); for (let i = 0; i < updated.length; i++) { if (updated [i] != updated [i - 1]) { this.push (updated [i]); } } }; Array.prototype.__eq__ = function (other) { if (this.length != other.length) { return false; } if (this.__class__ == set) { this.sort (); other.sort (); } for (let i = 0; i < this.length; i++) { if (this [i] != other [i]) { return false; } } return true; }; Array.prototype.__ne__ = function (other) { return !this.__eq__ (other); }; Array.prototype.__le__ = function (other) { if (this.__class__ == set) { return this.issubset (other); } else { for (let i = 0; i < this.length; i++) { if (this [i] > other [i]) { return false; } else if (this [i] < other [i]) { return true; } } return true; } }; Array.prototype.__ge__ = function (other) { if (this.__class__ == set) { return this.issuperset (other); } else { for (let i = 0; i < this.length; i++) { if (this [i] < other [i]) { return false; } else if (this [i] > other [i]) { return true; } } return true; } }; Array.prototype.__lt__ = function (other) { return ( this.__class__ == set ? this.issubset (other) && !this.issuperset (other) : !this.__ge__ (other) ); }; Array.prototype.__gt__ = function (other) { return ( this.__class__ == set ? this.issuperset (other) && !this.issubset (other) : !this.__le__ (other) ); }; export function bytearray (bytable, encoding) { if (bytable == undefined) { return new Uint8Array (0); } else { let aType = py_typeof (bytable); if (aType == int) { return new Uint8Array (bytable); } else if (aType == str) { let aBytes = new Uint8Array (len (bytable)); for (let i = 0; i < len (bytable); i++) { aBytes [i] = bytable.charCodeAt (i); } return aBytes; } else if (aType == list || aType == tuple) { return new Uint8Array (bytable); } else { throw py_TypeError; } } } export var bytes = bytearray; Uint8Array.prototype.__add__ = function (aBytes) { let result = new Uint8Array (this.length + aBytes.length); result.set (this); result.set (aBytes, this.length); return result; }; Uint8Array.prototype.__mul__ = function (scalar) { let result = new Uint8Array (scalar * this.length); for (let i = 0; i < scalar; i++) { result.set (this, i * this.length); } return result; }; Uint8Array.prototype.__rmul__ = Uint8Array.prototype.__mul__; export function str (stringable) { if (typeof stringable === 'number') return stringable.toString(); else { try { return stringable.__str__ (); } catch (exception) { try { return repr (stringable); } catch (exception) { return String (stringable); } } } }; String.prototype.__class__ = str; str.__name__ = 'str'; str.__bases__ = [object]; String.prototype.__iter__ = function () {new __PyIterator__ (this);}; String.prototype.__repr__ = function () { return (this.indexOf ('\'') == -1 ? '\'' + this + '\'' : '"' + this + '"') .py_replace ('\t', '\\t') .py_replace ('\n', '\\n'); }; String.prototype.__str__ = function () { return this; }; String.prototype.capitalize = function () { return this.charAt (0).toUpperCase () + this.slice (1); }; String.prototype.endswith = function (suffix) { if (suffix instanceof Array) { for (var i=0;i> b; } }; export function __or__ (a, b) { if (typeof a == 'object' && '__or__' in a) { return a.__or__ (b); } else if (typeof b == 'object' && '__ror__' in b) { return b.__ror__ (a); } else { return a | b; } }; export function __xor__ (a, b) { if (typeof a == 'object' && '__xor__' in a) { return a.__xor__ (b); } else if (typeof b == 'object' && '__rxor__' in b) { return b.__rxor__ (a); } else { return a ^ b; } }; export function __and__ (a, b) { if (typeof a == 'object' && '__and__' in a) { return a.__and__ (b); } else if (typeof b == 'object' && '__rand__' in b) { return b.__rand__ (a); } else { return a & b; } }; export function __eq__ (a, b) { if (typeof a == 'object' && '__eq__' in a) { return a.__eq__ (b); } else { return a == b; } }; export function __ne__ (a, b) { if (typeof a == 'object' && '__ne__' in a) { return a.__ne__ (b); } else { return a != b } }; export function __lt__ (a, b) { if (typeof a == 'object' && '__lt__' in a) { return a.__lt__ (b); } else { return a < b; } }; export function __le__ (a, b) { if (typeof a == 'object' && '__le__' in a) { return a.__le__ (b); } else { return a <= b; } }; export function __gt__ (a, b) { if (typeof a == 'object' && '__gt__' in a) { return a.__gt__ (b); } else { return a > b; } }; export function __ge__ (a, b) { if (typeof a == 'object' && '__ge__' in a) { return a.__ge__ (b); } else { return a >= b; } }; export function __imatmul__ (a, b) { if ('__imatmul__' in a) { return a.__imatmul__ (b); } else { return a.__matmul__ (b); } }; export function __ipow__ (a, b) { if (typeof a == 'object' && '__pow__' in a) { return a.__ipow__ (b); } else if (typeof a == 'object' && '__ipow__' in a) { return a.__pow__ (b); } else if (typeof b == 'object' && '__rpow__' in b) { return b.__rpow__ (a); } else { return Math.pow (a, b); } }; export function __ijsmod__ (a, b) { if (typeof a == 'object' && '__imod__' in a) { return a.__ismod__ (b); } else if (typeof a == 'object' && '__mod__' in a) { return a.__mod__ (b); } else if (typeof b == 'object' && '__rpow__' in b) { return b.__rmod__ (a); } else { return a % b; } }; export function __imod__ (a, b) { if (typeof a == 'object' && '__imod__' in a) { return a.__imod__ (b); } else if (typeof a == 'object' && '__mod__' in a) { return a.__mod__ (b); } else if (typeof b == 'object' && '__rmod__' in b) { return b.__rmod__ (a); } else { return ((a % b) + b) % b; } }; export function __imul__ (a, b) { if (typeof a == 'object' && '__imul__' in a) { return a.__imul__ (b); } else if (typeof a == 'object' && '__mul__' in a) { return a = a.__mul__ (b); } else if (typeof b == 'object' && '__rmul__' in b) { return a = b.__rmul__ (a); } else if (typeof a == 'string') { return a = a.__mul__ (b); } else if (typeof b == 'string') { return a = b.__rmul__ (a); } else { return a *= b; } }; export function __idiv__ (a, b) { if (typeof a == 'object' && '__idiv__' in a) { return a.__idiv__ (b); } else if (typeof a == 'object' && '__div__' in a) { return a = a.__div__ (b); } else if (typeof b == 'object' && '__rdiv__' in b) { return a = b.__rdiv__ (a); } else { return a /= b; } }; export function __iadd__ (a, b) { if (typeof a == 'object' && '__iadd__' in a) { return a.__iadd__ (b); } else if (typeof a == 'object' && '__add__' in a) { return a = a.__add__ (b); } else if (typeof b == 'object' && '__radd__' in b) { return a = b.__radd__ (a); } else { return a += b; } }; export function __isub__ (a, b) { if (typeof a == 'object' && '__isub__' in a) { return a.__isub__ (b); } else if (typeof a == 'object' && '__sub__' in a) { return a = a.__sub__ (b); } else if (typeof b == 'object' && '__rsub__' in b) { return a = b.__rsub__ (a); } else { return a -= b; } }; export function __ilshift__ (a, b) { if (typeof a == 'object' && '__ilshift__' in a) { return a.__ilshift__ (b); } else if (typeof a == 'object' && '__lshift__' in a) { return a = a.__lshift__ (b); } else if (typeof b == 'object' && '__rlshift__' in b) { return a = b.__rlshift__ (a); } else { return a <<= b; } }; export function __irshift__ (a, b) { if (typeof a == 'object' && '__irshift__' in a) { return a.__irshift__ (b); } else if (typeof a == 'object' && '__rshift__' in a) { return a = a.__rshift__ (b); } else if (typeof b == 'object' && '__rrshift__' in b) { return a = b.__rrshift__ (a); } else { return a >>= b; } }; export function __ior__ (a, b) { if (typeof a == 'object' && '__ior__' in a) { return a.__ior__ (b); } else if (typeof a == 'object' && '__or__' in a) { return a = a.__or__ (b); } else if (typeof b == 'object' && '__ror__' in b) { return a = b.__ror__ (a); } else { return a |= b; } }; export function __ixor__ (a, b) { if (typeof a == 'object' && '__ixor__' in a) { return a.__ixor__ (b); } else if (typeof a == 'object' && '__xor__' in a) { return a = a.__xor__ (b); } else if (typeof b == 'object' && '__rxor__' in b) { return a = b.__rxor__ (a); } else { return a ^= b; } }; export function __iand__ (a, b) { if (typeof a == 'object' && '__iand__' in a) { return a.__iand__ (b); } else if (typeof a == 'object' && '__and__' in a) { return a = a.__and__ (b); } else if (typeof b == 'object' && '__rand__' in b) { return a = b.__rand__ (a); } else { return a &= b; } }; export function __getitem__ (container, key) { if (typeof container == 'object' && '__getitem__' in container) { return container.__getitem__ (key); } else if ((typeof container == 'string' || container instanceof Array) && key < 0) { return container [container.length + key]; } else { return container [key]; } }; export function __setitem__ (container, key, value) { if (typeof container == 'object' && '__setitem__' in container) { container.__setitem__ (key, value); } else if ((typeof container == 'string' || container instanceof Array) && key < 0) { container [container.length + key] = value; } else { container [key] = value; } }; export function __getslice__ (container, lower, upper, step) { if (typeof container == 'object' && '__getitem__' in container) { return container.__getitem__ ([lower, upper, step]); } else { return container.__getslice__ (lower, upper, step); } }; export function __setslice__ (container, lower, upper, step, value) { if (typeof container == 'object' && '__setitem__' in container) { container.__setitem__ ([lower, upper, step], value); } else { container.__setslice__ (lower, upper, step, value); } }; export var BaseException = __class__ ('BaseException', [object], { __module__: __name__, }); export var Exception = __class__ ('Exception', [BaseException], { __module__: __name__, get __init__ () {return __get__ (this, function (self) { var kwargs = dict (); if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'self': var self = __allkwargs0__ [__attrib0__]; break; default: kwargs [__attrib0__] = __allkwargs0__ [__attrib0__]; } } delete kwargs.__kwargtrans__; } var args = tuple ([].slice.apply (arguments).slice (1, __ilastarg0__ + 1)); } else { var args = tuple (); } self.__args__ = args; try { self.stack = kwargs.error.stack; } catch (__except0__) { self.stack = 'No stack trace available'; } });}, get __repr__ () {return __get__ (this, function (self) { if (len (self.__args__) > 1) { return '{}{}'.format (self.__class__.__name__, repr (tuple (self.__args__))); } else if (len (self.__args__)) { return '{}({})'.format (self.__class__.__name__, repr (self.__args__ [0])); } else { return '{}()'.format (self.__class__.__name__); } });}, get __str__ () {return __get__ (this, function (self) { if (len (self.__args__) > 1) { return str (tuple (self.__args__)); } else if (len (self.__args__)) { return str (self.__args__ [0]); } else { return ''; } });} }); export var IterableError = __class__ ('IterableError', [Exception], { __module__: __name__, get __init__ () {return __get__ (this, function (self, error) { Exception.__init__ (self, "Can't iterate over non-iterable", __kwargtrans__ ({error: error})); });} }); export var StopIteration = __class__ ('StopIteration', [Exception], { __module__: __name__, get __init__ () {return __get__ (this, function (self, error) { Exception.__init__ (self, 'Iterator exhausted', __kwargtrans__ ({error: error})); });} }); export var ValueError = __class__ ('ValueError', [Exception], { __module__: __name__, get __init__ () {return __get__ (this, function (self, message, error) { Exception.__init__ (self, message, __kwargtrans__ ({error: error})); });} }); export var KeyError = __class__ ('KeyError', [Exception], { __module__: __name__, get __init__ () {return __get__ (this, function (self, message, error) { Exception.__init__ (self, message, __kwargtrans__ ({error: error})); });} }); export var AssertionError = __class__ ('AssertionError', [Exception], { __module__: __name__, get __init__ () {return __get__ (this, function (self, message, error) { if (message) { Exception.__init__ (self, message, __kwargtrans__ ({error: error})); } else { Exception.__init__ (self, __kwargtrans__ ({error: error})); } });} }); export var NotImplementedError = __class__ ('NotImplementedError', [Exception], { __module__: __name__, get __init__ () {return __get__ (this, function (self, message, error) { Exception.__init__ (self, message, __kwargtrans__ ({error: error})); });} }); export var IndexError = __class__ ('IndexError', [Exception], { __module__: __name__, get __init__ () {return __get__ (this, function (self, message, error) { Exception.__init__ (self, message, __kwargtrans__ ({error: error})); });} }); export var AttributeError = __class__ ('AttributeError', [Exception], { __module__: __name__, get __init__ () {return __get__ (this, function (self, message, error) { Exception.__init__ (self, message, __kwargtrans__ ({error: error})); });} }); export var py_TypeError = __class__ ('py_TypeError', [Exception], { __module__: __name__, get __init__ () {return __get__ (this, function (self, message, error) { Exception.__init__ (self, message, __kwargtrans__ ({error: error})); });} }); export var Warning = __class__ ('Warning', [Exception], { __module__: __name__, }); export var UserWarning = __class__ ('UserWarning', [Warning], { __module__: __name__, }); export var DeprecationWarning = __class__ ('DeprecationWarning', [Warning], { __module__: __name__, }); export var RuntimeWarning = __class__ ('RuntimeWarning', [Warning], { __module__: __name__, }); export var __sort__ = function (iterable, key, reverse) { if (typeof key == 'undefined' || (key != null && key.hasOwnProperty ("__kwargtrans__"))) {; var key = null; }; if (typeof reverse == 'undefined' || (reverse != null && reverse.hasOwnProperty ("__kwargtrans__"))) {; var reverse = false; }; if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'iterable': var iterable = __allkwargs0__ [__attrib0__]; break; case 'key': var key = __allkwargs0__ [__attrib0__]; break; case 'reverse': var reverse = __allkwargs0__ [__attrib0__]; break; } } } } else { } if (key) { iterable.sort ((function __lambda__ (a, b) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'a': var a = __allkwargs0__ [__attrib0__]; break; case 'b': var b = __allkwargs0__ [__attrib0__]; break; } } } } else { } return (key (a) > key (b) ? 1 : -(1)); })); } else { iterable.sort (); } if (reverse) { iterable.reverse (); } }; export var sorted = function (iterable, key, reverse) { if (typeof key == 'undefined' || (key != null && key.hasOwnProperty ("__kwargtrans__"))) {; var key = null; }; if (typeof reverse == 'undefined' || (reverse != null && reverse.hasOwnProperty ("__kwargtrans__"))) {; var reverse = false; }; if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'iterable': var iterable = __allkwargs0__ [__attrib0__]; break; case 'key': var key = __allkwargs0__ [__attrib0__]; break; case 'reverse': var reverse = __allkwargs0__ [__attrib0__]; break; } } } } else { } if (py_typeof (iterable) == dict) { var result = copy (iterable.py_keys ()); } else { var result = copy (iterable); } __sort__ (result, key, reverse); return result; }; export var map = function (func, iterable) { return (function () { var __accu0__ = []; for (var item of iterable) { __accu0__.append (func (item)); } return __accu0__; }) (); }; export var filter = function (func, iterable) { if (func == null) { var func = bool; } return (function () { var __accu0__ = []; for (var item of iterable) { if (func (item)) { __accu0__.append (item); } } return __accu0__; }) (); }; export var divmod = function (n, d) { return tuple ([Math.floor (n / d), __mod__ (n, d)]); }; export var __Terminal__ = __class__ ('__Terminal__', [object], { __module__: __name__, get __init__ () {return __get__ (this, function (self) { self.buffer = ''; try { self.element = document.getElementById ('__terminal__'); } catch (__except0__) { self.element = null; } if (self.element) { self.element.style.overflowX = 'auto'; self.element.style.boxSizing = 'border-box'; self.element.style.padding = '5px'; self.element.innerHTML = '_'; } });}, get print () {return __get__ (this, function (self) { var sep = ' '; var end = '\n'; if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'self': var self = __allkwargs0__ [__attrib0__]; break; case 'sep': var sep = __allkwargs0__ [__attrib0__]; break; case 'end': var end = __allkwargs0__ [__attrib0__]; break; } } } var args = tuple ([].slice.apply (arguments).slice (1, __ilastarg0__ + 1)); } else { var args = tuple (); } self.buffer = '{}{}{}'.format (self.buffer, sep.join ((function () { var __accu0__ = []; for (var arg of args) { __accu0__.append (str (arg)); } return __accu0__; }) ()), end).__getslice__ (-(4096), null, 1); if (self.element) { self.element.innerHTML = self.buffer.py_replace ('\n', '
').py_replace (' ', ' '); self.element.scrollTop = self.element.scrollHeight; } else { console.log (sep.join ((function () { var __accu0__ = []; for (var arg of args) { __accu0__.append (str (arg)); } return __accu0__; }) ())); } });}, get input () {return __get__ (this, function (self, question) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'self': var self = __allkwargs0__ [__attrib0__]; break; case 'question': var question = __allkwargs0__ [__attrib0__]; break; } } } } else { } self.print ('{}'.format (question), __kwargtrans__ ({end: ''})); var answer = window.prompt ('\n'.join (self.buffer.py_split ('\n').__getslice__ (-(8), null, 1))); self.print (answer); return answer; });} }); export var __terminal__ = __Terminal__ (); export var print = __terminal__.print; export var input = __terminal__.input; //# sourceMappingURL=org.transcrypt.__runtime__.map ================================================ FILE: docs/examples/sketch_000/target/org.transcrypt.__runtime__.py ================================================ # Transcrypt runtime module #__pragma__ ('js', 'export var __envir__ = {{}};\n{}', __include__ ('org/transcrypt/__envir__.js')) #__pragma__ ('js', '{}', __include__ ('org/transcrypt/__core__.js')) #__pragma__ ('js', '{}', __include__ ('org/transcrypt/__builtin__.js')) #__pragma__ ('skip') copy = Math = __typeof__ = __repr__ = document = console = window = 0 #__pragma__ ('noskip') #__pragma__ ('notconv') # !!! tconv gives a problem with __terminal__, needs investigation #__pragma__ ('nokwargs') #__pragma__ ('noalias', 'sort') class BaseException: pass class Exception (BaseException): #__pragma__ ('kwargs') def __init__ (self, *args, **kwargs): self.__args__ = args try: self.stack = kwargs.error.stack # Integrate with JavaScript Error object except: self.stack = 'No stack trace available' #__pragma__ ('nokwargs') def __repr__ (self): if len (self.__args__) > 1: return '{}{}'.format (self.__class__.__name__, repr (tuple (self.__args__))) elif len (self.__args__): return '{}({})'.format (self.__class__.__name__, repr (self.__args__ [0])) else: return '{}()'.format (self.__class__.__name__) def __str__ (self): if len (self.__args__) > 1: return str (tuple (self.__args__)) elif len (self.__args__): return str (self.__args__ [0]) else: return '' class IterableError (Exception): def __init__ (self, error): Exception.__init__ (self, 'Can\'t iterate over non-iterable', error = error) class StopIteration (Exception): def __init__ (self, error): Exception.__init__ (self, 'Iterator exhausted', error = error) class ValueError (Exception): def __init__ (self, message, error): Exception.__init__ (self, message, error = error) class KeyError (Exception): def __init__ (self, message, error): Exception.__init__ (self, message, error = error) class AssertionError (Exception): def __init__ (self, message, error): if message: Exception.__init__ (self, message, error = error) else: Exception.__init__ (self, error = error) class NotImplementedError (Exception): def __init__(self, message, error): Exception.__init__(self, message, error = error) class IndexError (Exception): def __init__(self, message, error): Exception.__init__(self, message, error = error) class AttributeError (Exception): def __init__(self, message, error): Exception.__init__(self, message, error = error) class TypeError (Exception): def __init__(self, message, error): Exception.__init__(self, message, error = error) # Warnings Exceptions # N.B. This is a limited subset of the warnings defined in # the cpython implementation to keep things small for now. class Warning (Exception): ''' Warning Base Class ''' pass class UserWarning (Warning): pass class DeprecationWarning (Warning): pass class RuntimeWarning (Warning): pass #__pragma__ ('kwargs') def __sort__ (iterable, key = None, reverse = False): # Used by py_sort, can deal with kwargs if key: iterable.sort (lambda a, b: 1 if key (a) > key (b) else -1) # JavaScript sort, case '==' is irrelevant for sorting else: iterable.sort () # JavaScript sort if reverse: iterable.reverse () def sorted (iterable, key = None, reverse = False): if type (iterable) == dict: result = copy (iterable.keys ()) else: result = copy (iterable) __sort__ (result, key, reverse) return result #__pragma__ ('nokwargs') def map (func, iterable): return [func (item) for item in iterable] def filter (func, iterable): if func == None: func = bool return [item for item in iterable if func (item)] def divmod (n, d): return n // d, n % d #__pragma__ ('ifdef', '__complex__') class complex: def __init__ (self, real, imag = None): if imag == None: if type (real) == complex: self.real = real.real self.imag = real.imag else: self.real = real self.imag = 0 else: self.real = real self.imag = imag def __neg__ (self): return complex (-self.real, -self.imag) def __exp__ (self): modulus = Math.exp (self.real) return complex (modulus * Math.cos (self.imag), modulus * Math.sin (self.imag)) def __log__ (self): return complex (Math.log (Math.sqrt (self.real * self.real + self.imag * self.imag)), Math.atan2 (self.imag, self.real)) def __pow__ (self, other): # a ** b = exp (b log a) return (self.__log__ () .__mul__ (other)) .__exp__ () def __rpow__ (self, real): # real ** comp -> comp.__rpow__ (real) return self.__mul__ (Math.log (real)) .__exp__ () def __mul__ (self, other): if __typeof__ (other) is 'number': return complex (self.real * other, self.imag * other) else: return complex (self.real * other.real - self.imag * other.imag, self.real * other.imag + self.imag * other.real) def __rmul__ (self, real): # real + comp -> comp.__rmul__ (real) return complex (self.real * real, self.imag * real) def __div__ (self, other): if __typeof__ (other) is 'number': return complex (self.real / other, self.imag / other) else: denom = other.real * other.real + other.imag * other.imag return complex ( (self.real * other.real + self.imag * other.imag) / denom, (self.imag * other.real - self.real * other.imag) / denom ) def __rdiv__ (self, real): # real / comp -> comp.__rdiv__ (real) denom = self.real * self.real return complex ( (real * self.real) / denom, (real * self.imag) / denom ) def __add__ (self, other): if __typeof__ (other) is 'number': return complex (self.real + other, self.imag) else: # Assume other is complex return complex (self.real + other.real, self.imag + other.imag) def __radd__ (self, real): # real + comp -> comp.__radd__ (real) return complex (self.real + real, self.imag) def __sub__ (self, other): if __typeof__ (other) is 'number': return complex (self.real - other, self.imag) else: return complex (self.real - other.real, self.imag - other.imag) def __rsub__ (self, real): # real - comp -> comp.__rsub__ (real) return complex (real - self.real, -self.imag) def __repr__ (self): return '({}{}{}j)'.format (self.real, '+' if self.imag >= 0 else '', self.imag) def __str__ (self): return __repr__ (self) [1 : -1] def __eq__ (self, other): if __typeof__ (other) is 'number': return self.real == other else: return self.real == other.real and self.imag == other.imag def __ne__ (self, other): if __typeof__ (other) is 'number': return self.real != other else: return self.real != other.real or self.imag != other.imag def conjugate (self): return complex (self.real, -self.imag) def __conj__ (aNumber): if isinstance (aNumber, complex): return complex (aNumber.real, -aNumber.imag) else: return complex (aNumber, 0) #__pragma__ ('endif') class __Terminal__: ''' Printing to either the console or to html happens async, but is blocked by calling window.prompt. So while all input and print statements are encountered in normal order, the print's exit immediately without yet having actually printed This means the next input takes control, blocking actual printing and so on indefinitely The effect is that everything's only printed after all inputs are done To prevent that, what's needed is to only execute the next window.prompt after actual printing has been done Since we've no way to find out when that is, a timeout is used. ''' def __init__ (self): self.buffer = '' try: self.element = document.getElementById ('__terminal__') except: self.element = None if self.element: self.element.style.overflowX = 'auto' self.element.style.boxSizing = 'border-box' self.element.style.padding = '5px' self.element.innerHTML = '_' #__pragma__ ('kwargs') def print (self, *args, sep = ' ', end = '\n'): self.buffer = '{}{}{}'.format (self.buffer, sep.join ([str (arg) for arg in args]), end) [-4096 : ] if self.element: self.element.innerHTML = self.buffer.replace ('\n', '
') .replace (' ', ' ') self.element.scrollTop = self.element.scrollHeight else: console.log (sep.join ([str (arg) for arg in args])) def input (self, question): self.print ('{}'.format (question), end = '') answer = window.prompt ('\n'.join (self.buffer.split ('\n') [-8:])) self.print (answer) return answer #__pragma__ ('nokwargs') __terminal__ = __Terminal__ () print = __terminal__.print input = __terminal__.input ================================================ FILE: docs/examples/sketch_000/target/pyp5js.js ================================================ // Transcrypt'ed from Python, 2020-04-28 21:56:45 import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __proxy__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, all, any, assert, bool, bytearray, bytes, callable, chr, deepcopy, delattr, dict, dir, divmod, enumerate, getattr, hasattr, isinstance, issubclass, len, list, object, ord, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, setattr, sorted, sum, tuple, zip} from './org.transcrypt.__runtime__.js'; import {PythonFunctions} from './pyp5js.python_functions.js'; var __name__ = 'pyp5js'; export var _P5_INSTANCE = null; export var _CTX_MIDDLE = null; export var _DEFAULT_FILL = null; export var _DEFAULT_LEADMULT = null; export var _DEFAULT_STROKE = null; export var _DEFAULT_TEXT_FILL = null; export var ADD = null; export var ALT = null; export var ARROW = null; export var AUDIO = null; export var AUTO = null; export var AXES = null; export var BACKSPACE = null; export var BASELINE = null; export var BEVEL = null; export var BEZIER = null; export var BLEND = null; export var BLUR = null; export var BOLD = null; export var BOLDITALIC = null; export var BOTTOM = null; export var BURN = null; export var CENTER = null; export var CHORD = null; export var CLAMP = null; export var CLOSE = null; export var CONTROL = null; export var CORNER = null; export var CORNERS = null; export var CROSS = null; export var CURVE = null; export var DARKEST = null; export var DEG_TO_RAD = null; export var DEGREES = null; export var DELETE = null; export var DIFFERENCE = null; export var DILATE = null; export var DODGE = null; export var DOWN_ARROW = null; export var ENTER = null; export var ERODE = null; export var ESCAPE = null; export var EXCLUSION = null; export var FILL = null; export var GRAY = null; export var GRID = null; export var HALF_PI = null; export var HAND = null; export var HARD_LIGHT = null; export var HSB = null; export var HSL = null; export var IMAGE = null; export var IMMEDIATE = null; export var INVERT = null; export var ITALIC = null; export var LANDSCAPE = null; export var LEFT = null; export var LEFT_ARROW = null; export var LIGHTEST = null; export var LINE_LOOP = null; export var LINE_STRIP = null; export var LINEAR = null; export var LINES = null; export var MIRROR = null; export var MITER = null; export var MOVE = null; export var MULTIPLY = null; export var NEAREST = null; export var NORMAL = null; export var OPAQUE = null; export var OPEN = null; export var OPTION = null; export var OVERLAY = null; export var PI = null; export var PIE = null; export var POINTS = null; export var PORTRAIT = null; export var POSTERIZE = null; export var PROJECT = null; export var QUAD_STRIP = null; export var QUADRATIC = null; export var QUADS = null; export var QUARTER_PI = null; export var RAD_TO_DEG = null; export var RADIANS = null; export var RADIUS = null; export var REPEAT = null; export var REPLACE = null; export var RETURN = null; export var RGB = null; export var RIGHT = null; export var RIGHT_ARROW = null; export var ROUND = null; export var SCREEN = null; export var SHIFT = null; export var SOFT_LIGHT = null; export var SQUARE = null; export var STROKE = null; export var SUBTRACT = null; export var TAB = null; export var TAU = null; export var TEXT = null; export var TEXTURE = null; export var THRESHOLD = null; export var TOP = null; export var TRIANGLE_FAN = null; export var TRIANGLE_STRIP = null; export var TRIANGLES = null; export var TWO_PI = null; export var UP_ARROW = null; export var VIDEO = null; export var WAIT = null; export var WEBGL = null; export var P2D = null; var PI = null; export var frameCount = null; export var focused = null; export var displayWidth = null; export var displayHeight = null; export var windowWidth = null; export var windowHeight = null; export var width = null; export var height = null; export var disableFriendlyErrors = null; export var deviceOrientation = null; export var accelerationX = null; export var accelerationY = null; export var accelerationZ = null; export var pAccelerationX = null; export var pAccelerationY = null; export var pAccelerationZ = null; export var rotationX = null; export var rotationY = null; export var rotationZ = null; export var pRotationX = null; export var pRotationY = null; export var pRotationZ = null; export var turnAxis = null; export var keyIsPressed = null; export var key = null; export var keyCode = null; export var mouseX = null; export var mouseY = null; export var pmouseX = null; export var pmouseY = null; export var winMouseX = null; export var winMouseY = null; export var pwinMouseX = null; export var pwinMouseY = null; export var mouseButton = null; export var mouseIsPressed = null; export var touches = null; export var pixels = null; export var alpha = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.alpha (...args); }; export var blue = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.blue (...args); }; export var brightness = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.brightness (...args); }; export var color = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.color (...args); }; export var green = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.green (...args); }; export var hue = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.hue (...args); }; export var lerpColor = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.lerpColor (...args); }; export var lightness = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.lightness (...args); }; export var red = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.red (...args); }; export var saturation = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.saturation (...args); }; export var background = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.background (...args); }; export var py_clear = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } var p5_clear = _P5_INSTANCE.clear (...args); return p5_clear; }; export var colorMode = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.colorMode (...args); }; export var fill = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.fill (...args); }; export var noFill = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noFill (...args); }; export var noStroke = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noStroke (...args); }; export var stroke = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.stroke (...args); }; export var arc = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.arc (...args); }; export var ellipse = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.ellipse (...args); }; export var circle = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.circle (...args); }; export var line = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.line (...args); }; export var point = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.point (...args); }; export var quad = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.quad (...args); }; export var rect = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.rect (...args); }; export var square = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.square (...args); }; export var triangle = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.triangle (...args); }; export var plane = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.plane (...args); }; export var box = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.box (...args); }; export var sphere = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.sphere (...args); }; export var cylinder = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.cylinder (...args); }; export var cone = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.cone (...args); }; export var ellipsoid = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.ellipsoid (...args); }; export var torus = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.torus (...args); }; export var loadModel = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.loadModel (...args); }; export var model = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.model (...args); }; export var ellipseMode = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.ellipseMode (...args); }; export var noSmooth = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noSmooth (...args); }; export var rectMode = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.rectMode (...args); }; export var smooth = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.smooth (...args); }; export var strokeCap = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.strokeCap (...args); }; export var strokeJoin = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.strokeJoin (...args); }; export var strokeWeight = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.strokeWeight (...args); }; export var bezier = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.bezier (...args); }; export var bezierDetail = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.bezierDetail (...args); }; export var bezierPoint = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.bezierPoint (...args); }; export var bezierTangent = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.bezierTangent (...args); }; export var curve = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.curve (...args); }; export var curveDetail = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.curveDetail (...args); }; export var curveTightness = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.curveTightness (...args); }; export var curvePoint = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.curvePoint (...args); }; export var curveTangent = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.curveTangent (...args); }; export var beginContour = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.beginContour (...args); }; export var beginShape = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.beginShape (...args); }; export var bezierVertex = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.bezierVertex (...args); }; export var curveVertex = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.curveVertex (...args); }; export var endContour = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.endContour (...args); }; export var endShape = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.endShape (...args); }; export var quadraticVertex = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.quadraticVertex (...args); }; export var vertex = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.vertex (...args); }; export var cursor = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.cursor (...args); }; export var frameRate = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.frameRate (...args); }; export var noCursor = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noCursor (...args); }; export var fullscreen = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.fullscreen (...args); }; export var pixelDensity = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.pixelDensity (...args); }; export var displayDensity = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.displayDensity (...args); }; export var getURL = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.getURL (...args); }; export var getURLPath = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.getURLPath (...args); }; export var getURLParams = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.getURLParams (...args); }; export var preload = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.preload (...args); }; export var setup = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.setup (...args); }; export var draw = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.draw (...args); }; export var remove = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.remove (...args); }; export var noLoop = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noLoop (...args); }; export var loop = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.loop (...args); }; export var push = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.push (...args); }; export var redraw = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.redraw (...args); }; export var resizeCanvas = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.resizeCanvas (...args); }; export var noCanvas = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noCanvas (...args); }; export var createGraphics = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createGraphics (...args); }; export var blendMode = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.blendMode (...args); }; export var setAttributes = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.setAttributes (...args); }; export var applyMatrix = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.applyMatrix (...args); }; export var resetMatrix = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.resetMatrix (...args); }; export var rotate = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.rotate (...args); }; export var rotateX = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.rotateX (...args); }; export var rotateY = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.rotateY (...args); }; export var rotateZ = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.rotateZ (...args); }; export var scale = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.scale (...args); }; export var shearX = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.shearX (...args); }; export var shearY = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.shearY (...args); }; export var translate = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.translate (...args); }; export var createStringDict = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createStringDict (...args); }; export var createNumberDict = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createNumberDict (...args); }; export var append = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.append (...args); }; export var arrayCopy = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.arrayCopy (...args); }; export var concat = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.concat (...args); }; export var reverse = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.reverse (...args); }; export var shorten = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.shorten (...args); }; export var shuffle = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.shuffle (...args); }; export var py_sort = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.py_sort (...args); }; export var splice = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.splice (...args); }; export var subset = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.subset (...args); }; export var float = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.float (...args); }; export var int = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.int (...args); }; export var str = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.str (...args); }; export var boolean = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.boolean (...args); }; export var byte = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.byte (...args); }; export var char = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.char (...args); }; export var unchar = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.unchar (...args); }; export var hex = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.hex (...args); }; export var unhex = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.unhex (...args); }; export var join = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.join (...args); }; export var match = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.match (...args); }; export var matchAll = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.matchAll (...args); }; export var nf = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.nf (...args); }; export var nfc = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.nfc (...args); }; export var nfp = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.nfp (...args); }; export var nfs = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.nfs (...args); }; export var py_split = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.py_split (...args); }; export var splitTokens = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.splitTokens (...args); }; export var trim = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.trim (...args); }; export var setMoveThreshold = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.setMoveThreshold (...args); }; export var setShakeThreshold = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.setShakeThreshold (...args); }; export var keyIsDown = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.keyIsDown (...args); }; export var createImage = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createImage (...args); }; export var saveCanvas = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.saveCanvas (...args); }; export var saveFrames = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.saveFrames (...args); }; export var loadImage = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.loadImage (...args); }; export var image = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.image (...args); }; export var tint = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.tint (...args); }; export var noTint = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noTint (...args); }; export var imageMode = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.imageMode (...args); }; export var blend = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.blend (...args); }; export var copy = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.copy (...args); }; export var filter = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } if (len (args) > 1 && (args [0] === null || callable (args [0]))) { return PythonFunctions.filter (...args); } else { return _P5_INSTANCE.filter (...args); } }; export var py_get = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.py_get (...args); }; export var loadPixels = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.loadPixels (...args); }; export var set = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } if (len (args) <= 1) { return PythonFunctions.set (...args); } else { return _P5_INSTANCE.set (...args); } }; export var updatePixels = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.updatePixels (...args); }; export var loadJSON = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.loadJSON (...args); }; export var loadStrings = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.loadStrings (...args); }; export var loadTable = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.loadTable (...args); }; export var loadXML = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.loadXML (...args); }; export var loadBytes = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.loadBytes (...args); }; export var httpGet = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.httpGet (...args); }; export var httpPost = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.httpPost (...args); }; export var httpDo = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.httpDo (...args); }; export var createWriter = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createWriter (...args); }; export var save = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.save (...args); }; export var saveJSON = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.saveJSON (...args); }; export var saveStrings = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.saveStrings (...args); }; export var saveTable = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.saveTable (...args); }; export var day = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.day (...args); }; export var hour = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.hour (...args); }; export var minute = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.minute (...args); }; export var millis = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.millis (...args); }; export var month = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.month (...args); }; export var second = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.second (...args); }; export var year = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.year (...args); }; export var createVector = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createVector (...args); }; export var abs = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.abs (...args); }; export var ceil = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.ceil (...args); }; export var constrain = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.constrain (...args); }; export var dist = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.dist (...args); }; export var exp = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.exp (...args); }; export var floor = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.floor (...args); }; export var lerp = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.lerp (...args); }; export var log = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.log (...args); }; export var mag = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.mag (...args); }; export var map = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } if (len (args) > 1 && callable (args [0])) { return PythonFunctions.map (...args); } else { return _P5_INSTANCE.map (...args); } }; export var max = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.max (...args); }; export var min = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.min (...args); }; export var norm = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.norm (...args); }; export var pow = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.pow (...args); }; export var round = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.round (...args); }; export var sq = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.sq (...args); }; export var sqrt = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.sqrt (...args); }; export var noise = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noise (...args); }; export var noiseDetail = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noiseDetail (...args); }; export var noiseSeed = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noiseSeed (...args); }; export var randomSeed = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.randomSeed (...args); }; export var random = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.random (...args); }; export var randomGaussian = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.randomGaussian (...args); }; export var acos = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.acos (...args); }; export var asin = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.asin (...args); }; export var atan = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.atan (...args); }; export var atan2 = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.atan2 (...args); }; export var cos = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.cos (...args); }; export var sin = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.sin (...args); }; export var tan = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.tan (...args); }; export var degrees = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.degrees (...args); }; export var radians = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.radians (...args); }; export var angleMode = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.angleMode (...args); }; export var textAlign = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.textAlign (...args); }; export var textLeading = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.textLeading (...args); }; export var textSize = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.textSize (...args); }; export var textStyle = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.textStyle (...args); }; export var textWidth = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.textWidth (...args); }; export var textAscent = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.textAscent (...args); }; export var textDescent = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.textDescent (...args); }; export var loadFont = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.loadFont (...args); }; export var text = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.text (...args); }; export var textFont = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.textFont (...args); }; export var orbitControl = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.orbitControl (...args); }; export var debugMode = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.debugMode (...args); }; export var noDebugMode = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noDebugMode (...args); }; export var ambientLight = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.ambientLight (...args); }; export var directionalLight = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.directionalLight (...args); }; export var pointLight = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.pointLight (...args); }; export var lights = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.lights (...args); }; export var loadShader = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.loadShader (...args); }; export var createShader = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createShader (...args); }; export var shader = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.shader (...args); }; export var resetShader = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.resetShader (...args); }; export var normalMaterial = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.normalMaterial (...args); }; export var texture = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.texture (...args); }; export var textureMode = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.textureMode (...args); }; export var textureWrap = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.textureWrap (...args); }; export var ambientMaterial = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.ambientMaterial (...args); }; export var specularMaterial = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.specularMaterial (...args); }; export var shininess = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.shininess (...args); }; export var camera = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.camera (...args); }; export var perspective = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.perspective (...args); }; export var ortho = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.ortho (...args); }; export var createCamera = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createCamera (...args); }; export var setCamera = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.setCamera (...args); }; export var select = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.select (...args); }; export var selectAll = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.selectAll (...args); }; export var removeElements = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.removeElements (...args); }; export var changed = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.changed (...args); }; export var input = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.input (...args); }; export var createDiv = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createDiv (...args); }; export var createP = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createP (...args); }; export var createSpan = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createSpan (...args); }; export var createImg = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createImg (...args); }; export var createA = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createA (...args); }; export var createSlider = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createSlider (...args); }; export var createButton = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createButton (...args); }; export var createCheckbox = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createCheckbox (...args); }; export var createSelect = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createSelect (...args); }; export var createRadio = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createRadio (...args); }; export var createColorPicker = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createColorPicker (...args); }; export var createInput = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createInput (...args); }; export var createFileInput = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createFileInput (...args); }; export var createVideo = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createVideo (...args); }; export var createAudio = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createAudio (...args); }; export var createCapture = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createCapture (...args); }; export var createElement = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createElement (...args); }; export var createCanvas = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } var canvas = _P5_INSTANCE.createCanvas (...args); width = _P5_INSTANCE.width; height = _P5_INSTANCE.height; return canvas; }; export var py_pop = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } var p5_pop = _P5_INSTANCE.pop (...args); return p5_pop; }; export var size = createCanvas; export var popMatrix = py_pop; export var popStyle = py_pop; export var pushMatrix = push; export var pushStyle = push; export var pre_draw = function (p5_instance, draw_func) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'p5_instance': var p5_instance = __allkwargs0__ [__attrib0__]; break; case 'draw_func': var draw_func = __allkwargs0__ [__attrib0__]; break; } } } } else { } _CTX_MIDDLE = p5_instance._CTX_MIDDLE; _DEFAULT_FILL = p5_instance._DEFAULT_FILL; _DEFAULT_LEADMULT = p5_instance._DEFAULT_LEADMULT; _DEFAULT_STROKE = p5_instance._DEFAULT_STROKE; _DEFAULT_TEXT_FILL = p5_instance._DEFAULT_TEXT_FILL; ADD = p5_instance.ADD; ALT = p5_instance.ALT; ARROW = p5_instance.ARROW; AUDIO = p5_instance.AUDIO; AUTO = p5_instance.AUTO; AXES = p5_instance.AXES; BACKSPACE = p5_instance.BACKSPACE; BASELINE = p5_instance.BASELINE; BEVEL = p5_instance.BEVEL; BEZIER = p5_instance.BEZIER; BLEND = p5_instance.BLEND; BLUR = p5_instance.BLUR; BOLD = p5_instance.BOLD; BOLDITALIC = p5_instance.BOLDITALIC; BOTTOM = p5_instance.BOTTOM; BURN = p5_instance.BURN; CENTER = p5_instance.CENTER; CHORD = p5_instance.CHORD; CLAMP = p5_instance.CLAMP; CLOSE = p5_instance.CLOSE; CONTROL = p5_instance.CONTROL; CORNER = p5_instance.CORNER; CORNERS = p5_instance.CORNERS; CROSS = p5_instance.CROSS; CURVE = p5_instance.CURVE; DARKEST = p5_instance.DARKEST; DEG_TO_RAD = p5_instance.DEG_TO_RAD; DEGREES = p5_instance.DEGREES; DELETE = p5_instance.DELETE; DIFFERENCE = p5_instance.DIFFERENCE; DILATE = p5_instance.DILATE; DODGE = p5_instance.DODGE; DOWN_ARROW = p5_instance.DOWN_ARROW; ENTER = p5_instance.ENTER; ERODE = p5_instance.ERODE; ESCAPE = p5_instance.ESCAPE; EXCLUSION = p5_instance.EXCLUSION; FILL = p5_instance.FILL; GRAY = p5_instance.GRAY; GRID = p5_instance.GRID; HALF_PI = p5_instance.HALF_PI; HAND = p5_instance.HAND; HARD_LIGHT = p5_instance.HARD_LIGHT; HSB = p5_instance.HSB; HSL = p5_instance.HSL; IMAGE = p5_instance.IMAGE; IMMEDIATE = p5_instance.IMMEDIATE; INVERT = p5_instance.INVERT; ITALIC = p5_instance.ITALIC; LANDSCAPE = p5_instance.LANDSCAPE; LEFT = p5_instance.LEFT; LEFT_ARROW = p5_instance.LEFT_ARROW; LIGHTEST = p5_instance.LIGHTEST; LINE_LOOP = p5_instance.LINE_LOOP; LINE_STRIP = p5_instance.LINE_STRIP; LINEAR = p5_instance.LINEAR; LINES = p5_instance.LINES; MIRROR = p5_instance.MIRROR; MITER = p5_instance.MITER; MOVE = p5_instance.MOVE; MULTIPLY = p5_instance.MULTIPLY; NEAREST = p5_instance.NEAREST; NORMAL = p5_instance.NORMAL; OPAQUE = p5_instance.OPAQUE; OPEN = p5_instance.OPEN; OPTION = p5_instance.OPTION; OVERLAY = p5_instance.OVERLAY; P2D = p5_instance.P2D; var P3D = p5_instance.WEBGL; PI = p5_instance.PI; PIE = p5_instance.PIE; POINTS = p5_instance.POINTS; PORTRAIT = p5_instance.PORTRAIT; POSTERIZE = p5_instance.POSTERIZE; PROJECT = p5_instance.PROJECT; QUAD_STRIP = p5_instance.QUAD_STRIP; QUADRATIC = p5_instance.QUADRATIC; QUADS = p5_instance.QUADS; QUARTER_PI = p5_instance.QUARTER_PI; RAD_TO_DEG = p5_instance.RAD_TO_DEG; RADIANS = p5_instance.RADIANS; RADIUS = p5_instance.RADIUS; REPEAT = p5_instance.REPEAT; REPLACE = p5_instance.REPLACE; RETURN = p5_instance.RETURN; RGB = p5_instance.RGB; RIGHT = p5_instance.RIGHT; RIGHT_ARROW = p5_instance.RIGHT_ARROW; ROUND = p5_instance.ROUND; SCREEN = p5_instance.SCREEN; SHIFT = p5_instance.SHIFT; SOFT_LIGHT = p5_instance.SOFT_LIGHT; SQUARE = p5_instance.SQUARE; STROKE = p5_instance.STROKE; SUBTRACT = p5_instance.SUBTRACT; TAB = p5_instance.TAB; TAU = p5_instance.TAU; TEXT = p5_instance.TEXT; TEXTURE = p5_instance.TEXTURE; THRESHOLD = p5_instance.THRESHOLD; TOP = p5_instance.TOP; TRIANGLE_FAN = p5_instance.TRIANGLE_FAN; TRIANGLE_STRIP = p5_instance.TRIANGLE_STRIP; TRIANGLES = p5_instance.TRIANGLES; TWO_PI = p5_instance.TWO_PI; UP_ARROW = p5_instance.UP_ARROW; VIDEO = p5_instance.VIDEO; WAIT = p5_instance.WAIT; WEBGL = p5_instance.WEBGL; frameCount = p5_instance.frameCount; focused = p5_instance.focused; displayWidth = p5_instance.displayWidth; displayHeight = p5_instance.displayHeight; windowWidth = p5_instance.windowWidth; windowHeight = p5_instance.windowHeight; width = p5_instance.width; height = p5_instance.height; disableFriendlyErrors = p5_instance.disableFriendlyErrors; deviceOrientation = p5_instance.deviceOrientation; accelerationX = p5_instance.accelerationX; accelerationY = p5_instance.accelerationY; accelerationZ = p5_instance.accelerationZ; pAccelerationX = p5_instance.pAccelerationX; pAccelerationY = p5_instance.pAccelerationY; pAccelerationZ = p5_instance.pAccelerationZ; rotationX = p5_instance.rotationX; rotationY = p5_instance.rotationY; rotationZ = p5_instance.rotationZ; pRotationX = p5_instance.pRotationX; pRotationY = p5_instance.pRotationY; pRotationZ = p5_instance.pRotationZ; turnAxis = p5_instance.turnAxis; keyIsPressed = p5_instance.keyIsPressed; key = p5_instance.key; keyCode = p5_instance.keyCode; mouseX = p5_instance.mouseX; mouseY = p5_instance.mouseY; pmouseX = p5_instance.pmouseX; pmouseY = p5_instance.pmouseY; winMouseX = p5_instance.winMouseX; winMouseY = p5_instance.winMouseY; pwinMouseX = p5_instance.pwinMouseX; pwinMouseY = p5_instance.pwinMouseY; mouseButton = p5_instance.mouseButton; mouseIsPressed = p5_instance.mouseIsPressed; touches = p5_instance.touches; pixels = p5_instance.pixels; return draw_func (); }; export var global_p5_injection = function (p5_sketch) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'p5_sketch': var p5_sketch = __allkwargs0__ [__attrib0__]; break; } } } } else { } var decorator = function (f) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'f': var f = __allkwargs0__ [__attrib0__]; break; } } } } else { } var wrapper = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } } else { } _P5_INSTANCE = p5_sketch; return pre_draw (_P5_INSTANCE, f); }; return wrapper; }; return decorator; }; export var start_p5 = function (setup_func, draw_func, event_functions) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'setup_func': var setup_func = __allkwargs0__ [__attrib0__]; break; case 'draw_func': var draw_func = __allkwargs0__ [__attrib0__]; break; case 'event_functions': var event_functions = __allkwargs0__ [__attrib0__]; break; } } } } else { } var sketch_setup = function (p5_sketch) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'p5_sketch': var p5_sketch = __allkwargs0__ [__attrib0__]; break; } } } } else { } p5_sketch.setup = global_p5_injection (p5_sketch) (setup_func); p5_sketch.draw = global_p5_injection (p5_sketch) (draw_func); }; var instance = new p5 (sketch_setup, 'sketch-holder'); var event_function_names = tuple (['deviceMoved', 'deviceTurned', 'deviceShaken', 'windowResized', 'keyPressed', 'keyReleased', 'keyTyped', 'mousePressed', 'mouseReleased', 'mouseClicked', 'doubleClicked', 'mouseMoved', 'mouseDragged', 'mouseWheel', 'touchStarted', 'touchMoved', 'touchEnded']); for (var f_name of (function () { var __accu0__ = []; for (var f of event_function_names) { if (event_functions.py_get (f, null)) { __accu0__.append (f); } } return __accu0__; }) ()) { var func = event_functions [f_name]; var event_func = global_p5_injection (instance) (func); setattr (instance, f_name, event_func); } }; export var logOnloaded = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } } else { } console.log ('Lib loaded!'); }; export var add_library = function (lib_name) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'lib_name': var lib_name = __allkwargs0__ [__attrib0__]; break; } } } } else { } var src = ''; return console.log ('Lib name is not valid:', lib_name); console.log ('Importing:', src); var script = document.createElement ('script'); script.onload = logOnloaded; script.src = src; document.head.appendChild (script); }; //# sourceMappingURL=pyp5js.map ================================================ FILE: docs/examples/sketch_000/target/pyp5js.py ================================================ from pyp5js.python_functions import PythonFunctions _P5_INSTANCE = None _CTX_MIDDLE = None _DEFAULT_FILL = None _DEFAULT_LEADMULT = None _DEFAULT_STROKE = None _DEFAULT_TEXT_FILL = None ADD = None ALT = None ARROW = None AUDIO = None AUTO = None AXES = None BACKSPACE = None BASELINE = None BEVEL = None BEZIER = None BLEND = None BLUR = None BOLD = None BOLDITALIC = None BOTTOM = None BURN = None CENTER = None CHORD = None CLAMP = None CLOSE = None CONTROL = None CORNER = None CORNERS = None CROSS = None CURVE = None DARKEST = None DEG_TO_RAD = None DEGREES = None DELETE = None DIFFERENCE = None DILATE = None DODGE = None DOWN_ARROW = None ENTER = None ERODE = None ESCAPE = None EXCLUSION = None FILL = None GRAY = None GRID = None HALF_PI = None HAND = None HARD_LIGHT = None HSB = None HSL = None IMAGE = None IMMEDIATE = None INVERT = None ITALIC = None LANDSCAPE = None LEFT = None LEFT_ARROW = None LIGHTEST = None LINE_LOOP = None LINE_STRIP = None LINEAR = None LINES = None MIRROR = None MITER = None MOVE = None MULTIPLY = None NEAREST = None NORMAL = None OPAQUE = None OPEN = None OPTION = None OVERLAY = None PI = None PIE = None POINTS = None PORTRAIT = None POSTERIZE = None PROJECT = None QUAD_STRIP = None QUADRATIC = None QUADS = None QUARTER_PI = None RAD_TO_DEG = None RADIANS = None RADIUS = None REPEAT = None REPLACE = None RETURN = None RGB = None RIGHT = None RIGHT_ARROW = None ROUND = None SCREEN = None SHIFT = None SOFT_LIGHT = None SQUARE = None STROKE = None SUBTRACT = None TAB = None TAU = None TEXT = None TEXTURE = None THRESHOLD = None TOP = None TRIANGLE_FAN = None TRIANGLE_STRIP = None TRIANGLES = None TWO_PI = None UP_ARROW = None VIDEO = None WAIT = None WEBGL = None P2D = None PI = None frameCount = None focused = None displayWidth = None displayHeight = None windowWidth = None windowHeight = None width = None height = None disableFriendlyErrors = None deviceOrientation = None accelerationX = None accelerationY = None accelerationZ = None pAccelerationX = None pAccelerationY = None pAccelerationZ = None rotationX = None rotationY = None rotationZ = None pRotationX = None pRotationY = None pRotationZ = None turnAxis = None keyIsPressed = None key = None keyCode = None mouseX = None mouseY = None pmouseX = None pmouseY = None winMouseX = None winMouseY = None pwinMouseX = None pwinMouseY = None mouseButton = None mouseIsPressed = None touches = None pixels = None def alpha(*args): return _P5_INSTANCE.alpha(*args) def blue(*args): return _P5_INSTANCE.blue(*args) def brightness(*args): return _P5_INSTANCE.brightness(*args) def color(*args): return _P5_INSTANCE.color(*args) def green(*args): return _P5_INSTANCE.green(*args) def hue(*args): return _P5_INSTANCE.hue(*args) def lerpColor(*args): return _P5_INSTANCE.lerpColor(*args) def lightness(*args): return _P5_INSTANCE.lightness(*args) def red(*args): return _P5_INSTANCE.red(*args) def saturation(*args): return _P5_INSTANCE.saturation(*args) def background(*args): return _P5_INSTANCE.background(*args) def clear(*args): __pragma__('noalias', 'clear') p5_clear = _P5_INSTANCE.clear(*args) __pragma__('alias', 'clear', 'py_clear') return p5_clear def colorMode(*args): return _P5_INSTANCE.colorMode(*args) def fill(*args): return _P5_INSTANCE.fill(*args) def noFill(*args): return _P5_INSTANCE.noFill(*args) def noStroke(*args): return _P5_INSTANCE.noStroke(*args) def stroke(*args): return _P5_INSTANCE.stroke(*args) def arc(*args): return _P5_INSTANCE.arc(*args) def ellipse(*args): return _P5_INSTANCE.ellipse(*args) def circle(*args): return _P5_INSTANCE.circle(*args) def line(*args): return _P5_INSTANCE.line(*args) def point(*args): return _P5_INSTANCE.point(*args) def quad(*args): return _P5_INSTANCE.quad(*args) def rect(*args): return _P5_INSTANCE.rect(*args) def square(*args): return _P5_INSTANCE.square(*args) def triangle(*args): return _P5_INSTANCE.triangle(*args) def plane(*args): return _P5_INSTANCE.plane(*args) def box(*args): return _P5_INSTANCE.box(*args) def sphere(*args): return _P5_INSTANCE.sphere(*args) def cylinder(*args): return _P5_INSTANCE.cylinder(*args) def cone(*args): return _P5_INSTANCE.cone(*args) def ellipsoid(*args): return _P5_INSTANCE.ellipsoid(*args) def torus(*args): return _P5_INSTANCE.torus(*args) def loadModel(*args): return _P5_INSTANCE.loadModel(*args) def model(*args): return _P5_INSTANCE.model(*args) def ellipseMode(*args): return _P5_INSTANCE.ellipseMode(*args) def noSmooth(*args): return _P5_INSTANCE.noSmooth(*args) def rectMode(*args): return _P5_INSTANCE.rectMode(*args) def smooth(*args): return _P5_INSTANCE.smooth(*args) def strokeCap(*args): return _P5_INSTANCE.strokeCap(*args) def strokeJoin(*args): return _P5_INSTANCE.strokeJoin(*args) def strokeWeight(*args): return _P5_INSTANCE.strokeWeight(*args) def bezier(*args): return _P5_INSTANCE.bezier(*args) def bezierDetail(*args): return _P5_INSTANCE.bezierDetail(*args) def bezierPoint(*args): return _P5_INSTANCE.bezierPoint(*args) def bezierTangent(*args): return _P5_INSTANCE.bezierTangent(*args) def curve(*args): return _P5_INSTANCE.curve(*args) def curveDetail(*args): return _P5_INSTANCE.curveDetail(*args) def curveTightness(*args): return _P5_INSTANCE.curveTightness(*args) def curvePoint(*args): return _P5_INSTANCE.curvePoint(*args) def curveTangent(*args): return _P5_INSTANCE.curveTangent(*args) def beginContour(*args): return _P5_INSTANCE.beginContour(*args) def beginShape(*args): return _P5_INSTANCE.beginShape(*args) def bezierVertex(*args): return _P5_INSTANCE.bezierVertex(*args) def curveVertex(*args): return _P5_INSTANCE.curveVertex(*args) def endContour(*args): return _P5_INSTANCE.endContour(*args) def endShape(*args): return _P5_INSTANCE.endShape(*args) def quadraticVertex(*args): return _P5_INSTANCE.quadraticVertex(*args) def vertex(*args): return _P5_INSTANCE.vertex(*args) def cursor(*args): return _P5_INSTANCE.cursor(*args) def frameRate(*args): return _P5_INSTANCE.frameRate(*args) def noCursor(*args): return _P5_INSTANCE.noCursor(*args) def fullscreen(*args): return _P5_INSTANCE.fullscreen(*args) def pixelDensity(*args): return _P5_INSTANCE.pixelDensity(*args) def displayDensity(*args): return _P5_INSTANCE.displayDensity(*args) def getURL(*args): return _P5_INSTANCE.getURL(*args) def getURLPath(*args): return _P5_INSTANCE.getURLPath(*args) def getURLParams(*args): return _P5_INSTANCE.getURLParams(*args) def preload(*args): return _P5_INSTANCE.preload(*args) def setup(*args): return _P5_INSTANCE.setup(*args) def draw(*args): return _P5_INSTANCE.draw(*args) def remove(*args): return _P5_INSTANCE.remove(*args) def noLoop(*args): return _P5_INSTANCE.noLoop(*args) def loop(*args): return _P5_INSTANCE.loop(*args) def push(*args): return _P5_INSTANCE.push(*args) def redraw(*args): return _P5_INSTANCE.redraw(*args) def resizeCanvas(*args): return _P5_INSTANCE.resizeCanvas(*args) def noCanvas(*args): return _P5_INSTANCE.noCanvas(*args) def createGraphics(*args): return _P5_INSTANCE.createGraphics(*args) def blendMode(*args): return _P5_INSTANCE.blendMode(*args) def setAttributes(*args): return _P5_INSTANCE.setAttributes(*args) def applyMatrix(*args): return _P5_INSTANCE.applyMatrix(*args) def resetMatrix(*args): return _P5_INSTANCE.resetMatrix(*args) def rotate(*args): return _P5_INSTANCE.rotate(*args) def rotateX(*args): return _P5_INSTANCE.rotateX(*args) def rotateY(*args): return _P5_INSTANCE.rotateY(*args) def rotateZ(*args): return _P5_INSTANCE.rotateZ(*args) def scale(*args): return _P5_INSTANCE.scale(*args) def shearX(*args): return _P5_INSTANCE.shearX(*args) def shearY(*args): return _P5_INSTANCE.shearY(*args) def translate(*args): return _P5_INSTANCE.translate(*args) def createStringDict(*args): return _P5_INSTANCE.createStringDict(*args) def createNumberDict(*args): return _P5_INSTANCE.createNumberDict(*args) def append(*args): return _P5_INSTANCE.append(*args) def arrayCopy(*args): return _P5_INSTANCE.arrayCopy(*args) def concat(*args): return _P5_INSTANCE.concat(*args) def reverse(*args): return _P5_INSTANCE.reverse(*args) def shorten(*args): return _P5_INSTANCE.shorten(*args) def shuffle(*args): return _P5_INSTANCE.shuffle(*args) def sort(*args): return _P5_INSTANCE.sort(*args) def splice(*args): return _P5_INSTANCE.splice(*args) def subset(*args): return _P5_INSTANCE.subset(*args) def float(*args): return _P5_INSTANCE.float(*args) def int(*args): return _P5_INSTANCE.int(*args) def str(*args): return _P5_INSTANCE.str(*args) def boolean(*args): return _P5_INSTANCE.boolean(*args) def byte(*args): return _P5_INSTANCE.byte(*args) def char(*args): return _P5_INSTANCE.char(*args) def unchar(*args): return _P5_INSTANCE.unchar(*args) def hex(*args): return _P5_INSTANCE.hex(*args) def unhex(*args): return _P5_INSTANCE.unhex(*args) def join(*args): return _P5_INSTANCE.join(*args) def match(*args): return _P5_INSTANCE.match(*args) def matchAll(*args): return _P5_INSTANCE.matchAll(*args) def nf(*args): return _P5_INSTANCE.nf(*args) def nfc(*args): return _P5_INSTANCE.nfc(*args) def nfp(*args): return _P5_INSTANCE.nfp(*args) def nfs(*args): return _P5_INSTANCE.nfs(*args) def split(*args): return _P5_INSTANCE.split(*args) def splitTokens(*args): return _P5_INSTANCE.splitTokens(*args) def trim(*args): return _P5_INSTANCE.trim(*args) def setMoveThreshold(*args): return _P5_INSTANCE.setMoveThreshold(*args) def setShakeThreshold(*args): return _P5_INSTANCE.setShakeThreshold(*args) def keyIsDown(*args): return _P5_INSTANCE.keyIsDown(*args) def createImage(*args): return _P5_INSTANCE.createImage(*args) def saveCanvas(*args): return _P5_INSTANCE.saveCanvas(*args) def saveFrames(*args): return _P5_INSTANCE.saveFrames(*args) def loadImage(*args): return _P5_INSTANCE.loadImage(*args) def image(*args): return _P5_INSTANCE.image(*args) def tint(*args): return _P5_INSTANCE.tint(*args) def noTint(*args): return _P5_INSTANCE.noTint(*args) def imageMode(*args): return _P5_INSTANCE.imageMode(*args) def blend(*args): return _P5_INSTANCE.blend(*args) def copy(*args): return _P5_INSTANCE.copy(*args) def filter(*args): if len(args) > 1 and (args[0] is None or callable(args[0])): return PythonFunctions.filter(*args) else: return _P5_INSTANCE.filter(*args) def get(*args): return _P5_INSTANCE.get(*args) def loadPixels(*args): return _P5_INSTANCE.loadPixels(*args) def set(*args): if len(args) <= 1: return PythonFunctions.set(*args) else: return _P5_INSTANCE.set(*args) def updatePixels(*args): return _P5_INSTANCE.updatePixels(*args) def loadJSON(*args): return _P5_INSTANCE.loadJSON(*args) def loadStrings(*args): return _P5_INSTANCE.loadStrings(*args) def loadTable(*args): return _P5_INSTANCE.loadTable(*args) def loadXML(*args): return _P5_INSTANCE.loadXML(*args) def loadBytes(*args): return _P5_INSTANCE.loadBytes(*args) def httpGet(*args): return _P5_INSTANCE.httpGet(*args) def httpPost(*args): return _P5_INSTANCE.httpPost(*args) def httpDo(*args): return _P5_INSTANCE.httpDo(*args) def createWriter(*args): return _P5_INSTANCE.createWriter(*args) def save(*args): return _P5_INSTANCE.save(*args) def saveJSON(*args): return _P5_INSTANCE.saveJSON(*args) def saveStrings(*args): return _P5_INSTANCE.saveStrings(*args) def saveTable(*args): return _P5_INSTANCE.saveTable(*args) def day(*args): return _P5_INSTANCE.day(*args) def hour(*args): return _P5_INSTANCE.hour(*args) def minute(*args): return _P5_INSTANCE.minute(*args) def millis(*args): return _P5_INSTANCE.millis(*args) def month(*args): return _P5_INSTANCE.month(*args) def second(*args): return _P5_INSTANCE.second(*args) def year(*args): return _P5_INSTANCE.year(*args) def createVector(*args): return _P5_INSTANCE.createVector(*args) def abs(*args): return _P5_INSTANCE.abs(*args) def ceil(*args): return _P5_INSTANCE.ceil(*args) def constrain(*args): return _P5_INSTANCE.constrain(*args) def dist(*args): return _P5_INSTANCE.dist(*args) def exp(*args): return _P5_INSTANCE.exp(*args) def floor(*args): return _P5_INSTANCE.floor(*args) def lerp(*args): return _P5_INSTANCE.lerp(*args) def log(*args): return _P5_INSTANCE.log(*args) def mag(*args): return _P5_INSTANCE.mag(*args) def map(*args): if len(args) > 1 and callable(args[0]): return PythonFunctions.map(*args) else: return _P5_INSTANCE.map(*args) def max(*args): return _P5_INSTANCE.max(*args) def min(*args): return _P5_INSTANCE.min(*args) def norm(*args): return _P5_INSTANCE.norm(*args) def pow(*args): return _P5_INSTANCE.pow(*args) def round(*args): return _P5_INSTANCE.round(*args) def sq(*args): return _P5_INSTANCE.sq(*args) def sqrt(*args): return _P5_INSTANCE.sqrt(*args) def noise(*args): return _P5_INSTANCE.noise(*args) def noiseDetail(*args): return _P5_INSTANCE.noiseDetail(*args) def noiseSeed(*args): return _P5_INSTANCE.noiseSeed(*args) def randomSeed(*args): return _P5_INSTANCE.randomSeed(*args) def random(*args): return _P5_INSTANCE.random(*args) def randomGaussian(*args): return _P5_INSTANCE.randomGaussian(*args) def acos(*args): return _P5_INSTANCE.acos(*args) def asin(*args): return _P5_INSTANCE.asin(*args) def atan(*args): return _P5_INSTANCE.atan(*args) def atan2(*args): return _P5_INSTANCE.atan2(*args) def cos(*args): return _P5_INSTANCE.cos(*args) def sin(*args): return _P5_INSTANCE.sin(*args) def tan(*args): return _P5_INSTANCE.tan(*args) def degrees(*args): return _P5_INSTANCE.degrees(*args) def radians(*args): return _P5_INSTANCE.radians(*args) def angleMode(*args): return _P5_INSTANCE.angleMode(*args) def textAlign(*args): return _P5_INSTANCE.textAlign(*args) def textLeading(*args): return _P5_INSTANCE.textLeading(*args) def textSize(*args): return _P5_INSTANCE.textSize(*args) def textStyle(*args): return _P5_INSTANCE.textStyle(*args) def textWidth(*args): return _P5_INSTANCE.textWidth(*args) def textAscent(*args): return _P5_INSTANCE.textAscent(*args) def textDescent(*args): return _P5_INSTANCE.textDescent(*args) def loadFont(*args): return _P5_INSTANCE.loadFont(*args) def text(*args): return _P5_INSTANCE.text(*args) def textFont(*args): return _P5_INSTANCE.textFont(*args) def orbitControl(*args): return _P5_INSTANCE.orbitControl(*args) def debugMode(*args): return _P5_INSTANCE.debugMode(*args) def noDebugMode(*args): return _P5_INSTANCE.noDebugMode(*args) def ambientLight(*args): return _P5_INSTANCE.ambientLight(*args) def directionalLight(*args): return _P5_INSTANCE.directionalLight(*args) def pointLight(*args): return _P5_INSTANCE.pointLight(*args) def lights(*args): return _P5_INSTANCE.lights(*args) def loadShader(*args): return _P5_INSTANCE.loadShader(*args) def createShader(*args): return _P5_INSTANCE.createShader(*args) def shader(*args): return _P5_INSTANCE.shader(*args) def resetShader(*args): return _P5_INSTANCE.resetShader(*args) def normalMaterial(*args): return _P5_INSTANCE.normalMaterial(*args) def texture(*args): return _P5_INSTANCE.texture(*args) def textureMode(*args): return _P5_INSTANCE.textureMode(*args) def textureWrap(*args): return _P5_INSTANCE.textureWrap(*args) def ambientMaterial(*args): return _P5_INSTANCE.ambientMaterial(*args) def specularMaterial(*args): return _P5_INSTANCE.specularMaterial(*args) def shininess(*args): return _P5_INSTANCE.shininess(*args) def camera(*args): return _P5_INSTANCE.camera(*args) def perspective(*args): return _P5_INSTANCE.perspective(*args) def ortho(*args): return _P5_INSTANCE.ortho(*args) def createCamera(*args): return _P5_INSTANCE.createCamera(*args) def setCamera(*args): return _P5_INSTANCE.setCamera(*args) def select(*args): return _P5_INSTANCE.select(*args) def selectAll(*args): return _P5_INSTANCE.selectAll(*args) def removeElements(*args): return _P5_INSTANCE.removeElements(*args) def changed(*args): return _P5_INSTANCE.changed(*args) def input(*args): return _P5_INSTANCE.input(*args) def createDiv(*args): return _P5_INSTANCE.createDiv(*args) def createP(*args): return _P5_INSTANCE.createP(*args) def createSpan(*args): return _P5_INSTANCE.createSpan(*args) def createImg(*args): return _P5_INSTANCE.createImg(*args) def createA(*args): return _P5_INSTANCE.createA(*args) def createSlider(*args): return _P5_INSTANCE.createSlider(*args) def createButton(*args): return _P5_INSTANCE.createButton(*args) def createCheckbox(*args): return _P5_INSTANCE.createCheckbox(*args) def createSelect(*args): return _P5_INSTANCE.createSelect(*args) def createRadio(*args): return _P5_INSTANCE.createRadio(*args) def createColorPicker(*args): return _P5_INSTANCE.createColorPicker(*args) def createInput(*args): return _P5_INSTANCE.createInput(*args) def createFileInput(*args): return _P5_INSTANCE.createFileInput(*args) def createVideo(*args): return _P5_INSTANCE.createVideo(*args) def createAudio(*args): return _P5_INSTANCE.createAudio(*args) def createCapture(*args): return _P5_INSTANCE.createCapture(*args) def createElement(*args): return _P5_INSTANCE.createElement(*args) def createCanvas(*args): canvas = _P5_INSTANCE.createCanvas(*args) global width, height width = _P5_INSTANCE.width height = _P5_INSTANCE.height return canvas def pop(*args): __pragma__('noalias', 'pop') p5_pop = _P5_INSTANCE.pop(*args) __pragma__('alias', 'pop', 'py_pop') return p5_pop # Processing Python or Java mode compatibility aliases size = createCanvas popMatrix = pop popStyle = pop pushMatrix = push pushStyle = push def pre_draw(p5_instance, draw_func): """ We need to run this before the actual draw to insert and update p5 env variables """ global _CTX_MIDDLE, _DEFAULT_FILL, _DEFAULT_LEADMULT, _DEFAULT_STROKE, _DEFAULT_TEXT_FILL global ADD, ALT, ARROW, AUTO, AUDIO, AXES, BACKSPACE, BASELINE, BEVEL, BEZIER, BLEND, BLUR, BOLD, BOLDITALIC global BOTTOM, BURN, CENTER, CHORD, CLAMP, CLOSE, CONTROL, CORNER, CORNERS, CROSS, CURVE, DARKEST global DEG_TO_RAD, DEGREES, DELETE, DIFFERENCE, DILATE, DODGE, DOWN_ARROW, ENTER, ERODE, ESCAPE, EXCLUSION global FILL, GRAY, GRID, HALF_PI, HAND, HARD_LIGHT, HSB, HSL, IMAGE, IMMEDIATE, INVERT, ITALIC, LANDSCAPE global LEFT, LEFT_ARROW, LIGHTEST, LINE_LOOP, LINE_STRIP, LINEAR, LINES, MIRROR, MITER, MOVE, MULTIPLY, NEAREST global NORMAL, OPAQUE, OPEN, OPTION, OVERLAY, P2D, PI, PIE, POINTS, PORTRAIT, POSTERIZE, PROJECT, QUAD_STRIP, QUADRATIC global QUADS, QUARTER_PI, RAD_TO_DEG, RADIANS, RADIUS, REPEAT, REPLACE, RETURN, RGB, RIGHT, RIGHT_ARROW global ROUND, SCREEN, SHIFT, SOFT_LIGHT, SQUARE, STROKE, SUBTRACT, TAB, TAU, TEXT, TEXTURE, THRESHOLD, TOP global TRIANGLE_FAN, TRIANGLE_STRIP, TRIANGLES, TWO_PI, UP_ARROW, VIDEO, WAIT, WEBGL global frameCount, focused, displayWidth, displayHeight, windowWidth, windowHeight, width, height global disableFriendlyErrors, deviceOrientation, accelerationX, accelerationY, accelerationZ global pAccelerationX, pAccelerationY, pAccelerationZ, rotationX, rotationY, rotationZ global pRotationX, pRotationY, pRotationZ, turnAxis, keyIsPressed, key, keyCode, mouseX, mouseY, pmouseX, pmouseY global winMouseX, winMouseY, pwinMouseX, pwinMouseY, mouseButton, mouseIsPressed, touches, pixels _CTX_MIDDLE = p5_instance._CTX_MIDDLE _DEFAULT_FILL = p5_instance._DEFAULT_FILL _DEFAULT_LEADMULT = p5_instance._DEFAULT_LEADMULT _DEFAULT_STROKE = p5_instance._DEFAULT_STROKE _DEFAULT_TEXT_FILL = p5_instance._DEFAULT_TEXT_FILL ADD = p5_instance.ADD ALT = p5_instance.ALT ARROW = p5_instance.ARROW AUDIO = p5_instance.AUDIO AUTO = p5_instance.AUTO AXES = p5_instance.AXES BACKSPACE = p5_instance.BACKSPACE BASELINE = p5_instance.BASELINE BEVEL = p5_instance.BEVEL BEZIER = p5_instance.BEZIER BLEND = p5_instance.BLEND BLUR = p5_instance.BLUR BOLD = p5_instance.BOLD BOLDITALIC = p5_instance.BOLDITALIC BOTTOM = p5_instance.BOTTOM BURN = p5_instance.BURN CENTER = p5_instance.CENTER CHORD = p5_instance.CHORD CLAMP = p5_instance.CLAMP CLOSE = p5_instance.CLOSE CONTROL = p5_instance.CONTROL CORNER = p5_instance.CORNER CORNERS = p5_instance.CORNERS CROSS = p5_instance.CROSS CURVE = p5_instance.CURVE DARKEST = p5_instance.DARKEST DEG_TO_RAD = p5_instance.DEG_TO_RAD DEGREES = p5_instance.DEGREES DELETE = p5_instance.DELETE DIFFERENCE = p5_instance.DIFFERENCE DILATE = p5_instance.DILATE DODGE = p5_instance.DODGE DOWN_ARROW = p5_instance.DOWN_ARROW ENTER = p5_instance.ENTER ERODE = p5_instance.ERODE ESCAPE = p5_instance.ESCAPE EXCLUSION = p5_instance.EXCLUSION FILL = p5_instance.FILL GRAY = p5_instance.GRAY GRID = p5_instance.GRID HALF_PI = p5_instance.HALF_PI HAND = p5_instance.HAND HARD_LIGHT = p5_instance.HARD_LIGHT HSB = p5_instance.HSB HSL = p5_instance.HSL IMAGE = p5_instance.IMAGE IMMEDIATE = p5_instance.IMMEDIATE INVERT = p5_instance.INVERT ITALIC = p5_instance.ITALIC LANDSCAPE = p5_instance.LANDSCAPE LEFT = p5_instance.LEFT LEFT_ARROW = p5_instance.LEFT_ARROW LIGHTEST = p5_instance.LIGHTEST LINE_LOOP = p5_instance.LINE_LOOP LINE_STRIP = p5_instance.LINE_STRIP LINEAR = p5_instance.LINEAR LINES = p5_instance.LINES MIRROR = p5_instance.MIRROR MITER = p5_instance.MITER MOVE = p5_instance.MOVE MULTIPLY = p5_instance.MULTIPLY NEAREST = p5_instance.NEAREST NORMAL = p5_instance.NORMAL OPAQUE = p5_instance.OPAQUE OPEN = p5_instance.OPEN OPTION = p5_instance.OPTION OVERLAY = p5_instance.OVERLAY P2D = p5_instance.P2D P3D = p5_instance.WEBGL PI = p5_instance.PI PIE = p5_instance.PIE POINTS = p5_instance.POINTS PORTRAIT = p5_instance.PORTRAIT POSTERIZE = p5_instance.POSTERIZE PROJECT = p5_instance.PROJECT QUAD_STRIP = p5_instance.QUAD_STRIP QUADRATIC = p5_instance.QUADRATIC QUADS = p5_instance.QUADS QUARTER_PI = p5_instance.QUARTER_PI RAD_TO_DEG = p5_instance.RAD_TO_DEG RADIANS = p5_instance.RADIANS RADIUS = p5_instance.RADIUS REPEAT = p5_instance.REPEAT REPLACE = p5_instance.REPLACE RETURN = p5_instance.RETURN RGB = p5_instance.RGB RIGHT = p5_instance.RIGHT RIGHT_ARROW = p5_instance.RIGHT_ARROW ROUND = p5_instance.ROUND SCREEN = p5_instance.SCREEN SHIFT = p5_instance.SHIFT SOFT_LIGHT = p5_instance.SOFT_LIGHT SQUARE = p5_instance.SQUARE STROKE = p5_instance.STROKE SUBTRACT = p5_instance.SUBTRACT TAB = p5_instance.TAB TAU = p5_instance.TAU TEXT = p5_instance.TEXT TEXTURE = p5_instance.TEXTURE THRESHOLD = p5_instance.THRESHOLD TOP = p5_instance.TOP TRIANGLE_FAN = p5_instance.TRIANGLE_FAN TRIANGLE_STRIP = p5_instance.TRIANGLE_STRIP TRIANGLES = p5_instance.TRIANGLES TWO_PI = p5_instance.TWO_PI UP_ARROW = p5_instance.UP_ARROW VIDEO = p5_instance.VIDEO WAIT = p5_instance.WAIT WEBGL = p5_instance.WEBGL frameCount = p5_instance.frameCount focused = p5_instance.focused displayWidth = p5_instance.displayWidth displayHeight = p5_instance.displayHeight windowWidth = p5_instance.windowWidth windowHeight = p5_instance.windowHeight width = p5_instance.width height = p5_instance.height disableFriendlyErrors = p5_instance.disableFriendlyErrors deviceOrientation = p5_instance.deviceOrientation accelerationX = p5_instance.accelerationX accelerationY = p5_instance.accelerationY accelerationZ = p5_instance.accelerationZ pAccelerationX = p5_instance.pAccelerationX pAccelerationY = p5_instance.pAccelerationY pAccelerationZ = p5_instance.pAccelerationZ rotationX = p5_instance.rotationX rotationY = p5_instance.rotationY rotationZ = p5_instance.rotationZ pRotationX = p5_instance.pRotationX pRotationY = p5_instance.pRotationY pRotationZ = p5_instance.pRotationZ turnAxis = p5_instance.turnAxis keyIsPressed = p5_instance.keyIsPressed key = p5_instance.key keyCode = p5_instance.keyCode mouseX = p5_instance.mouseX mouseY = p5_instance.mouseY pmouseX = p5_instance.pmouseX pmouseY = p5_instance.pmouseY winMouseX = p5_instance.winMouseX winMouseY = p5_instance.winMouseY pwinMouseX = p5_instance.pwinMouseX pwinMouseY = p5_instance.pwinMouseY mouseButton = p5_instance.mouseButton mouseIsPressed = p5_instance.mouseIsPressed touches = p5_instance.touches pixels = p5_instance.pixels return draw_func() def global_p5_injection(p5_sketch): """ Injects the p5js's skecth instance as a global variable to setup and draw functions """ def decorator(f): def wrapper(): global _P5_INSTANCE _P5_INSTANCE = p5_sketch return pre_draw(_P5_INSTANCE, f) return wrapper return decorator def start_p5(setup_func, draw_func, event_functions): """ This is the entrypoint function. It accepts 2 parameters: - setup_func: a Python setup callable - draw_func: a Python draw callable - event_functions: a config dict for the event functions in the format: {"eventFunctionName": python_event_function} This method gets the p5js's sketch instance and injects them """ def sketch_setup(p5_sketch): p5_sketch.setup = global_p5_injection(p5_sketch)(setup_func) p5_sketch.draw = global_p5_injection(p5_sketch)(draw_func) instance = __new__(p5(sketch_setup, 'sketch-holder')) # inject event functions into p5 event_function_names = ( "deviceMoved", "deviceTurned", "deviceShaken", "windowResized", "keyPressed", "keyReleased", "keyTyped", "mousePressed", "mouseReleased", "mouseClicked", "doubleClicked", "mouseMoved", "mouseDragged", "mouseWheel", "touchStarted", "touchMoved", "touchEnded" ) for f_name in [f for f in event_function_names if event_functions.get(f, None)]: func = event_functions[f_name] event_func = global_p5_injection(instance)(func) setattr(instance, f_name, event_func) def logOnloaded(): console.log("Lib loaded!") def add_library(lib_name): # placeholder for https://github.com/berinhard/pyp5js/issues/31 src = '' return console.log("Lib name is not valid:", lib_name) console.log("Importing:", src) script = document.createElement("script") script.onload = logOnloaded script.src = src document.head.appendChild(script) ================================================ FILE: docs/examples/sketch_000/target/pyp5js.python_functions.js ================================================ // Transcrypt'ed from Python, 2020-04-28 21:56:46 import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __proxy__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, abs, all, any, assert, bool, bytearray, bytes, callable, chr, copy, deepcopy, delattr, dict, dir, divmod, enumerate, filter, float, getattr, hasattr, input, int, isinstance, issubclass, len, list, map, max, min, object, ord, pow, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, round, set, setattr, sorted, str, sum, tuple, zip} from './org.transcrypt.__runtime__.js'; var __name__ = 'pyp5js.python_functions'; export var PythonFunctions = __class__ ('PythonFunctions', [object], { __module__: __name__, }); setattr (PythonFunctions, 'map', map); setattr (PythonFunctions, 'filter', filter); setattr (PythonFunctions, 'set', set); //# sourceMappingURL=pyp5js.python_functions.map ================================================ FILE: docs/examples/sketch_000/target/pyp5js.python_functions.py ================================================ class PythonFunctions: pass setattr(PythonFunctions, 'map', map) setattr(PythonFunctions, 'filter', filter) setattr(PythonFunctions, 'set', set) ================================================ FILE: docs/examples/sketch_000/target/sketch_000.js ================================================ // Transcrypt'ed from Python, 2020-04-28 21:56:46 import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __proxy__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, all, any, assert, bool, bytearray, bytes, callable, chr, deepcopy, delattr, dict, dir, divmod, enumerate, getattr, hasattr, isinstance, issubclass, len, list, object, ord, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, setattr, sorted, sum, tuple, zip} from './org.transcrypt.__runtime__.js'; import {ADD, ALT, ARROW, AUDIO, AUTO, AXES, BACKSPACE, BASELINE, BEVEL, BEZIER, BLEND, BLUR, BOLD, BOLDITALIC, BOTTOM, BURN, CENTER, CHORD, CLAMP, CLOSE, CONTROL, CORNER, CORNERS, CROSS, CURVE, DARKEST, DEGREES, DEG_TO_RAD, DELETE, DIFFERENCE, DILATE, DODGE, DOWN_ARROW, ENTER, ERODE, ESCAPE, EXCLUSION, FILL, GRAY, GRID, HALF_PI, HAND, HARD_LIGHT, HSB, HSL, IMAGE, IMMEDIATE, INVERT, ITALIC, LANDSCAPE, LEFT, LEFT_ARROW, LIGHTEST, LINEAR, LINES, LINE_LOOP, LINE_STRIP, MIRROR, MITER, MOVE, MULTIPLY, NEAREST, NORMAL, OPAQUE, OPEN, OPTION, OVERLAY, P2D, PI, PIE, POINTS, PORTRAIT, POSTERIZE, PROJECT, QUADRATIC, QUADS, QUAD_STRIP, QUARTER_PI, RADIANS, RADIUS, RAD_TO_DEG, REPEAT, REPLACE, RETURN, RGB, RIGHT, RIGHT_ARROW, ROUND, SCREEN, SHIFT, SOFT_LIGHT, SQUARE, STROKE, SUBTRACT, TAB, TAU, TEXT, TEXTURE, THRESHOLD, TOP, TRIANGLES, TRIANGLE_FAN, TRIANGLE_STRIP, TWO_PI, UP_ARROW, VIDEO, WAIT, WEBGL, _CTX_MIDDLE, _DEFAULT_FILL, _DEFAULT_LEADMULT, _DEFAULT_STROKE, _DEFAULT_TEXT_FILL, _P5_INSTANCE, abs, accelerationX, accelerationY, accelerationZ, acos, add_library, alpha, ambientLight, ambientMaterial, angleMode, append, applyMatrix, arc, arrayCopy, asin, atan, atan2, background, beginContour, beginShape, bezier, bezierDetail, bezierPoint, bezierTangent, bezierVertex, blend, blendMode, blue, boolean, box, brightness, byte, camera, ceil, changed, char, circle, color, colorMode, concat, cone, constrain, copy, cos, createA, createAudio, createButton, createCamera, createCanvas, createCapture, createCheckbox, createColorPicker, createDiv, createElement, createFileInput, createGraphics, createImage, createImg, createInput, createNumberDict, createP, createRadio, createSelect, createShader, createSlider, createSpan, createStringDict, createVector, createVideo, createWriter, cursor, curve, curveDetail, curvePoint, curveTangent, curveTightness, curveVertex, cylinder, day, debugMode, degrees, deviceOrientation, directionalLight, disableFriendlyErrors, displayDensity, displayHeight, displayWidth, dist, ellipse, ellipseMode, ellipsoid, endContour, endShape, exp, fill, filter, float, floor, focused, frameCount, frameRate, fullscreen, getURL, getURLParams, getURLPath, global_p5_injection, green, height, hex, hour, httpDo, httpGet, httpPost, hue, image, imageMode, input, int, join, key, keyCode, keyIsDown, keyIsPressed, lerp, lerpColor, lightness, lights, line, loadBytes, loadFont, loadImage, loadJSON, loadModel, loadPixels, loadShader, loadStrings, loadTable, loadXML, log, logOnloaded, loop, mag, map, match, matchAll, max, millis, min, minute, model, month, mouseButton, mouseIsPressed, mouseX, mouseY, nf, nfc, nfp, nfs, noCanvas, noCursor, noDebugMode, noFill, noLoop, noSmooth, noStroke, noTint, noise, noiseDetail, noiseSeed, norm, normalMaterial, orbitControl, ortho, pAccelerationX, pAccelerationY, pAccelerationZ, pRotationX, pRotationY, pRotationZ, perspective, pixelDensity, pixels, plane, pmouseX, pmouseY, point, pointLight, popMatrix, popStyle, pow, pre_draw, preload, push, pushMatrix, pushStyle, pwinMouseX, pwinMouseY, py_clear, py_get, py_pop, py_sort, py_split, quad, quadraticVertex, radians, random, randomGaussian, randomSeed, rect, rectMode, red, redraw, remove, removeElements, resetMatrix, resetShader, resizeCanvas, reverse, rotate, rotateX, rotateY, rotateZ, rotationX, rotationY, rotationZ, round, saturation, save, saveCanvas, saveFrames, saveJSON, saveStrings, saveTable, scale, second, select, selectAll, set, setAttributes, setCamera, setMoveThreshold, setShakeThreshold, shader, shearX, shearY, shininess, shorten, shuffle, sin, size, smooth, specularMaterial, sphere, splice, splitTokens, sq, sqrt, square, start_p5, str, stroke, strokeCap, strokeJoin, strokeWeight, subset, tan, text, textAlign, textAscent, textDescent, textFont, textLeading, textSize, textStyle, textWidth, texture, textureMode, textureWrap, tint, torus, touches, translate, triangle, trim, turnAxis, unchar, unhex, updatePixels, vertex, width, winMouseX, winMouseY, windowHeight, windowWidth, year} from './pyp5js.js'; var __name__ = 'sketch_000'; export var setup = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } } else { } createCanvas (200, 200); background (160); }; export var draw = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } } else { } fill ('blue'); background (200); var radius = sin (frameCount / 60) * 50 + 50; ellipse (100, 100, radius, radius); }; //# sourceMappingURL=sketch_000.map ================================================ FILE: docs/examples/sketch_000/target/sketch_000.py ================================================ from pyp5js import * def setup(): createCanvas(200, 200) background(160) def draw(): fill("blue") background(200) radius = sin(frameCount / 60) * 50 + 50 ellipse(100, 100, radius, radius) ================================================ FILE: docs/examples/sketch_000/target/target_sketch.js ================================================ // Transcrypt'ed from Python, 2020-04-28 21:56:45 import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __proxy__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, all, any, assert, bool, bytearray, bytes, callable, chr, deepcopy, delattr, dict, dir, divmod, enumerate, getattr, hasattr, isinstance, issubclass, len, list, object, ord, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, setattr, sorted, sum, tuple, zip} from './org.transcrypt.__runtime__.js'; import {ADD, ALT, ARROW, AUDIO, AUTO, AXES, BACKSPACE, BASELINE, BEVEL, BEZIER, BLEND, BLUR, BOLD, BOLDITALIC, BOTTOM, BURN, CENTER, CHORD, CLAMP, CLOSE, CONTROL, CORNER, CORNERS, CROSS, CURVE, DARKEST, DEGREES, DEG_TO_RAD, DELETE, DIFFERENCE, DILATE, DODGE, DOWN_ARROW, ENTER, ERODE, ESCAPE, EXCLUSION, FILL, GRAY, GRID, HALF_PI, HAND, HARD_LIGHT, HSB, HSL, IMAGE, IMMEDIATE, INVERT, ITALIC, LANDSCAPE, LEFT, LEFT_ARROW, LIGHTEST, LINEAR, LINES, LINE_LOOP, LINE_STRIP, MIRROR, MITER, MOVE, MULTIPLY, NEAREST, NORMAL, OPAQUE, OPEN, OPTION, OVERLAY, P2D, PI, PIE, POINTS, PORTRAIT, POSTERIZE, PROJECT, QUADRATIC, QUADS, QUAD_STRIP, QUARTER_PI, RADIANS, RADIUS, RAD_TO_DEG, REPEAT, REPLACE, RETURN, RGB, RIGHT, RIGHT_ARROW, ROUND, SCREEN, SHIFT, SOFT_LIGHT, SQUARE, STROKE, SUBTRACT, TAB, TAU, TEXT, TEXTURE, THRESHOLD, TOP, TRIANGLES, TRIANGLE_FAN, TRIANGLE_STRIP, TWO_PI, UP_ARROW, VIDEO, WAIT, WEBGL, _CTX_MIDDLE, _DEFAULT_FILL, _DEFAULT_LEADMULT, _DEFAULT_STROKE, _DEFAULT_TEXT_FILL, _P5_INSTANCE, abs, accelerationX, accelerationY, accelerationZ, acos, add_library, alpha, ambientLight, ambientMaterial, angleMode, append, applyMatrix, arc, arrayCopy, asin, atan, atan2, background, beginContour, beginShape, bezier, bezierDetail, bezierPoint, bezierTangent, bezierVertex, blend, blendMode, blue, boolean, box, brightness, byte, camera, ceil, changed, char, circle, color, colorMode, concat, cone, constrain, copy, cos, createA, createAudio, createButton, createCamera, createCanvas, createCapture, createCheckbox, createColorPicker, createDiv, createElement, createFileInput, createGraphics, createImage, createImg, createInput, createNumberDict, createP, createRadio, createSelect, createShader, createSlider, createSpan, createStringDict, createVector, createVideo, createWriter, cursor, curve, curveDetail, curvePoint, curveTangent, curveTightness, curveVertex, cylinder, day, debugMode, degrees, deviceOrientation, directionalLight, disableFriendlyErrors, displayDensity, displayHeight, displayWidth, dist, draw, ellipse, ellipseMode, ellipsoid, endContour, endShape, exp, fill, filter, float, floor, focused, frameCount, frameRate, fullscreen, getURL, getURLParams, getURLPath, global_p5_injection, green, height, hex, hour, httpDo, httpGet, httpPost, hue, image, imageMode, input, int, join, key, keyCode, keyIsDown, keyIsPressed, lerp, lerpColor, lightness, lights, line, loadBytes, loadFont, loadImage, loadJSON, loadModel, loadPixels, loadShader, loadStrings, loadTable, loadXML, log, logOnloaded, loop, mag, map, match, matchAll, max, millis, min, minute, model, month, mouseButton, mouseIsPressed, mouseX, mouseY, nf, nfc, nfp, nfs, noCanvas, noCursor, noDebugMode, noFill, noLoop, noSmooth, noStroke, noTint, noise, noiseDetail, noiseSeed, norm, normalMaterial, orbitControl, ortho, pAccelerationX, pAccelerationY, pAccelerationZ, pRotationX, pRotationY, pRotationZ, perspective, pixelDensity, pixels, plane, pmouseX, pmouseY, point, pointLight, popMatrix, popStyle, pow, pre_draw, preload, push, pushMatrix, pushStyle, pwinMouseX, pwinMouseY, py_clear, py_get, py_pop, py_sort, py_split, quad, quadraticVertex, radians, random, randomGaussian, randomSeed, rect, rectMode, red, redraw, remove, removeElements, resetMatrix, resetShader, resizeCanvas, reverse, rotate, rotateX, rotateY, rotateZ, rotationX, rotationY, rotationZ, round, saturation, save, saveCanvas, saveFrames, saveJSON, saveStrings, saveTable, scale, second, select, selectAll, set, setAttributes, setCamera, setMoveThreshold, setShakeThreshold, setup, shader, shearX, shearY, shininess, shorten, shuffle, sin, size, smooth, specularMaterial, sphere, splice, splitTokens, sq, sqrt, square, start_p5, str, stroke, strokeCap, strokeJoin, strokeWeight, subset, tan, text, textAlign, textAscent, textDescent, textFont, textLeading, textSize, textStyle, textWidth, texture, textureMode, textureWrap, tint, torus, touches, translate, triangle, trim, turnAxis, unchar, unhex, updatePixels, vertex, width, winMouseX, winMouseY, windowHeight, windowWidth, year} from './pyp5js.js'; import * as source_sketch from './sketch_000.js'; var __name__ = '__main__'; export var event_functions = dict ({'deviceMoved': source_sketch.deviceMoved, 'deviceTurned': source_sketch.deviceTurned, 'deviceShaken': source_sketch.deviceShaken, 'keyPressed': source_sketch.keyPressed, 'keyReleased': source_sketch.keyReleased, 'keyTyped': source_sketch.keyTyped, 'mouseMoved': source_sketch.mouseMoved, 'mouseDragged': source_sketch.mouseDragged, 'mousePressed': source_sketch.mousePressed, 'mouseReleased': source_sketch.mouseReleased, 'mouseClicked': source_sketch.mouseClicked, 'doubleClicked': source_sketch.doubleClicked, 'mouseWheel': source_sketch.mouseWheel, 'touchStarted': source_sketch.touchStarted, 'touchMoved': source_sketch.touchMoved, 'touchEnded': source_sketch.touchEnded, 'windowResized': source_sketch.windowResized}); start_p5 (source_sketch.setup, source_sketch.draw, event_functions); //# sourceMappingURL=target_sketch.map ================================================ FILE: docs/examples/sketch_000/target/target_sketch.project ================================================ {"options": {"source": "/home/bernardo/envs/pyp5js/docs/examples/sketch_000/target_sketch.py", "anno": false, "alimod": false, "build": true, "complex": false, "docat": false, "dassert": false, "dcheck": false, "dextex": false, "dlog": false, "dmap": false, "dnostrip": false, "dstat": false, "dtree": false, "esv": null, "ecom": false, "fcall": false, "gen": false, "iconv": false, "jscall": false, "jskeys": false, "jsmod": false, "kwargs": true, "keycheck": false, "license": false, "map": true, "nomin": true, "opov": false, "parent": null, "run": false, "symbols": null, "sform": false, "tconv": false, "unit": null, "verbose": false, "x": null, "xreex": false, "xglobs": false, "xpath": "/home/bernardo/envs/pyp5js/pyp5js", "xtiny": false, "star": false}, "modules": [{"source": "/home/bernardo/.virtualenvs/pyp5js/lib/python3.6/site-packages/transcrypt/modules/org/transcrypt/__runtime__.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/sketch_000/__target__/org.transcrypt.__runtime__.js"}, {"source": "/home/bernardo/envs/pyp5js/docs/examples/sketch_000/target_sketch.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/sketch_000/__target__/target_sketch.js"}, {"source": "/home/bernardo/envs/pyp5js/pyp5js/pyp5js.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/sketch_000/__target__/pyp5js.js"}, {"source": "/home/bernardo/envs/pyp5js/pyp5js/python_functions.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/sketch_000/__target__/pyp5js.python_functions.js"}, {"source": "/home/bernardo/envs/pyp5js/docs/examples/sketch_000/sketch_000.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/sketch_000/__target__/sketch_000.js"}]} ================================================ FILE: docs/examples/sketch_000/target/target_sketch.py ================================================ import sketch_000 as source_sketch from pyp5js import * event_functions = { "deviceMoved": source_sketch.deviceMoved, "deviceTurned": source_sketch.deviceTurned, "deviceShaken": source_sketch.deviceShaken, "keyPressed": source_sketch.keyPressed, "keyReleased": source_sketch.keyReleased, "keyTyped": source_sketch.keyTyped, "mouseMoved": source_sketch.mouseMoved, "mouseDragged": source_sketch.mouseDragged, "mousePressed": source_sketch.mousePressed, "mouseReleased": source_sketch.mouseReleased, "mouseClicked": source_sketch.mouseClicked, "doubleClicked": source_sketch.doubleClicked, "mouseWheel": source_sketch.mouseWheel, "touchStarted": source_sketch.touchStarted, "touchMoved": source_sketch.touchMoved, "touchEnded": source_sketch.touchEnded, "windowResized": source_sketch.windowResized, } start_p5(source_sketch.setup, source_sketch.draw, event_functions) ================================================ FILE: docs/examples/transcrypt/index.html.template ================================================ {{ sketch_name }} - pyp5js (using Transcrypt)

Python code here.

             
{{ sketch_content }}
              
          
================================================ FILE: docs/examples/transcrypt/sketch_001/index.html ================================================ sketch_001 - pyp5js (using Transcrypt)

Python code here.

             
# https://p5js.org/examples/interaction-wavemaker.html

t = 0

def setup():
    createCanvas(600, 600)
    stroke(250)
    strokeWeight(3)
    fill(40, 200, 40)


def draw():
    global t
    background(10, 10)

    xAngle = map(mouseX, 0, width, -4 * PI, 4 * PI, True)
    yAngle = map(mouseY, 0, height, -4 * PI, 4 * PI, True)
    for x in range(0, width, 30):
        for y in range(0, height, 30):

            angle = xAngle * (x / width) + yAngle * (y / height)

            myX = x + 20 * cos(2 * PI * t + angle)
            myY = y + 20 * sin(2 * TWO_PI * t + angle)

            ellipse(myX, myY, 10)

    t = t + 0.01

              
          
================================================ FILE: docs/examples/transcrypt/sketch_001/sketch_001.py ================================================ # https://p5js.org/examples/interaction-wavemaker.html t = 0 def setup(): createCanvas(600, 600) stroke(250) strokeWeight(3) fill(40, 200, 40) def draw(): global t background(10, 10) xAngle = map(mouseX, 0, width, -4 * PI, 4 * PI, True) yAngle = map(mouseY, 0, height, -4 * PI, 4 * PI, True) for x in range(0, width, 30): for y in range(0, height, 30): angle = xAngle * (x / width) + yAngle * (y / height) myX = x + 20 * cos(2 * PI * t + angle) myY = y + 20 * sin(2 * TWO_PI * t + angle) ellipse(myX, myY, 10) t = t + 0.01 ================================================ FILE: docs/examples/transcrypt/sketch_001/static/p5.js ================================================ /*! p5.js v1.0.0 February 29, 2020 */ !function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).p5=e()}}(function(){return function o(a,s,l){function u(t,e){if(!s[t]){if(!a[t]){var r="function"==typeof require&&require;if(!e&&r)return r(t,!0);if(h)return h(t,!0);var i=new Error("Cannot find module '"+t+"'");throw i.code="MODULE_NOT_FOUND",i}var n=s[t]={exports:{}};a[t][0].call(n.exports,function(e){return u(a[t][1][e]||e)},n,n.exports,o,a,s,l)}return s[t].exports}for(var h="function"==typeof require&&require,e=0;e>16&255,a[s++]=t>>8&255,a[s++]=255&t;2===o&&(t=u[e.charCodeAt(r)]<<2|u[e.charCodeAt(r+1)]>>4,a[s++]=255&t);1===o&&(t=u[e.charCodeAt(r)]<<10|u[e.charCodeAt(r+1)]<<4|u[e.charCodeAt(r+2)]>>2,a[s++]=t>>8&255,a[s++]=255&t);return a},r.fromByteArray=function(e){for(var t,r=e.length,i=r%3,n=[],o=0,a=r-i;o>2]+s[t<<4&63]+"==")):2==i&&(t=(e[r-2]<<8)+e[r-1],n.push(s[t>>10]+s[t>>4&63]+s[t<<2&63]+"="));return n.join("")};for(var s=[],u=[],h="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=0,o=i.length;n>18&63]+s[n>>12&63]+s[n>>6&63]+s[63&n]);return o.join("")}u["-".charCodeAt(0)]=62,u["_".charCodeAt(0)]=63},{}],20:[function(e,t,r){},{}],21:[function(N,e,F){(function(c){"use strict";var i=N("base64-js"),o=N("ieee754"),e="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;F.Buffer=c,F.SlowBuffer=function(e){+e!=e&&(e=0);return c.alloc(+e)},F.INSPECT_MAX_BYTES=50;var r=2147483647;function a(e){if(r>>1;case"base64":return O(e).length;default:if(n)return i?-1:R(e).length;t=(""+t).toLowerCase(),n=!0}}function d(e,t,r){var i=e[t];e[t]=e[r],e[r]=i}function p(e,t,r,i,n){if(0===e.length)return-1;if("string"==typeof r?(i=r,r=0):2147483647=e.length){if(n)return-1;r=e.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof t&&(t=c.from(t,i)),c.isBuffer(t))return 0===t.length?-1:m(e,t,r,i,n);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):m(e,[t],r,i,n);throw new TypeError("val must be string, number or Buffer")}function m(e,t,r,i,n){var o,a=1,s=e.length,l=t.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(e.length<2||t.length<2)return-1;s/=a=2,l/=2,r/=2}function u(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(n){var h=-1;for(o=r;o>8,n=r%256,o.push(n),o.push(i);return o}(t,e.length-r),e,r,i)}function b(e,t,r){return 0===t&&r===e.length?i.fromByteArray(e):i.fromByteArray(e.slice(t,r))}function _(e,t,r){r=Math.min(e.length,r);for(var i=[],n=t;n>>10&1023|55296),h=56320|1023&h),i.push(h),n+=c}return function(e){var t=e.length;if(t<=x)return String.fromCharCode.apply(String,e);var r="",i=0;for(;ithis.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e=e||"utf8";;)switch(e){case"hex":return M(this,t,r);case"utf8":case"utf-8":return _(this,t,r);case"ascii":return w(this,t,r);case"latin1":case"binary":return S(this,t,r);case"base64":return b(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,t,r);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}.apply(this,arguments)},c.prototype.equals=function(e){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===c.compare(this,e)},c.prototype.inspect=function(){var e="",t=F.INSPECT_MAX_BYTES;return e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(e+=" ... "),""},e&&(c.prototype[e]=c.prototype.inspect),c.prototype.compare=function(e,t,r,i,n){if(A(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),t<0||r>e.length||i<0||n>this.length)throw new RangeError("out of range index");if(n<=i&&r<=t)return 0;if(n<=i)return-1;if(r<=t)return 1;if(this===e)return 0;for(var o=(n>>>=0)-(i>>>=0),a=(r>>>=0)-(t>>>=0),s=Math.min(o,a),l=this.slice(i,n),u=e.slice(t,r),h=0;h>>=0,isFinite(r)?(r>>>=0,void 0===i&&(i="utf8")):(i=r,r=void 0)}var n=this.length-t;if((void 0===r||nthis.length)throw new RangeError("Attempt to write outside buffer bounds");i=i||"utf8";for(var o,a,s,l,u,h,c=!1;;)switch(i){case"hex":return g(this,e,t,r);case"utf8":case"utf-8":return u=t,h=r,D(R(e,(l=this).length-u),l,u,h);case"ascii":return v(this,e,t,r);case"latin1":case"binary":return v(this,e,t,r);case"base64":return o=this,a=t,s=r,D(O(e),o,a,s);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return y(this,e,t,r);default:if(c)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),c=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var x=4096;function w(e,t,r){var i="";r=Math.min(e.length,r);for(var n=t;ne.length)throw new RangeError("Index out of range")}function P(e,t,r,i){if(r+i>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function L(e,t,r,i,n){return t=+t,r>>>=0,n||P(e,0,r,4),o.write(e,t,r,i,23,4),r+4}function k(e,t,r,i,n){return t=+t,r>>>=0,n||P(e,0,r,8),o.write(e,t,r,i,52,8),r+8}c.prototype.slice=function(e,t){var r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):r>>=0,t>>>=0,r||T(e,t,this.length);for(var i=this[e],n=1,o=0;++o>>=0,t>>>=0,r||T(e,t,this.length);for(var i=this[e+--t],n=1;0>>=0,t||T(e,1,this.length),this[e]},c.prototype.readUInt16LE=function(e,t){return e>>>=0,t||T(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUInt16BE=function(e,t){return e>>>=0,t||T(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUInt32LE=function(e,t){return e>>>=0,t||T(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUInt32BE=function(e,t){return e>>>=0,t||T(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||T(e,t,this.length);for(var i=this[e],n=1,o=0;++o>>=0,t>>>=0,r||T(e,t,this.length);for(var i=t,n=1,o=this[e+--i];0>>=0,t||T(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){e>>>=0,t||T(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(e,t){e>>>=0,t||T(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(e,t){return e>>>=0,t||T(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return e>>>=0,t||T(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readFloatLE=function(e,t){return e>>>=0,t||T(e,4,this.length),o.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return e>>>=0,t||T(e,4,this.length),o.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return e>>>=0,t||T(e,8,this.length),o.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return e>>>=0,t||T(e,8,this.length),o.read(this,e,!1,52,8)},c.prototype.writeUIntLE=function(e,t,r,i){e=+e,t>>>=0,r>>>=0,i||C(this,e,t,r,Math.pow(2,8*r)-1,0);var n=1,o=0;for(this[t]=255&e;++o>>=0,r>>>=0,i||C(this,e,t,r,Math.pow(2,8*r)-1,0);var n=r-1,o=1;for(this[t+n]=255&e;0<=--n&&(o*=256);)this[t+n]=e/o&255;return t+r},c.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,1,255,0),this[t]=255&e,t+1},c.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},c.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeIntLE=function(e,t,r,i){if(e=+e,t>>>=0,!i){var n=Math.pow(2,8*r-1);C(this,e,t,r,n-1,-n)}var o=0,a=1,s=0;for(this[t]=255&e;++o>0)-s&255;return t+r},c.prototype.writeIntBE=function(e,t,r,i){if(e=+e,t>>>=0,!i){var n=Math.pow(2,8*r-1);C(this,e,t,r,n-1,-n)}var o=r-1,a=1,s=0;for(this[t+o]=255&e;0<=--o&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+r},c.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},c.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeFloatLE=function(e,t,r){return L(this,e,t,!0,r)},c.prototype.writeFloatBE=function(e,t,r){return L(this,e,t,!1,r)},c.prototype.writeDoubleLE=function(e,t,r){return k(this,e,t,!0,r)},c.prototype.writeDoubleBE=function(e,t,r){return k(this,e,t,!1,r)},c.prototype.copy=function(e,t,r,i){if(!c.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r=r||0,i||0===i||(i=this.length),t>=e.length&&(t=e.length),t=t||0,0=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t>>=0,r=void 0===r?this.length:r>>>0,"number"==typeof(e=e||0))for(o=t;o>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function O(e){return i.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(t,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function D(e,t,r,i){for(var n=0;n=t.length||n>=e.length);++n)t[n+r]=e[n];return n}function A(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function I(e){return e!=e}var U=function(){for(var e="0123456789abcdef",t=new Array(256),r=0;r<16;++r)for(var i=16*r,n=0;n<16;++n)t[i+n]=e[r]+e[n];return t}()}).call(this,N("buffer").Buffer)},{"base64-js":19,buffer:21,ieee754:30}],22:[function(e,t,r){"use strict";t.exports=e("./").polyfill()},{"./":23}],23:[function(z,r,i){(function(j,V){var e,t;e=this,t=function(){"use strict";function l(e){return"function"==typeof e}var r=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},i=0,t=void 0,n=void 0,a=function(e,t){f[i]=e,f[i+1]=t,2===(i+=2)&&(n?n(d):y())};var e="undefined"!=typeof window?window:void 0,o=e||{},s=o.MutationObserver||o.WebKitMutationObserver,u="undefined"==typeof self&&void 0!==j&&"[object process]"==={}.toString.call(j),h="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function c(){var e=setTimeout;return function(){return e(d,1)}}var f=new Array(1e3);function d(){for(var e=0;e":">",'"':""","'":"'","/":"/"};function S(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,function(e){return w[e]}):e}var M=function(){function i(e){var t,r=1=this.maxReplaces)break}for(a=0;r=this.regexp.exec(e);){if(void 0===(i=h(r[1].trim())))if("function"==typeof c){var d=c(e,r,t);i="string"==typeof d?d:""}else this.logger.warn("missed to pass in variable ".concat(r[1]," for interpolating ").concat(e)),i="";else"string"==typeof i||this.useRawValueToEscape||(i=v(i));if(i=this.escapeValue?u(this.escape(i)):u(i),e=e.replace(r[0],i),this.regexp.lastIndex=0,++a>=this.maxReplaces)break}return e}},{key:"nest",value:function(e,t,r){var i,n,o=D({},2>1,h=-7,c=r?n-1:0,f=r?-1:1,d=e[t+c];for(c+=f,o=d&(1<<-h)-1,d>>=-h,h+=s;0>=-h,h+=i;0>1,f=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,d=i?0:o-1,p=i?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=h):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),2<=(t+=1<=a+c?f/l:f*Math.pow(2,1-c))*l&&(a++,l/=2),h<=a+c?(s=0,a=h):1<=a+c?(s=(t*l-1)*Math.pow(2,n),a+=c):(s=t*Math.pow(2,c-1)*Math.pow(2,n),a=0));8<=n;e[r+d]=255&s,d+=p,s/=256,n-=8);for(a=a<Math.abs(e[0])&&(t=1),Math.abs(e[2])>Math.abs(e[t])&&(t=2),t}var C=4e150;function P(e,t){e.f+=t.f,e.b.f+=t.b.f}function u(e,t,r){return e=e.a,t=t.a,r=r.a,t.b.a===e?r.b.a===e?v(t.a,r.a)?b(r.b.a,t.a,r.a)<=0:0<=b(t.b.a,r.a,t.a):b(r.b.a,e,r.a)<=0:r.b.a===e?0<=b(t.b.a,e,t.a):(t=y(t.b.a,e,t.a),(e=y(r.b.a,e,r.a))<=t)}function L(e){e.a.i=null;var t=e.e;t.a.c=t.c,t.c.a=t.a,e.e=null}function h(e,t){c(e.a),e.c=!1,(e.a=t).i=e}function k(e){for(var t=e.a.a;(e=fe(e)).a.a===t;);return e.c&&(h(e,t=f(ce(e).a.b,e.a.e)),e=fe(e)),e}function R(e,t,r){var i=new he;return i.a=r,i.e=W(e.f,t.e,i),r.i=i}function O(e,t){switch(e.s){case 100130:return 0!=(1&t);case 100131:return 0!==t;case 100132:return 0>1]],s[a[u]])?le(r,u):ue(r,u)),s[o]=null,l[o]=r.b,r.b=o}else for(r.c[-(o+1)]=null;0Math.max(a.a,l.a))return!1;if(v(o,a)){if(0i.f&&(i.f*=2,i.c=oe(i.c,i.f+1)),0===i.b?r=n:(r=i.b,i.b=i.c[i.b]),i.e[r]=t,i.c[r]=n,i.d[n]=r,i.h&&ue(i,n),r}return i=e.a++,e.c[i]=t,-(i+1)}function ie(e){if(0===e.a)return se(e.b);var t=e.c[e.d[e.a-1]];if(0!==e.b.a&&v(ae(e.b),t))return se(e.b);for(;--e.a,0e.a||v(i[a],i[l])){n[r[o]=a]=o;break}n[r[o]=l]=o,o=s}}function ue(e,t){for(var r=e.d,i=e.e,n=e.c,o=t,a=r[o];;){var s=o>>1,l=r[s];if(0==s||v(i[l],i[a])){n[r[o]=a]=o;break}n[r[o]=l]=o,o=s}}function he(){this.e=this.a=null,this.f=0,this.c=this.b=this.h=this.d=!1}function ce(e){return e.e.c.b}function fe(e){return e.e.a.b}(i=q.prototype).x=function(){Y(this,0)},i.B=function(e,t){switch(e){case 100142:return;case 100140:switch(t){case 100130:case 100131:case 100132:case 100133:case 100134:return void(this.s=t)}break;case 100141:return void(this.m=!!t);default:return void Z(this,100900)}Z(this,100901)},i.y=function(e){switch(e){case 100142:return 0;case 100140:return this.s;case 100141:return this.m;default:Z(this,100900)}return!1},i.A=function(e,t,r){this.j[0]=e,this.j[1]=t,this.j[2]=r},i.z=function(e,t){var r=t||null;switch(e){case 100100:case 100106:this.h=r;break;case 100104:case 100110:this.l=r;break;case 100101:case 100107:this.k=r;break;case 100102:case 100108:this.i=r;break;case 100103:case 100109:this.p=r;break;case 100105:case 100111:this.o=r;break;case 100112:this.r=r;break;default:Z(this,100900)}},i.C=function(e,t){var r=!1,i=[0,0,0];Y(this,2);for(var n=0;n<3;++n){var o=e[n];o<-1e150&&(o=-1e150,r=!0),1e150n[u]&&(n[u]=h,a[u]=l)}if(l=0,n[1]-o[1]>n[0]-o[0]&&(l=1),n[2]-o[2]>n[l]-o[l]&&(l=2),o[l]>=n[l])i[0]=0,i[1]=0,i[2]=1;else{for(n=0,o=s[l],a=a[l],s=[0,0,0],o=[o.g[0]-a.g[0],o.g[1]-a.g[1],o.g[2]-a.g[2]],u=[0,0,0],l=r.e;l!==r;l=l.e)u[0]=l.g[0]-a.g[0],u[1]=l.g[1]-a.g[1],u[2]=l.g[2]-a.g[2],s[0]=o[1]*u[2]-o[2]*u[1],s[1]=o[2]*u[0]-o[0]*u[2],s[2]=o[0]*u[1]-o[1]*u[0],n<(h=s[0]*s[0]+s[1]*s[1]+s[2]*s[2])&&(n=h,i[0]=s[0],i[1]=s[1],i[2]=s[2]);n<=0&&(i[0]=i[1]=i[2]=0,i[T(o)]=1)}r=!0}for(s=T(i),l=this.b.c,n=(s+1)%3,a=(s+2)%3,s=0>=l,h-=l,g!=o){if(g==a)break;for(var v=g>8,++y;var _=b;if(i>=8;null!==m&&s<4096&&(p[s++]=m<<8|_,u+1<=s&&l<12&&(++l,u=u<<1|1)),m=g}else s=1+a,u=(1<<(l=n+1))-1,m=null}return f!==i&&console.log("Warning, gif stream shorter than expected."),r}try{r.GifWriter=function(v,e,t,r){var y=0,i=void 0===(r=void 0===r?{}:r).loop?null:r.loop,b=void 0===r.palette?null:r.palette;if(e<=0||t<=0||65535>=1;)++n;if(a=1<>8&255,v[y++]=255&t,v[y++]=t>>8&255,v[y++]=(null!==b?128:0)|n,v[y++]=o,v[y++]=0,null!==b)for(var s=0,l=b.length;s>16&255,v[y++]=u>>8&255,v[y++]=255&u}if(null!==i){if(i<0||65535>8&255,v[y++]=0}var x=!1;this.addFrame=function(e,t,r,i,n,o){if(!0===x&&(--y,x=!1),o=void 0===o?{}:o,e<0||t<0||65535>=1;)++u;l=1<>8&255,v[y++]=d,v[y++]=0),v[y++]=44,v[y++]=255&e,v[y++]=e>>8&255,v[y++]=255&t,v[y++]=t>>8&255,v[y++]=255&r,v[y++]=r>>8&255,v[y++]=255&i,v[y++]=i>>8&255,v[y++]=!0===a?128|u-1:0,!0===a)for(var p=0,m=s.length;p>16&255,v[y++]=g>>8&255,v[y++]=255&g}return y=function(t,r,e,i){t[r++]=e;var n=r++,o=1<>=8,h-=8,r===n+256&&(t[n]=255,n=r++)}function d(e){c|=e<>=8,h-=8,r===n+256&&(t[n]=255,n=r++);4096===l?(d(o),l=1+s,u=e+1,m={}):(1<>7,n=1<<1+(7&r);x[e++],x[e++];var o=null,a=null;i&&(o=e,e+=3*(a=n));var s=!0,l=[],u=0,h=null,c=0,f=null;for(this.width=w,this.height=t;s&&e>2&7,e++;break;case 254:for(;;){if(!(0<=(C=x[e++])))throw Error("Invalid block size");if(0===C)break;e+=C}break;default:throw new Error("Unknown graphic control label: 0x"+x[e-1].toString(16))}break;case 44:var p=x[e++]|x[e++]<<8,m=x[e++]|x[e++]<<8,g=x[e++]|x[e++]<<8,v=x[e++]|x[e++]<<8,y=x[e++],b=y>>6&1,_=1<<1+(7&y),S=o,M=a,E=!1;if(y>>7){E=!0;S=e,e+=3*(M=_)}var T=e;for(e++;;){var C;if(!(0<=(C=x[e++])))throw Error("Invalid block size");if(0===C)break;e+=C}l.push({x:p,y:m,width:g,height:v,has_local_palette:E,palette_offset:S,palette_size:M,data_offset:T,data_length:e-T,transparent_index:h,interlaced:!!b,delay:u,disposal:c});break;case 59:s=!1;break;default:throw new Error("Unknown gif block: 0x"+x[e-1].toString(16))}this.numFrames=function(){return l.length},this.loopCount=function(){return f},this.frameInfo=function(e){if(e<0||e>=l.length)throw new Error("Frame index out of range.");return l[e]},this.decodeAndBlitFrameBGRA=function(e,t){var r=this.frameInfo(e),i=r.width*r.height,n=new Uint8Array(i);P(x,r.data_offset,n,i);var o=r.palette_offset,a=r.transparent_index;null===a&&(a=256);var s=r.width,l=w-s,u=s,h=4*(r.y*w+r.x),c=4*((r.y+r.height)*w+r.x),f=h,d=4*l;!0===r.interlaced&&(d+=4*w*7);for(var p=8,m=0,g=n.length;m>=1)),v===a)f+=4;else{var y=x[o+3*v],b=x[o+3*v+1],_=x[o+3*v+2];t[f++]=_,t[f++]=b,t[f++]=y,t[f++]=255}--u}},this.decodeAndBlitFrameRGBA=function(e,t){var r=this.frameInfo(e),i=r.width*r.height,n=new Uint8Array(i);P(x,r.data_offset,n,i);var o=r.palette_offset,a=r.transparent_index;null===a&&(a=256);var s=r.width,l=w-s,u=s,h=4*(r.y*w+r.x),c=4*((r.y+r.height)*w+r.x),f=h,d=4*l;!0===r.interlaced&&(d+=4*w*7);for(var p=8,m=0,g=n.length;m>=1)),v===a)f+=4;else{var y=x[o+3*v],b=x[o+3*v+1],_=x[o+3*v+2];t[f++]=y,t[f++]=b,t[f++]=_,t[f++]=255}--u}}}}catch(e){}},{}],33:[function(jr,t,r){(function(Gr){var e;e=this,function(E){"use strict";function e(e){if(null==this)throw TypeError();var t=String(this),r=t.length,i=e?Number(e):0;if(i!=i&&(i=0),!(i<0||r<=i)){var n,o=t.charCodeAt(i);return 55296<=o&&o<=56319&&i+1>>=1,t}function _(e,t,r){if(!t)return r;for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<>>16-t;return e.tag>>>=t,e.bitcount-=t,i+r}function x(e,t){for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<>>=1,++n,r+=t.table[n],0<=(i-=t.table[n]););return e.tag=o,e.bitcount-=n,t.trans[r+i]}function w(e,t,r){var i,n,o,a,s,l;for(i=_(e,5,257),n=_(e,5,1),o=_(e,4,4),a=0;a<19;++a)g[a]=0;for(a=0;athis.x2&&(this.x2=e)),"number"==typeof t&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=t,this.y2=t),tthis.y2&&(this.y2=t))},C.prototype.addX=function(e){this.addPoint(e,null)},C.prototype.addY=function(e){this.addPoint(null,e)},C.prototype.addBezier=function(e,t,r,i,n,o,a,s){var l=this,u=[e,t],h=[r,i],c=[n,o],f=[a,s];this.addPoint(e,t),this.addPoint(a,s);for(var d=0;d<=1;d++){var p=6*u[d]-12*h[d]+6*c[d],m=-3*u[d]+9*h[d]-9*c[d]+3*f[d],g=3*h[d]-3*u[d];if(0!=m){var v=Math.pow(p,2)-4*g*m;if(!(v<0)){var y=(-p+Math.sqrt(v))/(2*m);0>8&255,255&e]},A.USHORT=U(2),D.SHORT=function(e){return 32768<=e&&(e=-(65536-e)),[e>>8&255,255&e]},A.SHORT=U(2),D.UINT24=function(e){return[e>>16&255,e>>8&255,255&e]},A.UINT24=U(3),D.ULONG=function(e){return[e>>24&255,e>>16&255,e>>8&255,255&e]},A.ULONG=U(4),D.LONG=function(e){return R<=e&&(e=-(2*R-e)),[e>>24&255,e>>16&255,e>>8&255,255&e]},A.LONG=U(4),D.FIXED=D.ULONG,A.FIXED=A.ULONG,D.FWORD=D.SHORT,A.FWORD=A.SHORT,D.UFWORD=D.USHORT,A.UFWORD=A.USHORT,D.LONGDATETIME=function(e){return[0,0,0,0,e>>24&255,e>>16&255,e>>8&255,255&e]},A.LONGDATETIME=U(8),D.TAG=function(e){return k.argument(4===e.length,"Tag should be exactly 4 ASCII characters."),[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]},A.TAG=U(4),D.Card8=D.BYTE,A.Card8=A.BYTE,D.Card16=D.USHORT,A.Card16=A.USHORT,D.OffSize=D.BYTE,A.OffSize=A.BYTE,D.SID=D.USHORT,A.SID=A.USHORT,D.NUMBER=function(e){return-107<=e&&e<=107?[e+139]:108<=e&&e<=1131?[247+((e-=108)>>8),255&e]:-1131<=e&&e<=-108?[251+((e=-e-108)>>8),255&e]:-32768<=e&&e<=32767?D.NUMBER16(e):D.NUMBER32(e)},A.NUMBER=function(e){return D.NUMBER(e).length},D.NUMBER16=function(e){return[28,e>>8&255,255&e]},A.NUMBER16=U(3),D.NUMBER32=function(e){return[29,e>>24&255,e>>16&255,e>>8&255,255&e]},A.NUMBER32=U(5),D.REAL=function(e){var t=e.toString(),r=/\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec(t);if(r){var i=parseFloat("1e"+((r[2]?+r[2]:0)+r[1].length));t=(Math.round(e*i)/i).toString()}for(var n="",o=0,a=t.length;o>8&255,t[t.length]=255&i}return t},A.UTF16=function(e){return 2*e.length};var N={"x-mac-croatian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈ƫȅ ÀÃÕŒœĐ—“”‘’÷◊©⁄€‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ","x-mac-cyrillic":"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю","x-mac-gaelic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØḂ±≤≥ḃĊċḊḋḞḟĠġṀæøṁṖṗɼƒſṠ«»… ÀÃÕŒœ–—“”‘’ṡẛÿŸṪ€‹›Ŷŷṫ·Ỳỳ⁊ÂÊÁËÈÍÎÏÌÓÔ♣ÒÚÛÙıÝýŴŵẄẅẀẁẂẃ","x-mac-greek":"Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦€ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ­","x-mac-icelandic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüݰ¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-inuit":"ᐃᐄᐅᐆᐊᐋᐱᐲᐳᐴᐸᐹᑉᑎᑏᑐᑑᑕᑖᑦᑭᑮᑯᑰᑲᑳᒃᒋᒌᒍᒎᒐᒑ°ᒡᒥᒦ•¶ᒧ®©™ᒨᒪᒫᒻᓂᓃᓄᓅᓇᓈᓐᓯᓰᓱᓲᓴᓵᔅᓕᓖᓗᓘᓚᓛᓪᔨᔩᔪᔫᔭ… ᔮᔾᕕᕖᕗ–—“”‘’ᕘᕙᕚᕝᕆᕇᕈᕉᕋᕌᕐᕿᖀᖁᖂᖃᖄᖅᖏᖐᖑᖒᖓᖔᖕᙱᙲᙳᙴᙵᙶᖖᖠᖡᖢᖣᖤᖥᖦᕼŁł","x-mac-ce":"ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ",macintosh:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-romanian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂȘ∞±≤≥¥µ∂∑∏π∫ªºΩăș¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›Țț‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-turkish":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙˆ˜¯˘˙˚¸˝˛ˇ"};O.MACSTRING=function(e,t,r,i){var n=N[i];if(void 0!==n){for(var o="",a=0;a>8&255,l+256&255)}return o}D.MACSTRING=function(e,t){var r=function(e){if(!F)for(var t in F={},N)F[t]=new String(t);var r=F[e];if(void 0!==r){if(B){var i=B.get(r);if(void 0!==i)return i}var n=N[e];if(void 0!==n){for(var o={},a=0;a>8,t[c+1]=255&f,t=t.concat(i[h])}return t},A.TABLE=function(e){for(var t=0,r=e.fields.length,i=0;i>1,t.skip("uShort",3),e.glyphIndexMap={};for(var a=new se.Parser(r,i+n+14),s=new se.Parser(r,i+n+16+2*o),l=new se.Parser(r,i+n+16+4*o),u=new se.Parser(r,i+n+16+6*o),h=i+n+16+8*o,c=0;c>4,o=15&i;if(15==n)break;if(t+=r[n],15==o)break;t+=r[o]}return parseFloat(t)}(e);if(32<=t&&t<=246)return t-139;if(247<=t&&t<=250)return 256*(t-247)+e.parseByte()+108;if(251<=t&&t<=254)return 256*-(t-251)-e.parseByte()-108;throw new Error("Invalid b0 "+t)}function Te(e,t,r){t=void 0!==t?t:0;var i=new se.Parser(e,t),n=[],o=[];for(r=void 0!==r?r:e.length;i.relativeOffset>1,T.length=0,P=!0}return function e(t){for(var r,i,n,o,a,s,l,u,h,c,f,d,p=0;pMath.abs(d-R)?k=f+T.shift():R=d+T.shift(),E.curveTo(y,b,_,x,l,u),E.curveTo(h,c,f,d,k,R);break;default:console.log("Glyph "+v.index+": unknown operator 1200"+m),T.length=0}break;case 14:0>3;break;case 21:2>16),p+=2;break;case 29:a=T.pop()+g.gsubrsBias,(s=g.gsubrs[a])&&e(s);break;case 30:for(;0=r.begin&&e=fe.length){var a=i.parseChar();r.names.push(i.parseString(a))}break;case 2.5:r.numberOfGlyphs=i.parseUShort(),r.offset=new Array(r.numberOfGlyphs);for(var s=0;st.value.tag?1:-1}),t.fields=t.fields.concat(i),t.fields=t.fields.concat(n),t}function gt(e,t,r){for(var i=0;i 123 are reserved for internal usage");d|=1<>>1,o=e[n].tag;if(o===t)return n;o>>1,o=e[n];if(o===t)return n;o>>1,a=(r=e[o]).start;if(a===t)return r;a(r=e[i-1]).end?0:r}function xt(e,t){this.font=e,this.tableName=t}function wt(e){xt.call(this,e,"gpos")}function St(e){xt.call(this,e,"gsub")}function Mt(e,t){var r=e.length;if(r!==t.length)return!1;for(var i=0;it.points.length-1||i.matchedPoints[1]>n.points.length-1)throw Error("Matched points out of range in "+t.name);var a=t.points[i.matchedPoints[0]],s=n.points[i.matchedPoints[1]],l={xScale:i.xScale,scale01:i.scale01,scale10:i.scale10,yScale:i.yScale,dx:0,dy:0};s=kt([s],l)[0],l.dx=a.x-s.x,l.dy=a.y-s.y,o=kt(n.points,l)}t.points=t.points.concat(o)}}return Rt(t.points)}(wt.prototype=xt.prototype={searchTag:yt,binSearch:bt,getTable:function(e){var t=this.font.tables[this.tableName];return!t&&e&&(t=this.font.tables[this.tableName]=this.createDefaultTable()),t},getScriptNames:function(){var e=this.getTable();return e?e.scripts.map(function(e){return e.tag}):[]},getDefaultScriptName:function(){var e=this.getTable();if(e){for(var t=!1,r=0;r=s[u-1].tag,"Features must be added in alphabetical order."),o={tag:r,feature:{params:0,lookupListIndexes:[]}},s.push(o),a.push(u),o.feature}}},getLookupTables:function(e,t,r,i,n){var o=this.getFeatureTable(e,t,r,n),a=[];if(o){for(var s,l=o.lookupListIndexes,u=this.font.tables[this.tableName].lookups,h=0;h",s),t.stack.push(Math.round(64*s))}function vr(e,t){var r=t.stack,i=r.pop(),n=t.fv,o=t.pv,a=t.ppem,s=t.deltaBase+16*(e-1),l=t.deltaShift,u=t.z0;E.DEBUG&&console.log(t.step,"DELTAP["+e+"]",i,r);for(var h=0;h>4)===a){var d=(15&f)-8;0<=d&&d++,E.DEBUG&&console.log(t.step,"DELTAPFIX",c,"by",d*l);var p=u[c];n.setRelative(p,p,d*l,o)}}}function yr(e,t){var r=t.stack,i=r.pop();E.DEBUG&&console.log(t.step,"ROUND[]"),r.push(64*t.round(i/64))}function br(e,t){var r=t.stack,i=r.pop(),n=t.ppem,o=t.deltaBase+16*(e-1),a=t.deltaShift;E.DEBUG&&console.log(t.step,"DELTAC["+e+"]",i,r);for(var s=0;s>4)===n){var h=(15&u)-8;0<=h&&h++;var c=h*a;E.DEBUG&&console.log(t.step,"DELTACFIX",l,"by",c),t.cvt[l]+=c}}}function _r(e,t){var r,i,n=t.stack,o=n.pop(),a=n.pop(),s=t.z2[o],l=t.z1[a];E.DEBUG&&console.log(t.step,"SDPVTL["+e+"]",o,a),i=e?(r=s.y-l.y,l.x-s.x):(r=l.x-s.x,l.y-s.y),t.dpv=Zt(r,i)}function xr(e,t){var r=t.stack,i=t.prog,n=t.ip;E.DEBUG&&console.log(t.step,"PUSHB["+e+"]");for(var o=0;o":"_")+(i?"R":"_")+(0===n?"Gr":1===n?"Bl":2===n?"Wh":"")+"]",e?c+"("+o.cvt[c]+","+u+")":"",f,"(d =",a,"->",l*s,")"),o.rp1=o.rp0,o.rp2=f,t&&(o.rp0=f)}Ft.prototype.exec=function(e,t){if("number"!=typeof t)throw new Error("Point size is not a number!");if(!(2",i),s.interpolate(c,o,a,l),s.touch(c)}e.loop=1},dr.bind(void 0,0),dr.bind(void 0,1),function(e){for(var t=e.stack,r=e.rp0,i=e.z0[r],n=e.loop,o=e.fv,a=e.pv,s=e.z1;n--;){var l=t.pop(),u=s[l];E.DEBUG&&console.log(e.step,(1=a.width||t>=a.height?[0,0,0,0]:this._getPixel(e,t);var s=new l.default.Image(r,i);return s.canvas.getContext("2d").drawImage(a,e,t,r*o,i*o,0,0,r,i),s},l.default.Renderer.prototype.textLeading=function(e){return"number"==typeof e?(this._setProperty("_textLeading",e),this._pInst):this._textLeading},l.default.Renderer.prototype.textSize=function(e){return"number"==typeof e?(this._setProperty("_textSize",e),this._setProperty("_textLeading",e*y._DEFAULT_LEADMULT),this._applyTextProperties()):this._textSize},l.default.Renderer.prototype.textStyle=function(e){return e?(e!==y.NORMAL&&e!==y.ITALIC&&e!==y.BOLD&&e!==y.BOLDITALIC||this._setProperty("_textStyle",e),this._applyTextProperties()):this._textStyle},l.default.Renderer.prototype.textAscent=function(){return null===this._textAscent&&this._updateTextMetrics(),this._textAscent},l.default.Renderer.prototype.textDescent=function(){return null===this._textDescent&&this._updateTextMetrics(),this._textDescent},l.default.Renderer.prototype.textAlign=function(e,t){return void 0!==e?(this._setProperty("_textAlign",e),void 0!==t&&this._setProperty("_textBaseline",t),this._applyTextProperties()):{horizontal:this._textAlign,vertical:this._textBaseline}},l.default.Renderer.prototype.text=function(e,t,r,i,n){var o,a,s,l,u,h,c,f,d=this._pInst,p=Number.MAX_VALUE;if((this._doFill||this._doStroke)&&void 0!==e){if("string"!=typeof e&&(e=e.toString()),o=(e=e.replace(/(\t)/g," ")).split("\n"),void 0!==i){for(s=f=0;ss.HALF_PI&&e<=3*s.HALF_PI?Math.atan(r/i*Math.tan(e))+s.PI:Math.atan(r/i*Math.tan(e))+s.TWO_PI,t=t<=s.HALF_PI?Math.atan(r/i*Math.tan(t)):t>s.HALF_PI&&t<=3*s.HALF_PI?Math.atan(r/i*Math.tan(t))+s.PI:Math.atan(r/i*Math.tan(t))+s.TWO_PI),tv||Math.abs(this.accelerationY-this.pAccelerationY)>v||Math.abs(this.accelerationZ-this.pAccelerationZ)>v)&&e();var t=this.deviceTurned||window.deviceTurned;if("function"==typeof t){var r=this.rotationX+180,i=this.pRotationX+180,n=c+180;0>>24],i+=x[(16711680&C)>>16],n+=x[(65280&C)>>8],o+=x[255&C],r+=k[_],s++}w[l=T+y]=a/r,S[l]=i/r,M[l]=n/r,E[l]=o/r}T+=d}for(h=(u=-P)*d,b=T=0;b>>16,e[r+1]=(65280&t[i])>>>8,e[r+2]=255&t[i],e[r+3]=(4278190080&t[i])>>>24},O._toImageData=function(e){return e instanceof ImageData?e:e.getContext("2d").getImageData(0,0,e.width,e.height)},O._createImageData=function(e,t){return O._tmpCanvas=document.createElement("canvas"),O._tmpCtx=O._tmpCanvas.getContext("2d"),this._tmpCtx.createImageData(e,t)},O.apply=function(e,t,r){var i=e.getContext("2d"),n=i.getImageData(0,0,e.width,e.height),o=t(n,r);o instanceof ImageData?i.putImageData(o,0,0,0,0,e.width,e.height):i.putImageData(n,0,0,0,0,e.width,e.height)},O.threshold=function(e,t){var r=O._toPixels(e);void 0===t&&(t=.5);for(var i=Math.floor(255*t),n=0;n>8)/i,r[n+1]=255*(a*t>>8)/i,r[n+2]=255*(s*t>>8)/i}},O.dilate=function(e){for(var t,r,i,n,o,a,s,l,u,h,c,f,d,p,m,g,v,y=O._toPixels(e),b=0,_=y.length?y.length/4:0,x=new Int32Array(_);b<_;)for(r=(t=b)+e.width;b>16&255)+151*(i>>8&255)+28*(255&i))<(m=77*(c>>16&255)+151*(c>>8&255)+28*(255&c))&&(n=c,o=m),o<(p=77*((h=O._getARGB(y,a))>>16&255)+151*(h>>8&255)+28*(255&h))&&(n=h,o=p),o<(g=77*(f>>16&255)+151*(f>>8&255)+28*(255&f))&&(n=f,o=g),o<(v=77*(d>>16&255)+151*(d>>8&255)+28*(255&d))&&(n=d,o=v),x[b++]=n;O._setPixels(y,x)},O.erode=function(e){for(var t,r,i,n,o,a,s,l,u,h,c,f,d,p,m,g,v,y=O._toPixels(e),b=0,_=y.length?y.length/4:0,x=new Int32Array(_);b<_;)for(r=(t=b)+e.width;b>16&255)+151*(c>>8&255)+28*(255&c))<(o=77*(i>>16&255)+151*(i>>8&255)+28*(255&i))&&(n=c,o=m),(p=77*((h=O._getARGB(y,a))>>16&255)+151*(h>>8&255)+28*(255&h))>16&255)+151*(f>>8&255)+28*(255&f))>16&255)+151*(d>>8&255)+28*(255&d))=r){var i=Math.floor(t.timeDisplayed/r);if(t.timeDisplayed=0,t.displayIndex+=i,t.loopCount=Math.floor(t.displayIndex/t.numFrames),null!==t.loopLimit&&t.loopCount>=t.loopLimit)t.playing=!1;else{var n=t.displayIndex%t.numFrames;this.drawingContext.putImageData(t.frames[n].image,0,0),t.displayIndex=n,this.setModified(!0)}}}},n.default.Image.prototype._setProperty=function(e,t){this[e]=t,this.setModified(!0)},n.default.Image.prototype.loadPixels=function(){n.default.Renderer2D.prototype.loadPixels.call(this),this.setModified(!0)},n.default.Image.prototype.updatePixels=function(e,t,r,i){n.default.Renderer2D.prototype.updatePixels.call(this,e,t,r,i),this.setModified(!0)},n.default.Image.prototype.get=function(e,t,r,i){return n.default._validateParameters("p5.Image.get",arguments),n.default.Renderer2D.prototype.get.apply(this,arguments)},n.default.Image.prototype._getPixel=n.default.Renderer2D.prototype._getPixel,n.default.Image.prototype.set=function(e,t,r){n.default.Renderer2D.prototype.set.call(this,e,t,r),this.setModified(!0)},n.default.Image.prototype.resize=function(e,t){0===e&&0===t?(e=this.canvas.width,t=this.canvas.height):0===e?e=this.canvas.width*t/this.canvas.height:0===t&&(t=this.canvas.height*e/this.canvas.width),e=Math.floor(e),t=Math.floor(t);var r=document.createElement("canvas");if(r.width=e,r.height=t,this.gifProperties)for(var i=this.gifProperties,n=function(e,t){for(var r=0,i=0;i/g,">").replace(/"/g,""").replace(/'/g,"'")}function l(e,t){t&&!0!==t&&"true"!==t||(t="");var r="";return(e=e||"untitled")&&e.includes(".")&&(r=e.split(".").pop()),t&&r!==t&&(r=t,e="".concat(e,".").concat(r)),[e,r]}e("../core/error_helpers"),v.default.prototype.loadJSON=function(){for(var e=arguments.length,t=new Array(e),r=0;r"),n.print("");if(n.print(' '),n.print(""),n.print(""),n.print(" "),"0"!==o[0]){n.print(" ");for(var h=0;h".concat(c)),n.print(" ")}n.print(" ")}for(var f=0;f");for(var d=0;d".concat(p)),n.print(" ")}n.print(" ")}n.print("
"),n.print(""),n.print("")}n.close(),n.clear()},v.default.prototype.writeFile=function(e,t,r){var i="application/octet-stream";v.default.prototype._isSafari()&&(i="text/plain");var n=new Blob(e,{type:i});v.default.prototype.downloadFile(n,t,r)},v.default.prototype.downloadFile=function(e,t,r){var i=l(t,r),n=i[0];if(e instanceof Blob)s.default.saveAs(e,n);else{var o=document.createElement("a");if(o.href=e,o.download=n,o.onclick=function(e){var t;t=e,document.body.removeChild(t.target),e.stopPropagation()},o.style.display="none",document.body.appendChild(o),v.default.prototype._isSafari()){var a="Hello, Safari user! To download this file...\n";a+="1. Go to File --\x3e Save As.\n",a+='2. Choose "Page Source" as the Format.\n',a+='3. Name it with this extension: ."'.concat(i[1],'"'),alert(a)}o.click()}},v.default.prototype._checkFileExtension=l,v.default.prototype._isSafari=function(){return 0>>0},getSeed:function(){return t},rand:function(){return(r=(1664525*r+1013904223)%i)/i}});n.setSeed(e),_=new Array(4096);for(var o=0;o<4096;o++)_[o]=n.rand()};var o=n.default;r.default=o},{"../core/main":49}],82:[function(e,t,r){"use strict";function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i,l=(i=e("../core/main"))&&i.__esModule?i:{default:i},o=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==a(e)&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var o=i?Object.getOwnPropertyDescriptor(e,n):null;o&&(o.get||o.set)?Object.defineProperty(r,n,o):r[n]=e[n]}r.default=e,t&&t.set(e,r);return r}(e("../core/constants"));function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}l.default.Vector=function(e,t,r){var i,n,o;o=e instanceof l.default?(this.p5=e,i=t[0]||0,n=t[1]||0,t[2]||0):(i=e||0,n=t||0,r||0),this.x=i,this.y=n,this.z=o},l.default.Vector.prototype.toString=function(){return"p5.Vector Object : [".concat(this.x,", ").concat(this.y,", ").concat(this.z,"]")},l.default.Vector.prototype.set=function(e,t,r){return e instanceof l.default.Vector?(this.x=e.x||0,this.y=e.y||0,this.z=e.z||0):e instanceof Array?(this.x=e[0]||0,this.y=e[1]||0,this.z=e[2]||0):(this.x=e||0,this.y=t||0,this.z=r||0),this},l.default.Vector.prototype.copy=function(){return this.p5?new l.default.Vector(this.p5,[this.x,this.y,this.z]):new l.default.Vector(this.x,this.y,this.z)},l.default.Vector.prototype.add=function(e,t,r){return e instanceof l.default.Vector?(this.x+=e.x||0,this.y+=e.y||0,this.z+=e.z||0):e instanceof Array?(this.x+=e[0]||0,this.y+=e[1]||0,this.z+=e[2]||0):(this.x+=e||0,this.y+=t||0,this.z+=r||0),this};function u(e,t){return 0!==e&&(this.x=this.x%e),0!==t&&(this.y=this.y%t),this}function h(e,t,r){return 0!==e&&(this.x=this.x%e),0!==t&&(this.y=this.y%t),0!==r&&(this.z=this.z%r),this}l.default.Vector.prototype.rem=function(e,t,r){if(e instanceof l.default.Vector){if(Number.isFinite(e.x)&&Number.isFinite(e.y)&&Number.isFinite(e.z)){var i=parseFloat(e.x),n=parseFloat(e.y),o=parseFloat(e.z);h.call(this,i,n,o)}}else if(e instanceof Array)e.every(function(e){return Number.isFinite(e)})&&(2===e.length&&u.call(this,e[0],e[1]),3===e.length&&h.call(this,e[0],e[1],e[2]));else if(1===arguments.length){if(Number.isFinite(e)&&0!==e)return this.x=this.x%e,this.y=this.y%e,this.z=this.z%e,this}else if(2===arguments.length){var a=Array.prototype.slice.call(arguments);a.every(function(e){return Number.isFinite(e)})&&2===a.length&&u.call(this,a[0],a[1])}else if(3===arguments.length){var s=Array.prototype.slice.call(arguments);s.every(function(e){return Number.isFinite(e)})&&3===s.length&&h.call(this,s[0],s[1],s[2])}},l.default.Vector.prototype.sub=function(e,t,r){return e instanceof l.default.Vector?(this.x-=e.x||0,this.y-=e.y||0,this.z-=e.z||0):e instanceof Array?(this.x-=e[0]||0,this.y-=e[1]||0,this.z-=e[2]||0):(this.x-=e||0,this.y-=t||0,this.z-=r||0),this},l.default.Vector.prototype.mult=function(e){return"number"==typeof e&&isFinite(e)?(this.x*=e,this.y*=e,this.z*=e):console.warn("p5.Vector.prototype.mult:","n is undefined or not a finite number"),this},l.default.Vector.prototype.div=function(e){return"number"==typeof e&&isFinite(e)?0===e?console.warn("p5.Vector.prototype.div:","divide by 0"):(this.x/=e,this.y/=e,this.z/=e):console.warn("p5.Vector.prototype.div:","n is undefined or not a finite number"),this},l.default.Vector.prototype.mag=function(){return Math.sqrt(this.magSq())},l.default.Vector.prototype.magSq=function(){var e=this.x,t=this.y,r=this.z;return e*e+t*t+r*r},l.default.Vector.prototype.dot=function(e,t,r){return e instanceof l.default.Vector?this.dot(e.x,e.y,e.z):this.x*(e||0)+this.y*(t||0)+this.z*(r||0)},l.default.Vector.prototype.cross=function(e){var t=this.y*e.z-this.z*e.y,r=this.z*e.x-this.x*e.z,i=this.x*e.y-this.y*e.x;return this.p5?new l.default.Vector(this.p5,[t,r,i]):new l.default.Vector(t,r,i)},l.default.Vector.prototype.dist=function(e){return e.copy().sub(this).mag()},l.default.Vector.prototype.normalize=function(){var e=this.mag();return 0!==e&&this.mult(1/e),this},l.default.Vector.prototype.limit=function(e){var t=this.magSq();return e*e>>0},n.default.prototype.randomSeed=function(e){this._lcgSetSeed(o,e),this._gaussian_previous=!1},n.default.prototype.random=function(e,t){var r;if(n.default._validateParameters("random",arguments),r=null!=this[o]?this._lcg(o):Math.random(),void 0===e)return r;if(void 0===t)return e instanceof Array?e[Math.floor(r*e.length)]:r*e;if(tf){var P=p,L=l,k=u;p=d+f*(s&&d=t&&(r=r.substring(r.length-t,r.length)),r}},n.default.prototype.unhex=function(e){return e instanceof Array?e.map(n.default.prototype.unhex):parseInt("0x".concat(e),16)};var o=n.default;r.default=o},{"../core/main":49}],90:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i,a=(i=e("../core/main"))&&i.__esModule?i:{default:i};function n(e,t,r){var i=e<0,n=i?e.toString().substring(1):e.toString(),o=n.indexOf("."),a=-1!==o?n.substring(0,o):n,s=-1!==o?n.substring(o+1):"",l=i?"-":"";if(void 0!==r){var u="";(-1!==o||0r&&(s=s.substring(0,r));for(var h=0;hi.length)for(var o=t-(i+=-1===r?".":"").length+1,a=0;a=d.TWO_PI?"".concat("ellipse","|").concat(u,"|"):"".concat("arc","|").concat(a,"|").concat(s,"|").concat(l,"|").concat(u,"|"),!this.geometryInHash(t)){var h=new T.default.Geometry(u,1,function(){if(this.strokeIndices=[],a.toFixed(10)!==s.toFixed(10)){l!==d.PIE&&void 0!==l||(this.vertices.push(new T.default.Vector(.5,.5,0)),this.uvs.push([.5,.5]));for(var e=0;e<=u;e++){var t=(s-a)*(e/u)+a,r=.5+Math.cos(t)/2,i=.5+Math.sin(t)/2;this.vertices.push(new T.default.Vector(r,i,0)),this.uvs.push([r,i]),e>5&31)/31,(y>>10&31)/31):(r=a,i=s,l)}for(var b=1;b<=3;b++){var _=p+12*b,x=new S.default.Vector(u.getFloat32(_,!0),u.getFloat32(8+_,!0),u.getFloat32(4+_,!0));e.vertices.push(x),c&&o.push(r,i,n)}var w=new S.default.Vector(m,g,v);e.vertexNormals.push(w,w,w),e.faces.push([3*d,3*d+1,3*d+2]),e.uvs.push([0,0],[0,0],[0,0])}}(e,t);else{var r=new DataView(t);if(!("TextDecoder"in window))return console.warn("Sorry, ASCII STL loading only works in browsers that support TextDecoder (https://caniuse.com/#feat=textencoder)");var i=new TextDecoder("utf-8").decode(r).split("\n");!function(e,t){for(var r,i,n="",o=[],a=0;aMath.PI?l=Math.PI:l<=0&&(l=.001);var u=Math.sin(l)*a*Math.sin(s),h=Math.cos(l)*a,c=Math.sin(l)*a*Math.cos(s);this.camera(u+this.centerX,h+this.centerY,c+this.centerZ,this.centerX,this.centerY,this.centerZ,0,1,0)},m.default.Camera.prototype._isActive=function(){return this===this._renderer._curCamera},m.default.prototype.setCamera=function(e){this._renderer._curCamera=e,this._renderer.uPMatrix.set(e.projMatrix.mat4[0],e.projMatrix.mat4[1],e.projMatrix.mat4[2],e.projMatrix.mat4[3],e.projMatrix.mat4[4],e.projMatrix.mat4[5],e.projMatrix.mat4[6],e.projMatrix.mat4[7],e.projMatrix.mat4[8],e.projMatrix.mat4[9],e.projMatrix.mat4[10],e.projMatrix.mat4[11],e.projMatrix.mat4[12],e.projMatrix.mat4[13],e.projMatrix.mat4[14],e.projMatrix.mat4[15])};var n=m.default.Camera;r.default=n},{"../core/main":49}],98:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i,h=(i=e("../core/main"))&&i.__esModule?i:{default:i};h.default.Geometry=function(e,t,r){return this.vertices=[],this.lineVertices=[],this.lineNormals=[],this.vertexNormals=[],this.faces=[],this.uvs=[],this.edges=[],this.vertexColors=[],this.detailX=void 0!==e?e:1,this.detailY=void 0!==t?t:1,this.dirtyFlags={},r instanceof Function&&r.call(this),this},h.default.Geometry.prototype.reset=function(){this.lineVertices.length=0,this.lineNormals.length=0,this.vertices.length=0,this.edges.length=0,this.vertexColors.length=0,this.vertexNormals.length=0,this.uvs.length=0,this.dirtyFlags={}},h.default.Geometry.prototype.computeFaces=function(){this.faces.length=0;for(var e,t,r,i,n=this.detailX+1,o=0;othis.vertices.length-1-this.detailX;i--)e.add(this.vertexNormals[i]);e=h.default.Vector.div(e,this.detailX);for(var n=this.vertices.length-1;n>this.vertices.length-1-this.detailX;n--)this.vertexNormals[n]=e;return this},h.default.Geometry.prototype._makeTriangleEdges=function(){if(this.edges.length=0,Array.isArray(this.strokeIndices))for(var e=0,t=this.strokeIndices.length;e vTexCoord.y;\n bool y1 = p1.y > vTexCoord.y;\n bool y2 = p2.y > vTexCoord.y;\n\n // could web be under the curve (after t1)?\n if (y1 ? !y2 : y0) {\n // add the coverage for t1\n coverage.x += saturate(C1.x + 0.5);\n // calculate the anti-aliasing for t1\n weight.x = min(weight.x, abs(C1.x));\n }\n\n // are we outside the curve (after t2)?\n if (y1 ? !y0 : y2) {\n // subtract the coverage for t2\n coverage.x -= saturate(C2.x + 0.5);\n // calculate the anti-aliasing for t2\n weight.x = min(weight.x, abs(C2.x));\n }\n}\n\n// this is essentially the same as coverageX, but with the axes swapped\nvoid coverageY(vec2 p0, vec2 p1, vec2 p2) {\n\n vec2 C1, C2;\n calulateCrossings(p0, p1, p2, C1, C2);\n\n bool x0 = p0.x > vTexCoord.x;\n bool x1 = p1.x > vTexCoord.x;\n bool x2 = p2.x > vTexCoord.x;\n\n if (x1 ? !x2 : x0) {\n coverage.y -= saturate(C1.y + 0.5);\n weight.y = min(weight.y, abs(C1.y));\n }\n\n if (x1 ? !x0 : x2) {\n coverage.y += saturate(C2.y + 0.5);\n weight.y = min(weight.y, abs(C2.y));\n }\n}\n\nvoid main() {\n\n // calculate the pixel scale based on screen-coordinates\n pixelScale = hardness / fwidth(vTexCoord);\n\n // which grid cell is this pixel in?\n ivec2 gridCoord = ifloor(vTexCoord * vec2(uGridSize));\n\n // intersect curves in this row\n {\n // the index into the row info bitmap\n int rowIndex = gridCoord.y + uGridOffset.y;\n // fetch the info texel\n vec4 rowInfo = getTexel(uSamplerRows, rowIndex, uGridImageSize);\n // unpack the rowInfo\n int rowStrokeIndex = getInt16(rowInfo.xy);\n int rowStrokeCount = getInt16(rowInfo.zw);\n\n for (int iRowStroke = INT(0); iRowStroke < N; iRowStroke++) {\n if (iRowStroke >= rowStrokeCount)\n break;\n\n // each stroke is made up of 3 points: the start and control point\n // and the start of the next curve.\n // fetch the indices of this pair of strokes:\n vec4 strokeIndices = getTexel(uSamplerRowStrokes, rowStrokeIndex++, uCellsImageSize);\n\n // unpack the stroke index\n int strokePos = getInt16(strokeIndices.xy);\n\n // fetch the two strokes\n vec4 stroke0 = getTexel(uSamplerStrokes, strokePos + INT(0), uStrokeImageSize);\n vec4 stroke1 = getTexel(uSamplerStrokes, strokePos + INT(1), uStrokeImageSize);\n\n // calculate the coverage\n coverageX(stroke0.xy, stroke0.zw, stroke1.xy);\n }\n }\n\n // intersect curves in this column\n {\n int colIndex = gridCoord.x + uGridOffset.x;\n vec4 colInfo = getTexel(uSamplerCols, colIndex, uGridImageSize);\n int colStrokeIndex = getInt16(colInfo.xy);\n int colStrokeCount = getInt16(colInfo.zw);\n \n for (int iColStroke = INT(0); iColStroke < N; iColStroke++) {\n if (iColStroke >= colStrokeCount)\n break;\n\n vec4 strokeIndices = getTexel(uSamplerColStrokes, colStrokeIndex++, uCellsImageSize);\n\n int strokePos = getInt16(strokeIndices.xy);\n vec4 stroke0 = getTexel(uSamplerStrokes, strokePos + INT(0), uStrokeImageSize);\n vec4 stroke1 = getTexel(uSamplerStrokes, strokePos + INT(1), uStrokeImageSize);\n coverageY(stroke0.xy, stroke0.zw, stroke1.xy);\n }\n }\n\n weight = saturate(1.0 - weight * 2.0);\n float distance = max(weight.x + weight.y, minDistance); // manhattan approx.\n float antialias = abs(dot(coverage, weight) / distance);\n float cover = min(abs(coverage.x), abs(coverage.y));\n gl_FragColor = uMaterialColor;\n gl_FragColor.a *= saturate(max(antialias, cover));\n}",lineVert:"/*\n Part of the Processing project - http://processing.org\n Copyright (c) 2012-15 The Processing Foundation\n Copyright (c) 2004-12 Ben Fry and Casey Reas\n Copyright (c) 2001-04 Massachusetts Institute of Technology\n This library is free software; you can redistribute it and/or\n modify it under the terms of the GNU Lesser General Public\n License as published by the Free Software Foundation, version 2.1.\n This library is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n Lesser General Public License for more details.\n You should have received a copy of the GNU Lesser General\n Public License along with this library; if not, write to the\n Free Software Foundation, Inc., 59 Temple Place, Suite 330,\n Boston, MA 02111-1307 USA\n*/\n\n#define PROCESSING_LINE_SHADER\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform float uStrokeWeight;\n\nuniform vec4 uViewport;\nuniform int uPerspective;\n\nattribute vec4 aPosition;\nattribute vec4 aDirection;\n \nvoid main() {\n // using a scale <1 moves the lines towards the camera\n // in order to prevent popping effects due to half of\n // the line disappearing behind the geometry faces.\n vec3 scale = vec3(0.9995);\n\n vec4 posp = uModelViewMatrix * aPosition;\n vec4 posq = uModelViewMatrix * (aPosition + vec4(aDirection.xyz, 0));\n\n // Moving vertices slightly toward the camera\n // to avoid depth-fighting with the fill triangles.\n // Discussed here:\n // http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Number=252848 \n posp.xyz = posp.xyz * scale;\n posq.xyz = posq.xyz * scale;\n\n vec4 p = uProjectionMatrix * posp;\n vec4 q = uProjectionMatrix * posq;\n\n // formula to convert from clip space (range -1..1) to screen space (range 0..[width or height])\n // screen_p = (p.xy/p.w + <1,1>) * 0.5 * uViewport.zw\n\n // prevent division by W by transforming the tangent formula (div by 0 causes\n // the line to disappear, see https://github.com/processing/processing/issues/5183)\n // t = screen_q - screen_p\n //\n // tangent is normalized and we don't care which aDirection it points to (+-)\n // t = +- normalize( screen_q - screen_p )\n // t = +- normalize( (q.xy/q.w+<1,1>)*0.5*uViewport.zw - (p.xy/p.w+<1,1>)*0.5*uViewport.zw )\n //\n // extract common factor, <1,1> - <1,1> cancels out\n // t = +- normalize( (q.xy/q.w - p.xy/p.w) * 0.5 * uViewport.zw )\n //\n // convert to common divisor\n // t = +- normalize( ((q.xy*p.w - p.xy*q.w) / (p.w*q.w)) * 0.5 * uViewport.zw )\n //\n // remove the common scalar divisor/factor, not needed due to normalize and +-\n // (keep uViewport - can't remove because it has different components for x and y\n // and corrects for aspect ratio, see https://github.com/processing/processing/issues/5181)\n // t = +- normalize( (q.xy*p.w - p.xy*q.w) * uViewport.zw )\n\n vec2 tangent = normalize((q.xy*p.w - p.xy*q.w) * uViewport.zw);\n\n // flip tangent to normal (it's already normalized)\n vec2 normal = vec2(-tangent.y, tangent.x);\n\n float thickness = aDirection.w * uStrokeWeight;\n vec2 offset = normal * thickness / 2.0;\n\n vec2 curPerspScale;\n\n if(uPerspective == 1) {\n // Perspective ---\n // convert from world to clip by multiplying with projection scaling factor\n // to get the right thickness (see https://github.com/processing/processing/issues/5182)\n // invert Y, projections in Processing invert Y\n curPerspScale = (uProjectionMatrix * vec4(1, -1, 0, 0)).xy;\n } else {\n // No Perspective ---\n // multiply by W (to cancel out division by W later in the pipeline) and\n // convert from screen to clip (derived from clip to screen above)\n curPerspScale = p.w / (0.5 * uViewport.zw);\n }\n\n gl_Position.xy = p.xy + offset.xy * curPerspScale;\n gl_Position.zw = p.zw;\n}\n",lineFrag:"precision mediump float;\nprecision mediump int;\n\nuniform vec4 uMaterialColor;\n\nvoid main() {\n gl_FragColor = uMaterialColor;\n}",pointVert:"attribute vec3 aPosition;\nuniform float uPointSize;\nvarying float vStrokeWeight;\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nvoid main() {\n\tvec4 positionVec4 = vec4(aPosition, 1.0);\n\tgl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n\tgl_PointSize = uPointSize;\n\tvStrokeWeight = uPointSize;\n}",pointFrag:"precision mediump float;\nprecision mediump int;\nuniform vec4 uMaterialColor;\nvarying float vStrokeWeight;\n\nvoid main(){\n\tfloat mask = 0.0;\n\n\t// make a circular mask using the gl_PointCoord (goes from 0 - 1 on a point)\n // might be able to get a nicer edge on big strokeweights with smoothstep but slightly less performant\n\n\tmask = step(0.98, length(gl_PointCoord * 2.0 - 1.0));\n\n\t// if strokeWeight is 1 or less lets just draw a square\n\t// this prevents weird artifacting from carving circles when our points are really small\n\t// if strokeWeight is larger than 1, we just use it as is\n\n\tmask = mix(0.0, mask, clamp(floor(vStrokeWeight - 0.5),0.0,1.0));\n\n\t// throw away the borders of the mask\n // otherwise we get weird alpha blending issues\n\n\tif(mask > 0.98){\n discard;\n \t}\n\n \tgl_FragColor = vec4(uMaterialColor.rgb * (1.0 - mask), uMaterialColor.a) ;\n}"};u.default.RendererGL=function(e,t,r,i){return u.default.Renderer.call(this,e,t,r),this._setAttributeDefaults(t),this._initContext(),this.isP3D=!0,this.GL=this.drawingContext,this._isErasing=!1,this._enableLighting=!1,this.ambientLightColors=[],this.specularColors=[1,1,1],this.directionalLightDirections=[],this.directionalLightDiffuseColors=[],this.directionalLightSpecularColors=[],this.pointLightPositions=[],this.pointLightDiffuseColors=[],this.pointLightSpecularColors=[],this.spotLightPositions=[],this.spotLightDirections=[],this.spotLightDiffuseColors=[],this.spotLightSpecularColors=[],this.spotLightAngle=[],this.spotLightConc=[],this.drawMode=o.FILL,this.curFillColor=this._cachedFillStyle=[1,1,1,1],this.curStrokeColor=this._cachedStrokeStyle=[0,0,0,1],this.curBlendMode=o.BLEND,this._cachedBlendMode=void 0,this.blendExt=this.GL.getExtension("EXT_blend_minmax"),this._isBlending=!1,this._useSpecularMaterial=!1,this._useEmissiveMaterial=!1,this._useNormalMaterial=!1,this._useShininess=1,this._tint=[255,255,255,255],this.constantAttenuation=1,this.linearAttenuation=0,this.quadraticAttenuation=0,this.uMVMatrix=new u.default.Matrix,this.uPMatrix=new u.default.Matrix,this.uNMatrix=new u.default.Matrix("mat3"),this._curCamera=new u.default.Camera(this),this._curCamera._computeCameraDefaultSettings(),this._curCamera._setDefaultCamera(),this._defaultLightShader=void 0,this._defaultImmediateModeShader=void 0,this._defaultNormalShader=void 0,this._defaultColorShader=void 0,this._defaultPointShader=void 0,this.userFillShader=void 0,this.userStrokeShader=void 0,this.userPointShader=void 0,this.retainedMode={geometry:{},buffers:{stroke:[new u.default.RenderBuffer(3,"lineVertices","lineVertexBuffer","aPosition",this,this._flatten),new u.default.RenderBuffer(4,"lineNormals","lineNormalBuffer","aDirection",this,this._flatten)],fill:[new u.default.RenderBuffer(3,"vertices","vertexBuffer","aPosition",this,this._vToNArray),new u.default.RenderBuffer(3,"vertexNormals","normalBuffer","aNormal",this,this._vToNArray),new u.default.RenderBuffer(4,"vertexColors","colorBuffer","aMaterialColor",this),new u.default.RenderBuffer(3,"vertexAmbients","ambientBuffer","aAmbientColor",this),new u.default.RenderBuffer(2,"uvs","uvBuffer","aTexCoord",this,this._flatten)],text:[new u.default.RenderBuffer(3,"vertices","vertexBuffer","aPosition",this,this._vToNArray),new u.default.RenderBuffer(2,"uvs","uvBuffer","aTexCoord",this,this._flatten)]}},this.immediateMode={geometry:new u.default.Geometry,shapeMode:o.TRIANGLE_FAN,_bezierVertex:[],_quadraticVertex:[],_curveVertex:[],buffers:{fill:[new u.default.RenderBuffer(3,"vertices","vertexBuffer","aPosition",this,this._vToNArray),new u.default.RenderBuffer(3,"vertexNormals","normalBuffer","aNormal",this,this._vToNArray),new u.default.RenderBuffer(4,"vertexColors","colorBuffer","aVertexColor",this),new u.default.RenderBuffer(3,"vertexAmbients","ambientBuffer","aAmbientColor",this),new u.default.RenderBuffer(2,"uvs","uvBuffer","aTexCoord",this,this._flatten)],stroke:[new u.default.RenderBuffer(3,"lineVertices","lineVertexBuffer","aPosition",this,this._flatten),new u.default.RenderBuffer(4,"lineNormals","lineNormalBuffer","aDirection",this,this._flatten)],point:this.GL.createBuffer()}},this.pointSize=5,this.curStrokeWeight=1,this.textures=[],this.textureMode=o.IMAGE,this.textureWrapX=o.CLAMP,this.textureWrapY=o.CLAMP,this._tex=null,this._curveTightness=6,this._lookUpTableBezier=[],this._lookUpTableQuadratic=[],this._lutBezierDetail=0,this._lutQuadraticDetail=0,this._tessy=this._initTessy(),this.fontInfos={},this._curShader=void 0,this},u.default.RendererGL.prototype=Object.create(u.default.Renderer.prototype),u.default.RendererGL.prototype._setAttributeDefaults=function(e){var t={alpha:!0,depth:!0,stencil:!0,antialias:navigator.userAgent.toLowerCase().includes("safari"),premultipliedAlpha:!1,preserveDrawingBuffer:!0,perPixelLighting:!0};null===e._glAttributes?e._glAttributes=t:e._glAttributes=Object.assign(t,e._glAttributes)},u.default.RendererGL.prototype._initContext=function(){try{if(this.drawingContext=this.canvas.getContext("webgl",this._pInst._glAttributes)||this.canvas.getContext("experimental-webgl",this._pInst._glAttributes),null===this.drawingContext)throw new Error("Error creating webgl context");var e=this.drawingContext;e.enable(e.DEPTH_TEST),e.depthFunc(e.LEQUAL),e.viewport(0,0,e.drawingBufferWidth,e.drawingBufferHeight),this._viewport=this.drawingContext.getParameter(this.drawingContext.VIEWPORT)}catch(e){throw e}},u.default.RendererGL.prototype._resetContext=function(e,t){var r=this.width,i=this.height,n=this.canvas.id,o=this._pInst instanceof u.default.Graphics;if(o){var a=this._pInst;a.canvas.parentNode.removeChild(a.canvas),a.canvas=document.createElement("canvas"),(a._pInst._userNode||document.body).appendChild(a.canvas),u.default.Element.call(a,a.canvas,a._pInst),a.width=r,a.height=i}else{var s=this.canvas;s&&s.parentNode.removeChild(s),(s=document.createElement("canvas")).id=n,this._pInst._userNode?this._pInst._userNode.appendChild(s):document.body.appendChild(s),this._pInst.canvas=s}var l=new u.default.RendererGL(this._pInst.canvas,this._pInst,!o);this._pInst._setProperty("_renderer",l),l.resize(r,i),l._applyDefaults(),o||this._pInst._elements.push(l),"function"==typeof t&&setTimeout(function(){t.apply(window._renderer,e)},0)},u.default.prototype.setAttributes=function(e,t){if(void 0!==this._glAttributes){var r=!0;if(void 0!==t?(null===this._glAttributes&&(this._glAttributes={}),this._glAttributes[e]!==t&&(this._glAttributes[e]=t,r=!1)):e instanceof Object&&this._glAttributes!==e&&(this._glAttributes=e,r=!1),this._renderer.isP3D&&!r){if(!this._setupDone)for(var i in this._renderer.retainedMode.geometry)if(this._renderer.retainedMode.geometry.hasOwnProperty(i))return void console.error("Sorry, Could not set the attributes, you need to call setAttributes() before calling the other drawing methods in setup()");this.push(),this._renderer._resetContext(),this.pop(),this._renderer._curCamera&&(this._renderer._curCamera._renderer=this._renderer)}}else console.log("You are trying to use setAttributes on a p5.Graphics object that does not use a WEBGL renderer.")},u.default.RendererGL.prototype._update=function(){this.uMVMatrix.set(this._curCamera.cameraMatrix.mat4[0],this._curCamera.cameraMatrix.mat4[1],this._curCamera.cameraMatrix.mat4[2],this._curCamera.cameraMatrix.mat4[3],this._curCamera.cameraMatrix.mat4[4],this._curCamera.cameraMatrix.mat4[5],this._curCamera.cameraMatrix.mat4[6],this._curCamera.cameraMatrix.mat4[7],this._curCamera.cameraMatrix.mat4[8],this._curCamera.cameraMatrix.mat4[9],this._curCamera.cameraMatrix.mat4[10],this._curCamera.cameraMatrix.mat4[11],this._curCamera.cameraMatrix.mat4[12],this._curCamera.cameraMatrix.mat4[13],this._curCamera.cameraMatrix.mat4[14],this._curCamera.cameraMatrix.mat4[15]),this.ambientLightColors.length=0,this.specularColors=[1,1,1],this.directionalLightDirections.length=0,this.directionalLightDiffuseColors.length=0,this.directionalLightSpecularColors.length=0,this.pointLightPositions.length=0,this.pointLightDiffuseColors.length=0,this.pointLightSpecularColors.length=0,this.spotLightPositions.length=0,this.spotLightDirections.length=0,this.spotLightDiffuseColors.length=0,this.spotLightSpecularColors.length=0,this.spotLightAngle.length=0,this.spotLightConc.length=0,this._enableLighting=!1,this._tint=[255,255,255,255],this.GL.clear(this.GL.DEPTH_BUFFER_BIT)},u.default.RendererGL.prototype.background=function(){var e,t=(e=this._pInst).color.apply(e,arguments),r=t.levels[0]/255,i=t.levels[1]/255,n=t.levels[2]/255,o=t.levels[3]/255;this.GL.clearColor(r,i,n,o),this.GL.clear(this.GL.COLOR_BUFFER_BIT)},u.default.RendererGL.prototype.fill=function(e,t,r,i){var n=u.default.prototype.color.apply(this._pInst,arguments);this.curFillColor=n._array,this.drawMode=o.FILL,this._useNormalMaterial=!1,this._tex=null},u.default.RendererGL.prototype.stroke=function(e,t,r,i){arguments[3]=255;var n=u.default.prototype.color.apply(this._pInst,arguments);this.curStrokeColor=n._array},u.default.RendererGL.prototype.strokeCap=function(e){console.error("Sorry, strokeCap() is not yet implemented in WEBGL mode")},u.default.RendererGL.prototype.strokeJoin=function(e){console.error("Sorry, strokeJoin() is not yet implemented in WEBGL mode")},u.default.RendererGL.prototype.filter=function(e){console.error("filter() does not work in WEBGL mode")},u.default.RendererGL.prototype.blendMode=function(e){e===o.DARKEST||e===o.LIGHTEST||e===o.ADD||e===o.BLEND||e===o.SUBTRACT||e===o.SCREEN||e===o.EXCLUSION||e===o.REPLACE||e===o.MULTIPLY||e===o.REMOVE?this.curBlendMode=e:e!==o.BURN&&e!==o.OVERLAY&&e!==o.HARD_LIGHT&&e!==o.SOFT_LIGHT&&e!==o.DODGE||console.warn("BURN, OVERLAY, HARD_LIGHT, SOFT_LIGHT, and DODGE only work for blendMode in 2D mode.")},u.default.RendererGL.prototype.erase=function(e,t){this._isErasing||(this._cachedBlendMode=this.curBlendMode,this.blendMode(o.REMOVE),this._cachedFillStyle=this.curFillColor.slice(),this.curFillColor=[1,1,1,e/255],this._cachedStrokeStyle=this.curStrokeColor.slice(),this.curStrokeColor=[1,1,1,t/255],this._isErasing=!0)},u.default.RendererGL.prototype.noErase=function(){this._isErasing&&(this.curFillColor=this._cachedFillStyle.slice(),this.curStrokeColor=this._cachedStrokeStyle.slice(),this.blendMode(this._cachedBlendMode),this._isErasing=!1)},u.default.RendererGL.prototype.strokeWeight=function(e){this.curStrokeWeight!==e&&(this.pointSize=e,this.curStrokeWeight=e)},u.default.RendererGL.prototype._getPixel=function(e,t){var r;return r=new Uint8Array(4),this.drawingContext.readPixels(e,t,1,1,this.drawingContext.RGBA,this.drawingContext.UNSIGNED_BYTE,r),[r[0],r[1],r[2],r[3]]},u.default.RendererGL.prototype.loadPixels=function(){var e=this._pixelsState;if(!0===this._pInst._glAttributes.preserveDrawingBuffer){var t=e.pixels,r=this.GL.drawingBufferWidth*this.GL.drawingBufferHeight*4;t instanceof Uint8Array&&t.length===r||(t=new Uint8Array(r),this._pixelsState._setProperty("pixels",t));var i=this._pInst._pixelDensity;this.GL.readPixels(0,0,this.width*i,this.height*i,this.GL.RGBA,this.GL.UNSIGNED_BYTE,t)}else console.log("loadPixels only works in WebGL when preserveDrawingBuffer is true.")},u.default.RendererGL.prototype.geometryInHash=function(e){return void 0!==this.retainedMode.geometry[e]},u.default.RendererGL.prototype.resize=function(e,t){u.default.Renderer.prototype.resize.call(this,e,t),this.GL.viewport(0,0,this.GL.drawingBufferWidth,this.GL.drawingBufferHeight),this._viewport=this.GL.getParameter(this.GL.VIEWPORT),this._curCamera._resize();var r=this._pixelsState;void 0!==r.pixels&&r._setProperty("pixels",new Uint8Array(this.GL.drawingBufferWidth*this.GL.drawingBufferHeight*4))},u.default.RendererGL.prototype.clear=function(){var e=(arguments.length<=0?void 0:arguments[0])||0,t=(arguments.length<=1?void 0:arguments[1])||0,r=(arguments.length<=2?void 0:arguments[2])||0,i=(arguments.length<=3?void 0:arguments[3])||0;this.GL.clearColor(e,t,r,i),this.GL.clear(this.GL.COLOR_BUFFER_BIT|this.GL.DEPTH_BUFFER_BIT)},u.default.RendererGL.prototype.applyMatrix=function(e,t,r,i,n,o){16===arguments.length?u.default.Matrix.prototype.apply.apply(this.uMVMatrix,arguments):this.uMVMatrix.apply([e,t,0,0,r,i,0,0,0,0,1,0,n,o,0,1])},u.default.RendererGL.prototype.translate=function(e,t,r){return e instanceof u.default.Vector&&(r=e.z,t=e.y,e=e.x),this.uMVMatrix.translate([e,t,r]),this},u.default.RendererGL.prototype.scale=function(e,t,r){return this.uMVMatrix.scale(e,t,r),this},u.default.RendererGL.prototype.rotate=function(e,t){return void 0===t?this.rotateZ(e):(u.default.Matrix.prototype.rotate.apply(this.uMVMatrix,arguments),this)},u.default.RendererGL.prototype.rotateX=function(e){return this.rotate(e,1,0,0),this},u.default.RendererGL.prototype.rotateY=function(e){return this.rotate(e,0,1,0),this},u.default.RendererGL.prototype.rotateZ=function(e){return this.rotate(e,0,0,1),this},u.default.RendererGL.prototype.push=function(){var e=u.default.Renderer.prototype.push.apply(this),t=e.properties;return t.uMVMatrix=this.uMVMatrix.copy(),t.uPMatrix=this.uPMatrix.copy(),t._curCamera=this._curCamera,this._curCamera=this._curCamera.copy(),t.ambientLightColors=this.ambientLightColors.slice(),t.specularColors=this.specularColors.slice(),t.directionalLightDirections=this.directionalLightDirections.slice(),t.directionalLightDiffuseColors=this.directionalLightDiffuseColors.slice(),t.directionalLightSpecularColors=this.directionalLightSpecularColors.slice(),t.pointLightPositions=this.pointLightPositions.slice(),t.pointLightDiffuseColors=this.pointLightDiffuseColors.slice(),t.pointLightSpecularColors=this.pointLightSpecularColors.slice(),t.spotLightPositions=this.spotLightPositions.slice(),t.spotLightDirections=this.spotLightDirections.slice(),t.spotLightDiffuseColors=this.spotLightDiffuseColors.slice(),t.spotLightSpecularColors=this.spotLightSpecularColors.slice(),t.spotLightAngle=this.spotLightAngle.slice(),t.spotLightConc=this.spotLightConc.slice(),t.userFillShader=this.userFillShader,t.userStrokeShader=this.userStrokeShader,t.userPointShader=this.userPointShader,t.pointSize=this.pointSize,t.curStrokeWeight=this.curStrokeWeight,t.curStrokeColor=this.curStrokeColor,t.curFillColor=this.curFillColor,t._useSpecularMaterial=this._useSpecularMaterial,t._useEmissiveMaterial=this._useEmissiveMaterial,t._useShininess=this._useShininess,t.constantAttenuation=this.constantAttenuation,t.linearAttenuation=this.linearAttenuation,t.quadraticAttenuation=this.quadraticAttenuation,t._enableLighting=this._enableLighting,t._useNormalMaterial=this._useNormalMaterial,t._tex=this._tex,t.drawMode=this.drawMode,e},u.default.RendererGL.prototype.resetMatrix=function(){return this.uMVMatrix=u.default.Matrix.identity(this._pInst),this},u.default.RendererGL.prototype._getImmediateStrokeShader=function(){var e=this.userStrokeShader;return e&&e.isStrokeShader()?e:this._getLineShader()},u.default.RendererGL.prototype._getRetainedStrokeShader=u.default.RendererGL.prototype._getImmediateStrokeShader,u.default.RendererGL.prototype._getImmediateFillShader=function(){var e=this.userFillShader;if(this._useNormalMaterial&&(!e||!e.isNormalShader()))return this._getNormalShader();if(this._enableLighting){if(!e||!e.isLightShader())return this._getLightShader()}else if(this._tex){if(!e||!e.isTextureShader())return this._getLightShader()}else if(!e)return this._getImmediateModeShader();return e},u.default.RendererGL.prototype._getRetainedFillShader=function(){if(this._useNormalMaterial)return this._getNormalShader();var e=this.userFillShader;if(this._enableLighting){if(!e||!e.isLightShader())return this._getLightShader()}else if(this._tex){if(!e||!e.isTextureShader())return this._getLightShader()}else if(!e)return this._getColorShader();return e},u.default.RendererGL.prototype._getImmediatePointShader=function(){var e=this.userPointShader;return e&&e.isPointShader()?e:this._getPointShader()},u.default.RendererGL.prototype._getRetainedLineShader=u.default.RendererGL.prototype._getImmediateLineShader,u.default.RendererGL.prototype._getLightShader=function(){return this._defaultLightShader||(this._pInst._glAttributes.perPixelLighting?this._defaultLightShader=new u.default.Shader(this,c.phongVert,c.phongFrag):this._defaultLightShader=new u.default.Shader(this,c.lightVert,c.lightTextureFrag)),this._defaultLightShader},u.default.RendererGL.prototype._getImmediateModeShader=function(){return this._defaultImmediateModeShader||(this._defaultImmediateModeShader=new u.default.Shader(this,c.immediateVert,c.vertexColorFrag)),this._defaultImmediateModeShader},u.default.RendererGL.prototype._getNormalShader=function(){return this._defaultNormalShader||(this._defaultNormalShader=new u.default.Shader(this,c.normalVert,c.normalFrag)),this._defaultNormalShader},u.default.RendererGL.prototype._getColorShader=function(){return this._defaultColorShader||(this._defaultColorShader=new u.default.Shader(this,c.normalVert,c.basicFrag)),this._defaultColorShader},u.default.RendererGL.prototype._getPointShader=function(){return this._defaultPointShader||(this._defaultPointShader=new u.default.Shader(this,c.pointVert,c.pointFrag)),this._defaultPointShader},u.default.RendererGL.prototype._getLineShader=function(){return this._defaultLineShader||(this._defaultLineShader=new u.default.Shader(this,c.lineVert,c.lineFrag)),this._defaultLineShader},u.default.RendererGL.prototype._getFontShader=function(){return this._defaultFontShader||(this.GL.getExtension("OES_standard_derivatives"),this._defaultFontShader=new u.default.Shader(this,c.fontVert,c.fontFrag)),this._defaultFontShader},u.default.RendererGL.prototype._getEmptyTexture=function(){if(!this._emptyTexture){var e=new u.default.Image(1,1);e.set(0,0,255),this._emptyTexture=new u.default.Texture(this,e)}return this._emptyTexture},u.default.RendererGL.prototype.getTexture=function(e){var t=this.textures,r=!0,i=!1,n=void 0;try{for(var o,a=t[Symbol.iterator]();!(r=(o=a.next()).done);r=!0){var s=o.value;if(s.src===e)return s}}catch(e){i=!0,n=e}finally{try{r||null==a.return||a.return()}finally{if(i)throw n}}var l=new u.default.Texture(this,e);return t.push(l),l},u.default.RendererGL.prototype._setStrokeUniforms=function(e){e.bindShader(),e.setUniform("uMaterialColor",this.curStrokeColor),e.setUniform("uStrokeWeight",this.curStrokeWeight)},u.default.RendererGL.prototype._setFillUniforms=function(e){e.bindShader(),e.setUniform("uMaterialColor",this.curFillColor),e.setUniform("isTexture",!!this._tex),this._tex&&e.setUniform("uSampler",this._tex),e.setUniform("uTint",this._tint),e.setUniform("uSpecular",this._useSpecularMaterial),e.setUniform("uEmissive",this._useEmissiveMaterial),e.setUniform("uShininess",this._useShininess),e.setUniform("uUseLighting",this._enableLighting);var t=this.pointLightDiffuseColors.length/3;e.setUniform("uPointLightCount",t),e.setUniform("uPointLightLocation",this.pointLightPositions),e.setUniform("uPointLightDiffuseColors",this.pointLightDiffuseColors),e.setUniform("uPointLightSpecularColors",this.pointLightSpecularColors);var r=this.directionalLightDiffuseColors.length/3;e.setUniform("uDirectionalLightCount",r),e.setUniform("uLightingDirection",this.directionalLightDirections),e.setUniform("uDirectionalDiffuseColors",this.directionalLightDiffuseColors),e.setUniform("uDirectionalSpecularColors",this.directionalLightSpecularColors);var i=this.ambientLightColors.length/3;e.setUniform("uAmbientLightCount",i),e.setUniform("uAmbientColor",this.ambientLightColors);var n=this.spotLightDiffuseColors.length/3;e.setUniform("uSpotLightCount",n),e.setUniform("uSpotLightAngle",this.spotLightAngle),e.setUniform("uSpotLightConc",this.spotLightConc),e.setUniform("uSpotLightDiffuseColors",this.spotLightDiffuseColors),e.setUniform("uSpotLightSpecularColors",this.spotLightSpecularColors),e.setUniform("uSpotLightLocation",this.spotLightPositions),e.setUniform("uSpotLightDirection",this.spotLightDirections),e.setUniform("uConstantAttenuation",this.constantAttenuation),e.setUniform("uLinearAttenuation",this.linearAttenuation),e.setUniform("uQuadraticAttenuation",this.quadraticAttenuation),e.bindTextures()},u.default.RendererGL.prototype._setPointUniforms=function(e){e.bindShader(),e.setUniform("uMaterialColor",this.curStrokeColor),e.setUniform("uPointSize",this.pointSize)},u.default.RendererGL.prototype._bindBuffer=function(e,t,r,i,n){if(t=t||this.GL.ARRAY_BUFFER,this.GL.bindBuffer(t,e),void 0!==r){var o=new(i||Float32Array)(r);this.GL.bufferData(t,o,n||this.GL.STATIC_DRAW)}},u.default.RendererGL.prototype._arraysEqual=function(e,t){var r=e.length;if(r!==t.length)return!1;for(var i=0;i>7,127&f,c>>7,127&c);for(var d=0;d>7,127&p,0,0)}}return{cellImageInfo:l,dimOffset:o,dimImageInfo:n}}return(t=this.glyphInfos[e.index]={glyph:e,uGlyphRect:[i.x1,-i.y1,i.x2,-i.y2],strokeImageInfo:U,strokes:d,colInfo:G(m,this.colDimImageInfos,this.colCellImageInfos),rowInfo:G(p,this.rowDimImageInfos,this.rowCellImageInfos)}).uGridOffset=[t.colInfo.dimOffset,t.rowInfo.dimOffset],t}}var z=Math.sqrt(3);j.default.RendererGL.prototype._renderText=function(e,t,r,i,n){if(this._textFont&&"string"!=typeof this._textFont){if(!(n<=i)&&this._doFill){if(!this._isOpenType())return console.log("WEBGL: only Opentype (.otf) and Truetype (.ttf) fonts are supported"),e;e.push();var o=this._doStroke,a=this.drawMode;this._doStroke=!1,this.drawMode=D.TEXTURE;var s=this._textFont.font,l=this._textFont._fontInfo;l=l||(this._textFont._fontInfo=new A(s));var u=this._textFont._handleAlignment(this,t,r,i),h=this._textSize/s.unitsPerEm;this.translate(u.x,u.y,0),this.scale(h,h,1);var c=this.GL,f=!this._defaultFontShader,d=this._getFontShader();d.init(),d.bindShader(),f&&(d.setUniform("uGridImageSize",[64,64]),d.setUniform("uCellsImageSize",[64,64]),d.setUniform("uStrokeImageSize",[64,64]),d.setUniform("uGridSize",[9,9])),this._applyColorBlend(this.curFillColor);var p=this.retainedMode.geometry.glyph;if(!p){var m=this._textGeom=new j.default.Geometry(1,1,function(){for(var e=0;e<=1;e++)for(var t=0;t<=1;t++)this.vertices.push(new j.default.Vector(t,e,0)),this.uvs.push(t,e)});m.computeFaces().computeNormals(),p=this.createBuffers("glyph",m)}var g=!0,v=!1,y=void 0;try{for(var b,_=this.retainedMode.buffers.text[Symbol.iterator]();!(g=(b=_.next()).done);g=!0){b.value._prepareBuffer(p,d)}}catch(e){v=!0,y=e}finally{try{g||null==_.return||_.return()}finally{if(v)throw y}}this._bindBuffer(p.indexBuffer,c.ELEMENT_ARRAY_BUFFER),d.setUniform("uMaterialColor",this.curFillColor);try{var x=0,w=null,S=s.stringToGlyphs(t),M=!0,E=!1,T=void 0;try{for(var C,P=S[Symbol.iterator]();!(M=(C=P.next()).done);M=!0){var L=C.value;w&&(x+=s.getKerningValue(w,L));var k=l.getGlyphInfo(L);if(k.uGlyphRect){var R=k.rowInfo,O=k.colInfo;d.setUniform("uSamplerStrokes",k.strokeImageInfo.imageData),d.setUniform("uSamplerRowStrokes",R.cellImageInfo.imageData),d.setUniform("uSamplerRows",R.dimImageInfo.imageData),d.setUniform("uSamplerColStrokes",O.cellImageInfo.imageData),d.setUniform("uSamplerCols",O.dimImageInfo.imageData),d.setUniform("uGridOffset",k.uGridOffset),d.setUniform("uGlyphRect",k.uGlyphRect),d.setUniform("uGlyphOffset",x),d.bindTextures(),c.drawElements(c.TRIANGLES,6,this.GL.UNSIGNED_SHORT,0)}x+=L.advanceWidth,w=L}}catch(e){E=!0,T=e}finally{try{M||null==P.return||P.return()}finally{if(E)throw T}}}finally{d.unbindShader(),this._doStroke=o,this.drawMode=a,e.pop()}return e}}else console.log("WEBGL: you must load and set a font before drawing text. See `loadFont` and `textFont` for more details.")}},{"../core/constants":42,"../core/main":49,"./p5.RendererGL.Retained":102,"./p5.Shader":104}],107:[function(e,t,r){t.exports={fes:{autoplay:"The media that tried to play (with '{{src}}') wasn't allowed to by this browser, most likely due to the browser's autoplay policy. Check out {{link}} for more information about why.",fileLoadError:{bytes:"It looks like there was a problem loading your file. {{suggestion}}",font:"It looks like there was a problem loading your font. {{suggestion}}",gif:"There was some trouble loading your GIF. Make sure that your GIF is using 87a or 89a encoding.",image:"It looks like there was a problem loading your image. {{suggestion}}",json:"It looks like there was a problem loading your JSON file. {{suggestion}}",large:"If your large file isn't fetched successfully, we recommend splitting the file into smaller segments and fetching those.",strings:"It looks like there was a problem loading your text file. {{suggestion}}",suggestion:"Try checking if the file path ({{filePath}}) is correct, hosting the file online, or running a local server. (More info at {{link}})",table:"It looks like there was a problem loading your table file. {{suggestion}}",xml:"It looks like there was a problem loading your XML file. {{suggestion}}"},misusedTopLevel:"Did you just try to use p5.js's {{symbolName}} {{symbolType}}? If so, you may want to move it into your sketch's setup() function.\n\nFor more details, see: {{link}}",pre:"🌸 p5.js says: {{message}}",welcome:"Welcome! This is your friendly debugger. To turn me off, switch to using p5.min.js."}}},{}],108:[function(e,t,r){t.exports={fes:{autoplay:"Su browser impidío un medio tocar (de '{{src}}'), posiblemente porque las reglas de autoplay. Para aprender más, visite {{link}}.",fileLoadError:{bytes:"",font:"",gif:"",image:"",json:"",large:"",strings:"",suggestion:"",table:"",xml:""},misusedTopLevel:"",pre:"🌸 p5.js dice: {{message}}",welcome:""}}},{}],109:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i=o(e("./en/translation")),n=o(e("./es/translation"));function o(e){return e&&e.__esModule?e:{default:e}}var a={en:{translation:i.default},es:{translation:n.default}};r.default=a},{"./en/translation":107,"./es/translation":108}]},{},[37])(37)}); ================================================ FILE: docs/examples/transcrypt/sketch_001/target/org.transcrypt.__runtime__.js ================================================ // Transcrypt'ed from Python, 2021-11-02 13:06:08 var __name__ = 'org.transcrypt.__runtime__'; export var __envir__ = {}; __envir__.interpreter_name = 'python'; __envir__.transpiler_name = 'transcrypt'; __envir__.executor_name = __envir__.transpiler_name; __envir__.transpiler_version = '3.9.0'; export function __nest__ (headObject, tailNames, value) { var current = headObject; if (tailNames != '') { var tailChain = tailNames.split ('.'); var firstNewIndex = tailChain.length; for (var index = 0; index < tailChain.length; index++) { if (!current.hasOwnProperty (tailChain [index])) { firstNewIndex = index; break; } current = current [tailChain [index]]; } for (var index = firstNewIndex; index < tailChain.length; index++) { current [tailChain [index]] = {}; current = current [tailChain [index]]; } } for (let attrib of Object.getOwnPropertyNames (value)) { Object.defineProperty (current, attrib, { get () {return value [attrib];}, enumerable: true, configurable: true }); } }; export function __init__ (module) { if (!module.__inited__) { module.__all__.__init__ (module.__all__); module.__inited__ = true; } return module.__all__; }; export function __get__ (aThis, func, quotedFuncName) { if (aThis) { if (aThis.hasOwnProperty ('__class__') || typeof aThis == 'string' || aThis instanceof String) { if (quotedFuncName) { Object.defineProperty (aThis, quotedFuncName, { value: function () { var args = [] .slice.apply (arguments); return func.apply (null, [aThis] .concat (args)); }, writable: true, enumerable: true, configurable: true }); } return function () { var args = [] .slice.apply (arguments); return func.apply (null, [aThis.__proxy__ ? aThis.__proxy__ : aThis] .concat (args)); }; } else { return func; } } else { return func; } }; export function __getcm__ (aThis, func, quotedFuncName) { if (aThis.hasOwnProperty ('__class__')) { return function () { var args = [] .slice.apply (arguments); return func.apply (null, [aThis.__class__] .concat (args)); }; } else { return function () { var args = [] .slice.apply (arguments); return func.apply (null, [aThis] .concat (args)); }; } }; export function __getsm__ (aThis, func, quotedFuncName) { return func; }; export var py_metatype = { __name__: 'type', __bases__: [], __new__: function (meta, name, bases, attribs) { var cls = function () { var args = [] .slice.apply (arguments); return cls.__new__ (args); }; for (var index = bases.length - 1; index >= 0; index--) { var base = bases [index]; for (var attrib in base) { var descrip = Object.getOwnPropertyDescriptor (base, attrib); if (descrip == null) { continue; } Object.defineProperty (cls, attrib, descrip); } for (let symbol of Object.getOwnPropertySymbols (base)) { let descrip = Object.getOwnPropertyDescriptor (base, symbol); Object.defineProperty (cls, symbol, descrip); } } cls.__metaclass__ = meta; cls.__name__ = name.startsWith ('py_') ? name.slice (3) : name; cls.__bases__ = bases; for (var attrib in attribs) { var descrip = Object.getOwnPropertyDescriptor (attribs, attrib); Object.defineProperty (cls, attrib, descrip); } for (let symbol of Object.getOwnPropertySymbols (attribs)) { let descrip = Object.getOwnPropertyDescriptor (attribs, symbol); Object.defineProperty (cls, symbol, descrip); } return cls; } }; py_metatype.__metaclass__ = py_metatype; export var object = { __init__: function (self) {}, __metaclass__: py_metatype, __name__: 'object', __bases__: [], __new__: function (args) { var instance = Object.create (this, {__class__: {value: this, enumerable: true}}); if ('__getattr__' in this || '__setattr__' in this) { instance.__proxy__ = new Proxy (instance, { get: function (target, name) { let result = target [name]; if (result == undefined) { return target.__getattr__ (name); } else { return result; } }, set: function (target, name, value) { try { target.__setattr__ (name, value); } catch (exception) { target [name] = value; } return true; } }) instance = instance.__proxy__ } this.__init__.apply (null, [instance] .concat (args)); return instance; } }; export function __class__ (name, bases, attribs, meta) { if (meta === undefined) { meta = bases [0] .__metaclass__; } return meta.__new__ (meta, name, bases, attribs); }; export function __pragma__ () {}; export function __call__ (/* , , * */) { var args = [] .slice.apply (arguments); if (typeof args [0] == 'object' && '__call__' in args [0]) { return args [0] .__call__ .apply (args [1], args.slice (2)); } else { return args [0] .apply (args [1], args.slice (2)); } }; __envir__.executor_name = __envir__.transpiler_name; var __main__ = {__file__: ''}; var __except__ = null; export function __kwargtrans__ (anObject) { anObject.__kwargtrans__ = null; anObject.constructor = Object; return anObject; } export function __super__ (aClass, methodName) { for (let base of aClass.__bases__) { if (methodName in base) { return base [methodName]; } } throw new Exception ('Superclass method not found'); } export function property (getter, setter) { if (!setter) { setter = function () {}; } return {get: function () {return getter (this)}, set: function (value) {setter (this, value)}, enumerable: true}; } export function __setproperty__ (anObject, name, descriptor) { if (!anObject.hasOwnProperty (name)) { Object.defineProperty (anObject, name, descriptor); } } export function assert (condition, message) { if (!condition) { throw AssertionError (message, new Error ()); } } export function __mergekwargtrans__ (object0, object1) { var result = {}; for (var attrib in object0) { result [attrib] = object0 [attrib]; } for (var attrib in object1) { result [attrib] = object1 [attrib]; } return result; }; export function __mergefields__ (targetClass, sourceClass) { let fieldNames = ['__reprfields__', '__comparefields__', '__initfields__'] if (sourceClass [fieldNames [0]]) { if (targetClass [fieldNames [0]]) { for (let fieldName of fieldNames) { targetClass [fieldName] = new Set ([...targetClass [fieldName], ...sourceClass [fieldName]]); } } else { for (let fieldName of fieldNames) { targetClass [fieldName] = new Set (sourceClass [fieldName]); } } } } export function __withblock__ (manager, statements) { if (hasattr (manager, '__enter__')) { try { manager.__enter__ (); statements (); manager.__exit__ (); } catch (exception) { if (! (manager.__exit__ (exception.name, exception, exception.stack))) { throw exception; } } } else { statements (); manager.close (); } }; export function dir (obj) { var aList = []; for (var aKey in obj) { aList.push (aKey.startsWith ('py_') ? aKey.slice (3) : aKey); } aList.sort (); return aList; }; export function setattr (obj, name, value) { obj [name] = value; }; export function getattr (obj, name) { return name in obj ? obj [name] : obj ['py_' + name]; }; export function hasattr (obj, name) { try { return name in obj || 'py_' + name in obj; } catch (exception) { return false; } }; export function delattr (obj, name) { if (name in obj) { delete obj [name]; } else { delete obj ['py_' + name]; } }; export function __in__ (element, container) { if (container === undefined || container === null) { return false; } if (container.__contains__ instanceof Function) { return container.__contains__ (element); } else { return ( container.indexOf ? container.indexOf (element) > -1 : container.hasOwnProperty (element) ); } }; export function __specialattrib__ (attrib) { return (attrib.startswith ('__') && attrib.endswith ('__')) || attrib == 'constructor' || attrib.startswith ('py_'); }; export function len (anObject) { if (anObject === undefined || anObject === null) { return 0; } if (anObject.__len__ instanceof Function) { return anObject.__len__ (); } if (anObject.length !== undefined) { return anObject.length; } var length = 0; for (var attr in anObject) { if (!__specialattrib__ (attr)) { length++; } } return length; }; export function __i__ (any) { return py_typeof (any) == dict ? any.py_keys () : any; } export function __k__ (keyed, key) { var result = keyed [key]; if (typeof result == 'undefined') { if (keyed instanceof Array) if (key == +key && key >= 0 && keyed.length > key) return result; else throw IndexError (key, new Error()); else throw KeyError (key, new Error()); } return result; } export function __t__ (target) { return ( target === undefined || target === null ? false : ['boolean', 'number'] .indexOf (typeof target) >= 0 ? target : target.__bool__ instanceof Function ? (target.__bool__ () ? target : false) : target.__len__ instanceof Function ? (target.__len__ () !== 0 ? target : false) : target instanceof Function ? target : len (target) !== 0 ? target : false ); } export function float (any) { if (any == 'inf') { return Infinity; } else if (any == '-inf') { return -Infinity; } else if (any == 'nan') { return NaN; } else if (isNaN (parseFloat (any))) { if (any === false) { return 0; } else if (any === true) { return 1; } else { throw ValueError ("could not convert string to float: '" + str(any) + "'", new Error ()); } } else { return +any; } }; float.__name__ = 'float'; float.__bases__ = [object]; export function int (any) { return float (any) | 0 }; int.__name__ = 'int'; int.__bases__ = [object]; export function bool (any) { return !!__t__ (any); }; bool.__name__ = 'bool'; bool.__bases__ = [int]; export function py_typeof (anObject) { var aType = typeof anObject; if (aType == 'object') { try { return '__class__' in anObject ? anObject.__class__ : object; } catch (exception) { return aType; } } else { return ( aType == 'boolean' ? bool : aType == 'string' ? str : aType == 'number' ? (anObject % 1 == 0 ? int : float) : null ); } }; export function issubclass (aClass, classinfo) { if (classinfo instanceof Array) { for (let aClass2 of classinfo) { if (issubclass (aClass, aClass2)) { return true; } } return false; } try { var aClass2 = aClass; if (aClass2 == classinfo) { return true; } else { var bases = [].slice.call (aClass2.__bases__); while (bases.length) { aClass2 = bases.shift (); if (aClass2 == classinfo) { return true; } if (aClass2.__bases__.length) { bases = [].slice.call (aClass2.__bases__).concat (bases); } } return false; } } catch (exception) { return aClass == classinfo || classinfo == object; } }; export function isinstance (anObject, classinfo) { try { return '__class__' in anObject ? issubclass (anObject.__class__, classinfo) : issubclass (py_typeof (anObject), classinfo); } catch (exception) { return issubclass (py_typeof (anObject), classinfo); } }; export function callable (anObject) { return anObject && typeof anObject == 'object' && '__call__' in anObject ? true : typeof anObject === 'function'; }; export function repr (anObject) { try { return anObject.__repr__ (); } catch (exception) { try { return anObject.__str__ (); } catch (exception) { try { if (anObject == null) { return 'None'; } else if (anObject.constructor == Object) { var result = '{'; var comma = false; for (var attrib in anObject) { if (!__specialattrib__ (attrib)) { if (attrib.isnumeric ()) { var attribRepr = attrib; } else { var attribRepr = '\'' + attrib + '\''; } if (comma) { result += ', '; } else { comma = true; } result += attribRepr + ': ' + repr (anObject [attrib]); } } result += '}'; return result; } else { return typeof anObject == 'boolean' ? anObject.toString () .capitalize () : anObject.toString (); } } catch (exception) { return ''; } } } }; export function chr (charCode) { return String.fromCharCode (charCode); }; export function ord (aChar) { return aChar.charCodeAt (0); }; export function max (nrOrSeq) { return arguments.length == 1 ? Math.max (...nrOrSeq) : Math.max (...arguments); }; export function min (nrOrSeq) { return arguments.length == 1 ? Math.min (...nrOrSeq) : Math.min (...arguments); }; export var abs = Math.abs; export function round (number, ndigits) { if (ndigits) { var scale = Math.pow (10, ndigits); number *= scale; } var rounded = Math.round (number); if (rounded - number == 0.5 && rounded % 2) { rounded -= 1; } if (ndigits) { rounded /= scale; } return rounded; }; export function __jsUsePyNext__ () { try { var result = this.__next__ (); return {value: result, done: false}; } catch (exception) { return {value: undefined, done: true}; } } export function __pyUseJsNext__ () { var result = this.next (); if (result.done) { throw StopIteration (new Error ()); } else { return result.value; } } export function py_iter (iterable) { if (typeof iterable == 'string' || '__iter__' in iterable) { var result = iterable.__iter__ (); result.next = __jsUsePyNext__; } else if ('selector' in iterable) { var result = list (iterable) .__iter__ (); result.next = __jsUsePyNext__; } else if ('next' in iterable) { var result = iterable if (! ('__next__' in result)) { result.__next__ = __pyUseJsNext__; } } else if (Symbol.iterator in iterable) { var result = iterable [Symbol.iterator] (); result.__next__ = __pyUseJsNext__; } else { throw IterableError (new Error ()); } result [Symbol.iterator] = function () {return result;}; return result; } export function py_next (iterator) { try { var result = iterator.__next__ (); } catch (exception) { var result = iterator.next (); if (result.done) { throw StopIteration (new Error ()); } else { return result.value; } } if (result == undefined) { throw StopIteration (new Error ()); } else { return result; } } export function __PyIterator__ (iterable) { this.iterable = iterable; this.index = 0; } __PyIterator__.prototype.__next__ = function() { if (this.index < this.iterable.length) { return this.iterable [this.index++]; } else { throw StopIteration (new Error ()); } }; export function __JsIterator__ (iterable) { this.iterable = iterable; this.index = 0; } __JsIterator__.prototype.next = function () { if (this.index < this.iterable.py_keys.length) { return {value: this.index++, done: false}; } else { return {value: undefined, done: true}; } }; export function py_reversed (iterable) { iterable = iterable.slice (); iterable.reverse (); return iterable; }; export function zip () { var args = [] .slice.call (arguments); for (var i = 0; i < args.length; i++) { if (typeof args [i] == 'string') { args [i] = args [i] .split (''); } else if (!Array.isArray (args [i])) { args [i] = Array.from (args [i]); } } var shortest = args.length == 0 ? [] : args.reduce ( function (array0, array1) { return array0.length < array1.length ? array0 : array1; } ); return shortest.map ( function (current, index) { return args.map ( function (current) { return current [index]; } ); } ); }; export function range (start, stop, step) { if (stop == undefined) { stop = start; start = 0; } if (step == undefined) { step = 1; } if ((step > 0 && start >= stop) || (step < 0 && start <= stop)) { return []; } var result = []; for (var i = start; step > 0 ? i < stop : i > stop; i += step) { result.push(i); } return result; }; export function any (iterable) { for (let item of iterable) { if (bool (item)) { return true; } } return false; } export function all (iterable) { for (let item of iterable) { if (! bool (item)) { return false; } } return true; } export function sum (iterable) { let result = 0; for (let item of iterable) { result += item; } return result; } export function enumerate (iterable) { return zip (range (len (iterable)), iterable); } export function copy (anObject) { if (anObject == null || typeof anObject == "object") { return anObject; } else { var result = {}; for (var attrib in obj) { if (anObject.hasOwnProperty (attrib)) { result [attrib] = anObject [attrib]; } } return result; } } export function deepcopy (anObject) { if (anObject == null || typeof anObject == "object") { return anObject; } else { var result = {}; for (var attrib in obj) { if (anObject.hasOwnProperty (attrib)) { result [attrib] = deepcopy (anObject [attrib]); } } return result; } } export function list (iterable) { let instance = iterable ? Array.from (iterable) : []; return instance; } Array.prototype.__class__ = list; list.__name__ = 'list'; list.__bases__ = [object]; Array.prototype.__iter__ = function () {return new __PyIterator__ (this);}; Array.prototype.__getslice__ = function (start, stop, step) { if (start < 0) { start = this.length + start; } if (stop == null) { stop = this.length; } else if (stop < 0) { stop = this.length + stop; } else if (stop > this.length) { stop = this.length; } if (step == 1) { return Array.prototype.slice.call(this, start, stop); } let result = list ([]); for (let index = start; index < stop; index += step) { result.push (this [index]); } return result; }; Array.prototype.__setslice__ = function (start, stop, step, source) { if (start < 0) { start = this.length + start; } if (stop == null) { stop = this.length; } else if (stop < 0) { stop = this.length + stop; } if (step == null) { Array.prototype.splice.apply (this, [start, stop - start] .concat (source)); } else { let sourceIndex = 0; for (let targetIndex = start; targetIndex < stop; targetIndex += step) { this [targetIndex] = source [sourceIndex++]; } } }; Array.prototype.__repr__ = function () { if (this.__class__ == set && !this.length) { return 'set()'; } let result = !this.__class__ || this.__class__ == list ? '[' : this.__class__ == tuple ? '(' : '{'; for (let index = 0; index < this.length; index++) { if (index) { result += ', '; } result += repr (this [index]); } if (this.__class__ == tuple && this.length == 1) { result += ','; } result += !this.__class__ || this.__class__ == list ? ']' : this.__class__ == tuple ? ')' : '}';; return result; }; Array.prototype.__str__ = Array.prototype.__repr__; Array.prototype.append = function (element) { this.push (element); }; Array.prototype.py_clear = function () { this.length = 0; }; Array.prototype.extend = function (aList) { this.push.apply (this, aList); }; Array.prototype.insert = function (index, element) { this.splice (index, 0, element); }; Array.prototype.remove = function (element) { let index = this.indexOf (element); if (index == -1) { throw ValueError ("list.remove(x): x not in list", new Error ()); } this.splice (index, 1); }; Array.prototype.index = function (element) { return this.indexOf (element); }; Array.prototype.py_pop = function (index) { if (index == undefined) { return this.pop (); } else { return this.splice (index, 1) [0]; } }; Array.prototype.py_sort = function () { __sort__.apply (null, [this].concat ([] .slice.apply (arguments))); }; Array.prototype.__add__ = function (aList) { return list (this.concat (aList)); }; Array.prototype.__mul__ = function (scalar) { let result = this; for (let i = 1; i < scalar; i++) { result = result.concat (this); } return result; }; Array.prototype.__rmul__ = Array.prototype.__mul__; export function tuple (iterable) { let instance = iterable ? [] .slice.apply (iterable) : []; instance.__class__ = tuple; return instance; } tuple.__name__ = 'tuple'; tuple.__bases__ = [object]; export function set (iterable) { let instance = []; if (iterable) { for (let index = 0; index < iterable.length; index++) { instance.add (iterable [index]); } } instance.__class__ = set; return instance; } set.__name__ = 'set'; set.__bases__ = [object]; Array.prototype.__bindexOf__ = function (element) { element += ''; let mindex = 0; let maxdex = this.length - 1; while (mindex <= maxdex) { let index = (mindex + maxdex) / 2 | 0; let middle = this [index] + ''; if (middle < element) { mindex = index + 1; } else if (middle > element) { maxdex = index - 1; } else { return index; } } return -1; }; Array.prototype.add = function (element) { if (this.indexOf (element) == -1) { this.push (element); } }; Array.prototype.discard = function (element) { var index = this.indexOf (element); if (index != -1) { this.splice (index, 1); } }; Array.prototype.isdisjoint = function (other) { this.sort (); for (let i = 0; i < other.length; i++) { if (this.__bindexOf__ (other [i]) != -1) { return false; } } return true; }; Array.prototype.issuperset = function (other) { this.sort (); for (let i = 0; i < other.length; i++) { if (this.__bindexOf__ (other [i]) == -1) { return false; } } return true; }; Array.prototype.issubset = function (other) { return set (other.slice ()) .issuperset (this); }; Array.prototype.union = function (other) { let result = set (this.slice () .sort ()); for (let i = 0; i < other.length; i++) { if (result.__bindexOf__ (other [i]) == -1) { result.push (other [i]); } } return result; }; Array.prototype.intersection = function (other) { this.sort (); let result = set (); for (let i = 0; i < other.length; i++) { if (this.__bindexOf__ (other [i]) != -1) { result.push (other [i]); } } return result; }; Array.prototype.difference = function (other) { let sother = set (other.slice () .sort ()); let result = set (); for (let i = 0; i < this.length; i++) { if (sother.__bindexOf__ (this [i]) == -1) { result.push (this [i]); } } return result; }; Array.prototype.symmetric_difference = function (other) { return this.union (other) .difference (this.intersection (other)); }; Array.prototype.py_update = function () { let updated = [] .concat.apply (this.slice (), arguments) .sort (); this.py_clear (); for (let i = 0; i < updated.length; i++) { if (updated [i] != updated [i - 1]) { this.push (updated [i]); } } }; Array.prototype.__eq__ = function (other) { if (this.length != other.length) { return false; } if (this.__class__ == set) { this.sort (); other.sort (); } for (let i = 0; i < this.length; i++) { if (this [i] != other [i]) { return false; } } return true; }; Array.prototype.__ne__ = function (other) { return !this.__eq__ (other); }; Array.prototype.__le__ = function (other) { if (this.__class__ == set) { return this.issubset (other); } else { for (let i = 0; i < this.length; i++) { if (this [i] > other [i]) { return false; } else if (this [i] < other [i]) { return true; } } return true; } }; Array.prototype.__ge__ = function (other) { if (this.__class__ == set) { return this.issuperset (other); } else { for (let i = 0; i < this.length; i++) { if (this [i] < other [i]) { return false; } else if (this [i] > other [i]) { return true; } } return true; } }; Array.prototype.__lt__ = function (other) { return ( this.__class__ == set ? this.issubset (other) && !this.issuperset (other) : !this.__ge__ (other) ); }; Array.prototype.__gt__ = function (other) { return ( this.__class__ == set ? this.issuperset (other) && !this.issubset (other) : !this.__le__ (other) ); }; export function bytearray (bytable, encoding) { if (bytable == undefined) { return new Uint8Array (0); } else { let aType = py_typeof (bytable); if (aType == int) { return new Uint8Array (bytable); } else if (aType == str) { let aBytes = new Uint8Array (len (bytable)); for (let i = 0; i < len (bytable); i++) { aBytes [i] = bytable.charCodeAt (i); } return aBytes; } else if (aType == list || aType == tuple) { return new Uint8Array (bytable); } else { throw py_TypeError; } } } export var bytes = bytearray; Uint8Array.prototype.__add__ = function (aBytes) { let result = new Uint8Array (this.length + aBytes.length); result.set (this); result.set (aBytes, this.length); return result; }; Uint8Array.prototype.__mul__ = function (scalar) { let result = new Uint8Array (scalar * this.length); for (let i = 0; i < scalar; i++) { result.set (this, i * this.length); } return result; }; Uint8Array.prototype.__rmul__ = Uint8Array.prototype.__mul__; export function str (stringable) { if (typeof stringable === 'number') return stringable.toString(); else { try { return stringable.__str__ (); } catch (exception) { try { return repr (stringable); } catch (exception) { return String (stringable); } } } }; String.prototype.__class__ = str; str.__name__ = 'str'; str.__bases__ = [object]; String.prototype.__iter__ = function () {new __PyIterator__ (this);}; String.prototype.__repr__ = function () { return (this.indexOf ('\'') == -1 ? '\'' + this + '\'' : '"' + this + '"') .py_replace ('\t', '\\t') .py_replace ('\n', '\\n'); }; String.prototype.__str__ = function () { return this; }; String.prototype.capitalize = function () { return this.charAt (0).toUpperCase () + this.slice (1); }; String.prototype.endswith = function (suffix) { if (suffix instanceof Array) { for (var i=0;i> b; } }; export function __or__ (a, b) { if (typeof a == 'object' && '__or__' in a) { return a.__or__ (b); } else if (typeof b == 'object' && '__ror__' in b) { return b.__ror__ (a); } else { return a | b; } }; export function __xor__ (a, b) { if (typeof a == 'object' && '__xor__' in a) { return a.__xor__ (b); } else if (typeof b == 'object' && '__rxor__' in b) { return b.__rxor__ (a); } else { return a ^ b; } }; export function __and__ (a, b) { if (typeof a == 'object' && '__and__' in a) { return a.__and__ (b); } else if (typeof b == 'object' && '__rand__' in b) { return b.__rand__ (a); } else { return a & b; } }; export function __eq__ (a, b) { if (typeof a == 'object' && '__eq__' in a) { return a.__eq__ (b); } else { return a == b; } }; export function __ne__ (a, b) { if (typeof a == 'object' && '__ne__' in a) { return a.__ne__ (b); } else { return a != b } }; export function __lt__ (a, b) { if (typeof a == 'object' && '__lt__' in a) { return a.__lt__ (b); } else { return a < b; } }; export function __le__ (a, b) { if (typeof a == 'object' && '__le__' in a) { return a.__le__ (b); } else { return a <= b; } }; export function __gt__ (a, b) { if (typeof a == 'object' && '__gt__' in a) { return a.__gt__ (b); } else { return a > b; } }; export function __ge__ (a, b) { if (typeof a == 'object' && '__ge__' in a) { return a.__ge__ (b); } else { return a >= b; } }; export function __imatmul__ (a, b) { if ('__imatmul__' in a) { return a.__imatmul__ (b); } else { return a.__matmul__ (b); } }; export function __ipow__ (a, b) { if (typeof a == 'object' && '__pow__' in a) { return a.__ipow__ (b); } else if (typeof a == 'object' && '__ipow__' in a) { return a.__pow__ (b); } else if (typeof b == 'object' && '__rpow__' in b) { return b.__rpow__ (a); } else { return Math.pow (a, b); } }; export function __ijsmod__ (a, b) { if (typeof a == 'object' && '__imod__' in a) { return a.__ismod__ (b); } else if (typeof a == 'object' && '__mod__' in a) { return a.__mod__ (b); } else if (typeof b == 'object' && '__rpow__' in b) { return b.__rmod__ (a); } else { return a % b; } }; export function __imod__ (a, b) { if (typeof a == 'object' && '__imod__' in a) { return a.__imod__ (b); } else if (typeof a == 'object' && '__mod__' in a) { return a.__mod__ (b); } else if (typeof b == 'object' && '__rmod__' in b) { return b.__rmod__ (a); } else { return ((a % b) + b) % b; } }; export function __imul__ (a, b) { if (typeof a == 'object' && '__imul__' in a) { return a.__imul__ (b); } else if (typeof a == 'object' && '__mul__' in a) { return a = a.__mul__ (b); } else if (typeof b == 'object' && '__rmul__' in b) { return a = b.__rmul__ (a); } else if (typeof a == 'string') { return a = a.__mul__ (b); } else if (typeof b == 'string') { return a = b.__rmul__ (a); } else { return a *= b; } }; export function __idiv__ (a, b) { if (typeof a == 'object' && '__idiv__' in a) { return a.__idiv__ (b); } else if (typeof a == 'object' && '__div__' in a) { return a = a.__div__ (b); } else if (typeof b == 'object' && '__rdiv__' in b) { return a = b.__rdiv__ (a); } else { return a /= b; } }; export function __iadd__ (a, b) { if (typeof a == 'object' && '__iadd__' in a) { return a.__iadd__ (b); } else if (typeof a == 'object' && '__add__' in a) { return a = a.__add__ (b); } else if (typeof b == 'object' && '__radd__' in b) { return a = b.__radd__ (a); } else { return a += b; } }; export function __isub__ (a, b) { if (typeof a == 'object' && '__isub__' in a) { return a.__isub__ (b); } else if (typeof a == 'object' && '__sub__' in a) { return a = a.__sub__ (b); } else if (typeof b == 'object' && '__rsub__' in b) { return a = b.__rsub__ (a); } else { return a -= b; } }; export function __ilshift__ (a, b) { if (typeof a == 'object' && '__ilshift__' in a) { return a.__ilshift__ (b); } else if (typeof a == 'object' && '__lshift__' in a) { return a = a.__lshift__ (b); } else if (typeof b == 'object' && '__rlshift__' in b) { return a = b.__rlshift__ (a); } else { return a <<= b; } }; export function __irshift__ (a, b) { if (typeof a == 'object' && '__irshift__' in a) { return a.__irshift__ (b); } else if (typeof a == 'object' && '__rshift__' in a) { return a = a.__rshift__ (b); } else if (typeof b == 'object' && '__rrshift__' in b) { return a = b.__rrshift__ (a); } else { return a >>= b; } }; export function __ior__ (a, b) { if (typeof a == 'object' && '__ior__' in a) { return a.__ior__ (b); } else if (typeof a == 'object' && '__or__' in a) { return a = a.__or__ (b); } else if (typeof b == 'object' && '__ror__' in b) { return a = b.__ror__ (a); } else { return a |= b; } }; export function __ixor__ (a, b) { if (typeof a == 'object' && '__ixor__' in a) { return a.__ixor__ (b); } else if (typeof a == 'object' && '__xor__' in a) { return a = a.__xor__ (b); } else if (typeof b == 'object' && '__rxor__' in b) { return a = b.__rxor__ (a); } else { return a ^= b; } }; export function __iand__ (a, b) { if (typeof a == 'object' && '__iand__' in a) { return a.__iand__ (b); } else if (typeof a == 'object' && '__and__' in a) { return a = a.__and__ (b); } else if (typeof b == 'object' && '__rand__' in b) { return a = b.__rand__ (a); } else { return a &= b; } }; export function __getitem__ (container, key) { if (typeof container == 'object' && '__getitem__' in container) { return container.__getitem__ (key); } else if ((typeof container == 'string' || container instanceof Array) && key < 0) { return container [container.length + key]; } else { return container [key]; } }; export function __setitem__ (container, key, value) { if (typeof container == 'object' && '__setitem__' in container) { container.__setitem__ (key, value); } else if ((typeof container == 'string' || container instanceof Array) && key < 0) { container [container.length + key] = value; } else { container [key] = value; } }; export function __getslice__ (container, lower, upper, step) { if (typeof container == 'object' && '__getitem__' in container) { return container.__getitem__ ([lower, upper, step]); } else { return container.__getslice__ (lower, upper, step); } }; export function __setslice__ (container, lower, upper, step, value) { if (typeof container == 'object' && '__setitem__' in container) { container.__setitem__ ([lower, upper, step], value); } else { container.__setslice__ (lower, upper, step, value); } }; export var BaseException = __class__ ('BaseException', [object], { __module__: __name__, }); export var Exception = __class__ ('Exception', [BaseException], { __module__: __name__, get __init__ () {return __get__ (this, function (self) { var kwargs = dict (); if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'self': var self = __allkwargs0__ [__attrib0__]; break; default: kwargs [__attrib0__] = __allkwargs0__ [__attrib0__]; } } delete kwargs.__kwargtrans__; } var args = tuple ([].slice.apply (arguments).slice (1, __ilastarg0__ + 1)); } else { var args = tuple (); } self.__args__ = args; if (kwargs.error != null) { self.stack = kwargs.error.stack; } else if (Error) { self.stack = new Error ().stack; } else { self.stack = 'No stack trace available'; } });}, get __repr__ () {return __get__ (this, function (self) { if (len (self.__args__) > 1) { return '{}{}'.format (self.__class__.__name__, repr (tuple (self.__args__))); } else if (len (self.__args__)) { return '{}({})'.format (self.__class__.__name__, repr (self.__args__ [0])); } else { return '{}()'.format (self.__class__.__name__); } });}, get __str__ () {return __get__ (this, function (self) { if (len (self.__args__) > 1) { return str (tuple (self.__args__)); } else if (len (self.__args__)) { return str (self.__args__ [0]); } else { return ''; } });} }); export var IterableError = __class__ ('IterableError', [Exception], { __module__: __name__, get __init__ () {return __get__ (this, function (self, error) { Exception.__init__ (self, "Can't iterate over non-iterable", __kwargtrans__ ({error: error})); });} }); export var StopIteration = __class__ ('StopIteration', [Exception], { __module__: __name__, get __init__ () {return __get__ (this, function (self, error) { Exception.__init__ (self, 'Iterator exhausted', __kwargtrans__ ({error: error})); });} }); export var ValueError = __class__ ('ValueError', [Exception], { __module__: __name__, get __init__ () {return __get__ (this, function (self, message, error) { Exception.__init__ (self, message, __kwargtrans__ ({error: error})); });} }); export var KeyError = __class__ ('KeyError', [Exception], { __module__: __name__, get __init__ () {return __get__ (this, function (self, message, error) { Exception.__init__ (self, message, __kwargtrans__ ({error: error})); });} }); export var AssertionError = __class__ ('AssertionError', [Exception], { __module__: __name__, get __init__ () {return __get__ (this, function (self, message, error) { if (message) { Exception.__init__ (self, message, __kwargtrans__ ({error: error})); } else { Exception.__init__ (self, __kwargtrans__ ({error: error})); } });} }); export var NotImplementedError = __class__ ('NotImplementedError', [Exception], { __module__: __name__, get __init__ () {return __get__ (this, function (self, message, error) { Exception.__init__ (self, message, __kwargtrans__ ({error: error})); });} }); export var IndexError = __class__ ('IndexError', [Exception], { __module__: __name__, get __init__ () {return __get__ (this, function (self, message, error) { Exception.__init__ (self, message, __kwargtrans__ ({error: error})); });} }); export var AttributeError = __class__ ('AttributeError', [Exception], { __module__: __name__, get __init__ () {return __get__ (this, function (self, message, error) { Exception.__init__ (self, message, __kwargtrans__ ({error: error})); });} }); export var py_TypeError = __class__ ('py_TypeError', [Exception], { __module__: __name__, get __init__ () {return __get__ (this, function (self, message, error) { Exception.__init__ (self, message, __kwargtrans__ ({error: error})); });} }); export var Warning = __class__ ('Warning', [Exception], { __module__: __name__, }); export var UserWarning = __class__ ('UserWarning', [Warning], { __module__: __name__, }); export var DeprecationWarning = __class__ ('DeprecationWarning', [Warning], { __module__: __name__, }); export var RuntimeWarning = __class__ ('RuntimeWarning', [Warning], { __module__: __name__, }); export var __sort__ = function (iterable, key, reverse) { if (typeof key == 'undefined' || (key != null && key.hasOwnProperty ("__kwargtrans__"))) {; var key = null; }; if (typeof reverse == 'undefined' || (reverse != null && reverse.hasOwnProperty ("__kwargtrans__"))) {; var reverse = false; }; if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'iterable': var iterable = __allkwargs0__ [__attrib0__]; break; case 'key': var key = __allkwargs0__ [__attrib0__]; break; case 'reverse': var reverse = __allkwargs0__ [__attrib0__]; break; } } } } else { } if (key) { iterable.sort ((function __lambda__ (a, b) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'a': var a = __allkwargs0__ [__attrib0__]; break; case 'b': var b = __allkwargs0__ [__attrib0__]; break; } } } } else { } return (key (a) > key (b) ? 1 : -(1)); })); } else { iterable.sort (); } if (reverse) { iterable.reverse (); } }; export var sorted = function (iterable, key, reverse) { if (typeof key == 'undefined' || (key != null && key.hasOwnProperty ("__kwargtrans__"))) {; var key = null; }; if (typeof reverse == 'undefined' || (reverse != null && reverse.hasOwnProperty ("__kwargtrans__"))) {; var reverse = false; }; if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'iterable': var iterable = __allkwargs0__ [__attrib0__]; break; case 'key': var key = __allkwargs0__ [__attrib0__]; break; case 'reverse': var reverse = __allkwargs0__ [__attrib0__]; break; } } } } else { } if (py_typeof (iterable) == dict) { var result = copy (iterable.py_keys ()); } else { var result = copy (iterable); } __sort__ (result, key, reverse); return result; }; export var map = function (func, iterable) { return (function () { var __accu0__ = []; for (var item of iterable) { __accu0__.append (func (item)); } return __accu0__; }) (); }; export var filter = function (func, iterable) { if (func == null) { var func = bool; } return (function () { var __accu0__ = []; for (var item of iterable) { if (func (item)) { __accu0__.append (item); } } return __accu0__; }) (); }; export var divmod = function (n, d) { return tuple ([Math.floor (n / d), __mod__ (n, d)]); }; export var __Terminal__ = __class__ ('__Terminal__', [object], { __module__: __name__, get __init__ () {return __get__ (this, function (self) { self.buffer = ''; try { self.element = document.getElementById ('__terminal__'); } catch (__except0__) { self.element = null; } if (self.element) { self.element.style.overflowX = 'auto'; self.element.style.boxSizing = 'border-box'; self.element.style.padding = '5px'; self.element.innerHTML = '_'; } });}, get print () {return __get__ (this, function (self) { var sep = ' '; var end = '\n'; if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'self': var self = __allkwargs0__ [__attrib0__]; break; case 'sep': var sep = __allkwargs0__ [__attrib0__]; break; case 'end': var end = __allkwargs0__ [__attrib0__]; break; } } } var args = tuple ([].slice.apply (arguments).slice (1, __ilastarg0__ + 1)); } else { var args = tuple (); } self.buffer = '{}{}{}'.format (self.buffer, sep.join ((function () { var __accu0__ = []; for (var arg of args) { __accu0__.append (str (arg)); } return __accu0__; }) ()), end).__getslice__ (-(4096), null, 1); if (self.element) { self.element.innerHTML = self.buffer.py_replace ('\n', '
').py_replace (' ', ' '); self.element.scrollTop = self.element.scrollHeight; } else { console.log (sep.join ((function () { var __accu0__ = []; for (var arg of args) { __accu0__.append (str (arg)); } return __accu0__; }) ())); } });}, get input () {return __get__ (this, function (self, question) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'self': var self = __allkwargs0__ [__attrib0__]; break; case 'question': var question = __allkwargs0__ [__attrib0__]; break; } } } } else { } self.print ('{}'.format (question), __kwargtrans__ ({end: ''})); var answer = window.prompt ('\n'.join (self.buffer.py_split ('\n').__getslice__ (-(8), null, 1))); self.print (answer); return answer; });} }); export var __terminal__ = __Terminal__ (); export var print = __terminal__.print; export var input = __terminal__.input; //# sourceMappingURL=org.transcrypt.__runtime__.map ================================================ FILE: docs/examples/transcrypt/sketch_001/target/org.transcrypt.__runtime__.py ================================================ # Transcrypt runtime module #__pragma__ ('js', 'export var __envir__ = {{}};\n{}', __include__ ('org/transcrypt/__envir__.js')) #__pragma__ ('js', '{}', __include__ ('org/transcrypt/__core__.js')) #__pragma__ ('js', '{}', __include__ ('org/transcrypt/__builtin__.js')) #__pragma__ ('skip') copy = Math = __typeof__ = __repr__ = document = console = window = 0 #__pragma__ ('noskip') #__pragma__ ('notconv') # !!! tconv gives a problem with __terminal__, needs investigation #__pragma__ ('nokwargs') #__pragma__ ('noalias', 'sort') class BaseException: pass class Exception (BaseException): #__pragma__ ('kwargs') def __init__ (self, *args, **kwargs): self.__args__ = args if kwargs.error != None: self.stack = kwargs.error.stack # Integrate with JavaScript Error object elif Error: self.stack = (__new__(Error())).stack # Create our own stack if we aren't given one else: self.stack = 'No stack trace available' #__pragma__ ('nokwargs') def __repr__ (self): if len (self.__args__) > 1: return '{}{}'.format (self.__class__.__name__, repr (tuple (self.__args__))) elif len (self.__args__): return '{}({})'.format (self.__class__.__name__, repr (self.__args__ [0])) else: return '{}()'.format (self.__class__.__name__) def __str__ (self): if len (self.__args__) > 1: return str (tuple (self.__args__)) elif len (self.__args__): return str (self.__args__ [0]) else: return '' class IterableError (Exception): def __init__ (self, error): Exception.__init__ (self, 'Can\'t iterate over non-iterable', error = error) class StopIteration (Exception): def __init__ (self, error): Exception.__init__ (self, 'Iterator exhausted', error = error) class ValueError (Exception): def __init__ (self, message, error): Exception.__init__ (self, message, error = error) class KeyError (Exception): def __init__ (self, message, error): Exception.__init__ (self, message, error = error) class AssertionError (Exception): def __init__ (self, message, error): if message: Exception.__init__ (self, message, error = error) else: Exception.__init__ (self, error = error) class NotImplementedError (Exception): def __init__(self, message, error): Exception.__init__(self, message, error = error) class IndexError (Exception): def __init__(self, message, error): Exception.__init__(self, message, error = error) class AttributeError (Exception): def __init__(self, message, error): Exception.__init__(self, message, error = error) class TypeError (Exception): def __init__(self, message, error): Exception.__init__(self, message, error = error) # Warnings Exceptions # N.B. This is a limited subset of the warnings defined in # the cpython implementation to keep things small for now. class Warning (Exception): ''' Warning Base Class ''' pass class UserWarning (Warning): pass class DeprecationWarning (Warning): pass class RuntimeWarning (Warning): pass #__pragma__ ('kwargs') def __sort__ (iterable, key = None, reverse = False): # Used by py_sort, can deal with kwargs if key: iterable.sort (lambda a, b: 1 if key (a) > key (b) else -1) # JavaScript sort, case '==' is irrelevant for sorting else: iterable.sort () # JavaScript sort if reverse: iterable.reverse () def sorted (iterable, key = None, reverse = False): if type (iterable) == dict: result = copy (iterable.keys ()) else: result = copy (iterable) __sort__ (result, key, reverse) return result #__pragma__ ('nokwargs') def map (func, iterable): return [func (item) for item in iterable] def filter (func, iterable): if func == None: func = bool return [item for item in iterable if func (item)] def divmod (n, d): return n // d, n % d #__pragma__ ('ifdef', '__complex__') class complex: def __init__ (self, real, imag = None): if imag == None: if type (real) == complex: self.real = real.real self.imag = real.imag else: self.real = real self.imag = 0 else: self.real = real self.imag = imag def __neg__ (self): return complex (-self.real, -self.imag) def __exp__ (self): modulus = Math.exp (self.real) return complex (modulus * Math.cos (self.imag), modulus * Math.sin (self.imag)) def __log__ (self): return complex (Math.log (Math.sqrt (self.real * self.real + self.imag * self.imag)), Math.atan2 (self.imag, self.real)) def __pow__ (self, other): # a ** b = exp (b log a) return (self.__log__ () .__mul__ (other)) .__exp__ () def __rpow__ (self, real): # real ** comp -> comp.__rpow__ (real) return self.__mul__ (Math.log (real)) .__exp__ () def __mul__ (self, other): if __typeof__ (other) is 'number': return complex (self.real * other, self.imag * other) else: return complex (self.real * other.real - self.imag * other.imag, self.real * other.imag + self.imag * other.real) def __rmul__ (self, real): # real + comp -> comp.__rmul__ (real) return complex (self.real * real, self.imag * real) def __div__ (self, other): if __typeof__ (other) is 'number': return complex (self.real / other, self.imag / other) else: denom = other.real * other.real + other.imag * other.imag return complex ( (self.real * other.real + self.imag * other.imag) / denom, (self.imag * other.real - self.real * other.imag) / denom ) def __rdiv__ (self, real): # real / comp -> comp.__rdiv__ (real) denom = self.real * self.real return complex ( (real * self.real) / denom, (real * self.imag) / denom ) def __add__ (self, other): if __typeof__ (other) is 'number': return complex (self.real + other, self.imag) else: # Assume other is complex return complex (self.real + other.real, self.imag + other.imag) def __radd__ (self, real): # real + comp -> comp.__radd__ (real) return complex (self.real + real, self.imag) def __sub__ (self, other): if __typeof__ (other) is 'number': return complex (self.real - other, self.imag) else: return complex (self.real - other.real, self.imag - other.imag) def __rsub__ (self, real): # real - comp -> comp.__rsub__ (real) return complex (real - self.real, -self.imag) def __repr__ (self): return '({}{}{}j)'.format (self.real, '+' if self.imag >= 0 else '', self.imag) def __str__ (self): return __repr__ (self) [1 : -1] def __eq__ (self, other): if __typeof__ (other) is 'number': return self.real == other else: return self.real == other.real and self.imag == other.imag def __ne__ (self, other): if __typeof__ (other) is 'number': return self.real != other else: return self.real != other.real or self.imag != other.imag def conjugate (self): return complex (self.real, -self.imag) def __conj__ (aNumber): if isinstance (aNumber, complex): return complex (aNumber.real, -aNumber.imag) else: return complex (aNumber, 0) #__pragma__ ('endif') class __Terminal__: ''' Printing to either the console or to html happens async, but is blocked by calling window.prompt. So while all input and print statements are encountered in normal order, the print's exit immediately without yet having actually printed This means the next input takes control, blocking actual printing and so on indefinitely The effect is that everything's only printed after all inputs are done To prevent that, what's needed is to only execute the next window.prompt after actual printing has been done Since we've no way to find out when that is, a timeout is used. ''' def __init__ (self): self.buffer = '' try: self.element = document.getElementById ('__terminal__') except: self.element = None if self.element: self.element.style.overflowX = 'auto' self.element.style.boxSizing = 'border-box' self.element.style.padding = '5px' self.element.innerHTML = '_' #__pragma__ ('kwargs') def print (self, *args, sep = ' ', end = '\n'): self.buffer = '{}{}{}'.format (self.buffer, sep.join ([str (arg) for arg in args]), end) [-4096 : ] if self.element: self.element.innerHTML = self.buffer.replace ('\n', '
') .replace (' ', ' ') self.element.scrollTop = self.element.scrollHeight else: console.log (sep.join ([str (arg) for arg in args])) def input (self, question): self.print ('{}'.format (question), end = '') answer = window.prompt ('\n'.join (self.buffer.split ('\n') [-8:])) self.print (answer) return answer #__pragma__ ('nokwargs') __terminal__ = __Terminal__ () print = __terminal__.print input = __terminal__.input ================================================ FILE: docs/examples/transcrypt/sketch_001/target/pyp5js.js ================================================ // Transcrypt'ed from Python, 2021-11-02 13:06:08 import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, all, any, assert, bool, bytearray, bytes, callable, chr, deepcopy, delattr, dict, dir, divmod, enumerate, getattr, hasattr, isinstance, issubclass, len, list, object, ord, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, setattr, sorted, sum, tuple, zip} from './org.transcrypt.__runtime__.js'; import {PythonFunctions} from './python_functions.js'; var __name__ = 'pyp5js'; export var _P5_INSTANCE = null; export var _CTX_MIDDLE = null; export var _DEFAULT_FILL = null; export var _DEFAULT_LEADMULT = null; export var _DEFAULT_STROKE = null; export var _DEFAULT_TEXT_FILL = null; export var ADD = null; export var ALT = null; export var ARROW = null; export var AUDIO = null; export var AUTO = null; export var AXES = null; export var BACKSPACE = null; export var BASELINE = null; export var BEVEL = null; export var BEZIER = null; export var BLEND = null; export var BLUR = null; export var BOLD = null; export var BOLDITALIC = null; export var BOTTOM = null; export var BURN = null; export var CENTER = null; export var CHORD = null; export var CLAMP = null; export var CLOSE = null; export var CONTROL = null; export var CORNER = null; export var CORNERS = null; export var CROSS = null; export var CURVE = null; export var DARKEST = null; export var DEG_TO_RAD = null; export var DEGREES = null; export var DELETE = null; export var DIFFERENCE = null; export var DILATE = null; export var DODGE = null; export var DOWN_ARROW = null; export var ENTER = null; export var ERODE = null; export var ESCAPE = null; export var EXCLUSION = null; export var FILL = null; export var GRAY = null; export var GRID = null; export var HALF_PI = null; export var HAND = null; export var HARD_LIGHT = null; export var HSB = null; export var HSL = null; export var IMAGE = null; export var IMMEDIATE = null; export var INVERT = null; export var ITALIC = null; export var LANDSCAPE = null; export var LEFT = null; export var LEFT_ARROW = null; export var LIGHTEST = null; export var LINE_LOOP = null; export var LINE_STRIP = null; export var LINEAR = null; export var LINES = null; export var MIRROR = null; export var MITER = null; export var MOVE = null; export var MULTIPLY = null; export var NEAREST = null; export var NORMAL = null; export var OPAQUE = null; export var OPEN = null; export var OPTION = null; export var OVERLAY = null; export var PI = null; export var PIE = null; export var POINTS = null; export var PORTRAIT = null; export var POSTERIZE = null; export var PROJECT = null; export var QUAD_STRIP = null; export var QUADRATIC = null; export var QUADS = null; export var QUARTER_PI = null; export var RAD_TO_DEG = null; export var RADIANS = null; export var RADIUS = null; export var REPEAT = null; export var REPLACE = null; export var RETURN = null; export var RGB = null; export var RIGHT = null; export var RIGHT_ARROW = null; export var ROUND = null; export var SCREEN = null; export var SHIFT = null; export var SOFT_LIGHT = null; export var SQUARE = null; export var STROKE = null; export var SUBTRACT = null; export var TAB = null; export var TAU = null; export var TEXT = null; export var TEXTURE = null; export var THRESHOLD = null; export var TOP = null; export var TRIANGLE_FAN = null; export var TRIANGLE_STRIP = null; export var TRIANGLES = null; export var TWO_PI = null; export var UP_ARROW = null; export var VIDEO = null; export var WAIT = null; export var WEBGL = null; export var P2D = null; var PI = null; export var frameCount = null; export var focused = null; export var displayWidth = null; export var displayHeight = null; export var windowWidth = null; export var windowHeight = null; export var width = null; export var height = null; export var disableFriendlyErrors = null; export var deviceOrientation = null; export var accelerationX = null; export var accelerationY = null; export var accelerationZ = null; export var pAccelerationX = null; export var pAccelerationY = null; export var pAccelerationZ = null; export var rotationX = null; export var rotationY = null; export var rotationZ = null; export var pRotationX = null; export var pRotationY = null; export var pRotationZ = null; export var turnAxis = null; export var keyIsPressed = null; export var key = null; export var keyCode = null; export var mouseX = null; export var mouseY = null; export var pmouseX = null; export var pmouseY = null; export var winMouseX = null; export var winMouseY = null; export var pwinMouseX = null; export var pwinMouseY = null; export var mouseButton = null; export var mouseIsPressed = null; export var touches = null; export var pixels = null; export var alpha = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.alpha (...args); }; export var blue = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.blue (...args); }; export var brightness = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.brightness (...args); }; export var color = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.color (...args); }; export var green = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.green (...args); }; export var hue = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.hue (...args); }; export var lerpColor = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.lerpColor (...args); }; export var lightness = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.lightness (...args); }; export var red = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.red (...args); }; export var saturation = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.saturation (...args); }; export var background = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.background (...args); }; export var py_clear = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } var p5_clear = _P5_INSTANCE.clear (...args); return p5_clear; }; export var erase = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.erase (...args); }; export var noErase = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noErase (...args); }; export var colorMode = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.colorMode (...args); }; export var fill = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.fill (...args); }; export var noFill = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noFill (...args); }; export var noStroke = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noStroke (...args); }; export var stroke = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.stroke (...args); }; export var arc = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.arc (...args); }; export var ellipse = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.ellipse (...args); }; export var circle = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.circle (...args); }; export var line = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.line (...args); }; export var point = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.point (...args); }; export var quad = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.quad (...args); }; export var rect = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.rect (...args); }; export var square = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.square (...args); }; export var triangle = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.triangle (...args); }; export var plane = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.plane (...args); }; export var box = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.box (...args); }; export var sphere = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.sphere (...args); }; export var cylinder = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.cylinder (...args); }; export var cone = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.cone (...args); }; export var ellipsoid = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.ellipsoid (...args); }; export var torus = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.torus (...args); }; export var loadModel = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.loadModel (...args); }; export var model = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.model (...args); }; export var ellipseMode = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.ellipseMode (...args); }; export var noSmooth = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noSmooth (...args); }; export var rectMode = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.rectMode (...args); }; export var smooth = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.smooth (...args); }; export var strokeCap = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.strokeCap (...args); }; export var strokeJoin = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.strokeJoin (...args); }; export var strokeWeight = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.strokeWeight (...args); }; export var bezier = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.bezier (...args); }; export var bezierDetail = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.bezierDetail (...args); }; export var bezierPoint = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.bezierPoint (...args); }; export var bezierTangent = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.bezierTangent (...args); }; export var curve = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.curve (...args); }; export var curveDetail = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.curveDetail (...args); }; export var curveTightness = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.curveTightness (...args); }; export var curvePoint = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.curvePoint (...args); }; export var curveTangent = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.curveTangent (...args); }; export var beginContour = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.beginContour (...args); }; export var beginShape = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.beginShape (...args); }; export var bezierVertex = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.bezierVertex (...args); }; export var curveVertex = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.curveVertex (...args); }; export var endContour = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.endContour (...args); }; export var endShape = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.endShape (...args); }; export var quadraticVertex = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.quadraticVertex (...args); }; export var vertex = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.vertex (...args); }; export var cursor = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.cursor (...args); }; export var frameRate = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.frameRate (...args); }; export var noCursor = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noCursor (...args); }; export var fullscreen = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.fullscreen (...args); }; export var pixelDensity = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.pixelDensity (...args); }; export var displayDensity = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.displayDensity (...args); }; export var getURL = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.getURL (...args); }; export var getURLPath = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.getURLPath (...args); }; export var getURLParams = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.getURLParams (...args); }; export var preload = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.preload (...args); }; export var setup = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.setup (...args); }; export var draw = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.draw (...args); }; export var remove = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.remove (...args); }; export var noLoop = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noLoop (...args); }; export var loop = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.loop (...args); }; export var push = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.push (...args); }; export var redraw = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.redraw (...args); }; export var resizeCanvas = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.resizeCanvas (...args); }; export var noCanvas = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noCanvas (...args); }; export var createGraphics = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createGraphics (...args); }; export var blendMode = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.blendMode (...args); }; export var setAttributes = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.setAttributes (...args); }; export var applyMatrix = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.applyMatrix (...args); }; export var resetMatrix = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.resetMatrix (...args); }; export var rotate = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.rotate (...args); }; export var rotateX = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.rotateX (...args); }; export var rotateY = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.rotateY (...args); }; export var rotateZ = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.rotateZ (...args); }; export var scale = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.scale (...args); }; export var shearX = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.shearX (...args); }; export var shearY = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.shearY (...args); }; export var translate = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.translate (...args); }; export var createStringDict = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createStringDict (...args); }; export var createNumberDict = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createNumberDict (...args); }; export var append = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.append (...args); }; export var arrayCopy = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.arrayCopy (...args); }; export var concat = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.concat (...args); }; export var reverse = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.reverse (...args); }; export var shorten = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.shorten (...args); }; export var shuffle = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.shuffle (...args); }; export var py_sort = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.py_sort (...args); }; export var splice = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.splice (...args); }; export var subset = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.subset (...args); }; export var float = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.float (...args); }; export var int = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.int (...args); }; export var str = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.str (...args); }; export var boolean = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.boolean (...args); }; export var byte = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.byte (...args); }; export var char = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.char (...args); }; export var unchar = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.unchar (...args); }; export var hex = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.hex (...args); }; export var unhex = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.unhex (...args); }; export var join = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.join (...args); }; export var match = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.match (...args); }; export var matchAll = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.matchAll (...args); }; export var nf = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.nf (...args); }; export var nfc = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.nfc (...args); }; export var nfp = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.nfp (...args); }; export var nfs = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.nfs (...args); }; export var py_split = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.py_split (...args); }; export var splitTokens = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.splitTokens (...args); }; export var trim = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.trim (...args); }; export var setMoveThreshold = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.setMoveThreshold (...args); }; export var setShakeThreshold = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.setShakeThreshold (...args); }; export var keyIsDown = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.keyIsDown (...args); }; export var createImage = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createImage (...args); }; export var saveCanvas = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.saveCanvas (...args); }; export var saveFrames = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.saveFrames (...args); }; export var image_proxy = function (img) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'img': var img = __allkwargs0__ [__attrib0__]; break; } } } } else { } var _set = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } var value = img.set (...args); return value; }; var _get = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } var value = img.get (...args); return value; }; img.py_set = _set; img.py_get = _get; return img; }; export var loadImage = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } var imageObj = _P5_INSTANCE.loadImage (...args); return image_proxy (imageObj); }; export var image = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.image (...args); }; export var tint = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.tint (...args); }; export var noTint = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noTint (...args); }; export var imageMode = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.imageMode (...args); }; export var blend = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.blend (...args); }; export var copy = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.copy (...args); }; export var filter = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } if (len (args) > 1 && (args [0] === null || callable (args [0]))) { return PythonFunctions.filter (...args); } else { return _P5_INSTANCE.filter (...args); } }; export var py_get = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } var p5_get = _P5_INSTANCE.get (...args); return p5_get; }; export var loadPixels = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.loadPixels (...args); }; export var py_set = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } if (len (args) <= 1) { return PythonFunctions.py_set (...args); } else { return _P5_INSTANCE.py_set (...args); } }; export var updatePixels = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.updatePixels (...args); }; export var loadJSON = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.loadJSON (...args); }; export var loadStrings = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.loadStrings (...args); }; export var loadTable = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.loadTable (...args); }; export var loadXML = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.loadXML (...args); }; export var loadBytes = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.loadBytes (...args); }; export var httpGet = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.httpGet (...args); }; export var httpPost = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.httpPost (...args); }; export var httpDo = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.httpDo (...args); }; export var createWriter = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createWriter (...args); }; export var save = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.save (...args); }; export var saveJSON = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.saveJSON (...args); }; export var saveStrings = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.saveStrings (...args); }; export var saveTable = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.saveTable (...args); }; export var day = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.day (...args); }; export var hour = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.hour (...args); }; export var minute = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.minute (...args); }; export var millis = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.millis (...args); }; export var month = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.month (...args); }; export var second = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.second (...args); }; export var year = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.year (...args); }; export var createVector = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createVector (...args); }; export var abs = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.abs (...args); }; export var ceil = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.ceil (...args); }; export var constrain = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.constrain (...args); }; export var dist = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.dist (...args); }; export var exp = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.exp (...args); }; export var floor = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.floor (...args); }; export var lerp = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.lerp (...args); }; export var log = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.log (...args); }; export var mag = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.mag (...args); }; export var map = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } if (len (args) > 1 && callable (args [0])) { return PythonFunctions.map (...args); } else { return _P5_INSTANCE.map (...args); } }; export var max = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.max (...args); }; export var min = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.min (...args); }; export var norm = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.norm (...args); }; export var pow = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.pow (...args); }; export var round = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.round (...args); }; export var sq = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.sq (...args); }; export var sqrt = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.sqrt (...args); }; export var noise = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noise (...args); }; export var noiseDetail = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noiseDetail (...args); }; export var noiseSeed = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noiseSeed (...args); }; export var randomSeed = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.randomSeed (...args); }; export var random = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.random (...args); }; export var randomGaussian = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.randomGaussian (...args); }; export var acos = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.acos (...args); }; export var asin = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.asin (...args); }; export var atan = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.atan (...args); }; export var atan2 = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.atan2 (...args); }; export var cos = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.cos (...args); }; export var sin = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.sin (...args); }; export var tan = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.tan (...args); }; export var degrees = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.degrees (...args); }; export var radians = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.radians (...args); }; export var angleMode = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.angleMode (...args); }; export var textAlign = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.textAlign (...args); }; export var textLeading = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.textLeading (...args); }; export var textSize = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.textSize (...args); }; export var textStyle = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.textStyle (...args); }; export var textWidth = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.textWidth (...args); }; export var textAscent = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.textAscent (...args); }; export var textDescent = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.textDescent (...args); }; export var loadFont = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.loadFont (...args); }; export var text = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.text (...args); }; export var textFont = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.textFont (...args); }; export var orbitControl = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.orbitControl (...args); }; export var debugMode = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.debugMode (...args); }; export var noDebugMode = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noDebugMode (...args); }; export var ambientLight = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.ambientLight (...args); }; export var directionalLight = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.directionalLight (...args); }; export var pointLight = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.pointLight (...args); }; export var lights = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.lights (...args); }; export var loadShader = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.loadShader (...args); }; export var createShader = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createShader (...args); }; export var shader = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.shader (...args); }; export var resetShader = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.resetShader (...args); }; export var normalMaterial = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.normalMaterial (...args); }; export var texture = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.texture (...args); }; export var textureMode = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.textureMode (...args); }; export var textureWrap = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.textureWrap (...args); }; export var ambientMaterial = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.ambientMaterial (...args); }; export var specularMaterial = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.specularMaterial (...args); }; export var shininess = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.shininess (...args); }; export var camera = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.camera (...args); }; export var perspective = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.perspective (...args); }; export var ortho = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.ortho (...args); }; export var createCamera = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createCamera (...args); }; export var setCamera = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.setCamera (...args); }; export var select = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.select (...args); }; export var selectAll = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.selectAll (...args); }; export var removeElements = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.removeElements (...args); }; export var changed = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.changed (...args); }; export var input = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.input (...args); }; export var createDiv = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createDiv (...args); }; export var createP = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createP (...args); }; export var createSpan = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createSpan (...args); }; export var createImg = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createImg (...args); }; export var createA = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createA (...args); }; export var createSlider = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createSlider (...args); }; export var createButton = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createButton (...args); }; export var createCheckbox = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createCheckbox (...args); }; export var createSelect = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createSelect (...args); }; export var createRadio = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createRadio (...args); }; export var createColorPicker = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createColorPicker (...args); }; export var createInput = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createInput (...args); }; export var createFileInput = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createFileInput (...args); }; export var createVideo = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createVideo (...args); }; export var createAudio = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createAudio (...args); }; export var createCapture = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createCapture (...args); }; export var createElement = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createElement (...args); }; export var createCanvas = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } var canvas = _P5_INSTANCE.createCanvas (...args); width = _P5_INSTANCE.width; height = _P5_INSTANCE.height; return canvas; }; export var py_pop = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } var p5_pop = _P5_INSTANCE.pop (...args); return p5_pop; }; export var size = createCanvas; export var popMatrix = py_pop; export var popStyle = py_pop; export var pushMatrix = push; export var pushStyle = push; export var PVector = function (x, y, z) { if (typeof x == 'undefined' || (x != null && x.hasOwnProperty ("__kwargtrans__"))) {; var x = 0; }; if (typeof y == 'undefined' || (y != null && y.hasOwnProperty ("__kwargtrans__"))) {; var y = 0; }; if (typeof z == 'undefined' || (z != null && z.hasOwnProperty ("__kwargtrans__"))) {; var z = 0; }; if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'x': var x = __allkwargs0__ [__attrib0__]; break; case 'y': var y = __allkwargs0__ [__attrib0__]; break; case 'z': var z = __allkwargs0__ [__attrib0__]; break; } } } } else { } return _P5_INSTANCE.createVector (x, y, z); }; setattr (PVector, 'dist', p5.Vector.dist); setattr (PVector, 'add', p5.Vector.add); setattr (PVector, 'sub', p5.Vector.sub); setattr (PVector, 'mult', p5.Vector.mult); setattr (PVector, 'div', p5.Vector.div); setattr (PVector, 'dot', p5.Vector.dot); setattr (PVector, 'cross', p5.Vector.cross); setattr (PVector, 'lerp', p5.Vector.lerp); setattr (PVector, 'random2D', p5.Vector.random2D); setattr (PVector, 'random3D', p5.Vector.random3D); setattr (PVector, 'angleBetween', p5.Vector.angleBetween); setattr (PVector, 'fromAngle', p5.Vector.fromAngle); setattr (PVector, 'fromAngles', p5.Vector.fromAngles); setattr (PVector, 'equals', p5.Vector.equals); export var pre_draw = function (p5_instance, draw_func) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'p5_instance': var p5_instance = __allkwargs0__ [__attrib0__]; break; case 'draw_func': var draw_func = __allkwargs0__ [__attrib0__]; break; } } } } else { } _CTX_MIDDLE = p5_instance._CTX_MIDDLE; _DEFAULT_FILL = p5_instance._DEFAULT_FILL; _DEFAULT_LEADMULT = p5_instance._DEFAULT_LEADMULT; _DEFAULT_STROKE = p5_instance._DEFAULT_STROKE; _DEFAULT_TEXT_FILL = p5_instance._DEFAULT_TEXT_FILL; ADD = p5_instance.ADD; ALT = p5_instance.ALT; ARROW = p5_instance.ARROW; AUDIO = p5_instance.AUDIO; AUTO = p5_instance.AUTO; AXES = p5_instance.AXES; BACKSPACE = p5_instance.BACKSPACE; BASELINE = p5_instance.BASELINE; BEVEL = p5_instance.BEVEL; BEZIER = p5_instance.BEZIER; BLEND = p5_instance.BLEND; BLUR = p5_instance.BLUR; BOLD = p5_instance.BOLD; BOLDITALIC = p5_instance.BOLDITALIC; BOTTOM = p5_instance.BOTTOM; BURN = p5_instance.BURN; CENTER = p5_instance.CENTER; CHORD = p5_instance.CHORD; CLAMP = p5_instance.CLAMP; CLOSE = p5_instance.CLOSE; CONTROL = p5_instance.CONTROL; CORNER = p5_instance.CORNER; CORNERS = p5_instance.CORNERS; CROSS = p5_instance.CROSS; CURVE = p5_instance.CURVE; DARKEST = p5_instance.DARKEST; DEG_TO_RAD = p5_instance.DEG_TO_RAD; DEGREES = p5_instance.DEGREES; DELETE = p5_instance.DELETE; DIFFERENCE = p5_instance.DIFFERENCE; DILATE = p5_instance.DILATE; DODGE = p5_instance.DODGE; DOWN_ARROW = p5_instance.DOWN_ARROW; ENTER = p5_instance.ENTER; ERODE = p5_instance.ERODE; ESCAPE = p5_instance.ESCAPE; EXCLUSION = p5_instance.EXCLUSION; FILL = p5_instance.FILL; GRAY = p5_instance.GRAY; GRID = p5_instance.GRID; HALF_PI = p5_instance.HALF_PI; HAND = p5_instance.HAND; HARD_LIGHT = p5_instance.HARD_LIGHT; HSB = p5_instance.HSB; HSL = p5_instance.HSL; IMAGE = p5_instance.IMAGE; IMMEDIATE = p5_instance.IMMEDIATE; INVERT = p5_instance.INVERT; ITALIC = p5_instance.ITALIC; LANDSCAPE = p5_instance.LANDSCAPE; LEFT = p5_instance.LEFT; LEFT_ARROW = p5_instance.LEFT_ARROW; LIGHTEST = p5_instance.LIGHTEST; LINE_LOOP = p5_instance.LINE_LOOP; LINE_STRIP = p5_instance.LINE_STRIP; LINEAR = p5_instance.LINEAR; LINES = p5_instance.LINES; MIRROR = p5_instance.MIRROR; MITER = p5_instance.MITER; MOVE = p5_instance.MOVE; MULTIPLY = p5_instance.MULTIPLY; NEAREST = p5_instance.NEAREST; NORMAL = p5_instance.NORMAL; OPAQUE = p5_instance.OPAQUE; OPEN = p5_instance.OPEN; OPTION = p5_instance.OPTION; OVERLAY = p5_instance.OVERLAY; P2D = p5_instance.P2D; var P3D = p5_instance.WEBGL; PI = p5_instance.PI; PIE = p5_instance.PIE; POINTS = p5_instance.POINTS; PORTRAIT = p5_instance.PORTRAIT; POSTERIZE = p5_instance.POSTERIZE; PROJECT = p5_instance.PROJECT; QUAD_STRIP = p5_instance.QUAD_STRIP; QUADRATIC = p5_instance.QUADRATIC; QUADS = p5_instance.QUADS; QUARTER_PI = p5_instance.QUARTER_PI; RAD_TO_DEG = p5_instance.RAD_TO_DEG; RADIANS = p5_instance.RADIANS; RADIUS = p5_instance.RADIUS; REPEAT = p5_instance.REPEAT; REPLACE = p5_instance.REPLACE; RETURN = p5_instance.RETURN; RGB = p5_instance.RGB; RIGHT = p5_instance.RIGHT; RIGHT_ARROW = p5_instance.RIGHT_ARROW; ROUND = p5_instance.ROUND; SCREEN = p5_instance.SCREEN; SHIFT = p5_instance.SHIFT; SOFT_LIGHT = p5_instance.SOFT_LIGHT; SQUARE = p5_instance.SQUARE; STROKE = p5_instance.STROKE; SUBTRACT = p5_instance.SUBTRACT; TAB = p5_instance.TAB; TAU = p5_instance.TAU; TEXT = p5_instance.TEXT; TEXTURE = p5_instance.TEXTURE; THRESHOLD = p5_instance.THRESHOLD; TOP = p5_instance.TOP; TRIANGLE_FAN = p5_instance.TRIANGLE_FAN; TRIANGLE_STRIP = p5_instance.TRIANGLE_STRIP; TRIANGLES = p5_instance.TRIANGLES; TWO_PI = p5_instance.TWO_PI; UP_ARROW = p5_instance.UP_ARROW; VIDEO = p5_instance.VIDEO; WAIT = p5_instance.WAIT; WEBGL = p5_instance.WEBGL; frameCount = p5_instance.frameCount; focused = p5_instance.focused; displayWidth = p5_instance.displayWidth; displayHeight = p5_instance.displayHeight; windowWidth = p5_instance.windowWidth; windowHeight = p5_instance.windowHeight; width = p5_instance.width; height = p5_instance.height; disableFriendlyErrors = p5_instance.disableFriendlyErrors; deviceOrientation = p5_instance.deviceOrientation; accelerationX = p5_instance.accelerationX; accelerationY = p5_instance.accelerationY; accelerationZ = p5_instance.accelerationZ; pAccelerationX = p5_instance.pAccelerationX; pAccelerationY = p5_instance.pAccelerationY; pAccelerationZ = p5_instance.pAccelerationZ; rotationX = p5_instance.rotationX; rotationY = p5_instance.rotationY; rotationZ = p5_instance.rotationZ; pRotationX = p5_instance.pRotationX; pRotationY = p5_instance.pRotationY; pRotationZ = p5_instance.pRotationZ; turnAxis = p5_instance.turnAxis; keyIsPressed = p5_instance.keyIsPressed; key = p5_instance.key; keyCode = p5_instance.keyCode; mouseX = p5_instance.mouseX; mouseY = p5_instance.mouseY; pmouseX = p5_instance.pmouseX; pmouseY = p5_instance.pmouseY; winMouseX = p5_instance.winMouseX; winMouseY = p5_instance.winMouseY; pwinMouseX = p5_instance.pwinMouseX; pwinMouseY = p5_instance.pwinMouseY; mouseButton = p5_instance.mouseButton; mouseIsPressed = p5_instance.mouseIsPressed; touches = p5_instance.touches; pixels = p5_instance.pixels; return draw_func (); }; export var global_p5_injection = function (p5_sketch) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'p5_sketch': var p5_sketch = __allkwargs0__ [__attrib0__]; break; } } } } else { } var decorator = function (f) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'f': var f = __allkwargs0__ [__attrib0__]; break; } } } } else { } var wrapper = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } } else { } _P5_INSTANCE = p5_sketch; return pre_draw (_P5_INSTANCE, f); }; return wrapper; }; return decorator; }; export var start_p5 = function (preload_func, setup_func, draw_func, event_functions) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'preload_func': var preload_func = __allkwargs0__ [__attrib0__]; break; case 'setup_func': var setup_func = __allkwargs0__ [__attrib0__]; break; case 'draw_func': var draw_func = __allkwargs0__ [__attrib0__]; break; case 'event_functions': var event_functions = __allkwargs0__ [__attrib0__]; break; } } } } else { } var sketch_setup = function (p5_sketch) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'p5_sketch': var p5_sketch = __allkwargs0__ [__attrib0__]; break; } } } } else { } p5_sketch.preload = global_p5_injection (p5_sketch) (preload_func); p5_sketch.setup = global_p5_injection (p5_sketch) (setup_func); p5_sketch.draw = global_p5_injection (p5_sketch) (draw_func); }; var instance = new p5 (sketch_setup, 'sketch-holder'); var event_function_names = tuple (['deviceMoved', 'deviceTurned', 'deviceShaken', 'windowResized', 'keyPressed', 'keyReleased', 'keyTyped', 'mousePressed', 'mouseReleased', 'mouseClicked', 'doubleClicked', 'mouseMoved', 'mouseDragged', 'mouseWheel', 'touchStarted', 'touchMoved', 'touchEnded', 'keyIsDown']); for (var f_name of (function () { var __accu0__ = []; for (var f of event_function_names) { if (event_functions.py_get (f, null)) { __accu0__.append (f); } } return __accu0__; }) ()) { var func = event_functions [f_name]; var event_func = global_p5_injection (instance) (func); setattr (instance, f_name, event_func); } }; export var logOnloaded = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } } else { } console.log ('Lib loaded!'); }; export var add_library = function (lib_name) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'lib_name': var lib_name = __allkwargs0__ [__attrib0__]; break; } } } } else { } var src = ''; return console.log ('Lib name is not valid:', lib_name); console.log ('Importing:', src); var script = document.createElement ('script'); script.onload = logOnloaded; script.src = src; document.head.appendChild (script); }; //# sourceMappingURL=pyp5js.map ================================================ FILE: docs/examples/transcrypt/sketch_001/target/pyp5js.py ================================================ from python_functions import PythonFunctions _P5_INSTANCE = None _CTX_MIDDLE = None _DEFAULT_FILL = None _DEFAULT_LEADMULT = None _DEFAULT_STROKE = None _DEFAULT_TEXT_FILL = None ADD = None ALT = None ARROW = None AUDIO = None AUTO = None AXES = None BACKSPACE = None BASELINE = None BEVEL = None BEZIER = None BLEND = None BLUR = None BOLD = None BOLDITALIC = None BOTTOM = None BURN = None CENTER = None CHORD = None CLAMP = None CLOSE = None CONTROL = None CORNER = None CORNERS = None CROSS = None CURVE = None DARKEST = None DEG_TO_RAD = None DEGREES = None DELETE = None DIFFERENCE = None DILATE = None DODGE = None DOWN_ARROW = None ENTER = None ERODE = None ESCAPE = None EXCLUSION = None FILL = None GRAY = None GRID = None HALF_PI = None HAND = None HARD_LIGHT = None HSB = None HSL = None IMAGE = None IMMEDIATE = None INVERT = None ITALIC = None LANDSCAPE = None LEFT = None LEFT_ARROW = None LIGHTEST = None LINE_LOOP = None LINE_STRIP = None LINEAR = None LINES = None MIRROR = None MITER = None MOVE = None MULTIPLY = None NEAREST = None NORMAL = None OPAQUE = None OPEN = None OPTION = None OVERLAY = None PI = None PIE = None POINTS = None PORTRAIT = None POSTERIZE = None PROJECT = None QUAD_STRIP = None QUADRATIC = None QUADS = None QUARTER_PI = None RAD_TO_DEG = None RADIANS = None RADIUS = None REPEAT = None REPLACE = None RETURN = None RGB = None RIGHT = None RIGHT_ARROW = None ROUND = None SCREEN = None SHIFT = None SOFT_LIGHT = None SQUARE = None STROKE = None SUBTRACT = None TAB = None TAU = None TEXT = None TEXTURE = None THRESHOLD = None TOP = None TRIANGLE_FAN = None TRIANGLE_STRIP = None TRIANGLES = None TWO_PI = None UP_ARROW = None VIDEO = None WAIT = None WEBGL = None P2D = None PI = None frameCount = None focused = None displayWidth = None displayHeight = None windowWidth = None windowHeight = None width = None height = None disableFriendlyErrors = None deviceOrientation = None accelerationX = None accelerationY = None accelerationZ = None pAccelerationX = None pAccelerationY = None pAccelerationZ = None rotationX = None rotationY = None rotationZ = None pRotationX = None pRotationY = None pRotationZ = None turnAxis = None keyIsPressed = None key = None keyCode = None mouseX = None mouseY = None pmouseX = None pmouseY = None winMouseX = None winMouseY = None pwinMouseX = None pwinMouseY = None mouseButton = None mouseIsPressed = None touches = None pixels = None def alpha(*args): return _P5_INSTANCE.alpha(*args) def blue(*args): return _P5_INSTANCE.blue(*args) def brightness(*args): return _P5_INSTANCE.brightness(*args) def color(*args): return _P5_INSTANCE.color(*args) def green(*args): return _P5_INSTANCE.green(*args) def hue(*args): return _P5_INSTANCE.hue(*args) def lerpColor(*args): return _P5_INSTANCE.lerpColor(*args) def lightness(*args): return _P5_INSTANCE.lightness(*args) def red(*args): return _P5_INSTANCE.red(*args) def saturation(*args): return _P5_INSTANCE.saturation(*args) def background(*args): return _P5_INSTANCE.background(*args) def clear(*args): __pragma__('noalias', 'clear') p5_clear = _P5_INSTANCE.clear(*args) __pragma__('alias', 'clear', 'py_clear') return p5_clear def erase(*args): return _P5_INSTANCE.erase(*args) def noErase(*args): return _P5_INSTANCE.noErase(*args) def colorMode(*args): return _P5_INSTANCE.colorMode(*args) def fill(*args): return _P5_INSTANCE.fill(*args) def noFill(*args): return _P5_INSTANCE.noFill(*args) def noStroke(*args): return _P5_INSTANCE.noStroke(*args) def stroke(*args): return _P5_INSTANCE.stroke(*args) def arc(*args): return _P5_INSTANCE.arc(*args) def ellipse(*args): return _P5_INSTANCE.ellipse(*args) def circle(*args): return _P5_INSTANCE.circle(*args) def line(*args): return _P5_INSTANCE.line(*args) def point(*args): return _P5_INSTANCE.point(*args) def quad(*args): return _P5_INSTANCE.quad(*args) def rect(*args): return _P5_INSTANCE.rect(*args) def square(*args): return _P5_INSTANCE.square(*args) def triangle(*args): return _P5_INSTANCE.triangle(*args) def plane(*args): return _P5_INSTANCE.plane(*args) def box(*args): return _P5_INSTANCE.box(*args) def sphere(*args): return _P5_INSTANCE.sphere(*args) def cylinder(*args): return _P5_INSTANCE.cylinder(*args) def cone(*args): return _P5_INSTANCE.cone(*args) def ellipsoid(*args): return _P5_INSTANCE.ellipsoid(*args) def torus(*args): return _P5_INSTANCE.torus(*args) def loadModel(*args): return _P5_INSTANCE.loadModel(*args) def model(*args): return _P5_INSTANCE.model(*args) def ellipseMode(*args): return _P5_INSTANCE.ellipseMode(*args) def noSmooth(*args): return _P5_INSTANCE.noSmooth(*args) def rectMode(*args): return _P5_INSTANCE.rectMode(*args) def smooth(*args): return _P5_INSTANCE.smooth(*args) def strokeCap(*args): return _P5_INSTANCE.strokeCap(*args) def strokeJoin(*args): return _P5_INSTANCE.strokeJoin(*args) def strokeWeight(*args): return _P5_INSTANCE.strokeWeight(*args) def bezier(*args): return _P5_INSTANCE.bezier(*args) def bezierDetail(*args): return _P5_INSTANCE.bezierDetail(*args) def bezierPoint(*args): return _P5_INSTANCE.bezierPoint(*args) def bezierTangent(*args): return _P5_INSTANCE.bezierTangent(*args) def curve(*args): return _P5_INSTANCE.curve(*args) def curveDetail(*args): return _P5_INSTANCE.curveDetail(*args) def curveTightness(*args): return _P5_INSTANCE.curveTightness(*args) def curvePoint(*args): return _P5_INSTANCE.curvePoint(*args) def curveTangent(*args): return _P5_INSTANCE.curveTangent(*args) def beginContour(*args): return _P5_INSTANCE.beginContour(*args) def beginShape(*args): return _P5_INSTANCE.beginShape(*args) def bezierVertex(*args): return _P5_INSTANCE.bezierVertex(*args) def curveVertex(*args): return _P5_INSTANCE.curveVertex(*args) def endContour(*args): return _P5_INSTANCE.endContour(*args) def endShape(*args): return _P5_INSTANCE.endShape(*args) def quadraticVertex(*args): return _P5_INSTANCE.quadraticVertex(*args) def vertex(*args): return _P5_INSTANCE.vertex(*args) def cursor(*args): return _P5_INSTANCE.cursor(*args) def frameRate(*args): return _P5_INSTANCE.frameRate(*args) def noCursor(*args): return _P5_INSTANCE.noCursor(*args) def fullscreen(*args): return _P5_INSTANCE.fullscreen(*args) def pixelDensity(*args): return _P5_INSTANCE.pixelDensity(*args) def displayDensity(*args): return _P5_INSTANCE.displayDensity(*args) def getURL(*args): return _P5_INSTANCE.getURL(*args) def getURLPath(*args): return _P5_INSTANCE.getURLPath(*args) def getURLParams(*args): return _P5_INSTANCE.getURLParams(*args) def preload(*args): return _P5_INSTANCE.preload(*args) def setup(*args): return _P5_INSTANCE.setup(*args) def draw(*args): return _P5_INSTANCE.draw(*args) def remove(*args): return _P5_INSTANCE.remove(*args) def noLoop(*args): return _P5_INSTANCE.noLoop(*args) def loop(*args): return _P5_INSTANCE.loop(*args) def push(*args): return _P5_INSTANCE.push(*args) def redraw(*args): return _P5_INSTANCE.redraw(*args) def resizeCanvas(*args): return _P5_INSTANCE.resizeCanvas(*args) def noCanvas(*args): return _P5_INSTANCE.noCanvas(*args) def createGraphics(*args): return _P5_INSTANCE.createGraphics(*args) def blendMode(*args): return _P5_INSTANCE.blendMode(*args) def setAttributes(*args): return _P5_INSTANCE.setAttributes(*args) def applyMatrix(*args): return _P5_INSTANCE.applyMatrix(*args) def resetMatrix(*args): return _P5_INSTANCE.resetMatrix(*args) def rotate(*args): return _P5_INSTANCE.rotate(*args) def rotateX(*args): return _P5_INSTANCE.rotateX(*args) def rotateY(*args): return _P5_INSTANCE.rotateY(*args) def rotateZ(*args): return _P5_INSTANCE.rotateZ(*args) def scale(*args): return _P5_INSTANCE.scale(*args) def shearX(*args): return _P5_INSTANCE.shearX(*args) def shearY(*args): return _P5_INSTANCE.shearY(*args) def translate(*args): return _P5_INSTANCE.translate(*args) def createStringDict(*args): return _P5_INSTANCE.createStringDict(*args) def createNumberDict(*args): return _P5_INSTANCE.createNumberDict(*args) def append(*args): return _P5_INSTANCE.append(*args) def arrayCopy(*args): return _P5_INSTANCE.arrayCopy(*args) def concat(*args): return _P5_INSTANCE.concat(*args) def reverse(*args): return _P5_INSTANCE.reverse(*args) def shorten(*args): return _P5_INSTANCE.shorten(*args) def shuffle(*args): return _P5_INSTANCE.shuffle(*args) def sort(*args): return _P5_INSTANCE.sort(*args) def splice(*args): return _P5_INSTANCE.splice(*args) def subset(*args): return _P5_INSTANCE.subset(*args) def float(*args): return _P5_INSTANCE.float(*args) def int(*args): return _P5_INSTANCE.int(*args) def str(*args): return _P5_INSTANCE.str(*args) def boolean(*args): return _P5_INSTANCE.boolean(*args) def byte(*args): return _P5_INSTANCE.byte(*args) def char(*args): return _P5_INSTANCE.char(*args) def unchar(*args): return _P5_INSTANCE.unchar(*args) def hex(*args): return _P5_INSTANCE.hex(*args) def unhex(*args): return _P5_INSTANCE.unhex(*args) def join(*args): return _P5_INSTANCE.join(*args) def match(*args): return _P5_INSTANCE.match(*args) def matchAll(*args): return _P5_INSTANCE.matchAll(*args) def nf(*args): return _P5_INSTANCE.nf(*args) def nfc(*args): return _P5_INSTANCE.nfc(*args) def nfp(*args): return _P5_INSTANCE.nfp(*args) def nfs(*args): return _P5_INSTANCE.nfs(*args) def split(*args): return _P5_INSTANCE.split(*args) def splitTokens(*args): return _P5_INSTANCE.splitTokens(*args) def trim(*args): return _P5_INSTANCE.trim(*args) def setMoveThreshold(*args): return _P5_INSTANCE.setMoveThreshold(*args) def setShakeThreshold(*args): return _P5_INSTANCE.setShakeThreshold(*args) def keyIsDown(*args): return _P5_INSTANCE.keyIsDown(*args) def createImage(*args): return _P5_INSTANCE.createImage(*args) def saveCanvas(*args): return _P5_INSTANCE.saveCanvas(*args) def saveFrames(*args): return _P5_INSTANCE.saveFrames(*args) def image_proxy(img): """ Proxy to turn of transcypt when calling img.get/set methods """ def _set(*args): __pragma__('noalias', 'set') value = img.set(*args) __pragma__('alias', 'set', 'py_set') return value def _get(*args): __pragma__('noalias', 'get') value = img.get(*args) __pragma__('alias', 'get', 'py_get') return value img.set = _set img.get = _get return img def loadImage(*args): imageObj = _P5_INSTANCE.loadImage(*args) return image_proxy(imageObj) def image(*args): return _P5_INSTANCE.image(*args) def tint(*args): return _P5_INSTANCE.tint(*args) def noTint(*args): return _P5_INSTANCE.noTint(*args) def imageMode(*args): return _P5_INSTANCE.imageMode(*args) def blend(*args): return _P5_INSTANCE.blend(*args) def copy(*args): return _P5_INSTANCE.copy(*args) def filter(*args): if len(args) > 1 and (args[0] is None or callable(args[0])): return PythonFunctions.filter(*args) else: return _P5_INSTANCE.filter(*args) def get(*args): __pragma__('noalias', 'get') p5_get = _P5_INSTANCE.get(*args) __pragma__('alias', 'get', 'py_get') return p5_get def loadPixels(*args): return _P5_INSTANCE.loadPixels(*args) def set(*args): if len(args) <= 1: return PythonFunctions.set(*args) else: return _P5_INSTANCE.set(*args) def updatePixels(*args): return _P5_INSTANCE.updatePixels(*args) def loadJSON(*args): return _P5_INSTANCE.loadJSON(*args) def loadStrings(*args): return _P5_INSTANCE.loadStrings(*args) def loadTable(*args): return _P5_INSTANCE.loadTable(*args) def loadXML(*args): return _P5_INSTANCE.loadXML(*args) def loadBytes(*args): return _P5_INSTANCE.loadBytes(*args) def httpGet(*args): return _P5_INSTANCE.httpGet(*args) def httpPost(*args): return _P5_INSTANCE.httpPost(*args) def httpDo(*args): return _P5_INSTANCE.httpDo(*args) def createWriter(*args): return _P5_INSTANCE.createWriter(*args) def save(*args): return _P5_INSTANCE.save(*args) def saveJSON(*args): return _P5_INSTANCE.saveJSON(*args) def saveStrings(*args): return _P5_INSTANCE.saveStrings(*args) def saveTable(*args): return _P5_INSTANCE.saveTable(*args) def day(*args): return _P5_INSTANCE.day(*args) def hour(*args): return _P5_INSTANCE.hour(*args) def minute(*args): return _P5_INSTANCE.minute(*args) def millis(*args): return _P5_INSTANCE.millis(*args) def month(*args): return _P5_INSTANCE.month(*args) def second(*args): return _P5_INSTANCE.second(*args) def year(*args): return _P5_INSTANCE.year(*args) def createVector(*args): return _P5_INSTANCE.createVector(*args) def abs(*args): return _P5_INSTANCE.abs(*args) def ceil(*args): return _P5_INSTANCE.ceil(*args) def constrain(*args): return _P5_INSTANCE.constrain(*args) def dist(*args): return _P5_INSTANCE.dist(*args) def exp(*args): return _P5_INSTANCE.exp(*args) def floor(*args): return _P5_INSTANCE.floor(*args) def lerp(*args): return _P5_INSTANCE.lerp(*args) def log(*args): return _P5_INSTANCE.log(*args) def mag(*args): return _P5_INSTANCE.mag(*args) def map(*args): if len(args) > 1 and callable(args[0]): return PythonFunctions.map(*args) else: return _P5_INSTANCE.map(*args) def max(*args): return _P5_INSTANCE.max(*args) def min(*args): return _P5_INSTANCE.min(*args) def norm(*args): return _P5_INSTANCE.norm(*args) def pow(*args): return _P5_INSTANCE.pow(*args) def round(*args): return _P5_INSTANCE.round(*args) def sq(*args): return _P5_INSTANCE.sq(*args) def sqrt(*args): return _P5_INSTANCE.sqrt(*args) def noise(*args): return _P5_INSTANCE.noise(*args) def noiseDetail(*args): return _P5_INSTANCE.noiseDetail(*args) def noiseSeed(*args): return _P5_INSTANCE.noiseSeed(*args) def randomSeed(*args): return _P5_INSTANCE.randomSeed(*args) def random(*args): return _P5_INSTANCE.random(*args) def randomGaussian(*args): return _P5_INSTANCE.randomGaussian(*args) def acos(*args): return _P5_INSTANCE.acos(*args) def asin(*args): return _P5_INSTANCE.asin(*args) def atan(*args): return _P5_INSTANCE.atan(*args) def atan2(*args): return _P5_INSTANCE.atan2(*args) def cos(*args): return _P5_INSTANCE.cos(*args) def sin(*args): return _P5_INSTANCE.sin(*args) def tan(*args): return _P5_INSTANCE.tan(*args) def degrees(*args): return _P5_INSTANCE.degrees(*args) def radians(*args): return _P5_INSTANCE.radians(*args) def angleMode(*args): return _P5_INSTANCE.angleMode(*args) def textAlign(*args): return _P5_INSTANCE.textAlign(*args) def textLeading(*args): return _P5_INSTANCE.textLeading(*args) def textSize(*args): return _P5_INSTANCE.textSize(*args) def textStyle(*args): return _P5_INSTANCE.textStyle(*args) def textWidth(*args): return _P5_INSTANCE.textWidth(*args) def textAscent(*args): return _P5_INSTANCE.textAscent(*args) def textDescent(*args): return _P5_INSTANCE.textDescent(*args) def loadFont(*args): return _P5_INSTANCE.loadFont(*args) def text(*args): return _P5_INSTANCE.text(*args) def textFont(*args): return _P5_INSTANCE.textFont(*args) def orbitControl(*args): return _P5_INSTANCE.orbitControl(*args) def debugMode(*args): return _P5_INSTANCE.debugMode(*args) def noDebugMode(*args): return _P5_INSTANCE.noDebugMode(*args) def ambientLight(*args): return _P5_INSTANCE.ambientLight(*args) def directionalLight(*args): return _P5_INSTANCE.directionalLight(*args) def pointLight(*args): return _P5_INSTANCE.pointLight(*args) def lights(*args): return _P5_INSTANCE.lights(*args) def loadShader(*args): return _P5_INSTANCE.loadShader(*args) def createShader(*args): return _P5_INSTANCE.createShader(*args) def shader(*args): return _P5_INSTANCE.shader(*args) def resetShader(*args): return _P5_INSTANCE.resetShader(*args) def normalMaterial(*args): return _P5_INSTANCE.normalMaterial(*args) def texture(*args): return _P5_INSTANCE.texture(*args) def textureMode(*args): return _P5_INSTANCE.textureMode(*args) def textureWrap(*args): return _P5_INSTANCE.textureWrap(*args) def ambientMaterial(*args): return _P5_INSTANCE.ambientMaterial(*args) def specularMaterial(*args): return _P5_INSTANCE.specularMaterial(*args) def shininess(*args): return _P5_INSTANCE.shininess(*args) def camera(*args): return _P5_INSTANCE.camera(*args) def perspective(*args): return _P5_INSTANCE.perspective(*args) def ortho(*args): return _P5_INSTANCE.ortho(*args) def createCamera(*args): return _P5_INSTANCE.createCamera(*args) def setCamera(*args): return _P5_INSTANCE.setCamera(*args) def select(*args): return _P5_INSTANCE.select(*args) def selectAll(*args): return _P5_INSTANCE.selectAll(*args) def removeElements(*args): return _P5_INSTANCE.removeElements(*args) def changed(*args): return _P5_INSTANCE.changed(*args) def input(*args): return _P5_INSTANCE.input(*args) def createDiv(*args): return _P5_INSTANCE.createDiv(*args) def createP(*args): return _P5_INSTANCE.createP(*args) def createSpan(*args): return _P5_INSTANCE.createSpan(*args) def createImg(*args): return _P5_INSTANCE.createImg(*args) def createA(*args): return _P5_INSTANCE.createA(*args) def createSlider(*args): return _P5_INSTANCE.createSlider(*args) def createButton(*args): return _P5_INSTANCE.createButton(*args) def createCheckbox(*args): return _P5_INSTANCE.createCheckbox(*args) def createSelect(*args): return _P5_INSTANCE.createSelect(*args) def createRadio(*args): return _P5_INSTANCE.createRadio(*args) def createColorPicker(*args): return _P5_INSTANCE.createColorPicker(*args) def createInput(*args): return _P5_INSTANCE.createInput(*args) def createFileInput(*args): return _P5_INSTANCE.createFileInput(*args) def createVideo(*args): return _P5_INSTANCE.createVideo(*args) def createAudio(*args): return _P5_INSTANCE.createAudio(*args) def createCapture(*args): return _P5_INSTANCE.createCapture(*args) def createElement(*args): return _P5_INSTANCE.createElement(*args) def createCanvas(*args): canvas = _P5_INSTANCE.createCanvas(*args) global width, height width = _P5_INSTANCE.width height = _P5_INSTANCE.height return canvas def pop(*args): __pragma__('noalias', 'pop') p5_pop = _P5_INSTANCE.pop(*args) __pragma__('alias', 'pop', 'py_pop') return p5_pop # Processing Python or Java mode compatibility aliases size = createCanvas popMatrix = pop popStyle = pop pushMatrix = push pushStyle = push # PVector is a helper/alias to create p5.Vector objects def PVector(x=0, y=0, z=0): return _P5_INSTANCE.createVector(x, y, z) # aliases for p5.Vector class methods setattr(PVector, 'dist', p5.Vector.dist) setattr(PVector, 'add', p5.Vector.add) setattr(PVector, 'sub', p5.Vector.sub) setattr(PVector, 'mult', p5.Vector.mult) setattr(PVector, 'div', p5.Vector.div) setattr(PVector, 'dot', p5.Vector.dot) setattr(PVector, 'cross', p5.Vector.cross) setattr(PVector, 'lerp', p5.Vector.lerp) setattr(PVector, 'random2D', p5.Vector.random2D) setattr(PVector, 'random3D', p5.Vector.random3D) setattr(PVector, 'angleBetween', p5.Vector.angleBetween) setattr(PVector, 'fromAngle', p5.Vector.fromAngle) setattr(PVector, 'fromAngles', p5.Vector.fromAngles) setattr(PVector, 'equals', p5.Vector.equals) def pre_draw(p5_instance, draw_func): """ We need to run this before the actual draw to insert and update p5 env variables """ global _CTX_MIDDLE, _DEFAULT_FILL, _DEFAULT_LEADMULT, _DEFAULT_STROKE, _DEFAULT_TEXT_FILL global ADD, ALT, ARROW, AUTO, AUDIO, AXES, BACKSPACE, BASELINE, BEVEL, BEZIER, BLEND, BLUR, BOLD, BOLDITALIC global BOTTOM, BURN, CENTER, CHORD, CLAMP, CLOSE, CONTROL, CORNER, CORNERS, CROSS, CURVE, DARKEST global DEG_TO_RAD, DEGREES, DELETE, DIFFERENCE, DILATE, DODGE, DOWN_ARROW, ENTER, ERODE, ESCAPE, EXCLUSION global FILL, GRAY, GRID, HALF_PI, HAND, HARD_LIGHT, HSB, HSL, IMAGE, IMMEDIATE, INVERT, ITALIC, LANDSCAPE global LEFT, LEFT_ARROW, LIGHTEST, LINE_LOOP, LINE_STRIP, LINEAR, LINES, MIRROR, MITER, MOVE, MULTIPLY, NEAREST global NORMAL, OPAQUE, OPEN, OPTION, OVERLAY, P2D, PI, PIE, POINTS, PORTRAIT, POSTERIZE, PROJECT, QUAD_STRIP, QUADRATIC global QUADS, QUARTER_PI, RAD_TO_DEG, RADIANS, RADIUS, REPEAT, REPLACE, RETURN, RGB, RIGHT, RIGHT_ARROW global ROUND, SCREEN, SHIFT, SOFT_LIGHT, SQUARE, STROKE, SUBTRACT, TAB, TAU, TEXT, TEXTURE, THRESHOLD, TOP global TRIANGLE_FAN, TRIANGLE_STRIP, TRIANGLES, TWO_PI, UP_ARROW, VIDEO, WAIT, WEBGL global frameCount, focused, displayWidth, displayHeight, windowWidth, windowHeight, width, height global disableFriendlyErrors, deviceOrientation, accelerationX, accelerationY, accelerationZ global pAccelerationX, pAccelerationY, pAccelerationZ, rotationX, rotationY, rotationZ global pRotationX, pRotationY, pRotationZ, turnAxis, keyIsPressed, key, keyCode, mouseX, mouseY, pmouseX, pmouseY global winMouseX, winMouseY, pwinMouseX, pwinMouseY, mouseButton, mouseIsPressed, touches, pixels _CTX_MIDDLE = p5_instance._CTX_MIDDLE _DEFAULT_FILL = p5_instance._DEFAULT_FILL _DEFAULT_LEADMULT = p5_instance._DEFAULT_LEADMULT _DEFAULT_STROKE = p5_instance._DEFAULT_STROKE _DEFAULT_TEXT_FILL = p5_instance._DEFAULT_TEXT_FILL ADD = p5_instance.ADD ALT = p5_instance.ALT ARROW = p5_instance.ARROW AUDIO = p5_instance.AUDIO AUTO = p5_instance.AUTO AXES = p5_instance.AXES BACKSPACE = p5_instance.BACKSPACE BASELINE = p5_instance.BASELINE BEVEL = p5_instance.BEVEL BEZIER = p5_instance.BEZIER BLEND = p5_instance.BLEND BLUR = p5_instance.BLUR BOLD = p5_instance.BOLD BOLDITALIC = p5_instance.BOLDITALIC BOTTOM = p5_instance.BOTTOM BURN = p5_instance.BURN CENTER = p5_instance.CENTER CHORD = p5_instance.CHORD CLAMP = p5_instance.CLAMP CLOSE = p5_instance.CLOSE CONTROL = p5_instance.CONTROL CORNER = p5_instance.CORNER CORNERS = p5_instance.CORNERS CROSS = p5_instance.CROSS CURVE = p5_instance.CURVE DARKEST = p5_instance.DARKEST DEG_TO_RAD = p5_instance.DEG_TO_RAD DEGREES = p5_instance.DEGREES DELETE = p5_instance.DELETE DIFFERENCE = p5_instance.DIFFERENCE DILATE = p5_instance.DILATE DODGE = p5_instance.DODGE DOWN_ARROW = p5_instance.DOWN_ARROW ENTER = p5_instance.ENTER ERODE = p5_instance.ERODE ESCAPE = p5_instance.ESCAPE EXCLUSION = p5_instance.EXCLUSION FILL = p5_instance.FILL GRAY = p5_instance.GRAY GRID = p5_instance.GRID HALF_PI = p5_instance.HALF_PI HAND = p5_instance.HAND HARD_LIGHT = p5_instance.HARD_LIGHT HSB = p5_instance.HSB HSL = p5_instance.HSL IMAGE = p5_instance.IMAGE IMMEDIATE = p5_instance.IMMEDIATE INVERT = p5_instance.INVERT ITALIC = p5_instance.ITALIC LANDSCAPE = p5_instance.LANDSCAPE LEFT = p5_instance.LEFT LEFT_ARROW = p5_instance.LEFT_ARROW LIGHTEST = p5_instance.LIGHTEST LINE_LOOP = p5_instance.LINE_LOOP LINE_STRIP = p5_instance.LINE_STRIP LINEAR = p5_instance.LINEAR LINES = p5_instance.LINES MIRROR = p5_instance.MIRROR MITER = p5_instance.MITER MOVE = p5_instance.MOVE MULTIPLY = p5_instance.MULTIPLY NEAREST = p5_instance.NEAREST NORMAL = p5_instance.NORMAL OPAQUE = p5_instance.OPAQUE OPEN = p5_instance.OPEN OPTION = p5_instance.OPTION OVERLAY = p5_instance.OVERLAY P2D = p5_instance.P2D P3D = p5_instance.WEBGL PI = p5_instance.PI PIE = p5_instance.PIE POINTS = p5_instance.POINTS PORTRAIT = p5_instance.PORTRAIT POSTERIZE = p5_instance.POSTERIZE PROJECT = p5_instance.PROJECT QUAD_STRIP = p5_instance.QUAD_STRIP QUADRATIC = p5_instance.QUADRATIC QUADS = p5_instance.QUADS QUARTER_PI = p5_instance.QUARTER_PI RAD_TO_DEG = p5_instance.RAD_TO_DEG RADIANS = p5_instance.RADIANS RADIUS = p5_instance.RADIUS REPEAT = p5_instance.REPEAT REPLACE = p5_instance.REPLACE RETURN = p5_instance.RETURN RGB = p5_instance.RGB RIGHT = p5_instance.RIGHT RIGHT_ARROW = p5_instance.RIGHT_ARROW ROUND = p5_instance.ROUND SCREEN = p5_instance.SCREEN SHIFT = p5_instance.SHIFT SOFT_LIGHT = p5_instance.SOFT_LIGHT SQUARE = p5_instance.SQUARE STROKE = p5_instance.STROKE SUBTRACT = p5_instance.SUBTRACT TAB = p5_instance.TAB TAU = p5_instance.TAU TEXT = p5_instance.TEXT TEXTURE = p5_instance.TEXTURE THRESHOLD = p5_instance.THRESHOLD TOP = p5_instance.TOP TRIANGLE_FAN = p5_instance.TRIANGLE_FAN TRIANGLE_STRIP = p5_instance.TRIANGLE_STRIP TRIANGLES = p5_instance.TRIANGLES TWO_PI = p5_instance.TWO_PI UP_ARROW = p5_instance.UP_ARROW VIDEO = p5_instance.VIDEO WAIT = p5_instance.WAIT WEBGL = p5_instance.WEBGL frameCount = p5_instance.frameCount focused = p5_instance.focused displayWidth = p5_instance.displayWidth displayHeight = p5_instance.displayHeight windowWidth = p5_instance.windowWidth windowHeight = p5_instance.windowHeight width = p5_instance.width height = p5_instance.height disableFriendlyErrors = p5_instance.disableFriendlyErrors deviceOrientation = p5_instance.deviceOrientation accelerationX = p5_instance.accelerationX accelerationY = p5_instance.accelerationY accelerationZ = p5_instance.accelerationZ pAccelerationX = p5_instance.pAccelerationX pAccelerationY = p5_instance.pAccelerationY pAccelerationZ = p5_instance.pAccelerationZ rotationX = p5_instance.rotationX rotationY = p5_instance.rotationY rotationZ = p5_instance.rotationZ pRotationX = p5_instance.pRotationX pRotationY = p5_instance.pRotationY pRotationZ = p5_instance.pRotationZ turnAxis = p5_instance.turnAxis keyIsPressed = p5_instance.keyIsPressed key = p5_instance.key keyCode = p5_instance.keyCode mouseX = p5_instance.mouseX mouseY = p5_instance.mouseY pmouseX = p5_instance.pmouseX pmouseY = p5_instance.pmouseY winMouseX = p5_instance.winMouseX winMouseY = p5_instance.winMouseY pwinMouseX = p5_instance.pwinMouseX pwinMouseY = p5_instance.pwinMouseY mouseButton = p5_instance.mouseButton mouseIsPressed = p5_instance.mouseIsPressed touches = p5_instance.touches pixels = p5_instance.pixels return draw_func() def global_p5_injection(p5_sketch): """ Injects the p5js's skecth instance as a global variable to setup and draw functions """ def decorator(f): def wrapper(): global _P5_INSTANCE _P5_INSTANCE = p5_sketch return pre_draw(_P5_INSTANCE, f) return wrapper return decorator def start_p5(preload_func, setup_func, draw_func, event_functions): """ This is the entrypoint function. It accepts 2 parameters: - preload_func: a Python preload callable - setup_func: a Python setup callable - draw_func: a Python draw callable - event_functions: a config dict for the event functions in the format: {"eventFunctionName": python_event_function} This method gets the p5js's sketch instance and injects them """ def sketch_setup(p5_sketch): p5_sketch.preload = global_p5_injection(p5_sketch)(preload_func) p5_sketch.setup = global_p5_injection(p5_sketch)(setup_func) p5_sketch.draw = global_p5_injection(p5_sketch)(draw_func) instance = __new__(p5(sketch_setup, 'sketch-holder')) # inject event functions into p5 event_function_names = ( "deviceMoved", "deviceTurned", "deviceShaken", "windowResized", "keyPressed", "keyReleased", "keyTyped", "mousePressed", "mouseReleased", "mouseClicked", "doubleClicked", "mouseMoved", "mouseDragged", "mouseWheel", "touchStarted", "touchMoved", "touchEnded", "keyIsDown" ) for f_name in [f for f in event_function_names if event_functions.get(f, None)]: func = event_functions[f_name] event_func = global_p5_injection(instance)(func) setattr(instance, f_name, event_func) def logOnloaded(): console.log("Lib loaded!") def add_library(lib_name): # placeholder for https://github.com/berinhard/pyp5js/issues/31 src = '' return console.log("Lib name is not valid:", lib_name) console.log("Importing:", src) script = document.createElement("script") script.onload = logOnloaded script.src = src document.head.appendChild(script) ================================================ FILE: docs/examples/transcrypt/sketch_001/target/python_functions.js ================================================ // Transcrypt'ed from Python, 2021-11-02 13:06:09 import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, abs, all, any, assert, bool, bytearray, bytes, callable, chr, copy, deepcopy, delattr, dict, dir, divmod, enumerate, filter, float, getattr, hasattr, input, int, isinstance, issubclass, len, list, map, max, min, object, ord, pow, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, round, set, setattr, sorted, str, sum, tuple, zip} from './org.transcrypt.__runtime__.js'; var __name__ = 'python_functions'; export var PythonFunctions = __class__ ('PythonFunctions', [object], { __module__: __name__, }); setattr (PythonFunctions, 'map', map); setattr (PythonFunctions, 'filter', filter); setattr (PythonFunctions, 'set', set); //# sourceMappingURL=python_functions.map ================================================ FILE: docs/examples/transcrypt/sketch_001/target/python_functions.py ================================================ class PythonFunctions: pass setattr(PythonFunctions, 'map', map) setattr(PythonFunctions, 'filter', filter) setattr(PythonFunctions, 'set', set) ================================================ FILE: docs/examples/transcrypt/sketch_001/target/target_sketch.js ================================================ // Transcrypt'ed from Python, 2021-11-02 13:06:08 import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, all, any, assert, bool, bytearray, bytes, callable, chr, deepcopy, delattr, dict, dir, divmod, enumerate, getattr, hasattr, isinstance, issubclass, len, list, object, ord, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, set, setattr, sorted, sum, tuple, zip} from './org.transcrypt.__runtime__.js'; import {ADD, ALT, ARROW, AUDIO, AUTO, AXES, BACKSPACE, BASELINE, BEVEL, BEZIER, BLEND, BLUR, BOLD, BOLDITALIC, BOTTOM, BURN, CENTER, CHORD, CLAMP, CLOSE, CONTROL, CORNER, CORNERS, CROSS, CURVE, DARKEST, DEGREES, DEG_TO_RAD, DELETE, DIFFERENCE, DILATE, DODGE, DOWN_ARROW, ENTER, ERODE, ESCAPE, EXCLUSION, FILL, GRAY, GRID, HALF_PI, HAND, HARD_LIGHT, HSB, HSL, IMAGE, IMMEDIATE, INVERT, ITALIC, LANDSCAPE, LEFT, LEFT_ARROW, LIGHTEST, LINEAR, LINES, LINE_LOOP, LINE_STRIP, MIRROR, MITER, MOVE, MULTIPLY, NEAREST, NORMAL, OPAQUE, OPEN, OPTION, OVERLAY, P2D, PI, PIE, POINTS, PORTRAIT, POSTERIZE, PROJECT, PVector, QUADRATIC, QUADS, QUAD_STRIP, QUARTER_PI, RADIANS, RADIUS, RAD_TO_DEG, REPEAT, REPLACE, RETURN, RGB, RIGHT, RIGHT_ARROW, ROUND, SCREEN, SHIFT, SOFT_LIGHT, SQUARE, STROKE, SUBTRACT, TAB, TAU, TEXT, TEXTURE, THRESHOLD, TOP, TRIANGLES, TRIANGLE_FAN, TRIANGLE_STRIP, TWO_PI, UP_ARROW, VIDEO, WAIT, WEBGL, _CTX_MIDDLE, _DEFAULT_FILL, _DEFAULT_LEADMULT, _DEFAULT_STROKE, _DEFAULT_TEXT_FILL, _P5_INSTANCE, abs, accelerationX, accelerationY, accelerationZ, acos, add_library, alpha, ambientLight, ambientMaterial, angleMode, append, applyMatrix, arc, arrayCopy, asin, atan, atan2, background, beginContour, beginShape, bezier, bezierDetail, bezierPoint, bezierTangent, bezierVertex, blend, blendMode, blue, boolean, box, brightness, byte, camera, ceil, changed, char, circle, color, colorMode, concat, cone, constrain, copy, cos, createA, createAudio, createButton, createCamera, createCanvas, createCapture, createCheckbox, createColorPicker, createDiv, createElement, createFileInput, createGraphics, createImage, createImg, createInput, createNumberDict, createP, createRadio, createSelect, createShader, createSlider, createSpan, createStringDict, createVector, createVideo, createWriter, cursor, curve, curveDetail, curvePoint, curveTangent, curveTightness, curveVertex, cylinder, day, debugMode, degrees, deviceOrientation, directionalLight, disableFriendlyErrors, displayDensity, displayHeight, displayWidth, dist, ellipse, ellipseMode, ellipsoid, endContour, endShape, erase, exp, fill, filter, float, floor, focused, frameCount, frameRate, fullscreen, getURL, getURLParams, getURLPath, global_p5_injection, green, height, hex, hour, httpDo, httpGet, httpPost, hue, image, imageMode, image_proxy, input, int, join, key, keyCode, keyIsPressed, lerp, lerpColor, lightness, lights, line, loadBytes, loadFont, loadImage, loadJSON, loadModel, loadPixels, loadShader, loadStrings, loadTable, loadXML, log, logOnloaded, loop, mag, map, match, matchAll, max, millis, min, minute, model, month, mouseButton, mouseIsPressed, mouseX, mouseY, nf, nfc, nfp, nfs, noCanvas, noCursor, noDebugMode, noErase, noFill, noLoop, noSmooth, noStroke, noTint, noise, noiseDetail, noiseSeed, norm, normalMaterial, orbitControl, ortho, pAccelerationX, pAccelerationY, pAccelerationZ, pRotationX, pRotationY, pRotationZ, perspective, pixelDensity, pixels, plane, pmouseX, pmouseY, point, pointLight, popMatrix, popStyle, pow, pre_draw, push, pushMatrix, pushStyle, pwinMouseX, pwinMouseY, py_clear, py_get, py_pop, py_set, py_sort, py_split, quad, quadraticVertex, radians, random, randomGaussian, randomSeed, rect, rectMode, red, redraw, remove, removeElements, resetMatrix, resetShader, resizeCanvas, reverse, rotate, rotateX, rotateY, rotateZ, rotationX, rotationY, rotationZ, round, saturation, save, saveCanvas, saveFrames, saveJSON, saveStrings, saveTable, scale, second, select, selectAll, setAttributes, setCamera, setMoveThreshold, setShakeThreshold, shader, shearX, shearY, shininess, shorten, shuffle, sin, size, smooth, specularMaterial, sphere, splice, splitTokens, sq, sqrt, square, start_p5, str, stroke, strokeCap, strokeJoin, strokeWeight, subset, tan, text, textAlign, textAscent, textDescent, textFont, textLeading, textSize, textStyle, textWidth, texture, textureMode, textureWrap, tint, torus, touches, translate, triangle, trim, turnAxis, unchar, unhex, updatePixels, vertex, width, winMouseX, winMouseY, windowHeight, windowWidth, year} from './pyp5js.js'; var __name__ = '__main__'; export var preload = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } } else { } // pass; }; export var setup = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } } else { } // pass; }; export var draw = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } } else { } // pass; }; export var deviceMoved = null; export var deviceTurned = null; export var deviceShaken = null; export var keyPressed = null; export var keyReleased = null; export var keyTyped = null; export var mouseMoved = null; export var mouseDragged = null; export var mousePressed = null; export var mouseReleased = null; export var mouseClicked = null; export var doubleClicked = null; export var mouseWheel = null; export var touchStarted = null; export var touchMoved = null; export var touchEnded = null; export var windowResized = null; export var keyIsDown = null; export var t = 0; var setup = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } } else { } createCanvas (600, 600); stroke (250); strokeWeight (3); fill (40, 200, 40); }; var draw = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } } else { } background (10, 10); var xAngle = map (mouseX, 0, width, -(4) * PI, 4 * PI, true); var yAngle = map (mouseY, 0, height, -(4) * PI, 4 * PI, true); for (var x = 0; x < width; x += 30) { for (var y = 0; y < height; y += 30) { var angle = xAngle * (x / width) + yAngle * (y / height); var myX = x + 20 * cos ((2 * PI) * t + angle); var myY = y + 20 * sin ((2 * TWO_PI) * t + angle); ellipse (myX, myY, 10); } } t = t + 0.01; }; export var event_functions = dict ({'deviceMoved': deviceMoved, 'deviceTurned': deviceTurned, 'deviceShaken': deviceShaken, 'keyPressed': keyPressed, 'keyReleased': keyReleased, 'keyTyped': keyTyped, 'mouseMoved': mouseMoved, 'mouseDragged': mouseDragged, 'mousePressed': mousePressed, 'mouseReleased': mouseReleased, 'mouseClicked': mouseClicked, 'doubleClicked': doubleClicked, 'mouseWheel': mouseWheel, 'touchStarted': touchStarted, 'touchMoved': touchMoved, 'touchEnded': touchEnded, 'windowResized': windowResized, 'keyIsDown': keyIsDown}); start_p5 (preload, setup, draw, event_functions); //# sourceMappingURL=target_sketch.map ================================================ FILE: docs/examples/transcrypt/sketch_001/target/target_sketch.project ================================================ {"options": {"source": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_001/target_sketch.py", "anno": false, "alimod": false, "build": true, "complex": false, "docat": false, "dassert": false, "dcheck": false, "dextex": false, "dlog": false, "dmap": false, "dnostrip": false, "dstat": false, "dtree": false, "esv": null, "ecom": false, "fcall": false, "gen": false, "iconv": false, "jscall": false, "jskeys": false, "jsmod": false, "kwargs": true, "keycheck": false, "license": false, "map": true, "nomin": true, "opov": false, "outdir": null, "parent": null, "run": false, "symbols": null, "sform": false, "tconv": false, "unit": null, "verbose": false, "x": null, "xreex": false, "xglobs": false, "xpath": "/home/bernardo/envs/pyp5js/pyp5js/templates/transcrypt", "xtiny": false, "star": false}, "modules": [{"source": "/home/bernardo/.pyenv/versions/pyp5js/lib/python3.8/site-packages/transcrypt/modules/org/transcrypt/__runtime__.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_001/__target__/org.transcrypt.__runtime__.js"}, {"source": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_001/target_sketch.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_001/__target__/target_sketch.js"}, {"source": "/home/bernardo/envs/pyp5js/pyp5js/templates/transcrypt/pyp5js.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_001/__target__/pyp5js.js"}, {"source": "/home/bernardo/envs/pyp5js/pyp5js/templates/transcrypt/python_functions.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_001/__target__/python_functions.js"}]} ================================================ FILE: docs/examples/transcrypt/sketch_001/target/target_sketch.py ================================================ from pyp5js import * def preload(): pass def setup(): pass def draw(): pass deviceMoved = None deviceTurned = None deviceShaken = None keyPressed = None keyReleased = None keyTyped = None mouseMoved = None mouseDragged = None mousePressed = None mouseReleased = None mouseClicked = None doubleClicked = None mouseWheel = None touchStarted = None touchMoved = None touchEnded = None windowResized = None keyIsDown = None # https://p5js.org/examples/interaction-wavemaker.html t = 0 def setup(): createCanvas(600, 600) stroke(250) strokeWeight(3) fill(40, 200, 40) def draw(): global t background(10, 10) xAngle = map(mouseX, 0, width, -4 * PI, 4 * PI, True) yAngle = map(mouseY, 0, height, -4 * PI, 4 * PI, True) for x in range(0, width, 30): for y in range(0, height, 30): angle = xAngle * (x / width) + yAngle * (y / height) myX = x + 20 * cos(2 * PI * t + angle) myY = y + 20 * sin(2 * TWO_PI * t + angle) ellipse(myX, myY, 10) t = t + 0.01 event_functions = { "deviceMoved": deviceMoved, "deviceTurned": deviceTurned, "deviceShaken": deviceShaken, "keyPressed": keyPressed, "keyReleased": keyReleased, "keyTyped": keyTyped, "mouseMoved": mouseMoved, "mouseDragged": mouseDragged, "mousePressed": mousePressed, "mouseReleased": mouseReleased, "mouseClicked": mouseClicked, "doubleClicked": doubleClicked, "mouseWheel": mouseWheel, "touchStarted": touchStarted, "touchMoved": touchMoved, "touchEnded": touchEnded, "windowResized": windowResized, "keyIsDown": keyIsDown, } start_p5(preload, setup, draw, event_functions) ================================================ FILE: docs/examples/transcrypt/sketch_002/index.html ================================================ sketch_002 - pyp5js (using Transcrypt)

Python code here.

             
"""
 * Move Eye.
 * by Simon Greenwold.
 *
 * The camera lifts up (controlled by mouseY) while looking at the same point.
 """

def setup():
    createCanvas(640, 360, _P5_INSTANCE.WEBGL)
    fill(204)


def draw():
    ambientLight(50)
    directionalLight(255, 0, 0, 0.25, 0.25, 0);
    background(0)

    # Change height of the camera with mouseY
    camera(30.0, mouseY, 220.0,  # eyeX, eyeY, eyeZ
           0.0, 0.0, 0.0,        # centerX, centerY, centerZ
           0.0, 1.0, 0.0)        # upX, upY, upZ

    noStroke()
    box(90)
    stroke(255)
    line(-100, 0, 0, 100, 0, 0)
    line(0, -100, 0, 0, 100, 0)
    line(0, 0, -100, 0, 0, 100)

              
          
================================================ FILE: docs/examples/transcrypt/sketch_002/sketch_002.py ================================================ """ * Move Eye. * by Simon Greenwold. * * The camera lifts up (controlled by mouseY) while looking at the same point. """ def setup(): createCanvas(640, 360, _P5_INSTANCE.WEBGL) fill(204) def draw(): ambientLight(50) directionalLight(255, 0, 0, 0.25, 0.25, 0); background(0) # Change height of the camera with mouseY camera(30.0, mouseY, 220.0, # eyeX, eyeY, eyeZ 0.0, 0.0, 0.0, # centerX, centerY, centerZ 0.0, 1.0, 0.0) # upX, upY, upZ noStroke() box(90) stroke(255) line(-100, 0, 0, 100, 0, 0) line(0, -100, 0, 0, 100, 0) line(0, 0, -100, 0, 0, 100) ================================================ FILE: docs/examples/transcrypt/sketch_002/static/p5.js ================================================ /*! p5.js v1.0.0 February 29, 2020 */ !function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).p5=e()}}(function(){return function o(a,s,l){function u(t,e){if(!s[t]){if(!a[t]){var r="function"==typeof require&&require;if(!e&&r)return r(t,!0);if(h)return h(t,!0);var i=new Error("Cannot find module '"+t+"'");throw i.code="MODULE_NOT_FOUND",i}var n=s[t]={exports:{}};a[t][0].call(n.exports,function(e){return u(a[t][1][e]||e)},n,n.exports,o,a,s,l)}return s[t].exports}for(var h="function"==typeof require&&require,e=0;e>16&255,a[s++]=t>>8&255,a[s++]=255&t;2===o&&(t=u[e.charCodeAt(r)]<<2|u[e.charCodeAt(r+1)]>>4,a[s++]=255&t);1===o&&(t=u[e.charCodeAt(r)]<<10|u[e.charCodeAt(r+1)]<<4|u[e.charCodeAt(r+2)]>>2,a[s++]=t>>8&255,a[s++]=255&t);return a},r.fromByteArray=function(e){for(var t,r=e.length,i=r%3,n=[],o=0,a=r-i;o>2]+s[t<<4&63]+"==")):2==i&&(t=(e[r-2]<<8)+e[r-1],n.push(s[t>>10]+s[t>>4&63]+s[t<<2&63]+"="));return n.join("")};for(var s=[],u=[],h="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=0,o=i.length;n>18&63]+s[n>>12&63]+s[n>>6&63]+s[63&n]);return o.join("")}u["-".charCodeAt(0)]=62,u["_".charCodeAt(0)]=63},{}],20:[function(e,t,r){},{}],21:[function(N,e,F){(function(c){"use strict";var i=N("base64-js"),o=N("ieee754"),e="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;F.Buffer=c,F.SlowBuffer=function(e){+e!=e&&(e=0);return c.alloc(+e)},F.INSPECT_MAX_BYTES=50;var r=2147483647;function a(e){if(r>>1;case"base64":return O(e).length;default:if(n)return i?-1:R(e).length;t=(""+t).toLowerCase(),n=!0}}function d(e,t,r){var i=e[t];e[t]=e[r],e[r]=i}function p(e,t,r,i,n){if(0===e.length)return-1;if("string"==typeof r?(i=r,r=0):2147483647=e.length){if(n)return-1;r=e.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof t&&(t=c.from(t,i)),c.isBuffer(t))return 0===t.length?-1:m(e,t,r,i,n);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):m(e,[t],r,i,n);throw new TypeError("val must be string, number or Buffer")}function m(e,t,r,i,n){var o,a=1,s=e.length,l=t.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(e.length<2||t.length<2)return-1;s/=a=2,l/=2,r/=2}function u(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(n){var h=-1;for(o=r;o>8,n=r%256,o.push(n),o.push(i);return o}(t,e.length-r),e,r,i)}function b(e,t,r){return 0===t&&r===e.length?i.fromByteArray(e):i.fromByteArray(e.slice(t,r))}function _(e,t,r){r=Math.min(e.length,r);for(var i=[],n=t;n>>10&1023|55296),h=56320|1023&h),i.push(h),n+=c}return function(e){var t=e.length;if(t<=x)return String.fromCharCode.apply(String,e);var r="",i=0;for(;ithis.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e=e||"utf8";;)switch(e){case"hex":return M(this,t,r);case"utf8":case"utf-8":return _(this,t,r);case"ascii":return w(this,t,r);case"latin1":case"binary":return S(this,t,r);case"base64":return b(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,t,r);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}.apply(this,arguments)},c.prototype.equals=function(e){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===c.compare(this,e)},c.prototype.inspect=function(){var e="",t=F.INSPECT_MAX_BYTES;return e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(e+=" ... "),""},e&&(c.prototype[e]=c.prototype.inspect),c.prototype.compare=function(e,t,r,i,n){if(A(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),t<0||r>e.length||i<0||n>this.length)throw new RangeError("out of range index");if(n<=i&&r<=t)return 0;if(n<=i)return-1;if(r<=t)return 1;if(this===e)return 0;for(var o=(n>>>=0)-(i>>>=0),a=(r>>>=0)-(t>>>=0),s=Math.min(o,a),l=this.slice(i,n),u=e.slice(t,r),h=0;h>>=0,isFinite(r)?(r>>>=0,void 0===i&&(i="utf8")):(i=r,r=void 0)}var n=this.length-t;if((void 0===r||nthis.length)throw new RangeError("Attempt to write outside buffer bounds");i=i||"utf8";for(var o,a,s,l,u,h,c=!1;;)switch(i){case"hex":return g(this,e,t,r);case"utf8":case"utf-8":return u=t,h=r,D(R(e,(l=this).length-u),l,u,h);case"ascii":return v(this,e,t,r);case"latin1":case"binary":return v(this,e,t,r);case"base64":return o=this,a=t,s=r,D(O(e),o,a,s);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return y(this,e,t,r);default:if(c)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),c=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var x=4096;function w(e,t,r){var i="";r=Math.min(e.length,r);for(var n=t;ne.length)throw new RangeError("Index out of range")}function P(e,t,r,i){if(r+i>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function L(e,t,r,i,n){return t=+t,r>>>=0,n||P(e,0,r,4),o.write(e,t,r,i,23,4),r+4}function k(e,t,r,i,n){return t=+t,r>>>=0,n||P(e,0,r,8),o.write(e,t,r,i,52,8),r+8}c.prototype.slice=function(e,t){var r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):r>>=0,t>>>=0,r||T(e,t,this.length);for(var i=this[e],n=1,o=0;++o>>=0,t>>>=0,r||T(e,t,this.length);for(var i=this[e+--t],n=1;0>>=0,t||T(e,1,this.length),this[e]},c.prototype.readUInt16LE=function(e,t){return e>>>=0,t||T(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUInt16BE=function(e,t){return e>>>=0,t||T(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUInt32LE=function(e,t){return e>>>=0,t||T(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUInt32BE=function(e,t){return e>>>=0,t||T(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||T(e,t,this.length);for(var i=this[e],n=1,o=0;++o>>=0,t>>>=0,r||T(e,t,this.length);for(var i=t,n=1,o=this[e+--i];0>>=0,t||T(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){e>>>=0,t||T(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(e,t){e>>>=0,t||T(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(e,t){return e>>>=0,t||T(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return e>>>=0,t||T(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readFloatLE=function(e,t){return e>>>=0,t||T(e,4,this.length),o.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return e>>>=0,t||T(e,4,this.length),o.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return e>>>=0,t||T(e,8,this.length),o.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return e>>>=0,t||T(e,8,this.length),o.read(this,e,!1,52,8)},c.prototype.writeUIntLE=function(e,t,r,i){e=+e,t>>>=0,r>>>=0,i||C(this,e,t,r,Math.pow(2,8*r)-1,0);var n=1,o=0;for(this[t]=255&e;++o>>=0,r>>>=0,i||C(this,e,t,r,Math.pow(2,8*r)-1,0);var n=r-1,o=1;for(this[t+n]=255&e;0<=--n&&(o*=256);)this[t+n]=e/o&255;return t+r},c.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,1,255,0),this[t]=255&e,t+1},c.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},c.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeIntLE=function(e,t,r,i){if(e=+e,t>>>=0,!i){var n=Math.pow(2,8*r-1);C(this,e,t,r,n-1,-n)}var o=0,a=1,s=0;for(this[t]=255&e;++o>0)-s&255;return t+r},c.prototype.writeIntBE=function(e,t,r,i){if(e=+e,t>>>=0,!i){var n=Math.pow(2,8*r-1);C(this,e,t,r,n-1,-n)}var o=r-1,a=1,s=0;for(this[t+o]=255&e;0<=--o&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+r},c.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},c.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeFloatLE=function(e,t,r){return L(this,e,t,!0,r)},c.prototype.writeFloatBE=function(e,t,r){return L(this,e,t,!1,r)},c.prototype.writeDoubleLE=function(e,t,r){return k(this,e,t,!0,r)},c.prototype.writeDoubleBE=function(e,t,r){return k(this,e,t,!1,r)},c.prototype.copy=function(e,t,r,i){if(!c.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r=r||0,i||0===i||(i=this.length),t>=e.length&&(t=e.length),t=t||0,0=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t>>=0,r=void 0===r?this.length:r>>>0,"number"==typeof(e=e||0))for(o=t;o>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function O(e){return i.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(t,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function D(e,t,r,i){for(var n=0;n=t.length||n>=e.length);++n)t[n+r]=e[n];return n}function A(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function I(e){return e!=e}var U=function(){for(var e="0123456789abcdef",t=new Array(256),r=0;r<16;++r)for(var i=16*r,n=0;n<16;++n)t[i+n]=e[r]+e[n];return t}()}).call(this,N("buffer").Buffer)},{"base64-js":19,buffer:21,ieee754:30}],22:[function(e,t,r){"use strict";t.exports=e("./").polyfill()},{"./":23}],23:[function(z,r,i){(function(j,V){var e,t;e=this,t=function(){"use strict";function l(e){return"function"==typeof e}var r=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},i=0,t=void 0,n=void 0,a=function(e,t){f[i]=e,f[i+1]=t,2===(i+=2)&&(n?n(d):y())};var e="undefined"!=typeof window?window:void 0,o=e||{},s=o.MutationObserver||o.WebKitMutationObserver,u="undefined"==typeof self&&void 0!==j&&"[object process]"==={}.toString.call(j),h="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function c(){var e=setTimeout;return function(){return e(d,1)}}var f=new Array(1e3);function d(){for(var e=0;e":">",'"':""","'":"'","/":"/"};function S(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,function(e){return w[e]}):e}var M=function(){function i(e){var t,r=1=this.maxReplaces)break}for(a=0;r=this.regexp.exec(e);){if(void 0===(i=h(r[1].trim())))if("function"==typeof c){var d=c(e,r,t);i="string"==typeof d?d:""}else this.logger.warn("missed to pass in variable ".concat(r[1]," for interpolating ").concat(e)),i="";else"string"==typeof i||this.useRawValueToEscape||(i=v(i));if(i=this.escapeValue?u(this.escape(i)):u(i),e=e.replace(r[0],i),this.regexp.lastIndex=0,++a>=this.maxReplaces)break}return e}},{key:"nest",value:function(e,t,r){var i,n,o=D({},2>1,h=-7,c=r?n-1:0,f=r?-1:1,d=e[t+c];for(c+=f,o=d&(1<<-h)-1,d>>=-h,h+=s;0>=-h,h+=i;0>1,f=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,d=i?0:o-1,p=i?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=h):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),2<=(t+=1<=a+c?f/l:f*Math.pow(2,1-c))*l&&(a++,l/=2),h<=a+c?(s=0,a=h):1<=a+c?(s=(t*l-1)*Math.pow(2,n),a+=c):(s=t*Math.pow(2,c-1)*Math.pow(2,n),a=0));8<=n;e[r+d]=255&s,d+=p,s/=256,n-=8);for(a=a<Math.abs(e[0])&&(t=1),Math.abs(e[2])>Math.abs(e[t])&&(t=2),t}var C=4e150;function P(e,t){e.f+=t.f,e.b.f+=t.b.f}function u(e,t,r){return e=e.a,t=t.a,r=r.a,t.b.a===e?r.b.a===e?v(t.a,r.a)?b(r.b.a,t.a,r.a)<=0:0<=b(t.b.a,r.a,t.a):b(r.b.a,e,r.a)<=0:r.b.a===e?0<=b(t.b.a,e,t.a):(t=y(t.b.a,e,t.a),(e=y(r.b.a,e,r.a))<=t)}function L(e){e.a.i=null;var t=e.e;t.a.c=t.c,t.c.a=t.a,e.e=null}function h(e,t){c(e.a),e.c=!1,(e.a=t).i=e}function k(e){for(var t=e.a.a;(e=fe(e)).a.a===t;);return e.c&&(h(e,t=f(ce(e).a.b,e.a.e)),e=fe(e)),e}function R(e,t,r){var i=new he;return i.a=r,i.e=W(e.f,t.e,i),r.i=i}function O(e,t){switch(e.s){case 100130:return 0!=(1&t);case 100131:return 0!==t;case 100132:return 0>1]],s[a[u]])?le(r,u):ue(r,u)),s[o]=null,l[o]=r.b,r.b=o}else for(r.c[-(o+1)]=null;0Math.max(a.a,l.a))return!1;if(v(o,a)){if(0i.f&&(i.f*=2,i.c=oe(i.c,i.f+1)),0===i.b?r=n:(r=i.b,i.b=i.c[i.b]),i.e[r]=t,i.c[r]=n,i.d[n]=r,i.h&&ue(i,n),r}return i=e.a++,e.c[i]=t,-(i+1)}function ie(e){if(0===e.a)return se(e.b);var t=e.c[e.d[e.a-1]];if(0!==e.b.a&&v(ae(e.b),t))return se(e.b);for(;--e.a,0e.a||v(i[a],i[l])){n[r[o]=a]=o;break}n[r[o]=l]=o,o=s}}function ue(e,t){for(var r=e.d,i=e.e,n=e.c,o=t,a=r[o];;){var s=o>>1,l=r[s];if(0==s||v(i[l],i[a])){n[r[o]=a]=o;break}n[r[o]=l]=o,o=s}}function he(){this.e=this.a=null,this.f=0,this.c=this.b=this.h=this.d=!1}function ce(e){return e.e.c.b}function fe(e){return e.e.a.b}(i=q.prototype).x=function(){Y(this,0)},i.B=function(e,t){switch(e){case 100142:return;case 100140:switch(t){case 100130:case 100131:case 100132:case 100133:case 100134:return void(this.s=t)}break;case 100141:return void(this.m=!!t);default:return void Z(this,100900)}Z(this,100901)},i.y=function(e){switch(e){case 100142:return 0;case 100140:return this.s;case 100141:return this.m;default:Z(this,100900)}return!1},i.A=function(e,t,r){this.j[0]=e,this.j[1]=t,this.j[2]=r},i.z=function(e,t){var r=t||null;switch(e){case 100100:case 100106:this.h=r;break;case 100104:case 100110:this.l=r;break;case 100101:case 100107:this.k=r;break;case 100102:case 100108:this.i=r;break;case 100103:case 100109:this.p=r;break;case 100105:case 100111:this.o=r;break;case 100112:this.r=r;break;default:Z(this,100900)}},i.C=function(e,t){var r=!1,i=[0,0,0];Y(this,2);for(var n=0;n<3;++n){var o=e[n];o<-1e150&&(o=-1e150,r=!0),1e150n[u]&&(n[u]=h,a[u]=l)}if(l=0,n[1]-o[1]>n[0]-o[0]&&(l=1),n[2]-o[2]>n[l]-o[l]&&(l=2),o[l]>=n[l])i[0]=0,i[1]=0,i[2]=1;else{for(n=0,o=s[l],a=a[l],s=[0,0,0],o=[o.g[0]-a.g[0],o.g[1]-a.g[1],o.g[2]-a.g[2]],u=[0,0,0],l=r.e;l!==r;l=l.e)u[0]=l.g[0]-a.g[0],u[1]=l.g[1]-a.g[1],u[2]=l.g[2]-a.g[2],s[0]=o[1]*u[2]-o[2]*u[1],s[1]=o[2]*u[0]-o[0]*u[2],s[2]=o[0]*u[1]-o[1]*u[0],n<(h=s[0]*s[0]+s[1]*s[1]+s[2]*s[2])&&(n=h,i[0]=s[0],i[1]=s[1],i[2]=s[2]);n<=0&&(i[0]=i[1]=i[2]=0,i[T(o)]=1)}r=!0}for(s=T(i),l=this.b.c,n=(s+1)%3,a=(s+2)%3,s=0>=l,h-=l,g!=o){if(g==a)break;for(var v=g>8,++y;var _=b;if(i>=8;null!==m&&s<4096&&(p[s++]=m<<8|_,u+1<=s&&l<12&&(++l,u=u<<1|1)),m=g}else s=1+a,u=(1<<(l=n+1))-1,m=null}return f!==i&&console.log("Warning, gif stream shorter than expected."),r}try{r.GifWriter=function(v,e,t,r){var y=0,i=void 0===(r=void 0===r?{}:r).loop?null:r.loop,b=void 0===r.palette?null:r.palette;if(e<=0||t<=0||65535>=1;)++n;if(a=1<>8&255,v[y++]=255&t,v[y++]=t>>8&255,v[y++]=(null!==b?128:0)|n,v[y++]=o,v[y++]=0,null!==b)for(var s=0,l=b.length;s>16&255,v[y++]=u>>8&255,v[y++]=255&u}if(null!==i){if(i<0||65535>8&255,v[y++]=0}var x=!1;this.addFrame=function(e,t,r,i,n,o){if(!0===x&&(--y,x=!1),o=void 0===o?{}:o,e<0||t<0||65535>=1;)++u;l=1<>8&255,v[y++]=d,v[y++]=0),v[y++]=44,v[y++]=255&e,v[y++]=e>>8&255,v[y++]=255&t,v[y++]=t>>8&255,v[y++]=255&r,v[y++]=r>>8&255,v[y++]=255&i,v[y++]=i>>8&255,v[y++]=!0===a?128|u-1:0,!0===a)for(var p=0,m=s.length;p>16&255,v[y++]=g>>8&255,v[y++]=255&g}return y=function(t,r,e,i){t[r++]=e;var n=r++,o=1<>=8,h-=8,r===n+256&&(t[n]=255,n=r++)}function d(e){c|=e<>=8,h-=8,r===n+256&&(t[n]=255,n=r++);4096===l?(d(o),l=1+s,u=e+1,m={}):(1<>7,n=1<<1+(7&r);x[e++],x[e++];var o=null,a=null;i&&(o=e,e+=3*(a=n));var s=!0,l=[],u=0,h=null,c=0,f=null;for(this.width=w,this.height=t;s&&e>2&7,e++;break;case 254:for(;;){if(!(0<=(C=x[e++])))throw Error("Invalid block size");if(0===C)break;e+=C}break;default:throw new Error("Unknown graphic control label: 0x"+x[e-1].toString(16))}break;case 44:var p=x[e++]|x[e++]<<8,m=x[e++]|x[e++]<<8,g=x[e++]|x[e++]<<8,v=x[e++]|x[e++]<<8,y=x[e++],b=y>>6&1,_=1<<1+(7&y),S=o,M=a,E=!1;if(y>>7){E=!0;S=e,e+=3*(M=_)}var T=e;for(e++;;){var C;if(!(0<=(C=x[e++])))throw Error("Invalid block size");if(0===C)break;e+=C}l.push({x:p,y:m,width:g,height:v,has_local_palette:E,palette_offset:S,palette_size:M,data_offset:T,data_length:e-T,transparent_index:h,interlaced:!!b,delay:u,disposal:c});break;case 59:s=!1;break;default:throw new Error("Unknown gif block: 0x"+x[e-1].toString(16))}this.numFrames=function(){return l.length},this.loopCount=function(){return f},this.frameInfo=function(e){if(e<0||e>=l.length)throw new Error("Frame index out of range.");return l[e]},this.decodeAndBlitFrameBGRA=function(e,t){var r=this.frameInfo(e),i=r.width*r.height,n=new Uint8Array(i);P(x,r.data_offset,n,i);var o=r.palette_offset,a=r.transparent_index;null===a&&(a=256);var s=r.width,l=w-s,u=s,h=4*(r.y*w+r.x),c=4*((r.y+r.height)*w+r.x),f=h,d=4*l;!0===r.interlaced&&(d+=4*w*7);for(var p=8,m=0,g=n.length;m>=1)),v===a)f+=4;else{var y=x[o+3*v],b=x[o+3*v+1],_=x[o+3*v+2];t[f++]=_,t[f++]=b,t[f++]=y,t[f++]=255}--u}},this.decodeAndBlitFrameRGBA=function(e,t){var r=this.frameInfo(e),i=r.width*r.height,n=new Uint8Array(i);P(x,r.data_offset,n,i);var o=r.palette_offset,a=r.transparent_index;null===a&&(a=256);var s=r.width,l=w-s,u=s,h=4*(r.y*w+r.x),c=4*((r.y+r.height)*w+r.x),f=h,d=4*l;!0===r.interlaced&&(d+=4*w*7);for(var p=8,m=0,g=n.length;m>=1)),v===a)f+=4;else{var y=x[o+3*v],b=x[o+3*v+1],_=x[o+3*v+2];t[f++]=y,t[f++]=b,t[f++]=_,t[f++]=255}--u}}}}catch(e){}},{}],33:[function(jr,t,r){(function(Gr){var e;e=this,function(E){"use strict";function e(e){if(null==this)throw TypeError();var t=String(this),r=t.length,i=e?Number(e):0;if(i!=i&&(i=0),!(i<0||r<=i)){var n,o=t.charCodeAt(i);return 55296<=o&&o<=56319&&i+1>>=1,t}function _(e,t,r){if(!t)return r;for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<>>16-t;return e.tag>>>=t,e.bitcount-=t,i+r}function x(e,t){for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<>>=1,++n,r+=t.table[n],0<=(i-=t.table[n]););return e.tag=o,e.bitcount-=n,t.trans[r+i]}function w(e,t,r){var i,n,o,a,s,l;for(i=_(e,5,257),n=_(e,5,1),o=_(e,4,4),a=0;a<19;++a)g[a]=0;for(a=0;athis.x2&&(this.x2=e)),"number"==typeof t&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=t,this.y2=t),tthis.y2&&(this.y2=t))},C.prototype.addX=function(e){this.addPoint(e,null)},C.prototype.addY=function(e){this.addPoint(null,e)},C.prototype.addBezier=function(e,t,r,i,n,o,a,s){var l=this,u=[e,t],h=[r,i],c=[n,o],f=[a,s];this.addPoint(e,t),this.addPoint(a,s);for(var d=0;d<=1;d++){var p=6*u[d]-12*h[d]+6*c[d],m=-3*u[d]+9*h[d]-9*c[d]+3*f[d],g=3*h[d]-3*u[d];if(0!=m){var v=Math.pow(p,2)-4*g*m;if(!(v<0)){var y=(-p+Math.sqrt(v))/(2*m);0>8&255,255&e]},A.USHORT=U(2),D.SHORT=function(e){return 32768<=e&&(e=-(65536-e)),[e>>8&255,255&e]},A.SHORT=U(2),D.UINT24=function(e){return[e>>16&255,e>>8&255,255&e]},A.UINT24=U(3),D.ULONG=function(e){return[e>>24&255,e>>16&255,e>>8&255,255&e]},A.ULONG=U(4),D.LONG=function(e){return R<=e&&(e=-(2*R-e)),[e>>24&255,e>>16&255,e>>8&255,255&e]},A.LONG=U(4),D.FIXED=D.ULONG,A.FIXED=A.ULONG,D.FWORD=D.SHORT,A.FWORD=A.SHORT,D.UFWORD=D.USHORT,A.UFWORD=A.USHORT,D.LONGDATETIME=function(e){return[0,0,0,0,e>>24&255,e>>16&255,e>>8&255,255&e]},A.LONGDATETIME=U(8),D.TAG=function(e){return k.argument(4===e.length,"Tag should be exactly 4 ASCII characters."),[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]},A.TAG=U(4),D.Card8=D.BYTE,A.Card8=A.BYTE,D.Card16=D.USHORT,A.Card16=A.USHORT,D.OffSize=D.BYTE,A.OffSize=A.BYTE,D.SID=D.USHORT,A.SID=A.USHORT,D.NUMBER=function(e){return-107<=e&&e<=107?[e+139]:108<=e&&e<=1131?[247+((e-=108)>>8),255&e]:-1131<=e&&e<=-108?[251+((e=-e-108)>>8),255&e]:-32768<=e&&e<=32767?D.NUMBER16(e):D.NUMBER32(e)},A.NUMBER=function(e){return D.NUMBER(e).length},D.NUMBER16=function(e){return[28,e>>8&255,255&e]},A.NUMBER16=U(3),D.NUMBER32=function(e){return[29,e>>24&255,e>>16&255,e>>8&255,255&e]},A.NUMBER32=U(5),D.REAL=function(e){var t=e.toString(),r=/\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec(t);if(r){var i=parseFloat("1e"+((r[2]?+r[2]:0)+r[1].length));t=(Math.round(e*i)/i).toString()}for(var n="",o=0,a=t.length;o>8&255,t[t.length]=255&i}return t},A.UTF16=function(e){return 2*e.length};var N={"x-mac-croatian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈ƫȅ ÀÃÕŒœĐ—“”‘’÷◊©⁄€‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ","x-mac-cyrillic":"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю","x-mac-gaelic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØḂ±≤≥ḃĊċḊḋḞḟĠġṀæøṁṖṗɼƒſṠ«»… ÀÃÕŒœ–—“”‘’ṡẛÿŸṪ€‹›Ŷŷṫ·Ỳỳ⁊ÂÊÁËÈÍÎÏÌÓÔ♣ÒÚÛÙıÝýŴŵẄẅẀẁẂẃ","x-mac-greek":"Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦€ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ­","x-mac-icelandic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüݰ¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-inuit":"ᐃᐄᐅᐆᐊᐋᐱᐲᐳᐴᐸᐹᑉᑎᑏᑐᑑᑕᑖᑦᑭᑮᑯᑰᑲᑳᒃᒋᒌᒍᒎᒐᒑ°ᒡᒥᒦ•¶ᒧ®©™ᒨᒪᒫᒻᓂᓃᓄᓅᓇᓈᓐᓯᓰᓱᓲᓴᓵᔅᓕᓖᓗᓘᓚᓛᓪᔨᔩᔪᔫᔭ… ᔮᔾᕕᕖᕗ–—“”‘’ᕘᕙᕚᕝᕆᕇᕈᕉᕋᕌᕐᕿᖀᖁᖂᖃᖄᖅᖏᖐᖑᖒᖓᖔᖕᙱᙲᙳᙴᙵᙶᖖᖠᖡᖢᖣᖤᖥᖦᕼŁł","x-mac-ce":"ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ",macintosh:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-romanian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂȘ∞±≤≥¥µ∂∑∏π∫ªºΩăș¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›Țț‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-turkish":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙˆ˜¯˘˙˚¸˝˛ˇ"};O.MACSTRING=function(e,t,r,i){var n=N[i];if(void 0!==n){for(var o="",a=0;a>8&255,l+256&255)}return o}D.MACSTRING=function(e,t){var r=function(e){if(!F)for(var t in F={},N)F[t]=new String(t);var r=F[e];if(void 0!==r){if(B){var i=B.get(r);if(void 0!==i)return i}var n=N[e];if(void 0!==n){for(var o={},a=0;a>8,t[c+1]=255&f,t=t.concat(i[h])}return t},A.TABLE=function(e){for(var t=0,r=e.fields.length,i=0;i>1,t.skip("uShort",3),e.glyphIndexMap={};for(var a=new se.Parser(r,i+n+14),s=new se.Parser(r,i+n+16+2*o),l=new se.Parser(r,i+n+16+4*o),u=new se.Parser(r,i+n+16+6*o),h=i+n+16+8*o,c=0;c>4,o=15&i;if(15==n)break;if(t+=r[n],15==o)break;t+=r[o]}return parseFloat(t)}(e);if(32<=t&&t<=246)return t-139;if(247<=t&&t<=250)return 256*(t-247)+e.parseByte()+108;if(251<=t&&t<=254)return 256*-(t-251)-e.parseByte()-108;throw new Error("Invalid b0 "+t)}function Te(e,t,r){t=void 0!==t?t:0;var i=new se.Parser(e,t),n=[],o=[];for(r=void 0!==r?r:e.length;i.relativeOffset>1,T.length=0,P=!0}return function e(t){for(var r,i,n,o,a,s,l,u,h,c,f,d,p=0;pMath.abs(d-R)?k=f+T.shift():R=d+T.shift(),E.curveTo(y,b,_,x,l,u),E.curveTo(h,c,f,d,k,R);break;default:console.log("Glyph "+v.index+": unknown operator 1200"+m),T.length=0}break;case 14:0>3;break;case 21:2>16),p+=2;break;case 29:a=T.pop()+g.gsubrsBias,(s=g.gsubrs[a])&&e(s);break;case 30:for(;0=r.begin&&e=fe.length){var a=i.parseChar();r.names.push(i.parseString(a))}break;case 2.5:r.numberOfGlyphs=i.parseUShort(),r.offset=new Array(r.numberOfGlyphs);for(var s=0;st.value.tag?1:-1}),t.fields=t.fields.concat(i),t.fields=t.fields.concat(n),t}function gt(e,t,r){for(var i=0;i 123 are reserved for internal usage");d|=1<>>1,o=e[n].tag;if(o===t)return n;o>>1,o=e[n];if(o===t)return n;o>>1,a=(r=e[o]).start;if(a===t)return r;a(r=e[i-1]).end?0:r}function xt(e,t){this.font=e,this.tableName=t}function wt(e){xt.call(this,e,"gpos")}function St(e){xt.call(this,e,"gsub")}function Mt(e,t){var r=e.length;if(r!==t.length)return!1;for(var i=0;it.points.length-1||i.matchedPoints[1]>n.points.length-1)throw Error("Matched points out of range in "+t.name);var a=t.points[i.matchedPoints[0]],s=n.points[i.matchedPoints[1]],l={xScale:i.xScale,scale01:i.scale01,scale10:i.scale10,yScale:i.yScale,dx:0,dy:0};s=kt([s],l)[0],l.dx=a.x-s.x,l.dy=a.y-s.y,o=kt(n.points,l)}t.points=t.points.concat(o)}}return Rt(t.points)}(wt.prototype=xt.prototype={searchTag:yt,binSearch:bt,getTable:function(e){var t=this.font.tables[this.tableName];return!t&&e&&(t=this.font.tables[this.tableName]=this.createDefaultTable()),t},getScriptNames:function(){var e=this.getTable();return e?e.scripts.map(function(e){return e.tag}):[]},getDefaultScriptName:function(){var e=this.getTable();if(e){for(var t=!1,r=0;r=s[u-1].tag,"Features must be added in alphabetical order."),o={tag:r,feature:{params:0,lookupListIndexes:[]}},s.push(o),a.push(u),o.feature}}},getLookupTables:function(e,t,r,i,n){var o=this.getFeatureTable(e,t,r,n),a=[];if(o){for(var s,l=o.lookupListIndexes,u=this.font.tables[this.tableName].lookups,h=0;h",s),t.stack.push(Math.round(64*s))}function vr(e,t){var r=t.stack,i=r.pop(),n=t.fv,o=t.pv,a=t.ppem,s=t.deltaBase+16*(e-1),l=t.deltaShift,u=t.z0;E.DEBUG&&console.log(t.step,"DELTAP["+e+"]",i,r);for(var h=0;h>4)===a){var d=(15&f)-8;0<=d&&d++,E.DEBUG&&console.log(t.step,"DELTAPFIX",c,"by",d*l);var p=u[c];n.setRelative(p,p,d*l,o)}}}function yr(e,t){var r=t.stack,i=r.pop();E.DEBUG&&console.log(t.step,"ROUND[]"),r.push(64*t.round(i/64))}function br(e,t){var r=t.stack,i=r.pop(),n=t.ppem,o=t.deltaBase+16*(e-1),a=t.deltaShift;E.DEBUG&&console.log(t.step,"DELTAC["+e+"]",i,r);for(var s=0;s>4)===n){var h=(15&u)-8;0<=h&&h++;var c=h*a;E.DEBUG&&console.log(t.step,"DELTACFIX",l,"by",c),t.cvt[l]+=c}}}function _r(e,t){var r,i,n=t.stack,o=n.pop(),a=n.pop(),s=t.z2[o],l=t.z1[a];E.DEBUG&&console.log(t.step,"SDPVTL["+e+"]",o,a),i=e?(r=s.y-l.y,l.x-s.x):(r=l.x-s.x,l.y-s.y),t.dpv=Zt(r,i)}function xr(e,t){var r=t.stack,i=t.prog,n=t.ip;E.DEBUG&&console.log(t.step,"PUSHB["+e+"]");for(var o=0;o":"_")+(i?"R":"_")+(0===n?"Gr":1===n?"Bl":2===n?"Wh":"")+"]",e?c+"("+o.cvt[c]+","+u+")":"",f,"(d =",a,"->",l*s,")"),o.rp1=o.rp0,o.rp2=f,t&&(o.rp0=f)}Ft.prototype.exec=function(e,t){if("number"!=typeof t)throw new Error("Point size is not a number!");if(!(2",i),s.interpolate(c,o,a,l),s.touch(c)}e.loop=1},dr.bind(void 0,0),dr.bind(void 0,1),function(e){for(var t=e.stack,r=e.rp0,i=e.z0[r],n=e.loop,o=e.fv,a=e.pv,s=e.z1;n--;){var l=t.pop(),u=s[l];E.DEBUG&&console.log(e.step,(1=a.width||t>=a.height?[0,0,0,0]:this._getPixel(e,t);var s=new l.default.Image(r,i);return s.canvas.getContext("2d").drawImage(a,e,t,r*o,i*o,0,0,r,i),s},l.default.Renderer.prototype.textLeading=function(e){return"number"==typeof e?(this._setProperty("_textLeading",e),this._pInst):this._textLeading},l.default.Renderer.prototype.textSize=function(e){return"number"==typeof e?(this._setProperty("_textSize",e),this._setProperty("_textLeading",e*y._DEFAULT_LEADMULT),this._applyTextProperties()):this._textSize},l.default.Renderer.prototype.textStyle=function(e){return e?(e!==y.NORMAL&&e!==y.ITALIC&&e!==y.BOLD&&e!==y.BOLDITALIC||this._setProperty("_textStyle",e),this._applyTextProperties()):this._textStyle},l.default.Renderer.prototype.textAscent=function(){return null===this._textAscent&&this._updateTextMetrics(),this._textAscent},l.default.Renderer.prototype.textDescent=function(){return null===this._textDescent&&this._updateTextMetrics(),this._textDescent},l.default.Renderer.prototype.textAlign=function(e,t){return void 0!==e?(this._setProperty("_textAlign",e),void 0!==t&&this._setProperty("_textBaseline",t),this._applyTextProperties()):{horizontal:this._textAlign,vertical:this._textBaseline}},l.default.Renderer.prototype.text=function(e,t,r,i,n){var o,a,s,l,u,h,c,f,d=this._pInst,p=Number.MAX_VALUE;if((this._doFill||this._doStroke)&&void 0!==e){if("string"!=typeof e&&(e=e.toString()),o=(e=e.replace(/(\t)/g," ")).split("\n"),void 0!==i){for(s=f=0;ss.HALF_PI&&e<=3*s.HALF_PI?Math.atan(r/i*Math.tan(e))+s.PI:Math.atan(r/i*Math.tan(e))+s.TWO_PI,t=t<=s.HALF_PI?Math.atan(r/i*Math.tan(t)):t>s.HALF_PI&&t<=3*s.HALF_PI?Math.atan(r/i*Math.tan(t))+s.PI:Math.atan(r/i*Math.tan(t))+s.TWO_PI),tv||Math.abs(this.accelerationY-this.pAccelerationY)>v||Math.abs(this.accelerationZ-this.pAccelerationZ)>v)&&e();var t=this.deviceTurned||window.deviceTurned;if("function"==typeof t){var r=this.rotationX+180,i=this.pRotationX+180,n=c+180;0>>24],i+=x[(16711680&C)>>16],n+=x[(65280&C)>>8],o+=x[255&C],r+=k[_],s++}w[l=T+y]=a/r,S[l]=i/r,M[l]=n/r,E[l]=o/r}T+=d}for(h=(u=-P)*d,b=T=0;b>>16,e[r+1]=(65280&t[i])>>>8,e[r+2]=255&t[i],e[r+3]=(4278190080&t[i])>>>24},O._toImageData=function(e){return e instanceof ImageData?e:e.getContext("2d").getImageData(0,0,e.width,e.height)},O._createImageData=function(e,t){return O._tmpCanvas=document.createElement("canvas"),O._tmpCtx=O._tmpCanvas.getContext("2d"),this._tmpCtx.createImageData(e,t)},O.apply=function(e,t,r){var i=e.getContext("2d"),n=i.getImageData(0,0,e.width,e.height),o=t(n,r);o instanceof ImageData?i.putImageData(o,0,0,0,0,e.width,e.height):i.putImageData(n,0,0,0,0,e.width,e.height)},O.threshold=function(e,t){var r=O._toPixels(e);void 0===t&&(t=.5);for(var i=Math.floor(255*t),n=0;n>8)/i,r[n+1]=255*(a*t>>8)/i,r[n+2]=255*(s*t>>8)/i}},O.dilate=function(e){for(var t,r,i,n,o,a,s,l,u,h,c,f,d,p,m,g,v,y=O._toPixels(e),b=0,_=y.length?y.length/4:0,x=new Int32Array(_);b<_;)for(r=(t=b)+e.width;b>16&255)+151*(i>>8&255)+28*(255&i))<(m=77*(c>>16&255)+151*(c>>8&255)+28*(255&c))&&(n=c,o=m),o<(p=77*((h=O._getARGB(y,a))>>16&255)+151*(h>>8&255)+28*(255&h))&&(n=h,o=p),o<(g=77*(f>>16&255)+151*(f>>8&255)+28*(255&f))&&(n=f,o=g),o<(v=77*(d>>16&255)+151*(d>>8&255)+28*(255&d))&&(n=d,o=v),x[b++]=n;O._setPixels(y,x)},O.erode=function(e){for(var t,r,i,n,o,a,s,l,u,h,c,f,d,p,m,g,v,y=O._toPixels(e),b=0,_=y.length?y.length/4:0,x=new Int32Array(_);b<_;)for(r=(t=b)+e.width;b>16&255)+151*(c>>8&255)+28*(255&c))<(o=77*(i>>16&255)+151*(i>>8&255)+28*(255&i))&&(n=c,o=m),(p=77*((h=O._getARGB(y,a))>>16&255)+151*(h>>8&255)+28*(255&h))>16&255)+151*(f>>8&255)+28*(255&f))>16&255)+151*(d>>8&255)+28*(255&d))=r){var i=Math.floor(t.timeDisplayed/r);if(t.timeDisplayed=0,t.displayIndex+=i,t.loopCount=Math.floor(t.displayIndex/t.numFrames),null!==t.loopLimit&&t.loopCount>=t.loopLimit)t.playing=!1;else{var n=t.displayIndex%t.numFrames;this.drawingContext.putImageData(t.frames[n].image,0,0),t.displayIndex=n,this.setModified(!0)}}}},n.default.Image.prototype._setProperty=function(e,t){this[e]=t,this.setModified(!0)},n.default.Image.prototype.loadPixels=function(){n.default.Renderer2D.prototype.loadPixels.call(this),this.setModified(!0)},n.default.Image.prototype.updatePixels=function(e,t,r,i){n.default.Renderer2D.prototype.updatePixels.call(this,e,t,r,i),this.setModified(!0)},n.default.Image.prototype.get=function(e,t,r,i){return n.default._validateParameters("p5.Image.get",arguments),n.default.Renderer2D.prototype.get.apply(this,arguments)},n.default.Image.prototype._getPixel=n.default.Renderer2D.prototype._getPixel,n.default.Image.prototype.set=function(e,t,r){n.default.Renderer2D.prototype.set.call(this,e,t,r),this.setModified(!0)},n.default.Image.prototype.resize=function(e,t){0===e&&0===t?(e=this.canvas.width,t=this.canvas.height):0===e?e=this.canvas.width*t/this.canvas.height:0===t&&(t=this.canvas.height*e/this.canvas.width),e=Math.floor(e),t=Math.floor(t);var r=document.createElement("canvas");if(r.width=e,r.height=t,this.gifProperties)for(var i=this.gifProperties,n=function(e,t){for(var r=0,i=0;i/g,">").replace(/"/g,""").replace(/'/g,"'")}function l(e,t){t&&!0!==t&&"true"!==t||(t="");var r="";return(e=e||"untitled")&&e.includes(".")&&(r=e.split(".").pop()),t&&r!==t&&(r=t,e="".concat(e,".").concat(r)),[e,r]}e("../core/error_helpers"),v.default.prototype.loadJSON=function(){for(var e=arguments.length,t=new Array(e),r=0;r"),n.print("");if(n.print(' '),n.print(""),n.print(""),n.print(" "),"0"!==o[0]){n.print(" ");for(var h=0;h".concat(c)),n.print(" ")}n.print(" ")}for(var f=0;f");for(var d=0;d".concat(p)),n.print(" ")}n.print(" ")}n.print("
"),n.print(""),n.print("")}n.close(),n.clear()},v.default.prototype.writeFile=function(e,t,r){var i="application/octet-stream";v.default.prototype._isSafari()&&(i="text/plain");var n=new Blob(e,{type:i});v.default.prototype.downloadFile(n,t,r)},v.default.prototype.downloadFile=function(e,t,r){var i=l(t,r),n=i[0];if(e instanceof Blob)s.default.saveAs(e,n);else{var o=document.createElement("a");if(o.href=e,o.download=n,o.onclick=function(e){var t;t=e,document.body.removeChild(t.target),e.stopPropagation()},o.style.display="none",document.body.appendChild(o),v.default.prototype._isSafari()){var a="Hello, Safari user! To download this file...\n";a+="1. Go to File --\x3e Save As.\n",a+='2. Choose "Page Source" as the Format.\n',a+='3. Name it with this extension: ."'.concat(i[1],'"'),alert(a)}o.click()}},v.default.prototype._checkFileExtension=l,v.default.prototype._isSafari=function(){return 0>>0},getSeed:function(){return t},rand:function(){return(r=(1664525*r+1013904223)%i)/i}});n.setSeed(e),_=new Array(4096);for(var o=0;o<4096;o++)_[o]=n.rand()};var o=n.default;r.default=o},{"../core/main":49}],82:[function(e,t,r){"use strict";function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i,l=(i=e("../core/main"))&&i.__esModule?i:{default:i},o=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==a(e)&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var o=i?Object.getOwnPropertyDescriptor(e,n):null;o&&(o.get||o.set)?Object.defineProperty(r,n,o):r[n]=e[n]}r.default=e,t&&t.set(e,r);return r}(e("../core/constants"));function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}l.default.Vector=function(e,t,r){var i,n,o;o=e instanceof l.default?(this.p5=e,i=t[0]||0,n=t[1]||0,t[2]||0):(i=e||0,n=t||0,r||0),this.x=i,this.y=n,this.z=o},l.default.Vector.prototype.toString=function(){return"p5.Vector Object : [".concat(this.x,", ").concat(this.y,", ").concat(this.z,"]")},l.default.Vector.prototype.set=function(e,t,r){return e instanceof l.default.Vector?(this.x=e.x||0,this.y=e.y||0,this.z=e.z||0):e instanceof Array?(this.x=e[0]||0,this.y=e[1]||0,this.z=e[2]||0):(this.x=e||0,this.y=t||0,this.z=r||0),this},l.default.Vector.prototype.copy=function(){return this.p5?new l.default.Vector(this.p5,[this.x,this.y,this.z]):new l.default.Vector(this.x,this.y,this.z)},l.default.Vector.prototype.add=function(e,t,r){return e instanceof l.default.Vector?(this.x+=e.x||0,this.y+=e.y||0,this.z+=e.z||0):e instanceof Array?(this.x+=e[0]||0,this.y+=e[1]||0,this.z+=e[2]||0):(this.x+=e||0,this.y+=t||0,this.z+=r||0),this};function u(e,t){return 0!==e&&(this.x=this.x%e),0!==t&&(this.y=this.y%t),this}function h(e,t,r){return 0!==e&&(this.x=this.x%e),0!==t&&(this.y=this.y%t),0!==r&&(this.z=this.z%r),this}l.default.Vector.prototype.rem=function(e,t,r){if(e instanceof l.default.Vector){if(Number.isFinite(e.x)&&Number.isFinite(e.y)&&Number.isFinite(e.z)){var i=parseFloat(e.x),n=parseFloat(e.y),o=parseFloat(e.z);h.call(this,i,n,o)}}else if(e instanceof Array)e.every(function(e){return Number.isFinite(e)})&&(2===e.length&&u.call(this,e[0],e[1]),3===e.length&&h.call(this,e[0],e[1],e[2]));else if(1===arguments.length){if(Number.isFinite(e)&&0!==e)return this.x=this.x%e,this.y=this.y%e,this.z=this.z%e,this}else if(2===arguments.length){var a=Array.prototype.slice.call(arguments);a.every(function(e){return Number.isFinite(e)})&&2===a.length&&u.call(this,a[0],a[1])}else if(3===arguments.length){var s=Array.prototype.slice.call(arguments);s.every(function(e){return Number.isFinite(e)})&&3===s.length&&h.call(this,s[0],s[1],s[2])}},l.default.Vector.prototype.sub=function(e,t,r){return e instanceof l.default.Vector?(this.x-=e.x||0,this.y-=e.y||0,this.z-=e.z||0):e instanceof Array?(this.x-=e[0]||0,this.y-=e[1]||0,this.z-=e[2]||0):(this.x-=e||0,this.y-=t||0,this.z-=r||0),this},l.default.Vector.prototype.mult=function(e){return"number"==typeof e&&isFinite(e)?(this.x*=e,this.y*=e,this.z*=e):console.warn("p5.Vector.prototype.mult:","n is undefined or not a finite number"),this},l.default.Vector.prototype.div=function(e){return"number"==typeof e&&isFinite(e)?0===e?console.warn("p5.Vector.prototype.div:","divide by 0"):(this.x/=e,this.y/=e,this.z/=e):console.warn("p5.Vector.prototype.div:","n is undefined or not a finite number"),this},l.default.Vector.prototype.mag=function(){return Math.sqrt(this.magSq())},l.default.Vector.prototype.magSq=function(){var e=this.x,t=this.y,r=this.z;return e*e+t*t+r*r},l.default.Vector.prototype.dot=function(e,t,r){return e instanceof l.default.Vector?this.dot(e.x,e.y,e.z):this.x*(e||0)+this.y*(t||0)+this.z*(r||0)},l.default.Vector.prototype.cross=function(e){var t=this.y*e.z-this.z*e.y,r=this.z*e.x-this.x*e.z,i=this.x*e.y-this.y*e.x;return this.p5?new l.default.Vector(this.p5,[t,r,i]):new l.default.Vector(t,r,i)},l.default.Vector.prototype.dist=function(e){return e.copy().sub(this).mag()},l.default.Vector.prototype.normalize=function(){var e=this.mag();return 0!==e&&this.mult(1/e),this},l.default.Vector.prototype.limit=function(e){var t=this.magSq();return e*e>>0},n.default.prototype.randomSeed=function(e){this._lcgSetSeed(o,e),this._gaussian_previous=!1},n.default.prototype.random=function(e,t){var r;if(n.default._validateParameters("random",arguments),r=null!=this[o]?this._lcg(o):Math.random(),void 0===e)return r;if(void 0===t)return e instanceof Array?e[Math.floor(r*e.length)]:r*e;if(tf){var P=p,L=l,k=u;p=d+f*(s&&d=t&&(r=r.substring(r.length-t,r.length)),r}},n.default.prototype.unhex=function(e){return e instanceof Array?e.map(n.default.prototype.unhex):parseInt("0x".concat(e),16)};var o=n.default;r.default=o},{"../core/main":49}],90:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i,a=(i=e("../core/main"))&&i.__esModule?i:{default:i};function n(e,t,r){var i=e<0,n=i?e.toString().substring(1):e.toString(),o=n.indexOf("."),a=-1!==o?n.substring(0,o):n,s=-1!==o?n.substring(o+1):"",l=i?"-":"";if(void 0!==r){var u="";(-1!==o||0r&&(s=s.substring(0,r));for(var h=0;hi.length)for(var o=t-(i+=-1===r?".":"").length+1,a=0;a=d.TWO_PI?"".concat("ellipse","|").concat(u,"|"):"".concat("arc","|").concat(a,"|").concat(s,"|").concat(l,"|").concat(u,"|"),!this.geometryInHash(t)){var h=new T.default.Geometry(u,1,function(){if(this.strokeIndices=[],a.toFixed(10)!==s.toFixed(10)){l!==d.PIE&&void 0!==l||(this.vertices.push(new T.default.Vector(.5,.5,0)),this.uvs.push([.5,.5]));for(var e=0;e<=u;e++){var t=(s-a)*(e/u)+a,r=.5+Math.cos(t)/2,i=.5+Math.sin(t)/2;this.vertices.push(new T.default.Vector(r,i,0)),this.uvs.push([r,i]),e>5&31)/31,(y>>10&31)/31):(r=a,i=s,l)}for(var b=1;b<=3;b++){var _=p+12*b,x=new S.default.Vector(u.getFloat32(_,!0),u.getFloat32(8+_,!0),u.getFloat32(4+_,!0));e.vertices.push(x),c&&o.push(r,i,n)}var w=new S.default.Vector(m,g,v);e.vertexNormals.push(w,w,w),e.faces.push([3*d,3*d+1,3*d+2]),e.uvs.push([0,0],[0,0],[0,0])}}(e,t);else{var r=new DataView(t);if(!("TextDecoder"in window))return console.warn("Sorry, ASCII STL loading only works in browsers that support TextDecoder (https://caniuse.com/#feat=textencoder)");var i=new TextDecoder("utf-8").decode(r).split("\n");!function(e,t){for(var r,i,n="",o=[],a=0;aMath.PI?l=Math.PI:l<=0&&(l=.001);var u=Math.sin(l)*a*Math.sin(s),h=Math.cos(l)*a,c=Math.sin(l)*a*Math.cos(s);this.camera(u+this.centerX,h+this.centerY,c+this.centerZ,this.centerX,this.centerY,this.centerZ,0,1,0)},m.default.Camera.prototype._isActive=function(){return this===this._renderer._curCamera},m.default.prototype.setCamera=function(e){this._renderer._curCamera=e,this._renderer.uPMatrix.set(e.projMatrix.mat4[0],e.projMatrix.mat4[1],e.projMatrix.mat4[2],e.projMatrix.mat4[3],e.projMatrix.mat4[4],e.projMatrix.mat4[5],e.projMatrix.mat4[6],e.projMatrix.mat4[7],e.projMatrix.mat4[8],e.projMatrix.mat4[9],e.projMatrix.mat4[10],e.projMatrix.mat4[11],e.projMatrix.mat4[12],e.projMatrix.mat4[13],e.projMatrix.mat4[14],e.projMatrix.mat4[15])};var n=m.default.Camera;r.default=n},{"../core/main":49}],98:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i,h=(i=e("../core/main"))&&i.__esModule?i:{default:i};h.default.Geometry=function(e,t,r){return this.vertices=[],this.lineVertices=[],this.lineNormals=[],this.vertexNormals=[],this.faces=[],this.uvs=[],this.edges=[],this.vertexColors=[],this.detailX=void 0!==e?e:1,this.detailY=void 0!==t?t:1,this.dirtyFlags={},r instanceof Function&&r.call(this),this},h.default.Geometry.prototype.reset=function(){this.lineVertices.length=0,this.lineNormals.length=0,this.vertices.length=0,this.edges.length=0,this.vertexColors.length=0,this.vertexNormals.length=0,this.uvs.length=0,this.dirtyFlags={}},h.default.Geometry.prototype.computeFaces=function(){this.faces.length=0;for(var e,t,r,i,n=this.detailX+1,o=0;othis.vertices.length-1-this.detailX;i--)e.add(this.vertexNormals[i]);e=h.default.Vector.div(e,this.detailX);for(var n=this.vertices.length-1;n>this.vertices.length-1-this.detailX;n--)this.vertexNormals[n]=e;return this},h.default.Geometry.prototype._makeTriangleEdges=function(){if(this.edges.length=0,Array.isArray(this.strokeIndices))for(var e=0,t=this.strokeIndices.length;e vTexCoord.y;\n bool y1 = p1.y > vTexCoord.y;\n bool y2 = p2.y > vTexCoord.y;\n\n // could web be under the curve (after t1)?\n if (y1 ? !y2 : y0) {\n // add the coverage for t1\n coverage.x += saturate(C1.x + 0.5);\n // calculate the anti-aliasing for t1\n weight.x = min(weight.x, abs(C1.x));\n }\n\n // are we outside the curve (after t2)?\n if (y1 ? !y0 : y2) {\n // subtract the coverage for t2\n coverage.x -= saturate(C2.x + 0.5);\n // calculate the anti-aliasing for t2\n weight.x = min(weight.x, abs(C2.x));\n }\n}\n\n// this is essentially the same as coverageX, but with the axes swapped\nvoid coverageY(vec2 p0, vec2 p1, vec2 p2) {\n\n vec2 C1, C2;\n calulateCrossings(p0, p1, p2, C1, C2);\n\n bool x0 = p0.x > vTexCoord.x;\n bool x1 = p1.x > vTexCoord.x;\n bool x2 = p2.x > vTexCoord.x;\n\n if (x1 ? !x2 : x0) {\n coverage.y -= saturate(C1.y + 0.5);\n weight.y = min(weight.y, abs(C1.y));\n }\n\n if (x1 ? !x0 : x2) {\n coverage.y += saturate(C2.y + 0.5);\n weight.y = min(weight.y, abs(C2.y));\n }\n}\n\nvoid main() {\n\n // calculate the pixel scale based on screen-coordinates\n pixelScale = hardness / fwidth(vTexCoord);\n\n // which grid cell is this pixel in?\n ivec2 gridCoord = ifloor(vTexCoord * vec2(uGridSize));\n\n // intersect curves in this row\n {\n // the index into the row info bitmap\n int rowIndex = gridCoord.y + uGridOffset.y;\n // fetch the info texel\n vec4 rowInfo = getTexel(uSamplerRows, rowIndex, uGridImageSize);\n // unpack the rowInfo\n int rowStrokeIndex = getInt16(rowInfo.xy);\n int rowStrokeCount = getInt16(rowInfo.zw);\n\n for (int iRowStroke = INT(0); iRowStroke < N; iRowStroke++) {\n if (iRowStroke >= rowStrokeCount)\n break;\n\n // each stroke is made up of 3 points: the start and control point\n // and the start of the next curve.\n // fetch the indices of this pair of strokes:\n vec4 strokeIndices = getTexel(uSamplerRowStrokes, rowStrokeIndex++, uCellsImageSize);\n\n // unpack the stroke index\n int strokePos = getInt16(strokeIndices.xy);\n\n // fetch the two strokes\n vec4 stroke0 = getTexel(uSamplerStrokes, strokePos + INT(0), uStrokeImageSize);\n vec4 stroke1 = getTexel(uSamplerStrokes, strokePos + INT(1), uStrokeImageSize);\n\n // calculate the coverage\n coverageX(stroke0.xy, stroke0.zw, stroke1.xy);\n }\n }\n\n // intersect curves in this column\n {\n int colIndex = gridCoord.x + uGridOffset.x;\n vec4 colInfo = getTexel(uSamplerCols, colIndex, uGridImageSize);\n int colStrokeIndex = getInt16(colInfo.xy);\n int colStrokeCount = getInt16(colInfo.zw);\n \n for (int iColStroke = INT(0); iColStroke < N; iColStroke++) {\n if (iColStroke >= colStrokeCount)\n break;\n\n vec4 strokeIndices = getTexel(uSamplerColStrokes, colStrokeIndex++, uCellsImageSize);\n\n int strokePos = getInt16(strokeIndices.xy);\n vec4 stroke0 = getTexel(uSamplerStrokes, strokePos + INT(0), uStrokeImageSize);\n vec4 stroke1 = getTexel(uSamplerStrokes, strokePos + INT(1), uStrokeImageSize);\n coverageY(stroke0.xy, stroke0.zw, stroke1.xy);\n }\n }\n\n weight = saturate(1.0 - weight * 2.0);\n float distance = max(weight.x + weight.y, minDistance); // manhattan approx.\n float antialias = abs(dot(coverage, weight) / distance);\n float cover = min(abs(coverage.x), abs(coverage.y));\n gl_FragColor = uMaterialColor;\n gl_FragColor.a *= saturate(max(antialias, cover));\n}",lineVert:"/*\n Part of the Processing project - http://processing.org\n Copyright (c) 2012-15 The Processing Foundation\n Copyright (c) 2004-12 Ben Fry and Casey Reas\n Copyright (c) 2001-04 Massachusetts Institute of Technology\n This library is free software; you can redistribute it and/or\n modify it under the terms of the GNU Lesser General Public\n License as published by the Free Software Foundation, version 2.1.\n This library is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n Lesser General Public License for more details.\n You should have received a copy of the GNU Lesser General\n Public License along with this library; if not, write to the\n Free Software Foundation, Inc., 59 Temple Place, Suite 330,\n Boston, MA 02111-1307 USA\n*/\n\n#define PROCESSING_LINE_SHADER\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform float uStrokeWeight;\n\nuniform vec4 uViewport;\nuniform int uPerspective;\n\nattribute vec4 aPosition;\nattribute vec4 aDirection;\n \nvoid main() {\n // using a scale <1 moves the lines towards the camera\n // in order to prevent popping effects due to half of\n // the line disappearing behind the geometry faces.\n vec3 scale = vec3(0.9995);\n\n vec4 posp = uModelViewMatrix * aPosition;\n vec4 posq = uModelViewMatrix * (aPosition + vec4(aDirection.xyz, 0));\n\n // Moving vertices slightly toward the camera\n // to avoid depth-fighting with the fill triangles.\n // Discussed here:\n // http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Number=252848 \n posp.xyz = posp.xyz * scale;\n posq.xyz = posq.xyz * scale;\n\n vec4 p = uProjectionMatrix * posp;\n vec4 q = uProjectionMatrix * posq;\n\n // formula to convert from clip space (range -1..1) to screen space (range 0..[width or height])\n // screen_p = (p.xy/p.w + <1,1>) * 0.5 * uViewport.zw\n\n // prevent division by W by transforming the tangent formula (div by 0 causes\n // the line to disappear, see https://github.com/processing/processing/issues/5183)\n // t = screen_q - screen_p\n //\n // tangent is normalized and we don't care which aDirection it points to (+-)\n // t = +- normalize( screen_q - screen_p )\n // t = +- normalize( (q.xy/q.w+<1,1>)*0.5*uViewport.zw - (p.xy/p.w+<1,1>)*0.5*uViewport.zw )\n //\n // extract common factor, <1,1> - <1,1> cancels out\n // t = +- normalize( (q.xy/q.w - p.xy/p.w) * 0.5 * uViewport.zw )\n //\n // convert to common divisor\n // t = +- normalize( ((q.xy*p.w - p.xy*q.w) / (p.w*q.w)) * 0.5 * uViewport.zw )\n //\n // remove the common scalar divisor/factor, not needed due to normalize and +-\n // (keep uViewport - can't remove because it has different components for x and y\n // and corrects for aspect ratio, see https://github.com/processing/processing/issues/5181)\n // t = +- normalize( (q.xy*p.w - p.xy*q.w) * uViewport.zw )\n\n vec2 tangent = normalize((q.xy*p.w - p.xy*q.w) * uViewport.zw);\n\n // flip tangent to normal (it's already normalized)\n vec2 normal = vec2(-tangent.y, tangent.x);\n\n float thickness = aDirection.w * uStrokeWeight;\n vec2 offset = normal * thickness / 2.0;\n\n vec2 curPerspScale;\n\n if(uPerspective == 1) {\n // Perspective ---\n // convert from world to clip by multiplying with projection scaling factor\n // to get the right thickness (see https://github.com/processing/processing/issues/5182)\n // invert Y, projections in Processing invert Y\n curPerspScale = (uProjectionMatrix * vec4(1, -1, 0, 0)).xy;\n } else {\n // No Perspective ---\n // multiply by W (to cancel out division by W later in the pipeline) and\n // convert from screen to clip (derived from clip to screen above)\n curPerspScale = p.w / (0.5 * uViewport.zw);\n }\n\n gl_Position.xy = p.xy + offset.xy * curPerspScale;\n gl_Position.zw = p.zw;\n}\n",lineFrag:"precision mediump float;\nprecision mediump int;\n\nuniform vec4 uMaterialColor;\n\nvoid main() {\n gl_FragColor = uMaterialColor;\n}",pointVert:"attribute vec3 aPosition;\nuniform float uPointSize;\nvarying float vStrokeWeight;\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nvoid main() {\n\tvec4 positionVec4 = vec4(aPosition, 1.0);\n\tgl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n\tgl_PointSize = uPointSize;\n\tvStrokeWeight = uPointSize;\n}",pointFrag:"precision mediump float;\nprecision mediump int;\nuniform vec4 uMaterialColor;\nvarying float vStrokeWeight;\n\nvoid main(){\n\tfloat mask = 0.0;\n\n\t// make a circular mask using the gl_PointCoord (goes from 0 - 1 on a point)\n // might be able to get a nicer edge on big strokeweights with smoothstep but slightly less performant\n\n\tmask = step(0.98, length(gl_PointCoord * 2.0 - 1.0));\n\n\t// if strokeWeight is 1 or less lets just draw a square\n\t// this prevents weird artifacting from carving circles when our points are really small\n\t// if strokeWeight is larger than 1, we just use it as is\n\n\tmask = mix(0.0, mask, clamp(floor(vStrokeWeight - 0.5),0.0,1.0));\n\n\t// throw away the borders of the mask\n // otherwise we get weird alpha blending issues\n\n\tif(mask > 0.98){\n discard;\n \t}\n\n \tgl_FragColor = vec4(uMaterialColor.rgb * (1.0 - mask), uMaterialColor.a) ;\n}"};u.default.RendererGL=function(e,t,r,i){return u.default.Renderer.call(this,e,t,r),this._setAttributeDefaults(t),this._initContext(),this.isP3D=!0,this.GL=this.drawingContext,this._isErasing=!1,this._enableLighting=!1,this.ambientLightColors=[],this.specularColors=[1,1,1],this.directionalLightDirections=[],this.directionalLightDiffuseColors=[],this.directionalLightSpecularColors=[],this.pointLightPositions=[],this.pointLightDiffuseColors=[],this.pointLightSpecularColors=[],this.spotLightPositions=[],this.spotLightDirections=[],this.spotLightDiffuseColors=[],this.spotLightSpecularColors=[],this.spotLightAngle=[],this.spotLightConc=[],this.drawMode=o.FILL,this.curFillColor=this._cachedFillStyle=[1,1,1,1],this.curStrokeColor=this._cachedStrokeStyle=[0,0,0,1],this.curBlendMode=o.BLEND,this._cachedBlendMode=void 0,this.blendExt=this.GL.getExtension("EXT_blend_minmax"),this._isBlending=!1,this._useSpecularMaterial=!1,this._useEmissiveMaterial=!1,this._useNormalMaterial=!1,this._useShininess=1,this._tint=[255,255,255,255],this.constantAttenuation=1,this.linearAttenuation=0,this.quadraticAttenuation=0,this.uMVMatrix=new u.default.Matrix,this.uPMatrix=new u.default.Matrix,this.uNMatrix=new u.default.Matrix("mat3"),this._curCamera=new u.default.Camera(this),this._curCamera._computeCameraDefaultSettings(),this._curCamera._setDefaultCamera(),this._defaultLightShader=void 0,this._defaultImmediateModeShader=void 0,this._defaultNormalShader=void 0,this._defaultColorShader=void 0,this._defaultPointShader=void 0,this.userFillShader=void 0,this.userStrokeShader=void 0,this.userPointShader=void 0,this.retainedMode={geometry:{},buffers:{stroke:[new u.default.RenderBuffer(3,"lineVertices","lineVertexBuffer","aPosition",this,this._flatten),new u.default.RenderBuffer(4,"lineNormals","lineNormalBuffer","aDirection",this,this._flatten)],fill:[new u.default.RenderBuffer(3,"vertices","vertexBuffer","aPosition",this,this._vToNArray),new u.default.RenderBuffer(3,"vertexNormals","normalBuffer","aNormal",this,this._vToNArray),new u.default.RenderBuffer(4,"vertexColors","colorBuffer","aMaterialColor",this),new u.default.RenderBuffer(3,"vertexAmbients","ambientBuffer","aAmbientColor",this),new u.default.RenderBuffer(2,"uvs","uvBuffer","aTexCoord",this,this._flatten)],text:[new u.default.RenderBuffer(3,"vertices","vertexBuffer","aPosition",this,this._vToNArray),new u.default.RenderBuffer(2,"uvs","uvBuffer","aTexCoord",this,this._flatten)]}},this.immediateMode={geometry:new u.default.Geometry,shapeMode:o.TRIANGLE_FAN,_bezierVertex:[],_quadraticVertex:[],_curveVertex:[],buffers:{fill:[new u.default.RenderBuffer(3,"vertices","vertexBuffer","aPosition",this,this._vToNArray),new u.default.RenderBuffer(3,"vertexNormals","normalBuffer","aNormal",this,this._vToNArray),new u.default.RenderBuffer(4,"vertexColors","colorBuffer","aVertexColor",this),new u.default.RenderBuffer(3,"vertexAmbients","ambientBuffer","aAmbientColor",this),new u.default.RenderBuffer(2,"uvs","uvBuffer","aTexCoord",this,this._flatten)],stroke:[new u.default.RenderBuffer(3,"lineVertices","lineVertexBuffer","aPosition",this,this._flatten),new u.default.RenderBuffer(4,"lineNormals","lineNormalBuffer","aDirection",this,this._flatten)],point:this.GL.createBuffer()}},this.pointSize=5,this.curStrokeWeight=1,this.textures=[],this.textureMode=o.IMAGE,this.textureWrapX=o.CLAMP,this.textureWrapY=o.CLAMP,this._tex=null,this._curveTightness=6,this._lookUpTableBezier=[],this._lookUpTableQuadratic=[],this._lutBezierDetail=0,this._lutQuadraticDetail=0,this._tessy=this._initTessy(),this.fontInfos={},this._curShader=void 0,this},u.default.RendererGL.prototype=Object.create(u.default.Renderer.prototype),u.default.RendererGL.prototype._setAttributeDefaults=function(e){var t={alpha:!0,depth:!0,stencil:!0,antialias:navigator.userAgent.toLowerCase().includes("safari"),premultipliedAlpha:!1,preserveDrawingBuffer:!0,perPixelLighting:!0};null===e._glAttributes?e._glAttributes=t:e._glAttributes=Object.assign(t,e._glAttributes)},u.default.RendererGL.prototype._initContext=function(){try{if(this.drawingContext=this.canvas.getContext("webgl",this._pInst._glAttributes)||this.canvas.getContext("experimental-webgl",this._pInst._glAttributes),null===this.drawingContext)throw new Error("Error creating webgl context");var e=this.drawingContext;e.enable(e.DEPTH_TEST),e.depthFunc(e.LEQUAL),e.viewport(0,0,e.drawingBufferWidth,e.drawingBufferHeight),this._viewport=this.drawingContext.getParameter(this.drawingContext.VIEWPORT)}catch(e){throw e}},u.default.RendererGL.prototype._resetContext=function(e,t){var r=this.width,i=this.height,n=this.canvas.id,o=this._pInst instanceof u.default.Graphics;if(o){var a=this._pInst;a.canvas.parentNode.removeChild(a.canvas),a.canvas=document.createElement("canvas"),(a._pInst._userNode||document.body).appendChild(a.canvas),u.default.Element.call(a,a.canvas,a._pInst),a.width=r,a.height=i}else{var s=this.canvas;s&&s.parentNode.removeChild(s),(s=document.createElement("canvas")).id=n,this._pInst._userNode?this._pInst._userNode.appendChild(s):document.body.appendChild(s),this._pInst.canvas=s}var l=new u.default.RendererGL(this._pInst.canvas,this._pInst,!o);this._pInst._setProperty("_renderer",l),l.resize(r,i),l._applyDefaults(),o||this._pInst._elements.push(l),"function"==typeof t&&setTimeout(function(){t.apply(window._renderer,e)},0)},u.default.prototype.setAttributes=function(e,t){if(void 0!==this._glAttributes){var r=!0;if(void 0!==t?(null===this._glAttributes&&(this._glAttributes={}),this._glAttributes[e]!==t&&(this._glAttributes[e]=t,r=!1)):e instanceof Object&&this._glAttributes!==e&&(this._glAttributes=e,r=!1),this._renderer.isP3D&&!r){if(!this._setupDone)for(var i in this._renderer.retainedMode.geometry)if(this._renderer.retainedMode.geometry.hasOwnProperty(i))return void console.error("Sorry, Could not set the attributes, you need to call setAttributes() before calling the other drawing methods in setup()");this.push(),this._renderer._resetContext(),this.pop(),this._renderer._curCamera&&(this._renderer._curCamera._renderer=this._renderer)}}else console.log("You are trying to use setAttributes on a p5.Graphics object that does not use a WEBGL renderer.")},u.default.RendererGL.prototype._update=function(){this.uMVMatrix.set(this._curCamera.cameraMatrix.mat4[0],this._curCamera.cameraMatrix.mat4[1],this._curCamera.cameraMatrix.mat4[2],this._curCamera.cameraMatrix.mat4[3],this._curCamera.cameraMatrix.mat4[4],this._curCamera.cameraMatrix.mat4[5],this._curCamera.cameraMatrix.mat4[6],this._curCamera.cameraMatrix.mat4[7],this._curCamera.cameraMatrix.mat4[8],this._curCamera.cameraMatrix.mat4[9],this._curCamera.cameraMatrix.mat4[10],this._curCamera.cameraMatrix.mat4[11],this._curCamera.cameraMatrix.mat4[12],this._curCamera.cameraMatrix.mat4[13],this._curCamera.cameraMatrix.mat4[14],this._curCamera.cameraMatrix.mat4[15]),this.ambientLightColors.length=0,this.specularColors=[1,1,1],this.directionalLightDirections.length=0,this.directionalLightDiffuseColors.length=0,this.directionalLightSpecularColors.length=0,this.pointLightPositions.length=0,this.pointLightDiffuseColors.length=0,this.pointLightSpecularColors.length=0,this.spotLightPositions.length=0,this.spotLightDirections.length=0,this.spotLightDiffuseColors.length=0,this.spotLightSpecularColors.length=0,this.spotLightAngle.length=0,this.spotLightConc.length=0,this._enableLighting=!1,this._tint=[255,255,255,255],this.GL.clear(this.GL.DEPTH_BUFFER_BIT)},u.default.RendererGL.prototype.background=function(){var e,t=(e=this._pInst).color.apply(e,arguments),r=t.levels[0]/255,i=t.levels[1]/255,n=t.levels[2]/255,o=t.levels[3]/255;this.GL.clearColor(r,i,n,o),this.GL.clear(this.GL.COLOR_BUFFER_BIT)},u.default.RendererGL.prototype.fill=function(e,t,r,i){var n=u.default.prototype.color.apply(this._pInst,arguments);this.curFillColor=n._array,this.drawMode=o.FILL,this._useNormalMaterial=!1,this._tex=null},u.default.RendererGL.prototype.stroke=function(e,t,r,i){arguments[3]=255;var n=u.default.prototype.color.apply(this._pInst,arguments);this.curStrokeColor=n._array},u.default.RendererGL.prototype.strokeCap=function(e){console.error("Sorry, strokeCap() is not yet implemented in WEBGL mode")},u.default.RendererGL.prototype.strokeJoin=function(e){console.error("Sorry, strokeJoin() is not yet implemented in WEBGL mode")},u.default.RendererGL.prototype.filter=function(e){console.error("filter() does not work in WEBGL mode")},u.default.RendererGL.prototype.blendMode=function(e){e===o.DARKEST||e===o.LIGHTEST||e===o.ADD||e===o.BLEND||e===o.SUBTRACT||e===o.SCREEN||e===o.EXCLUSION||e===o.REPLACE||e===o.MULTIPLY||e===o.REMOVE?this.curBlendMode=e:e!==o.BURN&&e!==o.OVERLAY&&e!==o.HARD_LIGHT&&e!==o.SOFT_LIGHT&&e!==o.DODGE||console.warn("BURN, OVERLAY, HARD_LIGHT, SOFT_LIGHT, and DODGE only work for blendMode in 2D mode.")},u.default.RendererGL.prototype.erase=function(e,t){this._isErasing||(this._cachedBlendMode=this.curBlendMode,this.blendMode(o.REMOVE),this._cachedFillStyle=this.curFillColor.slice(),this.curFillColor=[1,1,1,e/255],this._cachedStrokeStyle=this.curStrokeColor.slice(),this.curStrokeColor=[1,1,1,t/255],this._isErasing=!0)},u.default.RendererGL.prototype.noErase=function(){this._isErasing&&(this.curFillColor=this._cachedFillStyle.slice(),this.curStrokeColor=this._cachedStrokeStyle.slice(),this.blendMode(this._cachedBlendMode),this._isErasing=!1)},u.default.RendererGL.prototype.strokeWeight=function(e){this.curStrokeWeight!==e&&(this.pointSize=e,this.curStrokeWeight=e)},u.default.RendererGL.prototype._getPixel=function(e,t){var r;return r=new Uint8Array(4),this.drawingContext.readPixels(e,t,1,1,this.drawingContext.RGBA,this.drawingContext.UNSIGNED_BYTE,r),[r[0],r[1],r[2],r[3]]},u.default.RendererGL.prototype.loadPixels=function(){var e=this._pixelsState;if(!0===this._pInst._glAttributes.preserveDrawingBuffer){var t=e.pixels,r=this.GL.drawingBufferWidth*this.GL.drawingBufferHeight*4;t instanceof Uint8Array&&t.length===r||(t=new Uint8Array(r),this._pixelsState._setProperty("pixels",t));var i=this._pInst._pixelDensity;this.GL.readPixels(0,0,this.width*i,this.height*i,this.GL.RGBA,this.GL.UNSIGNED_BYTE,t)}else console.log("loadPixels only works in WebGL when preserveDrawingBuffer is true.")},u.default.RendererGL.prototype.geometryInHash=function(e){return void 0!==this.retainedMode.geometry[e]},u.default.RendererGL.prototype.resize=function(e,t){u.default.Renderer.prototype.resize.call(this,e,t),this.GL.viewport(0,0,this.GL.drawingBufferWidth,this.GL.drawingBufferHeight),this._viewport=this.GL.getParameter(this.GL.VIEWPORT),this._curCamera._resize();var r=this._pixelsState;void 0!==r.pixels&&r._setProperty("pixels",new Uint8Array(this.GL.drawingBufferWidth*this.GL.drawingBufferHeight*4))},u.default.RendererGL.prototype.clear=function(){var e=(arguments.length<=0?void 0:arguments[0])||0,t=(arguments.length<=1?void 0:arguments[1])||0,r=(arguments.length<=2?void 0:arguments[2])||0,i=(arguments.length<=3?void 0:arguments[3])||0;this.GL.clearColor(e,t,r,i),this.GL.clear(this.GL.COLOR_BUFFER_BIT|this.GL.DEPTH_BUFFER_BIT)},u.default.RendererGL.prototype.applyMatrix=function(e,t,r,i,n,o){16===arguments.length?u.default.Matrix.prototype.apply.apply(this.uMVMatrix,arguments):this.uMVMatrix.apply([e,t,0,0,r,i,0,0,0,0,1,0,n,o,0,1])},u.default.RendererGL.prototype.translate=function(e,t,r){return e instanceof u.default.Vector&&(r=e.z,t=e.y,e=e.x),this.uMVMatrix.translate([e,t,r]),this},u.default.RendererGL.prototype.scale=function(e,t,r){return this.uMVMatrix.scale(e,t,r),this},u.default.RendererGL.prototype.rotate=function(e,t){return void 0===t?this.rotateZ(e):(u.default.Matrix.prototype.rotate.apply(this.uMVMatrix,arguments),this)},u.default.RendererGL.prototype.rotateX=function(e){return this.rotate(e,1,0,0),this},u.default.RendererGL.prototype.rotateY=function(e){return this.rotate(e,0,1,0),this},u.default.RendererGL.prototype.rotateZ=function(e){return this.rotate(e,0,0,1),this},u.default.RendererGL.prototype.push=function(){var e=u.default.Renderer.prototype.push.apply(this),t=e.properties;return t.uMVMatrix=this.uMVMatrix.copy(),t.uPMatrix=this.uPMatrix.copy(),t._curCamera=this._curCamera,this._curCamera=this._curCamera.copy(),t.ambientLightColors=this.ambientLightColors.slice(),t.specularColors=this.specularColors.slice(),t.directionalLightDirections=this.directionalLightDirections.slice(),t.directionalLightDiffuseColors=this.directionalLightDiffuseColors.slice(),t.directionalLightSpecularColors=this.directionalLightSpecularColors.slice(),t.pointLightPositions=this.pointLightPositions.slice(),t.pointLightDiffuseColors=this.pointLightDiffuseColors.slice(),t.pointLightSpecularColors=this.pointLightSpecularColors.slice(),t.spotLightPositions=this.spotLightPositions.slice(),t.spotLightDirections=this.spotLightDirections.slice(),t.spotLightDiffuseColors=this.spotLightDiffuseColors.slice(),t.spotLightSpecularColors=this.spotLightSpecularColors.slice(),t.spotLightAngle=this.spotLightAngle.slice(),t.spotLightConc=this.spotLightConc.slice(),t.userFillShader=this.userFillShader,t.userStrokeShader=this.userStrokeShader,t.userPointShader=this.userPointShader,t.pointSize=this.pointSize,t.curStrokeWeight=this.curStrokeWeight,t.curStrokeColor=this.curStrokeColor,t.curFillColor=this.curFillColor,t._useSpecularMaterial=this._useSpecularMaterial,t._useEmissiveMaterial=this._useEmissiveMaterial,t._useShininess=this._useShininess,t.constantAttenuation=this.constantAttenuation,t.linearAttenuation=this.linearAttenuation,t.quadraticAttenuation=this.quadraticAttenuation,t._enableLighting=this._enableLighting,t._useNormalMaterial=this._useNormalMaterial,t._tex=this._tex,t.drawMode=this.drawMode,e},u.default.RendererGL.prototype.resetMatrix=function(){return this.uMVMatrix=u.default.Matrix.identity(this._pInst),this},u.default.RendererGL.prototype._getImmediateStrokeShader=function(){var e=this.userStrokeShader;return e&&e.isStrokeShader()?e:this._getLineShader()},u.default.RendererGL.prototype._getRetainedStrokeShader=u.default.RendererGL.prototype._getImmediateStrokeShader,u.default.RendererGL.prototype._getImmediateFillShader=function(){var e=this.userFillShader;if(this._useNormalMaterial&&(!e||!e.isNormalShader()))return this._getNormalShader();if(this._enableLighting){if(!e||!e.isLightShader())return this._getLightShader()}else if(this._tex){if(!e||!e.isTextureShader())return this._getLightShader()}else if(!e)return this._getImmediateModeShader();return e},u.default.RendererGL.prototype._getRetainedFillShader=function(){if(this._useNormalMaterial)return this._getNormalShader();var e=this.userFillShader;if(this._enableLighting){if(!e||!e.isLightShader())return this._getLightShader()}else if(this._tex){if(!e||!e.isTextureShader())return this._getLightShader()}else if(!e)return this._getColorShader();return e},u.default.RendererGL.prototype._getImmediatePointShader=function(){var e=this.userPointShader;return e&&e.isPointShader()?e:this._getPointShader()},u.default.RendererGL.prototype._getRetainedLineShader=u.default.RendererGL.prototype._getImmediateLineShader,u.default.RendererGL.prototype._getLightShader=function(){return this._defaultLightShader||(this._pInst._glAttributes.perPixelLighting?this._defaultLightShader=new u.default.Shader(this,c.phongVert,c.phongFrag):this._defaultLightShader=new u.default.Shader(this,c.lightVert,c.lightTextureFrag)),this._defaultLightShader},u.default.RendererGL.prototype._getImmediateModeShader=function(){return this._defaultImmediateModeShader||(this._defaultImmediateModeShader=new u.default.Shader(this,c.immediateVert,c.vertexColorFrag)),this._defaultImmediateModeShader},u.default.RendererGL.prototype._getNormalShader=function(){return this._defaultNormalShader||(this._defaultNormalShader=new u.default.Shader(this,c.normalVert,c.normalFrag)),this._defaultNormalShader},u.default.RendererGL.prototype._getColorShader=function(){return this._defaultColorShader||(this._defaultColorShader=new u.default.Shader(this,c.normalVert,c.basicFrag)),this._defaultColorShader},u.default.RendererGL.prototype._getPointShader=function(){return this._defaultPointShader||(this._defaultPointShader=new u.default.Shader(this,c.pointVert,c.pointFrag)),this._defaultPointShader},u.default.RendererGL.prototype._getLineShader=function(){return this._defaultLineShader||(this._defaultLineShader=new u.default.Shader(this,c.lineVert,c.lineFrag)),this._defaultLineShader},u.default.RendererGL.prototype._getFontShader=function(){return this._defaultFontShader||(this.GL.getExtension("OES_standard_derivatives"),this._defaultFontShader=new u.default.Shader(this,c.fontVert,c.fontFrag)),this._defaultFontShader},u.default.RendererGL.prototype._getEmptyTexture=function(){if(!this._emptyTexture){var e=new u.default.Image(1,1);e.set(0,0,255),this._emptyTexture=new u.default.Texture(this,e)}return this._emptyTexture},u.default.RendererGL.prototype.getTexture=function(e){var t=this.textures,r=!0,i=!1,n=void 0;try{for(var o,a=t[Symbol.iterator]();!(r=(o=a.next()).done);r=!0){var s=o.value;if(s.src===e)return s}}catch(e){i=!0,n=e}finally{try{r||null==a.return||a.return()}finally{if(i)throw n}}var l=new u.default.Texture(this,e);return t.push(l),l},u.default.RendererGL.prototype._setStrokeUniforms=function(e){e.bindShader(),e.setUniform("uMaterialColor",this.curStrokeColor),e.setUniform("uStrokeWeight",this.curStrokeWeight)},u.default.RendererGL.prototype._setFillUniforms=function(e){e.bindShader(),e.setUniform("uMaterialColor",this.curFillColor),e.setUniform("isTexture",!!this._tex),this._tex&&e.setUniform("uSampler",this._tex),e.setUniform("uTint",this._tint),e.setUniform("uSpecular",this._useSpecularMaterial),e.setUniform("uEmissive",this._useEmissiveMaterial),e.setUniform("uShininess",this._useShininess),e.setUniform("uUseLighting",this._enableLighting);var t=this.pointLightDiffuseColors.length/3;e.setUniform("uPointLightCount",t),e.setUniform("uPointLightLocation",this.pointLightPositions),e.setUniform("uPointLightDiffuseColors",this.pointLightDiffuseColors),e.setUniform("uPointLightSpecularColors",this.pointLightSpecularColors);var r=this.directionalLightDiffuseColors.length/3;e.setUniform("uDirectionalLightCount",r),e.setUniform("uLightingDirection",this.directionalLightDirections),e.setUniform("uDirectionalDiffuseColors",this.directionalLightDiffuseColors),e.setUniform("uDirectionalSpecularColors",this.directionalLightSpecularColors);var i=this.ambientLightColors.length/3;e.setUniform("uAmbientLightCount",i),e.setUniform("uAmbientColor",this.ambientLightColors);var n=this.spotLightDiffuseColors.length/3;e.setUniform("uSpotLightCount",n),e.setUniform("uSpotLightAngle",this.spotLightAngle),e.setUniform("uSpotLightConc",this.spotLightConc),e.setUniform("uSpotLightDiffuseColors",this.spotLightDiffuseColors),e.setUniform("uSpotLightSpecularColors",this.spotLightSpecularColors),e.setUniform("uSpotLightLocation",this.spotLightPositions),e.setUniform("uSpotLightDirection",this.spotLightDirections),e.setUniform("uConstantAttenuation",this.constantAttenuation),e.setUniform("uLinearAttenuation",this.linearAttenuation),e.setUniform("uQuadraticAttenuation",this.quadraticAttenuation),e.bindTextures()},u.default.RendererGL.prototype._setPointUniforms=function(e){e.bindShader(),e.setUniform("uMaterialColor",this.curStrokeColor),e.setUniform("uPointSize",this.pointSize)},u.default.RendererGL.prototype._bindBuffer=function(e,t,r,i,n){if(t=t||this.GL.ARRAY_BUFFER,this.GL.bindBuffer(t,e),void 0!==r){var o=new(i||Float32Array)(r);this.GL.bufferData(t,o,n||this.GL.STATIC_DRAW)}},u.default.RendererGL.prototype._arraysEqual=function(e,t){var r=e.length;if(r!==t.length)return!1;for(var i=0;i>7,127&f,c>>7,127&c);for(var d=0;d>7,127&p,0,0)}}return{cellImageInfo:l,dimOffset:o,dimImageInfo:n}}return(t=this.glyphInfos[e.index]={glyph:e,uGlyphRect:[i.x1,-i.y1,i.x2,-i.y2],strokeImageInfo:U,strokes:d,colInfo:G(m,this.colDimImageInfos,this.colCellImageInfos),rowInfo:G(p,this.rowDimImageInfos,this.rowCellImageInfos)}).uGridOffset=[t.colInfo.dimOffset,t.rowInfo.dimOffset],t}}var z=Math.sqrt(3);j.default.RendererGL.prototype._renderText=function(e,t,r,i,n){if(this._textFont&&"string"!=typeof this._textFont){if(!(n<=i)&&this._doFill){if(!this._isOpenType())return console.log("WEBGL: only Opentype (.otf) and Truetype (.ttf) fonts are supported"),e;e.push();var o=this._doStroke,a=this.drawMode;this._doStroke=!1,this.drawMode=D.TEXTURE;var s=this._textFont.font,l=this._textFont._fontInfo;l=l||(this._textFont._fontInfo=new A(s));var u=this._textFont._handleAlignment(this,t,r,i),h=this._textSize/s.unitsPerEm;this.translate(u.x,u.y,0),this.scale(h,h,1);var c=this.GL,f=!this._defaultFontShader,d=this._getFontShader();d.init(),d.bindShader(),f&&(d.setUniform("uGridImageSize",[64,64]),d.setUniform("uCellsImageSize",[64,64]),d.setUniform("uStrokeImageSize",[64,64]),d.setUniform("uGridSize",[9,9])),this._applyColorBlend(this.curFillColor);var p=this.retainedMode.geometry.glyph;if(!p){var m=this._textGeom=new j.default.Geometry(1,1,function(){for(var e=0;e<=1;e++)for(var t=0;t<=1;t++)this.vertices.push(new j.default.Vector(t,e,0)),this.uvs.push(t,e)});m.computeFaces().computeNormals(),p=this.createBuffers("glyph",m)}var g=!0,v=!1,y=void 0;try{for(var b,_=this.retainedMode.buffers.text[Symbol.iterator]();!(g=(b=_.next()).done);g=!0){b.value._prepareBuffer(p,d)}}catch(e){v=!0,y=e}finally{try{g||null==_.return||_.return()}finally{if(v)throw y}}this._bindBuffer(p.indexBuffer,c.ELEMENT_ARRAY_BUFFER),d.setUniform("uMaterialColor",this.curFillColor);try{var x=0,w=null,S=s.stringToGlyphs(t),M=!0,E=!1,T=void 0;try{for(var C,P=S[Symbol.iterator]();!(M=(C=P.next()).done);M=!0){var L=C.value;w&&(x+=s.getKerningValue(w,L));var k=l.getGlyphInfo(L);if(k.uGlyphRect){var R=k.rowInfo,O=k.colInfo;d.setUniform("uSamplerStrokes",k.strokeImageInfo.imageData),d.setUniform("uSamplerRowStrokes",R.cellImageInfo.imageData),d.setUniform("uSamplerRows",R.dimImageInfo.imageData),d.setUniform("uSamplerColStrokes",O.cellImageInfo.imageData),d.setUniform("uSamplerCols",O.dimImageInfo.imageData),d.setUniform("uGridOffset",k.uGridOffset),d.setUniform("uGlyphRect",k.uGlyphRect),d.setUniform("uGlyphOffset",x),d.bindTextures(),c.drawElements(c.TRIANGLES,6,this.GL.UNSIGNED_SHORT,0)}x+=L.advanceWidth,w=L}}catch(e){E=!0,T=e}finally{try{M||null==P.return||P.return()}finally{if(E)throw T}}}finally{d.unbindShader(),this._doStroke=o,this.drawMode=a,e.pop()}return e}}else console.log("WEBGL: you must load and set a font before drawing text. See `loadFont` and `textFont` for more details.")}},{"../core/constants":42,"../core/main":49,"./p5.RendererGL.Retained":102,"./p5.Shader":104}],107:[function(e,t,r){t.exports={fes:{autoplay:"The media that tried to play (with '{{src}}') wasn't allowed to by this browser, most likely due to the browser's autoplay policy. Check out {{link}} for more information about why.",fileLoadError:{bytes:"It looks like there was a problem loading your file. {{suggestion}}",font:"It looks like there was a problem loading your font. {{suggestion}}",gif:"There was some trouble loading your GIF. Make sure that your GIF is using 87a or 89a encoding.",image:"It looks like there was a problem loading your image. {{suggestion}}",json:"It looks like there was a problem loading your JSON file. {{suggestion}}",large:"If your large file isn't fetched successfully, we recommend splitting the file into smaller segments and fetching those.",strings:"It looks like there was a problem loading your text file. {{suggestion}}",suggestion:"Try checking if the file path ({{filePath}}) is correct, hosting the file online, or running a local server. (More info at {{link}})",table:"It looks like there was a problem loading your table file. {{suggestion}}",xml:"It looks like there was a problem loading your XML file. {{suggestion}}"},misusedTopLevel:"Did you just try to use p5.js's {{symbolName}} {{symbolType}}? If so, you may want to move it into your sketch's setup() function.\n\nFor more details, see: {{link}}",pre:"🌸 p5.js says: {{message}}",welcome:"Welcome! This is your friendly debugger. To turn me off, switch to using p5.min.js."}}},{}],108:[function(e,t,r){t.exports={fes:{autoplay:"Su browser impidío un medio tocar (de '{{src}}'), posiblemente porque las reglas de autoplay. Para aprender más, visite {{link}}.",fileLoadError:{bytes:"",font:"",gif:"",image:"",json:"",large:"",strings:"",suggestion:"",table:"",xml:""},misusedTopLevel:"",pre:"🌸 p5.js dice: {{message}}",welcome:""}}},{}],109:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i=o(e("./en/translation")),n=o(e("./es/translation"));function o(e){return e&&e.__esModule?e:{default:e}}var a={en:{translation:i.default},es:{translation:n.default}};r.default=a},{"./en/translation":107,"./es/translation":108}]},{},[37])(37)}); ================================================ FILE: docs/examples/transcrypt/sketch_002/target/org.transcrypt.__runtime__.js ================================================ // Transcrypt'ed from Python, 2021-11-02 13:06:09 var __name__ = 'org.transcrypt.__runtime__'; export var __envir__ = {}; __envir__.interpreter_name = 'python'; __envir__.transpiler_name = 'transcrypt'; __envir__.executor_name = __envir__.transpiler_name; __envir__.transpiler_version = '3.9.0'; export function __nest__ (headObject, tailNames, value) { var current = headObject; if (tailNames != '') { var tailChain = tailNames.split ('.'); var firstNewIndex = tailChain.length; for (var index = 0; index < tailChain.length; index++) { if (!current.hasOwnProperty (tailChain [index])) { firstNewIndex = index; break; } current = current [tailChain [index]]; } for (var index = firstNewIndex; index < tailChain.length; index++) { current [tailChain [index]] = {}; current = current [tailChain [index]]; } } for (let attrib of Object.getOwnPropertyNames (value)) { Object.defineProperty (current, attrib, { get () {return value [attrib];}, enumerable: true, configurable: true }); } }; export function __init__ (module) { if (!module.__inited__) { module.__all__.__init__ (module.__all__); module.__inited__ = true; } return module.__all__; }; export function __get__ (aThis, func, quotedFuncName) { if (aThis) { if (aThis.hasOwnProperty ('__class__') || typeof aThis == 'string' || aThis instanceof String) { if (quotedFuncName) { Object.defineProperty (aThis, quotedFuncName, { value: function () { var args = [] .slice.apply (arguments); return func.apply (null, [aThis] .concat (args)); }, writable: true, enumerable: true, configurable: true }); } return function () { var args = [] .slice.apply (arguments); return func.apply (null, [aThis.__proxy__ ? aThis.__proxy__ : aThis] .concat (args)); }; } else { return func; } } else { return func; } }; export function __getcm__ (aThis, func, quotedFuncName) { if (aThis.hasOwnProperty ('__class__')) { return function () { var args = [] .slice.apply (arguments); return func.apply (null, [aThis.__class__] .concat (args)); }; } else { return function () { var args = [] .slice.apply (arguments); return func.apply (null, [aThis] .concat (args)); }; } }; export function __getsm__ (aThis, func, quotedFuncName) { return func; }; export var py_metatype = { __name__: 'type', __bases__: [], __new__: function (meta, name, bases, attribs) { var cls = function () { var args = [] .slice.apply (arguments); return cls.__new__ (args); }; for (var index = bases.length - 1; index >= 0; index--) { var base = bases [index]; for (var attrib in base) { var descrip = Object.getOwnPropertyDescriptor (base, attrib); if (descrip == null) { continue; } Object.defineProperty (cls, attrib, descrip); } for (let symbol of Object.getOwnPropertySymbols (base)) { let descrip = Object.getOwnPropertyDescriptor (base, symbol); Object.defineProperty (cls, symbol, descrip); } } cls.__metaclass__ = meta; cls.__name__ = name.startsWith ('py_') ? name.slice (3) : name; cls.__bases__ = bases; for (var attrib in attribs) { var descrip = Object.getOwnPropertyDescriptor (attribs, attrib); Object.defineProperty (cls, attrib, descrip); } for (let symbol of Object.getOwnPropertySymbols (attribs)) { let descrip = Object.getOwnPropertyDescriptor (attribs, symbol); Object.defineProperty (cls, symbol, descrip); } return cls; } }; py_metatype.__metaclass__ = py_metatype; export var object = { __init__: function (self) {}, __metaclass__: py_metatype, __name__: 'object', __bases__: [], __new__: function (args) { var instance = Object.create (this, {__class__: {value: this, enumerable: true}}); if ('__getattr__' in this || '__setattr__' in this) { instance.__proxy__ = new Proxy (instance, { get: function (target, name) { let result = target [name]; if (result == undefined) { return target.__getattr__ (name); } else { return result; } }, set: function (target, name, value) { try { target.__setattr__ (name, value); } catch (exception) { target [name] = value; } return true; } }) instance = instance.__proxy__ } this.__init__.apply (null, [instance] .concat (args)); return instance; } }; export function __class__ (name, bases, attribs, meta) { if (meta === undefined) { meta = bases [0] .__metaclass__; } return meta.__new__ (meta, name, bases, attribs); }; export function __pragma__ () {}; export function __call__ (/* , , * */) { var args = [] .slice.apply (arguments); if (typeof args [0] == 'object' && '__call__' in args [0]) { return args [0] .__call__ .apply (args [1], args.slice (2)); } else { return args [0] .apply (args [1], args.slice (2)); } }; __envir__.executor_name = __envir__.transpiler_name; var __main__ = {__file__: ''}; var __except__ = null; export function __kwargtrans__ (anObject) { anObject.__kwargtrans__ = null; anObject.constructor = Object; return anObject; } export function __super__ (aClass, methodName) { for (let base of aClass.__bases__) { if (methodName in base) { return base [methodName]; } } throw new Exception ('Superclass method not found'); } export function property (getter, setter) { if (!setter) { setter = function () {}; } return {get: function () {return getter (this)}, set: function (value) {setter (this, value)}, enumerable: true}; } export function __setproperty__ (anObject, name, descriptor) { if (!anObject.hasOwnProperty (name)) { Object.defineProperty (anObject, name, descriptor); } } export function assert (condition, message) { if (!condition) { throw AssertionError (message, new Error ()); } } export function __mergekwargtrans__ (object0, object1) { var result = {}; for (var attrib in object0) { result [attrib] = object0 [attrib]; } for (var attrib in object1) { result [attrib] = object1 [attrib]; } return result; }; export function __mergefields__ (targetClass, sourceClass) { let fieldNames = ['__reprfields__', '__comparefields__', '__initfields__'] if (sourceClass [fieldNames [0]]) { if (targetClass [fieldNames [0]]) { for (let fieldName of fieldNames) { targetClass [fieldName] = new Set ([...targetClass [fieldName], ...sourceClass [fieldName]]); } } else { for (let fieldName of fieldNames) { targetClass [fieldName] = new Set (sourceClass [fieldName]); } } } } export function __withblock__ (manager, statements) { if (hasattr (manager, '__enter__')) { try { manager.__enter__ (); statements (); manager.__exit__ (); } catch (exception) { if (! (manager.__exit__ (exception.name, exception, exception.stack))) { throw exception; } } } else { statements (); manager.close (); } }; export function dir (obj) { var aList = []; for (var aKey in obj) { aList.push (aKey.startsWith ('py_') ? aKey.slice (3) : aKey); } aList.sort (); return aList; }; export function setattr (obj, name, value) { obj [name] = value; }; export function getattr (obj, name) { return name in obj ? obj [name] : obj ['py_' + name]; }; export function hasattr (obj, name) { try { return name in obj || 'py_' + name in obj; } catch (exception) { return false; } }; export function delattr (obj, name) { if (name in obj) { delete obj [name]; } else { delete obj ['py_' + name]; } }; export function __in__ (element, container) { if (container === undefined || container === null) { return false; } if (container.__contains__ instanceof Function) { return container.__contains__ (element); } else { return ( container.indexOf ? container.indexOf (element) > -1 : container.hasOwnProperty (element) ); } }; export function __specialattrib__ (attrib) { return (attrib.startswith ('__') && attrib.endswith ('__')) || attrib == 'constructor' || attrib.startswith ('py_'); }; export function len (anObject) { if (anObject === undefined || anObject === null) { return 0; } if (anObject.__len__ instanceof Function) { return anObject.__len__ (); } if (anObject.length !== undefined) { return anObject.length; } var length = 0; for (var attr in anObject) { if (!__specialattrib__ (attr)) { length++; } } return length; }; export function __i__ (any) { return py_typeof (any) == dict ? any.py_keys () : any; } export function __k__ (keyed, key) { var result = keyed [key]; if (typeof result == 'undefined') { if (keyed instanceof Array) if (key == +key && key >= 0 && keyed.length > key) return result; else throw IndexError (key, new Error()); else throw KeyError (key, new Error()); } return result; } export function __t__ (target) { return ( target === undefined || target === null ? false : ['boolean', 'number'] .indexOf (typeof target) >= 0 ? target : target.__bool__ instanceof Function ? (target.__bool__ () ? target : false) : target.__len__ instanceof Function ? (target.__len__ () !== 0 ? target : false) : target instanceof Function ? target : len (target) !== 0 ? target : false ); } export function float (any) { if (any == 'inf') { return Infinity; } else if (any == '-inf') { return -Infinity; } else if (any == 'nan') { return NaN; } else if (isNaN (parseFloat (any))) { if (any === false) { return 0; } else if (any === true) { return 1; } else { throw ValueError ("could not convert string to float: '" + str(any) + "'", new Error ()); } } else { return +any; } }; float.__name__ = 'float'; float.__bases__ = [object]; export function int (any) { return float (any) | 0 }; int.__name__ = 'int'; int.__bases__ = [object]; export function bool (any) { return !!__t__ (any); }; bool.__name__ = 'bool'; bool.__bases__ = [int]; export function py_typeof (anObject) { var aType = typeof anObject; if (aType == 'object') { try { return '__class__' in anObject ? anObject.__class__ : object; } catch (exception) { return aType; } } else { return ( aType == 'boolean' ? bool : aType == 'string' ? str : aType == 'number' ? (anObject % 1 == 0 ? int : float) : null ); } }; export function issubclass (aClass, classinfo) { if (classinfo instanceof Array) { for (let aClass2 of classinfo) { if (issubclass (aClass, aClass2)) { return true; } } return false; } try { var aClass2 = aClass; if (aClass2 == classinfo) { return true; } else { var bases = [].slice.call (aClass2.__bases__); while (bases.length) { aClass2 = bases.shift (); if (aClass2 == classinfo) { return true; } if (aClass2.__bases__.length) { bases = [].slice.call (aClass2.__bases__).concat (bases); } } return false; } } catch (exception) { return aClass == classinfo || classinfo == object; } }; export function isinstance (anObject, classinfo) { try { return '__class__' in anObject ? issubclass (anObject.__class__, classinfo) : issubclass (py_typeof (anObject), classinfo); } catch (exception) { return issubclass (py_typeof (anObject), classinfo); } }; export function callable (anObject) { return anObject && typeof anObject == 'object' && '__call__' in anObject ? true : typeof anObject === 'function'; }; export function repr (anObject) { try { return anObject.__repr__ (); } catch (exception) { try { return anObject.__str__ (); } catch (exception) { try { if (anObject == null) { return 'None'; } else if (anObject.constructor == Object) { var result = '{'; var comma = false; for (var attrib in anObject) { if (!__specialattrib__ (attrib)) { if (attrib.isnumeric ()) { var attribRepr = attrib; } else { var attribRepr = '\'' + attrib + '\''; } if (comma) { result += ', '; } else { comma = true; } result += attribRepr + ': ' + repr (anObject [attrib]); } } result += '}'; return result; } else { return typeof anObject == 'boolean' ? anObject.toString () .capitalize () : anObject.toString (); } } catch (exception) { return ''; } } } }; export function chr (charCode) { return String.fromCharCode (charCode); }; export function ord (aChar) { return aChar.charCodeAt (0); }; export function max (nrOrSeq) { return arguments.length == 1 ? Math.max (...nrOrSeq) : Math.max (...arguments); }; export function min (nrOrSeq) { return arguments.length == 1 ? Math.min (...nrOrSeq) : Math.min (...arguments); }; export var abs = Math.abs; export function round (number, ndigits) { if (ndigits) { var scale = Math.pow (10, ndigits); number *= scale; } var rounded = Math.round (number); if (rounded - number == 0.5 && rounded % 2) { rounded -= 1; } if (ndigits) { rounded /= scale; } return rounded; }; export function __jsUsePyNext__ () { try { var result = this.__next__ (); return {value: result, done: false}; } catch (exception) { return {value: undefined, done: true}; } } export function __pyUseJsNext__ () { var result = this.next (); if (result.done) { throw StopIteration (new Error ()); } else { return result.value; } } export function py_iter (iterable) { if (typeof iterable == 'string' || '__iter__' in iterable) { var result = iterable.__iter__ (); result.next = __jsUsePyNext__; } else if ('selector' in iterable) { var result = list (iterable) .__iter__ (); result.next = __jsUsePyNext__; } else if ('next' in iterable) { var result = iterable if (! ('__next__' in result)) { result.__next__ = __pyUseJsNext__; } } else if (Symbol.iterator in iterable) { var result = iterable [Symbol.iterator] (); result.__next__ = __pyUseJsNext__; } else { throw IterableError (new Error ()); } result [Symbol.iterator] = function () {return result;}; return result; } export function py_next (iterator) { try { var result = iterator.__next__ (); } catch (exception) { var result = iterator.next (); if (result.done) { throw StopIteration (new Error ()); } else { return result.value; } } if (result == undefined) { throw StopIteration (new Error ()); } else { return result; } } export function __PyIterator__ (iterable) { this.iterable = iterable; this.index = 0; } __PyIterator__.prototype.__next__ = function() { if (this.index < this.iterable.length) { return this.iterable [this.index++]; } else { throw StopIteration (new Error ()); } }; export function __JsIterator__ (iterable) { this.iterable = iterable; this.index = 0; } __JsIterator__.prototype.next = function () { if (this.index < this.iterable.py_keys.length) { return {value: this.index++, done: false}; } else { return {value: undefined, done: true}; } }; export function py_reversed (iterable) { iterable = iterable.slice (); iterable.reverse (); return iterable; }; export function zip () { var args = [] .slice.call (arguments); for (var i = 0; i < args.length; i++) { if (typeof args [i] == 'string') { args [i] = args [i] .split (''); } else if (!Array.isArray (args [i])) { args [i] = Array.from (args [i]); } } var shortest = args.length == 0 ? [] : args.reduce ( function (array0, array1) { return array0.length < array1.length ? array0 : array1; } ); return shortest.map ( function (current, index) { return args.map ( function (current) { return current [index]; } ); } ); }; export function range (start, stop, step) { if (stop == undefined) { stop = start; start = 0; } if (step == undefined) { step = 1; } if ((step > 0 && start >= stop) || (step < 0 && start <= stop)) { return []; } var result = []; for (var i = start; step > 0 ? i < stop : i > stop; i += step) { result.push(i); } return result; }; export function any (iterable) { for (let item of iterable) { if (bool (item)) { return true; } } return false; } export function all (iterable) { for (let item of iterable) { if (! bool (item)) { return false; } } return true; } export function sum (iterable) { let result = 0; for (let item of iterable) { result += item; } return result; } export function enumerate (iterable) { return zip (range (len (iterable)), iterable); } export function copy (anObject) { if (anObject == null || typeof anObject == "object") { return anObject; } else { var result = {}; for (var attrib in obj) { if (anObject.hasOwnProperty (attrib)) { result [attrib] = anObject [attrib]; } } return result; } } export function deepcopy (anObject) { if (anObject == null || typeof anObject == "object") { return anObject; } else { var result = {}; for (var attrib in obj) { if (anObject.hasOwnProperty (attrib)) { result [attrib] = deepcopy (anObject [attrib]); } } return result; } } export function list (iterable) { let instance = iterable ? Array.from (iterable) : []; return instance; } Array.prototype.__class__ = list; list.__name__ = 'list'; list.__bases__ = [object]; Array.prototype.__iter__ = function () {return new __PyIterator__ (this);}; Array.prototype.__getslice__ = function (start, stop, step) { if (start < 0) { start = this.length + start; } if (stop == null) { stop = this.length; } else if (stop < 0) { stop = this.length + stop; } else if (stop > this.length) { stop = this.length; } if (step == 1) { return Array.prototype.slice.call(this, start, stop); } let result = list ([]); for (let index = start; index < stop; index += step) { result.push (this [index]); } return result; }; Array.prototype.__setslice__ = function (start, stop, step, source) { if (start < 0) { start = this.length + start; } if (stop == null) { stop = this.length; } else if (stop < 0) { stop = this.length + stop; } if (step == null) { Array.prototype.splice.apply (this, [start, stop - start] .concat (source)); } else { let sourceIndex = 0; for (let targetIndex = start; targetIndex < stop; targetIndex += step) { this [targetIndex] = source [sourceIndex++]; } } }; Array.prototype.__repr__ = function () { if (this.__class__ == set && !this.length) { return 'set()'; } let result = !this.__class__ || this.__class__ == list ? '[' : this.__class__ == tuple ? '(' : '{'; for (let index = 0; index < this.length; index++) { if (index) { result += ', '; } result += repr (this [index]); } if (this.__class__ == tuple && this.length == 1) { result += ','; } result += !this.__class__ || this.__class__ == list ? ']' : this.__class__ == tuple ? ')' : '}';; return result; }; Array.prototype.__str__ = Array.prototype.__repr__; Array.prototype.append = function (element) { this.push (element); }; Array.prototype.py_clear = function () { this.length = 0; }; Array.prototype.extend = function (aList) { this.push.apply (this, aList); }; Array.prototype.insert = function (index, element) { this.splice (index, 0, element); }; Array.prototype.remove = function (element) { let index = this.indexOf (element); if (index == -1) { throw ValueError ("list.remove(x): x not in list", new Error ()); } this.splice (index, 1); }; Array.prototype.index = function (element) { return this.indexOf (element); }; Array.prototype.py_pop = function (index) { if (index == undefined) { return this.pop (); } else { return this.splice (index, 1) [0]; } }; Array.prototype.py_sort = function () { __sort__.apply (null, [this].concat ([] .slice.apply (arguments))); }; Array.prototype.__add__ = function (aList) { return list (this.concat (aList)); }; Array.prototype.__mul__ = function (scalar) { let result = this; for (let i = 1; i < scalar; i++) { result = result.concat (this); } return result; }; Array.prototype.__rmul__ = Array.prototype.__mul__; export function tuple (iterable) { let instance = iterable ? [] .slice.apply (iterable) : []; instance.__class__ = tuple; return instance; } tuple.__name__ = 'tuple'; tuple.__bases__ = [object]; export function set (iterable) { let instance = []; if (iterable) { for (let index = 0; index < iterable.length; index++) { instance.add (iterable [index]); } } instance.__class__ = set; return instance; } set.__name__ = 'set'; set.__bases__ = [object]; Array.prototype.__bindexOf__ = function (element) { element += ''; let mindex = 0; let maxdex = this.length - 1; while (mindex <= maxdex) { let index = (mindex + maxdex) / 2 | 0; let middle = this [index] + ''; if (middle < element) { mindex = index + 1; } else if (middle > element) { maxdex = index - 1; } else { return index; } } return -1; }; Array.prototype.add = function (element) { if (this.indexOf (element) == -1) { this.push (element); } }; Array.prototype.discard = function (element) { var index = this.indexOf (element); if (index != -1) { this.splice (index, 1); } }; Array.prototype.isdisjoint = function (other) { this.sort (); for (let i = 0; i < other.length; i++) { if (this.__bindexOf__ (other [i]) != -1) { return false; } } return true; }; Array.prototype.issuperset = function (other) { this.sort (); for (let i = 0; i < other.length; i++) { if (this.__bindexOf__ (other [i]) == -1) { return false; } } return true; }; Array.prototype.issubset = function (other) { return set (other.slice ()) .issuperset (this); }; Array.prototype.union = function (other) { let result = set (this.slice () .sort ()); for (let i = 0; i < other.length; i++) { if (result.__bindexOf__ (other [i]) == -1) { result.push (other [i]); } } return result; }; Array.prototype.intersection = function (other) { this.sort (); let result = set (); for (let i = 0; i < other.length; i++) { if (this.__bindexOf__ (other [i]) != -1) { result.push (other [i]); } } return result; }; Array.prototype.difference = function (other) { let sother = set (other.slice () .sort ()); let result = set (); for (let i = 0; i < this.length; i++) { if (sother.__bindexOf__ (this [i]) == -1) { result.push (this [i]); } } return result; }; Array.prototype.symmetric_difference = function (other) { return this.union (other) .difference (this.intersection (other)); }; Array.prototype.py_update = function () { let updated = [] .concat.apply (this.slice (), arguments) .sort (); this.py_clear (); for (let i = 0; i < updated.length; i++) { if (updated [i] != updated [i - 1]) { this.push (updated [i]); } } }; Array.prototype.__eq__ = function (other) { if (this.length != other.length) { return false; } if (this.__class__ == set) { this.sort (); other.sort (); } for (let i = 0; i < this.length; i++) { if (this [i] != other [i]) { return false; } } return true; }; Array.prototype.__ne__ = function (other) { return !this.__eq__ (other); }; Array.prototype.__le__ = function (other) { if (this.__class__ == set) { return this.issubset (other); } else { for (let i = 0; i < this.length; i++) { if (this [i] > other [i]) { return false; } else if (this [i] < other [i]) { return true; } } return true; } }; Array.prototype.__ge__ = function (other) { if (this.__class__ == set) { return this.issuperset (other); } else { for (let i = 0; i < this.length; i++) { if (this [i] < other [i]) { return false; } else if (this [i] > other [i]) { return true; } } return true; } }; Array.prototype.__lt__ = function (other) { return ( this.__class__ == set ? this.issubset (other) && !this.issuperset (other) : !this.__ge__ (other) ); }; Array.prototype.__gt__ = function (other) { return ( this.__class__ == set ? this.issuperset (other) && !this.issubset (other) : !this.__le__ (other) ); }; export function bytearray (bytable, encoding) { if (bytable == undefined) { return new Uint8Array (0); } else { let aType = py_typeof (bytable); if (aType == int) { return new Uint8Array (bytable); } else if (aType == str) { let aBytes = new Uint8Array (len (bytable)); for (let i = 0; i < len (bytable); i++) { aBytes [i] = bytable.charCodeAt (i); } return aBytes; } else if (aType == list || aType == tuple) { return new Uint8Array (bytable); } else { throw py_TypeError; } } } export var bytes = bytearray; Uint8Array.prototype.__add__ = function (aBytes) { let result = new Uint8Array (this.length + aBytes.length); result.set (this); result.set (aBytes, this.length); return result; }; Uint8Array.prototype.__mul__ = function (scalar) { let result = new Uint8Array (scalar * this.length); for (let i = 0; i < scalar; i++) { result.set (this, i * this.length); } return result; }; Uint8Array.prototype.__rmul__ = Uint8Array.prototype.__mul__; export function str (stringable) { if (typeof stringable === 'number') return stringable.toString(); else { try { return stringable.__str__ (); } catch (exception) { try { return repr (stringable); } catch (exception) { return String (stringable); } } } }; String.prototype.__class__ = str; str.__name__ = 'str'; str.__bases__ = [object]; String.prototype.__iter__ = function () {new __PyIterator__ (this);}; String.prototype.__repr__ = function () { return (this.indexOf ('\'') == -1 ? '\'' + this + '\'' : '"' + this + '"') .py_replace ('\t', '\\t') .py_replace ('\n', '\\n'); }; String.prototype.__str__ = function () { return this; }; String.prototype.capitalize = function () { return this.charAt (0).toUpperCase () + this.slice (1); }; String.prototype.endswith = function (suffix) { if (suffix instanceof Array) { for (var i=0;i> b; } }; export function __or__ (a, b) { if (typeof a == 'object' && '__or__' in a) { return a.__or__ (b); } else if (typeof b == 'object' && '__ror__' in b) { return b.__ror__ (a); } else { return a | b; } }; export function __xor__ (a, b) { if (typeof a == 'object' && '__xor__' in a) { return a.__xor__ (b); } else if (typeof b == 'object' && '__rxor__' in b) { return b.__rxor__ (a); } else { return a ^ b; } }; export function __and__ (a, b) { if (typeof a == 'object' && '__and__' in a) { return a.__and__ (b); } else if (typeof b == 'object' && '__rand__' in b) { return b.__rand__ (a); } else { return a & b; } }; export function __eq__ (a, b) { if (typeof a == 'object' && '__eq__' in a) { return a.__eq__ (b); } else { return a == b; } }; export function __ne__ (a, b) { if (typeof a == 'object' && '__ne__' in a) { return a.__ne__ (b); } else { return a != b } }; export function __lt__ (a, b) { if (typeof a == 'object' && '__lt__' in a) { return a.__lt__ (b); } else { return a < b; } }; export function __le__ (a, b) { if (typeof a == 'object' && '__le__' in a) { return a.__le__ (b); } else { return a <= b; } }; export function __gt__ (a, b) { if (typeof a == 'object' && '__gt__' in a) { return a.__gt__ (b); } else { return a > b; } }; export function __ge__ (a, b) { if (typeof a == 'object' && '__ge__' in a) { return a.__ge__ (b); } else { return a >= b; } }; export function __imatmul__ (a, b) { if ('__imatmul__' in a) { return a.__imatmul__ (b); } else { return a.__matmul__ (b); } }; export function __ipow__ (a, b) { if (typeof a == 'object' && '__pow__' in a) { return a.__ipow__ (b); } else if (typeof a == 'object' && '__ipow__' in a) { return a.__pow__ (b); } else if (typeof b == 'object' && '__rpow__' in b) { return b.__rpow__ (a); } else { return Math.pow (a, b); } }; export function __ijsmod__ (a, b) { if (typeof a == 'object' && '__imod__' in a) { return a.__ismod__ (b); } else if (typeof a == 'object' && '__mod__' in a) { return a.__mod__ (b); } else if (typeof b == 'object' && '__rpow__' in b) { return b.__rmod__ (a); } else { return a % b; } }; export function __imod__ (a, b) { if (typeof a == 'object' && '__imod__' in a) { return a.__imod__ (b); } else if (typeof a == 'object' && '__mod__' in a) { return a.__mod__ (b); } else if (typeof b == 'object' && '__rmod__' in b) { return b.__rmod__ (a); } else { return ((a % b) + b) % b; } }; export function __imul__ (a, b) { if (typeof a == 'object' && '__imul__' in a) { return a.__imul__ (b); } else if (typeof a == 'object' && '__mul__' in a) { return a = a.__mul__ (b); } else if (typeof b == 'object' && '__rmul__' in b) { return a = b.__rmul__ (a); } else if (typeof a == 'string') { return a = a.__mul__ (b); } else if (typeof b == 'string') { return a = b.__rmul__ (a); } else { return a *= b; } }; export function __idiv__ (a, b) { if (typeof a == 'object' && '__idiv__' in a) { return a.__idiv__ (b); } else if (typeof a == 'object' && '__div__' in a) { return a = a.__div__ (b); } else if (typeof b == 'object' && '__rdiv__' in b) { return a = b.__rdiv__ (a); } else { return a /= b; } }; export function __iadd__ (a, b) { if (typeof a == 'object' && '__iadd__' in a) { return a.__iadd__ (b); } else if (typeof a == 'object' && '__add__' in a) { return a = a.__add__ (b); } else if (typeof b == 'object' && '__radd__' in b) { return a = b.__radd__ (a); } else { return a += b; } }; export function __isub__ (a, b) { if (typeof a == 'object' && '__isub__' in a) { return a.__isub__ (b); } else if (typeof a == 'object' && '__sub__' in a) { return a = a.__sub__ (b); } else if (typeof b == 'object' && '__rsub__' in b) { return a = b.__rsub__ (a); } else { return a -= b; } }; export function __ilshift__ (a, b) { if (typeof a == 'object' && '__ilshift__' in a) { return a.__ilshift__ (b); } else if (typeof a == 'object' && '__lshift__' in a) { return a = a.__lshift__ (b); } else if (typeof b == 'object' && '__rlshift__' in b) { return a = b.__rlshift__ (a); } else { return a <<= b; } }; export function __irshift__ (a, b) { if (typeof a == 'object' && '__irshift__' in a) { return a.__irshift__ (b); } else if (typeof a == 'object' && '__rshift__' in a) { return a = a.__rshift__ (b); } else if (typeof b == 'object' && '__rrshift__' in b) { return a = b.__rrshift__ (a); } else { return a >>= b; } }; export function __ior__ (a, b) { if (typeof a == 'object' && '__ior__' in a) { return a.__ior__ (b); } else if (typeof a == 'object' && '__or__' in a) { return a = a.__or__ (b); } else if (typeof b == 'object' && '__ror__' in b) { return a = b.__ror__ (a); } else { return a |= b; } }; export function __ixor__ (a, b) { if (typeof a == 'object' && '__ixor__' in a) { return a.__ixor__ (b); } else if (typeof a == 'object' && '__xor__' in a) { return a = a.__xor__ (b); } else if (typeof b == 'object' && '__rxor__' in b) { return a = b.__rxor__ (a); } else { return a ^= b; } }; export function __iand__ (a, b) { if (typeof a == 'object' && '__iand__' in a) { return a.__iand__ (b); } else if (typeof a == 'object' && '__and__' in a) { return a = a.__and__ (b); } else if (typeof b == 'object' && '__rand__' in b) { return a = b.__rand__ (a); } else { return a &= b; } }; export function __getitem__ (container, key) { if (typeof container == 'object' && '__getitem__' in container) { return container.__getitem__ (key); } else if ((typeof container == 'string' || container instanceof Array) && key < 0) { return container [container.length + key]; } else { return container [key]; } }; export function __setitem__ (container, key, value) { if (typeof container == 'object' && '__setitem__' in container) { container.__setitem__ (key, value); } else if ((typeof container == 'string' || container instanceof Array) && key < 0) { container [container.length + key] = value; } else { container [key] = value; } }; export function __getslice__ (container, lower, upper, step) { if (typeof container == 'object' && '__getitem__' in container) { return container.__getitem__ ([lower, upper, step]); } else { return container.__getslice__ (lower, upper, step); } }; export function __setslice__ (container, lower, upper, step, value) { if (typeof container == 'object' && '__setitem__' in container) { container.__setitem__ ([lower, upper, step], value); } else { container.__setslice__ (lower, upper, step, value); } }; export var BaseException = __class__ ('BaseException', [object], { __module__: __name__, }); export var Exception = __class__ ('Exception', [BaseException], { __module__: __name__, get __init__ () {return __get__ (this, function (self) { var kwargs = dict (); if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'self': var self = __allkwargs0__ [__attrib0__]; break; default: kwargs [__attrib0__] = __allkwargs0__ [__attrib0__]; } } delete kwargs.__kwargtrans__; } var args = tuple ([].slice.apply (arguments).slice (1, __ilastarg0__ + 1)); } else { var args = tuple (); } self.__args__ = args; if (kwargs.error != null) { self.stack = kwargs.error.stack; } else if (Error) { self.stack = new Error ().stack; } else { self.stack = 'No stack trace available'; } });}, get __repr__ () {return __get__ (this, function (self) { if (len (self.__args__) > 1) { return '{}{}'.format (self.__class__.__name__, repr (tuple (self.__args__))); } else if (len (self.__args__)) { return '{}({})'.format (self.__class__.__name__, repr (self.__args__ [0])); } else { return '{}()'.format (self.__class__.__name__); } });}, get __str__ () {return __get__ (this, function (self) { if (len (self.__args__) > 1) { return str (tuple (self.__args__)); } else if (len (self.__args__)) { return str (self.__args__ [0]); } else { return ''; } });} }); export var IterableError = __class__ ('IterableError', [Exception], { __module__: __name__, get __init__ () {return __get__ (this, function (self, error) { Exception.__init__ (self, "Can't iterate over non-iterable", __kwargtrans__ ({error: error})); });} }); export var StopIteration = __class__ ('StopIteration', [Exception], { __module__: __name__, get __init__ () {return __get__ (this, function (self, error) { Exception.__init__ (self, 'Iterator exhausted', __kwargtrans__ ({error: error})); });} }); export var ValueError = __class__ ('ValueError', [Exception], { __module__: __name__, get __init__ () {return __get__ (this, function (self, message, error) { Exception.__init__ (self, message, __kwargtrans__ ({error: error})); });} }); export var KeyError = __class__ ('KeyError', [Exception], { __module__: __name__, get __init__ () {return __get__ (this, function (self, message, error) { Exception.__init__ (self, message, __kwargtrans__ ({error: error})); });} }); export var AssertionError = __class__ ('AssertionError', [Exception], { __module__: __name__, get __init__ () {return __get__ (this, function (self, message, error) { if (message) { Exception.__init__ (self, message, __kwargtrans__ ({error: error})); } else { Exception.__init__ (self, __kwargtrans__ ({error: error})); } });} }); export var NotImplementedError = __class__ ('NotImplementedError', [Exception], { __module__: __name__, get __init__ () {return __get__ (this, function (self, message, error) { Exception.__init__ (self, message, __kwargtrans__ ({error: error})); });} }); export var IndexError = __class__ ('IndexError', [Exception], { __module__: __name__, get __init__ () {return __get__ (this, function (self, message, error) { Exception.__init__ (self, message, __kwargtrans__ ({error: error})); });} }); export var AttributeError = __class__ ('AttributeError', [Exception], { __module__: __name__, get __init__ () {return __get__ (this, function (self, message, error) { Exception.__init__ (self, message, __kwargtrans__ ({error: error})); });} }); export var py_TypeError = __class__ ('py_TypeError', [Exception], { __module__: __name__, get __init__ () {return __get__ (this, function (self, message, error) { Exception.__init__ (self, message, __kwargtrans__ ({error: error})); });} }); export var Warning = __class__ ('Warning', [Exception], { __module__: __name__, }); export var UserWarning = __class__ ('UserWarning', [Warning], { __module__: __name__, }); export var DeprecationWarning = __class__ ('DeprecationWarning', [Warning], { __module__: __name__, }); export var RuntimeWarning = __class__ ('RuntimeWarning', [Warning], { __module__: __name__, }); export var __sort__ = function (iterable, key, reverse) { if (typeof key == 'undefined' || (key != null && key.hasOwnProperty ("__kwargtrans__"))) {; var key = null; }; if (typeof reverse == 'undefined' || (reverse != null && reverse.hasOwnProperty ("__kwargtrans__"))) {; var reverse = false; }; if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'iterable': var iterable = __allkwargs0__ [__attrib0__]; break; case 'key': var key = __allkwargs0__ [__attrib0__]; break; case 'reverse': var reverse = __allkwargs0__ [__attrib0__]; break; } } } } else { } if (key) { iterable.sort ((function __lambda__ (a, b) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'a': var a = __allkwargs0__ [__attrib0__]; break; case 'b': var b = __allkwargs0__ [__attrib0__]; break; } } } } else { } return (key (a) > key (b) ? 1 : -(1)); })); } else { iterable.sort (); } if (reverse) { iterable.reverse (); } }; export var sorted = function (iterable, key, reverse) { if (typeof key == 'undefined' || (key != null && key.hasOwnProperty ("__kwargtrans__"))) {; var key = null; }; if (typeof reverse == 'undefined' || (reverse != null && reverse.hasOwnProperty ("__kwargtrans__"))) {; var reverse = false; }; if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'iterable': var iterable = __allkwargs0__ [__attrib0__]; break; case 'key': var key = __allkwargs0__ [__attrib0__]; break; case 'reverse': var reverse = __allkwargs0__ [__attrib0__]; break; } } } } else { } if (py_typeof (iterable) == dict) { var result = copy (iterable.py_keys ()); } else { var result = copy (iterable); } __sort__ (result, key, reverse); return result; }; export var map = function (func, iterable) { return (function () { var __accu0__ = []; for (var item of iterable) { __accu0__.append (func (item)); } return __accu0__; }) (); }; export var filter = function (func, iterable) { if (func == null) { var func = bool; } return (function () { var __accu0__ = []; for (var item of iterable) { if (func (item)) { __accu0__.append (item); } } return __accu0__; }) (); }; export var divmod = function (n, d) { return tuple ([Math.floor (n / d), __mod__ (n, d)]); }; export var __Terminal__ = __class__ ('__Terminal__', [object], { __module__: __name__, get __init__ () {return __get__ (this, function (self) { self.buffer = ''; try { self.element = document.getElementById ('__terminal__'); } catch (__except0__) { self.element = null; } if (self.element) { self.element.style.overflowX = 'auto'; self.element.style.boxSizing = 'border-box'; self.element.style.padding = '5px'; self.element.innerHTML = '_'; } });}, get print () {return __get__ (this, function (self) { var sep = ' '; var end = '\n'; if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'self': var self = __allkwargs0__ [__attrib0__]; break; case 'sep': var sep = __allkwargs0__ [__attrib0__]; break; case 'end': var end = __allkwargs0__ [__attrib0__]; break; } } } var args = tuple ([].slice.apply (arguments).slice (1, __ilastarg0__ + 1)); } else { var args = tuple (); } self.buffer = '{}{}{}'.format (self.buffer, sep.join ((function () { var __accu0__ = []; for (var arg of args) { __accu0__.append (str (arg)); } return __accu0__; }) ()), end).__getslice__ (-(4096), null, 1); if (self.element) { self.element.innerHTML = self.buffer.py_replace ('\n', '
').py_replace (' ', ' '); self.element.scrollTop = self.element.scrollHeight; } else { console.log (sep.join ((function () { var __accu0__ = []; for (var arg of args) { __accu0__.append (str (arg)); } return __accu0__; }) ())); } });}, get input () {return __get__ (this, function (self, question) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'self': var self = __allkwargs0__ [__attrib0__]; break; case 'question': var question = __allkwargs0__ [__attrib0__]; break; } } } } else { } self.print ('{}'.format (question), __kwargtrans__ ({end: ''})); var answer = window.prompt ('\n'.join (self.buffer.py_split ('\n').__getslice__ (-(8), null, 1))); self.print (answer); return answer; });} }); export var __terminal__ = __Terminal__ (); export var print = __terminal__.print; export var input = __terminal__.input; //# sourceMappingURL=org.transcrypt.__runtime__.map ================================================ FILE: docs/examples/transcrypt/sketch_002/target/org.transcrypt.__runtime__.py ================================================ # Transcrypt runtime module #__pragma__ ('js', 'export var __envir__ = {{}};\n{}', __include__ ('org/transcrypt/__envir__.js')) #__pragma__ ('js', '{}', __include__ ('org/transcrypt/__core__.js')) #__pragma__ ('js', '{}', __include__ ('org/transcrypt/__builtin__.js')) #__pragma__ ('skip') copy = Math = __typeof__ = __repr__ = document = console = window = 0 #__pragma__ ('noskip') #__pragma__ ('notconv') # !!! tconv gives a problem with __terminal__, needs investigation #__pragma__ ('nokwargs') #__pragma__ ('noalias', 'sort') class BaseException: pass class Exception (BaseException): #__pragma__ ('kwargs') def __init__ (self, *args, **kwargs): self.__args__ = args if kwargs.error != None: self.stack = kwargs.error.stack # Integrate with JavaScript Error object elif Error: self.stack = (__new__(Error())).stack # Create our own stack if we aren't given one else: self.stack = 'No stack trace available' #__pragma__ ('nokwargs') def __repr__ (self): if len (self.__args__) > 1: return '{}{}'.format (self.__class__.__name__, repr (tuple (self.__args__))) elif len (self.__args__): return '{}({})'.format (self.__class__.__name__, repr (self.__args__ [0])) else: return '{}()'.format (self.__class__.__name__) def __str__ (self): if len (self.__args__) > 1: return str (tuple (self.__args__)) elif len (self.__args__): return str (self.__args__ [0]) else: return '' class IterableError (Exception): def __init__ (self, error): Exception.__init__ (self, 'Can\'t iterate over non-iterable', error = error) class StopIteration (Exception): def __init__ (self, error): Exception.__init__ (self, 'Iterator exhausted', error = error) class ValueError (Exception): def __init__ (self, message, error): Exception.__init__ (self, message, error = error) class KeyError (Exception): def __init__ (self, message, error): Exception.__init__ (self, message, error = error) class AssertionError (Exception): def __init__ (self, message, error): if message: Exception.__init__ (self, message, error = error) else: Exception.__init__ (self, error = error) class NotImplementedError (Exception): def __init__(self, message, error): Exception.__init__(self, message, error = error) class IndexError (Exception): def __init__(self, message, error): Exception.__init__(self, message, error = error) class AttributeError (Exception): def __init__(self, message, error): Exception.__init__(self, message, error = error) class TypeError (Exception): def __init__(self, message, error): Exception.__init__(self, message, error = error) # Warnings Exceptions # N.B. This is a limited subset of the warnings defined in # the cpython implementation to keep things small for now. class Warning (Exception): ''' Warning Base Class ''' pass class UserWarning (Warning): pass class DeprecationWarning (Warning): pass class RuntimeWarning (Warning): pass #__pragma__ ('kwargs') def __sort__ (iterable, key = None, reverse = False): # Used by py_sort, can deal with kwargs if key: iterable.sort (lambda a, b: 1 if key (a) > key (b) else -1) # JavaScript sort, case '==' is irrelevant for sorting else: iterable.sort () # JavaScript sort if reverse: iterable.reverse () def sorted (iterable, key = None, reverse = False): if type (iterable) == dict: result = copy (iterable.keys ()) else: result = copy (iterable) __sort__ (result, key, reverse) return result #__pragma__ ('nokwargs') def map (func, iterable): return [func (item) for item in iterable] def filter (func, iterable): if func == None: func = bool return [item for item in iterable if func (item)] def divmod (n, d): return n // d, n % d #__pragma__ ('ifdef', '__complex__') class complex: def __init__ (self, real, imag = None): if imag == None: if type (real) == complex: self.real = real.real self.imag = real.imag else: self.real = real self.imag = 0 else: self.real = real self.imag = imag def __neg__ (self): return complex (-self.real, -self.imag) def __exp__ (self): modulus = Math.exp (self.real) return complex (modulus * Math.cos (self.imag), modulus * Math.sin (self.imag)) def __log__ (self): return complex (Math.log (Math.sqrt (self.real * self.real + self.imag * self.imag)), Math.atan2 (self.imag, self.real)) def __pow__ (self, other): # a ** b = exp (b log a) return (self.__log__ () .__mul__ (other)) .__exp__ () def __rpow__ (self, real): # real ** comp -> comp.__rpow__ (real) return self.__mul__ (Math.log (real)) .__exp__ () def __mul__ (self, other): if __typeof__ (other) is 'number': return complex (self.real * other, self.imag * other) else: return complex (self.real * other.real - self.imag * other.imag, self.real * other.imag + self.imag * other.real) def __rmul__ (self, real): # real + comp -> comp.__rmul__ (real) return complex (self.real * real, self.imag * real) def __div__ (self, other): if __typeof__ (other) is 'number': return complex (self.real / other, self.imag / other) else: denom = other.real * other.real + other.imag * other.imag return complex ( (self.real * other.real + self.imag * other.imag) / denom, (self.imag * other.real - self.real * other.imag) / denom ) def __rdiv__ (self, real): # real / comp -> comp.__rdiv__ (real) denom = self.real * self.real return complex ( (real * self.real) / denom, (real * self.imag) / denom ) def __add__ (self, other): if __typeof__ (other) is 'number': return complex (self.real + other, self.imag) else: # Assume other is complex return complex (self.real + other.real, self.imag + other.imag) def __radd__ (self, real): # real + comp -> comp.__radd__ (real) return complex (self.real + real, self.imag) def __sub__ (self, other): if __typeof__ (other) is 'number': return complex (self.real - other, self.imag) else: return complex (self.real - other.real, self.imag - other.imag) def __rsub__ (self, real): # real - comp -> comp.__rsub__ (real) return complex (real - self.real, -self.imag) def __repr__ (self): return '({}{}{}j)'.format (self.real, '+' if self.imag >= 0 else '', self.imag) def __str__ (self): return __repr__ (self) [1 : -1] def __eq__ (self, other): if __typeof__ (other) is 'number': return self.real == other else: return self.real == other.real and self.imag == other.imag def __ne__ (self, other): if __typeof__ (other) is 'number': return self.real != other else: return self.real != other.real or self.imag != other.imag def conjugate (self): return complex (self.real, -self.imag) def __conj__ (aNumber): if isinstance (aNumber, complex): return complex (aNumber.real, -aNumber.imag) else: return complex (aNumber, 0) #__pragma__ ('endif') class __Terminal__: ''' Printing to either the console or to html happens async, but is blocked by calling window.prompt. So while all input and print statements are encountered in normal order, the print's exit immediately without yet having actually printed This means the next input takes control, blocking actual printing and so on indefinitely The effect is that everything's only printed after all inputs are done To prevent that, what's needed is to only execute the next window.prompt after actual printing has been done Since we've no way to find out when that is, a timeout is used. ''' def __init__ (self): self.buffer = '' try: self.element = document.getElementById ('__terminal__') except: self.element = None if self.element: self.element.style.overflowX = 'auto' self.element.style.boxSizing = 'border-box' self.element.style.padding = '5px' self.element.innerHTML = '_' #__pragma__ ('kwargs') def print (self, *args, sep = ' ', end = '\n'): self.buffer = '{}{}{}'.format (self.buffer, sep.join ([str (arg) for arg in args]), end) [-4096 : ] if self.element: self.element.innerHTML = self.buffer.replace ('\n', '
') .replace (' ', ' ') self.element.scrollTop = self.element.scrollHeight else: console.log (sep.join ([str (arg) for arg in args])) def input (self, question): self.print ('{}'.format (question), end = '') answer = window.prompt ('\n'.join (self.buffer.split ('\n') [-8:])) self.print (answer) return answer #__pragma__ ('nokwargs') __terminal__ = __Terminal__ () print = __terminal__.print input = __terminal__.input ================================================ FILE: docs/examples/transcrypt/sketch_002/target/pyp5js.js ================================================ // Transcrypt'ed from Python, 2021-11-02 13:06:10 import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, all, any, assert, bool, bytearray, bytes, callable, chr, deepcopy, delattr, dict, dir, divmod, enumerate, getattr, hasattr, isinstance, issubclass, len, list, object, ord, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, setattr, sorted, sum, tuple, zip} from './org.transcrypt.__runtime__.js'; import {PythonFunctions} from './python_functions.js'; var __name__ = 'pyp5js'; export var _P5_INSTANCE = null; export var _CTX_MIDDLE = null; export var _DEFAULT_FILL = null; export var _DEFAULT_LEADMULT = null; export var _DEFAULT_STROKE = null; export var _DEFAULT_TEXT_FILL = null; export var ADD = null; export var ALT = null; export var ARROW = null; export var AUDIO = null; export var AUTO = null; export var AXES = null; export var BACKSPACE = null; export var BASELINE = null; export var BEVEL = null; export var BEZIER = null; export var BLEND = null; export var BLUR = null; export var BOLD = null; export var BOLDITALIC = null; export var BOTTOM = null; export var BURN = null; export var CENTER = null; export var CHORD = null; export var CLAMP = null; export var CLOSE = null; export var CONTROL = null; export var CORNER = null; export var CORNERS = null; export var CROSS = null; export var CURVE = null; export var DARKEST = null; export var DEG_TO_RAD = null; export var DEGREES = null; export var DELETE = null; export var DIFFERENCE = null; export var DILATE = null; export var DODGE = null; export var DOWN_ARROW = null; export var ENTER = null; export var ERODE = null; export var ESCAPE = null; export var EXCLUSION = null; export var FILL = null; export var GRAY = null; export var GRID = null; export var HALF_PI = null; export var HAND = null; export var HARD_LIGHT = null; export var HSB = null; export var HSL = null; export var IMAGE = null; export var IMMEDIATE = null; export var INVERT = null; export var ITALIC = null; export var LANDSCAPE = null; export var LEFT = null; export var LEFT_ARROW = null; export var LIGHTEST = null; export var LINE_LOOP = null; export var LINE_STRIP = null; export var LINEAR = null; export var LINES = null; export var MIRROR = null; export var MITER = null; export var MOVE = null; export var MULTIPLY = null; export var NEAREST = null; export var NORMAL = null; export var OPAQUE = null; export var OPEN = null; export var OPTION = null; export var OVERLAY = null; export var PI = null; export var PIE = null; export var POINTS = null; export var PORTRAIT = null; export var POSTERIZE = null; export var PROJECT = null; export var QUAD_STRIP = null; export var QUADRATIC = null; export var QUADS = null; export var QUARTER_PI = null; export var RAD_TO_DEG = null; export var RADIANS = null; export var RADIUS = null; export var REPEAT = null; export var REPLACE = null; export var RETURN = null; export var RGB = null; export var RIGHT = null; export var RIGHT_ARROW = null; export var ROUND = null; export var SCREEN = null; export var SHIFT = null; export var SOFT_LIGHT = null; export var SQUARE = null; export var STROKE = null; export var SUBTRACT = null; export var TAB = null; export var TAU = null; export var TEXT = null; export var TEXTURE = null; export var THRESHOLD = null; export var TOP = null; export var TRIANGLE_FAN = null; export var TRIANGLE_STRIP = null; export var TRIANGLES = null; export var TWO_PI = null; export var UP_ARROW = null; export var VIDEO = null; export var WAIT = null; export var WEBGL = null; export var P2D = null; var PI = null; export var frameCount = null; export var focused = null; export var displayWidth = null; export var displayHeight = null; export var windowWidth = null; export var windowHeight = null; export var width = null; export var height = null; export var disableFriendlyErrors = null; export var deviceOrientation = null; export var accelerationX = null; export var accelerationY = null; export var accelerationZ = null; export var pAccelerationX = null; export var pAccelerationY = null; export var pAccelerationZ = null; export var rotationX = null; export var rotationY = null; export var rotationZ = null; export var pRotationX = null; export var pRotationY = null; export var pRotationZ = null; export var turnAxis = null; export var keyIsPressed = null; export var key = null; export var keyCode = null; export var mouseX = null; export var mouseY = null; export var pmouseX = null; export var pmouseY = null; export var winMouseX = null; export var winMouseY = null; export var pwinMouseX = null; export var pwinMouseY = null; export var mouseButton = null; export var mouseIsPressed = null; export var touches = null; export var pixels = null; export var alpha = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.alpha (...args); }; export var blue = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.blue (...args); }; export var brightness = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.brightness (...args); }; export var color = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.color (...args); }; export var green = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.green (...args); }; export var hue = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.hue (...args); }; export var lerpColor = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.lerpColor (...args); }; export var lightness = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.lightness (...args); }; export var red = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.red (...args); }; export var saturation = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.saturation (...args); }; export var background = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.background (...args); }; export var py_clear = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } var p5_clear = _P5_INSTANCE.clear (...args); return p5_clear; }; export var erase = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.erase (...args); }; export var noErase = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noErase (...args); }; export var colorMode = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.colorMode (...args); }; export var fill = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.fill (...args); }; export var noFill = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noFill (...args); }; export var noStroke = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noStroke (...args); }; export var stroke = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.stroke (...args); }; export var arc = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.arc (...args); }; export var ellipse = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.ellipse (...args); }; export var circle = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.circle (...args); }; export var line = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.line (...args); }; export var point = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.point (...args); }; export var quad = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.quad (...args); }; export var rect = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.rect (...args); }; export var square = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.square (...args); }; export var triangle = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.triangle (...args); }; export var plane = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.plane (...args); }; export var box = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.box (...args); }; export var sphere = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.sphere (...args); }; export var cylinder = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.cylinder (...args); }; export var cone = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.cone (...args); }; export var ellipsoid = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.ellipsoid (...args); }; export var torus = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.torus (...args); }; export var loadModel = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.loadModel (...args); }; export var model = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.model (...args); }; export var ellipseMode = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.ellipseMode (...args); }; export var noSmooth = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noSmooth (...args); }; export var rectMode = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.rectMode (...args); }; export var smooth = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.smooth (...args); }; export var strokeCap = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.strokeCap (...args); }; export var strokeJoin = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.strokeJoin (...args); }; export var strokeWeight = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.strokeWeight (...args); }; export var bezier = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.bezier (...args); }; export var bezierDetail = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.bezierDetail (...args); }; export var bezierPoint = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.bezierPoint (...args); }; export var bezierTangent = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.bezierTangent (...args); }; export var curve = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.curve (...args); }; export var curveDetail = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.curveDetail (...args); }; export var curveTightness = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.curveTightness (...args); }; export var curvePoint = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.curvePoint (...args); }; export var curveTangent = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.curveTangent (...args); }; export var beginContour = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.beginContour (...args); }; export var beginShape = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.beginShape (...args); }; export var bezierVertex = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.bezierVertex (...args); }; export var curveVertex = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.curveVertex (...args); }; export var endContour = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.endContour (...args); }; export var endShape = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.endShape (...args); }; export var quadraticVertex = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.quadraticVertex (...args); }; export var vertex = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.vertex (...args); }; export var cursor = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.cursor (...args); }; export var frameRate = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.frameRate (...args); }; export var noCursor = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noCursor (...args); }; export var fullscreen = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.fullscreen (...args); }; export var pixelDensity = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.pixelDensity (...args); }; export var displayDensity = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.displayDensity (...args); }; export var getURL = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.getURL (...args); }; export var getURLPath = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.getURLPath (...args); }; export var getURLParams = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.getURLParams (...args); }; export var preload = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.preload (...args); }; export var setup = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.setup (...args); }; export var draw = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.draw (...args); }; export var remove = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.remove (...args); }; export var noLoop = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noLoop (...args); }; export var loop = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.loop (...args); }; export var push = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.push (...args); }; export var redraw = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.redraw (...args); }; export var resizeCanvas = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.resizeCanvas (...args); }; export var noCanvas = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noCanvas (...args); }; export var createGraphics = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createGraphics (...args); }; export var blendMode = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.blendMode (...args); }; export var setAttributes = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.setAttributes (...args); }; export var applyMatrix = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.applyMatrix (...args); }; export var resetMatrix = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.resetMatrix (...args); }; export var rotate = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.rotate (...args); }; export var rotateX = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.rotateX (...args); }; export var rotateY = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.rotateY (...args); }; export var rotateZ = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.rotateZ (...args); }; export var scale = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.scale (...args); }; export var shearX = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.shearX (...args); }; export var shearY = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.shearY (...args); }; export var translate = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.translate (...args); }; export var createStringDict = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createStringDict (...args); }; export var createNumberDict = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createNumberDict (...args); }; export var append = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.append (...args); }; export var arrayCopy = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.arrayCopy (...args); }; export var concat = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.concat (...args); }; export var reverse = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.reverse (...args); }; export var shorten = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.shorten (...args); }; export var shuffle = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.shuffle (...args); }; export var py_sort = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.py_sort (...args); }; export var splice = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.splice (...args); }; export var subset = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.subset (...args); }; export var float = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.float (...args); }; export var int = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.int (...args); }; export var str = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.str (...args); }; export var boolean = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.boolean (...args); }; export var byte = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.byte (...args); }; export var char = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.char (...args); }; export var unchar = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.unchar (...args); }; export var hex = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.hex (...args); }; export var unhex = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.unhex (...args); }; export var join = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.join (...args); }; export var match = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.match (...args); }; export var matchAll = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.matchAll (...args); }; export var nf = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.nf (...args); }; export var nfc = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.nfc (...args); }; export var nfp = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.nfp (...args); }; export var nfs = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.nfs (...args); }; export var py_split = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.py_split (...args); }; export var splitTokens = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.splitTokens (...args); }; export var trim = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.trim (...args); }; export var setMoveThreshold = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.setMoveThreshold (...args); }; export var setShakeThreshold = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.setShakeThreshold (...args); }; export var keyIsDown = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.keyIsDown (...args); }; export var createImage = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createImage (...args); }; export var saveCanvas = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.saveCanvas (...args); }; export var saveFrames = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.saveFrames (...args); }; export var image_proxy = function (img) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'img': var img = __allkwargs0__ [__attrib0__]; break; } } } } else { } var _set = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } var value = img.set (...args); return value; }; var _get = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } var value = img.get (...args); return value; }; img.py_set = _set; img.py_get = _get; return img; }; export var loadImage = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } var imageObj = _P5_INSTANCE.loadImage (...args); return image_proxy (imageObj); }; export var image = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.image (...args); }; export var tint = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.tint (...args); }; export var noTint = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noTint (...args); }; export var imageMode = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.imageMode (...args); }; export var blend = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.blend (...args); }; export var copy = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.copy (...args); }; export var filter = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } if (len (args) > 1 && (args [0] === null || callable (args [0]))) { return PythonFunctions.filter (...args); } else { return _P5_INSTANCE.filter (...args); } }; export var py_get = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } var p5_get = _P5_INSTANCE.get (...args); return p5_get; }; export var loadPixels = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.loadPixels (...args); }; export var py_set = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } if (len (args) <= 1) { return PythonFunctions.py_set (...args); } else { return _P5_INSTANCE.py_set (...args); } }; export var updatePixels = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.updatePixels (...args); }; export var loadJSON = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.loadJSON (...args); }; export var loadStrings = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.loadStrings (...args); }; export var loadTable = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.loadTable (...args); }; export var loadXML = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.loadXML (...args); }; export var loadBytes = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.loadBytes (...args); }; export var httpGet = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.httpGet (...args); }; export var httpPost = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.httpPost (...args); }; export var httpDo = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.httpDo (...args); }; export var createWriter = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createWriter (...args); }; export var save = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.save (...args); }; export var saveJSON = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.saveJSON (...args); }; export var saveStrings = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.saveStrings (...args); }; export var saveTable = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.saveTable (...args); }; export var day = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.day (...args); }; export var hour = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.hour (...args); }; export var minute = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.minute (...args); }; export var millis = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.millis (...args); }; export var month = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.month (...args); }; export var second = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.second (...args); }; export var year = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.year (...args); }; export var createVector = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createVector (...args); }; export var abs = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.abs (...args); }; export var ceil = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.ceil (...args); }; export var constrain = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.constrain (...args); }; export var dist = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.dist (...args); }; export var exp = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.exp (...args); }; export var floor = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.floor (...args); }; export var lerp = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.lerp (...args); }; export var log = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.log (...args); }; export var mag = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.mag (...args); }; export var map = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } if (len (args) > 1 && callable (args [0])) { return PythonFunctions.map (...args); } else { return _P5_INSTANCE.map (...args); } }; export var max = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.max (...args); }; export var min = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.min (...args); }; export var norm = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.norm (...args); }; export var pow = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.pow (...args); }; export var round = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.round (...args); }; export var sq = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.sq (...args); }; export var sqrt = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.sqrt (...args); }; export var noise = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noise (...args); }; export var noiseDetail = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noiseDetail (...args); }; export var noiseSeed = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noiseSeed (...args); }; export var randomSeed = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.randomSeed (...args); }; export var random = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.random (...args); }; export var randomGaussian = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.randomGaussian (...args); }; export var acos = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.acos (...args); }; export var asin = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.asin (...args); }; export var atan = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.atan (...args); }; export var atan2 = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.atan2 (...args); }; export var cos = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.cos (...args); }; export var sin = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.sin (...args); }; export var tan = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.tan (...args); }; export var degrees = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.degrees (...args); }; export var radians = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.radians (...args); }; export var angleMode = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.angleMode (...args); }; export var textAlign = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.textAlign (...args); }; export var textLeading = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.textLeading (...args); }; export var textSize = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.textSize (...args); }; export var textStyle = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.textStyle (...args); }; export var textWidth = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.textWidth (...args); }; export var textAscent = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.textAscent (...args); }; export var textDescent = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.textDescent (...args); }; export var loadFont = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.loadFont (...args); }; export var text = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.text (...args); }; export var textFont = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.textFont (...args); }; export var orbitControl = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.orbitControl (...args); }; export var debugMode = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.debugMode (...args); }; export var noDebugMode = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noDebugMode (...args); }; export var ambientLight = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.ambientLight (...args); }; export var directionalLight = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.directionalLight (...args); }; export var pointLight = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.pointLight (...args); }; export var lights = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.lights (...args); }; export var loadShader = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.loadShader (...args); }; export var createShader = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createShader (...args); }; export var shader = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.shader (...args); }; export var resetShader = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.resetShader (...args); }; export var normalMaterial = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.normalMaterial (...args); }; export var texture = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.texture (...args); }; export var textureMode = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.textureMode (...args); }; export var textureWrap = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.textureWrap (...args); }; export var ambientMaterial = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.ambientMaterial (...args); }; export var specularMaterial = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.specularMaterial (...args); }; export var shininess = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.shininess (...args); }; export var camera = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.camera (...args); }; export var perspective = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.perspective (...args); }; export var ortho = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.ortho (...args); }; export var createCamera = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createCamera (...args); }; export var setCamera = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.setCamera (...args); }; export var select = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.select (...args); }; export var selectAll = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.selectAll (...args); }; export var removeElements = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.removeElements (...args); }; export var changed = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.changed (...args); }; export var input = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.input (...args); }; export var createDiv = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createDiv (...args); }; export var createP = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createP (...args); }; export var createSpan = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createSpan (...args); }; export var createImg = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createImg (...args); }; export var createA = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createA (...args); }; export var createSlider = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createSlider (...args); }; export var createButton = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createButton (...args); }; export var createCheckbox = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createCheckbox (...args); }; export var createSelect = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createSelect (...args); }; export var createRadio = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createRadio (...args); }; export var createColorPicker = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createColorPicker (...args); }; export var createInput = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createInput (...args); }; export var createFileInput = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createFileInput (...args); }; export var createVideo = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createVideo (...args); }; export var createAudio = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createAudio (...args); }; export var createCapture = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createCapture (...args); }; export var createElement = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createElement (...args); }; export var createCanvas = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } var canvas = _P5_INSTANCE.createCanvas (...args); width = _P5_INSTANCE.width; height = _P5_INSTANCE.height; return canvas; }; export var py_pop = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } var p5_pop = _P5_INSTANCE.pop (...args); return p5_pop; }; export var size = createCanvas; export var popMatrix = py_pop; export var popStyle = py_pop; export var pushMatrix = push; export var pushStyle = push; export var PVector = function (x, y, z) { if (typeof x == 'undefined' || (x != null && x.hasOwnProperty ("__kwargtrans__"))) {; var x = 0; }; if (typeof y == 'undefined' || (y != null && y.hasOwnProperty ("__kwargtrans__"))) {; var y = 0; }; if (typeof z == 'undefined' || (z != null && z.hasOwnProperty ("__kwargtrans__"))) {; var z = 0; }; if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'x': var x = __allkwargs0__ [__attrib0__]; break; case 'y': var y = __allkwargs0__ [__attrib0__]; break; case 'z': var z = __allkwargs0__ [__attrib0__]; break; } } } } else { } return _P5_INSTANCE.createVector (x, y, z); }; setattr (PVector, 'dist', p5.Vector.dist); setattr (PVector, 'add', p5.Vector.add); setattr (PVector, 'sub', p5.Vector.sub); setattr (PVector, 'mult', p5.Vector.mult); setattr (PVector, 'div', p5.Vector.div); setattr (PVector, 'dot', p5.Vector.dot); setattr (PVector, 'cross', p5.Vector.cross); setattr (PVector, 'lerp', p5.Vector.lerp); setattr (PVector, 'random2D', p5.Vector.random2D); setattr (PVector, 'random3D', p5.Vector.random3D); setattr (PVector, 'angleBetween', p5.Vector.angleBetween); setattr (PVector, 'fromAngle', p5.Vector.fromAngle); setattr (PVector, 'fromAngles', p5.Vector.fromAngles); setattr (PVector, 'equals', p5.Vector.equals); export var pre_draw = function (p5_instance, draw_func) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'p5_instance': var p5_instance = __allkwargs0__ [__attrib0__]; break; case 'draw_func': var draw_func = __allkwargs0__ [__attrib0__]; break; } } } } else { } _CTX_MIDDLE = p5_instance._CTX_MIDDLE; _DEFAULT_FILL = p5_instance._DEFAULT_FILL; _DEFAULT_LEADMULT = p5_instance._DEFAULT_LEADMULT; _DEFAULT_STROKE = p5_instance._DEFAULT_STROKE; _DEFAULT_TEXT_FILL = p5_instance._DEFAULT_TEXT_FILL; ADD = p5_instance.ADD; ALT = p5_instance.ALT; ARROW = p5_instance.ARROW; AUDIO = p5_instance.AUDIO; AUTO = p5_instance.AUTO; AXES = p5_instance.AXES; BACKSPACE = p5_instance.BACKSPACE; BASELINE = p5_instance.BASELINE; BEVEL = p5_instance.BEVEL; BEZIER = p5_instance.BEZIER; BLEND = p5_instance.BLEND; BLUR = p5_instance.BLUR; BOLD = p5_instance.BOLD; BOLDITALIC = p5_instance.BOLDITALIC; BOTTOM = p5_instance.BOTTOM; BURN = p5_instance.BURN; CENTER = p5_instance.CENTER; CHORD = p5_instance.CHORD; CLAMP = p5_instance.CLAMP; CLOSE = p5_instance.CLOSE; CONTROL = p5_instance.CONTROL; CORNER = p5_instance.CORNER; CORNERS = p5_instance.CORNERS; CROSS = p5_instance.CROSS; CURVE = p5_instance.CURVE; DARKEST = p5_instance.DARKEST; DEG_TO_RAD = p5_instance.DEG_TO_RAD; DEGREES = p5_instance.DEGREES; DELETE = p5_instance.DELETE; DIFFERENCE = p5_instance.DIFFERENCE; DILATE = p5_instance.DILATE; DODGE = p5_instance.DODGE; DOWN_ARROW = p5_instance.DOWN_ARROW; ENTER = p5_instance.ENTER; ERODE = p5_instance.ERODE; ESCAPE = p5_instance.ESCAPE; EXCLUSION = p5_instance.EXCLUSION; FILL = p5_instance.FILL; GRAY = p5_instance.GRAY; GRID = p5_instance.GRID; HALF_PI = p5_instance.HALF_PI; HAND = p5_instance.HAND; HARD_LIGHT = p5_instance.HARD_LIGHT; HSB = p5_instance.HSB; HSL = p5_instance.HSL; IMAGE = p5_instance.IMAGE; IMMEDIATE = p5_instance.IMMEDIATE; INVERT = p5_instance.INVERT; ITALIC = p5_instance.ITALIC; LANDSCAPE = p5_instance.LANDSCAPE; LEFT = p5_instance.LEFT; LEFT_ARROW = p5_instance.LEFT_ARROW; LIGHTEST = p5_instance.LIGHTEST; LINE_LOOP = p5_instance.LINE_LOOP; LINE_STRIP = p5_instance.LINE_STRIP; LINEAR = p5_instance.LINEAR; LINES = p5_instance.LINES; MIRROR = p5_instance.MIRROR; MITER = p5_instance.MITER; MOVE = p5_instance.MOVE; MULTIPLY = p5_instance.MULTIPLY; NEAREST = p5_instance.NEAREST; NORMAL = p5_instance.NORMAL; OPAQUE = p5_instance.OPAQUE; OPEN = p5_instance.OPEN; OPTION = p5_instance.OPTION; OVERLAY = p5_instance.OVERLAY; P2D = p5_instance.P2D; var P3D = p5_instance.WEBGL; PI = p5_instance.PI; PIE = p5_instance.PIE; POINTS = p5_instance.POINTS; PORTRAIT = p5_instance.PORTRAIT; POSTERIZE = p5_instance.POSTERIZE; PROJECT = p5_instance.PROJECT; QUAD_STRIP = p5_instance.QUAD_STRIP; QUADRATIC = p5_instance.QUADRATIC; QUADS = p5_instance.QUADS; QUARTER_PI = p5_instance.QUARTER_PI; RAD_TO_DEG = p5_instance.RAD_TO_DEG; RADIANS = p5_instance.RADIANS; RADIUS = p5_instance.RADIUS; REPEAT = p5_instance.REPEAT; REPLACE = p5_instance.REPLACE; RETURN = p5_instance.RETURN; RGB = p5_instance.RGB; RIGHT = p5_instance.RIGHT; RIGHT_ARROW = p5_instance.RIGHT_ARROW; ROUND = p5_instance.ROUND; SCREEN = p5_instance.SCREEN; SHIFT = p5_instance.SHIFT; SOFT_LIGHT = p5_instance.SOFT_LIGHT; SQUARE = p5_instance.SQUARE; STROKE = p5_instance.STROKE; SUBTRACT = p5_instance.SUBTRACT; TAB = p5_instance.TAB; TAU = p5_instance.TAU; TEXT = p5_instance.TEXT; TEXTURE = p5_instance.TEXTURE; THRESHOLD = p5_instance.THRESHOLD; TOP = p5_instance.TOP; TRIANGLE_FAN = p5_instance.TRIANGLE_FAN; TRIANGLE_STRIP = p5_instance.TRIANGLE_STRIP; TRIANGLES = p5_instance.TRIANGLES; TWO_PI = p5_instance.TWO_PI; UP_ARROW = p5_instance.UP_ARROW; VIDEO = p5_instance.VIDEO; WAIT = p5_instance.WAIT; WEBGL = p5_instance.WEBGL; frameCount = p5_instance.frameCount; focused = p5_instance.focused; displayWidth = p5_instance.displayWidth; displayHeight = p5_instance.displayHeight; windowWidth = p5_instance.windowWidth; windowHeight = p5_instance.windowHeight; width = p5_instance.width; height = p5_instance.height; disableFriendlyErrors = p5_instance.disableFriendlyErrors; deviceOrientation = p5_instance.deviceOrientation; accelerationX = p5_instance.accelerationX; accelerationY = p5_instance.accelerationY; accelerationZ = p5_instance.accelerationZ; pAccelerationX = p5_instance.pAccelerationX; pAccelerationY = p5_instance.pAccelerationY; pAccelerationZ = p5_instance.pAccelerationZ; rotationX = p5_instance.rotationX; rotationY = p5_instance.rotationY; rotationZ = p5_instance.rotationZ; pRotationX = p5_instance.pRotationX; pRotationY = p5_instance.pRotationY; pRotationZ = p5_instance.pRotationZ; turnAxis = p5_instance.turnAxis; keyIsPressed = p5_instance.keyIsPressed; key = p5_instance.key; keyCode = p5_instance.keyCode; mouseX = p5_instance.mouseX; mouseY = p5_instance.mouseY; pmouseX = p5_instance.pmouseX; pmouseY = p5_instance.pmouseY; winMouseX = p5_instance.winMouseX; winMouseY = p5_instance.winMouseY; pwinMouseX = p5_instance.pwinMouseX; pwinMouseY = p5_instance.pwinMouseY; mouseButton = p5_instance.mouseButton; mouseIsPressed = p5_instance.mouseIsPressed; touches = p5_instance.touches; pixels = p5_instance.pixels; return draw_func (); }; export var global_p5_injection = function (p5_sketch) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'p5_sketch': var p5_sketch = __allkwargs0__ [__attrib0__]; break; } } } } else { } var decorator = function (f) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'f': var f = __allkwargs0__ [__attrib0__]; break; } } } } else { } var wrapper = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } } else { } _P5_INSTANCE = p5_sketch; return pre_draw (_P5_INSTANCE, f); }; return wrapper; }; return decorator; }; export var start_p5 = function (preload_func, setup_func, draw_func, event_functions) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'preload_func': var preload_func = __allkwargs0__ [__attrib0__]; break; case 'setup_func': var setup_func = __allkwargs0__ [__attrib0__]; break; case 'draw_func': var draw_func = __allkwargs0__ [__attrib0__]; break; case 'event_functions': var event_functions = __allkwargs0__ [__attrib0__]; break; } } } } else { } var sketch_setup = function (p5_sketch) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'p5_sketch': var p5_sketch = __allkwargs0__ [__attrib0__]; break; } } } } else { } p5_sketch.preload = global_p5_injection (p5_sketch) (preload_func); p5_sketch.setup = global_p5_injection (p5_sketch) (setup_func); p5_sketch.draw = global_p5_injection (p5_sketch) (draw_func); }; var instance = new p5 (sketch_setup, 'sketch-holder'); var event_function_names = tuple (['deviceMoved', 'deviceTurned', 'deviceShaken', 'windowResized', 'keyPressed', 'keyReleased', 'keyTyped', 'mousePressed', 'mouseReleased', 'mouseClicked', 'doubleClicked', 'mouseMoved', 'mouseDragged', 'mouseWheel', 'touchStarted', 'touchMoved', 'touchEnded', 'keyIsDown']); for (var f_name of (function () { var __accu0__ = []; for (var f of event_function_names) { if (event_functions.py_get (f, null)) { __accu0__.append (f); } } return __accu0__; }) ()) { var func = event_functions [f_name]; var event_func = global_p5_injection (instance) (func); setattr (instance, f_name, event_func); } }; export var logOnloaded = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } } else { } console.log ('Lib loaded!'); }; export var add_library = function (lib_name) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'lib_name': var lib_name = __allkwargs0__ [__attrib0__]; break; } } } } else { } var src = ''; return console.log ('Lib name is not valid:', lib_name); console.log ('Importing:', src); var script = document.createElement ('script'); script.onload = logOnloaded; script.src = src; document.head.appendChild (script); }; //# sourceMappingURL=pyp5js.map ================================================ FILE: docs/examples/transcrypt/sketch_002/target/pyp5js.py ================================================ from python_functions import PythonFunctions _P5_INSTANCE = None _CTX_MIDDLE = None _DEFAULT_FILL = None _DEFAULT_LEADMULT = None _DEFAULT_STROKE = None _DEFAULT_TEXT_FILL = None ADD = None ALT = None ARROW = None AUDIO = None AUTO = None AXES = None BACKSPACE = None BASELINE = None BEVEL = None BEZIER = None BLEND = None BLUR = None BOLD = None BOLDITALIC = None BOTTOM = None BURN = None CENTER = None CHORD = None CLAMP = None CLOSE = None CONTROL = None CORNER = None CORNERS = None CROSS = None CURVE = None DARKEST = None DEG_TO_RAD = None DEGREES = None DELETE = None DIFFERENCE = None DILATE = None DODGE = None DOWN_ARROW = None ENTER = None ERODE = None ESCAPE = None EXCLUSION = None FILL = None GRAY = None GRID = None HALF_PI = None HAND = None HARD_LIGHT = None HSB = None HSL = None IMAGE = None IMMEDIATE = None INVERT = None ITALIC = None LANDSCAPE = None LEFT = None LEFT_ARROW = None LIGHTEST = None LINE_LOOP = None LINE_STRIP = None LINEAR = None LINES = None MIRROR = None MITER = None MOVE = None MULTIPLY = None NEAREST = None NORMAL = None OPAQUE = None OPEN = None OPTION = None OVERLAY = None PI = None PIE = None POINTS = None PORTRAIT = None POSTERIZE = None PROJECT = None QUAD_STRIP = None QUADRATIC = None QUADS = None QUARTER_PI = None RAD_TO_DEG = None RADIANS = None RADIUS = None REPEAT = None REPLACE = None RETURN = None RGB = None RIGHT = None RIGHT_ARROW = None ROUND = None SCREEN = None SHIFT = None SOFT_LIGHT = None SQUARE = None STROKE = None SUBTRACT = None TAB = None TAU = None TEXT = None TEXTURE = None THRESHOLD = None TOP = None TRIANGLE_FAN = None TRIANGLE_STRIP = None TRIANGLES = None TWO_PI = None UP_ARROW = None VIDEO = None WAIT = None WEBGL = None P2D = None PI = None frameCount = None focused = None displayWidth = None displayHeight = None windowWidth = None windowHeight = None width = None height = None disableFriendlyErrors = None deviceOrientation = None accelerationX = None accelerationY = None accelerationZ = None pAccelerationX = None pAccelerationY = None pAccelerationZ = None rotationX = None rotationY = None rotationZ = None pRotationX = None pRotationY = None pRotationZ = None turnAxis = None keyIsPressed = None key = None keyCode = None mouseX = None mouseY = None pmouseX = None pmouseY = None winMouseX = None winMouseY = None pwinMouseX = None pwinMouseY = None mouseButton = None mouseIsPressed = None touches = None pixels = None def alpha(*args): return _P5_INSTANCE.alpha(*args) def blue(*args): return _P5_INSTANCE.blue(*args) def brightness(*args): return _P5_INSTANCE.brightness(*args) def color(*args): return _P5_INSTANCE.color(*args) def green(*args): return _P5_INSTANCE.green(*args) def hue(*args): return _P5_INSTANCE.hue(*args) def lerpColor(*args): return _P5_INSTANCE.lerpColor(*args) def lightness(*args): return _P5_INSTANCE.lightness(*args) def red(*args): return _P5_INSTANCE.red(*args) def saturation(*args): return _P5_INSTANCE.saturation(*args) def background(*args): return _P5_INSTANCE.background(*args) def clear(*args): __pragma__('noalias', 'clear') p5_clear = _P5_INSTANCE.clear(*args) __pragma__('alias', 'clear', 'py_clear') return p5_clear def erase(*args): return _P5_INSTANCE.erase(*args) def noErase(*args): return _P5_INSTANCE.noErase(*args) def colorMode(*args): return _P5_INSTANCE.colorMode(*args) def fill(*args): return _P5_INSTANCE.fill(*args) def noFill(*args): return _P5_INSTANCE.noFill(*args) def noStroke(*args): return _P5_INSTANCE.noStroke(*args) def stroke(*args): return _P5_INSTANCE.stroke(*args) def arc(*args): return _P5_INSTANCE.arc(*args) def ellipse(*args): return _P5_INSTANCE.ellipse(*args) def circle(*args): return _P5_INSTANCE.circle(*args) def line(*args): return _P5_INSTANCE.line(*args) def point(*args): return _P5_INSTANCE.point(*args) def quad(*args): return _P5_INSTANCE.quad(*args) def rect(*args): return _P5_INSTANCE.rect(*args) def square(*args): return _P5_INSTANCE.square(*args) def triangle(*args): return _P5_INSTANCE.triangle(*args) def plane(*args): return _P5_INSTANCE.plane(*args) def box(*args): return _P5_INSTANCE.box(*args) def sphere(*args): return _P5_INSTANCE.sphere(*args) def cylinder(*args): return _P5_INSTANCE.cylinder(*args) def cone(*args): return _P5_INSTANCE.cone(*args) def ellipsoid(*args): return _P5_INSTANCE.ellipsoid(*args) def torus(*args): return _P5_INSTANCE.torus(*args) def loadModel(*args): return _P5_INSTANCE.loadModel(*args) def model(*args): return _P5_INSTANCE.model(*args) def ellipseMode(*args): return _P5_INSTANCE.ellipseMode(*args) def noSmooth(*args): return _P5_INSTANCE.noSmooth(*args) def rectMode(*args): return _P5_INSTANCE.rectMode(*args) def smooth(*args): return _P5_INSTANCE.smooth(*args) def strokeCap(*args): return _P5_INSTANCE.strokeCap(*args) def strokeJoin(*args): return _P5_INSTANCE.strokeJoin(*args) def strokeWeight(*args): return _P5_INSTANCE.strokeWeight(*args) def bezier(*args): return _P5_INSTANCE.bezier(*args) def bezierDetail(*args): return _P5_INSTANCE.bezierDetail(*args) def bezierPoint(*args): return _P5_INSTANCE.bezierPoint(*args) def bezierTangent(*args): return _P5_INSTANCE.bezierTangent(*args) def curve(*args): return _P5_INSTANCE.curve(*args) def curveDetail(*args): return _P5_INSTANCE.curveDetail(*args) def curveTightness(*args): return _P5_INSTANCE.curveTightness(*args) def curvePoint(*args): return _P5_INSTANCE.curvePoint(*args) def curveTangent(*args): return _P5_INSTANCE.curveTangent(*args) def beginContour(*args): return _P5_INSTANCE.beginContour(*args) def beginShape(*args): return _P5_INSTANCE.beginShape(*args) def bezierVertex(*args): return _P5_INSTANCE.bezierVertex(*args) def curveVertex(*args): return _P5_INSTANCE.curveVertex(*args) def endContour(*args): return _P5_INSTANCE.endContour(*args) def endShape(*args): return _P5_INSTANCE.endShape(*args) def quadraticVertex(*args): return _P5_INSTANCE.quadraticVertex(*args) def vertex(*args): return _P5_INSTANCE.vertex(*args) def cursor(*args): return _P5_INSTANCE.cursor(*args) def frameRate(*args): return _P5_INSTANCE.frameRate(*args) def noCursor(*args): return _P5_INSTANCE.noCursor(*args) def fullscreen(*args): return _P5_INSTANCE.fullscreen(*args) def pixelDensity(*args): return _P5_INSTANCE.pixelDensity(*args) def displayDensity(*args): return _P5_INSTANCE.displayDensity(*args) def getURL(*args): return _P5_INSTANCE.getURL(*args) def getURLPath(*args): return _P5_INSTANCE.getURLPath(*args) def getURLParams(*args): return _P5_INSTANCE.getURLParams(*args) def preload(*args): return _P5_INSTANCE.preload(*args) def setup(*args): return _P5_INSTANCE.setup(*args) def draw(*args): return _P5_INSTANCE.draw(*args) def remove(*args): return _P5_INSTANCE.remove(*args) def noLoop(*args): return _P5_INSTANCE.noLoop(*args) def loop(*args): return _P5_INSTANCE.loop(*args) def push(*args): return _P5_INSTANCE.push(*args) def redraw(*args): return _P5_INSTANCE.redraw(*args) def resizeCanvas(*args): return _P5_INSTANCE.resizeCanvas(*args) def noCanvas(*args): return _P5_INSTANCE.noCanvas(*args) def createGraphics(*args): return _P5_INSTANCE.createGraphics(*args) def blendMode(*args): return _P5_INSTANCE.blendMode(*args) def setAttributes(*args): return _P5_INSTANCE.setAttributes(*args) def applyMatrix(*args): return _P5_INSTANCE.applyMatrix(*args) def resetMatrix(*args): return _P5_INSTANCE.resetMatrix(*args) def rotate(*args): return _P5_INSTANCE.rotate(*args) def rotateX(*args): return _P5_INSTANCE.rotateX(*args) def rotateY(*args): return _P5_INSTANCE.rotateY(*args) def rotateZ(*args): return _P5_INSTANCE.rotateZ(*args) def scale(*args): return _P5_INSTANCE.scale(*args) def shearX(*args): return _P5_INSTANCE.shearX(*args) def shearY(*args): return _P5_INSTANCE.shearY(*args) def translate(*args): return _P5_INSTANCE.translate(*args) def createStringDict(*args): return _P5_INSTANCE.createStringDict(*args) def createNumberDict(*args): return _P5_INSTANCE.createNumberDict(*args) def append(*args): return _P5_INSTANCE.append(*args) def arrayCopy(*args): return _P5_INSTANCE.arrayCopy(*args) def concat(*args): return _P5_INSTANCE.concat(*args) def reverse(*args): return _P5_INSTANCE.reverse(*args) def shorten(*args): return _P5_INSTANCE.shorten(*args) def shuffle(*args): return _P5_INSTANCE.shuffle(*args) def sort(*args): return _P5_INSTANCE.sort(*args) def splice(*args): return _P5_INSTANCE.splice(*args) def subset(*args): return _P5_INSTANCE.subset(*args) def float(*args): return _P5_INSTANCE.float(*args) def int(*args): return _P5_INSTANCE.int(*args) def str(*args): return _P5_INSTANCE.str(*args) def boolean(*args): return _P5_INSTANCE.boolean(*args) def byte(*args): return _P5_INSTANCE.byte(*args) def char(*args): return _P5_INSTANCE.char(*args) def unchar(*args): return _P5_INSTANCE.unchar(*args) def hex(*args): return _P5_INSTANCE.hex(*args) def unhex(*args): return _P5_INSTANCE.unhex(*args) def join(*args): return _P5_INSTANCE.join(*args) def match(*args): return _P5_INSTANCE.match(*args) def matchAll(*args): return _P5_INSTANCE.matchAll(*args) def nf(*args): return _P5_INSTANCE.nf(*args) def nfc(*args): return _P5_INSTANCE.nfc(*args) def nfp(*args): return _P5_INSTANCE.nfp(*args) def nfs(*args): return _P5_INSTANCE.nfs(*args) def split(*args): return _P5_INSTANCE.split(*args) def splitTokens(*args): return _P5_INSTANCE.splitTokens(*args) def trim(*args): return _P5_INSTANCE.trim(*args) def setMoveThreshold(*args): return _P5_INSTANCE.setMoveThreshold(*args) def setShakeThreshold(*args): return _P5_INSTANCE.setShakeThreshold(*args) def keyIsDown(*args): return _P5_INSTANCE.keyIsDown(*args) def createImage(*args): return _P5_INSTANCE.createImage(*args) def saveCanvas(*args): return _P5_INSTANCE.saveCanvas(*args) def saveFrames(*args): return _P5_INSTANCE.saveFrames(*args) def image_proxy(img): """ Proxy to turn of transcypt when calling img.get/set methods """ def _set(*args): __pragma__('noalias', 'set') value = img.set(*args) __pragma__('alias', 'set', 'py_set') return value def _get(*args): __pragma__('noalias', 'get') value = img.get(*args) __pragma__('alias', 'get', 'py_get') return value img.set = _set img.get = _get return img def loadImage(*args): imageObj = _P5_INSTANCE.loadImage(*args) return image_proxy(imageObj) def image(*args): return _P5_INSTANCE.image(*args) def tint(*args): return _P5_INSTANCE.tint(*args) def noTint(*args): return _P5_INSTANCE.noTint(*args) def imageMode(*args): return _P5_INSTANCE.imageMode(*args) def blend(*args): return _P5_INSTANCE.blend(*args) def copy(*args): return _P5_INSTANCE.copy(*args) def filter(*args): if len(args) > 1 and (args[0] is None or callable(args[0])): return PythonFunctions.filter(*args) else: return _P5_INSTANCE.filter(*args) def get(*args): __pragma__('noalias', 'get') p5_get = _P5_INSTANCE.get(*args) __pragma__('alias', 'get', 'py_get') return p5_get def loadPixels(*args): return _P5_INSTANCE.loadPixels(*args) def set(*args): if len(args) <= 1: return PythonFunctions.set(*args) else: return _P5_INSTANCE.set(*args) def updatePixels(*args): return _P5_INSTANCE.updatePixels(*args) def loadJSON(*args): return _P5_INSTANCE.loadJSON(*args) def loadStrings(*args): return _P5_INSTANCE.loadStrings(*args) def loadTable(*args): return _P5_INSTANCE.loadTable(*args) def loadXML(*args): return _P5_INSTANCE.loadXML(*args) def loadBytes(*args): return _P5_INSTANCE.loadBytes(*args) def httpGet(*args): return _P5_INSTANCE.httpGet(*args) def httpPost(*args): return _P5_INSTANCE.httpPost(*args) def httpDo(*args): return _P5_INSTANCE.httpDo(*args) def createWriter(*args): return _P5_INSTANCE.createWriter(*args) def save(*args): return _P5_INSTANCE.save(*args) def saveJSON(*args): return _P5_INSTANCE.saveJSON(*args) def saveStrings(*args): return _P5_INSTANCE.saveStrings(*args) def saveTable(*args): return _P5_INSTANCE.saveTable(*args) def day(*args): return _P5_INSTANCE.day(*args) def hour(*args): return _P5_INSTANCE.hour(*args) def minute(*args): return _P5_INSTANCE.minute(*args) def millis(*args): return _P5_INSTANCE.millis(*args) def month(*args): return _P5_INSTANCE.month(*args) def second(*args): return _P5_INSTANCE.second(*args) def year(*args): return _P5_INSTANCE.year(*args) def createVector(*args): return _P5_INSTANCE.createVector(*args) def abs(*args): return _P5_INSTANCE.abs(*args) def ceil(*args): return _P5_INSTANCE.ceil(*args) def constrain(*args): return _P5_INSTANCE.constrain(*args) def dist(*args): return _P5_INSTANCE.dist(*args) def exp(*args): return _P5_INSTANCE.exp(*args) def floor(*args): return _P5_INSTANCE.floor(*args) def lerp(*args): return _P5_INSTANCE.lerp(*args) def log(*args): return _P5_INSTANCE.log(*args) def mag(*args): return _P5_INSTANCE.mag(*args) def map(*args): if len(args) > 1 and callable(args[0]): return PythonFunctions.map(*args) else: return _P5_INSTANCE.map(*args) def max(*args): return _P5_INSTANCE.max(*args) def min(*args): return _P5_INSTANCE.min(*args) def norm(*args): return _P5_INSTANCE.norm(*args) def pow(*args): return _P5_INSTANCE.pow(*args) def round(*args): return _P5_INSTANCE.round(*args) def sq(*args): return _P5_INSTANCE.sq(*args) def sqrt(*args): return _P5_INSTANCE.sqrt(*args) def noise(*args): return _P5_INSTANCE.noise(*args) def noiseDetail(*args): return _P5_INSTANCE.noiseDetail(*args) def noiseSeed(*args): return _P5_INSTANCE.noiseSeed(*args) def randomSeed(*args): return _P5_INSTANCE.randomSeed(*args) def random(*args): return _P5_INSTANCE.random(*args) def randomGaussian(*args): return _P5_INSTANCE.randomGaussian(*args) def acos(*args): return _P5_INSTANCE.acos(*args) def asin(*args): return _P5_INSTANCE.asin(*args) def atan(*args): return _P5_INSTANCE.atan(*args) def atan2(*args): return _P5_INSTANCE.atan2(*args) def cos(*args): return _P5_INSTANCE.cos(*args) def sin(*args): return _P5_INSTANCE.sin(*args) def tan(*args): return _P5_INSTANCE.tan(*args) def degrees(*args): return _P5_INSTANCE.degrees(*args) def radians(*args): return _P5_INSTANCE.radians(*args) def angleMode(*args): return _P5_INSTANCE.angleMode(*args) def textAlign(*args): return _P5_INSTANCE.textAlign(*args) def textLeading(*args): return _P5_INSTANCE.textLeading(*args) def textSize(*args): return _P5_INSTANCE.textSize(*args) def textStyle(*args): return _P5_INSTANCE.textStyle(*args) def textWidth(*args): return _P5_INSTANCE.textWidth(*args) def textAscent(*args): return _P5_INSTANCE.textAscent(*args) def textDescent(*args): return _P5_INSTANCE.textDescent(*args) def loadFont(*args): return _P5_INSTANCE.loadFont(*args) def text(*args): return _P5_INSTANCE.text(*args) def textFont(*args): return _P5_INSTANCE.textFont(*args) def orbitControl(*args): return _P5_INSTANCE.orbitControl(*args) def debugMode(*args): return _P5_INSTANCE.debugMode(*args) def noDebugMode(*args): return _P5_INSTANCE.noDebugMode(*args) def ambientLight(*args): return _P5_INSTANCE.ambientLight(*args) def directionalLight(*args): return _P5_INSTANCE.directionalLight(*args) def pointLight(*args): return _P5_INSTANCE.pointLight(*args) def lights(*args): return _P5_INSTANCE.lights(*args) def loadShader(*args): return _P5_INSTANCE.loadShader(*args) def createShader(*args): return _P5_INSTANCE.createShader(*args) def shader(*args): return _P5_INSTANCE.shader(*args) def resetShader(*args): return _P5_INSTANCE.resetShader(*args) def normalMaterial(*args): return _P5_INSTANCE.normalMaterial(*args) def texture(*args): return _P5_INSTANCE.texture(*args) def textureMode(*args): return _P5_INSTANCE.textureMode(*args) def textureWrap(*args): return _P5_INSTANCE.textureWrap(*args) def ambientMaterial(*args): return _P5_INSTANCE.ambientMaterial(*args) def specularMaterial(*args): return _P5_INSTANCE.specularMaterial(*args) def shininess(*args): return _P5_INSTANCE.shininess(*args) def camera(*args): return _P5_INSTANCE.camera(*args) def perspective(*args): return _P5_INSTANCE.perspective(*args) def ortho(*args): return _P5_INSTANCE.ortho(*args) def createCamera(*args): return _P5_INSTANCE.createCamera(*args) def setCamera(*args): return _P5_INSTANCE.setCamera(*args) def select(*args): return _P5_INSTANCE.select(*args) def selectAll(*args): return _P5_INSTANCE.selectAll(*args) def removeElements(*args): return _P5_INSTANCE.removeElements(*args) def changed(*args): return _P5_INSTANCE.changed(*args) def input(*args): return _P5_INSTANCE.input(*args) def createDiv(*args): return _P5_INSTANCE.createDiv(*args) def createP(*args): return _P5_INSTANCE.createP(*args) def createSpan(*args): return _P5_INSTANCE.createSpan(*args) def createImg(*args): return _P5_INSTANCE.createImg(*args) def createA(*args): return _P5_INSTANCE.createA(*args) def createSlider(*args): return _P5_INSTANCE.createSlider(*args) def createButton(*args): return _P5_INSTANCE.createButton(*args) def createCheckbox(*args): return _P5_INSTANCE.createCheckbox(*args) def createSelect(*args): return _P5_INSTANCE.createSelect(*args) def createRadio(*args): return _P5_INSTANCE.createRadio(*args) def createColorPicker(*args): return _P5_INSTANCE.createColorPicker(*args) def createInput(*args): return _P5_INSTANCE.createInput(*args) def createFileInput(*args): return _P5_INSTANCE.createFileInput(*args) def createVideo(*args): return _P5_INSTANCE.createVideo(*args) def createAudio(*args): return _P5_INSTANCE.createAudio(*args) def createCapture(*args): return _P5_INSTANCE.createCapture(*args) def createElement(*args): return _P5_INSTANCE.createElement(*args) def createCanvas(*args): canvas = _P5_INSTANCE.createCanvas(*args) global width, height width = _P5_INSTANCE.width height = _P5_INSTANCE.height return canvas def pop(*args): __pragma__('noalias', 'pop') p5_pop = _P5_INSTANCE.pop(*args) __pragma__('alias', 'pop', 'py_pop') return p5_pop # Processing Python or Java mode compatibility aliases size = createCanvas popMatrix = pop popStyle = pop pushMatrix = push pushStyle = push # PVector is a helper/alias to create p5.Vector objects def PVector(x=0, y=0, z=0): return _P5_INSTANCE.createVector(x, y, z) # aliases for p5.Vector class methods setattr(PVector, 'dist', p5.Vector.dist) setattr(PVector, 'add', p5.Vector.add) setattr(PVector, 'sub', p5.Vector.sub) setattr(PVector, 'mult', p5.Vector.mult) setattr(PVector, 'div', p5.Vector.div) setattr(PVector, 'dot', p5.Vector.dot) setattr(PVector, 'cross', p5.Vector.cross) setattr(PVector, 'lerp', p5.Vector.lerp) setattr(PVector, 'random2D', p5.Vector.random2D) setattr(PVector, 'random3D', p5.Vector.random3D) setattr(PVector, 'angleBetween', p5.Vector.angleBetween) setattr(PVector, 'fromAngle', p5.Vector.fromAngle) setattr(PVector, 'fromAngles', p5.Vector.fromAngles) setattr(PVector, 'equals', p5.Vector.equals) def pre_draw(p5_instance, draw_func): """ We need to run this before the actual draw to insert and update p5 env variables """ global _CTX_MIDDLE, _DEFAULT_FILL, _DEFAULT_LEADMULT, _DEFAULT_STROKE, _DEFAULT_TEXT_FILL global ADD, ALT, ARROW, AUTO, AUDIO, AXES, BACKSPACE, BASELINE, BEVEL, BEZIER, BLEND, BLUR, BOLD, BOLDITALIC global BOTTOM, BURN, CENTER, CHORD, CLAMP, CLOSE, CONTROL, CORNER, CORNERS, CROSS, CURVE, DARKEST global DEG_TO_RAD, DEGREES, DELETE, DIFFERENCE, DILATE, DODGE, DOWN_ARROW, ENTER, ERODE, ESCAPE, EXCLUSION global FILL, GRAY, GRID, HALF_PI, HAND, HARD_LIGHT, HSB, HSL, IMAGE, IMMEDIATE, INVERT, ITALIC, LANDSCAPE global LEFT, LEFT_ARROW, LIGHTEST, LINE_LOOP, LINE_STRIP, LINEAR, LINES, MIRROR, MITER, MOVE, MULTIPLY, NEAREST global NORMAL, OPAQUE, OPEN, OPTION, OVERLAY, P2D, PI, PIE, POINTS, PORTRAIT, POSTERIZE, PROJECT, QUAD_STRIP, QUADRATIC global QUADS, QUARTER_PI, RAD_TO_DEG, RADIANS, RADIUS, REPEAT, REPLACE, RETURN, RGB, RIGHT, RIGHT_ARROW global ROUND, SCREEN, SHIFT, SOFT_LIGHT, SQUARE, STROKE, SUBTRACT, TAB, TAU, TEXT, TEXTURE, THRESHOLD, TOP global TRIANGLE_FAN, TRIANGLE_STRIP, TRIANGLES, TWO_PI, UP_ARROW, VIDEO, WAIT, WEBGL global frameCount, focused, displayWidth, displayHeight, windowWidth, windowHeight, width, height global disableFriendlyErrors, deviceOrientation, accelerationX, accelerationY, accelerationZ global pAccelerationX, pAccelerationY, pAccelerationZ, rotationX, rotationY, rotationZ global pRotationX, pRotationY, pRotationZ, turnAxis, keyIsPressed, key, keyCode, mouseX, mouseY, pmouseX, pmouseY global winMouseX, winMouseY, pwinMouseX, pwinMouseY, mouseButton, mouseIsPressed, touches, pixels _CTX_MIDDLE = p5_instance._CTX_MIDDLE _DEFAULT_FILL = p5_instance._DEFAULT_FILL _DEFAULT_LEADMULT = p5_instance._DEFAULT_LEADMULT _DEFAULT_STROKE = p5_instance._DEFAULT_STROKE _DEFAULT_TEXT_FILL = p5_instance._DEFAULT_TEXT_FILL ADD = p5_instance.ADD ALT = p5_instance.ALT ARROW = p5_instance.ARROW AUDIO = p5_instance.AUDIO AUTO = p5_instance.AUTO AXES = p5_instance.AXES BACKSPACE = p5_instance.BACKSPACE BASELINE = p5_instance.BASELINE BEVEL = p5_instance.BEVEL BEZIER = p5_instance.BEZIER BLEND = p5_instance.BLEND BLUR = p5_instance.BLUR BOLD = p5_instance.BOLD BOLDITALIC = p5_instance.BOLDITALIC BOTTOM = p5_instance.BOTTOM BURN = p5_instance.BURN CENTER = p5_instance.CENTER CHORD = p5_instance.CHORD CLAMP = p5_instance.CLAMP CLOSE = p5_instance.CLOSE CONTROL = p5_instance.CONTROL CORNER = p5_instance.CORNER CORNERS = p5_instance.CORNERS CROSS = p5_instance.CROSS CURVE = p5_instance.CURVE DARKEST = p5_instance.DARKEST DEG_TO_RAD = p5_instance.DEG_TO_RAD DEGREES = p5_instance.DEGREES DELETE = p5_instance.DELETE DIFFERENCE = p5_instance.DIFFERENCE DILATE = p5_instance.DILATE DODGE = p5_instance.DODGE DOWN_ARROW = p5_instance.DOWN_ARROW ENTER = p5_instance.ENTER ERODE = p5_instance.ERODE ESCAPE = p5_instance.ESCAPE EXCLUSION = p5_instance.EXCLUSION FILL = p5_instance.FILL GRAY = p5_instance.GRAY GRID = p5_instance.GRID HALF_PI = p5_instance.HALF_PI HAND = p5_instance.HAND HARD_LIGHT = p5_instance.HARD_LIGHT HSB = p5_instance.HSB HSL = p5_instance.HSL IMAGE = p5_instance.IMAGE IMMEDIATE = p5_instance.IMMEDIATE INVERT = p5_instance.INVERT ITALIC = p5_instance.ITALIC LANDSCAPE = p5_instance.LANDSCAPE LEFT = p5_instance.LEFT LEFT_ARROW = p5_instance.LEFT_ARROW LIGHTEST = p5_instance.LIGHTEST LINE_LOOP = p5_instance.LINE_LOOP LINE_STRIP = p5_instance.LINE_STRIP LINEAR = p5_instance.LINEAR LINES = p5_instance.LINES MIRROR = p5_instance.MIRROR MITER = p5_instance.MITER MOVE = p5_instance.MOVE MULTIPLY = p5_instance.MULTIPLY NEAREST = p5_instance.NEAREST NORMAL = p5_instance.NORMAL OPAQUE = p5_instance.OPAQUE OPEN = p5_instance.OPEN OPTION = p5_instance.OPTION OVERLAY = p5_instance.OVERLAY P2D = p5_instance.P2D P3D = p5_instance.WEBGL PI = p5_instance.PI PIE = p5_instance.PIE POINTS = p5_instance.POINTS PORTRAIT = p5_instance.PORTRAIT POSTERIZE = p5_instance.POSTERIZE PROJECT = p5_instance.PROJECT QUAD_STRIP = p5_instance.QUAD_STRIP QUADRATIC = p5_instance.QUADRATIC QUADS = p5_instance.QUADS QUARTER_PI = p5_instance.QUARTER_PI RAD_TO_DEG = p5_instance.RAD_TO_DEG RADIANS = p5_instance.RADIANS RADIUS = p5_instance.RADIUS REPEAT = p5_instance.REPEAT REPLACE = p5_instance.REPLACE RETURN = p5_instance.RETURN RGB = p5_instance.RGB RIGHT = p5_instance.RIGHT RIGHT_ARROW = p5_instance.RIGHT_ARROW ROUND = p5_instance.ROUND SCREEN = p5_instance.SCREEN SHIFT = p5_instance.SHIFT SOFT_LIGHT = p5_instance.SOFT_LIGHT SQUARE = p5_instance.SQUARE STROKE = p5_instance.STROKE SUBTRACT = p5_instance.SUBTRACT TAB = p5_instance.TAB TAU = p5_instance.TAU TEXT = p5_instance.TEXT TEXTURE = p5_instance.TEXTURE THRESHOLD = p5_instance.THRESHOLD TOP = p5_instance.TOP TRIANGLE_FAN = p5_instance.TRIANGLE_FAN TRIANGLE_STRIP = p5_instance.TRIANGLE_STRIP TRIANGLES = p5_instance.TRIANGLES TWO_PI = p5_instance.TWO_PI UP_ARROW = p5_instance.UP_ARROW VIDEO = p5_instance.VIDEO WAIT = p5_instance.WAIT WEBGL = p5_instance.WEBGL frameCount = p5_instance.frameCount focused = p5_instance.focused displayWidth = p5_instance.displayWidth displayHeight = p5_instance.displayHeight windowWidth = p5_instance.windowWidth windowHeight = p5_instance.windowHeight width = p5_instance.width height = p5_instance.height disableFriendlyErrors = p5_instance.disableFriendlyErrors deviceOrientation = p5_instance.deviceOrientation accelerationX = p5_instance.accelerationX accelerationY = p5_instance.accelerationY accelerationZ = p5_instance.accelerationZ pAccelerationX = p5_instance.pAccelerationX pAccelerationY = p5_instance.pAccelerationY pAccelerationZ = p5_instance.pAccelerationZ rotationX = p5_instance.rotationX rotationY = p5_instance.rotationY rotationZ = p5_instance.rotationZ pRotationX = p5_instance.pRotationX pRotationY = p5_instance.pRotationY pRotationZ = p5_instance.pRotationZ turnAxis = p5_instance.turnAxis keyIsPressed = p5_instance.keyIsPressed key = p5_instance.key keyCode = p5_instance.keyCode mouseX = p5_instance.mouseX mouseY = p5_instance.mouseY pmouseX = p5_instance.pmouseX pmouseY = p5_instance.pmouseY winMouseX = p5_instance.winMouseX winMouseY = p5_instance.winMouseY pwinMouseX = p5_instance.pwinMouseX pwinMouseY = p5_instance.pwinMouseY mouseButton = p5_instance.mouseButton mouseIsPressed = p5_instance.mouseIsPressed touches = p5_instance.touches pixels = p5_instance.pixels return draw_func() def global_p5_injection(p5_sketch): """ Injects the p5js's skecth instance as a global variable to setup and draw functions """ def decorator(f): def wrapper(): global _P5_INSTANCE _P5_INSTANCE = p5_sketch return pre_draw(_P5_INSTANCE, f) return wrapper return decorator def start_p5(preload_func, setup_func, draw_func, event_functions): """ This is the entrypoint function. It accepts 2 parameters: - preload_func: a Python preload callable - setup_func: a Python setup callable - draw_func: a Python draw callable - event_functions: a config dict for the event functions in the format: {"eventFunctionName": python_event_function} This method gets the p5js's sketch instance and injects them """ def sketch_setup(p5_sketch): p5_sketch.preload = global_p5_injection(p5_sketch)(preload_func) p5_sketch.setup = global_p5_injection(p5_sketch)(setup_func) p5_sketch.draw = global_p5_injection(p5_sketch)(draw_func) instance = __new__(p5(sketch_setup, 'sketch-holder')) # inject event functions into p5 event_function_names = ( "deviceMoved", "deviceTurned", "deviceShaken", "windowResized", "keyPressed", "keyReleased", "keyTyped", "mousePressed", "mouseReleased", "mouseClicked", "doubleClicked", "mouseMoved", "mouseDragged", "mouseWheel", "touchStarted", "touchMoved", "touchEnded", "keyIsDown" ) for f_name in [f for f in event_function_names if event_functions.get(f, None)]: func = event_functions[f_name] event_func = global_p5_injection(instance)(func) setattr(instance, f_name, event_func) def logOnloaded(): console.log("Lib loaded!") def add_library(lib_name): # placeholder for https://github.com/berinhard/pyp5js/issues/31 src = '' return console.log("Lib name is not valid:", lib_name) console.log("Importing:", src) script = document.createElement("script") script.onload = logOnloaded script.src = src document.head.appendChild(script) ================================================ FILE: docs/examples/transcrypt/sketch_002/target/python_functions.js ================================================ // Transcrypt'ed from Python, 2021-11-02 13:06:10 import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, abs, all, any, assert, bool, bytearray, bytes, callable, chr, copy, deepcopy, delattr, dict, dir, divmod, enumerate, filter, float, getattr, hasattr, input, int, isinstance, issubclass, len, list, map, max, min, object, ord, pow, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, round, set, setattr, sorted, str, sum, tuple, zip} from './org.transcrypt.__runtime__.js'; var __name__ = 'python_functions'; export var PythonFunctions = __class__ ('PythonFunctions', [object], { __module__: __name__, }); setattr (PythonFunctions, 'map', map); setattr (PythonFunctions, 'filter', filter); setattr (PythonFunctions, 'set', set); //# sourceMappingURL=python_functions.map ================================================ FILE: docs/examples/transcrypt/sketch_002/target/python_functions.py ================================================ class PythonFunctions: pass setattr(PythonFunctions, 'map', map) setattr(PythonFunctions, 'filter', filter) setattr(PythonFunctions, 'set', set) ================================================ FILE: docs/examples/transcrypt/sketch_002/target/target_sketch.js ================================================ // Transcrypt'ed from Python, 2021-11-02 13:06:10 import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, all, any, assert, bool, bytearray, bytes, callable, chr, deepcopy, delattr, dict, dir, divmod, enumerate, getattr, hasattr, isinstance, issubclass, len, list, object, ord, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, set, setattr, sorted, sum, tuple, zip} from './org.transcrypt.__runtime__.js'; import {ADD, ALT, ARROW, AUDIO, AUTO, AXES, BACKSPACE, BASELINE, BEVEL, BEZIER, BLEND, BLUR, BOLD, BOLDITALIC, BOTTOM, BURN, CENTER, CHORD, CLAMP, CLOSE, CONTROL, CORNER, CORNERS, CROSS, CURVE, DARKEST, DEGREES, DEG_TO_RAD, DELETE, DIFFERENCE, DILATE, DODGE, DOWN_ARROW, ENTER, ERODE, ESCAPE, EXCLUSION, FILL, GRAY, GRID, HALF_PI, HAND, HARD_LIGHT, HSB, HSL, IMAGE, IMMEDIATE, INVERT, ITALIC, LANDSCAPE, LEFT, LEFT_ARROW, LIGHTEST, LINEAR, LINES, LINE_LOOP, LINE_STRIP, MIRROR, MITER, MOVE, MULTIPLY, NEAREST, NORMAL, OPAQUE, OPEN, OPTION, OVERLAY, P2D, PI, PIE, POINTS, PORTRAIT, POSTERIZE, PROJECT, PVector, QUADRATIC, QUADS, QUAD_STRIP, QUARTER_PI, RADIANS, RADIUS, RAD_TO_DEG, REPEAT, REPLACE, RETURN, RGB, RIGHT, RIGHT_ARROW, ROUND, SCREEN, SHIFT, SOFT_LIGHT, SQUARE, STROKE, SUBTRACT, TAB, TAU, TEXT, TEXTURE, THRESHOLD, TOP, TRIANGLES, TRIANGLE_FAN, TRIANGLE_STRIP, TWO_PI, UP_ARROW, VIDEO, WAIT, WEBGL, _CTX_MIDDLE, _DEFAULT_FILL, _DEFAULT_LEADMULT, _DEFAULT_STROKE, _DEFAULT_TEXT_FILL, _P5_INSTANCE, abs, accelerationX, accelerationY, accelerationZ, acos, add_library, alpha, ambientLight, ambientMaterial, angleMode, append, applyMatrix, arc, arrayCopy, asin, atan, atan2, background, beginContour, beginShape, bezier, bezierDetail, bezierPoint, bezierTangent, bezierVertex, blend, blendMode, blue, boolean, box, brightness, byte, camera, ceil, changed, char, circle, color, colorMode, concat, cone, constrain, copy, cos, createA, createAudio, createButton, createCamera, createCanvas, createCapture, createCheckbox, createColorPicker, createDiv, createElement, createFileInput, createGraphics, createImage, createImg, createInput, createNumberDict, createP, createRadio, createSelect, createShader, createSlider, createSpan, createStringDict, createVector, createVideo, createWriter, cursor, curve, curveDetail, curvePoint, curveTangent, curveTightness, curveVertex, cylinder, day, debugMode, degrees, deviceOrientation, directionalLight, disableFriendlyErrors, displayDensity, displayHeight, displayWidth, dist, ellipse, ellipseMode, ellipsoid, endContour, endShape, erase, exp, fill, filter, float, floor, focused, frameCount, frameRate, fullscreen, getURL, getURLParams, getURLPath, global_p5_injection, green, height, hex, hour, httpDo, httpGet, httpPost, hue, image, imageMode, image_proxy, input, int, join, key, keyCode, keyIsPressed, lerp, lerpColor, lightness, lights, line, loadBytes, loadFont, loadImage, loadJSON, loadModel, loadPixels, loadShader, loadStrings, loadTable, loadXML, log, logOnloaded, loop, mag, map, match, matchAll, max, millis, min, minute, model, month, mouseButton, mouseIsPressed, mouseX, mouseY, nf, nfc, nfp, nfs, noCanvas, noCursor, noDebugMode, noErase, noFill, noLoop, noSmooth, noStroke, noTint, noise, noiseDetail, noiseSeed, norm, normalMaterial, orbitControl, ortho, pAccelerationX, pAccelerationY, pAccelerationZ, pRotationX, pRotationY, pRotationZ, perspective, pixelDensity, pixels, plane, pmouseX, pmouseY, point, pointLight, popMatrix, popStyle, pow, pre_draw, push, pushMatrix, pushStyle, pwinMouseX, pwinMouseY, py_clear, py_get, py_pop, py_set, py_sort, py_split, quad, quadraticVertex, radians, random, randomGaussian, randomSeed, rect, rectMode, red, redraw, remove, removeElements, resetMatrix, resetShader, resizeCanvas, reverse, rotate, rotateX, rotateY, rotateZ, rotationX, rotationY, rotationZ, round, saturation, save, saveCanvas, saveFrames, saveJSON, saveStrings, saveTable, scale, second, select, selectAll, setAttributes, setCamera, setMoveThreshold, setShakeThreshold, shader, shearX, shearY, shininess, shorten, shuffle, sin, size, smooth, specularMaterial, sphere, splice, splitTokens, sq, sqrt, square, start_p5, str, stroke, strokeCap, strokeJoin, strokeWeight, subset, tan, text, textAlign, textAscent, textDescent, textFont, textLeading, textSize, textStyle, textWidth, texture, textureMode, textureWrap, tint, torus, touches, translate, triangle, trim, turnAxis, unchar, unhex, updatePixels, vertex, width, winMouseX, winMouseY, windowHeight, windowWidth, year} from './pyp5js.js'; var __name__ = '__main__'; export var preload = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } } else { } // pass; }; export var setup = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } } else { } // pass; }; export var draw = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } } else { } // pass; }; export var deviceMoved = null; export var deviceTurned = null; export var deviceShaken = null; export var keyPressed = null; export var keyReleased = null; export var keyTyped = null; export var mouseMoved = null; export var mouseDragged = null; export var mousePressed = null; export var mouseReleased = null; export var mouseClicked = null; export var doubleClicked = null; export var mouseWheel = null; export var touchStarted = null; export var touchMoved = null; export var touchEnded = null; export var windowResized = null; export var keyIsDown = null; var setup = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } } else { } createCanvas (640, 360, _P5_INSTANCE.WEBGL); fill (204); }; var draw = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } } else { } ambientLight (50); directionalLight (255, 0, 0, 0.25, 0.25, 0); background (0); camera (30.0, mouseY, 220.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0); noStroke (); box (90); stroke (255); line (-(100), 0, 0, 100, 0, 0); line (0, -(100), 0, 0, 100, 0); line (0, 0, -(100), 0, 0, 100); }; export var event_functions = dict ({'deviceMoved': deviceMoved, 'deviceTurned': deviceTurned, 'deviceShaken': deviceShaken, 'keyPressed': keyPressed, 'keyReleased': keyReleased, 'keyTyped': keyTyped, 'mouseMoved': mouseMoved, 'mouseDragged': mouseDragged, 'mousePressed': mousePressed, 'mouseReleased': mouseReleased, 'mouseClicked': mouseClicked, 'doubleClicked': doubleClicked, 'mouseWheel': mouseWheel, 'touchStarted': touchStarted, 'touchMoved': touchMoved, 'touchEnded': touchEnded, 'windowResized': windowResized, 'keyIsDown': keyIsDown}); start_p5 (preload, setup, draw, event_functions); //# sourceMappingURL=target_sketch.map ================================================ FILE: docs/examples/transcrypt/sketch_002/target/target_sketch.project ================================================ {"options": {"source": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_002/target_sketch.py", "anno": false, "alimod": false, "build": true, "complex": false, "docat": false, "dassert": false, "dcheck": false, "dextex": false, "dlog": false, "dmap": false, "dnostrip": false, "dstat": false, "dtree": false, "esv": null, "ecom": false, "fcall": false, "gen": false, "iconv": false, "jscall": false, "jskeys": false, "jsmod": false, "kwargs": true, "keycheck": false, "license": false, "map": true, "nomin": true, "opov": false, "outdir": null, "parent": null, "run": false, "symbols": null, "sform": false, "tconv": false, "unit": null, "verbose": false, "x": null, "xreex": false, "xglobs": false, "xpath": "/home/bernardo/envs/pyp5js/pyp5js/templates/transcrypt", "xtiny": false, "star": false}, "modules": [{"source": "/home/bernardo/.pyenv/versions/pyp5js/lib/python3.8/site-packages/transcrypt/modules/org/transcrypt/__runtime__.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_002/__target__/org.transcrypt.__runtime__.js"}, {"source": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_002/target_sketch.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_002/__target__/target_sketch.js"}, {"source": "/home/bernardo/envs/pyp5js/pyp5js/templates/transcrypt/pyp5js.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_002/__target__/pyp5js.js"}, {"source": "/home/bernardo/envs/pyp5js/pyp5js/templates/transcrypt/python_functions.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_002/__target__/python_functions.js"}]} ================================================ FILE: docs/examples/transcrypt/sketch_002/target/target_sketch.py ================================================ from pyp5js import * def preload(): pass def setup(): pass def draw(): pass deviceMoved = None deviceTurned = None deviceShaken = None keyPressed = None keyReleased = None keyTyped = None mouseMoved = None mouseDragged = None mousePressed = None mouseReleased = None mouseClicked = None doubleClicked = None mouseWheel = None touchStarted = None touchMoved = None touchEnded = None windowResized = None keyIsDown = None """ * Move Eye. * by Simon Greenwold. * * The camera lifts up (controlled by mouseY) while looking at the same point. """ def setup(): createCanvas(640, 360, _P5_INSTANCE.WEBGL) fill(204) def draw(): ambientLight(50) directionalLight(255, 0, 0, 0.25, 0.25, 0); background(0) # Change height of the camera with mouseY camera(30.0, mouseY, 220.0, # eyeX, eyeY, eyeZ 0.0, 0.0, 0.0, # centerX, centerY, centerZ 0.0, 1.0, 0.0) # upX, upY, upZ noStroke() box(90) stroke(255) line(-100, 0, 0, 100, 0, 0) line(0, -100, 0, 0, 100, 0) line(0, 0, -100, 0, 0, 100) event_functions = { "deviceMoved": deviceMoved, "deviceTurned": deviceTurned, "deviceShaken": deviceShaken, "keyPressed": keyPressed, "keyReleased": keyReleased, "keyTyped": keyTyped, "mouseMoved": mouseMoved, "mouseDragged": mouseDragged, "mousePressed": mousePressed, "mouseReleased": mouseReleased, "mouseClicked": mouseClicked, "doubleClicked": doubleClicked, "mouseWheel": mouseWheel, "touchStarted": touchStarted, "touchMoved": touchMoved, "touchEnded": touchEnded, "windowResized": windowResized, "keyIsDown": keyIsDown, } start_p5(preload, setup, draw, event_functions) ================================================ FILE: docs/examples/transcrypt/sketch_003/index.html ================================================ sketch_003 - pyp5js (using Transcrypt)

Python code here.

             
# 3d example


def setup():
    createCanvas(600, 600, WEBGL)

def draw():
    background(200)
    translate(-100, -100, 0)
    push()
    normalMaterial()
    rotateZ(frameCount * 0.01)
    rotateX(frameCount * 0.01)
    rotateY(frameCount * 0.01)
    box(50, 70, 100)
    pop()

              
          
================================================ FILE: docs/examples/transcrypt/sketch_003/sketch_003.py ================================================ # 3d example def setup(): createCanvas(600, 600, WEBGL) def draw(): background(200) translate(-100, -100, 0) push() normalMaterial() rotateZ(frameCount * 0.01) rotateX(frameCount * 0.01) rotateY(frameCount * 0.01) box(50, 70, 100) pop() ================================================ FILE: docs/examples/transcrypt/sketch_003/static/p5.js ================================================ /*! p5.js v1.0.0 February 29, 2020 */ !function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).p5=e()}}(function(){return function o(a,s,l){function u(t,e){if(!s[t]){if(!a[t]){var r="function"==typeof require&&require;if(!e&&r)return r(t,!0);if(h)return h(t,!0);var i=new Error("Cannot find module '"+t+"'");throw i.code="MODULE_NOT_FOUND",i}var n=s[t]={exports:{}};a[t][0].call(n.exports,function(e){return u(a[t][1][e]||e)},n,n.exports,o,a,s,l)}return s[t].exports}for(var h="function"==typeof require&&require,e=0;e>16&255,a[s++]=t>>8&255,a[s++]=255&t;2===o&&(t=u[e.charCodeAt(r)]<<2|u[e.charCodeAt(r+1)]>>4,a[s++]=255&t);1===o&&(t=u[e.charCodeAt(r)]<<10|u[e.charCodeAt(r+1)]<<4|u[e.charCodeAt(r+2)]>>2,a[s++]=t>>8&255,a[s++]=255&t);return a},r.fromByteArray=function(e){for(var t,r=e.length,i=r%3,n=[],o=0,a=r-i;o>2]+s[t<<4&63]+"==")):2==i&&(t=(e[r-2]<<8)+e[r-1],n.push(s[t>>10]+s[t>>4&63]+s[t<<2&63]+"="));return n.join("")};for(var s=[],u=[],h="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=0,o=i.length;n>18&63]+s[n>>12&63]+s[n>>6&63]+s[63&n]);return o.join("")}u["-".charCodeAt(0)]=62,u["_".charCodeAt(0)]=63},{}],20:[function(e,t,r){},{}],21:[function(N,e,F){(function(c){"use strict";var i=N("base64-js"),o=N("ieee754"),e="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;F.Buffer=c,F.SlowBuffer=function(e){+e!=e&&(e=0);return c.alloc(+e)},F.INSPECT_MAX_BYTES=50;var r=2147483647;function a(e){if(r>>1;case"base64":return O(e).length;default:if(n)return i?-1:R(e).length;t=(""+t).toLowerCase(),n=!0}}function d(e,t,r){var i=e[t];e[t]=e[r],e[r]=i}function p(e,t,r,i,n){if(0===e.length)return-1;if("string"==typeof r?(i=r,r=0):2147483647=e.length){if(n)return-1;r=e.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof t&&(t=c.from(t,i)),c.isBuffer(t))return 0===t.length?-1:m(e,t,r,i,n);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):m(e,[t],r,i,n);throw new TypeError("val must be string, number or Buffer")}function m(e,t,r,i,n){var o,a=1,s=e.length,l=t.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(e.length<2||t.length<2)return-1;s/=a=2,l/=2,r/=2}function u(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(n){var h=-1;for(o=r;o>8,n=r%256,o.push(n),o.push(i);return o}(t,e.length-r),e,r,i)}function b(e,t,r){return 0===t&&r===e.length?i.fromByteArray(e):i.fromByteArray(e.slice(t,r))}function _(e,t,r){r=Math.min(e.length,r);for(var i=[],n=t;n>>10&1023|55296),h=56320|1023&h),i.push(h),n+=c}return function(e){var t=e.length;if(t<=x)return String.fromCharCode.apply(String,e);var r="",i=0;for(;ithis.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e=e||"utf8";;)switch(e){case"hex":return M(this,t,r);case"utf8":case"utf-8":return _(this,t,r);case"ascii":return w(this,t,r);case"latin1":case"binary":return S(this,t,r);case"base64":return b(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,t,r);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}.apply(this,arguments)},c.prototype.equals=function(e){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===c.compare(this,e)},c.prototype.inspect=function(){var e="",t=F.INSPECT_MAX_BYTES;return e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(e+=" ... "),""},e&&(c.prototype[e]=c.prototype.inspect),c.prototype.compare=function(e,t,r,i,n){if(A(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),t<0||r>e.length||i<0||n>this.length)throw new RangeError("out of range index");if(n<=i&&r<=t)return 0;if(n<=i)return-1;if(r<=t)return 1;if(this===e)return 0;for(var o=(n>>>=0)-(i>>>=0),a=(r>>>=0)-(t>>>=0),s=Math.min(o,a),l=this.slice(i,n),u=e.slice(t,r),h=0;h>>=0,isFinite(r)?(r>>>=0,void 0===i&&(i="utf8")):(i=r,r=void 0)}var n=this.length-t;if((void 0===r||nthis.length)throw new RangeError("Attempt to write outside buffer bounds");i=i||"utf8";for(var o,a,s,l,u,h,c=!1;;)switch(i){case"hex":return g(this,e,t,r);case"utf8":case"utf-8":return u=t,h=r,D(R(e,(l=this).length-u),l,u,h);case"ascii":return v(this,e,t,r);case"latin1":case"binary":return v(this,e,t,r);case"base64":return o=this,a=t,s=r,D(O(e),o,a,s);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return y(this,e,t,r);default:if(c)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),c=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var x=4096;function w(e,t,r){var i="";r=Math.min(e.length,r);for(var n=t;ne.length)throw new RangeError("Index out of range")}function P(e,t,r,i){if(r+i>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function L(e,t,r,i,n){return t=+t,r>>>=0,n||P(e,0,r,4),o.write(e,t,r,i,23,4),r+4}function k(e,t,r,i,n){return t=+t,r>>>=0,n||P(e,0,r,8),o.write(e,t,r,i,52,8),r+8}c.prototype.slice=function(e,t){var r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):r>>=0,t>>>=0,r||T(e,t,this.length);for(var i=this[e],n=1,o=0;++o>>=0,t>>>=0,r||T(e,t,this.length);for(var i=this[e+--t],n=1;0>>=0,t||T(e,1,this.length),this[e]},c.prototype.readUInt16LE=function(e,t){return e>>>=0,t||T(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUInt16BE=function(e,t){return e>>>=0,t||T(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUInt32LE=function(e,t){return e>>>=0,t||T(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUInt32BE=function(e,t){return e>>>=0,t||T(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||T(e,t,this.length);for(var i=this[e],n=1,o=0;++o>>=0,t>>>=0,r||T(e,t,this.length);for(var i=t,n=1,o=this[e+--i];0>>=0,t||T(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){e>>>=0,t||T(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(e,t){e>>>=0,t||T(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(e,t){return e>>>=0,t||T(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return e>>>=0,t||T(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readFloatLE=function(e,t){return e>>>=0,t||T(e,4,this.length),o.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return e>>>=0,t||T(e,4,this.length),o.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return e>>>=0,t||T(e,8,this.length),o.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return e>>>=0,t||T(e,8,this.length),o.read(this,e,!1,52,8)},c.prototype.writeUIntLE=function(e,t,r,i){e=+e,t>>>=0,r>>>=0,i||C(this,e,t,r,Math.pow(2,8*r)-1,0);var n=1,o=0;for(this[t]=255&e;++o>>=0,r>>>=0,i||C(this,e,t,r,Math.pow(2,8*r)-1,0);var n=r-1,o=1;for(this[t+n]=255&e;0<=--n&&(o*=256);)this[t+n]=e/o&255;return t+r},c.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,1,255,0),this[t]=255&e,t+1},c.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},c.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeIntLE=function(e,t,r,i){if(e=+e,t>>>=0,!i){var n=Math.pow(2,8*r-1);C(this,e,t,r,n-1,-n)}var o=0,a=1,s=0;for(this[t]=255&e;++o>0)-s&255;return t+r},c.prototype.writeIntBE=function(e,t,r,i){if(e=+e,t>>>=0,!i){var n=Math.pow(2,8*r-1);C(this,e,t,r,n-1,-n)}var o=r-1,a=1,s=0;for(this[t+o]=255&e;0<=--o&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+r},c.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},c.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeFloatLE=function(e,t,r){return L(this,e,t,!0,r)},c.prototype.writeFloatBE=function(e,t,r){return L(this,e,t,!1,r)},c.prototype.writeDoubleLE=function(e,t,r){return k(this,e,t,!0,r)},c.prototype.writeDoubleBE=function(e,t,r){return k(this,e,t,!1,r)},c.prototype.copy=function(e,t,r,i){if(!c.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r=r||0,i||0===i||(i=this.length),t>=e.length&&(t=e.length),t=t||0,0=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t>>=0,r=void 0===r?this.length:r>>>0,"number"==typeof(e=e||0))for(o=t;o>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function O(e){return i.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(t,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function D(e,t,r,i){for(var n=0;n=t.length||n>=e.length);++n)t[n+r]=e[n];return n}function A(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function I(e){return e!=e}var U=function(){for(var e="0123456789abcdef",t=new Array(256),r=0;r<16;++r)for(var i=16*r,n=0;n<16;++n)t[i+n]=e[r]+e[n];return t}()}).call(this,N("buffer").Buffer)},{"base64-js":19,buffer:21,ieee754:30}],22:[function(e,t,r){"use strict";t.exports=e("./").polyfill()},{"./":23}],23:[function(z,r,i){(function(j,V){var e,t;e=this,t=function(){"use strict";function l(e){return"function"==typeof e}var r=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},i=0,t=void 0,n=void 0,a=function(e,t){f[i]=e,f[i+1]=t,2===(i+=2)&&(n?n(d):y())};var e="undefined"!=typeof window?window:void 0,o=e||{},s=o.MutationObserver||o.WebKitMutationObserver,u="undefined"==typeof self&&void 0!==j&&"[object process]"==={}.toString.call(j),h="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function c(){var e=setTimeout;return function(){return e(d,1)}}var f=new Array(1e3);function d(){for(var e=0;e":">",'"':""","'":"'","/":"/"};function S(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,function(e){return w[e]}):e}var M=function(){function i(e){var t,r=1=this.maxReplaces)break}for(a=0;r=this.regexp.exec(e);){if(void 0===(i=h(r[1].trim())))if("function"==typeof c){var d=c(e,r,t);i="string"==typeof d?d:""}else this.logger.warn("missed to pass in variable ".concat(r[1]," for interpolating ").concat(e)),i="";else"string"==typeof i||this.useRawValueToEscape||(i=v(i));if(i=this.escapeValue?u(this.escape(i)):u(i),e=e.replace(r[0],i),this.regexp.lastIndex=0,++a>=this.maxReplaces)break}return e}},{key:"nest",value:function(e,t,r){var i,n,o=D({},2>1,h=-7,c=r?n-1:0,f=r?-1:1,d=e[t+c];for(c+=f,o=d&(1<<-h)-1,d>>=-h,h+=s;0>=-h,h+=i;0>1,f=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,d=i?0:o-1,p=i?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=h):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),2<=(t+=1<=a+c?f/l:f*Math.pow(2,1-c))*l&&(a++,l/=2),h<=a+c?(s=0,a=h):1<=a+c?(s=(t*l-1)*Math.pow(2,n),a+=c):(s=t*Math.pow(2,c-1)*Math.pow(2,n),a=0));8<=n;e[r+d]=255&s,d+=p,s/=256,n-=8);for(a=a<Math.abs(e[0])&&(t=1),Math.abs(e[2])>Math.abs(e[t])&&(t=2),t}var C=4e150;function P(e,t){e.f+=t.f,e.b.f+=t.b.f}function u(e,t,r){return e=e.a,t=t.a,r=r.a,t.b.a===e?r.b.a===e?v(t.a,r.a)?b(r.b.a,t.a,r.a)<=0:0<=b(t.b.a,r.a,t.a):b(r.b.a,e,r.a)<=0:r.b.a===e?0<=b(t.b.a,e,t.a):(t=y(t.b.a,e,t.a),(e=y(r.b.a,e,r.a))<=t)}function L(e){e.a.i=null;var t=e.e;t.a.c=t.c,t.c.a=t.a,e.e=null}function h(e,t){c(e.a),e.c=!1,(e.a=t).i=e}function k(e){for(var t=e.a.a;(e=fe(e)).a.a===t;);return e.c&&(h(e,t=f(ce(e).a.b,e.a.e)),e=fe(e)),e}function R(e,t,r){var i=new he;return i.a=r,i.e=W(e.f,t.e,i),r.i=i}function O(e,t){switch(e.s){case 100130:return 0!=(1&t);case 100131:return 0!==t;case 100132:return 0>1]],s[a[u]])?le(r,u):ue(r,u)),s[o]=null,l[o]=r.b,r.b=o}else for(r.c[-(o+1)]=null;0Math.max(a.a,l.a))return!1;if(v(o,a)){if(0i.f&&(i.f*=2,i.c=oe(i.c,i.f+1)),0===i.b?r=n:(r=i.b,i.b=i.c[i.b]),i.e[r]=t,i.c[r]=n,i.d[n]=r,i.h&&ue(i,n),r}return i=e.a++,e.c[i]=t,-(i+1)}function ie(e){if(0===e.a)return se(e.b);var t=e.c[e.d[e.a-1]];if(0!==e.b.a&&v(ae(e.b),t))return se(e.b);for(;--e.a,0e.a||v(i[a],i[l])){n[r[o]=a]=o;break}n[r[o]=l]=o,o=s}}function ue(e,t){for(var r=e.d,i=e.e,n=e.c,o=t,a=r[o];;){var s=o>>1,l=r[s];if(0==s||v(i[l],i[a])){n[r[o]=a]=o;break}n[r[o]=l]=o,o=s}}function he(){this.e=this.a=null,this.f=0,this.c=this.b=this.h=this.d=!1}function ce(e){return e.e.c.b}function fe(e){return e.e.a.b}(i=q.prototype).x=function(){Y(this,0)},i.B=function(e,t){switch(e){case 100142:return;case 100140:switch(t){case 100130:case 100131:case 100132:case 100133:case 100134:return void(this.s=t)}break;case 100141:return void(this.m=!!t);default:return void Z(this,100900)}Z(this,100901)},i.y=function(e){switch(e){case 100142:return 0;case 100140:return this.s;case 100141:return this.m;default:Z(this,100900)}return!1},i.A=function(e,t,r){this.j[0]=e,this.j[1]=t,this.j[2]=r},i.z=function(e,t){var r=t||null;switch(e){case 100100:case 100106:this.h=r;break;case 100104:case 100110:this.l=r;break;case 100101:case 100107:this.k=r;break;case 100102:case 100108:this.i=r;break;case 100103:case 100109:this.p=r;break;case 100105:case 100111:this.o=r;break;case 100112:this.r=r;break;default:Z(this,100900)}},i.C=function(e,t){var r=!1,i=[0,0,0];Y(this,2);for(var n=0;n<3;++n){var o=e[n];o<-1e150&&(o=-1e150,r=!0),1e150n[u]&&(n[u]=h,a[u]=l)}if(l=0,n[1]-o[1]>n[0]-o[0]&&(l=1),n[2]-o[2]>n[l]-o[l]&&(l=2),o[l]>=n[l])i[0]=0,i[1]=0,i[2]=1;else{for(n=0,o=s[l],a=a[l],s=[0,0,0],o=[o.g[0]-a.g[0],o.g[1]-a.g[1],o.g[2]-a.g[2]],u=[0,0,0],l=r.e;l!==r;l=l.e)u[0]=l.g[0]-a.g[0],u[1]=l.g[1]-a.g[1],u[2]=l.g[2]-a.g[2],s[0]=o[1]*u[2]-o[2]*u[1],s[1]=o[2]*u[0]-o[0]*u[2],s[2]=o[0]*u[1]-o[1]*u[0],n<(h=s[0]*s[0]+s[1]*s[1]+s[2]*s[2])&&(n=h,i[0]=s[0],i[1]=s[1],i[2]=s[2]);n<=0&&(i[0]=i[1]=i[2]=0,i[T(o)]=1)}r=!0}for(s=T(i),l=this.b.c,n=(s+1)%3,a=(s+2)%3,s=0>=l,h-=l,g!=o){if(g==a)break;for(var v=g>8,++y;var _=b;if(i>=8;null!==m&&s<4096&&(p[s++]=m<<8|_,u+1<=s&&l<12&&(++l,u=u<<1|1)),m=g}else s=1+a,u=(1<<(l=n+1))-1,m=null}return f!==i&&console.log("Warning, gif stream shorter than expected."),r}try{r.GifWriter=function(v,e,t,r){var y=0,i=void 0===(r=void 0===r?{}:r).loop?null:r.loop,b=void 0===r.palette?null:r.palette;if(e<=0||t<=0||65535>=1;)++n;if(a=1<>8&255,v[y++]=255&t,v[y++]=t>>8&255,v[y++]=(null!==b?128:0)|n,v[y++]=o,v[y++]=0,null!==b)for(var s=0,l=b.length;s>16&255,v[y++]=u>>8&255,v[y++]=255&u}if(null!==i){if(i<0||65535>8&255,v[y++]=0}var x=!1;this.addFrame=function(e,t,r,i,n,o){if(!0===x&&(--y,x=!1),o=void 0===o?{}:o,e<0||t<0||65535>=1;)++u;l=1<>8&255,v[y++]=d,v[y++]=0),v[y++]=44,v[y++]=255&e,v[y++]=e>>8&255,v[y++]=255&t,v[y++]=t>>8&255,v[y++]=255&r,v[y++]=r>>8&255,v[y++]=255&i,v[y++]=i>>8&255,v[y++]=!0===a?128|u-1:0,!0===a)for(var p=0,m=s.length;p>16&255,v[y++]=g>>8&255,v[y++]=255&g}return y=function(t,r,e,i){t[r++]=e;var n=r++,o=1<>=8,h-=8,r===n+256&&(t[n]=255,n=r++)}function d(e){c|=e<>=8,h-=8,r===n+256&&(t[n]=255,n=r++);4096===l?(d(o),l=1+s,u=e+1,m={}):(1<>7,n=1<<1+(7&r);x[e++],x[e++];var o=null,a=null;i&&(o=e,e+=3*(a=n));var s=!0,l=[],u=0,h=null,c=0,f=null;for(this.width=w,this.height=t;s&&e>2&7,e++;break;case 254:for(;;){if(!(0<=(C=x[e++])))throw Error("Invalid block size");if(0===C)break;e+=C}break;default:throw new Error("Unknown graphic control label: 0x"+x[e-1].toString(16))}break;case 44:var p=x[e++]|x[e++]<<8,m=x[e++]|x[e++]<<8,g=x[e++]|x[e++]<<8,v=x[e++]|x[e++]<<8,y=x[e++],b=y>>6&1,_=1<<1+(7&y),S=o,M=a,E=!1;if(y>>7){E=!0;S=e,e+=3*(M=_)}var T=e;for(e++;;){var C;if(!(0<=(C=x[e++])))throw Error("Invalid block size");if(0===C)break;e+=C}l.push({x:p,y:m,width:g,height:v,has_local_palette:E,palette_offset:S,palette_size:M,data_offset:T,data_length:e-T,transparent_index:h,interlaced:!!b,delay:u,disposal:c});break;case 59:s=!1;break;default:throw new Error("Unknown gif block: 0x"+x[e-1].toString(16))}this.numFrames=function(){return l.length},this.loopCount=function(){return f},this.frameInfo=function(e){if(e<0||e>=l.length)throw new Error("Frame index out of range.");return l[e]},this.decodeAndBlitFrameBGRA=function(e,t){var r=this.frameInfo(e),i=r.width*r.height,n=new Uint8Array(i);P(x,r.data_offset,n,i);var o=r.palette_offset,a=r.transparent_index;null===a&&(a=256);var s=r.width,l=w-s,u=s,h=4*(r.y*w+r.x),c=4*((r.y+r.height)*w+r.x),f=h,d=4*l;!0===r.interlaced&&(d+=4*w*7);for(var p=8,m=0,g=n.length;m>=1)),v===a)f+=4;else{var y=x[o+3*v],b=x[o+3*v+1],_=x[o+3*v+2];t[f++]=_,t[f++]=b,t[f++]=y,t[f++]=255}--u}},this.decodeAndBlitFrameRGBA=function(e,t){var r=this.frameInfo(e),i=r.width*r.height,n=new Uint8Array(i);P(x,r.data_offset,n,i);var o=r.palette_offset,a=r.transparent_index;null===a&&(a=256);var s=r.width,l=w-s,u=s,h=4*(r.y*w+r.x),c=4*((r.y+r.height)*w+r.x),f=h,d=4*l;!0===r.interlaced&&(d+=4*w*7);for(var p=8,m=0,g=n.length;m>=1)),v===a)f+=4;else{var y=x[o+3*v],b=x[o+3*v+1],_=x[o+3*v+2];t[f++]=y,t[f++]=b,t[f++]=_,t[f++]=255}--u}}}}catch(e){}},{}],33:[function(jr,t,r){(function(Gr){var e;e=this,function(E){"use strict";function e(e){if(null==this)throw TypeError();var t=String(this),r=t.length,i=e?Number(e):0;if(i!=i&&(i=0),!(i<0||r<=i)){var n,o=t.charCodeAt(i);return 55296<=o&&o<=56319&&i+1>>=1,t}function _(e,t,r){if(!t)return r;for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<>>16-t;return e.tag>>>=t,e.bitcount-=t,i+r}function x(e,t){for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<>>=1,++n,r+=t.table[n],0<=(i-=t.table[n]););return e.tag=o,e.bitcount-=n,t.trans[r+i]}function w(e,t,r){var i,n,o,a,s,l;for(i=_(e,5,257),n=_(e,5,1),o=_(e,4,4),a=0;a<19;++a)g[a]=0;for(a=0;athis.x2&&(this.x2=e)),"number"==typeof t&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=t,this.y2=t),tthis.y2&&(this.y2=t))},C.prototype.addX=function(e){this.addPoint(e,null)},C.prototype.addY=function(e){this.addPoint(null,e)},C.prototype.addBezier=function(e,t,r,i,n,o,a,s){var l=this,u=[e,t],h=[r,i],c=[n,o],f=[a,s];this.addPoint(e,t),this.addPoint(a,s);for(var d=0;d<=1;d++){var p=6*u[d]-12*h[d]+6*c[d],m=-3*u[d]+9*h[d]-9*c[d]+3*f[d],g=3*h[d]-3*u[d];if(0!=m){var v=Math.pow(p,2)-4*g*m;if(!(v<0)){var y=(-p+Math.sqrt(v))/(2*m);0>8&255,255&e]},A.USHORT=U(2),D.SHORT=function(e){return 32768<=e&&(e=-(65536-e)),[e>>8&255,255&e]},A.SHORT=U(2),D.UINT24=function(e){return[e>>16&255,e>>8&255,255&e]},A.UINT24=U(3),D.ULONG=function(e){return[e>>24&255,e>>16&255,e>>8&255,255&e]},A.ULONG=U(4),D.LONG=function(e){return R<=e&&(e=-(2*R-e)),[e>>24&255,e>>16&255,e>>8&255,255&e]},A.LONG=U(4),D.FIXED=D.ULONG,A.FIXED=A.ULONG,D.FWORD=D.SHORT,A.FWORD=A.SHORT,D.UFWORD=D.USHORT,A.UFWORD=A.USHORT,D.LONGDATETIME=function(e){return[0,0,0,0,e>>24&255,e>>16&255,e>>8&255,255&e]},A.LONGDATETIME=U(8),D.TAG=function(e){return k.argument(4===e.length,"Tag should be exactly 4 ASCII characters."),[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]},A.TAG=U(4),D.Card8=D.BYTE,A.Card8=A.BYTE,D.Card16=D.USHORT,A.Card16=A.USHORT,D.OffSize=D.BYTE,A.OffSize=A.BYTE,D.SID=D.USHORT,A.SID=A.USHORT,D.NUMBER=function(e){return-107<=e&&e<=107?[e+139]:108<=e&&e<=1131?[247+((e-=108)>>8),255&e]:-1131<=e&&e<=-108?[251+((e=-e-108)>>8),255&e]:-32768<=e&&e<=32767?D.NUMBER16(e):D.NUMBER32(e)},A.NUMBER=function(e){return D.NUMBER(e).length},D.NUMBER16=function(e){return[28,e>>8&255,255&e]},A.NUMBER16=U(3),D.NUMBER32=function(e){return[29,e>>24&255,e>>16&255,e>>8&255,255&e]},A.NUMBER32=U(5),D.REAL=function(e){var t=e.toString(),r=/\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec(t);if(r){var i=parseFloat("1e"+((r[2]?+r[2]:0)+r[1].length));t=(Math.round(e*i)/i).toString()}for(var n="",o=0,a=t.length;o>8&255,t[t.length]=255&i}return t},A.UTF16=function(e){return 2*e.length};var N={"x-mac-croatian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈ƫȅ ÀÃÕŒœĐ—“”‘’÷◊©⁄€‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ","x-mac-cyrillic":"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю","x-mac-gaelic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØḂ±≤≥ḃĊċḊḋḞḟĠġṀæøṁṖṗɼƒſṠ«»… ÀÃÕŒœ–—“”‘’ṡẛÿŸṪ€‹›Ŷŷṫ·Ỳỳ⁊ÂÊÁËÈÍÎÏÌÓÔ♣ÒÚÛÙıÝýŴŵẄẅẀẁẂẃ","x-mac-greek":"Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦€ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ­","x-mac-icelandic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüݰ¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-inuit":"ᐃᐄᐅᐆᐊᐋᐱᐲᐳᐴᐸᐹᑉᑎᑏᑐᑑᑕᑖᑦᑭᑮᑯᑰᑲᑳᒃᒋᒌᒍᒎᒐᒑ°ᒡᒥᒦ•¶ᒧ®©™ᒨᒪᒫᒻᓂᓃᓄᓅᓇᓈᓐᓯᓰᓱᓲᓴᓵᔅᓕᓖᓗᓘᓚᓛᓪᔨᔩᔪᔫᔭ… ᔮᔾᕕᕖᕗ–—“”‘’ᕘᕙᕚᕝᕆᕇᕈᕉᕋᕌᕐᕿᖀᖁᖂᖃᖄᖅᖏᖐᖑᖒᖓᖔᖕᙱᙲᙳᙴᙵᙶᖖᖠᖡᖢᖣᖤᖥᖦᕼŁł","x-mac-ce":"ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ",macintosh:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-romanian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂȘ∞±≤≥¥µ∂∑∏π∫ªºΩăș¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›Țț‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-turkish":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙˆ˜¯˘˙˚¸˝˛ˇ"};O.MACSTRING=function(e,t,r,i){var n=N[i];if(void 0!==n){for(var o="",a=0;a>8&255,l+256&255)}return o}D.MACSTRING=function(e,t){var r=function(e){if(!F)for(var t in F={},N)F[t]=new String(t);var r=F[e];if(void 0!==r){if(B){var i=B.get(r);if(void 0!==i)return i}var n=N[e];if(void 0!==n){for(var o={},a=0;a>8,t[c+1]=255&f,t=t.concat(i[h])}return t},A.TABLE=function(e){for(var t=0,r=e.fields.length,i=0;i>1,t.skip("uShort",3),e.glyphIndexMap={};for(var a=new se.Parser(r,i+n+14),s=new se.Parser(r,i+n+16+2*o),l=new se.Parser(r,i+n+16+4*o),u=new se.Parser(r,i+n+16+6*o),h=i+n+16+8*o,c=0;c>4,o=15&i;if(15==n)break;if(t+=r[n],15==o)break;t+=r[o]}return parseFloat(t)}(e);if(32<=t&&t<=246)return t-139;if(247<=t&&t<=250)return 256*(t-247)+e.parseByte()+108;if(251<=t&&t<=254)return 256*-(t-251)-e.parseByte()-108;throw new Error("Invalid b0 "+t)}function Te(e,t,r){t=void 0!==t?t:0;var i=new se.Parser(e,t),n=[],o=[];for(r=void 0!==r?r:e.length;i.relativeOffset>1,T.length=0,P=!0}return function e(t){for(var r,i,n,o,a,s,l,u,h,c,f,d,p=0;pMath.abs(d-R)?k=f+T.shift():R=d+T.shift(),E.curveTo(y,b,_,x,l,u),E.curveTo(h,c,f,d,k,R);break;default:console.log("Glyph "+v.index+": unknown operator 1200"+m),T.length=0}break;case 14:0>3;break;case 21:2>16),p+=2;break;case 29:a=T.pop()+g.gsubrsBias,(s=g.gsubrs[a])&&e(s);break;case 30:for(;0=r.begin&&e=fe.length){var a=i.parseChar();r.names.push(i.parseString(a))}break;case 2.5:r.numberOfGlyphs=i.parseUShort(),r.offset=new Array(r.numberOfGlyphs);for(var s=0;st.value.tag?1:-1}),t.fields=t.fields.concat(i),t.fields=t.fields.concat(n),t}function gt(e,t,r){for(var i=0;i 123 are reserved for internal usage");d|=1<>>1,o=e[n].tag;if(o===t)return n;o>>1,o=e[n];if(o===t)return n;o>>1,a=(r=e[o]).start;if(a===t)return r;a(r=e[i-1]).end?0:r}function xt(e,t){this.font=e,this.tableName=t}function wt(e){xt.call(this,e,"gpos")}function St(e){xt.call(this,e,"gsub")}function Mt(e,t){var r=e.length;if(r!==t.length)return!1;for(var i=0;it.points.length-1||i.matchedPoints[1]>n.points.length-1)throw Error("Matched points out of range in "+t.name);var a=t.points[i.matchedPoints[0]],s=n.points[i.matchedPoints[1]],l={xScale:i.xScale,scale01:i.scale01,scale10:i.scale10,yScale:i.yScale,dx:0,dy:0};s=kt([s],l)[0],l.dx=a.x-s.x,l.dy=a.y-s.y,o=kt(n.points,l)}t.points=t.points.concat(o)}}return Rt(t.points)}(wt.prototype=xt.prototype={searchTag:yt,binSearch:bt,getTable:function(e){var t=this.font.tables[this.tableName];return!t&&e&&(t=this.font.tables[this.tableName]=this.createDefaultTable()),t},getScriptNames:function(){var e=this.getTable();return e?e.scripts.map(function(e){return e.tag}):[]},getDefaultScriptName:function(){var e=this.getTable();if(e){for(var t=!1,r=0;r=s[u-1].tag,"Features must be added in alphabetical order."),o={tag:r,feature:{params:0,lookupListIndexes:[]}},s.push(o),a.push(u),o.feature}}},getLookupTables:function(e,t,r,i,n){var o=this.getFeatureTable(e,t,r,n),a=[];if(o){for(var s,l=o.lookupListIndexes,u=this.font.tables[this.tableName].lookups,h=0;h",s),t.stack.push(Math.round(64*s))}function vr(e,t){var r=t.stack,i=r.pop(),n=t.fv,o=t.pv,a=t.ppem,s=t.deltaBase+16*(e-1),l=t.deltaShift,u=t.z0;E.DEBUG&&console.log(t.step,"DELTAP["+e+"]",i,r);for(var h=0;h>4)===a){var d=(15&f)-8;0<=d&&d++,E.DEBUG&&console.log(t.step,"DELTAPFIX",c,"by",d*l);var p=u[c];n.setRelative(p,p,d*l,o)}}}function yr(e,t){var r=t.stack,i=r.pop();E.DEBUG&&console.log(t.step,"ROUND[]"),r.push(64*t.round(i/64))}function br(e,t){var r=t.stack,i=r.pop(),n=t.ppem,o=t.deltaBase+16*(e-1),a=t.deltaShift;E.DEBUG&&console.log(t.step,"DELTAC["+e+"]",i,r);for(var s=0;s>4)===n){var h=(15&u)-8;0<=h&&h++;var c=h*a;E.DEBUG&&console.log(t.step,"DELTACFIX",l,"by",c),t.cvt[l]+=c}}}function _r(e,t){var r,i,n=t.stack,o=n.pop(),a=n.pop(),s=t.z2[o],l=t.z1[a];E.DEBUG&&console.log(t.step,"SDPVTL["+e+"]",o,a),i=e?(r=s.y-l.y,l.x-s.x):(r=l.x-s.x,l.y-s.y),t.dpv=Zt(r,i)}function xr(e,t){var r=t.stack,i=t.prog,n=t.ip;E.DEBUG&&console.log(t.step,"PUSHB["+e+"]");for(var o=0;o":"_")+(i?"R":"_")+(0===n?"Gr":1===n?"Bl":2===n?"Wh":"")+"]",e?c+"("+o.cvt[c]+","+u+")":"",f,"(d =",a,"->",l*s,")"),o.rp1=o.rp0,o.rp2=f,t&&(o.rp0=f)}Ft.prototype.exec=function(e,t){if("number"!=typeof t)throw new Error("Point size is not a number!");if(!(2",i),s.interpolate(c,o,a,l),s.touch(c)}e.loop=1},dr.bind(void 0,0),dr.bind(void 0,1),function(e){for(var t=e.stack,r=e.rp0,i=e.z0[r],n=e.loop,o=e.fv,a=e.pv,s=e.z1;n--;){var l=t.pop(),u=s[l];E.DEBUG&&console.log(e.step,(1=a.width||t>=a.height?[0,0,0,0]:this._getPixel(e,t);var s=new l.default.Image(r,i);return s.canvas.getContext("2d").drawImage(a,e,t,r*o,i*o,0,0,r,i),s},l.default.Renderer.prototype.textLeading=function(e){return"number"==typeof e?(this._setProperty("_textLeading",e),this._pInst):this._textLeading},l.default.Renderer.prototype.textSize=function(e){return"number"==typeof e?(this._setProperty("_textSize",e),this._setProperty("_textLeading",e*y._DEFAULT_LEADMULT),this._applyTextProperties()):this._textSize},l.default.Renderer.prototype.textStyle=function(e){return e?(e!==y.NORMAL&&e!==y.ITALIC&&e!==y.BOLD&&e!==y.BOLDITALIC||this._setProperty("_textStyle",e),this._applyTextProperties()):this._textStyle},l.default.Renderer.prototype.textAscent=function(){return null===this._textAscent&&this._updateTextMetrics(),this._textAscent},l.default.Renderer.prototype.textDescent=function(){return null===this._textDescent&&this._updateTextMetrics(),this._textDescent},l.default.Renderer.prototype.textAlign=function(e,t){return void 0!==e?(this._setProperty("_textAlign",e),void 0!==t&&this._setProperty("_textBaseline",t),this._applyTextProperties()):{horizontal:this._textAlign,vertical:this._textBaseline}},l.default.Renderer.prototype.text=function(e,t,r,i,n){var o,a,s,l,u,h,c,f,d=this._pInst,p=Number.MAX_VALUE;if((this._doFill||this._doStroke)&&void 0!==e){if("string"!=typeof e&&(e=e.toString()),o=(e=e.replace(/(\t)/g," ")).split("\n"),void 0!==i){for(s=f=0;ss.HALF_PI&&e<=3*s.HALF_PI?Math.atan(r/i*Math.tan(e))+s.PI:Math.atan(r/i*Math.tan(e))+s.TWO_PI,t=t<=s.HALF_PI?Math.atan(r/i*Math.tan(t)):t>s.HALF_PI&&t<=3*s.HALF_PI?Math.atan(r/i*Math.tan(t))+s.PI:Math.atan(r/i*Math.tan(t))+s.TWO_PI),tv||Math.abs(this.accelerationY-this.pAccelerationY)>v||Math.abs(this.accelerationZ-this.pAccelerationZ)>v)&&e();var t=this.deviceTurned||window.deviceTurned;if("function"==typeof t){var r=this.rotationX+180,i=this.pRotationX+180,n=c+180;0>>24],i+=x[(16711680&C)>>16],n+=x[(65280&C)>>8],o+=x[255&C],r+=k[_],s++}w[l=T+y]=a/r,S[l]=i/r,M[l]=n/r,E[l]=o/r}T+=d}for(h=(u=-P)*d,b=T=0;b>>16,e[r+1]=(65280&t[i])>>>8,e[r+2]=255&t[i],e[r+3]=(4278190080&t[i])>>>24},O._toImageData=function(e){return e instanceof ImageData?e:e.getContext("2d").getImageData(0,0,e.width,e.height)},O._createImageData=function(e,t){return O._tmpCanvas=document.createElement("canvas"),O._tmpCtx=O._tmpCanvas.getContext("2d"),this._tmpCtx.createImageData(e,t)},O.apply=function(e,t,r){var i=e.getContext("2d"),n=i.getImageData(0,0,e.width,e.height),o=t(n,r);o instanceof ImageData?i.putImageData(o,0,0,0,0,e.width,e.height):i.putImageData(n,0,0,0,0,e.width,e.height)},O.threshold=function(e,t){var r=O._toPixels(e);void 0===t&&(t=.5);for(var i=Math.floor(255*t),n=0;n>8)/i,r[n+1]=255*(a*t>>8)/i,r[n+2]=255*(s*t>>8)/i}},O.dilate=function(e){for(var t,r,i,n,o,a,s,l,u,h,c,f,d,p,m,g,v,y=O._toPixels(e),b=0,_=y.length?y.length/4:0,x=new Int32Array(_);b<_;)for(r=(t=b)+e.width;b>16&255)+151*(i>>8&255)+28*(255&i))<(m=77*(c>>16&255)+151*(c>>8&255)+28*(255&c))&&(n=c,o=m),o<(p=77*((h=O._getARGB(y,a))>>16&255)+151*(h>>8&255)+28*(255&h))&&(n=h,o=p),o<(g=77*(f>>16&255)+151*(f>>8&255)+28*(255&f))&&(n=f,o=g),o<(v=77*(d>>16&255)+151*(d>>8&255)+28*(255&d))&&(n=d,o=v),x[b++]=n;O._setPixels(y,x)},O.erode=function(e){for(var t,r,i,n,o,a,s,l,u,h,c,f,d,p,m,g,v,y=O._toPixels(e),b=0,_=y.length?y.length/4:0,x=new Int32Array(_);b<_;)for(r=(t=b)+e.width;b>16&255)+151*(c>>8&255)+28*(255&c))<(o=77*(i>>16&255)+151*(i>>8&255)+28*(255&i))&&(n=c,o=m),(p=77*((h=O._getARGB(y,a))>>16&255)+151*(h>>8&255)+28*(255&h))>16&255)+151*(f>>8&255)+28*(255&f))>16&255)+151*(d>>8&255)+28*(255&d))=r){var i=Math.floor(t.timeDisplayed/r);if(t.timeDisplayed=0,t.displayIndex+=i,t.loopCount=Math.floor(t.displayIndex/t.numFrames),null!==t.loopLimit&&t.loopCount>=t.loopLimit)t.playing=!1;else{var n=t.displayIndex%t.numFrames;this.drawingContext.putImageData(t.frames[n].image,0,0),t.displayIndex=n,this.setModified(!0)}}}},n.default.Image.prototype._setProperty=function(e,t){this[e]=t,this.setModified(!0)},n.default.Image.prototype.loadPixels=function(){n.default.Renderer2D.prototype.loadPixels.call(this),this.setModified(!0)},n.default.Image.prototype.updatePixels=function(e,t,r,i){n.default.Renderer2D.prototype.updatePixels.call(this,e,t,r,i),this.setModified(!0)},n.default.Image.prototype.get=function(e,t,r,i){return n.default._validateParameters("p5.Image.get",arguments),n.default.Renderer2D.prototype.get.apply(this,arguments)},n.default.Image.prototype._getPixel=n.default.Renderer2D.prototype._getPixel,n.default.Image.prototype.set=function(e,t,r){n.default.Renderer2D.prototype.set.call(this,e,t,r),this.setModified(!0)},n.default.Image.prototype.resize=function(e,t){0===e&&0===t?(e=this.canvas.width,t=this.canvas.height):0===e?e=this.canvas.width*t/this.canvas.height:0===t&&(t=this.canvas.height*e/this.canvas.width),e=Math.floor(e),t=Math.floor(t);var r=document.createElement("canvas");if(r.width=e,r.height=t,this.gifProperties)for(var i=this.gifProperties,n=function(e,t){for(var r=0,i=0;i/g,">").replace(/"/g,""").replace(/'/g,"'")}function l(e,t){t&&!0!==t&&"true"!==t||(t="");var r="";return(e=e||"untitled")&&e.includes(".")&&(r=e.split(".").pop()),t&&r!==t&&(r=t,e="".concat(e,".").concat(r)),[e,r]}e("../core/error_helpers"),v.default.prototype.loadJSON=function(){for(var e=arguments.length,t=new Array(e),r=0;r"),n.print("");if(n.print(' '),n.print(""),n.print(""),n.print(" "),"0"!==o[0]){n.print(" ");for(var h=0;h".concat(c)),n.print(" ")}n.print(" ")}for(var f=0;f");for(var d=0;d".concat(p)),n.print(" ")}n.print(" ")}n.print("
"),n.print(""),n.print("")}n.close(),n.clear()},v.default.prototype.writeFile=function(e,t,r){var i="application/octet-stream";v.default.prototype._isSafari()&&(i="text/plain");var n=new Blob(e,{type:i});v.default.prototype.downloadFile(n,t,r)},v.default.prototype.downloadFile=function(e,t,r){var i=l(t,r),n=i[0];if(e instanceof Blob)s.default.saveAs(e,n);else{var o=document.createElement("a");if(o.href=e,o.download=n,o.onclick=function(e){var t;t=e,document.body.removeChild(t.target),e.stopPropagation()},o.style.display="none",document.body.appendChild(o),v.default.prototype._isSafari()){var a="Hello, Safari user! To download this file...\n";a+="1. Go to File --\x3e Save As.\n",a+='2. Choose "Page Source" as the Format.\n',a+='3. Name it with this extension: ."'.concat(i[1],'"'),alert(a)}o.click()}},v.default.prototype._checkFileExtension=l,v.default.prototype._isSafari=function(){return 0>>0},getSeed:function(){return t},rand:function(){return(r=(1664525*r+1013904223)%i)/i}});n.setSeed(e),_=new Array(4096);for(var o=0;o<4096;o++)_[o]=n.rand()};var o=n.default;r.default=o},{"../core/main":49}],82:[function(e,t,r){"use strict";function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i,l=(i=e("../core/main"))&&i.__esModule?i:{default:i},o=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==a(e)&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var o=i?Object.getOwnPropertyDescriptor(e,n):null;o&&(o.get||o.set)?Object.defineProperty(r,n,o):r[n]=e[n]}r.default=e,t&&t.set(e,r);return r}(e("../core/constants"));function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}l.default.Vector=function(e,t,r){var i,n,o;o=e instanceof l.default?(this.p5=e,i=t[0]||0,n=t[1]||0,t[2]||0):(i=e||0,n=t||0,r||0),this.x=i,this.y=n,this.z=o},l.default.Vector.prototype.toString=function(){return"p5.Vector Object : [".concat(this.x,", ").concat(this.y,", ").concat(this.z,"]")},l.default.Vector.prototype.set=function(e,t,r){return e instanceof l.default.Vector?(this.x=e.x||0,this.y=e.y||0,this.z=e.z||0):e instanceof Array?(this.x=e[0]||0,this.y=e[1]||0,this.z=e[2]||0):(this.x=e||0,this.y=t||0,this.z=r||0),this},l.default.Vector.prototype.copy=function(){return this.p5?new l.default.Vector(this.p5,[this.x,this.y,this.z]):new l.default.Vector(this.x,this.y,this.z)},l.default.Vector.prototype.add=function(e,t,r){return e instanceof l.default.Vector?(this.x+=e.x||0,this.y+=e.y||0,this.z+=e.z||0):e instanceof Array?(this.x+=e[0]||0,this.y+=e[1]||0,this.z+=e[2]||0):(this.x+=e||0,this.y+=t||0,this.z+=r||0),this};function u(e,t){return 0!==e&&(this.x=this.x%e),0!==t&&(this.y=this.y%t),this}function h(e,t,r){return 0!==e&&(this.x=this.x%e),0!==t&&(this.y=this.y%t),0!==r&&(this.z=this.z%r),this}l.default.Vector.prototype.rem=function(e,t,r){if(e instanceof l.default.Vector){if(Number.isFinite(e.x)&&Number.isFinite(e.y)&&Number.isFinite(e.z)){var i=parseFloat(e.x),n=parseFloat(e.y),o=parseFloat(e.z);h.call(this,i,n,o)}}else if(e instanceof Array)e.every(function(e){return Number.isFinite(e)})&&(2===e.length&&u.call(this,e[0],e[1]),3===e.length&&h.call(this,e[0],e[1],e[2]));else if(1===arguments.length){if(Number.isFinite(e)&&0!==e)return this.x=this.x%e,this.y=this.y%e,this.z=this.z%e,this}else if(2===arguments.length){var a=Array.prototype.slice.call(arguments);a.every(function(e){return Number.isFinite(e)})&&2===a.length&&u.call(this,a[0],a[1])}else if(3===arguments.length){var s=Array.prototype.slice.call(arguments);s.every(function(e){return Number.isFinite(e)})&&3===s.length&&h.call(this,s[0],s[1],s[2])}},l.default.Vector.prototype.sub=function(e,t,r){return e instanceof l.default.Vector?(this.x-=e.x||0,this.y-=e.y||0,this.z-=e.z||0):e instanceof Array?(this.x-=e[0]||0,this.y-=e[1]||0,this.z-=e[2]||0):(this.x-=e||0,this.y-=t||0,this.z-=r||0),this},l.default.Vector.prototype.mult=function(e){return"number"==typeof e&&isFinite(e)?(this.x*=e,this.y*=e,this.z*=e):console.warn("p5.Vector.prototype.mult:","n is undefined or not a finite number"),this},l.default.Vector.prototype.div=function(e){return"number"==typeof e&&isFinite(e)?0===e?console.warn("p5.Vector.prototype.div:","divide by 0"):(this.x/=e,this.y/=e,this.z/=e):console.warn("p5.Vector.prototype.div:","n is undefined or not a finite number"),this},l.default.Vector.prototype.mag=function(){return Math.sqrt(this.magSq())},l.default.Vector.prototype.magSq=function(){var e=this.x,t=this.y,r=this.z;return e*e+t*t+r*r},l.default.Vector.prototype.dot=function(e,t,r){return e instanceof l.default.Vector?this.dot(e.x,e.y,e.z):this.x*(e||0)+this.y*(t||0)+this.z*(r||0)},l.default.Vector.prototype.cross=function(e){var t=this.y*e.z-this.z*e.y,r=this.z*e.x-this.x*e.z,i=this.x*e.y-this.y*e.x;return this.p5?new l.default.Vector(this.p5,[t,r,i]):new l.default.Vector(t,r,i)},l.default.Vector.prototype.dist=function(e){return e.copy().sub(this).mag()},l.default.Vector.prototype.normalize=function(){var e=this.mag();return 0!==e&&this.mult(1/e),this},l.default.Vector.prototype.limit=function(e){var t=this.magSq();return e*e>>0},n.default.prototype.randomSeed=function(e){this._lcgSetSeed(o,e),this._gaussian_previous=!1},n.default.prototype.random=function(e,t){var r;if(n.default._validateParameters("random",arguments),r=null!=this[o]?this._lcg(o):Math.random(),void 0===e)return r;if(void 0===t)return e instanceof Array?e[Math.floor(r*e.length)]:r*e;if(tf){var P=p,L=l,k=u;p=d+f*(s&&d=t&&(r=r.substring(r.length-t,r.length)),r}},n.default.prototype.unhex=function(e){return e instanceof Array?e.map(n.default.prototype.unhex):parseInt("0x".concat(e),16)};var o=n.default;r.default=o},{"../core/main":49}],90:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i,a=(i=e("../core/main"))&&i.__esModule?i:{default:i};function n(e,t,r){var i=e<0,n=i?e.toString().substring(1):e.toString(),o=n.indexOf("."),a=-1!==o?n.substring(0,o):n,s=-1!==o?n.substring(o+1):"",l=i?"-":"";if(void 0!==r){var u="";(-1!==o||0r&&(s=s.substring(0,r));for(var h=0;hi.length)for(var o=t-(i+=-1===r?".":"").length+1,a=0;a=d.TWO_PI?"".concat("ellipse","|").concat(u,"|"):"".concat("arc","|").concat(a,"|").concat(s,"|").concat(l,"|").concat(u,"|"),!this.geometryInHash(t)){var h=new T.default.Geometry(u,1,function(){if(this.strokeIndices=[],a.toFixed(10)!==s.toFixed(10)){l!==d.PIE&&void 0!==l||(this.vertices.push(new T.default.Vector(.5,.5,0)),this.uvs.push([.5,.5]));for(var e=0;e<=u;e++){var t=(s-a)*(e/u)+a,r=.5+Math.cos(t)/2,i=.5+Math.sin(t)/2;this.vertices.push(new T.default.Vector(r,i,0)),this.uvs.push([r,i]),e>5&31)/31,(y>>10&31)/31):(r=a,i=s,l)}for(var b=1;b<=3;b++){var _=p+12*b,x=new S.default.Vector(u.getFloat32(_,!0),u.getFloat32(8+_,!0),u.getFloat32(4+_,!0));e.vertices.push(x),c&&o.push(r,i,n)}var w=new S.default.Vector(m,g,v);e.vertexNormals.push(w,w,w),e.faces.push([3*d,3*d+1,3*d+2]),e.uvs.push([0,0],[0,0],[0,0])}}(e,t);else{var r=new DataView(t);if(!("TextDecoder"in window))return console.warn("Sorry, ASCII STL loading only works in browsers that support TextDecoder (https://caniuse.com/#feat=textencoder)");var i=new TextDecoder("utf-8").decode(r).split("\n");!function(e,t){for(var r,i,n="",o=[],a=0;aMath.PI?l=Math.PI:l<=0&&(l=.001);var u=Math.sin(l)*a*Math.sin(s),h=Math.cos(l)*a,c=Math.sin(l)*a*Math.cos(s);this.camera(u+this.centerX,h+this.centerY,c+this.centerZ,this.centerX,this.centerY,this.centerZ,0,1,0)},m.default.Camera.prototype._isActive=function(){return this===this._renderer._curCamera},m.default.prototype.setCamera=function(e){this._renderer._curCamera=e,this._renderer.uPMatrix.set(e.projMatrix.mat4[0],e.projMatrix.mat4[1],e.projMatrix.mat4[2],e.projMatrix.mat4[3],e.projMatrix.mat4[4],e.projMatrix.mat4[5],e.projMatrix.mat4[6],e.projMatrix.mat4[7],e.projMatrix.mat4[8],e.projMatrix.mat4[9],e.projMatrix.mat4[10],e.projMatrix.mat4[11],e.projMatrix.mat4[12],e.projMatrix.mat4[13],e.projMatrix.mat4[14],e.projMatrix.mat4[15])};var n=m.default.Camera;r.default=n},{"../core/main":49}],98:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i,h=(i=e("../core/main"))&&i.__esModule?i:{default:i};h.default.Geometry=function(e,t,r){return this.vertices=[],this.lineVertices=[],this.lineNormals=[],this.vertexNormals=[],this.faces=[],this.uvs=[],this.edges=[],this.vertexColors=[],this.detailX=void 0!==e?e:1,this.detailY=void 0!==t?t:1,this.dirtyFlags={},r instanceof Function&&r.call(this),this},h.default.Geometry.prototype.reset=function(){this.lineVertices.length=0,this.lineNormals.length=0,this.vertices.length=0,this.edges.length=0,this.vertexColors.length=0,this.vertexNormals.length=0,this.uvs.length=0,this.dirtyFlags={}},h.default.Geometry.prototype.computeFaces=function(){this.faces.length=0;for(var e,t,r,i,n=this.detailX+1,o=0;othis.vertices.length-1-this.detailX;i--)e.add(this.vertexNormals[i]);e=h.default.Vector.div(e,this.detailX);for(var n=this.vertices.length-1;n>this.vertices.length-1-this.detailX;n--)this.vertexNormals[n]=e;return this},h.default.Geometry.prototype._makeTriangleEdges=function(){if(this.edges.length=0,Array.isArray(this.strokeIndices))for(var e=0,t=this.strokeIndices.length;e vTexCoord.y;\n bool y1 = p1.y > vTexCoord.y;\n bool y2 = p2.y > vTexCoord.y;\n\n // could web be under the curve (after t1)?\n if (y1 ? !y2 : y0) {\n // add the coverage for t1\n coverage.x += saturate(C1.x + 0.5);\n // calculate the anti-aliasing for t1\n weight.x = min(weight.x, abs(C1.x));\n }\n\n // are we outside the curve (after t2)?\n if (y1 ? !y0 : y2) {\n // subtract the coverage for t2\n coverage.x -= saturate(C2.x + 0.5);\n // calculate the anti-aliasing for t2\n weight.x = min(weight.x, abs(C2.x));\n }\n}\n\n// this is essentially the same as coverageX, but with the axes swapped\nvoid coverageY(vec2 p0, vec2 p1, vec2 p2) {\n\n vec2 C1, C2;\n calulateCrossings(p0, p1, p2, C1, C2);\n\n bool x0 = p0.x > vTexCoord.x;\n bool x1 = p1.x > vTexCoord.x;\n bool x2 = p2.x > vTexCoord.x;\n\n if (x1 ? !x2 : x0) {\n coverage.y -= saturate(C1.y + 0.5);\n weight.y = min(weight.y, abs(C1.y));\n }\n\n if (x1 ? !x0 : x2) {\n coverage.y += saturate(C2.y + 0.5);\n weight.y = min(weight.y, abs(C2.y));\n }\n}\n\nvoid main() {\n\n // calculate the pixel scale based on screen-coordinates\n pixelScale = hardness / fwidth(vTexCoord);\n\n // which grid cell is this pixel in?\n ivec2 gridCoord = ifloor(vTexCoord * vec2(uGridSize));\n\n // intersect curves in this row\n {\n // the index into the row info bitmap\n int rowIndex = gridCoord.y + uGridOffset.y;\n // fetch the info texel\n vec4 rowInfo = getTexel(uSamplerRows, rowIndex, uGridImageSize);\n // unpack the rowInfo\n int rowStrokeIndex = getInt16(rowInfo.xy);\n int rowStrokeCount = getInt16(rowInfo.zw);\n\n for (int iRowStroke = INT(0); iRowStroke < N; iRowStroke++) {\n if (iRowStroke >= rowStrokeCount)\n break;\n\n // each stroke is made up of 3 points: the start and control point\n // and the start of the next curve.\n // fetch the indices of this pair of strokes:\n vec4 strokeIndices = getTexel(uSamplerRowStrokes, rowStrokeIndex++, uCellsImageSize);\n\n // unpack the stroke index\n int strokePos = getInt16(strokeIndices.xy);\n\n // fetch the two strokes\n vec4 stroke0 = getTexel(uSamplerStrokes, strokePos + INT(0), uStrokeImageSize);\n vec4 stroke1 = getTexel(uSamplerStrokes, strokePos + INT(1), uStrokeImageSize);\n\n // calculate the coverage\n coverageX(stroke0.xy, stroke0.zw, stroke1.xy);\n }\n }\n\n // intersect curves in this column\n {\n int colIndex = gridCoord.x + uGridOffset.x;\n vec4 colInfo = getTexel(uSamplerCols, colIndex, uGridImageSize);\n int colStrokeIndex = getInt16(colInfo.xy);\n int colStrokeCount = getInt16(colInfo.zw);\n \n for (int iColStroke = INT(0); iColStroke < N; iColStroke++) {\n if (iColStroke >= colStrokeCount)\n break;\n\n vec4 strokeIndices = getTexel(uSamplerColStrokes, colStrokeIndex++, uCellsImageSize);\n\n int strokePos = getInt16(strokeIndices.xy);\n vec4 stroke0 = getTexel(uSamplerStrokes, strokePos + INT(0), uStrokeImageSize);\n vec4 stroke1 = getTexel(uSamplerStrokes, strokePos + INT(1), uStrokeImageSize);\n coverageY(stroke0.xy, stroke0.zw, stroke1.xy);\n }\n }\n\n weight = saturate(1.0 - weight * 2.0);\n float distance = max(weight.x + weight.y, minDistance); // manhattan approx.\n float antialias = abs(dot(coverage, weight) / distance);\n float cover = min(abs(coverage.x), abs(coverage.y));\n gl_FragColor = uMaterialColor;\n gl_FragColor.a *= saturate(max(antialias, cover));\n}",lineVert:"/*\n Part of the Processing project - http://processing.org\n Copyright (c) 2012-15 The Processing Foundation\n Copyright (c) 2004-12 Ben Fry and Casey Reas\n Copyright (c) 2001-04 Massachusetts Institute of Technology\n This library is free software; you can redistribute it and/or\n modify it under the terms of the GNU Lesser General Public\n License as published by the Free Software Foundation, version 2.1.\n This library is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n Lesser General Public License for more details.\n You should have received a copy of the GNU Lesser General\n Public License along with this library; if not, write to the\n Free Software Foundation, Inc., 59 Temple Place, Suite 330,\n Boston, MA 02111-1307 USA\n*/\n\n#define PROCESSING_LINE_SHADER\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform float uStrokeWeight;\n\nuniform vec4 uViewport;\nuniform int uPerspective;\n\nattribute vec4 aPosition;\nattribute vec4 aDirection;\n \nvoid main() {\n // using a scale <1 moves the lines towards the camera\n // in order to prevent popping effects due to half of\n // the line disappearing behind the geometry faces.\n vec3 scale = vec3(0.9995);\n\n vec4 posp = uModelViewMatrix * aPosition;\n vec4 posq = uModelViewMatrix * (aPosition + vec4(aDirection.xyz, 0));\n\n // Moving vertices slightly toward the camera\n // to avoid depth-fighting with the fill triangles.\n // Discussed here:\n // http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Number=252848 \n posp.xyz = posp.xyz * scale;\n posq.xyz = posq.xyz * scale;\n\n vec4 p = uProjectionMatrix * posp;\n vec4 q = uProjectionMatrix * posq;\n\n // formula to convert from clip space (range -1..1) to screen space (range 0..[width or height])\n // screen_p = (p.xy/p.w + <1,1>) * 0.5 * uViewport.zw\n\n // prevent division by W by transforming the tangent formula (div by 0 causes\n // the line to disappear, see https://github.com/processing/processing/issues/5183)\n // t = screen_q - screen_p\n //\n // tangent is normalized and we don't care which aDirection it points to (+-)\n // t = +- normalize( screen_q - screen_p )\n // t = +- normalize( (q.xy/q.w+<1,1>)*0.5*uViewport.zw - (p.xy/p.w+<1,1>)*0.5*uViewport.zw )\n //\n // extract common factor, <1,1> - <1,1> cancels out\n // t = +- normalize( (q.xy/q.w - p.xy/p.w) * 0.5 * uViewport.zw )\n //\n // convert to common divisor\n // t = +- normalize( ((q.xy*p.w - p.xy*q.w) / (p.w*q.w)) * 0.5 * uViewport.zw )\n //\n // remove the common scalar divisor/factor, not needed due to normalize and +-\n // (keep uViewport - can't remove because it has different components for x and y\n // and corrects for aspect ratio, see https://github.com/processing/processing/issues/5181)\n // t = +- normalize( (q.xy*p.w - p.xy*q.w) * uViewport.zw )\n\n vec2 tangent = normalize((q.xy*p.w - p.xy*q.w) * uViewport.zw);\n\n // flip tangent to normal (it's already normalized)\n vec2 normal = vec2(-tangent.y, tangent.x);\n\n float thickness = aDirection.w * uStrokeWeight;\n vec2 offset = normal * thickness / 2.0;\n\n vec2 curPerspScale;\n\n if(uPerspective == 1) {\n // Perspective ---\n // convert from world to clip by multiplying with projection scaling factor\n // to get the right thickness (see https://github.com/processing/processing/issues/5182)\n // invert Y, projections in Processing invert Y\n curPerspScale = (uProjectionMatrix * vec4(1, -1, 0, 0)).xy;\n } else {\n // No Perspective ---\n // multiply by W (to cancel out division by W later in the pipeline) and\n // convert from screen to clip (derived from clip to screen above)\n curPerspScale = p.w / (0.5 * uViewport.zw);\n }\n\n gl_Position.xy = p.xy + offset.xy * curPerspScale;\n gl_Position.zw = p.zw;\n}\n",lineFrag:"precision mediump float;\nprecision mediump int;\n\nuniform vec4 uMaterialColor;\n\nvoid main() {\n gl_FragColor = uMaterialColor;\n}",pointVert:"attribute vec3 aPosition;\nuniform float uPointSize;\nvarying float vStrokeWeight;\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nvoid main() {\n\tvec4 positionVec4 = vec4(aPosition, 1.0);\n\tgl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n\tgl_PointSize = uPointSize;\n\tvStrokeWeight = uPointSize;\n}",pointFrag:"precision mediump float;\nprecision mediump int;\nuniform vec4 uMaterialColor;\nvarying float vStrokeWeight;\n\nvoid main(){\n\tfloat mask = 0.0;\n\n\t// make a circular mask using the gl_PointCoord (goes from 0 - 1 on a point)\n // might be able to get a nicer edge on big strokeweights with smoothstep but slightly less performant\n\n\tmask = step(0.98, length(gl_PointCoord * 2.0 - 1.0));\n\n\t// if strokeWeight is 1 or less lets just draw a square\n\t// this prevents weird artifacting from carving circles when our points are really small\n\t// if strokeWeight is larger than 1, we just use it as is\n\n\tmask = mix(0.0, mask, clamp(floor(vStrokeWeight - 0.5),0.0,1.0));\n\n\t// throw away the borders of the mask\n // otherwise we get weird alpha blending issues\n\n\tif(mask > 0.98){\n discard;\n \t}\n\n \tgl_FragColor = vec4(uMaterialColor.rgb * (1.0 - mask), uMaterialColor.a) ;\n}"};u.default.RendererGL=function(e,t,r,i){return u.default.Renderer.call(this,e,t,r),this._setAttributeDefaults(t),this._initContext(),this.isP3D=!0,this.GL=this.drawingContext,this._isErasing=!1,this._enableLighting=!1,this.ambientLightColors=[],this.specularColors=[1,1,1],this.directionalLightDirections=[],this.directionalLightDiffuseColors=[],this.directionalLightSpecularColors=[],this.pointLightPositions=[],this.pointLightDiffuseColors=[],this.pointLightSpecularColors=[],this.spotLightPositions=[],this.spotLightDirections=[],this.spotLightDiffuseColors=[],this.spotLightSpecularColors=[],this.spotLightAngle=[],this.spotLightConc=[],this.drawMode=o.FILL,this.curFillColor=this._cachedFillStyle=[1,1,1,1],this.curStrokeColor=this._cachedStrokeStyle=[0,0,0,1],this.curBlendMode=o.BLEND,this._cachedBlendMode=void 0,this.blendExt=this.GL.getExtension("EXT_blend_minmax"),this._isBlending=!1,this._useSpecularMaterial=!1,this._useEmissiveMaterial=!1,this._useNormalMaterial=!1,this._useShininess=1,this._tint=[255,255,255,255],this.constantAttenuation=1,this.linearAttenuation=0,this.quadraticAttenuation=0,this.uMVMatrix=new u.default.Matrix,this.uPMatrix=new u.default.Matrix,this.uNMatrix=new u.default.Matrix("mat3"),this._curCamera=new u.default.Camera(this),this._curCamera._computeCameraDefaultSettings(),this._curCamera._setDefaultCamera(),this._defaultLightShader=void 0,this._defaultImmediateModeShader=void 0,this._defaultNormalShader=void 0,this._defaultColorShader=void 0,this._defaultPointShader=void 0,this.userFillShader=void 0,this.userStrokeShader=void 0,this.userPointShader=void 0,this.retainedMode={geometry:{},buffers:{stroke:[new u.default.RenderBuffer(3,"lineVertices","lineVertexBuffer","aPosition",this,this._flatten),new u.default.RenderBuffer(4,"lineNormals","lineNormalBuffer","aDirection",this,this._flatten)],fill:[new u.default.RenderBuffer(3,"vertices","vertexBuffer","aPosition",this,this._vToNArray),new u.default.RenderBuffer(3,"vertexNormals","normalBuffer","aNormal",this,this._vToNArray),new u.default.RenderBuffer(4,"vertexColors","colorBuffer","aMaterialColor",this),new u.default.RenderBuffer(3,"vertexAmbients","ambientBuffer","aAmbientColor",this),new u.default.RenderBuffer(2,"uvs","uvBuffer","aTexCoord",this,this._flatten)],text:[new u.default.RenderBuffer(3,"vertices","vertexBuffer","aPosition",this,this._vToNArray),new u.default.RenderBuffer(2,"uvs","uvBuffer","aTexCoord",this,this._flatten)]}},this.immediateMode={geometry:new u.default.Geometry,shapeMode:o.TRIANGLE_FAN,_bezierVertex:[],_quadraticVertex:[],_curveVertex:[],buffers:{fill:[new u.default.RenderBuffer(3,"vertices","vertexBuffer","aPosition",this,this._vToNArray),new u.default.RenderBuffer(3,"vertexNormals","normalBuffer","aNormal",this,this._vToNArray),new u.default.RenderBuffer(4,"vertexColors","colorBuffer","aVertexColor",this),new u.default.RenderBuffer(3,"vertexAmbients","ambientBuffer","aAmbientColor",this),new u.default.RenderBuffer(2,"uvs","uvBuffer","aTexCoord",this,this._flatten)],stroke:[new u.default.RenderBuffer(3,"lineVertices","lineVertexBuffer","aPosition",this,this._flatten),new u.default.RenderBuffer(4,"lineNormals","lineNormalBuffer","aDirection",this,this._flatten)],point:this.GL.createBuffer()}},this.pointSize=5,this.curStrokeWeight=1,this.textures=[],this.textureMode=o.IMAGE,this.textureWrapX=o.CLAMP,this.textureWrapY=o.CLAMP,this._tex=null,this._curveTightness=6,this._lookUpTableBezier=[],this._lookUpTableQuadratic=[],this._lutBezierDetail=0,this._lutQuadraticDetail=0,this._tessy=this._initTessy(),this.fontInfos={},this._curShader=void 0,this},u.default.RendererGL.prototype=Object.create(u.default.Renderer.prototype),u.default.RendererGL.prototype._setAttributeDefaults=function(e){var t={alpha:!0,depth:!0,stencil:!0,antialias:navigator.userAgent.toLowerCase().includes("safari"),premultipliedAlpha:!1,preserveDrawingBuffer:!0,perPixelLighting:!0};null===e._glAttributes?e._glAttributes=t:e._glAttributes=Object.assign(t,e._glAttributes)},u.default.RendererGL.prototype._initContext=function(){try{if(this.drawingContext=this.canvas.getContext("webgl",this._pInst._glAttributes)||this.canvas.getContext("experimental-webgl",this._pInst._glAttributes),null===this.drawingContext)throw new Error("Error creating webgl context");var e=this.drawingContext;e.enable(e.DEPTH_TEST),e.depthFunc(e.LEQUAL),e.viewport(0,0,e.drawingBufferWidth,e.drawingBufferHeight),this._viewport=this.drawingContext.getParameter(this.drawingContext.VIEWPORT)}catch(e){throw e}},u.default.RendererGL.prototype._resetContext=function(e,t){var r=this.width,i=this.height,n=this.canvas.id,o=this._pInst instanceof u.default.Graphics;if(o){var a=this._pInst;a.canvas.parentNode.removeChild(a.canvas),a.canvas=document.createElement("canvas"),(a._pInst._userNode||document.body).appendChild(a.canvas),u.default.Element.call(a,a.canvas,a._pInst),a.width=r,a.height=i}else{var s=this.canvas;s&&s.parentNode.removeChild(s),(s=document.createElement("canvas")).id=n,this._pInst._userNode?this._pInst._userNode.appendChild(s):document.body.appendChild(s),this._pInst.canvas=s}var l=new u.default.RendererGL(this._pInst.canvas,this._pInst,!o);this._pInst._setProperty("_renderer",l),l.resize(r,i),l._applyDefaults(),o||this._pInst._elements.push(l),"function"==typeof t&&setTimeout(function(){t.apply(window._renderer,e)},0)},u.default.prototype.setAttributes=function(e,t){if(void 0!==this._glAttributes){var r=!0;if(void 0!==t?(null===this._glAttributes&&(this._glAttributes={}),this._glAttributes[e]!==t&&(this._glAttributes[e]=t,r=!1)):e instanceof Object&&this._glAttributes!==e&&(this._glAttributes=e,r=!1),this._renderer.isP3D&&!r){if(!this._setupDone)for(var i in this._renderer.retainedMode.geometry)if(this._renderer.retainedMode.geometry.hasOwnProperty(i))return void console.error("Sorry, Could not set the attributes, you need to call setAttributes() before calling the other drawing methods in setup()");this.push(),this._renderer._resetContext(),this.pop(),this._renderer._curCamera&&(this._renderer._curCamera._renderer=this._renderer)}}else console.log("You are trying to use setAttributes on a p5.Graphics object that does not use a WEBGL renderer.")},u.default.RendererGL.prototype._update=function(){this.uMVMatrix.set(this._curCamera.cameraMatrix.mat4[0],this._curCamera.cameraMatrix.mat4[1],this._curCamera.cameraMatrix.mat4[2],this._curCamera.cameraMatrix.mat4[3],this._curCamera.cameraMatrix.mat4[4],this._curCamera.cameraMatrix.mat4[5],this._curCamera.cameraMatrix.mat4[6],this._curCamera.cameraMatrix.mat4[7],this._curCamera.cameraMatrix.mat4[8],this._curCamera.cameraMatrix.mat4[9],this._curCamera.cameraMatrix.mat4[10],this._curCamera.cameraMatrix.mat4[11],this._curCamera.cameraMatrix.mat4[12],this._curCamera.cameraMatrix.mat4[13],this._curCamera.cameraMatrix.mat4[14],this._curCamera.cameraMatrix.mat4[15]),this.ambientLightColors.length=0,this.specularColors=[1,1,1],this.directionalLightDirections.length=0,this.directionalLightDiffuseColors.length=0,this.directionalLightSpecularColors.length=0,this.pointLightPositions.length=0,this.pointLightDiffuseColors.length=0,this.pointLightSpecularColors.length=0,this.spotLightPositions.length=0,this.spotLightDirections.length=0,this.spotLightDiffuseColors.length=0,this.spotLightSpecularColors.length=0,this.spotLightAngle.length=0,this.spotLightConc.length=0,this._enableLighting=!1,this._tint=[255,255,255,255],this.GL.clear(this.GL.DEPTH_BUFFER_BIT)},u.default.RendererGL.prototype.background=function(){var e,t=(e=this._pInst).color.apply(e,arguments),r=t.levels[0]/255,i=t.levels[1]/255,n=t.levels[2]/255,o=t.levels[3]/255;this.GL.clearColor(r,i,n,o),this.GL.clear(this.GL.COLOR_BUFFER_BIT)},u.default.RendererGL.prototype.fill=function(e,t,r,i){var n=u.default.prototype.color.apply(this._pInst,arguments);this.curFillColor=n._array,this.drawMode=o.FILL,this._useNormalMaterial=!1,this._tex=null},u.default.RendererGL.prototype.stroke=function(e,t,r,i){arguments[3]=255;var n=u.default.prototype.color.apply(this._pInst,arguments);this.curStrokeColor=n._array},u.default.RendererGL.prototype.strokeCap=function(e){console.error("Sorry, strokeCap() is not yet implemented in WEBGL mode")},u.default.RendererGL.prototype.strokeJoin=function(e){console.error("Sorry, strokeJoin() is not yet implemented in WEBGL mode")},u.default.RendererGL.prototype.filter=function(e){console.error("filter() does not work in WEBGL mode")},u.default.RendererGL.prototype.blendMode=function(e){e===o.DARKEST||e===o.LIGHTEST||e===o.ADD||e===o.BLEND||e===o.SUBTRACT||e===o.SCREEN||e===o.EXCLUSION||e===o.REPLACE||e===o.MULTIPLY||e===o.REMOVE?this.curBlendMode=e:e!==o.BURN&&e!==o.OVERLAY&&e!==o.HARD_LIGHT&&e!==o.SOFT_LIGHT&&e!==o.DODGE||console.warn("BURN, OVERLAY, HARD_LIGHT, SOFT_LIGHT, and DODGE only work for blendMode in 2D mode.")},u.default.RendererGL.prototype.erase=function(e,t){this._isErasing||(this._cachedBlendMode=this.curBlendMode,this.blendMode(o.REMOVE),this._cachedFillStyle=this.curFillColor.slice(),this.curFillColor=[1,1,1,e/255],this._cachedStrokeStyle=this.curStrokeColor.slice(),this.curStrokeColor=[1,1,1,t/255],this._isErasing=!0)},u.default.RendererGL.prototype.noErase=function(){this._isErasing&&(this.curFillColor=this._cachedFillStyle.slice(),this.curStrokeColor=this._cachedStrokeStyle.slice(),this.blendMode(this._cachedBlendMode),this._isErasing=!1)},u.default.RendererGL.prototype.strokeWeight=function(e){this.curStrokeWeight!==e&&(this.pointSize=e,this.curStrokeWeight=e)},u.default.RendererGL.prototype._getPixel=function(e,t){var r;return r=new Uint8Array(4),this.drawingContext.readPixels(e,t,1,1,this.drawingContext.RGBA,this.drawingContext.UNSIGNED_BYTE,r),[r[0],r[1],r[2],r[3]]},u.default.RendererGL.prototype.loadPixels=function(){var e=this._pixelsState;if(!0===this._pInst._glAttributes.preserveDrawingBuffer){var t=e.pixels,r=this.GL.drawingBufferWidth*this.GL.drawingBufferHeight*4;t instanceof Uint8Array&&t.length===r||(t=new Uint8Array(r),this._pixelsState._setProperty("pixels",t));var i=this._pInst._pixelDensity;this.GL.readPixels(0,0,this.width*i,this.height*i,this.GL.RGBA,this.GL.UNSIGNED_BYTE,t)}else console.log("loadPixels only works in WebGL when preserveDrawingBuffer is true.")},u.default.RendererGL.prototype.geometryInHash=function(e){return void 0!==this.retainedMode.geometry[e]},u.default.RendererGL.prototype.resize=function(e,t){u.default.Renderer.prototype.resize.call(this,e,t),this.GL.viewport(0,0,this.GL.drawingBufferWidth,this.GL.drawingBufferHeight),this._viewport=this.GL.getParameter(this.GL.VIEWPORT),this._curCamera._resize();var r=this._pixelsState;void 0!==r.pixels&&r._setProperty("pixels",new Uint8Array(this.GL.drawingBufferWidth*this.GL.drawingBufferHeight*4))},u.default.RendererGL.prototype.clear=function(){var e=(arguments.length<=0?void 0:arguments[0])||0,t=(arguments.length<=1?void 0:arguments[1])||0,r=(arguments.length<=2?void 0:arguments[2])||0,i=(arguments.length<=3?void 0:arguments[3])||0;this.GL.clearColor(e,t,r,i),this.GL.clear(this.GL.COLOR_BUFFER_BIT|this.GL.DEPTH_BUFFER_BIT)},u.default.RendererGL.prototype.applyMatrix=function(e,t,r,i,n,o){16===arguments.length?u.default.Matrix.prototype.apply.apply(this.uMVMatrix,arguments):this.uMVMatrix.apply([e,t,0,0,r,i,0,0,0,0,1,0,n,o,0,1])},u.default.RendererGL.prototype.translate=function(e,t,r){return e instanceof u.default.Vector&&(r=e.z,t=e.y,e=e.x),this.uMVMatrix.translate([e,t,r]),this},u.default.RendererGL.prototype.scale=function(e,t,r){return this.uMVMatrix.scale(e,t,r),this},u.default.RendererGL.prototype.rotate=function(e,t){return void 0===t?this.rotateZ(e):(u.default.Matrix.prototype.rotate.apply(this.uMVMatrix,arguments),this)},u.default.RendererGL.prototype.rotateX=function(e){return this.rotate(e,1,0,0),this},u.default.RendererGL.prototype.rotateY=function(e){return this.rotate(e,0,1,0),this},u.default.RendererGL.prototype.rotateZ=function(e){return this.rotate(e,0,0,1),this},u.default.RendererGL.prototype.push=function(){var e=u.default.Renderer.prototype.push.apply(this),t=e.properties;return t.uMVMatrix=this.uMVMatrix.copy(),t.uPMatrix=this.uPMatrix.copy(),t._curCamera=this._curCamera,this._curCamera=this._curCamera.copy(),t.ambientLightColors=this.ambientLightColors.slice(),t.specularColors=this.specularColors.slice(),t.directionalLightDirections=this.directionalLightDirections.slice(),t.directionalLightDiffuseColors=this.directionalLightDiffuseColors.slice(),t.directionalLightSpecularColors=this.directionalLightSpecularColors.slice(),t.pointLightPositions=this.pointLightPositions.slice(),t.pointLightDiffuseColors=this.pointLightDiffuseColors.slice(),t.pointLightSpecularColors=this.pointLightSpecularColors.slice(),t.spotLightPositions=this.spotLightPositions.slice(),t.spotLightDirections=this.spotLightDirections.slice(),t.spotLightDiffuseColors=this.spotLightDiffuseColors.slice(),t.spotLightSpecularColors=this.spotLightSpecularColors.slice(),t.spotLightAngle=this.spotLightAngle.slice(),t.spotLightConc=this.spotLightConc.slice(),t.userFillShader=this.userFillShader,t.userStrokeShader=this.userStrokeShader,t.userPointShader=this.userPointShader,t.pointSize=this.pointSize,t.curStrokeWeight=this.curStrokeWeight,t.curStrokeColor=this.curStrokeColor,t.curFillColor=this.curFillColor,t._useSpecularMaterial=this._useSpecularMaterial,t._useEmissiveMaterial=this._useEmissiveMaterial,t._useShininess=this._useShininess,t.constantAttenuation=this.constantAttenuation,t.linearAttenuation=this.linearAttenuation,t.quadraticAttenuation=this.quadraticAttenuation,t._enableLighting=this._enableLighting,t._useNormalMaterial=this._useNormalMaterial,t._tex=this._tex,t.drawMode=this.drawMode,e},u.default.RendererGL.prototype.resetMatrix=function(){return this.uMVMatrix=u.default.Matrix.identity(this._pInst),this},u.default.RendererGL.prototype._getImmediateStrokeShader=function(){var e=this.userStrokeShader;return e&&e.isStrokeShader()?e:this._getLineShader()},u.default.RendererGL.prototype._getRetainedStrokeShader=u.default.RendererGL.prototype._getImmediateStrokeShader,u.default.RendererGL.prototype._getImmediateFillShader=function(){var e=this.userFillShader;if(this._useNormalMaterial&&(!e||!e.isNormalShader()))return this._getNormalShader();if(this._enableLighting){if(!e||!e.isLightShader())return this._getLightShader()}else if(this._tex){if(!e||!e.isTextureShader())return this._getLightShader()}else if(!e)return this._getImmediateModeShader();return e},u.default.RendererGL.prototype._getRetainedFillShader=function(){if(this._useNormalMaterial)return this._getNormalShader();var e=this.userFillShader;if(this._enableLighting){if(!e||!e.isLightShader())return this._getLightShader()}else if(this._tex){if(!e||!e.isTextureShader())return this._getLightShader()}else if(!e)return this._getColorShader();return e},u.default.RendererGL.prototype._getImmediatePointShader=function(){var e=this.userPointShader;return e&&e.isPointShader()?e:this._getPointShader()},u.default.RendererGL.prototype._getRetainedLineShader=u.default.RendererGL.prototype._getImmediateLineShader,u.default.RendererGL.prototype._getLightShader=function(){return this._defaultLightShader||(this._pInst._glAttributes.perPixelLighting?this._defaultLightShader=new u.default.Shader(this,c.phongVert,c.phongFrag):this._defaultLightShader=new u.default.Shader(this,c.lightVert,c.lightTextureFrag)),this._defaultLightShader},u.default.RendererGL.prototype._getImmediateModeShader=function(){return this._defaultImmediateModeShader||(this._defaultImmediateModeShader=new u.default.Shader(this,c.immediateVert,c.vertexColorFrag)),this._defaultImmediateModeShader},u.default.RendererGL.prototype._getNormalShader=function(){return this._defaultNormalShader||(this._defaultNormalShader=new u.default.Shader(this,c.normalVert,c.normalFrag)),this._defaultNormalShader},u.default.RendererGL.prototype._getColorShader=function(){return this._defaultColorShader||(this._defaultColorShader=new u.default.Shader(this,c.normalVert,c.basicFrag)),this._defaultColorShader},u.default.RendererGL.prototype._getPointShader=function(){return this._defaultPointShader||(this._defaultPointShader=new u.default.Shader(this,c.pointVert,c.pointFrag)),this._defaultPointShader},u.default.RendererGL.prototype._getLineShader=function(){return this._defaultLineShader||(this._defaultLineShader=new u.default.Shader(this,c.lineVert,c.lineFrag)),this._defaultLineShader},u.default.RendererGL.prototype._getFontShader=function(){return this._defaultFontShader||(this.GL.getExtension("OES_standard_derivatives"),this._defaultFontShader=new u.default.Shader(this,c.fontVert,c.fontFrag)),this._defaultFontShader},u.default.RendererGL.prototype._getEmptyTexture=function(){if(!this._emptyTexture){var e=new u.default.Image(1,1);e.set(0,0,255),this._emptyTexture=new u.default.Texture(this,e)}return this._emptyTexture},u.default.RendererGL.prototype.getTexture=function(e){var t=this.textures,r=!0,i=!1,n=void 0;try{for(var o,a=t[Symbol.iterator]();!(r=(o=a.next()).done);r=!0){var s=o.value;if(s.src===e)return s}}catch(e){i=!0,n=e}finally{try{r||null==a.return||a.return()}finally{if(i)throw n}}var l=new u.default.Texture(this,e);return t.push(l),l},u.default.RendererGL.prototype._setStrokeUniforms=function(e){e.bindShader(),e.setUniform("uMaterialColor",this.curStrokeColor),e.setUniform("uStrokeWeight",this.curStrokeWeight)},u.default.RendererGL.prototype._setFillUniforms=function(e){e.bindShader(),e.setUniform("uMaterialColor",this.curFillColor),e.setUniform("isTexture",!!this._tex),this._tex&&e.setUniform("uSampler",this._tex),e.setUniform("uTint",this._tint),e.setUniform("uSpecular",this._useSpecularMaterial),e.setUniform("uEmissive",this._useEmissiveMaterial),e.setUniform("uShininess",this._useShininess),e.setUniform("uUseLighting",this._enableLighting);var t=this.pointLightDiffuseColors.length/3;e.setUniform("uPointLightCount",t),e.setUniform("uPointLightLocation",this.pointLightPositions),e.setUniform("uPointLightDiffuseColors",this.pointLightDiffuseColors),e.setUniform("uPointLightSpecularColors",this.pointLightSpecularColors);var r=this.directionalLightDiffuseColors.length/3;e.setUniform("uDirectionalLightCount",r),e.setUniform("uLightingDirection",this.directionalLightDirections),e.setUniform("uDirectionalDiffuseColors",this.directionalLightDiffuseColors),e.setUniform("uDirectionalSpecularColors",this.directionalLightSpecularColors);var i=this.ambientLightColors.length/3;e.setUniform("uAmbientLightCount",i),e.setUniform("uAmbientColor",this.ambientLightColors);var n=this.spotLightDiffuseColors.length/3;e.setUniform("uSpotLightCount",n),e.setUniform("uSpotLightAngle",this.spotLightAngle),e.setUniform("uSpotLightConc",this.spotLightConc),e.setUniform("uSpotLightDiffuseColors",this.spotLightDiffuseColors),e.setUniform("uSpotLightSpecularColors",this.spotLightSpecularColors),e.setUniform("uSpotLightLocation",this.spotLightPositions),e.setUniform("uSpotLightDirection",this.spotLightDirections),e.setUniform("uConstantAttenuation",this.constantAttenuation),e.setUniform("uLinearAttenuation",this.linearAttenuation),e.setUniform("uQuadraticAttenuation",this.quadraticAttenuation),e.bindTextures()},u.default.RendererGL.prototype._setPointUniforms=function(e){e.bindShader(),e.setUniform("uMaterialColor",this.curStrokeColor),e.setUniform("uPointSize",this.pointSize)},u.default.RendererGL.prototype._bindBuffer=function(e,t,r,i,n){if(t=t||this.GL.ARRAY_BUFFER,this.GL.bindBuffer(t,e),void 0!==r){var o=new(i||Float32Array)(r);this.GL.bufferData(t,o,n||this.GL.STATIC_DRAW)}},u.default.RendererGL.prototype._arraysEqual=function(e,t){var r=e.length;if(r!==t.length)return!1;for(var i=0;i>7,127&f,c>>7,127&c);for(var d=0;d>7,127&p,0,0)}}return{cellImageInfo:l,dimOffset:o,dimImageInfo:n}}return(t=this.glyphInfos[e.index]={glyph:e,uGlyphRect:[i.x1,-i.y1,i.x2,-i.y2],strokeImageInfo:U,strokes:d,colInfo:G(m,this.colDimImageInfos,this.colCellImageInfos),rowInfo:G(p,this.rowDimImageInfos,this.rowCellImageInfos)}).uGridOffset=[t.colInfo.dimOffset,t.rowInfo.dimOffset],t}}var z=Math.sqrt(3);j.default.RendererGL.prototype._renderText=function(e,t,r,i,n){if(this._textFont&&"string"!=typeof this._textFont){if(!(n<=i)&&this._doFill){if(!this._isOpenType())return console.log("WEBGL: only Opentype (.otf) and Truetype (.ttf) fonts are supported"),e;e.push();var o=this._doStroke,a=this.drawMode;this._doStroke=!1,this.drawMode=D.TEXTURE;var s=this._textFont.font,l=this._textFont._fontInfo;l=l||(this._textFont._fontInfo=new A(s));var u=this._textFont._handleAlignment(this,t,r,i),h=this._textSize/s.unitsPerEm;this.translate(u.x,u.y,0),this.scale(h,h,1);var c=this.GL,f=!this._defaultFontShader,d=this._getFontShader();d.init(),d.bindShader(),f&&(d.setUniform("uGridImageSize",[64,64]),d.setUniform("uCellsImageSize",[64,64]),d.setUniform("uStrokeImageSize",[64,64]),d.setUniform("uGridSize",[9,9])),this._applyColorBlend(this.curFillColor);var p=this.retainedMode.geometry.glyph;if(!p){var m=this._textGeom=new j.default.Geometry(1,1,function(){for(var e=0;e<=1;e++)for(var t=0;t<=1;t++)this.vertices.push(new j.default.Vector(t,e,0)),this.uvs.push(t,e)});m.computeFaces().computeNormals(),p=this.createBuffers("glyph",m)}var g=!0,v=!1,y=void 0;try{for(var b,_=this.retainedMode.buffers.text[Symbol.iterator]();!(g=(b=_.next()).done);g=!0){b.value._prepareBuffer(p,d)}}catch(e){v=!0,y=e}finally{try{g||null==_.return||_.return()}finally{if(v)throw y}}this._bindBuffer(p.indexBuffer,c.ELEMENT_ARRAY_BUFFER),d.setUniform("uMaterialColor",this.curFillColor);try{var x=0,w=null,S=s.stringToGlyphs(t),M=!0,E=!1,T=void 0;try{for(var C,P=S[Symbol.iterator]();!(M=(C=P.next()).done);M=!0){var L=C.value;w&&(x+=s.getKerningValue(w,L));var k=l.getGlyphInfo(L);if(k.uGlyphRect){var R=k.rowInfo,O=k.colInfo;d.setUniform("uSamplerStrokes",k.strokeImageInfo.imageData),d.setUniform("uSamplerRowStrokes",R.cellImageInfo.imageData),d.setUniform("uSamplerRows",R.dimImageInfo.imageData),d.setUniform("uSamplerColStrokes",O.cellImageInfo.imageData),d.setUniform("uSamplerCols",O.dimImageInfo.imageData),d.setUniform("uGridOffset",k.uGridOffset),d.setUniform("uGlyphRect",k.uGlyphRect),d.setUniform("uGlyphOffset",x),d.bindTextures(),c.drawElements(c.TRIANGLES,6,this.GL.UNSIGNED_SHORT,0)}x+=L.advanceWidth,w=L}}catch(e){E=!0,T=e}finally{try{M||null==P.return||P.return()}finally{if(E)throw T}}}finally{d.unbindShader(),this._doStroke=o,this.drawMode=a,e.pop()}return e}}else console.log("WEBGL: you must load and set a font before drawing text. See `loadFont` and `textFont` for more details.")}},{"../core/constants":42,"../core/main":49,"./p5.RendererGL.Retained":102,"./p5.Shader":104}],107:[function(e,t,r){t.exports={fes:{autoplay:"The media that tried to play (with '{{src}}') wasn't allowed to by this browser, most likely due to the browser's autoplay policy. Check out {{link}} for more information about why.",fileLoadError:{bytes:"It looks like there was a problem loading your file. {{suggestion}}",font:"It looks like there was a problem loading your font. {{suggestion}}",gif:"There was some trouble loading your GIF. Make sure that your GIF is using 87a or 89a encoding.",image:"It looks like there was a problem loading your image. {{suggestion}}",json:"It looks like there was a problem loading your JSON file. {{suggestion}}",large:"If your large file isn't fetched successfully, we recommend splitting the file into smaller segments and fetching those.",strings:"It looks like there was a problem loading your text file. {{suggestion}}",suggestion:"Try checking if the file path ({{filePath}}) is correct, hosting the file online, or running a local server. (More info at {{link}})",table:"It looks like there was a problem loading your table file. {{suggestion}}",xml:"It looks like there was a problem loading your XML file. {{suggestion}}"},misusedTopLevel:"Did you just try to use p5.js's {{symbolName}} {{symbolType}}? If so, you may want to move it into your sketch's setup() function.\n\nFor more details, see: {{link}}",pre:"🌸 p5.js says: {{message}}",welcome:"Welcome! This is your friendly debugger. To turn me off, switch to using p5.min.js."}}},{}],108:[function(e,t,r){t.exports={fes:{autoplay:"Su browser impidío un medio tocar (de '{{src}}'), posiblemente porque las reglas de autoplay. Para aprender más, visite {{link}}.",fileLoadError:{bytes:"",font:"",gif:"",image:"",json:"",large:"",strings:"",suggestion:"",table:"",xml:""},misusedTopLevel:"",pre:"🌸 p5.js dice: {{message}}",welcome:""}}},{}],109:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i=o(e("./en/translation")),n=o(e("./es/translation"));function o(e){return e&&e.__esModule?e:{default:e}}var a={en:{translation:i.default},es:{translation:n.default}};r.default=a},{"./en/translation":107,"./es/translation":108}]},{},[37])(37)}); ================================================ FILE: docs/examples/transcrypt/sketch_003/target/org.transcrypt.__runtime__.js ================================================ // Transcrypt'ed from Python, 2021-11-02 13:06:11 var __name__ = 'org.transcrypt.__runtime__'; export var __envir__ = {}; __envir__.interpreter_name = 'python'; __envir__.transpiler_name = 'transcrypt'; __envir__.executor_name = __envir__.transpiler_name; __envir__.transpiler_version = '3.9.0'; export function __nest__ (headObject, tailNames, value) { var current = headObject; if (tailNames != '') { var tailChain = tailNames.split ('.'); var firstNewIndex = tailChain.length; for (var index = 0; index < tailChain.length; index++) { if (!current.hasOwnProperty (tailChain [index])) { firstNewIndex = index; break; } current = current [tailChain [index]]; } for (var index = firstNewIndex; index < tailChain.length; index++) { current [tailChain [index]] = {}; current = current [tailChain [index]]; } } for (let attrib of Object.getOwnPropertyNames (value)) { Object.defineProperty (current, attrib, { get () {return value [attrib];}, enumerable: true, configurable: true }); } }; export function __init__ (module) { if (!module.__inited__) { module.__all__.__init__ (module.__all__); module.__inited__ = true; } return module.__all__; }; export function __get__ (aThis, func, quotedFuncName) { if (aThis) { if (aThis.hasOwnProperty ('__class__') || typeof aThis == 'string' || aThis instanceof String) { if (quotedFuncName) { Object.defineProperty (aThis, quotedFuncName, { value: function () { var args = [] .slice.apply (arguments); return func.apply (null, [aThis] .concat (args)); }, writable: true, enumerable: true, configurable: true }); } return function () { var args = [] .slice.apply (arguments); return func.apply (null, [aThis.__proxy__ ? aThis.__proxy__ : aThis] .concat (args)); }; } else { return func; } } else { return func; } }; export function __getcm__ (aThis, func, quotedFuncName) { if (aThis.hasOwnProperty ('__class__')) { return function () { var args = [] .slice.apply (arguments); return func.apply (null, [aThis.__class__] .concat (args)); }; } else { return function () { var args = [] .slice.apply (arguments); return func.apply (null, [aThis] .concat (args)); }; } }; export function __getsm__ (aThis, func, quotedFuncName) { return func; }; export var py_metatype = { __name__: 'type', __bases__: [], __new__: function (meta, name, bases, attribs) { var cls = function () { var args = [] .slice.apply (arguments); return cls.__new__ (args); }; for (var index = bases.length - 1; index >= 0; index--) { var base = bases [index]; for (var attrib in base) { var descrip = Object.getOwnPropertyDescriptor (base, attrib); if (descrip == null) { continue; } Object.defineProperty (cls, attrib, descrip); } for (let symbol of Object.getOwnPropertySymbols (base)) { let descrip = Object.getOwnPropertyDescriptor (base, symbol); Object.defineProperty (cls, symbol, descrip); } } cls.__metaclass__ = meta; cls.__name__ = name.startsWith ('py_') ? name.slice (3) : name; cls.__bases__ = bases; for (var attrib in attribs) { var descrip = Object.getOwnPropertyDescriptor (attribs, attrib); Object.defineProperty (cls, attrib, descrip); } for (let symbol of Object.getOwnPropertySymbols (attribs)) { let descrip = Object.getOwnPropertyDescriptor (attribs, symbol); Object.defineProperty (cls, symbol, descrip); } return cls; } }; py_metatype.__metaclass__ = py_metatype; export var object = { __init__: function (self) {}, __metaclass__: py_metatype, __name__: 'object', __bases__: [], __new__: function (args) { var instance = Object.create (this, {__class__: {value: this, enumerable: true}}); if ('__getattr__' in this || '__setattr__' in this) { instance.__proxy__ = new Proxy (instance, { get: function (target, name) { let result = target [name]; if (result == undefined) { return target.__getattr__ (name); } else { return result; } }, set: function (target, name, value) { try { target.__setattr__ (name, value); } catch (exception) { target [name] = value; } return true; } }) instance = instance.__proxy__ } this.__init__.apply (null, [instance] .concat (args)); return instance; } }; export function __class__ (name, bases, attribs, meta) { if (meta === undefined) { meta = bases [0] .__metaclass__; } return meta.__new__ (meta, name, bases, attribs); }; export function __pragma__ () {}; export function __call__ (/* , , * */) { var args = [] .slice.apply (arguments); if (typeof args [0] == 'object' && '__call__' in args [0]) { return args [0] .__call__ .apply (args [1], args.slice (2)); } else { return args [0] .apply (args [1], args.slice (2)); } }; __envir__.executor_name = __envir__.transpiler_name; var __main__ = {__file__: ''}; var __except__ = null; export function __kwargtrans__ (anObject) { anObject.__kwargtrans__ = null; anObject.constructor = Object; return anObject; } export function __super__ (aClass, methodName) { for (let base of aClass.__bases__) { if (methodName in base) { return base [methodName]; } } throw new Exception ('Superclass method not found'); } export function property (getter, setter) { if (!setter) { setter = function () {}; } return {get: function () {return getter (this)}, set: function (value) {setter (this, value)}, enumerable: true}; } export function __setproperty__ (anObject, name, descriptor) { if (!anObject.hasOwnProperty (name)) { Object.defineProperty (anObject, name, descriptor); } } export function assert (condition, message) { if (!condition) { throw AssertionError (message, new Error ()); } } export function __mergekwargtrans__ (object0, object1) { var result = {}; for (var attrib in object0) { result [attrib] = object0 [attrib]; } for (var attrib in object1) { result [attrib] = object1 [attrib]; } return result; }; export function __mergefields__ (targetClass, sourceClass) { let fieldNames = ['__reprfields__', '__comparefields__', '__initfields__'] if (sourceClass [fieldNames [0]]) { if (targetClass [fieldNames [0]]) { for (let fieldName of fieldNames) { targetClass [fieldName] = new Set ([...targetClass [fieldName], ...sourceClass [fieldName]]); } } else { for (let fieldName of fieldNames) { targetClass [fieldName] = new Set (sourceClass [fieldName]); } } } } export function __withblock__ (manager, statements) { if (hasattr (manager, '__enter__')) { try { manager.__enter__ (); statements (); manager.__exit__ (); } catch (exception) { if (! (manager.__exit__ (exception.name, exception, exception.stack))) { throw exception; } } } else { statements (); manager.close (); } }; export function dir (obj) { var aList = []; for (var aKey in obj) { aList.push (aKey.startsWith ('py_') ? aKey.slice (3) : aKey); } aList.sort (); return aList; }; export function setattr (obj, name, value) { obj [name] = value; }; export function getattr (obj, name) { return name in obj ? obj [name] : obj ['py_' + name]; }; export function hasattr (obj, name) { try { return name in obj || 'py_' + name in obj; } catch (exception) { return false; } }; export function delattr (obj, name) { if (name in obj) { delete obj [name]; } else { delete obj ['py_' + name]; } }; export function __in__ (element, container) { if (container === undefined || container === null) { return false; } if (container.__contains__ instanceof Function) { return container.__contains__ (element); } else { return ( container.indexOf ? container.indexOf (element) > -1 : container.hasOwnProperty (element) ); } }; export function __specialattrib__ (attrib) { return (attrib.startswith ('__') && attrib.endswith ('__')) || attrib == 'constructor' || attrib.startswith ('py_'); }; export function len (anObject) { if (anObject === undefined || anObject === null) { return 0; } if (anObject.__len__ instanceof Function) { return anObject.__len__ (); } if (anObject.length !== undefined) { return anObject.length; } var length = 0; for (var attr in anObject) { if (!__specialattrib__ (attr)) { length++; } } return length; }; export function __i__ (any) { return py_typeof (any) == dict ? any.py_keys () : any; } export function __k__ (keyed, key) { var result = keyed [key]; if (typeof result == 'undefined') { if (keyed instanceof Array) if (key == +key && key >= 0 && keyed.length > key) return result; else throw IndexError (key, new Error()); else throw KeyError (key, new Error()); } return result; } export function __t__ (target) { return ( target === undefined || target === null ? false : ['boolean', 'number'] .indexOf (typeof target) >= 0 ? target : target.__bool__ instanceof Function ? (target.__bool__ () ? target : false) : target.__len__ instanceof Function ? (target.__len__ () !== 0 ? target : false) : target instanceof Function ? target : len (target) !== 0 ? target : false ); } export function float (any) { if (any == 'inf') { return Infinity; } else if (any == '-inf') { return -Infinity; } else if (any == 'nan') { return NaN; } else if (isNaN (parseFloat (any))) { if (any === false) { return 0; } else if (any === true) { return 1; } else { throw ValueError ("could not convert string to float: '" + str(any) + "'", new Error ()); } } else { return +any; } }; float.__name__ = 'float'; float.__bases__ = [object]; export function int (any) { return float (any) | 0 }; int.__name__ = 'int'; int.__bases__ = [object]; export function bool (any) { return !!__t__ (any); }; bool.__name__ = 'bool'; bool.__bases__ = [int]; export function py_typeof (anObject) { var aType = typeof anObject; if (aType == 'object') { try { return '__class__' in anObject ? anObject.__class__ : object; } catch (exception) { return aType; } } else { return ( aType == 'boolean' ? bool : aType == 'string' ? str : aType == 'number' ? (anObject % 1 == 0 ? int : float) : null ); } }; export function issubclass (aClass, classinfo) { if (classinfo instanceof Array) { for (let aClass2 of classinfo) { if (issubclass (aClass, aClass2)) { return true; } } return false; } try { var aClass2 = aClass; if (aClass2 == classinfo) { return true; } else { var bases = [].slice.call (aClass2.__bases__); while (bases.length) { aClass2 = bases.shift (); if (aClass2 == classinfo) { return true; } if (aClass2.__bases__.length) { bases = [].slice.call (aClass2.__bases__).concat (bases); } } return false; } } catch (exception) { return aClass == classinfo || classinfo == object; } }; export function isinstance (anObject, classinfo) { try { return '__class__' in anObject ? issubclass (anObject.__class__, classinfo) : issubclass (py_typeof (anObject), classinfo); } catch (exception) { return issubclass (py_typeof (anObject), classinfo); } }; export function callable (anObject) { return anObject && typeof anObject == 'object' && '__call__' in anObject ? true : typeof anObject === 'function'; }; export function repr (anObject) { try { return anObject.__repr__ (); } catch (exception) { try { return anObject.__str__ (); } catch (exception) { try { if (anObject == null) { return 'None'; } else if (anObject.constructor == Object) { var result = '{'; var comma = false; for (var attrib in anObject) { if (!__specialattrib__ (attrib)) { if (attrib.isnumeric ()) { var attribRepr = attrib; } else { var attribRepr = '\'' + attrib + '\''; } if (comma) { result += ', '; } else { comma = true; } result += attribRepr + ': ' + repr (anObject [attrib]); } } result += '}'; return result; } else { return typeof anObject == 'boolean' ? anObject.toString () .capitalize () : anObject.toString (); } } catch (exception) { return ''; } } } }; export function chr (charCode) { return String.fromCharCode (charCode); }; export function ord (aChar) { return aChar.charCodeAt (0); }; export function max (nrOrSeq) { return arguments.length == 1 ? Math.max (...nrOrSeq) : Math.max (...arguments); }; export function min (nrOrSeq) { return arguments.length == 1 ? Math.min (...nrOrSeq) : Math.min (...arguments); }; export var abs = Math.abs; export function round (number, ndigits) { if (ndigits) { var scale = Math.pow (10, ndigits); number *= scale; } var rounded = Math.round (number); if (rounded - number == 0.5 && rounded % 2) { rounded -= 1; } if (ndigits) { rounded /= scale; } return rounded; }; export function __jsUsePyNext__ () { try { var result = this.__next__ (); return {value: result, done: false}; } catch (exception) { return {value: undefined, done: true}; } } export function __pyUseJsNext__ () { var result = this.next (); if (result.done) { throw StopIteration (new Error ()); } else { return result.value; } } export function py_iter (iterable) { if (typeof iterable == 'string' || '__iter__' in iterable) { var result = iterable.__iter__ (); result.next = __jsUsePyNext__; } else if ('selector' in iterable) { var result = list (iterable) .__iter__ (); result.next = __jsUsePyNext__; } else if ('next' in iterable) { var result = iterable if (! ('__next__' in result)) { result.__next__ = __pyUseJsNext__; } } else if (Symbol.iterator in iterable) { var result = iterable [Symbol.iterator] (); result.__next__ = __pyUseJsNext__; } else { throw IterableError (new Error ()); } result [Symbol.iterator] = function () {return result;}; return result; } export function py_next (iterator) { try { var result = iterator.__next__ (); } catch (exception) { var result = iterator.next (); if (result.done) { throw StopIteration (new Error ()); } else { return result.value; } } if (result == undefined) { throw StopIteration (new Error ()); } else { return result; } } export function __PyIterator__ (iterable) { this.iterable = iterable; this.index = 0; } __PyIterator__.prototype.__next__ = function() { if (this.index < this.iterable.length) { return this.iterable [this.index++]; } else { throw StopIteration (new Error ()); } }; export function __JsIterator__ (iterable) { this.iterable = iterable; this.index = 0; } __JsIterator__.prototype.next = function () { if (this.index < this.iterable.py_keys.length) { return {value: this.index++, done: false}; } else { return {value: undefined, done: true}; } }; export function py_reversed (iterable) { iterable = iterable.slice (); iterable.reverse (); return iterable; }; export function zip () { var args = [] .slice.call (arguments); for (var i = 0; i < args.length; i++) { if (typeof args [i] == 'string') { args [i] = args [i] .split (''); } else if (!Array.isArray (args [i])) { args [i] = Array.from (args [i]); } } var shortest = args.length == 0 ? [] : args.reduce ( function (array0, array1) { return array0.length < array1.length ? array0 : array1; } ); return shortest.map ( function (current, index) { return args.map ( function (current) { return current [index]; } ); } ); }; export function range (start, stop, step) { if (stop == undefined) { stop = start; start = 0; } if (step == undefined) { step = 1; } if ((step > 0 && start >= stop) || (step < 0 && start <= stop)) { return []; } var result = []; for (var i = start; step > 0 ? i < stop : i > stop; i += step) { result.push(i); } return result; }; export function any (iterable) { for (let item of iterable) { if (bool (item)) { return true; } } return false; } export function all (iterable) { for (let item of iterable) { if (! bool (item)) { return false; } } return true; } export function sum (iterable) { let result = 0; for (let item of iterable) { result += item; } return result; } export function enumerate (iterable) { return zip (range (len (iterable)), iterable); } export function copy (anObject) { if (anObject == null || typeof anObject == "object") { return anObject; } else { var result = {}; for (var attrib in obj) { if (anObject.hasOwnProperty (attrib)) { result [attrib] = anObject [attrib]; } } return result; } } export function deepcopy (anObject) { if (anObject == null || typeof anObject == "object") { return anObject; } else { var result = {}; for (var attrib in obj) { if (anObject.hasOwnProperty (attrib)) { result [attrib] = deepcopy (anObject [attrib]); } } return result; } } export function list (iterable) { let instance = iterable ? Array.from (iterable) : []; return instance; } Array.prototype.__class__ = list; list.__name__ = 'list'; list.__bases__ = [object]; Array.prototype.__iter__ = function () {return new __PyIterator__ (this);}; Array.prototype.__getslice__ = function (start, stop, step) { if (start < 0) { start = this.length + start; } if (stop == null) { stop = this.length; } else if (stop < 0) { stop = this.length + stop; } else if (stop > this.length) { stop = this.length; } if (step == 1) { return Array.prototype.slice.call(this, start, stop); } let result = list ([]); for (let index = start; index < stop; index += step) { result.push (this [index]); } return result; }; Array.prototype.__setslice__ = function (start, stop, step, source) { if (start < 0) { start = this.length + start; } if (stop == null) { stop = this.length; } else if (stop < 0) { stop = this.length + stop; } if (step == null) { Array.prototype.splice.apply (this, [start, stop - start] .concat (source)); } else { let sourceIndex = 0; for (let targetIndex = start; targetIndex < stop; targetIndex += step) { this [targetIndex] = source [sourceIndex++]; } } }; Array.prototype.__repr__ = function () { if (this.__class__ == set && !this.length) { return 'set()'; } let result = !this.__class__ || this.__class__ == list ? '[' : this.__class__ == tuple ? '(' : '{'; for (let index = 0; index < this.length; index++) { if (index) { result += ', '; } result += repr (this [index]); } if (this.__class__ == tuple && this.length == 1) { result += ','; } result += !this.__class__ || this.__class__ == list ? ']' : this.__class__ == tuple ? ')' : '}';; return result; }; Array.prototype.__str__ = Array.prototype.__repr__; Array.prototype.append = function (element) { this.push (element); }; Array.prototype.py_clear = function () { this.length = 0; }; Array.prototype.extend = function (aList) { this.push.apply (this, aList); }; Array.prototype.insert = function (index, element) { this.splice (index, 0, element); }; Array.prototype.remove = function (element) { let index = this.indexOf (element); if (index == -1) { throw ValueError ("list.remove(x): x not in list", new Error ()); } this.splice (index, 1); }; Array.prototype.index = function (element) { return this.indexOf (element); }; Array.prototype.py_pop = function (index) { if (index == undefined) { return this.pop (); } else { return this.splice (index, 1) [0]; } }; Array.prototype.py_sort = function () { __sort__.apply (null, [this].concat ([] .slice.apply (arguments))); }; Array.prototype.__add__ = function (aList) { return list (this.concat (aList)); }; Array.prototype.__mul__ = function (scalar) { let result = this; for (let i = 1; i < scalar; i++) { result = result.concat (this); } return result; }; Array.prototype.__rmul__ = Array.prototype.__mul__; export function tuple (iterable) { let instance = iterable ? [] .slice.apply (iterable) : []; instance.__class__ = tuple; return instance; } tuple.__name__ = 'tuple'; tuple.__bases__ = [object]; export function set (iterable) { let instance = []; if (iterable) { for (let index = 0; index < iterable.length; index++) { instance.add (iterable [index]); } } instance.__class__ = set; return instance; } set.__name__ = 'set'; set.__bases__ = [object]; Array.prototype.__bindexOf__ = function (element) { element += ''; let mindex = 0; let maxdex = this.length - 1; while (mindex <= maxdex) { let index = (mindex + maxdex) / 2 | 0; let middle = this [index] + ''; if (middle < element) { mindex = index + 1; } else if (middle > element) { maxdex = index - 1; } else { return index; } } return -1; }; Array.prototype.add = function (element) { if (this.indexOf (element) == -1) { this.push (element); } }; Array.prototype.discard = function (element) { var index = this.indexOf (element); if (index != -1) { this.splice (index, 1); } }; Array.prototype.isdisjoint = function (other) { this.sort (); for (let i = 0; i < other.length; i++) { if (this.__bindexOf__ (other [i]) != -1) { return false; } } return true; }; Array.prototype.issuperset = function (other) { this.sort (); for (let i = 0; i < other.length; i++) { if (this.__bindexOf__ (other [i]) == -1) { return false; } } return true; }; Array.prototype.issubset = function (other) { return set (other.slice ()) .issuperset (this); }; Array.prototype.union = function (other) { let result = set (this.slice () .sort ()); for (let i = 0; i < other.length; i++) { if (result.__bindexOf__ (other [i]) == -1) { result.push (other [i]); } } return result; }; Array.prototype.intersection = function (other) { this.sort (); let result = set (); for (let i = 0; i < other.length; i++) { if (this.__bindexOf__ (other [i]) != -1) { result.push (other [i]); } } return result; }; Array.prototype.difference = function (other) { let sother = set (other.slice () .sort ()); let result = set (); for (let i = 0; i < this.length; i++) { if (sother.__bindexOf__ (this [i]) == -1) { result.push (this [i]); } } return result; }; Array.prototype.symmetric_difference = function (other) { return this.union (other) .difference (this.intersection (other)); }; Array.prototype.py_update = function () { let updated = [] .concat.apply (this.slice (), arguments) .sort (); this.py_clear (); for (let i = 0; i < updated.length; i++) { if (updated [i] != updated [i - 1]) { this.push (updated [i]); } } }; Array.prototype.__eq__ = function (other) { if (this.length != other.length) { return false; } if (this.__class__ == set) { this.sort (); other.sort (); } for (let i = 0; i < this.length; i++) { if (this [i] != other [i]) { return false; } } return true; }; Array.prototype.__ne__ = function (other) { return !this.__eq__ (other); }; Array.prototype.__le__ = function (other) { if (this.__class__ == set) { return this.issubset (other); } else { for (let i = 0; i < this.length; i++) { if (this [i] > other [i]) { return false; } else if (this [i] < other [i]) { return true; } } return true; } }; Array.prototype.__ge__ = function (other) { if (this.__class__ == set) { return this.issuperset (other); } else { for (let i = 0; i < this.length; i++) { if (this [i] < other [i]) { return false; } else if (this [i] > other [i]) { return true; } } return true; } }; Array.prototype.__lt__ = function (other) { return ( this.__class__ == set ? this.issubset (other) && !this.issuperset (other) : !this.__ge__ (other) ); }; Array.prototype.__gt__ = function (other) { return ( this.__class__ == set ? this.issuperset (other) && !this.issubset (other) : !this.__le__ (other) ); }; export function bytearray (bytable, encoding) { if (bytable == undefined) { return new Uint8Array (0); } else { let aType = py_typeof (bytable); if (aType == int) { return new Uint8Array (bytable); } else if (aType == str) { let aBytes = new Uint8Array (len (bytable)); for (let i = 0; i < len (bytable); i++) { aBytes [i] = bytable.charCodeAt (i); } return aBytes; } else if (aType == list || aType == tuple) { return new Uint8Array (bytable); } else { throw py_TypeError; } } } export var bytes = bytearray; Uint8Array.prototype.__add__ = function (aBytes) { let result = new Uint8Array (this.length + aBytes.length); result.set (this); result.set (aBytes, this.length); return result; }; Uint8Array.prototype.__mul__ = function (scalar) { let result = new Uint8Array (scalar * this.length); for (let i = 0; i < scalar; i++) { result.set (this, i * this.length); } return result; }; Uint8Array.prototype.__rmul__ = Uint8Array.prototype.__mul__; export function str (stringable) { if (typeof stringable === 'number') return stringable.toString(); else { try { return stringable.__str__ (); } catch (exception) { try { return repr (stringable); } catch (exception) { return String (stringable); } } } }; String.prototype.__class__ = str; str.__name__ = 'str'; str.__bases__ = [object]; String.prototype.__iter__ = function () {new __PyIterator__ (this);}; String.prototype.__repr__ = function () { return (this.indexOf ('\'') == -1 ? '\'' + this + '\'' : '"' + this + '"') .py_replace ('\t', '\\t') .py_replace ('\n', '\\n'); }; String.prototype.__str__ = function () { return this; }; String.prototype.capitalize = function () { return this.charAt (0).toUpperCase () + this.slice (1); }; String.prototype.endswith = function (suffix) { if (suffix instanceof Array) { for (var i=0;i> b; } }; export function __or__ (a, b) { if (typeof a == 'object' && '__or__' in a) { return a.__or__ (b); } else if (typeof b == 'object' && '__ror__' in b) { return b.__ror__ (a); } else { return a | b; } }; export function __xor__ (a, b) { if (typeof a == 'object' && '__xor__' in a) { return a.__xor__ (b); } else if (typeof b == 'object' && '__rxor__' in b) { return b.__rxor__ (a); } else { return a ^ b; } }; export function __and__ (a, b) { if (typeof a == 'object' && '__and__' in a) { return a.__and__ (b); } else if (typeof b == 'object' && '__rand__' in b) { return b.__rand__ (a); } else { return a & b; } }; export function __eq__ (a, b) { if (typeof a == 'object' && '__eq__' in a) { return a.__eq__ (b); } else { return a == b; } }; export function __ne__ (a, b) { if (typeof a == 'object' && '__ne__' in a) { return a.__ne__ (b); } else { return a != b } }; export function __lt__ (a, b) { if (typeof a == 'object' && '__lt__' in a) { return a.__lt__ (b); } else { return a < b; } }; export function __le__ (a, b) { if (typeof a == 'object' && '__le__' in a) { return a.__le__ (b); } else { return a <= b; } }; export function __gt__ (a, b) { if (typeof a == 'object' && '__gt__' in a) { return a.__gt__ (b); } else { return a > b; } }; export function __ge__ (a, b) { if (typeof a == 'object' && '__ge__' in a) { return a.__ge__ (b); } else { return a >= b; } }; export function __imatmul__ (a, b) { if ('__imatmul__' in a) { return a.__imatmul__ (b); } else { return a.__matmul__ (b); } }; export function __ipow__ (a, b) { if (typeof a == 'object' && '__pow__' in a) { return a.__ipow__ (b); } else if (typeof a == 'object' && '__ipow__' in a) { return a.__pow__ (b); } else if (typeof b == 'object' && '__rpow__' in b) { return b.__rpow__ (a); } else { return Math.pow (a, b); } }; export function __ijsmod__ (a, b) { if (typeof a == 'object' && '__imod__' in a) { return a.__ismod__ (b); } else if (typeof a == 'object' && '__mod__' in a) { return a.__mod__ (b); } else if (typeof b == 'object' && '__rpow__' in b) { return b.__rmod__ (a); } else { return a % b; } }; export function __imod__ (a, b) { if (typeof a == 'object' && '__imod__' in a) { return a.__imod__ (b); } else if (typeof a == 'object' && '__mod__' in a) { return a.__mod__ (b); } else if (typeof b == 'object' && '__rmod__' in b) { return b.__rmod__ (a); } else { return ((a % b) + b) % b; } }; export function __imul__ (a, b) { if (typeof a == 'object' && '__imul__' in a) { return a.__imul__ (b); } else if (typeof a == 'object' && '__mul__' in a) { return a = a.__mul__ (b); } else if (typeof b == 'object' && '__rmul__' in b) { return a = b.__rmul__ (a); } else if (typeof a == 'string') { return a = a.__mul__ (b); } else if (typeof b == 'string') { return a = b.__rmul__ (a); } else { return a *= b; } }; export function __idiv__ (a, b) { if (typeof a == 'object' && '__idiv__' in a) { return a.__idiv__ (b); } else if (typeof a == 'object' && '__div__' in a) { return a = a.__div__ (b); } else if (typeof b == 'object' && '__rdiv__' in b) { return a = b.__rdiv__ (a); } else { return a /= b; } }; export function __iadd__ (a, b) { if (typeof a == 'object' && '__iadd__' in a) { return a.__iadd__ (b); } else if (typeof a == 'object' && '__add__' in a) { return a = a.__add__ (b); } else if (typeof b == 'object' && '__radd__' in b) { return a = b.__radd__ (a); } else { return a += b; } }; export function __isub__ (a, b) { if (typeof a == 'object' && '__isub__' in a) { return a.__isub__ (b); } else if (typeof a == 'object' && '__sub__' in a) { return a = a.__sub__ (b); } else if (typeof b == 'object' && '__rsub__' in b) { return a = b.__rsub__ (a); } else { return a -= b; } }; export function __ilshift__ (a, b) { if (typeof a == 'object' && '__ilshift__' in a) { return a.__ilshift__ (b); } else if (typeof a == 'object' && '__lshift__' in a) { return a = a.__lshift__ (b); } else if (typeof b == 'object' && '__rlshift__' in b) { return a = b.__rlshift__ (a); } else { return a <<= b; } }; export function __irshift__ (a, b) { if (typeof a == 'object' && '__irshift__' in a) { return a.__irshift__ (b); } else if (typeof a == 'object' && '__rshift__' in a) { return a = a.__rshift__ (b); } else if (typeof b == 'object' && '__rrshift__' in b) { return a = b.__rrshift__ (a); } else { return a >>= b; } }; export function __ior__ (a, b) { if (typeof a == 'object' && '__ior__' in a) { return a.__ior__ (b); } else if (typeof a == 'object' && '__or__' in a) { return a = a.__or__ (b); } else if (typeof b == 'object' && '__ror__' in b) { return a = b.__ror__ (a); } else { return a |= b; } }; export function __ixor__ (a, b) { if (typeof a == 'object' && '__ixor__' in a) { return a.__ixor__ (b); } else if (typeof a == 'object' && '__xor__' in a) { return a = a.__xor__ (b); } else if (typeof b == 'object' && '__rxor__' in b) { return a = b.__rxor__ (a); } else { return a ^= b; } }; export function __iand__ (a, b) { if (typeof a == 'object' && '__iand__' in a) { return a.__iand__ (b); } else if (typeof a == 'object' && '__and__' in a) { return a = a.__and__ (b); } else if (typeof b == 'object' && '__rand__' in b) { return a = b.__rand__ (a); } else { return a &= b; } }; export function __getitem__ (container, key) { if (typeof container == 'object' && '__getitem__' in container) { return container.__getitem__ (key); } else if ((typeof container == 'string' || container instanceof Array) && key < 0) { return container [container.length + key]; } else { return container [key]; } }; export function __setitem__ (container, key, value) { if (typeof container == 'object' && '__setitem__' in container) { container.__setitem__ (key, value); } else if ((typeof container == 'string' || container instanceof Array) && key < 0) { container [container.length + key] = value; } else { container [key] = value; } }; export function __getslice__ (container, lower, upper, step) { if (typeof container == 'object' && '__getitem__' in container) { return container.__getitem__ ([lower, upper, step]); } else { return container.__getslice__ (lower, upper, step); } }; export function __setslice__ (container, lower, upper, step, value) { if (typeof container == 'object' && '__setitem__' in container) { container.__setitem__ ([lower, upper, step], value); } else { container.__setslice__ (lower, upper, step, value); } }; export var BaseException = __class__ ('BaseException', [object], { __module__: __name__, }); export var Exception = __class__ ('Exception', [BaseException], { __module__: __name__, get __init__ () {return __get__ (this, function (self) { var kwargs = dict (); if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'self': var self = __allkwargs0__ [__attrib0__]; break; default: kwargs [__attrib0__] = __allkwargs0__ [__attrib0__]; } } delete kwargs.__kwargtrans__; } var args = tuple ([].slice.apply (arguments).slice (1, __ilastarg0__ + 1)); } else { var args = tuple (); } self.__args__ = args; if (kwargs.error != null) { self.stack = kwargs.error.stack; } else if (Error) { self.stack = new Error ().stack; } else { self.stack = 'No stack trace available'; } });}, get __repr__ () {return __get__ (this, function (self) { if (len (self.__args__) > 1) { return '{}{}'.format (self.__class__.__name__, repr (tuple (self.__args__))); } else if (len (self.__args__)) { return '{}({})'.format (self.__class__.__name__, repr (self.__args__ [0])); } else { return '{}()'.format (self.__class__.__name__); } });}, get __str__ () {return __get__ (this, function (self) { if (len (self.__args__) > 1) { return str (tuple (self.__args__)); } else if (len (self.__args__)) { return str (self.__args__ [0]); } else { return ''; } });} }); export var IterableError = __class__ ('IterableError', [Exception], { __module__: __name__, get __init__ () {return __get__ (this, function (self, error) { Exception.__init__ (self, "Can't iterate over non-iterable", __kwargtrans__ ({error: error})); });} }); export var StopIteration = __class__ ('StopIteration', [Exception], { __module__: __name__, get __init__ () {return __get__ (this, function (self, error) { Exception.__init__ (self, 'Iterator exhausted', __kwargtrans__ ({error: error})); });} }); export var ValueError = __class__ ('ValueError', [Exception], { __module__: __name__, get __init__ () {return __get__ (this, function (self, message, error) { Exception.__init__ (self, message, __kwargtrans__ ({error: error})); });} }); export var KeyError = __class__ ('KeyError', [Exception], { __module__: __name__, get __init__ () {return __get__ (this, function (self, message, error) { Exception.__init__ (self, message, __kwargtrans__ ({error: error})); });} }); export var AssertionError = __class__ ('AssertionError', [Exception], { __module__: __name__, get __init__ () {return __get__ (this, function (self, message, error) { if (message) { Exception.__init__ (self, message, __kwargtrans__ ({error: error})); } else { Exception.__init__ (self, __kwargtrans__ ({error: error})); } });} }); export var NotImplementedError = __class__ ('NotImplementedError', [Exception], { __module__: __name__, get __init__ () {return __get__ (this, function (self, message, error) { Exception.__init__ (self, message, __kwargtrans__ ({error: error})); });} }); export var IndexError = __class__ ('IndexError', [Exception], { __module__: __name__, get __init__ () {return __get__ (this, function (self, message, error) { Exception.__init__ (self, message, __kwargtrans__ ({error: error})); });} }); export var AttributeError = __class__ ('AttributeError', [Exception], { __module__: __name__, get __init__ () {return __get__ (this, function (self, message, error) { Exception.__init__ (self, message, __kwargtrans__ ({error: error})); });} }); export var py_TypeError = __class__ ('py_TypeError', [Exception], { __module__: __name__, get __init__ () {return __get__ (this, function (self, message, error) { Exception.__init__ (self, message, __kwargtrans__ ({error: error})); });} }); export var Warning = __class__ ('Warning', [Exception], { __module__: __name__, }); export var UserWarning = __class__ ('UserWarning', [Warning], { __module__: __name__, }); export var DeprecationWarning = __class__ ('DeprecationWarning', [Warning], { __module__: __name__, }); export var RuntimeWarning = __class__ ('RuntimeWarning', [Warning], { __module__: __name__, }); export var __sort__ = function (iterable, key, reverse) { if (typeof key == 'undefined' || (key != null && key.hasOwnProperty ("__kwargtrans__"))) {; var key = null; }; if (typeof reverse == 'undefined' || (reverse != null && reverse.hasOwnProperty ("__kwargtrans__"))) {; var reverse = false; }; if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'iterable': var iterable = __allkwargs0__ [__attrib0__]; break; case 'key': var key = __allkwargs0__ [__attrib0__]; break; case 'reverse': var reverse = __allkwargs0__ [__attrib0__]; break; } } } } else { } if (key) { iterable.sort ((function __lambda__ (a, b) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'a': var a = __allkwargs0__ [__attrib0__]; break; case 'b': var b = __allkwargs0__ [__attrib0__]; break; } } } } else { } return (key (a) > key (b) ? 1 : -(1)); })); } else { iterable.sort (); } if (reverse) { iterable.reverse (); } }; export var sorted = function (iterable, key, reverse) { if (typeof key == 'undefined' || (key != null && key.hasOwnProperty ("__kwargtrans__"))) {; var key = null; }; if (typeof reverse == 'undefined' || (reverse != null && reverse.hasOwnProperty ("__kwargtrans__"))) {; var reverse = false; }; if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'iterable': var iterable = __allkwargs0__ [__attrib0__]; break; case 'key': var key = __allkwargs0__ [__attrib0__]; break; case 'reverse': var reverse = __allkwargs0__ [__attrib0__]; break; } } } } else { } if (py_typeof (iterable) == dict) { var result = copy (iterable.py_keys ()); } else { var result = copy (iterable); } __sort__ (result, key, reverse); return result; }; export var map = function (func, iterable) { return (function () { var __accu0__ = []; for (var item of iterable) { __accu0__.append (func (item)); } return __accu0__; }) (); }; export var filter = function (func, iterable) { if (func == null) { var func = bool; } return (function () { var __accu0__ = []; for (var item of iterable) { if (func (item)) { __accu0__.append (item); } } return __accu0__; }) (); }; export var divmod = function (n, d) { return tuple ([Math.floor (n / d), __mod__ (n, d)]); }; export var __Terminal__ = __class__ ('__Terminal__', [object], { __module__: __name__, get __init__ () {return __get__ (this, function (self) { self.buffer = ''; try { self.element = document.getElementById ('__terminal__'); } catch (__except0__) { self.element = null; } if (self.element) { self.element.style.overflowX = 'auto'; self.element.style.boxSizing = 'border-box'; self.element.style.padding = '5px'; self.element.innerHTML = '_'; } });}, get print () {return __get__ (this, function (self) { var sep = ' '; var end = '\n'; if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'self': var self = __allkwargs0__ [__attrib0__]; break; case 'sep': var sep = __allkwargs0__ [__attrib0__]; break; case 'end': var end = __allkwargs0__ [__attrib0__]; break; } } } var args = tuple ([].slice.apply (arguments).slice (1, __ilastarg0__ + 1)); } else { var args = tuple (); } self.buffer = '{}{}{}'.format (self.buffer, sep.join ((function () { var __accu0__ = []; for (var arg of args) { __accu0__.append (str (arg)); } return __accu0__; }) ()), end).__getslice__ (-(4096), null, 1); if (self.element) { self.element.innerHTML = self.buffer.py_replace ('\n', '
').py_replace (' ', ' '); self.element.scrollTop = self.element.scrollHeight; } else { console.log (sep.join ((function () { var __accu0__ = []; for (var arg of args) { __accu0__.append (str (arg)); } return __accu0__; }) ())); } });}, get input () {return __get__ (this, function (self, question) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'self': var self = __allkwargs0__ [__attrib0__]; break; case 'question': var question = __allkwargs0__ [__attrib0__]; break; } } } } else { } self.print ('{}'.format (question), __kwargtrans__ ({end: ''})); var answer = window.prompt ('\n'.join (self.buffer.py_split ('\n').__getslice__ (-(8), null, 1))); self.print (answer); return answer; });} }); export var __terminal__ = __Terminal__ (); export var print = __terminal__.print; export var input = __terminal__.input; //# sourceMappingURL=org.transcrypt.__runtime__.map ================================================ FILE: docs/examples/transcrypt/sketch_003/target/org.transcrypt.__runtime__.py ================================================ # Transcrypt runtime module #__pragma__ ('js', 'export var __envir__ = {{}};\n{}', __include__ ('org/transcrypt/__envir__.js')) #__pragma__ ('js', '{}', __include__ ('org/transcrypt/__core__.js')) #__pragma__ ('js', '{}', __include__ ('org/transcrypt/__builtin__.js')) #__pragma__ ('skip') copy = Math = __typeof__ = __repr__ = document = console = window = 0 #__pragma__ ('noskip') #__pragma__ ('notconv') # !!! tconv gives a problem with __terminal__, needs investigation #__pragma__ ('nokwargs') #__pragma__ ('noalias', 'sort') class BaseException: pass class Exception (BaseException): #__pragma__ ('kwargs') def __init__ (self, *args, **kwargs): self.__args__ = args if kwargs.error != None: self.stack = kwargs.error.stack # Integrate with JavaScript Error object elif Error: self.stack = (__new__(Error())).stack # Create our own stack if we aren't given one else: self.stack = 'No stack trace available' #__pragma__ ('nokwargs') def __repr__ (self): if len (self.__args__) > 1: return '{}{}'.format (self.__class__.__name__, repr (tuple (self.__args__))) elif len (self.__args__): return '{}({})'.format (self.__class__.__name__, repr (self.__args__ [0])) else: return '{}()'.format (self.__class__.__name__) def __str__ (self): if len (self.__args__) > 1: return str (tuple (self.__args__)) elif len (self.__args__): return str (self.__args__ [0]) else: return '' class IterableError (Exception): def __init__ (self, error): Exception.__init__ (self, 'Can\'t iterate over non-iterable', error = error) class StopIteration (Exception): def __init__ (self, error): Exception.__init__ (self, 'Iterator exhausted', error = error) class ValueError (Exception): def __init__ (self, message, error): Exception.__init__ (self, message, error = error) class KeyError (Exception): def __init__ (self, message, error): Exception.__init__ (self, message, error = error) class AssertionError (Exception): def __init__ (self, message, error): if message: Exception.__init__ (self, message, error = error) else: Exception.__init__ (self, error = error) class NotImplementedError (Exception): def __init__(self, message, error): Exception.__init__(self, message, error = error) class IndexError (Exception): def __init__(self, message, error): Exception.__init__(self, message, error = error) class AttributeError (Exception): def __init__(self, message, error): Exception.__init__(self, message, error = error) class TypeError (Exception): def __init__(self, message, error): Exception.__init__(self, message, error = error) # Warnings Exceptions # N.B. This is a limited subset of the warnings defined in # the cpython implementation to keep things small for now. class Warning (Exception): ''' Warning Base Class ''' pass class UserWarning (Warning): pass class DeprecationWarning (Warning): pass class RuntimeWarning (Warning): pass #__pragma__ ('kwargs') def __sort__ (iterable, key = None, reverse = False): # Used by py_sort, can deal with kwargs if key: iterable.sort (lambda a, b: 1 if key (a) > key (b) else -1) # JavaScript sort, case '==' is irrelevant for sorting else: iterable.sort () # JavaScript sort if reverse: iterable.reverse () def sorted (iterable, key = None, reverse = False): if type (iterable) == dict: result = copy (iterable.keys ()) else: result = copy (iterable) __sort__ (result, key, reverse) return result #__pragma__ ('nokwargs') def map (func, iterable): return [func (item) for item in iterable] def filter (func, iterable): if func == None: func = bool return [item for item in iterable if func (item)] def divmod (n, d): return n // d, n % d #__pragma__ ('ifdef', '__complex__') class complex: def __init__ (self, real, imag = None): if imag == None: if type (real) == complex: self.real = real.real self.imag = real.imag else: self.real = real self.imag = 0 else: self.real = real self.imag = imag def __neg__ (self): return complex (-self.real, -self.imag) def __exp__ (self): modulus = Math.exp (self.real) return complex (modulus * Math.cos (self.imag), modulus * Math.sin (self.imag)) def __log__ (self): return complex (Math.log (Math.sqrt (self.real * self.real + self.imag * self.imag)), Math.atan2 (self.imag, self.real)) def __pow__ (self, other): # a ** b = exp (b log a) return (self.__log__ () .__mul__ (other)) .__exp__ () def __rpow__ (self, real): # real ** comp -> comp.__rpow__ (real) return self.__mul__ (Math.log (real)) .__exp__ () def __mul__ (self, other): if __typeof__ (other) is 'number': return complex (self.real * other, self.imag * other) else: return complex (self.real * other.real - self.imag * other.imag, self.real * other.imag + self.imag * other.real) def __rmul__ (self, real): # real + comp -> comp.__rmul__ (real) return complex (self.real * real, self.imag * real) def __div__ (self, other): if __typeof__ (other) is 'number': return complex (self.real / other, self.imag / other) else: denom = other.real * other.real + other.imag * other.imag return complex ( (self.real * other.real + self.imag * other.imag) / denom, (self.imag * other.real - self.real * other.imag) / denom ) def __rdiv__ (self, real): # real / comp -> comp.__rdiv__ (real) denom = self.real * self.real return complex ( (real * self.real) / denom, (real * self.imag) / denom ) def __add__ (self, other): if __typeof__ (other) is 'number': return complex (self.real + other, self.imag) else: # Assume other is complex return complex (self.real + other.real, self.imag + other.imag) def __radd__ (self, real): # real + comp -> comp.__radd__ (real) return complex (self.real + real, self.imag) def __sub__ (self, other): if __typeof__ (other) is 'number': return complex (self.real - other, self.imag) else: return complex (self.real - other.real, self.imag - other.imag) def __rsub__ (self, real): # real - comp -> comp.__rsub__ (real) return complex (real - self.real, -self.imag) def __repr__ (self): return '({}{}{}j)'.format (self.real, '+' if self.imag >= 0 else '', self.imag) def __str__ (self): return __repr__ (self) [1 : -1] def __eq__ (self, other): if __typeof__ (other) is 'number': return self.real == other else: return self.real == other.real and self.imag == other.imag def __ne__ (self, other): if __typeof__ (other) is 'number': return self.real != other else: return self.real != other.real or self.imag != other.imag def conjugate (self): return complex (self.real, -self.imag) def __conj__ (aNumber): if isinstance (aNumber, complex): return complex (aNumber.real, -aNumber.imag) else: return complex (aNumber, 0) #__pragma__ ('endif') class __Terminal__: ''' Printing to either the console or to html happens async, but is blocked by calling window.prompt. So while all input and print statements are encountered in normal order, the print's exit immediately without yet having actually printed This means the next input takes control, blocking actual printing and so on indefinitely The effect is that everything's only printed after all inputs are done To prevent that, what's needed is to only execute the next window.prompt after actual printing has been done Since we've no way to find out when that is, a timeout is used. ''' def __init__ (self): self.buffer = '' try: self.element = document.getElementById ('__terminal__') except: self.element = None if self.element: self.element.style.overflowX = 'auto' self.element.style.boxSizing = 'border-box' self.element.style.padding = '5px' self.element.innerHTML = '_' #__pragma__ ('kwargs') def print (self, *args, sep = ' ', end = '\n'): self.buffer = '{}{}{}'.format (self.buffer, sep.join ([str (arg) for arg in args]), end) [-4096 : ] if self.element: self.element.innerHTML = self.buffer.replace ('\n', '
') .replace (' ', ' ') self.element.scrollTop = self.element.scrollHeight else: console.log (sep.join ([str (arg) for arg in args])) def input (self, question): self.print ('{}'.format (question), end = '') answer = window.prompt ('\n'.join (self.buffer.split ('\n') [-8:])) self.print (answer) return answer #__pragma__ ('nokwargs') __terminal__ = __Terminal__ () print = __terminal__.print input = __terminal__.input ================================================ FILE: docs/examples/transcrypt/sketch_003/target/pyp5js.js ================================================ // Transcrypt'ed from Python, 2021-11-02 13:06:11 import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, all, any, assert, bool, bytearray, bytes, callable, chr, deepcopy, delattr, dict, dir, divmod, enumerate, getattr, hasattr, isinstance, issubclass, len, list, object, ord, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, setattr, sorted, sum, tuple, zip} from './org.transcrypt.__runtime__.js'; import {PythonFunctions} from './python_functions.js'; var __name__ = 'pyp5js'; export var _P5_INSTANCE = null; export var _CTX_MIDDLE = null; export var _DEFAULT_FILL = null; export var _DEFAULT_LEADMULT = null; export var _DEFAULT_STROKE = null; export var _DEFAULT_TEXT_FILL = null; export var ADD = null; export var ALT = null; export var ARROW = null; export var AUDIO = null; export var AUTO = null; export var AXES = null; export var BACKSPACE = null; export var BASELINE = null; export var BEVEL = null; export var BEZIER = null; export var BLEND = null; export var BLUR = null; export var BOLD = null; export var BOLDITALIC = null; export var BOTTOM = null; export var BURN = null; export var CENTER = null; export var CHORD = null; export var CLAMP = null; export var CLOSE = null; export var CONTROL = null; export var CORNER = null; export var CORNERS = null; export var CROSS = null; export var CURVE = null; export var DARKEST = null; export var DEG_TO_RAD = null; export var DEGREES = null; export var DELETE = null; export var DIFFERENCE = null; export var DILATE = null; export var DODGE = null; export var DOWN_ARROW = null; export var ENTER = null; export var ERODE = null; export var ESCAPE = null; export var EXCLUSION = null; export var FILL = null; export var GRAY = null; export var GRID = null; export var HALF_PI = null; export var HAND = null; export var HARD_LIGHT = null; export var HSB = null; export var HSL = null; export var IMAGE = null; export var IMMEDIATE = null; export var INVERT = null; export var ITALIC = null; export var LANDSCAPE = null; export var LEFT = null; export var LEFT_ARROW = null; export var LIGHTEST = null; export var LINE_LOOP = null; export var LINE_STRIP = null; export var LINEAR = null; export var LINES = null; export var MIRROR = null; export var MITER = null; export var MOVE = null; export var MULTIPLY = null; export var NEAREST = null; export var NORMAL = null; export var OPAQUE = null; export var OPEN = null; export var OPTION = null; export var OVERLAY = null; export var PI = null; export var PIE = null; export var POINTS = null; export var PORTRAIT = null; export var POSTERIZE = null; export var PROJECT = null; export var QUAD_STRIP = null; export var QUADRATIC = null; export var QUADS = null; export var QUARTER_PI = null; export var RAD_TO_DEG = null; export var RADIANS = null; export var RADIUS = null; export var REPEAT = null; export var REPLACE = null; export var RETURN = null; export var RGB = null; export var RIGHT = null; export var RIGHT_ARROW = null; export var ROUND = null; export var SCREEN = null; export var SHIFT = null; export var SOFT_LIGHT = null; export var SQUARE = null; export var STROKE = null; export var SUBTRACT = null; export var TAB = null; export var TAU = null; export var TEXT = null; export var TEXTURE = null; export var THRESHOLD = null; export var TOP = null; export var TRIANGLE_FAN = null; export var TRIANGLE_STRIP = null; export var TRIANGLES = null; export var TWO_PI = null; export var UP_ARROW = null; export var VIDEO = null; export var WAIT = null; export var WEBGL = null; export var P2D = null; var PI = null; export var frameCount = null; export var focused = null; export var displayWidth = null; export var displayHeight = null; export var windowWidth = null; export var windowHeight = null; export var width = null; export var height = null; export var disableFriendlyErrors = null; export var deviceOrientation = null; export var accelerationX = null; export var accelerationY = null; export var accelerationZ = null; export var pAccelerationX = null; export var pAccelerationY = null; export var pAccelerationZ = null; export var rotationX = null; export var rotationY = null; export var rotationZ = null; export var pRotationX = null; export var pRotationY = null; export var pRotationZ = null; export var turnAxis = null; export var keyIsPressed = null; export var key = null; export var keyCode = null; export var mouseX = null; export var mouseY = null; export var pmouseX = null; export var pmouseY = null; export var winMouseX = null; export var winMouseY = null; export var pwinMouseX = null; export var pwinMouseY = null; export var mouseButton = null; export var mouseIsPressed = null; export var touches = null; export var pixels = null; export var alpha = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.alpha (...args); }; export var blue = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.blue (...args); }; export var brightness = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.brightness (...args); }; export var color = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.color (...args); }; export var green = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.green (...args); }; export var hue = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.hue (...args); }; export var lerpColor = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.lerpColor (...args); }; export var lightness = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.lightness (...args); }; export var red = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.red (...args); }; export var saturation = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.saturation (...args); }; export var background = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.background (...args); }; export var py_clear = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } var p5_clear = _P5_INSTANCE.clear (...args); return p5_clear; }; export var erase = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.erase (...args); }; export var noErase = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noErase (...args); }; export var colorMode = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.colorMode (...args); }; export var fill = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.fill (...args); }; export var noFill = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noFill (...args); }; export var noStroke = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noStroke (...args); }; export var stroke = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.stroke (...args); }; export var arc = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.arc (...args); }; export var ellipse = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.ellipse (...args); }; export var circle = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.circle (...args); }; export var line = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.line (...args); }; export var point = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.point (...args); }; export var quad = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.quad (...args); }; export var rect = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.rect (...args); }; export var square = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.square (...args); }; export var triangle = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.triangle (...args); }; export var plane = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.plane (...args); }; export var box = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.box (...args); }; export var sphere = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.sphere (...args); }; export var cylinder = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.cylinder (...args); }; export var cone = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.cone (...args); }; export var ellipsoid = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.ellipsoid (...args); }; export var torus = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.torus (...args); }; export var loadModel = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.loadModel (...args); }; export var model = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.model (...args); }; export var ellipseMode = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.ellipseMode (...args); }; export var noSmooth = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noSmooth (...args); }; export var rectMode = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.rectMode (...args); }; export var smooth = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.smooth (...args); }; export var strokeCap = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.strokeCap (...args); }; export var strokeJoin = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.strokeJoin (...args); }; export var strokeWeight = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.strokeWeight (...args); }; export var bezier = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.bezier (...args); }; export var bezierDetail = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.bezierDetail (...args); }; export var bezierPoint = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.bezierPoint (...args); }; export var bezierTangent = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.bezierTangent (...args); }; export var curve = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.curve (...args); }; export var curveDetail = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.curveDetail (...args); }; export var curveTightness = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.curveTightness (...args); }; export var curvePoint = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.curvePoint (...args); }; export var curveTangent = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.curveTangent (...args); }; export var beginContour = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.beginContour (...args); }; export var beginShape = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.beginShape (...args); }; export var bezierVertex = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.bezierVertex (...args); }; export var curveVertex = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.curveVertex (...args); }; export var endContour = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.endContour (...args); }; export var endShape = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.endShape (...args); }; export var quadraticVertex = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.quadraticVertex (...args); }; export var vertex = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.vertex (...args); }; export var cursor = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.cursor (...args); }; export var frameRate = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.frameRate (...args); }; export var noCursor = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noCursor (...args); }; export var fullscreen = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.fullscreen (...args); }; export var pixelDensity = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.pixelDensity (...args); }; export var displayDensity = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.displayDensity (...args); }; export var getURL = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.getURL (...args); }; export var getURLPath = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.getURLPath (...args); }; export var getURLParams = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.getURLParams (...args); }; export var preload = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.preload (...args); }; export var setup = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.setup (...args); }; export var draw = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.draw (...args); }; export var remove = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.remove (...args); }; export var noLoop = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noLoop (...args); }; export var loop = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.loop (...args); }; export var push = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.push (...args); }; export var redraw = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.redraw (...args); }; export var resizeCanvas = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.resizeCanvas (...args); }; export var noCanvas = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noCanvas (...args); }; export var createGraphics = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createGraphics (...args); }; export var blendMode = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.blendMode (...args); }; export var setAttributes = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.setAttributes (...args); }; export var applyMatrix = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.applyMatrix (...args); }; export var resetMatrix = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.resetMatrix (...args); }; export var rotate = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.rotate (...args); }; export var rotateX = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.rotateX (...args); }; export var rotateY = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.rotateY (...args); }; export var rotateZ = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.rotateZ (...args); }; export var scale = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.scale (...args); }; export var shearX = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.shearX (...args); }; export var shearY = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.shearY (...args); }; export var translate = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.translate (...args); }; export var createStringDict = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createStringDict (...args); }; export var createNumberDict = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createNumberDict (...args); }; export var append = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.append (...args); }; export var arrayCopy = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.arrayCopy (...args); }; export var concat = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.concat (...args); }; export var reverse = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.reverse (...args); }; export var shorten = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.shorten (...args); }; export var shuffle = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.shuffle (...args); }; export var py_sort = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.py_sort (...args); }; export var splice = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.splice (...args); }; export var subset = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.subset (...args); }; export var float = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.float (...args); }; export var int = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.int (...args); }; export var str = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.str (...args); }; export var boolean = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.boolean (...args); }; export var byte = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.byte (...args); }; export var char = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.char (...args); }; export var unchar = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.unchar (...args); }; export var hex = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.hex (...args); }; export var unhex = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.unhex (...args); }; export var join = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.join (...args); }; export var match = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.match (...args); }; export var matchAll = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.matchAll (...args); }; export var nf = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.nf (...args); }; export var nfc = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.nfc (...args); }; export var nfp = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.nfp (...args); }; export var nfs = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.nfs (...args); }; export var py_split = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.py_split (...args); }; export var splitTokens = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.splitTokens (...args); }; export var trim = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.trim (...args); }; export var setMoveThreshold = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.setMoveThreshold (...args); }; export var setShakeThreshold = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.setShakeThreshold (...args); }; export var keyIsDown = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.keyIsDown (...args); }; export var createImage = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createImage (...args); }; export var saveCanvas = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.saveCanvas (...args); }; export var saveFrames = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.saveFrames (...args); }; export var image_proxy = function (img) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'img': var img = __allkwargs0__ [__attrib0__]; break; } } } } else { } var _set = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } var value = img.set (...args); return value; }; var _get = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } var value = img.get (...args); return value; }; img.py_set = _set; img.py_get = _get; return img; }; export var loadImage = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } var imageObj = _P5_INSTANCE.loadImage (...args); return image_proxy (imageObj); }; export var image = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.image (...args); }; export var tint = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.tint (...args); }; export var noTint = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noTint (...args); }; export var imageMode = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.imageMode (...args); }; export var blend = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.blend (...args); }; export var copy = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.copy (...args); }; export var filter = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } if (len (args) > 1 && (args [0] === null || callable (args [0]))) { return PythonFunctions.filter (...args); } else { return _P5_INSTANCE.filter (...args); } }; export var py_get = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } var p5_get = _P5_INSTANCE.get (...args); return p5_get; }; export var loadPixels = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.loadPixels (...args); }; export var py_set = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } if (len (args) <= 1) { return PythonFunctions.py_set (...args); } else { return _P5_INSTANCE.py_set (...args); } }; export var updatePixels = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.updatePixels (...args); }; export var loadJSON = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.loadJSON (...args); }; export var loadStrings = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.loadStrings (...args); }; export var loadTable = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.loadTable (...args); }; export var loadXML = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.loadXML (...args); }; export var loadBytes = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.loadBytes (...args); }; export var httpGet = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.httpGet (...args); }; export var httpPost = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.httpPost (...args); }; export var httpDo = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.httpDo (...args); }; export var createWriter = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createWriter (...args); }; export var save = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.save (...args); }; export var saveJSON = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.saveJSON (...args); }; export var saveStrings = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.saveStrings (...args); }; export var saveTable = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.saveTable (...args); }; export var day = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.day (...args); }; export var hour = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.hour (...args); }; export var minute = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.minute (...args); }; export var millis = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.millis (...args); }; export var month = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.month (...args); }; export var second = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.second (...args); }; export var year = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.year (...args); }; export var createVector = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createVector (...args); }; export var abs = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.abs (...args); }; export var ceil = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.ceil (...args); }; export var constrain = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.constrain (...args); }; export var dist = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.dist (...args); }; export var exp = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.exp (...args); }; export var floor = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.floor (...args); }; export var lerp = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.lerp (...args); }; export var log = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.log (...args); }; export var mag = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.mag (...args); }; export var map = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } if (len (args) > 1 && callable (args [0])) { return PythonFunctions.map (...args); } else { return _P5_INSTANCE.map (...args); } }; export var max = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.max (...args); }; export var min = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.min (...args); }; export var norm = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.norm (...args); }; export var pow = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.pow (...args); }; export var round = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.round (...args); }; export var sq = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.sq (...args); }; export var sqrt = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.sqrt (...args); }; export var noise = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noise (...args); }; export var noiseDetail = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noiseDetail (...args); }; export var noiseSeed = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noiseSeed (...args); }; export var randomSeed = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.randomSeed (...args); }; export var random = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.random (...args); }; export var randomGaussian = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.randomGaussian (...args); }; export var acos = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.acos (...args); }; export var asin = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.asin (...args); }; export var atan = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.atan (...args); }; export var atan2 = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.atan2 (...args); }; export var cos = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.cos (...args); }; export var sin = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.sin (...args); }; export var tan = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.tan (...args); }; export var degrees = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.degrees (...args); }; export var radians = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.radians (...args); }; export var angleMode = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.angleMode (...args); }; export var textAlign = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.textAlign (...args); }; export var textLeading = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.textLeading (...args); }; export var textSize = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.textSize (...args); }; export var textStyle = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.textStyle (...args); }; export var textWidth = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.textWidth (...args); }; export var textAscent = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.textAscent (...args); }; export var textDescent = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.textDescent (...args); }; export var loadFont = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.loadFont (...args); }; export var text = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.text (...args); }; export var textFont = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.textFont (...args); }; export var orbitControl = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.orbitControl (...args); }; export var debugMode = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.debugMode (...args); }; export var noDebugMode = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noDebugMode (...args); }; export var ambientLight = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.ambientLight (...args); }; export var directionalLight = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.directionalLight (...args); }; export var pointLight = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.pointLight (...args); }; export var lights = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.lights (...args); }; export var loadShader = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.loadShader (...args); }; export var createShader = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createShader (...args); }; export var shader = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.shader (...args); }; export var resetShader = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.resetShader (...args); }; export var normalMaterial = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.normalMaterial (...args); }; export var texture = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.texture (...args); }; export var textureMode = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.textureMode (...args); }; export var textureWrap = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.textureWrap (...args); }; export var ambientMaterial = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.ambientMaterial (...args); }; export var specularMaterial = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.specularMaterial (...args); }; export var shininess = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.shininess (...args); }; export var camera = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.camera (...args); }; export var perspective = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.perspective (...args); }; export var ortho = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.ortho (...args); }; export var createCamera = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createCamera (...args); }; export var setCamera = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.setCamera (...args); }; export var select = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.select (...args); }; export var selectAll = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.selectAll (...args); }; export var removeElements = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.removeElements (...args); }; export var changed = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.changed (...args); }; export var input = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.input (...args); }; export var createDiv = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createDiv (...args); }; export var createP = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createP (...args); }; export var createSpan = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createSpan (...args); }; export var createImg = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createImg (...args); }; export var createA = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createA (...args); }; export var createSlider = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createSlider (...args); }; export var createButton = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createButton (...args); }; export var createCheckbox = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createCheckbox (...args); }; export var createSelect = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createSelect (...args); }; export var createRadio = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createRadio (...args); }; export var createColorPicker = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createColorPicker (...args); }; export var createInput = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createInput (...args); }; export var createFileInput = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createFileInput (...args); }; export var createVideo = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createVideo (...args); }; export var createAudio = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createAudio (...args); }; export var createCapture = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createCapture (...args); }; export var createElement = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createElement (...args); }; export var createCanvas = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } var canvas = _P5_INSTANCE.createCanvas (...args); width = _P5_INSTANCE.width; height = _P5_INSTANCE.height; return canvas; }; export var py_pop = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } var p5_pop = _P5_INSTANCE.pop (...args); return p5_pop; }; export var size = createCanvas; export var popMatrix = py_pop; export var popStyle = py_pop; export var pushMatrix = push; export var pushStyle = push; export var PVector = function (x, y, z) { if (typeof x == 'undefined' || (x != null && x.hasOwnProperty ("__kwargtrans__"))) {; var x = 0; }; if (typeof y == 'undefined' || (y != null && y.hasOwnProperty ("__kwargtrans__"))) {; var y = 0; }; if (typeof z == 'undefined' || (z != null && z.hasOwnProperty ("__kwargtrans__"))) {; var z = 0; }; if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'x': var x = __allkwargs0__ [__attrib0__]; break; case 'y': var y = __allkwargs0__ [__attrib0__]; break; case 'z': var z = __allkwargs0__ [__attrib0__]; break; } } } } else { } return _P5_INSTANCE.createVector (x, y, z); }; setattr (PVector, 'dist', p5.Vector.dist); setattr (PVector, 'add', p5.Vector.add); setattr (PVector, 'sub', p5.Vector.sub); setattr (PVector, 'mult', p5.Vector.mult); setattr (PVector, 'div', p5.Vector.div); setattr (PVector, 'dot', p5.Vector.dot); setattr (PVector, 'cross', p5.Vector.cross); setattr (PVector, 'lerp', p5.Vector.lerp); setattr (PVector, 'random2D', p5.Vector.random2D); setattr (PVector, 'random3D', p5.Vector.random3D); setattr (PVector, 'angleBetween', p5.Vector.angleBetween); setattr (PVector, 'fromAngle', p5.Vector.fromAngle); setattr (PVector, 'fromAngles', p5.Vector.fromAngles); setattr (PVector, 'equals', p5.Vector.equals); export var pre_draw = function (p5_instance, draw_func) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'p5_instance': var p5_instance = __allkwargs0__ [__attrib0__]; break; case 'draw_func': var draw_func = __allkwargs0__ [__attrib0__]; break; } } } } else { } _CTX_MIDDLE = p5_instance._CTX_MIDDLE; _DEFAULT_FILL = p5_instance._DEFAULT_FILL; _DEFAULT_LEADMULT = p5_instance._DEFAULT_LEADMULT; _DEFAULT_STROKE = p5_instance._DEFAULT_STROKE; _DEFAULT_TEXT_FILL = p5_instance._DEFAULT_TEXT_FILL; ADD = p5_instance.ADD; ALT = p5_instance.ALT; ARROW = p5_instance.ARROW; AUDIO = p5_instance.AUDIO; AUTO = p5_instance.AUTO; AXES = p5_instance.AXES; BACKSPACE = p5_instance.BACKSPACE; BASELINE = p5_instance.BASELINE; BEVEL = p5_instance.BEVEL; BEZIER = p5_instance.BEZIER; BLEND = p5_instance.BLEND; BLUR = p5_instance.BLUR; BOLD = p5_instance.BOLD; BOLDITALIC = p5_instance.BOLDITALIC; BOTTOM = p5_instance.BOTTOM; BURN = p5_instance.BURN; CENTER = p5_instance.CENTER; CHORD = p5_instance.CHORD; CLAMP = p5_instance.CLAMP; CLOSE = p5_instance.CLOSE; CONTROL = p5_instance.CONTROL; CORNER = p5_instance.CORNER; CORNERS = p5_instance.CORNERS; CROSS = p5_instance.CROSS; CURVE = p5_instance.CURVE; DARKEST = p5_instance.DARKEST; DEG_TO_RAD = p5_instance.DEG_TO_RAD; DEGREES = p5_instance.DEGREES; DELETE = p5_instance.DELETE; DIFFERENCE = p5_instance.DIFFERENCE; DILATE = p5_instance.DILATE; DODGE = p5_instance.DODGE; DOWN_ARROW = p5_instance.DOWN_ARROW; ENTER = p5_instance.ENTER; ERODE = p5_instance.ERODE; ESCAPE = p5_instance.ESCAPE; EXCLUSION = p5_instance.EXCLUSION; FILL = p5_instance.FILL; GRAY = p5_instance.GRAY; GRID = p5_instance.GRID; HALF_PI = p5_instance.HALF_PI; HAND = p5_instance.HAND; HARD_LIGHT = p5_instance.HARD_LIGHT; HSB = p5_instance.HSB; HSL = p5_instance.HSL; IMAGE = p5_instance.IMAGE; IMMEDIATE = p5_instance.IMMEDIATE; INVERT = p5_instance.INVERT; ITALIC = p5_instance.ITALIC; LANDSCAPE = p5_instance.LANDSCAPE; LEFT = p5_instance.LEFT; LEFT_ARROW = p5_instance.LEFT_ARROW; LIGHTEST = p5_instance.LIGHTEST; LINE_LOOP = p5_instance.LINE_LOOP; LINE_STRIP = p5_instance.LINE_STRIP; LINEAR = p5_instance.LINEAR; LINES = p5_instance.LINES; MIRROR = p5_instance.MIRROR; MITER = p5_instance.MITER; MOVE = p5_instance.MOVE; MULTIPLY = p5_instance.MULTIPLY; NEAREST = p5_instance.NEAREST; NORMAL = p5_instance.NORMAL; OPAQUE = p5_instance.OPAQUE; OPEN = p5_instance.OPEN; OPTION = p5_instance.OPTION; OVERLAY = p5_instance.OVERLAY; P2D = p5_instance.P2D; var P3D = p5_instance.WEBGL; PI = p5_instance.PI; PIE = p5_instance.PIE; POINTS = p5_instance.POINTS; PORTRAIT = p5_instance.PORTRAIT; POSTERIZE = p5_instance.POSTERIZE; PROJECT = p5_instance.PROJECT; QUAD_STRIP = p5_instance.QUAD_STRIP; QUADRATIC = p5_instance.QUADRATIC; QUADS = p5_instance.QUADS; QUARTER_PI = p5_instance.QUARTER_PI; RAD_TO_DEG = p5_instance.RAD_TO_DEG; RADIANS = p5_instance.RADIANS; RADIUS = p5_instance.RADIUS; REPEAT = p5_instance.REPEAT; REPLACE = p5_instance.REPLACE; RETURN = p5_instance.RETURN; RGB = p5_instance.RGB; RIGHT = p5_instance.RIGHT; RIGHT_ARROW = p5_instance.RIGHT_ARROW; ROUND = p5_instance.ROUND; SCREEN = p5_instance.SCREEN; SHIFT = p5_instance.SHIFT; SOFT_LIGHT = p5_instance.SOFT_LIGHT; SQUARE = p5_instance.SQUARE; STROKE = p5_instance.STROKE; SUBTRACT = p5_instance.SUBTRACT; TAB = p5_instance.TAB; TAU = p5_instance.TAU; TEXT = p5_instance.TEXT; TEXTURE = p5_instance.TEXTURE; THRESHOLD = p5_instance.THRESHOLD; TOP = p5_instance.TOP; TRIANGLE_FAN = p5_instance.TRIANGLE_FAN; TRIANGLE_STRIP = p5_instance.TRIANGLE_STRIP; TRIANGLES = p5_instance.TRIANGLES; TWO_PI = p5_instance.TWO_PI; UP_ARROW = p5_instance.UP_ARROW; VIDEO = p5_instance.VIDEO; WAIT = p5_instance.WAIT; WEBGL = p5_instance.WEBGL; frameCount = p5_instance.frameCount; focused = p5_instance.focused; displayWidth = p5_instance.displayWidth; displayHeight = p5_instance.displayHeight; windowWidth = p5_instance.windowWidth; windowHeight = p5_instance.windowHeight; width = p5_instance.width; height = p5_instance.height; disableFriendlyErrors = p5_instance.disableFriendlyErrors; deviceOrientation = p5_instance.deviceOrientation; accelerationX = p5_instance.accelerationX; accelerationY = p5_instance.accelerationY; accelerationZ = p5_instance.accelerationZ; pAccelerationX = p5_instance.pAccelerationX; pAccelerationY = p5_instance.pAccelerationY; pAccelerationZ = p5_instance.pAccelerationZ; rotationX = p5_instance.rotationX; rotationY = p5_instance.rotationY; rotationZ = p5_instance.rotationZ; pRotationX = p5_instance.pRotationX; pRotationY = p5_instance.pRotationY; pRotationZ = p5_instance.pRotationZ; turnAxis = p5_instance.turnAxis; keyIsPressed = p5_instance.keyIsPressed; key = p5_instance.key; keyCode = p5_instance.keyCode; mouseX = p5_instance.mouseX; mouseY = p5_instance.mouseY; pmouseX = p5_instance.pmouseX; pmouseY = p5_instance.pmouseY; winMouseX = p5_instance.winMouseX; winMouseY = p5_instance.winMouseY; pwinMouseX = p5_instance.pwinMouseX; pwinMouseY = p5_instance.pwinMouseY; mouseButton = p5_instance.mouseButton; mouseIsPressed = p5_instance.mouseIsPressed; touches = p5_instance.touches; pixels = p5_instance.pixels; return draw_func (); }; export var global_p5_injection = function (p5_sketch) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'p5_sketch': var p5_sketch = __allkwargs0__ [__attrib0__]; break; } } } } else { } var decorator = function (f) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'f': var f = __allkwargs0__ [__attrib0__]; break; } } } } else { } var wrapper = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } } else { } _P5_INSTANCE = p5_sketch; return pre_draw (_P5_INSTANCE, f); }; return wrapper; }; return decorator; }; export var start_p5 = function (preload_func, setup_func, draw_func, event_functions) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'preload_func': var preload_func = __allkwargs0__ [__attrib0__]; break; case 'setup_func': var setup_func = __allkwargs0__ [__attrib0__]; break; case 'draw_func': var draw_func = __allkwargs0__ [__attrib0__]; break; case 'event_functions': var event_functions = __allkwargs0__ [__attrib0__]; break; } } } } else { } var sketch_setup = function (p5_sketch) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'p5_sketch': var p5_sketch = __allkwargs0__ [__attrib0__]; break; } } } } else { } p5_sketch.preload = global_p5_injection (p5_sketch) (preload_func); p5_sketch.setup = global_p5_injection (p5_sketch) (setup_func); p5_sketch.draw = global_p5_injection (p5_sketch) (draw_func); }; var instance = new p5 (sketch_setup, 'sketch-holder'); var event_function_names = tuple (['deviceMoved', 'deviceTurned', 'deviceShaken', 'windowResized', 'keyPressed', 'keyReleased', 'keyTyped', 'mousePressed', 'mouseReleased', 'mouseClicked', 'doubleClicked', 'mouseMoved', 'mouseDragged', 'mouseWheel', 'touchStarted', 'touchMoved', 'touchEnded', 'keyIsDown']); for (var f_name of (function () { var __accu0__ = []; for (var f of event_function_names) { if (event_functions.py_get (f, null)) { __accu0__.append (f); } } return __accu0__; }) ()) { var func = event_functions [f_name]; var event_func = global_p5_injection (instance) (func); setattr (instance, f_name, event_func); } }; export var logOnloaded = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } } else { } console.log ('Lib loaded!'); }; export var add_library = function (lib_name) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'lib_name': var lib_name = __allkwargs0__ [__attrib0__]; break; } } } } else { } var src = ''; return console.log ('Lib name is not valid:', lib_name); console.log ('Importing:', src); var script = document.createElement ('script'); script.onload = logOnloaded; script.src = src; document.head.appendChild (script); }; //# sourceMappingURL=pyp5js.map ================================================ FILE: docs/examples/transcrypt/sketch_003/target/pyp5js.py ================================================ from python_functions import PythonFunctions _P5_INSTANCE = None _CTX_MIDDLE = None _DEFAULT_FILL = None _DEFAULT_LEADMULT = None _DEFAULT_STROKE = None _DEFAULT_TEXT_FILL = None ADD = None ALT = None ARROW = None AUDIO = None AUTO = None AXES = None BACKSPACE = None BASELINE = None BEVEL = None BEZIER = None BLEND = None BLUR = None BOLD = None BOLDITALIC = None BOTTOM = None BURN = None CENTER = None CHORD = None CLAMP = None CLOSE = None CONTROL = None CORNER = None CORNERS = None CROSS = None CURVE = None DARKEST = None DEG_TO_RAD = None DEGREES = None DELETE = None DIFFERENCE = None DILATE = None DODGE = None DOWN_ARROW = None ENTER = None ERODE = None ESCAPE = None EXCLUSION = None FILL = None GRAY = None GRID = None HALF_PI = None HAND = None HARD_LIGHT = None HSB = None HSL = None IMAGE = None IMMEDIATE = None INVERT = None ITALIC = None LANDSCAPE = None LEFT = None LEFT_ARROW = None LIGHTEST = None LINE_LOOP = None LINE_STRIP = None LINEAR = None LINES = None MIRROR = None MITER = None MOVE = None MULTIPLY = None NEAREST = None NORMAL = None OPAQUE = None OPEN = None OPTION = None OVERLAY = None PI = None PIE = None POINTS = None PORTRAIT = None POSTERIZE = None PROJECT = None QUAD_STRIP = None QUADRATIC = None QUADS = None QUARTER_PI = None RAD_TO_DEG = None RADIANS = None RADIUS = None REPEAT = None REPLACE = None RETURN = None RGB = None RIGHT = None RIGHT_ARROW = None ROUND = None SCREEN = None SHIFT = None SOFT_LIGHT = None SQUARE = None STROKE = None SUBTRACT = None TAB = None TAU = None TEXT = None TEXTURE = None THRESHOLD = None TOP = None TRIANGLE_FAN = None TRIANGLE_STRIP = None TRIANGLES = None TWO_PI = None UP_ARROW = None VIDEO = None WAIT = None WEBGL = None P2D = None PI = None frameCount = None focused = None displayWidth = None displayHeight = None windowWidth = None windowHeight = None width = None height = None disableFriendlyErrors = None deviceOrientation = None accelerationX = None accelerationY = None accelerationZ = None pAccelerationX = None pAccelerationY = None pAccelerationZ = None rotationX = None rotationY = None rotationZ = None pRotationX = None pRotationY = None pRotationZ = None turnAxis = None keyIsPressed = None key = None keyCode = None mouseX = None mouseY = None pmouseX = None pmouseY = None winMouseX = None winMouseY = None pwinMouseX = None pwinMouseY = None mouseButton = None mouseIsPressed = None touches = None pixels = None def alpha(*args): return _P5_INSTANCE.alpha(*args) def blue(*args): return _P5_INSTANCE.blue(*args) def brightness(*args): return _P5_INSTANCE.brightness(*args) def color(*args): return _P5_INSTANCE.color(*args) def green(*args): return _P5_INSTANCE.green(*args) def hue(*args): return _P5_INSTANCE.hue(*args) def lerpColor(*args): return _P5_INSTANCE.lerpColor(*args) def lightness(*args): return _P5_INSTANCE.lightness(*args) def red(*args): return _P5_INSTANCE.red(*args) def saturation(*args): return _P5_INSTANCE.saturation(*args) def background(*args): return _P5_INSTANCE.background(*args) def clear(*args): __pragma__('noalias', 'clear') p5_clear = _P5_INSTANCE.clear(*args) __pragma__('alias', 'clear', 'py_clear') return p5_clear def erase(*args): return _P5_INSTANCE.erase(*args) def noErase(*args): return _P5_INSTANCE.noErase(*args) def colorMode(*args): return _P5_INSTANCE.colorMode(*args) def fill(*args): return _P5_INSTANCE.fill(*args) def noFill(*args): return _P5_INSTANCE.noFill(*args) def noStroke(*args): return _P5_INSTANCE.noStroke(*args) def stroke(*args): return _P5_INSTANCE.stroke(*args) def arc(*args): return _P5_INSTANCE.arc(*args) def ellipse(*args): return _P5_INSTANCE.ellipse(*args) def circle(*args): return _P5_INSTANCE.circle(*args) def line(*args): return _P5_INSTANCE.line(*args) def point(*args): return _P5_INSTANCE.point(*args) def quad(*args): return _P5_INSTANCE.quad(*args) def rect(*args): return _P5_INSTANCE.rect(*args) def square(*args): return _P5_INSTANCE.square(*args) def triangle(*args): return _P5_INSTANCE.triangle(*args) def plane(*args): return _P5_INSTANCE.plane(*args) def box(*args): return _P5_INSTANCE.box(*args) def sphere(*args): return _P5_INSTANCE.sphere(*args) def cylinder(*args): return _P5_INSTANCE.cylinder(*args) def cone(*args): return _P5_INSTANCE.cone(*args) def ellipsoid(*args): return _P5_INSTANCE.ellipsoid(*args) def torus(*args): return _P5_INSTANCE.torus(*args) def loadModel(*args): return _P5_INSTANCE.loadModel(*args) def model(*args): return _P5_INSTANCE.model(*args) def ellipseMode(*args): return _P5_INSTANCE.ellipseMode(*args) def noSmooth(*args): return _P5_INSTANCE.noSmooth(*args) def rectMode(*args): return _P5_INSTANCE.rectMode(*args) def smooth(*args): return _P5_INSTANCE.smooth(*args) def strokeCap(*args): return _P5_INSTANCE.strokeCap(*args) def strokeJoin(*args): return _P5_INSTANCE.strokeJoin(*args) def strokeWeight(*args): return _P5_INSTANCE.strokeWeight(*args) def bezier(*args): return _P5_INSTANCE.bezier(*args) def bezierDetail(*args): return _P5_INSTANCE.bezierDetail(*args) def bezierPoint(*args): return _P5_INSTANCE.bezierPoint(*args) def bezierTangent(*args): return _P5_INSTANCE.bezierTangent(*args) def curve(*args): return _P5_INSTANCE.curve(*args) def curveDetail(*args): return _P5_INSTANCE.curveDetail(*args) def curveTightness(*args): return _P5_INSTANCE.curveTightness(*args) def curvePoint(*args): return _P5_INSTANCE.curvePoint(*args) def curveTangent(*args): return _P5_INSTANCE.curveTangent(*args) def beginContour(*args): return _P5_INSTANCE.beginContour(*args) def beginShape(*args): return _P5_INSTANCE.beginShape(*args) def bezierVertex(*args): return _P5_INSTANCE.bezierVertex(*args) def curveVertex(*args): return _P5_INSTANCE.curveVertex(*args) def endContour(*args): return _P5_INSTANCE.endContour(*args) def endShape(*args): return _P5_INSTANCE.endShape(*args) def quadraticVertex(*args): return _P5_INSTANCE.quadraticVertex(*args) def vertex(*args): return _P5_INSTANCE.vertex(*args) def cursor(*args): return _P5_INSTANCE.cursor(*args) def frameRate(*args): return _P5_INSTANCE.frameRate(*args) def noCursor(*args): return _P5_INSTANCE.noCursor(*args) def fullscreen(*args): return _P5_INSTANCE.fullscreen(*args) def pixelDensity(*args): return _P5_INSTANCE.pixelDensity(*args) def displayDensity(*args): return _P5_INSTANCE.displayDensity(*args) def getURL(*args): return _P5_INSTANCE.getURL(*args) def getURLPath(*args): return _P5_INSTANCE.getURLPath(*args) def getURLParams(*args): return _P5_INSTANCE.getURLParams(*args) def preload(*args): return _P5_INSTANCE.preload(*args) def setup(*args): return _P5_INSTANCE.setup(*args) def draw(*args): return _P5_INSTANCE.draw(*args) def remove(*args): return _P5_INSTANCE.remove(*args) def noLoop(*args): return _P5_INSTANCE.noLoop(*args) def loop(*args): return _P5_INSTANCE.loop(*args) def push(*args): return _P5_INSTANCE.push(*args) def redraw(*args): return _P5_INSTANCE.redraw(*args) def resizeCanvas(*args): return _P5_INSTANCE.resizeCanvas(*args) def noCanvas(*args): return _P5_INSTANCE.noCanvas(*args) def createGraphics(*args): return _P5_INSTANCE.createGraphics(*args) def blendMode(*args): return _P5_INSTANCE.blendMode(*args) def setAttributes(*args): return _P5_INSTANCE.setAttributes(*args) def applyMatrix(*args): return _P5_INSTANCE.applyMatrix(*args) def resetMatrix(*args): return _P5_INSTANCE.resetMatrix(*args) def rotate(*args): return _P5_INSTANCE.rotate(*args) def rotateX(*args): return _P5_INSTANCE.rotateX(*args) def rotateY(*args): return _P5_INSTANCE.rotateY(*args) def rotateZ(*args): return _P5_INSTANCE.rotateZ(*args) def scale(*args): return _P5_INSTANCE.scale(*args) def shearX(*args): return _P5_INSTANCE.shearX(*args) def shearY(*args): return _P5_INSTANCE.shearY(*args) def translate(*args): return _P5_INSTANCE.translate(*args) def createStringDict(*args): return _P5_INSTANCE.createStringDict(*args) def createNumberDict(*args): return _P5_INSTANCE.createNumberDict(*args) def append(*args): return _P5_INSTANCE.append(*args) def arrayCopy(*args): return _P5_INSTANCE.arrayCopy(*args) def concat(*args): return _P5_INSTANCE.concat(*args) def reverse(*args): return _P5_INSTANCE.reverse(*args) def shorten(*args): return _P5_INSTANCE.shorten(*args) def shuffle(*args): return _P5_INSTANCE.shuffle(*args) def sort(*args): return _P5_INSTANCE.sort(*args) def splice(*args): return _P5_INSTANCE.splice(*args) def subset(*args): return _P5_INSTANCE.subset(*args) def float(*args): return _P5_INSTANCE.float(*args) def int(*args): return _P5_INSTANCE.int(*args) def str(*args): return _P5_INSTANCE.str(*args) def boolean(*args): return _P5_INSTANCE.boolean(*args) def byte(*args): return _P5_INSTANCE.byte(*args) def char(*args): return _P5_INSTANCE.char(*args) def unchar(*args): return _P5_INSTANCE.unchar(*args) def hex(*args): return _P5_INSTANCE.hex(*args) def unhex(*args): return _P5_INSTANCE.unhex(*args) def join(*args): return _P5_INSTANCE.join(*args) def match(*args): return _P5_INSTANCE.match(*args) def matchAll(*args): return _P5_INSTANCE.matchAll(*args) def nf(*args): return _P5_INSTANCE.nf(*args) def nfc(*args): return _P5_INSTANCE.nfc(*args) def nfp(*args): return _P5_INSTANCE.nfp(*args) def nfs(*args): return _P5_INSTANCE.nfs(*args) def split(*args): return _P5_INSTANCE.split(*args) def splitTokens(*args): return _P5_INSTANCE.splitTokens(*args) def trim(*args): return _P5_INSTANCE.trim(*args) def setMoveThreshold(*args): return _P5_INSTANCE.setMoveThreshold(*args) def setShakeThreshold(*args): return _P5_INSTANCE.setShakeThreshold(*args) def keyIsDown(*args): return _P5_INSTANCE.keyIsDown(*args) def createImage(*args): return _P5_INSTANCE.createImage(*args) def saveCanvas(*args): return _P5_INSTANCE.saveCanvas(*args) def saveFrames(*args): return _P5_INSTANCE.saveFrames(*args) def image_proxy(img): """ Proxy to turn of transcypt when calling img.get/set methods """ def _set(*args): __pragma__('noalias', 'set') value = img.set(*args) __pragma__('alias', 'set', 'py_set') return value def _get(*args): __pragma__('noalias', 'get') value = img.get(*args) __pragma__('alias', 'get', 'py_get') return value img.set = _set img.get = _get return img def loadImage(*args): imageObj = _P5_INSTANCE.loadImage(*args) return image_proxy(imageObj) def image(*args): return _P5_INSTANCE.image(*args) def tint(*args): return _P5_INSTANCE.tint(*args) def noTint(*args): return _P5_INSTANCE.noTint(*args) def imageMode(*args): return _P5_INSTANCE.imageMode(*args) def blend(*args): return _P5_INSTANCE.blend(*args) def copy(*args): return _P5_INSTANCE.copy(*args) def filter(*args): if len(args) > 1 and (args[0] is None or callable(args[0])): return PythonFunctions.filter(*args) else: return _P5_INSTANCE.filter(*args) def get(*args): __pragma__('noalias', 'get') p5_get = _P5_INSTANCE.get(*args) __pragma__('alias', 'get', 'py_get') return p5_get def loadPixels(*args): return _P5_INSTANCE.loadPixels(*args) def set(*args): if len(args) <= 1: return PythonFunctions.set(*args) else: return _P5_INSTANCE.set(*args) def updatePixels(*args): return _P5_INSTANCE.updatePixels(*args) def loadJSON(*args): return _P5_INSTANCE.loadJSON(*args) def loadStrings(*args): return _P5_INSTANCE.loadStrings(*args) def loadTable(*args): return _P5_INSTANCE.loadTable(*args) def loadXML(*args): return _P5_INSTANCE.loadXML(*args) def loadBytes(*args): return _P5_INSTANCE.loadBytes(*args) def httpGet(*args): return _P5_INSTANCE.httpGet(*args) def httpPost(*args): return _P5_INSTANCE.httpPost(*args) def httpDo(*args): return _P5_INSTANCE.httpDo(*args) def createWriter(*args): return _P5_INSTANCE.createWriter(*args) def save(*args): return _P5_INSTANCE.save(*args) def saveJSON(*args): return _P5_INSTANCE.saveJSON(*args) def saveStrings(*args): return _P5_INSTANCE.saveStrings(*args) def saveTable(*args): return _P5_INSTANCE.saveTable(*args) def day(*args): return _P5_INSTANCE.day(*args) def hour(*args): return _P5_INSTANCE.hour(*args) def minute(*args): return _P5_INSTANCE.minute(*args) def millis(*args): return _P5_INSTANCE.millis(*args) def month(*args): return _P5_INSTANCE.month(*args) def second(*args): return _P5_INSTANCE.second(*args) def year(*args): return _P5_INSTANCE.year(*args) def createVector(*args): return _P5_INSTANCE.createVector(*args) def abs(*args): return _P5_INSTANCE.abs(*args) def ceil(*args): return _P5_INSTANCE.ceil(*args) def constrain(*args): return _P5_INSTANCE.constrain(*args) def dist(*args): return _P5_INSTANCE.dist(*args) def exp(*args): return _P5_INSTANCE.exp(*args) def floor(*args): return _P5_INSTANCE.floor(*args) def lerp(*args): return _P5_INSTANCE.lerp(*args) def log(*args): return _P5_INSTANCE.log(*args) def mag(*args): return _P5_INSTANCE.mag(*args) def map(*args): if len(args) > 1 and callable(args[0]): return PythonFunctions.map(*args) else: return _P5_INSTANCE.map(*args) def max(*args): return _P5_INSTANCE.max(*args) def min(*args): return _P5_INSTANCE.min(*args) def norm(*args): return _P5_INSTANCE.norm(*args) def pow(*args): return _P5_INSTANCE.pow(*args) def round(*args): return _P5_INSTANCE.round(*args) def sq(*args): return _P5_INSTANCE.sq(*args) def sqrt(*args): return _P5_INSTANCE.sqrt(*args) def noise(*args): return _P5_INSTANCE.noise(*args) def noiseDetail(*args): return _P5_INSTANCE.noiseDetail(*args) def noiseSeed(*args): return _P5_INSTANCE.noiseSeed(*args) def randomSeed(*args): return _P5_INSTANCE.randomSeed(*args) def random(*args): return _P5_INSTANCE.random(*args) def randomGaussian(*args): return _P5_INSTANCE.randomGaussian(*args) def acos(*args): return _P5_INSTANCE.acos(*args) def asin(*args): return _P5_INSTANCE.asin(*args) def atan(*args): return _P5_INSTANCE.atan(*args) def atan2(*args): return _P5_INSTANCE.atan2(*args) def cos(*args): return _P5_INSTANCE.cos(*args) def sin(*args): return _P5_INSTANCE.sin(*args) def tan(*args): return _P5_INSTANCE.tan(*args) def degrees(*args): return _P5_INSTANCE.degrees(*args) def radians(*args): return _P5_INSTANCE.radians(*args) def angleMode(*args): return _P5_INSTANCE.angleMode(*args) def textAlign(*args): return _P5_INSTANCE.textAlign(*args) def textLeading(*args): return _P5_INSTANCE.textLeading(*args) def textSize(*args): return _P5_INSTANCE.textSize(*args) def textStyle(*args): return _P5_INSTANCE.textStyle(*args) def textWidth(*args): return _P5_INSTANCE.textWidth(*args) def textAscent(*args): return _P5_INSTANCE.textAscent(*args) def textDescent(*args): return _P5_INSTANCE.textDescent(*args) def loadFont(*args): return _P5_INSTANCE.loadFont(*args) def text(*args): return _P5_INSTANCE.text(*args) def textFont(*args): return _P5_INSTANCE.textFont(*args) def orbitControl(*args): return _P5_INSTANCE.orbitControl(*args) def debugMode(*args): return _P5_INSTANCE.debugMode(*args) def noDebugMode(*args): return _P5_INSTANCE.noDebugMode(*args) def ambientLight(*args): return _P5_INSTANCE.ambientLight(*args) def directionalLight(*args): return _P5_INSTANCE.directionalLight(*args) def pointLight(*args): return _P5_INSTANCE.pointLight(*args) def lights(*args): return _P5_INSTANCE.lights(*args) def loadShader(*args): return _P5_INSTANCE.loadShader(*args) def createShader(*args): return _P5_INSTANCE.createShader(*args) def shader(*args): return _P5_INSTANCE.shader(*args) def resetShader(*args): return _P5_INSTANCE.resetShader(*args) def normalMaterial(*args): return _P5_INSTANCE.normalMaterial(*args) def texture(*args): return _P5_INSTANCE.texture(*args) def textureMode(*args): return _P5_INSTANCE.textureMode(*args) def textureWrap(*args): return _P5_INSTANCE.textureWrap(*args) def ambientMaterial(*args): return _P5_INSTANCE.ambientMaterial(*args) def specularMaterial(*args): return _P5_INSTANCE.specularMaterial(*args) def shininess(*args): return _P5_INSTANCE.shininess(*args) def camera(*args): return _P5_INSTANCE.camera(*args) def perspective(*args): return _P5_INSTANCE.perspective(*args) def ortho(*args): return _P5_INSTANCE.ortho(*args) def createCamera(*args): return _P5_INSTANCE.createCamera(*args) def setCamera(*args): return _P5_INSTANCE.setCamera(*args) def select(*args): return _P5_INSTANCE.select(*args) def selectAll(*args): return _P5_INSTANCE.selectAll(*args) def removeElements(*args): return _P5_INSTANCE.removeElements(*args) def changed(*args): return _P5_INSTANCE.changed(*args) def input(*args): return _P5_INSTANCE.input(*args) def createDiv(*args): return _P5_INSTANCE.createDiv(*args) def createP(*args): return _P5_INSTANCE.createP(*args) def createSpan(*args): return _P5_INSTANCE.createSpan(*args) def createImg(*args): return _P5_INSTANCE.createImg(*args) def createA(*args): return _P5_INSTANCE.createA(*args) def createSlider(*args): return _P5_INSTANCE.createSlider(*args) def createButton(*args): return _P5_INSTANCE.createButton(*args) def createCheckbox(*args): return _P5_INSTANCE.createCheckbox(*args) def createSelect(*args): return _P5_INSTANCE.createSelect(*args) def createRadio(*args): return _P5_INSTANCE.createRadio(*args) def createColorPicker(*args): return _P5_INSTANCE.createColorPicker(*args) def createInput(*args): return _P5_INSTANCE.createInput(*args) def createFileInput(*args): return _P5_INSTANCE.createFileInput(*args) def createVideo(*args): return _P5_INSTANCE.createVideo(*args) def createAudio(*args): return _P5_INSTANCE.createAudio(*args) def createCapture(*args): return _P5_INSTANCE.createCapture(*args) def createElement(*args): return _P5_INSTANCE.createElement(*args) def createCanvas(*args): canvas = _P5_INSTANCE.createCanvas(*args) global width, height width = _P5_INSTANCE.width height = _P5_INSTANCE.height return canvas def pop(*args): __pragma__('noalias', 'pop') p5_pop = _P5_INSTANCE.pop(*args) __pragma__('alias', 'pop', 'py_pop') return p5_pop # Processing Python or Java mode compatibility aliases size = createCanvas popMatrix = pop popStyle = pop pushMatrix = push pushStyle = push # PVector is a helper/alias to create p5.Vector objects def PVector(x=0, y=0, z=0): return _P5_INSTANCE.createVector(x, y, z) # aliases for p5.Vector class methods setattr(PVector, 'dist', p5.Vector.dist) setattr(PVector, 'add', p5.Vector.add) setattr(PVector, 'sub', p5.Vector.sub) setattr(PVector, 'mult', p5.Vector.mult) setattr(PVector, 'div', p5.Vector.div) setattr(PVector, 'dot', p5.Vector.dot) setattr(PVector, 'cross', p5.Vector.cross) setattr(PVector, 'lerp', p5.Vector.lerp) setattr(PVector, 'random2D', p5.Vector.random2D) setattr(PVector, 'random3D', p5.Vector.random3D) setattr(PVector, 'angleBetween', p5.Vector.angleBetween) setattr(PVector, 'fromAngle', p5.Vector.fromAngle) setattr(PVector, 'fromAngles', p5.Vector.fromAngles) setattr(PVector, 'equals', p5.Vector.equals) def pre_draw(p5_instance, draw_func): """ We need to run this before the actual draw to insert and update p5 env variables """ global _CTX_MIDDLE, _DEFAULT_FILL, _DEFAULT_LEADMULT, _DEFAULT_STROKE, _DEFAULT_TEXT_FILL global ADD, ALT, ARROW, AUTO, AUDIO, AXES, BACKSPACE, BASELINE, BEVEL, BEZIER, BLEND, BLUR, BOLD, BOLDITALIC global BOTTOM, BURN, CENTER, CHORD, CLAMP, CLOSE, CONTROL, CORNER, CORNERS, CROSS, CURVE, DARKEST global DEG_TO_RAD, DEGREES, DELETE, DIFFERENCE, DILATE, DODGE, DOWN_ARROW, ENTER, ERODE, ESCAPE, EXCLUSION global FILL, GRAY, GRID, HALF_PI, HAND, HARD_LIGHT, HSB, HSL, IMAGE, IMMEDIATE, INVERT, ITALIC, LANDSCAPE global LEFT, LEFT_ARROW, LIGHTEST, LINE_LOOP, LINE_STRIP, LINEAR, LINES, MIRROR, MITER, MOVE, MULTIPLY, NEAREST global NORMAL, OPAQUE, OPEN, OPTION, OVERLAY, P2D, PI, PIE, POINTS, PORTRAIT, POSTERIZE, PROJECT, QUAD_STRIP, QUADRATIC global QUADS, QUARTER_PI, RAD_TO_DEG, RADIANS, RADIUS, REPEAT, REPLACE, RETURN, RGB, RIGHT, RIGHT_ARROW global ROUND, SCREEN, SHIFT, SOFT_LIGHT, SQUARE, STROKE, SUBTRACT, TAB, TAU, TEXT, TEXTURE, THRESHOLD, TOP global TRIANGLE_FAN, TRIANGLE_STRIP, TRIANGLES, TWO_PI, UP_ARROW, VIDEO, WAIT, WEBGL global frameCount, focused, displayWidth, displayHeight, windowWidth, windowHeight, width, height global disableFriendlyErrors, deviceOrientation, accelerationX, accelerationY, accelerationZ global pAccelerationX, pAccelerationY, pAccelerationZ, rotationX, rotationY, rotationZ global pRotationX, pRotationY, pRotationZ, turnAxis, keyIsPressed, key, keyCode, mouseX, mouseY, pmouseX, pmouseY global winMouseX, winMouseY, pwinMouseX, pwinMouseY, mouseButton, mouseIsPressed, touches, pixels _CTX_MIDDLE = p5_instance._CTX_MIDDLE _DEFAULT_FILL = p5_instance._DEFAULT_FILL _DEFAULT_LEADMULT = p5_instance._DEFAULT_LEADMULT _DEFAULT_STROKE = p5_instance._DEFAULT_STROKE _DEFAULT_TEXT_FILL = p5_instance._DEFAULT_TEXT_FILL ADD = p5_instance.ADD ALT = p5_instance.ALT ARROW = p5_instance.ARROW AUDIO = p5_instance.AUDIO AUTO = p5_instance.AUTO AXES = p5_instance.AXES BACKSPACE = p5_instance.BACKSPACE BASELINE = p5_instance.BASELINE BEVEL = p5_instance.BEVEL BEZIER = p5_instance.BEZIER BLEND = p5_instance.BLEND BLUR = p5_instance.BLUR BOLD = p5_instance.BOLD BOLDITALIC = p5_instance.BOLDITALIC BOTTOM = p5_instance.BOTTOM BURN = p5_instance.BURN CENTER = p5_instance.CENTER CHORD = p5_instance.CHORD CLAMP = p5_instance.CLAMP CLOSE = p5_instance.CLOSE CONTROL = p5_instance.CONTROL CORNER = p5_instance.CORNER CORNERS = p5_instance.CORNERS CROSS = p5_instance.CROSS CURVE = p5_instance.CURVE DARKEST = p5_instance.DARKEST DEG_TO_RAD = p5_instance.DEG_TO_RAD DEGREES = p5_instance.DEGREES DELETE = p5_instance.DELETE DIFFERENCE = p5_instance.DIFFERENCE DILATE = p5_instance.DILATE DODGE = p5_instance.DODGE DOWN_ARROW = p5_instance.DOWN_ARROW ENTER = p5_instance.ENTER ERODE = p5_instance.ERODE ESCAPE = p5_instance.ESCAPE EXCLUSION = p5_instance.EXCLUSION FILL = p5_instance.FILL GRAY = p5_instance.GRAY GRID = p5_instance.GRID HALF_PI = p5_instance.HALF_PI HAND = p5_instance.HAND HARD_LIGHT = p5_instance.HARD_LIGHT HSB = p5_instance.HSB HSL = p5_instance.HSL IMAGE = p5_instance.IMAGE IMMEDIATE = p5_instance.IMMEDIATE INVERT = p5_instance.INVERT ITALIC = p5_instance.ITALIC LANDSCAPE = p5_instance.LANDSCAPE LEFT = p5_instance.LEFT LEFT_ARROW = p5_instance.LEFT_ARROW LIGHTEST = p5_instance.LIGHTEST LINE_LOOP = p5_instance.LINE_LOOP LINE_STRIP = p5_instance.LINE_STRIP LINEAR = p5_instance.LINEAR LINES = p5_instance.LINES MIRROR = p5_instance.MIRROR MITER = p5_instance.MITER MOVE = p5_instance.MOVE MULTIPLY = p5_instance.MULTIPLY NEAREST = p5_instance.NEAREST NORMAL = p5_instance.NORMAL OPAQUE = p5_instance.OPAQUE OPEN = p5_instance.OPEN OPTION = p5_instance.OPTION OVERLAY = p5_instance.OVERLAY P2D = p5_instance.P2D P3D = p5_instance.WEBGL PI = p5_instance.PI PIE = p5_instance.PIE POINTS = p5_instance.POINTS PORTRAIT = p5_instance.PORTRAIT POSTERIZE = p5_instance.POSTERIZE PROJECT = p5_instance.PROJECT QUAD_STRIP = p5_instance.QUAD_STRIP QUADRATIC = p5_instance.QUADRATIC QUADS = p5_instance.QUADS QUARTER_PI = p5_instance.QUARTER_PI RAD_TO_DEG = p5_instance.RAD_TO_DEG RADIANS = p5_instance.RADIANS RADIUS = p5_instance.RADIUS REPEAT = p5_instance.REPEAT REPLACE = p5_instance.REPLACE RETURN = p5_instance.RETURN RGB = p5_instance.RGB RIGHT = p5_instance.RIGHT RIGHT_ARROW = p5_instance.RIGHT_ARROW ROUND = p5_instance.ROUND SCREEN = p5_instance.SCREEN SHIFT = p5_instance.SHIFT SOFT_LIGHT = p5_instance.SOFT_LIGHT SQUARE = p5_instance.SQUARE STROKE = p5_instance.STROKE SUBTRACT = p5_instance.SUBTRACT TAB = p5_instance.TAB TAU = p5_instance.TAU TEXT = p5_instance.TEXT TEXTURE = p5_instance.TEXTURE THRESHOLD = p5_instance.THRESHOLD TOP = p5_instance.TOP TRIANGLE_FAN = p5_instance.TRIANGLE_FAN TRIANGLE_STRIP = p5_instance.TRIANGLE_STRIP TRIANGLES = p5_instance.TRIANGLES TWO_PI = p5_instance.TWO_PI UP_ARROW = p5_instance.UP_ARROW VIDEO = p5_instance.VIDEO WAIT = p5_instance.WAIT WEBGL = p5_instance.WEBGL frameCount = p5_instance.frameCount focused = p5_instance.focused displayWidth = p5_instance.displayWidth displayHeight = p5_instance.displayHeight windowWidth = p5_instance.windowWidth windowHeight = p5_instance.windowHeight width = p5_instance.width height = p5_instance.height disableFriendlyErrors = p5_instance.disableFriendlyErrors deviceOrientation = p5_instance.deviceOrientation accelerationX = p5_instance.accelerationX accelerationY = p5_instance.accelerationY accelerationZ = p5_instance.accelerationZ pAccelerationX = p5_instance.pAccelerationX pAccelerationY = p5_instance.pAccelerationY pAccelerationZ = p5_instance.pAccelerationZ rotationX = p5_instance.rotationX rotationY = p5_instance.rotationY rotationZ = p5_instance.rotationZ pRotationX = p5_instance.pRotationX pRotationY = p5_instance.pRotationY pRotationZ = p5_instance.pRotationZ turnAxis = p5_instance.turnAxis keyIsPressed = p5_instance.keyIsPressed key = p5_instance.key keyCode = p5_instance.keyCode mouseX = p5_instance.mouseX mouseY = p5_instance.mouseY pmouseX = p5_instance.pmouseX pmouseY = p5_instance.pmouseY winMouseX = p5_instance.winMouseX winMouseY = p5_instance.winMouseY pwinMouseX = p5_instance.pwinMouseX pwinMouseY = p5_instance.pwinMouseY mouseButton = p5_instance.mouseButton mouseIsPressed = p5_instance.mouseIsPressed touches = p5_instance.touches pixels = p5_instance.pixels return draw_func() def global_p5_injection(p5_sketch): """ Injects the p5js's skecth instance as a global variable to setup and draw functions """ def decorator(f): def wrapper(): global _P5_INSTANCE _P5_INSTANCE = p5_sketch return pre_draw(_P5_INSTANCE, f) return wrapper return decorator def start_p5(preload_func, setup_func, draw_func, event_functions): """ This is the entrypoint function. It accepts 2 parameters: - preload_func: a Python preload callable - setup_func: a Python setup callable - draw_func: a Python draw callable - event_functions: a config dict for the event functions in the format: {"eventFunctionName": python_event_function} This method gets the p5js's sketch instance and injects them """ def sketch_setup(p5_sketch): p5_sketch.preload = global_p5_injection(p5_sketch)(preload_func) p5_sketch.setup = global_p5_injection(p5_sketch)(setup_func) p5_sketch.draw = global_p5_injection(p5_sketch)(draw_func) instance = __new__(p5(sketch_setup, 'sketch-holder')) # inject event functions into p5 event_function_names = ( "deviceMoved", "deviceTurned", "deviceShaken", "windowResized", "keyPressed", "keyReleased", "keyTyped", "mousePressed", "mouseReleased", "mouseClicked", "doubleClicked", "mouseMoved", "mouseDragged", "mouseWheel", "touchStarted", "touchMoved", "touchEnded", "keyIsDown" ) for f_name in [f for f in event_function_names if event_functions.get(f, None)]: func = event_functions[f_name] event_func = global_p5_injection(instance)(func) setattr(instance, f_name, event_func) def logOnloaded(): console.log("Lib loaded!") def add_library(lib_name): # placeholder for https://github.com/berinhard/pyp5js/issues/31 src = '' return console.log("Lib name is not valid:", lib_name) console.log("Importing:", src) script = document.createElement("script") script.onload = logOnloaded script.src = src document.head.appendChild(script) ================================================ FILE: docs/examples/transcrypt/sketch_003/target/python_functions.js ================================================ // Transcrypt'ed from Python, 2021-11-02 13:06:11 import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, abs, all, any, assert, bool, bytearray, bytes, callable, chr, copy, deepcopy, delattr, dict, dir, divmod, enumerate, filter, float, getattr, hasattr, input, int, isinstance, issubclass, len, list, map, max, min, object, ord, pow, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, round, set, setattr, sorted, str, sum, tuple, zip} from './org.transcrypt.__runtime__.js'; var __name__ = 'python_functions'; export var PythonFunctions = __class__ ('PythonFunctions', [object], { __module__: __name__, }); setattr (PythonFunctions, 'map', map); setattr (PythonFunctions, 'filter', filter); setattr (PythonFunctions, 'set', set); //# sourceMappingURL=python_functions.map ================================================ FILE: docs/examples/transcrypt/sketch_003/target/python_functions.py ================================================ class PythonFunctions: pass setattr(PythonFunctions, 'map', map) setattr(PythonFunctions, 'filter', filter) setattr(PythonFunctions, 'set', set) ================================================ FILE: docs/examples/transcrypt/sketch_003/target/target_sketch.js ================================================ // Transcrypt'ed from Python, 2021-11-02 13:06:11 import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, all, any, assert, bool, bytearray, bytes, callable, chr, deepcopy, delattr, dict, dir, divmod, enumerate, getattr, hasattr, isinstance, issubclass, len, list, object, ord, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, set, setattr, sorted, sum, tuple, zip} from './org.transcrypt.__runtime__.js'; import {ADD, ALT, ARROW, AUDIO, AUTO, AXES, BACKSPACE, BASELINE, BEVEL, BEZIER, BLEND, BLUR, BOLD, BOLDITALIC, BOTTOM, BURN, CENTER, CHORD, CLAMP, CLOSE, CONTROL, CORNER, CORNERS, CROSS, CURVE, DARKEST, DEGREES, DEG_TO_RAD, DELETE, DIFFERENCE, DILATE, DODGE, DOWN_ARROW, ENTER, ERODE, ESCAPE, EXCLUSION, FILL, GRAY, GRID, HALF_PI, HAND, HARD_LIGHT, HSB, HSL, IMAGE, IMMEDIATE, INVERT, ITALIC, LANDSCAPE, LEFT, LEFT_ARROW, LIGHTEST, LINEAR, LINES, LINE_LOOP, LINE_STRIP, MIRROR, MITER, MOVE, MULTIPLY, NEAREST, NORMAL, OPAQUE, OPEN, OPTION, OVERLAY, P2D, PI, PIE, POINTS, PORTRAIT, POSTERIZE, PROJECT, PVector, QUADRATIC, QUADS, QUAD_STRIP, QUARTER_PI, RADIANS, RADIUS, RAD_TO_DEG, REPEAT, REPLACE, RETURN, RGB, RIGHT, RIGHT_ARROW, ROUND, SCREEN, SHIFT, SOFT_LIGHT, SQUARE, STROKE, SUBTRACT, TAB, TAU, TEXT, TEXTURE, THRESHOLD, TOP, TRIANGLES, TRIANGLE_FAN, TRIANGLE_STRIP, TWO_PI, UP_ARROW, VIDEO, WAIT, WEBGL, _CTX_MIDDLE, _DEFAULT_FILL, _DEFAULT_LEADMULT, _DEFAULT_STROKE, _DEFAULT_TEXT_FILL, _P5_INSTANCE, abs, accelerationX, accelerationY, accelerationZ, acos, add_library, alpha, ambientLight, ambientMaterial, angleMode, append, applyMatrix, arc, arrayCopy, asin, atan, atan2, background, beginContour, beginShape, bezier, bezierDetail, bezierPoint, bezierTangent, bezierVertex, blend, blendMode, blue, boolean, box, brightness, byte, camera, ceil, changed, char, circle, color, colorMode, concat, cone, constrain, copy, cos, createA, createAudio, createButton, createCamera, createCanvas, createCapture, createCheckbox, createColorPicker, createDiv, createElement, createFileInput, createGraphics, createImage, createImg, createInput, createNumberDict, createP, createRadio, createSelect, createShader, createSlider, createSpan, createStringDict, createVector, createVideo, createWriter, cursor, curve, curveDetail, curvePoint, curveTangent, curveTightness, curveVertex, cylinder, day, debugMode, degrees, deviceOrientation, directionalLight, disableFriendlyErrors, displayDensity, displayHeight, displayWidth, dist, ellipse, ellipseMode, ellipsoid, endContour, endShape, erase, exp, fill, filter, float, floor, focused, frameCount, frameRate, fullscreen, getURL, getURLParams, getURLPath, global_p5_injection, green, height, hex, hour, httpDo, httpGet, httpPost, hue, image, imageMode, image_proxy, input, int, join, key, keyCode, keyIsPressed, lerp, lerpColor, lightness, lights, line, loadBytes, loadFont, loadImage, loadJSON, loadModel, loadPixels, loadShader, loadStrings, loadTable, loadXML, log, logOnloaded, loop, mag, map, match, matchAll, max, millis, min, minute, model, month, mouseButton, mouseIsPressed, mouseX, mouseY, nf, nfc, nfp, nfs, noCanvas, noCursor, noDebugMode, noErase, noFill, noLoop, noSmooth, noStroke, noTint, noise, noiseDetail, noiseSeed, norm, normalMaterial, orbitControl, ortho, pAccelerationX, pAccelerationY, pAccelerationZ, pRotationX, pRotationY, pRotationZ, perspective, pixelDensity, pixels, plane, pmouseX, pmouseY, point, pointLight, popMatrix, popStyle, pow, pre_draw, push, pushMatrix, pushStyle, pwinMouseX, pwinMouseY, py_clear, py_get, py_pop, py_set, py_sort, py_split, quad, quadraticVertex, radians, random, randomGaussian, randomSeed, rect, rectMode, red, redraw, remove, removeElements, resetMatrix, resetShader, resizeCanvas, reverse, rotate, rotateX, rotateY, rotateZ, rotationX, rotationY, rotationZ, round, saturation, save, saveCanvas, saveFrames, saveJSON, saveStrings, saveTable, scale, second, select, selectAll, setAttributes, setCamera, setMoveThreshold, setShakeThreshold, shader, shearX, shearY, shininess, shorten, shuffle, sin, size, smooth, specularMaterial, sphere, splice, splitTokens, sq, sqrt, square, start_p5, str, stroke, strokeCap, strokeJoin, strokeWeight, subset, tan, text, textAlign, textAscent, textDescent, textFont, textLeading, textSize, textStyle, textWidth, texture, textureMode, textureWrap, tint, torus, touches, translate, triangle, trim, turnAxis, unchar, unhex, updatePixels, vertex, width, winMouseX, winMouseY, windowHeight, windowWidth, year} from './pyp5js.js'; var __name__ = '__main__'; export var preload = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } } else { } // pass; }; export var setup = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } } else { } // pass; }; export var draw = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } } else { } // pass; }; export var deviceMoved = null; export var deviceTurned = null; export var deviceShaken = null; export var keyPressed = null; export var keyReleased = null; export var keyTyped = null; export var mouseMoved = null; export var mouseDragged = null; export var mousePressed = null; export var mouseReleased = null; export var mouseClicked = null; export var doubleClicked = null; export var mouseWheel = null; export var touchStarted = null; export var touchMoved = null; export var touchEnded = null; export var windowResized = null; export var keyIsDown = null; var setup = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } } else { } createCanvas (600, 600, WEBGL); }; var draw = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } } else { } background (200); translate (-(100), -(100), 0); push (); normalMaterial (); rotateZ (frameCount * 0.01); rotateX (frameCount * 0.01); rotateY (frameCount * 0.01); box (50, 70, 100); py_pop (); }; export var event_functions = dict ({'deviceMoved': deviceMoved, 'deviceTurned': deviceTurned, 'deviceShaken': deviceShaken, 'keyPressed': keyPressed, 'keyReleased': keyReleased, 'keyTyped': keyTyped, 'mouseMoved': mouseMoved, 'mouseDragged': mouseDragged, 'mousePressed': mousePressed, 'mouseReleased': mouseReleased, 'mouseClicked': mouseClicked, 'doubleClicked': doubleClicked, 'mouseWheel': mouseWheel, 'touchStarted': touchStarted, 'touchMoved': touchMoved, 'touchEnded': touchEnded, 'windowResized': windowResized, 'keyIsDown': keyIsDown}); start_p5 (preload, setup, draw, event_functions); //# sourceMappingURL=target_sketch.map ================================================ FILE: docs/examples/transcrypt/sketch_003/target/target_sketch.project ================================================ {"options": {"source": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_003/target_sketch.py", "anno": false, "alimod": false, "build": true, "complex": false, "docat": false, "dassert": false, "dcheck": false, "dextex": false, "dlog": false, "dmap": false, "dnostrip": false, "dstat": false, "dtree": false, "esv": null, "ecom": false, "fcall": false, "gen": false, "iconv": false, "jscall": false, "jskeys": false, "jsmod": false, "kwargs": true, "keycheck": false, "license": false, "map": true, "nomin": true, "opov": false, "outdir": null, "parent": null, "run": false, "symbols": null, "sform": false, "tconv": false, "unit": null, "verbose": false, "x": null, "xreex": false, "xglobs": false, "xpath": "/home/bernardo/envs/pyp5js/pyp5js/templates/transcrypt", "xtiny": false, "star": false}, "modules": [{"source": "/home/bernardo/.pyenv/versions/pyp5js/lib/python3.8/site-packages/transcrypt/modules/org/transcrypt/__runtime__.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_003/__target__/org.transcrypt.__runtime__.js"}, {"source": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_003/target_sketch.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_003/__target__/target_sketch.js"}, {"source": "/home/bernardo/envs/pyp5js/pyp5js/templates/transcrypt/pyp5js.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_003/__target__/pyp5js.js"}, {"source": "/home/bernardo/envs/pyp5js/pyp5js/templates/transcrypt/python_functions.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_003/__target__/python_functions.js"}]} ================================================ FILE: docs/examples/transcrypt/sketch_003/target/target_sketch.py ================================================ from pyp5js import * def preload(): pass def setup(): pass def draw(): pass deviceMoved = None deviceTurned = None deviceShaken = None keyPressed = None keyReleased = None keyTyped = None mouseMoved = None mouseDragged = None mousePressed = None mouseReleased = None mouseClicked = None doubleClicked = None mouseWheel = None touchStarted = None touchMoved = None touchEnded = None windowResized = None keyIsDown = None # 3d example def setup(): createCanvas(600, 600, WEBGL) def draw(): background(200) translate(-100, -100, 0) push() normalMaterial() rotateZ(frameCount * 0.01) rotateX(frameCount * 0.01) rotateY(frameCount * 0.01) box(50, 70, 100) pop() event_functions = { "deviceMoved": deviceMoved, "deviceTurned": deviceTurned, "deviceShaken": deviceShaken, "keyPressed": keyPressed, "keyReleased": keyReleased, "keyTyped": keyTyped, "mouseMoved": mouseMoved, "mouseDragged": mouseDragged, "mousePressed": mousePressed, "mouseReleased": mouseReleased, "mouseClicked": mouseClicked, "doubleClicked": doubleClicked, "mouseWheel": mouseWheel, "touchStarted": touchStarted, "touchMoved": touchMoved, "touchEnded": touchEnded, "windowResized": windowResized, "keyIsDown": keyIsDown, } start_p5(preload, setup, draw, event_functions) ================================================ FILE: docs/examples/transcrypt/sketch_004/index.html ================================================ sketch_004 - pyp5js (using Transcrypt)

Python code here.

             
# From Prof. Claudio Esperança examples for BrythonIDE
# https://github.com/esperanc/brythonide/blob/master/demoSketches/boids.py

boids = [];

def setup() :
  createCanvas(720, 400);

  # Add an initial set of boids into the system
  for i in range(40):
    boids.append (Boid(random(720), random(400)))

def draw() :
  background(51);
  # Run all the boids
  for boid in boids: boid.run(boids)


# Boid class
# Methods for Separation, Cohesion, Alignment added
class Boid (object):

    def __init__(self, x, y) :
        self.acceleration = createVector(0, 0);
        self.velocity = p5.Vector.random2D();
        self.position = createVector(x, y);
        self.r = 3.0;
        self.maxspeed = 3;    # Maximum speed
        self.maxforce = 0.05; # Maximum steering force

    def run (self, boids):
        self.flock(boids);
        self.update();
        self.borders();
        self.render();

    # Forces go into acceleration
    def applyForce (self,force):
        self.acceleration.add(force);

    # We accumulate a new acceleration each time based on three rules
    def flock (self, boids) :
        sep = self.separate(boids); # Separation
        ali = self.align(boids);    # Alignment
        coh = self.cohesion(boids); # Cohesion
        # Arbitrarily weight these forces
        sep.mult(2.5);
        ali.mult(1.0);
        coh.mult(1.0);
        # Add the force vectors to acceleration
        self.applyForce(sep);
        self.applyForce(ali);
        self.applyForce(coh);

    # Method to update location
    def update (self) :
        # Update velocity
        self.velocity.add(self.acceleration);
        # Limit speed
        self.velocity.limit(self.maxspeed);
        self.position.add(self.velocity);
        # Reset acceleration to 0 each cycle
        self.acceleration.mult(0);

    # A method that calculates and applies a steering force towards a target
    # STEER = DESIRED MINUS VELOCITY
    def seek (self,target):
        desired = p5.Vector.sub(target, self.position); # A vector pointing from the location to the target
        # Normalize desired and scale to maximum speed
        desired.normalize();
        desired.mult(self.maxspeed);
        # Steering = Desired minus Velocity
        steer = p5.Vector.sub(desired, self.velocity);
        steer.limit(self.maxforce); # Limit to maximum steering force
        return steer;

    # Draw boid as a circle
    def render (self) :
        fill(127, 127);
        stroke(200);
        ellipse(self.position.x, self.position.y, 16, 16);

    # Wraparound
    def borders (self) :
        if (self.position.x < -self.r): self.position.x = width + self.r;
        if (self.position.y < -self.r): self.position.y = height + self.r;
        if (self.position.x > width + self.r): self.position.x = -self.r;
        if (self.position.y > height + self.r): self.position.y = -self.r;


    # Separation
    # Method checks for nearby boids and steers away
    def separate (self, boids) :
        desiredseparation = 25.0;
        steer = createVector(0, 0);
        count = 0;
        # For every boid in the system, check if it's too close
        for i in range(len(boids)):
            d = p5.Vector.dist(self.position, boids[i].position);
            # If the distance is greater than 0 and less than an arbitrary amount (0 when you are yourself)
            if ((d > 0) and (d < desiredseparation)) :
              # Calculate vector pointing away from neighbor
              diff = p5.Vector.sub(self.position, boids[i].position);
              diff.normalize();
              diff.div(d); # Weight by distance
              steer.add(diff);
              count+=1; # Keep track of how many
        # Average -- divide by how many
        if (count > 0) :
            steer.div(count);


        # As long as the vector is greater than 0
        if (steer.mag() > 0) :
            # Implement Reynolds: Steering = Desired - Velocity
            steer.normalize();
            steer.mult(self.maxspeed);
            steer.sub(self.velocity);
            steer.limit(self.maxforce);

        return steer;


    # Alignment
    # For every nearby boid in the system, calculate the average velocity
    def align (self, boids) :
      neighbordist = 50;
      sum = createVector(0, 0);
      count = 0;
      for i in range(len(boids)):
        d = p5.Vector.dist(self.position, boids[i].position);
        if ((d > 0) and (d < neighbordist)) :
          sum.add(boids[i].velocity);
          count+=1;

      if (count > 0) :
        sum.div(count);
        sum.normalize();
        sum.mult(self.maxspeed);
        steer = p5.Vector.sub(sum, self.velocity);
        steer.limit(self.maxforce);
        return steer;
      else:
        return createVector(0, 0);

    # Cohesion
    # For the average location (i.e. center) of all nearby boids, calculate steering vector towards that location
    def cohesion  (self, boids) :
      neighbordist = 50;
      sum = createVector(0, 0); # Start with empty vector to accumulate all locations
      count = 0;
      for i in range(len(boids)):
        d = p5.Vector.dist(self.position, boids[i].position);
        if ((d > 0) and (d < neighbordist)) :
          sum.add(boids[i].position); # Add location
          count+=1;

      if (count > 0) :
        sum.div(count);
        return self.seek(sum); # Steer towards the location
      else:
        return createVector(0, 0);

              
          
================================================ FILE: docs/examples/transcrypt/sketch_004/sketch_004.py ================================================ # From Prof. Claudio Esperança examples for BrythonIDE # https://github.com/esperanc/brythonide/blob/master/demoSketches/boids.py boids = []; def setup() : createCanvas(720, 400); # Add an initial set of boids into the system for i in range(40): boids.append (Boid(random(720), random(400))) def draw() : background(51); # Run all the boids for boid in boids: boid.run(boids) # Boid class # Methods for Separation, Cohesion, Alignment added class Boid (object): def __init__(self, x, y) : self.acceleration = createVector(0, 0); self.velocity = p5.Vector.random2D(); self.position = createVector(x, y); self.r = 3.0; self.maxspeed = 3; # Maximum speed self.maxforce = 0.05; # Maximum steering force def run (self, boids): self.flock(boids); self.update(); self.borders(); self.render(); # Forces go into acceleration def applyForce (self,force): self.acceleration.add(force); # We accumulate a new acceleration each time based on three rules def flock (self, boids) : sep = self.separate(boids); # Separation ali = self.align(boids); # Alignment coh = self.cohesion(boids); # Cohesion # Arbitrarily weight these forces sep.mult(2.5); ali.mult(1.0); coh.mult(1.0); # Add the force vectors to acceleration self.applyForce(sep); self.applyForce(ali); self.applyForce(coh); # Method to update location def update (self) : # Update velocity self.velocity.add(self.acceleration); # Limit speed self.velocity.limit(self.maxspeed); self.position.add(self.velocity); # Reset acceleration to 0 each cycle self.acceleration.mult(0); # A method that calculates and applies a steering force towards a target # STEER = DESIRED MINUS VELOCITY def seek (self,target): desired = p5.Vector.sub(target, self.position); # A vector pointing from the location to the target # Normalize desired and scale to maximum speed desired.normalize(); desired.mult(self.maxspeed); # Steering = Desired minus Velocity steer = p5.Vector.sub(desired, self.velocity); steer.limit(self.maxforce); # Limit to maximum steering force return steer; # Draw boid as a circle def render (self) : fill(127, 127); stroke(200); ellipse(self.position.x, self.position.y, 16, 16); # Wraparound def borders (self) : if (self.position.x < -self.r): self.position.x = width + self.r; if (self.position.y < -self.r): self.position.y = height + self.r; if (self.position.x > width + self.r): self.position.x = -self.r; if (self.position.y > height + self.r): self.position.y = -self.r; # Separation # Method checks for nearby boids and steers away def separate (self, boids) : desiredseparation = 25.0; steer = createVector(0, 0); count = 0; # For every boid in the system, check if it's too close for i in range(len(boids)): d = p5.Vector.dist(self.position, boids[i].position); # If the distance is greater than 0 and less than an arbitrary amount (0 when you are yourself) if ((d > 0) and (d < desiredseparation)) : # Calculate vector pointing away from neighbor diff = p5.Vector.sub(self.position, boids[i].position); diff.normalize(); diff.div(d); # Weight by distance steer.add(diff); count+=1; # Keep track of how many # Average -- divide by how many if (count > 0) : steer.div(count); # As long as the vector is greater than 0 if (steer.mag() > 0) : # Implement Reynolds: Steering = Desired - Velocity steer.normalize(); steer.mult(self.maxspeed); steer.sub(self.velocity); steer.limit(self.maxforce); return steer; # Alignment # For every nearby boid in the system, calculate the average velocity def align (self, boids) : neighbordist = 50; sum = createVector(0, 0); count = 0; for i in range(len(boids)): d = p5.Vector.dist(self.position, boids[i].position); if ((d > 0) and (d < neighbordist)) : sum.add(boids[i].velocity); count+=1; if (count > 0) : sum.div(count); sum.normalize(); sum.mult(self.maxspeed); steer = p5.Vector.sub(sum, self.velocity); steer.limit(self.maxforce); return steer; else: return createVector(0, 0); # Cohesion # For the average location (i.e. center) of all nearby boids, calculate steering vector towards that location def cohesion (self, boids) : neighbordist = 50; sum = createVector(0, 0); # Start with empty vector to accumulate all locations count = 0; for i in range(len(boids)): d = p5.Vector.dist(self.position, boids[i].position); if ((d > 0) and (d < neighbordist)) : sum.add(boids[i].position); # Add location count+=1; if (count > 0) : sum.div(count); return self.seek(sum); # Steer towards the location else: return createVector(0, 0); ================================================ FILE: docs/examples/transcrypt/sketch_004/static/p5.js ================================================ /*! p5.js v1.0.0 February 29, 2020 */ !function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).p5=e()}}(function(){return function o(a,s,l){function u(t,e){if(!s[t]){if(!a[t]){var r="function"==typeof require&&require;if(!e&&r)return r(t,!0);if(h)return h(t,!0);var i=new Error("Cannot find module '"+t+"'");throw i.code="MODULE_NOT_FOUND",i}var n=s[t]={exports:{}};a[t][0].call(n.exports,function(e){return u(a[t][1][e]||e)},n,n.exports,o,a,s,l)}return s[t].exports}for(var h="function"==typeof require&&require,e=0;e>16&255,a[s++]=t>>8&255,a[s++]=255&t;2===o&&(t=u[e.charCodeAt(r)]<<2|u[e.charCodeAt(r+1)]>>4,a[s++]=255&t);1===o&&(t=u[e.charCodeAt(r)]<<10|u[e.charCodeAt(r+1)]<<4|u[e.charCodeAt(r+2)]>>2,a[s++]=t>>8&255,a[s++]=255&t);return a},r.fromByteArray=function(e){for(var t,r=e.length,i=r%3,n=[],o=0,a=r-i;o>2]+s[t<<4&63]+"==")):2==i&&(t=(e[r-2]<<8)+e[r-1],n.push(s[t>>10]+s[t>>4&63]+s[t<<2&63]+"="));return n.join("")};for(var s=[],u=[],h="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=0,o=i.length;n>18&63]+s[n>>12&63]+s[n>>6&63]+s[63&n]);return o.join("")}u["-".charCodeAt(0)]=62,u["_".charCodeAt(0)]=63},{}],20:[function(e,t,r){},{}],21:[function(N,e,F){(function(c){"use strict";var i=N("base64-js"),o=N("ieee754"),e="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;F.Buffer=c,F.SlowBuffer=function(e){+e!=e&&(e=0);return c.alloc(+e)},F.INSPECT_MAX_BYTES=50;var r=2147483647;function a(e){if(r>>1;case"base64":return O(e).length;default:if(n)return i?-1:R(e).length;t=(""+t).toLowerCase(),n=!0}}function d(e,t,r){var i=e[t];e[t]=e[r],e[r]=i}function p(e,t,r,i,n){if(0===e.length)return-1;if("string"==typeof r?(i=r,r=0):2147483647=e.length){if(n)return-1;r=e.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof t&&(t=c.from(t,i)),c.isBuffer(t))return 0===t.length?-1:m(e,t,r,i,n);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):m(e,[t],r,i,n);throw new TypeError("val must be string, number or Buffer")}function m(e,t,r,i,n){var o,a=1,s=e.length,l=t.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(e.length<2||t.length<2)return-1;s/=a=2,l/=2,r/=2}function u(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(n){var h=-1;for(o=r;o>8,n=r%256,o.push(n),o.push(i);return o}(t,e.length-r),e,r,i)}function b(e,t,r){return 0===t&&r===e.length?i.fromByteArray(e):i.fromByteArray(e.slice(t,r))}function _(e,t,r){r=Math.min(e.length,r);for(var i=[],n=t;n>>10&1023|55296),h=56320|1023&h),i.push(h),n+=c}return function(e){var t=e.length;if(t<=x)return String.fromCharCode.apply(String,e);var r="",i=0;for(;ithis.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e=e||"utf8";;)switch(e){case"hex":return M(this,t,r);case"utf8":case"utf-8":return _(this,t,r);case"ascii":return w(this,t,r);case"latin1":case"binary":return S(this,t,r);case"base64":return b(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,t,r);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}.apply(this,arguments)},c.prototype.equals=function(e){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===c.compare(this,e)},c.prototype.inspect=function(){var e="",t=F.INSPECT_MAX_BYTES;return e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(e+=" ... "),""},e&&(c.prototype[e]=c.prototype.inspect),c.prototype.compare=function(e,t,r,i,n){if(A(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),t<0||r>e.length||i<0||n>this.length)throw new RangeError("out of range index");if(n<=i&&r<=t)return 0;if(n<=i)return-1;if(r<=t)return 1;if(this===e)return 0;for(var o=(n>>>=0)-(i>>>=0),a=(r>>>=0)-(t>>>=0),s=Math.min(o,a),l=this.slice(i,n),u=e.slice(t,r),h=0;h>>=0,isFinite(r)?(r>>>=0,void 0===i&&(i="utf8")):(i=r,r=void 0)}var n=this.length-t;if((void 0===r||nthis.length)throw new RangeError("Attempt to write outside buffer bounds");i=i||"utf8";for(var o,a,s,l,u,h,c=!1;;)switch(i){case"hex":return g(this,e,t,r);case"utf8":case"utf-8":return u=t,h=r,D(R(e,(l=this).length-u),l,u,h);case"ascii":return v(this,e,t,r);case"latin1":case"binary":return v(this,e,t,r);case"base64":return o=this,a=t,s=r,D(O(e),o,a,s);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return y(this,e,t,r);default:if(c)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),c=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var x=4096;function w(e,t,r){var i="";r=Math.min(e.length,r);for(var n=t;ne.length)throw new RangeError("Index out of range")}function P(e,t,r,i){if(r+i>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function L(e,t,r,i,n){return t=+t,r>>>=0,n||P(e,0,r,4),o.write(e,t,r,i,23,4),r+4}function k(e,t,r,i,n){return t=+t,r>>>=0,n||P(e,0,r,8),o.write(e,t,r,i,52,8),r+8}c.prototype.slice=function(e,t){var r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):r>>=0,t>>>=0,r||T(e,t,this.length);for(var i=this[e],n=1,o=0;++o>>=0,t>>>=0,r||T(e,t,this.length);for(var i=this[e+--t],n=1;0>>=0,t||T(e,1,this.length),this[e]},c.prototype.readUInt16LE=function(e,t){return e>>>=0,t||T(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUInt16BE=function(e,t){return e>>>=0,t||T(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUInt32LE=function(e,t){return e>>>=0,t||T(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUInt32BE=function(e,t){return e>>>=0,t||T(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||T(e,t,this.length);for(var i=this[e],n=1,o=0;++o>>=0,t>>>=0,r||T(e,t,this.length);for(var i=t,n=1,o=this[e+--i];0>>=0,t||T(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){e>>>=0,t||T(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(e,t){e>>>=0,t||T(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(e,t){return e>>>=0,t||T(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return e>>>=0,t||T(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readFloatLE=function(e,t){return e>>>=0,t||T(e,4,this.length),o.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return e>>>=0,t||T(e,4,this.length),o.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return e>>>=0,t||T(e,8,this.length),o.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return e>>>=0,t||T(e,8,this.length),o.read(this,e,!1,52,8)},c.prototype.writeUIntLE=function(e,t,r,i){e=+e,t>>>=0,r>>>=0,i||C(this,e,t,r,Math.pow(2,8*r)-1,0);var n=1,o=0;for(this[t]=255&e;++o>>=0,r>>>=0,i||C(this,e,t,r,Math.pow(2,8*r)-1,0);var n=r-1,o=1;for(this[t+n]=255&e;0<=--n&&(o*=256);)this[t+n]=e/o&255;return t+r},c.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,1,255,0),this[t]=255&e,t+1},c.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},c.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeIntLE=function(e,t,r,i){if(e=+e,t>>>=0,!i){var n=Math.pow(2,8*r-1);C(this,e,t,r,n-1,-n)}var o=0,a=1,s=0;for(this[t]=255&e;++o>0)-s&255;return t+r},c.prototype.writeIntBE=function(e,t,r,i){if(e=+e,t>>>=0,!i){var n=Math.pow(2,8*r-1);C(this,e,t,r,n-1,-n)}var o=r-1,a=1,s=0;for(this[t+o]=255&e;0<=--o&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+r},c.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},c.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeFloatLE=function(e,t,r){return L(this,e,t,!0,r)},c.prototype.writeFloatBE=function(e,t,r){return L(this,e,t,!1,r)},c.prototype.writeDoubleLE=function(e,t,r){return k(this,e,t,!0,r)},c.prototype.writeDoubleBE=function(e,t,r){return k(this,e,t,!1,r)},c.prototype.copy=function(e,t,r,i){if(!c.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r=r||0,i||0===i||(i=this.length),t>=e.length&&(t=e.length),t=t||0,0=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t>>=0,r=void 0===r?this.length:r>>>0,"number"==typeof(e=e||0))for(o=t;o>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function O(e){return i.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(t,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function D(e,t,r,i){for(var n=0;n=t.length||n>=e.length);++n)t[n+r]=e[n];return n}function A(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function I(e){return e!=e}var U=function(){for(var e="0123456789abcdef",t=new Array(256),r=0;r<16;++r)for(var i=16*r,n=0;n<16;++n)t[i+n]=e[r]+e[n];return t}()}).call(this,N("buffer").Buffer)},{"base64-js":19,buffer:21,ieee754:30}],22:[function(e,t,r){"use strict";t.exports=e("./").polyfill()},{"./":23}],23:[function(z,r,i){(function(j,V){var e,t;e=this,t=function(){"use strict";function l(e){return"function"==typeof e}var r=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},i=0,t=void 0,n=void 0,a=function(e,t){f[i]=e,f[i+1]=t,2===(i+=2)&&(n?n(d):y())};var e="undefined"!=typeof window?window:void 0,o=e||{},s=o.MutationObserver||o.WebKitMutationObserver,u="undefined"==typeof self&&void 0!==j&&"[object process]"==={}.toString.call(j),h="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function c(){var e=setTimeout;return function(){return e(d,1)}}var f=new Array(1e3);function d(){for(var e=0;e":">",'"':""","'":"'","/":"/"};function S(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,function(e){return w[e]}):e}var M=function(){function i(e){var t,r=1=this.maxReplaces)break}for(a=0;r=this.regexp.exec(e);){if(void 0===(i=h(r[1].trim())))if("function"==typeof c){var d=c(e,r,t);i="string"==typeof d?d:""}else this.logger.warn("missed to pass in variable ".concat(r[1]," for interpolating ").concat(e)),i="";else"string"==typeof i||this.useRawValueToEscape||(i=v(i));if(i=this.escapeValue?u(this.escape(i)):u(i),e=e.replace(r[0],i),this.regexp.lastIndex=0,++a>=this.maxReplaces)break}return e}},{key:"nest",value:function(e,t,r){var i,n,o=D({},2>1,h=-7,c=r?n-1:0,f=r?-1:1,d=e[t+c];for(c+=f,o=d&(1<<-h)-1,d>>=-h,h+=s;0>=-h,h+=i;0>1,f=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,d=i?0:o-1,p=i?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=h):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),2<=(t+=1<=a+c?f/l:f*Math.pow(2,1-c))*l&&(a++,l/=2),h<=a+c?(s=0,a=h):1<=a+c?(s=(t*l-1)*Math.pow(2,n),a+=c):(s=t*Math.pow(2,c-1)*Math.pow(2,n),a=0));8<=n;e[r+d]=255&s,d+=p,s/=256,n-=8);for(a=a<Math.abs(e[0])&&(t=1),Math.abs(e[2])>Math.abs(e[t])&&(t=2),t}var C=4e150;function P(e,t){e.f+=t.f,e.b.f+=t.b.f}function u(e,t,r){return e=e.a,t=t.a,r=r.a,t.b.a===e?r.b.a===e?v(t.a,r.a)?b(r.b.a,t.a,r.a)<=0:0<=b(t.b.a,r.a,t.a):b(r.b.a,e,r.a)<=0:r.b.a===e?0<=b(t.b.a,e,t.a):(t=y(t.b.a,e,t.a),(e=y(r.b.a,e,r.a))<=t)}function L(e){e.a.i=null;var t=e.e;t.a.c=t.c,t.c.a=t.a,e.e=null}function h(e,t){c(e.a),e.c=!1,(e.a=t).i=e}function k(e){for(var t=e.a.a;(e=fe(e)).a.a===t;);return e.c&&(h(e,t=f(ce(e).a.b,e.a.e)),e=fe(e)),e}function R(e,t,r){var i=new he;return i.a=r,i.e=W(e.f,t.e,i),r.i=i}function O(e,t){switch(e.s){case 100130:return 0!=(1&t);case 100131:return 0!==t;case 100132:return 0>1]],s[a[u]])?le(r,u):ue(r,u)),s[o]=null,l[o]=r.b,r.b=o}else for(r.c[-(o+1)]=null;0Math.max(a.a,l.a))return!1;if(v(o,a)){if(0i.f&&(i.f*=2,i.c=oe(i.c,i.f+1)),0===i.b?r=n:(r=i.b,i.b=i.c[i.b]),i.e[r]=t,i.c[r]=n,i.d[n]=r,i.h&&ue(i,n),r}return i=e.a++,e.c[i]=t,-(i+1)}function ie(e){if(0===e.a)return se(e.b);var t=e.c[e.d[e.a-1]];if(0!==e.b.a&&v(ae(e.b),t))return se(e.b);for(;--e.a,0e.a||v(i[a],i[l])){n[r[o]=a]=o;break}n[r[o]=l]=o,o=s}}function ue(e,t){for(var r=e.d,i=e.e,n=e.c,o=t,a=r[o];;){var s=o>>1,l=r[s];if(0==s||v(i[l],i[a])){n[r[o]=a]=o;break}n[r[o]=l]=o,o=s}}function he(){this.e=this.a=null,this.f=0,this.c=this.b=this.h=this.d=!1}function ce(e){return e.e.c.b}function fe(e){return e.e.a.b}(i=q.prototype).x=function(){Y(this,0)},i.B=function(e,t){switch(e){case 100142:return;case 100140:switch(t){case 100130:case 100131:case 100132:case 100133:case 100134:return void(this.s=t)}break;case 100141:return void(this.m=!!t);default:return void Z(this,100900)}Z(this,100901)},i.y=function(e){switch(e){case 100142:return 0;case 100140:return this.s;case 100141:return this.m;default:Z(this,100900)}return!1},i.A=function(e,t,r){this.j[0]=e,this.j[1]=t,this.j[2]=r},i.z=function(e,t){var r=t||null;switch(e){case 100100:case 100106:this.h=r;break;case 100104:case 100110:this.l=r;break;case 100101:case 100107:this.k=r;break;case 100102:case 100108:this.i=r;break;case 100103:case 100109:this.p=r;break;case 100105:case 100111:this.o=r;break;case 100112:this.r=r;break;default:Z(this,100900)}},i.C=function(e,t){var r=!1,i=[0,0,0];Y(this,2);for(var n=0;n<3;++n){var o=e[n];o<-1e150&&(o=-1e150,r=!0),1e150n[u]&&(n[u]=h,a[u]=l)}if(l=0,n[1]-o[1]>n[0]-o[0]&&(l=1),n[2]-o[2]>n[l]-o[l]&&(l=2),o[l]>=n[l])i[0]=0,i[1]=0,i[2]=1;else{for(n=0,o=s[l],a=a[l],s=[0,0,0],o=[o.g[0]-a.g[0],o.g[1]-a.g[1],o.g[2]-a.g[2]],u=[0,0,0],l=r.e;l!==r;l=l.e)u[0]=l.g[0]-a.g[0],u[1]=l.g[1]-a.g[1],u[2]=l.g[2]-a.g[2],s[0]=o[1]*u[2]-o[2]*u[1],s[1]=o[2]*u[0]-o[0]*u[2],s[2]=o[0]*u[1]-o[1]*u[0],n<(h=s[0]*s[0]+s[1]*s[1]+s[2]*s[2])&&(n=h,i[0]=s[0],i[1]=s[1],i[2]=s[2]);n<=0&&(i[0]=i[1]=i[2]=0,i[T(o)]=1)}r=!0}for(s=T(i),l=this.b.c,n=(s+1)%3,a=(s+2)%3,s=0>=l,h-=l,g!=o){if(g==a)break;for(var v=g>8,++y;var _=b;if(i>=8;null!==m&&s<4096&&(p[s++]=m<<8|_,u+1<=s&&l<12&&(++l,u=u<<1|1)),m=g}else s=1+a,u=(1<<(l=n+1))-1,m=null}return f!==i&&console.log("Warning, gif stream shorter than expected."),r}try{r.GifWriter=function(v,e,t,r){var y=0,i=void 0===(r=void 0===r?{}:r).loop?null:r.loop,b=void 0===r.palette?null:r.palette;if(e<=0||t<=0||65535>=1;)++n;if(a=1<>8&255,v[y++]=255&t,v[y++]=t>>8&255,v[y++]=(null!==b?128:0)|n,v[y++]=o,v[y++]=0,null!==b)for(var s=0,l=b.length;s>16&255,v[y++]=u>>8&255,v[y++]=255&u}if(null!==i){if(i<0||65535>8&255,v[y++]=0}var x=!1;this.addFrame=function(e,t,r,i,n,o){if(!0===x&&(--y,x=!1),o=void 0===o?{}:o,e<0||t<0||65535>=1;)++u;l=1<>8&255,v[y++]=d,v[y++]=0),v[y++]=44,v[y++]=255&e,v[y++]=e>>8&255,v[y++]=255&t,v[y++]=t>>8&255,v[y++]=255&r,v[y++]=r>>8&255,v[y++]=255&i,v[y++]=i>>8&255,v[y++]=!0===a?128|u-1:0,!0===a)for(var p=0,m=s.length;p>16&255,v[y++]=g>>8&255,v[y++]=255&g}return y=function(t,r,e,i){t[r++]=e;var n=r++,o=1<>=8,h-=8,r===n+256&&(t[n]=255,n=r++)}function d(e){c|=e<>=8,h-=8,r===n+256&&(t[n]=255,n=r++);4096===l?(d(o),l=1+s,u=e+1,m={}):(1<>7,n=1<<1+(7&r);x[e++],x[e++];var o=null,a=null;i&&(o=e,e+=3*(a=n));var s=!0,l=[],u=0,h=null,c=0,f=null;for(this.width=w,this.height=t;s&&e>2&7,e++;break;case 254:for(;;){if(!(0<=(C=x[e++])))throw Error("Invalid block size");if(0===C)break;e+=C}break;default:throw new Error("Unknown graphic control label: 0x"+x[e-1].toString(16))}break;case 44:var p=x[e++]|x[e++]<<8,m=x[e++]|x[e++]<<8,g=x[e++]|x[e++]<<8,v=x[e++]|x[e++]<<8,y=x[e++],b=y>>6&1,_=1<<1+(7&y),S=o,M=a,E=!1;if(y>>7){E=!0;S=e,e+=3*(M=_)}var T=e;for(e++;;){var C;if(!(0<=(C=x[e++])))throw Error("Invalid block size");if(0===C)break;e+=C}l.push({x:p,y:m,width:g,height:v,has_local_palette:E,palette_offset:S,palette_size:M,data_offset:T,data_length:e-T,transparent_index:h,interlaced:!!b,delay:u,disposal:c});break;case 59:s=!1;break;default:throw new Error("Unknown gif block: 0x"+x[e-1].toString(16))}this.numFrames=function(){return l.length},this.loopCount=function(){return f},this.frameInfo=function(e){if(e<0||e>=l.length)throw new Error("Frame index out of range.");return l[e]},this.decodeAndBlitFrameBGRA=function(e,t){var r=this.frameInfo(e),i=r.width*r.height,n=new Uint8Array(i);P(x,r.data_offset,n,i);var o=r.palette_offset,a=r.transparent_index;null===a&&(a=256);var s=r.width,l=w-s,u=s,h=4*(r.y*w+r.x),c=4*((r.y+r.height)*w+r.x),f=h,d=4*l;!0===r.interlaced&&(d+=4*w*7);for(var p=8,m=0,g=n.length;m>=1)),v===a)f+=4;else{var y=x[o+3*v],b=x[o+3*v+1],_=x[o+3*v+2];t[f++]=_,t[f++]=b,t[f++]=y,t[f++]=255}--u}},this.decodeAndBlitFrameRGBA=function(e,t){var r=this.frameInfo(e),i=r.width*r.height,n=new Uint8Array(i);P(x,r.data_offset,n,i);var o=r.palette_offset,a=r.transparent_index;null===a&&(a=256);var s=r.width,l=w-s,u=s,h=4*(r.y*w+r.x),c=4*((r.y+r.height)*w+r.x),f=h,d=4*l;!0===r.interlaced&&(d+=4*w*7);for(var p=8,m=0,g=n.length;m>=1)),v===a)f+=4;else{var y=x[o+3*v],b=x[o+3*v+1],_=x[o+3*v+2];t[f++]=y,t[f++]=b,t[f++]=_,t[f++]=255}--u}}}}catch(e){}},{}],33:[function(jr,t,r){(function(Gr){var e;e=this,function(E){"use strict";function e(e){if(null==this)throw TypeError();var t=String(this),r=t.length,i=e?Number(e):0;if(i!=i&&(i=0),!(i<0||r<=i)){var n,o=t.charCodeAt(i);return 55296<=o&&o<=56319&&i+1>>=1,t}function _(e,t,r){if(!t)return r;for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<>>16-t;return e.tag>>>=t,e.bitcount-=t,i+r}function x(e,t){for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<>>=1,++n,r+=t.table[n],0<=(i-=t.table[n]););return e.tag=o,e.bitcount-=n,t.trans[r+i]}function w(e,t,r){var i,n,o,a,s,l;for(i=_(e,5,257),n=_(e,5,1),o=_(e,4,4),a=0;a<19;++a)g[a]=0;for(a=0;athis.x2&&(this.x2=e)),"number"==typeof t&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=t,this.y2=t),tthis.y2&&(this.y2=t))},C.prototype.addX=function(e){this.addPoint(e,null)},C.prototype.addY=function(e){this.addPoint(null,e)},C.prototype.addBezier=function(e,t,r,i,n,o,a,s){var l=this,u=[e,t],h=[r,i],c=[n,o],f=[a,s];this.addPoint(e,t),this.addPoint(a,s);for(var d=0;d<=1;d++){var p=6*u[d]-12*h[d]+6*c[d],m=-3*u[d]+9*h[d]-9*c[d]+3*f[d],g=3*h[d]-3*u[d];if(0!=m){var v=Math.pow(p,2)-4*g*m;if(!(v<0)){var y=(-p+Math.sqrt(v))/(2*m);0>8&255,255&e]},A.USHORT=U(2),D.SHORT=function(e){return 32768<=e&&(e=-(65536-e)),[e>>8&255,255&e]},A.SHORT=U(2),D.UINT24=function(e){return[e>>16&255,e>>8&255,255&e]},A.UINT24=U(3),D.ULONG=function(e){return[e>>24&255,e>>16&255,e>>8&255,255&e]},A.ULONG=U(4),D.LONG=function(e){return R<=e&&(e=-(2*R-e)),[e>>24&255,e>>16&255,e>>8&255,255&e]},A.LONG=U(4),D.FIXED=D.ULONG,A.FIXED=A.ULONG,D.FWORD=D.SHORT,A.FWORD=A.SHORT,D.UFWORD=D.USHORT,A.UFWORD=A.USHORT,D.LONGDATETIME=function(e){return[0,0,0,0,e>>24&255,e>>16&255,e>>8&255,255&e]},A.LONGDATETIME=U(8),D.TAG=function(e){return k.argument(4===e.length,"Tag should be exactly 4 ASCII characters."),[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]},A.TAG=U(4),D.Card8=D.BYTE,A.Card8=A.BYTE,D.Card16=D.USHORT,A.Card16=A.USHORT,D.OffSize=D.BYTE,A.OffSize=A.BYTE,D.SID=D.USHORT,A.SID=A.USHORT,D.NUMBER=function(e){return-107<=e&&e<=107?[e+139]:108<=e&&e<=1131?[247+((e-=108)>>8),255&e]:-1131<=e&&e<=-108?[251+((e=-e-108)>>8),255&e]:-32768<=e&&e<=32767?D.NUMBER16(e):D.NUMBER32(e)},A.NUMBER=function(e){return D.NUMBER(e).length},D.NUMBER16=function(e){return[28,e>>8&255,255&e]},A.NUMBER16=U(3),D.NUMBER32=function(e){return[29,e>>24&255,e>>16&255,e>>8&255,255&e]},A.NUMBER32=U(5),D.REAL=function(e){var t=e.toString(),r=/\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec(t);if(r){var i=parseFloat("1e"+((r[2]?+r[2]:0)+r[1].length));t=(Math.round(e*i)/i).toString()}for(var n="",o=0,a=t.length;o>8&255,t[t.length]=255&i}return t},A.UTF16=function(e){return 2*e.length};var N={"x-mac-croatian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈ƫȅ ÀÃÕŒœĐ—“”‘’÷◊©⁄€‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ","x-mac-cyrillic":"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю","x-mac-gaelic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØḂ±≤≥ḃĊċḊḋḞḟĠġṀæøṁṖṗɼƒſṠ«»… ÀÃÕŒœ–—“”‘’ṡẛÿŸṪ€‹›Ŷŷṫ·Ỳỳ⁊ÂÊÁËÈÍÎÏÌÓÔ♣ÒÚÛÙıÝýŴŵẄẅẀẁẂẃ","x-mac-greek":"Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦€ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ­","x-mac-icelandic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüݰ¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-inuit":"ᐃᐄᐅᐆᐊᐋᐱᐲᐳᐴᐸᐹᑉᑎᑏᑐᑑᑕᑖᑦᑭᑮᑯᑰᑲᑳᒃᒋᒌᒍᒎᒐᒑ°ᒡᒥᒦ•¶ᒧ®©™ᒨᒪᒫᒻᓂᓃᓄᓅᓇᓈᓐᓯᓰᓱᓲᓴᓵᔅᓕᓖᓗᓘᓚᓛᓪᔨᔩᔪᔫᔭ… ᔮᔾᕕᕖᕗ–—“”‘’ᕘᕙᕚᕝᕆᕇᕈᕉᕋᕌᕐᕿᖀᖁᖂᖃᖄᖅᖏᖐᖑᖒᖓᖔᖕᙱᙲᙳᙴᙵᙶᖖᖠᖡᖢᖣᖤᖥᖦᕼŁł","x-mac-ce":"ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ",macintosh:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-romanian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂȘ∞±≤≥¥µ∂∑∏π∫ªºΩăș¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›Țț‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-turkish":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙˆ˜¯˘˙˚¸˝˛ˇ"};O.MACSTRING=function(e,t,r,i){var n=N[i];if(void 0!==n){for(var o="",a=0;a>8&255,l+256&255)}return o}D.MACSTRING=function(e,t){var r=function(e){if(!F)for(var t in F={},N)F[t]=new String(t);var r=F[e];if(void 0!==r){if(B){var i=B.get(r);if(void 0!==i)return i}var n=N[e];if(void 0!==n){for(var o={},a=0;a>8,t[c+1]=255&f,t=t.concat(i[h])}return t},A.TABLE=function(e){for(var t=0,r=e.fields.length,i=0;i>1,t.skip("uShort",3),e.glyphIndexMap={};for(var a=new se.Parser(r,i+n+14),s=new se.Parser(r,i+n+16+2*o),l=new se.Parser(r,i+n+16+4*o),u=new se.Parser(r,i+n+16+6*o),h=i+n+16+8*o,c=0;c>4,o=15&i;if(15==n)break;if(t+=r[n],15==o)break;t+=r[o]}return parseFloat(t)}(e);if(32<=t&&t<=246)return t-139;if(247<=t&&t<=250)return 256*(t-247)+e.parseByte()+108;if(251<=t&&t<=254)return 256*-(t-251)-e.parseByte()-108;throw new Error("Invalid b0 "+t)}function Te(e,t,r){t=void 0!==t?t:0;var i=new se.Parser(e,t),n=[],o=[];for(r=void 0!==r?r:e.length;i.relativeOffset>1,T.length=0,P=!0}return function e(t){for(var r,i,n,o,a,s,l,u,h,c,f,d,p=0;pMath.abs(d-R)?k=f+T.shift():R=d+T.shift(),E.curveTo(y,b,_,x,l,u),E.curveTo(h,c,f,d,k,R);break;default:console.log("Glyph "+v.index+": unknown operator 1200"+m),T.length=0}break;case 14:0>3;break;case 21:2>16),p+=2;break;case 29:a=T.pop()+g.gsubrsBias,(s=g.gsubrs[a])&&e(s);break;case 30:for(;0=r.begin&&e=fe.length){var a=i.parseChar();r.names.push(i.parseString(a))}break;case 2.5:r.numberOfGlyphs=i.parseUShort(),r.offset=new Array(r.numberOfGlyphs);for(var s=0;st.value.tag?1:-1}),t.fields=t.fields.concat(i),t.fields=t.fields.concat(n),t}function gt(e,t,r){for(var i=0;i 123 are reserved for internal usage");d|=1<>>1,o=e[n].tag;if(o===t)return n;o>>1,o=e[n];if(o===t)return n;o>>1,a=(r=e[o]).start;if(a===t)return r;a(r=e[i-1]).end?0:r}function xt(e,t){this.font=e,this.tableName=t}function wt(e){xt.call(this,e,"gpos")}function St(e){xt.call(this,e,"gsub")}function Mt(e,t){var r=e.length;if(r!==t.length)return!1;for(var i=0;it.points.length-1||i.matchedPoints[1]>n.points.length-1)throw Error("Matched points out of range in "+t.name);var a=t.points[i.matchedPoints[0]],s=n.points[i.matchedPoints[1]],l={xScale:i.xScale,scale01:i.scale01,scale10:i.scale10,yScale:i.yScale,dx:0,dy:0};s=kt([s],l)[0],l.dx=a.x-s.x,l.dy=a.y-s.y,o=kt(n.points,l)}t.points=t.points.concat(o)}}return Rt(t.points)}(wt.prototype=xt.prototype={searchTag:yt,binSearch:bt,getTable:function(e){var t=this.font.tables[this.tableName];return!t&&e&&(t=this.font.tables[this.tableName]=this.createDefaultTable()),t},getScriptNames:function(){var e=this.getTable();return e?e.scripts.map(function(e){return e.tag}):[]},getDefaultScriptName:function(){var e=this.getTable();if(e){for(var t=!1,r=0;r=s[u-1].tag,"Features must be added in alphabetical order."),o={tag:r,feature:{params:0,lookupListIndexes:[]}},s.push(o),a.push(u),o.feature}}},getLookupTables:function(e,t,r,i,n){var o=this.getFeatureTable(e,t,r,n),a=[];if(o){for(var s,l=o.lookupListIndexes,u=this.font.tables[this.tableName].lookups,h=0;h",s),t.stack.push(Math.round(64*s))}function vr(e,t){var r=t.stack,i=r.pop(),n=t.fv,o=t.pv,a=t.ppem,s=t.deltaBase+16*(e-1),l=t.deltaShift,u=t.z0;E.DEBUG&&console.log(t.step,"DELTAP["+e+"]",i,r);for(var h=0;h>4)===a){var d=(15&f)-8;0<=d&&d++,E.DEBUG&&console.log(t.step,"DELTAPFIX",c,"by",d*l);var p=u[c];n.setRelative(p,p,d*l,o)}}}function yr(e,t){var r=t.stack,i=r.pop();E.DEBUG&&console.log(t.step,"ROUND[]"),r.push(64*t.round(i/64))}function br(e,t){var r=t.stack,i=r.pop(),n=t.ppem,o=t.deltaBase+16*(e-1),a=t.deltaShift;E.DEBUG&&console.log(t.step,"DELTAC["+e+"]",i,r);for(var s=0;s>4)===n){var h=(15&u)-8;0<=h&&h++;var c=h*a;E.DEBUG&&console.log(t.step,"DELTACFIX",l,"by",c),t.cvt[l]+=c}}}function _r(e,t){var r,i,n=t.stack,o=n.pop(),a=n.pop(),s=t.z2[o],l=t.z1[a];E.DEBUG&&console.log(t.step,"SDPVTL["+e+"]",o,a),i=e?(r=s.y-l.y,l.x-s.x):(r=l.x-s.x,l.y-s.y),t.dpv=Zt(r,i)}function xr(e,t){var r=t.stack,i=t.prog,n=t.ip;E.DEBUG&&console.log(t.step,"PUSHB["+e+"]");for(var o=0;o":"_")+(i?"R":"_")+(0===n?"Gr":1===n?"Bl":2===n?"Wh":"")+"]",e?c+"("+o.cvt[c]+","+u+")":"",f,"(d =",a,"->",l*s,")"),o.rp1=o.rp0,o.rp2=f,t&&(o.rp0=f)}Ft.prototype.exec=function(e,t){if("number"!=typeof t)throw new Error("Point size is not a number!");if(!(2",i),s.interpolate(c,o,a,l),s.touch(c)}e.loop=1},dr.bind(void 0,0),dr.bind(void 0,1),function(e){for(var t=e.stack,r=e.rp0,i=e.z0[r],n=e.loop,o=e.fv,a=e.pv,s=e.z1;n--;){var l=t.pop(),u=s[l];E.DEBUG&&console.log(e.step,(1=a.width||t>=a.height?[0,0,0,0]:this._getPixel(e,t);var s=new l.default.Image(r,i);return s.canvas.getContext("2d").drawImage(a,e,t,r*o,i*o,0,0,r,i),s},l.default.Renderer.prototype.textLeading=function(e){return"number"==typeof e?(this._setProperty("_textLeading",e),this._pInst):this._textLeading},l.default.Renderer.prototype.textSize=function(e){return"number"==typeof e?(this._setProperty("_textSize",e),this._setProperty("_textLeading",e*y._DEFAULT_LEADMULT),this._applyTextProperties()):this._textSize},l.default.Renderer.prototype.textStyle=function(e){return e?(e!==y.NORMAL&&e!==y.ITALIC&&e!==y.BOLD&&e!==y.BOLDITALIC||this._setProperty("_textStyle",e),this._applyTextProperties()):this._textStyle},l.default.Renderer.prototype.textAscent=function(){return null===this._textAscent&&this._updateTextMetrics(),this._textAscent},l.default.Renderer.prototype.textDescent=function(){return null===this._textDescent&&this._updateTextMetrics(),this._textDescent},l.default.Renderer.prototype.textAlign=function(e,t){return void 0!==e?(this._setProperty("_textAlign",e),void 0!==t&&this._setProperty("_textBaseline",t),this._applyTextProperties()):{horizontal:this._textAlign,vertical:this._textBaseline}},l.default.Renderer.prototype.text=function(e,t,r,i,n){var o,a,s,l,u,h,c,f,d=this._pInst,p=Number.MAX_VALUE;if((this._doFill||this._doStroke)&&void 0!==e){if("string"!=typeof e&&(e=e.toString()),o=(e=e.replace(/(\t)/g," ")).split("\n"),void 0!==i){for(s=f=0;ss.HALF_PI&&e<=3*s.HALF_PI?Math.atan(r/i*Math.tan(e))+s.PI:Math.atan(r/i*Math.tan(e))+s.TWO_PI,t=t<=s.HALF_PI?Math.atan(r/i*Math.tan(t)):t>s.HALF_PI&&t<=3*s.HALF_PI?Math.atan(r/i*Math.tan(t))+s.PI:Math.atan(r/i*Math.tan(t))+s.TWO_PI),tv||Math.abs(this.accelerationY-this.pAccelerationY)>v||Math.abs(this.accelerationZ-this.pAccelerationZ)>v)&&e();var t=this.deviceTurned||window.deviceTurned;if("function"==typeof t){var r=this.rotationX+180,i=this.pRotationX+180,n=c+180;0>>24],i+=x[(16711680&C)>>16],n+=x[(65280&C)>>8],o+=x[255&C],r+=k[_],s++}w[l=T+y]=a/r,S[l]=i/r,M[l]=n/r,E[l]=o/r}T+=d}for(h=(u=-P)*d,b=T=0;b>>16,e[r+1]=(65280&t[i])>>>8,e[r+2]=255&t[i],e[r+3]=(4278190080&t[i])>>>24},O._toImageData=function(e){return e instanceof ImageData?e:e.getContext("2d").getImageData(0,0,e.width,e.height)},O._createImageData=function(e,t){return O._tmpCanvas=document.createElement("canvas"),O._tmpCtx=O._tmpCanvas.getContext("2d"),this._tmpCtx.createImageData(e,t)},O.apply=function(e,t,r){var i=e.getContext("2d"),n=i.getImageData(0,0,e.width,e.height),o=t(n,r);o instanceof ImageData?i.putImageData(o,0,0,0,0,e.width,e.height):i.putImageData(n,0,0,0,0,e.width,e.height)},O.threshold=function(e,t){var r=O._toPixels(e);void 0===t&&(t=.5);for(var i=Math.floor(255*t),n=0;n>8)/i,r[n+1]=255*(a*t>>8)/i,r[n+2]=255*(s*t>>8)/i}},O.dilate=function(e){for(var t,r,i,n,o,a,s,l,u,h,c,f,d,p,m,g,v,y=O._toPixels(e),b=0,_=y.length?y.length/4:0,x=new Int32Array(_);b<_;)for(r=(t=b)+e.width;b>16&255)+151*(i>>8&255)+28*(255&i))<(m=77*(c>>16&255)+151*(c>>8&255)+28*(255&c))&&(n=c,o=m),o<(p=77*((h=O._getARGB(y,a))>>16&255)+151*(h>>8&255)+28*(255&h))&&(n=h,o=p),o<(g=77*(f>>16&255)+151*(f>>8&255)+28*(255&f))&&(n=f,o=g),o<(v=77*(d>>16&255)+151*(d>>8&255)+28*(255&d))&&(n=d,o=v),x[b++]=n;O._setPixels(y,x)},O.erode=function(e){for(var t,r,i,n,o,a,s,l,u,h,c,f,d,p,m,g,v,y=O._toPixels(e),b=0,_=y.length?y.length/4:0,x=new Int32Array(_);b<_;)for(r=(t=b)+e.width;b>16&255)+151*(c>>8&255)+28*(255&c))<(o=77*(i>>16&255)+151*(i>>8&255)+28*(255&i))&&(n=c,o=m),(p=77*((h=O._getARGB(y,a))>>16&255)+151*(h>>8&255)+28*(255&h))>16&255)+151*(f>>8&255)+28*(255&f))>16&255)+151*(d>>8&255)+28*(255&d))=r){var i=Math.floor(t.timeDisplayed/r);if(t.timeDisplayed=0,t.displayIndex+=i,t.loopCount=Math.floor(t.displayIndex/t.numFrames),null!==t.loopLimit&&t.loopCount>=t.loopLimit)t.playing=!1;else{var n=t.displayIndex%t.numFrames;this.drawingContext.putImageData(t.frames[n].image,0,0),t.displayIndex=n,this.setModified(!0)}}}},n.default.Image.prototype._setProperty=function(e,t){this[e]=t,this.setModified(!0)},n.default.Image.prototype.loadPixels=function(){n.default.Renderer2D.prototype.loadPixels.call(this),this.setModified(!0)},n.default.Image.prototype.updatePixels=function(e,t,r,i){n.default.Renderer2D.prototype.updatePixels.call(this,e,t,r,i),this.setModified(!0)},n.default.Image.prototype.get=function(e,t,r,i){return n.default._validateParameters("p5.Image.get",arguments),n.default.Renderer2D.prototype.get.apply(this,arguments)},n.default.Image.prototype._getPixel=n.default.Renderer2D.prototype._getPixel,n.default.Image.prototype.set=function(e,t,r){n.default.Renderer2D.prototype.set.call(this,e,t,r),this.setModified(!0)},n.default.Image.prototype.resize=function(e,t){0===e&&0===t?(e=this.canvas.width,t=this.canvas.height):0===e?e=this.canvas.width*t/this.canvas.height:0===t&&(t=this.canvas.height*e/this.canvas.width),e=Math.floor(e),t=Math.floor(t);var r=document.createElement("canvas");if(r.width=e,r.height=t,this.gifProperties)for(var i=this.gifProperties,n=function(e,t){for(var r=0,i=0;i/g,">").replace(/"/g,""").replace(/'/g,"'")}function l(e,t){t&&!0!==t&&"true"!==t||(t="");var r="";return(e=e||"untitled")&&e.includes(".")&&(r=e.split(".").pop()),t&&r!==t&&(r=t,e="".concat(e,".").concat(r)),[e,r]}e("../core/error_helpers"),v.default.prototype.loadJSON=function(){for(var e=arguments.length,t=new Array(e),r=0;r"),n.print("");if(n.print(' '),n.print(""),n.print(""),n.print(" "),"0"!==o[0]){n.print(" ");for(var h=0;h".concat(c)),n.print(" ")}n.print(" ")}for(var f=0;f");for(var d=0;d".concat(p)),n.print(" ")}n.print(" ")}n.print("
"),n.print(""),n.print("")}n.close(),n.clear()},v.default.prototype.writeFile=function(e,t,r){var i="application/octet-stream";v.default.prototype._isSafari()&&(i="text/plain");var n=new Blob(e,{type:i});v.default.prototype.downloadFile(n,t,r)},v.default.prototype.downloadFile=function(e,t,r){var i=l(t,r),n=i[0];if(e instanceof Blob)s.default.saveAs(e,n);else{var o=document.createElement("a");if(o.href=e,o.download=n,o.onclick=function(e){var t;t=e,document.body.removeChild(t.target),e.stopPropagation()},o.style.display="none",document.body.appendChild(o),v.default.prototype._isSafari()){var a="Hello, Safari user! To download this file...\n";a+="1. Go to File --\x3e Save As.\n",a+='2. Choose "Page Source" as the Format.\n',a+='3. Name it with this extension: ."'.concat(i[1],'"'),alert(a)}o.click()}},v.default.prototype._checkFileExtension=l,v.default.prototype._isSafari=function(){return 0>>0},getSeed:function(){return t},rand:function(){return(r=(1664525*r+1013904223)%i)/i}});n.setSeed(e),_=new Array(4096);for(var o=0;o<4096;o++)_[o]=n.rand()};var o=n.default;r.default=o},{"../core/main":49}],82:[function(e,t,r){"use strict";function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i,l=(i=e("../core/main"))&&i.__esModule?i:{default:i},o=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==a(e)&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var o=i?Object.getOwnPropertyDescriptor(e,n):null;o&&(o.get||o.set)?Object.defineProperty(r,n,o):r[n]=e[n]}r.default=e,t&&t.set(e,r);return r}(e("../core/constants"));function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}l.default.Vector=function(e,t,r){var i,n,o;o=e instanceof l.default?(this.p5=e,i=t[0]||0,n=t[1]||0,t[2]||0):(i=e||0,n=t||0,r||0),this.x=i,this.y=n,this.z=o},l.default.Vector.prototype.toString=function(){return"p5.Vector Object : [".concat(this.x,", ").concat(this.y,", ").concat(this.z,"]")},l.default.Vector.prototype.set=function(e,t,r){return e instanceof l.default.Vector?(this.x=e.x||0,this.y=e.y||0,this.z=e.z||0):e instanceof Array?(this.x=e[0]||0,this.y=e[1]||0,this.z=e[2]||0):(this.x=e||0,this.y=t||0,this.z=r||0),this},l.default.Vector.prototype.copy=function(){return this.p5?new l.default.Vector(this.p5,[this.x,this.y,this.z]):new l.default.Vector(this.x,this.y,this.z)},l.default.Vector.prototype.add=function(e,t,r){return e instanceof l.default.Vector?(this.x+=e.x||0,this.y+=e.y||0,this.z+=e.z||0):e instanceof Array?(this.x+=e[0]||0,this.y+=e[1]||0,this.z+=e[2]||0):(this.x+=e||0,this.y+=t||0,this.z+=r||0),this};function u(e,t){return 0!==e&&(this.x=this.x%e),0!==t&&(this.y=this.y%t),this}function h(e,t,r){return 0!==e&&(this.x=this.x%e),0!==t&&(this.y=this.y%t),0!==r&&(this.z=this.z%r),this}l.default.Vector.prototype.rem=function(e,t,r){if(e instanceof l.default.Vector){if(Number.isFinite(e.x)&&Number.isFinite(e.y)&&Number.isFinite(e.z)){var i=parseFloat(e.x),n=parseFloat(e.y),o=parseFloat(e.z);h.call(this,i,n,o)}}else if(e instanceof Array)e.every(function(e){return Number.isFinite(e)})&&(2===e.length&&u.call(this,e[0],e[1]),3===e.length&&h.call(this,e[0],e[1],e[2]));else if(1===arguments.length){if(Number.isFinite(e)&&0!==e)return this.x=this.x%e,this.y=this.y%e,this.z=this.z%e,this}else if(2===arguments.length){var a=Array.prototype.slice.call(arguments);a.every(function(e){return Number.isFinite(e)})&&2===a.length&&u.call(this,a[0],a[1])}else if(3===arguments.length){var s=Array.prototype.slice.call(arguments);s.every(function(e){return Number.isFinite(e)})&&3===s.length&&h.call(this,s[0],s[1],s[2])}},l.default.Vector.prototype.sub=function(e,t,r){return e instanceof l.default.Vector?(this.x-=e.x||0,this.y-=e.y||0,this.z-=e.z||0):e instanceof Array?(this.x-=e[0]||0,this.y-=e[1]||0,this.z-=e[2]||0):(this.x-=e||0,this.y-=t||0,this.z-=r||0),this},l.default.Vector.prototype.mult=function(e){return"number"==typeof e&&isFinite(e)?(this.x*=e,this.y*=e,this.z*=e):console.warn("p5.Vector.prototype.mult:","n is undefined or not a finite number"),this},l.default.Vector.prototype.div=function(e){return"number"==typeof e&&isFinite(e)?0===e?console.warn("p5.Vector.prototype.div:","divide by 0"):(this.x/=e,this.y/=e,this.z/=e):console.warn("p5.Vector.prototype.div:","n is undefined or not a finite number"),this},l.default.Vector.prototype.mag=function(){return Math.sqrt(this.magSq())},l.default.Vector.prototype.magSq=function(){var e=this.x,t=this.y,r=this.z;return e*e+t*t+r*r},l.default.Vector.prototype.dot=function(e,t,r){return e instanceof l.default.Vector?this.dot(e.x,e.y,e.z):this.x*(e||0)+this.y*(t||0)+this.z*(r||0)},l.default.Vector.prototype.cross=function(e){var t=this.y*e.z-this.z*e.y,r=this.z*e.x-this.x*e.z,i=this.x*e.y-this.y*e.x;return this.p5?new l.default.Vector(this.p5,[t,r,i]):new l.default.Vector(t,r,i)},l.default.Vector.prototype.dist=function(e){return e.copy().sub(this).mag()},l.default.Vector.prototype.normalize=function(){var e=this.mag();return 0!==e&&this.mult(1/e),this},l.default.Vector.prototype.limit=function(e){var t=this.magSq();return e*e>>0},n.default.prototype.randomSeed=function(e){this._lcgSetSeed(o,e),this._gaussian_previous=!1},n.default.prototype.random=function(e,t){var r;if(n.default._validateParameters("random",arguments),r=null!=this[o]?this._lcg(o):Math.random(),void 0===e)return r;if(void 0===t)return e instanceof Array?e[Math.floor(r*e.length)]:r*e;if(tf){var P=p,L=l,k=u;p=d+f*(s&&d=t&&(r=r.substring(r.length-t,r.length)),r}},n.default.prototype.unhex=function(e){return e instanceof Array?e.map(n.default.prototype.unhex):parseInt("0x".concat(e),16)};var o=n.default;r.default=o},{"../core/main":49}],90:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i,a=(i=e("../core/main"))&&i.__esModule?i:{default:i};function n(e,t,r){var i=e<0,n=i?e.toString().substring(1):e.toString(),o=n.indexOf("."),a=-1!==o?n.substring(0,o):n,s=-1!==o?n.substring(o+1):"",l=i?"-":"";if(void 0!==r){var u="";(-1!==o||0r&&(s=s.substring(0,r));for(var h=0;hi.length)for(var o=t-(i+=-1===r?".":"").length+1,a=0;a=d.TWO_PI?"".concat("ellipse","|").concat(u,"|"):"".concat("arc","|").concat(a,"|").concat(s,"|").concat(l,"|").concat(u,"|"),!this.geometryInHash(t)){var h=new T.default.Geometry(u,1,function(){if(this.strokeIndices=[],a.toFixed(10)!==s.toFixed(10)){l!==d.PIE&&void 0!==l||(this.vertices.push(new T.default.Vector(.5,.5,0)),this.uvs.push([.5,.5]));for(var e=0;e<=u;e++){var t=(s-a)*(e/u)+a,r=.5+Math.cos(t)/2,i=.5+Math.sin(t)/2;this.vertices.push(new T.default.Vector(r,i,0)),this.uvs.push([r,i]),e>5&31)/31,(y>>10&31)/31):(r=a,i=s,l)}for(var b=1;b<=3;b++){var _=p+12*b,x=new S.default.Vector(u.getFloat32(_,!0),u.getFloat32(8+_,!0),u.getFloat32(4+_,!0));e.vertices.push(x),c&&o.push(r,i,n)}var w=new S.default.Vector(m,g,v);e.vertexNormals.push(w,w,w),e.faces.push([3*d,3*d+1,3*d+2]),e.uvs.push([0,0],[0,0],[0,0])}}(e,t);else{var r=new DataView(t);if(!("TextDecoder"in window))return console.warn("Sorry, ASCII STL loading only works in browsers that support TextDecoder (https://caniuse.com/#feat=textencoder)");var i=new TextDecoder("utf-8").decode(r).split("\n");!function(e,t){for(var r,i,n="",o=[],a=0;aMath.PI?l=Math.PI:l<=0&&(l=.001);var u=Math.sin(l)*a*Math.sin(s),h=Math.cos(l)*a,c=Math.sin(l)*a*Math.cos(s);this.camera(u+this.centerX,h+this.centerY,c+this.centerZ,this.centerX,this.centerY,this.centerZ,0,1,0)},m.default.Camera.prototype._isActive=function(){return this===this._renderer._curCamera},m.default.prototype.setCamera=function(e){this._renderer._curCamera=e,this._renderer.uPMatrix.set(e.projMatrix.mat4[0],e.projMatrix.mat4[1],e.projMatrix.mat4[2],e.projMatrix.mat4[3],e.projMatrix.mat4[4],e.projMatrix.mat4[5],e.projMatrix.mat4[6],e.projMatrix.mat4[7],e.projMatrix.mat4[8],e.projMatrix.mat4[9],e.projMatrix.mat4[10],e.projMatrix.mat4[11],e.projMatrix.mat4[12],e.projMatrix.mat4[13],e.projMatrix.mat4[14],e.projMatrix.mat4[15])};var n=m.default.Camera;r.default=n},{"../core/main":49}],98:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i,h=(i=e("../core/main"))&&i.__esModule?i:{default:i};h.default.Geometry=function(e,t,r){return this.vertices=[],this.lineVertices=[],this.lineNormals=[],this.vertexNormals=[],this.faces=[],this.uvs=[],this.edges=[],this.vertexColors=[],this.detailX=void 0!==e?e:1,this.detailY=void 0!==t?t:1,this.dirtyFlags={},r instanceof Function&&r.call(this),this},h.default.Geometry.prototype.reset=function(){this.lineVertices.length=0,this.lineNormals.length=0,this.vertices.length=0,this.edges.length=0,this.vertexColors.length=0,this.vertexNormals.length=0,this.uvs.length=0,this.dirtyFlags={}},h.default.Geometry.prototype.computeFaces=function(){this.faces.length=0;for(var e,t,r,i,n=this.detailX+1,o=0;othis.vertices.length-1-this.detailX;i--)e.add(this.vertexNormals[i]);e=h.default.Vector.div(e,this.detailX);for(var n=this.vertices.length-1;n>this.vertices.length-1-this.detailX;n--)this.vertexNormals[n]=e;return this},h.default.Geometry.prototype._makeTriangleEdges=function(){if(this.edges.length=0,Array.isArray(this.strokeIndices))for(var e=0,t=this.strokeIndices.length;e vTexCoord.y;\n bool y1 = p1.y > vTexCoord.y;\n bool y2 = p2.y > vTexCoord.y;\n\n // could web be under the curve (after t1)?\n if (y1 ? !y2 : y0) {\n // add the coverage for t1\n coverage.x += saturate(C1.x + 0.5);\n // calculate the anti-aliasing for t1\n weight.x = min(weight.x, abs(C1.x));\n }\n\n // are we outside the curve (after t2)?\n if (y1 ? !y0 : y2) {\n // subtract the coverage for t2\n coverage.x -= saturate(C2.x + 0.5);\n // calculate the anti-aliasing for t2\n weight.x = min(weight.x, abs(C2.x));\n }\n}\n\n// this is essentially the same as coverageX, but with the axes swapped\nvoid coverageY(vec2 p0, vec2 p1, vec2 p2) {\n\n vec2 C1, C2;\n calulateCrossings(p0, p1, p2, C1, C2);\n\n bool x0 = p0.x > vTexCoord.x;\n bool x1 = p1.x > vTexCoord.x;\n bool x2 = p2.x > vTexCoord.x;\n\n if (x1 ? !x2 : x0) {\n coverage.y -= saturate(C1.y + 0.5);\n weight.y = min(weight.y, abs(C1.y));\n }\n\n if (x1 ? !x0 : x2) {\n coverage.y += saturate(C2.y + 0.5);\n weight.y = min(weight.y, abs(C2.y));\n }\n}\n\nvoid main() {\n\n // calculate the pixel scale based on screen-coordinates\n pixelScale = hardness / fwidth(vTexCoord);\n\n // which grid cell is this pixel in?\n ivec2 gridCoord = ifloor(vTexCoord * vec2(uGridSize));\n\n // intersect curves in this row\n {\n // the index into the row info bitmap\n int rowIndex = gridCoord.y + uGridOffset.y;\n // fetch the info texel\n vec4 rowInfo = getTexel(uSamplerRows, rowIndex, uGridImageSize);\n // unpack the rowInfo\n int rowStrokeIndex = getInt16(rowInfo.xy);\n int rowStrokeCount = getInt16(rowInfo.zw);\n\n for (int iRowStroke = INT(0); iRowStroke < N; iRowStroke++) {\n if (iRowStroke >= rowStrokeCount)\n break;\n\n // each stroke is made up of 3 points: the start and control point\n // and the start of the next curve.\n // fetch the indices of this pair of strokes:\n vec4 strokeIndices = getTexel(uSamplerRowStrokes, rowStrokeIndex++, uCellsImageSize);\n\n // unpack the stroke index\n int strokePos = getInt16(strokeIndices.xy);\n\n // fetch the two strokes\n vec4 stroke0 = getTexel(uSamplerStrokes, strokePos + INT(0), uStrokeImageSize);\n vec4 stroke1 = getTexel(uSamplerStrokes, strokePos + INT(1), uStrokeImageSize);\n\n // calculate the coverage\n coverageX(stroke0.xy, stroke0.zw, stroke1.xy);\n }\n }\n\n // intersect curves in this column\n {\n int colIndex = gridCoord.x + uGridOffset.x;\n vec4 colInfo = getTexel(uSamplerCols, colIndex, uGridImageSize);\n int colStrokeIndex = getInt16(colInfo.xy);\n int colStrokeCount = getInt16(colInfo.zw);\n \n for (int iColStroke = INT(0); iColStroke < N; iColStroke++) {\n if (iColStroke >= colStrokeCount)\n break;\n\n vec4 strokeIndices = getTexel(uSamplerColStrokes, colStrokeIndex++, uCellsImageSize);\n\n int strokePos = getInt16(strokeIndices.xy);\n vec4 stroke0 = getTexel(uSamplerStrokes, strokePos + INT(0), uStrokeImageSize);\n vec4 stroke1 = getTexel(uSamplerStrokes, strokePos + INT(1), uStrokeImageSize);\n coverageY(stroke0.xy, stroke0.zw, stroke1.xy);\n }\n }\n\n weight = saturate(1.0 - weight * 2.0);\n float distance = max(weight.x + weight.y, minDistance); // manhattan approx.\n float antialias = abs(dot(coverage, weight) / distance);\n float cover = min(abs(coverage.x), abs(coverage.y));\n gl_FragColor = uMaterialColor;\n gl_FragColor.a *= saturate(max(antialias, cover));\n}",lineVert:"/*\n Part of the Processing project - http://processing.org\n Copyright (c) 2012-15 The Processing Foundation\n Copyright (c) 2004-12 Ben Fry and Casey Reas\n Copyright (c) 2001-04 Massachusetts Institute of Technology\n This library is free software; you can redistribute it and/or\n modify it under the terms of the GNU Lesser General Public\n License as published by the Free Software Foundation, version 2.1.\n This library is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n Lesser General Public License for more details.\n You should have received a copy of the GNU Lesser General\n Public License along with this library; if not, write to the\n Free Software Foundation, Inc., 59 Temple Place, Suite 330,\n Boston, MA 02111-1307 USA\n*/\n\n#define PROCESSING_LINE_SHADER\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform float uStrokeWeight;\n\nuniform vec4 uViewport;\nuniform int uPerspective;\n\nattribute vec4 aPosition;\nattribute vec4 aDirection;\n \nvoid main() {\n // using a scale <1 moves the lines towards the camera\n // in order to prevent popping effects due to half of\n // the line disappearing behind the geometry faces.\n vec3 scale = vec3(0.9995);\n\n vec4 posp = uModelViewMatrix * aPosition;\n vec4 posq = uModelViewMatrix * (aPosition + vec4(aDirection.xyz, 0));\n\n // Moving vertices slightly toward the camera\n // to avoid depth-fighting with the fill triangles.\n // Discussed here:\n // http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Number=252848 \n posp.xyz = posp.xyz * scale;\n posq.xyz = posq.xyz * scale;\n\n vec4 p = uProjectionMatrix * posp;\n vec4 q = uProjectionMatrix * posq;\n\n // formula to convert from clip space (range -1..1) to screen space (range 0..[width or height])\n // screen_p = (p.xy/p.w + <1,1>) * 0.5 * uViewport.zw\n\n // prevent division by W by transforming the tangent formula (div by 0 causes\n // the line to disappear, see https://github.com/processing/processing/issues/5183)\n // t = screen_q - screen_p\n //\n // tangent is normalized and we don't care which aDirection it points to (+-)\n // t = +- normalize( screen_q - screen_p )\n // t = +- normalize( (q.xy/q.w+<1,1>)*0.5*uViewport.zw - (p.xy/p.w+<1,1>)*0.5*uViewport.zw )\n //\n // extract common factor, <1,1> - <1,1> cancels out\n // t = +- normalize( (q.xy/q.w - p.xy/p.w) * 0.5 * uViewport.zw )\n //\n // convert to common divisor\n // t = +- normalize( ((q.xy*p.w - p.xy*q.w) / (p.w*q.w)) * 0.5 * uViewport.zw )\n //\n // remove the common scalar divisor/factor, not needed due to normalize and +-\n // (keep uViewport - can't remove because it has different components for x and y\n // and corrects for aspect ratio, see https://github.com/processing/processing/issues/5181)\n // t = +- normalize( (q.xy*p.w - p.xy*q.w) * uViewport.zw )\n\n vec2 tangent = normalize((q.xy*p.w - p.xy*q.w) * uViewport.zw);\n\n // flip tangent to normal (it's already normalized)\n vec2 normal = vec2(-tangent.y, tangent.x);\n\n float thickness = aDirection.w * uStrokeWeight;\n vec2 offset = normal * thickness / 2.0;\n\n vec2 curPerspScale;\n\n if(uPerspective == 1) {\n // Perspective ---\n // convert from world to clip by multiplying with projection scaling factor\n // to get the right thickness (see https://github.com/processing/processing/issues/5182)\n // invert Y, projections in Processing invert Y\n curPerspScale = (uProjectionMatrix * vec4(1, -1, 0, 0)).xy;\n } else {\n // No Perspective ---\n // multiply by W (to cancel out division by W later in the pipeline) and\n // convert from screen to clip (derived from clip to screen above)\n curPerspScale = p.w / (0.5 * uViewport.zw);\n }\n\n gl_Position.xy = p.xy + offset.xy * curPerspScale;\n gl_Position.zw = p.zw;\n}\n",lineFrag:"precision mediump float;\nprecision mediump int;\n\nuniform vec4 uMaterialColor;\n\nvoid main() {\n gl_FragColor = uMaterialColor;\n}",pointVert:"attribute vec3 aPosition;\nuniform float uPointSize;\nvarying float vStrokeWeight;\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nvoid main() {\n\tvec4 positionVec4 = vec4(aPosition, 1.0);\n\tgl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n\tgl_PointSize = uPointSize;\n\tvStrokeWeight = uPointSize;\n}",pointFrag:"precision mediump float;\nprecision mediump int;\nuniform vec4 uMaterialColor;\nvarying float vStrokeWeight;\n\nvoid main(){\n\tfloat mask = 0.0;\n\n\t// make a circular mask using the gl_PointCoord (goes from 0 - 1 on a point)\n // might be able to get a nicer edge on big strokeweights with smoothstep but slightly less performant\n\n\tmask = step(0.98, length(gl_PointCoord * 2.0 - 1.0));\n\n\t// if strokeWeight is 1 or less lets just draw a square\n\t// this prevents weird artifacting from carving circles when our points are really small\n\t// if strokeWeight is larger than 1, we just use it as is\n\n\tmask = mix(0.0, mask, clamp(floor(vStrokeWeight - 0.5),0.0,1.0));\n\n\t// throw away the borders of the mask\n // otherwise we get weird alpha blending issues\n\n\tif(mask > 0.98){\n discard;\n \t}\n\n \tgl_FragColor = vec4(uMaterialColor.rgb * (1.0 - mask), uMaterialColor.a) ;\n}"};u.default.RendererGL=function(e,t,r,i){return u.default.Renderer.call(this,e,t,r),this._setAttributeDefaults(t),this._initContext(),this.isP3D=!0,this.GL=this.drawingContext,this._isErasing=!1,this._enableLighting=!1,this.ambientLightColors=[],this.specularColors=[1,1,1],this.directionalLightDirections=[],this.directionalLightDiffuseColors=[],this.directionalLightSpecularColors=[],this.pointLightPositions=[],this.pointLightDiffuseColors=[],this.pointLightSpecularColors=[],this.spotLightPositions=[],this.spotLightDirections=[],this.spotLightDiffuseColors=[],this.spotLightSpecularColors=[],this.spotLightAngle=[],this.spotLightConc=[],this.drawMode=o.FILL,this.curFillColor=this._cachedFillStyle=[1,1,1,1],this.curStrokeColor=this._cachedStrokeStyle=[0,0,0,1],this.curBlendMode=o.BLEND,this._cachedBlendMode=void 0,this.blendExt=this.GL.getExtension("EXT_blend_minmax"),this._isBlending=!1,this._useSpecularMaterial=!1,this._useEmissiveMaterial=!1,this._useNormalMaterial=!1,this._useShininess=1,this._tint=[255,255,255,255],this.constantAttenuation=1,this.linearAttenuation=0,this.quadraticAttenuation=0,this.uMVMatrix=new u.default.Matrix,this.uPMatrix=new u.default.Matrix,this.uNMatrix=new u.default.Matrix("mat3"),this._curCamera=new u.default.Camera(this),this._curCamera._computeCameraDefaultSettings(),this._curCamera._setDefaultCamera(),this._defaultLightShader=void 0,this._defaultImmediateModeShader=void 0,this._defaultNormalShader=void 0,this._defaultColorShader=void 0,this._defaultPointShader=void 0,this.userFillShader=void 0,this.userStrokeShader=void 0,this.userPointShader=void 0,this.retainedMode={geometry:{},buffers:{stroke:[new u.default.RenderBuffer(3,"lineVertices","lineVertexBuffer","aPosition",this,this._flatten),new u.default.RenderBuffer(4,"lineNormals","lineNormalBuffer","aDirection",this,this._flatten)],fill:[new u.default.RenderBuffer(3,"vertices","vertexBuffer","aPosition",this,this._vToNArray),new u.default.RenderBuffer(3,"vertexNormals","normalBuffer","aNormal",this,this._vToNArray),new u.default.RenderBuffer(4,"vertexColors","colorBuffer","aMaterialColor",this),new u.default.RenderBuffer(3,"vertexAmbients","ambientBuffer","aAmbientColor",this),new u.default.RenderBuffer(2,"uvs","uvBuffer","aTexCoord",this,this._flatten)],text:[new u.default.RenderBuffer(3,"vertices","vertexBuffer","aPosition",this,this._vToNArray),new u.default.RenderBuffer(2,"uvs","uvBuffer","aTexCoord",this,this._flatten)]}},this.immediateMode={geometry:new u.default.Geometry,shapeMode:o.TRIANGLE_FAN,_bezierVertex:[],_quadraticVertex:[],_curveVertex:[],buffers:{fill:[new u.default.RenderBuffer(3,"vertices","vertexBuffer","aPosition",this,this._vToNArray),new u.default.RenderBuffer(3,"vertexNormals","normalBuffer","aNormal",this,this._vToNArray),new u.default.RenderBuffer(4,"vertexColors","colorBuffer","aVertexColor",this),new u.default.RenderBuffer(3,"vertexAmbients","ambientBuffer","aAmbientColor",this),new u.default.RenderBuffer(2,"uvs","uvBuffer","aTexCoord",this,this._flatten)],stroke:[new u.default.RenderBuffer(3,"lineVertices","lineVertexBuffer","aPosition",this,this._flatten),new u.default.RenderBuffer(4,"lineNormals","lineNormalBuffer","aDirection",this,this._flatten)],point:this.GL.createBuffer()}},this.pointSize=5,this.curStrokeWeight=1,this.textures=[],this.textureMode=o.IMAGE,this.textureWrapX=o.CLAMP,this.textureWrapY=o.CLAMP,this._tex=null,this._curveTightness=6,this._lookUpTableBezier=[],this._lookUpTableQuadratic=[],this._lutBezierDetail=0,this._lutQuadraticDetail=0,this._tessy=this._initTessy(),this.fontInfos={},this._curShader=void 0,this},u.default.RendererGL.prototype=Object.create(u.default.Renderer.prototype),u.default.RendererGL.prototype._setAttributeDefaults=function(e){var t={alpha:!0,depth:!0,stencil:!0,antialias:navigator.userAgent.toLowerCase().includes("safari"),premultipliedAlpha:!1,preserveDrawingBuffer:!0,perPixelLighting:!0};null===e._glAttributes?e._glAttributes=t:e._glAttributes=Object.assign(t,e._glAttributes)},u.default.RendererGL.prototype._initContext=function(){try{if(this.drawingContext=this.canvas.getContext("webgl",this._pInst._glAttributes)||this.canvas.getContext("experimental-webgl",this._pInst._glAttributes),null===this.drawingContext)throw new Error("Error creating webgl context");var e=this.drawingContext;e.enable(e.DEPTH_TEST),e.depthFunc(e.LEQUAL),e.viewport(0,0,e.drawingBufferWidth,e.drawingBufferHeight),this._viewport=this.drawingContext.getParameter(this.drawingContext.VIEWPORT)}catch(e){throw e}},u.default.RendererGL.prototype._resetContext=function(e,t){var r=this.width,i=this.height,n=this.canvas.id,o=this._pInst instanceof u.default.Graphics;if(o){var a=this._pInst;a.canvas.parentNode.removeChild(a.canvas),a.canvas=document.createElement("canvas"),(a._pInst._userNode||document.body).appendChild(a.canvas),u.default.Element.call(a,a.canvas,a._pInst),a.width=r,a.height=i}else{var s=this.canvas;s&&s.parentNode.removeChild(s),(s=document.createElement("canvas")).id=n,this._pInst._userNode?this._pInst._userNode.appendChild(s):document.body.appendChild(s),this._pInst.canvas=s}var l=new u.default.RendererGL(this._pInst.canvas,this._pInst,!o);this._pInst._setProperty("_renderer",l),l.resize(r,i),l._applyDefaults(),o||this._pInst._elements.push(l),"function"==typeof t&&setTimeout(function(){t.apply(window._renderer,e)},0)},u.default.prototype.setAttributes=function(e,t){if(void 0!==this._glAttributes){var r=!0;if(void 0!==t?(null===this._glAttributes&&(this._glAttributes={}),this._glAttributes[e]!==t&&(this._glAttributes[e]=t,r=!1)):e instanceof Object&&this._glAttributes!==e&&(this._glAttributes=e,r=!1),this._renderer.isP3D&&!r){if(!this._setupDone)for(var i in this._renderer.retainedMode.geometry)if(this._renderer.retainedMode.geometry.hasOwnProperty(i))return void console.error("Sorry, Could not set the attributes, you need to call setAttributes() before calling the other drawing methods in setup()");this.push(),this._renderer._resetContext(),this.pop(),this._renderer._curCamera&&(this._renderer._curCamera._renderer=this._renderer)}}else console.log("You are trying to use setAttributes on a p5.Graphics object that does not use a WEBGL renderer.")},u.default.RendererGL.prototype._update=function(){this.uMVMatrix.set(this._curCamera.cameraMatrix.mat4[0],this._curCamera.cameraMatrix.mat4[1],this._curCamera.cameraMatrix.mat4[2],this._curCamera.cameraMatrix.mat4[3],this._curCamera.cameraMatrix.mat4[4],this._curCamera.cameraMatrix.mat4[5],this._curCamera.cameraMatrix.mat4[6],this._curCamera.cameraMatrix.mat4[7],this._curCamera.cameraMatrix.mat4[8],this._curCamera.cameraMatrix.mat4[9],this._curCamera.cameraMatrix.mat4[10],this._curCamera.cameraMatrix.mat4[11],this._curCamera.cameraMatrix.mat4[12],this._curCamera.cameraMatrix.mat4[13],this._curCamera.cameraMatrix.mat4[14],this._curCamera.cameraMatrix.mat4[15]),this.ambientLightColors.length=0,this.specularColors=[1,1,1],this.directionalLightDirections.length=0,this.directionalLightDiffuseColors.length=0,this.directionalLightSpecularColors.length=0,this.pointLightPositions.length=0,this.pointLightDiffuseColors.length=0,this.pointLightSpecularColors.length=0,this.spotLightPositions.length=0,this.spotLightDirections.length=0,this.spotLightDiffuseColors.length=0,this.spotLightSpecularColors.length=0,this.spotLightAngle.length=0,this.spotLightConc.length=0,this._enableLighting=!1,this._tint=[255,255,255,255],this.GL.clear(this.GL.DEPTH_BUFFER_BIT)},u.default.RendererGL.prototype.background=function(){var e,t=(e=this._pInst).color.apply(e,arguments),r=t.levels[0]/255,i=t.levels[1]/255,n=t.levels[2]/255,o=t.levels[3]/255;this.GL.clearColor(r,i,n,o),this.GL.clear(this.GL.COLOR_BUFFER_BIT)},u.default.RendererGL.prototype.fill=function(e,t,r,i){var n=u.default.prototype.color.apply(this._pInst,arguments);this.curFillColor=n._array,this.drawMode=o.FILL,this._useNormalMaterial=!1,this._tex=null},u.default.RendererGL.prototype.stroke=function(e,t,r,i){arguments[3]=255;var n=u.default.prototype.color.apply(this._pInst,arguments);this.curStrokeColor=n._array},u.default.RendererGL.prototype.strokeCap=function(e){console.error("Sorry, strokeCap() is not yet implemented in WEBGL mode")},u.default.RendererGL.prototype.strokeJoin=function(e){console.error("Sorry, strokeJoin() is not yet implemented in WEBGL mode")},u.default.RendererGL.prototype.filter=function(e){console.error("filter() does not work in WEBGL mode")},u.default.RendererGL.prototype.blendMode=function(e){e===o.DARKEST||e===o.LIGHTEST||e===o.ADD||e===o.BLEND||e===o.SUBTRACT||e===o.SCREEN||e===o.EXCLUSION||e===o.REPLACE||e===o.MULTIPLY||e===o.REMOVE?this.curBlendMode=e:e!==o.BURN&&e!==o.OVERLAY&&e!==o.HARD_LIGHT&&e!==o.SOFT_LIGHT&&e!==o.DODGE||console.warn("BURN, OVERLAY, HARD_LIGHT, SOFT_LIGHT, and DODGE only work for blendMode in 2D mode.")},u.default.RendererGL.prototype.erase=function(e,t){this._isErasing||(this._cachedBlendMode=this.curBlendMode,this.blendMode(o.REMOVE),this._cachedFillStyle=this.curFillColor.slice(),this.curFillColor=[1,1,1,e/255],this._cachedStrokeStyle=this.curStrokeColor.slice(),this.curStrokeColor=[1,1,1,t/255],this._isErasing=!0)},u.default.RendererGL.prototype.noErase=function(){this._isErasing&&(this.curFillColor=this._cachedFillStyle.slice(),this.curStrokeColor=this._cachedStrokeStyle.slice(),this.blendMode(this._cachedBlendMode),this._isErasing=!1)},u.default.RendererGL.prototype.strokeWeight=function(e){this.curStrokeWeight!==e&&(this.pointSize=e,this.curStrokeWeight=e)},u.default.RendererGL.prototype._getPixel=function(e,t){var r;return r=new Uint8Array(4),this.drawingContext.readPixels(e,t,1,1,this.drawingContext.RGBA,this.drawingContext.UNSIGNED_BYTE,r),[r[0],r[1],r[2],r[3]]},u.default.RendererGL.prototype.loadPixels=function(){var e=this._pixelsState;if(!0===this._pInst._glAttributes.preserveDrawingBuffer){var t=e.pixels,r=this.GL.drawingBufferWidth*this.GL.drawingBufferHeight*4;t instanceof Uint8Array&&t.length===r||(t=new Uint8Array(r),this._pixelsState._setProperty("pixels",t));var i=this._pInst._pixelDensity;this.GL.readPixels(0,0,this.width*i,this.height*i,this.GL.RGBA,this.GL.UNSIGNED_BYTE,t)}else console.log("loadPixels only works in WebGL when preserveDrawingBuffer is true.")},u.default.RendererGL.prototype.geometryInHash=function(e){return void 0!==this.retainedMode.geometry[e]},u.default.RendererGL.prototype.resize=function(e,t){u.default.Renderer.prototype.resize.call(this,e,t),this.GL.viewport(0,0,this.GL.drawingBufferWidth,this.GL.drawingBufferHeight),this._viewport=this.GL.getParameter(this.GL.VIEWPORT),this._curCamera._resize();var r=this._pixelsState;void 0!==r.pixels&&r._setProperty("pixels",new Uint8Array(this.GL.drawingBufferWidth*this.GL.drawingBufferHeight*4))},u.default.RendererGL.prototype.clear=function(){var e=(arguments.length<=0?void 0:arguments[0])||0,t=(arguments.length<=1?void 0:arguments[1])||0,r=(arguments.length<=2?void 0:arguments[2])||0,i=(arguments.length<=3?void 0:arguments[3])||0;this.GL.clearColor(e,t,r,i),this.GL.clear(this.GL.COLOR_BUFFER_BIT|this.GL.DEPTH_BUFFER_BIT)},u.default.RendererGL.prototype.applyMatrix=function(e,t,r,i,n,o){16===arguments.length?u.default.Matrix.prototype.apply.apply(this.uMVMatrix,arguments):this.uMVMatrix.apply([e,t,0,0,r,i,0,0,0,0,1,0,n,o,0,1])},u.default.RendererGL.prototype.translate=function(e,t,r){return e instanceof u.default.Vector&&(r=e.z,t=e.y,e=e.x),this.uMVMatrix.translate([e,t,r]),this},u.default.RendererGL.prototype.scale=function(e,t,r){return this.uMVMatrix.scale(e,t,r),this},u.default.RendererGL.prototype.rotate=function(e,t){return void 0===t?this.rotateZ(e):(u.default.Matrix.prototype.rotate.apply(this.uMVMatrix,arguments),this)},u.default.RendererGL.prototype.rotateX=function(e){return this.rotate(e,1,0,0),this},u.default.RendererGL.prototype.rotateY=function(e){return this.rotate(e,0,1,0),this},u.default.RendererGL.prototype.rotateZ=function(e){return this.rotate(e,0,0,1),this},u.default.RendererGL.prototype.push=function(){var e=u.default.Renderer.prototype.push.apply(this),t=e.properties;return t.uMVMatrix=this.uMVMatrix.copy(),t.uPMatrix=this.uPMatrix.copy(),t._curCamera=this._curCamera,this._curCamera=this._curCamera.copy(),t.ambientLightColors=this.ambientLightColors.slice(),t.specularColors=this.specularColors.slice(),t.directionalLightDirections=this.directionalLightDirections.slice(),t.directionalLightDiffuseColors=this.directionalLightDiffuseColors.slice(),t.directionalLightSpecularColors=this.directionalLightSpecularColors.slice(),t.pointLightPositions=this.pointLightPositions.slice(),t.pointLightDiffuseColors=this.pointLightDiffuseColors.slice(),t.pointLightSpecularColors=this.pointLightSpecularColors.slice(),t.spotLightPositions=this.spotLightPositions.slice(),t.spotLightDirections=this.spotLightDirections.slice(),t.spotLightDiffuseColors=this.spotLightDiffuseColors.slice(),t.spotLightSpecularColors=this.spotLightSpecularColors.slice(),t.spotLightAngle=this.spotLightAngle.slice(),t.spotLightConc=this.spotLightConc.slice(),t.userFillShader=this.userFillShader,t.userStrokeShader=this.userStrokeShader,t.userPointShader=this.userPointShader,t.pointSize=this.pointSize,t.curStrokeWeight=this.curStrokeWeight,t.curStrokeColor=this.curStrokeColor,t.curFillColor=this.curFillColor,t._useSpecularMaterial=this._useSpecularMaterial,t._useEmissiveMaterial=this._useEmissiveMaterial,t._useShininess=this._useShininess,t.constantAttenuation=this.constantAttenuation,t.linearAttenuation=this.linearAttenuation,t.quadraticAttenuation=this.quadraticAttenuation,t._enableLighting=this._enableLighting,t._useNormalMaterial=this._useNormalMaterial,t._tex=this._tex,t.drawMode=this.drawMode,e},u.default.RendererGL.prototype.resetMatrix=function(){return this.uMVMatrix=u.default.Matrix.identity(this._pInst),this},u.default.RendererGL.prototype._getImmediateStrokeShader=function(){var e=this.userStrokeShader;return e&&e.isStrokeShader()?e:this._getLineShader()},u.default.RendererGL.prototype._getRetainedStrokeShader=u.default.RendererGL.prototype._getImmediateStrokeShader,u.default.RendererGL.prototype._getImmediateFillShader=function(){var e=this.userFillShader;if(this._useNormalMaterial&&(!e||!e.isNormalShader()))return this._getNormalShader();if(this._enableLighting){if(!e||!e.isLightShader())return this._getLightShader()}else if(this._tex){if(!e||!e.isTextureShader())return this._getLightShader()}else if(!e)return this._getImmediateModeShader();return e},u.default.RendererGL.prototype._getRetainedFillShader=function(){if(this._useNormalMaterial)return this._getNormalShader();var e=this.userFillShader;if(this._enableLighting){if(!e||!e.isLightShader())return this._getLightShader()}else if(this._tex){if(!e||!e.isTextureShader())return this._getLightShader()}else if(!e)return this._getColorShader();return e},u.default.RendererGL.prototype._getImmediatePointShader=function(){var e=this.userPointShader;return e&&e.isPointShader()?e:this._getPointShader()},u.default.RendererGL.prototype._getRetainedLineShader=u.default.RendererGL.prototype._getImmediateLineShader,u.default.RendererGL.prototype._getLightShader=function(){return this._defaultLightShader||(this._pInst._glAttributes.perPixelLighting?this._defaultLightShader=new u.default.Shader(this,c.phongVert,c.phongFrag):this._defaultLightShader=new u.default.Shader(this,c.lightVert,c.lightTextureFrag)),this._defaultLightShader},u.default.RendererGL.prototype._getImmediateModeShader=function(){return this._defaultImmediateModeShader||(this._defaultImmediateModeShader=new u.default.Shader(this,c.immediateVert,c.vertexColorFrag)),this._defaultImmediateModeShader},u.default.RendererGL.prototype._getNormalShader=function(){return this._defaultNormalShader||(this._defaultNormalShader=new u.default.Shader(this,c.normalVert,c.normalFrag)),this._defaultNormalShader},u.default.RendererGL.prototype._getColorShader=function(){return this._defaultColorShader||(this._defaultColorShader=new u.default.Shader(this,c.normalVert,c.basicFrag)),this._defaultColorShader},u.default.RendererGL.prototype._getPointShader=function(){return this._defaultPointShader||(this._defaultPointShader=new u.default.Shader(this,c.pointVert,c.pointFrag)),this._defaultPointShader},u.default.RendererGL.prototype._getLineShader=function(){return this._defaultLineShader||(this._defaultLineShader=new u.default.Shader(this,c.lineVert,c.lineFrag)),this._defaultLineShader},u.default.RendererGL.prototype._getFontShader=function(){return this._defaultFontShader||(this.GL.getExtension("OES_standard_derivatives"),this._defaultFontShader=new u.default.Shader(this,c.fontVert,c.fontFrag)),this._defaultFontShader},u.default.RendererGL.prototype._getEmptyTexture=function(){if(!this._emptyTexture){var e=new u.default.Image(1,1);e.set(0,0,255),this._emptyTexture=new u.default.Texture(this,e)}return this._emptyTexture},u.default.RendererGL.prototype.getTexture=function(e){var t=this.textures,r=!0,i=!1,n=void 0;try{for(var o,a=t[Symbol.iterator]();!(r=(o=a.next()).done);r=!0){var s=o.value;if(s.src===e)return s}}catch(e){i=!0,n=e}finally{try{r||null==a.return||a.return()}finally{if(i)throw n}}var l=new u.default.Texture(this,e);return t.push(l),l},u.default.RendererGL.prototype._setStrokeUniforms=function(e){e.bindShader(),e.setUniform("uMaterialColor",this.curStrokeColor),e.setUniform("uStrokeWeight",this.curStrokeWeight)},u.default.RendererGL.prototype._setFillUniforms=function(e){e.bindShader(),e.setUniform("uMaterialColor",this.curFillColor),e.setUniform("isTexture",!!this._tex),this._tex&&e.setUniform("uSampler",this._tex),e.setUniform("uTint",this._tint),e.setUniform("uSpecular",this._useSpecularMaterial),e.setUniform("uEmissive",this._useEmissiveMaterial),e.setUniform("uShininess",this._useShininess),e.setUniform("uUseLighting",this._enableLighting);var t=this.pointLightDiffuseColors.length/3;e.setUniform("uPointLightCount",t),e.setUniform("uPointLightLocation",this.pointLightPositions),e.setUniform("uPointLightDiffuseColors",this.pointLightDiffuseColors),e.setUniform("uPointLightSpecularColors",this.pointLightSpecularColors);var r=this.directionalLightDiffuseColors.length/3;e.setUniform("uDirectionalLightCount",r),e.setUniform("uLightingDirection",this.directionalLightDirections),e.setUniform("uDirectionalDiffuseColors",this.directionalLightDiffuseColors),e.setUniform("uDirectionalSpecularColors",this.directionalLightSpecularColors);var i=this.ambientLightColors.length/3;e.setUniform("uAmbientLightCount",i),e.setUniform("uAmbientColor",this.ambientLightColors);var n=this.spotLightDiffuseColors.length/3;e.setUniform("uSpotLightCount",n),e.setUniform("uSpotLightAngle",this.spotLightAngle),e.setUniform("uSpotLightConc",this.spotLightConc),e.setUniform("uSpotLightDiffuseColors",this.spotLightDiffuseColors),e.setUniform("uSpotLightSpecularColors",this.spotLightSpecularColors),e.setUniform("uSpotLightLocation",this.spotLightPositions),e.setUniform("uSpotLightDirection",this.spotLightDirections),e.setUniform("uConstantAttenuation",this.constantAttenuation),e.setUniform("uLinearAttenuation",this.linearAttenuation),e.setUniform("uQuadraticAttenuation",this.quadraticAttenuation),e.bindTextures()},u.default.RendererGL.prototype._setPointUniforms=function(e){e.bindShader(),e.setUniform("uMaterialColor",this.curStrokeColor),e.setUniform("uPointSize",this.pointSize)},u.default.RendererGL.prototype._bindBuffer=function(e,t,r,i,n){if(t=t||this.GL.ARRAY_BUFFER,this.GL.bindBuffer(t,e),void 0!==r){var o=new(i||Float32Array)(r);this.GL.bufferData(t,o,n||this.GL.STATIC_DRAW)}},u.default.RendererGL.prototype._arraysEqual=function(e,t){var r=e.length;if(r!==t.length)return!1;for(var i=0;i>7,127&f,c>>7,127&c);for(var d=0;d>7,127&p,0,0)}}return{cellImageInfo:l,dimOffset:o,dimImageInfo:n}}return(t=this.glyphInfos[e.index]={glyph:e,uGlyphRect:[i.x1,-i.y1,i.x2,-i.y2],strokeImageInfo:U,strokes:d,colInfo:G(m,this.colDimImageInfos,this.colCellImageInfos),rowInfo:G(p,this.rowDimImageInfos,this.rowCellImageInfos)}).uGridOffset=[t.colInfo.dimOffset,t.rowInfo.dimOffset],t}}var z=Math.sqrt(3);j.default.RendererGL.prototype._renderText=function(e,t,r,i,n){if(this._textFont&&"string"!=typeof this._textFont){if(!(n<=i)&&this._doFill){if(!this._isOpenType())return console.log("WEBGL: only Opentype (.otf) and Truetype (.ttf) fonts are supported"),e;e.push();var o=this._doStroke,a=this.drawMode;this._doStroke=!1,this.drawMode=D.TEXTURE;var s=this._textFont.font,l=this._textFont._fontInfo;l=l||(this._textFont._fontInfo=new A(s));var u=this._textFont._handleAlignment(this,t,r,i),h=this._textSize/s.unitsPerEm;this.translate(u.x,u.y,0),this.scale(h,h,1);var c=this.GL,f=!this._defaultFontShader,d=this._getFontShader();d.init(),d.bindShader(),f&&(d.setUniform("uGridImageSize",[64,64]),d.setUniform("uCellsImageSize",[64,64]),d.setUniform("uStrokeImageSize",[64,64]),d.setUniform("uGridSize",[9,9])),this._applyColorBlend(this.curFillColor);var p=this.retainedMode.geometry.glyph;if(!p){var m=this._textGeom=new j.default.Geometry(1,1,function(){for(var e=0;e<=1;e++)for(var t=0;t<=1;t++)this.vertices.push(new j.default.Vector(t,e,0)),this.uvs.push(t,e)});m.computeFaces().computeNormals(),p=this.createBuffers("glyph",m)}var g=!0,v=!1,y=void 0;try{for(var b,_=this.retainedMode.buffers.text[Symbol.iterator]();!(g=(b=_.next()).done);g=!0){b.value._prepareBuffer(p,d)}}catch(e){v=!0,y=e}finally{try{g||null==_.return||_.return()}finally{if(v)throw y}}this._bindBuffer(p.indexBuffer,c.ELEMENT_ARRAY_BUFFER),d.setUniform("uMaterialColor",this.curFillColor);try{var x=0,w=null,S=s.stringToGlyphs(t),M=!0,E=!1,T=void 0;try{for(var C,P=S[Symbol.iterator]();!(M=(C=P.next()).done);M=!0){var L=C.value;w&&(x+=s.getKerningValue(w,L));var k=l.getGlyphInfo(L);if(k.uGlyphRect){var R=k.rowInfo,O=k.colInfo;d.setUniform("uSamplerStrokes",k.strokeImageInfo.imageData),d.setUniform("uSamplerRowStrokes",R.cellImageInfo.imageData),d.setUniform("uSamplerRows",R.dimImageInfo.imageData),d.setUniform("uSamplerColStrokes",O.cellImageInfo.imageData),d.setUniform("uSamplerCols",O.dimImageInfo.imageData),d.setUniform("uGridOffset",k.uGridOffset),d.setUniform("uGlyphRect",k.uGlyphRect),d.setUniform("uGlyphOffset",x),d.bindTextures(),c.drawElements(c.TRIANGLES,6,this.GL.UNSIGNED_SHORT,0)}x+=L.advanceWidth,w=L}}catch(e){E=!0,T=e}finally{try{M||null==P.return||P.return()}finally{if(E)throw T}}}finally{d.unbindShader(),this._doStroke=o,this.drawMode=a,e.pop()}return e}}else console.log("WEBGL: you must load and set a font before drawing text. See `loadFont` and `textFont` for more details.")}},{"../core/constants":42,"../core/main":49,"./p5.RendererGL.Retained":102,"./p5.Shader":104}],107:[function(e,t,r){t.exports={fes:{autoplay:"The media that tried to play (with '{{src}}') wasn't allowed to by this browser, most likely due to the browser's autoplay policy. Check out {{link}} for more information about why.",fileLoadError:{bytes:"It looks like there was a problem loading your file. {{suggestion}}",font:"It looks like there was a problem loading your font. {{suggestion}}",gif:"There was some trouble loading your GIF. Make sure that your GIF is using 87a or 89a encoding.",image:"It looks like there was a problem loading your image. {{suggestion}}",json:"It looks like there was a problem loading your JSON file. {{suggestion}}",large:"If your large file isn't fetched successfully, we recommend splitting the file into smaller segments and fetching those.",strings:"It looks like there was a problem loading your text file. {{suggestion}}",suggestion:"Try checking if the file path ({{filePath}}) is correct, hosting the file online, or running a local server. (More info at {{link}})",table:"It looks like there was a problem loading your table file. {{suggestion}}",xml:"It looks like there was a problem loading your XML file. {{suggestion}}"},misusedTopLevel:"Did you just try to use p5.js's {{symbolName}} {{symbolType}}? If so, you may want to move it into your sketch's setup() function.\n\nFor more details, see: {{link}}",pre:"🌸 p5.js says: {{message}}",welcome:"Welcome! This is your friendly debugger. To turn me off, switch to using p5.min.js."}}},{}],108:[function(e,t,r){t.exports={fes:{autoplay:"Su browser impidío un medio tocar (de '{{src}}'), posiblemente porque las reglas de autoplay. Para aprender más, visite {{link}}.",fileLoadError:{bytes:"",font:"",gif:"",image:"",json:"",large:"",strings:"",suggestion:"",table:"",xml:""},misusedTopLevel:"",pre:"🌸 p5.js dice: {{message}}",welcome:""}}},{}],109:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i=o(e("./en/translation")),n=o(e("./es/translation"));function o(e){return e&&e.__esModule?e:{default:e}}var a={en:{translation:i.default},es:{translation:n.default}};r.default=a},{"./en/translation":107,"./es/translation":108}]},{},[37])(37)}); ================================================ FILE: docs/examples/transcrypt/sketch_004/target/org.transcrypt.__runtime__.js ================================================ // Transcrypt'ed from Python, 2021-11-02 13:06:12 var __name__ = 'org.transcrypt.__runtime__'; export var __envir__ = {}; __envir__.interpreter_name = 'python'; __envir__.transpiler_name = 'transcrypt'; __envir__.executor_name = __envir__.transpiler_name; __envir__.transpiler_version = '3.9.0'; export function __nest__ (headObject, tailNames, value) { var current = headObject; if (tailNames != '') { var tailChain = tailNames.split ('.'); var firstNewIndex = tailChain.length; for (var index = 0; index < tailChain.length; index++) { if (!current.hasOwnProperty (tailChain [index])) { firstNewIndex = index; break; } current = current [tailChain [index]]; } for (var index = firstNewIndex; index < tailChain.length; index++) { current [tailChain [index]] = {}; current = current [tailChain [index]]; } } for (let attrib of Object.getOwnPropertyNames (value)) { Object.defineProperty (current, attrib, { get () {return value [attrib];}, enumerable: true, configurable: true }); } }; export function __init__ (module) { if (!module.__inited__) { module.__all__.__init__ (module.__all__); module.__inited__ = true; } return module.__all__; }; export function __get__ (aThis, func, quotedFuncName) { if (aThis) { if (aThis.hasOwnProperty ('__class__') || typeof aThis == 'string' || aThis instanceof String) { if (quotedFuncName) { Object.defineProperty (aThis, quotedFuncName, { value: function () { var args = [] .slice.apply (arguments); return func.apply (null, [aThis] .concat (args)); }, writable: true, enumerable: true, configurable: true }); } return function () { var args = [] .slice.apply (arguments); return func.apply (null, [aThis.__proxy__ ? aThis.__proxy__ : aThis] .concat (args)); }; } else { return func; } } else { return func; } }; export function __getcm__ (aThis, func, quotedFuncName) { if (aThis.hasOwnProperty ('__class__')) { return function () { var args = [] .slice.apply (arguments); return func.apply (null, [aThis.__class__] .concat (args)); }; } else { return function () { var args = [] .slice.apply (arguments); return func.apply (null, [aThis] .concat (args)); }; } }; export function __getsm__ (aThis, func, quotedFuncName) { return func; }; export var py_metatype = { __name__: 'type', __bases__: [], __new__: function (meta, name, bases, attribs) { var cls = function () { var args = [] .slice.apply (arguments); return cls.__new__ (args); }; for (var index = bases.length - 1; index >= 0; index--) { var base = bases [index]; for (var attrib in base) { var descrip = Object.getOwnPropertyDescriptor (base, attrib); if (descrip == null) { continue; } Object.defineProperty (cls, attrib, descrip); } for (let symbol of Object.getOwnPropertySymbols (base)) { let descrip = Object.getOwnPropertyDescriptor (base, symbol); Object.defineProperty (cls, symbol, descrip); } } cls.__metaclass__ = meta; cls.__name__ = name.startsWith ('py_') ? name.slice (3) : name; cls.__bases__ = bases; for (var attrib in attribs) { var descrip = Object.getOwnPropertyDescriptor (attribs, attrib); Object.defineProperty (cls, attrib, descrip); } for (let symbol of Object.getOwnPropertySymbols (attribs)) { let descrip = Object.getOwnPropertyDescriptor (attribs, symbol); Object.defineProperty (cls, symbol, descrip); } return cls; } }; py_metatype.__metaclass__ = py_metatype; export var object = { __init__: function (self) {}, __metaclass__: py_metatype, __name__: 'object', __bases__: [], __new__: function (args) { var instance = Object.create (this, {__class__: {value: this, enumerable: true}}); if ('__getattr__' in this || '__setattr__' in this) { instance.__proxy__ = new Proxy (instance, { get: function (target, name) { let result = target [name]; if (result == undefined) { return target.__getattr__ (name); } else { return result; } }, set: function (target, name, value) { try { target.__setattr__ (name, value); } catch (exception) { target [name] = value; } return true; } }) instance = instance.__proxy__ } this.__init__.apply (null, [instance] .concat (args)); return instance; } }; export function __class__ (name, bases, attribs, meta) { if (meta === undefined) { meta = bases [0] .__metaclass__; } return meta.__new__ (meta, name, bases, attribs); }; export function __pragma__ () {}; export function __call__ (/* , , * */) { var args = [] .slice.apply (arguments); if (typeof args [0] == 'object' && '__call__' in args [0]) { return args [0] .__call__ .apply (args [1], args.slice (2)); } else { return args [0] .apply (args [1], args.slice (2)); } }; __envir__.executor_name = __envir__.transpiler_name; var __main__ = {__file__: ''}; var __except__ = null; export function __kwargtrans__ (anObject) { anObject.__kwargtrans__ = null; anObject.constructor = Object; return anObject; } export function __super__ (aClass, methodName) { for (let base of aClass.__bases__) { if (methodName in base) { return base [methodName]; } } throw new Exception ('Superclass method not found'); } export function property (getter, setter) { if (!setter) { setter = function () {}; } return {get: function () {return getter (this)}, set: function (value) {setter (this, value)}, enumerable: true}; } export function __setproperty__ (anObject, name, descriptor) { if (!anObject.hasOwnProperty (name)) { Object.defineProperty (anObject, name, descriptor); } } export function assert (condition, message) { if (!condition) { throw AssertionError (message, new Error ()); } } export function __mergekwargtrans__ (object0, object1) { var result = {}; for (var attrib in object0) { result [attrib] = object0 [attrib]; } for (var attrib in object1) { result [attrib] = object1 [attrib]; } return result; }; export function __mergefields__ (targetClass, sourceClass) { let fieldNames = ['__reprfields__', '__comparefields__', '__initfields__'] if (sourceClass [fieldNames [0]]) { if (targetClass [fieldNames [0]]) { for (let fieldName of fieldNames) { targetClass [fieldName] = new Set ([...targetClass [fieldName], ...sourceClass [fieldName]]); } } else { for (let fieldName of fieldNames) { targetClass [fieldName] = new Set (sourceClass [fieldName]); } } } } export function __withblock__ (manager, statements) { if (hasattr (manager, '__enter__')) { try { manager.__enter__ (); statements (); manager.__exit__ (); } catch (exception) { if (! (manager.__exit__ (exception.name, exception, exception.stack))) { throw exception; } } } else { statements (); manager.close (); } }; export function dir (obj) { var aList = []; for (var aKey in obj) { aList.push (aKey.startsWith ('py_') ? aKey.slice (3) : aKey); } aList.sort (); return aList; }; export function setattr (obj, name, value) { obj [name] = value; }; export function getattr (obj, name) { return name in obj ? obj [name] : obj ['py_' + name]; }; export function hasattr (obj, name) { try { return name in obj || 'py_' + name in obj; } catch (exception) { return false; } }; export function delattr (obj, name) { if (name in obj) { delete obj [name]; } else { delete obj ['py_' + name]; } }; export function __in__ (element, container) { if (container === undefined || container === null) { return false; } if (container.__contains__ instanceof Function) { return container.__contains__ (element); } else { return ( container.indexOf ? container.indexOf (element) > -1 : container.hasOwnProperty (element) ); } }; export function __specialattrib__ (attrib) { return (attrib.startswith ('__') && attrib.endswith ('__')) || attrib == 'constructor' || attrib.startswith ('py_'); }; export function len (anObject) { if (anObject === undefined || anObject === null) { return 0; } if (anObject.__len__ instanceof Function) { return anObject.__len__ (); } if (anObject.length !== undefined) { return anObject.length; } var length = 0; for (var attr in anObject) { if (!__specialattrib__ (attr)) { length++; } } return length; }; export function __i__ (any) { return py_typeof (any) == dict ? any.py_keys () : any; } export function __k__ (keyed, key) { var result = keyed [key]; if (typeof result == 'undefined') { if (keyed instanceof Array) if (key == +key && key >= 0 && keyed.length > key) return result; else throw IndexError (key, new Error()); else throw KeyError (key, new Error()); } return result; } export function __t__ (target) { return ( target === undefined || target === null ? false : ['boolean', 'number'] .indexOf (typeof target) >= 0 ? target : target.__bool__ instanceof Function ? (target.__bool__ () ? target : false) : target.__len__ instanceof Function ? (target.__len__ () !== 0 ? target : false) : target instanceof Function ? target : len (target) !== 0 ? target : false ); } export function float (any) { if (any == 'inf') { return Infinity; } else if (any == '-inf') { return -Infinity; } else if (any == 'nan') { return NaN; } else if (isNaN (parseFloat (any))) { if (any === false) { return 0; } else if (any === true) { return 1; } else { throw ValueError ("could not convert string to float: '" + str(any) + "'", new Error ()); } } else { return +any; } }; float.__name__ = 'float'; float.__bases__ = [object]; export function int (any) { return float (any) | 0 }; int.__name__ = 'int'; int.__bases__ = [object]; export function bool (any) { return !!__t__ (any); }; bool.__name__ = 'bool'; bool.__bases__ = [int]; export function py_typeof (anObject) { var aType = typeof anObject; if (aType == 'object') { try { return '__class__' in anObject ? anObject.__class__ : object; } catch (exception) { return aType; } } else { return ( aType == 'boolean' ? bool : aType == 'string' ? str : aType == 'number' ? (anObject % 1 == 0 ? int : float) : null ); } }; export function issubclass (aClass, classinfo) { if (classinfo instanceof Array) { for (let aClass2 of classinfo) { if (issubclass (aClass, aClass2)) { return true; } } return false; } try { var aClass2 = aClass; if (aClass2 == classinfo) { return true; } else { var bases = [].slice.call (aClass2.__bases__); while (bases.length) { aClass2 = bases.shift (); if (aClass2 == classinfo) { return true; } if (aClass2.__bases__.length) { bases = [].slice.call (aClass2.__bases__).concat (bases); } } return false; } } catch (exception) { return aClass == classinfo || classinfo == object; } }; export function isinstance (anObject, classinfo) { try { return '__class__' in anObject ? issubclass (anObject.__class__, classinfo) : issubclass (py_typeof (anObject), classinfo); } catch (exception) { return issubclass (py_typeof (anObject), classinfo); } }; export function callable (anObject) { return anObject && typeof anObject == 'object' && '__call__' in anObject ? true : typeof anObject === 'function'; }; export function repr (anObject) { try { return anObject.__repr__ (); } catch (exception) { try { return anObject.__str__ (); } catch (exception) { try { if (anObject == null) { return 'None'; } else if (anObject.constructor == Object) { var result = '{'; var comma = false; for (var attrib in anObject) { if (!__specialattrib__ (attrib)) { if (attrib.isnumeric ()) { var attribRepr = attrib; } else { var attribRepr = '\'' + attrib + '\''; } if (comma) { result += ', '; } else { comma = true; } result += attribRepr + ': ' + repr (anObject [attrib]); } } result += '}'; return result; } else { return typeof anObject == 'boolean' ? anObject.toString () .capitalize () : anObject.toString (); } } catch (exception) { return ''; } } } }; export function chr (charCode) { return String.fromCharCode (charCode); }; export function ord (aChar) { return aChar.charCodeAt (0); }; export function max (nrOrSeq) { return arguments.length == 1 ? Math.max (...nrOrSeq) : Math.max (...arguments); }; export function min (nrOrSeq) { return arguments.length == 1 ? Math.min (...nrOrSeq) : Math.min (...arguments); }; export var abs = Math.abs; export function round (number, ndigits) { if (ndigits) { var scale = Math.pow (10, ndigits); number *= scale; } var rounded = Math.round (number); if (rounded - number == 0.5 && rounded % 2) { rounded -= 1; } if (ndigits) { rounded /= scale; } return rounded; }; export function __jsUsePyNext__ () { try { var result = this.__next__ (); return {value: result, done: false}; } catch (exception) { return {value: undefined, done: true}; } } export function __pyUseJsNext__ () { var result = this.next (); if (result.done) { throw StopIteration (new Error ()); } else { return result.value; } } export function py_iter (iterable) { if (typeof iterable == 'string' || '__iter__' in iterable) { var result = iterable.__iter__ (); result.next = __jsUsePyNext__; } else if ('selector' in iterable) { var result = list (iterable) .__iter__ (); result.next = __jsUsePyNext__; } else if ('next' in iterable) { var result = iterable if (! ('__next__' in result)) { result.__next__ = __pyUseJsNext__; } } else if (Symbol.iterator in iterable) { var result = iterable [Symbol.iterator] (); result.__next__ = __pyUseJsNext__; } else { throw IterableError (new Error ()); } result [Symbol.iterator] = function () {return result;}; return result; } export function py_next (iterator) { try { var result = iterator.__next__ (); } catch (exception) { var result = iterator.next (); if (result.done) { throw StopIteration (new Error ()); } else { return result.value; } } if (result == undefined) { throw StopIteration (new Error ()); } else { return result; } } export function __PyIterator__ (iterable) { this.iterable = iterable; this.index = 0; } __PyIterator__.prototype.__next__ = function() { if (this.index < this.iterable.length) { return this.iterable [this.index++]; } else { throw StopIteration (new Error ()); } }; export function __JsIterator__ (iterable) { this.iterable = iterable; this.index = 0; } __JsIterator__.prototype.next = function () { if (this.index < this.iterable.py_keys.length) { return {value: this.index++, done: false}; } else { return {value: undefined, done: true}; } }; export function py_reversed (iterable) { iterable = iterable.slice (); iterable.reverse (); return iterable; }; export function zip () { var args = [] .slice.call (arguments); for (var i = 0; i < args.length; i++) { if (typeof args [i] == 'string') { args [i] = args [i] .split (''); } else if (!Array.isArray (args [i])) { args [i] = Array.from (args [i]); } } var shortest = args.length == 0 ? [] : args.reduce ( function (array0, array1) { return array0.length < array1.length ? array0 : array1; } ); return shortest.map ( function (current, index) { return args.map ( function (current) { return current [index]; } ); } ); }; export function range (start, stop, step) { if (stop == undefined) { stop = start; start = 0; } if (step == undefined) { step = 1; } if ((step > 0 && start >= stop) || (step < 0 && start <= stop)) { return []; } var result = []; for (var i = start; step > 0 ? i < stop : i > stop; i += step) { result.push(i); } return result; }; export function any (iterable) { for (let item of iterable) { if (bool (item)) { return true; } } return false; } export function all (iterable) { for (let item of iterable) { if (! bool (item)) { return false; } } return true; } export function sum (iterable) { let result = 0; for (let item of iterable) { result += item; } return result; } export function enumerate (iterable) { return zip (range (len (iterable)), iterable); } export function copy (anObject) { if (anObject == null || typeof anObject == "object") { return anObject; } else { var result = {}; for (var attrib in obj) { if (anObject.hasOwnProperty (attrib)) { result [attrib] = anObject [attrib]; } } return result; } } export function deepcopy (anObject) { if (anObject == null || typeof anObject == "object") { return anObject; } else { var result = {}; for (var attrib in obj) { if (anObject.hasOwnProperty (attrib)) { result [attrib] = deepcopy (anObject [attrib]); } } return result; } } export function list (iterable) { let instance = iterable ? Array.from (iterable) : []; return instance; } Array.prototype.__class__ = list; list.__name__ = 'list'; list.__bases__ = [object]; Array.prototype.__iter__ = function () {return new __PyIterator__ (this);}; Array.prototype.__getslice__ = function (start, stop, step) { if (start < 0) { start = this.length + start; } if (stop == null) { stop = this.length; } else if (stop < 0) { stop = this.length + stop; } else if (stop > this.length) { stop = this.length; } if (step == 1) { return Array.prototype.slice.call(this, start, stop); } let result = list ([]); for (let index = start; index < stop; index += step) { result.push (this [index]); } return result; }; Array.prototype.__setslice__ = function (start, stop, step, source) { if (start < 0) { start = this.length + start; } if (stop == null) { stop = this.length; } else if (stop < 0) { stop = this.length + stop; } if (step == null) { Array.prototype.splice.apply (this, [start, stop - start] .concat (source)); } else { let sourceIndex = 0; for (let targetIndex = start; targetIndex < stop; targetIndex += step) { this [targetIndex] = source [sourceIndex++]; } } }; Array.prototype.__repr__ = function () { if (this.__class__ == set && !this.length) { return 'set()'; } let result = !this.__class__ || this.__class__ == list ? '[' : this.__class__ == tuple ? '(' : '{'; for (let index = 0; index < this.length; index++) { if (index) { result += ', '; } result += repr (this [index]); } if (this.__class__ == tuple && this.length == 1) { result += ','; } result += !this.__class__ || this.__class__ == list ? ']' : this.__class__ == tuple ? ')' : '}';; return result; }; Array.prototype.__str__ = Array.prototype.__repr__; Array.prototype.append = function (element) { this.push (element); }; Array.prototype.py_clear = function () { this.length = 0; }; Array.prototype.extend = function (aList) { this.push.apply (this, aList); }; Array.prototype.insert = function (index, element) { this.splice (index, 0, element); }; Array.prototype.remove = function (element) { let index = this.indexOf (element); if (index == -1) { throw ValueError ("list.remove(x): x not in list", new Error ()); } this.splice (index, 1); }; Array.prototype.index = function (element) { return this.indexOf (element); }; Array.prototype.py_pop = function (index) { if (index == undefined) { return this.pop (); } else { return this.splice (index, 1) [0]; } }; Array.prototype.py_sort = function () { __sort__.apply (null, [this].concat ([] .slice.apply (arguments))); }; Array.prototype.__add__ = function (aList) { return list (this.concat (aList)); }; Array.prototype.__mul__ = function (scalar) { let result = this; for (let i = 1; i < scalar; i++) { result = result.concat (this); } return result; }; Array.prototype.__rmul__ = Array.prototype.__mul__; export function tuple (iterable) { let instance = iterable ? [] .slice.apply (iterable) : []; instance.__class__ = tuple; return instance; } tuple.__name__ = 'tuple'; tuple.__bases__ = [object]; export function set (iterable) { let instance = []; if (iterable) { for (let index = 0; index < iterable.length; index++) { instance.add (iterable [index]); } } instance.__class__ = set; return instance; } set.__name__ = 'set'; set.__bases__ = [object]; Array.prototype.__bindexOf__ = function (element) { element += ''; let mindex = 0; let maxdex = this.length - 1; while (mindex <= maxdex) { let index = (mindex + maxdex) / 2 | 0; let middle = this [index] + ''; if (middle < element) { mindex = index + 1; } else if (middle > element) { maxdex = index - 1; } else { return index; } } return -1; }; Array.prototype.add = function (element) { if (this.indexOf (element) == -1) { this.push (element); } }; Array.prototype.discard = function (element) { var index = this.indexOf (element); if (index != -1) { this.splice (index, 1); } }; Array.prototype.isdisjoint = function (other) { this.sort (); for (let i = 0; i < other.length; i++) { if (this.__bindexOf__ (other [i]) != -1) { return false; } } return true; }; Array.prototype.issuperset = function (other) { this.sort (); for (let i = 0; i < other.length; i++) { if (this.__bindexOf__ (other [i]) == -1) { return false; } } return true; }; Array.prototype.issubset = function (other) { return set (other.slice ()) .issuperset (this); }; Array.prototype.union = function (other) { let result = set (this.slice () .sort ()); for (let i = 0; i < other.length; i++) { if (result.__bindexOf__ (other [i]) == -1) { result.push (other [i]); } } return result; }; Array.prototype.intersection = function (other) { this.sort (); let result = set (); for (let i = 0; i < other.length; i++) { if (this.__bindexOf__ (other [i]) != -1) { result.push (other [i]); } } return result; }; Array.prototype.difference = function (other) { let sother = set (other.slice () .sort ()); let result = set (); for (let i = 0; i < this.length; i++) { if (sother.__bindexOf__ (this [i]) == -1) { result.push (this [i]); } } return result; }; Array.prototype.symmetric_difference = function (other) { return this.union (other) .difference (this.intersection (other)); }; Array.prototype.py_update = function () { let updated = [] .concat.apply (this.slice (), arguments) .sort (); this.py_clear (); for (let i = 0; i < updated.length; i++) { if (updated [i] != updated [i - 1]) { this.push (updated [i]); } } }; Array.prototype.__eq__ = function (other) { if (this.length != other.length) { return false; } if (this.__class__ == set) { this.sort (); other.sort (); } for (let i = 0; i < this.length; i++) { if (this [i] != other [i]) { return false; } } return true; }; Array.prototype.__ne__ = function (other) { return !this.__eq__ (other); }; Array.prototype.__le__ = function (other) { if (this.__class__ == set) { return this.issubset (other); } else { for (let i = 0; i < this.length; i++) { if (this [i] > other [i]) { return false; } else if (this [i] < other [i]) { return true; } } return true; } }; Array.prototype.__ge__ = function (other) { if (this.__class__ == set) { return this.issuperset (other); } else { for (let i = 0; i < this.length; i++) { if (this [i] < other [i]) { return false; } else if (this [i] > other [i]) { return true; } } return true; } }; Array.prototype.__lt__ = function (other) { return ( this.__class__ == set ? this.issubset (other) && !this.issuperset (other) : !this.__ge__ (other) ); }; Array.prototype.__gt__ = function (other) { return ( this.__class__ == set ? this.issuperset (other) && !this.issubset (other) : !this.__le__ (other) ); }; export function bytearray (bytable, encoding) { if (bytable == undefined) { return new Uint8Array (0); } else { let aType = py_typeof (bytable); if (aType == int) { return new Uint8Array (bytable); } else if (aType == str) { let aBytes = new Uint8Array (len (bytable)); for (let i = 0; i < len (bytable); i++) { aBytes [i] = bytable.charCodeAt (i); } return aBytes; } else if (aType == list || aType == tuple) { return new Uint8Array (bytable); } else { throw py_TypeError; } } } export var bytes = bytearray; Uint8Array.prototype.__add__ = function (aBytes) { let result = new Uint8Array (this.length + aBytes.length); result.set (this); result.set (aBytes, this.length); return result; }; Uint8Array.prototype.__mul__ = function (scalar) { let result = new Uint8Array (scalar * this.length); for (let i = 0; i < scalar; i++) { result.set (this, i * this.length); } return result; }; Uint8Array.prototype.__rmul__ = Uint8Array.prototype.__mul__; export function str (stringable) { if (typeof stringable === 'number') return stringable.toString(); else { try { return stringable.__str__ (); } catch (exception) { try { return repr (stringable); } catch (exception) { return String (stringable); } } } }; String.prototype.__class__ = str; str.__name__ = 'str'; str.__bases__ = [object]; String.prototype.__iter__ = function () {new __PyIterator__ (this);}; String.prototype.__repr__ = function () { return (this.indexOf ('\'') == -1 ? '\'' + this + '\'' : '"' + this + '"') .py_replace ('\t', '\\t') .py_replace ('\n', '\\n'); }; String.prototype.__str__ = function () { return this; }; String.prototype.capitalize = function () { return this.charAt (0).toUpperCase () + this.slice (1); }; String.prototype.endswith = function (suffix) { if (suffix instanceof Array) { for (var i=0;i> b; } }; export function __or__ (a, b) { if (typeof a == 'object' && '__or__' in a) { return a.__or__ (b); } else if (typeof b == 'object' && '__ror__' in b) { return b.__ror__ (a); } else { return a | b; } }; export function __xor__ (a, b) { if (typeof a == 'object' && '__xor__' in a) { return a.__xor__ (b); } else if (typeof b == 'object' && '__rxor__' in b) { return b.__rxor__ (a); } else { return a ^ b; } }; export function __and__ (a, b) { if (typeof a == 'object' && '__and__' in a) { return a.__and__ (b); } else if (typeof b == 'object' && '__rand__' in b) { return b.__rand__ (a); } else { return a & b; } }; export function __eq__ (a, b) { if (typeof a == 'object' && '__eq__' in a) { return a.__eq__ (b); } else { return a == b; } }; export function __ne__ (a, b) { if (typeof a == 'object' && '__ne__' in a) { return a.__ne__ (b); } else { return a != b } }; export function __lt__ (a, b) { if (typeof a == 'object' && '__lt__' in a) { return a.__lt__ (b); } else { return a < b; } }; export function __le__ (a, b) { if (typeof a == 'object' && '__le__' in a) { return a.__le__ (b); } else { return a <= b; } }; export function __gt__ (a, b) { if (typeof a == 'object' && '__gt__' in a) { return a.__gt__ (b); } else { return a > b; } }; export function __ge__ (a, b) { if (typeof a == 'object' && '__ge__' in a) { return a.__ge__ (b); } else { return a >= b; } }; export function __imatmul__ (a, b) { if ('__imatmul__' in a) { return a.__imatmul__ (b); } else { return a.__matmul__ (b); } }; export function __ipow__ (a, b) { if (typeof a == 'object' && '__pow__' in a) { return a.__ipow__ (b); } else if (typeof a == 'object' && '__ipow__' in a) { return a.__pow__ (b); } else if (typeof b == 'object' && '__rpow__' in b) { return b.__rpow__ (a); } else { return Math.pow (a, b); } }; export function __ijsmod__ (a, b) { if (typeof a == 'object' && '__imod__' in a) { return a.__ismod__ (b); } else if (typeof a == 'object' && '__mod__' in a) { return a.__mod__ (b); } else if (typeof b == 'object' && '__rpow__' in b) { return b.__rmod__ (a); } else { return a % b; } }; export function __imod__ (a, b) { if (typeof a == 'object' && '__imod__' in a) { return a.__imod__ (b); } else if (typeof a == 'object' && '__mod__' in a) { return a.__mod__ (b); } else if (typeof b == 'object' && '__rmod__' in b) { return b.__rmod__ (a); } else { return ((a % b) + b) % b; } }; export function __imul__ (a, b) { if (typeof a == 'object' && '__imul__' in a) { return a.__imul__ (b); } else if (typeof a == 'object' && '__mul__' in a) { return a = a.__mul__ (b); } else if (typeof b == 'object' && '__rmul__' in b) { return a = b.__rmul__ (a); } else if (typeof a == 'string') { return a = a.__mul__ (b); } else if (typeof b == 'string') { return a = b.__rmul__ (a); } else { return a *= b; } }; export function __idiv__ (a, b) { if (typeof a == 'object' && '__idiv__' in a) { return a.__idiv__ (b); } else if (typeof a == 'object' && '__div__' in a) { return a = a.__div__ (b); } else if (typeof b == 'object' && '__rdiv__' in b) { return a = b.__rdiv__ (a); } else { return a /= b; } }; export function __iadd__ (a, b) { if (typeof a == 'object' && '__iadd__' in a) { return a.__iadd__ (b); } else if (typeof a == 'object' && '__add__' in a) { return a = a.__add__ (b); } else if (typeof b == 'object' && '__radd__' in b) { return a = b.__radd__ (a); } else { return a += b; } }; export function __isub__ (a, b) { if (typeof a == 'object' && '__isub__' in a) { return a.__isub__ (b); } else if (typeof a == 'object' && '__sub__' in a) { return a = a.__sub__ (b); } else if (typeof b == 'object' && '__rsub__' in b) { return a = b.__rsub__ (a); } else { return a -= b; } }; export function __ilshift__ (a, b) { if (typeof a == 'object' && '__ilshift__' in a) { return a.__ilshift__ (b); } else if (typeof a == 'object' && '__lshift__' in a) { return a = a.__lshift__ (b); } else if (typeof b == 'object' && '__rlshift__' in b) { return a = b.__rlshift__ (a); } else { return a <<= b; } }; export function __irshift__ (a, b) { if (typeof a == 'object' && '__irshift__' in a) { return a.__irshift__ (b); } else if (typeof a == 'object' && '__rshift__' in a) { return a = a.__rshift__ (b); } else if (typeof b == 'object' && '__rrshift__' in b) { return a = b.__rrshift__ (a); } else { return a >>= b; } }; export function __ior__ (a, b) { if (typeof a == 'object' && '__ior__' in a) { return a.__ior__ (b); } else if (typeof a == 'object' && '__or__' in a) { return a = a.__or__ (b); } else if (typeof b == 'object' && '__ror__' in b) { return a = b.__ror__ (a); } else { return a |= b; } }; export function __ixor__ (a, b) { if (typeof a == 'object' && '__ixor__' in a) { return a.__ixor__ (b); } else if (typeof a == 'object' && '__xor__' in a) { return a = a.__xor__ (b); } else if (typeof b == 'object' && '__rxor__' in b) { return a = b.__rxor__ (a); } else { return a ^= b; } }; export function __iand__ (a, b) { if (typeof a == 'object' && '__iand__' in a) { return a.__iand__ (b); } else if (typeof a == 'object' && '__and__' in a) { return a = a.__and__ (b); } else if (typeof b == 'object' && '__rand__' in b) { return a = b.__rand__ (a); } else { return a &= b; } }; export function __getitem__ (container, key) { if (typeof container == 'object' && '__getitem__' in container) { return container.__getitem__ (key); } else if ((typeof container == 'string' || container instanceof Array) && key < 0) { return container [container.length + key]; } else { return container [key]; } }; export function __setitem__ (container, key, value) { if (typeof container == 'object' && '__setitem__' in container) { container.__setitem__ (key, value); } else if ((typeof container == 'string' || container instanceof Array) && key < 0) { container [container.length + key] = value; } else { container [key] = value; } }; export function __getslice__ (container, lower, upper, step) { if (typeof container == 'object' && '__getitem__' in container) { return container.__getitem__ ([lower, upper, step]); } else { return container.__getslice__ (lower, upper, step); } }; export function __setslice__ (container, lower, upper, step, value) { if (typeof container == 'object' && '__setitem__' in container) { container.__setitem__ ([lower, upper, step], value); } else { container.__setslice__ (lower, upper, step, value); } }; export var BaseException = __class__ ('BaseException', [object], { __module__: __name__, }); export var Exception = __class__ ('Exception', [BaseException], { __module__: __name__, get __init__ () {return __get__ (this, function (self) { var kwargs = dict (); if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'self': var self = __allkwargs0__ [__attrib0__]; break; default: kwargs [__attrib0__] = __allkwargs0__ [__attrib0__]; } } delete kwargs.__kwargtrans__; } var args = tuple ([].slice.apply (arguments).slice (1, __ilastarg0__ + 1)); } else { var args = tuple (); } self.__args__ = args; if (kwargs.error != null) { self.stack = kwargs.error.stack; } else if (Error) { self.stack = new Error ().stack; } else { self.stack = 'No stack trace available'; } });}, get __repr__ () {return __get__ (this, function (self) { if (len (self.__args__) > 1) { return '{}{}'.format (self.__class__.__name__, repr (tuple (self.__args__))); } else if (len (self.__args__)) { return '{}({})'.format (self.__class__.__name__, repr (self.__args__ [0])); } else { return '{}()'.format (self.__class__.__name__); } });}, get __str__ () {return __get__ (this, function (self) { if (len (self.__args__) > 1) { return str (tuple (self.__args__)); } else if (len (self.__args__)) { return str (self.__args__ [0]); } else { return ''; } });} }); export var IterableError = __class__ ('IterableError', [Exception], { __module__: __name__, get __init__ () {return __get__ (this, function (self, error) { Exception.__init__ (self, "Can't iterate over non-iterable", __kwargtrans__ ({error: error})); });} }); export var StopIteration = __class__ ('StopIteration', [Exception], { __module__: __name__, get __init__ () {return __get__ (this, function (self, error) { Exception.__init__ (self, 'Iterator exhausted', __kwargtrans__ ({error: error})); });} }); export var ValueError = __class__ ('ValueError', [Exception], { __module__: __name__, get __init__ () {return __get__ (this, function (self, message, error) { Exception.__init__ (self, message, __kwargtrans__ ({error: error})); });} }); export var KeyError = __class__ ('KeyError', [Exception], { __module__: __name__, get __init__ () {return __get__ (this, function (self, message, error) { Exception.__init__ (self, message, __kwargtrans__ ({error: error})); });} }); export var AssertionError = __class__ ('AssertionError', [Exception], { __module__: __name__, get __init__ () {return __get__ (this, function (self, message, error) { if (message) { Exception.__init__ (self, message, __kwargtrans__ ({error: error})); } else { Exception.__init__ (self, __kwargtrans__ ({error: error})); } });} }); export var NotImplementedError = __class__ ('NotImplementedError', [Exception], { __module__: __name__, get __init__ () {return __get__ (this, function (self, message, error) { Exception.__init__ (self, message, __kwargtrans__ ({error: error})); });} }); export var IndexError = __class__ ('IndexError', [Exception], { __module__: __name__, get __init__ () {return __get__ (this, function (self, message, error) { Exception.__init__ (self, message, __kwargtrans__ ({error: error})); });} }); export var AttributeError = __class__ ('AttributeError', [Exception], { __module__: __name__, get __init__ () {return __get__ (this, function (self, message, error) { Exception.__init__ (self, message, __kwargtrans__ ({error: error})); });} }); export var py_TypeError = __class__ ('py_TypeError', [Exception], { __module__: __name__, get __init__ () {return __get__ (this, function (self, message, error) { Exception.__init__ (self, message, __kwargtrans__ ({error: error})); });} }); export var Warning = __class__ ('Warning', [Exception], { __module__: __name__, }); export var UserWarning = __class__ ('UserWarning', [Warning], { __module__: __name__, }); export var DeprecationWarning = __class__ ('DeprecationWarning', [Warning], { __module__: __name__, }); export var RuntimeWarning = __class__ ('RuntimeWarning', [Warning], { __module__: __name__, }); export var __sort__ = function (iterable, key, reverse) { if (typeof key == 'undefined' || (key != null && key.hasOwnProperty ("__kwargtrans__"))) {; var key = null; }; if (typeof reverse == 'undefined' || (reverse != null && reverse.hasOwnProperty ("__kwargtrans__"))) {; var reverse = false; }; if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'iterable': var iterable = __allkwargs0__ [__attrib0__]; break; case 'key': var key = __allkwargs0__ [__attrib0__]; break; case 'reverse': var reverse = __allkwargs0__ [__attrib0__]; break; } } } } else { } if (key) { iterable.sort ((function __lambda__ (a, b) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'a': var a = __allkwargs0__ [__attrib0__]; break; case 'b': var b = __allkwargs0__ [__attrib0__]; break; } } } } else { } return (key (a) > key (b) ? 1 : -(1)); })); } else { iterable.sort (); } if (reverse) { iterable.reverse (); } }; export var sorted = function (iterable, key, reverse) { if (typeof key == 'undefined' || (key != null && key.hasOwnProperty ("__kwargtrans__"))) {; var key = null; }; if (typeof reverse == 'undefined' || (reverse != null && reverse.hasOwnProperty ("__kwargtrans__"))) {; var reverse = false; }; if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'iterable': var iterable = __allkwargs0__ [__attrib0__]; break; case 'key': var key = __allkwargs0__ [__attrib0__]; break; case 'reverse': var reverse = __allkwargs0__ [__attrib0__]; break; } } } } else { } if (py_typeof (iterable) == dict) { var result = copy (iterable.py_keys ()); } else { var result = copy (iterable); } __sort__ (result, key, reverse); return result; }; export var map = function (func, iterable) { return (function () { var __accu0__ = []; for (var item of iterable) { __accu0__.append (func (item)); } return __accu0__; }) (); }; export var filter = function (func, iterable) { if (func == null) { var func = bool; } return (function () { var __accu0__ = []; for (var item of iterable) { if (func (item)) { __accu0__.append (item); } } return __accu0__; }) (); }; export var divmod = function (n, d) { return tuple ([Math.floor (n / d), __mod__ (n, d)]); }; export var __Terminal__ = __class__ ('__Terminal__', [object], { __module__: __name__, get __init__ () {return __get__ (this, function (self) { self.buffer = ''; try { self.element = document.getElementById ('__terminal__'); } catch (__except0__) { self.element = null; } if (self.element) { self.element.style.overflowX = 'auto'; self.element.style.boxSizing = 'border-box'; self.element.style.padding = '5px'; self.element.innerHTML = '_'; } });}, get print () {return __get__ (this, function (self) { var sep = ' '; var end = '\n'; if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'self': var self = __allkwargs0__ [__attrib0__]; break; case 'sep': var sep = __allkwargs0__ [__attrib0__]; break; case 'end': var end = __allkwargs0__ [__attrib0__]; break; } } } var args = tuple ([].slice.apply (arguments).slice (1, __ilastarg0__ + 1)); } else { var args = tuple (); } self.buffer = '{}{}{}'.format (self.buffer, sep.join ((function () { var __accu0__ = []; for (var arg of args) { __accu0__.append (str (arg)); } return __accu0__; }) ()), end).__getslice__ (-(4096), null, 1); if (self.element) { self.element.innerHTML = self.buffer.py_replace ('\n', '
').py_replace (' ', ' '); self.element.scrollTop = self.element.scrollHeight; } else { console.log (sep.join ((function () { var __accu0__ = []; for (var arg of args) { __accu0__.append (str (arg)); } return __accu0__; }) ())); } });}, get input () {return __get__ (this, function (self, question) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'self': var self = __allkwargs0__ [__attrib0__]; break; case 'question': var question = __allkwargs0__ [__attrib0__]; break; } } } } else { } self.print ('{}'.format (question), __kwargtrans__ ({end: ''})); var answer = window.prompt ('\n'.join (self.buffer.py_split ('\n').__getslice__ (-(8), null, 1))); self.print (answer); return answer; });} }); export var __terminal__ = __Terminal__ (); export var print = __terminal__.print; export var input = __terminal__.input; //# sourceMappingURL=org.transcrypt.__runtime__.map ================================================ FILE: docs/examples/transcrypt/sketch_004/target/org.transcrypt.__runtime__.py ================================================ # Transcrypt runtime module #__pragma__ ('js', 'export var __envir__ = {{}};\n{}', __include__ ('org/transcrypt/__envir__.js')) #__pragma__ ('js', '{}', __include__ ('org/transcrypt/__core__.js')) #__pragma__ ('js', '{}', __include__ ('org/transcrypt/__builtin__.js')) #__pragma__ ('skip') copy = Math = __typeof__ = __repr__ = document = console = window = 0 #__pragma__ ('noskip') #__pragma__ ('notconv') # !!! tconv gives a problem with __terminal__, needs investigation #__pragma__ ('nokwargs') #__pragma__ ('noalias', 'sort') class BaseException: pass class Exception (BaseException): #__pragma__ ('kwargs') def __init__ (self, *args, **kwargs): self.__args__ = args if kwargs.error != None: self.stack = kwargs.error.stack # Integrate with JavaScript Error object elif Error: self.stack = (__new__(Error())).stack # Create our own stack if we aren't given one else: self.stack = 'No stack trace available' #__pragma__ ('nokwargs') def __repr__ (self): if len (self.__args__) > 1: return '{}{}'.format (self.__class__.__name__, repr (tuple (self.__args__))) elif len (self.__args__): return '{}({})'.format (self.__class__.__name__, repr (self.__args__ [0])) else: return '{}()'.format (self.__class__.__name__) def __str__ (self): if len (self.__args__) > 1: return str (tuple (self.__args__)) elif len (self.__args__): return str (self.__args__ [0]) else: return '' class IterableError (Exception): def __init__ (self, error): Exception.__init__ (self, 'Can\'t iterate over non-iterable', error = error) class StopIteration (Exception): def __init__ (self, error): Exception.__init__ (self, 'Iterator exhausted', error = error) class ValueError (Exception): def __init__ (self, message, error): Exception.__init__ (self, message, error = error) class KeyError (Exception): def __init__ (self, message, error): Exception.__init__ (self, message, error = error) class AssertionError (Exception): def __init__ (self, message, error): if message: Exception.__init__ (self, message, error = error) else: Exception.__init__ (self, error = error) class NotImplementedError (Exception): def __init__(self, message, error): Exception.__init__(self, message, error = error) class IndexError (Exception): def __init__(self, message, error): Exception.__init__(self, message, error = error) class AttributeError (Exception): def __init__(self, message, error): Exception.__init__(self, message, error = error) class TypeError (Exception): def __init__(self, message, error): Exception.__init__(self, message, error = error) # Warnings Exceptions # N.B. This is a limited subset of the warnings defined in # the cpython implementation to keep things small for now. class Warning (Exception): ''' Warning Base Class ''' pass class UserWarning (Warning): pass class DeprecationWarning (Warning): pass class RuntimeWarning (Warning): pass #__pragma__ ('kwargs') def __sort__ (iterable, key = None, reverse = False): # Used by py_sort, can deal with kwargs if key: iterable.sort (lambda a, b: 1 if key (a) > key (b) else -1) # JavaScript sort, case '==' is irrelevant for sorting else: iterable.sort () # JavaScript sort if reverse: iterable.reverse () def sorted (iterable, key = None, reverse = False): if type (iterable) == dict: result = copy (iterable.keys ()) else: result = copy (iterable) __sort__ (result, key, reverse) return result #__pragma__ ('nokwargs') def map (func, iterable): return [func (item) for item in iterable] def filter (func, iterable): if func == None: func = bool return [item for item in iterable if func (item)] def divmod (n, d): return n // d, n % d #__pragma__ ('ifdef', '__complex__') class complex: def __init__ (self, real, imag = None): if imag == None: if type (real) == complex: self.real = real.real self.imag = real.imag else: self.real = real self.imag = 0 else: self.real = real self.imag = imag def __neg__ (self): return complex (-self.real, -self.imag) def __exp__ (self): modulus = Math.exp (self.real) return complex (modulus * Math.cos (self.imag), modulus * Math.sin (self.imag)) def __log__ (self): return complex (Math.log (Math.sqrt (self.real * self.real + self.imag * self.imag)), Math.atan2 (self.imag, self.real)) def __pow__ (self, other): # a ** b = exp (b log a) return (self.__log__ () .__mul__ (other)) .__exp__ () def __rpow__ (self, real): # real ** comp -> comp.__rpow__ (real) return self.__mul__ (Math.log (real)) .__exp__ () def __mul__ (self, other): if __typeof__ (other) is 'number': return complex (self.real * other, self.imag * other) else: return complex (self.real * other.real - self.imag * other.imag, self.real * other.imag + self.imag * other.real) def __rmul__ (self, real): # real + comp -> comp.__rmul__ (real) return complex (self.real * real, self.imag * real) def __div__ (self, other): if __typeof__ (other) is 'number': return complex (self.real / other, self.imag / other) else: denom = other.real * other.real + other.imag * other.imag return complex ( (self.real * other.real + self.imag * other.imag) / denom, (self.imag * other.real - self.real * other.imag) / denom ) def __rdiv__ (self, real): # real / comp -> comp.__rdiv__ (real) denom = self.real * self.real return complex ( (real * self.real) / denom, (real * self.imag) / denom ) def __add__ (self, other): if __typeof__ (other) is 'number': return complex (self.real + other, self.imag) else: # Assume other is complex return complex (self.real + other.real, self.imag + other.imag) def __radd__ (self, real): # real + comp -> comp.__radd__ (real) return complex (self.real + real, self.imag) def __sub__ (self, other): if __typeof__ (other) is 'number': return complex (self.real - other, self.imag) else: return complex (self.real - other.real, self.imag - other.imag) def __rsub__ (self, real): # real - comp -> comp.__rsub__ (real) return complex (real - self.real, -self.imag) def __repr__ (self): return '({}{}{}j)'.format (self.real, '+' if self.imag >= 0 else '', self.imag) def __str__ (self): return __repr__ (self) [1 : -1] def __eq__ (self, other): if __typeof__ (other) is 'number': return self.real == other else: return self.real == other.real and self.imag == other.imag def __ne__ (self, other): if __typeof__ (other) is 'number': return self.real != other else: return self.real != other.real or self.imag != other.imag def conjugate (self): return complex (self.real, -self.imag) def __conj__ (aNumber): if isinstance (aNumber, complex): return complex (aNumber.real, -aNumber.imag) else: return complex (aNumber, 0) #__pragma__ ('endif') class __Terminal__: ''' Printing to either the console or to html happens async, but is blocked by calling window.prompt. So while all input and print statements are encountered in normal order, the print's exit immediately without yet having actually printed This means the next input takes control, blocking actual printing and so on indefinitely The effect is that everything's only printed after all inputs are done To prevent that, what's needed is to only execute the next window.prompt after actual printing has been done Since we've no way to find out when that is, a timeout is used. ''' def __init__ (self): self.buffer = '' try: self.element = document.getElementById ('__terminal__') except: self.element = None if self.element: self.element.style.overflowX = 'auto' self.element.style.boxSizing = 'border-box' self.element.style.padding = '5px' self.element.innerHTML = '_' #__pragma__ ('kwargs') def print (self, *args, sep = ' ', end = '\n'): self.buffer = '{}{}{}'.format (self.buffer, sep.join ([str (arg) for arg in args]), end) [-4096 : ] if self.element: self.element.innerHTML = self.buffer.replace ('\n', '
') .replace (' ', ' ') self.element.scrollTop = self.element.scrollHeight else: console.log (sep.join ([str (arg) for arg in args])) def input (self, question): self.print ('{}'.format (question), end = '') answer = window.prompt ('\n'.join (self.buffer.split ('\n') [-8:])) self.print (answer) return answer #__pragma__ ('nokwargs') __terminal__ = __Terminal__ () print = __terminal__.print input = __terminal__.input ================================================ FILE: docs/examples/transcrypt/sketch_004/target/pyp5js.js ================================================ // Transcrypt'ed from Python, 2021-11-02 13:06:12 import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, all, any, assert, bool, bytearray, bytes, callable, chr, deepcopy, delattr, dict, dir, divmod, enumerate, getattr, hasattr, isinstance, issubclass, len, list, object, ord, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, setattr, sorted, sum, tuple, zip} from './org.transcrypt.__runtime__.js'; import {PythonFunctions} from './python_functions.js'; var __name__ = 'pyp5js'; export var _P5_INSTANCE = null; export var _CTX_MIDDLE = null; export var _DEFAULT_FILL = null; export var _DEFAULT_LEADMULT = null; export var _DEFAULT_STROKE = null; export var _DEFAULT_TEXT_FILL = null; export var ADD = null; export var ALT = null; export var ARROW = null; export var AUDIO = null; export var AUTO = null; export var AXES = null; export var BACKSPACE = null; export var BASELINE = null; export var BEVEL = null; export var BEZIER = null; export var BLEND = null; export var BLUR = null; export var BOLD = null; export var BOLDITALIC = null; export var BOTTOM = null; export var BURN = null; export var CENTER = null; export var CHORD = null; export var CLAMP = null; export var CLOSE = null; export var CONTROL = null; export var CORNER = null; export var CORNERS = null; export var CROSS = null; export var CURVE = null; export var DARKEST = null; export var DEG_TO_RAD = null; export var DEGREES = null; export var DELETE = null; export var DIFFERENCE = null; export var DILATE = null; export var DODGE = null; export var DOWN_ARROW = null; export var ENTER = null; export var ERODE = null; export var ESCAPE = null; export var EXCLUSION = null; export var FILL = null; export var GRAY = null; export var GRID = null; export var HALF_PI = null; export var HAND = null; export var HARD_LIGHT = null; export var HSB = null; export var HSL = null; export var IMAGE = null; export var IMMEDIATE = null; export var INVERT = null; export var ITALIC = null; export var LANDSCAPE = null; export var LEFT = null; export var LEFT_ARROW = null; export var LIGHTEST = null; export var LINE_LOOP = null; export var LINE_STRIP = null; export var LINEAR = null; export var LINES = null; export var MIRROR = null; export var MITER = null; export var MOVE = null; export var MULTIPLY = null; export var NEAREST = null; export var NORMAL = null; export var OPAQUE = null; export var OPEN = null; export var OPTION = null; export var OVERLAY = null; export var PI = null; export var PIE = null; export var POINTS = null; export var PORTRAIT = null; export var POSTERIZE = null; export var PROJECT = null; export var QUAD_STRIP = null; export var QUADRATIC = null; export var QUADS = null; export var QUARTER_PI = null; export var RAD_TO_DEG = null; export var RADIANS = null; export var RADIUS = null; export var REPEAT = null; export var REPLACE = null; export var RETURN = null; export var RGB = null; export var RIGHT = null; export var RIGHT_ARROW = null; export var ROUND = null; export var SCREEN = null; export var SHIFT = null; export var SOFT_LIGHT = null; export var SQUARE = null; export var STROKE = null; export var SUBTRACT = null; export var TAB = null; export var TAU = null; export var TEXT = null; export var TEXTURE = null; export var THRESHOLD = null; export var TOP = null; export var TRIANGLE_FAN = null; export var TRIANGLE_STRIP = null; export var TRIANGLES = null; export var TWO_PI = null; export var UP_ARROW = null; export var VIDEO = null; export var WAIT = null; export var WEBGL = null; export var P2D = null; var PI = null; export var frameCount = null; export var focused = null; export var displayWidth = null; export var displayHeight = null; export var windowWidth = null; export var windowHeight = null; export var width = null; export var height = null; export var disableFriendlyErrors = null; export var deviceOrientation = null; export var accelerationX = null; export var accelerationY = null; export var accelerationZ = null; export var pAccelerationX = null; export var pAccelerationY = null; export var pAccelerationZ = null; export var rotationX = null; export var rotationY = null; export var rotationZ = null; export var pRotationX = null; export var pRotationY = null; export var pRotationZ = null; export var turnAxis = null; export var keyIsPressed = null; export var key = null; export var keyCode = null; export var mouseX = null; export var mouseY = null; export var pmouseX = null; export var pmouseY = null; export var winMouseX = null; export var winMouseY = null; export var pwinMouseX = null; export var pwinMouseY = null; export var mouseButton = null; export var mouseIsPressed = null; export var touches = null; export var pixels = null; export var alpha = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.alpha (...args); }; export var blue = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.blue (...args); }; export var brightness = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.brightness (...args); }; export var color = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.color (...args); }; export var green = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.green (...args); }; export var hue = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.hue (...args); }; export var lerpColor = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.lerpColor (...args); }; export var lightness = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.lightness (...args); }; export var red = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.red (...args); }; export var saturation = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.saturation (...args); }; export var background = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.background (...args); }; export var py_clear = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } var p5_clear = _P5_INSTANCE.clear (...args); return p5_clear; }; export var erase = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.erase (...args); }; export var noErase = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noErase (...args); }; export var colorMode = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.colorMode (...args); }; export var fill = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.fill (...args); }; export var noFill = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noFill (...args); }; export var noStroke = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noStroke (...args); }; export var stroke = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.stroke (...args); }; export var arc = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.arc (...args); }; export var ellipse = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.ellipse (...args); }; export var circle = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.circle (...args); }; export var line = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.line (...args); }; export var point = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.point (...args); }; export var quad = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.quad (...args); }; export var rect = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.rect (...args); }; export var square = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.square (...args); }; export var triangle = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.triangle (...args); }; export var plane = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.plane (...args); }; export var box = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.box (...args); }; export var sphere = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.sphere (...args); }; export var cylinder = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.cylinder (...args); }; export var cone = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.cone (...args); }; export var ellipsoid = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.ellipsoid (...args); }; export var torus = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.torus (...args); }; export var loadModel = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.loadModel (...args); }; export var model = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.model (...args); }; export var ellipseMode = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.ellipseMode (...args); }; export var noSmooth = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noSmooth (...args); }; export var rectMode = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.rectMode (...args); }; export var smooth = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.smooth (...args); }; export var strokeCap = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.strokeCap (...args); }; export var strokeJoin = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.strokeJoin (...args); }; export var strokeWeight = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.strokeWeight (...args); }; export var bezier = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.bezier (...args); }; export var bezierDetail = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.bezierDetail (...args); }; export var bezierPoint = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.bezierPoint (...args); }; export var bezierTangent = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.bezierTangent (...args); }; export var curve = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.curve (...args); }; export var curveDetail = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.curveDetail (...args); }; export var curveTightness = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.curveTightness (...args); }; export var curvePoint = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.curvePoint (...args); }; export var curveTangent = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.curveTangent (...args); }; export var beginContour = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.beginContour (...args); }; export var beginShape = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.beginShape (...args); }; export var bezierVertex = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.bezierVertex (...args); }; export var curveVertex = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.curveVertex (...args); }; export var endContour = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.endContour (...args); }; export var endShape = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.endShape (...args); }; export var quadraticVertex = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.quadraticVertex (...args); }; export var vertex = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.vertex (...args); }; export var cursor = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.cursor (...args); }; export var frameRate = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.frameRate (...args); }; export var noCursor = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noCursor (...args); }; export var fullscreen = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.fullscreen (...args); }; export var pixelDensity = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.pixelDensity (...args); }; export var displayDensity = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.displayDensity (...args); }; export var getURL = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.getURL (...args); }; export var getURLPath = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.getURLPath (...args); }; export var getURLParams = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.getURLParams (...args); }; export var preload = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.preload (...args); }; export var setup = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.setup (...args); }; export var draw = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.draw (...args); }; export var remove = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.remove (...args); }; export var noLoop = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noLoop (...args); }; export var loop = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.loop (...args); }; export var push = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.push (...args); }; export var redraw = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.redraw (...args); }; export var resizeCanvas = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.resizeCanvas (...args); }; export var noCanvas = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noCanvas (...args); }; export var createGraphics = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createGraphics (...args); }; export var blendMode = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.blendMode (...args); }; export var setAttributes = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.setAttributes (...args); }; export var applyMatrix = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.applyMatrix (...args); }; export var resetMatrix = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.resetMatrix (...args); }; export var rotate = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.rotate (...args); }; export var rotateX = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.rotateX (...args); }; export var rotateY = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.rotateY (...args); }; export var rotateZ = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.rotateZ (...args); }; export var scale = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.scale (...args); }; export var shearX = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.shearX (...args); }; export var shearY = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.shearY (...args); }; export var translate = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.translate (...args); }; export var createStringDict = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createStringDict (...args); }; export var createNumberDict = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createNumberDict (...args); }; export var append = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.append (...args); }; export var arrayCopy = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.arrayCopy (...args); }; export var concat = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.concat (...args); }; export var reverse = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.reverse (...args); }; export var shorten = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.shorten (...args); }; export var shuffle = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.shuffle (...args); }; export var py_sort = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.py_sort (...args); }; export var splice = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.splice (...args); }; export var subset = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.subset (...args); }; export var float = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.float (...args); }; export var int = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.int (...args); }; export var str = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.str (...args); }; export var boolean = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.boolean (...args); }; export var byte = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.byte (...args); }; export var char = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.char (...args); }; export var unchar = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.unchar (...args); }; export var hex = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.hex (...args); }; export var unhex = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.unhex (...args); }; export var join = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.join (...args); }; export var match = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.match (...args); }; export var matchAll = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.matchAll (...args); }; export var nf = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.nf (...args); }; export var nfc = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.nfc (...args); }; export var nfp = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.nfp (...args); }; export var nfs = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.nfs (...args); }; export var py_split = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.py_split (...args); }; export var splitTokens = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.splitTokens (...args); }; export var trim = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.trim (...args); }; export var setMoveThreshold = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.setMoveThreshold (...args); }; export var setShakeThreshold = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.setShakeThreshold (...args); }; export var keyIsDown = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.keyIsDown (...args); }; export var createImage = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createImage (...args); }; export var saveCanvas = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.saveCanvas (...args); }; export var saveFrames = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.saveFrames (...args); }; export var image_proxy = function (img) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'img': var img = __allkwargs0__ [__attrib0__]; break; } } } } else { } var _set = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } var value = img.set (...args); return value; }; var _get = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } var value = img.get (...args); return value; }; img.py_set = _set; img.py_get = _get; return img; }; export var loadImage = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } var imageObj = _P5_INSTANCE.loadImage (...args); return image_proxy (imageObj); }; export var image = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.image (...args); }; export var tint = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.tint (...args); }; export var noTint = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noTint (...args); }; export var imageMode = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.imageMode (...args); }; export var blend = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.blend (...args); }; export var copy = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.copy (...args); }; export var filter = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } if (len (args) > 1 && (args [0] === null || callable (args [0]))) { return PythonFunctions.filter (...args); } else { return _P5_INSTANCE.filter (...args); } }; export var py_get = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } var p5_get = _P5_INSTANCE.get (...args); return p5_get; }; export var loadPixels = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.loadPixels (...args); }; export var py_set = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } if (len (args) <= 1) { return PythonFunctions.py_set (...args); } else { return _P5_INSTANCE.py_set (...args); } }; export var updatePixels = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.updatePixels (...args); }; export var loadJSON = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.loadJSON (...args); }; export var loadStrings = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.loadStrings (...args); }; export var loadTable = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.loadTable (...args); }; export var loadXML = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.loadXML (...args); }; export var loadBytes = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.loadBytes (...args); }; export var httpGet = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.httpGet (...args); }; export var httpPost = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.httpPost (...args); }; export var httpDo = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.httpDo (...args); }; export var createWriter = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createWriter (...args); }; export var save = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.save (...args); }; export var saveJSON = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.saveJSON (...args); }; export var saveStrings = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.saveStrings (...args); }; export var saveTable = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.saveTable (...args); }; export var day = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.day (...args); }; export var hour = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.hour (...args); }; export var minute = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.minute (...args); }; export var millis = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.millis (...args); }; export var month = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.month (...args); }; export var second = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.second (...args); }; export var year = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.year (...args); }; export var createVector = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createVector (...args); }; export var abs = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.abs (...args); }; export var ceil = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.ceil (...args); }; export var constrain = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.constrain (...args); }; export var dist = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.dist (...args); }; export var exp = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.exp (...args); }; export var floor = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.floor (...args); }; export var lerp = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.lerp (...args); }; export var log = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.log (...args); }; export var mag = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.mag (...args); }; export var map = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } if (len (args) > 1 && callable (args [0])) { return PythonFunctions.map (...args); } else { return _P5_INSTANCE.map (...args); } }; export var max = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.max (...args); }; export var min = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.min (...args); }; export var norm = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.norm (...args); }; export var pow = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.pow (...args); }; export var round = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.round (...args); }; export var sq = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.sq (...args); }; export var sqrt = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.sqrt (...args); }; export var noise = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noise (...args); }; export var noiseDetail = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noiseDetail (...args); }; export var noiseSeed = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noiseSeed (...args); }; export var randomSeed = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.randomSeed (...args); }; export var random = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.random (...args); }; export var randomGaussian = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.randomGaussian (...args); }; export var acos = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.acos (...args); }; export var asin = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.asin (...args); }; export var atan = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.atan (...args); }; export var atan2 = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.atan2 (...args); }; export var cos = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.cos (...args); }; export var sin = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.sin (...args); }; export var tan = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.tan (...args); }; export var degrees = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.degrees (...args); }; export var radians = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.radians (...args); }; export var angleMode = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.angleMode (...args); }; export var textAlign = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.textAlign (...args); }; export var textLeading = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.textLeading (...args); }; export var textSize = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.textSize (...args); }; export var textStyle = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.textStyle (...args); }; export var textWidth = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.textWidth (...args); }; export var textAscent = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.textAscent (...args); }; export var textDescent = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.textDescent (...args); }; export var loadFont = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.loadFont (...args); }; export var text = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.text (...args); }; export var textFont = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.textFont (...args); }; export var orbitControl = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.orbitControl (...args); }; export var debugMode = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.debugMode (...args); }; export var noDebugMode = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noDebugMode (...args); }; export var ambientLight = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.ambientLight (...args); }; export var directionalLight = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.directionalLight (...args); }; export var pointLight = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.pointLight (...args); }; export var lights = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.lights (...args); }; export var loadShader = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.loadShader (...args); }; export var createShader = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createShader (...args); }; export var shader = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.shader (...args); }; export var resetShader = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.resetShader (...args); }; export var normalMaterial = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.normalMaterial (...args); }; export var texture = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.texture (...args); }; export var textureMode = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.textureMode (...args); }; export var textureWrap = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.textureWrap (...args); }; export var ambientMaterial = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.ambientMaterial (...args); }; export var specularMaterial = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.specularMaterial (...args); }; export var shininess = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.shininess (...args); }; export var camera = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.camera (...args); }; export var perspective = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.perspective (...args); }; export var ortho = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.ortho (...args); }; export var createCamera = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createCamera (...args); }; export var setCamera = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.setCamera (...args); }; export var select = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.select (...args); }; export var selectAll = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.selectAll (...args); }; export var removeElements = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.removeElements (...args); }; export var changed = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.changed (...args); }; export var input = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.input (...args); }; export var createDiv = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createDiv (...args); }; export var createP = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createP (...args); }; export var createSpan = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createSpan (...args); }; export var createImg = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createImg (...args); }; export var createA = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createA (...args); }; export var createSlider = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createSlider (...args); }; export var createButton = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createButton (...args); }; export var createCheckbox = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createCheckbox (...args); }; export var createSelect = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createSelect (...args); }; export var createRadio = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createRadio (...args); }; export var createColorPicker = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createColorPicker (...args); }; export var createInput = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createInput (...args); }; export var createFileInput = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createFileInput (...args); }; export var createVideo = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createVideo (...args); }; export var createAudio = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createAudio (...args); }; export var createCapture = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createCapture (...args); }; export var createElement = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createElement (...args); }; export var createCanvas = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } var canvas = _P5_INSTANCE.createCanvas (...args); width = _P5_INSTANCE.width; height = _P5_INSTANCE.height; return canvas; }; export var py_pop = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } var p5_pop = _P5_INSTANCE.pop (...args); return p5_pop; }; export var size = createCanvas; export var popMatrix = py_pop; export var popStyle = py_pop; export var pushMatrix = push; export var pushStyle = push; export var PVector = function (x, y, z) { if (typeof x == 'undefined' || (x != null && x.hasOwnProperty ("__kwargtrans__"))) {; var x = 0; }; if (typeof y == 'undefined' || (y != null && y.hasOwnProperty ("__kwargtrans__"))) {; var y = 0; }; if (typeof z == 'undefined' || (z != null && z.hasOwnProperty ("__kwargtrans__"))) {; var z = 0; }; if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'x': var x = __allkwargs0__ [__attrib0__]; break; case 'y': var y = __allkwargs0__ [__attrib0__]; break; case 'z': var z = __allkwargs0__ [__attrib0__]; break; } } } } else { } return _P5_INSTANCE.createVector (x, y, z); }; setattr (PVector, 'dist', p5.Vector.dist); setattr (PVector, 'add', p5.Vector.add); setattr (PVector, 'sub', p5.Vector.sub); setattr (PVector, 'mult', p5.Vector.mult); setattr (PVector, 'div', p5.Vector.div); setattr (PVector, 'dot', p5.Vector.dot); setattr (PVector, 'cross', p5.Vector.cross); setattr (PVector, 'lerp', p5.Vector.lerp); setattr (PVector, 'random2D', p5.Vector.random2D); setattr (PVector, 'random3D', p5.Vector.random3D); setattr (PVector, 'angleBetween', p5.Vector.angleBetween); setattr (PVector, 'fromAngle', p5.Vector.fromAngle); setattr (PVector, 'fromAngles', p5.Vector.fromAngles); setattr (PVector, 'equals', p5.Vector.equals); export var pre_draw = function (p5_instance, draw_func) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'p5_instance': var p5_instance = __allkwargs0__ [__attrib0__]; break; case 'draw_func': var draw_func = __allkwargs0__ [__attrib0__]; break; } } } } else { } _CTX_MIDDLE = p5_instance._CTX_MIDDLE; _DEFAULT_FILL = p5_instance._DEFAULT_FILL; _DEFAULT_LEADMULT = p5_instance._DEFAULT_LEADMULT; _DEFAULT_STROKE = p5_instance._DEFAULT_STROKE; _DEFAULT_TEXT_FILL = p5_instance._DEFAULT_TEXT_FILL; ADD = p5_instance.ADD; ALT = p5_instance.ALT; ARROW = p5_instance.ARROW; AUDIO = p5_instance.AUDIO; AUTO = p5_instance.AUTO; AXES = p5_instance.AXES; BACKSPACE = p5_instance.BACKSPACE; BASELINE = p5_instance.BASELINE; BEVEL = p5_instance.BEVEL; BEZIER = p5_instance.BEZIER; BLEND = p5_instance.BLEND; BLUR = p5_instance.BLUR; BOLD = p5_instance.BOLD; BOLDITALIC = p5_instance.BOLDITALIC; BOTTOM = p5_instance.BOTTOM; BURN = p5_instance.BURN; CENTER = p5_instance.CENTER; CHORD = p5_instance.CHORD; CLAMP = p5_instance.CLAMP; CLOSE = p5_instance.CLOSE; CONTROL = p5_instance.CONTROL; CORNER = p5_instance.CORNER; CORNERS = p5_instance.CORNERS; CROSS = p5_instance.CROSS; CURVE = p5_instance.CURVE; DARKEST = p5_instance.DARKEST; DEG_TO_RAD = p5_instance.DEG_TO_RAD; DEGREES = p5_instance.DEGREES; DELETE = p5_instance.DELETE; DIFFERENCE = p5_instance.DIFFERENCE; DILATE = p5_instance.DILATE; DODGE = p5_instance.DODGE; DOWN_ARROW = p5_instance.DOWN_ARROW; ENTER = p5_instance.ENTER; ERODE = p5_instance.ERODE; ESCAPE = p5_instance.ESCAPE; EXCLUSION = p5_instance.EXCLUSION; FILL = p5_instance.FILL; GRAY = p5_instance.GRAY; GRID = p5_instance.GRID; HALF_PI = p5_instance.HALF_PI; HAND = p5_instance.HAND; HARD_LIGHT = p5_instance.HARD_LIGHT; HSB = p5_instance.HSB; HSL = p5_instance.HSL; IMAGE = p5_instance.IMAGE; IMMEDIATE = p5_instance.IMMEDIATE; INVERT = p5_instance.INVERT; ITALIC = p5_instance.ITALIC; LANDSCAPE = p5_instance.LANDSCAPE; LEFT = p5_instance.LEFT; LEFT_ARROW = p5_instance.LEFT_ARROW; LIGHTEST = p5_instance.LIGHTEST; LINE_LOOP = p5_instance.LINE_LOOP; LINE_STRIP = p5_instance.LINE_STRIP; LINEAR = p5_instance.LINEAR; LINES = p5_instance.LINES; MIRROR = p5_instance.MIRROR; MITER = p5_instance.MITER; MOVE = p5_instance.MOVE; MULTIPLY = p5_instance.MULTIPLY; NEAREST = p5_instance.NEAREST; NORMAL = p5_instance.NORMAL; OPAQUE = p5_instance.OPAQUE; OPEN = p5_instance.OPEN; OPTION = p5_instance.OPTION; OVERLAY = p5_instance.OVERLAY; P2D = p5_instance.P2D; var P3D = p5_instance.WEBGL; PI = p5_instance.PI; PIE = p5_instance.PIE; POINTS = p5_instance.POINTS; PORTRAIT = p5_instance.PORTRAIT; POSTERIZE = p5_instance.POSTERIZE; PROJECT = p5_instance.PROJECT; QUAD_STRIP = p5_instance.QUAD_STRIP; QUADRATIC = p5_instance.QUADRATIC; QUADS = p5_instance.QUADS; QUARTER_PI = p5_instance.QUARTER_PI; RAD_TO_DEG = p5_instance.RAD_TO_DEG; RADIANS = p5_instance.RADIANS; RADIUS = p5_instance.RADIUS; REPEAT = p5_instance.REPEAT; REPLACE = p5_instance.REPLACE; RETURN = p5_instance.RETURN; RGB = p5_instance.RGB; RIGHT = p5_instance.RIGHT; RIGHT_ARROW = p5_instance.RIGHT_ARROW; ROUND = p5_instance.ROUND; SCREEN = p5_instance.SCREEN; SHIFT = p5_instance.SHIFT; SOFT_LIGHT = p5_instance.SOFT_LIGHT; SQUARE = p5_instance.SQUARE; STROKE = p5_instance.STROKE; SUBTRACT = p5_instance.SUBTRACT; TAB = p5_instance.TAB; TAU = p5_instance.TAU; TEXT = p5_instance.TEXT; TEXTURE = p5_instance.TEXTURE; THRESHOLD = p5_instance.THRESHOLD; TOP = p5_instance.TOP; TRIANGLE_FAN = p5_instance.TRIANGLE_FAN; TRIANGLE_STRIP = p5_instance.TRIANGLE_STRIP; TRIANGLES = p5_instance.TRIANGLES; TWO_PI = p5_instance.TWO_PI; UP_ARROW = p5_instance.UP_ARROW; VIDEO = p5_instance.VIDEO; WAIT = p5_instance.WAIT; WEBGL = p5_instance.WEBGL; frameCount = p5_instance.frameCount; focused = p5_instance.focused; displayWidth = p5_instance.displayWidth; displayHeight = p5_instance.displayHeight; windowWidth = p5_instance.windowWidth; windowHeight = p5_instance.windowHeight; width = p5_instance.width; height = p5_instance.height; disableFriendlyErrors = p5_instance.disableFriendlyErrors; deviceOrientation = p5_instance.deviceOrientation; accelerationX = p5_instance.accelerationX; accelerationY = p5_instance.accelerationY; accelerationZ = p5_instance.accelerationZ; pAccelerationX = p5_instance.pAccelerationX; pAccelerationY = p5_instance.pAccelerationY; pAccelerationZ = p5_instance.pAccelerationZ; rotationX = p5_instance.rotationX; rotationY = p5_instance.rotationY; rotationZ = p5_instance.rotationZ; pRotationX = p5_instance.pRotationX; pRotationY = p5_instance.pRotationY; pRotationZ = p5_instance.pRotationZ; turnAxis = p5_instance.turnAxis; keyIsPressed = p5_instance.keyIsPressed; key = p5_instance.key; keyCode = p5_instance.keyCode; mouseX = p5_instance.mouseX; mouseY = p5_instance.mouseY; pmouseX = p5_instance.pmouseX; pmouseY = p5_instance.pmouseY; winMouseX = p5_instance.winMouseX; winMouseY = p5_instance.winMouseY; pwinMouseX = p5_instance.pwinMouseX; pwinMouseY = p5_instance.pwinMouseY; mouseButton = p5_instance.mouseButton; mouseIsPressed = p5_instance.mouseIsPressed; touches = p5_instance.touches; pixels = p5_instance.pixels; return draw_func (); }; export var global_p5_injection = function (p5_sketch) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'p5_sketch': var p5_sketch = __allkwargs0__ [__attrib0__]; break; } } } } else { } var decorator = function (f) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'f': var f = __allkwargs0__ [__attrib0__]; break; } } } } else { } var wrapper = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } } else { } _P5_INSTANCE = p5_sketch; return pre_draw (_P5_INSTANCE, f); }; return wrapper; }; return decorator; }; export var start_p5 = function (preload_func, setup_func, draw_func, event_functions) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'preload_func': var preload_func = __allkwargs0__ [__attrib0__]; break; case 'setup_func': var setup_func = __allkwargs0__ [__attrib0__]; break; case 'draw_func': var draw_func = __allkwargs0__ [__attrib0__]; break; case 'event_functions': var event_functions = __allkwargs0__ [__attrib0__]; break; } } } } else { } var sketch_setup = function (p5_sketch) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'p5_sketch': var p5_sketch = __allkwargs0__ [__attrib0__]; break; } } } } else { } p5_sketch.preload = global_p5_injection (p5_sketch) (preload_func); p5_sketch.setup = global_p5_injection (p5_sketch) (setup_func); p5_sketch.draw = global_p5_injection (p5_sketch) (draw_func); }; var instance = new p5 (sketch_setup, 'sketch-holder'); var event_function_names = tuple (['deviceMoved', 'deviceTurned', 'deviceShaken', 'windowResized', 'keyPressed', 'keyReleased', 'keyTyped', 'mousePressed', 'mouseReleased', 'mouseClicked', 'doubleClicked', 'mouseMoved', 'mouseDragged', 'mouseWheel', 'touchStarted', 'touchMoved', 'touchEnded', 'keyIsDown']); for (var f_name of (function () { var __accu0__ = []; for (var f of event_function_names) { if (event_functions.py_get (f, null)) { __accu0__.append (f); } } return __accu0__; }) ()) { var func = event_functions [f_name]; var event_func = global_p5_injection (instance) (func); setattr (instance, f_name, event_func); } }; export var logOnloaded = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } } else { } console.log ('Lib loaded!'); }; export var add_library = function (lib_name) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'lib_name': var lib_name = __allkwargs0__ [__attrib0__]; break; } } } } else { } var src = ''; return console.log ('Lib name is not valid:', lib_name); console.log ('Importing:', src); var script = document.createElement ('script'); script.onload = logOnloaded; script.src = src; document.head.appendChild (script); }; //# sourceMappingURL=pyp5js.map ================================================ FILE: docs/examples/transcrypt/sketch_004/target/pyp5js.py ================================================ from python_functions import PythonFunctions _P5_INSTANCE = None _CTX_MIDDLE = None _DEFAULT_FILL = None _DEFAULT_LEADMULT = None _DEFAULT_STROKE = None _DEFAULT_TEXT_FILL = None ADD = None ALT = None ARROW = None AUDIO = None AUTO = None AXES = None BACKSPACE = None BASELINE = None BEVEL = None BEZIER = None BLEND = None BLUR = None BOLD = None BOLDITALIC = None BOTTOM = None BURN = None CENTER = None CHORD = None CLAMP = None CLOSE = None CONTROL = None CORNER = None CORNERS = None CROSS = None CURVE = None DARKEST = None DEG_TO_RAD = None DEGREES = None DELETE = None DIFFERENCE = None DILATE = None DODGE = None DOWN_ARROW = None ENTER = None ERODE = None ESCAPE = None EXCLUSION = None FILL = None GRAY = None GRID = None HALF_PI = None HAND = None HARD_LIGHT = None HSB = None HSL = None IMAGE = None IMMEDIATE = None INVERT = None ITALIC = None LANDSCAPE = None LEFT = None LEFT_ARROW = None LIGHTEST = None LINE_LOOP = None LINE_STRIP = None LINEAR = None LINES = None MIRROR = None MITER = None MOVE = None MULTIPLY = None NEAREST = None NORMAL = None OPAQUE = None OPEN = None OPTION = None OVERLAY = None PI = None PIE = None POINTS = None PORTRAIT = None POSTERIZE = None PROJECT = None QUAD_STRIP = None QUADRATIC = None QUADS = None QUARTER_PI = None RAD_TO_DEG = None RADIANS = None RADIUS = None REPEAT = None REPLACE = None RETURN = None RGB = None RIGHT = None RIGHT_ARROW = None ROUND = None SCREEN = None SHIFT = None SOFT_LIGHT = None SQUARE = None STROKE = None SUBTRACT = None TAB = None TAU = None TEXT = None TEXTURE = None THRESHOLD = None TOP = None TRIANGLE_FAN = None TRIANGLE_STRIP = None TRIANGLES = None TWO_PI = None UP_ARROW = None VIDEO = None WAIT = None WEBGL = None P2D = None PI = None frameCount = None focused = None displayWidth = None displayHeight = None windowWidth = None windowHeight = None width = None height = None disableFriendlyErrors = None deviceOrientation = None accelerationX = None accelerationY = None accelerationZ = None pAccelerationX = None pAccelerationY = None pAccelerationZ = None rotationX = None rotationY = None rotationZ = None pRotationX = None pRotationY = None pRotationZ = None turnAxis = None keyIsPressed = None key = None keyCode = None mouseX = None mouseY = None pmouseX = None pmouseY = None winMouseX = None winMouseY = None pwinMouseX = None pwinMouseY = None mouseButton = None mouseIsPressed = None touches = None pixels = None def alpha(*args): return _P5_INSTANCE.alpha(*args) def blue(*args): return _P5_INSTANCE.blue(*args) def brightness(*args): return _P5_INSTANCE.brightness(*args) def color(*args): return _P5_INSTANCE.color(*args) def green(*args): return _P5_INSTANCE.green(*args) def hue(*args): return _P5_INSTANCE.hue(*args) def lerpColor(*args): return _P5_INSTANCE.lerpColor(*args) def lightness(*args): return _P5_INSTANCE.lightness(*args) def red(*args): return _P5_INSTANCE.red(*args) def saturation(*args): return _P5_INSTANCE.saturation(*args) def background(*args): return _P5_INSTANCE.background(*args) def clear(*args): __pragma__('noalias', 'clear') p5_clear = _P5_INSTANCE.clear(*args) __pragma__('alias', 'clear', 'py_clear') return p5_clear def erase(*args): return _P5_INSTANCE.erase(*args) def noErase(*args): return _P5_INSTANCE.noErase(*args) def colorMode(*args): return _P5_INSTANCE.colorMode(*args) def fill(*args): return _P5_INSTANCE.fill(*args) def noFill(*args): return _P5_INSTANCE.noFill(*args) def noStroke(*args): return _P5_INSTANCE.noStroke(*args) def stroke(*args): return _P5_INSTANCE.stroke(*args) def arc(*args): return _P5_INSTANCE.arc(*args) def ellipse(*args): return _P5_INSTANCE.ellipse(*args) def circle(*args): return _P5_INSTANCE.circle(*args) def line(*args): return _P5_INSTANCE.line(*args) def point(*args): return _P5_INSTANCE.point(*args) def quad(*args): return _P5_INSTANCE.quad(*args) def rect(*args): return _P5_INSTANCE.rect(*args) def square(*args): return _P5_INSTANCE.square(*args) def triangle(*args): return _P5_INSTANCE.triangle(*args) def plane(*args): return _P5_INSTANCE.plane(*args) def box(*args): return _P5_INSTANCE.box(*args) def sphere(*args): return _P5_INSTANCE.sphere(*args) def cylinder(*args): return _P5_INSTANCE.cylinder(*args) def cone(*args): return _P5_INSTANCE.cone(*args) def ellipsoid(*args): return _P5_INSTANCE.ellipsoid(*args) def torus(*args): return _P5_INSTANCE.torus(*args) def loadModel(*args): return _P5_INSTANCE.loadModel(*args) def model(*args): return _P5_INSTANCE.model(*args) def ellipseMode(*args): return _P5_INSTANCE.ellipseMode(*args) def noSmooth(*args): return _P5_INSTANCE.noSmooth(*args) def rectMode(*args): return _P5_INSTANCE.rectMode(*args) def smooth(*args): return _P5_INSTANCE.smooth(*args) def strokeCap(*args): return _P5_INSTANCE.strokeCap(*args) def strokeJoin(*args): return _P5_INSTANCE.strokeJoin(*args) def strokeWeight(*args): return _P5_INSTANCE.strokeWeight(*args) def bezier(*args): return _P5_INSTANCE.bezier(*args) def bezierDetail(*args): return _P5_INSTANCE.bezierDetail(*args) def bezierPoint(*args): return _P5_INSTANCE.bezierPoint(*args) def bezierTangent(*args): return _P5_INSTANCE.bezierTangent(*args) def curve(*args): return _P5_INSTANCE.curve(*args) def curveDetail(*args): return _P5_INSTANCE.curveDetail(*args) def curveTightness(*args): return _P5_INSTANCE.curveTightness(*args) def curvePoint(*args): return _P5_INSTANCE.curvePoint(*args) def curveTangent(*args): return _P5_INSTANCE.curveTangent(*args) def beginContour(*args): return _P5_INSTANCE.beginContour(*args) def beginShape(*args): return _P5_INSTANCE.beginShape(*args) def bezierVertex(*args): return _P5_INSTANCE.bezierVertex(*args) def curveVertex(*args): return _P5_INSTANCE.curveVertex(*args) def endContour(*args): return _P5_INSTANCE.endContour(*args) def endShape(*args): return _P5_INSTANCE.endShape(*args) def quadraticVertex(*args): return _P5_INSTANCE.quadraticVertex(*args) def vertex(*args): return _P5_INSTANCE.vertex(*args) def cursor(*args): return _P5_INSTANCE.cursor(*args) def frameRate(*args): return _P5_INSTANCE.frameRate(*args) def noCursor(*args): return _P5_INSTANCE.noCursor(*args) def fullscreen(*args): return _P5_INSTANCE.fullscreen(*args) def pixelDensity(*args): return _P5_INSTANCE.pixelDensity(*args) def displayDensity(*args): return _P5_INSTANCE.displayDensity(*args) def getURL(*args): return _P5_INSTANCE.getURL(*args) def getURLPath(*args): return _P5_INSTANCE.getURLPath(*args) def getURLParams(*args): return _P5_INSTANCE.getURLParams(*args) def preload(*args): return _P5_INSTANCE.preload(*args) def setup(*args): return _P5_INSTANCE.setup(*args) def draw(*args): return _P5_INSTANCE.draw(*args) def remove(*args): return _P5_INSTANCE.remove(*args) def noLoop(*args): return _P5_INSTANCE.noLoop(*args) def loop(*args): return _P5_INSTANCE.loop(*args) def push(*args): return _P5_INSTANCE.push(*args) def redraw(*args): return _P5_INSTANCE.redraw(*args) def resizeCanvas(*args): return _P5_INSTANCE.resizeCanvas(*args) def noCanvas(*args): return _P5_INSTANCE.noCanvas(*args) def createGraphics(*args): return _P5_INSTANCE.createGraphics(*args) def blendMode(*args): return _P5_INSTANCE.blendMode(*args) def setAttributes(*args): return _P5_INSTANCE.setAttributes(*args) def applyMatrix(*args): return _P5_INSTANCE.applyMatrix(*args) def resetMatrix(*args): return _P5_INSTANCE.resetMatrix(*args) def rotate(*args): return _P5_INSTANCE.rotate(*args) def rotateX(*args): return _P5_INSTANCE.rotateX(*args) def rotateY(*args): return _P5_INSTANCE.rotateY(*args) def rotateZ(*args): return _P5_INSTANCE.rotateZ(*args) def scale(*args): return _P5_INSTANCE.scale(*args) def shearX(*args): return _P5_INSTANCE.shearX(*args) def shearY(*args): return _P5_INSTANCE.shearY(*args) def translate(*args): return _P5_INSTANCE.translate(*args) def createStringDict(*args): return _P5_INSTANCE.createStringDict(*args) def createNumberDict(*args): return _P5_INSTANCE.createNumberDict(*args) def append(*args): return _P5_INSTANCE.append(*args) def arrayCopy(*args): return _P5_INSTANCE.arrayCopy(*args) def concat(*args): return _P5_INSTANCE.concat(*args) def reverse(*args): return _P5_INSTANCE.reverse(*args) def shorten(*args): return _P5_INSTANCE.shorten(*args) def shuffle(*args): return _P5_INSTANCE.shuffle(*args) def sort(*args): return _P5_INSTANCE.sort(*args) def splice(*args): return _P5_INSTANCE.splice(*args) def subset(*args): return _P5_INSTANCE.subset(*args) def float(*args): return _P5_INSTANCE.float(*args) def int(*args): return _P5_INSTANCE.int(*args) def str(*args): return _P5_INSTANCE.str(*args) def boolean(*args): return _P5_INSTANCE.boolean(*args) def byte(*args): return _P5_INSTANCE.byte(*args) def char(*args): return _P5_INSTANCE.char(*args) def unchar(*args): return _P5_INSTANCE.unchar(*args) def hex(*args): return _P5_INSTANCE.hex(*args) def unhex(*args): return _P5_INSTANCE.unhex(*args) def join(*args): return _P5_INSTANCE.join(*args) def match(*args): return _P5_INSTANCE.match(*args) def matchAll(*args): return _P5_INSTANCE.matchAll(*args) def nf(*args): return _P5_INSTANCE.nf(*args) def nfc(*args): return _P5_INSTANCE.nfc(*args) def nfp(*args): return _P5_INSTANCE.nfp(*args) def nfs(*args): return _P5_INSTANCE.nfs(*args) def split(*args): return _P5_INSTANCE.split(*args) def splitTokens(*args): return _P5_INSTANCE.splitTokens(*args) def trim(*args): return _P5_INSTANCE.trim(*args) def setMoveThreshold(*args): return _P5_INSTANCE.setMoveThreshold(*args) def setShakeThreshold(*args): return _P5_INSTANCE.setShakeThreshold(*args) def keyIsDown(*args): return _P5_INSTANCE.keyIsDown(*args) def createImage(*args): return _P5_INSTANCE.createImage(*args) def saveCanvas(*args): return _P5_INSTANCE.saveCanvas(*args) def saveFrames(*args): return _P5_INSTANCE.saveFrames(*args) def image_proxy(img): """ Proxy to turn of transcypt when calling img.get/set methods """ def _set(*args): __pragma__('noalias', 'set') value = img.set(*args) __pragma__('alias', 'set', 'py_set') return value def _get(*args): __pragma__('noalias', 'get') value = img.get(*args) __pragma__('alias', 'get', 'py_get') return value img.set = _set img.get = _get return img def loadImage(*args): imageObj = _P5_INSTANCE.loadImage(*args) return image_proxy(imageObj) def image(*args): return _P5_INSTANCE.image(*args) def tint(*args): return _P5_INSTANCE.tint(*args) def noTint(*args): return _P5_INSTANCE.noTint(*args) def imageMode(*args): return _P5_INSTANCE.imageMode(*args) def blend(*args): return _P5_INSTANCE.blend(*args) def copy(*args): return _P5_INSTANCE.copy(*args) def filter(*args): if len(args) > 1 and (args[0] is None or callable(args[0])): return PythonFunctions.filter(*args) else: return _P5_INSTANCE.filter(*args) def get(*args): __pragma__('noalias', 'get') p5_get = _P5_INSTANCE.get(*args) __pragma__('alias', 'get', 'py_get') return p5_get def loadPixels(*args): return _P5_INSTANCE.loadPixels(*args) def set(*args): if len(args) <= 1: return PythonFunctions.set(*args) else: return _P5_INSTANCE.set(*args) def updatePixels(*args): return _P5_INSTANCE.updatePixels(*args) def loadJSON(*args): return _P5_INSTANCE.loadJSON(*args) def loadStrings(*args): return _P5_INSTANCE.loadStrings(*args) def loadTable(*args): return _P5_INSTANCE.loadTable(*args) def loadXML(*args): return _P5_INSTANCE.loadXML(*args) def loadBytes(*args): return _P5_INSTANCE.loadBytes(*args) def httpGet(*args): return _P5_INSTANCE.httpGet(*args) def httpPost(*args): return _P5_INSTANCE.httpPost(*args) def httpDo(*args): return _P5_INSTANCE.httpDo(*args) def createWriter(*args): return _P5_INSTANCE.createWriter(*args) def save(*args): return _P5_INSTANCE.save(*args) def saveJSON(*args): return _P5_INSTANCE.saveJSON(*args) def saveStrings(*args): return _P5_INSTANCE.saveStrings(*args) def saveTable(*args): return _P5_INSTANCE.saveTable(*args) def day(*args): return _P5_INSTANCE.day(*args) def hour(*args): return _P5_INSTANCE.hour(*args) def minute(*args): return _P5_INSTANCE.minute(*args) def millis(*args): return _P5_INSTANCE.millis(*args) def month(*args): return _P5_INSTANCE.month(*args) def second(*args): return _P5_INSTANCE.second(*args) def year(*args): return _P5_INSTANCE.year(*args) def createVector(*args): return _P5_INSTANCE.createVector(*args) def abs(*args): return _P5_INSTANCE.abs(*args) def ceil(*args): return _P5_INSTANCE.ceil(*args) def constrain(*args): return _P5_INSTANCE.constrain(*args) def dist(*args): return _P5_INSTANCE.dist(*args) def exp(*args): return _P5_INSTANCE.exp(*args) def floor(*args): return _P5_INSTANCE.floor(*args) def lerp(*args): return _P5_INSTANCE.lerp(*args) def log(*args): return _P5_INSTANCE.log(*args) def mag(*args): return _P5_INSTANCE.mag(*args) def map(*args): if len(args) > 1 and callable(args[0]): return PythonFunctions.map(*args) else: return _P5_INSTANCE.map(*args) def max(*args): return _P5_INSTANCE.max(*args) def min(*args): return _P5_INSTANCE.min(*args) def norm(*args): return _P5_INSTANCE.norm(*args) def pow(*args): return _P5_INSTANCE.pow(*args) def round(*args): return _P5_INSTANCE.round(*args) def sq(*args): return _P5_INSTANCE.sq(*args) def sqrt(*args): return _P5_INSTANCE.sqrt(*args) def noise(*args): return _P5_INSTANCE.noise(*args) def noiseDetail(*args): return _P5_INSTANCE.noiseDetail(*args) def noiseSeed(*args): return _P5_INSTANCE.noiseSeed(*args) def randomSeed(*args): return _P5_INSTANCE.randomSeed(*args) def random(*args): return _P5_INSTANCE.random(*args) def randomGaussian(*args): return _P5_INSTANCE.randomGaussian(*args) def acos(*args): return _P5_INSTANCE.acos(*args) def asin(*args): return _P5_INSTANCE.asin(*args) def atan(*args): return _P5_INSTANCE.atan(*args) def atan2(*args): return _P5_INSTANCE.atan2(*args) def cos(*args): return _P5_INSTANCE.cos(*args) def sin(*args): return _P5_INSTANCE.sin(*args) def tan(*args): return _P5_INSTANCE.tan(*args) def degrees(*args): return _P5_INSTANCE.degrees(*args) def radians(*args): return _P5_INSTANCE.radians(*args) def angleMode(*args): return _P5_INSTANCE.angleMode(*args) def textAlign(*args): return _P5_INSTANCE.textAlign(*args) def textLeading(*args): return _P5_INSTANCE.textLeading(*args) def textSize(*args): return _P5_INSTANCE.textSize(*args) def textStyle(*args): return _P5_INSTANCE.textStyle(*args) def textWidth(*args): return _P5_INSTANCE.textWidth(*args) def textAscent(*args): return _P5_INSTANCE.textAscent(*args) def textDescent(*args): return _P5_INSTANCE.textDescent(*args) def loadFont(*args): return _P5_INSTANCE.loadFont(*args) def text(*args): return _P5_INSTANCE.text(*args) def textFont(*args): return _P5_INSTANCE.textFont(*args) def orbitControl(*args): return _P5_INSTANCE.orbitControl(*args) def debugMode(*args): return _P5_INSTANCE.debugMode(*args) def noDebugMode(*args): return _P5_INSTANCE.noDebugMode(*args) def ambientLight(*args): return _P5_INSTANCE.ambientLight(*args) def directionalLight(*args): return _P5_INSTANCE.directionalLight(*args) def pointLight(*args): return _P5_INSTANCE.pointLight(*args) def lights(*args): return _P5_INSTANCE.lights(*args) def loadShader(*args): return _P5_INSTANCE.loadShader(*args) def createShader(*args): return _P5_INSTANCE.createShader(*args) def shader(*args): return _P5_INSTANCE.shader(*args) def resetShader(*args): return _P5_INSTANCE.resetShader(*args) def normalMaterial(*args): return _P5_INSTANCE.normalMaterial(*args) def texture(*args): return _P5_INSTANCE.texture(*args) def textureMode(*args): return _P5_INSTANCE.textureMode(*args) def textureWrap(*args): return _P5_INSTANCE.textureWrap(*args) def ambientMaterial(*args): return _P5_INSTANCE.ambientMaterial(*args) def specularMaterial(*args): return _P5_INSTANCE.specularMaterial(*args) def shininess(*args): return _P5_INSTANCE.shininess(*args) def camera(*args): return _P5_INSTANCE.camera(*args) def perspective(*args): return _P5_INSTANCE.perspective(*args) def ortho(*args): return _P5_INSTANCE.ortho(*args) def createCamera(*args): return _P5_INSTANCE.createCamera(*args) def setCamera(*args): return _P5_INSTANCE.setCamera(*args) def select(*args): return _P5_INSTANCE.select(*args) def selectAll(*args): return _P5_INSTANCE.selectAll(*args) def removeElements(*args): return _P5_INSTANCE.removeElements(*args) def changed(*args): return _P5_INSTANCE.changed(*args) def input(*args): return _P5_INSTANCE.input(*args) def createDiv(*args): return _P5_INSTANCE.createDiv(*args) def createP(*args): return _P5_INSTANCE.createP(*args) def createSpan(*args): return _P5_INSTANCE.createSpan(*args) def createImg(*args): return _P5_INSTANCE.createImg(*args) def createA(*args): return _P5_INSTANCE.createA(*args) def createSlider(*args): return _P5_INSTANCE.createSlider(*args) def createButton(*args): return _P5_INSTANCE.createButton(*args) def createCheckbox(*args): return _P5_INSTANCE.createCheckbox(*args) def createSelect(*args): return _P5_INSTANCE.createSelect(*args) def createRadio(*args): return _P5_INSTANCE.createRadio(*args) def createColorPicker(*args): return _P5_INSTANCE.createColorPicker(*args) def createInput(*args): return _P5_INSTANCE.createInput(*args) def createFileInput(*args): return _P5_INSTANCE.createFileInput(*args) def createVideo(*args): return _P5_INSTANCE.createVideo(*args) def createAudio(*args): return _P5_INSTANCE.createAudio(*args) def createCapture(*args): return _P5_INSTANCE.createCapture(*args) def createElement(*args): return _P5_INSTANCE.createElement(*args) def createCanvas(*args): canvas = _P5_INSTANCE.createCanvas(*args) global width, height width = _P5_INSTANCE.width height = _P5_INSTANCE.height return canvas def pop(*args): __pragma__('noalias', 'pop') p5_pop = _P5_INSTANCE.pop(*args) __pragma__('alias', 'pop', 'py_pop') return p5_pop # Processing Python or Java mode compatibility aliases size = createCanvas popMatrix = pop popStyle = pop pushMatrix = push pushStyle = push # PVector is a helper/alias to create p5.Vector objects def PVector(x=0, y=0, z=0): return _P5_INSTANCE.createVector(x, y, z) # aliases for p5.Vector class methods setattr(PVector, 'dist', p5.Vector.dist) setattr(PVector, 'add', p5.Vector.add) setattr(PVector, 'sub', p5.Vector.sub) setattr(PVector, 'mult', p5.Vector.mult) setattr(PVector, 'div', p5.Vector.div) setattr(PVector, 'dot', p5.Vector.dot) setattr(PVector, 'cross', p5.Vector.cross) setattr(PVector, 'lerp', p5.Vector.lerp) setattr(PVector, 'random2D', p5.Vector.random2D) setattr(PVector, 'random3D', p5.Vector.random3D) setattr(PVector, 'angleBetween', p5.Vector.angleBetween) setattr(PVector, 'fromAngle', p5.Vector.fromAngle) setattr(PVector, 'fromAngles', p5.Vector.fromAngles) setattr(PVector, 'equals', p5.Vector.equals) def pre_draw(p5_instance, draw_func): """ We need to run this before the actual draw to insert and update p5 env variables """ global _CTX_MIDDLE, _DEFAULT_FILL, _DEFAULT_LEADMULT, _DEFAULT_STROKE, _DEFAULT_TEXT_FILL global ADD, ALT, ARROW, AUTO, AUDIO, AXES, BACKSPACE, BASELINE, BEVEL, BEZIER, BLEND, BLUR, BOLD, BOLDITALIC global BOTTOM, BURN, CENTER, CHORD, CLAMP, CLOSE, CONTROL, CORNER, CORNERS, CROSS, CURVE, DARKEST global DEG_TO_RAD, DEGREES, DELETE, DIFFERENCE, DILATE, DODGE, DOWN_ARROW, ENTER, ERODE, ESCAPE, EXCLUSION global FILL, GRAY, GRID, HALF_PI, HAND, HARD_LIGHT, HSB, HSL, IMAGE, IMMEDIATE, INVERT, ITALIC, LANDSCAPE global LEFT, LEFT_ARROW, LIGHTEST, LINE_LOOP, LINE_STRIP, LINEAR, LINES, MIRROR, MITER, MOVE, MULTIPLY, NEAREST global NORMAL, OPAQUE, OPEN, OPTION, OVERLAY, P2D, PI, PIE, POINTS, PORTRAIT, POSTERIZE, PROJECT, QUAD_STRIP, QUADRATIC global QUADS, QUARTER_PI, RAD_TO_DEG, RADIANS, RADIUS, REPEAT, REPLACE, RETURN, RGB, RIGHT, RIGHT_ARROW global ROUND, SCREEN, SHIFT, SOFT_LIGHT, SQUARE, STROKE, SUBTRACT, TAB, TAU, TEXT, TEXTURE, THRESHOLD, TOP global TRIANGLE_FAN, TRIANGLE_STRIP, TRIANGLES, TWO_PI, UP_ARROW, VIDEO, WAIT, WEBGL global frameCount, focused, displayWidth, displayHeight, windowWidth, windowHeight, width, height global disableFriendlyErrors, deviceOrientation, accelerationX, accelerationY, accelerationZ global pAccelerationX, pAccelerationY, pAccelerationZ, rotationX, rotationY, rotationZ global pRotationX, pRotationY, pRotationZ, turnAxis, keyIsPressed, key, keyCode, mouseX, mouseY, pmouseX, pmouseY global winMouseX, winMouseY, pwinMouseX, pwinMouseY, mouseButton, mouseIsPressed, touches, pixels _CTX_MIDDLE = p5_instance._CTX_MIDDLE _DEFAULT_FILL = p5_instance._DEFAULT_FILL _DEFAULT_LEADMULT = p5_instance._DEFAULT_LEADMULT _DEFAULT_STROKE = p5_instance._DEFAULT_STROKE _DEFAULT_TEXT_FILL = p5_instance._DEFAULT_TEXT_FILL ADD = p5_instance.ADD ALT = p5_instance.ALT ARROW = p5_instance.ARROW AUDIO = p5_instance.AUDIO AUTO = p5_instance.AUTO AXES = p5_instance.AXES BACKSPACE = p5_instance.BACKSPACE BASELINE = p5_instance.BASELINE BEVEL = p5_instance.BEVEL BEZIER = p5_instance.BEZIER BLEND = p5_instance.BLEND BLUR = p5_instance.BLUR BOLD = p5_instance.BOLD BOLDITALIC = p5_instance.BOLDITALIC BOTTOM = p5_instance.BOTTOM BURN = p5_instance.BURN CENTER = p5_instance.CENTER CHORD = p5_instance.CHORD CLAMP = p5_instance.CLAMP CLOSE = p5_instance.CLOSE CONTROL = p5_instance.CONTROL CORNER = p5_instance.CORNER CORNERS = p5_instance.CORNERS CROSS = p5_instance.CROSS CURVE = p5_instance.CURVE DARKEST = p5_instance.DARKEST DEG_TO_RAD = p5_instance.DEG_TO_RAD DEGREES = p5_instance.DEGREES DELETE = p5_instance.DELETE DIFFERENCE = p5_instance.DIFFERENCE DILATE = p5_instance.DILATE DODGE = p5_instance.DODGE DOWN_ARROW = p5_instance.DOWN_ARROW ENTER = p5_instance.ENTER ERODE = p5_instance.ERODE ESCAPE = p5_instance.ESCAPE EXCLUSION = p5_instance.EXCLUSION FILL = p5_instance.FILL GRAY = p5_instance.GRAY GRID = p5_instance.GRID HALF_PI = p5_instance.HALF_PI HAND = p5_instance.HAND HARD_LIGHT = p5_instance.HARD_LIGHT HSB = p5_instance.HSB HSL = p5_instance.HSL IMAGE = p5_instance.IMAGE IMMEDIATE = p5_instance.IMMEDIATE INVERT = p5_instance.INVERT ITALIC = p5_instance.ITALIC LANDSCAPE = p5_instance.LANDSCAPE LEFT = p5_instance.LEFT LEFT_ARROW = p5_instance.LEFT_ARROW LIGHTEST = p5_instance.LIGHTEST LINE_LOOP = p5_instance.LINE_LOOP LINE_STRIP = p5_instance.LINE_STRIP LINEAR = p5_instance.LINEAR LINES = p5_instance.LINES MIRROR = p5_instance.MIRROR MITER = p5_instance.MITER MOVE = p5_instance.MOVE MULTIPLY = p5_instance.MULTIPLY NEAREST = p5_instance.NEAREST NORMAL = p5_instance.NORMAL OPAQUE = p5_instance.OPAQUE OPEN = p5_instance.OPEN OPTION = p5_instance.OPTION OVERLAY = p5_instance.OVERLAY P2D = p5_instance.P2D P3D = p5_instance.WEBGL PI = p5_instance.PI PIE = p5_instance.PIE POINTS = p5_instance.POINTS PORTRAIT = p5_instance.PORTRAIT POSTERIZE = p5_instance.POSTERIZE PROJECT = p5_instance.PROJECT QUAD_STRIP = p5_instance.QUAD_STRIP QUADRATIC = p5_instance.QUADRATIC QUADS = p5_instance.QUADS QUARTER_PI = p5_instance.QUARTER_PI RAD_TO_DEG = p5_instance.RAD_TO_DEG RADIANS = p5_instance.RADIANS RADIUS = p5_instance.RADIUS REPEAT = p5_instance.REPEAT REPLACE = p5_instance.REPLACE RETURN = p5_instance.RETURN RGB = p5_instance.RGB RIGHT = p5_instance.RIGHT RIGHT_ARROW = p5_instance.RIGHT_ARROW ROUND = p5_instance.ROUND SCREEN = p5_instance.SCREEN SHIFT = p5_instance.SHIFT SOFT_LIGHT = p5_instance.SOFT_LIGHT SQUARE = p5_instance.SQUARE STROKE = p5_instance.STROKE SUBTRACT = p5_instance.SUBTRACT TAB = p5_instance.TAB TAU = p5_instance.TAU TEXT = p5_instance.TEXT TEXTURE = p5_instance.TEXTURE THRESHOLD = p5_instance.THRESHOLD TOP = p5_instance.TOP TRIANGLE_FAN = p5_instance.TRIANGLE_FAN TRIANGLE_STRIP = p5_instance.TRIANGLE_STRIP TRIANGLES = p5_instance.TRIANGLES TWO_PI = p5_instance.TWO_PI UP_ARROW = p5_instance.UP_ARROW VIDEO = p5_instance.VIDEO WAIT = p5_instance.WAIT WEBGL = p5_instance.WEBGL frameCount = p5_instance.frameCount focused = p5_instance.focused displayWidth = p5_instance.displayWidth displayHeight = p5_instance.displayHeight windowWidth = p5_instance.windowWidth windowHeight = p5_instance.windowHeight width = p5_instance.width height = p5_instance.height disableFriendlyErrors = p5_instance.disableFriendlyErrors deviceOrientation = p5_instance.deviceOrientation accelerationX = p5_instance.accelerationX accelerationY = p5_instance.accelerationY accelerationZ = p5_instance.accelerationZ pAccelerationX = p5_instance.pAccelerationX pAccelerationY = p5_instance.pAccelerationY pAccelerationZ = p5_instance.pAccelerationZ rotationX = p5_instance.rotationX rotationY = p5_instance.rotationY rotationZ = p5_instance.rotationZ pRotationX = p5_instance.pRotationX pRotationY = p5_instance.pRotationY pRotationZ = p5_instance.pRotationZ turnAxis = p5_instance.turnAxis keyIsPressed = p5_instance.keyIsPressed key = p5_instance.key keyCode = p5_instance.keyCode mouseX = p5_instance.mouseX mouseY = p5_instance.mouseY pmouseX = p5_instance.pmouseX pmouseY = p5_instance.pmouseY winMouseX = p5_instance.winMouseX winMouseY = p5_instance.winMouseY pwinMouseX = p5_instance.pwinMouseX pwinMouseY = p5_instance.pwinMouseY mouseButton = p5_instance.mouseButton mouseIsPressed = p5_instance.mouseIsPressed touches = p5_instance.touches pixels = p5_instance.pixels return draw_func() def global_p5_injection(p5_sketch): """ Injects the p5js's skecth instance as a global variable to setup and draw functions """ def decorator(f): def wrapper(): global _P5_INSTANCE _P5_INSTANCE = p5_sketch return pre_draw(_P5_INSTANCE, f) return wrapper return decorator def start_p5(preload_func, setup_func, draw_func, event_functions): """ This is the entrypoint function. It accepts 2 parameters: - preload_func: a Python preload callable - setup_func: a Python setup callable - draw_func: a Python draw callable - event_functions: a config dict for the event functions in the format: {"eventFunctionName": python_event_function} This method gets the p5js's sketch instance and injects them """ def sketch_setup(p5_sketch): p5_sketch.preload = global_p5_injection(p5_sketch)(preload_func) p5_sketch.setup = global_p5_injection(p5_sketch)(setup_func) p5_sketch.draw = global_p5_injection(p5_sketch)(draw_func) instance = __new__(p5(sketch_setup, 'sketch-holder')) # inject event functions into p5 event_function_names = ( "deviceMoved", "deviceTurned", "deviceShaken", "windowResized", "keyPressed", "keyReleased", "keyTyped", "mousePressed", "mouseReleased", "mouseClicked", "doubleClicked", "mouseMoved", "mouseDragged", "mouseWheel", "touchStarted", "touchMoved", "touchEnded", "keyIsDown" ) for f_name in [f for f in event_function_names if event_functions.get(f, None)]: func = event_functions[f_name] event_func = global_p5_injection(instance)(func) setattr(instance, f_name, event_func) def logOnloaded(): console.log("Lib loaded!") def add_library(lib_name): # placeholder for https://github.com/berinhard/pyp5js/issues/31 src = '' return console.log("Lib name is not valid:", lib_name) console.log("Importing:", src) script = document.createElement("script") script.onload = logOnloaded script.src = src document.head.appendChild(script) ================================================ FILE: docs/examples/transcrypt/sketch_004/target/python_functions.js ================================================ // Transcrypt'ed from Python, 2021-11-02 13:06:12 import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, abs, all, any, assert, bool, bytearray, bytes, callable, chr, copy, deepcopy, delattr, dict, dir, divmod, enumerate, filter, float, getattr, hasattr, input, int, isinstance, issubclass, len, list, map, max, min, object, ord, pow, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, round, set, setattr, sorted, str, sum, tuple, zip} from './org.transcrypt.__runtime__.js'; var __name__ = 'python_functions'; export var PythonFunctions = __class__ ('PythonFunctions', [object], { __module__: __name__, }); setattr (PythonFunctions, 'map', map); setattr (PythonFunctions, 'filter', filter); setattr (PythonFunctions, 'set', set); //# sourceMappingURL=python_functions.map ================================================ FILE: docs/examples/transcrypt/sketch_004/target/python_functions.py ================================================ class PythonFunctions: pass setattr(PythonFunctions, 'map', map) setattr(PythonFunctions, 'filter', filter) setattr(PythonFunctions, 'set', set) ================================================ FILE: docs/examples/transcrypt/sketch_004/target/target_sketch.js ================================================ // Transcrypt'ed from Python, 2021-11-02 13:06:12 import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, all, any, assert, bool, bytearray, bytes, callable, chr, deepcopy, delattr, dict, dir, divmod, enumerate, getattr, hasattr, isinstance, issubclass, len, list, object, ord, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, set, setattr, sorted, sum, tuple, zip} from './org.transcrypt.__runtime__.js'; import {ADD, ALT, ARROW, AUDIO, AUTO, AXES, BACKSPACE, BASELINE, BEVEL, BEZIER, BLEND, BLUR, BOLD, BOLDITALIC, BOTTOM, BURN, CENTER, CHORD, CLAMP, CLOSE, CONTROL, CORNER, CORNERS, CROSS, CURVE, DARKEST, DEGREES, DEG_TO_RAD, DELETE, DIFFERENCE, DILATE, DODGE, DOWN_ARROW, ENTER, ERODE, ESCAPE, EXCLUSION, FILL, GRAY, GRID, HALF_PI, HAND, HARD_LIGHT, HSB, HSL, IMAGE, IMMEDIATE, INVERT, ITALIC, LANDSCAPE, LEFT, LEFT_ARROW, LIGHTEST, LINEAR, LINES, LINE_LOOP, LINE_STRIP, MIRROR, MITER, MOVE, MULTIPLY, NEAREST, NORMAL, OPAQUE, OPEN, OPTION, OVERLAY, P2D, PI, PIE, POINTS, PORTRAIT, POSTERIZE, PROJECT, PVector, QUADRATIC, QUADS, QUAD_STRIP, QUARTER_PI, RADIANS, RADIUS, RAD_TO_DEG, REPEAT, REPLACE, RETURN, RGB, RIGHT, RIGHT_ARROW, ROUND, SCREEN, SHIFT, SOFT_LIGHT, SQUARE, STROKE, SUBTRACT, TAB, TAU, TEXT, TEXTURE, THRESHOLD, TOP, TRIANGLES, TRIANGLE_FAN, TRIANGLE_STRIP, TWO_PI, UP_ARROW, VIDEO, WAIT, WEBGL, _CTX_MIDDLE, _DEFAULT_FILL, _DEFAULT_LEADMULT, _DEFAULT_STROKE, _DEFAULT_TEXT_FILL, _P5_INSTANCE, abs, accelerationX, accelerationY, accelerationZ, acos, add_library, alpha, ambientLight, ambientMaterial, angleMode, append, applyMatrix, arc, arrayCopy, asin, atan, atan2, background, beginContour, beginShape, bezier, bezierDetail, bezierPoint, bezierTangent, bezierVertex, blend, blendMode, blue, boolean, box, brightness, byte, camera, ceil, changed, char, circle, color, colorMode, concat, cone, constrain, copy, cos, createA, createAudio, createButton, createCamera, createCanvas, createCapture, createCheckbox, createColorPicker, createDiv, createElement, createFileInput, createGraphics, createImage, createImg, createInput, createNumberDict, createP, createRadio, createSelect, createShader, createSlider, createSpan, createStringDict, createVector, createVideo, createWriter, cursor, curve, curveDetail, curvePoint, curveTangent, curveTightness, curveVertex, cylinder, day, debugMode, degrees, deviceOrientation, directionalLight, disableFriendlyErrors, displayDensity, displayHeight, displayWidth, dist, ellipse, ellipseMode, ellipsoid, endContour, endShape, erase, exp, fill, filter, float, floor, focused, frameCount, frameRate, fullscreen, getURL, getURLParams, getURLPath, global_p5_injection, green, height, hex, hour, httpDo, httpGet, httpPost, hue, image, imageMode, image_proxy, input, int, join, key, keyCode, keyIsPressed, lerp, lerpColor, lightness, lights, line, loadBytes, loadFont, loadImage, loadJSON, loadModel, loadPixels, loadShader, loadStrings, loadTable, loadXML, log, logOnloaded, loop, mag, map, match, matchAll, max, millis, min, minute, model, month, mouseButton, mouseIsPressed, mouseX, mouseY, nf, nfc, nfp, nfs, noCanvas, noCursor, noDebugMode, noErase, noFill, noLoop, noSmooth, noStroke, noTint, noise, noiseDetail, noiseSeed, norm, normalMaterial, orbitControl, ortho, pAccelerationX, pAccelerationY, pAccelerationZ, pRotationX, pRotationY, pRotationZ, perspective, pixelDensity, pixels, plane, pmouseX, pmouseY, point, pointLight, popMatrix, popStyle, pow, pre_draw, push, pushMatrix, pushStyle, pwinMouseX, pwinMouseY, py_clear, py_get, py_pop, py_set, py_sort, py_split, quad, quadraticVertex, radians, random, randomGaussian, randomSeed, rect, rectMode, red, redraw, remove, removeElements, resetMatrix, resetShader, resizeCanvas, reverse, rotate, rotateX, rotateY, rotateZ, rotationX, rotationY, rotationZ, round, saturation, save, saveCanvas, saveFrames, saveJSON, saveStrings, saveTable, scale, second, select, selectAll, setAttributes, setCamera, setMoveThreshold, setShakeThreshold, shader, shearX, shearY, shininess, shorten, shuffle, sin, size, smooth, specularMaterial, sphere, splice, splitTokens, sq, sqrt, square, start_p5, str, stroke, strokeCap, strokeJoin, strokeWeight, subset, tan, text, textAlign, textAscent, textDescent, textFont, textLeading, textSize, textStyle, textWidth, texture, textureMode, textureWrap, tint, torus, touches, translate, triangle, trim, turnAxis, unchar, unhex, updatePixels, vertex, width, winMouseX, winMouseY, windowHeight, windowWidth, year} from './pyp5js.js'; var __name__ = '__main__'; export var preload = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } } else { } // pass; }; export var setup = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } } else { } // pass; }; export var draw = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } } else { } // pass; }; export var deviceMoved = null; export var deviceTurned = null; export var deviceShaken = null; export var keyPressed = null; export var keyReleased = null; export var keyTyped = null; export var mouseMoved = null; export var mouseDragged = null; export var mousePressed = null; export var mouseReleased = null; export var mouseClicked = null; export var doubleClicked = null; export var mouseWheel = null; export var touchStarted = null; export var touchMoved = null; export var touchEnded = null; export var windowResized = null; export var keyIsDown = null; export var boids = []; var setup = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } } else { } createCanvas (720, 400); for (var i = 0; i < 40; i++) { boids.append (Boid (random (720), random (400))); } }; var draw = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } } else { } background (51); for (var boid of boids) { boid.run (boids); } }; export var Boid = __class__ ('Boid', [object], { __module__: __name__, get __init__ () {return __get__ (this, function (self, x, y) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'self': var self = __allkwargs0__ [__attrib0__]; break; case 'x': var x = __allkwargs0__ [__attrib0__]; break; case 'y': var y = __allkwargs0__ [__attrib0__]; break; } } } } else { } self.acceleration = createVector (0, 0); self.velocity = p5.Vector.random2D (); self.position = createVector (x, y); self.r = 3.0; self.maxspeed = 3; self.maxforce = 0.05; });}, get run () {return __get__ (this, function (self, boids) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'self': var self = __allkwargs0__ [__attrib0__]; break; case 'boids': var boids = __allkwargs0__ [__attrib0__]; break; } } } } else { } self.flock (boids); self.py_update (); self.borders (); self.render (); });}, get applyForce () {return __get__ (this, function (self, force) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'self': var self = __allkwargs0__ [__attrib0__]; break; case 'force': var force = __allkwargs0__ [__attrib0__]; break; } } } } else { } self.acceleration.add (force); });}, get flock () {return __get__ (this, function (self, boids) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'self': var self = __allkwargs0__ [__attrib0__]; break; case 'boids': var boids = __allkwargs0__ [__attrib0__]; break; } } } } else { } var sep = self.separate (boids); var ali = self.align (boids); var coh = self.cohesion (boids); sep.mult (2.5); ali.mult (1.0); coh.mult (1.0); self.applyForce (sep); self.applyForce (ali); self.applyForce (coh); });}, get py_update () {return __get__ (this, function (self) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'self': var self = __allkwargs0__ [__attrib0__]; break; } } } } else { } self.velocity.add (self.acceleration); self.velocity.limit (self.maxspeed); self.position.add (self.velocity); self.acceleration.mult (0); });}, get seek () {return __get__ (this, function (self, target) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'self': var self = __allkwargs0__ [__attrib0__]; break; case 'target': var target = __allkwargs0__ [__attrib0__]; break; } } } } else { } var desired = p5.Vector.sub (target, self.position); desired.normalize (); desired.mult (self.maxspeed); var steer = p5.Vector.sub (desired, self.velocity); steer.limit (self.maxforce); return steer; });}, get render () {return __get__ (this, function (self) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'self': var self = __allkwargs0__ [__attrib0__]; break; } } } } else { } fill (127, 127); stroke (200); ellipse (self.position.x, self.position.y, 16, 16); });}, get borders () {return __get__ (this, function (self) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'self': var self = __allkwargs0__ [__attrib0__]; break; } } } } else { } if (self.position.x < -(self.r)) { self.position.x = width + self.r; } if (self.position.y < -(self.r)) { self.position.y = height + self.r; } if (self.position.x > width + self.r) { self.position.x = -(self.r); } if (self.position.y > height + self.r) { self.position.y = -(self.r); } });}, get separate () {return __get__ (this, function (self, boids) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'self': var self = __allkwargs0__ [__attrib0__]; break; case 'boids': var boids = __allkwargs0__ [__attrib0__]; break; } } } } else { } var desiredseparation = 25.0; var steer = createVector (0, 0); var count = 0; for (var i = 0; i < len (boids); i++) { var d = p5.Vector.dist (self.position, boids [i].position); if (d > 0 && d < desiredseparation) { var diff = p5.Vector.sub (self.position, boids [i].position); diff.normalize (); diff.div (d); steer.add (diff); count++; } } if (count > 0) { steer.div (count); } if (steer.mag () > 0) { steer.normalize (); steer.mult (self.maxspeed); steer.sub (self.velocity); steer.limit (self.maxforce); } return steer; });}, get align () {return __get__ (this, function (self, boids) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'self': var self = __allkwargs0__ [__attrib0__]; break; case 'boids': var boids = __allkwargs0__ [__attrib0__]; break; } } } } else { } var neighbordist = 50; var sum = createVector (0, 0); var count = 0; for (var i = 0; i < len (boids); i++) { var d = p5.Vector.dist (self.position, boids [i].position); if (d > 0 && d < neighbordist) { sum.add (boids [i].velocity); count++; } } if (count > 0) { sum.div (count); sum.normalize (); sum.mult (self.maxspeed); var steer = p5.Vector.sub (sum, self.velocity); steer.limit (self.maxforce); return steer; } else { return createVector (0, 0); } });}, get cohesion () {return __get__ (this, function (self, boids) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'self': var self = __allkwargs0__ [__attrib0__]; break; case 'boids': var boids = __allkwargs0__ [__attrib0__]; break; } } } } else { } var neighbordist = 50; var sum = createVector (0, 0); var count = 0; for (var i = 0; i < len (boids); i++) { var d = p5.Vector.dist (self.position, boids [i].position); if (d > 0 && d < neighbordist) { sum.add (boids [i].position); count++; } } if (count > 0) { sum.div (count); return self.seek (sum); } else { return createVector (0, 0); } });} }); export var event_functions = dict ({'deviceMoved': deviceMoved, 'deviceTurned': deviceTurned, 'deviceShaken': deviceShaken, 'keyPressed': keyPressed, 'keyReleased': keyReleased, 'keyTyped': keyTyped, 'mouseMoved': mouseMoved, 'mouseDragged': mouseDragged, 'mousePressed': mousePressed, 'mouseReleased': mouseReleased, 'mouseClicked': mouseClicked, 'doubleClicked': doubleClicked, 'mouseWheel': mouseWheel, 'touchStarted': touchStarted, 'touchMoved': touchMoved, 'touchEnded': touchEnded, 'windowResized': windowResized, 'keyIsDown': keyIsDown}); start_p5 (preload, setup, draw, event_functions); //# sourceMappingURL=target_sketch.map ================================================ FILE: docs/examples/transcrypt/sketch_004/target/target_sketch.project ================================================ {"options": {"source": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_004/target_sketch.py", "anno": false, "alimod": false, "build": true, "complex": false, "docat": false, "dassert": false, "dcheck": false, "dextex": false, "dlog": false, "dmap": false, "dnostrip": false, "dstat": false, "dtree": false, "esv": null, "ecom": false, "fcall": false, "gen": false, "iconv": false, "jscall": false, "jskeys": false, "jsmod": false, "kwargs": true, "keycheck": false, "license": false, "map": true, "nomin": true, "opov": false, "outdir": null, "parent": null, "run": false, "symbols": null, "sform": false, "tconv": false, "unit": null, "verbose": false, "x": null, "xreex": false, "xglobs": false, "xpath": "/home/bernardo/envs/pyp5js/pyp5js/templates/transcrypt", "xtiny": false, "star": false}, "modules": [{"source": "/home/bernardo/.pyenv/versions/pyp5js/lib/python3.8/site-packages/transcrypt/modules/org/transcrypt/__runtime__.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_004/__target__/org.transcrypt.__runtime__.js"}, {"source": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_004/target_sketch.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_004/__target__/target_sketch.js"}, {"source": "/home/bernardo/envs/pyp5js/pyp5js/templates/transcrypt/pyp5js.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_004/__target__/pyp5js.js"}, {"source": "/home/bernardo/envs/pyp5js/pyp5js/templates/transcrypt/python_functions.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_004/__target__/python_functions.js"}]} ================================================ FILE: docs/examples/transcrypt/sketch_004/target/target_sketch.py ================================================ from pyp5js import * def preload(): pass def setup(): pass def draw(): pass deviceMoved = None deviceTurned = None deviceShaken = None keyPressed = None keyReleased = None keyTyped = None mouseMoved = None mouseDragged = None mousePressed = None mouseReleased = None mouseClicked = None doubleClicked = None mouseWheel = None touchStarted = None touchMoved = None touchEnded = None windowResized = None keyIsDown = None # From Prof. Claudio Esperança examples for BrythonIDE # https://github.com/esperanc/brythonide/blob/master/demoSketches/boids.py boids = []; def setup() : createCanvas(720, 400); # Add an initial set of boids into the system for i in range(40): boids.append (Boid(random(720), random(400))) def draw() : background(51); # Run all the boids for boid in boids: boid.run(boids) # Boid class # Methods for Separation, Cohesion, Alignment added class Boid (object): def __init__(self, x, y) : self.acceleration = createVector(0, 0); self.velocity = p5.Vector.random2D(); self.position = createVector(x, y); self.r = 3.0; self.maxspeed = 3; # Maximum speed self.maxforce = 0.05; # Maximum steering force def run (self, boids): self.flock(boids); self.update(); self.borders(); self.render(); # Forces go into acceleration def applyForce (self,force): self.acceleration.add(force); # We accumulate a new acceleration each time based on three rules def flock (self, boids) : sep = self.separate(boids); # Separation ali = self.align(boids); # Alignment coh = self.cohesion(boids); # Cohesion # Arbitrarily weight these forces sep.mult(2.5); ali.mult(1.0); coh.mult(1.0); # Add the force vectors to acceleration self.applyForce(sep); self.applyForce(ali); self.applyForce(coh); # Method to update location def update (self) : # Update velocity self.velocity.add(self.acceleration); # Limit speed self.velocity.limit(self.maxspeed); self.position.add(self.velocity); # Reset acceleration to 0 each cycle self.acceleration.mult(0); # A method that calculates and applies a steering force towards a target # STEER = DESIRED MINUS VELOCITY def seek (self,target): desired = p5.Vector.sub(target, self.position); # A vector pointing from the location to the target # Normalize desired and scale to maximum speed desired.normalize(); desired.mult(self.maxspeed); # Steering = Desired minus Velocity steer = p5.Vector.sub(desired, self.velocity); steer.limit(self.maxforce); # Limit to maximum steering force return steer; # Draw boid as a circle def render (self) : fill(127, 127); stroke(200); ellipse(self.position.x, self.position.y, 16, 16); # Wraparound def borders (self) : if (self.position.x < -self.r): self.position.x = width + self.r; if (self.position.y < -self.r): self.position.y = height + self.r; if (self.position.x > width + self.r): self.position.x = -self.r; if (self.position.y > height + self.r): self.position.y = -self.r; # Separation # Method checks for nearby boids and steers away def separate (self, boids) : desiredseparation = 25.0; steer = createVector(0, 0); count = 0; # For every boid in the system, check if it's too close for i in range(len(boids)): d = p5.Vector.dist(self.position, boids[i].position); # If the distance is greater than 0 and less than an arbitrary amount (0 when you are yourself) if ((d > 0) and (d < desiredseparation)) : # Calculate vector pointing away from neighbor diff = p5.Vector.sub(self.position, boids[i].position); diff.normalize(); diff.div(d); # Weight by distance steer.add(diff); count+=1; # Keep track of how many # Average -- divide by how many if (count > 0) : steer.div(count); # As long as the vector is greater than 0 if (steer.mag() > 0) : # Implement Reynolds: Steering = Desired - Velocity steer.normalize(); steer.mult(self.maxspeed); steer.sub(self.velocity); steer.limit(self.maxforce); return steer; # Alignment # For every nearby boid in the system, calculate the average velocity def align (self, boids) : neighbordist = 50; sum = createVector(0, 0); count = 0; for i in range(len(boids)): d = p5.Vector.dist(self.position, boids[i].position); if ((d > 0) and (d < neighbordist)) : sum.add(boids[i].velocity); count+=1; if (count > 0) : sum.div(count); sum.normalize(); sum.mult(self.maxspeed); steer = p5.Vector.sub(sum, self.velocity); steer.limit(self.maxforce); return steer; else: return createVector(0, 0); # Cohesion # For the average location (i.e. center) of all nearby boids, calculate steering vector towards that location def cohesion (self, boids) : neighbordist = 50; sum = createVector(0, 0); # Start with empty vector to accumulate all locations count = 0; for i in range(len(boids)): d = p5.Vector.dist(self.position, boids[i].position); if ((d > 0) and (d < neighbordist)) : sum.add(boids[i].position); # Add location count+=1; if (count > 0) : sum.div(count); return self.seek(sum); # Steer towards the location else: return createVector(0, 0); event_functions = { "deviceMoved": deviceMoved, "deviceTurned": deviceTurned, "deviceShaken": deviceShaken, "keyPressed": keyPressed, "keyReleased": keyReleased, "keyTyped": keyTyped, "mouseMoved": mouseMoved, "mouseDragged": mouseDragged, "mousePressed": mousePressed, "mouseReleased": mouseReleased, "mouseClicked": mouseClicked, "doubleClicked": doubleClicked, "mouseWheel": mouseWheel, "touchStarted": touchStarted, "touchMoved": touchMoved, "touchEnded": touchEnded, "windowResized": windowResized, "keyIsDown": keyIsDown, } start_p5(preload, setup, draw, event_functions) ================================================ FILE: docs/examples/transcrypt/sketch_005/index.html ================================================ sketch_005 - pyp5js (using Transcrypt)

Python code here.

             
def setup():
    createCanvas(600,600)
    noStroke()
    rectMode(CENTER)


def draw():
    colorMode(HSB,100)
    h = map(mouseY,0,600,0,100)
    background(h,100,100)
    fill(100-h,100,100)
    rect(300,300,mouseX+1,mouseX+1)

              
          
================================================ FILE: docs/examples/transcrypt/sketch_005/sketch_005.py ================================================ def setup(): createCanvas(600,600) noStroke() rectMode(CENTER) def draw(): colorMode(HSB,100) h = map(mouseY,0,600,0,100) background(h,100,100) fill(100-h,100,100) rect(300,300,mouseX+1,mouseX+1) ================================================ FILE: docs/examples/transcrypt/sketch_005/static/p5.js ================================================ /*! p5.js v1.0.0 February 29, 2020 */ !function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).p5=e()}}(function(){return function o(a,s,l){function u(t,e){if(!s[t]){if(!a[t]){var r="function"==typeof require&&require;if(!e&&r)return r(t,!0);if(h)return h(t,!0);var i=new Error("Cannot find module '"+t+"'");throw i.code="MODULE_NOT_FOUND",i}var n=s[t]={exports:{}};a[t][0].call(n.exports,function(e){return u(a[t][1][e]||e)},n,n.exports,o,a,s,l)}return s[t].exports}for(var h="function"==typeof require&&require,e=0;e>16&255,a[s++]=t>>8&255,a[s++]=255&t;2===o&&(t=u[e.charCodeAt(r)]<<2|u[e.charCodeAt(r+1)]>>4,a[s++]=255&t);1===o&&(t=u[e.charCodeAt(r)]<<10|u[e.charCodeAt(r+1)]<<4|u[e.charCodeAt(r+2)]>>2,a[s++]=t>>8&255,a[s++]=255&t);return a},r.fromByteArray=function(e){for(var t,r=e.length,i=r%3,n=[],o=0,a=r-i;o>2]+s[t<<4&63]+"==")):2==i&&(t=(e[r-2]<<8)+e[r-1],n.push(s[t>>10]+s[t>>4&63]+s[t<<2&63]+"="));return n.join("")};for(var s=[],u=[],h="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=0,o=i.length;n>18&63]+s[n>>12&63]+s[n>>6&63]+s[63&n]);return o.join("")}u["-".charCodeAt(0)]=62,u["_".charCodeAt(0)]=63},{}],20:[function(e,t,r){},{}],21:[function(N,e,F){(function(c){"use strict";var i=N("base64-js"),o=N("ieee754"),e="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;F.Buffer=c,F.SlowBuffer=function(e){+e!=e&&(e=0);return c.alloc(+e)},F.INSPECT_MAX_BYTES=50;var r=2147483647;function a(e){if(r>>1;case"base64":return O(e).length;default:if(n)return i?-1:R(e).length;t=(""+t).toLowerCase(),n=!0}}function d(e,t,r){var i=e[t];e[t]=e[r],e[r]=i}function p(e,t,r,i,n){if(0===e.length)return-1;if("string"==typeof r?(i=r,r=0):2147483647=e.length){if(n)return-1;r=e.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof t&&(t=c.from(t,i)),c.isBuffer(t))return 0===t.length?-1:m(e,t,r,i,n);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):m(e,[t],r,i,n);throw new TypeError("val must be string, number or Buffer")}function m(e,t,r,i,n){var o,a=1,s=e.length,l=t.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(e.length<2||t.length<2)return-1;s/=a=2,l/=2,r/=2}function u(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(n){var h=-1;for(o=r;o>8,n=r%256,o.push(n),o.push(i);return o}(t,e.length-r),e,r,i)}function b(e,t,r){return 0===t&&r===e.length?i.fromByteArray(e):i.fromByteArray(e.slice(t,r))}function _(e,t,r){r=Math.min(e.length,r);for(var i=[],n=t;n>>10&1023|55296),h=56320|1023&h),i.push(h),n+=c}return function(e){var t=e.length;if(t<=x)return String.fromCharCode.apply(String,e);var r="",i=0;for(;ithis.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e=e||"utf8";;)switch(e){case"hex":return M(this,t,r);case"utf8":case"utf-8":return _(this,t,r);case"ascii":return w(this,t,r);case"latin1":case"binary":return S(this,t,r);case"base64":return b(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,t,r);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}.apply(this,arguments)},c.prototype.equals=function(e){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===c.compare(this,e)},c.prototype.inspect=function(){var e="",t=F.INSPECT_MAX_BYTES;return e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(e+=" ... "),""},e&&(c.prototype[e]=c.prototype.inspect),c.prototype.compare=function(e,t,r,i,n){if(A(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),t<0||r>e.length||i<0||n>this.length)throw new RangeError("out of range index");if(n<=i&&r<=t)return 0;if(n<=i)return-1;if(r<=t)return 1;if(this===e)return 0;for(var o=(n>>>=0)-(i>>>=0),a=(r>>>=0)-(t>>>=0),s=Math.min(o,a),l=this.slice(i,n),u=e.slice(t,r),h=0;h>>=0,isFinite(r)?(r>>>=0,void 0===i&&(i="utf8")):(i=r,r=void 0)}var n=this.length-t;if((void 0===r||nthis.length)throw new RangeError("Attempt to write outside buffer bounds");i=i||"utf8";for(var o,a,s,l,u,h,c=!1;;)switch(i){case"hex":return g(this,e,t,r);case"utf8":case"utf-8":return u=t,h=r,D(R(e,(l=this).length-u),l,u,h);case"ascii":return v(this,e,t,r);case"latin1":case"binary":return v(this,e,t,r);case"base64":return o=this,a=t,s=r,D(O(e),o,a,s);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return y(this,e,t,r);default:if(c)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),c=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var x=4096;function w(e,t,r){var i="";r=Math.min(e.length,r);for(var n=t;ne.length)throw new RangeError("Index out of range")}function P(e,t,r,i){if(r+i>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function L(e,t,r,i,n){return t=+t,r>>>=0,n||P(e,0,r,4),o.write(e,t,r,i,23,4),r+4}function k(e,t,r,i,n){return t=+t,r>>>=0,n||P(e,0,r,8),o.write(e,t,r,i,52,8),r+8}c.prototype.slice=function(e,t){var r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):r>>=0,t>>>=0,r||T(e,t,this.length);for(var i=this[e],n=1,o=0;++o>>=0,t>>>=0,r||T(e,t,this.length);for(var i=this[e+--t],n=1;0>>=0,t||T(e,1,this.length),this[e]},c.prototype.readUInt16LE=function(e,t){return e>>>=0,t||T(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUInt16BE=function(e,t){return e>>>=0,t||T(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUInt32LE=function(e,t){return e>>>=0,t||T(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUInt32BE=function(e,t){return e>>>=0,t||T(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||T(e,t,this.length);for(var i=this[e],n=1,o=0;++o>>=0,t>>>=0,r||T(e,t,this.length);for(var i=t,n=1,o=this[e+--i];0>>=0,t||T(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){e>>>=0,t||T(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(e,t){e>>>=0,t||T(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(e,t){return e>>>=0,t||T(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return e>>>=0,t||T(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readFloatLE=function(e,t){return e>>>=0,t||T(e,4,this.length),o.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return e>>>=0,t||T(e,4,this.length),o.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return e>>>=0,t||T(e,8,this.length),o.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return e>>>=0,t||T(e,8,this.length),o.read(this,e,!1,52,8)},c.prototype.writeUIntLE=function(e,t,r,i){e=+e,t>>>=0,r>>>=0,i||C(this,e,t,r,Math.pow(2,8*r)-1,0);var n=1,o=0;for(this[t]=255&e;++o>>=0,r>>>=0,i||C(this,e,t,r,Math.pow(2,8*r)-1,0);var n=r-1,o=1;for(this[t+n]=255&e;0<=--n&&(o*=256);)this[t+n]=e/o&255;return t+r},c.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,1,255,0),this[t]=255&e,t+1},c.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},c.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeIntLE=function(e,t,r,i){if(e=+e,t>>>=0,!i){var n=Math.pow(2,8*r-1);C(this,e,t,r,n-1,-n)}var o=0,a=1,s=0;for(this[t]=255&e;++o>0)-s&255;return t+r},c.prototype.writeIntBE=function(e,t,r,i){if(e=+e,t>>>=0,!i){var n=Math.pow(2,8*r-1);C(this,e,t,r,n-1,-n)}var o=r-1,a=1,s=0;for(this[t+o]=255&e;0<=--o&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+r},c.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},c.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeFloatLE=function(e,t,r){return L(this,e,t,!0,r)},c.prototype.writeFloatBE=function(e,t,r){return L(this,e,t,!1,r)},c.prototype.writeDoubleLE=function(e,t,r){return k(this,e,t,!0,r)},c.prototype.writeDoubleBE=function(e,t,r){return k(this,e,t,!1,r)},c.prototype.copy=function(e,t,r,i){if(!c.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r=r||0,i||0===i||(i=this.length),t>=e.length&&(t=e.length),t=t||0,0=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t>>=0,r=void 0===r?this.length:r>>>0,"number"==typeof(e=e||0))for(o=t;o>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function O(e){return i.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(t,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function D(e,t,r,i){for(var n=0;n=t.length||n>=e.length);++n)t[n+r]=e[n];return n}function A(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function I(e){return e!=e}var U=function(){for(var e="0123456789abcdef",t=new Array(256),r=0;r<16;++r)for(var i=16*r,n=0;n<16;++n)t[i+n]=e[r]+e[n];return t}()}).call(this,N("buffer").Buffer)},{"base64-js":19,buffer:21,ieee754:30}],22:[function(e,t,r){"use strict";t.exports=e("./").polyfill()},{"./":23}],23:[function(z,r,i){(function(j,V){var e,t;e=this,t=function(){"use strict";function l(e){return"function"==typeof e}var r=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},i=0,t=void 0,n=void 0,a=function(e,t){f[i]=e,f[i+1]=t,2===(i+=2)&&(n?n(d):y())};var e="undefined"!=typeof window?window:void 0,o=e||{},s=o.MutationObserver||o.WebKitMutationObserver,u="undefined"==typeof self&&void 0!==j&&"[object process]"==={}.toString.call(j),h="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function c(){var e=setTimeout;return function(){return e(d,1)}}var f=new Array(1e3);function d(){for(var e=0;e":">",'"':""","'":"'","/":"/"};function S(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,function(e){return w[e]}):e}var M=function(){function i(e){var t,r=1=this.maxReplaces)break}for(a=0;r=this.regexp.exec(e);){if(void 0===(i=h(r[1].trim())))if("function"==typeof c){var d=c(e,r,t);i="string"==typeof d?d:""}else this.logger.warn("missed to pass in variable ".concat(r[1]," for interpolating ").concat(e)),i="";else"string"==typeof i||this.useRawValueToEscape||(i=v(i));if(i=this.escapeValue?u(this.escape(i)):u(i),e=e.replace(r[0],i),this.regexp.lastIndex=0,++a>=this.maxReplaces)break}return e}},{key:"nest",value:function(e,t,r){var i,n,o=D({},2>1,h=-7,c=r?n-1:0,f=r?-1:1,d=e[t+c];for(c+=f,o=d&(1<<-h)-1,d>>=-h,h+=s;0>=-h,h+=i;0>1,f=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,d=i?0:o-1,p=i?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=h):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),2<=(t+=1<=a+c?f/l:f*Math.pow(2,1-c))*l&&(a++,l/=2),h<=a+c?(s=0,a=h):1<=a+c?(s=(t*l-1)*Math.pow(2,n),a+=c):(s=t*Math.pow(2,c-1)*Math.pow(2,n),a=0));8<=n;e[r+d]=255&s,d+=p,s/=256,n-=8);for(a=a<Math.abs(e[0])&&(t=1),Math.abs(e[2])>Math.abs(e[t])&&(t=2),t}var C=4e150;function P(e,t){e.f+=t.f,e.b.f+=t.b.f}function u(e,t,r){return e=e.a,t=t.a,r=r.a,t.b.a===e?r.b.a===e?v(t.a,r.a)?b(r.b.a,t.a,r.a)<=0:0<=b(t.b.a,r.a,t.a):b(r.b.a,e,r.a)<=0:r.b.a===e?0<=b(t.b.a,e,t.a):(t=y(t.b.a,e,t.a),(e=y(r.b.a,e,r.a))<=t)}function L(e){e.a.i=null;var t=e.e;t.a.c=t.c,t.c.a=t.a,e.e=null}function h(e,t){c(e.a),e.c=!1,(e.a=t).i=e}function k(e){for(var t=e.a.a;(e=fe(e)).a.a===t;);return e.c&&(h(e,t=f(ce(e).a.b,e.a.e)),e=fe(e)),e}function R(e,t,r){var i=new he;return i.a=r,i.e=W(e.f,t.e,i),r.i=i}function O(e,t){switch(e.s){case 100130:return 0!=(1&t);case 100131:return 0!==t;case 100132:return 0>1]],s[a[u]])?le(r,u):ue(r,u)),s[o]=null,l[o]=r.b,r.b=o}else for(r.c[-(o+1)]=null;0Math.max(a.a,l.a))return!1;if(v(o,a)){if(0i.f&&(i.f*=2,i.c=oe(i.c,i.f+1)),0===i.b?r=n:(r=i.b,i.b=i.c[i.b]),i.e[r]=t,i.c[r]=n,i.d[n]=r,i.h&&ue(i,n),r}return i=e.a++,e.c[i]=t,-(i+1)}function ie(e){if(0===e.a)return se(e.b);var t=e.c[e.d[e.a-1]];if(0!==e.b.a&&v(ae(e.b),t))return se(e.b);for(;--e.a,0e.a||v(i[a],i[l])){n[r[o]=a]=o;break}n[r[o]=l]=o,o=s}}function ue(e,t){for(var r=e.d,i=e.e,n=e.c,o=t,a=r[o];;){var s=o>>1,l=r[s];if(0==s||v(i[l],i[a])){n[r[o]=a]=o;break}n[r[o]=l]=o,o=s}}function he(){this.e=this.a=null,this.f=0,this.c=this.b=this.h=this.d=!1}function ce(e){return e.e.c.b}function fe(e){return e.e.a.b}(i=q.prototype).x=function(){Y(this,0)},i.B=function(e,t){switch(e){case 100142:return;case 100140:switch(t){case 100130:case 100131:case 100132:case 100133:case 100134:return void(this.s=t)}break;case 100141:return void(this.m=!!t);default:return void Z(this,100900)}Z(this,100901)},i.y=function(e){switch(e){case 100142:return 0;case 100140:return this.s;case 100141:return this.m;default:Z(this,100900)}return!1},i.A=function(e,t,r){this.j[0]=e,this.j[1]=t,this.j[2]=r},i.z=function(e,t){var r=t||null;switch(e){case 100100:case 100106:this.h=r;break;case 100104:case 100110:this.l=r;break;case 100101:case 100107:this.k=r;break;case 100102:case 100108:this.i=r;break;case 100103:case 100109:this.p=r;break;case 100105:case 100111:this.o=r;break;case 100112:this.r=r;break;default:Z(this,100900)}},i.C=function(e,t){var r=!1,i=[0,0,0];Y(this,2);for(var n=0;n<3;++n){var o=e[n];o<-1e150&&(o=-1e150,r=!0),1e150n[u]&&(n[u]=h,a[u]=l)}if(l=0,n[1]-o[1]>n[0]-o[0]&&(l=1),n[2]-o[2]>n[l]-o[l]&&(l=2),o[l]>=n[l])i[0]=0,i[1]=0,i[2]=1;else{for(n=0,o=s[l],a=a[l],s=[0,0,0],o=[o.g[0]-a.g[0],o.g[1]-a.g[1],o.g[2]-a.g[2]],u=[0,0,0],l=r.e;l!==r;l=l.e)u[0]=l.g[0]-a.g[0],u[1]=l.g[1]-a.g[1],u[2]=l.g[2]-a.g[2],s[0]=o[1]*u[2]-o[2]*u[1],s[1]=o[2]*u[0]-o[0]*u[2],s[2]=o[0]*u[1]-o[1]*u[0],n<(h=s[0]*s[0]+s[1]*s[1]+s[2]*s[2])&&(n=h,i[0]=s[0],i[1]=s[1],i[2]=s[2]);n<=0&&(i[0]=i[1]=i[2]=0,i[T(o)]=1)}r=!0}for(s=T(i),l=this.b.c,n=(s+1)%3,a=(s+2)%3,s=0>=l,h-=l,g!=o){if(g==a)break;for(var v=g>8,++y;var _=b;if(i>=8;null!==m&&s<4096&&(p[s++]=m<<8|_,u+1<=s&&l<12&&(++l,u=u<<1|1)),m=g}else s=1+a,u=(1<<(l=n+1))-1,m=null}return f!==i&&console.log("Warning, gif stream shorter than expected."),r}try{r.GifWriter=function(v,e,t,r){var y=0,i=void 0===(r=void 0===r?{}:r).loop?null:r.loop,b=void 0===r.palette?null:r.palette;if(e<=0||t<=0||65535>=1;)++n;if(a=1<>8&255,v[y++]=255&t,v[y++]=t>>8&255,v[y++]=(null!==b?128:0)|n,v[y++]=o,v[y++]=0,null!==b)for(var s=0,l=b.length;s>16&255,v[y++]=u>>8&255,v[y++]=255&u}if(null!==i){if(i<0||65535>8&255,v[y++]=0}var x=!1;this.addFrame=function(e,t,r,i,n,o){if(!0===x&&(--y,x=!1),o=void 0===o?{}:o,e<0||t<0||65535>=1;)++u;l=1<>8&255,v[y++]=d,v[y++]=0),v[y++]=44,v[y++]=255&e,v[y++]=e>>8&255,v[y++]=255&t,v[y++]=t>>8&255,v[y++]=255&r,v[y++]=r>>8&255,v[y++]=255&i,v[y++]=i>>8&255,v[y++]=!0===a?128|u-1:0,!0===a)for(var p=0,m=s.length;p>16&255,v[y++]=g>>8&255,v[y++]=255&g}return y=function(t,r,e,i){t[r++]=e;var n=r++,o=1<>=8,h-=8,r===n+256&&(t[n]=255,n=r++)}function d(e){c|=e<>=8,h-=8,r===n+256&&(t[n]=255,n=r++);4096===l?(d(o),l=1+s,u=e+1,m={}):(1<>7,n=1<<1+(7&r);x[e++],x[e++];var o=null,a=null;i&&(o=e,e+=3*(a=n));var s=!0,l=[],u=0,h=null,c=0,f=null;for(this.width=w,this.height=t;s&&e>2&7,e++;break;case 254:for(;;){if(!(0<=(C=x[e++])))throw Error("Invalid block size");if(0===C)break;e+=C}break;default:throw new Error("Unknown graphic control label: 0x"+x[e-1].toString(16))}break;case 44:var p=x[e++]|x[e++]<<8,m=x[e++]|x[e++]<<8,g=x[e++]|x[e++]<<8,v=x[e++]|x[e++]<<8,y=x[e++],b=y>>6&1,_=1<<1+(7&y),S=o,M=a,E=!1;if(y>>7){E=!0;S=e,e+=3*(M=_)}var T=e;for(e++;;){var C;if(!(0<=(C=x[e++])))throw Error("Invalid block size");if(0===C)break;e+=C}l.push({x:p,y:m,width:g,height:v,has_local_palette:E,palette_offset:S,palette_size:M,data_offset:T,data_length:e-T,transparent_index:h,interlaced:!!b,delay:u,disposal:c});break;case 59:s=!1;break;default:throw new Error("Unknown gif block: 0x"+x[e-1].toString(16))}this.numFrames=function(){return l.length},this.loopCount=function(){return f},this.frameInfo=function(e){if(e<0||e>=l.length)throw new Error("Frame index out of range.");return l[e]},this.decodeAndBlitFrameBGRA=function(e,t){var r=this.frameInfo(e),i=r.width*r.height,n=new Uint8Array(i);P(x,r.data_offset,n,i);var o=r.palette_offset,a=r.transparent_index;null===a&&(a=256);var s=r.width,l=w-s,u=s,h=4*(r.y*w+r.x),c=4*((r.y+r.height)*w+r.x),f=h,d=4*l;!0===r.interlaced&&(d+=4*w*7);for(var p=8,m=0,g=n.length;m>=1)),v===a)f+=4;else{var y=x[o+3*v],b=x[o+3*v+1],_=x[o+3*v+2];t[f++]=_,t[f++]=b,t[f++]=y,t[f++]=255}--u}},this.decodeAndBlitFrameRGBA=function(e,t){var r=this.frameInfo(e),i=r.width*r.height,n=new Uint8Array(i);P(x,r.data_offset,n,i);var o=r.palette_offset,a=r.transparent_index;null===a&&(a=256);var s=r.width,l=w-s,u=s,h=4*(r.y*w+r.x),c=4*((r.y+r.height)*w+r.x),f=h,d=4*l;!0===r.interlaced&&(d+=4*w*7);for(var p=8,m=0,g=n.length;m>=1)),v===a)f+=4;else{var y=x[o+3*v],b=x[o+3*v+1],_=x[o+3*v+2];t[f++]=y,t[f++]=b,t[f++]=_,t[f++]=255}--u}}}}catch(e){}},{}],33:[function(jr,t,r){(function(Gr){var e;e=this,function(E){"use strict";function e(e){if(null==this)throw TypeError();var t=String(this),r=t.length,i=e?Number(e):0;if(i!=i&&(i=0),!(i<0||r<=i)){var n,o=t.charCodeAt(i);return 55296<=o&&o<=56319&&i+1>>=1,t}function _(e,t,r){if(!t)return r;for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<>>16-t;return e.tag>>>=t,e.bitcount-=t,i+r}function x(e,t){for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<>>=1,++n,r+=t.table[n],0<=(i-=t.table[n]););return e.tag=o,e.bitcount-=n,t.trans[r+i]}function w(e,t,r){var i,n,o,a,s,l;for(i=_(e,5,257),n=_(e,5,1),o=_(e,4,4),a=0;a<19;++a)g[a]=0;for(a=0;athis.x2&&(this.x2=e)),"number"==typeof t&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=t,this.y2=t),tthis.y2&&(this.y2=t))},C.prototype.addX=function(e){this.addPoint(e,null)},C.prototype.addY=function(e){this.addPoint(null,e)},C.prototype.addBezier=function(e,t,r,i,n,o,a,s){var l=this,u=[e,t],h=[r,i],c=[n,o],f=[a,s];this.addPoint(e,t),this.addPoint(a,s);for(var d=0;d<=1;d++){var p=6*u[d]-12*h[d]+6*c[d],m=-3*u[d]+9*h[d]-9*c[d]+3*f[d],g=3*h[d]-3*u[d];if(0!=m){var v=Math.pow(p,2)-4*g*m;if(!(v<0)){var y=(-p+Math.sqrt(v))/(2*m);0>8&255,255&e]},A.USHORT=U(2),D.SHORT=function(e){return 32768<=e&&(e=-(65536-e)),[e>>8&255,255&e]},A.SHORT=U(2),D.UINT24=function(e){return[e>>16&255,e>>8&255,255&e]},A.UINT24=U(3),D.ULONG=function(e){return[e>>24&255,e>>16&255,e>>8&255,255&e]},A.ULONG=U(4),D.LONG=function(e){return R<=e&&(e=-(2*R-e)),[e>>24&255,e>>16&255,e>>8&255,255&e]},A.LONG=U(4),D.FIXED=D.ULONG,A.FIXED=A.ULONG,D.FWORD=D.SHORT,A.FWORD=A.SHORT,D.UFWORD=D.USHORT,A.UFWORD=A.USHORT,D.LONGDATETIME=function(e){return[0,0,0,0,e>>24&255,e>>16&255,e>>8&255,255&e]},A.LONGDATETIME=U(8),D.TAG=function(e){return k.argument(4===e.length,"Tag should be exactly 4 ASCII characters."),[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]},A.TAG=U(4),D.Card8=D.BYTE,A.Card8=A.BYTE,D.Card16=D.USHORT,A.Card16=A.USHORT,D.OffSize=D.BYTE,A.OffSize=A.BYTE,D.SID=D.USHORT,A.SID=A.USHORT,D.NUMBER=function(e){return-107<=e&&e<=107?[e+139]:108<=e&&e<=1131?[247+((e-=108)>>8),255&e]:-1131<=e&&e<=-108?[251+((e=-e-108)>>8),255&e]:-32768<=e&&e<=32767?D.NUMBER16(e):D.NUMBER32(e)},A.NUMBER=function(e){return D.NUMBER(e).length},D.NUMBER16=function(e){return[28,e>>8&255,255&e]},A.NUMBER16=U(3),D.NUMBER32=function(e){return[29,e>>24&255,e>>16&255,e>>8&255,255&e]},A.NUMBER32=U(5),D.REAL=function(e){var t=e.toString(),r=/\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec(t);if(r){var i=parseFloat("1e"+((r[2]?+r[2]:0)+r[1].length));t=(Math.round(e*i)/i).toString()}for(var n="",o=0,a=t.length;o>8&255,t[t.length]=255&i}return t},A.UTF16=function(e){return 2*e.length};var N={"x-mac-croatian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈ƫȅ ÀÃÕŒœĐ—“”‘’÷◊©⁄€‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ","x-mac-cyrillic":"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю","x-mac-gaelic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØḂ±≤≥ḃĊċḊḋḞḟĠġṀæøṁṖṗɼƒſṠ«»… ÀÃÕŒœ–—“”‘’ṡẛÿŸṪ€‹›Ŷŷṫ·Ỳỳ⁊ÂÊÁËÈÍÎÏÌÓÔ♣ÒÚÛÙıÝýŴŵẄẅẀẁẂẃ","x-mac-greek":"Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦€ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ­","x-mac-icelandic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüݰ¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-inuit":"ᐃᐄᐅᐆᐊᐋᐱᐲᐳᐴᐸᐹᑉᑎᑏᑐᑑᑕᑖᑦᑭᑮᑯᑰᑲᑳᒃᒋᒌᒍᒎᒐᒑ°ᒡᒥᒦ•¶ᒧ®©™ᒨᒪᒫᒻᓂᓃᓄᓅᓇᓈᓐᓯᓰᓱᓲᓴᓵᔅᓕᓖᓗᓘᓚᓛᓪᔨᔩᔪᔫᔭ… ᔮᔾᕕᕖᕗ–—“”‘’ᕘᕙᕚᕝᕆᕇᕈᕉᕋᕌᕐᕿᖀᖁᖂᖃᖄᖅᖏᖐᖑᖒᖓᖔᖕᙱᙲᙳᙴᙵᙶᖖᖠᖡᖢᖣᖤᖥᖦᕼŁł","x-mac-ce":"ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ",macintosh:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-romanian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂȘ∞±≤≥¥µ∂∑∏π∫ªºΩăș¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›Țț‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-turkish":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙˆ˜¯˘˙˚¸˝˛ˇ"};O.MACSTRING=function(e,t,r,i){var n=N[i];if(void 0!==n){for(var o="",a=0;a>8&255,l+256&255)}return o}D.MACSTRING=function(e,t){var r=function(e){if(!F)for(var t in F={},N)F[t]=new String(t);var r=F[e];if(void 0!==r){if(B){var i=B.get(r);if(void 0!==i)return i}var n=N[e];if(void 0!==n){for(var o={},a=0;a>8,t[c+1]=255&f,t=t.concat(i[h])}return t},A.TABLE=function(e){for(var t=0,r=e.fields.length,i=0;i>1,t.skip("uShort",3),e.glyphIndexMap={};for(var a=new se.Parser(r,i+n+14),s=new se.Parser(r,i+n+16+2*o),l=new se.Parser(r,i+n+16+4*o),u=new se.Parser(r,i+n+16+6*o),h=i+n+16+8*o,c=0;c>4,o=15&i;if(15==n)break;if(t+=r[n],15==o)break;t+=r[o]}return parseFloat(t)}(e);if(32<=t&&t<=246)return t-139;if(247<=t&&t<=250)return 256*(t-247)+e.parseByte()+108;if(251<=t&&t<=254)return 256*-(t-251)-e.parseByte()-108;throw new Error("Invalid b0 "+t)}function Te(e,t,r){t=void 0!==t?t:0;var i=new se.Parser(e,t),n=[],o=[];for(r=void 0!==r?r:e.length;i.relativeOffset>1,T.length=0,P=!0}return function e(t){for(var r,i,n,o,a,s,l,u,h,c,f,d,p=0;pMath.abs(d-R)?k=f+T.shift():R=d+T.shift(),E.curveTo(y,b,_,x,l,u),E.curveTo(h,c,f,d,k,R);break;default:console.log("Glyph "+v.index+": unknown operator 1200"+m),T.length=0}break;case 14:0>3;break;case 21:2>16),p+=2;break;case 29:a=T.pop()+g.gsubrsBias,(s=g.gsubrs[a])&&e(s);break;case 30:for(;0=r.begin&&e=fe.length){var a=i.parseChar();r.names.push(i.parseString(a))}break;case 2.5:r.numberOfGlyphs=i.parseUShort(),r.offset=new Array(r.numberOfGlyphs);for(var s=0;st.value.tag?1:-1}),t.fields=t.fields.concat(i),t.fields=t.fields.concat(n),t}function gt(e,t,r){for(var i=0;i 123 are reserved for internal usage");d|=1<>>1,o=e[n].tag;if(o===t)return n;o>>1,o=e[n];if(o===t)return n;o>>1,a=(r=e[o]).start;if(a===t)return r;a(r=e[i-1]).end?0:r}function xt(e,t){this.font=e,this.tableName=t}function wt(e){xt.call(this,e,"gpos")}function St(e){xt.call(this,e,"gsub")}function Mt(e,t){var r=e.length;if(r!==t.length)return!1;for(var i=0;it.points.length-1||i.matchedPoints[1]>n.points.length-1)throw Error("Matched points out of range in "+t.name);var a=t.points[i.matchedPoints[0]],s=n.points[i.matchedPoints[1]],l={xScale:i.xScale,scale01:i.scale01,scale10:i.scale10,yScale:i.yScale,dx:0,dy:0};s=kt([s],l)[0],l.dx=a.x-s.x,l.dy=a.y-s.y,o=kt(n.points,l)}t.points=t.points.concat(o)}}return Rt(t.points)}(wt.prototype=xt.prototype={searchTag:yt,binSearch:bt,getTable:function(e){var t=this.font.tables[this.tableName];return!t&&e&&(t=this.font.tables[this.tableName]=this.createDefaultTable()),t},getScriptNames:function(){var e=this.getTable();return e?e.scripts.map(function(e){return e.tag}):[]},getDefaultScriptName:function(){var e=this.getTable();if(e){for(var t=!1,r=0;r=s[u-1].tag,"Features must be added in alphabetical order."),o={tag:r,feature:{params:0,lookupListIndexes:[]}},s.push(o),a.push(u),o.feature}}},getLookupTables:function(e,t,r,i,n){var o=this.getFeatureTable(e,t,r,n),a=[];if(o){for(var s,l=o.lookupListIndexes,u=this.font.tables[this.tableName].lookups,h=0;h",s),t.stack.push(Math.round(64*s))}function vr(e,t){var r=t.stack,i=r.pop(),n=t.fv,o=t.pv,a=t.ppem,s=t.deltaBase+16*(e-1),l=t.deltaShift,u=t.z0;E.DEBUG&&console.log(t.step,"DELTAP["+e+"]",i,r);for(var h=0;h>4)===a){var d=(15&f)-8;0<=d&&d++,E.DEBUG&&console.log(t.step,"DELTAPFIX",c,"by",d*l);var p=u[c];n.setRelative(p,p,d*l,o)}}}function yr(e,t){var r=t.stack,i=r.pop();E.DEBUG&&console.log(t.step,"ROUND[]"),r.push(64*t.round(i/64))}function br(e,t){var r=t.stack,i=r.pop(),n=t.ppem,o=t.deltaBase+16*(e-1),a=t.deltaShift;E.DEBUG&&console.log(t.step,"DELTAC["+e+"]",i,r);for(var s=0;s>4)===n){var h=(15&u)-8;0<=h&&h++;var c=h*a;E.DEBUG&&console.log(t.step,"DELTACFIX",l,"by",c),t.cvt[l]+=c}}}function _r(e,t){var r,i,n=t.stack,o=n.pop(),a=n.pop(),s=t.z2[o],l=t.z1[a];E.DEBUG&&console.log(t.step,"SDPVTL["+e+"]",o,a),i=e?(r=s.y-l.y,l.x-s.x):(r=l.x-s.x,l.y-s.y),t.dpv=Zt(r,i)}function xr(e,t){var r=t.stack,i=t.prog,n=t.ip;E.DEBUG&&console.log(t.step,"PUSHB["+e+"]");for(var o=0;o":"_")+(i?"R":"_")+(0===n?"Gr":1===n?"Bl":2===n?"Wh":"")+"]",e?c+"("+o.cvt[c]+","+u+")":"",f,"(d =",a,"->",l*s,")"),o.rp1=o.rp0,o.rp2=f,t&&(o.rp0=f)}Ft.prototype.exec=function(e,t){if("number"!=typeof t)throw new Error("Point size is not a number!");if(!(2",i),s.interpolate(c,o,a,l),s.touch(c)}e.loop=1},dr.bind(void 0,0),dr.bind(void 0,1),function(e){for(var t=e.stack,r=e.rp0,i=e.z0[r],n=e.loop,o=e.fv,a=e.pv,s=e.z1;n--;){var l=t.pop(),u=s[l];E.DEBUG&&console.log(e.step,(1=a.width||t>=a.height?[0,0,0,0]:this._getPixel(e,t);var s=new l.default.Image(r,i);return s.canvas.getContext("2d").drawImage(a,e,t,r*o,i*o,0,0,r,i),s},l.default.Renderer.prototype.textLeading=function(e){return"number"==typeof e?(this._setProperty("_textLeading",e),this._pInst):this._textLeading},l.default.Renderer.prototype.textSize=function(e){return"number"==typeof e?(this._setProperty("_textSize",e),this._setProperty("_textLeading",e*y._DEFAULT_LEADMULT),this._applyTextProperties()):this._textSize},l.default.Renderer.prototype.textStyle=function(e){return e?(e!==y.NORMAL&&e!==y.ITALIC&&e!==y.BOLD&&e!==y.BOLDITALIC||this._setProperty("_textStyle",e),this._applyTextProperties()):this._textStyle},l.default.Renderer.prototype.textAscent=function(){return null===this._textAscent&&this._updateTextMetrics(),this._textAscent},l.default.Renderer.prototype.textDescent=function(){return null===this._textDescent&&this._updateTextMetrics(),this._textDescent},l.default.Renderer.prototype.textAlign=function(e,t){return void 0!==e?(this._setProperty("_textAlign",e),void 0!==t&&this._setProperty("_textBaseline",t),this._applyTextProperties()):{horizontal:this._textAlign,vertical:this._textBaseline}},l.default.Renderer.prototype.text=function(e,t,r,i,n){var o,a,s,l,u,h,c,f,d=this._pInst,p=Number.MAX_VALUE;if((this._doFill||this._doStroke)&&void 0!==e){if("string"!=typeof e&&(e=e.toString()),o=(e=e.replace(/(\t)/g," ")).split("\n"),void 0!==i){for(s=f=0;ss.HALF_PI&&e<=3*s.HALF_PI?Math.atan(r/i*Math.tan(e))+s.PI:Math.atan(r/i*Math.tan(e))+s.TWO_PI,t=t<=s.HALF_PI?Math.atan(r/i*Math.tan(t)):t>s.HALF_PI&&t<=3*s.HALF_PI?Math.atan(r/i*Math.tan(t))+s.PI:Math.atan(r/i*Math.tan(t))+s.TWO_PI),tv||Math.abs(this.accelerationY-this.pAccelerationY)>v||Math.abs(this.accelerationZ-this.pAccelerationZ)>v)&&e();var t=this.deviceTurned||window.deviceTurned;if("function"==typeof t){var r=this.rotationX+180,i=this.pRotationX+180,n=c+180;0>>24],i+=x[(16711680&C)>>16],n+=x[(65280&C)>>8],o+=x[255&C],r+=k[_],s++}w[l=T+y]=a/r,S[l]=i/r,M[l]=n/r,E[l]=o/r}T+=d}for(h=(u=-P)*d,b=T=0;b>>16,e[r+1]=(65280&t[i])>>>8,e[r+2]=255&t[i],e[r+3]=(4278190080&t[i])>>>24},O._toImageData=function(e){return e instanceof ImageData?e:e.getContext("2d").getImageData(0,0,e.width,e.height)},O._createImageData=function(e,t){return O._tmpCanvas=document.createElement("canvas"),O._tmpCtx=O._tmpCanvas.getContext("2d"),this._tmpCtx.createImageData(e,t)},O.apply=function(e,t,r){var i=e.getContext("2d"),n=i.getImageData(0,0,e.width,e.height),o=t(n,r);o instanceof ImageData?i.putImageData(o,0,0,0,0,e.width,e.height):i.putImageData(n,0,0,0,0,e.width,e.height)},O.threshold=function(e,t){var r=O._toPixels(e);void 0===t&&(t=.5);for(var i=Math.floor(255*t),n=0;n>8)/i,r[n+1]=255*(a*t>>8)/i,r[n+2]=255*(s*t>>8)/i}},O.dilate=function(e){for(var t,r,i,n,o,a,s,l,u,h,c,f,d,p,m,g,v,y=O._toPixels(e),b=0,_=y.length?y.length/4:0,x=new Int32Array(_);b<_;)for(r=(t=b)+e.width;b>16&255)+151*(i>>8&255)+28*(255&i))<(m=77*(c>>16&255)+151*(c>>8&255)+28*(255&c))&&(n=c,o=m),o<(p=77*((h=O._getARGB(y,a))>>16&255)+151*(h>>8&255)+28*(255&h))&&(n=h,o=p),o<(g=77*(f>>16&255)+151*(f>>8&255)+28*(255&f))&&(n=f,o=g),o<(v=77*(d>>16&255)+151*(d>>8&255)+28*(255&d))&&(n=d,o=v),x[b++]=n;O._setPixels(y,x)},O.erode=function(e){for(var t,r,i,n,o,a,s,l,u,h,c,f,d,p,m,g,v,y=O._toPixels(e),b=0,_=y.length?y.length/4:0,x=new Int32Array(_);b<_;)for(r=(t=b)+e.width;b>16&255)+151*(c>>8&255)+28*(255&c))<(o=77*(i>>16&255)+151*(i>>8&255)+28*(255&i))&&(n=c,o=m),(p=77*((h=O._getARGB(y,a))>>16&255)+151*(h>>8&255)+28*(255&h))>16&255)+151*(f>>8&255)+28*(255&f))>16&255)+151*(d>>8&255)+28*(255&d))=r){var i=Math.floor(t.timeDisplayed/r);if(t.timeDisplayed=0,t.displayIndex+=i,t.loopCount=Math.floor(t.displayIndex/t.numFrames),null!==t.loopLimit&&t.loopCount>=t.loopLimit)t.playing=!1;else{var n=t.displayIndex%t.numFrames;this.drawingContext.putImageData(t.frames[n].image,0,0),t.displayIndex=n,this.setModified(!0)}}}},n.default.Image.prototype._setProperty=function(e,t){this[e]=t,this.setModified(!0)},n.default.Image.prototype.loadPixels=function(){n.default.Renderer2D.prototype.loadPixels.call(this),this.setModified(!0)},n.default.Image.prototype.updatePixels=function(e,t,r,i){n.default.Renderer2D.prototype.updatePixels.call(this,e,t,r,i),this.setModified(!0)},n.default.Image.prototype.get=function(e,t,r,i){return n.default._validateParameters("p5.Image.get",arguments),n.default.Renderer2D.prototype.get.apply(this,arguments)},n.default.Image.prototype._getPixel=n.default.Renderer2D.prototype._getPixel,n.default.Image.prototype.set=function(e,t,r){n.default.Renderer2D.prototype.set.call(this,e,t,r),this.setModified(!0)},n.default.Image.prototype.resize=function(e,t){0===e&&0===t?(e=this.canvas.width,t=this.canvas.height):0===e?e=this.canvas.width*t/this.canvas.height:0===t&&(t=this.canvas.height*e/this.canvas.width),e=Math.floor(e),t=Math.floor(t);var r=document.createElement("canvas");if(r.width=e,r.height=t,this.gifProperties)for(var i=this.gifProperties,n=function(e,t){for(var r=0,i=0;i/g,">").replace(/"/g,""").replace(/'/g,"'")}function l(e,t){t&&!0!==t&&"true"!==t||(t="");var r="";return(e=e||"untitled")&&e.includes(".")&&(r=e.split(".").pop()),t&&r!==t&&(r=t,e="".concat(e,".").concat(r)),[e,r]}e("../core/error_helpers"),v.default.prototype.loadJSON=function(){for(var e=arguments.length,t=new Array(e),r=0;r"),n.print("");if(n.print(' '),n.print(""),n.print(""),n.print(" "),"0"!==o[0]){n.print(" ");for(var h=0;h".concat(c)),n.print(" ")}n.print(" ")}for(var f=0;f");for(var d=0;d".concat(p)),n.print(" ")}n.print(" ")}n.print("
"),n.print(""),n.print("")}n.close(),n.clear()},v.default.prototype.writeFile=function(e,t,r){var i="application/octet-stream";v.default.prototype._isSafari()&&(i="text/plain");var n=new Blob(e,{type:i});v.default.prototype.downloadFile(n,t,r)},v.default.prototype.downloadFile=function(e,t,r){var i=l(t,r),n=i[0];if(e instanceof Blob)s.default.saveAs(e,n);else{var o=document.createElement("a");if(o.href=e,o.download=n,o.onclick=function(e){var t;t=e,document.body.removeChild(t.target),e.stopPropagation()},o.style.display="none",document.body.appendChild(o),v.default.prototype._isSafari()){var a="Hello, Safari user! To download this file...\n";a+="1. Go to File --\x3e Save As.\n",a+='2. Choose "Page Source" as the Format.\n',a+='3. Name it with this extension: ."'.concat(i[1],'"'),alert(a)}o.click()}},v.default.prototype._checkFileExtension=l,v.default.prototype._isSafari=function(){return 0>>0},getSeed:function(){return t},rand:function(){return(r=(1664525*r+1013904223)%i)/i}});n.setSeed(e),_=new Array(4096);for(var o=0;o<4096;o++)_[o]=n.rand()};var o=n.default;r.default=o},{"../core/main":49}],82:[function(e,t,r){"use strict";function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i,l=(i=e("../core/main"))&&i.__esModule?i:{default:i},o=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==a(e)&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var o=i?Object.getOwnPropertyDescriptor(e,n):null;o&&(o.get||o.set)?Object.defineProperty(r,n,o):r[n]=e[n]}r.default=e,t&&t.set(e,r);return r}(e("../core/constants"));function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}l.default.Vector=function(e,t,r){var i,n,o;o=e instanceof l.default?(this.p5=e,i=t[0]||0,n=t[1]||0,t[2]||0):(i=e||0,n=t||0,r||0),this.x=i,this.y=n,this.z=o},l.default.Vector.prototype.toString=function(){return"p5.Vector Object : [".concat(this.x,", ").concat(this.y,", ").concat(this.z,"]")},l.default.Vector.prototype.set=function(e,t,r){return e instanceof l.default.Vector?(this.x=e.x||0,this.y=e.y||0,this.z=e.z||0):e instanceof Array?(this.x=e[0]||0,this.y=e[1]||0,this.z=e[2]||0):(this.x=e||0,this.y=t||0,this.z=r||0),this},l.default.Vector.prototype.copy=function(){return this.p5?new l.default.Vector(this.p5,[this.x,this.y,this.z]):new l.default.Vector(this.x,this.y,this.z)},l.default.Vector.prototype.add=function(e,t,r){return e instanceof l.default.Vector?(this.x+=e.x||0,this.y+=e.y||0,this.z+=e.z||0):e instanceof Array?(this.x+=e[0]||0,this.y+=e[1]||0,this.z+=e[2]||0):(this.x+=e||0,this.y+=t||0,this.z+=r||0),this};function u(e,t){return 0!==e&&(this.x=this.x%e),0!==t&&(this.y=this.y%t),this}function h(e,t,r){return 0!==e&&(this.x=this.x%e),0!==t&&(this.y=this.y%t),0!==r&&(this.z=this.z%r),this}l.default.Vector.prototype.rem=function(e,t,r){if(e instanceof l.default.Vector){if(Number.isFinite(e.x)&&Number.isFinite(e.y)&&Number.isFinite(e.z)){var i=parseFloat(e.x),n=parseFloat(e.y),o=parseFloat(e.z);h.call(this,i,n,o)}}else if(e instanceof Array)e.every(function(e){return Number.isFinite(e)})&&(2===e.length&&u.call(this,e[0],e[1]),3===e.length&&h.call(this,e[0],e[1],e[2]));else if(1===arguments.length){if(Number.isFinite(e)&&0!==e)return this.x=this.x%e,this.y=this.y%e,this.z=this.z%e,this}else if(2===arguments.length){var a=Array.prototype.slice.call(arguments);a.every(function(e){return Number.isFinite(e)})&&2===a.length&&u.call(this,a[0],a[1])}else if(3===arguments.length){var s=Array.prototype.slice.call(arguments);s.every(function(e){return Number.isFinite(e)})&&3===s.length&&h.call(this,s[0],s[1],s[2])}},l.default.Vector.prototype.sub=function(e,t,r){return e instanceof l.default.Vector?(this.x-=e.x||0,this.y-=e.y||0,this.z-=e.z||0):e instanceof Array?(this.x-=e[0]||0,this.y-=e[1]||0,this.z-=e[2]||0):(this.x-=e||0,this.y-=t||0,this.z-=r||0),this},l.default.Vector.prototype.mult=function(e){return"number"==typeof e&&isFinite(e)?(this.x*=e,this.y*=e,this.z*=e):console.warn("p5.Vector.prototype.mult:","n is undefined or not a finite number"),this},l.default.Vector.prototype.div=function(e){return"number"==typeof e&&isFinite(e)?0===e?console.warn("p5.Vector.prototype.div:","divide by 0"):(this.x/=e,this.y/=e,this.z/=e):console.warn("p5.Vector.prototype.div:","n is undefined or not a finite number"),this},l.default.Vector.prototype.mag=function(){return Math.sqrt(this.magSq())},l.default.Vector.prototype.magSq=function(){var e=this.x,t=this.y,r=this.z;return e*e+t*t+r*r},l.default.Vector.prototype.dot=function(e,t,r){return e instanceof l.default.Vector?this.dot(e.x,e.y,e.z):this.x*(e||0)+this.y*(t||0)+this.z*(r||0)},l.default.Vector.prototype.cross=function(e){var t=this.y*e.z-this.z*e.y,r=this.z*e.x-this.x*e.z,i=this.x*e.y-this.y*e.x;return this.p5?new l.default.Vector(this.p5,[t,r,i]):new l.default.Vector(t,r,i)},l.default.Vector.prototype.dist=function(e){return e.copy().sub(this).mag()},l.default.Vector.prototype.normalize=function(){var e=this.mag();return 0!==e&&this.mult(1/e),this},l.default.Vector.prototype.limit=function(e){var t=this.magSq();return e*e>>0},n.default.prototype.randomSeed=function(e){this._lcgSetSeed(o,e),this._gaussian_previous=!1},n.default.prototype.random=function(e,t){var r;if(n.default._validateParameters("random",arguments),r=null!=this[o]?this._lcg(o):Math.random(),void 0===e)return r;if(void 0===t)return e instanceof Array?e[Math.floor(r*e.length)]:r*e;if(tf){var P=p,L=l,k=u;p=d+f*(s&&d=t&&(r=r.substring(r.length-t,r.length)),r}},n.default.prototype.unhex=function(e){return e instanceof Array?e.map(n.default.prototype.unhex):parseInt("0x".concat(e),16)};var o=n.default;r.default=o},{"../core/main":49}],90:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i,a=(i=e("../core/main"))&&i.__esModule?i:{default:i};function n(e,t,r){var i=e<0,n=i?e.toString().substring(1):e.toString(),o=n.indexOf("."),a=-1!==o?n.substring(0,o):n,s=-1!==o?n.substring(o+1):"",l=i?"-":"";if(void 0!==r){var u="";(-1!==o||0r&&(s=s.substring(0,r));for(var h=0;hi.length)for(var o=t-(i+=-1===r?".":"").length+1,a=0;a=d.TWO_PI?"".concat("ellipse","|").concat(u,"|"):"".concat("arc","|").concat(a,"|").concat(s,"|").concat(l,"|").concat(u,"|"),!this.geometryInHash(t)){var h=new T.default.Geometry(u,1,function(){if(this.strokeIndices=[],a.toFixed(10)!==s.toFixed(10)){l!==d.PIE&&void 0!==l||(this.vertices.push(new T.default.Vector(.5,.5,0)),this.uvs.push([.5,.5]));for(var e=0;e<=u;e++){var t=(s-a)*(e/u)+a,r=.5+Math.cos(t)/2,i=.5+Math.sin(t)/2;this.vertices.push(new T.default.Vector(r,i,0)),this.uvs.push([r,i]),e>5&31)/31,(y>>10&31)/31):(r=a,i=s,l)}for(var b=1;b<=3;b++){var _=p+12*b,x=new S.default.Vector(u.getFloat32(_,!0),u.getFloat32(8+_,!0),u.getFloat32(4+_,!0));e.vertices.push(x),c&&o.push(r,i,n)}var w=new S.default.Vector(m,g,v);e.vertexNormals.push(w,w,w),e.faces.push([3*d,3*d+1,3*d+2]),e.uvs.push([0,0],[0,0],[0,0])}}(e,t);else{var r=new DataView(t);if(!("TextDecoder"in window))return console.warn("Sorry, ASCII STL loading only works in browsers that support TextDecoder (https://caniuse.com/#feat=textencoder)");var i=new TextDecoder("utf-8").decode(r).split("\n");!function(e,t){for(var r,i,n="",o=[],a=0;aMath.PI?l=Math.PI:l<=0&&(l=.001);var u=Math.sin(l)*a*Math.sin(s),h=Math.cos(l)*a,c=Math.sin(l)*a*Math.cos(s);this.camera(u+this.centerX,h+this.centerY,c+this.centerZ,this.centerX,this.centerY,this.centerZ,0,1,0)},m.default.Camera.prototype._isActive=function(){return this===this._renderer._curCamera},m.default.prototype.setCamera=function(e){this._renderer._curCamera=e,this._renderer.uPMatrix.set(e.projMatrix.mat4[0],e.projMatrix.mat4[1],e.projMatrix.mat4[2],e.projMatrix.mat4[3],e.projMatrix.mat4[4],e.projMatrix.mat4[5],e.projMatrix.mat4[6],e.projMatrix.mat4[7],e.projMatrix.mat4[8],e.projMatrix.mat4[9],e.projMatrix.mat4[10],e.projMatrix.mat4[11],e.projMatrix.mat4[12],e.projMatrix.mat4[13],e.projMatrix.mat4[14],e.projMatrix.mat4[15])};var n=m.default.Camera;r.default=n},{"../core/main":49}],98:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i,h=(i=e("../core/main"))&&i.__esModule?i:{default:i};h.default.Geometry=function(e,t,r){return this.vertices=[],this.lineVertices=[],this.lineNormals=[],this.vertexNormals=[],this.faces=[],this.uvs=[],this.edges=[],this.vertexColors=[],this.detailX=void 0!==e?e:1,this.detailY=void 0!==t?t:1,this.dirtyFlags={},r instanceof Function&&r.call(this),this},h.default.Geometry.prototype.reset=function(){this.lineVertices.length=0,this.lineNormals.length=0,this.vertices.length=0,this.edges.length=0,this.vertexColors.length=0,this.vertexNormals.length=0,this.uvs.length=0,this.dirtyFlags={}},h.default.Geometry.prototype.computeFaces=function(){this.faces.length=0;for(var e,t,r,i,n=this.detailX+1,o=0;othis.vertices.length-1-this.detailX;i--)e.add(this.vertexNormals[i]);e=h.default.Vector.div(e,this.detailX);for(var n=this.vertices.length-1;n>this.vertices.length-1-this.detailX;n--)this.vertexNormals[n]=e;return this},h.default.Geometry.prototype._makeTriangleEdges=function(){if(this.edges.length=0,Array.isArray(this.strokeIndices))for(var e=0,t=this.strokeIndices.length;e vTexCoord.y;\n bool y1 = p1.y > vTexCoord.y;\n bool y2 = p2.y > vTexCoord.y;\n\n // could web be under the curve (after t1)?\n if (y1 ? !y2 : y0) {\n // add the coverage for t1\n coverage.x += saturate(C1.x + 0.5);\n // calculate the anti-aliasing for t1\n weight.x = min(weight.x, abs(C1.x));\n }\n\n // are we outside the curve (after t2)?\n if (y1 ? !y0 : y2) {\n // subtract the coverage for t2\n coverage.x -= saturate(C2.x + 0.5);\n // calculate the anti-aliasing for t2\n weight.x = min(weight.x, abs(C2.x));\n }\n}\n\n// this is essentially the same as coverageX, but with the axes swapped\nvoid coverageY(vec2 p0, vec2 p1, vec2 p2) {\n\n vec2 C1, C2;\n calulateCrossings(p0, p1, p2, C1, C2);\n\n bool x0 = p0.x > vTexCoord.x;\n bool x1 = p1.x > vTexCoord.x;\n bool x2 = p2.x > vTexCoord.x;\n\n if (x1 ? !x2 : x0) {\n coverage.y -= saturate(C1.y + 0.5);\n weight.y = min(weight.y, abs(C1.y));\n }\n\n if (x1 ? !x0 : x2) {\n coverage.y += saturate(C2.y + 0.5);\n weight.y = min(weight.y, abs(C2.y));\n }\n}\n\nvoid main() {\n\n // calculate the pixel scale based on screen-coordinates\n pixelScale = hardness / fwidth(vTexCoord);\n\n // which grid cell is this pixel in?\n ivec2 gridCoord = ifloor(vTexCoord * vec2(uGridSize));\n\n // intersect curves in this row\n {\n // the index into the row info bitmap\n int rowIndex = gridCoord.y + uGridOffset.y;\n // fetch the info texel\n vec4 rowInfo = getTexel(uSamplerRows, rowIndex, uGridImageSize);\n // unpack the rowInfo\n int rowStrokeIndex = getInt16(rowInfo.xy);\n int rowStrokeCount = getInt16(rowInfo.zw);\n\n for (int iRowStroke = INT(0); iRowStroke < N; iRowStroke++) {\n if (iRowStroke >= rowStrokeCount)\n break;\n\n // each stroke is made up of 3 points: the start and control point\n // and the start of the next curve.\n // fetch the indices of this pair of strokes:\n vec4 strokeIndices = getTexel(uSamplerRowStrokes, rowStrokeIndex++, uCellsImageSize);\n\n // unpack the stroke index\n int strokePos = getInt16(strokeIndices.xy);\n\n // fetch the two strokes\n vec4 stroke0 = getTexel(uSamplerStrokes, strokePos + INT(0), uStrokeImageSize);\n vec4 stroke1 = getTexel(uSamplerStrokes, strokePos + INT(1), uStrokeImageSize);\n\n // calculate the coverage\n coverageX(stroke0.xy, stroke0.zw, stroke1.xy);\n }\n }\n\n // intersect curves in this column\n {\n int colIndex = gridCoord.x + uGridOffset.x;\n vec4 colInfo = getTexel(uSamplerCols, colIndex, uGridImageSize);\n int colStrokeIndex = getInt16(colInfo.xy);\n int colStrokeCount = getInt16(colInfo.zw);\n \n for (int iColStroke = INT(0); iColStroke < N; iColStroke++) {\n if (iColStroke >= colStrokeCount)\n break;\n\n vec4 strokeIndices = getTexel(uSamplerColStrokes, colStrokeIndex++, uCellsImageSize);\n\n int strokePos = getInt16(strokeIndices.xy);\n vec4 stroke0 = getTexel(uSamplerStrokes, strokePos + INT(0), uStrokeImageSize);\n vec4 stroke1 = getTexel(uSamplerStrokes, strokePos + INT(1), uStrokeImageSize);\n coverageY(stroke0.xy, stroke0.zw, stroke1.xy);\n }\n }\n\n weight = saturate(1.0 - weight * 2.0);\n float distance = max(weight.x + weight.y, minDistance); // manhattan approx.\n float antialias = abs(dot(coverage, weight) / distance);\n float cover = min(abs(coverage.x), abs(coverage.y));\n gl_FragColor = uMaterialColor;\n gl_FragColor.a *= saturate(max(antialias, cover));\n}",lineVert:"/*\n Part of the Processing project - http://processing.org\n Copyright (c) 2012-15 The Processing Foundation\n Copyright (c) 2004-12 Ben Fry and Casey Reas\n Copyright (c) 2001-04 Massachusetts Institute of Technology\n This library is free software; you can redistribute it and/or\n modify it under the terms of the GNU Lesser General Public\n License as published by the Free Software Foundation, version 2.1.\n This library is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n Lesser General Public License for more details.\n You should have received a copy of the GNU Lesser General\n Public License along with this library; if not, write to the\n Free Software Foundation, Inc., 59 Temple Place, Suite 330,\n Boston, MA 02111-1307 USA\n*/\n\n#define PROCESSING_LINE_SHADER\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform float uStrokeWeight;\n\nuniform vec4 uViewport;\nuniform int uPerspective;\n\nattribute vec4 aPosition;\nattribute vec4 aDirection;\n \nvoid main() {\n // using a scale <1 moves the lines towards the camera\n // in order to prevent popping effects due to half of\n // the line disappearing behind the geometry faces.\n vec3 scale = vec3(0.9995);\n\n vec4 posp = uModelViewMatrix * aPosition;\n vec4 posq = uModelViewMatrix * (aPosition + vec4(aDirection.xyz, 0));\n\n // Moving vertices slightly toward the camera\n // to avoid depth-fighting with the fill triangles.\n // Discussed here:\n // http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Number=252848 \n posp.xyz = posp.xyz * scale;\n posq.xyz = posq.xyz * scale;\n\n vec4 p = uProjectionMatrix * posp;\n vec4 q = uProjectionMatrix * posq;\n\n // formula to convert from clip space (range -1..1) to screen space (range 0..[width or height])\n // screen_p = (p.xy/p.w + <1,1>) * 0.5 * uViewport.zw\n\n // prevent division by W by transforming the tangent formula (div by 0 causes\n // the line to disappear, see https://github.com/processing/processing/issues/5183)\n // t = screen_q - screen_p\n //\n // tangent is normalized and we don't care which aDirection it points to (+-)\n // t = +- normalize( screen_q - screen_p )\n // t = +- normalize( (q.xy/q.w+<1,1>)*0.5*uViewport.zw - (p.xy/p.w+<1,1>)*0.5*uViewport.zw )\n //\n // extract common factor, <1,1> - <1,1> cancels out\n // t = +- normalize( (q.xy/q.w - p.xy/p.w) * 0.5 * uViewport.zw )\n //\n // convert to common divisor\n // t = +- normalize( ((q.xy*p.w - p.xy*q.w) / (p.w*q.w)) * 0.5 * uViewport.zw )\n //\n // remove the common scalar divisor/factor, not needed due to normalize and +-\n // (keep uViewport - can't remove because it has different components for x and y\n // and corrects for aspect ratio, see https://github.com/processing/processing/issues/5181)\n // t = +- normalize( (q.xy*p.w - p.xy*q.w) * uViewport.zw )\n\n vec2 tangent = normalize((q.xy*p.w - p.xy*q.w) * uViewport.zw);\n\n // flip tangent to normal (it's already normalized)\n vec2 normal = vec2(-tangent.y, tangent.x);\n\n float thickness = aDirection.w * uStrokeWeight;\n vec2 offset = normal * thickness / 2.0;\n\n vec2 curPerspScale;\n\n if(uPerspective == 1) {\n // Perspective ---\n // convert from world to clip by multiplying with projection scaling factor\n // to get the right thickness (see https://github.com/processing/processing/issues/5182)\n // invert Y, projections in Processing invert Y\n curPerspScale = (uProjectionMatrix * vec4(1, -1, 0, 0)).xy;\n } else {\n // No Perspective ---\n // multiply by W (to cancel out division by W later in the pipeline) and\n // convert from screen to clip (derived from clip to screen above)\n curPerspScale = p.w / (0.5 * uViewport.zw);\n }\n\n gl_Position.xy = p.xy + offset.xy * curPerspScale;\n gl_Position.zw = p.zw;\n}\n",lineFrag:"precision mediump float;\nprecision mediump int;\n\nuniform vec4 uMaterialColor;\n\nvoid main() {\n gl_FragColor = uMaterialColor;\n}",pointVert:"attribute vec3 aPosition;\nuniform float uPointSize;\nvarying float vStrokeWeight;\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nvoid main() {\n\tvec4 positionVec4 = vec4(aPosition, 1.0);\n\tgl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n\tgl_PointSize = uPointSize;\n\tvStrokeWeight = uPointSize;\n}",pointFrag:"precision mediump float;\nprecision mediump int;\nuniform vec4 uMaterialColor;\nvarying float vStrokeWeight;\n\nvoid main(){\n\tfloat mask = 0.0;\n\n\t// make a circular mask using the gl_PointCoord (goes from 0 - 1 on a point)\n // might be able to get a nicer edge on big strokeweights with smoothstep but slightly less performant\n\n\tmask = step(0.98, length(gl_PointCoord * 2.0 - 1.0));\n\n\t// if strokeWeight is 1 or less lets just draw a square\n\t// this prevents weird artifacting from carving circles when our points are really small\n\t// if strokeWeight is larger than 1, we just use it as is\n\n\tmask = mix(0.0, mask, clamp(floor(vStrokeWeight - 0.5),0.0,1.0));\n\n\t// throw away the borders of the mask\n // otherwise we get weird alpha blending issues\n\n\tif(mask > 0.98){\n discard;\n \t}\n\n \tgl_FragColor = vec4(uMaterialColor.rgb * (1.0 - mask), uMaterialColor.a) ;\n}"};u.default.RendererGL=function(e,t,r,i){return u.default.Renderer.call(this,e,t,r),this._setAttributeDefaults(t),this._initContext(),this.isP3D=!0,this.GL=this.drawingContext,this._isErasing=!1,this._enableLighting=!1,this.ambientLightColors=[],this.specularColors=[1,1,1],this.directionalLightDirections=[],this.directionalLightDiffuseColors=[],this.directionalLightSpecularColors=[],this.pointLightPositions=[],this.pointLightDiffuseColors=[],this.pointLightSpecularColors=[],this.spotLightPositions=[],this.spotLightDirections=[],this.spotLightDiffuseColors=[],this.spotLightSpecularColors=[],this.spotLightAngle=[],this.spotLightConc=[],this.drawMode=o.FILL,this.curFillColor=this._cachedFillStyle=[1,1,1,1],this.curStrokeColor=this._cachedStrokeStyle=[0,0,0,1],this.curBlendMode=o.BLEND,this._cachedBlendMode=void 0,this.blendExt=this.GL.getExtension("EXT_blend_minmax"),this._isBlending=!1,this._useSpecularMaterial=!1,this._useEmissiveMaterial=!1,this._useNormalMaterial=!1,this._useShininess=1,this._tint=[255,255,255,255],this.constantAttenuation=1,this.linearAttenuation=0,this.quadraticAttenuation=0,this.uMVMatrix=new u.default.Matrix,this.uPMatrix=new u.default.Matrix,this.uNMatrix=new u.default.Matrix("mat3"),this._curCamera=new u.default.Camera(this),this._curCamera._computeCameraDefaultSettings(),this._curCamera._setDefaultCamera(),this._defaultLightShader=void 0,this._defaultImmediateModeShader=void 0,this._defaultNormalShader=void 0,this._defaultColorShader=void 0,this._defaultPointShader=void 0,this.userFillShader=void 0,this.userStrokeShader=void 0,this.userPointShader=void 0,this.retainedMode={geometry:{},buffers:{stroke:[new u.default.RenderBuffer(3,"lineVertices","lineVertexBuffer","aPosition",this,this._flatten),new u.default.RenderBuffer(4,"lineNormals","lineNormalBuffer","aDirection",this,this._flatten)],fill:[new u.default.RenderBuffer(3,"vertices","vertexBuffer","aPosition",this,this._vToNArray),new u.default.RenderBuffer(3,"vertexNormals","normalBuffer","aNormal",this,this._vToNArray),new u.default.RenderBuffer(4,"vertexColors","colorBuffer","aMaterialColor",this),new u.default.RenderBuffer(3,"vertexAmbients","ambientBuffer","aAmbientColor",this),new u.default.RenderBuffer(2,"uvs","uvBuffer","aTexCoord",this,this._flatten)],text:[new u.default.RenderBuffer(3,"vertices","vertexBuffer","aPosition",this,this._vToNArray),new u.default.RenderBuffer(2,"uvs","uvBuffer","aTexCoord",this,this._flatten)]}},this.immediateMode={geometry:new u.default.Geometry,shapeMode:o.TRIANGLE_FAN,_bezierVertex:[],_quadraticVertex:[],_curveVertex:[],buffers:{fill:[new u.default.RenderBuffer(3,"vertices","vertexBuffer","aPosition",this,this._vToNArray),new u.default.RenderBuffer(3,"vertexNormals","normalBuffer","aNormal",this,this._vToNArray),new u.default.RenderBuffer(4,"vertexColors","colorBuffer","aVertexColor",this),new u.default.RenderBuffer(3,"vertexAmbients","ambientBuffer","aAmbientColor",this),new u.default.RenderBuffer(2,"uvs","uvBuffer","aTexCoord",this,this._flatten)],stroke:[new u.default.RenderBuffer(3,"lineVertices","lineVertexBuffer","aPosition",this,this._flatten),new u.default.RenderBuffer(4,"lineNormals","lineNormalBuffer","aDirection",this,this._flatten)],point:this.GL.createBuffer()}},this.pointSize=5,this.curStrokeWeight=1,this.textures=[],this.textureMode=o.IMAGE,this.textureWrapX=o.CLAMP,this.textureWrapY=o.CLAMP,this._tex=null,this._curveTightness=6,this._lookUpTableBezier=[],this._lookUpTableQuadratic=[],this._lutBezierDetail=0,this._lutQuadraticDetail=0,this._tessy=this._initTessy(),this.fontInfos={},this._curShader=void 0,this},u.default.RendererGL.prototype=Object.create(u.default.Renderer.prototype),u.default.RendererGL.prototype._setAttributeDefaults=function(e){var t={alpha:!0,depth:!0,stencil:!0,antialias:navigator.userAgent.toLowerCase().includes("safari"),premultipliedAlpha:!1,preserveDrawingBuffer:!0,perPixelLighting:!0};null===e._glAttributes?e._glAttributes=t:e._glAttributes=Object.assign(t,e._glAttributes)},u.default.RendererGL.prototype._initContext=function(){try{if(this.drawingContext=this.canvas.getContext("webgl",this._pInst._glAttributes)||this.canvas.getContext("experimental-webgl",this._pInst._glAttributes),null===this.drawingContext)throw new Error("Error creating webgl context");var e=this.drawingContext;e.enable(e.DEPTH_TEST),e.depthFunc(e.LEQUAL),e.viewport(0,0,e.drawingBufferWidth,e.drawingBufferHeight),this._viewport=this.drawingContext.getParameter(this.drawingContext.VIEWPORT)}catch(e){throw e}},u.default.RendererGL.prototype._resetContext=function(e,t){var r=this.width,i=this.height,n=this.canvas.id,o=this._pInst instanceof u.default.Graphics;if(o){var a=this._pInst;a.canvas.parentNode.removeChild(a.canvas),a.canvas=document.createElement("canvas"),(a._pInst._userNode||document.body).appendChild(a.canvas),u.default.Element.call(a,a.canvas,a._pInst),a.width=r,a.height=i}else{var s=this.canvas;s&&s.parentNode.removeChild(s),(s=document.createElement("canvas")).id=n,this._pInst._userNode?this._pInst._userNode.appendChild(s):document.body.appendChild(s),this._pInst.canvas=s}var l=new u.default.RendererGL(this._pInst.canvas,this._pInst,!o);this._pInst._setProperty("_renderer",l),l.resize(r,i),l._applyDefaults(),o||this._pInst._elements.push(l),"function"==typeof t&&setTimeout(function(){t.apply(window._renderer,e)},0)},u.default.prototype.setAttributes=function(e,t){if(void 0!==this._glAttributes){var r=!0;if(void 0!==t?(null===this._glAttributes&&(this._glAttributes={}),this._glAttributes[e]!==t&&(this._glAttributes[e]=t,r=!1)):e instanceof Object&&this._glAttributes!==e&&(this._glAttributes=e,r=!1),this._renderer.isP3D&&!r){if(!this._setupDone)for(var i in this._renderer.retainedMode.geometry)if(this._renderer.retainedMode.geometry.hasOwnProperty(i))return void console.error("Sorry, Could not set the attributes, you need to call setAttributes() before calling the other drawing methods in setup()");this.push(),this._renderer._resetContext(),this.pop(),this._renderer._curCamera&&(this._renderer._curCamera._renderer=this._renderer)}}else console.log("You are trying to use setAttributes on a p5.Graphics object that does not use a WEBGL renderer.")},u.default.RendererGL.prototype._update=function(){this.uMVMatrix.set(this._curCamera.cameraMatrix.mat4[0],this._curCamera.cameraMatrix.mat4[1],this._curCamera.cameraMatrix.mat4[2],this._curCamera.cameraMatrix.mat4[3],this._curCamera.cameraMatrix.mat4[4],this._curCamera.cameraMatrix.mat4[5],this._curCamera.cameraMatrix.mat4[6],this._curCamera.cameraMatrix.mat4[7],this._curCamera.cameraMatrix.mat4[8],this._curCamera.cameraMatrix.mat4[9],this._curCamera.cameraMatrix.mat4[10],this._curCamera.cameraMatrix.mat4[11],this._curCamera.cameraMatrix.mat4[12],this._curCamera.cameraMatrix.mat4[13],this._curCamera.cameraMatrix.mat4[14],this._curCamera.cameraMatrix.mat4[15]),this.ambientLightColors.length=0,this.specularColors=[1,1,1],this.directionalLightDirections.length=0,this.directionalLightDiffuseColors.length=0,this.directionalLightSpecularColors.length=0,this.pointLightPositions.length=0,this.pointLightDiffuseColors.length=0,this.pointLightSpecularColors.length=0,this.spotLightPositions.length=0,this.spotLightDirections.length=0,this.spotLightDiffuseColors.length=0,this.spotLightSpecularColors.length=0,this.spotLightAngle.length=0,this.spotLightConc.length=0,this._enableLighting=!1,this._tint=[255,255,255,255],this.GL.clear(this.GL.DEPTH_BUFFER_BIT)},u.default.RendererGL.prototype.background=function(){var e,t=(e=this._pInst).color.apply(e,arguments),r=t.levels[0]/255,i=t.levels[1]/255,n=t.levels[2]/255,o=t.levels[3]/255;this.GL.clearColor(r,i,n,o),this.GL.clear(this.GL.COLOR_BUFFER_BIT)},u.default.RendererGL.prototype.fill=function(e,t,r,i){var n=u.default.prototype.color.apply(this._pInst,arguments);this.curFillColor=n._array,this.drawMode=o.FILL,this._useNormalMaterial=!1,this._tex=null},u.default.RendererGL.prototype.stroke=function(e,t,r,i){arguments[3]=255;var n=u.default.prototype.color.apply(this._pInst,arguments);this.curStrokeColor=n._array},u.default.RendererGL.prototype.strokeCap=function(e){console.error("Sorry, strokeCap() is not yet implemented in WEBGL mode")},u.default.RendererGL.prototype.strokeJoin=function(e){console.error("Sorry, strokeJoin() is not yet implemented in WEBGL mode")},u.default.RendererGL.prototype.filter=function(e){console.error("filter() does not work in WEBGL mode")},u.default.RendererGL.prototype.blendMode=function(e){e===o.DARKEST||e===o.LIGHTEST||e===o.ADD||e===o.BLEND||e===o.SUBTRACT||e===o.SCREEN||e===o.EXCLUSION||e===o.REPLACE||e===o.MULTIPLY||e===o.REMOVE?this.curBlendMode=e:e!==o.BURN&&e!==o.OVERLAY&&e!==o.HARD_LIGHT&&e!==o.SOFT_LIGHT&&e!==o.DODGE||console.warn("BURN, OVERLAY, HARD_LIGHT, SOFT_LIGHT, and DODGE only work for blendMode in 2D mode.")},u.default.RendererGL.prototype.erase=function(e,t){this._isErasing||(this._cachedBlendMode=this.curBlendMode,this.blendMode(o.REMOVE),this._cachedFillStyle=this.curFillColor.slice(),this.curFillColor=[1,1,1,e/255],this._cachedStrokeStyle=this.curStrokeColor.slice(),this.curStrokeColor=[1,1,1,t/255],this._isErasing=!0)},u.default.RendererGL.prototype.noErase=function(){this._isErasing&&(this.curFillColor=this._cachedFillStyle.slice(),this.curStrokeColor=this._cachedStrokeStyle.slice(),this.blendMode(this._cachedBlendMode),this._isErasing=!1)},u.default.RendererGL.prototype.strokeWeight=function(e){this.curStrokeWeight!==e&&(this.pointSize=e,this.curStrokeWeight=e)},u.default.RendererGL.prototype._getPixel=function(e,t){var r;return r=new Uint8Array(4),this.drawingContext.readPixels(e,t,1,1,this.drawingContext.RGBA,this.drawingContext.UNSIGNED_BYTE,r),[r[0],r[1],r[2],r[3]]},u.default.RendererGL.prototype.loadPixels=function(){var e=this._pixelsState;if(!0===this._pInst._glAttributes.preserveDrawingBuffer){var t=e.pixels,r=this.GL.drawingBufferWidth*this.GL.drawingBufferHeight*4;t instanceof Uint8Array&&t.length===r||(t=new Uint8Array(r),this._pixelsState._setProperty("pixels",t));var i=this._pInst._pixelDensity;this.GL.readPixels(0,0,this.width*i,this.height*i,this.GL.RGBA,this.GL.UNSIGNED_BYTE,t)}else console.log("loadPixels only works in WebGL when preserveDrawingBuffer is true.")},u.default.RendererGL.prototype.geometryInHash=function(e){return void 0!==this.retainedMode.geometry[e]},u.default.RendererGL.prototype.resize=function(e,t){u.default.Renderer.prototype.resize.call(this,e,t),this.GL.viewport(0,0,this.GL.drawingBufferWidth,this.GL.drawingBufferHeight),this._viewport=this.GL.getParameter(this.GL.VIEWPORT),this._curCamera._resize();var r=this._pixelsState;void 0!==r.pixels&&r._setProperty("pixels",new Uint8Array(this.GL.drawingBufferWidth*this.GL.drawingBufferHeight*4))},u.default.RendererGL.prototype.clear=function(){var e=(arguments.length<=0?void 0:arguments[0])||0,t=(arguments.length<=1?void 0:arguments[1])||0,r=(arguments.length<=2?void 0:arguments[2])||0,i=(arguments.length<=3?void 0:arguments[3])||0;this.GL.clearColor(e,t,r,i),this.GL.clear(this.GL.COLOR_BUFFER_BIT|this.GL.DEPTH_BUFFER_BIT)},u.default.RendererGL.prototype.applyMatrix=function(e,t,r,i,n,o){16===arguments.length?u.default.Matrix.prototype.apply.apply(this.uMVMatrix,arguments):this.uMVMatrix.apply([e,t,0,0,r,i,0,0,0,0,1,0,n,o,0,1])},u.default.RendererGL.prototype.translate=function(e,t,r){return e instanceof u.default.Vector&&(r=e.z,t=e.y,e=e.x),this.uMVMatrix.translate([e,t,r]),this},u.default.RendererGL.prototype.scale=function(e,t,r){return this.uMVMatrix.scale(e,t,r),this},u.default.RendererGL.prototype.rotate=function(e,t){return void 0===t?this.rotateZ(e):(u.default.Matrix.prototype.rotate.apply(this.uMVMatrix,arguments),this)},u.default.RendererGL.prototype.rotateX=function(e){return this.rotate(e,1,0,0),this},u.default.RendererGL.prototype.rotateY=function(e){return this.rotate(e,0,1,0),this},u.default.RendererGL.prototype.rotateZ=function(e){return this.rotate(e,0,0,1),this},u.default.RendererGL.prototype.push=function(){var e=u.default.Renderer.prototype.push.apply(this),t=e.properties;return t.uMVMatrix=this.uMVMatrix.copy(),t.uPMatrix=this.uPMatrix.copy(),t._curCamera=this._curCamera,this._curCamera=this._curCamera.copy(),t.ambientLightColors=this.ambientLightColors.slice(),t.specularColors=this.specularColors.slice(),t.directionalLightDirections=this.directionalLightDirections.slice(),t.directionalLightDiffuseColors=this.directionalLightDiffuseColors.slice(),t.directionalLightSpecularColors=this.directionalLightSpecularColors.slice(),t.pointLightPositions=this.pointLightPositions.slice(),t.pointLightDiffuseColors=this.pointLightDiffuseColors.slice(),t.pointLightSpecularColors=this.pointLightSpecularColors.slice(),t.spotLightPositions=this.spotLightPositions.slice(),t.spotLightDirections=this.spotLightDirections.slice(),t.spotLightDiffuseColors=this.spotLightDiffuseColors.slice(),t.spotLightSpecularColors=this.spotLightSpecularColors.slice(),t.spotLightAngle=this.spotLightAngle.slice(),t.spotLightConc=this.spotLightConc.slice(),t.userFillShader=this.userFillShader,t.userStrokeShader=this.userStrokeShader,t.userPointShader=this.userPointShader,t.pointSize=this.pointSize,t.curStrokeWeight=this.curStrokeWeight,t.curStrokeColor=this.curStrokeColor,t.curFillColor=this.curFillColor,t._useSpecularMaterial=this._useSpecularMaterial,t._useEmissiveMaterial=this._useEmissiveMaterial,t._useShininess=this._useShininess,t.constantAttenuation=this.constantAttenuation,t.linearAttenuation=this.linearAttenuation,t.quadraticAttenuation=this.quadraticAttenuation,t._enableLighting=this._enableLighting,t._useNormalMaterial=this._useNormalMaterial,t._tex=this._tex,t.drawMode=this.drawMode,e},u.default.RendererGL.prototype.resetMatrix=function(){return this.uMVMatrix=u.default.Matrix.identity(this._pInst),this},u.default.RendererGL.prototype._getImmediateStrokeShader=function(){var e=this.userStrokeShader;return e&&e.isStrokeShader()?e:this._getLineShader()},u.default.RendererGL.prototype._getRetainedStrokeShader=u.default.RendererGL.prototype._getImmediateStrokeShader,u.default.RendererGL.prototype._getImmediateFillShader=function(){var e=this.userFillShader;if(this._useNormalMaterial&&(!e||!e.isNormalShader()))return this._getNormalShader();if(this._enableLighting){if(!e||!e.isLightShader())return this._getLightShader()}else if(this._tex){if(!e||!e.isTextureShader())return this._getLightShader()}else if(!e)return this._getImmediateModeShader();return e},u.default.RendererGL.prototype._getRetainedFillShader=function(){if(this._useNormalMaterial)return this._getNormalShader();var e=this.userFillShader;if(this._enableLighting){if(!e||!e.isLightShader())return this._getLightShader()}else if(this._tex){if(!e||!e.isTextureShader())return this._getLightShader()}else if(!e)return this._getColorShader();return e},u.default.RendererGL.prototype._getImmediatePointShader=function(){var e=this.userPointShader;return e&&e.isPointShader()?e:this._getPointShader()},u.default.RendererGL.prototype._getRetainedLineShader=u.default.RendererGL.prototype._getImmediateLineShader,u.default.RendererGL.prototype._getLightShader=function(){return this._defaultLightShader||(this._pInst._glAttributes.perPixelLighting?this._defaultLightShader=new u.default.Shader(this,c.phongVert,c.phongFrag):this._defaultLightShader=new u.default.Shader(this,c.lightVert,c.lightTextureFrag)),this._defaultLightShader},u.default.RendererGL.prototype._getImmediateModeShader=function(){return this._defaultImmediateModeShader||(this._defaultImmediateModeShader=new u.default.Shader(this,c.immediateVert,c.vertexColorFrag)),this._defaultImmediateModeShader},u.default.RendererGL.prototype._getNormalShader=function(){return this._defaultNormalShader||(this._defaultNormalShader=new u.default.Shader(this,c.normalVert,c.normalFrag)),this._defaultNormalShader},u.default.RendererGL.prototype._getColorShader=function(){return this._defaultColorShader||(this._defaultColorShader=new u.default.Shader(this,c.normalVert,c.basicFrag)),this._defaultColorShader},u.default.RendererGL.prototype._getPointShader=function(){return this._defaultPointShader||(this._defaultPointShader=new u.default.Shader(this,c.pointVert,c.pointFrag)),this._defaultPointShader},u.default.RendererGL.prototype._getLineShader=function(){return this._defaultLineShader||(this._defaultLineShader=new u.default.Shader(this,c.lineVert,c.lineFrag)),this._defaultLineShader},u.default.RendererGL.prototype._getFontShader=function(){return this._defaultFontShader||(this.GL.getExtension("OES_standard_derivatives"),this._defaultFontShader=new u.default.Shader(this,c.fontVert,c.fontFrag)),this._defaultFontShader},u.default.RendererGL.prototype._getEmptyTexture=function(){if(!this._emptyTexture){var e=new u.default.Image(1,1);e.set(0,0,255),this._emptyTexture=new u.default.Texture(this,e)}return this._emptyTexture},u.default.RendererGL.prototype.getTexture=function(e){var t=this.textures,r=!0,i=!1,n=void 0;try{for(var o,a=t[Symbol.iterator]();!(r=(o=a.next()).done);r=!0){var s=o.value;if(s.src===e)return s}}catch(e){i=!0,n=e}finally{try{r||null==a.return||a.return()}finally{if(i)throw n}}var l=new u.default.Texture(this,e);return t.push(l),l},u.default.RendererGL.prototype._setStrokeUniforms=function(e){e.bindShader(),e.setUniform("uMaterialColor",this.curStrokeColor),e.setUniform("uStrokeWeight",this.curStrokeWeight)},u.default.RendererGL.prototype._setFillUniforms=function(e){e.bindShader(),e.setUniform("uMaterialColor",this.curFillColor),e.setUniform("isTexture",!!this._tex),this._tex&&e.setUniform("uSampler",this._tex),e.setUniform("uTint",this._tint),e.setUniform("uSpecular",this._useSpecularMaterial),e.setUniform("uEmissive",this._useEmissiveMaterial),e.setUniform("uShininess",this._useShininess),e.setUniform("uUseLighting",this._enableLighting);var t=this.pointLightDiffuseColors.length/3;e.setUniform("uPointLightCount",t),e.setUniform("uPointLightLocation",this.pointLightPositions),e.setUniform("uPointLightDiffuseColors",this.pointLightDiffuseColors),e.setUniform("uPointLightSpecularColors",this.pointLightSpecularColors);var r=this.directionalLightDiffuseColors.length/3;e.setUniform("uDirectionalLightCount",r),e.setUniform("uLightingDirection",this.directionalLightDirections),e.setUniform("uDirectionalDiffuseColors",this.directionalLightDiffuseColors),e.setUniform("uDirectionalSpecularColors",this.directionalLightSpecularColors);var i=this.ambientLightColors.length/3;e.setUniform("uAmbientLightCount",i),e.setUniform("uAmbientColor",this.ambientLightColors);var n=this.spotLightDiffuseColors.length/3;e.setUniform("uSpotLightCount",n),e.setUniform("uSpotLightAngle",this.spotLightAngle),e.setUniform("uSpotLightConc",this.spotLightConc),e.setUniform("uSpotLightDiffuseColors",this.spotLightDiffuseColors),e.setUniform("uSpotLightSpecularColors",this.spotLightSpecularColors),e.setUniform("uSpotLightLocation",this.spotLightPositions),e.setUniform("uSpotLightDirection",this.spotLightDirections),e.setUniform("uConstantAttenuation",this.constantAttenuation),e.setUniform("uLinearAttenuation",this.linearAttenuation),e.setUniform("uQuadraticAttenuation",this.quadraticAttenuation),e.bindTextures()},u.default.RendererGL.prototype._setPointUniforms=function(e){e.bindShader(),e.setUniform("uMaterialColor",this.curStrokeColor),e.setUniform("uPointSize",this.pointSize)},u.default.RendererGL.prototype._bindBuffer=function(e,t,r,i,n){if(t=t||this.GL.ARRAY_BUFFER,this.GL.bindBuffer(t,e),void 0!==r){var o=new(i||Float32Array)(r);this.GL.bufferData(t,o,n||this.GL.STATIC_DRAW)}},u.default.RendererGL.prototype._arraysEqual=function(e,t){var r=e.length;if(r!==t.length)return!1;for(var i=0;i>7,127&f,c>>7,127&c);for(var d=0;d>7,127&p,0,0)}}return{cellImageInfo:l,dimOffset:o,dimImageInfo:n}}return(t=this.glyphInfos[e.index]={glyph:e,uGlyphRect:[i.x1,-i.y1,i.x2,-i.y2],strokeImageInfo:U,strokes:d,colInfo:G(m,this.colDimImageInfos,this.colCellImageInfos),rowInfo:G(p,this.rowDimImageInfos,this.rowCellImageInfos)}).uGridOffset=[t.colInfo.dimOffset,t.rowInfo.dimOffset],t}}var z=Math.sqrt(3);j.default.RendererGL.prototype._renderText=function(e,t,r,i,n){if(this._textFont&&"string"!=typeof this._textFont){if(!(n<=i)&&this._doFill){if(!this._isOpenType())return console.log("WEBGL: only Opentype (.otf) and Truetype (.ttf) fonts are supported"),e;e.push();var o=this._doStroke,a=this.drawMode;this._doStroke=!1,this.drawMode=D.TEXTURE;var s=this._textFont.font,l=this._textFont._fontInfo;l=l||(this._textFont._fontInfo=new A(s));var u=this._textFont._handleAlignment(this,t,r,i),h=this._textSize/s.unitsPerEm;this.translate(u.x,u.y,0),this.scale(h,h,1);var c=this.GL,f=!this._defaultFontShader,d=this._getFontShader();d.init(),d.bindShader(),f&&(d.setUniform("uGridImageSize",[64,64]),d.setUniform("uCellsImageSize",[64,64]),d.setUniform("uStrokeImageSize",[64,64]),d.setUniform("uGridSize",[9,9])),this._applyColorBlend(this.curFillColor);var p=this.retainedMode.geometry.glyph;if(!p){var m=this._textGeom=new j.default.Geometry(1,1,function(){for(var e=0;e<=1;e++)for(var t=0;t<=1;t++)this.vertices.push(new j.default.Vector(t,e,0)),this.uvs.push(t,e)});m.computeFaces().computeNormals(),p=this.createBuffers("glyph",m)}var g=!0,v=!1,y=void 0;try{for(var b,_=this.retainedMode.buffers.text[Symbol.iterator]();!(g=(b=_.next()).done);g=!0){b.value._prepareBuffer(p,d)}}catch(e){v=!0,y=e}finally{try{g||null==_.return||_.return()}finally{if(v)throw y}}this._bindBuffer(p.indexBuffer,c.ELEMENT_ARRAY_BUFFER),d.setUniform("uMaterialColor",this.curFillColor);try{var x=0,w=null,S=s.stringToGlyphs(t),M=!0,E=!1,T=void 0;try{for(var C,P=S[Symbol.iterator]();!(M=(C=P.next()).done);M=!0){var L=C.value;w&&(x+=s.getKerningValue(w,L));var k=l.getGlyphInfo(L);if(k.uGlyphRect){var R=k.rowInfo,O=k.colInfo;d.setUniform("uSamplerStrokes",k.strokeImageInfo.imageData),d.setUniform("uSamplerRowStrokes",R.cellImageInfo.imageData),d.setUniform("uSamplerRows",R.dimImageInfo.imageData),d.setUniform("uSamplerColStrokes",O.cellImageInfo.imageData),d.setUniform("uSamplerCols",O.dimImageInfo.imageData),d.setUniform("uGridOffset",k.uGridOffset),d.setUniform("uGlyphRect",k.uGlyphRect),d.setUniform("uGlyphOffset",x),d.bindTextures(),c.drawElements(c.TRIANGLES,6,this.GL.UNSIGNED_SHORT,0)}x+=L.advanceWidth,w=L}}catch(e){E=!0,T=e}finally{try{M||null==P.return||P.return()}finally{if(E)throw T}}}finally{d.unbindShader(),this._doStroke=o,this.drawMode=a,e.pop()}return e}}else console.log("WEBGL: you must load and set a font before drawing text. See `loadFont` and `textFont` for more details.")}},{"../core/constants":42,"../core/main":49,"./p5.RendererGL.Retained":102,"./p5.Shader":104}],107:[function(e,t,r){t.exports={fes:{autoplay:"The media that tried to play (with '{{src}}') wasn't allowed to by this browser, most likely due to the browser's autoplay policy. Check out {{link}} for more information about why.",fileLoadError:{bytes:"It looks like there was a problem loading your file. {{suggestion}}",font:"It looks like there was a problem loading your font. {{suggestion}}",gif:"There was some trouble loading your GIF. Make sure that your GIF is using 87a or 89a encoding.",image:"It looks like there was a problem loading your image. {{suggestion}}",json:"It looks like there was a problem loading your JSON file. {{suggestion}}",large:"If your large file isn't fetched successfully, we recommend splitting the file into smaller segments and fetching those.",strings:"It looks like there was a problem loading your text file. {{suggestion}}",suggestion:"Try checking if the file path ({{filePath}}) is correct, hosting the file online, or running a local server. (More info at {{link}})",table:"It looks like there was a problem loading your table file. {{suggestion}}",xml:"It looks like there was a problem loading your XML file. {{suggestion}}"},misusedTopLevel:"Did you just try to use p5.js's {{symbolName}} {{symbolType}}? If so, you may want to move it into your sketch's setup() function.\n\nFor more details, see: {{link}}",pre:"🌸 p5.js says: {{message}}",welcome:"Welcome! This is your friendly debugger. To turn me off, switch to using p5.min.js."}}},{}],108:[function(e,t,r){t.exports={fes:{autoplay:"Su browser impidío un medio tocar (de '{{src}}'), posiblemente porque las reglas de autoplay. Para aprender más, visite {{link}}.",fileLoadError:{bytes:"",font:"",gif:"",image:"",json:"",large:"",strings:"",suggestion:"",table:"",xml:""},misusedTopLevel:"",pre:"🌸 p5.js dice: {{message}}",welcome:""}}},{}],109:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i=o(e("./en/translation")),n=o(e("./es/translation"));function o(e){return e&&e.__esModule?e:{default:e}}var a={en:{translation:i.default},es:{translation:n.default}};r.default=a},{"./en/translation":107,"./es/translation":108}]},{},[37])(37)}); ================================================ FILE: docs/examples/transcrypt/sketch_005/target/org.transcrypt.__runtime__.js ================================================ // Transcrypt'ed from Python, 2021-11-02 13:06:13 var __name__ = 'org.transcrypt.__runtime__'; export var __envir__ = {}; __envir__.interpreter_name = 'python'; __envir__.transpiler_name = 'transcrypt'; __envir__.executor_name = __envir__.transpiler_name; __envir__.transpiler_version = '3.9.0'; export function __nest__ (headObject, tailNames, value) { var current = headObject; if (tailNames != '') { var tailChain = tailNames.split ('.'); var firstNewIndex = tailChain.length; for (var index = 0; index < tailChain.length; index++) { if (!current.hasOwnProperty (tailChain [index])) { firstNewIndex = index; break; } current = current [tailChain [index]]; } for (var index = firstNewIndex; index < tailChain.length; index++) { current [tailChain [index]] = {}; current = current [tailChain [index]]; } } for (let attrib of Object.getOwnPropertyNames (value)) { Object.defineProperty (current, attrib, { get () {return value [attrib];}, enumerable: true, configurable: true }); } }; export function __init__ (module) { if (!module.__inited__) { module.__all__.__init__ (module.__all__); module.__inited__ = true; } return module.__all__; }; export function __get__ (aThis, func, quotedFuncName) { if (aThis) { if (aThis.hasOwnProperty ('__class__') || typeof aThis == 'string' || aThis instanceof String) { if (quotedFuncName) { Object.defineProperty (aThis, quotedFuncName, { value: function () { var args = [] .slice.apply (arguments); return func.apply (null, [aThis] .concat (args)); }, writable: true, enumerable: true, configurable: true }); } return function () { var args = [] .slice.apply (arguments); return func.apply (null, [aThis.__proxy__ ? aThis.__proxy__ : aThis] .concat (args)); }; } else { return func; } } else { return func; } }; export function __getcm__ (aThis, func, quotedFuncName) { if (aThis.hasOwnProperty ('__class__')) { return function () { var args = [] .slice.apply (arguments); return func.apply (null, [aThis.__class__] .concat (args)); }; } else { return function () { var args = [] .slice.apply (arguments); return func.apply (null, [aThis] .concat (args)); }; } }; export function __getsm__ (aThis, func, quotedFuncName) { return func; }; export var py_metatype = { __name__: 'type', __bases__: [], __new__: function (meta, name, bases, attribs) { var cls = function () { var args = [] .slice.apply (arguments); return cls.__new__ (args); }; for (var index = bases.length - 1; index >= 0; index--) { var base = bases [index]; for (var attrib in base) { var descrip = Object.getOwnPropertyDescriptor (base, attrib); if (descrip == null) { continue; } Object.defineProperty (cls, attrib, descrip); } for (let symbol of Object.getOwnPropertySymbols (base)) { let descrip = Object.getOwnPropertyDescriptor (base, symbol); Object.defineProperty (cls, symbol, descrip); } } cls.__metaclass__ = meta; cls.__name__ = name.startsWith ('py_') ? name.slice (3) : name; cls.__bases__ = bases; for (var attrib in attribs) { var descrip = Object.getOwnPropertyDescriptor (attribs, attrib); Object.defineProperty (cls, attrib, descrip); } for (let symbol of Object.getOwnPropertySymbols (attribs)) { let descrip = Object.getOwnPropertyDescriptor (attribs, symbol); Object.defineProperty (cls, symbol, descrip); } return cls; } }; py_metatype.__metaclass__ = py_metatype; export var object = { __init__: function (self) {}, __metaclass__: py_metatype, __name__: 'object', __bases__: [], __new__: function (args) { var instance = Object.create (this, {__class__: {value: this, enumerable: true}}); if ('__getattr__' in this || '__setattr__' in this) { instance.__proxy__ = new Proxy (instance, { get: function (target, name) { let result = target [name]; if (result == undefined) { return target.__getattr__ (name); } else { return result; } }, set: function (target, name, value) { try { target.__setattr__ (name, value); } catch (exception) { target [name] = value; } return true; } }) instance = instance.__proxy__ } this.__init__.apply (null, [instance] .concat (args)); return instance; } }; export function __class__ (name, bases, attribs, meta) { if (meta === undefined) { meta = bases [0] .__metaclass__; } return meta.__new__ (meta, name, bases, attribs); }; export function __pragma__ () {}; export function __call__ (/* , , * */) { var args = [] .slice.apply (arguments); if (typeof args [0] == 'object' && '__call__' in args [0]) { return args [0] .__call__ .apply (args [1], args.slice (2)); } else { return args [0] .apply (args [1], args.slice (2)); } }; __envir__.executor_name = __envir__.transpiler_name; var __main__ = {__file__: ''}; var __except__ = null; export function __kwargtrans__ (anObject) { anObject.__kwargtrans__ = null; anObject.constructor = Object; return anObject; } export function __super__ (aClass, methodName) { for (let base of aClass.__bases__) { if (methodName in base) { return base [methodName]; } } throw new Exception ('Superclass method not found'); } export function property (getter, setter) { if (!setter) { setter = function () {}; } return {get: function () {return getter (this)}, set: function (value) {setter (this, value)}, enumerable: true}; } export function __setproperty__ (anObject, name, descriptor) { if (!anObject.hasOwnProperty (name)) { Object.defineProperty (anObject, name, descriptor); } } export function assert (condition, message) { if (!condition) { throw AssertionError (message, new Error ()); } } export function __mergekwargtrans__ (object0, object1) { var result = {}; for (var attrib in object0) { result [attrib] = object0 [attrib]; } for (var attrib in object1) { result [attrib] = object1 [attrib]; } return result; }; export function __mergefields__ (targetClass, sourceClass) { let fieldNames = ['__reprfields__', '__comparefields__', '__initfields__'] if (sourceClass [fieldNames [0]]) { if (targetClass [fieldNames [0]]) { for (let fieldName of fieldNames) { targetClass [fieldName] = new Set ([...targetClass [fieldName], ...sourceClass [fieldName]]); } } else { for (let fieldName of fieldNames) { targetClass [fieldName] = new Set (sourceClass [fieldName]); } } } } export function __withblock__ (manager, statements) { if (hasattr (manager, '__enter__')) { try { manager.__enter__ (); statements (); manager.__exit__ (); } catch (exception) { if (! (manager.__exit__ (exception.name, exception, exception.stack))) { throw exception; } } } else { statements (); manager.close (); } }; export function dir (obj) { var aList = []; for (var aKey in obj) { aList.push (aKey.startsWith ('py_') ? aKey.slice (3) : aKey); } aList.sort (); return aList; }; export function setattr (obj, name, value) { obj [name] = value; }; export function getattr (obj, name) { return name in obj ? obj [name] : obj ['py_' + name]; }; export function hasattr (obj, name) { try { return name in obj || 'py_' + name in obj; } catch (exception) { return false; } }; export function delattr (obj, name) { if (name in obj) { delete obj [name]; } else { delete obj ['py_' + name]; } }; export function __in__ (element, container) { if (container === undefined || container === null) { return false; } if (container.__contains__ instanceof Function) { return container.__contains__ (element); } else { return ( container.indexOf ? container.indexOf (element) > -1 : container.hasOwnProperty (element) ); } }; export function __specialattrib__ (attrib) { return (attrib.startswith ('__') && attrib.endswith ('__')) || attrib == 'constructor' || attrib.startswith ('py_'); }; export function len (anObject) { if (anObject === undefined || anObject === null) { return 0; } if (anObject.__len__ instanceof Function) { return anObject.__len__ (); } if (anObject.length !== undefined) { return anObject.length; } var length = 0; for (var attr in anObject) { if (!__specialattrib__ (attr)) { length++; } } return length; }; export function __i__ (any) { return py_typeof (any) == dict ? any.py_keys () : any; } export function __k__ (keyed, key) { var result = keyed [key]; if (typeof result == 'undefined') { if (keyed instanceof Array) if (key == +key && key >= 0 && keyed.length > key) return result; else throw IndexError (key, new Error()); else throw KeyError (key, new Error()); } return result; } export function __t__ (target) { return ( target === undefined || target === null ? false : ['boolean', 'number'] .indexOf (typeof target) >= 0 ? target : target.__bool__ instanceof Function ? (target.__bool__ () ? target : false) : target.__len__ instanceof Function ? (target.__len__ () !== 0 ? target : false) : target instanceof Function ? target : len (target) !== 0 ? target : false ); } export function float (any) { if (any == 'inf') { return Infinity; } else if (any == '-inf') { return -Infinity; } else if (any == 'nan') { return NaN; } else if (isNaN (parseFloat (any))) { if (any === false) { return 0; } else if (any === true) { return 1; } else { throw ValueError ("could not convert string to float: '" + str(any) + "'", new Error ()); } } else { return +any; } }; float.__name__ = 'float'; float.__bases__ = [object]; export function int (any) { return float (any) | 0 }; int.__name__ = 'int'; int.__bases__ = [object]; export function bool (any) { return !!__t__ (any); }; bool.__name__ = 'bool'; bool.__bases__ = [int]; export function py_typeof (anObject) { var aType = typeof anObject; if (aType == 'object') { try { return '__class__' in anObject ? anObject.__class__ : object; } catch (exception) { return aType; } } else { return ( aType == 'boolean' ? bool : aType == 'string' ? str : aType == 'number' ? (anObject % 1 == 0 ? int : float) : null ); } }; export function issubclass (aClass, classinfo) { if (classinfo instanceof Array) { for (let aClass2 of classinfo) { if (issubclass (aClass, aClass2)) { return true; } } return false; } try { var aClass2 = aClass; if (aClass2 == classinfo) { return true; } else { var bases = [].slice.call (aClass2.__bases__); while (bases.length) { aClass2 = bases.shift (); if (aClass2 == classinfo) { return true; } if (aClass2.__bases__.length) { bases = [].slice.call (aClass2.__bases__).concat (bases); } } return false; } } catch (exception) { return aClass == classinfo || classinfo == object; } }; export function isinstance (anObject, classinfo) { try { return '__class__' in anObject ? issubclass (anObject.__class__, classinfo) : issubclass (py_typeof (anObject), classinfo); } catch (exception) { return issubclass (py_typeof (anObject), classinfo); } }; export function callable (anObject) { return anObject && typeof anObject == 'object' && '__call__' in anObject ? true : typeof anObject === 'function'; }; export function repr (anObject) { try { return anObject.__repr__ (); } catch (exception) { try { return anObject.__str__ (); } catch (exception) { try { if (anObject == null) { return 'None'; } else if (anObject.constructor == Object) { var result = '{'; var comma = false; for (var attrib in anObject) { if (!__specialattrib__ (attrib)) { if (attrib.isnumeric ()) { var attribRepr = attrib; } else { var attribRepr = '\'' + attrib + '\''; } if (comma) { result += ', '; } else { comma = true; } result += attribRepr + ': ' + repr (anObject [attrib]); } } result += '}'; return result; } else { return typeof anObject == 'boolean' ? anObject.toString () .capitalize () : anObject.toString (); } } catch (exception) { return ''; } } } }; export function chr (charCode) { return String.fromCharCode (charCode); }; export function ord (aChar) { return aChar.charCodeAt (0); }; export function max (nrOrSeq) { return arguments.length == 1 ? Math.max (...nrOrSeq) : Math.max (...arguments); }; export function min (nrOrSeq) { return arguments.length == 1 ? Math.min (...nrOrSeq) : Math.min (...arguments); }; export var abs = Math.abs; export function round (number, ndigits) { if (ndigits) { var scale = Math.pow (10, ndigits); number *= scale; } var rounded = Math.round (number); if (rounded - number == 0.5 && rounded % 2) { rounded -= 1; } if (ndigits) { rounded /= scale; } return rounded; }; export function __jsUsePyNext__ () { try { var result = this.__next__ (); return {value: result, done: false}; } catch (exception) { return {value: undefined, done: true}; } } export function __pyUseJsNext__ () { var result = this.next (); if (result.done) { throw StopIteration (new Error ()); } else { return result.value; } } export function py_iter (iterable) { if (typeof iterable == 'string' || '__iter__' in iterable) { var result = iterable.__iter__ (); result.next = __jsUsePyNext__; } else if ('selector' in iterable) { var result = list (iterable) .__iter__ (); result.next = __jsUsePyNext__; } else if ('next' in iterable) { var result = iterable if (! ('__next__' in result)) { result.__next__ = __pyUseJsNext__; } } else if (Symbol.iterator in iterable) { var result = iterable [Symbol.iterator] (); result.__next__ = __pyUseJsNext__; } else { throw IterableError (new Error ()); } result [Symbol.iterator] = function () {return result;}; return result; } export function py_next (iterator) { try { var result = iterator.__next__ (); } catch (exception) { var result = iterator.next (); if (result.done) { throw StopIteration (new Error ()); } else { return result.value; } } if (result == undefined) { throw StopIteration (new Error ()); } else { return result; } } export function __PyIterator__ (iterable) { this.iterable = iterable; this.index = 0; } __PyIterator__.prototype.__next__ = function() { if (this.index < this.iterable.length) { return this.iterable [this.index++]; } else { throw StopIteration (new Error ()); } }; export function __JsIterator__ (iterable) { this.iterable = iterable; this.index = 0; } __JsIterator__.prototype.next = function () { if (this.index < this.iterable.py_keys.length) { return {value: this.index++, done: false}; } else { return {value: undefined, done: true}; } }; export function py_reversed (iterable) { iterable = iterable.slice (); iterable.reverse (); return iterable; }; export function zip () { var args = [] .slice.call (arguments); for (var i = 0; i < args.length; i++) { if (typeof args [i] == 'string') { args [i] = args [i] .split (''); } else if (!Array.isArray (args [i])) { args [i] = Array.from (args [i]); } } var shortest = args.length == 0 ? [] : args.reduce ( function (array0, array1) { return array0.length < array1.length ? array0 : array1; } ); return shortest.map ( function (current, index) { return args.map ( function (current) { return current [index]; } ); } ); }; export function range (start, stop, step) { if (stop == undefined) { stop = start; start = 0; } if (step == undefined) { step = 1; } if ((step > 0 && start >= stop) || (step < 0 && start <= stop)) { return []; } var result = []; for (var i = start; step > 0 ? i < stop : i > stop; i += step) { result.push(i); } return result; }; export function any (iterable) { for (let item of iterable) { if (bool (item)) { return true; } } return false; } export function all (iterable) { for (let item of iterable) { if (! bool (item)) { return false; } } return true; } export function sum (iterable) { let result = 0; for (let item of iterable) { result += item; } return result; } export function enumerate (iterable) { return zip (range (len (iterable)), iterable); } export function copy (anObject) { if (anObject == null || typeof anObject == "object") { return anObject; } else { var result = {}; for (var attrib in obj) { if (anObject.hasOwnProperty (attrib)) { result [attrib] = anObject [attrib]; } } return result; } } export function deepcopy (anObject) { if (anObject == null || typeof anObject == "object") { return anObject; } else { var result = {}; for (var attrib in obj) { if (anObject.hasOwnProperty (attrib)) { result [attrib] = deepcopy (anObject [attrib]); } } return result; } } export function list (iterable) { let instance = iterable ? Array.from (iterable) : []; return instance; } Array.prototype.__class__ = list; list.__name__ = 'list'; list.__bases__ = [object]; Array.prototype.__iter__ = function () {return new __PyIterator__ (this);}; Array.prototype.__getslice__ = function (start, stop, step) { if (start < 0) { start = this.length + start; } if (stop == null) { stop = this.length; } else if (stop < 0) { stop = this.length + stop; } else if (stop > this.length) { stop = this.length; } if (step == 1) { return Array.prototype.slice.call(this, start, stop); } let result = list ([]); for (let index = start; index < stop; index += step) { result.push (this [index]); } return result; }; Array.prototype.__setslice__ = function (start, stop, step, source) { if (start < 0) { start = this.length + start; } if (stop == null) { stop = this.length; } else if (stop < 0) { stop = this.length + stop; } if (step == null) { Array.prototype.splice.apply (this, [start, stop - start] .concat (source)); } else { let sourceIndex = 0; for (let targetIndex = start; targetIndex < stop; targetIndex += step) { this [targetIndex] = source [sourceIndex++]; } } }; Array.prototype.__repr__ = function () { if (this.__class__ == set && !this.length) { return 'set()'; } let result = !this.__class__ || this.__class__ == list ? '[' : this.__class__ == tuple ? '(' : '{'; for (let index = 0; index < this.length; index++) { if (index) { result += ', '; } result += repr (this [index]); } if (this.__class__ == tuple && this.length == 1) { result += ','; } result += !this.__class__ || this.__class__ == list ? ']' : this.__class__ == tuple ? ')' : '}';; return result; }; Array.prototype.__str__ = Array.prototype.__repr__; Array.prototype.append = function (element) { this.push (element); }; Array.prototype.py_clear = function () { this.length = 0; }; Array.prototype.extend = function (aList) { this.push.apply (this, aList); }; Array.prototype.insert = function (index, element) { this.splice (index, 0, element); }; Array.prototype.remove = function (element) { let index = this.indexOf (element); if (index == -1) { throw ValueError ("list.remove(x): x not in list", new Error ()); } this.splice (index, 1); }; Array.prototype.index = function (element) { return this.indexOf (element); }; Array.prototype.py_pop = function (index) { if (index == undefined) { return this.pop (); } else { return this.splice (index, 1) [0]; } }; Array.prototype.py_sort = function () { __sort__.apply (null, [this].concat ([] .slice.apply (arguments))); }; Array.prototype.__add__ = function (aList) { return list (this.concat (aList)); }; Array.prototype.__mul__ = function (scalar) { let result = this; for (let i = 1; i < scalar; i++) { result = result.concat (this); } return result; }; Array.prototype.__rmul__ = Array.prototype.__mul__; export function tuple (iterable) { let instance = iterable ? [] .slice.apply (iterable) : []; instance.__class__ = tuple; return instance; } tuple.__name__ = 'tuple'; tuple.__bases__ = [object]; export function set (iterable) { let instance = []; if (iterable) { for (let index = 0; index < iterable.length; index++) { instance.add (iterable [index]); } } instance.__class__ = set; return instance; } set.__name__ = 'set'; set.__bases__ = [object]; Array.prototype.__bindexOf__ = function (element) { element += ''; let mindex = 0; let maxdex = this.length - 1; while (mindex <= maxdex) { let index = (mindex + maxdex) / 2 | 0; let middle = this [index] + ''; if (middle < element) { mindex = index + 1; } else if (middle > element) { maxdex = index - 1; } else { return index; } } return -1; }; Array.prototype.add = function (element) { if (this.indexOf (element) == -1) { this.push (element); } }; Array.prototype.discard = function (element) { var index = this.indexOf (element); if (index != -1) { this.splice (index, 1); } }; Array.prototype.isdisjoint = function (other) { this.sort (); for (let i = 0; i < other.length; i++) { if (this.__bindexOf__ (other [i]) != -1) { return false; } } return true; }; Array.prototype.issuperset = function (other) { this.sort (); for (let i = 0; i < other.length; i++) { if (this.__bindexOf__ (other [i]) == -1) { return false; } } return true; }; Array.prototype.issubset = function (other) { return set (other.slice ()) .issuperset (this); }; Array.prototype.union = function (other) { let result = set (this.slice () .sort ()); for (let i = 0; i < other.length; i++) { if (result.__bindexOf__ (other [i]) == -1) { result.push (other [i]); } } return result; }; Array.prototype.intersection = function (other) { this.sort (); let result = set (); for (let i = 0; i < other.length; i++) { if (this.__bindexOf__ (other [i]) != -1) { result.push (other [i]); } } return result; }; Array.prototype.difference = function (other) { let sother = set (other.slice () .sort ()); let result = set (); for (let i = 0; i < this.length; i++) { if (sother.__bindexOf__ (this [i]) == -1) { result.push (this [i]); } } return result; }; Array.prototype.symmetric_difference = function (other) { return this.union (other) .difference (this.intersection (other)); }; Array.prototype.py_update = function () { let updated = [] .concat.apply (this.slice (), arguments) .sort (); this.py_clear (); for (let i = 0; i < updated.length; i++) { if (updated [i] != updated [i - 1]) { this.push (updated [i]); } } }; Array.prototype.__eq__ = function (other) { if (this.length != other.length) { return false; } if (this.__class__ == set) { this.sort (); other.sort (); } for (let i = 0; i < this.length; i++) { if (this [i] != other [i]) { return false; } } return true; }; Array.prototype.__ne__ = function (other) { return !this.__eq__ (other); }; Array.prototype.__le__ = function (other) { if (this.__class__ == set) { return this.issubset (other); } else { for (let i = 0; i < this.length; i++) { if (this [i] > other [i]) { return false; } else if (this [i] < other [i]) { return true; } } return true; } }; Array.prototype.__ge__ = function (other) { if (this.__class__ == set) { return this.issuperset (other); } else { for (let i = 0; i < this.length; i++) { if (this [i] < other [i]) { return false; } else if (this [i] > other [i]) { return true; } } return true; } }; Array.prototype.__lt__ = function (other) { return ( this.__class__ == set ? this.issubset (other) && !this.issuperset (other) : !this.__ge__ (other) ); }; Array.prototype.__gt__ = function (other) { return ( this.__class__ == set ? this.issuperset (other) && !this.issubset (other) : !this.__le__ (other) ); }; export function bytearray (bytable, encoding) { if (bytable == undefined) { return new Uint8Array (0); } else { let aType = py_typeof (bytable); if (aType == int) { return new Uint8Array (bytable); } else if (aType == str) { let aBytes = new Uint8Array (len (bytable)); for (let i = 0; i < len (bytable); i++) { aBytes [i] = bytable.charCodeAt (i); } return aBytes; } else if (aType == list || aType == tuple) { return new Uint8Array (bytable); } else { throw py_TypeError; } } } export var bytes = bytearray; Uint8Array.prototype.__add__ = function (aBytes) { let result = new Uint8Array (this.length + aBytes.length); result.set (this); result.set (aBytes, this.length); return result; }; Uint8Array.prototype.__mul__ = function (scalar) { let result = new Uint8Array (scalar * this.length); for (let i = 0; i < scalar; i++) { result.set (this, i * this.length); } return result; }; Uint8Array.prototype.__rmul__ = Uint8Array.prototype.__mul__; export function str (stringable) { if (typeof stringable === 'number') return stringable.toString(); else { try { return stringable.__str__ (); } catch (exception) { try { return repr (stringable); } catch (exception) { return String (stringable); } } } }; String.prototype.__class__ = str; str.__name__ = 'str'; str.__bases__ = [object]; String.prototype.__iter__ = function () {new __PyIterator__ (this);}; String.prototype.__repr__ = function () { return (this.indexOf ('\'') == -1 ? '\'' + this + '\'' : '"' + this + '"') .py_replace ('\t', '\\t') .py_replace ('\n', '\\n'); }; String.prototype.__str__ = function () { return this; }; String.prototype.capitalize = function () { return this.charAt (0).toUpperCase () + this.slice (1); }; String.prototype.endswith = function (suffix) { if (suffix instanceof Array) { for (var i=0;i> b; } }; export function __or__ (a, b) { if (typeof a == 'object' && '__or__' in a) { return a.__or__ (b); } else if (typeof b == 'object' && '__ror__' in b) { return b.__ror__ (a); } else { return a | b; } }; export function __xor__ (a, b) { if (typeof a == 'object' && '__xor__' in a) { return a.__xor__ (b); } else if (typeof b == 'object' && '__rxor__' in b) { return b.__rxor__ (a); } else { return a ^ b; } }; export function __and__ (a, b) { if (typeof a == 'object' && '__and__' in a) { return a.__and__ (b); } else if (typeof b == 'object' && '__rand__' in b) { return b.__rand__ (a); } else { return a & b; } }; export function __eq__ (a, b) { if (typeof a == 'object' && '__eq__' in a) { return a.__eq__ (b); } else { return a == b; } }; export function __ne__ (a, b) { if (typeof a == 'object' && '__ne__' in a) { return a.__ne__ (b); } else { return a != b } }; export function __lt__ (a, b) { if (typeof a == 'object' && '__lt__' in a) { return a.__lt__ (b); } else { return a < b; } }; export function __le__ (a, b) { if (typeof a == 'object' && '__le__' in a) { return a.__le__ (b); } else { return a <= b; } }; export function __gt__ (a, b) { if (typeof a == 'object' && '__gt__' in a) { return a.__gt__ (b); } else { return a > b; } }; export function __ge__ (a, b) { if (typeof a == 'object' && '__ge__' in a) { return a.__ge__ (b); } else { return a >= b; } }; export function __imatmul__ (a, b) { if ('__imatmul__' in a) { return a.__imatmul__ (b); } else { return a.__matmul__ (b); } }; export function __ipow__ (a, b) { if (typeof a == 'object' && '__pow__' in a) { return a.__ipow__ (b); } else if (typeof a == 'object' && '__ipow__' in a) { return a.__pow__ (b); } else if (typeof b == 'object' && '__rpow__' in b) { return b.__rpow__ (a); } else { return Math.pow (a, b); } }; export function __ijsmod__ (a, b) { if (typeof a == 'object' && '__imod__' in a) { return a.__ismod__ (b); } else if (typeof a == 'object' && '__mod__' in a) { return a.__mod__ (b); } else if (typeof b == 'object' && '__rpow__' in b) { return b.__rmod__ (a); } else { return a % b; } }; export function __imod__ (a, b) { if (typeof a == 'object' && '__imod__' in a) { return a.__imod__ (b); } else if (typeof a == 'object' && '__mod__' in a) { return a.__mod__ (b); } else if (typeof b == 'object' && '__rmod__' in b) { return b.__rmod__ (a); } else { return ((a % b) + b) % b; } }; export function __imul__ (a, b) { if (typeof a == 'object' && '__imul__' in a) { return a.__imul__ (b); } else if (typeof a == 'object' && '__mul__' in a) { return a = a.__mul__ (b); } else if (typeof b == 'object' && '__rmul__' in b) { return a = b.__rmul__ (a); } else if (typeof a == 'string') { return a = a.__mul__ (b); } else if (typeof b == 'string') { return a = b.__rmul__ (a); } else { return a *= b; } }; export function __idiv__ (a, b) { if (typeof a == 'object' && '__idiv__' in a) { return a.__idiv__ (b); } else if (typeof a == 'object' && '__div__' in a) { return a = a.__div__ (b); } else if (typeof b == 'object' && '__rdiv__' in b) { return a = b.__rdiv__ (a); } else { return a /= b; } }; export function __iadd__ (a, b) { if (typeof a == 'object' && '__iadd__' in a) { return a.__iadd__ (b); } else if (typeof a == 'object' && '__add__' in a) { return a = a.__add__ (b); } else if (typeof b == 'object' && '__radd__' in b) { return a = b.__radd__ (a); } else { return a += b; } }; export function __isub__ (a, b) { if (typeof a == 'object' && '__isub__' in a) { return a.__isub__ (b); } else if (typeof a == 'object' && '__sub__' in a) { return a = a.__sub__ (b); } else if (typeof b == 'object' && '__rsub__' in b) { return a = b.__rsub__ (a); } else { return a -= b; } }; export function __ilshift__ (a, b) { if (typeof a == 'object' && '__ilshift__' in a) { return a.__ilshift__ (b); } else if (typeof a == 'object' && '__lshift__' in a) { return a = a.__lshift__ (b); } else if (typeof b == 'object' && '__rlshift__' in b) { return a = b.__rlshift__ (a); } else { return a <<= b; } }; export function __irshift__ (a, b) { if (typeof a == 'object' && '__irshift__' in a) { return a.__irshift__ (b); } else if (typeof a == 'object' && '__rshift__' in a) { return a = a.__rshift__ (b); } else if (typeof b == 'object' && '__rrshift__' in b) { return a = b.__rrshift__ (a); } else { return a >>= b; } }; export function __ior__ (a, b) { if (typeof a == 'object' && '__ior__' in a) { return a.__ior__ (b); } else if (typeof a == 'object' && '__or__' in a) { return a = a.__or__ (b); } else if (typeof b == 'object' && '__ror__' in b) { return a = b.__ror__ (a); } else { return a |= b; } }; export function __ixor__ (a, b) { if (typeof a == 'object' && '__ixor__' in a) { return a.__ixor__ (b); } else if (typeof a == 'object' && '__xor__' in a) { return a = a.__xor__ (b); } else if (typeof b == 'object' && '__rxor__' in b) { return a = b.__rxor__ (a); } else { return a ^= b; } }; export function __iand__ (a, b) { if (typeof a == 'object' && '__iand__' in a) { return a.__iand__ (b); } else if (typeof a == 'object' && '__and__' in a) { return a = a.__and__ (b); } else if (typeof b == 'object' && '__rand__' in b) { return a = b.__rand__ (a); } else { return a &= b; } }; export function __getitem__ (container, key) { if (typeof container == 'object' && '__getitem__' in container) { return container.__getitem__ (key); } else if ((typeof container == 'string' || container instanceof Array) && key < 0) { return container [container.length + key]; } else { return container [key]; } }; export function __setitem__ (container, key, value) { if (typeof container == 'object' && '__setitem__' in container) { container.__setitem__ (key, value); } else if ((typeof container == 'string' || container instanceof Array) && key < 0) { container [container.length + key] = value; } else { container [key] = value; } }; export function __getslice__ (container, lower, upper, step) { if (typeof container == 'object' && '__getitem__' in container) { return container.__getitem__ ([lower, upper, step]); } else { return container.__getslice__ (lower, upper, step); } }; export function __setslice__ (container, lower, upper, step, value) { if (typeof container == 'object' && '__setitem__' in container) { container.__setitem__ ([lower, upper, step], value); } else { container.__setslice__ (lower, upper, step, value); } }; export var BaseException = __class__ ('BaseException', [object], { __module__: __name__, }); export var Exception = __class__ ('Exception', [BaseException], { __module__: __name__, get __init__ () {return __get__ (this, function (self) { var kwargs = dict (); if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'self': var self = __allkwargs0__ [__attrib0__]; break; default: kwargs [__attrib0__] = __allkwargs0__ [__attrib0__]; } } delete kwargs.__kwargtrans__; } var args = tuple ([].slice.apply (arguments).slice (1, __ilastarg0__ + 1)); } else { var args = tuple (); } self.__args__ = args; if (kwargs.error != null) { self.stack = kwargs.error.stack; } else if (Error) { self.stack = new Error ().stack; } else { self.stack = 'No stack trace available'; } });}, get __repr__ () {return __get__ (this, function (self) { if (len (self.__args__) > 1) { return '{}{}'.format (self.__class__.__name__, repr (tuple (self.__args__))); } else if (len (self.__args__)) { return '{}({})'.format (self.__class__.__name__, repr (self.__args__ [0])); } else { return '{}()'.format (self.__class__.__name__); } });}, get __str__ () {return __get__ (this, function (self) { if (len (self.__args__) > 1) { return str (tuple (self.__args__)); } else if (len (self.__args__)) { return str (self.__args__ [0]); } else { return ''; } });} }); export var IterableError = __class__ ('IterableError', [Exception], { __module__: __name__, get __init__ () {return __get__ (this, function (self, error) { Exception.__init__ (self, "Can't iterate over non-iterable", __kwargtrans__ ({error: error})); });} }); export var StopIteration = __class__ ('StopIteration', [Exception], { __module__: __name__, get __init__ () {return __get__ (this, function (self, error) { Exception.__init__ (self, 'Iterator exhausted', __kwargtrans__ ({error: error})); });} }); export var ValueError = __class__ ('ValueError', [Exception], { __module__: __name__, get __init__ () {return __get__ (this, function (self, message, error) { Exception.__init__ (self, message, __kwargtrans__ ({error: error})); });} }); export var KeyError = __class__ ('KeyError', [Exception], { __module__: __name__, get __init__ () {return __get__ (this, function (self, message, error) { Exception.__init__ (self, message, __kwargtrans__ ({error: error})); });} }); export var AssertionError = __class__ ('AssertionError', [Exception], { __module__: __name__, get __init__ () {return __get__ (this, function (self, message, error) { if (message) { Exception.__init__ (self, message, __kwargtrans__ ({error: error})); } else { Exception.__init__ (self, __kwargtrans__ ({error: error})); } });} }); export var NotImplementedError = __class__ ('NotImplementedError', [Exception], { __module__: __name__, get __init__ () {return __get__ (this, function (self, message, error) { Exception.__init__ (self, message, __kwargtrans__ ({error: error})); });} }); export var IndexError = __class__ ('IndexError', [Exception], { __module__: __name__, get __init__ () {return __get__ (this, function (self, message, error) { Exception.__init__ (self, message, __kwargtrans__ ({error: error})); });} }); export var AttributeError = __class__ ('AttributeError', [Exception], { __module__: __name__, get __init__ () {return __get__ (this, function (self, message, error) { Exception.__init__ (self, message, __kwargtrans__ ({error: error})); });} }); export var py_TypeError = __class__ ('py_TypeError', [Exception], { __module__: __name__, get __init__ () {return __get__ (this, function (self, message, error) { Exception.__init__ (self, message, __kwargtrans__ ({error: error})); });} }); export var Warning = __class__ ('Warning', [Exception], { __module__: __name__, }); export var UserWarning = __class__ ('UserWarning', [Warning], { __module__: __name__, }); export var DeprecationWarning = __class__ ('DeprecationWarning', [Warning], { __module__: __name__, }); export var RuntimeWarning = __class__ ('RuntimeWarning', [Warning], { __module__: __name__, }); export var __sort__ = function (iterable, key, reverse) { if (typeof key == 'undefined' || (key != null && key.hasOwnProperty ("__kwargtrans__"))) {; var key = null; }; if (typeof reverse == 'undefined' || (reverse != null && reverse.hasOwnProperty ("__kwargtrans__"))) {; var reverse = false; }; if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'iterable': var iterable = __allkwargs0__ [__attrib0__]; break; case 'key': var key = __allkwargs0__ [__attrib0__]; break; case 'reverse': var reverse = __allkwargs0__ [__attrib0__]; break; } } } } else { } if (key) { iterable.sort ((function __lambda__ (a, b) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'a': var a = __allkwargs0__ [__attrib0__]; break; case 'b': var b = __allkwargs0__ [__attrib0__]; break; } } } } else { } return (key (a) > key (b) ? 1 : -(1)); })); } else { iterable.sort (); } if (reverse) { iterable.reverse (); } }; export var sorted = function (iterable, key, reverse) { if (typeof key == 'undefined' || (key != null && key.hasOwnProperty ("__kwargtrans__"))) {; var key = null; }; if (typeof reverse == 'undefined' || (reverse != null && reverse.hasOwnProperty ("__kwargtrans__"))) {; var reverse = false; }; if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'iterable': var iterable = __allkwargs0__ [__attrib0__]; break; case 'key': var key = __allkwargs0__ [__attrib0__]; break; case 'reverse': var reverse = __allkwargs0__ [__attrib0__]; break; } } } } else { } if (py_typeof (iterable) == dict) { var result = copy (iterable.py_keys ()); } else { var result = copy (iterable); } __sort__ (result, key, reverse); return result; }; export var map = function (func, iterable) { return (function () { var __accu0__ = []; for (var item of iterable) { __accu0__.append (func (item)); } return __accu0__; }) (); }; export var filter = function (func, iterable) { if (func == null) { var func = bool; } return (function () { var __accu0__ = []; for (var item of iterable) { if (func (item)) { __accu0__.append (item); } } return __accu0__; }) (); }; export var divmod = function (n, d) { return tuple ([Math.floor (n / d), __mod__ (n, d)]); }; export var __Terminal__ = __class__ ('__Terminal__', [object], { __module__: __name__, get __init__ () {return __get__ (this, function (self) { self.buffer = ''; try { self.element = document.getElementById ('__terminal__'); } catch (__except0__) { self.element = null; } if (self.element) { self.element.style.overflowX = 'auto'; self.element.style.boxSizing = 'border-box'; self.element.style.padding = '5px'; self.element.innerHTML = '_'; } });}, get print () {return __get__ (this, function (self) { var sep = ' '; var end = '\n'; if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'self': var self = __allkwargs0__ [__attrib0__]; break; case 'sep': var sep = __allkwargs0__ [__attrib0__]; break; case 'end': var end = __allkwargs0__ [__attrib0__]; break; } } } var args = tuple ([].slice.apply (arguments).slice (1, __ilastarg0__ + 1)); } else { var args = tuple (); } self.buffer = '{}{}{}'.format (self.buffer, sep.join ((function () { var __accu0__ = []; for (var arg of args) { __accu0__.append (str (arg)); } return __accu0__; }) ()), end).__getslice__ (-(4096), null, 1); if (self.element) { self.element.innerHTML = self.buffer.py_replace ('\n', '
').py_replace (' ', ' '); self.element.scrollTop = self.element.scrollHeight; } else { console.log (sep.join ((function () { var __accu0__ = []; for (var arg of args) { __accu0__.append (str (arg)); } return __accu0__; }) ())); } });}, get input () {return __get__ (this, function (self, question) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'self': var self = __allkwargs0__ [__attrib0__]; break; case 'question': var question = __allkwargs0__ [__attrib0__]; break; } } } } else { } self.print ('{}'.format (question), __kwargtrans__ ({end: ''})); var answer = window.prompt ('\n'.join (self.buffer.py_split ('\n').__getslice__ (-(8), null, 1))); self.print (answer); return answer; });} }); export var __terminal__ = __Terminal__ (); export var print = __terminal__.print; export var input = __terminal__.input; //# sourceMappingURL=org.transcrypt.__runtime__.map ================================================ FILE: docs/examples/transcrypt/sketch_005/target/org.transcrypt.__runtime__.py ================================================ # Transcrypt runtime module #__pragma__ ('js', 'export var __envir__ = {{}};\n{}', __include__ ('org/transcrypt/__envir__.js')) #__pragma__ ('js', '{}', __include__ ('org/transcrypt/__core__.js')) #__pragma__ ('js', '{}', __include__ ('org/transcrypt/__builtin__.js')) #__pragma__ ('skip') copy = Math = __typeof__ = __repr__ = document = console = window = 0 #__pragma__ ('noskip') #__pragma__ ('notconv') # !!! tconv gives a problem with __terminal__, needs investigation #__pragma__ ('nokwargs') #__pragma__ ('noalias', 'sort') class BaseException: pass class Exception (BaseException): #__pragma__ ('kwargs') def __init__ (self, *args, **kwargs): self.__args__ = args if kwargs.error != None: self.stack = kwargs.error.stack # Integrate with JavaScript Error object elif Error: self.stack = (__new__(Error())).stack # Create our own stack if we aren't given one else: self.stack = 'No stack trace available' #__pragma__ ('nokwargs') def __repr__ (self): if len (self.__args__) > 1: return '{}{}'.format (self.__class__.__name__, repr (tuple (self.__args__))) elif len (self.__args__): return '{}({})'.format (self.__class__.__name__, repr (self.__args__ [0])) else: return '{}()'.format (self.__class__.__name__) def __str__ (self): if len (self.__args__) > 1: return str (tuple (self.__args__)) elif len (self.__args__): return str (self.__args__ [0]) else: return '' class IterableError (Exception): def __init__ (self, error): Exception.__init__ (self, 'Can\'t iterate over non-iterable', error = error) class StopIteration (Exception): def __init__ (self, error): Exception.__init__ (self, 'Iterator exhausted', error = error) class ValueError (Exception): def __init__ (self, message, error): Exception.__init__ (self, message, error = error) class KeyError (Exception): def __init__ (self, message, error): Exception.__init__ (self, message, error = error) class AssertionError (Exception): def __init__ (self, message, error): if message: Exception.__init__ (self, message, error = error) else: Exception.__init__ (self, error = error) class NotImplementedError (Exception): def __init__(self, message, error): Exception.__init__(self, message, error = error) class IndexError (Exception): def __init__(self, message, error): Exception.__init__(self, message, error = error) class AttributeError (Exception): def __init__(self, message, error): Exception.__init__(self, message, error = error) class TypeError (Exception): def __init__(self, message, error): Exception.__init__(self, message, error = error) # Warnings Exceptions # N.B. This is a limited subset of the warnings defined in # the cpython implementation to keep things small for now. class Warning (Exception): ''' Warning Base Class ''' pass class UserWarning (Warning): pass class DeprecationWarning (Warning): pass class RuntimeWarning (Warning): pass #__pragma__ ('kwargs') def __sort__ (iterable, key = None, reverse = False): # Used by py_sort, can deal with kwargs if key: iterable.sort (lambda a, b: 1 if key (a) > key (b) else -1) # JavaScript sort, case '==' is irrelevant for sorting else: iterable.sort () # JavaScript sort if reverse: iterable.reverse () def sorted (iterable, key = None, reverse = False): if type (iterable) == dict: result = copy (iterable.keys ()) else: result = copy (iterable) __sort__ (result, key, reverse) return result #__pragma__ ('nokwargs') def map (func, iterable): return [func (item) for item in iterable] def filter (func, iterable): if func == None: func = bool return [item for item in iterable if func (item)] def divmod (n, d): return n // d, n % d #__pragma__ ('ifdef', '__complex__') class complex: def __init__ (self, real, imag = None): if imag == None: if type (real) == complex: self.real = real.real self.imag = real.imag else: self.real = real self.imag = 0 else: self.real = real self.imag = imag def __neg__ (self): return complex (-self.real, -self.imag) def __exp__ (self): modulus = Math.exp (self.real) return complex (modulus * Math.cos (self.imag), modulus * Math.sin (self.imag)) def __log__ (self): return complex (Math.log (Math.sqrt (self.real * self.real + self.imag * self.imag)), Math.atan2 (self.imag, self.real)) def __pow__ (self, other): # a ** b = exp (b log a) return (self.__log__ () .__mul__ (other)) .__exp__ () def __rpow__ (self, real): # real ** comp -> comp.__rpow__ (real) return self.__mul__ (Math.log (real)) .__exp__ () def __mul__ (self, other): if __typeof__ (other) is 'number': return complex (self.real * other, self.imag * other) else: return complex (self.real * other.real - self.imag * other.imag, self.real * other.imag + self.imag * other.real) def __rmul__ (self, real): # real + comp -> comp.__rmul__ (real) return complex (self.real * real, self.imag * real) def __div__ (self, other): if __typeof__ (other) is 'number': return complex (self.real / other, self.imag / other) else: denom = other.real * other.real + other.imag * other.imag return complex ( (self.real * other.real + self.imag * other.imag) / denom, (self.imag * other.real - self.real * other.imag) / denom ) def __rdiv__ (self, real): # real / comp -> comp.__rdiv__ (real) denom = self.real * self.real return complex ( (real * self.real) / denom, (real * self.imag) / denom ) def __add__ (self, other): if __typeof__ (other) is 'number': return complex (self.real + other, self.imag) else: # Assume other is complex return complex (self.real + other.real, self.imag + other.imag) def __radd__ (self, real): # real + comp -> comp.__radd__ (real) return complex (self.real + real, self.imag) def __sub__ (self, other): if __typeof__ (other) is 'number': return complex (self.real - other, self.imag) else: return complex (self.real - other.real, self.imag - other.imag) def __rsub__ (self, real): # real - comp -> comp.__rsub__ (real) return complex (real - self.real, -self.imag) def __repr__ (self): return '({}{}{}j)'.format (self.real, '+' if self.imag >= 0 else '', self.imag) def __str__ (self): return __repr__ (self) [1 : -1] def __eq__ (self, other): if __typeof__ (other) is 'number': return self.real == other else: return self.real == other.real and self.imag == other.imag def __ne__ (self, other): if __typeof__ (other) is 'number': return self.real != other else: return self.real != other.real or self.imag != other.imag def conjugate (self): return complex (self.real, -self.imag) def __conj__ (aNumber): if isinstance (aNumber, complex): return complex (aNumber.real, -aNumber.imag) else: return complex (aNumber, 0) #__pragma__ ('endif') class __Terminal__: ''' Printing to either the console or to html happens async, but is blocked by calling window.prompt. So while all input and print statements are encountered in normal order, the print's exit immediately without yet having actually printed This means the next input takes control, blocking actual printing and so on indefinitely The effect is that everything's only printed after all inputs are done To prevent that, what's needed is to only execute the next window.prompt after actual printing has been done Since we've no way to find out when that is, a timeout is used. ''' def __init__ (self): self.buffer = '' try: self.element = document.getElementById ('__terminal__') except: self.element = None if self.element: self.element.style.overflowX = 'auto' self.element.style.boxSizing = 'border-box' self.element.style.padding = '5px' self.element.innerHTML = '_' #__pragma__ ('kwargs') def print (self, *args, sep = ' ', end = '\n'): self.buffer = '{}{}{}'.format (self.buffer, sep.join ([str (arg) for arg in args]), end) [-4096 : ] if self.element: self.element.innerHTML = self.buffer.replace ('\n', '
') .replace (' ', ' ') self.element.scrollTop = self.element.scrollHeight else: console.log (sep.join ([str (arg) for arg in args])) def input (self, question): self.print ('{}'.format (question), end = '') answer = window.prompt ('\n'.join (self.buffer.split ('\n') [-8:])) self.print (answer) return answer #__pragma__ ('nokwargs') __terminal__ = __Terminal__ () print = __terminal__.print input = __terminal__.input ================================================ FILE: docs/examples/transcrypt/sketch_005/target/pyp5js.js ================================================ // Transcrypt'ed from Python, 2021-11-02 13:06:13 import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, all, any, assert, bool, bytearray, bytes, callable, chr, deepcopy, delattr, dict, dir, divmod, enumerate, getattr, hasattr, isinstance, issubclass, len, list, object, ord, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, setattr, sorted, sum, tuple, zip} from './org.transcrypt.__runtime__.js'; import {PythonFunctions} from './python_functions.js'; var __name__ = 'pyp5js'; export var _P5_INSTANCE = null; export var _CTX_MIDDLE = null; export var _DEFAULT_FILL = null; export var _DEFAULT_LEADMULT = null; export var _DEFAULT_STROKE = null; export var _DEFAULT_TEXT_FILL = null; export var ADD = null; export var ALT = null; export var ARROW = null; export var AUDIO = null; export var AUTO = null; export var AXES = null; export var BACKSPACE = null; export var BASELINE = null; export var BEVEL = null; export var BEZIER = null; export var BLEND = null; export var BLUR = null; export var BOLD = null; export var BOLDITALIC = null; export var BOTTOM = null; export var BURN = null; export var CENTER = null; export var CHORD = null; export var CLAMP = null; export var CLOSE = null; export var CONTROL = null; export var CORNER = null; export var CORNERS = null; export var CROSS = null; export var CURVE = null; export var DARKEST = null; export var DEG_TO_RAD = null; export var DEGREES = null; export var DELETE = null; export var DIFFERENCE = null; export var DILATE = null; export var DODGE = null; export var DOWN_ARROW = null; export var ENTER = null; export var ERODE = null; export var ESCAPE = null; export var EXCLUSION = null; export var FILL = null; export var GRAY = null; export var GRID = null; export var HALF_PI = null; export var HAND = null; export var HARD_LIGHT = null; export var HSB = null; export var HSL = null; export var IMAGE = null; export var IMMEDIATE = null; export var INVERT = null; export var ITALIC = null; export var LANDSCAPE = null; export var LEFT = null; export var LEFT_ARROW = null; export var LIGHTEST = null; export var LINE_LOOP = null; export var LINE_STRIP = null; export var LINEAR = null; export var LINES = null; export var MIRROR = null; export var MITER = null; export var MOVE = null; export var MULTIPLY = null; export var NEAREST = null; export var NORMAL = null; export var OPAQUE = null; export var OPEN = null; export var OPTION = null; export var OVERLAY = null; export var PI = null; export var PIE = null; export var POINTS = null; export var PORTRAIT = null; export var POSTERIZE = null; export var PROJECT = null; export var QUAD_STRIP = null; export var QUADRATIC = null; export var QUADS = null; export var QUARTER_PI = null; export var RAD_TO_DEG = null; export var RADIANS = null; export var RADIUS = null; export var REPEAT = null; export var REPLACE = null; export var RETURN = null; export var RGB = null; export var RIGHT = null; export var RIGHT_ARROW = null; export var ROUND = null; export var SCREEN = null; export var SHIFT = null; export var SOFT_LIGHT = null; export var SQUARE = null; export var STROKE = null; export var SUBTRACT = null; export var TAB = null; export var TAU = null; export var TEXT = null; export var TEXTURE = null; export var THRESHOLD = null; export var TOP = null; export var TRIANGLE_FAN = null; export var TRIANGLE_STRIP = null; export var TRIANGLES = null; export var TWO_PI = null; export var UP_ARROW = null; export var VIDEO = null; export var WAIT = null; export var WEBGL = null; export var P2D = null; var PI = null; export var frameCount = null; export var focused = null; export var displayWidth = null; export var displayHeight = null; export var windowWidth = null; export var windowHeight = null; export var width = null; export var height = null; export var disableFriendlyErrors = null; export var deviceOrientation = null; export var accelerationX = null; export var accelerationY = null; export var accelerationZ = null; export var pAccelerationX = null; export var pAccelerationY = null; export var pAccelerationZ = null; export var rotationX = null; export var rotationY = null; export var rotationZ = null; export var pRotationX = null; export var pRotationY = null; export var pRotationZ = null; export var turnAxis = null; export var keyIsPressed = null; export var key = null; export var keyCode = null; export var mouseX = null; export var mouseY = null; export var pmouseX = null; export var pmouseY = null; export var winMouseX = null; export var winMouseY = null; export var pwinMouseX = null; export var pwinMouseY = null; export var mouseButton = null; export var mouseIsPressed = null; export var touches = null; export var pixels = null; export var alpha = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.alpha (...args); }; export var blue = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.blue (...args); }; export var brightness = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.brightness (...args); }; export var color = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.color (...args); }; export var green = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.green (...args); }; export var hue = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.hue (...args); }; export var lerpColor = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.lerpColor (...args); }; export var lightness = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.lightness (...args); }; export var red = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.red (...args); }; export var saturation = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.saturation (...args); }; export var background = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.background (...args); }; export var py_clear = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } var p5_clear = _P5_INSTANCE.clear (...args); return p5_clear; }; export var erase = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.erase (...args); }; export var noErase = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noErase (...args); }; export var colorMode = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.colorMode (...args); }; export var fill = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.fill (...args); }; export var noFill = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noFill (...args); }; export var noStroke = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noStroke (...args); }; export var stroke = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.stroke (...args); }; export var arc = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.arc (...args); }; export var ellipse = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.ellipse (...args); }; export var circle = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.circle (...args); }; export var line = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.line (...args); }; export var point = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.point (...args); }; export var quad = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.quad (...args); }; export var rect = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.rect (...args); }; export var square = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.square (...args); }; export var triangle = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.triangle (...args); }; export var plane = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.plane (...args); }; export var box = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.box (...args); }; export var sphere = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.sphere (...args); }; export var cylinder = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.cylinder (...args); }; export var cone = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.cone (...args); }; export var ellipsoid = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.ellipsoid (...args); }; export var torus = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.torus (...args); }; export var loadModel = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.loadModel (...args); }; export var model = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.model (...args); }; export var ellipseMode = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.ellipseMode (...args); }; export var noSmooth = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noSmooth (...args); }; export var rectMode = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.rectMode (...args); }; export var smooth = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.smooth (...args); }; export var strokeCap = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.strokeCap (...args); }; export var strokeJoin = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.strokeJoin (...args); }; export var strokeWeight = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.strokeWeight (...args); }; export var bezier = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.bezier (...args); }; export var bezierDetail = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.bezierDetail (...args); }; export var bezierPoint = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.bezierPoint (...args); }; export var bezierTangent = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.bezierTangent (...args); }; export var curve = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.curve (...args); }; export var curveDetail = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.curveDetail (...args); }; export var curveTightness = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.curveTightness (...args); }; export var curvePoint = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.curvePoint (...args); }; export var curveTangent = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.curveTangent (...args); }; export var beginContour = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.beginContour (...args); }; export var beginShape = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.beginShape (...args); }; export var bezierVertex = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.bezierVertex (...args); }; export var curveVertex = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.curveVertex (...args); }; export var endContour = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.endContour (...args); }; export var endShape = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.endShape (...args); }; export var quadraticVertex = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.quadraticVertex (...args); }; export var vertex = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.vertex (...args); }; export var cursor = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.cursor (...args); }; export var frameRate = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.frameRate (...args); }; export var noCursor = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noCursor (...args); }; export var fullscreen = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.fullscreen (...args); }; export var pixelDensity = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.pixelDensity (...args); }; export var displayDensity = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.displayDensity (...args); }; export var getURL = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.getURL (...args); }; export var getURLPath = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.getURLPath (...args); }; export var getURLParams = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.getURLParams (...args); }; export var preload = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.preload (...args); }; export var setup = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.setup (...args); }; export var draw = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.draw (...args); }; export var remove = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.remove (...args); }; export var noLoop = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noLoop (...args); }; export var loop = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.loop (...args); }; export var push = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.push (...args); }; export var redraw = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.redraw (...args); }; export var resizeCanvas = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.resizeCanvas (...args); }; export var noCanvas = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noCanvas (...args); }; export var createGraphics = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createGraphics (...args); }; export var blendMode = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.blendMode (...args); }; export var setAttributes = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.setAttributes (...args); }; export var applyMatrix = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.applyMatrix (...args); }; export var resetMatrix = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.resetMatrix (...args); }; export var rotate = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.rotate (...args); }; export var rotateX = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.rotateX (...args); }; export var rotateY = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.rotateY (...args); }; export var rotateZ = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.rotateZ (...args); }; export var scale = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.scale (...args); }; export var shearX = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.shearX (...args); }; export var shearY = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.shearY (...args); }; export var translate = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.translate (...args); }; export var createStringDict = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createStringDict (...args); }; export var createNumberDict = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createNumberDict (...args); }; export var append = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.append (...args); }; export var arrayCopy = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.arrayCopy (...args); }; export var concat = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.concat (...args); }; export var reverse = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.reverse (...args); }; export var shorten = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.shorten (...args); }; export var shuffle = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.shuffle (...args); }; export var py_sort = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.py_sort (...args); }; export var splice = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.splice (...args); }; export var subset = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.subset (...args); }; export var float = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.float (...args); }; export var int = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.int (...args); }; export var str = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.str (...args); }; export var boolean = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.boolean (...args); }; export var byte = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.byte (...args); }; export var char = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.char (...args); }; export var unchar = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.unchar (...args); }; export var hex = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.hex (...args); }; export var unhex = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.unhex (...args); }; export var join = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.join (...args); }; export var match = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.match (...args); }; export var matchAll = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.matchAll (...args); }; export var nf = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.nf (...args); }; export var nfc = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.nfc (...args); }; export var nfp = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.nfp (...args); }; export var nfs = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.nfs (...args); }; export var py_split = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.py_split (...args); }; export var splitTokens = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.splitTokens (...args); }; export var trim = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.trim (...args); }; export var setMoveThreshold = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.setMoveThreshold (...args); }; export var setShakeThreshold = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.setShakeThreshold (...args); }; export var keyIsDown = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.keyIsDown (...args); }; export var createImage = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createImage (...args); }; export var saveCanvas = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.saveCanvas (...args); }; export var saveFrames = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.saveFrames (...args); }; export var image_proxy = function (img) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'img': var img = __allkwargs0__ [__attrib0__]; break; } } } } else { } var _set = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } var value = img.set (...args); return value; }; var _get = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } var value = img.get (...args); return value; }; img.py_set = _set; img.py_get = _get; return img; }; export var loadImage = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } var imageObj = _P5_INSTANCE.loadImage (...args); return image_proxy (imageObj); }; export var image = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.image (...args); }; export var tint = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.tint (...args); }; export var noTint = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noTint (...args); }; export var imageMode = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.imageMode (...args); }; export var blend = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.blend (...args); }; export var copy = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.copy (...args); }; export var filter = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } if (len (args) > 1 && (args [0] === null || callable (args [0]))) { return PythonFunctions.filter (...args); } else { return _P5_INSTANCE.filter (...args); } }; export var py_get = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } var p5_get = _P5_INSTANCE.get (...args); return p5_get; }; export var loadPixels = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.loadPixels (...args); }; export var py_set = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } if (len (args) <= 1) { return PythonFunctions.py_set (...args); } else { return _P5_INSTANCE.py_set (...args); } }; export var updatePixels = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.updatePixels (...args); }; export var loadJSON = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.loadJSON (...args); }; export var loadStrings = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.loadStrings (...args); }; export var loadTable = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.loadTable (...args); }; export var loadXML = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.loadXML (...args); }; export var loadBytes = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.loadBytes (...args); }; export var httpGet = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.httpGet (...args); }; export var httpPost = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.httpPost (...args); }; export var httpDo = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.httpDo (...args); }; export var createWriter = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createWriter (...args); }; export var save = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.save (...args); }; export var saveJSON = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.saveJSON (...args); }; export var saveStrings = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.saveStrings (...args); }; export var saveTable = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.saveTable (...args); }; export var day = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.day (...args); }; export var hour = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.hour (...args); }; export var minute = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.minute (...args); }; export var millis = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.millis (...args); }; export var month = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.month (...args); }; export var second = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.second (...args); }; export var year = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.year (...args); }; export var createVector = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createVector (...args); }; export var abs = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.abs (...args); }; export var ceil = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.ceil (...args); }; export var constrain = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.constrain (...args); }; export var dist = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.dist (...args); }; export var exp = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.exp (...args); }; export var floor = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.floor (...args); }; export var lerp = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.lerp (...args); }; export var log = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.log (...args); }; export var mag = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.mag (...args); }; export var map = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } if (len (args) > 1 && callable (args [0])) { return PythonFunctions.map (...args); } else { return _P5_INSTANCE.map (...args); } }; export var max = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.max (...args); }; export var min = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.min (...args); }; export var norm = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.norm (...args); }; export var pow = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.pow (...args); }; export var round = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.round (...args); }; export var sq = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.sq (...args); }; export var sqrt = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.sqrt (...args); }; export var noise = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noise (...args); }; export var noiseDetail = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noiseDetail (...args); }; export var noiseSeed = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noiseSeed (...args); }; export var randomSeed = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.randomSeed (...args); }; export var random = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.random (...args); }; export var randomGaussian = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.randomGaussian (...args); }; export var acos = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.acos (...args); }; export var asin = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.asin (...args); }; export var atan = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.atan (...args); }; export var atan2 = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.atan2 (...args); }; export var cos = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.cos (...args); }; export var sin = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.sin (...args); }; export var tan = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.tan (...args); }; export var degrees = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.degrees (...args); }; export var radians = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.radians (...args); }; export var angleMode = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.angleMode (...args); }; export var textAlign = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.textAlign (...args); }; export var textLeading = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.textLeading (...args); }; export var textSize = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.textSize (...args); }; export var textStyle = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.textStyle (...args); }; export var textWidth = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.textWidth (...args); }; export var textAscent = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.textAscent (...args); }; export var textDescent = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.textDescent (...args); }; export var loadFont = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.loadFont (...args); }; export var text = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.text (...args); }; export var textFont = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.textFont (...args); }; export var orbitControl = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.orbitControl (...args); }; export var debugMode = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.debugMode (...args); }; export var noDebugMode = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noDebugMode (...args); }; export var ambientLight = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.ambientLight (...args); }; export var directionalLight = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.directionalLight (...args); }; export var pointLight = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.pointLight (...args); }; export var lights = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.lights (...args); }; export var loadShader = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.loadShader (...args); }; export var createShader = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createShader (...args); }; export var shader = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.shader (...args); }; export var resetShader = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.resetShader (...args); }; export var normalMaterial = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.normalMaterial (...args); }; export var texture = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.texture (...args); }; export var textureMode = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.textureMode (...args); }; export var textureWrap = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.textureWrap (...args); }; export var ambientMaterial = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.ambientMaterial (...args); }; export var specularMaterial = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.specularMaterial (...args); }; export var shininess = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.shininess (...args); }; export var camera = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.camera (...args); }; export var perspective = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.perspective (...args); }; export var ortho = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.ortho (...args); }; export var createCamera = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createCamera (...args); }; export var setCamera = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.setCamera (...args); }; export var select = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.select (...args); }; export var selectAll = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.selectAll (...args); }; export var removeElements = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.removeElements (...args); }; export var changed = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.changed (...args); }; export var input = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.input (...args); }; export var createDiv = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createDiv (...args); }; export var createP = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createP (...args); }; export var createSpan = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createSpan (...args); }; export var createImg = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createImg (...args); }; export var createA = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createA (...args); }; export var createSlider = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createSlider (...args); }; export var createButton = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createButton (...args); }; export var createCheckbox = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createCheckbox (...args); }; export var createSelect = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createSelect (...args); }; export var createRadio = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createRadio (...args); }; export var createColorPicker = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createColorPicker (...args); }; export var createInput = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createInput (...args); }; export var createFileInput = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createFileInput (...args); }; export var createVideo = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createVideo (...args); }; export var createAudio = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createAudio (...args); }; export var createCapture = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createCapture (...args); }; export var createElement = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createElement (...args); }; export var createCanvas = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } var canvas = _P5_INSTANCE.createCanvas (...args); width = _P5_INSTANCE.width; height = _P5_INSTANCE.height; return canvas; }; export var py_pop = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } var p5_pop = _P5_INSTANCE.pop (...args); return p5_pop; }; export var size = createCanvas; export var popMatrix = py_pop; export var popStyle = py_pop; export var pushMatrix = push; export var pushStyle = push; export var PVector = function (x, y, z) { if (typeof x == 'undefined' || (x != null && x.hasOwnProperty ("__kwargtrans__"))) {; var x = 0; }; if (typeof y == 'undefined' || (y != null && y.hasOwnProperty ("__kwargtrans__"))) {; var y = 0; }; if (typeof z == 'undefined' || (z != null && z.hasOwnProperty ("__kwargtrans__"))) {; var z = 0; }; if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'x': var x = __allkwargs0__ [__attrib0__]; break; case 'y': var y = __allkwargs0__ [__attrib0__]; break; case 'z': var z = __allkwargs0__ [__attrib0__]; break; } } } } else { } return _P5_INSTANCE.createVector (x, y, z); }; setattr (PVector, 'dist', p5.Vector.dist); setattr (PVector, 'add', p5.Vector.add); setattr (PVector, 'sub', p5.Vector.sub); setattr (PVector, 'mult', p5.Vector.mult); setattr (PVector, 'div', p5.Vector.div); setattr (PVector, 'dot', p5.Vector.dot); setattr (PVector, 'cross', p5.Vector.cross); setattr (PVector, 'lerp', p5.Vector.lerp); setattr (PVector, 'random2D', p5.Vector.random2D); setattr (PVector, 'random3D', p5.Vector.random3D); setattr (PVector, 'angleBetween', p5.Vector.angleBetween); setattr (PVector, 'fromAngle', p5.Vector.fromAngle); setattr (PVector, 'fromAngles', p5.Vector.fromAngles); setattr (PVector, 'equals', p5.Vector.equals); export var pre_draw = function (p5_instance, draw_func) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'p5_instance': var p5_instance = __allkwargs0__ [__attrib0__]; break; case 'draw_func': var draw_func = __allkwargs0__ [__attrib0__]; break; } } } } else { } _CTX_MIDDLE = p5_instance._CTX_MIDDLE; _DEFAULT_FILL = p5_instance._DEFAULT_FILL; _DEFAULT_LEADMULT = p5_instance._DEFAULT_LEADMULT; _DEFAULT_STROKE = p5_instance._DEFAULT_STROKE; _DEFAULT_TEXT_FILL = p5_instance._DEFAULT_TEXT_FILL; ADD = p5_instance.ADD; ALT = p5_instance.ALT; ARROW = p5_instance.ARROW; AUDIO = p5_instance.AUDIO; AUTO = p5_instance.AUTO; AXES = p5_instance.AXES; BACKSPACE = p5_instance.BACKSPACE; BASELINE = p5_instance.BASELINE; BEVEL = p5_instance.BEVEL; BEZIER = p5_instance.BEZIER; BLEND = p5_instance.BLEND; BLUR = p5_instance.BLUR; BOLD = p5_instance.BOLD; BOLDITALIC = p5_instance.BOLDITALIC; BOTTOM = p5_instance.BOTTOM; BURN = p5_instance.BURN; CENTER = p5_instance.CENTER; CHORD = p5_instance.CHORD; CLAMP = p5_instance.CLAMP; CLOSE = p5_instance.CLOSE; CONTROL = p5_instance.CONTROL; CORNER = p5_instance.CORNER; CORNERS = p5_instance.CORNERS; CROSS = p5_instance.CROSS; CURVE = p5_instance.CURVE; DARKEST = p5_instance.DARKEST; DEG_TO_RAD = p5_instance.DEG_TO_RAD; DEGREES = p5_instance.DEGREES; DELETE = p5_instance.DELETE; DIFFERENCE = p5_instance.DIFFERENCE; DILATE = p5_instance.DILATE; DODGE = p5_instance.DODGE; DOWN_ARROW = p5_instance.DOWN_ARROW; ENTER = p5_instance.ENTER; ERODE = p5_instance.ERODE; ESCAPE = p5_instance.ESCAPE; EXCLUSION = p5_instance.EXCLUSION; FILL = p5_instance.FILL; GRAY = p5_instance.GRAY; GRID = p5_instance.GRID; HALF_PI = p5_instance.HALF_PI; HAND = p5_instance.HAND; HARD_LIGHT = p5_instance.HARD_LIGHT; HSB = p5_instance.HSB; HSL = p5_instance.HSL; IMAGE = p5_instance.IMAGE; IMMEDIATE = p5_instance.IMMEDIATE; INVERT = p5_instance.INVERT; ITALIC = p5_instance.ITALIC; LANDSCAPE = p5_instance.LANDSCAPE; LEFT = p5_instance.LEFT; LEFT_ARROW = p5_instance.LEFT_ARROW; LIGHTEST = p5_instance.LIGHTEST; LINE_LOOP = p5_instance.LINE_LOOP; LINE_STRIP = p5_instance.LINE_STRIP; LINEAR = p5_instance.LINEAR; LINES = p5_instance.LINES; MIRROR = p5_instance.MIRROR; MITER = p5_instance.MITER; MOVE = p5_instance.MOVE; MULTIPLY = p5_instance.MULTIPLY; NEAREST = p5_instance.NEAREST; NORMAL = p5_instance.NORMAL; OPAQUE = p5_instance.OPAQUE; OPEN = p5_instance.OPEN; OPTION = p5_instance.OPTION; OVERLAY = p5_instance.OVERLAY; P2D = p5_instance.P2D; var P3D = p5_instance.WEBGL; PI = p5_instance.PI; PIE = p5_instance.PIE; POINTS = p5_instance.POINTS; PORTRAIT = p5_instance.PORTRAIT; POSTERIZE = p5_instance.POSTERIZE; PROJECT = p5_instance.PROJECT; QUAD_STRIP = p5_instance.QUAD_STRIP; QUADRATIC = p5_instance.QUADRATIC; QUADS = p5_instance.QUADS; QUARTER_PI = p5_instance.QUARTER_PI; RAD_TO_DEG = p5_instance.RAD_TO_DEG; RADIANS = p5_instance.RADIANS; RADIUS = p5_instance.RADIUS; REPEAT = p5_instance.REPEAT; REPLACE = p5_instance.REPLACE; RETURN = p5_instance.RETURN; RGB = p5_instance.RGB; RIGHT = p5_instance.RIGHT; RIGHT_ARROW = p5_instance.RIGHT_ARROW; ROUND = p5_instance.ROUND; SCREEN = p5_instance.SCREEN; SHIFT = p5_instance.SHIFT; SOFT_LIGHT = p5_instance.SOFT_LIGHT; SQUARE = p5_instance.SQUARE; STROKE = p5_instance.STROKE; SUBTRACT = p5_instance.SUBTRACT; TAB = p5_instance.TAB; TAU = p5_instance.TAU; TEXT = p5_instance.TEXT; TEXTURE = p5_instance.TEXTURE; THRESHOLD = p5_instance.THRESHOLD; TOP = p5_instance.TOP; TRIANGLE_FAN = p5_instance.TRIANGLE_FAN; TRIANGLE_STRIP = p5_instance.TRIANGLE_STRIP; TRIANGLES = p5_instance.TRIANGLES; TWO_PI = p5_instance.TWO_PI; UP_ARROW = p5_instance.UP_ARROW; VIDEO = p5_instance.VIDEO; WAIT = p5_instance.WAIT; WEBGL = p5_instance.WEBGL; frameCount = p5_instance.frameCount; focused = p5_instance.focused; displayWidth = p5_instance.displayWidth; displayHeight = p5_instance.displayHeight; windowWidth = p5_instance.windowWidth; windowHeight = p5_instance.windowHeight; width = p5_instance.width; height = p5_instance.height; disableFriendlyErrors = p5_instance.disableFriendlyErrors; deviceOrientation = p5_instance.deviceOrientation; accelerationX = p5_instance.accelerationX; accelerationY = p5_instance.accelerationY; accelerationZ = p5_instance.accelerationZ; pAccelerationX = p5_instance.pAccelerationX; pAccelerationY = p5_instance.pAccelerationY; pAccelerationZ = p5_instance.pAccelerationZ; rotationX = p5_instance.rotationX; rotationY = p5_instance.rotationY; rotationZ = p5_instance.rotationZ; pRotationX = p5_instance.pRotationX; pRotationY = p5_instance.pRotationY; pRotationZ = p5_instance.pRotationZ; turnAxis = p5_instance.turnAxis; keyIsPressed = p5_instance.keyIsPressed; key = p5_instance.key; keyCode = p5_instance.keyCode; mouseX = p5_instance.mouseX; mouseY = p5_instance.mouseY; pmouseX = p5_instance.pmouseX; pmouseY = p5_instance.pmouseY; winMouseX = p5_instance.winMouseX; winMouseY = p5_instance.winMouseY; pwinMouseX = p5_instance.pwinMouseX; pwinMouseY = p5_instance.pwinMouseY; mouseButton = p5_instance.mouseButton; mouseIsPressed = p5_instance.mouseIsPressed; touches = p5_instance.touches; pixels = p5_instance.pixels; return draw_func (); }; export var global_p5_injection = function (p5_sketch) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'p5_sketch': var p5_sketch = __allkwargs0__ [__attrib0__]; break; } } } } else { } var decorator = function (f) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'f': var f = __allkwargs0__ [__attrib0__]; break; } } } } else { } var wrapper = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } } else { } _P5_INSTANCE = p5_sketch; return pre_draw (_P5_INSTANCE, f); }; return wrapper; }; return decorator; }; export var start_p5 = function (preload_func, setup_func, draw_func, event_functions) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'preload_func': var preload_func = __allkwargs0__ [__attrib0__]; break; case 'setup_func': var setup_func = __allkwargs0__ [__attrib0__]; break; case 'draw_func': var draw_func = __allkwargs0__ [__attrib0__]; break; case 'event_functions': var event_functions = __allkwargs0__ [__attrib0__]; break; } } } } else { } var sketch_setup = function (p5_sketch) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'p5_sketch': var p5_sketch = __allkwargs0__ [__attrib0__]; break; } } } } else { } p5_sketch.preload = global_p5_injection (p5_sketch) (preload_func); p5_sketch.setup = global_p5_injection (p5_sketch) (setup_func); p5_sketch.draw = global_p5_injection (p5_sketch) (draw_func); }; var instance = new p5 (sketch_setup, 'sketch-holder'); var event_function_names = tuple (['deviceMoved', 'deviceTurned', 'deviceShaken', 'windowResized', 'keyPressed', 'keyReleased', 'keyTyped', 'mousePressed', 'mouseReleased', 'mouseClicked', 'doubleClicked', 'mouseMoved', 'mouseDragged', 'mouseWheel', 'touchStarted', 'touchMoved', 'touchEnded', 'keyIsDown']); for (var f_name of (function () { var __accu0__ = []; for (var f of event_function_names) { if (event_functions.py_get (f, null)) { __accu0__.append (f); } } return __accu0__; }) ()) { var func = event_functions [f_name]; var event_func = global_p5_injection (instance) (func); setattr (instance, f_name, event_func); } }; export var logOnloaded = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } } else { } console.log ('Lib loaded!'); }; export var add_library = function (lib_name) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'lib_name': var lib_name = __allkwargs0__ [__attrib0__]; break; } } } } else { } var src = ''; return console.log ('Lib name is not valid:', lib_name); console.log ('Importing:', src); var script = document.createElement ('script'); script.onload = logOnloaded; script.src = src; document.head.appendChild (script); }; //# sourceMappingURL=pyp5js.map ================================================ FILE: docs/examples/transcrypt/sketch_005/target/pyp5js.py ================================================ from python_functions import PythonFunctions _P5_INSTANCE = None _CTX_MIDDLE = None _DEFAULT_FILL = None _DEFAULT_LEADMULT = None _DEFAULT_STROKE = None _DEFAULT_TEXT_FILL = None ADD = None ALT = None ARROW = None AUDIO = None AUTO = None AXES = None BACKSPACE = None BASELINE = None BEVEL = None BEZIER = None BLEND = None BLUR = None BOLD = None BOLDITALIC = None BOTTOM = None BURN = None CENTER = None CHORD = None CLAMP = None CLOSE = None CONTROL = None CORNER = None CORNERS = None CROSS = None CURVE = None DARKEST = None DEG_TO_RAD = None DEGREES = None DELETE = None DIFFERENCE = None DILATE = None DODGE = None DOWN_ARROW = None ENTER = None ERODE = None ESCAPE = None EXCLUSION = None FILL = None GRAY = None GRID = None HALF_PI = None HAND = None HARD_LIGHT = None HSB = None HSL = None IMAGE = None IMMEDIATE = None INVERT = None ITALIC = None LANDSCAPE = None LEFT = None LEFT_ARROW = None LIGHTEST = None LINE_LOOP = None LINE_STRIP = None LINEAR = None LINES = None MIRROR = None MITER = None MOVE = None MULTIPLY = None NEAREST = None NORMAL = None OPAQUE = None OPEN = None OPTION = None OVERLAY = None PI = None PIE = None POINTS = None PORTRAIT = None POSTERIZE = None PROJECT = None QUAD_STRIP = None QUADRATIC = None QUADS = None QUARTER_PI = None RAD_TO_DEG = None RADIANS = None RADIUS = None REPEAT = None REPLACE = None RETURN = None RGB = None RIGHT = None RIGHT_ARROW = None ROUND = None SCREEN = None SHIFT = None SOFT_LIGHT = None SQUARE = None STROKE = None SUBTRACT = None TAB = None TAU = None TEXT = None TEXTURE = None THRESHOLD = None TOP = None TRIANGLE_FAN = None TRIANGLE_STRIP = None TRIANGLES = None TWO_PI = None UP_ARROW = None VIDEO = None WAIT = None WEBGL = None P2D = None PI = None frameCount = None focused = None displayWidth = None displayHeight = None windowWidth = None windowHeight = None width = None height = None disableFriendlyErrors = None deviceOrientation = None accelerationX = None accelerationY = None accelerationZ = None pAccelerationX = None pAccelerationY = None pAccelerationZ = None rotationX = None rotationY = None rotationZ = None pRotationX = None pRotationY = None pRotationZ = None turnAxis = None keyIsPressed = None key = None keyCode = None mouseX = None mouseY = None pmouseX = None pmouseY = None winMouseX = None winMouseY = None pwinMouseX = None pwinMouseY = None mouseButton = None mouseIsPressed = None touches = None pixels = None def alpha(*args): return _P5_INSTANCE.alpha(*args) def blue(*args): return _P5_INSTANCE.blue(*args) def brightness(*args): return _P5_INSTANCE.brightness(*args) def color(*args): return _P5_INSTANCE.color(*args) def green(*args): return _P5_INSTANCE.green(*args) def hue(*args): return _P5_INSTANCE.hue(*args) def lerpColor(*args): return _P5_INSTANCE.lerpColor(*args) def lightness(*args): return _P5_INSTANCE.lightness(*args) def red(*args): return _P5_INSTANCE.red(*args) def saturation(*args): return _P5_INSTANCE.saturation(*args) def background(*args): return _P5_INSTANCE.background(*args) def clear(*args): __pragma__('noalias', 'clear') p5_clear = _P5_INSTANCE.clear(*args) __pragma__('alias', 'clear', 'py_clear') return p5_clear def erase(*args): return _P5_INSTANCE.erase(*args) def noErase(*args): return _P5_INSTANCE.noErase(*args) def colorMode(*args): return _P5_INSTANCE.colorMode(*args) def fill(*args): return _P5_INSTANCE.fill(*args) def noFill(*args): return _P5_INSTANCE.noFill(*args) def noStroke(*args): return _P5_INSTANCE.noStroke(*args) def stroke(*args): return _P5_INSTANCE.stroke(*args) def arc(*args): return _P5_INSTANCE.arc(*args) def ellipse(*args): return _P5_INSTANCE.ellipse(*args) def circle(*args): return _P5_INSTANCE.circle(*args) def line(*args): return _P5_INSTANCE.line(*args) def point(*args): return _P5_INSTANCE.point(*args) def quad(*args): return _P5_INSTANCE.quad(*args) def rect(*args): return _P5_INSTANCE.rect(*args) def square(*args): return _P5_INSTANCE.square(*args) def triangle(*args): return _P5_INSTANCE.triangle(*args) def plane(*args): return _P5_INSTANCE.plane(*args) def box(*args): return _P5_INSTANCE.box(*args) def sphere(*args): return _P5_INSTANCE.sphere(*args) def cylinder(*args): return _P5_INSTANCE.cylinder(*args) def cone(*args): return _P5_INSTANCE.cone(*args) def ellipsoid(*args): return _P5_INSTANCE.ellipsoid(*args) def torus(*args): return _P5_INSTANCE.torus(*args) def loadModel(*args): return _P5_INSTANCE.loadModel(*args) def model(*args): return _P5_INSTANCE.model(*args) def ellipseMode(*args): return _P5_INSTANCE.ellipseMode(*args) def noSmooth(*args): return _P5_INSTANCE.noSmooth(*args) def rectMode(*args): return _P5_INSTANCE.rectMode(*args) def smooth(*args): return _P5_INSTANCE.smooth(*args) def strokeCap(*args): return _P5_INSTANCE.strokeCap(*args) def strokeJoin(*args): return _P5_INSTANCE.strokeJoin(*args) def strokeWeight(*args): return _P5_INSTANCE.strokeWeight(*args) def bezier(*args): return _P5_INSTANCE.bezier(*args) def bezierDetail(*args): return _P5_INSTANCE.bezierDetail(*args) def bezierPoint(*args): return _P5_INSTANCE.bezierPoint(*args) def bezierTangent(*args): return _P5_INSTANCE.bezierTangent(*args) def curve(*args): return _P5_INSTANCE.curve(*args) def curveDetail(*args): return _P5_INSTANCE.curveDetail(*args) def curveTightness(*args): return _P5_INSTANCE.curveTightness(*args) def curvePoint(*args): return _P5_INSTANCE.curvePoint(*args) def curveTangent(*args): return _P5_INSTANCE.curveTangent(*args) def beginContour(*args): return _P5_INSTANCE.beginContour(*args) def beginShape(*args): return _P5_INSTANCE.beginShape(*args) def bezierVertex(*args): return _P5_INSTANCE.bezierVertex(*args) def curveVertex(*args): return _P5_INSTANCE.curveVertex(*args) def endContour(*args): return _P5_INSTANCE.endContour(*args) def endShape(*args): return _P5_INSTANCE.endShape(*args) def quadraticVertex(*args): return _P5_INSTANCE.quadraticVertex(*args) def vertex(*args): return _P5_INSTANCE.vertex(*args) def cursor(*args): return _P5_INSTANCE.cursor(*args) def frameRate(*args): return _P5_INSTANCE.frameRate(*args) def noCursor(*args): return _P5_INSTANCE.noCursor(*args) def fullscreen(*args): return _P5_INSTANCE.fullscreen(*args) def pixelDensity(*args): return _P5_INSTANCE.pixelDensity(*args) def displayDensity(*args): return _P5_INSTANCE.displayDensity(*args) def getURL(*args): return _P5_INSTANCE.getURL(*args) def getURLPath(*args): return _P5_INSTANCE.getURLPath(*args) def getURLParams(*args): return _P5_INSTANCE.getURLParams(*args) def preload(*args): return _P5_INSTANCE.preload(*args) def setup(*args): return _P5_INSTANCE.setup(*args) def draw(*args): return _P5_INSTANCE.draw(*args) def remove(*args): return _P5_INSTANCE.remove(*args) def noLoop(*args): return _P5_INSTANCE.noLoop(*args) def loop(*args): return _P5_INSTANCE.loop(*args) def push(*args): return _P5_INSTANCE.push(*args) def redraw(*args): return _P5_INSTANCE.redraw(*args) def resizeCanvas(*args): return _P5_INSTANCE.resizeCanvas(*args) def noCanvas(*args): return _P5_INSTANCE.noCanvas(*args) def createGraphics(*args): return _P5_INSTANCE.createGraphics(*args) def blendMode(*args): return _P5_INSTANCE.blendMode(*args) def setAttributes(*args): return _P5_INSTANCE.setAttributes(*args) def applyMatrix(*args): return _P5_INSTANCE.applyMatrix(*args) def resetMatrix(*args): return _P5_INSTANCE.resetMatrix(*args) def rotate(*args): return _P5_INSTANCE.rotate(*args) def rotateX(*args): return _P5_INSTANCE.rotateX(*args) def rotateY(*args): return _P5_INSTANCE.rotateY(*args) def rotateZ(*args): return _P5_INSTANCE.rotateZ(*args) def scale(*args): return _P5_INSTANCE.scale(*args) def shearX(*args): return _P5_INSTANCE.shearX(*args) def shearY(*args): return _P5_INSTANCE.shearY(*args) def translate(*args): return _P5_INSTANCE.translate(*args) def createStringDict(*args): return _P5_INSTANCE.createStringDict(*args) def createNumberDict(*args): return _P5_INSTANCE.createNumberDict(*args) def append(*args): return _P5_INSTANCE.append(*args) def arrayCopy(*args): return _P5_INSTANCE.arrayCopy(*args) def concat(*args): return _P5_INSTANCE.concat(*args) def reverse(*args): return _P5_INSTANCE.reverse(*args) def shorten(*args): return _P5_INSTANCE.shorten(*args) def shuffle(*args): return _P5_INSTANCE.shuffle(*args) def sort(*args): return _P5_INSTANCE.sort(*args) def splice(*args): return _P5_INSTANCE.splice(*args) def subset(*args): return _P5_INSTANCE.subset(*args) def float(*args): return _P5_INSTANCE.float(*args) def int(*args): return _P5_INSTANCE.int(*args) def str(*args): return _P5_INSTANCE.str(*args) def boolean(*args): return _P5_INSTANCE.boolean(*args) def byte(*args): return _P5_INSTANCE.byte(*args) def char(*args): return _P5_INSTANCE.char(*args) def unchar(*args): return _P5_INSTANCE.unchar(*args) def hex(*args): return _P5_INSTANCE.hex(*args) def unhex(*args): return _P5_INSTANCE.unhex(*args) def join(*args): return _P5_INSTANCE.join(*args) def match(*args): return _P5_INSTANCE.match(*args) def matchAll(*args): return _P5_INSTANCE.matchAll(*args) def nf(*args): return _P5_INSTANCE.nf(*args) def nfc(*args): return _P5_INSTANCE.nfc(*args) def nfp(*args): return _P5_INSTANCE.nfp(*args) def nfs(*args): return _P5_INSTANCE.nfs(*args) def split(*args): return _P5_INSTANCE.split(*args) def splitTokens(*args): return _P5_INSTANCE.splitTokens(*args) def trim(*args): return _P5_INSTANCE.trim(*args) def setMoveThreshold(*args): return _P5_INSTANCE.setMoveThreshold(*args) def setShakeThreshold(*args): return _P5_INSTANCE.setShakeThreshold(*args) def keyIsDown(*args): return _P5_INSTANCE.keyIsDown(*args) def createImage(*args): return _P5_INSTANCE.createImage(*args) def saveCanvas(*args): return _P5_INSTANCE.saveCanvas(*args) def saveFrames(*args): return _P5_INSTANCE.saveFrames(*args) def image_proxy(img): """ Proxy to turn of transcypt when calling img.get/set methods """ def _set(*args): __pragma__('noalias', 'set') value = img.set(*args) __pragma__('alias', 'set', 'py_set') return value def _get(*args): __pragma__('noalias', 'get') value = img.get(*args) __pragma__('alias', 'get', 'py_get') return value img.set = _set img.get = _get return img def loadImage(*args): imageObj = _P5_INSTANCE.loadImage(*args) return image_proxy(imageObj) def image(*args): return _P5_INSTANCE.image(*args) def tint(*args): return _P5_INSTANCE.tint(*args) def noTint(*args): return _P5_INSTANCE.noTint(*args) def imageMode(*args): return _P5_INSTANCE.imageMode(*args) def blend(*args): return _P5_INSTANCE.blend(*args) def copy(*args): return _P5_INSTANCE.copy(*args) def filter(*args): if len(args) > 1 and (args[0] is None or callable(args[0])): return PythonFunctions.filter(*args) else: return _P5_INSTANCE.filter(*args) def get(*args): __pragma__('noalias', 'get') p5_get = _P5_INSTANCE.get(*args) __pragma__('alias', 'get', 'py_get') return p5_get def loadPixels(*args): return _P5_INSTANCE.loadPixels(*args) def set(*args): if len(args) <= 1: return PythonFunctions.set(*args) else: return _P5_INSTANCE.set(*args) def updatePixels(*args): return _P5_INSTANCE.updatePixels(*args) def loadJSON(*args): return _P5_INSTANCE.loadJSON(*args) def loadStrings(*args): return _P5_INSTANCE.loadStrings(*args) def loadTable(*args): return _P5_INSTANCE.loadTable(*args) def loadXML(*args): return _P5_INSTANCE.loadXML(*args) def loadBytes(*args): return _P5_INSTANCE.loadBytes(*args) def httpGet(*args): return _P5_INSTANCE.httpGet(*args) def httpPost(*args): return _P5_INSTANCE.httpPost(*args) def httpDo(*args): return _P5_INSTANCE.httpDo(*args) def createWriter(*args): return _P5_INSTANCE.createWriter(*args) def save(*args): return _P5_INSTANCE.save(*args) def saveJSON(*args): return _P5_INSTANCE.saveJSON(*args) def saveStrings(*args): return _P5_INSTANCE.saveStrings(*args) def saveTable(*args): return _P5_INSTANCE.saveTable(*args) def day(*args): return _P5_INSTANCE.day(*args) def hour(*args): return _P5_INSTANCE.hour(*args) def minute(*args): return _P5_INSTANCE.minute(*args) def millis(*args): return _P5_INSTANCE.millis(*args) def month(*args): return _P5_INSTANCE.month(*args) def second(*args): return _P5_INSTANCE.second(*args) def year(*args): return _P5_INSTANCE.year(*args) def createVector(*args): return _P5_INSTANCE.createVector(*args) def abs(*args): return _P5_INSTANCE.abs(*args) def ceil(*args): return _P5_INSTANCE.ceil(*args) def constrain(*args): return _P5_INSTANCE.constrain(*args) def dist(*args): return _P5_INSTANCE.dist(*args) def exp(*args): return _P5_INSTANCE.exp(*args) def floor(*args): return _P5_INSTANCE.floor(*args) def lerp(*args): return _P5_INSTANCE.lerp(*args) def log(*args): return _P5_INSTANCE.log(*args) def mag(*args): return _P5_INSTANCE.mag(*args) def map(*args): if len(args) > 1 and callable(args[0]): return PythonFunctions.map(*args) else: return _P5_INSTANCE.map(*args) def max(*args): return _P5_INSTANCE.max(*args) def min(*args): return _P5_INSTANCE.min(*args) def norm(*args): return _P5_INSTANCE.norm(*args) def pow(*args): return _P5_INSTANCE.pow(*args) def round(*args): return _P5_INSTANCE.round(*args) def sq(*args): return _P5_INSTANCE.sq(*args) def sqrt(*args): return _P5_INSTANCE.sqrt(*args) def noise(*args): return _P5_INSTANCE.noise(*args) def noiseDetail(*args): return _P5_INSTANCE.noiseDetail(*args) def noiseSeed(*args): return _P5_INSTANCE.noiseSeed(*args) def randomSeed(*args): return _P5_INSTANCE.randomSeed(*args) def random(*args): return _P5_INSTANCE.random(*args) def randomGaussian(*args): return _P5_INSTANCE.randomGaussian(*args) def acos(*args): return _P5_INSTANCE.acos(*args) def asin(*args): return _P5_INSTANCE.asin(*args) def atan(*args): return _P5_INSTANCE.atan(*args) def atan2(*args): return _P5_INSTANCE.atan2(*args) def cos(*args): return _P5_INSTANCE.cos(*args) def sin(*args): return _P5_INSTANCE.sin(*args) def tan(*args): return _P5_INSTANCE.tan(*args) def degrees(*args): return _P5_INSTANCE.degrees(*args) def radians(*args): return _P5_INSTANCE.radians(*args) def angleMode(*args): return _P5_INSTANCE.angleMode(*args) def textAlign(*args): return _P5_INSTANCE.textAlign(*args) def textLeading(*args): return _P5_INSTANCE.textLeading(*args) def textSize(*args): return _P5_INSTANCE.textSize(*args) def textStyle(*args): return _P5_INSTANCE.textStyle(*args) def textWidth(*args): return _P5_INSTANCE.textWidth(*args) def textAscent(*args): return _P5_INSTANCE.textAscent(*args) def textDescent(*args): return _P5_INSTANCE.textDescent(*args) def loadFont(*args): return _P5_INSTANCE.loadFont(*args) def text(*args): return _P5_INSTANCE.text(*args) def textFont(*args): return _P5_INSTANCE.textFont(*args) def orbitControl(*args): return _P5_INSTANCE.orbitControl(*args) def debugMode(*args): return _P5_INSTANCE.debugMode(*args) def noDebugMode(*args): return _P5_INSTANCE.noDebugMode(*args) def ambientLight(*args): return _P5_INSTANCE.ambientLight(*args) def directionalLight(*args): return _P5_INSTANCE.directionalLight(*args) def pointLight(*args): return _P5_INSTANCE.pointLight(*args) def lights(*args): return _P5_INSTANCE.lights(*args) def loadShader(*args): return _P5_INSTANCE.loadShader(*args) def createShader(*args): return _P5_INSTANCE.createShader(*args) def shader(*args): return _P5_INSTANCE.shader(*args) def resetShader(*args): return _P5_INSTANCE.resetShader(*args) def normalMaterial(*args): return _P5_INSTANCE.normalMaterial(*args) def texture(*args): return _P5_INSTANCE.texture(*args) def textureMode(*args): return _P5_INSTANCE.textureMode(*args) def textureWrap(*args): return _P5_INSTANCE.textureWrap(*args) def ambientMaterial(*args): return _P5_INSTANCE.ambientMaterial(*args) def specularMaterial(*args): return _P5_INSTANCE.specularMaterial(*args) def shininess(*args): return _P5_INSTANCE.shininess(*args) def camera(*args): return _P5_INSTANCE.camera(*args) def perspective(*args): return _P5_INSTANCE.perspective(*args) def ortho(*args): return _P5_INSTANCE.ortho(*args) def createCamera(*args): return _P5_INSTANCE.createCamera(*args) def setCamera(*args): return _P5_INSTANCE.setCamera(*args) def select(*args): return _P5_INSTANCE.select(*args) def selectAll(*args): return _P5_INSTANCE.selectAll(*args) def removeElements(*args): return _P5_INSTANCE.removeElements(*args) def changed(*args): return _P5_INSTANCE.changed(*args) def input(*args): return _P5_INSTANCE.input(*args) def createDiv(*args): return _P5_INSTANCE.createDiv(*args) def createP(*args): return _P5_INSTANCE.createP(*args) def createSpan(*args): return _P5_INSTANCE.createSpan(*args) def createImg(*args): return _P5_INSTANCE.createImg(*args) def createA(*args): return _P5_INSTANCE.createA(*args) def createSlider(*args): return _P5_INSTANCE.createSlider(*args) def createButton(*args): return _P5_INSTANCE.createButton(*args) def createCheckbox(*args): return _P5_INSTANCE.createCheckbox(*args) def createSelect(*args): return _P5_INSTANCE.createSelect(*args) def createRadio(*args): return _P5_INSTANCE.createRadio(*args) def createColorPicker(*args): return _P5_INSTANCE.createColorPicker(*args) def createInput(*args): return _P5_INSTANCE.createInput(*args) def createFileInput(*args): return _P5_INSTANCE.createFileInput(*args) def createVideo(*args): return _P5_INSTANCE.createVideo(*args) def createAudio(*args): return _P5_INSTANCE.createAudio(*args) def createCapture(*args): return _P5_INSTANCE.createCapture(*args) def createElement(*args): return _P5_INSTANCE.createElement(*args) def createCanvas(*args): canvas = _P5_INSTANCE.createCanvas(*args) global width, height width = _P5_INSTANCE.width height = _P5_INSTANCE.height return canvas def pop(*args): __pragma__('noalias', 'pop') p5_pop = _P5_INSTANCE.pop(*args) __pragma__('alias', 'pop', 'py_pop') return p5_pop # Processing Python or Java mode compatibility aliases size = createCanvas popMatrix = pop popStyle = pop pushMatrix = push pushStyle = push # PVector is a helper/alias to create p5.Vector objects def PVector(x=0, y=0, z=0): return _P5_INSTANCE.createVector(x, y, z) # aliases for p5.Vector class methods setattr(PVector, 'dist', p5.Vector.dist) setattr(PVector, 'add', p5.Vector.add) setattr(PVector, 'sub', p5.Vector.sub) setattr(PVector, 'mult', p5.Vector.mult) setattr(PVector, 'div', p5.Vector.div) setattr(PVector, 'dot', p5.Vector.dot) setattr(PVector, 'cross', p5.Vector.cross) setattr(PVector, 'lerp', p5.Vector.lerp) setattr(PVector, 'random2D', p5.Vector.random2D) setattr(PVector, 'random3D', p5.Vector.random3D) setattr(PVector, 'angleBetween', p5.Vector.angleBetween) setattr(PVector, 'fromAngle', p5.Vector.fromAngle) setattr(PVector, 'fromAngles', p5.Vector.fromAngles) setattr(PVector, 'equals', p5.Vector.equals) def pre_draw(p5_instance, draw_func): """ We need to run this before the actual draw to insert and update p5 env variables """ global _CTX_MIDDLE, _DEFAULT_FILL, _DEFAULT_LEADMULT, _DEFAULT_STROKE, _DEFAULT_TEXT_FILL global ADD, ALT, ARROW, AUTO, AUDIO, AXES, BACKSPACE, BASELINE, BEVEL, BEZIER, BLEND, BLUR, BOLD, BOLDITALIC global BOTTOM, BURN, CENTER, CHORD, CLAMP, CLOSE, CONTROL, CORNER, CORNERS, CROSS, CURVE, DARKEST global DEG_TO_RAD, DEGREES, DELETE, DIFFERENCE, DILATE, DODGE, DOWN_ARROW, ENTER, ERODE, ESCAPE, EXCLUSION global FILL, GRAY, GRID, HALF_PI, HAND, HARD_LIGHT, HSB, HSL, IMAGE, IMMEDIATE, INVERT, ITALIC, LANDSCAPE global LEFT, LEFT_ARROW, LIGHTEST, LINE_LOOP, LINE_STRIP, LINEAR, LINES, MIRROR, MITER, MOVE, MULTIPLY, NEAREST global NORMAL, OPAQUE, OPEN, OPTION, OVERLAY, P2D, PI, PIE, POINTS, PORTRAIT, POSTERIZE, PROJECT, QUAD_STRIP, QUADRATIC global QUADS, QUARTER_PI, RAD_TO_DEG, RADIANS, RADIUS, REPEAT, REPLACE, RETURN, RGB, RIGHT, RIGHT_ARROW global ROUND, SCREEN, SHIFT, SOFT_LIGHT, SQUARE, STROKE, SUBTRACT, TAB, TAU, TEXT, TEXTURE, THRESHOLD, TOP global TRIANGLE_FAN, TRIANGLE_STRIP, TRIANGLES, TWO_PI, UP_ARROW, VIDEO, WAIT, WEBGL global frameCount, focused, displayWidth, displayHeight, windowWidth, windowHeight, width, height global disableFriendlyErrors, deviceOrientation, accelerationX, accelerationY, accelerationZ global pAccelerationX, pAccelerationY, pAccelerationZ, rotationX, rotationY, rotationZ global pRotationX, pRotationY, pRotationZ, turnAxis, keyIsPressed, key, keyCode, mouseX, mouseY, pmouseX, pmouseY global winMouseX, winMouseY, pwinMouseX, pwinMouseY, mouseButton, mouseIsPressed, touches, pixels _CTX_MIDDLE = p5_instance._CTX_MIDDLE _DEFAULT_FILL = p5_instance._DEFAULT_FILL _DEFAULT_LEADMULT = p5_instance._DEFAULT_LEADMULT _DEFAULT_STROKE = p5_instance._DEFAULT_STROKE _DEFAULT_TEXT_FILL = p5_instance._DEFAULT_TEXT_FILL ADD = p5_instance.ADD ALT = p5_instance.ALT ARROW = p5_instance.ARROW AUDIO = p5_instance.AUDIO AUTO = p5_instance.AUTO AXES = p5_instance.AXES BACKSPACE = p5_instance.BACKSPACE BASELINE = p5_instance.BASELINE BEVEL = p5_instance.BEVEL BEZIER = p5_instance.BEZIER BLEND = p5_instance.BLEND BLUR = p5_instance.BLUR BOLD = p5_instance.BOLD BOLDITALIC = p5_instance.BOLDITALIC BOTTOM = p5_instance.BOTTOM BURN = p5_instance.BURN CENTER = p5_instance.CENTER CHORD = p5_instance.CHORD CLAMP = p5_instance.CLAMP CLOSE = p5_instance.CLOSE CONTROL = p5_instance.CONTROL CORNER = p5_instance.CORNER CORNERS = p5_instance.CORNERS CROSS = p5_instance.CROSS CURVE = p5_instance.CURVE DARKEST = p5_instance.DARKEST DEG_TO_RAD = p5_instance.DEG_TO_RAD DEGREES = p5_instance.DEGREES DELETE = p5_instance.DELETE DIFFERENCE = p5_instance.DIFFERENCE DILATE = p5_instance.DILATE DODGE = p5_instance.DODGE DOWN_ARROW = p5_instance.DOWN_ARROW ENTER = p5_instance.ENTER ERODE = p5_instance.ERODE ESCAPE = p5_instance.ESCAPE EXCLUSION = p5_instance.EXCLUSION FILL = p5_instance.FILL GRAY = p5_instance.GRAY GRID = p5_instance.GRID HALF_PI = p5_instance.HALF_PI HAND = p5_instance.HAND HARD_LIGHT = p5_instance.HARD_LIGHT HSB = p5_instance.HSB HSL = p5_instance.HSL IMAGE = p5_instance.IMAGE IMMEDIATE = p5_instance.IMMEDIATE INVERT = p5_instance.INVERT ITALIC = p5_instance.ITALIC LANDSCAPE = p5_instance.LANDSCAPE LEFT = p5_instance.LEFT LEFT_ARROW = p5_instance.LEFT_ARROW LIGHTEST = p5_instance.LIGHTEST LINE_LOOP = p5_instance.LINE_LOOP LINE_STRIP = p5_instance.LINE_STRIP LINEAR = p5_instance.LINEAR LINES = p5_instance.LINES MIRROR = p5_instance.MIRROR MITER = p5_instance.MITER MOVE = p5_instance.MOVE MULTIPLY = p5_instance.MULTIPLY NEAREST = p5_instance.NEAREST NORMAL = p5_instance.NORMAL OPAQUE = p5_instance.OPAQUE OPEN = p5_instance.OPEN OPTION = p5_instance.OPTION OVERLAY = p5_instance.OVERLAY P2D = p5_instance.P2D P3D = p5_instance.WEBGL PI = p5_instance.PI PIE = p5_instance.PIE POINTS = p5_instance.POINTS PORTRAIT = p5_instance.PORTRAIT POSTERIZE = p5_instance.POSTERIZE PROJECT = p5_instance.PROJECT QUAD_STRIP = p5_instance.QUAD_STRIP QUADRATIC = p5_instance.QUADRATIC QUADS = p5_instance.QUADS QUARTER_PI = p5_instance.QUARTER_PI RAD_TO_DEG = p5_instance.RAD_TO_DEG RADIANS = p5_instance.RADIANS RADIUS = p5_instance.RADIUS REPEAT = p5_instance.REPEAT REPLACE = p5_instance.REPLACE RETURN = p5_instance.RETURN RGB = p5_instance.RGB RIGHT = p5_instance.RIGHT RIGHT_ARROW = p5_instance.RIGHT_ARROW ROUND = p5_instance.ROUND SCREEN = p5_instance.SCREEN SHIFT = p5_instance.SHIFT SOFT_LIGHT = p5_instance.SOFT_LIGHT SQUARE = p5_instance.SQUARE STROKE = p5_instance.STROKE SUBTRACT = p5_instance.SUBTRACT TAB = p5_instance.TAB TAU = p5_instance.TAU TEXT = p5_instance.TEXT TEXTURE = p5_instance.TEXTURE THRESHOLD = p5_instance.THRESHOLD TOP = p5_instance.TOP TRIANGLE_FAN = p5_instance.TRIANGLE_FAN TRIANGLE_STRIP = p5_instance.TRIANGLE_STRIP TRIANGLES = p5_instance.TRIANGLES TWO_PI = p5_instance.TWO_PI UP_ARROW = p5_instance.UP_ARROW VIDEO = p5_instance.VIDEO WAIT = p5_instance.WAIT WEBGL = p5_instance.WEBGL frameCount = p5_instance.frameCount focused = p5_instance.focused displayWidth = p5_instance.displayWidth displayHeight = p5_instance.displayHeight windowWidth = p5_instance.windowWidth windowHeight = p5_instance.windowHeight width = p5_instance.width height = p5_instance.height disableFriendlyErrors = p5_instance.disableFriendlyErrors deviceOrientation = p5_instance.deviceOrientation accelerationX = p5_instance.accelerationX accelerationY = p5_instance.accelerationY accelerationZ = p5_instance.accelerationZ pAccelerationX = p5_instance.pAccelerationX pAccelerationY = p5_instance.pAccelerationY pAccelerationZ = p5_instance.pAccelerationZ rotationX = p5_instance.rotationX rotationY = p5_instance.rotationY rotationZ = p5_instance.rotationZ pRotationX = p5_instance.pRotationX pRotationY = p5_instance.pRotationY pRotationZ = p5_instance.pRotationZ turnAxis = p5_instance.turnAxis keyIsPressed = p5_instance.keyIsPressed key = p5_instance.key keyCode = p5_instance.keyCode mouseX = p5_instance.mouseX mouseY = p5_instance.mouseY pmouseX = p5_instance.pmouseX pmouseY = p5_instance.pmouseY winMouseX = p5_instance.winMouseX winMouseY = p5_instance.winMouseY pwinMouseX = p5_instance.pwinMouseX pwinMouseY = p5_instance.pwinMouseY mouseButton = p5_instance.mouseButton mouseIsPressed = p5_instance.mouseIsPressed touches = p5_instance.touches pixels = p5_instance.pixels return draw_func() def global_p5_injection(p5_sketch): """ Injects the p5js's skecth instance as a global variable to setup and draw functions """ def decorator(f): def wrapper(): global _P5_INSTANCE _P5_INSTANCE = p5_sketch return pre_draw(_P5_INSTANCE, f) return wrapper return decorator def start_p5(preload_func, setup_func, draw_func, event_functions): """ This is the entrypoint function. It accepts 2 parameters: - preload_func: a Python preload callable - setup_func: a Python setup callable - draw_func: a Python draw callable - event_functions: a config dict for the event functions in the format: {"eventFunctionName": python_event_function} This method gets the p5js's sketch instance and injects them """ def sketch_setup(p5_sketch): p5_sketch.preload = global_p5_injection(p5_sketch)(preload_func) p5_sketch.setup = global_p5_injection(p5_sketch)(setup_func) p5_sketch.draw = global_p5_injection(p5_sketch)(draw_func) instance = __new__(p5(sketch_setup, 'sketch-holder')) # inject event functions into p5 event_function_names = ( "deviceMoved", "deviceTurned", "deviceShaken", "windowResized", "keyPressed", "keyReleased", "keyTyped", "mousePressed", "mouseReleased", "mouseClicked", "doubleClicked", "mouseMoved", "mouseDragged", "mouseWheel", "touchStarted", "touchMoved", "touchEnded", "keyIsDown" ) for f_name in [f for f in event_function_names if event_functions.get(f, None)]: func = event_functions[f_name] event_func = global_p5_injection(instance)(func) setattr(instance, f_name, event_func) def logOnloaded(): console.log("Lib loaded!") def add_library(lib_name): # placeholder for https://github.com/berinhard/pyp5js/issues/31 src = '' return console.log("Lib name is not valid:", lib_name) console.log("Importing:", src) script = document.createElement("script") script.onload = logOnloaded script.src = src document.head.appendChild(script) ================================================ FILE: docs/examples/transcrypt/sketch_005/target/python_functions.js ================================================ // Transcrypt'ed from Python, 2021-11-02 13:06:13 import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, abs, all, any, assert, bool, bytearray, bytes, callable, chr, copy, deepcopy, delattr, dict, dir, divmod, enumerate, filter, float, getattr, hasattr, input, int, isinstance, issubclass, len, list, map, max, min, object, ord, pow, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, round, set, setattr, sorted, str, sum, tuple, zip} from './org.transcrypt.__runtime__.js'; var __name__ = 'python_functions'; export var PythonFunctions = __class__ ('PythonFunctions', [object], { __module__: __name__, }); setattr (PythonFunctions, 'map', map); setattr (PythonFunctions, 'filter', filter); setattr (PythonFunctions, 'set', set); //# sourceMappingURL=python_functions.map ================================================ FILE: docs/examples/transcrypt/sketch_005/target/python_functions.py ================================================ class PythonFunctions: pass setattr(PythonFunctions, 'map', map) setattr(PythonFunctions, 'filter', filter) setattr(PythonFunctions, 'set', set) ================================================ FILE: docs/examples/transcrypt/sketch_005/target/target_sketch.js ================================================ // Transcrypt'ed from Python, 2021-11-02 13:06:13 import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, all, any, assert, bool, bytearray, bytes, callable, chr, deepcopy, delattr, dict, dir, divmod, enumerate, getattr, hasattr, isinstance, issubclass, len, list, object, ord, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, set, setattr, sorted, sum, tuple, zip} from './org.transcrypt.__runtime__.js'; import {ADD, ALT, ARROW, AUDIO, AUTO, AXES, BACKSPACE, BASELINE, BEVEL, BEZIER, BLEND, BLUR, BOLD, BOLDITALIC, BOTTOM, BURN, CENTER, CHORD, CLAMP, CLOSE, CONTROL, CORNER, CORNERS, CROSS, CURVE, DARKEST, DEGREES, DEG_TO_RAD, DELETE, DIFFERENCE, DILATE, DODGE, DOWN_ARROW, ENTER, ERODE, ESCAPE, EXCLUSION, FILL, GRAY, GRID, HALF_PI, HAND, HARD_LIGHT, HSB, HSL, IMAGE, IMMEDIATE, INVERT, ITALIC, LANDSCAPE, LEFT, LEFT_ARROW, LIGHTEST, LINEAR, LINES, LINE_LOOP, LINE_STRIP, MIRROR, MITER, MOVE, MULTIPLY, NEAREST, NORMAL, OPAQUE, OPEN, OPTION, OVERLAY, P2D, PI, PIE, POINTS, PORTRAIT, POSTERIZE, PROJECT, PVector, QUADRATIC, QUADS, QUAD_STRIP, QUARTER_PI, RADIANS, RADIUS, RAD_TO_DEG, REPEAT, REPLACE, RETURN, RGB, RIGHT, RIGHT_ARROW, ROUND, SCREEN, SHIFT, SOFT_LIGHT, SQUARE, STROKE, SUBTRACT, TAB, TAU, TEXT, TEXTURE, THRESHOLD, TOP, TRIANGLES, TRIANGLE_FAN, TRIANGLE_STRIP, TWO_PI, UP_ARROW, VIDEO, WAIT, WEBGL, _CTX_MIDDLE, _DEFAULT_FILL, _DEFAULT_LEADMULT, _DEFAULT_STROKE, _DEFAULT_TEXT_FILL, _P5_INSTANCE, abs, accelerationX, accelerationY, accelerationZ, acos, add_library, alpha, ambientLight, ambientMaterial, angleMode, append, applyMatrix, arc, arrayCopy, asin, atan, atan2, background, beginContour, beginShape, bezier, bezierDetail, bezierPoint, bezierTangent, bezierVertex, blend, blendMode, blue, boolean, box, brightness, byte, camera, ceil, changed, char, circle, color, colorMode, concat, cone, constrain, copy, cos, createA, createAudio, createButton, createCamera, createCanvas, createCapture, createCheckbox, createColorPicker, createDiv, createElement, createFileInput, createGraphics, createImage, createImg, createInput, createNumberDict, createP, createRadio, createSelect, createShader, createSlider, createSpan, createStringDict, createVector, createVideo, createWriter, cursor, curve, curveDetail, curvePoint, curveTangent, curveTightness, curveVertex, cylinder, day, debugMode, degrees, deviceOrientation, directionalLight, disableFriendlyErrors, displayDensity, displayHeight, displayWidth, dist, ellipse, ellipseMode, ellipsoid, endContour, endShape, erase, exp, fill, filter, float, floor, focused, frameCount, frameRate, fullscreen, getURL, getURLParams, getURLPath, global_p5_injection, green, height, hex, hour, httpDo, httpGet, httpPost, hue, image, imageMode, image_proxy, input, int, join, key, keyCode, keyIsPressed, lerp, lerpColor, lightness, lights, line, loadBytes, loadFont, loadImage, loadJSON, loadModel, loadPixels, loadShader, loadStrings, loadTable, loadXML, log, logOnloaded, loop, mag, map, match, matchAll, max, millis, min, minute, model, month, mouseButton, mouseIsPressed, mouseX, mouseY, nf, nfc, nfp, nfs, noCanvas, noCursor, noDebugMode, noErase, noFill, noLoop, noSmooth, noStroke, noTint, noise, noiseDetail, noiseSeed, norm, normalMaterial, orbitControl, ortho, pAccelerationX, pAccelerationY, pAccelerationZ, pRotationX, pRotationY, pRotationZ, perspective, pixelDensity, pixels, plane, pmouseX, pmouseY, point, pointLight, popMatrix, popStyle, pow, pre_draw, push, pushMatrix, pushStyle, pwinMouseX, pwinMouseY, py_clear, py_get, py_pop, py_set, py_sort, py_split, quad, quadraticVertex, radians, random, randomGaussian, randomSeed, rect, rectMode, red, redraw, remove, removeElements, resetMatrix, resetShader, resizeCanvas, reverse, rotate, rotateX, rotateY, rotateZ, rotationX, rotationY, rotationZ, round, saturation, save, saveCanvas, saveFrames, saveJSON, saveStrings, saveTable, scale, second, select, selectAll, setAttributes, setCamera, setMoveThreshold, setShakeThreshold, shader, shearX, shearY, shininess, shorten, shuffle, sin, size, smooth, specularMaterial, sphere, splice, splitTokens, sq, sqrt, square, start_p5, str, stroke, strokeCap, strokeJoin, strokeWeight, subset, tan, text, textAlign, textAscent, textDescent, textFont, textLeading, textSize, textStyle, textWidth, texture, textureMode, textureWrap, tint, torus, touches, translate, triangle, trim, turnAxis, unchar, unhex, updatePixels, vertex, width, winMouseX, winMouseY, windowHeight, windowWidth, year} from './pyp5js.js'; var __name__ = '__main__'; export var preload = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } } else { } // pass; }; export var setup = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } } else { } // pass; }; export var draw = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } } else { } // pass; }; export var deviceMoved = null; export var deviceTurned = null; export var deviceShaken = null; export var keyPressed = null; export var keyReleased = null; export var keyTyped = null; export var mouseMoved = null; export var mouseDragged = null; export var mousePressed = null; export var mouseReleased = null; export var mouseClicked = null; export var doubleClicked = null; export var mouseWheel = null; export var touchStarted = null; export var touchMoved = null; export var touchEnded = null; export var windowResized = null; export var keyIsDown = null; var setup = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } } else { } createCanvas (600, 600); noStroke (); rectMode (CENTER); }; var draw = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } } else { } colorMode (HSB, 100); var h = map (mouseY, 0, 600, 0, 100); background (h, 100, 100); fill (100 - h, 100, 100); rect (300, 300, mouseX + 1, mouseX + 1); }; export var event_functions = dict ({'deviceMoved': deviceMoved, 'deviceTurned': deviceTurned, 'deviceShaken': deviceShaken, 'keyPressed': keyPressed, 'keyReleased': keyReleased, 'keyTyped': keyTyped, 'mouseMoved': mouseMoved, 'mouseDragged': mouseDragged, 'mousePressed': mousePressed, 'mouseReleased': mouseReleased, 'mouseClicked': mouseClicked, 'doubleClicked': doubleClicked, 'mouseWheel': mouseWheel, 'touchStarted': touchStarted, 'touchMoved': touchMoved, 'touchEnded': touchEnded, 'windowResized': windowResized, 'keyIsDown': keyIsDown}); start_p5 (preload, setup, draw, event_functions); //# sourceMappingURL=target_sketch.map ================================================ FILE: docs/examples/transcrypt/sketch_005/target/target_sketch.project ================================================ {"options": {"source": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_005/target_sketch.py", "anno": false, "alimod": false, "build": true, "complex": false, "docat": false, "dassert": false, "dcheck": false, "dextex": false, "dlog": false, "dmap": false, "dnostrip": false, "dstat": false, "dtree": false, "esv": null, "ecom": false, "fcall": false, "gen": false, "iconv": false, "jscall": false, "jskeys": false, "jsmod": false, "kwargs": true, "keycheck": false, "license": false, "map": true, "nomin": true, "opov": false, "outdir": null, "parent": null, "run": false, "symbols": null, "sform": false, "tconv": false, "unit": null, "verbose": false, "x": null, "xreex": false, "xglobs": false, "xpath": "/home/bernardo/envs/pyp5js/pyp5js/templates/transcrypt", "xtiny": false, "star": false}, "modules": [{"source": "/home/bernardo/.pyenv/versions/pyp5js/lib/python3.8/site-packages/transcrypt/modules/org/transcrypt/__runtime__.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_005/__target__/org.transcrypt.__runtime__.js"}, {"source": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_005/target_sketch.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_005/__target__/target_sketch.js"}, {"source": "/home/bernardo/envs/pyp5js/pyp5js/templates/transcrypt/pyp5js.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_005/__target__/pyp5js.js"}, {"source": "/home/bernardo/envs/pyp5js/pyp5js/templates/transcrypt/python_functions.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_005/__target__/python_functions.js"}]} ================================================ FILE: docs/examples/transcrypt/sketch_005/target/target_sketch.py ================================================ from pyp5js import * def preload(): pass def setup(): pass def draw(): pass deviceMoved = None deviceTurned = None deviceShaken = None keyPressed = None keyReleased = None keyTyped = None mouseMoved = None mouseDragged = None mousePressed = None mouseReleased = None mouseClicked = None doubleClicked = None mouseWheel = None touchStarted = None touchMoved = None touchEnded = None windowResized = None keyIsDown = None def setup(): createCanvas(600,600) noStroke() rectMode(CENTER) def draw(): colorMode(HSB,100) h = map(mouseY,0,600,0,100) background(h,100,100) fill(100-h,100,100) rect(300,300,mouseX+1,mouseX+1) event_functions = { "deviceMoved": deviceMoved, "deviceTurned": deviceTurned, "deviceShaken": deviceShaken, "keyPressed": keyPressed, "keyReleased": keyReleased, "keyTyped": keyTyped, "mouseMoved": mouseMoved, "mouseDragged": mouseDragged, "mousePressed": mousePressed, "mouseReleased": mouseReleased, "mouseClicked": mouseClicked, "doubleClicked": doubleClicked, "mouseWheel": mouseWheel, "touchStarted": touchStarted, "touchMoved": touchMoved, "touchEnded": touchEnded, "windowResized": windowResized, "keyIsDown": keyIsDown, } start_p5(preload, setup, draw, event_functions) ================================================ FILE: docs/examples/transcrypt/sketch_006/index.html ================================================ sketch_006 - pyp5js (using Transcrypt)

Python code here.

             
r = None
def setup():
    global r

    createCanvas(900, 900)
    r = random(100, 700)
    noFill()


def draw():
    x, y = 100, 100
    rect(x, y, r, r)


def keyPressed():
    console.log("Key pressed event")

    if key == "n":
        global r
        r = random(100, 700)
        redraw()


def mouseDragged():
    global r
    r = random(100, 700)
    redraw()

              
          
================================================ FILE: docs/examples/transcrypt/sketch_006/sketch_006.py ================================================ r = None def setup(): global r createCanvas(900, 900) r = random(100, 700) noFill() def draw(): x, y = 100, 100 rect(x, y, r, r) def keyPressed(): console.log("Key pressed event") if key == "n": global r r = random(100, 700) redraw() def mouseDragged(): global r r = random(100, 700) redraw() ================================================ FILE: docs/examples/transcrypt/sketch_006/static/p5.js ================================================ /*! p5.js v1.0.0 February 29, 2020 */ !function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).p5=e()}}(function(){return function o(a,s,l){function u(t,e){if(!s[t]){if(!a[t]){var r="function"==typeof require&&require;if(!e&&r)return r(t,!0);if(h)return h(t,!0);var i=new Error("Cannot find module '"+t+"'");throw i.code="MODULE_NOT_FOUND",i}var n=s[t]={exports:{}};a[t][0].call(n.exports,function(e){return u(a[t][1][e]||e)},n,n.exports,o,a,s,l)}return s[t].exports}for(var h="function"==typeof require&&require,e=0;e>16&255,a[s++]=t>>8&255,a[s++]=255&t;2===o&&(t=u[e.charCodeAt(r)]<<2|u[e.charCodeAt(r+1)]>>4,a[s++]=255&t);1===o&&(t=u[e.charCodeAt(r)]<<10|u[e.charCodeAt(r+1)]<<4|u[e.charCodeAt(r+2)]>>2,a[s++]=t>>8&255,a[s++]=255&t);return a},r.fromByteArray=function(e){for(var t,r=e.length,i=r%3,n=[],o=0,a=r-i;o>2]+s[t<<4&63]+"==")):2==i&&(t=(e[r-2]<<8)+e[r-1],n.push(s[t>>10]+s[t>>4&63]+s[t<<2&63]+"="));return n.join("")};for(var s=[],u=[],h="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=0,o=i.length;n>18&63]+s[n>>12&63]+s[n>>6&63]+s[63&n]);return o.join("")}u["-".charCodeAt(0)]=62,u["_".charCodeAt(0)]=63},{}],20:[function(e,t,r){},{}],21:[function(N,e,F){(function(c){"use strict";var i=N("base64-js"),o=N("ieee754"),e="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;F.Buffer=c,F.SlowBuffer=function(e){+e!=e&&(e=0);return c.alloc(+e)},F.INSPECT_MAX_BYTES=50;var r=2147483647;function a(e){if(r>>1;case"base64":return O(e).length;default:if(n)return i?-1:R(e).length;t=(""+t).toLowerCase(),n=!0}}function d(e,t,r){var i=e[t];e[t]=e[r],e[r]=i}function p(e,t,r,i,n){if(0===e.length)return-1;if("string"==typeof r?(i=r,r=0):2147483647=e.length){if(n)return-1;r=e.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof t&&(t=c.from(t,i)),c.isBuffer(t))return 0===t.length?-1:m(e,t,r,i,n);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):m(e,[t],r,i,n);throw new TypeError("val must be string, number or Buffer")}function m(e,t,r,i,n){var o,a=1,s=e.length,l=t.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(e.length<2||t.length<2)return-1;s/=a=2,l/=2,r/=2}function u(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(n){var h=-1;for(o=r;o>8,n=r%256,o.push(n),o.push(i);return o}(t,e.length-r),e,r,i)}function b(e,t,r){return 0===t&&r===e.length?i.fromByteArray(e):i.fromByteArray(e.slice(t,r))}function _(e,t,r){r=Math.min(e.length,r);for(var i=[],n=t;n>>10&1023|55296),h=56320|1023&h),i.push(h),n+=c}return function(e){var t=e.length;if(t<=x)return String.fromCharCode.apply(String,e);var r="",i=0;for(;ithis.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e=e||"utf8";;)switch(e){case"hex":return M(this,t,r);case"utf8":case"utf-8":return _(this,t,r);case"ascii":return w(this,t,r);case"latin1":case"binary":return S(this,t,r);case"base64":return b(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,t,r);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}.apply(this,arguments)},c.prototype.equals=function(e){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===c.compare(this,e)},c.prototype.inspect=function(){var e="",t=F.INSPECT_MAX_BYTES;return e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(e+=" ... "),""},e&&(c.prototype[e]=c.prototype.inspect),c.prototype.compare=function(e,t,r,i,n){if(A(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),t<0||r>e.length||i<0||n>this.length)throw new RangeError("out of range index");if(n<=i&&r<=t)return 0;if(n<=i)return-1;if(r<=t)return 1;if(this===e)return 0;for(var o=(n>>>=0)-(i>>>=0),a=(r>>>=0)-(t>>>=0),s=Math.min(o,a),l=this.slice(i,n),u=e.slice(t,r),h=0;h>>=0,isFinite(r)?(r>>>=0,void 0===i&&(i="utf8")):(i=r,r=void 0)}var n=this.length-t;if((void 0===r||nthis.length)throw new RangeError("Attempt to write outside buffer bounds");i=i||"utf8";for(var o,a,s,l,u,h,c=!1;;)switch(i){case"hex":return g(this,e,t,r);case"utf8":case"utf-8":return u=t,h=r,D(R(e,(l=this).length-u),l,u,h);case"ascii":return v(this,e,t,r);case"latin1":case"binary":return v(this,e,t,r);case"base64":return o=this,a=t,s=r,D(O(e),o,a,s);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return y(this,e,t,r);default:if(c)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),c=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var x=4096;function w(e,t,r){var i="";r=Math.min(e.length,r);for(var n=t;ne.length)throw new RangeError("Index out of range")}function P(e,t,r,i){if(r+i>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function L(e,t,r,i,n){return t=+t,r>>>=0,n||P(e,0,r,4),o.write(e,t,r,i,23,4),r+4}function k(e,t,r,i,n){return t=+t,r>>>=0,n||P(e,0,r,8),o.write(e,t,r,i,52,8),r+8}c.prototype.slice=function(e,t){var r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):r>>=0,t>>>=0,r||T(e,t,this.length);for(var i=this[e],n=1,o=0;++o>>=0,t>>>=0,r||T(e,t,this.length);for(var i=this[e+--t],n=1;0>>=0,t||T(e,1,this.length),this[e]},c.prototype.readUInt16LE=function(e,t){return e>>>=0,t||T(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUInt16BE=function(e,t){return e>>>=0,t||T(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUInt32LE=function(e,t){return e>>>=0,t||T(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUInt32BE=function(e,t){return e>>>=0,t||T(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||T(e,t,this.length);for(var i=this[e],n=1,o=0;++o>>=0,t>>>=0,r||T(e,t,this.length);for(var i=t,n=1,o=this[e+--i];0>>=0,t||T(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){e>>>=0,t||T(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(e,t){e>>>=0,t||T(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(e,t){return e>>>=0,t||T(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return e>>>=0,t||T(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readFloatLE=function(e,t){return e>>>=0,t||T(e,4,this.length),o.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return e>>>=0,t||T(e,4,this.length),o.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return e>>>=0,t||T(e,8,this.length),o.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return e>>>=0,t||T(e,8,this.length),o.read(this,e,!1,52,8)},c.prototype.writeUIntLE=function(e,t,r,i){e=+e,t>>>=0,r>>>=0,i||C(this,e,t,r,Math.pow(2,8*r)-1,0);var n=1,o=0;for(this[t]=255&e;++o>>=0,r>>>=0,i||C(this,e,t,r,Math.pow(2,8*r)-1,0);var n=r-1,o=1;for(this[t+n]=255&e;0<=--n&&(o*=256);)this[t+n]=e/o&255;return t+r},c.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,1,255,0),this[t]=255&e,t+1},c.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},c.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeIntLE=function(e,t,r,i){if(e=+e,t>>>=0,!i){var n=Math.pow(2,8*r-1);C(this,e,t,r,n-1,-n)}var o=0,a=1,s=0;for(this[t]=255&e;++o>0)-s&255;return t+r},c.prototype.writeIntBE=function(e,t,r,i){if(e=+e,t>>>=0,!i){var n=Math.pow(2,8*r-1);C(this,e,t,r,n-1,-n)}var o=r-1,a=1,s=0;for(this[t+o]=255&e;0<=--o&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+r},c.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},c.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeFloatLE=function(e,t,r){return L(this,e,t,!0,r)},c.prototype.writeFloatBE=function(e,t,r){return L(this,e,t,!1,r)},c.prototype.writeDoubleLE=function(e,t,r){return k(this,e,t,!0,r)},c.prototype.writeDoubleBE=function(e,t,r){return k(this,e,t,!1,r)},c.prototype.copy=function(e,t,r,i){if(!c.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r=r||0,i||0===i||(i=this.length),t>=e.length&&(t=e.length),t=t||0,0=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t>>=0,r=void 0===r?this.length:r>>>0,"number"==typeof(e=e||0))for(o=t;o>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function O(e){return i.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(t,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function D(e,t,r,i){for(var n=0;n=t.length||n>=e.length);++n)t[n+r]=e[n];return n}function A(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function I(e){return e!=e}var U=function(){for(var e="0123456789abcdef",t=new Array(256),r=0;r<16;++r)for(var i=16*r,n=0;n<16;++n)t[i+n]=e[r]+e[n];return t}()}).call(this,N("buffer").Buffer)},{"base64-js":19,buffer:21,ieee754:30}],22:[function(e,t,r){"use strict";t.exports=e("./").polyfill()},{"./":23}],23:[function(z,r,i){(function(j,V){var e,t;e=this,t=function(){"use strict";function l(e){return"function"==typeof e}var r=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},i=0,t=void 0,n=void 0,a=function(e,t){f[i]=e,f[i+1]=t,2===(i+=2)&&(n?n(d):y())};var e="undefined"!=typeof window?window:void 0,o=e||{},s=o.MutationObserver||o.WebKitMutationObserver,u="undefined"==typeof self&&void 0!==j&&"[object process]"==={}.toString.call(j),h="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function c(){var e=setTimeout;return function(){return e(d,1)}}var f=new Array(1e3);function d(){for(var e=0;e":">",'"':""","'":"'","/":"/"};function S(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,function(e){return w[e]}):e}var M=function(){function i(e){var t,r=1=this.maxReplaces)break}for(a=0;r=this.regexp.exec(e);){if(void 0===(i=h(r[1].trim())))if("function"==typeof c){var d=c(e,r,t);i="string"==typeof d?d:""}else this.logger.warn("missed to pass in variable ".concat(r[1]," for interpolating ").concat(e)),i="";else"string"==typeof i||this.useRawValueToEscape||(i=v(i));if(i=this.escapeValue?u(this.escape(i)):u(i),e=e.replace(r[0],i),this.regexp.lastIndex=0,++a>=this.maxReplaces)break}return e}},{key:"nest",value:function(e,t,r){var i,n,o=D({},2>1,h=-7,c=r?n-1:0,f=r?-1:1,d=e[t+c];for(c+=f,o=d&(1<<-h)-1,d>>=-h,h+=s;0>=-h,h+=i;0>1,f=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,d=i?0:o-1,p=i?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=h):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),2<=(t+=1<=a+c?f/l:f*Math.pow(2,1-c))*l&&(a++,l/=2),h<=a+c?(s=0,a=h):1<=a+c?(s=(t*l-1)*Math.pow(2,n),a+=c):(s=t*Math.pow(2,c-1)*Math.pow(2,n),a=0));8<=n;e[r+d]=255&s,d+=p,s/=256,n-=8);for(a=a<Math.abs(e[0])&&(t=1),Math.abs(e[2])>Math.abs(e[t])&&(t=2),t}var C=4e150;function P(e,t){e.f+=t.f,e.b.f+=t.b.f}function u(e,t,r){return e=e.a,t=t.a,r=r.a,t.b.a===e?r.b.a===e?v(t.a,r.a)?b(r.b.a,t.a,r.a)<=0:0<=b(t.b.a,r.a,t.a):b(r.b.a,e,r.a)<=0:r.b.a===e?0<=b(t.b.a,e,t.a):(t=y(t.b.a,e,t.a),(e=y(r.b.a,e,r.a))<=t)}function L(e){e.a.i=null;var t=e.e;t.a.c=t.c,t.c.a=t.a,e.e=null}function h(e,t){c(e.a),e.c=!1,(e.a=t).i=e}function k(e){for(var t=e.a.a;(e=fe(e)).a.a===t;);return e.c&&(h(e,t=f(ce(e).a.b,e.a.e)),e=fe(e)),e}function R(e,t,r){var i=new he;return i.a=r,i.e=W(e.f,t.e,i),r.i=i}function O(e,t){switch(e.s){case 100130:return 0!=(1&t);case 100131:return 0!==t;case 100132:return 0>1]],s[a[u]])?le(r,u):ue(r,u)),s[o]=null,l[o]=r.b,r.b=o}else for(r.c[-(o+1)]=null;0Math.max(a.a,l.a))return!1;if(v(o,a)){if(0i.f&&(i.f*=2,i.c=oe(i.c,i.f+1)),0===i.b?r=n:(r=i.b,i.b=i.c[i.b]),i.e[r]=t,i.c[r]=n,i.d[n]=r,i.h&&ue(i,n),r}return i=e.a++,e.c[i]=t,-(i+1)}function ie(e){if(0===e.a)return se(e.b);var t=e.c[e.d[e.a-1]];if(0!==e.b.a&&v(ae(e.b),t))return se(e.b);for(;--e.a,0e.a||v(i[a],i[l])){n[r[o]=a]=o;break}n[r[o]=l]=o,o=s}}function ue(e,t){for(var r=e.d,i=e.e,n=e.c,o=t,a=r[o];;){var s=o>>1,l=r[s];if(0==s||v(i[l],i[a])){n[r[o]=a]=o;break}n[r[o]=l]=o,o=s}}function he(){this.e=this.a=null,this.f=0,this.c=this.b=this.h=this.d=!1}function ce(e){return e.e.c.b}function fe(e){return e.e.a.b}(i=q.prototype).x=function(){Y(this,0)},i.B=function(e,t){switch(e){case 100142:return;case 100140:switch(t){case 100130:case 100131:case 100132:case 100133:case 100134:return void(this.s=t)}break;case 100141:return void(this.m=!!t);default:return void Z(this,100900)}Z(this,100901)},i.y=function(e){switch(e){case 100142:return 0;case 100140:return this.s;case 100141:return this.m;default:Z(this,100900)}return!1},i.A=function(e,t,r){this.j[0]=e,this.j[1]=t,this.j[2]=r},i.z=function(e,t){var r=t||null;switch(e){case 100100:case 100106:this.h=r;break;case 100104:case 100110:this.l=r;break;case 100101:case 100107:this.k=r;break;case 100102:case 100108:this.i=r;break;case 100103:case 100109:this.p=r;break;case 100105:case 100111:this.o=r;break;case 100112:this.r=r;break;default:Z(this,100900)}},i.C=function(e,t){var r=!1,i=[0,0,0];Y(this,2);for(var n=0;n<3;++n){var o=e[n];o<-1e150&&(o=-1e150,r=!0),1e150n[u]&&(n[u]=h,a[u]=l)}if(l=0,n[1]-o[1]>n[0]-o[0]&&(l=1),n[2]-o[2]>n[l]-o[l]&&(l=2),o[l]>=n[l])i[0]=0,i[1]=0,i[2]=1;else{for(n=0,o=s[l],a=a[l],s=[0,0,0],o=[o.g[0]-a.g[0],o.g[1]-a.g[1],o.g[2]-a.g[2]],u=[0,0,0],l=r.e;l!==r;l=l.e)u[0]=l.g[0]-a.g[0],u[1]=l.g[1]-a.g[1],u[2]=l.g[2]-a.g[2],s[0]=o[1]*u[2]-o[2]*u[1],s[1]=o[2]*u[0]-o[0]*u[2],s[2]=o[0]*u[1]-o[1]*u[0],n<(h=s[0]*s[0]+s[1]*s[1]+s[2]*s[2])&&(n=h,i[0]=s[0],i[1]=s[1],i[2]=s[2]);n<=0&&(i[0]=i[1]=i[2]=0,i[T(o)]=1)}r=!0}for(s=T(i),l=this.b.c,n=(s+1)%3,a=(s+2)%3,s=0>=l,h-=l,g!=o){if(g==a)break;for(var v=g>8,++y;var _=b;if(i>=8;null!==m&&s<4096&&(p[s++]=m<<8|_,u+1<=s&&l<12&&(++l,u=u<<1|1)),m=g}else s=1+a,u=(1<<(l=n+1))-1,m=null}return f!==i&&console.log("Warning, gif stream shorter than expected."),r}try{r.GifWriter=function(v,e,t,r){var y=0,i=void 0===(r=void 0===r?{}:r).loop?null:r.loop,b=void 0===r.palette?null:r.palette;if(e<=0||t<=0||65535>=1;)++n;if(a=1<>8&255,v[y++]=255&t,v[y++]=t>>8&255,v[y++]=(null!==b?128:0)|n,v[y++]=o,v[y++]=0,null!==b)for(var s=0,l=b.length;s>16&255,v[y++]=u>>8&255,v[y++]=255&u}if(null!==i){if(i<0||65535>8&255,v[y++]=0}var x=!1;this.addFrame=function(e,t,r,i,n,o){if(!0===x&&(--y,x=!1),o=void 0===o?{}:o,e<0||t<0||65535>=1;)++u;l=1<>8&255,v[y++]=d,v[y++]=0),v[y++]=44,v[y++]=255&e,v[y++]=e>>8&255,v[y++]=255&t,v[y++]=t>>8&255,v[y++]=255&r,v[y++]=r>>8&255,v[y++]=255&i,v[y++]=i>>8&255,v[y++]=!0===a?128|u-1:0,!0===a)for(var p=0,m=s.length;p>16&255,v[y++]=g>>8&255,v[y++]=255&g}return y=function(t,r,e,i){t[r++]=e;var n=r++,o=1<>=8,h-=8,r===n+256&&(t[n]=255,n=r++)}function d(e){c|=e<>=8,h-=8,r===n+256&&(t[n]=255,n=r++);4096===l?(d(o),l=1+s,u=e+1,m={}):(1<>7,n=1<<1+(7&r);x[e++],x[e++];var o=null,a=null;i&&(o=e,e+=3*(a=n));var s=!0,l=[],u=0,h=null,c=0,f=null;for(this.width=w,this.height=t;s&&e>2&7,e++;break;case 254:for(;;){if(!(0<=(C=x[e++])))throw Error("Invalid block size");if(0===C)break;e+=C}break;default:throw new Error("Unknown graphic control label: 0x"+x[e-1].toString(16))}break;case 44:var p=x[e++]|x[e++]<<8,m=x[e++]|x[e++]<<8,g=x[e++]|x[e++]<<8,v=x[e++]|x[e++]<<8,y=x[e++],b=y>>6&1,_=1<<1+(7&y),S=o,M=a,E=!1;if(y>>7){E=!0;S=e,e+=3*(M=_)}var T=e;for(e++;;){var C;if(!(0<=(C=x[e++])))throw Error("Invalid block size");if(0===C)break;e+=C}l.push({x:p,y:m,width:g,height:v,has_local_palette:E,palette_offset:S,palette_size:M,data_offset:T,data_length:e-T,transparent_index:h,interlaced:!!b,delay:u,disposal:c});break;case 59:s=!1;break;default:throw new Error("Unknown gif block: 0x"+x[e-1].toString(16))}this.numFrames=function(){return l.length},this.loopCount=function(){return f},this.frameInfo=function(e){if(e<0||e>=l.length)throw new Error("Frame index out of range.");return l[e]},this.decodeAndBlitFrameBGRA=function(e,t){var r=this.frameInfo(e),i=r.width*r.height,n=new Uint8Array(i);P(x,r.data_offset,n,i);var o=r.palette_offset,a=r.transparent_index;null===a&&(a=256);var s=r.width,l=w-s,u=s,h=4*(r.y*w+r.x),c=4*((r.y+r.height)*w+r.x),f=h,d=4*l;!0===r.interlaced&&(d+=4*w*7);for(var p=8,m=0,g=n.length;m>=1)),v===a)f+=4;else{var y=x[o+3*v],b=x[o+3*v+1],_=x[o+3*v+2];t[f++]=_,t[f++]=b,t[f++]=y,t[f++]=255}--u}},this.decodeAndBlitFrameRGBA=function(e,t){var r=this.frameInfo(e),i=r.width*r.height,n=new Uint8Array(i);P(x,r.data_offset,n,i);var o=r.palette_offset,a=r.transparent_index;null===a&&(a=256);var s=r.width,l=w-s,u=s,h=4*(r.y*w+r.x),c=4*((r.y+r.height)*w+r.x),f=h,d=4*l;!0===r.interlaced&&(d+=4*w*7);for(var p=8,m=0,g=n.length;m>=1)),v===a)f+=4;else{var y=x[o+3*v],b=x[o+3*v+1],_=x[o+3*v+2];t[f++]=y,t[f++]=b,t[f++]=_,t[f++]=255}--u}}}}catch(e){}},{}],33:[function(jr,t,r){(function(Gr){var e;e=this,function(E){"use strict";function e(e){if(null==this)throw TypeError();var t=String(this),r=t.length,i=e?Number(e):0;if(i!=i&&(i=0),!(i<0||r<=i)){var n,o=t.charCodeAt(i);return 55296<=o&&o<=56319&&i+1>>=1,t}function _(e,t,r){if(!t)return r;for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<>>16-t;return e.tag>>>=t,e.bitcount-=t,i+r}function x(e,t){for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<>>=1,++n,r+=t.table[n],0<=(i-=t.table[n]););return e.tag=o,e.bitcount-=n,t.trans[r+i]}function w(e,t,r){var i,n,o,a,s,l;for(i=_(e,5,257),n=_(e,5,1),o=_(e,4,4),a=0;a<19;++a)g[a]=0;for(a=0;athis.x2&&(this.x2=e)),"number"==typeof t&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=t,this.y2=t),tthis.y2&&(this.y2=t))},C.prototype.addX=function(e){this.addPoint(e,null)},C.prototype.addY=function(e){this.addPoint(null,e)},C.prototype.addBezier=function(e,t,r,i,n,o,a,s){var l=this,u=[e,t],h=[r,i],c=[n,o],f=[a,s];this.addPoint(e,t),this.addPoint(a,s);for(var d=0;d<=1;d++){var p=6*u[d]-12*h[d]+6*c[d],m=-3*u[d]+9*h[d]-9*c[d]+3*f[d],g=3*h[d]-3*u[d];if(0!=m){var v=Math.pow(p,2)-4*g*m;if(!(v<0)){var y=(-p+Math.sqrt(v))/(2*m);0>8&255,255&e]},A.USHORT=U(2),D.SHORT=function(e){return 32768<=e&&(e=-(65536-e)),[e>>8&255,255&e]},A.SHORT=U(2),D.UINT24=function(e){return[e>>16&255,e>>8&255,255&e]},A.UINT24=U(3),D.ULONG=function(e){return[e>>24&255,e>>16&255,e>>8&255,255&e]},A.ULONG=U(4),D.LONG=function(e){return R<=e&&(e=-(2*R-e)),[e>>24&255,e>>16&255,e>>8&255,255&e]},A.LONG=U(4),D.FIXED=D.ULONG,A.FIXED=A.ULONG,D.FWORD=D.SHORT,A.FWORD=A.SHORT,D.UFWORD=D.USHORT,A.UFWORD=A.USHORT,D.LONGDATETIME=function(e){return[0,0,0,0,e>>24&255,e>>16&255,e>>8&255,255&e]},A.LONGDATETIME=U(8),D.TAG=function(e){return k.argument(4===e.length,"Tag should be exactly 4 ASCII characters."),[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]},A.TAG=U(4),D.Card8=D.BYTE,A.Card8=A.BYTE,D.Card16=D.USHORT,A.Card16=A.USHORT,D.OffSize=D.BYTE,A.OffSize=A.BYTE,D.SID=D.USHORT,A.SID=A.USHORT,D.NUMBER=function(e){return-107<=e&&e<=107?[e+139]:108<=e&&e<=1131?[247+((e-=108)>>8),255&e]:-1131<=e&&e<=-108?[251+((e=-e-108)>>8),255&e]:-32768<=e&&e<=32767?D.NUMBER16(e):D.NUMBER32(e)},A.NUMBER=function(e){return D.NUMBER(e).length},D.NUMBER16=function(e){return[28,e>>8&255,255&e]},A.NUMBER16=U(3),D.NUMBER32=function(e){return[29,e>>24&255,e>>16&255,e>>8&255,255&e]},A.NUMBER32=U(5),D.REAL=function(e){var t=e.toString(),r=/\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec(t);if(r){var i=parseFloat("1e"+((r[2]?+r[2]:0)+r[1].length));t=(Math.round(e*i)/i).toString()}for(var n="",o=0,a=t.length;o>8&255,t[t.length]=255&i}return t},A.UTF16=function(e){return 2*e.length};var N={"x-mac-croatian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈ƫȅ ÀÃÕŒœĐ—“”‘’÷◊©⁄€‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ","x-mac-cyrillic":"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю","x-mac-gaelic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØḂ±≤≥ḃĊċḊḋḞḟĠġṀæøṁṖṗɼƒſṠ«»… ÀÃÕŒœ–—“”‘’ṡẛÿŸṪ€‹›Ŷŷṫ·Ỳỳ⁊ÂÊÁËÈÍÎÏÌÓÔ♣ÒÚÛÙıÝýŴŵẄẅẀẁẂẃ","x-mac-greek":"Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦€ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ­","x-mac-icelandic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüݰ¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-inuit":"ᐃᐄᐅᐆᐊᐋᐱᐲᐳᐴᐸᐹᑉᑎᑏᑐᑑᑕᑖᑦᑭᑮᑯᑰᑲᑳᒃᒋᒌᒍᒎᒐᒑ°ᒡᒥᒦ•¶ᒧ®©™ᒨᒪᒫᒻᓂᓃᓄᓅᓇᓈᓐᓯᓰᓱᓲᓴᓵᔅᓕᓖᓗᓘᓚᓛᓪᔨᔩᔪᔫᔭ… ᔮᔾᕕᕖᕗ–—“”‘’ᕘᕙᕚᕝᕆᕇᕈᕉᕋᕌᕐᕿᖀᖁᖂᖃᖄᖅᖏᖐᖑᖒᖓᖔᖕᙱᙲᙳᙴᙵᙶᖖᖠᖡᖢᖣᖤᖥᖦᕼŁł","x-mac-ce":"ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ",macintosh:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-romanian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂȘ∞±≤≥¥µ∂∑∏π∫ªºΩăș¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›Țț‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-turkish":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙˆ˜¯˘˙˚¸˝˛ˇ"};O.MACSTRING=function(e,t,r,i){var n=N[i];if(void 0!==n){for(var o="",a=0;a>8&255,l+256&255)}return o}D.MACSTRING=function(e,t){var r=function(e){if(!F)for(var t in F={},N)F[t]=new String(t);var r=F[e];if(void 0!==r){if(B){var i=B.get(r);if(void 0!==i)return i}var n=N[e];if(void 0!==n){for(var o={},a=0;a>8,t[c+1]=255&f,t=t.concat(i[h])}return t},A.TABLE=function(e){for(var t=0,r=e.fields.length,i=0;i>1,t.skip("uShort",3),e.glyphIndexMap={};for(var a=new se.Parser(r,i+n+14),s=new se.Parser(r,i+n+16+2*o),l=new se.Parser(r,i+n+16+4*o),u=new se.Parser(r,i+n+16+6*o),h=i+n+16+8*o,c=0;c>4,o=15&i;if(15==n)break;if(t+=r[n],15==o)break;t+=r[o]}return parseFloat(t)}(e);if(32<=t&&t<=246)return t-139;if(247<=t&&t<=250)return 256*(t-247)+e.parseByte()+108;if(251<=t&&t<=254)return 256*-(t-251)-e.parseByte()-108;throw new Error("Invalid b0 "+t)}function Te(e,t,r){t=void 0!==t?t:0;var i=new se.Parser(e,t),n=[],o=[];for(r=void 0!==r?r:e.length;i.relativeOffset>1,T.length=0,P=!0}return function e(t){for(var r,i,n,o,a,s,l,u,h,c,f,d,p=0;pMath.abs(d-R)?k=f+T.shift():R=d+T.shift(),E.curveTo(y,b,_,x,l,u),E.curveTo(h,c,f,d,k,R);break;default:console.log("Glyph "+v.index+": unknown operator 1200"+m),T.length=0}break;case 14:0>3;break;case 21:2>16),p+=2;break;case 29:a=T.pop()+g.gsubrsBias,(s=g.gsubrs[a])&&e(s);break;case 30:for(;0=r.begin&&e=fe.length){var a=i.parseChar();r.names.push(i.parseString(a))}break;case 2.5:r.numberOfGlyphs=i.parseUShort(),r.offset=new Array(r.numberOfGlyphs);for(var s=0;st.value.tag?1:-1}),t.fields=t.fields.concat(i),t.fields=t.fields.concat(n),t}function gt(e,t,r){for(var i=0;i 123 are reserved for internal usage");d|=1<>>1,o=e[n].tag;if(o===t)return n;o>>1,o=e[n];if(o===t)return n;o>>1,a=(r=e[o]).start;if(a===t)return r;a(r=e[i-1]).end?0:r}function xt(e,t){this.font=e,this.tableName=t}function wt(e){xt.call(this,e,"gpos")}function St(e){xt.call(this,e,"gsub")}function Mt(e,t){var r=e.length;if(r!==t.length)return!1;for(var i=0;it.points.length-1||i.matchedPoints[1]>n.points.length-1)throw Error("Matched points out of range in "+t.name);var a=t.points[i.matchedPoints[0]],s=n.points[i.matchedPoints[1]],l={xScale:i.xScale,scale01:i.scale01,scale10:i.scale10,yScale:i.yScale,dx:0,dy:0};s=kt([s],l)[0],l.dx=a.x-s.x,l.dy=a.y-s.y,o=kt(n.points,l)}t.points=t.points.concat(o)}}return Rt(t.points)}(wt.prototype=xt.prototype={searchTag:yt,binSearch:bt,getTable:function(e){var t=this.font.tables[this.tableName];return!t&&e&&(t=this.font.tables[this.tableName]=this.createDefaultTable()),t},getScriptNames:function(){var e=this.getTable();return e?e.scripts.map(function(e){return e.tag}):[]},getDefaultScriptName:function(){var e=this.getTable();if(e){for(var t=!1,r=0;r=s[u-1].tag,"Features must be added in alphabetical order."),o={tag:r,feature:{params:0,lookupListIndexes:[]}},s.push(o),a.push(u),o.feature}}},getLookupTables:function(e,t,r,i,n){var o=this.getFeatureTable(e,t,r,n),a=[];if(o){for(var s,l=o.lookupListIndexes,u=this.font.tables[this.tableName].lookups,h=0;h",s),t.stack.push(Math.round(64*s))}function vr(e,t){var r=t.stack,i=r.pop(),n=t.fv,o=t.pv,a=t.ppem,s=t.deltaBase+16*(e-1),l=t.deltaShift,u=t.z0;E.DEBUG&&console.log(t.step,"DELTAP["+e+"]",i,r);for(var h=0;h>4)===a){var d=(15&f)-8;0<=d&&d++,E.DEBUG&&console.log(t.step,"DELTAPFIX",c,"by",d*l);var p=u[c];n.setRelative(p,p,d*l,o)}}}function yr(e,t){var r=t.stack,i=r.pop();E.DEBUG&&console.log(t.step,"ROUND[]"),r.push(64*t.round(i/64))}function br(e,t){var r=t.stack,i=r.pop(),n=t.ppem,o=t.deltaBase+16*(e-1),a=t.deltaShift;E.DEBUG&&console.log(t.step,"DELTAC["+e+"]",i,r);for(var s=0;s>4)===n){var h=(15&u)-8;0<=h&&h++;var c=h*a;E.DEBUG&&console.log(t.step,"DELTACFIX",l,"by",c),t.cvt[l]+=c}}}function _r(e,t){var r,i,n=t.stack,o=n.pop(),a=n.pop(),s=t.z2[o],l=t.z1[a];E.DEBUG&&console.log(t.step,"SDPVTL["+e+"]",o,a),i=e?(r=s.y-l.y,l.x-s.x):(r=l.x-s.x,l.y-s.y),t.dpv=Zt(r,i)}function xr(e,t){var r=t.stack,i=t.prog,n=t.ip;E.DEBUG&&console.log(t.step,"PUSHB["+e+"]");for(var o=0;o":"_")+(i?"R":"_")+(0===n?"Gr":1===n?"Bl":2===n?"Wh":"")+"]",e?c+"("+o.cvt[c]+","+u+")":"",f,"(d =",a,"->",l*s,")"),o.rp1=o.rp0,o.rp2=f,t&&(o.rp0=f)}Ft.prototype.exec=function(e,t){if("number"!=typeof t)throw new Error("Point size is not a number!");if(!(2",i),s.interpolate(c,o,a,l),s.touch(c)}e.loop=1},dr.bind(void 0,0),dr.bind(void 0,1),function(e){for(var t=e.stack,r=e.rp0,i=e.z0[r],n=e.loop,o=e.fv,a=e.pv,s=e.z1;n--;){var l=t.pop(),u=s[l];E.DEBUG&&console.log(e.step,(1=a.width||t>=a.height?[0,0,0,0]:this._getPixel(e,t);var s=new l.default.Image(r,i);return s.canvas.getContext("2d").drawImage(a,e,t,r*o,i*o,0,0,r,i),s},l.default.Renderer.prototype.textLeading=function(e){return"number"==typeof e?(this._setProperty("_textLeading",e),this._pInst):this._textLeading},l.default.Renderer.prototype.textSize=function(e){return"number"==typeof e?(this._setProperty("_textSize",e),this._setProperty("_textLeading",e*y._DEFAULT_LEADMULT),this._applyTextProperties()):this._textSize},l.default.Renderer.prototype.textStyle=function(e){return e?(e!==y.NORMAL&&e!==y.ITALIC&&e!==y.BOLD&&e!==y.BOLDITALIC||this._setProperty("_textStyle",e),this._applyTextProperties()):this._textStyle},l.default.Renderer.prototype.textAscent=function(){return null===this._textAscent&&this._updateTextMetrics(),this._textAscent},l.default.Renderer.prototype.textDescent=function(){return null===this._textDescent&&this._updateTextMetrics(),this._textDescent},l.default.Renderer.prototype.textAlign=function(e,t){return void 0!==e?(this._setProperty("_textAlign",e),void 0!==t&&this._setProperty("_textBaseline",t),this._applyTextProperties()):{horizontal:this._textAlign,vertical:this._textBaseline}},l.default.Renderer.prototype.text=function(e,t,r,i,n){var o,a,s,l,u,h,c,f,d=this._pInst,p=Number.MAX_VALUE;if((this._doFill||this._doStroke)&&void 0!==e){if("string"!=typeof e&&(e=e.toString()),o=(e=e.replace(/(\t)/g," ")).split("\n"),void 0!==i){for(s=f=0;ss.HALF_PI&&e<=3*s.HALF_PI?Math.atan(r/i*Math.tan(e))+s.PI:Math.atan(r/i*Math.tan(e))+s.TWO_PI,t=t<=s.HALF_PI?Math.atan(r/i*Math.tan(t)):t>s.HALF_PI&&t<=3*s.HALF_PI?Math.atan(r/i*Math.tan(t))+s.PI:Math.atan(r/i*Math.tan(t))+s.TWO_PI),tv||Math.abs(this.accelerationY-this.pAccelerationY)>v||Math.abs(this.accelerationZ-this.pAccelerationZ)>v)&&e();var t=this.deviceTurned||window.deviceTurned;if("function"==typeof t){var r=this.rotationX+180,i=this.pRotationX+180,n=c+180;0>>24],i+=x[(16711680&C)>>16],n+=x[(65280&C)>>8],o+=x[255&C],r+=k[_],s++}w[l=T+y]=a/r,S[l]=i/r,M[l]=n/r,E[l]=o/r}T+=d}for(h=(u=-P)*d,b=T=0;b>>16,e[r+1]=(65280&t[i])>>>8,e[r+2]=255&t[i],e[r+3]=(4278190080&t[i])>>>24},O._toImageData=function(e){return e instanceof ImageData?e:e.getContext("2d").getImageData(0,0,e.width,e.height)},O._createImageData=function(e,t){return O._tmpCanvas=document.createElement("canvas"),O._tmpCtx=O._tmpCanvas.getContext("2d"),this._tmpCtx.createImageData(e,t)},O.apply=function(e,t,r){var i=e.getContext("2d"),n=i.getImageData(0,0,e.width,e.height),o=t(n,r);o instanceof ImageData?i.putImageData(o,0,0,0,0,e.width,e.height):i.putImageData(n,0,0,0,0,e.width,e.height)},O.threshold=function(e,t){var r=O._toPixels(e);void 0===t&&(t=.5);for(var i=Math.floor(255*t),n=0;n>8)/i,r[n+1]=255*(a*t>>8)/i,r[n+2]=255*(s*t>>8)/i}},O.dilate=function(e){for(var t,r,i,n,o,a,s,l,u,h,c,f,d,p,m,g,v,y=O._toPixels(e),b=0,_=y.length?y.length/4:0,x=new Int32Array(_);b<_;)for(r=(t=b)+e.width;b>16&255)+151*(i>>8&255)+28*(255&i))<(m=77*(c>>16&255)+151*(c>>8&255)+28*(255&c))&&(n=c,o=m),o<(p=77*((h=O._getARGB(y,a))>>16&255)+151*(h>>8&255)+28*(255&h))&&(n=h,o=p),o<(g=77*(f>>16&255)+151*(f>>8&255)+28*(255&f))&&(n=f,o=g),o<(v=77*(d>>16&255)+151*(d>>8&255)+28*(255&d))&&(n=d,o=v),x[b++]=n;O._setPixels(y,x)},O.erode=function(e){for(var t,r,i,n,o,a,s,l,u,h,c,f,d,p,m,g,v,y=O._toPixels(e),b=0,_=y.length?y.length/4:0,x=new Int32Array(_);b<_;)for(r=(t=b)+e.width;b>16&255)+151*(c>>8&255)+28*(255&c))<(o=77*(i>>16&255)+151*(i>>8&255)+28*(255&i))&&(n=c,o=m),(p=77*((h=O._getARGB(y,a))>>16&255)+151*(h>>8&255)+28*(255&h))>16&255)+151*(f>>8&255)+28*(255&f))>16&255)+151*(d>>8&255)+28*(255&d))=r){var i=Math.floor(t.timeDisplayed/r);if(t.timeDisplayed=0,t.displayIndex+=i,t.loopCount=Math.floor(t.displayIndex/t.numFrames),null!==t.loopLimit&&t.loopCount>=t.loopLimit)t.playing=!1;else{var n=t.displayIndex%t.numFrames;this.drawingContext.putImageData(t.frames[n].image,0,0),t.displayIndex=n,this.setModified(!0)}}}},n.default.Image.prototype._setProperty=function(e,t){this[e]=t,this.setModified(!0)},n.default.Image.prototype.loadPixels=function(){n.default.Renderer2D.prototype.loadPixels.call(this),this.setModified(!0)},n.default.Image.prototype.updatePixels=function(e,t,r,i){n.default.Renderer2D.prototype.updatePixels.call(this,e,t,r,i),this.setModified(!0)},n.default.Image.prototype.get=function(e,t,r,i){return n.default._validateParameters("p5.Image.get",arguments),n.default.Renderer2D.prototype.get.apply(this,arguments)},n.default.Image.prototype._getPixel=n.default.Renderer2D.prototype._getPixel,n.default.Image.prototype.set=function(e,t,r){n.default.Renderer2D.prototype.set.call(this,e,t,r),this.setModified(!0)},n.default.Image.prototype.resize=function(e,t){0===e&&0===t?(e=this.canvas.width,t=this.canvas.height):0===e?e=this.canvas.width*t/this.canvas.height:0===t&&(t=this.canvas.height*e/this.canvas.width),e=Math.floor(e),t=Math.floor(t);var r=document.createElement("canvas");if(r.width=e,r.height=t,this.gifProperties)for(var i=this.gifProperties,n=function(e,t){for(var r=0,i=0;i/g,">").replace(/"/g,""").replace(/'/g,"'")}function l(e,t){t&&!0!==t&&"true"!==t||(t="");var r="";return(e=e||"untitled")&&e.includes(".")&&(r=e.split(".").pop()),t&&r!==t&&(r=t,e="".concat(e,".").concat(r)),[e,r]}e("../core/error_helpers"),v.default.prototype.loadJSON=function(){for(var e=arguments.length,t=new Array(e),r=0;r"),n.print("");if(n.print(' '),n.print(""),n.print(""),n.print(" "),"0"!==o[0]){n.print(" ");for(var h=0;h".concat(c)),n.print(" ")}n.print(" ")}for(var f=0;f");for(var d=0;d".concat(p)),n.print(" ")}n.print(" ")}n.print("
"),n.print(""),n.print("")}n.close(),n.clear()},v.default.prototype.writeFile=function(e,t,r){var i="application/octet-stream";v.default.prototype._isSafari()&&(i="text/plain");var n=new Blob(e,{type:i});v.default.prototype.downloadFile(n,t,r)},v.default.prototype.downloadFile=function(e,t,r){var i=l(t,r),n=i[0];if(e instanceof Blob)s.default.saveAs(e,n);else{var o=document.createElement("a");if(o.href=e,o.download=n,o.onclick=function(e){var t;t=e,document.body.removeChild(t.target),e.stopPropagation()},o.style.display="none",document.body.appendChild(o),v.default.prototype._isSafari()){var a="Hello, Safari user! To download this file...\n";a+="1. Go to File --\x3e Save As.\n",a+='2. Choose "Page Source" as the Format.\n',a+='3. Name it with this extension: ."'.concat(i[1],'"'),alert(a)}o.click()}},v.default.prototype._checkFileExtension=l,v.default.prototype._isSafari=function(){return 0>>0},getSeed:function(){return t},rand:function(){return(r=(1664525*r+1013904223)%i)/i}});n.setSeed(e),_=new Array(4096);for(var o=0;o<4096;o++)_[o]=n.rand()};var o=n.default;r.default=o},{"../core/main":49}],82:[function(e,t,r){"use strict";function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i,l=(i=e("../core/main"))&&i.__esModule?i:{default:i},o=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==a(e)&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var o=i?Object.getOwnPropertyDescriptor(e,n):null;o&&(o.get||o.set)?Object.defineProperty(r,n,o):r[n]=e[n]}r.default=e,t&&t.set(e,r);return r}(e("../core/constants"));function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}l.default.Vector=function(e,t,r){var i,n,o;o=e instanceof l.default?(this.p5=e,i=t[0]||0,n=t[1]||0,t[2]||0):(i=e||0,n=t||0,r||0),this.x=i,this.y=n,this.z=o},l.default.Vector.prototype.toString=function(){return"p5.Vector Object : [".concat(this.x,", ").concat(this.y,", ").concat(this.z,"]")},l.default.Vector.prototype.set=function(e,t,r){return e instanceof l.default.Vector?(this.x=e.x||0,this.y=e.y||0,this.z=e.z||0):e instanceof Array?(this.x=e[0]||0,this.y=e[1]||0,this.z=e[2]||0):(this.x=e||0,this.y=t||0,this.z=r||0),this},l.default.Vector.prototype.copy=function(){return this.p5?new l.default.Vector(this.p5,[this.x,this.y,this.z]):new l.default.Vector(this.x,this.y,this.z)},l.default.Vector.prototype.add=function(e,t,r){return e instanceof l.default.Vector?(this.x+=e.x||0,this.y+=e.y||0,this.z+=e.z||0):e instanceof Array?(this.x+=e[0]||0,this.y+=e[1]||0,this.z+=e[2]||0):(this.x+=e||0,this.y+=t||0,this.z+=r||0),this};function u(e,t){return 0!==e&&(this.x=this.x%e),0!==t&&(this.y=this.y%t),this}function h(e,t,r){return 0!==e&&(this.x=this.x%e),0!==t&&(this.y=this.y%t),0!==r&&(this.z=this.z%r),this}l.default.Vector.prototype.rem=function(e,t,r){if(e instanceof l.default.Vector){if(Number.isFinite(e.x)&&Number.isFinite(e.y)&&Number.isFinite(e.z)){var i=parseFloat(e.x),n=parseFloat(e.y),o=parseFloat(e.z);h.call(this,i,n,o)}}else if(e instanceof Array)e.every(function(e){return Number.isFinite(e)})&&(2===e.length&&u.call(this,e[0],e[1]),3===e.length&&h.call(this,e[0],e[1],e[2]));else if(1===arguments.length){if(Number.isFinite(e)&&0!==e)return this.x=this.x%e,this.y=this.y%e,this.z=this.z%e,this}else if(2===arguments.length){var a=Array.prototype.slice.call(arguments);a.every(function(e){return Number.isFinite(e)})&&2===a.length&&u.call(this,a[0],a[1])}else if(3===arguments.length){var s=Array.prototype.slice.call(arguments);s.every(function(e){return Number.isFinite(e)})&&3===s.length&&h.call(this,s[0],s[1],s[2])}},l.default.Vector.prototype.sub=function(e,t,r){return e instanceof l.default.Vector?(this.x-=e.x||0,this.y-=e.y||0,this.z-=e.z||0):e instanceof Array?(this.x-=e[0]||0,this.y-=e[1]||0,this.z-=e[2]||0):(this.x-=e||0,this.y-=t||0,this.z-=r||0),this},l.default.Vector.prototype.mult=function(e){return"number"==typeof e&&isFinite(e)?(this.x*=e,this.y*=e,this.z*=e):console.warn("p5.Vector.prototype.mult:","n is undefined or not a finite number"),this},l.default.Vector.prototype.div=function(e){return"number"==typeof e&&isFinite(e)?0===e?console.warn("p5.Vector.prototype.div:","divide by 0"):(this.x/=e,this.y/=e,this.z/=e):console.warn("p5.Vector.prototype.div:","n is undefined or not a finite number"),this},l.default.Vector.prototype.mag=function(){return Math.sqrt(this.magSq())},l.default.Vector.prototype.magSq=function(){var e=this.x,t=this.y,r=this.z;return e*e+t*t+r*r},l.default.Vector.prototype.dot=function(e,t,r){return e instanceof l.default.Vector?this.dot(e.x,e.y,e.z):this.x*(e||0)+this.y*(t||0)+this.z*(r||0)},l.default.Vector.prototype.cross=function(e){var t=this.y*e.z-this.z*e.y,r=this.z*e.x-this.x*e.z,i=this.x*e.y-this.y*e.x;return this.p5?new l.default.Vector(this.p5,[t,r,i]):new l.default.Vector(t,r,i)},l.default.Vector.prototype.dist=function(e){return e.copy().sub(this).mag()},l.default.Vector.prototype.normalize=function(){var e=this.mag();return 0!==e&&this.mult(1/e),this},l.default.Vector.prototype.limit=function(e){var t=this.magSq();return e*e>>0},n.default.prototype.randomSeed=function(e){this._lcgSetSeed(o,e),this._gaussian_previous=!1},n.default.prototype.random=function(e,t){var r;if(n.default._validateParameters("random",arguments),r=null!=this[o]?this._lcg(o):Math.random(),void 0===e)return r;if(void 0===t)return e instanceof Array?e[Math.floor(r*e.length)]:r*e;if(tf){var P=p,L=l,k=u;p=d+f*(s&&d=t&&(r=r.substring(r.length-t,r.length)),r}},n.default.prototype.unhex=function(e){return e instanceof Array?e.map(n.default.prototype.unhex):parseInt("0x".concat(e),16)};var o=n.default;r.default=o},{"../core/main":49}],90:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i,a=(i=e("../core/main"))&&i.__esModule?i:{default:i};function n(e,t,r){var i=e<0,n=i?e.toString().substring(1):e.toString(),o=n.indexOf("."),a=-1!==o?n.substring(0,o):n,s=-1!==o?n.substring(o+1):"",l=i?"-":"";if(void 0!==r){var u="";(-1!==o||0r&&(s=s.substring(0,r));for(var h=0;hi.length)for(var o=t-(i+=-1===r?".":"").length+1,a=0;a=d.TWO_PI?"".concat("ellipse","|").concat(u,"|"):"".concat("arc","|").concat(a,"|").concat(s,"|").concat(l,"|").concat(u,"|"),!this.geometryInHash(t)){var h=new T.default.Geometry(u,1,function(){if(this.strokeIndices=[],a.toFixed(10)!==s.toFixed(10)){l!==d.PIE&&void 0!==l||(this.vertices.push(new T.default.Vector(.5,.5,0)),this.uvs.push([.5,.5]));for(var e=0;e<=u;e++){var t=(s-a)*(e/u)+a,r=.5+Math.cos(t)/2,i=.5+Math.sin(t)/2;this.vertices.push(new T.default.Vector(r,i,0)),this.uvs.push([r,i]),e>5&31)/31,(y>>10&31)/31):(r=a,i=s,l)}for(var b=1;b<=3;b++){var _=p+12*b,x=new S.default.Vector(u.getFloat32(_,!0),u.getFloat32(8+_,!0),u.getFloat32(4+_,!0));e.vertices.push(x),c&&o.push(r,i,n)}var w=new S.default.Vector(m,g,v);e.vertexNormals.push(w,w,w),e.faces.push([3*d,3*d+1,3*d+2]),e.uvs.push([0,0],[0,0],[0,0])}}(e,t);else{var r=new DataView(t);if(!("TextDecoder"in window))return console.warn("Sorry, ASCII STL loading only works in browsers that support TextDecoder (https://caniuse.com/#feat=textencoder)");var i=new TextDecoder("utf-8").decode(r).split("\n");!function(e,t){for(var r,i,n="",o=[],a=0;aMath.PI?l=Math.PI:l<=0&&(l=.001);var u=Math.sin(l)*a*Math.sin(s),h=Math.cos(l)*a,c=Math.sin(l)*a*Math.cos(s);this.camera(u+this.centerX,h+this.centerY,c+this.centerZ,this.centerX,this.centerY,this.centerZ,0,1,0)},m.default.Camera.prototype._isActive=function(){return this===this._renderer._curCamera},m.default.prototype.setCamera=function(e){this._renderer._curCamera=e,this._renderer.uPMatrix.set(e.projMatrix.mat4[0],e.projMatrix.mat4[1],e.projMatrix.mat4[2],e.projMatrix.mat4[3],e.projMatrix.mat4[4],e.projMatrix.mat4[5],e.projMatrix.mat4[6],e.projMatrix.mat4[7],e.projMatrix.mat4[8],e.projMatrix.mat4[9],e.projMatrix.mat4[10],e.projMatrix.mat4[11],e.projMatrix.mat4[12],e.projMatrix.mat4[13],e.projMatrix.mat4[14],e.projMatrix.mat4[15])};var n=m.default.Camera;r.default=n},{"../core/main":49}],98:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i,h=(i=e("../core/main"))&&i.__esModule?i:{default:i};h.default.Geometry=function(e,t,r){return this.vertices=[],this.lineVertices=[],this.lineNormals=[],this.vertexNormals=[],this.faces=[],this.uvs=[],this.edges=[],this.vertexColors=[],this.detailX=void 0!==e?e:1,this.detailY=void 0!==t?t:1,this.dirtyFlags={},r instanceof Function&&r.call(this),this},h.default.Geometry.prototype.reset=function(){this.lineVertices.length=0,this.lineNormals.length=0,this.vertices.length=0,this.edges.length=0,this.vertexColors.length=0,this.vertexNormals.length=0,this.uvs.length=0,this.dirtyFlags={}},h.default.Geometry.prototype.computeFaces=function(){this.faces.length=0;for(var e,t,r,i,n=this.detailX+1,o=0;othis.vertices.length-1-this.detailX;i--)e.add(this.vertexNormals[i]);e=h.default.Vector.div(e,this.detailX);for(var n=this.vertices.length-1;n>this.vertices.length-1-this.detailX;n--)this.vertexNormals[n]=e;return this},h.default.Geometry.prototype._makeTriangleEdges=function(){if(this.edges.length=0,Array.isArray(this.strokeIndices))for(var e=0,t=this.strokeIndices.length;e vTexCoord.y;\n bool y1 = p1.y > vTexCoord.y;\n bool y2 = p2.y > vTexCoord.y;\n\n // could web be under the curve (after t1)?\n if (y1 ? !y2 : y0) {\n // add the coverage for t1\n coverage.x += saturate(C1.x + 0.5);\n // calculate the anti-aliasing for t1\n weight.x = min(weight.x, abs(C1.x));\n }\n\n // are we outside the curve (after t2)?\n if (y1 ? !y0 : y2) {\n // subtract the coverage for t2\n coverage.x -= saturate(C2.x + 0.5);\n // calculate the anti-aliasing for t2\n weight.x = min(weight.x, abs(C2.x));\n }\n}\n\n// this is essentially the same as coverageX, but with the axes swapped\nvoid coverageY(vec2 p0, vec2 p1, vec2 p2) {\n\n vec2 C1, C2;\n calulateCrossings(p0, p1, p2, C1, C2);\n\n bool x0 = p0.x > vTexCoord.x;\n bool x1 = p1.x > vTexCoord.x;\n bool x2 = p2.x > vTexCoord.x;\n\n if (x1 ? !x2 : x0) {\n coverage.y -= saturate(C1.y + 0.5);\n weight.y = min(weight.y, abs(C1.y));\n }\n\n if (x1 ? !x0 : x2) {\n coverage.y += saturate(C2.y + 0.5);\n weight.y = min(weight.y, abs(C2.y));\n }\n}\n\nvoid main() {\n\n // calculate the pixel scale based on screen-coordinates\n pixelScale = hardness / fwidth(vTexCoord);\n\n // which grid cell is this pixel in?\n ivec2 gridCoord = ifloor(vTexCoord * vec2(uGridSize));\n\n // intersect curves in this row\n {\n // the index into the row info bitmap\n int rowIndex = gridCoord.y + uGridOffset.y;\n // fetch the info texel\n vec4 rowInfo = getTexel(uSamplerRows, rowIndex, uGridImageSize);\n // unpack the rowInfo\n int rowStrokeIndex = getInt16(rowInfo.xy);\n int rowStrokeCount = getInt16(rowInfo.zw);\n\n for (int iRowStroke = INT(0); iRowStroke < N; iRowStroke++) {\n if (iRowStroke >= rowStrokeCount)\n break;\n\n // each stroke is made up of 3 points: the start and control point\n // and the start of the next curve.\n // fetch the indices of this pair of strokes:\n vec4 strokeIndices = getTexel(uSamplerRowStrokes, rowStrokeIndex++, uCellsImageSize);\n\n // unpack the stroke index\n int strokePos = getInt16(strokeIndices.xy);\n\n // fetch the two strokes\n vec4 stroke0 = getTexel(uSamplerStrokes, strokePos + INT(0), uStrokeImageSize);\n vec4 stroke1 = getTexel(uSamplerStrokes, strokePos + INT(1), uStrokeImageSize);\n\n // calculate the coverage\n coverageX(stroke0.xy, stroke0.zw, stroke1.xy);\n }\n }\n\n // intersect curves in this column\n {\n int colIndex = gridCoord.x + uGridOffset.x;\n vec4 colInfo = getTexel(uSamplerCols, colIndex, uGridImageSize);\n int colStrokeIndex = getInt16(colInfo.xy);\n int colStrokeCount = getInt16(colInfo.zw);\n \n for (int iColStroke = INT(0); iColStroke < N; iColStroke++) {\n if (iColStroke >= colStrokeCount)\n break;\n\n vec4 strokeIndices = getTexel(uSamplerColStrokes, colStrokeIndex++, uCellsImageSize);\n\n int strokePos = getInt16(strokeIndices.xy);\n vec4 stroke0 = getTexel(uSamplerStrokes, strokePos + INT(0), uStrokeImageSize);\n vec4 stroke1 = getTexel(uSamplerStrokes, strokePos + INT(1), uStrokeImageSize);\n coverageY(stroke0.xy, stroke0.zw, stroke1.xy);\n }\n }\n\n weight = saturate(1.0 - weight * 2.0);\n float distance = max(weight.x + weight.y, minDistance); // manhattan approx.\n float antialias = abs(dot(coverage, weight) / distance);\n float cover = min(abs(coverage.x), abs(coverage.y));\n gl_FragColor = uMaterialColor;\n gl_FragColor.a *= saturate(max(antialias, cover));\n}",lineVert:"/*\n Part of the Processing project - http://processing.org\n Copyright (c) 2012-15 The Processing Foundation\n Copyright (c) 2004-12 Ben Fry and Casey Reas\n Copyright (c) 2001-04 Massachusetts Institute of Technology\n This library is free software; you can redistribute it and/or\n modify it under the terms of the GNU Lesser General Public\n License as published by the Free Software Foundation, version 2.1.\n This library is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n Lesser General Public License for more details.\n You should have received a copy of the GNU Lesser General\n Public License along with this library; if not, write to the\n Free Software Foundation, Inc., 59 Temple Place, Suite 330,\n Boston, MA 02111-1307 USA\n*/\n\n#define PROCESSING_LINE_SHADER\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform float uStrokeWeight;\n\nuniform vec4 uViewport;\nuniform int uPerspective;\n\nattribute vec4 aPosition;\nattribute vec4 aDirection;\n \nvoid main() {\n // using a scale <1 moves the lines towards the camera\n // in order to prevent popping effects due to half of\n // the line disappearing behind the geometry faces.\n vec3 scale = vec3(0.9995);\n\n vec4 posp = uModelViewMatrix * aPosition;\n vec4 posq = uModelViewMatrix * (aPosition + vec4(aDirection.xyz, 0));\n\n // Moving vertices slightly toward the camera\n // to avoid depth-fighting with the fill triangles.\n // Discussed here:\n // http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Number=252848 \n posp.xyz = posp.xyz * scale;\n posq.xyz = posq.xyz * scale;\n\n vec4 p = uProjectionMatrix * posp;\n vec4 q = uProjectionMatrix * posq;\n\n // formula to convert from clip space (range -1..1) to screen space (range 0..[width or height])\n // screen_p = (p.xy/p.w + <1,1>) * 0.5 * uViewport.zw\n\n // prevent division by W by transforming the tangent formula (div by 0 causes\n // the line to disappear, see https://github.com/processing/processing/issues/5183)\n // t = screen_q - screen_p\n //\n // tangent is normalized and we don't care which aDirection it points to (+-)\n // t = +- normalize( screen_q - screen_p )\n // t = +- normalize( (q.xy/q.w+<1,1>)*0.5*uViewport.zw - (p.xy/p.w+<1,1>)*0.5*uViewport.zw )\n //\n // extract common factor, <1,1> - <1,1> cancels out\n // t = +- normalize( (q.xy/q.w - p.xy/p.w) * 0.5 * uViewport.zw )\n //\n // convert to common divisor\n // t = +- normalize( ((q.xy*p.w - p.xy*q.w) / (p.w*q.w)) * 0.5 * uViewport.zw )\n //\n // remove the common scalar divisor/factor, not needed due to normalize and +-\n // (keep uViewport - can't remove because it has different components for x and y\n // and corrects for aspect ratio, see https://github.com/processing/processing/issues/5181)\n // t = +- normalize( (q.xy*p.w - p.xy*q.w) * uViewport.zw )\n\n vec2 tangent = normalize((q.xy*p.w - p.xy*q.w) * uViewport.zw);\n\n // flip tangent to normal (it's already normalized)\n vec2 normal = vec2(-tangent.y, tangent.x);\n\n float thickness = aDirection.w * uStrokeWeight;\n vec2 offset = normal * thickness / 2.0;\n\n vec2 curPerspScale;\n\n if(uPerspective == 1) {\n // Perspective ---\n // convert from world to clip by multiplying with projection scaling factor\n // to get the right thickness (see https://github.com/processing/processing/issues/5182)\n // invert Y, projections in Processing invert Y\n curPerspScale = (uProjectionMatrix * vec4(1, -1, 0, 0)).xy;\n } else {\n // No Perspective ---\n // multiply by W (to cancel out division by W later in the pipeline) and\n // convert from screen to clip (derived from clip to screen above)\n curPerspScale = p.w / (0.5 * uViewport.zw);\n }\n\n gl_Position.xy = p.xy + offset.xy * curPerspScale;\n gl_Position.zw = p.zw;\n}\n",lineFrag:"precision mediump float;\nprecision mediump int;\n\nuniform vec4 uMaterialColor;\n\nvoid main() {\n gl_FragColor = uMaterialColor;\n}",pointVert:"attribute vec3 aPosition;\nuniform float uPointSize;\nvarying float vStrokeWeight;\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nvoid main() {\n\tvec4 positionVec4 = vec4(aPosition, 1.0);\n\tgl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n\tgl_PointSize = uPointSize;\n\tvStrokeWeight = uPointSize;\n}",pointFrag:"precision mediump float;\nprecision mediump int;\nuniform vec4 uMaterialColor;\nvarying float vStrokeWeight;\n\nvoid main(){\n\tfloat mask = 0.0;\n\n\t// make a circular mask using the gl_PointCoord (goes from 0 - 1 on a point)\n // might be able to get a nicer edge on big strokeweights with smoothstep but slightly less performant\n\n\tmask = step(0.98, length(gl_PointCoord * 2.0 - 1.0));\n\n\t// if strokeWeight is 1 or less lets just draw a square\n\t// this prevents weird artifacting from carving circles when our points are really small\n\t// if strokeWeight is larger than 1, we just use it as is\n\n\tmask = mix(0.0, mask, clamp(floor(vStrokeWeight - 0.5),0.0,1.0));\n\n\t// throw away the borders of the mask\n // otherwise we get weird alpha blending issues\n\n\tif(mask > 0.98){\n discard;\n \t}\n\n \tgl_FragColor = vec4(uMaterialColor.rgb * (1.0 - mask), uMaterialColor.a) ;\n}"};u.default.RendererGL=function(e,t,r,i){return u.default.Renderer.call(this,e,t,r),this._setAttributeDefaults(t),this._initContext(),this.isP3D=!0,this.GL=this.drawingContext,this._isErasing=!1,this._enableLighting=!1,this.ambientLightColors=[],this.specularColors=[1,1,1],this.directionalLightDirections=[],this.directionalLightDiffuseColors=[],this.directionalLightSpecularColors=[],this.pointLightPositions=[],this.pointLightDiffuseColors=[],this.pointLightSpecularColors=[],this.spotLightPositions=[],this.spotLightDirections=[],this.spotLightDiffuseColors=[],this.spotLightSpecularColors=[],this.spotLightAngle=[],this.spotLightConc=[],this.drawMode=o.FILL,this.curFillColor=this._cachedFillStyle=[1,1,1,1],this.curStrokeColor=this._cachedStrokeStyle=[0,0,0,1],this.curBlendMode=o.BLEND,this._cachedBlendMode=void 0,this.blendExt=this.GL.getExtension("EXT_blend_minmax"),this._isBlending=!1,this._useSpecularMaterial=!1,this._useEmissiveMaterial=!1,this._useNormalMaterial=!1,this._useShininess=1,this._tint=[255,255,255,255],this.constantAttenuation=1,this.linearAttenuation=0,this.quadraticAttenuation=0,this.uMVMatrix=new u.default.Matrix,this.uPMatrix=new u.default.Matrix,this.uNMatrix=new u.default.Matrix("mat3"),this._curCamera=new u.default.Camera(this),this._curCamera._computeCameraDefaultSettings(),this._curCamera._setDefaultCamera(),this._defaultLightShader=void 0,this._defaultImmediateModeShader=void 0,this._defaultNormalShader=void 0,this._defaultColorShader=void 0,this._defaultPointShader=void 0,this.userFillShader=void 0,this.userStrokeShader=void 0,this.userPointShader=void 0,this.retainedMode={geometry:{},buffers:{stroke:[new u.default.RenderBuffer(3,"lineVertices","lineVertexBuffer","aPosition",this,this._flatten),new u.default.RenderBuffer(4,"lineNormals","lineNormalBuffer","aDirection",this,this._flatten)],fill:[new u.default.RenderBuffer(3,"vertices","vertexBuffer","aPosition",this,this._vToNArray),new u.default.RenderBuffer(3,"vertexNormals","normalBuffer","aNormal",this,this._vToNArray),new u.default.RenderBuffer(4,"vertexColors","colorBuffer","aMaterialColor",this),new u.default.RenderBuffer(3,"vertexAmbients","ambientBuffer","aAmbientColor",this),new u.default.RenderBuffer(2,"uvs","uvBuffer","aTexCoord",this,this._flatten)],text:[new u.default.RenderBuffer(3,"vertices","vertexBuffer","aPosition",this,this._vToNArray),new u.default.RenderBuffer(2,"uvs","uvBuffer","aTexCoord",this,this._flatten)]}},this.immediateMode={geometry:new u.default.Geometry,shapeMode:o.TRIANGLE_FAN,_bezierVertex:[],_quadraticVertex:[],_curveVertex:[],buffers:{fill:[new u.default.RenderBuffer(3,"vertices","vertexBuffer","aPosition",this,this._vToNArray),new u.default.RenderBuffer(3,"vertexNormals","normalBuffer","aNormal",this,this._vToNArray),new u.default.RenderBuffer(4,"vertexColors","colorBuffer","aVertexColor",this),new u.default.RenderBuffer(3,"vertexAmbients","ambientBuffer","aAmbientColor",this),new u.default.RenderBuffer(2,"uvs","uvBuffer","aTexCoord",this,this._flatten)],stroke:[new u.default.RenderBuffer(3,"lineVertices","lineVertexBuffer","aPosition",this,this._flatten),new u.default.RenderBuffer(4,"lineNormals","lineNormalBuffer","aDirection",this,this._flatten)],point:this.GL.createBuffer()}},this.pointSize=5,this.curStrokeWeight=1,this.textures=[],this.textureMode=o.IMAGE,this.textureWrapX=o.CLAMP,this.textureWrapY=o.CLAMP,this._tex=null,this._curveTightness=6,this._lookUpTableBezier=[],this._lookUpTableQuadratic=[],this._lutBezierDetail=0,this._lutQuadraticDetail=0,this._tessy=this._initTessy(),this.fontInfos={},this._curShader=void 0,this},u.default.RendererGL.prototype=Object.create(u.default.Renderer.prototype),u.default.RendererGL.prototype._setAttributeDefaults=function(e){var t={alpha:!0,depth:!0,stencil:!0,antialias:navigator.userAgent.toLowerCase().includes("safari"),premultipliedAlpha:!1,preserveDrawingBuffer:!0,perPixelLighting:!0};null===e._glAttributes?e._glAttributes=t:e._glAttributes=Object.assign(t,e._glAttributes)},u.default.RendererGL.prototype._initContext=function(){try{if(this.drawingContext=this.canvas.getContext("webgl",this._pInst._glAttributes)||this.canvas.getContext("experimental-webgl",this._pInst._glAttributes),null===this.drawingContext)throw new Error("Error creating webgl context");var e=this.drawingContext;e.enable(e.DEPTH_TEST),e.depthFunc(e.LEQUAL),e.viewport(0,0,e.drawingBufferWidth,e.drawingBufferHeight),this._viewport=this.drawingContext.getParameter(this.drawingContext.VIEWPORT)}catch(e){throw e}},u.default.RendererGL.prototype._resetContext=function(e,t){var r=this.width,i=this.height,n=this.canvas.id,o=this._pInst instanceof u.default.Graphics;if(o){var a=this._pInst;a.canvas.parentNode.removeChild(a.canvas),a.canvas=document.createElement("canvas"),(a._pInst._userNode||document.body).appendChild(a.canvas),u.default.Element.call(a,a.canvas,a._pInst),a.width=r,a.height=i}else{var s=this.canvas;s&&s.parentNode.removeChild(s),(s=document.createElement("canvas")).id=n,this._pInst._userNode?this._pInst._userNode.appendChild(s):document.body.appendChild(s),this._pInst.canvas=s}var l=new u.default.RendererGL(this._pInst.canvas,this._pInst,!o);this._pInst._setProperty("_renderer",l),l.resize(r,i),l._applyDefaults(),o||this._pInst._elements.push(l),"function"==typeof t&&setTimeout(function(){t.apply(window._renderer,e)},0)},u.default.prototype.setAttributes=function(e,t){if(void 0!==this._glAttributes){var r=!0;if(void 0!==t?(null===this._glAttributes&&(this._glAttributes={}),this._glAttributes[e]!==t&&(this._glAttributes[e]=t,r=!1)):e instanceof Object&&this._glAttributes!==e&&(this._glAttributes=e,r=!1),this._renderer.isP3D&&!r){if(!this._setupDone)for(var i in this._renderer.retainedMode.geometry)if(this._renderer.retainedMode.geometry.hasOwnProperty(i))return void console.error("Sorry, Could not set the attributes, you need to call setAttributes() before calling the other drawing methods in setup()");this.push(),this._renderer._resetContext(),this.pop(),this._renderer._curCamera&&(this._renderer._curCamera._renderer=this._renderer)}}else console.log("You are trying to use setAttributes on a p5.Graphics object that does not use a WEBGL renderer.")},u.default.RendererGL.prototype._update=function(){this.uMVMatrix.set(this._curCamera.cameraMatrix.mat4[0],this._curCamera.cameraMatrix.mat4[1],this._curCamera.cameraMatrix.mat4[2],this._curCamera.cameraMatrix.mat4[3],this._curCamera.cameraMatrix.mat4[4],this._curCamera.cameraMatrix.mat4[5],this._curCamera.cameraMatrix.mat4[6],this._curCamera.cameraMatrix.mat4[7],this._curCamera.cameraMatrix.mat4[8],this._curCamera.cameraMatrix.mat4[9],this._curCamera.cameraMatrix.mat4[10],this._curCamera.cameraMatrix.mat4[11],this._curCamera.cameraMatrix.mat4[12],this._curCamera.cameraMatrix.mat4[13],this._curCamera.cameraMatrix.mat4[14],this._curCamera.cameraMatrix.mat4[15]),this.ambientLightColors.length=0,this.specularColors=[1,1,1],this.directionalLightDirections.length=0,this.directionalLightDiffuseColors.length=0,this.directionalLightSpecularColors.length=0,this.pointLightPositions.length=0,this.pointLightDiffuseColors.length=0,this.pointLightSpecularColors.length=0,this.spotLightPositions.length=0,this.spotLightDirections.length=0,this.spotLightDiffuseColors.length=0,this.spotLightSpecularColors.length=0,this.spotLightAngle.length=0,this.spotLightConc.length=0,this._enableLighting=!1,this._tint=[255,255,255,255],this.GL.clear(this.GL.DEPTH_BUFFER_BIT)},u.default.RendererGL.prototype.background=function(){var e,t=(e=this._pInst).color.apply(e,arguments),r=t.levels[0]/255,i=t.levels[1]/255,n=t.levels[2]/255,o=t.levels[3]/255;this.GL.clearColor(r,i,n,o),this.GL.clear(this.GL.COLOR_BUFFER_BIT)},u.default.RendererGL.prototype.fill=function(e,t,r,i){var n=u.default.prototype.color.apply(this._pInst,arguments);this.curFillColor=n._array,this.drawMode=o.FILL,this._useNormalMaterial=!1,this._tex=null},u.default.RendererGL.prototype.stroke=function(e,t,r,i){arguments[3]=255;var n=u.default.prototype.color.apply(this._pInst,arguments);this.curStrokeColor=n._array},u.default.RendererGL.prototype.strokeCap=function(e){console.error("Sorry, strokeCap() is not yet implemented in WEBGL mode")},u.default.RendererGL.prototype.strokeJoin=function(e){console.error("Sorry, strokeJoin() is not yet implemented in WEBGL mode")},u.default.RendererGL.prototype.filter=function(e){console.error("filter() does not work in WEBGL mode")},u.default.RendererGL.prototype.blendMode=function(e){e===o.DARKEST||e===o.LIGHTEST||e===o.ADD||e===o.BLEND||e===o.SUBTRACT||e===o.SCREEN||e===o.EXCLUSION||e===o.REPLACE||e===o.MULTIPLY||e===o.REMOVE?this.curBlendMode=e:e!==o.BURN&&e!==o.OVERLAY&&e!==o.HARD_LIGHT&&e!==o.SOFT_LIGHT&&e!==o.DODGE||console.warn("BURN, OVERLAY, HARD_LIGHT, SOFT_LIGHT, and DODGE only work for blendMode in 2D mode.")},u.default.RendererGL.prototype.erase=function(e,t){this._isErasing||(this._cachedBlendMode=this.curBlendMode,this.blendMode(o.REMOVE),this._cachedFillStyle=this.curFillColor.slice(),this.curFillColor=[1,1,1,e/255],this._cachedStrokeStyle=this.curStrokeColor.slice(),this.curStrokeColor=[1,1,1,t/255],this._isErasing=!0)},u.default.RendererGL.prototype.noErase=function(){this._isErasing&&(this.curFillColor=this._cachedFillStyle.slice(),this.curStrokeColor=this._cachedStrokeStyle.slice(),this.blendMode(this._cachedBlendMode),this._isErasing=!1)},u.default.RendererGL.prototype.strokeWeight=function(e){this.curStrokeWeight!==e&&(this.pointSize=e,this.curStrokeWeight=e)},u.default.RendererGL.prototype._getPixel=function(e,t){var r;return r=new Uint8Array(4),this.drawingContext.readPixels(e,t,1,1,this.drawingContext.RGBA,this.drawingContext.UNSIGNED_BYTE,r),[r[0],r[1],r[2],r[3]]},u.default.RendererGL.prototype.loadPixels=function(){var e=this._pixelsState;if(!0===this._pInst._glAttributes.preserveDrawingBuffer){var t=e.pixels,r=this.GL.drawingBufferWidth*this.GL.drawingBufferHeight*4;t instanceof Uint8Array&&t.length===r||(t=new Uint8Array(r),this._pixelsState._setProperty("pixels",t));var i=this._pInst._pixelDensity;this.GL.readPixels(0,0,this.width*i,this.height*i,this.GL.RGBA,this.GL.UNSIGNED_BYTE,t)}else console.log("loadPixels only works in WebGL when preserveDrawingBuffer is true.")},u.default.RendererGL.prototype.geometryInHash=function(e){return void 0!==this.retainedMode.geometry[e]},u.default.RendererGL.prototype.resize=function(e,t){u.default.Renderer.prototype.resize.call(this,e,t),this.GL.viewport(0,0,this.GL.drawingBufferWidth,this.GL.drawingBufferHeight),this._viewport=this.GL.getParameter(this.GL.VIEWPORT),this._curCamera._resize();var r=this._pixelsState;void 0!==r.pixels&&r._setProperty("pixels",new Uint8Array(this.GL.drawingBufferWidth*this.GL.drawingBufferHeight*4))},u.default.RendererGL.prototype.clear=function(){var e=(arguments.length<=0?void 0:arguments[0])||0,t=(arguments.length<=1?void 0:arguments[1])||0,r=(arguments.length<=2?void 0:arguments[2])||0,i=(arguments.length<=3?void 0:arguments[3])||0;this.GL.clearColor(e,t,r,i),this.GL.clear(this.GL.COLOR_BUFFER_BIT|this.GL.DEPTH_BUFFER_BIT)},u.default.RendererGL.prototype.applyMatrix=function(e,t,r,i,n,o){16===arguments.length?u.default.Matrix.prototype.apply.apply(this.uMVMatrix,arguments):this.uMVMatrix.apply([e,t,0,0,r,i,0,0,0,0,1,0,n,o,0,1])},u.default.RendererGL.prototype.translate=function(e,t,r){return e instanceof u.default.Vector&&(r=e.z,t=e.y,e=e.x),this.uMVMatrix.translate([e,t,r]),this},u.default.RendererGL.prototype.scale=function(e,t,r){return this.uMVMatrix.scale(e,t,r),this},u.default.RendererGL.prototype.rotate=function(e,t){return void 0===t?this.rotateZ(e):(u.default.Matrix.prototype.rotate.apply(this.uMVMatrix,arguments),this)},u.default.RendererGL.prototype.rotateX=function(e){return this.rotate(e,1,0,0),this},u.default.RendererGL.prototype.rotateY=function(e){return this.rotate(e,0,1,0),this},u.default.RendererGL.prototype.rotateZ=function(e){return this.rotate(e,0,0,1),this},u.default.RendererGL.prototype.push=function(){var e=u.default.Renderer.prototype.push.apply(this),t=e.properties;return t.uMVMatrix=this.uMVMatrix.copy(),t.uPMatrix=this.uPMatrix.copy(),t._curCamera=this._curCamera,this._curCamera=this._curCamera.copy(),t.ambientLightColors=this.ambientLightColors.slice(),t.specularColors=this.specularColors.slice(),t.directionalLightDirections=this.directionalLightDirections.slice(),t.directionalLightDiffuseColors=this.directionalLightDiffuseColors.slice(),t.directionalLightSpecularColors=this.directionalLightSpecularColors.slice(),t.pointLightPositions=this.pointLightPositions.slice(),t.pointLightDiffuseColors=this.pointLightDiffuseColors.slice(),t.pointLightSpecularColors=this.pointLightSpecularColors.slice(),t.spotLightPositions=this.spotLightPositions.slice(),t.spotLightDirections=this.spotLightDirections.slice(),t.spotLightDiffuseColors=this.spotLightDiffuseColors.slice(),t.spotLightSpecularColors=this.spotLightSpecularColors.slice(),t.spotLightAngle=this.spotLightAngle.slice(),t.spotLightConc=this.spotLightConc.slice(),t.userFillShader=this.userFillShader,t.userStrokeShader=this.userStrokeShader,t.userPointShader=this.userPointShader,t.pointSize=this.pointSize,t.curStrokeWeight=this.curStrokeWeight,t.curStrokeColor=this.curStrokeColor,t.curFillColor=this.curFillColor,t._useSpecularMaterial=this._useSpecularMaterial,t._useEmissiveMaterial=this._useEmissiveMaterial,t._useShininess=this._useShininess,t.constantAttenuation=this.constantAttenuation,t.linearAttenuation=this.linearAttenuation,t.quadraticAttenuation=this.quadraticAttenuation,t._enableLighting=this._enableLighting,t._useNormalMaterial=this._useNormalMaterial,t._tex=this._tex,t.drawMode=this.drawMode,e},u.default.RendererGL.prototype.resetMatrix=function(){return this.uMVMatrix=u.default.Matrix.identity(this._pInst),this},u.default.RendererGL.prototype._getImmediateStrokeShader=function(){var e=this.userStrokeShader;return e&&e.isStrokeShader()?e:this._getLineShader()},u.default.RendererGL.prototype._getRetainedStrokeShader=u.default.RendererGL.prototype._getImmediateStrokeShader,u.default.RendererGL.prototype._getImmediateFillShader=function(){var e=this.userFillShader;if(this._useNormalMaterial&&(!e||!e.isNormalShader()))return this._getNormalShader();if(this._enableLighting){if(!e||!e.isLightShader())return this._getLightShader()}else if(this._tex){if(!e||!e.isTextureShader())return this._getLightShader()}else if(!e)return this._getImmediateModeShader();return e},u.default.RendererGL.prototype._getRetainedFillShader=function(){if(this._useNormalMaterial)return this._getNormalShader();var e=this.userFillShader;if(this._enableLighting){if(!e||!e.isLightShader())return this._getLightShader()}else if(this._tex){if(!e||!e.isTextureShader())return this._getLightShader()}else if(!e)return this._getColorShader();return e},u.default.RendererGL.prototype._getImmediatePointShader=function(){var e=this.userPointShader;return e&&e.isPointShader()?e:this._getPointShader()},u.default.RendererGL.prototype._getRetainedLineShader=u.default.RendererGL.prototype._getImmediateLineShader,u.default.RendererGL.prototype._getLightShader=function(){return this._defaultLightShader||(this._pInst._glAttributes.perPixelLighting?this._defaultLightShader=new u.default.Shader(this,c.phongVert,c.phongFrag):this._defaultLightShader=new u.default.Shader(this,c.lightVert,c.lightTextureFrag)),this._defaultLightShader},u.default.RendererGL.prototype._getImmediateModeShader=function(){return this._defaultImmediateModeShader||(this._defaultImmediateModeShader=new u.default.Shader(this,c.immediateVert,c.vertexColorFrag)),this._defaultImmediateModeShader},u.default.RendererGL.prototype._getNormalShader=function(){return this._defaultNormalShader||(this._defaultNormalShader=new u.default.Shader(this,c.normalVert,c.normalFrag)),this._defaultNormalShader},u.default.RendererGL.prototype._getColorShader=function(){return this._defaultColorShader||(this._defaultColorShader=new u.default.Shader(this,c.normalVert,c.basicFrag)),this._defaultColorShader},u.default.RendererGL.prototype._getPointShader=function(){return this._defaultPointShader||(this._defaultPointShader=new u.default.Shader(this,c.pointVert,c.pointFrag)),this._defaultPointShader},u.default.RendererGL.prototype._getLineShader=function(){return this._defaultLineShader||(this._defaultLineShader=new u.default.Shader(this,c.lineVert,c.lineFrag)),this._defaultLineShader},u.default.RendererGL.prototype._getFontShader=function(){return this._defaultFontShader||(this.GL.getExtension("OES_standard_derivatives"),this._defaultFontShader=new u.default.Shader(this,c.fontVert,c.fontFrag)),this._defaultFontShader},u.default.RendererGL.prototype._getEmptyTexture=function(){if(!this._emptyTexture){var e=new u.default.Image(1,1);e.set(0,0,255),this._emptyTexture=new u.default.Texture(this,e)}return this._emptyTexture},u.default.RendererGL.prototype.getTexture=function(e){var t=this.textures,r=!0,i=!1,n=void 0;try{for(var o,a=t[Symbol.iterator]();!(r=(o=a.next()).done);r=!0){var s=o.value;if(s.src===e)return s}}catch(e){i=!0,n=e}finally{try{r||null==a.return||a.return()}finally{if(i)throw n}}var l=new u.default.Texture(this,e);return t.push(l),l},u.default.RendererGL.prototype._setStrokeUniforms=function(e){e.bindShader(),e.setUniform("uMaterialColor",this.curStrokeColor),e.setUniform("uStrokeWeight",this.curStrokeWeight)},u.default.RendererGL.prototype._setFillUniforms=function(e){e.bindShader(),e.setUniform("uMaterialColor",this.curFillColor),e.setUniform("isTexture",!!this._tex),this._tex&&e.setUniform("uSampler",this._tex),e.setUniform("uTint",this._tint),e.setUniform("uSpecular",this._useSpecularMaterial),e.setUniform("uEmissive",this._useEmissiveMaterial),e.setUniform("uShininess",this._useShininess),e.setUniform("uUseLighting",this._enableLighting);var t=this.pointLightDiffuseColors.length/3;e.setUniform("uPointLightCount",t),e.setUniform("uPointLightLocation",this.pointLightPositions),e.setUniform("uPointLightDiffuseColors",this.pointLightDiffuseColors),e.setUniform("uPointLightSpecularColors",this.pointLightSpecularColors);var r=this.directionalLightDiffuseColors.length/3;e.setUniform("uDirectionalLightCount",r),e.setUniform("uLightingDirection",this.directionalLightDirections),e.setUniform("uDirectionalDiffuseColors",this.directionalLightDiffuseColors),e.setUniform("uDirectionalSpecularColors",this.directionalLightSpecularColors);var i=this.ambientLightColors.length/3;e.setUniform("uAmbientLightCount",i),e.setUniform("uAmbientColor",this.ambientLightColors);var n=this.spotLightDiffuseColors.length/3;e.setUniform("uSpotLightCount",n),e.setUniform("uSpotLightAngle",this.spotLightAngle),e.setUniform("uSpotLightConc",this.spotLightConc),e.setUniform("uSpotLightDiffuseColors",this.spotLightDiffuseColors),e.setUniform("uSpotLightSpecularColors",this.spotLightSpecularColors),e.setUniform("uSpotLightLocation",this.spotLightPositions),e.setUniform("uSpotLightDirection",this.spotLightDirections),e.setUniform("uConstantAttenuation",this.constantAttenuation),e.setUniform("uLinearAttenuation",this.linearAttenuation),e.setUniform("uQuadraticAttenuation",this.quadraticAttenuation),e.bindTextures()},u.default.RendererGL.prototype._setPointUniforms=function(e){e.bindShader(),e.setUniform("uMaterialColor",this.curStrokeColor),e.setUniform("uPointSize",this.pointSize)},u.default.RendererGL.prototype._bindBuffer=function(e,t,r,i,n){if(t=t||this.GL.ARRAY_BUFFER,this.GL.bindBuffer(t,e),void 0!==r){var o=new(i||Float32Array)(r);this.GL.bufferData(t,o,n||this.GL.STATIC_DRAW)}},u.default.RendererGL.prototype._arraysEqual=function(e,t){var r=e.length;if(r!==t.length)return!1;for(var i=0;i>7,127&f,c>>7,127&c);for(var d=0;d>7,127&p,0,0)}}return{cellImageInfo:l,dimOffset:o,dimImageInfo:n}}return(t=this.glyphInfos[e.index]={glyph:e,uGlyphRect:[i.x1,-i.y1,i.x2,-i.y2],strokeImageInfo:U,strokes:d,colInfo:G(m,this.colDimImageInfos,this.colCellImageInfos),rowInfo:G(p,this.rowDimImageInfos,this.rowCellImageInfos)}).uGridOffset=[t.colInfo.dimOffset,t.rowInfo.dimOffset],t}}var z=Math.sqrt(3);j.default.RendererGL.prototype._renderText=function(e,t,r,i,n){if(this._textFont&&"string"!=typeof this._textFont){if(!(n<=i)&&this._doFill){if(!this._isOpenType())return console.log("WEBGL: only Opentype (.otf) and Truetype (.ttf) fonts are supported"),e;e.push();var o=this._doStroke,a=this.drawMode;this._doStroke=!1,this.drawMode=D.TEXTURE;var s=this._textFont.font,l=this._textFont._fontInfo;l=l||(this._textFont._fontInfo=new A(s));var u=this._textFont._handleAlignment(this,t,r,i),h=this._textSize/s.unitsPerEm;this.translate(u.x,u.y,0),this.scale(h,h,1);var c=this.GL,f=!this._defaultFontShader,d=this._getFontShader();d.init(),d.bindShader(),f&&(d.setUniform("uGridImageSize",[64,64]),d.setUniform("uCellsImageSize",[64,64]),d.setUniform("uStrokeImageSize",[64,64]),d.setUniform("uGridSize",[9,9])),this._applyColorBlend(this.curFillColor);var p=this.retainedMode.geometry.glyph;if(!p){var m=this._textGeom=new j.default.Geometry(1,1,function(){for(var e=0;e<=1;e++)for(var t=0;t<=1;t++)this.vertices.push(new j.default.Vector(t,e,0)),this.uvs.push(t,e)});m.computeFaces().computeNormals(),p=this.createBuffers("glyph",m)}var g=!0,v=!1,y=void 0;try{for(var b,_=this.retainedMode.buffers.text[Symbol.iterator]();!(g=(b=_.next()).done);g=!0){b.value._prepareBuffer(p,d)}}catch(e){v=!0,y=e}finally{try{g||null==_.return||_.return()}finally{if(v)throw y}}this._bindBuffer(p.indexBuffer,c.ELEMENT_ARRAY_BUFFER),d.setUniform("uMaterialColor",this.curFillColor);try{var x=0,w=null,S=s.stringToGlyphs(t),M=!0,E=!1,T=void 0;try{for(var C,P=S[Symbol.iterator]();!(M=(C=P.next()).done);M=!0){var L=C.value;w&&(x+=s.getKerningValue(w,L));var k=l.getGlyphInfo(L);if(k.uGlyphRect){var R=k.rowInfo,O=k.colInfo;d.setUniform("uSamplerStrokes",k.strokeImageInfo.imageData),d.setUniform("uSamplerRowStrokes",R.cellImageInfo.imageData),d.setUniform("uSamplerRows",R.dimImageInfo.imageData),d.setUniform("uSamplerColStrokes",O.cellImageInfo.imageData),d.setUniform("uSamplerCols",O.dimImageInfo.imageData),d.setUniform("uGridOffset",k.uGridOffset),d.setUniform("uGlyphRect",k.uGlyphRect),d.setUniform("uGlyphOffset",x),d.bindTextures(),c.drawElements(c.TRIANGLES,6,this.GL.UNSIGNED_SHORT,0)}x+=L.advanceWidth,w=L}}catch(e){E=!0,T=e}finally{try{M||null==P.return||P.return()}finally{if(E)throw T}}}finally{d.unbindShader(),this._doStroke=o,this.drawMode=a,e.pop()}return e}}else console.log("WEBGL: you must load and set a font before drawing text. See `loadFont` and `textFont` for more details.")}},{"../core/constants":42,"../core/main":49,"./p5.RendererGL.Retained":102,"./p5.Shader":104}],107:[function(e,t,r){t.exports={fes:{autoplay:"The media that tried to play (with '{{src}}') wasn't allowed to by this browser, most likely due to the browser's autoplay policy. Check out {{link}} for more information about why.",fileLoadError:{bytes:"It looks like there was a problem loading your file. {{suggestion}}",font:"It looks like there was a problem loading your font. {{suggestion}}",gif:"There was some trouble loading your GIF. Make sure that your GIF is using 87a or 89a encoding.",image:"It looks like there was a problem loading your image. {{suggestion}}",json:"It looks like there was a problem loading your JSON file. {{suggestion}}",large:"If your large file isn't fetched successfully, we recommend splitting the file into smaller segments and fetching those.",strings:"It looks like there was a problem loading your text file. {{suggestion}}",suggestion:"Try checking if the file path ({{filePath}}) is correct, hosting the file online, or running a local server. (More info at {{link}})",table:"It looks like there was a problem loading your table file. {{suggestion}}",xml:"It looks like there was a problem loading your XML file. {{suggestion}}"},misusedTopLevel:"Did you just try to use p5.js's {{symbolName}} {{symbolType}}? If so, you may want to move it into your sketch's setup() function.\n\nFor more details, see: {{link}}",pre:"🌸 p5.js says: {{message}}",welcome:"Welcome! This is your friendly debugger. To turn me off, switch to using p5.min.js."}}},{}],108:[function(e,t,r){t.exports={fes:{autoplay:"Su browser impidío un medio tocar (de '{{src}}'), posiblemente porque las reglas de autoplay. Para aprender más, visite {{link}}.",fileLoadError:{bytes:"",font:"",gif:"",image:"",json:"",large:"",strings:"",suggestion:"",table:"",xml:""},misusedTopLevel:"",pre:"🌸 p5.js dice: {{message}}",welcome:""}}},{}],109:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i=o(e("./en/translation")),n=o(e("./es/translation"));function o(e){return e&&e.__esModule?e:{default:e}}var a={en:{translation:i.default},es:{translation:n.default}};r.default=a},{"./en/translation":107,"./es/translation":108}]},{},[37])(37)}); ================================================ FILE: docs/examples/transcrypt/sketch_006/target/org.transcrypt.__runtime__.js ================================================ // Transcrypt'ed from Python, 2021-11-02 13:06:14 var __name__ = 'org.transcrypt.__runtime__'; export var __envir__ = {}; __envir__.interpreter_name = 'python'; __envir__.transpiler_name = 'transcrypt'; __envir__.executor_name = __envir__.transpiler_name; __envir__.transpiler_version = '3.9.0'; export function __nest__ (headObject, tailNames, value) { var current = headObject; if (tailNames != '') { var tailChain = tailNames.split ('.'); var firstNewIndex = tailChain.length; for (var index = 0; index < tailChain.length; index++) { if (!current.hasOwnProperty (tailChain [index])) { firstNewIndex = index; break; } current = current [tailChain [index]]; } for (var index = firstNewIndex; index < tailChain.length; index++) { current [tailChain [index]] = {}; current = current [tailChain [index]]; } } for (let attrib of Object.getOwnPropertyNames (value)) { Object.defineProperty (current, attrib, { get () {return value [attrib];}, enumerable: true, configurable: true }); } }; export function __init__ (module) { if (!module.__inited__) { module.__all__.__init__ (module.__all__); module.__inited__ = true; } return module.__all__; }; export function __get__ (aThis, func, quotedFuncName) { if (aThis) { if (aThis.hasOwnProperty ('__class__') || typeof aThis == 'string' || aThis instanceof String) { if (quotedFuncName) { Object.defineProperty (aThis, quotedFuncName, { value: function () { var args = [] .slice.apply (arguments); return func.apply (null, [aThis] .concat (args)); }, writable: true, enumerable: true, configurable: true }); } return function () { var args = [] .slice.apply (arguments); return func.apply (null, [aThis.__proxy__ ? aThis.__proxy__ : aThis] .concat (args)); }; } else { return func; } } else { return func; } }; export function __getcm__ (aThis, func, quotedFuncName) { if (aThis.hasOwnProperty ('__class__')) { return function () { var args = [] .slice.apply (arguments); return func.apply (null, [aThis.__class__] .concat (args)); }; } else { return function () { var args = [] .slice.apply (arguments); return func.apply (null, [aThis] .concat (args)); }; } }; export function __getsm__ (aThis, func, quotedFuncName) { return func; }; export var py_metatype = { __name__: 'type', __bases__: [], __new__: function (meta, name, bases, attribs) { var cls = function () { var args = [] .slice.apply (arguments); return cls.__new__ (args); }; for (var index = bases.length - 1; index >= 0; index--) { var base = bases [index]; for (var attrib in base) { var descrip = Object.getOwnPropertyDescriptor (base, attrib); if (descrip == null) { continue; } Object.defineProperty (cls, attrib, descrip); } for (let symbol of Object.getOwnPropertySymbols (base)) { let descrip = Object.getOwnPropertyDescriptor (base, symbol); Object.defineProperty (cls, symbol, descrip); } } cls.__metaclass__ = meta; cls.__name__ = name.startsWith ('py_') ? name.slice (3) : name; cls.__bases__ = bases; for (var attrib in attribs) { var descrip = Object.getOwnPropertyDescriptor (attribs, attrib); Object.defineProperty (cls, attrib, descrip); } for (let symbol of Object.getOwnPropertySymbols (attribs)) { let descrip = Object.getOwnPropertyDescriptor (attribs, symbol); Object.defineProperty (cls, symbol, descrip); } return cls; } }; py_metatype.__metaclass__ = py_metatype; export var object = { __init__: function (self) {}, __metaclass__: py_metatype, __name__: 'object', __bases__: [], __new__: function (args) { var instance = Object.create (this, {__class__: {value: this, enumerable: true}}); if ('__getattr__' in this || '__setattr__' in this) { instance.__proxy__ = new Proxy (instance, { get: function (target, name) { let result = target [name]; if (result == undefined) { return target.__getattr__ (name); } else { return result; } }, set: function (target, name, value) { try { target.__setattr__ (name, value); } catch (exception) { target [name] = value; } return true; } }) instance = instance.__proxy__ } this.__init__.apply (null, [instance] .concat (args)); return instance; } }; export function __class__ (name, bases, attribs, meta) { if (meta === undefined) { meta = bases [0] .__metaclass__; } return meta.__new__ (meta, name, bases, attribs); }; export function __pragma__ () {}; export function __call__ (/* , , * */) { var args = [] .slice.apply (arguments); if (typeof args [0] == 'object' && '__call__' in args [0]) { return args [0] .__call__ .apply (args [1], args.slice (2)); } else { return args [0] .apply (args [1], args.slice (2)); } }; __envir__.executor_name = __envir__.transpiler_name; var __main__ = {__file__: ''}; var __except__ = null; export function __kwargtrans__ (anObject) { anObject.__kwargtrans__ = null; anObject.constructor = Object; return anObject; } export function __super__ (aClass, methodName) { for (let base of aClass.__bases__) { if (methodName in base) { return base [methodName]; } } throw new Exception ('Superclass method not found'); } export function property (getter, setter) { if (!setter) { setter = function () {}; } return {get: function () {return getter (this)}, set: function (value) {setter (this, value)}, enumerable: true}; } export function __setproperty__ (anObject, name, descriptor) { if (!anObject.hasOwnProperty (name)) { Object.defineProperty (anObject, name, descriptor); } } export function assert (condition, message) { if (!condition) { throw AssertionError (message, new Error ()); } } export function __mergekwargtrans__ (object0, object1) { var result = {}; for (var attrib in object0) { result [attrib] = object0 [attrib]; } for (var attrib in object1) { result [attrib] = object1 [attrib]; } return result; }; export function __mergefields__ (targetClass, sourceClass) { let fieldNames = ['__reprfields__', '__comparefields__', '__initfields__'] if (sourceClass [fieldNames [0]]) { if (targetClass [fieldNames [0]]) { for (let fieldName of fieldNames) { targetClass [fieldName] = new Set ([...targetClass [fieldName], ...sourceClass [fieldName]]); } } else { for (let fieldName of fieldNames) { targetClass [fieldName] = new Set (sourceClass [fieldName]); } } } } export function __withblock__ (manager, statements) { if (hasattr (manager, '__enter__')) { try { manager.__enter__ (); statements (); manager.__exit__ (); } catch (exception) { if (! (manager.__exit__ (exception.name, exception, exception.stack))) { throw exception; } } } else { statements (); manager.close (); } }; export function dir (obj) { var aList = []; for (var aKey in obj) { aList.push (aKey.startsWith ('py_') ? aKey.slice (3) : aKey); } aList.sort (); return aList; }; export function setattr (obj, name, value) { obj [name] = value; }; export function getattr (obj, name) { return name in obj ? obj [name] : obj ['py_' + name]; }; export function hasattr (obj, name) { try { return name in obj || 'py_' + name in obj; } catch (exception) { return false; } }; export function delattr (obj, name) { if (name in obj) { delete obj [name]; } else { delete obj ['py_' + name]; } }; export function __in__ (element, container) { if (container === undefined || container === null) { return false; } if (container.__contains__ instanceof Function) { return container.__contains__ (element); } else { return ( container.indexOf ? container.indexOf (element) > -1 : container.hasOwnProperty (element) ); } }; export function __specialattrib__ (attrib) { return (attrib.startswith ('__') && attrib.endswith ('__')) || attrib == 'constructor' || attrib.startswith ('py_'); }; export function len (anObject) { if (anObject === undefined || anObject === null) { return 0; } if (anObject.__len__ instanceof Function) { return anObject.__len__ (); } if (anObject.length !== undefined) { return anObject.length; } var length = 0; for (var attr in anObject) { if (!__specialattrib__ (attr)) { length++; } } return length; }; export function __i__ (any) { return py_typeof (any) == dict ? any.py_keys () : any; } export function __k__ (keyed, key) { var result = keyed [key]; if (typeof result == 'undefined') { if (keyed instanceof Array) if (key == +key && key >= 0 && keyed.length > key) return result; else throw IndexError (key, new Error()); else throw KeyError (key, new Error()); } return result; } export function __t__ (target) { return ( target === undefined || target === null ? false : ['boolean', 'number'] .indexOf (typeof target) >= 0 ? target : target.__bool__ instanceof Function ? (target.__bool__ () ? target : false) : target.__len__ instanceof Function ? (target.__len__ () !== 0 ? target : false) : target instanceof Function ? target : len (target) !== 0 ? target : false ); } export function float (any) { if (any == 'inf') { return Infinity; } else if (any == '-inf') { return -Infinity; } else if (any == 'nan') { return NaN; } else if (isNaN (parseFloat (any))) { if (any === false) { return 0; } else if (any === true) { return 1; } else { throw ValueError ("could not convert string to float: '" + str(any) + "'", new Error ()); } } else { return +any; } }; float.__name__ = 'float'; float.__bases__ = [object]; export function int (any) { return float (any) | 0 }; int.__name__ = 'int'; int.__bases__ = [object]; export function bool (any) { return !!__t__ (any); }; bool.__name__ = 'bool'; bool.__bases__ = [int]; export function py_typeof (anObject) { var aType = typeof anObject; if (aType == 'object') { try { return '__class__' in anObject ? anObject.__class__ : object; } catch (exception) { return aType; } } else { return ( aType == 'boolean' ? bool : aType == 'string' ? str : aType == 'number' ? (anObject % 1 == 0 ? int : float) : null ); } }; export function issubclass (aClass, classinfo) { if (classinfo instanceof Array) { for (let aClass2 of classinfo) { if (issubclass (aClass, aClass2)) { return true; } } return false; } try { var aClass2 = aClass; if (aClass2 == classinfo) { return true; } else { var bases = [].slice.call (aClass2.__bases__); while (bases.length) { aClass2 = bases.shift (); if (aClass2 == classinfo) { return true; } if (aClass2.__bases__.length) { bases = [].slice.call (aClass2.__bases__).concat (bases); } } return false; } } catch (exception) { return aClass == classinfo || classinfo == object; } }; export function isinstance (anObject, classinfo) { try { return '__class__' in anObject ? issubclass (anObject.__class__, classinfo) : issubclass (py_typeof (anObject), classinfo); } catch (exception) { return issubclass (py_typeof (anObject), classinfo); } }; export function callable (anObject) { return anObject && typeof anObject == 'object' && '__call__' in anObject ? true : typeof anObject === 'function'; }; export function repr (anObject) { try { return anObject.__repr__ (); } catch (exception) { try { return anObject.__str__ (); } catch (exception) { try { if (anObject == null) { return 'None'; } else if (anObject.constructor == Object) { var result = '{'; var comma = false; for (var attrib in anObject) { if (!__specialattrib__ (attrib)) { if (attrib.isnumeric ()) { var attribRepr = attrib; } else { var attribRepr = '\'' + attrib + '\''; } if (comma) { result += ', '; } else { comma = true; } result += attribRepr + ': ' + repr (anObject [attrib]); } } result += '}'; return result; } else { return typeof anObject == 'boolean' ? anObject.toString () .capitalize () : anObject.toString (); } } catch (exception) { return ''; } } } }; export function chr (charCode) { return String.fromCharCode (charCode); }; export function ord (aChar) { return aChar.charCodeAt (0); }; export function max (nrOrSeq) { return arguments.length == 1 ? Math.max (...nrOrSeq) : Math.max (...arguments); }; export function min (nrOrSeq) { return arguments.length == 1 ? Math.min (...nrOrSeq) : Math.min (...arguments); }; export var abs = Math.abs; export function round (number, ndigits) { if (ndigits) { var scale = Math.pow (10, ndigits); number *= scale; } var rounded = Math.round (number); if (rounded - number == 0.5 && rounded % 2) { rounded -= 1; } if (ndigits) { rounded /= scale; } return rounded; }; export function __jsUsePyNext__ () { try { var result = this.__next__ (); return {value: result, done: false}; } catch (exception) { return {value: undefined, done: true}; } } export function __pyUseJsNext__ () { var result = this.next (); if (result.done) { throw StopIteration (new Error ()); } else { return result.value; } } export function py_iter (iterable) { if (typeof iterable == 'string' || '__iter__' in iterable) { var result = iterable.__iter__ (); result.next = __jsUsePyNext__; } else if ('selector' in iterable) { var result = list (iterable) .__iter__ (); result.next = __jsUsePyNext__; } else if ('next' in iterable) { var result = iterable if (! ('__next__' in result)) { result.__next__ = __pyUseJsNext__; } } else if (Symbol.iterator in iterable) { var result = iterable [Symbol.iterator] (); result.__next__ = __pyUseJsNext__; } else { throw IterableError (new Error ()); } result [Symbol.iterator] = function () {return result;}; return result; } export function py_next (iterator) { try { var result = iterator.__next__ (); } catch (exception) { var result = iterator.next (); if (result.done) { throw StopIteration (new Error ()); } else { return result.value; } } if (result == undefined) { throw StopIteration (new Error ()); } else { return result; } } export function __PyIterator__ (iterable) { this.iterable = iterable; this.index = 0; } __PyIterator__.prototype.__next__ = function() { if (this.index < this.iterable.length) { return this.iterable [this.index++]; } else { throw StopIteration (new Error ()); } }; export function __JsIterator__ (iterable) { this.iterable = iterable; this.index = 0; } __JsIterator__.prototype.next = function () { if (this.index < this.iterable.py_keys.length) { return {value: this.index++, done: false}; } else { return {value: undefined, done: true}; } }; export function py_reversed (iterable) { iterable = iterable.slice (); iterable.reverse (); return iterable; }; export function zip () { var args = [] .slice.call (arguments); for (var i = 0; i < args.length; i++) { if (typeof args [i] == 'string') { args [i] = args [i] .split (''); } else if (!Array.isArray (args [i])) { args [i] = Array.from (args [i]); } } var shortest = args.length == 0 ? [] : args.reduce ( function (array0, array1) { return array0.length < array1.length ? array0 : array1; } ); return shortest.map ( function (current, index) { return args.map ( function (current) { return current [index]; } ); } ); }; export function range (start, stop, step) { if (stop == undefined) { stop = start; start = 0; } if (step == undefined) { step = 1; } if ((step > 0 && start >= stop) || (step < 0 && start <= stop)) { return []; } var result = []; for (var i = start; step > 0 ? i < stop : i > stop; i += step) { result.push(i); } return result; }; export function any (iterable) { for (let item of iterable) { if (bool (item)) { return true; } } return false; } export function all (iterable) { for (let item of iterable) { if (! bool (item)) { return false; } } return true; } export function sum (iterable) { let result = 0; for (let item of iterable) { result += item; } return result; } export function enumerate (iterable) { return zip (range (len (iterable)), iterable); } export function copy (anObject) { if (anObject == null || typeof anObject == "object") { return anObject; } else { var result = {}; for (var attrib in obj) { if (anObject.hasOwnProperty (attrib)) { result [attrib] = anObject [attrib]; } } return result; } } export function deepcopy (anObject) { if (anObject == null || typeof anObject == "object") { return anObject; } else { var result = {}; for (var attrib in obj) { if (anObject.hasOwnProperty (attrib)) { result [attrib] = deepcopy (anObject [attrib]); } } return result; } } export function list (iterable) { let instance = iterable ? Array.from (iterable) : []; return instance; } Array.prototype.__class__ = list; list.__name__ = 'list'; list.__bases__ = [object]; Array.prototype.__iter__ = function () {return new __PyIterator__ (this);}; Array.prototype.__getslice__ = function (start, stop, step) { if (start < 0) { start = this.length + start; } if (stop == null) { stop = this.length; } else if (stop < 0) { stop = this.length + stop; } else if (stop > this.length) { stop = this.length; } if (step == 1) { return Array.prototype.slice.call(this, start, stop); } let result = list ([]); for (let index = start; index < stop; index += step) { result.push (this [index]); } return result; }; Array.prototype.__setslice__ = function (start, stop, step, source) { if (start < 0) { start = this.length + start; } if (stop == null) { stop = this.length; } else if (stop < 0) { stop = this.length + stop; } if (step == null) { Array.prototype.splice.apply (this, [start, stop - start] .concat (source)); } else { let sourceIndex = 0; for (let targetIndex = start; targetIndex < stop; targetIndex += step) { this [targetIndex] = source [sourceIndex++]; } } }; Array.prototype.__repr__ = function () { if (this.__class__ == set && !this.length) { return 'set()'; } let result = !this.__class__ || this.__class__ == list ? '[' : this.__class__ == tuple ? '(' : '{'; for (let index = 0; index < this.length; index++) { if (index) { result += ', '; } result += repr (this [index]); } if (this.__class__ == tuple && this.length == 1) { result += ','; } result += !this.__class__ || this.__class__ == list ? ']' : this.__class__ == tuple ? ')' : '}';; return result; }; Array.prototype.__str__ = Array.prototype.__repr__; Array.prototype.append = function (element) { this.push (element); }; Array.prototype.py_clear = function () { this.length = 0; }; Array.prototype.extend = function (aList) { this.push.apply (this, aList); }; Array.prototype.insert = function (index, element) { this.splice (index, 0, element); }; Array.prototype.remove = function (element) { let index = this.indexOf (element); if (index == -1) { throw ValueError ("list.remove(x): x not in list", new Error ()); } this.splice (index, 1); }; Array.prototype.index = function (element) { return this.indexOf (element); }; Array.prototype.py_pop = function (index) { if (index == undefined) { return this.pop (); } else { return this.splice (index, 1) [0]; } }; Array.prototype.py_sort = function () { __sort__.apply (null, [this].concat ([] .slice.apply (arguments))); }; Array.prototype.__add__ = function (aList) { return list (this.concat (aList)); }; Array.prototype.__mul__ = function (scalar) { let result = this; for (let i = 1; i < scalar; i++) { result = result.concat (this); } return result; }; Array.prototype.__rmul__ = Array.prototype.__mul__; export function tuple (iterable) { let instance = iterable ? [] .slice.apply (iterable) : []; instance.__class__ = tuple; return instance; } tuple.__name__ = 'tuple'; tuple.__bases__ = [object]; export function set (iterable) { let instance = []; if (iterable) { for (let index = 0; index < iterable.length; index++) { instance.add (iterable [index]); } } instance.__class__ = set; return instance; } set.__name__ = 'set'; set.__bases__ = [object]; Array.prototype.__bindexOf__ = function (element) { element += ''; let mindex = 0; let maxdex = this.length - 1; while (mindex <= maxdex) { let index = (mindex + maxdex) / 2 | 0; let middle = this [index] + ''; if (middle < element) { mindex = index + 1; } else if (middle > element) { maxdex = index - 1; } else { return index; } } return -1; }; Array.prototype.add = function (element) { if (this.indexOf (element) == -1) { this.push (element); } }; Array.prototype.discard = function (element) { var index = this.indexOf (element); if (index != -1) { this.splice (index, 1); } }; Array.prototype.isdisjoint = function (other) { this.sort (); for (let i = 0; i < other.length; i++) { if (this.__bindexOf__ (other [i]) != -1) { return false; } } return true; }; Array.prototype.issuperset = function (other) { this.sort (); for (let i = 0; i < other.length; i++) { if (this.__bindexOf__ (other [i]) == -1) { return false; } } return true; }; Array.prototype.issubset = function (other) { return set (other.slice ()) .issuperset (this); }; Array.prototype.union = function (other) { let result = set (this.slice () .sort ()); for (let i = 0; i < other.length; i++) { if (result.__bindexOf__ (other [i]) == -1) { result.push (other [i]); } } return result; }; Array.prototype.intersection = function (other) { this.sort (); let result = set (); for (let i = 0; i < other.length; i++) { if (this.__bindexOf__ (other [i]) != -1) { result.push (other [i]); } } return result; }; Array.prototype.difference = function (other) { let sother = set (other.slice () .sort ()); let result = set (); for (let i = 0; i < this.length; i++) { if (sother.__bindexOf__ (this [i]) == -1) { result.push (this [i]); } } return result; }; Array.prototype.symmetric_difference = function (other) { return this.union (other) .difference (this.intersection (other)); }; Array.prototype.py_update = function () { let updated = [] .concat.apply (this.slice (), arguments) .sort (); this.py_clear (); for (let i = 0; i < updated.length; i++) { if (updated [i] != updated [i - 1]) { this.push (updated [i]); } } }; Array.prototype.__eq__ = function (other) { if (this.length != other.length) { return false; } if (this.__class__ == set) { this.sort (); other.sort (); } for (let i = 0; i < this.length; i++) { if (this [i] != other [i]) { return false; } } return true; }; Array.prototype.__ne__ = function (other) { return !this.__eq__ (other); }; Array.prototype.__le__ = function (other) { if (this.__class__ == set) { return this.issubset (other); } else { for (let i = 0; i < this.length; i++) { if (this [i] > other [i]) { return false; } else if (this [i] < other [i]) { return true; } } return true; } }; Array.prototype.__ge__ = function (other) { if (this.__class__ == set) { return this.issuperset (other); } else { for (let i = 0; i < this.length; i++) { if (this [i] < other [i]) { return false; } else if (this [i] > other [i]) { return true; } } return true; } }; Array.prototype.__lt__ = function (other) { return ( this.__class__ == set ? this.issubset (other) && !this.issuperset (other) : !this.__ge__ (other) ); }; Array.prototype.__gt__ = function (other) { return ( this.__class__ == set ? this.issuperset (other) && !this.issubset (other) : !this.__le__ (other) ); }; export function bytearray (bytable, encoding) { if (bytable == undefined) { return new Uint8Array (0); } else { let aType = py_typeof (bytable); if (aType == int) { return new Uint8Array (bytable); } else if (aType == str) { let aBytes = new Uint8Array (len (bytable)); for (let i = 0; i < len (bytable); i++) { aBytes [i] = bytable.charCodeAt (i); } return aBytes; } else if (aType == list || aType == tuple) { return new Uint8Array (bytable); } else { throw py_TypeError; } } } export var bytes = bytearray; Uint8Array.prototype.__add__ = function (aBytes) { let result = new Uint8Array (this.length + aBytes.length); result.set (this); result.set (aBytes, this.length); return result; }; Uint8Array.prototype.__mul__ = function (scalar) { let result = new Uint8Array (scalar * this.length); for (let i = 0; i < scalar; i++) { result.set (this, i * this.length); } return result; }; Uint8Array.prototype.__rmul__ = Uint8Array.prototype.__mul__; export function str (stringable) { if (typeof stringable === 'number') return stringable.toString(); else { try { return stringable.__str__ (); } catch (exception) { try { return repr (stringable); } catch (exception) { return String (stringable); } } } }; String.prototype.__class__ = str; str.__name__ = 'str'; str.__bases__ = [object]; String.prototype.__iter__ = function () {new __PyIterator__ (this);}; String.prototype.__repr__ = function () { return (this.indexOf ('\'') == -1 ? '\'' + this + '\'' : '"' + this + '"') .py_replace ('\t', '\\t') .py_replace ('\n', '\\n'); }; String.prototype.__str__ = function () { return this; }; String.prototype.capitalize = function () { return this.charAt (0).toUpperCase () + this.slice (1); }; String.prototype.endswith = function (suffix) { if (suffix instanceof Array) { for (var i=0;i> b; } }; export function __or__ (a, b) { if (typeof a == 'object' && '__or__' in a) { return a.__or__ (b); } else if (typeof b == 'object' && '__ror__' in b) { return b.__ror__ (a); } else { return a | b; } }; export function __xor__ (a, b) { if (typeof a == 'object' && '__xor__' in a) { return a.__xor__ (b); } else if (typeof b == 'object' && '__rxor__' in b) { return b.__rxor__ (a); } else { return a ^ b; } }; export function __and__ (a, b) { if (typeof a == 'object' && '__and__' in a) { return a.__and__ (b); } else if (typeof b == 'object' && '__rand__' in b) { return b.__rand__ (a); } else { return a & b; } }; export function __eq__ (a, b) { if (typeof a == 'object' && '__eq__' in a) { return a.__eq__ (b); } else { return a == b; } }; export function __ne__ (a, b) { if (typeof a == 'object' && '__ne__' in a) { return a.__ne__ (b); } else { return a != b } }; export function __lt__ (a, b) { if (typeof a == 'object' && '__lt__' in a) { return a.__lt__ (b); } else { return a < b; } }; export function __le__ (a, b) { if (typeof a == 'object' && '__le__' in a) { return a.__le__ (b); } else { return a <= b; } }; export function __gt__ (a, b) { if (typeof a == 'object' && '__gt__' in a) { return a.__gt__ (b); } else { return a > b; } }; export function __ge__ (a, b) { if (typeof a == 'object' && '__ge__' in a) { return a.__ge__ (b); } else { return a >= b; } }; export function __imatmul__ (a, b) { if ('__imatmul__' in a) { return a.__imatmul__ (b); } else { return a.__matmul__ (b); } }; export function __ipow__ (a, b) { if (typeof a == 'object' && '__pow__' in a) { return a.__ipow__ (b); } else if (typeof a == 'object' && '__ipow__' in a) { return a.__pow__ (b); } else if (typeof b == 'object' && '__rpow__' in b) { return b.__rpow__ (a); } else { return Math.pow (a, b); } }; export function __ijsmod__ (a, b) { if (typeof a == 'object' && '__imod__' in a) { return a.__ismod__ (b); } else if (typeof a == 'object' && '__mod__' in a) { return a.__mod__ (b); } else if (typeof b == 'object' && '__rpow__' in b) { return b.__rmod__ (a); } else { return a % b; } }; export function __imod__ (a, b) { if (typeof a == 'object' && '__imod__' in a) { return a.__imod__ (b); } else if (typeof a == 'object' && '__mod__' in a) { return a.__mod__ (b); } else if (typeof b == 'object' && '__rmod__' in b) { return b.__rmod__ (a); } else { return ((a % b) + b) % b; } }; export function __imul__ (a, b) { if (typeof a == 'object' && '__imul__' in a) { return a.__imul__ (b); } else if (typeof a == 'object' && '__mul__' in a) { return a = a.__mul__ (b); } else if (typeof b == 'object' && '__rmul__' in b) { return a = b.__rmul__ (a); } else if (typeof a == 'string') { return a = a.__mul__ (b); } else if (typeof b == 'string') { return a = b.__rmul__ (a); } else { return a *= b; } }; export function __idiv__ (a, b) { if (typeof a == 'object' && '__idiv__' in a) { return a.__idiv__ (b); } else if (typeof a == 'object' && '__div__' in a) { return a = a.__div__ (b); } else if (typeof b == 'object' && '__rdiv__' in b) { return a = b.__rdiv__ (a); } else { return a /= b; } }; export function __iadd__ (a, b) { if (typeof a == 'object' && '__iadd__' in a) { return a.__iadd__ (b); } else if (typeof a == 'object' && '__add__' in a) { return a = a.__add__ (b); } else if (typeof b == 'object' && '__radd__' in b) { return a = b.__radd__ (a); } else { return a += b; } }; export function __isub__ (a, b) { if (typeof a == 'object' && '__isub__' in a) { return a.__isub__ (b); } else if (typeof a == 'object' && '__sub__' in a) { return a = a.__sub__ (b); } else if (typeof b == 'object' && '__rsub__' in b) { return a = b.__rsub__ (a); } else { return a -= b; } }; export function __ilshift__ (a, b) { if (typeof a == 'object' && '__ilshift__' in a) { return a.__ilshift__ (b); } else if (typeof a == 'object' && '__lshift__' in a) { return a = a.__lshift__ (b); } else if (typeof b == 'object' && '__rlshift__' in b) { return a = b.__rlshift__ (a); } else { return a <<= b; } }; export function __irshift__ (a, b) { if (typeof a == 'object' && '__irshift__' in a) { return a.__irshift__ (b); } else if (typeof a == 'object' && '__rshift__' in a) { return a = a.__rshift__ (b); } else if (typeof b == 'object' && '__rrshift__' in b) { return a = b.__rrshift__ (a); } else { return a >>= b; } }; export function __ior__ (a, b) { if (typeof a == 'object' && '__ior__' in a) { return a.__ior__ (b); } else if (typeof a == 'object' && '__or__' in a) { return a = a.__or__ (b); } else if (typeof b == 'object' && '__ror__' in b) { return a = b.__ror__ (a); } else { return a |= b; } }; export function __ixor__ (a, b) { if (typeof a == 'object' && '__ixor__' in a) { return a.__ixor__ (b); } else if (typeof a == 'object' && '__xor__' in a) { return a = a.__xor__ (b); } else if (typeof b == 'object' && '__rxor__' in b) { return a = b.__rxor__ (a); } else { return a ^= b; } }; export function __iand__ (a, b) { if (typeof a == 'object' && '__iand__' in a) { return a.__iand__ (b); } else if (typeof a == 'object' && '__and__' in a) { return a = a.__and__ (b); } else if (typeof b == 'object' && '__rand__' in b) { return a = b.__rand__ (a); } else { return a &= b; } }; export function __getitem__ (container, key) { if (typeof container == 'object' && '__getitem__' in container) { return container.__getitem__ (key); } else if ((typeof container == 'string' || container instanceof Array) && key < 0) { return container [container.length + key]; } else { return container [key]; } }; export function __setitem__ (container, key, value) { if (typeof container == 'object' && '__setitem__' in container) { container.__setitem__ (key, value); } else if ((typeof container == 'string' || container instanceof Array) && key < 0) { container [container.length + key] = value; } else { container [key] = value; } }; export function __getslice__ (container, lower, upper, step) { if (typeof container == 'object' && '__getitem__' in container) { return container.__getitem__ ([lower, upper, step]); } else { return container.__getslice__ (lower, upper, step); } }; export function __setslice__ (container, lower, upper, step, value) { if (typeof container == 'object' && '__setitem__' in container) { container.__setitem__ ([lower, upper, step], value); } else { container.__setslice__ (lower, upper, step, value); } }; export var BaseException = __class__ ('BaseException', [object], { __module__: __name__, }); export var Exception = __class__ ('Exception', [BaseException], { __module__: __name__, get __init__ () {return __get__ (this, function (self) { var kwargs = dict (); if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'self': var self = __allkwargs0__ [__attrib0__]; break; default: kwargs [__attrib0__] = __allkwargs0__ [__attrib0__]; } } delete kwargs.__kwargtrans__; } var args = tuple ([].slice.apply (arguments).slice (1, __ilastarg0__ + 1)); } else { var args = tuple (); } self.__args__ = args; if (kwargs.error != null) { self.stack = kwargs.error.stack; } else if (Error) { self.stack = new Error ().stack; } else { self.stack = 'No stack trace available'; } });}, get __repr__ () {return __get__ (this, function (self) { if (len (self.__args__) > 1) { return '{}{}'.format (self.__class__.__name__, repr (tuple (self.__args__))); } else if (len (self.__args__)) { return '{}({})'.format (self.__class__.__name__, repr (self.__args__ [0])); } else { return '{}()'.format (self.__class__.__name__); } });}, get __str__ () {return __get__ (this, function (self) { if (len (self.__args__) > 1) { return str (tuple (self.__args__)); } else if (len (self.__args__)) { return str (self.__args__ [0]); } else { return ''; } });} }); export var IterableError = __class__ ('IterableError', [Exception], { __module__: __name__, get __init__ () {return __get__ (this, function (self, error) { Exception.__init__ (self, "Can't iterate over non-iterable", __kwargtrans__ ({error: error})); });} }); export var StopIteration = __class__ ('StopIteration', [Exception], { __module__: __name__, get __init__ () {return __get__ (this, function (self, error) { Exception.__init__ (self, 'Iterator exhausted', __kwargtrans__ ({error: error})); });} }); export var ValueError = __class__ ('ValueError', [Exception], { __module__: __name__, get __init__ () {return __get__ (this, function (self, message, error) { Exception.__init__ (self, message, __kwargtrans__ ({error: error})); });} }); export var KeyError = __class__ ('KeyError', [Exception], { __module__: __name__, get __init__ () {return __get__ (this, function (self, message, error) { Exception.__init__ (self, message, __kwargtrans__ ({error: error})); });} }); export var AssertionError = __class__ ('AssertionError', [Exception], { __module__: __name__, get __init__ () {return __get__ (this, function (self, message, error) { if (message) { Exception.__init__ (self, message, __kwargtrans__ ({error: error})); } else { Exception.__init__ (self, __kwargtrans__ ({error: error})); } });} }); export var NotImplementedError = __class__ ('NotImplementedError', [Exception], { __module__: __name__, get __init__ () {return __get__ (this, function (self, message, error) { Exception.__init__ (self, message, __kwargtrans__ ({error: error})); });} }); export var IndexError = __class__ ('IndexError', [Exception], { __module__: __name__, get __init__ () {return __get__ (this, function (self, message, error) { Exception.__init__ (self, message, __kwargtrans__ ({error: error})); });} }); export var AttributeError = __class__ ('AttributeError', [Exception], { __module__: __name__, get __init__ () {return __get__ (this, function (self, message, error) { Exception.__init__ (self, message, __kwargtrans__ ({error: error})); });} }); export var py_TypeError = __class__ ('py_TypeError', [Exception], { __module__: __name__, get __init__ () {return __get__ (this, function (self, message, error) { Exception.__init__ (self, message, __kwargtrans__ ({error: error})); });} }); export var Warning = __class__ ('Warning', [Exception], { __module__: __name__, }); export var UserWarning = __class__ ('UserWarning', [Warning], { __module__: __name__, }); export var DeprecationWarning = __class__ ('DeprecationWarning', [Warning], { __module__: __name__, }); export var RuntimeWarning = __class__ ('RuntimeWarning', [Warning], { __module__: __name__, }); export var __sort__ = function (iterable, key, reverse) { if (typeof key == 'undefined' || (key != null && key.hasOwnProperty ("__kwargtrans__"))) {; var key = null; }; if (typeof reverse == 'undefined' || (reverse != null && reverse.hasOwnProperty ("__kwargtrans__"))) {; var reverse = false; }; if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'iterable': var iterable = __allkwargs0__ [__attrib0__]; break; case 'key': var key = __allkwargs0__ [__attrib0__]; break; case 'reverse': var reverse = __allkwargs0__ [__attrib0__]; break; } } } } else { } if (key) { iterable.sort ((function __lambda__ (a, b) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'a': var a = __allkwargs0__ [__attrib0__]; break; case 'b': var b = __allkwargs0__ [__attrib0__]; break; } } } } else { } return (key (a) > key (b) ? 1 : -(1)); })); } else { iterable.sort (); } if (reverse) { iterable.reverse (); } }; export var sorted = function (iterable, key, reverse) { if (typeof key == 'undefined' || (key != null && key.hasOwnProperty ("__kwargtrans__"))) {; var key = null; }; if (typeof reverse == 'undefined' || (reverse != null && reverse.hasOwnProperty ("__kwargtrans__"))) {; var reverse = false; }; if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'iterable': var iterable = __allkwargs0__ [__attrib0__]; break; case 'key': var key = __allkwargs0__ [__attrib0__]; break; case 'reverse': var reverse = __allkwargs0__ [__attrib0__]; break; } } } } else { } if (py_typeof (iterable) == dict) { var result = copy (iterable.py_keys ()); } else { var result = copy (iterable); } __sort__ (result, key, reverse); return result; }; export var map = function (func, iterable) { return (function () { var __accu0__ = []; for (var item of iterable) { __accu0__.append (func (item)); } return __accu0__; }) (); }; export var filter = function (func, iterable) { if (func == null) { var func = bool; } return (function () { var __accu0__ = []; for (var item of iterable) { if (func (item)) { __accu0__.append (item); } } return __accu0__; }) (); }; export var divmod = function (n, d) { return tuple ([Math.floor (n / d), __mod__ (n, d)]); }; export var __Terminal__ = __class__ ('__Terminal__', [object], { __module__: __name__, get __init__ () {return __get__ (this, function (self) { self.buffer = ''; try { self.element = document.getElementById ('__terminal__'); } catch (__except0__) { self.element = null; } if (self.element) { self.element.style.overflowX = 'auto'; self.element.style.boxSizing = 'border-box'; self.element.style.padding = '5px'; self.element.innerHTML = '_'; } });}, get print () {return __get__ (this, function (self) { var sep = ' '; var end = '\n'; if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'self': var self = __allkwargs0__ [__attrib0__]; break; case 'sep': var sep = __allkwargs0__ [__attrib0__]; break; case 'end': var end = __allkwargs0__ [__attrib0__]; break; } } } var args = tuple ([].slice.apply (arguments).slice (1, __ilastarg0__ + 1)); } else { var args = tuple (); } self.buffer = '{}{}{}'.format (self.buffer, sep.join ((function () { var __accu0__ = []; for (var arg of args) { __accu0__.append (str (arg)); } return __accu0__; }) ()), end).__getslice__ (-(4096), null, 1); if (self.element) { self.element.innerHTML = self.buffer.py_replace ('\n', '
').py_replace (' ', ' '); self.element.scrollTop = self.element.scrollHeight; } else { console.log (sep.join ((function () { var __accu0__ = []; for (var arg of args) { __accu0__.append (str (arg)); } return __accu0__; }) ())); } });}, get input () {return __get__ (this, function (self, question) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'self': var self = __allkwargs0__ [__attrib0__]; break; case 'question': var question = __allkwargs0__ [__attrib0__]; break; } } } } else { } self.print ('{}'.format (question), __kwargtrans__ ({end: ''})); var answer = window.prompt ('\n'.join (self.buffer.py_split ('\n').__getslice__ (-(8), null, 1))); self.print (answer); return answer; });} }); export var __terminal__ = __Terminal__ (); export var print = __terminal__.print; export var input = __terminal__.input; //# sourceMappingURL=org.transcrypt.__runtime__.map ================================================ FILE: docs/examples/transcrypt/sketch_006/target/org.transcrypt.__runtime__.py ================================================ # Transcrypt runtime module #__pragma__ ('js', 'export var __envir__ = {{}};\n{}', __include__ ('org/transcrypt/__envir__.js')) #__pragma__ ('js', '{}', __include__ ('org/transcrypt/__core__.js')) #__pragma__ ('js', '{}', __include__ ('org/transcrypt/__builtin__.js')) #__pragma__ ('skip') copy = Math = __typeof__ = __repr__ = document = console = window = 0 #__pragma__ ('noskip') #__pragma__ ('notconv') # !!! tconv gives a problem with __terminal__, needs investigation #__pragma__ ('nokwargs') #__pragma__ ('noalias', 'sort') class BaseException: pass class Exception (BaseException): #__pragma__ ('kwargs') def __init__ (self, *args, **kwargs): self.__args__ = args if kwargs.error != None: self.stack = kwargs.error.stack # Integrate with JavaScript Error object elif Error: self.stack = (__new__(Error())).stack # Create our own stack if we aren't given one else: self.stack = 'No stack trace available' #__pragma__ ('nokwargs') def __repr__ (self): if len (self.__args__) > 1: return '{}{}'.format (self.__class__.__name__, repr (tuple (self.__args__))) elif len (self.__args__): return '{}({})'.format (self.__class__.__name__, repr (self.__args__ [0])) else: return '{}()'.format (self.__class__.__name__) def __str__ (self): if len (self.__args__) > 1: return str (tuple (self.__args__)) elif len (self.__args__): return str (self.__args__ [0]) else: return '' class IterableError (Exception): def __init__ (self, error): Exception.__init__ (self, 'Can\'t iterate over non-iterable', error = error) class StopIteration (Exception): def __init__ (self, error): Exception.__init__ (self, 'Iterator exhausted', error = error) class ValueError (Exception): def __init__ (self, message, error): Exception.__init__ (self, message, error = error) class KeyError (Exception): def __init__ (self, message, error): Exception.__init__ (self, message, error = error) class AssertionError (Exception): def __init__ (self, message, error): if message: Exception.__init__ (self, message, error = error) else: Exception.__init__ (self, error = error) class NotImplementedError (Exception): def __init__(self, message, error): Exception.__init__(self, message, error = error) class IndexError (Exception): def __init__(self, message, error): Exception.__init__(self, message, error = error) class AttributeError (Exception): def __init__(self, message, error): Exception.__init__(self, message, error = error) class TypeError (Exception): def __init__(self, message, error): Exception.__init__(self, message, error = error) # Warnings Exceptions # N.B. This is a limited subset of the warnings defined in # the cpython implementation to keep things small for now. class Warning (Exception): ''' Warning Base Class ''' pass class UserWarning (Warning): pass class DeprecationWarning (Warning): pass class RuntimeWarning (Warning): pass #__pragma__ ('kwargs') def __sort__ (iterable, key = None, reverse = False): # Used by py_sort, can deal with kwargs if key: iterable.sort (lambda a, b: 1 if key (a) > key (b) else -1) # JavaScript sort, case '==' is irrelevant for sorting else: iterable.sort () # JavaScript sort if reverse: iterable.reverse () def sorted (iterable, key = None, reverse = False): if type (iterable) == dict: result = copy (iterable.keys ()) else: result = copy (iterable) __sort__ (result, key, reverse) return result #__pragma__ ('nokwargs') def map (func, iterable): return [func (item) for item in iterable] def filter (func, iterable): if func == None: func = bool return [item for item in iterable if func (item)] def divmod (n, d): return n // d, n % d #__pragma__ ('ifdef', '__complex__') class complex: def __init__ (self, real, imag = None): if imag == None: if type (real) == complex: self.real = real.real self.imag = real.imag else: self.real = real self.imag = 0 else: self.real = real self.imag = imag def __neg__ (self): return complex (-self.real, -self.imag) def __exp__ (self): modulus = Math.exp (self.real) return complex (modulus * Math.cos (self.imag), modulus * Math.sin (self.imag)) def __log__ (self): return complex (Math.log (Math.sqrt (self.real * self.real + self.imag * self.imag)), Math.atan2 (self.imag, self.real)) def __pow__ (self, other): # a ** b = exp (b log a) return (self.__log__ () .__mul__ (other)) .__exp__ () def __rpow__ (self, real): # real ** comp -> comp.__rpow__ (real) return self.__mul__ (Math.log (real)) .__exp__ () def __mul__ (self, other): if __typeof__ (other) is 'number': return complex (self.real * other, self.imag * other) else: return complex (self.real * other.real - self.imag * other.imag, self.real * other.imag + self.imag * other.real) def __rmul__ (self, real): # real + comp -> comp.__rmul__ (real) return complex (self.real * real, self.imag * real) def __div__ (self, other): if __typeof__ (other) is 'number': return complex (self.real / other, self.imag / other) else: denom = other.real * other.real + other.imag * other.imag return complex ( (self.real * other.real + self.imag * other.imag) / denom, (self.imag * other.real - self.real * other.imag) / denom ) def __rdiv__ (self, real): # real / comp -> comp.__rdiv__ (real) denom = self.real * self.real return complex ( (real * self.real) / denom, (real * self.imag) / denom ) def __add__ (self, other): if __typeof__ (other) is 'number': return complex (self.real + other, self.imag) else: # Assume other is complex return complex (self.real + other.real, self.imag + other.imag) def __radd__ (self, real): # real + comp -> comp.__radd__ (real) return complex (self.real + real, self.imag) def __sub__ (self, other): if __typeof__ (other) is 'number': return complex (self.real - other, self.imag) else: return complex (self.real - other.real, self.imag - other.imag) def __rsub__ (self, real): # real - comp -> comp.__rsub__ (real) return complex (real - self.real, -self.imag) def __repr__ (self): return '({}{}{}j)'.format (self.real, '+' if self.imag >= 0 else '', self.imag) def __str__ (self): return __repr__ (self) [1 : -1] def __eq__ (self, other): if __typeof__ (other) is 'number': return self.real == other else: return self.real == other.real and self.imag == other.imag def __ne__ (self, other): if __typeof__ (other) is 'number': return self.real != other else: return self.real != other.real or self.imag != other.imag def conjugate (self): return complex (self.real, -self.imag) def __conj__ (aNumber): if isinstance (aNumber, complex): return complex (aNumber.real, -aNumber.imag) else: return complex (aNumber, 0) #__pragma__ ('endif') class __Terminal__: ''' Printing to either the console or to html happens async, but is blocked by calling window.prompt. So while all input and print statements are encountered in normal order, the print's exit immediately without yet having actually printed This means the next input takes control, blocking actual printing and so on indefinitely The effect is that everything's only printed after all inputs are done To prevent that, what's needed is to only execute the next window.prompt after actual printing has been done Since we've no way to find out when that is, a timeout is used. ''' def __init__ (self): self.buffer = '' try: self.element = document.getElementById ('__terminal__') except: self.element = None if self.element: self.element.style.overflowX = 'auto' self.element.style.boxSizing = 'border-box' self.element.style.padding = '5px' self.element.innerHTML = '_' #__pragma__ ('kwargs') def print (self, *args, sep = ' ', end = '\n'): self.buffer = '{}{}{}'.format (self.buffer, sep.join ([str (arg) for arg in args]), end) [-4096 : ] if self.element: self.element.innerHTML = self.buffer.replace ('\n', '
') .replace (' ', ' ') self.element.scrollTop = self.element.scrollHeight else: console.log (sep.join ([str (arg) for arg in args])) def input (self, question): self.print ('{}'.format (question), end = '') answer = window.prompt ('\n'.join (self.buffer.split ('\n') [-8:])) self.print (answer) return answer #__pragma__ ('nokwargs') __terminal__ = __Terminal__ () print = __terminal__.print input = __terminal__.input ================================================ FILE: docs/examples/transcrypt/sketch_006/target/pyp5js.js ================================================ // Transcrypt'ed from Python, 2021-11-02 13:06:14 import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, all, any, assert, bool, bytearray, bytes, callable, chr, deepcopy, delattr, dict, dir, divmod, enumerate, getattr, hasattr, isinstance, issubclass, len, list, object, ord, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, setattr, sorted, sum, tuple, zip} from './org.transcrypt.__runtime__.js'; import {PythonFunctions} from './python_functions.js'; var __name__ = 'pyp5js'; export var _P5_INSTANCE = null; export var _CTX_MIDDLE = null; export var _DEFAULT_FILL = null; export var _DEFAULT_LEADMULT = null; export var _DEFAULT_STROKE = null; export var _DEFAULT_TEXT_FILL = null; export var ADD = null; export var ALT = null; export var ARROW = null; export var AUDIO = null; export var AUTO = null; export var AXES = null; export var BACKSPACE = null; export var BASELINE = null; export var BEVEL = null; export var BEZIER = null; export var BLEND = null; export var BLUR = null; export var BOLD = null; export var BOLDITALIC = null; export var BOTTOM = null; export var BURN = null; export var CENTER = null; export var CHORD = null; export var CLAMP = null; export var CLOSE = null; export var CONTROL = null; export var CORNER = null; export var CORNERS = null; export var CROSS = null; export var CURVE = null; export var DARKEST = null; export var DEG_TO_RAD = null; export var DEGREES = null; export var DELETE = null; export var DIFFERENCE = null; export var DILATE = null; export var DODGE = null; export var DOWN_ARROW = null; export var ENTER = null; export var ERODE = null; export var ESCAPE = null; export var EXCLUSION = null; export var FILL = null; export var GRAY = null; export var GRID = null; export var HALF_PI = null; export var HAND = null; export var HARD_LIGHT = null; export var HSB = null; export var HSL = null; export var IMAGE = null; export var IMMEDIATE = null; export var INVERT = null; export var ITALIC = null; export var LANDSCAPE = null; export var LEFT = null; export var LEFT_ARROW = null; export var LIGHTEST = null; export var LINE_LOOP = null; export var LINE_STRIP = null; export var LINEAR = null; export var LINES = null; export var MIRROR = null; export var MITER = null; export var MOVE = null; export var MULTIPLY = null; export var NEAREST = null; export var NORMAL = null; export var OPAQUE = null; export var OPEN = null; export var OPTION = null; export var OVERLAY = null; export var PI = null; export var PIE = null; export var POINTS = null; export var PORTRAIT = null; export var POSTERIZE = null; export var PROJECT = null; export var QUAD_STRIP = null; export var QUADRATIC = null; export var QUADS = null; export var QUARTER_PI = null; export var RAD_TO_DEG = null; export var RADIANS = null; export var RADIUS = null; export var REPEAT = null; export var REPLACE = null; export var RETURN = null; export var RGB = null; export var RIGHT = null; export var RIGHT_ARROW = null; export var ROUND = null; export var SCREEN = null; export var SHIFT = null; export var SOFT_LIGHT = null; export var SQUARE = null; export var STROKE = null; export var SUBTRACT = null; export var TAB = null; export var TAU = null; export var TEXT = null; export var TEXTURE = null; export var THRESHOLD = null; export var TOP = null; export var TRIANGLE_FAN = null; export var TRIANGLE_STRIP = null; export var TRIANGLES = null; export var TWO_PI = null; export var UP_ARROW = null; export var VIDEO = null; export var WAIT = null; export var WEBGL = null; export var P2D = null; var PI = null; export var frameCount = null; export var focused = null; export var displayWidth = null; export var displayHeight = null; export var windowWidth = null; export var windowHeight = null; export var width = null; export var height = null; export var disableFriendlyErrors = null; export var deviceOrientation = null; export var accelerationX = null; export var accelerationY = null; export var accelerationZ = null; export var pAccelerationX = null; export var pAccelerationY = null; export var pAccelerationZ = null; export var rotationX = null; export var rotationY = null; export var rotationZ = null; export var pRotationX = null; export var pRotationY = null; export var pRotationZ = null; export var turnAxis = null; export var keyIsPressed = null; export var key = null; export var keyCode = null; export var mouseX = null; export var mouseY = null; export var pmouseX = null; export var pmouseY = null; export var winMouseX = null; export var winMouseY = null; export var pwinMouseX = null; export var pwinMouseY = null; export var mouseButton = null; export var mouseIsPressed = null; export var touches = null; export var pixels = null; export var alpha = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.alpha (...args); }; export var blue = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.blue (...args); }; export var brightness = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.brightness (...args); }; export var color = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.color (...args); }; export var green = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.green (...args); }; export var hue = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.hue (...args); }; export var lerpColor = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.lerpColor (...args); }; export var lightness = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.lightness (...args); }; export var red = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.red (...args); }; export var saturation = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.saturation (...args); }; export var background = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.background (...args); }; export var py_clear = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } var p5_clear = _P5_INSTANCE.clear (...args); return p5_clear; }; export var erase = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.erase (...args); }; export var noErase = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noErase (...args); }; export var colorMode = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.colorMode (...args); }; export var fill = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.fill (...args); }; export var noFill = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noFill (...args); }; export var noStroke = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noStroke (...args); }; export var stroke = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.stroke (...args); }; export var arc = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.arc (...args); }; export var ellipse = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.ellipse (...args); }; export var circle = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.circle (...args); }; export var line = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.line (...args); }; export var point = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.point (...args); }; export var quad = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.quad (...args); }; export var rect = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.rect (...args); }; export var square = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.square (...args); }; export var triangle = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.triangle (...args); }; export var plane = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.plane (...args); }; export var box = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.box (...args); }; export var sphere = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.sphere (...args); }; export var cylinder = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.cylinder (...args); }; export var cone = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.cone (...args); }; export var ellipsoid = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.ellipsoid (...args); }; export var torus = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.torus (...args); }; export var loadModel = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.loadModel (...args); }; export var model = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.model (...args); }; export var ellipseMode = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.ellipseMode (...args); }; export var noSmooth = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noSmooth (...args); }; export var rectMode = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.rectMode (...args); }; export var smooth = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.smooth (...args); }; export var strokeCap = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.strokeCap (...args); }; export var strokeJoin = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.strokeJoin (...args); }; export var strokeWeight = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.strokeWeight (...args); }; export var bezier = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.bezier (...args); }; export var bezierDetail = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.bezierDetail (...args); }; export var bezierPoint = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.bezierPoint (...args); }; export var bezierTangent = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.bezierTangent (...args); }; export var curve = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.curve (...args); }; export var curveDetail = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.curveDetail (...args); }; export var curveTightness = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.curveTightness (...args); }; export var curvePoint = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.curvePoint (...args); }; export var curveTangent = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.curveTangent (...args); }; export var beginContour = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.beginContour (...args); }; export var beginShape = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.beginShape (...args); }; export var bezierVertex = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.bezierVertex (...args); }; export var curveVertex = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.curveVertex (...args); }; export var endContour = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.endContour (...args); }; export var endShape = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.endShape (...args); }; export var quadraticVertex = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.quadraticVertex (...args); }; export var vertex = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.vertex (...args); }; export var cursor = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.cursor (...args); }; export var frameRate = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.frameRate (...args); }; export var noCursor = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noCursor (...args); }; export var fullscreen = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.fullscreen (...args); }; export var pixelDensity = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.pixelDensity (...args); }; export var displayDensity = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.displayDensity (...args); }; export var getURL = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.getURL (...args); }; export var getURLPath = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.getURLPath (...args); }; export var getURLParams = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.getURLParams (...args); }; export var preload = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.preload (...args); }; export var setup = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.setup (...args); }; export var draw = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.draw (...args); }; export var remove = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.remove (...args); }; export var noLoop = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noLoop (...args); }; export var loop = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.loop (...args); }; export var push = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.push (...args); }; export var redraw = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.redraw (...args); }; export var resizeCanvas = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.resizeCanvas (...args); }; export var noCanvas = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noCanvas (...args); }; export var createGraphics = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createGraphics (...args); }; export var blendMode = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.blendMode (...args); }; export var setAttributes = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.setAttributes (...args); }; export var applyMatrix = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.applyMatrix (...args); }; export var resetMatrix = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.resetMatrix (...args); }; export var rotate = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.rotate (...args); }; export var rotateX = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.rotateX (...args); }; export var rotateY = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.rotateY (...args); }; export var rotateZ = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.rotateZ (...args); }; export var scale = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.scale (...args); }; export var shearX = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.shearX (...args); }; export var shearY = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.shearY (...args); }; export var translate = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.translate (...args); }; export var createStringDict = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createStringDict (...args); }; export var createNumberDict = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createNumberDict (...args); }; export var append = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.append (...args); }; export var arrayCopy = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.arrayCopy (...args); }; export var concat = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.concat (...args); }; export var reverse = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.reverse (...args); }; export var shorten = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.shorten (...args); }; export var shuffle = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.shuffle (...args); }; export var py_sort = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.py_sort (...args); }; export var splice = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.splice (...args); }; export var subset = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.subset (...args); }; export var float = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.float (...args); }; export var int = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.int (...args); }; export var str = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.str (...args); }; export var boolean = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.boolean (...args); }; export var byte = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.byte (...args); }; export var char = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.char (...args); }; export var unchar = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.unchar (...args); }; export var hex = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.hex (...args); }; export var unhex = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.unhex (...args); }; export var join = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.join (...args); }; export var match = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.match (...args); }; export var matchAll = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.matchAll (...args); }; export var nf = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.nf (...args); }; export var nfc = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.nfc (...args); }; export var nfp = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.nfp (...args); }; export var nfs = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.nfs (...args); }; export var py_split = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.py_split (...args); }; export var splitTokens = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.splitTokens (...args); }; export var trim = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.trim (...args); }; export var setMoveThreshold = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.setMoveThreshold (...args); }; export var setShakeThreshold = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.setShakeThreshold (...args); }; export var keyIsDown = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.keyIsDown (...args); }; export var createImage = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createImage (...args); }; export var saveCanvas = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.saveCanvas (...args); }; export var saveFrames = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.saveFrames (...args); }; export var image_proxy = function (img) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'img': var img = __allkwargs0__ [__attrib0__]; break; } } } } else { } var _set = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } var value = img.set (...args); return value; }; var _get = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } var value = img.get (...args); return value; }; img.py_set = _set; img.py_get = _get; return img; }; export var loadImage = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } var imageObj = _P5_INSTANCE.loadImage (...args); return image_proxy (imageObj); }; export var image = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.image (...args); }; export var tint = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.tint (...args); }; export var noTint = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noTint (...args); }; export var imageMode = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.imageMode (...args); }; export var blend = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.blend (...args); }; export var copy = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.copy (...args); }; export var filter = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } if (len (args) > 1 && (args [0] === null || callable (args [0]))) { return PythonFunctions.filter (...args); } else { return _P5_INSTANCE.filter (...args); } }; export var py_get = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } var p5_get = _P5_INSTANCE.get (...args); return p5_get; }; export var loadPixels = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.loadPixels (...args); }; export var py_set = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } if (len (args) <= 1) { return PythonFunctions.py_set (...args); } else { return _P5_INSTANCE.py_set (...args); } }; export var updatePixels = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.updatePixels (...args); }; export var loadJSON = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.loadJSON (...args); }; export var loadStrings = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.loadStrings (...args); }; export var loadTable = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.loadTable (...args); }; export var loadXML = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.loadXML (...args); }; export var loadBytes = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.loadBytes (...args); }; export var httpGet = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.httpGet (...args); }; export var httpPost = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.httpPost (...args); }; export var httpDo = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.httpDo (...args); }; export var createWriter = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createWriter (...args); }; export var save = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.save (...args); }; export var saveJSON = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.saveJSON (...args); }; export var saveStrings = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.saveStrings (...args); }; export var saveTable = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.saveTable (...args); }; export var day = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.day (...args); }; export var hour = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.hour (...args); }; export var minute = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.minute (...args); }; export var millis = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.millis (...args); }; export var month = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.month (...args); }; export var second = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.second (...args); }; export var year = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.year (...args); }; export var createVector = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createVector (...args); }; export var abs = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.abs (...args); }; export var ceil = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.ceil (...args); }; export var constrain = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.constrain (...args); }; export var dist = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.dist (...args); }; export var exp = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.exp (...args); }; export var floor = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.floor (...args); }; export var lerp = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.lerp (...args); }; export var log = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.log (...args); }; export var mag = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.mag (...args); }; export var map = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } if (len (args) > 1 && callable (args [0])) { return PythonFunctions.map (...args); } else { return _P5_INSTANCE.map (...args); } }; export var max = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.max (...args); }; export var min = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.min (...args); }; export var norm = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.norm (...args); }; export var pow = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.pow (...args); }; export var round = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.round (...args); }; export var sq = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.sq (...args); }; export var sqrt = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.sqrt (...args); }; export var noise = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noise (...args); }; export var noiseDetail = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noiseDetail (...args); }; export var noiseSeed = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noiseSeed (...args); }; export var randomSeed = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.randomSeed (...args); }; export var random = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.random (...args); }; export var randomGaussian = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.randomGaussian (...args); }; export var acos = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.acos (...args); }; export var asin = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.asin (...args); }; export var atan = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.atan (...args); }; export var atan2 = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.atan2 (...args); }; export var cos = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.cos (...args); }; export var sin = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.sin (...args); }; export var tan = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.tan (...args); }; export var degrees = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.degrees (...args); }; export var radians = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.radians (...args); }; export var angleMode = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.angleMode (...args); }; export var textAlign = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.textAlign (...args); }; export var textLeading = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.textLeading (...args); }; export var textSize = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.textSize (...args); }; export var textStyle = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.textStyle (...args); }; export var textWidth = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.textWidth (...args); }; export var textAscent = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.textAscent (...args); }; export var textDescent = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.textDescent (...args); }; export var loadFont = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.loadFont (...args); }; export var text = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.text (...args); }; export var textFont = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.textFont (...args); }; export var orbitControl = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.orbitControl (...args); }; export var debugMode = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.debugMode (...args); }; export var noDebugMode = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noDebugMode (...args); }; export var ambientLight = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.ambientLight (...args); }; export var directionalLight = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.directionalLight (...args); }; export var pointLight = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.pointLight (...args); }; export var lights = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.lights (...args); }; export var loadShader = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.loadShader (...args); }; export var createShader = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createShader (...args); }; export var shader = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.shader (...args); }; export var resetShader = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.resetShader (...args); }; export var normalMaterial = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.normalMaterial (...args); }; export var texture = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.texture (...args); }; export var textureMode = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.textureMode (...args); }; export var textureWrap = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.textureWrap (...args); }; export var ambientMaterial = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.ambientMaterial (...args); }; export var specularMaterial = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.specularMaterial (...args); }; export var shininess = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.shininess (...args); }; export var camera = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.camera (...args); }; export var perspective = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.perspective (...args); }; export var ortho = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.ortho (...args); }; export var createCamera = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createCamera (...args); }; export var setCamera = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.setCamera (...args); }; export var select = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.select (...args); }; export var selectAll = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.selectAll (...args); }; export var removeElements = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.removeElements (...args); }; export var changed = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.changed (...args); }; export var input = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.input (...args); }; export var createDiv = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createDiv (...args); }; export var createP = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createP (...args); }; export var createSpan = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createSpan (...args); }; export var createImg = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createImg (...args); }; export var createA = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createA (...args); }; export var createSlider = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createSlider (...args); }; export var createButton = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createButton (...args); }; export var createCheckbox = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createCheckbox (...args); }; export var createSelect = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createSelect (...args); }; export var createRadio = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createRadio (...args); }; export var createColorPicker = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createColorPicker (...args); }; export var createInput = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createInput (...args); }; export var createFileInput = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createFileInput (...args); }; export var createVideo = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createVideo (...args); }; export var createAudio = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createAudio (...args); }; export var createCapture = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createCapture (...args); }; export var createElement = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createElement (...args); }; export var createCanvas = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } var canvas = _P5_INSTANCE.createCanvas (...args); width = _P5_INSTANCE.width; height = _P5_INSTANCE.height; return canvas; }; export var py_pop = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } var p5_pop = _P5_INSTANCE.pop (...args); return p5_pop; }; export var size = createCanvas; export var popMatrix = py_pop; export var popStyle = py_pop; export var pushMatrix = push; export var pushStyle = push; export var PVector = function (x, y, z) { if (typeof x == 'undefined' || (x != null && x.hasOwnProperty ("__kwargtrans__"))) {; var x = 0; }; if (typeof y == 'undefined' || (y != null && y.hasOwnProperty ("__kwargtrans__"))) {; var y = 0; }; if (typeof z == 'undefined' || (z != null && z.hasOwnProperty ("__kwargtrans__"))) {; var z = 0; }; if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'x': var x = __allkwargs0__ [__attrib0__]; break; case 'y': var y = __allkwargs0__ [__attrib0__]; break; case 'z': var z = __allkwargs0__ [__attrib0__]; break; } } } } else { } return _P5_INSTANCE.createVector (x, y, z); }; setattr (PVector, 'dist', p5.Vector.dist); setattr (PVector, 'add', p5.Vector.add); setattr (PVector, 'sub', p5.Vector.sub); setattr (PVector, 'mult', p5.Vector.mult); setattr (PVector, 'div', p5.Vector.div); setattr (PVector, 'dot', p5.Vector.dot); setattr (PVector, 'cross', p5.Vector.cross); setattr (PVector, 'lerp', p5.Vector.lerp); setattr (PVector, 'random2D', p5.Vector.random2D); setattr (PVector, 'random3D', p5.Vector.random3D); setattr (PVector, 'angleBetween', p5.Vector.angleBetween); setattr (PVector, 'fromAngle', p5.Vector.fromAngle); setattr (PVector, 'fromAngles', p5.Vector.fromAngles); setattr (PVector, 'equals', p5.Vector.equals); export var pre_draw = function (p5_instance, draw_func) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'p5_instance': var p5_instance = __allkwargs0__ [__attrib0__]; break; case 'draw_func': var draw_func = __allkwargs0__ [__attrib0__]; break; } } } } else { } _CTX_MIDDLE = p5_instance._CTX_MIDDLE; _DEFAULT_FILL = p5_instance._DEFAULT_FILL; _DEFAULT_LEADMULT = p5_instance._DEFAULT_LEADMULT; _DEFAULT_STROKE = p5_instance._DEFAULT_STROKE; _DEFAULT_TEXT_FILL = p5_instance._DEFAULT_TEXT_FILL; ADD = p5_instance.ADD; ALT = p5_instance.ALT; ARROW = p5_instance.ARROW; AUDIO = p5_instance.AUDIO; AUTO = p5_instance.AUTO; AXES = p5_instance.AXES; BACKSPACE = p5_instance.BACKSPACE; BASELINE = p5_instance.BASELINE; BEVEL = p5_instance.BEVEL; BEZIER = p5_instance.BEZIER; BLEND = p5_instance.BLEND; BLUR = p5_instance.BLUR; BOLD = p5_instance.BOLD; BOLDITALIC = p5_instance.BOLDITALIC; BOTTOM = p5_instance.BOTTOM; BURN = p5_instance.BURN; CENTER = p5_instance.CENTER; CHORD = p5_instance.CHORD; CLAMP = p5_instance.CLAMP; CLOSE = p5_instance.CLOSE; CONTROL = p5_instance.CONTROL; CORNER = p5_instance.CORNER; CORNERS = p5_instance.CORNERS; CROSS = p5_instance.CROSS; CURVE = p5_instance.CURVE; DARKEST = p5_instance.DARKEST; DEG_TO_RAD = p5_instance.DEG_TO_RAD; DEGREES = p5_instance.DEGREES; DELETE = p5_instance.DELETE; DIFFERENCE = p5_instance.DIFFERENCE; DILATE = p5_instance.DILATE; DODGE = p5_instance.DODGE; DOWN_ARROW = p5_instance.DOWN_ARROW; ENTER = p5_instance.ENTER; ERODE = p5_instance.ERODE; ESCAPE = p5_instance.ESCAPE; EXCLUSION = p5_instance.EXCLUSION; FILL = p5_instance.FILL; GRAY = p5_instance.GRAY; GRID = p5_instance.GRID; HALF_PI = p5_instance.HALF_PI; HAND = p5_instance.HAND; HARD_LIGHT = p5_instance.HARD_LIGHT; HSB = p5_instance.HSB; HSL = p5_instance.HSL; IMAGE = p5_instance.IMAGE; IMMEDIATE = p5_instance.IMMEDIATE; INVERT = p5_instance.INVERT; ITALIC = p5_instance.ITALIC; LANDSCAPE = p5_instance.LANDSCAPE; LEFT = p5_instance.LEFT; LEFT_ARROW = p5_instance.LEFT_ARROW; LIGHTEST = p5_instance.LIGHTEST; LINE_LOOP = p5_instance.LINE_LOOP; LINE_STRIP = p5_instance.LINE_STRIP; LINEAR = p5_instance.LINEAR; LINES = p5_instance.LINES; MIRROR = p5_instance.MIRROR; MITER = p5_instance.MITER; MOVE = p5_instance.MOVE; MULTIPLY = p5_instance.MULTIPLY; NEAREST = p5_instance.NEAREST; NORMAL = p5_instance.NORMAL; OPAQUE = p5_instance.OPAQUE; OPEN = p5_instance.OPEN; OPTION = p5_instance.OPTION; OVERLAY = p5_instance.OVERLAY; P2D = p5_instance.P2D; var P3D = p5_instance.WEBGL; PI = p5_instance.PI; PIE = p5_instance.PIE; POINTS = p5_instance.POINTS; PORTRAIT = p5_instance.PORTRAIT; POSTERIZE = p5_instance.POSTERIZE; PROJECT = p5_instance.PROJECT; QUAD_STRIP = p5_instance.QUAD_STRIP; QUADRATIC = p5_instance.QUADRATIC; QUADS = p5_instance.QUADS; QUARTER_PI = p5_instance.QUARTER_PI; RAD_TO_DEG = p5_instance.RAD_TO_DEG; RADIANS = p5_instance.RADIANS; RADIUS = p5_instance.RADIUS; REPEAT = p5_instance.REPEAT; REPLACE = p5_instance.REPLACE; RETURN = p5_instance.RETURN; RGB = p5_instance.RGB; RIGHT = p5_instance.RIGHT; RIGHT_ARROW = p5_instance.RIGHT_ARROW; ROUND = p5_instance.ROUND; SCREEN = p5_instance.SCREEN; SHIFT = p5_instance.SHIFT; SOFT_LIGHT = p5_instance.SOFT_LIGHT; SQUARE = p5_instance.SQUARE; STROKE = p5_instance.STROKE; SUBTRACT = p5_instance.SUBTRACT; TAB = p5_instance.TAB; TAU = p5_instance.TAU; TEXT = p5_instance.TEXT; TEXTURE = p5_instance.TEXTURE; THRESHOLD = p5_instance.THRESHOLD; TOP = p5_instance.TOP; TRIANGLE_FAN = p5_instance.TRIANGLE_FAN; TRIANGLE_STRIP = p5_instance.TRIANGLE_STRIP; TRIANGLES = p5_instance.TRIANGLES; TWO_PI = p5_instance.TWO_PI; UP_ARROW = p5_instance.UP_ARROW; VIDEO = p5_instance.VIDEO; WAIT = p5_instance.WAIT; WEBGL = p5_instance.WEBGL; frameCount = p5_instance.frameCount; focused = p5_instance.focused; displayWidth = p5_instance.displayWidth; displayHeight = p5_instance.displayHeight; windowWidth = p5_instance.windowWidth; windowHeight = p5_instance.windowHeight; width = p5_instance.width; height = p5_instance.height; disableFriendlyErrors = p5_instance.disableFriendlyErrors; deviceOrientation = p5_instance.deviceOrientation; accelerationX = p5_instance.accelerationX; accelerationY = p5_instance.accelerationY; accelerationZ = p5_instance.accelerationZ; pAccelerationX = p5_instance.pAccelerationX; pAccelerationY = p5_instance.pAccelerationY; pAccelerationZ = p5_instance.pAccelerationZ; rotationX = p5_instance.rotationX; rotationY = p5_instance.rotationY; rotationZ = p5_instance.rotationZ; pRotationX = p5_instance.pRotationX; pRotationY = p5_instance.pRotationY; pRotationZ = p5_instance.pRotationZ; turnAxis = p5_instance.turnAxis; keyIsPressed = p5_instance.keyIsPressed; key = p5_instance.key; keyCode = p5_instance.keyCode; mouseX = p5_instance.mouseX; mouseY = p5_instance.mouseY; pmouseX = p5_instance.pmouseX; pmouseY = p5_instance.pmouseY; winMouseX = p5_instance.winMouseX; winMouseY = p5_instance.winMouseY; pwinMouseX = p5_instance.pwinMouseX; pwinMouseY = p5_instance.pwinMouseY; mouseButton = p5_instance.mouseButton; mouseIsPressed = p5_instance.mouseIsPressed; touches = p5_instance.touches; pixels = p5_instance.pixels; return draw_func (); }; export var global_p5_injection = function (p5_sketch) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'p5_sketch': var p5_sketch = __allkwargs0__ [__attrib0__]; break; } } } } else { } var decorator = function (f) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'f': var f = __allkwargs0__ [__attrib0__]; break; } } } } else { } var wrapper = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } } else { } _P5_INSTANCE = p5_sketch; return pre_draw (_P5_INSTANCE, f); }; return wrapper; }; return decorator; }; export var start_p5 = function (preload_func, setup_func, draw_func, event_functions) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'preload_func': var preload_func = __allkwargs0__ [__attrib0__]; break; case 'setup_func': var setup_func = __allkwargs0__ [__attrib0__]; break; case 'draw_func': var draw_func = __allkwargs0__ [__attrib0__]; break; case 'event_functions': var event_functions = __allkwargs0__ [__attrib0__]; break; } } } } else { } var sketch_setup = function (p5_sketch) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'p5_sketch': var p5_sketch = __allkwargs0__ [__attrib0__]; break; } } } } else { } p5_sketch.preload = global_p5_injection (p5_sketch) (preload_func); p5_sketch.setup = global_p5_injection (p5_sketch) (setup_func); p5_sketch.draw = global_p5_injection (p5_sketch) (draw_func); }; var instance = new p5 (sketch_setup, 'sketch-holder'); var event_function_names = tuple (['deviceMoved', 'deviceTurned', 'deviceShaken', 'windowResized', 'keyPressed', 'keyReleased', 'keyTyped', 'mousePressed', 'mouseReleased', 'mouseClicked', 'doubleClicked', 'mouseMoved', 'mouseDragged', 'mouseWheel', 'touchStarted', 'touchMoved', 'touchEnded', 'keyIsDown']); for (var f_name of (function () { var __accu0__ = []; for (var f of event_function_names) { if (event_functions.py_get (f, null)) { __accu0__.append (f); } } return __accu0__; }) ()) { var func = event_functions [f_name]; var event_func = global_p5_injection (instance) (func); setattr (instance, f_name, event_func); } }; export var logOnloaded = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } } else { } console.log ('Lib loaded!'); }; export var add_library = function (lib_name) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'lib_name': var lib_name = __allkwargs0__ [__attrib0__]; break; } } } } else { } var src = ''; return console.log ('Lib name is not valid:', lib_name); console.log ('Importing:', src); var script = document.createElement ('script'); script.onload = logOnloaded; script.src = src; document.head.appendChild (script); }; //# sourceMappingURL=pyp5js.map ================================================ FILE: docs/examples/transcrypt/sketch_006/target/pyp5js.py ================================================ from python_functions import PythonFunctions _P5_INSTANCE = None _CTX_MIDDLE = None _DEFAULT_FILL = None _DEFAULT_LEADMULT = None _DEFAULT_STROKE = None _DEFAULT_TEXT_FILL = None ADD = None ALT = None ARROW = None AUDIO = None AUTO = None AXES = None BACKSPACE = None BASELINE = None BEVEL = None BEZIER = None BLEND = None BLUR = None BOLD = None BOLDITALIC = None BOTTOM = None BURN = None CENTER = None CHORD = None CLAMP = None CLOSE = None CONTROL = None CORNER = None CORNERS = None CROSS = None CURVE = None DARKEST = None DEG_TO_RAD = None DEGREES = None DELETE = None DIFFERENCE = None DILATE = None DODGE = None DOWN_ARROW = None ENTER = None ERODE = None ESCAPE = None EXCLUSION = None FILL = None GRAY = None GRID = None HALF_PI = None HAND = None HARD_LIGHT = None HSB = None HSL = None IMAGE = None IMMEDIATE = None INVERT = None ITALIC = None LANDSCAPE = None LEFT = None LEFT_ARROW = None LIGHTEST = None LINE_LOOP = None LINE_STRIP = None LINEAR = None LINES = None MIRROR = None MITER = None MOVE = None MULTIPLY = None NEAREST = None NORMAL = None OPAQUE = None OPEN = None OPTION = None OVERLAY = None PI = None PIE = None POINTS = None PORTRAIT = None POSTERIZE = None PROJECT = None QUAD_STRIP = None QUADRATIC = None QUADS = None QUARTER_PI = None RAD_TO_DEG = None RADIANS = None RADIUS = None REPEAT = None REPLACE = None RETURN = None RGB = None RIGHT = None RIGHT_ARROW = None ROUND = None SCREEN = None SHIFT = None SOFT_LIGHT = None SQUARE = None STROKE = None SUBTRACT = None TAB = None TAU = None TEXT = None TEXTURE = None THRESHOLD = None TOP = None TRIANGLE_FAN = None TRIANGLE_STRIP = None TRIANGLES = None TWO_PI = None UP_ARROW = None VIDEO = None WAIT = None WEBGL = None P2D = None PI = None frameCount = None focused = None displayWidth = None displayHeight = None windowWidth = None windowHeight = None width = None height = None disableFriendlyErrors = None deviceOrientation = None accelerationX = None accelerationY = None accelerationZ = None pAccelerationX = None pAccelerationY = None pAccelerationZ = None rotationX = None rotationY = None rotationZ = None pRotationX = None pRotationY = None pRotationZ = None turnAxis = None keyIsPressed = None key = None keyCode = None mouseX = None mouseY = None pmouseX = None pmouseY = None winMouseX = None winMouseY = None pwinMouseX = None pwinMouseY = None mouseButton = None mouseIsPressed = None touches = None pixels = None def alpha(*args): return _P5_INSTANCE.alpha(*args) def blue(*args): return _P5_INSTANCE.blue(*args) def brightness(*args): return _P5_INSTANCE.brightness(*args) def color(*args): return _P5_INSTANCE.color(*args) def green(*args): return _P5_INSTANCE.green(*args) def hue(*args): return _P5_INSTANCE.hue(*args) def lerpColor(*args): return _P5_INSTANCE.lerpColor(*args) def lightness(*args): return _P5_INSTANCE.lightness(*args) def red(*args): return _P5_INSTANCE.red(*args) def saturation(*args): return _P5_INSTANCE.saturation(*args) def background(*args): return _P5_INSTANCE.background(*args) def clear(*args): __pragma__('noalias', 'clear') p5_clear = _P5_INSTANCE.clear(*args) __pragma__('alias', 'clear', 'py_clear') return p5_clear def erase(*args): return _P5_INSTANCE.erase(*args) def noErase(*args): return _P5_INSTANCE.noErase(*args) def colorMode(*args): return _P5_INSTANCE.colorMode(*args) def fill(*args): return _P5_INSTANCE.fill(*args) def noFill(*args): return _P5_INSTANCE.noFill(*args) def noStroke(*args): return _P5_INSTANCE.noStroke(*args) def stroke(*args): return _P5_INSTANCE.stroke(*args) def arc(*args): return _P5_INSTANCE.arc(*args) def ellipse(*args): return _P5_INSTANCE.ellipse(*args) def circle(*args): return _P5_INSTANCE.circle(*args) def line(*args): return _P5_INSTANCE.line(*args) def point(*args): return _P5_INSTANCE.point(*args) def quad(*args): return _P5_INSTANCE.quad(*args) def rect(*args): return _P5_INSTANCE.rect(*args) def square(*args): return _P5_INSTANCE.square(*args) def triangle(*args): return _P5_INSTANCE.triangle(*args) def plane(*args): return _P5_INSTANCE.plane(*args) def box(*args): return _P5_INSTANCE.box(*args) def sphere(*args): return _P5_INSTANCE.sphere(*args) def cylinder(*args): return _P5_INSTANCE.cylinder(*args) def cone(*args): return _P5_INSTANCE.cone(*args) def ellipsoid(*args): return _P5_INSTANCE.ellipsoid(*args) def torus(*args): return _P5_INSTANCE.torus(*args) def loadModel(*args): return _P5_INSTANCE.loadModel(*args) def model(*args): return _P5_INSTANCE.model(*args) def ellipseMode(*args): return _P5_INSTANCE.ellipseMode(*args) def noSmooth(*args): return _P5_INSTANCE.noSmooth(*args) def rectMode(*args): return _P5_INSTANCE.rectMode(*args) def smooth(*args): return _P5_INSTANCE.smooth(*args) def strokeCap(*args): return _P5_INSTANCE.strokeCap(*args) def strokeJoin(*args): return _P5_INSTANCE.strokeJoin(*args) def strokeWeight(*args): return _P5_INSTANCE.strokeWeight(*args) def bezier(*args): return _P5_INSTANCE.bezier(*args) def bezierDetail(*args): return _P5_INSTANCE.bezierDetail(*args) def bezierPoint(*args): return _P5_INSTANCE.bezierPoint(*args) def bezierTangent(*args): return _P5_INSTANCE.bezierTangent(*args) def curve(*args): return _P5_INSTANCE.curve(*args) def curveDetail(*args): return _P5_INSTANCE.curveDetail(*args) def curveTightness(*args): return _P5_INSTANCE.curveTightness(*args) def curvePoint(*args): return _P5_INSTANCE.curvePoint(*args) def curveTangent(*args): return _P5_INSTANCE.curveTangent(*args) def beginContour(*args): return _P5_INSTANCE.beginContour(*args) def beginShape(*args): return _P5_INSTANCE.beginShape(*args) def bezierVertex(*args): return _P5_INSTANCE.bezierVertex(*args) def curveVertex(*args): return _P5_INSTANCE.curveVertex(*args) def endContour(*args): return _P5_INSTANCE.endContour(*args) def endShape(*args): return _P5_INSTANCE.endShape(*args) def quadraticVertex(*args): return _P5_INSTANCE.quadraticVertex(*args) def vertex(*args): return _P5_INSTANCE.vertex(*args) def cursor(*args): return _P5_INSTANCE.cursor(*args) def frameRate(*args): return _P5_INSTANCE.frameRate(*args) def noCursor(*args): return _P5_INSTANCE.noCursor(*args) def fullscreen(*args): return _P5_INSTANCE.fullscreen(*args) def pixelDensity(*args): return _P5_INSTANCE.pixelDensity(*args) def displayDensity(*args): return _P5_INSTANCE.displayDensity(*args) def getURL(*args): return _P5_INSTANCE.getURL(*args) def getURLPath(*args): return _P5_INSTANCE.getURLPath(*args) def getURLParams(*args): return _P5_INSTANCE.getURLParams(*args) def preload(*args): return _P5_INSTANCE.preload(*args) def setup(*args): return _P5_INSTANCE.setup(*args) def draw(*args): return _P5_INSTANCE.draw(*args) def remove(*args): return _P5_INSTANCE.remove(*args) def noLoop(*args): return _P5_INSTANCE.noLoop(*args) def loop(*args): return _P5_INSTANCE.loop(*args) def push(*args): return _P5_INSTANCE.push(*args) def redraw(*args): return _P5_INSTANCE.redraw(*args) def resizeCanvas(*args): return _P5_INSTANCE.resizeCanvas(*args) def noCanvas(*args): return _P5_INSTANCE.noCanvas(*args) def createGraphics(*args): return _P5_INSTANCE.createGraphics(*args) def blendMode(*args): return _P5_INSTANCE.blendMode(*args) def setAttributes(*args): return _P5_INSTANCE.setAttributes(*args) def applyMatrix(*args): return _P5_INSTANCE.applyMatrix(*args) def resetMatrix(*args): return _P5_INSTANCE.resetMatrix(*args) def rotate(*args): return _P5_INSTANCE.rotate(*args) def rotateX(*args): return _P5_INSTANCE.rotateX(*args) def rotateY(*args): return _P5_INSTANCE.rotateY(*args) def rotateZ(*args): return _P5_INSTANCE.rotateZ(*args) def scale(*args): return _P5_INSTANCE.scale(*args) def shearX(*args): return _P5_INSTANCE.shearX(*args) def shearY(*args): return _P5_INSTANCE.shearY(*args) def translate(*args): return _P5_INSTANCE.translate(*args) def createStringDict(*args): return _P5_INSTANCE.createStringDict(*args) def createNumberDict(*args): return _P5_INSTANCE.createNumberDict(*args) def append(*args): return _P5_INSTANCE.append(*args) def arrayCopy(*args): return _P5_INSTANCE.arrayCopy(*args) def concat(*args): return _P5_INSTANCE.concat(*args) def reverse(*args): return _P5_INSTANCE.reverse(*args) def shorten(*args): return _P5_INSTANCE.shorten(*args) def shuffle(*args): return _P5_INSTANCE.shuffle(*args) def sort(*args): return _P5_INSTANCE.sort(*args) def splice(*args): return _P5_INSTANCE.splice(*args) def subset(*args): return _P5_INSTANCE.subset(*args) def float(*args): return _P5_INSTANCE.float(*args) def int(*args): return _P5_INSTANCE.int(*args) def str(*args): return _P5_INSTANCE.str(*args) def boolean(*args): return _P5_INSTANCE.boolean(*args) def byte(*args): return _P5_INSTANCE.byte(*args) def char(*args): return _P5_INSTANCE.char(*args) def unchar(*args): return _P5_INSTANCE.unchar(*args) def hex(*args): return _P5_INSTANCE.hex(*args) def unhex(*args): return _P5_INSTANCE.unhex(*args) def join(*args): return _P5_INSTANCE.join(*args) def match(*args): return _P5_INSTANCE.match(*args) def matchAll(*args): return _P5_INSTANCE.matchAll(*args) def nf(*args): return _P5_INSTANCE.nf(*args) def nfc(*args): return _P5_INSTANCE.nfc(*args) def nfp(*args): return _P5_INSTANCE.nfp(*args) def nfs(*args): return _P5_INSTANCE.nfs(*args) def split(*args): return _P5_INSTANCE.split(*args) def splitTokens(*args): return _P5_INSTANCE.splitTokens(*args) def trim(*args): return _P5_INSTANCE.trim(*args) def setMoveThreshold(*args): return _P5_INSTANCE.setMoveThreshold(*args) def setShakeThreshold(*args): return _P5_INSTANCE.setShakeThreshold(*args) def keyIsDown(*args): return _P5_INSTANCE.keyIsDown(*args) def createImage(*args): return _P5_INSTANCE.createImage(*args) def saveCanvas(*args): return _P5_INSTANCE.saveCanvas(*args) def saveFrames(*args): return _P5_INSTANCE.saveFrames(*args) def image_proxy(img): """ Proxy to turn of transcypt when calling img.get/set methods """ def _set(*args): __pragma__('noalias', 'set') value = img.set(*args) __pragma__('alias', 'set', 'py_set') return value def _get(*args): __pragma__('noalias', 'get') value = img.get(*args) __pragma__('alias', 'get', 'py_get') return value img.set = _set img.get = _get return img def loadImage(*args): imageObj = _P5_INSTANCE.loadImage(*args) return image_proxy(imageObj) def image(*args): return _P5_INSTANCE.image(*args) def tint(*args): return _P5_INSTANCE.tint(*args) def noTint(*args): return _P5_INSTANCE.noTint(*args) def imageMode(*args): return _P5_INSTANCE.imageMode(*args) def blend(*args): return _P5_INSTANCE.blend(*args) def copy(*args): return _P5_INSTANCE.copy(*args) def filter(*args): if len(args) > 1 and (args[0] is None or callable(args[0])): return PythonFunctions.filter(*args) else: return _P5_INSTANCE.filter(*args) def get(*args): __pragma__('noalias', 'get') p5_get = _P5_INSTANCE.get(*args) __pragma__('alias', 'get', 'py_get') return p5_get def loadPixels(*args): return _P5_INSTANCE.loadPixels(*args) def set(*args): if len(args) <= 1: return PythonFunctions.set(*args) else: return _P5_INSTANCE.set(*args) def updatePixels(*args): return _P5_INSTANCE.updatePixels(*args) def loadJSON(*args): return _P5_INSTANCE.loadJSON(*args) def loadStrings(*args): return _P5_INSTANCE.loadStrings(*args) def loadTable(*args): return _P5_INSTANCE.loadTable(*args) def loadXML(*args): return _P5_INSTANCE.loadXML(*args) def loadBytes(*args): return _P5_INSTANCE.loadBytes(*args) def httpGet(*args): return _P5_INSTANCE.httpGet(*args) def httpPost(*args): return _P5_INSTANCE.httpPost(*args) def httpDo(*args): return _P5_INSTANCE.httpDo(*args) def createWriter(*args): return _P5_INSTANCE.createWriter(*args) def save(*args): return _P5_INSTANCE.save(*args) def saveJSON(*args): return _P5_INSTANCE.saveJSON(*args) def saveStrings(*args): return _P5_INSTANCE.saveStrings(*args) def saveTable(*args): return _P5_INSTANCE.saveTable(*args) def day(*args): return _P5_INSTANCE.day(*args) def hour(*args): return _P5_INSTANCE.hour(*args) def minute(*args): return _P5_INSTANCE.minute(*args) def millis(*args): return _P5_INSTANCE.millis(*args) def month(*args): return _P5_INSTANCE.month(*args) def second(*args): return _P5_INSTANCE.second(*args) def year(*args): return _P5_INSTANCE.year(*args) def createVector(*args): return _P5_INSTANCE.createVector(*args) def abs(*args): return _P5_INSTANCE.abs(*args) def ceil(*args): return _P5_INSTANCE.ceil(*args) def constrain(*args): return _P5_INSTANCE.constrain(*args) def dist(*args): return _P5_INSTANCE.dist(*args) def exp(*args): return _P5_INSTANCE.exp(*args) def floor(*args): return _P5_INSTANCE.floor(*args) def lerp(*args): return _P5_INSTANCE.lerp(*args) def log(*args): return _P5_INSTANCE.log(*args) def mag(*args): return _P5_INSTANCE.mag(*args) def map(*args): if len(args) > 1 and callable(args[0]): return PythonFunctions.map(*args) else: return _P5_INSTANCE.map(*args) def max(*args): return _P5_INSTANCE.max(*args) def min(*args): return _P5_INSTANCE.min(*args) def norm(*args): return _P5_INSTANCE.norm(*args) def pow(*args): return _P5_INSTANCE.pow(*args) def round(*args): return _P5_INSTANCE.round(*args) def sq(*args): return _P5_INSTANCE.sq(*args) def sqrt(*args): return _P5_INSTANCE.sqrt(*args) def noise(*args): return _P5_INSTANCE.noise(*args) def noiseDetail(*args): return _P5_INSTANCE.noiseDetail(*args) def noiseSeed(*args): return _P5_INSTANCE.noiseSeed(*args) def randomSeed(*args): return _P5_INSTANCE.randomSeed(*args) def random(*args): return _P5_INSTANCE.random(*args) def randomGaussian(*args): return _P5_INSTANCE.randomGaussian(*args) def acos(*args): return _P5_INSTANCE.acos(*args) def asin(*args): return _P5_INSTANCE.asin(*args) def atan(*args): return _P5_INSTANCE.atan(*args) def atan2(*args): return _P5_INSTANCE.atan2(*args) def cos(*args): return _P5_INSTANCE.cos(*args) def sin(*args): return _P5_INSTANCE.sin(*args) def tan(*args): return _P5_INSTANCE.tan(*args) def degrees(*args): return _P5_INSTANCE.degrees(*args) def radians(*args): return _P5_INSTANCE.radians(*args) def angleMode(*args): return _P5_INSTANCE.angleMode(*args) def textAlign(*args): return _P5_INSTANCE.textAlign(*args) def textLeading(*args): return _P5_INSTANCE.textLeading(*args) def textSize(*args): return _P5_INSTANCE.textSize(*args) def textStyle(*args): return _P5_INSTANCE.textStyle(*args) def textWidth(*args): return _P5_INSTANCE.textWidth(*args) def textAscent(*args): return _P5_INSTANCE.textAscent(*args) def textDescent(*args): return _P5_INSTANCE.textDescent(*args) def loadFont(*args): return _P5_INSTANCE.loadFont(*args) def text(*args): return _P5_INSTANCE.text(*args) def textFont(*args): return _P5_INSTANCE.textFont(*args) def orbitControl(*args): return _P5_INSTANCE.orbitControl(*args) def debugMode(*args): return _P5_INSTANCE.debugMode(*args) def noDebugMode(*args): return _P5_INSTANCE.noDebugMode(*args) def ambientLight(*args): return _P5_INSTANCE.ambientLight(*args) def directionalLight(*args): return _P5_INSTANCE.directionalLight(*args) def pointLight(*args): return _P5_INSTANCE.pointLight(*args) def lights(*args): return _P5_INSTANCE.lights(*args) def loadShader(*args): return _P5_INSTANCE.loadShader(*args) def createShader(*args): return _P5_INSTANCE.createShader(*args) def shader(*args): return _P5_INSTANCE.shader(*args) def resetShader(*args): return _P5_INSTANCE.resetShader(*args) def normalMaterial(*args): return _P5_INSTANCE.normalMaterial(*args) def texture(*args): return _P5_INSTANCE.texture(*args) def textureMode(*args): return _P5_INSTANCE.textureMode(*args) def textureWrap(*args): return _P5_INSTANCE.textureWrap(*args) def ambientMaterial(*args): return _P5_INSTANCE.ambientMaterial(*args) def specularMaterial(*args): return _P5_INSTANCE.specularMaterial(*args) def shininess(*args): return _P5_INSTANCE.shininess(*args) def camera(*args): return _P5_INSTANCE.camera(*args) def perspective(*args): return _P5_INSTANCE.perspective(*args) def ortho(*args): return _P5_INSTANCE.ortho(*args) def createCamera(*args): return _P5_INSTANCE.createCamera(*args) def setCamera(*args): return _P5_INSTANCE.setCamera(*args) def select(*args): return _P5_INSTANCE.select(*args) def selectAll(*args): return _P5_INSTANCE.selectAll(*args) def removeElements(*args): return _P5_INSTANCE.removeElements(*args) def changed(*args): return _P5_INSTANCE.changed(*args) def input(*args): return _P5_INSTANCE.input(*args) def createDiv(*args): return _P5_INSTANCE.createDiv(*args) def createP(*args): return _P5_INSTANCE.createP(*args) def createSpan(*args): return _P5_INSTANCE.createSpan(*args) def createImg(*args): return _P5_INSTANCE.createImg(*args) def createA(*args): return _P5_INSTANCE.createA(*args) def createSlider(*args): return _P5_INSTANCE.createSlider(*args) def createButton(*args): return _P5_INSTANCE.createButton(*args) def createCheckbox(*args): return _P5_INSTANCE.createCheckbox(*args) def createSelect(*args): return _P5_INSTANCE.createSelect(*args) def createRadio(*args): return _P5_INSTANCE.createRadio(*args) def createColorPicker(*args): return _P5_INSTANCE.createColorPicker(*args) def createInput(*args): return _P5_INSTANCE.createInput(*args) def createFileInput(*args): return _P5_INSTANCE.createFileInput(*args) def createVideo(*args): return _P5_INSTANCE.createVideo(*args) def createAudio(*args): return _P5_INSTANCE.createAudio(*args) def createCapture(*args): return _P5_INSTANCE.createCapture(*args) def createElement(*args): return _P5_INSTANCE.createElement(*args) def createCanvas(*args): canvas = _P5_INSTANCE.createCanvas(*args) global width, height width = _P5_INSTANCE.width height = _P5_INSTANCE.height return canvas def pop(*args): __pragma__('noalias', 'pop') p5_pop = _P5_INSTANCE.pop(*args) __pragma__('alias', 'pop', 'py_pop') return p5_pop # Processing Python or Java mode compatibility aliases size = createCanvas popMatrix = pop popStyle = pop pushMatrix = push pushStyle = push # PVector is a helper/alias to create p5.Vector objects def PVector(x=0, y=0, z=0): return _P5_INSTANCE.createVector(x, y, z) # aliases for p5.Vector class methods setattr(PVector, 'dist', p5.Vector.dist) setattr(PVector, 'add', p5.Vector.add) setattr(PVector, 'sub', p5.Vector.sub) setattr(PVector, 'mult', p5.Vector.mult) setattr(PVector, 'div', p5.Vector.div) setattr(PVector, 'dot', p5.Vector.dot) setattr(PVector, 'cross', p5.Vector.cross) setattr(PVector, 'lerp', p5.Vector.lerp) setattr(PVector, 'random2D', p5.Vector.random2D) setattr(PVector, 'random3D', p5.Vector.random3D) setattr(PVector, 'angleBetween', p5.Vector.angleBetween) setattr(PVector, 'fromAngle', p5.Vector.fromAngle) setattr(PVector, 'fromAngles', p5.Vector.fromAngles) setattr(PVector, 'equals', p5.Vector.equals) def pre_draw(p5_instance, draw_func): """ We need to run this before the actual draw to insert and update p5 env variables """ global _CTX_MIDDLE, _DEFAULT_FILL, _DEFAULT_LEADMULT, _DEFAULT_STROKE, _DEFAULT_TEXT_FILL global ADD, ALT, ARROW, AUTO, AUDIO, AXES, BACKSPACE, BASELINE, BEVEL, BEZIER, BLEND, BLUR, BOLD, BOLDITALIC global BOTTOM, BURN, CENTER, CHORD, CLAMP, CLOSE, CONTROL, CORNER, CORNERS, CROSS, CURVE, DARKEST global DEG_TO_RAD, DEGREES, DELETE, DIFFERENCE, DILATE, DODGE, DOWN_ARROW, ENTER, ERODE, ESCAPE, EXCLUSION global FILL, GRAY, GRID, HALF_PI, HAND, HARD_LIGHT, HSB, HSL, IMAGE, IMMEDIATE, INVERT, ITALIC, LANDSCAPE global LEFT, LEFT_ARROW, LIGHTEST, LINE_LOOP, LINE_STRIP, LINEAR, LINES, MIRROR, MITER, MOVE, MULTIPLY, NEAREST global NORMAL, OPAQUE, OPEN, OPTION, OVERLAY, P2D, PI, PIE, POINTS, PORTRAIT, POSTERIZE, PROJECT, QUAD_STRIP, QUADRATIC global QUADS, QUARTER_PI, RAD_TO_DEG, RADIANS, RADIUS, REPEAT, REPLACE, RETURN, RGB, RIGHT, RIGHT_ARROW global ROUND, SCREEN, SHIFT, SOFT_LIGHT, SQUARE, STROKE, SUBTRACT, TAB, TAU, TEXT, TEXTURE, THRESHOLD, TOP global TRIANGLE_FAN, TRIANGLE_STRIP, TRIANGLES, TWO_PI, UP_ARROW, VIDEO, WAIT, WEBGL global frameCount, focused, displayWidth, displayHeight, windowWidth, windowHeight, width, height global disableFriendlyErrors, deviceOrientation, accelerationX, accelerationY, accelerationZ global pAccelerationX, pAccelerationY, pAccelerationZ, rotationX, rotationY, rotationZ global pRotationX, pRotationY, pRotationZ, turnAxis, keyIsPressed, key, keyCode, mouseX, mouseY, pmouseX, pmouseY global winMouseX, winMouseY, pwinMouseX, pwinMouseY, mouseButton, mouseIsPressed, touches, pixels _CTX_MIDDLE = p5_instance._CTX_MIDDLE _DEFAULT_FILL = p5_instance._DEFAULT_FILL _DEFAULT_LEADMULT = p5_instance._DEFAULT_LEADMULT _DEFAULT_STROKE = p5_instance._DEFAULT_STROKE _DEFAULT_TEXT_FILL = p5_instance._DEFAULT_TEXT_FILL ADD = p5_instance.ADD ALT = p5_instance.ALT ARROW = p5_instance.ARROW AUDIO = p5_instance.AUDIO AUTO = p5_instance.AUTO AXES = p5_instance.AXES BACKSPACE = p5_instance.BACKSPACE BASELINE = p5_instance.BASELINE BEVEL = p5_instance.BEVEL BEZIER = p5_instance.BEZIER BLEND = p5_instance.BLEND BLUR = p5_instance.BLUR BOLD = p5_instance.BOLD BOLDITALIC = p5_instance.BOLDITALIC BOTTOM = p5_instance.BOTTOM BURN = p5_instance.BURN CENTER = p5_instance.CENTER CHORD = p5_instance.CHORD CLAMP = p5_instance.CLAMP CLOSE = p5_instance.CLOSE CONTROL = p5_instance.CONTROL CORNER = p5_instance.CORNER CORNERS = p5_instance.CORNERS CROSS = p5_instance.CROSS CURVE = p5_instance.CURVE DARKEST = p5_instance.DARKEST DEG_TO_RAD = p5_instance.DEG_TO_RAD DEGREES = p5_instance.DEGREES DELETE = p5_instance.DELETE DIFFERENCE = p5_instance.DIFFERENCE DILATE = p5_instance.DILATE DODGE = p5_instance.DODGE DOWN_ARROW = p5_instance.DOWN_ARROW ENTER = p5_instance.ENTER ERODE = p5_instance.ERODE ESCAPE = p5_instance.ESCAPE EXCLUSION = p5_instance.EXCLUSION FILL = p5_instance.FILL GRAY = p5_instance.GRAY GRID = p5_instance.GRID HALF_PI = p5_instance.HALF_PI HAND = p5_instance.HAND HARD_LIGHT = p5_instance.HARD_LIGHT HSB = p5_instance.HSB HSL = p5_instance.HSL IMAGE = p5_instance.IMAGE IMMEDIATE = p5_instance.IMMEDIATE INVERT = p5_instance.INVERT ITALIC = p5_instance.ITALIC LANDSCAPE = p5_instance.LANDSCAPE LEFT = p5_instance.LEFT LEFT_ARROW = p5_instance.LEFT_ARROW LIGHTEST = p5_instance.LIGHTEST LINE_LOOP = p5_instance.LINE_LOOP LINE_STRIP = p5_instance.LINE_STRIP LINEAR = p5_instance.LINEAR LINES = p5_instance.LINES MIRROR = p5_instance.MIRROR MITER = p5_instance.MITER MOVE = p5_instance.MOVE MULTIPLY = p5_instance.MULTIPLY NEAREST = p5_instance.NEAREST NORMAL = p5_instance.NORMAL OPAQUE = p5_instance.OPAQUE OPEN = p5_instance.OPEN OPTION = p5_instance.OPTION OVERLAY = p5_instance.OVERLAY P2D = p5_instance.P2D P3D = p5_instance.WEBGL PI = p5_instance.PI PIE = p5_instance.PIE POINTS = p5_instance.POINTS PORTRAIT = p5_instance.PORTRAIT POSTERIZE = p5_instance.POSTERIZE PROJECT = p5_instance.PROJECT QUAD_STRIP = p5_instance.QUAD_STRIP QUADRATIC = p5_instance.QUADRATIC QUADS = p5_instance.QUADS QUARTER_PI = p5_instance.QUARTER_PI RAD_TO_DEG = p5_instance.RAD_TO_DEG RADIANS = p5_instance.RADIANS RADIUS = p5_instance.RADIUS REPEAT = p5_instance.REPEAT REPLACE = p5_instance.REPLACE RETURN = p5_instance.RETURN RGB = p5_instance.RGB RIGHT = p5_instance.RIGHT RIGHT_ARROW = p5_instance.RIGHT_ARROW ROUND = p5_instance.ROUND SCREEN = p5_instance.SCREEN SHIFT = p5_instance.SHIFT SOFT_LIGHT = p5_instance.SOFT_LIGHT SQUARE = p5_instance.SQUARE STROKE = p5_instance.STROKE SUBTRACT = p5_instance.SUBTRACT TAB = p5_instance.TAB TAU = p5_instance.TAU TEXT = p5_instance.TEXT TEXTURE = p5_instance.TEXTURE THRESHOLD = p5_instance.THRESHOLD TOP = p5_instance.TOP TRIANGLE_FAN = p5_instance.TRIANGLE_FAN TRIANGLE_STRIP = p5_instance.TRIANGLE_STRIP TRIANGLES = p5_instance.TRIANGLES TWO_PI = p5_instance.TWO_PI UP_ARROW = p5_instance.UP_ARROW VIDEO = p5_instance.VIDEO WAIT = p5_instance.WAIT WEBGL = p5_instance.WEBGL frameCount = p5_instance.frameCount focused = p5_instance.focused displayWidth = p5_instance.displayWidth displayHeight = p5_instance.displayHeight windowWidth = p5_instance.windowWidth windowHeight = p5_instance.windowHeight width = p5_instance.width height = p5_instance.height disableFriendlyErrors = p5_instance.disableFriendlyErrors deviceOrientation = p5_instance.deviceOrientation accelerationX = p5_instance.accelerationX accelerationY = p5_instance.accelerationY accelerationZ = p5_instance.accelerationZ pAccelerationX = p5_instance.pAccelerationX pAccelerationY = p5_instance.pAccelerationY pAccelerationZ = p5_instance.pAccelerationZ rotationX = p5_instance.rotationX rotationY = p5_instance.rotationY rotationZ = p5_instance.rotationZ pRotationX = p5_instance.pRotationX pRotationY = p5_instance.pRotationY pRotationZ = p5_instance.pRotationZ turnAxis = p5_instance.turnAxis keyIsPressed = p5_instance.keyIsPressed key = p5_instance.key keyCode = p5_instance.keyCode mouseX = p5_instance.mouseX mouseY = p5_instance.mouseY pmouseX = p5_instance.pmouseX pmouseY = p5_instance.pmouseY winMouseX = p5_instance.winMouseX winMouseY = p5_instance.winMouseY pwinMouseX = p5_instance.pwinMouseX pwinMouseY = p5_instance.pwinMouseY mouseButton = p5_instance.mouseButton mouseIsPressed = p5_instance.mouseIsPressed touches = p5_instance.touches pixels = p5_instance.pixels return draw_func() def global_p5_injection(p5_sketch): """ Injects the p5js's skecth instance as a global variable to setup and draw functions """ def decorator(f): def wrapper(): global _P5_INSTANCE _P5_INSTANCE = p5_sketch return pre_draw(_P5_INSTANCE, f) return wrapper return decorator def start_p5(preload_func, setup_func, draw_func, event_functions): """ This is the entrypoint function. It accepts 2 parameters: - preload_func: a Python preload callable - setup_func: a Python setup callable - draw_func: a Python draw callable - event_functions: a config dict for the event functions in the format: {"eventFunctionName": python_event_function} This method gets the p5js's sketch instance and injects them """ def sketch_setup(p5_sketch): p5_sketch.preload = global_p5_injection(p5_sketch)(preload_func) p5_sketch.setup = global_p5_injection(p5_sketch)(setup_func) p5_sketch.draw = global_p5_injection(p5_sketch)(draw_func) instance = __new__(p5(sketch_setup, 'sketch-holder')) # inject event functions into p5 event_function_names = ( "deviceMoved", "deviceTurned", "deviceShaken", "windowResized", "keyPressed", "keyReleased", "keyTyped", "mousePressed", "mouseReleased", "mouseClicked", "doubleClicked", "mouseMoved", "mouseDragged", "mouseWheel", "touchStarted", "touchMoved", "touchEnded", "keyIsDown" ) for f_name in [f for f in event_function_names if event_functions.get(f, None)]: func = event_functions[f_name] event_func = global_p5_injection(instance)(func) setattr(instance, f_name, event_func) def logOnloaded(): console.log("Lib loaded!") def add_library(lib_name): # placeholder for https://github.com/berinhard/pyp5js/issues/31 src = '' return console.log("Lib name is not valid:", lib_name) console.log("Importing:", src) script = document.createElement("script") script.onload = logOnloaded script.src = src document.head.appendChild(script) ================================================ FILE: docs/examples/transcrypt/sketch_006/target/python_functions.js ================================================ // Transcrypt'ed from Python, 2021-11-02 13:06:14 import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, abs, all, any, assert, bool, bytearray, bytes, callable, chr, copy, deepcopy, delattr, dict, dir, divmod, enumerate, filter, float, getattr, hasattr, input, int, isinstance, issubclass, len, list, map, max, min, object, ord, pow, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, round, set, setattr, sorted, str, sum, tuple, zip} from './org.transcrypt.__runtime__.js'; var __name__ = 'python_functions'; export var PythonFunctions = __class__ ('PythonFunctions', [object], { __module__: __name__, }); setattr (PythonFunctions, 'map', map); setattr (PythonFunctions, 'filter', filter); setattr (PythonFunctions, 'set', set); //# sourceMappingURL=python_functions.map ================================================ FILE: docs/examples/transcrypt/sketch_006/target/python_functions.py ================================================ class PythonFunctions: pass setattr(PythonFunctions, 'map', map) setattr(PythonFunctions, 'filter', filter) setattr(PythonFunctions, 'set', set) ================================================ FILE: docs/examples/transcrypt/sketch_006/target/target_sketch.js ================================================ // Transcrypt'ed from Python, 2021-11-02 13:06:14 import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, all, any, assert, bool, bytearray, bytes, callable, chr, deepcopy, delattr, dict, dir, divmod, enumerate, getattr, hasattr, isinstance, issubclass, len, list, object, ord, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, set, setattr, sorted, sum, tuple, zip} from './org.transcrypt.__runtime__.js'; import {ADD, ALT, ARROW, AUDIO, AUTO, AXES, BACKSPACE, BASELINE, BEVEL, BEZIER, BLEND, BLUR, BOLD, BOLDITALIC, BOTTOM, BURN, CENTER, CHORD, CLAMP, CLOSE, CONTROL, CORNER, CORNERS, CROSS, CURVE, DARKEST, DEGREES, DEG_TO_RAD, DELETE, DIFFERENCE, DILATE, DODGE, DOWN_ARROW, ENTER, ERODE, ESCAPE, EXCLUSION, FILL, GRAY, GRID, HALF_PI, HAND, HARD_LIGHT, HSB, HSL, IMAGE, IMMEDIATE, INVERT, ITALIC, LANDSCAPE, LEFT, LEFT_ARROW, LIGHTEST, LINEAR, LINES, LINE_LOOP, LINE_STRIP, MIRROR, MITER, MOVE, MULTIPLY, NEAREST, NORMAL, OPAQUE, OPEN, OPTION, OVERLAY, P2D, PI, PIE, POINTS, PORTRAIT, POSTERIZE, PROJECT, PVector, QUADRATIC, QUADS, QUAD_STRIP, QUARTER_PI, RADIANS, RADIUS, RAD_TO_DEG, REPEAT, REPLACE, RETURN, RGB, RIGHT, RIGHT_ARROW, ROUND, SCREEN, SHIFT, SOFT_LIGHT, SQUARE, STROKE, SUBTRACT, TAB, TAU, TEXT, TEXTURE, THRESHOLD, TOP, TRIANGLES, TRIANGLE_FAN, TRIANGLE_STRIP, TWO_PI, UP_ARROW, VIDEO, WAIT, WEBGL, _CTX_MIDDLE, _DEFAULT_FILL, _DEFAULT_LEADMULT, _DEFAULT_STROKE, _DEFAULT_TEXT_FILL, _P5_INSTANCE, abs, accelerationX, accelerationY, accelerationZ, acos, add_library, alpha, ambientLight, ambientMaterial, angleMode, append, applyMatrix, arc, arrayCopy, asin, atan, atan2, background, beginContour, beginShape, bezier, bezierDetail, bezierPoint, bezierTangent, bezierVertex, blend, blendMode, blue, boolean, box, brightness, byte, camera, ceil, changed, char, circle, color, colorMode, concat, cone, constrain, copy, cos, createA, createAudio, createButton, createCamera, createCanvas, createCapture, createCheckbox, createColorPicker, createDiv, createElement, createFileInput, createGraphics, createImage, createImg, createInput, createNumberDict, createP, createRadio, createSelect, createShader, createSlider, createSpan, createStringDict, createVector, createVideo, createWriter, cursor, curve, curveDetail, curvePoint, curveTangent, curveTightness, curveVertex, cylinder, day, debugMode, degrees, deviceOrientation, directionalLight, disableFriendlyErrors, displayDensity, displayHeight, displayWidth, dist, ellipse, ellipseMode, ellipsoid, endContour, endShape, erase, exp, fill, filter, float, floor, focused, frameCount, frameRate, fullscreen, getURL, getURLParams, getURLPath, global_p5_injection, green, height, hex, hour, httpDo, httpGet, httpPost, hue, image, imageMode, image_proxy, input, int, join, key, keyCode, keyIsPressed, lerp, lerpColor, lightness, lights, line, loadBytes, loadFont, loadImage, loadJSON, loadModel, loadPixels, loadShader, loadStrings, loadTable, loadXML, log, logOnloaded, loop, mag, map, match, matchAll, max, millis, min, minute, model, month, mouseButton, mouseIsPressed, mouseX, mouseY, nf, nfc, nfp, nfs, noCanvas, noCursor, noDebugMode, noErase, noFill, noLoop, noSmooth, noStroke, noTint, noise, noiseDetail, noiseSeed, norm, normalMaterial, orbitControl, ortho, pAccelerationX, pAccelerationY, pAccelerationZ, pRotationX, pRotationY, pRotationZ, perspective, pixelDensity, pixels, plane, pmouseX, pmouseY, point, pointLight, popMatrix, popStyle, pow, pre_draw, push, pushMatrix, pushStyle, pwinMouseX, pwinMouseY, py_clear, py_get, py_pop, py_set, py_sort, py_split, quad, quadraticVertex, radians, random, randomGaussian, randomSeed, rect, rectMode, red, redraw, remove, removeElements, resetMatrix, resetShader, resizeCanvas, reverse, rotate, rotateX, rotateY, rotateZ, rotationX, rotationY, rotationZ, round, saturation, save, saveCanvas, saveFrames, saveJSON, saveStrings, saveTable, scale, second, select, selectAll, setAttributes, setCamera, setMoveThreshold, setShakeThreshold, shader, shearX, shearY, shininess, shorten, shuffle, sin, size, smooth, specularMaterial, sphere, splice, splitTokens, sq, sqrt, square, start_p5, str, stroke, strokeCap, strokeJoin, strokeWeight, subset, tan, text, textAlign, textAscent, textDescent, textFont, textLeading, textSize, textStyle, textWidth, texture, textureMode, textureWrap, tint, torus, touches, translate, triangle, trim, turnAxis, unchar, unhex, updatePixels, vertex, width, winMouseX, winMouseY, windowHeight, windowWidth, year} from './pyp5js.js'; var __name__ = '__main__'; export var preload = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } } else { } // pass; }; export var setup = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } } else { } // pass; }; export var draw = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } } else { } // pass; }; export var deviceMoved = null; export var deviceTurned = null; export var deviceShaken = null; export var keyPressed = null; export var keyReleased = null; export var keyTyped = null; export var mouseMoved = null; export var mouseDragged = null; export var mousePressed = null; export var mouseReleased = null; export var mouseClicked = null; export var doubleClicked = null; export var mouseWheel = null; export var touchStarted = null; export var touchMoved = null; export var touchEnded = null; export var windowResized = null; export var keyIsDown = null; export var r = null; var setup = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } } else { } createCanvas (900, 900); r = random (100, 700); noFill (); }; var draw = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } } else { } var __left0__ = tuple ([100, 100]); var x = __left0__ [0]; var y = __left0__ [1]; rect (x, y, r, r); }; var keyPressed = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } } else { } console.log ('Key pressed event'); if (key == 'n') { r = random (100, 700); redraw (); } }; var mouseDragged = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } } else { } r = random (100, 700); redraw (); }; export var event_functions = dict ({'deviceMoved': deviceMoved, 'deviceTurned': deviceTurned, 'deviceShaken': deviceShaken, 'keyPressed': keyPressed, 'keyReleased': keyReleased, 'keyTyped': keyTyped, 'mouseMoved': mouseMoved, 'mouseDragged': mouseDragged, 'mousePressed': mousePressed, 'mouseReleased': mouseReleased, 'mouseClicked': mouseClicked, 'doubleClicked': doubleClicked, 'mouseWheel': mouseWheel, 'touchStarted': touchStarted, 'touchMoved': touchMoved, 'touchEnded': touchEnded, 'windowResized': windowResized, 'keyIsDown': keyIsDown}); start_p5 (preload, setup, draw, event_functions); //# sourceMappingURL=target_sketch.map ================================================ FILE: docs/examples/transcrypt/sketch_006/target/target_sketch.project ================================================ {"options": {"source": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_006/target_sketch.py", "anno": false, "alimod": false, "build": true, "complex": false, "docat": false, "dassert": false, "dcheck": false, "dextex": false, "dlog": false, "dmap": false, "dnostrip": false, "dstat": false, "dtree": false, "esv": null, "ecom": false, "fcall": false, "gen": false, "iconv": false, "jscall": false, "jskeys": false, "jsmod": false, "kwargs": true, "keycheck": false, "license": false, "map": true, "nomin": true, "opov": false, "outdir": null, "parent": null, "run": false, "symbols": null, "sform": false, "tconv": false, "unit": null, "verbose": false, "x": null, "xreex": false, "xglobs": false, "xpath": "/home/bernardo/envs/pyp5js/pyp5js/templates/transcrypt", "xtiny": false, "star": false}, "modules": [{"source": "/home/bernardo/.pyenv/versions/pyp5js/lib/python3.8/site-packages/transcrypt/modules/org/transcrypt/__runtime__.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_006/__target__/org.transcrypt.__runtime__.js"}, {"source": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_006/target_sketch.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_006/__target__/target_sketch.js"}, {"source": "/home/bernardo/envs/pyp5js/pyp5js/templates/transcrypt/pyp5js.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_006/__target__/pyp5js.js"}, {"source": "/home/bernardo/envs/pyp5js/pyp5js/templates/transcrypt/python_functions.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_006/__target__/python_functions.js"}]} ================================================ FILE: docs/examples/transcrypt/sketch_006/target/target_sketch.py ================================================ from pyp5js import * def preload(): pass def setup(): pass def draw(): pass deviceMoved = None deviceTurned = None deviceShaken = None keyPressed = None keyReleased = None keyTyped = None mouseMoved = None mouseDragged = None mousePressed = None mouseReleased = None mouseClicked = None doubleClicked = None mouseWheel = None touchStarted = None touchMoved = None touchEnded = None windowResized = None keyIsDown = None r = None def setup(): global r createCanvas(900, 900) r = random(100, 700) noFill() def draw(): x, y = 100, 100 rect(x, y, r, r) def keyPressed(): console.log("Key pressed event") if key == "n": global r r = random(100, 700) redraw() def mouseDragged(): global r r = random(100, 700) redraw() event_functions = { "deviceMoved": deviceMoved, "deviceTurned": deviceTurned, "deviceShaken": deviceShaken, "keyPressed": keyPressed, "keyReleased": keyReleased, "keyTyped": keyTyped, "mouseMoved": mouseMoved, "mouseDragged": mouseDragged, "mousePressed": mousePressed, "mouseReleased": mouseReleased, "mouseClicked": mouseClicked, "doubleClicked": doubleClicked, "mouseWheel": mouseWheel, "touchStarted": touchStarted, "touchMoved": touchMoved, "touchEnded": touchEnded, "windowResized": windowResized, "keyIsDown": keyIsDown, } start_p5(preload, setup, draw, event_functions) ================================================ FILE: docs/examples/transcrypt/sketch_007/index.html ================================================ sketch_007 - pyp5js (using Transcrypt)

Python code here.

             
def setup():
    createCanvas(900, 900)
    stroke(27, 27, 27, 10)
    strokeWeight(2)


def draw():
    push()

    translate(width / 2, height / 2)
    v = p5.Vector.random2D()
    v.normalize()
    v.mult(random(100, 400))
    line(0, 0, v.x, v.y)

    pop()

              
          
================================================ FILE: docs/examples/transcrypt/sketch_007/sketch_007.py ================================================ def setup(): createCanvas(900, 900) stroke(27, 27, 27, 10) strokeWeight(2) def draw(): push() translate(width / 2, height / 2) v = p5.Vector.random2D() v.normalize() v.mult(random(100, 400)) line(0, 0, v.x, v.y) pop() ================================================ FILE: docs/examples/transcrypt/sketch_007/static/p5.js ================================================ /*! p5.js v1.0.0 February 29, 2020 */ !function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).p5=e()}}(function(){return function o(a,s,l){function u(t,e){if(!s[t]){if(!a[t]){var r="function"==typeof require&&require;if(!e&&r)return r(t,!0);if(h)return h(t,!0);var i=new Error("Cannot find module '"+t+"'");throw i.code="MODULE_NOT_FOUND",i}var n=s[t]={exports:{}};a[t][0].call(n.exports,function(e){return u(a[t][1][e]||e)},n,n.exports,o,a,s,l)}return s[t].exports}for(var h="function"==typeof require&&require,e=0;e>16&255,a[s++]=t>>8&255,a[s++]=255&t;2===o&&(t=u[e.charCodeAt(r)]<<2|u[e.charCodeAt(r+1)]>>4,a[s++]=255&t);1===o&&(t=u[e.charCodeAt(r)]<<10|u[e.charCodeAt(r+1)]<<4|u[e.charCodeAt(r+2)]>>2,a[s++]=t>>8&255,a[s++]=255&t);return a},r.fromByteArray=function(e){for(var t,r=e.length,i=r%3,n=[],o=0,a=r-i;o>2]+s[t<<4&63]+"==")):2==i&&(t=(e[r-2]<<8)+e[r-1],n.push(s[t>>10]+s[t>>4&63]+s[t<<2&63]+"="));return n.join("")};for(var s=[],u=[],h="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=0,o=i.length;n>18&63]+s[n>>12&63]+s[n>>6&63]+s[63&n]);return o.join("")}u["-".charCodeAt(0)]=62,u["_".charCodeAt(0)]=63},{}],20:[function(e,t,r){},{}],21:[function(N,e,F){(function(c){"use strict";var i=N("base64-js"),o=N("ieee754"),e="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;F.Buffer=c,F.SlowBuffer=function(e){+e!=e&&(e=0);return c.alloc(+e)},F.INSPECT_MAX_BYTES=50;var r=2147483647;function a(e){if(r>>1;case"base64":return O(e).length;default:if(n)return i?-1:R(e).length;t=(""+t).toLowerCase(),n=!0}}function d(e,t,r){var i=e[t];e[t]=e[r],e[r]=i}function p(e,t,r,i,n){if(0===e.length)return-1;if("string"==typeof r?(i=r,r=0):2147483647=e.length){if(n)return-1;r=e.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof t&&(t=c.from(t,i)),c.isBuffer(t))return 0===t.length?-1:m(e,t,r,i,n);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):m(e,[t],r,i,n);throw new TypeError("val must be string, number or Buffer")}function m(e,t,r,i,n){var o,a=1,s=e.length,l=t.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(e.length<2||t.length<2)return-1;s/=a=2,l/=2,r/=2}function u(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(n){var h=-1;for(o=r;o>8,n=r%256,o.push(n),o.push(i);return o}(t,e.length-r),e,r,i)}function b(e,t,r){return 0===t&&r===e.length?i.fromByteArray(e):i.fromByteArray(e.slice(t,r))}function _(e,t,r){r=Math.min(e.length,r);for(var i=[],n=t;n>>10&1023|55296),h=56320|1023&h),i.push(h),n+=c}return function(e){var t=e.length;if(t<=x)return String.fromCharCode.apply(String,e);var r="",i=0;for(;ithis.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e=e||"utf8";;)switch(e){case"hex":return M(this,t,r);case"utf8":case"utf-8":return _(this,t,r);case"ascii":return w(this,t,r);case"latin1":case"binary":return S(this,t,r);case"base64":return b(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,t,r);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}.apply(this,arguments)},c.prototype.equals=function(e){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===c.compare(this,e)},c.prototype.inspect=function(){var e="",t=F.INSPECT_MAX_BYTES;return e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(e+=" ... "),""},e&&(c.prototype[e]=c.prototype.inspect),c.prototype.compare=function(e,t,r,i,n){if(A(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),t<0||r>e.length||i<0||n>this.length)throw new RangeError("out of range index");if(n<=i&&r<=t)return 0;if(n<=i)return-1;if(r<=t)return 1;if(this===e)return 0;for(var o=(n>>>=0)-(i>>>=0),a=(r>>>=0)-(t>>>=0),s=Math.min(o,a),l=this.slice(i,n),u=e.slice(t,r),h=0;h>>=0,isFinite(r)?(r>>>=0,void 0===i&&(i="utf8")):(i=r,r=void 0)}var n=this.length-t;if((void 0===r||nthis.length)throw new RangeError("Attempt to write outside buffer bounds");i=i||"utf8";for(var o,a,s,l,u,h,c=!1;;)switch(i){case"hex":return g(this,e,t,r);case"utf8":case"utf-8":return u=t,h=r,D(R(e,(l=this).length-u),l,u,h);case"ascii":return v(this,e,t,r);case"latin1":case"binary":return v(this,e,t,r);case"base64":return o=this,a=t,s=r,D(O(e),o,a,s);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return y(this,e,t,r);default:if(c)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),c=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var x=4096;function w(e,t,r){var i="";r=Math.min(e.length,r);for(var n=t;ne.length)throw new RangeError("Index out of range")}function P(e,t,r,i){if(r+i>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function L(e,t,r,i,n){return t=+t,r>>>=0,n||P(e,0,r,4),o.write(e,t,r,i,23,4),r+4}function k(e,t,r,i,n){return t=+t,r>>>=0,n||P(e,0,r,8),o.write(e,t,r,i,52,8),r+8}c.prototype.slice=function(e,t){var r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):r>>=0,t>>>=0,r||T(e,t,this.length);for(var i=this[e],n=1,o=0;++o>>=0,t>>>=0,r||T(e,t,this.length);for(var i=this[e+--t],n=1;0>>=0,t||T(e,1,this.length),this[e]},c.prototype.readUInt16LE=function(e,t){return e>>>=0,t||T(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUInt16BE=function(e,t){return e>>>=0,t||T(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUInt32LE=function(e,t){return e>>>=0,t||T(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUInt32BE=function(e,t){return e>>>=0,t||T(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||T(e,t,this.length);for(var i=this[e],n=1,o=0;++o>>=0,t>>>=0,r||T(e,t,this.length);for(var i=t,n=1,o=this[e+--i];0>>=0,t||T(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){e>>>=0,t||T(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(e,t){e>>>=0,t||T(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(e,t){return e>>>=0,t||T(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return e>>>=0,t||T(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readFloatLE=function(e,t){return e>>>=0,t||T(e,4,this.length),o.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return e>>>=0,t||T(e,4,this.length),o.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return e>>>=0,t||T(e,8,this.length),o.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return e>>>=0,t||T(e,8,this.length),o.read(this,e,!1,52,8)},c.prototype.writeUIntLE=function(e,t,r,i){e=+e,t>>>=0,r>>>=0,i||C(this,e,t,r,Math.pow(2,8*r)-1,0);var n=1,o=0;for(this[t]=255&e;++o>>=0,r>>>=0,i||C(this,e,t,r,Math.pow(2,8*r)-1,0);var n=r-1,o=1;for(this[t+n]=255&e;0<=--n&&(o*=256);)this[t+n]=e/o&255;return t+r},c.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,1,255,0),this[t]=255&e,t+1},c.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},c.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeIntLE=function(e,t,r,i){if(e=+e,t>>>=0,!i){var n=Math.pow(2,8*r-1);C(this,e,t,r,n-1,-n)}var o=0,a=1,s=0;for(this[t]=255&e;++o>0)-s&255;return t+r},c.prototype.writeIntBE=function(e,t,r,i){if(e=+e,t>>>=0,!i){var n=Math.pow(2,8*r-1);C(this,e,t,r,n-1,-n)}var o=r-1,a=1,s=0;for(this[t+o]=255&e;0<=--o&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+r},c.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},c.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeFloatLE=function(e,t,r){return L(this,e,t,!0,r)},c.prototype.writeFloatBE=function(e,t,r){return L(this,e,t,!1,r)},c.prototype.writeDoubleLE=function(e,t,r){return k(this,e,t,!0,r)},c.prototype.writeDoubleBE=function(e,t,r){return k(this,e,t,!1,r)},c.prototype.copy=function(e,t,r,i){if(!c.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r=r||0,i||0===i||(i=this.length),t>=e.length&&(t=e.length),t=t||0,0=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t>>=0,r=void 0===r?this.length:r>>>0,"number"==typeof(e=e||0))for(o=t;o>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function O(e){return i.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(t,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function D(e,t,r,i){for(var n=0;n=t.length||n>=e.length);++n)t[n+r]=e[n];return n}function A(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function I(e){return e!=e}var U=function(){for(var e="0123456789abcdef",t=new Array(256),r=0;r<16;++r)for(var i=16*r,n=0;n<16;++n)t[i+n]=e[r]+e[n];return t}()}).call(this,N("buffer").Buffer)},{"base64-js":19,buffer:21,ieee754:30}],22:[function(e,t,r){"use strict";t.exports=e("./").polyfill()},{"./":23}],23:[function(z,r,i){(function(j,V){var e,t;e=this,t=function(){"use strict";function l(e){return"function"==typeof e}var r=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},i=0,t=void 0,n=void 0,a=function(e,t){f[i]=e,f[i+1]=t,2===(i+=2)&&(n?n(d):y())};var e="undefined"!=typeof window?window:void 0,o=e||{},s=o.MutationObserver||o.WebKitMutationObserver,u="undefined"==typeof self&&void 0!==j&&"[object process]"==={}.toString.call(j),h="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function c(){var e=setTimeout;return function(){return e(d,1)}}var f=new Array(1e3);function d(){for(var e=0;e":">",'"':""","'":"'","/":"/"};function S(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,function(e){return w[e]}):e}var M=function(){function i(e){var t,r=1=this.maxReplaces)break}for(a=0;r=this.regexp.exec(e);){if(void 0===(i=h(r[1].trim())))if("function"==typeof c){var d=c(e,r,t);i="string"==typeof d?d:""}else this.logger.warn("missed to pass in variable ".concat(r[1]," for interpolating ").concat(e)),i="";else"string"==typeof i||this.useRawValueToEscape||(i=v(i));if(i=this.escapeValue?u(this.escape(i)):u(i),e=e.replace(r[0],i),this.regexp.lastIndex=0,++a>=this.maxReplaces)break}return e}},{key:"nest",value:function(e,t,r){var i,n,o=D({},2>1,h=-7,c=r?n-1:0,f=r?-1:1,d=e[t+c];for(c+=f,o=d&(1<<-h)-1,d>>=-h,h+=s;0>=-h,h+=i;0>1,f=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,d=i?0:o-1,p=i?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=h):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),2<=(t+=1<=a+c?f/l:f*Math.pow(2,1-c))*l&&(a++,l/=2),h<=a+c?(s=0,a=h):1<=a+c?(s=(t*l-1)*Math.pow(2,n),a+=c):(s=t*Math.pow(2,c-1)*Math.pow(2,n),a=0));8<=n;e[r+d]=255&s,d+=p,s/=256,n-=8);for(a=a<Math.abs(e[0])&&(t=1),Math.abs(e[2])>Math.abs(e[t])&&(t=2),t}var C=4e150;function P(e,t){e.f+=t.f,e.b.f+=t.b.f}function u(e,t,r){return e=e.a,t=t.a,r=r.a,t.b.a===e?r.b.a===e?v(t.a,r.a)?b(r.b.a,t.a,r.a)<=0:0<=b(t.b.a,r.a,t.a):b(r.b.a,e,r.a)<=0:r.b.a===e?0<=b(t.b.a,e,t.a):(t=y(t.b.a,e,t.a),(e=y(r.b.a,e,r.a))<=t)}function L(e){e.a.i=null;var t=e.e;t.a.c=t.c,t.c.a=t.a,e.e=null}function h(e,t){c(e.a),e.c=!1,(e.a=t).i=e}function k(e){for(var t=e.a.a;(e=fe(e)).a.a===t;);return e.c&&(h(e,t=f(ce(e).a.b,e.a.e)),e=fe(e)),e}function R(e,t,r){var i=new he;return i.a=r,i.e=W(e.f,t.e,i),r.i=i}function O(e,t){switch(e.s){case 100130:return 0!=(1&t);case 100131:return 0!==t;case 100132:return 0>1]],s[a[u]])?le(r,u):ue(r,u)),s[o]=null,l[o]=r.b,r.b=o}else for(r.c[-(o+1)]=null;0Math.max(a.a,l.a))return!1;if(v(o,a)){if(0i.f&&(i.f*=2,i.c=oe(i.c,i.f+1)),0===i.b?r=n:(r=i.b,i.b=i.c[i.b]),i.e[r]=t,i.c[r]=n,i.d[n]=r,i.h&&ue(i,n),r}return i=e.a++,e.c[i]=t,-(i+1)}function ie(e){if(0===e.a)return se(e.b);var t=e.c[e.d[e.a-1]];if(0!==e.b.a&&v(ae(e.b),t))return se(e.b);for(;--e.a,0e.a||v(i[a],i[l])){n[r[o]=a]=o;break}n[r[o]=l]=o,o=s}}function ue(e,t){for(var r=e.d,i=e.e,n=e.c,o=t,a=r[o];;){var s=o>>1,l=r[s];if(0==s||v(i[l],i[a])){n[r[o]=a]=o;break}n[r[o]=l]=o,o=s}}function he(){this.e=this.a=null,this.f=0,this.c=this.b=this.h=this.d=!1}function ce(e){return e.e.c.b}function fe(e){return e.e.a.b}(i=q.prototype).x=function(){Y(this,0)},i.B=function(e,t){switch(e){case 100142:return;case 100140:switch(t){case 100130:case 100131:case 100132:case 100133:case 100134:return void(this.s=t)}break;case 100141:return void(this.m=!!t);default:return void Z(this,100900)}Z(this,100901)},i.y=function(e){switch(e){case 100142:return 0;case 100140:return this.s;case 100141:return this.m;default:Z(this,100900)}return!1},i.A=function(e,t,r){this.j[0]=e,this.j[1]=t,this.j[2]=r},i.z=function(e,t){var r=t||null;switch(e){case 100100:case 100106:this.h=r;break;case 100104:case 100110:this.l=r;break;case 100101:case 100107:this.k=r;break;case 100102:case 100108:this.i=r;break;case 100103:case 100109:this.p=r;break;case 100105:case 100111:this.o=r;break;case 100112:this.r=r;break;default:Z(this,100900)}},i.C=function(e,t){var r=!1,i=[0,0,0];Y(this,2);for(var n=0;n<3;++n){var o=e[n];o<-1e150&&(o=-1e150,r=!0),1e150n[u]&&(n[u]=h,a[u]=l)}if(l=0,n[1]-o[1]>n[0]-o[0]&&(l=1),n[2]-o[2]>n[l]-o[l]&&(l=2),o[l]>=n[l])i[0]=0,i[1]=0,i[2]=1;else{for(n=0,o=s[l],a=a[l],s=[0,0,0],o=[o.g[0]-a.g[0],o.g[1]-a.g[1],o.g[2]-a.g[2]],u=[0,0,0],l=r.e;l!==r;l=l.e)u[0]=l.g[0]-a.g[0],u[1]=l.g[1]-a.g[1],u[2]=l.g[2]-a.g[2],s[0]=o[1]*u[2]-o[2]*u[1],s[1]=o[2]*u[0]-o[0]*u[2],s[2]=o[0]*u[1]-o[1]*u[0],n<(h=s[0]*s[0]+s[1]*s[1]+s[2]*s[2])&&(n=h,i[0]=s[0],i[1]=s[1],i[2]=s[2]);n<=0&&(i[0]=i[1]=i[2]=0,i[T(o)]=1)}r=!0}for(s=T(i),l=this.b.c,n=(s+1)%3,a=(s+2)%3,s=0>=l,h-=l,g!=o){if(g==a)break;for(var v=g>8,++y;var _=b;if(i>=8;null!==m&&s<4096&&(p[s++]=m<<8|_,u+1<=s&&l<12&&(++l,u=u<<1|1)),m=g}else s=1+a,u=(1<<(l=n+1))-1,m=null}return f!==i&&console.log("Warning, gif stream shorter than expected."),r}try{r.GifWriter=function(v,e,t,r){var y=0,i=void 0===(r=void 0===r?{}:r).loop?null:r.loop,b=void 0===r.palette?null:r.palette;if(e<=0||t<=0||65535>=1;)++n;if(a=1<>8&255,v[y++]=255&t,v[y++]=t>>8&255,v[y++]=(null!==b?128:0)|n,v[y++]=o,v[y++]=0,null!==b)for(var s=0,l=b.length;s>16&255,v[y++]=u>>8&255,v[y++]=255&u}if(null!==i){if(i<0||65535>8&255,v[y++]=0}var x=!1;this.addFrame=function(e,t,r,i,n,o){if(!0===x&&(--y,x=!1),o=void 0===o?{}:o,e<0||t<0||65535>=1;)++u;l=1<>8&255,v[y++]=d,v[y++]=0),v[y++]=44,v[y++]=255&e,v[y++]=e>>8&255,v[y++]=255&t,v[y++]=t>>8&255,v[y++]=255&r,v[y++]=r>>8&255,v[y++]=255&i,v[y++]=i>>8&255,v[y++]=!0===a?128|u-1:0,!0===a)for(var p=0,m=s.length;p>16&255,v[y++]=g>>8&255,v[y++]=255&g}return y=function(t,r,e,i){t[r++]=e;var n=r++,o=1<>=8,h-=8,r===n+256&&(t[n]=255,n=r++)}function d(e){c|=e<>=8,h-=8,r===n+256&&(t[n]=255,n=r++);4096===l?(d(o),l=1+s,u=e+1,m={}):(1<>7,n=1<<1+(7&r);x[e++],x[e++];var o=null,a=null;i&&(o=e,e+=3*(a=n));var s=!0,l=[],u=0,h=null,c=0,f=null;for(this.width=w,this.height=t;s&&e>2&7,e++;break;case 254:for(;;){if(!(0<=(C=x[e++])))throw Error("Invalid block size");if(0===C)break;e+=C}break;default:throw new Error("Unknown graphic control label: 0x"+x[e-1].toString(16))}break;case 44:var p=x[e++]|x[e++]<<8,m=x[e++]|x[e++]<<8,g=x[e++]|x[e++]<<8,v=x[e++]|x[e++]<<8,y=x[e++],b=y>>6&1,_=1<<1+(7&y),S=o,M=a,E=!1;if(y>>7){E=!0;S=e,e+=3*(M=_)}var T=e;for(e++;;){var C;if(!(0<=(C=x[e++])))throw Error("Invalid block size");if(0===C)break;e+=C}l.push({x:p,y:m,width:g,height:v,has_local_palette:E,palette_offset:S,palette_size:M,data_offset:T,data_length:e-T,transparent_index:h,interlaced:!!b,delay:u,disposal:c});break;case 59:s=!1;break;default:throw new Error("Unknown gif block: 0x"+x[e-1].toString(16))}this.numFrames=function(){return l.length},this.loopCount=function(){return f},this.frameInfo=function(e){if(e<0||e>=l.length)throw new Error("Frame index out of range.");return l[e]},this.decodeAndBlitFrameBGRA=function(e,t){var r=this.frameInfo(e),i=r.width*r.height,n=new Uint8Array(i);P(x,r.data_offset,n,i);var o=r.palette_offset,a=r.transparent_index;null===a&&(a=256);var s=r.width,l=w-s,u=s,h=4*(r.y*w+r.x),c=4*((r.y+r.height)*w+r.x),f=h,d=4*l;!0===r.interlaced&&(d+=4*w*7);for(var p=8,m=0,g=n.length;m>=1)),v===a)f+=4;else{var y=x[o+3*v],b=x[o+3*v+1],_=x[o+3*v+2];t[f++]=_,t[f++]=b,t[f++]=y,t[f++]=255}--u}},this.decodeAndBlitFrameRGBA=function(e,t){var r=this.frameInfo(e),i=r.width*r.height,n=new Uint8Array(i);P(x,r.data_offset,n,i);var o=r.palette_offset,a=r.transparent_index;null===a&&(a=256);var s=r.width,l=w-s,u=s,h=4*(r.y*w+r.x),c=4*((r.y+r.height)*w+r.x),f=h,d=4*l;!0===r.interlaced&&(d+=4*w*7);for(var p=8,m=0,g=n.length;m>=1)),v===a)f+=4;else{var y=x[o+3*v],b=x[o+3*v+1],_=x[o+3*v+2];t[f++]=y,t[f++]=b,t[f++]=_,t[f++]=255}--u}}}}catch(e){}},{}],33:[function(jr,t,r){(function(Gr){var e;e=this,function(E){"use strict";function e(e){if(null==this)throw TypeError();var t=String(this),r=t.length,i=e?Number(e):0;if(i!=i&&(i=0),!(i<0||r<=i)){var n,o=t.charCodeAt(i);return 55296<=o&&o<=56319&&i+1>>=1,t}function _(e,t,r){if(!t)return r;for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<>>16-t;return e.tag>>>=t,e.bitcount-=t,i+r}function x(e,t){for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<>>=1,++n,r+=t.table[n],0<=(i-=t.table[n]););return e.tag=o,e.bitcount-=n,t.trans[r+i]}function w(e,t,r){var i,n,o,a,s,l;for(i=_(e,5,257),n=_(e,5,1),o=_(e,4,4),a=0;a<19;++a)g[a]=0;for(a=0;athis.x2&&(this.x2=e)),"number"==typeof t&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=t,this.y2=t),tthis.y2&&(this.y2=t))},C.prototype.addX=function(e){this.addPoint(e,null)},C.prototype.addY=function(e){this.addPoint(null,e)},C.prototype.addBezier=function(e,t,r,i,n,o,a,s){var l=this,u=[e,t],h=[r,i],c=[n,o],f=[a,s];this.addPoint(e,t),this.addPoint(a,s);for(var d=0;d<=1;d++){var p=6*u[d]-12*h[d]+6*c[d],m=-3*u[d]+9*h[d]-9*c[d]+3*f[d],g=3*h[d]-3*u[d];if(0!=m){var v=Math.pow(p,2)-4*g*m;if(!(v<0)){var y=(-p+Math.sqrt(v))/(2*m);0>8&255,255&e]},A.USHORT=U(2),D.SHORT=function(e){return 32768<=e&&(e=-(65536-e)),[e>>8&255,255&e]},A.SHORT=U(2),D.UINT24=function(e){return[e>>16&255,e>>8&255,255&e]},A.UINT24=U(3),D.ULONG=function(e){return[e>>24&255,e>>16&255,e>>8&255,255&e]},A.ULONG=U(4),D.LONG=function(e){return R<=e&&(e=-(2*R-e)),[e>>24&255,e>>16&255,e>>8&255,255&e]},A.LONG=U(4),D.FIXED=D.ULONG,A.FIXED=A.ULONG,D.FWORD=D.SHORT,A.FWORD=A.SHORT,D.UFWORD=D.USHORT,A.UFWORD=A.USHORT,D.LONGDATETIME=function(e){return[0,0,0,0,e>>24&255,e>>16&255,e>>8&255,255&e]},A.LONGDATETIME=U(8),D.TAG=function(e){return k.argument(4===e.length,"Tag should be exactly 4 ASCII characters."),[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]},A.TAG=U(4),D.Card8=D.BYTE,A.Card8=A.BYTE,D.Card16=D.USHORT,A.Card16=A.USHORT,D.OffSize=D.BYTE,A.OffSize=A.BYTE,D.SID=D.USHORT,A.SID=A.USHORT,D.NUMBER=function(e){return-107<=e&&e<=107?[e+139]:108<=e&&e<=1131?[247+((e-=108)>>8),255&e]:-1131<=e&&e<=-108?[251+((e=-e-108)>>8),255&e]:-32768<=e&&e<=32767?D.NUMBER16(e):D.NUMBER32(e)},A.NUMBER=function(e){return D.NUMBER(e).length},D.NUMBER16=function(e){return[28,e>>8&255,255&e]},A.NUMBER16=U(3),D.NUMBER32=function(e){return[29,e>>24&255,e>>16&255,e>>8&255,255&e]},A.NUMBER32=U(5),D.REAL=function(e){var t=e.toString(),r=/\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec(t);if(r){var i=parseFloat("1e"+((r[2]?+r[2]:0)+r[1].length));t=(Math.round(e*i)/i).toString()}for(var n="",o=0,a=t.length;o>8&255,t[t.length]=255&i}return t},A.UTF16=function(e){return 2*e.length};var N={"x-mac-croatian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈ƫȅ ÀÃÕŒœĐ—“”‘’÷◊©⁄€‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ","x-mac-cyrillic":"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю","x-mac-gaelic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØḂ±≤≥ḃĊċḊḋḞḟĠġṀæøṁṖṗɼƒſṠ«»… ÀÃÕŒœ–—“”‘’ṡẛÿŸṪ€‹›Ŷŷṫ·Ỳỳ⁊ÂÊÁËÈÍÎÏÌÓÔ♣ÒÚÛÙıÝýŴŵẄẅẀẁẂẃ","x-mac-greek":"Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦€ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ­","x-mac-icelandic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüݰ¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-inuit":"ᐃᐄᐅᐆᐊᐋᐱᐲᐳᐴᐸᐹᑉᑎᑏᑐᑑᑕᑖᑦᑭᑮᑯᑰᑲᑳᒃᒋᒌᒍᒎᒐᒑ°ᒡᒥᒦ•¶ᒧ®©™ᒨᒪᒫᒻᓂᓃᓄᓅᓇᓈᓐᓯᓰᓱᓲᓴᓵᔅᓕᓖᓗᓘᓚᓛᓪᔨᔩᔪᔫᔭ… ᔮᔾᕕᕖᕗ–—“”‘’ᕘᕙᕚᕝᕆᕇᕈᕉᕋᕌᕐᕿᖀᖁᖂᖃᖄᖅᖏᖐᖑᖒᖓᖔᖕᙱᙲᙳᙴᙵᙶᖖᖠᖡᖢᖣᖤᖥᖦᕼŁł","x-mac-ce":"ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ",macintosh:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-romanian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂȘ∞±≤≥¥µ∂∑∏π∫ªºΩăș¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›Țț‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-turkish":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙˆ˜¯˘˙˚¸˝˛ˇ"};O.MACSTRING=function(e,t,r,i){var n=N[i];if(void 0!==n){for(var o="",a=0;a>8&255,l+256&255)}return o}D.MACSTRING=function(e,t){var r=function(e){if(!F)for(var t in F={},N)F[t]=new String(t);var r=F[e];if(void 0!==r){if(B){var i=B.get(r);if(void 0!==i)return i}var n=N[e];if(void 0!==n){for(var o={},a=0;a>8,t[c+1]=255&f,t=t.concat(i[h])}return t},A.TABLE=function(e){for(var t=0,r=e.fields.length,i=0;i>1,t.skip("uShort",3),e.glyphIndexMap={};for(var a=new se.Parser(r,i+n+14),s=new se.Parser(r,i+n+16+2*o),l=new se.Parser(r,i+n+16+4*o),u=new se.Parser(r,i+n+16+6*o),h=i+n+16+8*o,c=0;c>4,o=15&i;if(15==n)break;if(t+=r[n],15==o)break;t+=r[o]}return parseFloat(t)}(e);if(32<=t&&t<=246)return t-139;if(247<=t&&t<=250)return 256*(t-247)+e.parseByte()+108;if(251<=t&&t<=254)return 256*-(t-251)-e.parseByte()-108;throw new Error("Invalid b0 "+t)}function Te(e,t,r){t=void 0!==t?t:0;var i=new se.Parser(e,t),n=[],o=[];for(r=void 0!==r?r:e.length;i.relativeOffset>1,T.length=0,P=!0}return function e(t){for(var r,i,n,o,a,s,l,u,h,c,f,d,p=0;pMath.abs(d-R)?k=f+T.shift():R=d+T.shift(),E.curveTo(y,b,_,x,l,u),E.curveTo(h,c,f,d,k,R);break;default:console.log("Glyph "+v.index+": unknown operator 1200"+m),T.length=0}break;case 14:0>3;break;case 21:2>16),p+=2;break;case 29:a=T.pop()+g.gsubrsBias,(s=g.gsubrs[a])&&e(s);break;case 30:for(;0=r.begin&&e=fe.length){var a=i.parseChar();r.names.push(i.parseString(a))}break;case 2.5:r.numberOfGlyphs=i.parseUShort(),r.offset=new Array(r.numberOfGlyphs);for(var s=0;st.value.tag?1:-1}),t.fields=t.fields.concat(i),t.fields=t.fields.concat(n),t}function gt(e,t,r){for(var i=0;i 123 are reserved for internal usage");d|=1<>>1,o=e[n].tag;if(o===t)return n;o>>1,o=e[n];if(o===t)return n;o>>1,a=(r=e[o]).start;if(a===t)return r;a(r=e[i-1]).end?0:r}function xt(e,t){this.font=e,this.tableName=t}function wt(e){xt.call(this,e,"gpos")}function St(e){xt.call(this,e,"gsub")}function Mt(e,t){var r=e.length;if(r!==t.length)return!1;for(var i=0;it.points.length-1||i.matchedPoints[1]>n.points.length-1)throw Error("Matched points out of range in "+t.name);var a=t.points[i.matchedPoints[0]],s=n.points[i.matchedPoints[1]],l={xScale:i.xScale,scale01:i.scale01,scale10:i.scale10,yScale:i.yScale,dx:0,dy:0};s=kt([s],l)[0],l.dx=a.x-s.x,l.dy=a.y-s.y,o=kt(n.points,l)}t.points=t.points.concat(o)}}return Rt(t.points)}(wt.prototype=xt.prototype={searchTag:yt,binSearch:bt,getTable:function(e){var t=this.font.tables[this.tableName];return!t&&e&&(t=this.font.tables[this.tableName]=this.createDefaultTable()),t},getScriptNames:function(){var e=this.getTable();return e?e.scripts.map(function(e){return e.tag}):[]},getDefaultScriptName:function(){var e=this.getTable();if(e){for(var t=!1,r=0;r=s[u-1].tag,"Features must be added in alphabetical order."),o={tag:r,feature:{params:0,lookupListIndexes:[]}},s.push(o),a.push(u),o.feature}}},getLookupTables:function(e,t,r,i,n){var o=this.getFeatureTable(e,t,r,n),a=[];if(o){for(var s,l=o.lookupListIndexes,u=this.font.tables[this.tableName].lookups,h=0;h",s),t.stack.push(Math.round(64*s))}function vr(e,t){var r=t.stack,i=r.pop(),n=t.fv,o=t.pv,a=t.ppem,s=t.deltaBase+16*(e-1),l=t.deltaShift,u=t.z0;E.DEBUG&&console.log(t.step,"DELTAP["+e+"]",i,r);for(var h=0;h>4)===a){var d=(15&f)-8;0<=d&&d++,E.DEBUG&&console.log(t.step,"DELTAPFIX",c,"by",d*l);var p=u[c];n.setRelative(p,p,d*l,o)}}}function yr(e,t){var r=t.stack,i=r.pop();E.DEBUG&&console.log(t.step,"ROUND[]"),r.push(64*t.round(i/64))}function br(e,t){var r=t.stack,i=r.pop(),n=t.ppem,o=t.deltaBase+16*(e-1),a=t.deltaShift;E.DEBUG&&console.log(t.step,"DELTAC["+e+"]",i,r);for(var s=0;s>4)===n){var h=(15&u)-8;0<=h&&h++;var c=h*a;E.DEBUG&&console.log(t.step,"DELTACFIX",l,"by",c),t.cvt[l]+=c}}}function _r(e,t){var r,i,n=t.stack,o=n.pop(),a=n.pop(),s=t.z2[o],l=t.z1[a];E.DEBUG&&console.log(t.step,"SDPVTL["+e+"]",o,a),i=e?(r=s.y-l.y,l.x-s.x):(r=l.x-s.x,l.y-s.y),t.dpv=Zt(r,i)}function xr(e,t){var r=t.stack,i=t.prog,n=t.ip;E.DEBUG&&console.log(t.step,"PUSHB["+e+"]");for(var o=0;o":"_")+(i?"R":"_")+(0===n?"Gr":1===n?"Bl":2===n?"Wh":"")+"]",e?c+"("+o.cvt[c]+","+u+")":"",f,"(d =",a,"->",l*s,")"),o.rp1=o.rp0,o.rp2=f,t&&(o.rp0=f)}Ft.prototype.exec=function(e,t){if("number"!=typeof t)throw new Error("Point size is not a number!");if(!(2",i),s.interpolate(c,o,a,l),s.touch(c)}e.loop=1},dr.bind(void 0,0),dr.bind(void 0,1),function(e){for(var t=e.stack,r=e.rp0,i=e.z0[r],n=e.loop,o=e.fv,a=e.pv,s=e.z1;n--;){var l=t.pop(),u=s[l];E.DEBUG&&console.log(e.step,(1=a.width||t>=a.height?[0,0,0,0]:this._getPixel(e,t);var s=new l.default.Image(r,i);return s.canvas.getContext("2d").drawImage(a,e,t,r*o,i*o,0,0,r,i),s},l.default.Renderer.prototype.textLeading=function(e){return"number"==typeof e?(this._setProperty("_textLeading",e),this._pInst):this._textLeading},l.default.Renderer.prototype.textSize=function(e){return"number"==typeof e?(this._setProperty("_textSize",e),this._setProperty("_textLeading",e*y._DEFAULT_LEADMULT),this._applyTextProperties()):this._textSize},l.default.Renderer.prototype.textStyle=function(e){return e?(e!==y.NORMAL&&e!==y.ITALIC&&e!==y.BOLD&&e!==y.BOLDITALIC||this._setProperty("_textStyle",e),this._applyTextProperties()):this._textStyle},l.default.Renderer.prototype.textAscent=function(){return null===this._textAscent&&this._updateTextMetrics(),this._textAscent},l.default.Renderer.prototype.textDescent=function(){return null===this._textDescent&&this._updateTextMetrics(),this._textDescent},l.default.Renderer.prototype.textAlign=function(e,t){return void 0!==e?(this._setProperty("_textAlign",e),void 0!==t&&this._setProperty("_textBaseline",t),this._applyTextProperties()):{horizontal:this._textAlign,vertical:this._textBaseline}},l.default.Renderer.prototype.text=function(e,t,r,i,n){var o,a,s,l,u,h,c,f,d=this._pInst,p=Number.MAX_VALUE;if((this._doFill||this._doStroke)&&void 0!==e){if("string"!=typeof e&&(e=e.toString()),o=(e=e.replace(/(\t)/g," ")).split("\n"),void 0!==i){for(s=f=0;ss.HALF_PI&&e<=3*s.HALF_PI?Math.atan(r/i*Math.tan(e))+s.PI:Math.atan(r/i*Math.tan(e))+s.TWO_PI,t=t<=s.HALF_PI?Math.atan(r/i*Math.tan(t)):t>s.HALF_PI&&t<=3*s.HALF_PI?Math.atan(r/i*Math.tan(t))+s.PI:Math.atan(r/i*Math.tan(t))+s.TWO_PI),tv||Math.abs(this.accelerationY-this.pAccelerationY)>v||Math.abs(this.accelerationZ-this.pAccelerationZ)>v)&&e();var t=this.deviceTurned||window.deviceTurned;if("function"==typeof t){var r=this.rotationX+180,i=this.pRotationX+180,n=c+180;0>>24],i+=x[(16711680&C)>>16],n+=x[(65280&C)>>8],o+=x[255&C],r+=k[_],s++}w[l=T+y]=a/r,S[l]=i/r,M[l]=n/r,E[l]=o/r}T+=d}for(h=(u=-P)*d,b=T=0;b>>16,e[r+1]=(65280&t[i])>>>8,e[r+2]=255&t[i],e[r+3]=(4278190080&t[i])>>>24},O._toImageData=function(e){return e instanceof ImageData?e:e.getContext("2d").getImageData(0,0,e.width,e.height)},O._createImageData=function(e,t){return O._tmpCanvas=document.createElement("canvas"),O._tmpCtx=O._tmpCanvas.getContext("2d"),this._tmpCtx.createImageData(e,t)},O.apply=function(e,t,r){var i=e.getContext("2d"),n=i.getImageData(0,0,e.width,e.height),o=t(n,r);o instanceof ImageData?i.putImageData(o,0,0,0,0,e.width,e.height):i.putImageData(n,0,0,0,0,e.width,e.height)},O.threshold=function(e,t){var r=O._toPixels(e);void 0===t&&(t=.5);for(var i=Math.floor(255*t),n=0;n>8)/i,r[n+1]=255*(a*t>>8)/i,r[n+2]=255*(s*t>>8)/i}},O.dilate=function(e){for(var t,r,i,n,o,a,s,l,u,h,c,f,d,p,m,g,v,y=O._toPixels(e),b=0,_=y.length?y.length/4:0,x=new Int32Array(_);b<_;)for(r=(t=b)+e.width;b>16&255)+151*(i>>8&255)+28*(255&i))<(m=77*(c>>16&255)+151*(c>>8&255)+28*(255&c))&&(n=c,o=m),o<(p=77*((h=O._getARGB(y,a))>>16&255)+151*(h>>8&255)+28*(255&h))&&(n=h,o=p),o<(g=77*(f>>16&255)+151*(f>>8&255)+28*(255&f))&&(n=f,o=g),o<(v=77*(d>>16&255)+151*(d>>8&255)+28*(255&d))&&(n=d,o=v),x[b++]=n;O._setPixels(y,x)},O.erode=function(e){for(var t,r,i,n,o,a,s,l,u,h,c,f,d,p,m,g,v,y=O._toPixels(e),b=0,_=y.length?y.length/4:0,x=new Int32Array(_);b<_;)for(r=(t=b)+e.width;b>16&255)+151*(c>>8&255)+28*(255&c))<(o=77*(i>>16&255)+151*(i>>8&255)+28*(255&i))&&(n=c,o=m),(p=77*((h=O._getARGB(y,a))>>16&255)+151*(h>>8&255)+28*(255&h))>16&255)+151*(f>>8&255)+28*(255&f))>16&255)+151*(d>>8&255)+28*(255&d))=r){var i=Math.floor(t.timeDisplayed/r);if(t.timeDisplayed=0,t.displayIndex+=i,t.loopCount=Math.floor(t.displayIndex/t.numFrames),null!==t.loopLimit&&t.loopCount>=t.loopLimit)t.playing=!1;else{var n=t.displayIndex%t.numFrames;this.drawingContext.putImageData(t.frames[n].image,0,0),t.displayIndex=n,this.setModified(!0)}}}},n.default.Image.prototype._setProperty=function(e,t){this[e]=t,this.setModified(!0)},n.default.Image.prototype.loadPixels=function(){n.default.Renderer2D.prototype.loadPixels.call(this),this.setModified(!0)},n.default.Image.prototype.updatePixels=function(e,t,r,i){n.default.Renderer2D.prototype.updatePixels.call(this,e,t,r,i),this.setModified(!0)},n.default.Image.prototype.get=function(e,t,r,i){return n.default._validateParameters("p5.Image.get",arguments),n.default.Renderer2D.prototype.get.apply(this,arguments)},n.default.Image.prototype._getPixel=n.default.Renderer2D.prototype._getPixel,n.default.Image.prototype.set=function(e,t,r){n.default.Renderer2D.prototype.set.call(this,e,t,r),this.setModified(!0)},n.default.Image.prototype.resize=function(e,t){0===e&&0===t?(e=this.canvas.width,t=this.canvas.height):0===e?e=this.canvas.width*t/this.canvas.height:0===t&&(t=this.canvas.height*e/this.canvas.width),e=Math.floor(e),t=Math.floor(t);var r=document.createElement("canvas");if(r.width=e,r.height=t,this.gifProperties)for(var i=this.gifProperties,n=function(e,t){for(var r=0,i=0;i/g,">").replace(/"/g,""").replace(/'/g,"'")}function l(e,t){t&&!0!==t&&"true"!==t||(t="");var r="";return(e=e||"untitled")&&e.includes(".")&&(r=e.split(".").pop()),t&&r!==t&&(r=t,e="".concat(e,".").concat(r)),[e,r]}e("../core/error_helpers"),v.default.prototype.loadJSON=function(){for(var e=arguments.length,t=new Array(e),r=0;r"),n.print("");if(n.print(' '),n.print(""),n.print(""),n.print(" "),"0"!==o[0]){n.print(" ");for(var h=0;h".concat(c)),n.print(" ")}n.print(" ")}for(var f=0;f");for(var d=0;d".concat(p)),n.print(" ")}n.print(" ")}n.print("
"),n.print(""),n.print("")}n.close(),n.clear()},v.default.prototype.writeFile=function(e,t,r){var i="application/octet-stream";v.default.prototype._isSafari()&&(i="text/plain");var n=new Blob(e,{type:i});v.default.prototype.downloadFile(n,t,r)},v.default.prototype.downloadFile=function(e,t,r){var i=l(t,r),n=i[0];if(e instanceof Blob)s.default.saveAs(e,n);else{var o=document.createElement("a");if(o.href=e,o.download=n,o.onclick=function(e){var t;t=e,document.body.removeChild(t.target),e.stopPropagation()},o.style.display="none",document.body.appendChild(o),v.default.prototype._isSafari()){var a="Hello, Safari user! To download this file...\n";a+="1. Go to File --\x3e Save As.\n",a+='2. Choose "Page Source" as the Format.\n',a+='3. Name it with this extension: ."'.concat(i[1],'"'),alert(a)}o.click()}},v.default.prototype._checkFileExtension=l,v.default.prototype._isSafari=function(){return 0>>0},getSeed:function(){return t},rand:function(){return(r=(1664525*r+1013904223)%i)/i}});n.setSeed(e),_=new Array(4096);for(var o=0;o<4096;o++)_[o]=n.rand()};var o=n.default;r.default=o},{"../core/main":49}],82:[function(e,t,r){"use strict";function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i,l=(i=e("../core/main"))&&i.__esModule?i:{default:i},o=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==a(e)&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var o=i?Object.getOwnPropertyDescriptor(e,n):null;o&&(o.get||o.set)?Object.defineProperty(r,n,o):r[n]=e[n]}r.default=e,t&&t.set(e,r);return r}(e("../core/constants"));function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}l.default.Vector=function(e,t,r){var i,n,o;o=e instanceof l.default?(this.p5=e,i=t[0]||0,n=t[1]||0,t[2]||0):(i=e||0,n=t||0,r||0),this.x=i,this.y=n,this.z=o},l.default.Vector.prototype.toString=function(){return"p5.Vector Object : [".concat(this.x,", ").concat(this.y,", ").concat(this.z,"]")},l.default.Vector.prototype.set=function(e,t,r){return e instanceof l.default.Vector?(this.x=e.x||0,this.y=e.y||0,this.z=e.z||0):e instanceof Array?(this.x=e[0]||0,this.y=e[1]||0,this.z=e[2]||0):(this.x=e||0,this.y=t||0,this.z=r||0),this},l.default.Vector.prototype.copy=function(){return this.p5?new l.default.Vector(this.p5,[this.x,this.y,this.z]):new l.default.Vector(this.x,this.y,this.z)},l.default.Vector.prototype.add=function(e,t,r){return e instanceof l.default.Vector?(this.x+=e.x||0,this.y+=e.y||0,this.z+=e.z||0):e instanceof Array?(this.x+=e[0]||0,this.y+=e[1]||0,this.z+=e[2]||0):(this.x+=e||0,this.y+=t||0,this.z+=r||0),this};function u(e,t){return 0!==e&&(this.x=this.x%e),0!==t&&(this.y=this.y%t),this}function h(e,t,r){return 0!==e&&(this.x=this.x%e),0!==t&&(this.y=this.y%t),0!==r&&(this.z=this.z%r),this}l.default.Vector.prototype.rem=function(e,t,r){if(e instanceof l.default.Vector){if(Number.isFinite(e.x)&&Number.isFinite(e.y)&&Number.isFinite(e.z)){var i=parseFloat(e.x),n=parseFloat(e.y),o=parseFloat(e.z);h.call(this,i,n,o)}}else if(e instanceof Array)e.every(function(e){return Number.isFinite(e)})&&(2===e.length&&u.call(this,e[0],e[1]),3===e.length&&h.call(this,e[0],e[1],e[2]));else if(1===arguments.length){if(Number.isFinite(e)&&0!==e)return this.x=this.x%e,this.y=this.y%e,this.z=this.z%e,this}else if(2===arguments.length){var a=Array.prototype.slice.call(arguments);a.every(function(e){return Number.isFinite(e)})&&2===a.length&&u.call(this,a[0],a[1])}else if(3===arguments.length){var s=Array.prototype.slice.call(arguments);s.every(function(e){return Number.isFinite(e)})&&3===s.length&&h.call(this,s[0],s[1],s[2])}},l.default.Vector.prototype.sub=function(e,t,r){return e instanceof l.default.Vector?(this.x-=e.x||0,this.y-=e.y||0,this.z-=e.z||0):e instanceof Array?(this.x-=e[0]||0,this.y-=e[1]||0,this.z-=e[2]||0):(this.x-=e||0,this.y-=t||0,this.z-=r||0),this},l.default.Vector.prototype.mult=function(e){return"number"==typeof e&&isFinite(e)?(this.x*=e,this.y*=e,this.z*=e):console.warn("p5.Vector.prototype.mult:","n is undefined or not a finite number"),this},l.default.Vector.prototype.div=function(e){return"number"==typeof e&&isFinite(e)?0===e?console.warn("p5.Vector.prototype.div:","divide by 0"):(this.x/=e,this.y/=e,this.z/=e):console.warn("p5.Vector.prototype.div:","n is undefined or not a finite number"),this},l.default.Vector.prototype.mag=function(){return Math.sqrt(this.magSq())},l.default.Vector.prototype.magSq=function(){var e=this.x,t=this.y,r=this.z;return e*e+t*t+r*r},l.default.Vector.prototype.dot=function(e,t,r){return e instanceof l.default.Vector?this.dot(e.x,e.y,e.z):this.x*(e||0)+this.y*(t||0)+this.z*(r||0)},l.default.Vector.prototype.cross=function(e){var t=this.y*e.z-this.z*e.y,r=this.z*e.x-this.x*e.z,i=this.x*e.y-this.y*e.x;return this.p5?new l.default.Vector(this.p5,[t,r,i]):new l.default.Vector(t,r,i)},l.default.Vector.prototype.dist=function(e){return e.copy().sub(this).mag()},l.default.Vector.prototype.normalize=function(){var e=this.mag();return 0!==e&&this.mult(1/e),this},l.default.Vector.prototype.limit=function(e){var t=this.magSq();return e*e>>0},n.default.prototype.randomSeed=function(e){this._lcgSetSeed(o,e),this._gaussian_previous=!1},n.default.prototype.random=function(e,t){var r;if(n.default._validateParameters("random",arguments),r=null!=this[o]?this._lcg(o):Math.random(),void 0===e)return r;if(void 0===t)return e instanceof Array?e[Math.floor(r*e.length)]:r*e;if(tf){var P=p,L=l,k=u;p=d+f*(s&&d=t&&(r=r.substring(r.length-t,r.length)),r}},n.default.prototype.unhex=function(e){return e instanceof Array?e.map(n.default.prototype.unhex):parseInt("0x".concat(e),16)};var o=n.default;r.default=o},{"../core/main":49}],90:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i,a=(i=e("../core/main"))&&i.__esModule?i:{default:i};function n(e,t,r){var i=e<0,n=i?e.toString().substring(1):e.toString(),o=n.indexOf("."),a=-1!==o?n.substring(0,o):n,s=-1!==o?n.substring(o+1):"",l=i?"-":"";if(void 0!==r){var u="";(-1!==o||0r&&(s=s.substring(0,r));for(var h=0;hi.length)for(var o=t-(i+=-1===r?".":"").length+1,a=0;a=d.TWO_PI?"".concat("ellipse","|").concat(u,"|"):"".concat("arc","|").concat(a,"|").concat(s,"|").concat(l,"|").concat(u,"|"),!this.geometryInHash(t)){var h=new T.default.Geometry(u,1,function(){if(this.strokeIndices=[],a.toFixed(10)!==s.toFixed(10)){l!==d.PIE&&void 0!==l||(this.vertices.push(new T.default.Vector(.5,.5,0)),this.uvs.push([.5,.5]));for(var e=0;e<=u;e++){var t=(s-a)*(e/u)+a,r=.5+Math.cos(t)/2,i=.5+Math.sin(t)/2;this.vertices.push(new T.default.Vector(r,i,0)),this.uvs.push([r,i]),e>5&31)/31,(y>>10&31)/31):(r=a,i=s,l)}for(var b=1;b<=3;b++){var _=p+12*b,x=new S.default.Vector(u.getFloat32(_,!0),u.getFloat32(8+_,!0),u.getFloat32(4+_,!0));e.vertices.push(x),c&&o.push(r,i,n)}var w=new S.default.Vector(m,g,v);e.vertexNormals.push(w,w,w),e.faces.push([3*d,3*d+1,3*d+2]),e.uvs.push([0,0],[0,0],[0,0])}}(e,t);else{var r=new DataView(t);if(!("TextDecoder"in window))return console.warn("Sorry, ASCII STL loading only works in browsers that support TextDecoder (https://caniuse.com/#feat=textencoder)");var i=new TextDecoder("utf-8").decode(r).split("\n");!function(e,t){for(var r,i,n="",o=[],a=0;aMath.PI?l=Math.PI:l<=0&&(l=.001);var u=Math.sin(l)*a*Math.sin(s),h=Math.cos(l)*a,c=Math.sin(l)*a*Math.cos(s);this.camera(u+this.centerX,h+this.centerY,c+this.centerZ,this.centerX,this.centerY,this.centerZ,0,1,0)},m.default.Camera.prototype._isActive=function(){return this===this._renderer._curCamera},m.default.prototype.setCamera=function(e){this._renderer._curCamera=e,this._renderer.uPMatrix.set(e.projMatrix.mat4[0],e.projMatrix.mat4[1],e.projMatrix.mat4[2],e.projMatrix.mat4[3],e.projMatrix.mat4[4],e.projMatrix.mat4[5],e.projMatrix.mat4[6],e.projMatrix.mat4[7],e.projMatrix.mat4[8],e.projMatrix.mat4[9],e.projMatrix.mat4[10],e.projMatrix.mat4[11],e.projMatrix.mat4[12],e.projMatrix.mat4[13],e.projMatrix.mat4[14],e.projMatrix.mat4[15])};var n=m.default.Camera;r.default=n},{"../core/main":49}],98:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i,h=(i=e("../core/main"))&&i.__esModule?i:{default:i};h.default.Geometry=function(e,t,r){return this.vertices=[],this.lineVertices=[],this.lineNormals=[],this.vertexNormals=[],this.faces=[],this.uvs=[],this.edges=[],this.vertexColors=[],this.detailX=void 0!==e?e:1,this.detailY=void 0!==t?t:1,this.dirtyFlags={},r instanceof Function&&r.call(this),this},h.default.Geometry.prototype.reset=function(){this.lineVertices.length=0,this.lineNormals.length=0,this.vertices.length=0,this.edges.length=0,this.vertexColors.length=0,this.vertexNormals.length=0,this.uvs.length=0,this.dirtyFlags={}},h.default.Geometry.prototype.computeFaces=function(){this.faces.length=0;for(var e,t,r,i,n=this.detailX+1,o=0;othis.vertices.length-1-this.detailX;i--)e.add(this.vertexNormals[i]);e=h.default.Vector.div(e,this.detailX);for(var n=this.vertices.length-1;n>this.vertices.length-1-this.detailX;n--)this.vertexNormals[n]=e;return this},h.default.Geometry.prototype._makeTriangleEdges=function(){if(this.edges.length=0,Array.isArray(this.strokeIndices))for(var e=0,t=this.strokeIndices.length;e vTexCoord.y;\n bool y1 = p1.y > vTexCoord.y;\n bool y2 = p2.y > vTexCoord.y;\n\n // could web be under the curve (after t1)?\n if (y1 ? !y2 : y0) {\n // add the coverage for t1\n coverage.x += saturate(C1.x + 0.5);\n // calculate the anti-aliasing for t1\n weight.x = min(weight.x, abs(C1.x));\n }\n\n // are we outside the curve (after t2)?\n if (y1 ? !y0 : y2) {\n // subtract the coverage for t2\n coverage.x -= saturate(C2.x + 0.5);\n // calculate the anti-aliasing for t2\n weight.x = min(weight.x, abs(C2.x));\n }\n}\n\n// this is essentially the same as coverageX, but with the axes swapped\nvoid coverageY(vec2 p0, vec2 p1, vec2 p2) {\n\n vec2 C1, C2;\n calulateCrossings(p0, p1, p2, C1, C2);\n\n bool x0 = p0.x > vTexCoord.x;\n bool x1 = p1.x > vTexCoord.x;\n bool x2 = p2.x > vTexCoord.x;\n\n if (x1 ? !x2 : x0) {\n coverage.y -= saturate(C1.y + 0.5);\n weight.y = min(weight.y, abs(C1.y));\n }\n\n if (x1 ? !x0 : x2) {\n coverage.y += saturate(C2.y + 0.5);\n weight.y = min(weight.y, abs(C2.y));\n }\n}\n\nvoid main() {\n\n // calculate the pixel scale based on screen-coordinates\n pixelScale = hardness / fwidth(vTexCoord);\n\n // which grid cell is this pixel in?\n ivec2 gridCoord = ifloor(vTexCoord * vec2(uGridSize));\n\n // intersect curves in this row\n {\n // the index into the row info bitmap\n int rowIndex = gridCoord.y + uGridOffset.y;\n // fetch the info texel\n vec4 rowInfo = getTexel(uSamplerRows, rowIndex, uGridImageSize);\n // unpack the rowInfo\n int rowStrokeIndex = getInt16(rowInfo.xy);\n int rowStrokeCount = getInt16(rowInfo.zw);\n\n for (int iRowStroke = INT(0); iRowStroke < N; iRowStroke++) {\n if (iRowStroke >= rowStrokeCount)\n break;\n\n // each stroke is made up of 3 points: the start and control point\n // and the start of the next curve.\n // fetch the indices of this pair of strokes:\n vec4 strokeIndices = getTexel(uSamplerRowStrokes, rowStrokeIndex++, uCellsImageSize);\n\n // unpack the stroke index\n int strokePos = getInt16(strokeIndices.xy);\n\n // fetch the two strokes\n vec4 stroke0 = getTexel(uSamplerStrokes, strokePos + INT(0), uStrokeImageSize);\n vec4 stroke1 = getTexel(uSamplerStrokes, strokePos + INT(1), uStrokeImageSize);\n\n // calculate the coverage\n coverageX(stroke0.xy, stroke0.zw, stroke1.xy);\n }\n }\n\n // intersect curves in this column\n {\n int colIndex = gridCoord.x + uGridOffset.x;\n vec4 colInfo = getTexel(uSamplerCols, colIndex, uGridImageSize);\n int colStrokeIndex = getInt16(colInfo.xy);\n int colStrokeCount = getInt16(colInfo.zw);\n \n for (int iColStroke = INT(0); iColStroke < N; iColStroke++) {\n if (iColStroke >= colStrokeCount)\n break;\n\n vec4 strokeIndices = getTexel(uSamplerColStrokes, colStrokeIndex++, uCellsImageSize);\n\n int strokePos = getInt16(strokeIndices.xy);\n vec4 stroke0 = getTexel(uSamplerStrokes, strokePos + INT(0), uStrokeImageSize);\n vec4 stroke1 = getTexel(uSamplerStrokes, strokePos + INT(1), uStrokeImageSize);\n coverageY(stroke0.xy, stroke0.zw, stroke1.xy);\n }\n }\n\n weight = saturate(1.0 - weight * 2.0);\n float distance = max(weight.x + weight.y, minDistance); // manhattan approx.\n float antialias = abs(dot(coverage, weight) / distance);\n float cover = min(abs(coverage.x), abs(coverage.y));\n gl_FragColor = uMaterialColor;\n gl_FragColor.a *= saturate(max(antialias, cover));\n}",lineVert:"/*\n Part of the Processing project - http://processing.org\n Copyright (c) 2012-15 The Processing Foundation\n Copyright (c) 2004-12 Ben Fry and Casey Reas\n Copyright (c) 2001-04 Massachusetts Institute of Technology\n This library is free software; you can redistribute it and/or\n modify it under the terms of the GNU Lesser General Public\n License as published by the Free Software Foundation, version 2.1.\n This library is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n Lesser General Public License for more details.\n You should have received a copy of the GNU Lesser General\n Public License along with this library; if not, write to the\n Free Software Foundation, Inc., 59 Temple Place, Suite 330,\n Boston, MA 02111-1307 USA\n*/\n\n#define PROCESSING_LINE_SHADER\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform float uStrokeWeight;\n\nuniform vec4 uViewport;\nuniform int uPerspective;\n\nattribute vec4 aPosition;\nattribute vec4 aDirection;\n \nvoid main() {\n // using a scale <1 moves the lines towards the camera\n // in order to prevent popping effects due to half of\n // the line disappearing behind the geometry faces.\n vec3 scale = vec3(0.9995);\n\n vec4 posp = uModelViewMatrix * aPosition;\n vec4 posq = uModelViewMatrix * (aPosition + vec4(aDirection.xyz, 0));\n\n // Moving vertices slightly toward the camera\n // to avoid depth-fighting with the fill triangles.\n // Discussed here:\n // http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Number=252848 \n posp.xyz = posp.xyz * scale;\n posq.xyz = posq.xyz * scale;\n\n vec4 p = uProjectionMatrix * posp;\n vec4 q = uProjectionMatrix * posq;\n\n // formula to convert from clip space (range -1..1) to screen space (range 0..[width or height])\n // screen_p = (p.xy/p.w + <1,1>) * 0.5 * uViewport.zw\n\n // prevent division by W by transforming the tangent formula (div by 0 causes\n // the line to disappear, see https://github.com/processing/processing/issues/5183)\n // t = screen_q - screen_p\n //\n // tangent is normalized and we don't care which aDirection it points to (+-)\n // t = +- normalize( screen_q - screen_p )\n // t = +- normalize( (q.xy/q.w+<1,1>)*0.5*uViewport.zw - (p.xy/p.w+<1,1>)*0.5*uViewport.zw )\n //\n // extract common factor, <1,1> - <1,1> cancels out\n // t = +- normalize( (q.xy/q.w - p.xy/p.w) * 0.5 * uViewport.zw )\n //\n // convert to common divisor\n // t = +- normalize( ((q.xy*p.w - p.xy*q.w) / (p.w*q.w)) * 0.5 * uViewport.zw )\n //\n // remove the common scalar divisor/factor, not needed due to normalize and +-\n // (keep uViewport - can't remove because it has different components for x and y\n // and corrects for aspect ratio, see https://github.com/processing/processing/issues/5181)\n // t = +- normalize( (q.xy*p.w - p.xy*q.w) * uViewport.zw )\n\n vec2 tangent = normalize((q.xy*p.w - p.xy*q.w) * uViewport.zw);\n\n // flip tangent to normal (it's already normalized)\n vec2 normal = vec2(-tangent.y, tangent.x);\n\n float thickness = aDirection.w * uStrokeWeight;\n vec2 offset = normal * thickness / 2.0;\n\n vec2 curPerspScale;\n\n if(uPerspective == 1) {\n // Perspective ---\n // convert from world to clip by multiplying with projection scaling factor\n // to get the right thickness (see https://github.com/processing/processing/issues/5182)\n // invert Y, projections in Processing invert Y\n curPerspScale = (uProjectionMatrix * vec4(1, -1, 0, 0)).xy;\n } else {\n // No Perspective ---\n // multiply by W (to cancel out division by W later in the pipeline) and\n // convert from screen to clip (derived from clip to screen above)\n curPerspScale = p.w / (0.5 * uViewport.zw);\n }\n\n gl_Position.xy = p.xy + offset.xy * curPerspScale;\n gl_Position.zw = p.zw;\n}\n",lineFrag:"precision mediump float;\nprecision mediump int;\n\nuniform vec4 uMaterialColor;\n\nvoid main() {\n gl_FragColor = uMaterialColor;\n}",pointVert:"attribute vec3 aPosition;\nuniform float uPointSize;\nvarying float vStrokeWeight;\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nvoid main() {\n\tvec4 positionVec4 = vec4(aPosition, 1.0);\n\tgl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n\tgl_PointSize = uPointSize;\n\tvStrokeWeight = uPointSize;\n}",pointFrag:"precision mediump float;\nprecision mediump int;\nuniform vec4 uMaterialColor;\nvarying float vStrokeWeight;\n\nvoid main(){\n\tfloat mask = 0.0;\n\n\t// make a circular mask using the gl_PointCoord (goes from 0 - 1 on a point)\n // might be able to get a nicer edge on big strokeweights with smoothstep but slightly less performant\n\n\tmask = step(0.98, length(gl_PointCoord * 2.0 - 1.0));\n\n\t// if strokeWeight is 1 or less lets just draw a square\n\t// this prevents weird artifacting from carving circles when our points are really small\n\t// if strokeWeight is larger than 1, we just use it as is\n\n\tmask = mix(0.0, mask, clamp(floor(vStrokeWeight - 0.5),0.0,1.0));\n\n\t// throw away the borders of the mask\n // otherwise we get weird alpha blending issues\n\n\tif(mask > 0.98){\n discard;\n \t}\n\n \tgl_FragColor = vec4(uMaterialColor.rgb * (1.0 - mask), uMaterialColor.a) ;\n}"};u.default.RendererGL=function(e,t,r,i){return u.default.Renderer.call(this,e,t,r),this._setAttributeDefaults(t),this._initContext(),this.isP3D=!0,this.GL=this.drawingContext,this._isErasing=!1,this._enableLighting=!1,this.ambientLightColors=[],this.specularColors=[1,1,1],this.directionalLightDirections=[],this.directionalLightDiffuseColors=[],this.directionalLightSpecularColors=[],this.pointLightPositions=[],this.pointLightDiffuseColors=[],this.pointLightSpecularColors=[],this.spotLightPositions=[],this.spotLightDirections=[],this.spotLightDiffuseColors=[],this.spotLightSpecularColors=[],this.spotLightAngle=[],this.spotLightConc=[],this.drawMode=o.FILL,this.curFillColor=this._cachedFillStyle=[1,1,1,1],this.curStrokeColor=this._cachedStrokeStyle=[0,0,0,1],this.curBlendMode=o.BLEND,this._cachedBlendMode=void 0,this.blendExt=this.GL.getExtension("EXT_blend_minmax"),this._isBlending=!1,this._useSpecularMaterial=!1,this._useEmissiveMaterial=!1,this._useNormalMaterial=!1,this._useShininess=1,this._tint=[255,255,255,255],this.constantAttenuation=1,this.linearAttenuation=0,this.quadraticAttenuation=0,this.uMVMatrix=new u.default.Matrix,this.uPMatrix=new u.default.Matrix,this.uNMatrix=new u.default.Matrix("mat3"),this._curCamera=new u.default.Camera(this),this._curCamera._computeCameraDefaultSettings(),this._curCamera._setDefaultCamera(),this._defaultLightShader=void 0,this._defaultImmediateModeShader=void 0,this._defaultNormalShader=void 0,this._defaultColorShader=void 0,this._defaultPointShader=void 0,this.userFillShader=void 0,this.userStrokeShader=void 0,this.userPointShader=void 0,this.retainedMode={geometry:{},buffers:{stroke:[new u.default.RenderBuffer(3,"lineVertices","lineVertexBuffer","aPosition",this,this._flatten),new u.default.RenderBuffer(4,"lineNormals","lineNormalBuffer","aDirection",this,this._flatten)],fill:[new u.default.RenderBuffer(3,"vertices","vertexBuffer","aPosition",this,this._vToNArray),new u.default.RenderBuffer(3,"vertexNormals","normalBuffer","aNormal",this,this._vToNArray),new u.default.RenderBuffer(4,"vertexColors","colorBuffer","aMaterialColor",this),new u.default.RenderBuffer(3,"vertexAmbients","ambientBuffer","aAmbientColor",this),new u.default.RenderBuffer(2,"uvs","uvBuffer","aTexCoord",this,this._flatten)],text:[new u.default.RenderBuffer(3,"vertices","vertexBuffer","aPosition",this,this._vToNArray),new u.default.RenderBuffer(2,"uvs","uvBuffer","aTexCoord",this,this._flatten)]}},this.immediateMode={geometry:new u.default.Geometry,shapeMode:o.TRIANGLE_FAN,_bezierVertex:[],_quadraticVertex:[],_curveVertex:[],buffers:{fill:[new u.default.RenderBuffer(3,"vertices","vertexBuffer","aPosition",this,this._vToNArray),new u.default.RenderBuffer(3,"vertexNormals","normalBuffer","aNormal",this,this._vToNArray),new u.default.RenderBuffer(4,"vertexColors","colorBuffer","aVertexColor",this),new u.default.RenderBuffer(3,"vertexAmbients","ambientBuffer","aAmbientColor",this),new u.default.RenderBuffer(2,"uvs","uvBuffer","aTexCoord",this,this._flatten)],stroke:[new u.default.RenderBuffer(3,"lineVertices","lineVertexBuffer","aPosition",this,this._flatten),new u.default.RenderBuffer(4,"lineNormals","lineNormalBuffer","aDirection",this,this._flatten)],point:this.GL.createBuffer()}},this.pointSize=5,this.curStrokeWeight=1,this.textures=[],this.textureMode=o.IMAGE,this.textureWrapX=o.CLAMP,this.textureWrapY=o.CLAMP,this._tex=null,this._curveTightness=6,this._lookUpTableBezier=[],this._lookUpTableQuadratic=[],this._lutBezierDetail=0,this._lutQuadraticDetail=0,this._tessy=this._initTessy(),this.fontInfos={},this._curShader=void 0,this},u.default.RendererGL.prototype=Object.create(u.default.Renderer.prototype),u.default.RendererGL.prototype._setAttributeDefaults=function(e){var t={alpha:!0,depth:!0,stencil:!0,antialias:navigator.userAgent.toLowerCase().includes("safari"),premultipliedAlpha:!1,preserveDrawingBuffer:!0,perPixelLighting:!0};null===e._glAttributes?e._glAttributes=t:e._glAttributes=Object.assign(t,e._glAttributes)},u.default.RendererGL.prototype._initContext=function(){try{if(this.drawingContext=this.canvas.getContext("webgl",this._pInst._glAttributes)||this.canvas.getContext("experimental-webgl",this._pInst._glAttributes),null===this.drawingContext)throw new Error("Error creating webgl context");var e=this.drawingContext;e.enable(e.DEPTH_TEST),e.depthFunc(e.LEQUAL),e.viewport(0,0,e.drawingBufferWidth,e.drawingBufferHeight),this._viewport=this.drawingContext.getParameter(this.drawingContext.VIEWPORT)}catch(e){throw e}},u.default.RendererGL.prototype._resetContext=function(e,t){var r=this.width,i=this.height,n=this.canvas.id,o=this._pInst instanceof u.default.Graphics;if(o){var a=this._pInst;a.canvas.parentNode.removeChild(a.canvas),a.canvas=document.createElement("canvas"),(a._pInst._userNode||document.body).appendChild(a.canvas),u.default.Element.call(a,a.canvas,a._pInst),a.width=r,a.height=i}else{var s=this.canvas;s&&s.parentNode.removeChild(s),(s=document.createElement("canvas")).id=n,this._pInst._userNode?this._pInst._userNode.appendChild(s):document.body.appendChild(s),this._pInst.canvas=s}var l=new u.default.RendererGL(this._pInst.canvas,this._pInst,!o);this._pInst._setProperty("_renderer",l),l.resize(r,i),l._applyDefaults(),o||this._pInst._elements.push(l),"function"==typeof t&&setTimeout(function(){t.apply(window._renderer,e)},0)},u.default.prototype.setAttributes=function(e,t){if(void 0!==this._glAttributes){var r=!0;if(void 0!==t?(null===this._glAttributes&&(this._glAttributes={}),this._glAttributes[e]!==t&&(this._glAttributes[e]=t,r=!1)):e instanceof Object&&this._glAttributes!==e&&(this._glAttributes=e,r=!1),this._renderer.isP3D&&!r){if(!this._setupDone)for(var i in this._renderer.retainedMode.geometry)if(this._renderer.retainedMode.geometry.hasOwnProperty(i))return void console.error("Sorry, Could not set the attributes, you need to call setAttributes() before calling the other drawing methods in setup()");this.push(),this._renderer._resetContext(),this.pop(),this._renderer._curCamera&&(this._renderer._curCamera._renderer=this._renderer)}}else console.log("You are trying to use setAttributes on a p5.Graphics object that does not use a WEBGL renderer.")},u.default.RendererGL.prototype._update=function(){this.uMVMatrix.set(this._curCamera.cameraMatrix.mat4[0],this._curCamera.cameraMatrix.mat4[1],this._curCamera.cameraMatrix.mat4[2],this._curCamera.cameraMatrix.mat4[3],this._curCamera.cameraMatrix.mat4[4],this._curCamera.cameraMatrix.mat4[5],this._curCamera.cameraMatrix.mat4[6],this._curCamera.cameraMatrix.mat4[7],this._curCamera.cameraMatrix.mat4[8],this._curCamera.cameraMatrix.mat4[9],this._curCamera.cameraMatrix.mat4[10],this._curCamera.cameraMatrix.mat4[11],this._curCamera.cameraMatrix.mat4[12],this._curCamera.cameraMatrix.mat4[13],this._curCamera.cameraMatrix.mat4[14],this._curCamera.cameraMatrix.mat4[15]),this.ambientLightColors.length=0,this.specularColors=[1,1,1],this.directionalLightDirections.length=0,this.directionalLightDiffuseColors.length=0,this.directionalLightSpecularColors.length=0,this.pointLightPositions.length=0,this.pointLightDiffuseColors.length=0,this.pointLightSpecularColors.length=0,this.spotLightPositions.length=0,this.spotLightDirections.length=0,this.spotLightDiffuseColors.length=0,this.spotLightSpecularColors.length=0,this.spotLightAngle.length=0,this.spotLightConc.length=0,this._enableLighting=!1,this._tint=[255,255,255,255],this.GL.clear(this.GL.DEPTH_BUFFER_BIT)},u.default.RendererGL.prototype.background=function(){var e,t=(e=this._pInst).color.apply(e,arguments),r=t.levels[0]/255,i=t.levels[1]/255,n=t.levels[2]/255,o=t.levels[3]/255;this.GL.clearColor(r,i,n,o),this.GL.clear(this.GL.COLOR_BUFFER_BIT)},u.default.RendererGL.prototype.fill=function(e,t,r,i){var n=u.default.prototype.color.apply(this._pInst,arguments);this.curFillColor=n._array,this.drawMode=o.FILL,this._useNormalMaterial=!1,this._tex=null},u.default.RendererGL.prototype.stroke=function(e,t,r,i){arguments[3]=255;var n=u.default.prototype.color.apply(this._pInst,arguments);this.curStrokeColor=n._array},u.default.RendererGL.prototype.strokeCap=function(e){console.error("Sorry, strokeCap() is not yet implemented in WEBGL mode")},u.default.RendererGL.prototype.strokeJoin=function(e){console.error("Sorry, strokeJoin() is not yet implemented in WEBGL mode")},u.default.RendererGL.prototype.filter=function(e){console.error("filter() does not work in WEBGL mode")},u.default.RendererGL.prototype.blendMode=function(e){e===o.DARKEST||e===o.LIGHTEST||e===o.ADD||e===o.BLEND||e===o.SUBTRACT||e===o.SCREEN||e===o.EXCLUSION||e===o.REPLACE||e===o.MULTIPLY||e===o.REMOVE?this.curBlendMode=e:e!==o.BURN&&e!==o.OVERLAY&&e!==o.HARD_LIGHT&&e!==o.SOFT_LIGHT&&e!==o.DODGE||console.warn("BURN, OVERLAY, HARD_LIGHT, SOFT_LIGHT, and DODGE only work for blendMode in 2D mode.")},u.default.RendererGL.prototype.erase=function(e,t){this._isErasing||(this._cachedBlendMode=this.curBlendMode,this.blendMode(o.REMOVE),this._cachedFillStyle=this.curFillColor.slice(),this.curFillColor=[1,1,1,e/255],this._cachedStrokeStyle=this.curStrokeColor.slice(),this.curStrokeColor=[1,1,1,t/255],this._isErasing=!0)},u.default.RendererGL.prototype.noErase=function(){this._isErasing&&(this.curFillColor=this._cachedFillStyle.slice(),this.curStrokeColor=this._cachedStrokeStyle.slice(),this.blendMode(this._cachedBlendMode),this._isErasing=!1)},u.default.RendererGL.prototype.strokeWeight=function(e){this.curStrokeWeight!==e&&(this.pointSize=e,this.curStrokeWeight=e)},u.default.RendererGL.prototype._getPixel=function(e,t){var r;return r=new Uint8Array(4),this.drawingContext.readPixels(e,t,1,1,this.drawingContext.RGBA,this.drawingContext.UNSIGNED_BYTE,r),[r[0],r[1],r[2],r[3]]},u.default.RendererGL.prototype.loadPixels=function(){var e=this._pixelsState;if(!0===this._pInst._glAttributes.preserveDrawingBuffer){var t=e.pixels,r=this.GL.drawingBufferWidth*this.GL.drawingBufferHeight*4;t instanceof Uint8Array&&t.length===r||(t=new Uint8Array(r),this._pixelsState._setProperty("pixels",t));var i=this._pInst._pixelDensity;this.GL.readPixels(0,0,this.width*i,this.height*i,this.GL.RGBA,this.GL.UNSIGNED_BYTE,t)}else console.log("loadPixels only works in WebGL when preserveDrawingBuffer is true.")},u.default.RendererGL.prototype.geometryInHash=function(e){return void 0!==this.retainedMode.geometry[e]},u.default.RendererGL.prototype.resize=function(e,t){u.default.Renderer.prototype.resize.call(this,e,t),this.GL.viewport(0,0,this.GL.drawingBufferWidth,this.GL.drawingBufferHeight),this._viewport=this.GL.getParameter(this.GL.VIEWPORT),this._curCamera._resize();var r=this._pixelsState;void 0!==r.pixels&&r._setProperty("pixels",new Uint8Array(this.GL.drawingBufferWidth*this.GL.drawingBufferHeight*4))},u.default.RendererGL.prototype.clear=function(){var e=(arguments.length<=0?void 0:arguments[0])||0,t=(arguments.length<=1?void 0:arguments[1])||0,r=(arguments.length<=2?void 0:arguments[2])||0,i=(arguments.length<=3?void 0:arguments[3])||0;this.GL.clearColor(e,t,r,i),this.GL.clear(this.GL.COLOR_BUFFER_BIT|this.GL.DEPTH_BUFFER_BIT)},u.default.RendererGL.prototype.applyMatrix=function(e,t,r,i,n,o){16===arguments.length?u.default.Matrix.prototype.apply.apply(this.uMVMatrix,arguments):this.uMVMatrix.apply([e,t,0,0,r,i,0,0,0,0,1,0,n,o,0,1])},u.default.RendererGL.prototype.translate=function(e,t,r){return e instanceof u.default.Vector&&(r=e.z,t=e.y,e=e.x),this.uMVMatrix.translate([e,t,r]),this},u.default.RendererGL.prototype.scale=function(e,t,r){return this.uMVMatrix.scale(e,t,r),this},u.default.RendererGL.prototype.rotate=function(e,t){return void 0===t?this.rotateZ(e):(u.default.Matrix.prototype.rotate.apply(this.uMVMatrix,arguments),this)},u.default.RendererGL.prototype.rotateX=function(e){return this.rotate(e,1,0,0),this},u.default.RendererGL.prototype.rotateY=function(e){return this.rotate(e,0,1,0),this},u.default.RendererGL.prototype.rotateZ=function(e){return this.rotate(e,0,0,1),this},u.default.RendererGL.prototype.push=function(){var e=u.default.Renderer.prototype.push.apply(this),t=e.properties;return t.uMVMatrix=this.uMVMatrix.copy(),t.uPMatrix=this.uPMatrix.copy(),t._curCamera=this._curCamera,this._curCamera=this._curCamera.copy(),t.ambientLightColors=this.ambientLightColors.slice(),t.specularColors=this.specularColors.slice(),t.directionalLightDirections=this.directionalLightDirections.slice(),t.directionalLightDiffuseColors=this.directionalLightDiffuseColors.slice(),t.directionalLightSpecularColors=this.directionalLightSpecularColors.slice(),t.pointLightPositions=this.pointLightPositions.slice(),t.pointLightDiffuseColors=this.pointLightDiffuseColors.slice(),t.pointLightSpecularColors=this.pointLightSpecularColors.slice(),t.spotLightPositions=this.spotLightPositions.slice(),t.spotLightDirections=this.spotLightDirections.slice(),t.spotLightDiffuseColors=this.spotLightDiffuseColors.slice(),t.spotLightSpecularColors=this.spotLightSpecularColors.slice(),t.spotLightAngle=this.spotLightAngle.slice(),t.spotLightConc=this.spotLightConc.slice(),t.userFillShader=this.userFillShader,t.userStrokeShader=this.userStrokeShader,t.userPointShader=this.userPointShader,t.pointSize=this.pointSize,t.curStrokeWeight=this.curStrokeWeight,t.curStrokeColor=this.curStrokeColor,t.curFillColor=this.curFillColor,t._useSpecularMaterial=this._useSpecularMaterial,t._useEmissiveMaterial=this._useEmissiveMaterial,t._useShininess=this._useShininess,t.constantAttenuation=this.constantAttenuation,t.linearAttenuation=this.linearAttenuation,t.quadraticAttenuation=this.quadraticAttenuation,t._enableLighting=this._enableLighting,t._useNormalMaterial=this._useNormalMaterial,t._tex=this._tex,t.drawMode=this.drawMode,e},u.default.RendererGL.prototype.resetMatrix=function(){return this.uMVMatrix=u.default.Matrix.identity(this._pInst),this},u.default.RendererGL.prototype._getImmediateStrokeShader=function(){var e=this.userStrokeShader;return e&&e.isStrokeShader()?e:this._getLineShader()},u.default.RendererGL.prototype._getRetainedStrokeShader=u.default.RendererGL.prototype._getImmediateStrokeShader,u.default.RendererGL.prototype._getImmediateFillShader=function(){var e=this.userFillShader;if(this._useNormalMaterial&&(!e||!e.isNormalShader()))return this._getNormalShader();if(this._enableLighting){if(!e||!e.isLightShader())return this._getLightShader()}else if(this._tex){if(!e||!e.isTextureShader())return this._getLightShader()}else if(!e)return this._getImmediateModeShader();return e},u.default.RendererGL.prototype._getRetainedFillShader=function(){if(this._useNormalMaterial)return this._getNormalShader();var e=this.userFillShader;if(this._enableLighting){if(!e||!e.isLightShader())return this._getLightShader()}else if(this._tex){if(!e||!e.isTextureShader())return this._getLightShader()}else if(!e)return this._getColorShader();return e},u.default.RendererGL.prototype._getImmediatePointShader=function(){var e=this.userPointShader;return e&&e.isPointShader()?e:this._getPointShader()},u.default.RendererGL.prototype._getRetainedLineShader=u.default.RendererGL.prototype._getImmediateLineShader,u.default.RendererGL.prototype._getLightShader=function(){return this._defaultLightShader||(this._pInst._glAttributes.perPixelLighting?this._defaultLightShader=new u.default.Shader(this,c.phongVert,c.phongFrag):this._defaultLightShader=new u.default.Shader(this,c.lightVert,c.lightTextureFrag)),this._defaultLightShader},u.default.RendererGL.prototype._getImmediateModeShader=function(){return this._defaultImmediateModeShader||(this._defaultImmediateModeShader=new u.default.Shader(this,c.immediateVert,c.vertexColorFrag)),this._defaultImmediateModeShader},u.default.RendererGL.prototype._getNormalShader=function(){return this._defaultNormalShader||(this._defaultNormalShader=new u.default.Shader(this,c.normalVert,c.normalFrag)),this._defaultNormalShader},u.default.RendererGL.prototype._getColorShader=function(){return this._defaultColorShader||(this._defaultColorShader=new u.default.Shader(this,c.normalVert,c.basicFrag)),this._defaultColorShader},u.default.RendererGL.prototype._getPointShader=function(){return this._defaultPointShader||(this._defaultPointShader=new u.default.Shader(this,c.pointVert,c.pointFrag)),this._defaultPointShader},u.default.RendererGL.prototype._getLineShader=function(){return this._defaultLineShader||(this._defaultLineShader=new u.default.Shader(this,c.lineVert,c.lineFrag)),this._defaultLineShader},u.default.RendererGL.prototype._getFontShader=function(){return this._defaultFontShader||(this.GL.getExtension("OES_standard_derivatives"),this._defaultFontShader=new u.default.Shader(this,c.fontVert,c.fontFrag)),this._defaultFontShader},u.default.RendererGL.prototype._getEmptyTexture=function(){if(!this._emptyTexture){var e=new u.default.Image(1,1);e.set(0,0,255),this._emptyTexture=new u.default.Texture(this,e)}return this._emptyTexture},u.default.RendererGL.prototype.getTexture=function(e){var t=this.textures,r=!0,i=!1,n=void 0;try{for(var o,a=t[Symbol.iterator]();!(r=(o=a.next()).done);r=!0){var s=o.value;if(s.src===e)return s}}catch(e){i=!0,n=e}finally{try{r||null==a.return||a.return()}finally{if(i)throw n}}var l=new u.default.Texture(this,e);return t.push(l),l},u.default.RendererGL.prototype._setStrokeUniforms=function(e){e.bindShader(),e.setUniform("uMaterialColor",this.curStrokeColor),e.setUniform("uStrokeWeight",this.curStrokeWeight)},u.default.RendererGL.prototype._setFillUniforms=function(e){e.bindShader(),e.setUniform("uMaterialColor",this.curFillColor),e.setUniform("isTexture",!!this._tex),this._tex&&e.setUniform("uSampler",this._tex),e.setUniform("uTint",this._tint),e.setUniform("uSpecular",this._useSpecularMaterial),e.setUniform("uEmissive",this._useEmissiveMaterial),e.setUniform("uShininess",this._useShininess),e.setUniform("uUseLighting",this._enableLighting);var t=this.pointLightDiffuseColors.length/3;e.setUniform("uPointLightCount",t),e.setUniform("uPointLightLocation",this.pointLightPositions),e.setUniform("uPointLightDiffuseColors",this.pointLightDiffuseColors),e.setUniform("uPointLightSpecularColors",this.pointLightSpecularColors);var r=this.directionalLightDiffuseColors.length/3;e.setUniform("uDirectionalLightCount",r),e.setUniform("uLightingDirection",this.directionalLightDirections),e.setUniform("uDirectionalDiffuseColors",this.directionalLightDiffuseColors),e.setUniform("uDirectionalSpecularColors",this.directionalLightSpecularColors);var i=this.ambientLightColors.length/3;e.setUniform("uAmbientLightCount",i),e.setUniform("uAmbientColor",this.ambientLightColors);var n=this.spotLightDiffuseColors.length/3;e.setUniform("uSpotLightCount",n),e.setUniform("uSpotLightAngle",this.spotLightAngle),e.setUniform("uSpotLightConc",this.spotLightConc),e.setUniform("uSpotLightDiffuseColors",this.spotLightDiffuseColors),e.setUniform("uSpotLightSpecularColors",this.spotLightSpecularColors),e.setUniform("uSpotLightLocation",this.spotLightPositions),e.setUniform("uSpotLightDirection",this.spotLightDirections),e.setUniform("uConstantAttenuation",this.constantAttenuation),e.setUniform("uLinearAttenuation",this.linearAttenuation),e.setUniform("uQuadraticAttenuation",this.quadraticAttenuation),e.bindTextures()},u.default.RendererGL.prototype._setPointUniforms=function(e){e.bindShader(),e.setUniform("uMaterialColor",this.curStrokeColor),e.setUniform("uPointSize",this.pointSize)},u.default.RendererGL.prototype._bindBuffer=function(e,t,r,i,n){if(t=t||this.GL.ARRAY_BUFFER,this.GL.bindBuffer(t,e),void 0!==r){var o=new(i||Float32Array)(r);this.GL.bufferData(t,o,n||this.GL.STATIC_DRAW)}},u.default.RendererGL.prototype._arraysEqual=function(e,t){var r=e.length;if(r!==t.length)return!1;for(var i=0;i>7,127&f,c>>7,127&c);for(var d=0;d>7,127&p,0,0)}}return{cellImageInfo:l,dimOffset:o,dimImageInfo:n}}return(t=this.glyphInfos[e.index]={glyph:e,uGlyphRect:[i.x1,-i.y1,i.x2,-i.y2],strokeImageInfo:U,strokes:d,colInfo:G(m,this.colDimImageInfos,this.colCellImageInfos),rowInfo:G(p,this.rowDimImageInfos,this.rowCellImageInfos)}).uGridOffset=[t.colInfo.dimOffset,t.rowInfo.dimOffset],t}}var z=Math.sqrt(3);j.default.RendererGL.prototype._renderText=function(e,t,r,i,n){if(this._textFont&&"string"!=typeof this._textFont){if(!(n<=i)&&this._doFill){if(!this._isOpenType())return console.log("WEBGL: only Opentype (.otf) and Truetype (.ttf) fonts are supported"),e;e.push();var o=this._doStroke,a=this.drawMode;this._doStroke=!1,this.drawMode=D.TEXTURE;var s=this._textFont.font,l=this._textFont._fontInfo;l=l||(this._textFont._fontInfo=new A(s));var u=this._textFont._handleAlignment(this,t,r,i),h=this._textSize/s.unitsPerEm;this.translate(u.x,u.y,0),this.scale(h,h,1);var c=this.GL,f=!this._defaultFontShader,d=this._getFontShader();d.init(),d.bindShader(),f&&(d.setUniform("uGridImageSize",[64,64]),d.setUniform("uCellsImageSize",[64,64]),d.setUniform("uStrokeImageSize",[64,64]),d.setUniform("uGridSize",[9,9])),this._applyColorBlend(this.curFillColor);var p=this.retainedMode.geometry.glyph;if(!p){var m=this._textGeom=new j.default.Geometry(1,1,function(){for(var e=0;e<=1;e++)for(var t=0;t<=1;t++)this.vertices.push(new j.default.Vector(t,e,0)),this.uvs.push(t,e)});m.computeFaces().computeNormals(),p=this.createBuffers("glyph",m)}var g=!0,v=!1,y=void 0;try{for(var b,_=this.retainedMode.buffers.text[Symbol.iterator]();!(g=(b=_.next()).done);g=!0){b.value._prepareBuffer(p,d)}}catch(e){v=!0,y=e}finally{try{g||null==_.return||_.return()}finally{if(v)throw y}}this._bindBuffer(p.indexBuffer,c.ELEMENT_ARRAY_BUFFER),d.setUniform("uMaterialColor",this.curFillColor);try{var x=0,w=null,S=s.stringToGlyphs(t),M=!0,E=!1,T=void 0;try{for(var C,P=S[Symbol.iterator]();!(M=(C=P.next()).done);M=!0){var L=C.value;w&&(x+=s.getKerningValue(w,L));var k=l.getGlyphInfo(L);if(k.uGlyphRect){var R=k.rowInfo,O=k.colInfo;d.setUniform("uSamplerStrokes",k.strokeImageInfo.imageData),d.setUniform("uSamplerRowStrokes",R.cellImageInfo.imageData),d.setUniform("uSamplerRows",R.dimImageInfo.imageData),d.setUniform("uSamplerColStrokes",O.cellImageInfo.imageData),d.setUniform("uSamplerCols",O.dimImageInfo.imageData),d.setUniform("uGridOffset",k.uGridOffset),d.setUniform("uGlyphRect",k.uGlyphRect),d.setUniform("uGlyphOffset",x),d.bindTextures(),c.drawElements(c.TRIANGLES,6,this.GL.UNSIGNED_SHORT,0)}x+=L.advanceWidth,w=L}}catch(e){E=!0,T=e}finally{try{M||null==P.return||P.return()}finally{if(E)throw T}}}finally{d.unbindShader(),this._doStroke=o,this.drawMode=a,e.pop()}return e}}else console.log("WEBGL: you must load and set a font before drawing text. See `loadFont` and `textFont` for more details.")}},{"../core/constants":42,"../core/main":49,"./p5.RendererGL.Retained":102,"./p5.Shader":104}],107:[function(e,t,r){t.exports={fes:{autoplay:"The media that tried to play (with '{{src}}') wasn't allowed to by this browser, most likely due to the browser's autoplay policy. Check out {{link}} for more information about why.",fileLoadError:{bytes:"It looks like there was a problem loading your file. {{suggestion}}",font:"It looks like there was a problem loading your font. {{suggestion}}",gif:"There was some trouble loading your GIF. Make sure that your GIF is using 87a or 89a encoding.",image:"It looks like there was a problem loading your image. {{suggestion}}",json:"It looks like there was a problem loading your JSON file. {{suggestion}}",large:"If your large file isn't fetched successfully, we recommend splitting the file into smaller segments and fetching those.",strings:"It looks like there was a problem loading your text file. {{suggestion}}",suggestion:"Try checking if the file path ({{filePath}}) is correct, hosting the file online, or running a local server. (More info at {{link}})",table:"It looks like there was a problem loading your table file. {{suggestion}}",xml:"It looks like there was a problem loading your XML file. {{suggestion}}"},misusedTopLevel:"Did you just try to use p5.js's {{symbolName}} {{symbolType}}? If so, you may want to move it into your sketch's setup() function.\n\nFor more details, see: {{link}}",pre:"🌸 p5.js says: {{message}}",welcome:"Welcome! This is your friendly debugger. To turn me off, switch to using p5.min.js."}}},{}],108:[function(e,t,r){t.exports={fes:{autoplay:"Su browser impidío un medio tocar (de '{{src}}'), posiblemente porque las reglas de autoplay. Para aprender más, visite {{link}}.",fileLoadError:{bytes:"",font:"",gif:"",image:"",json:"",large:"",strings:"",suggestion:"",table:"",xml:""},misusedTopLevel:"",pre:"🌸 p5.js dice: {{message}}",welcome:""}}},{}],109:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i=o(e("./en/translation")),n=o(e("./es/translation"));function o(e){return e&&e.__esModule?e:{default:e}}var a={en:{translation:i.default},es:{translation:n.default}};r.default=a},{"./en/translation":107,"./es/translation":108}]},{},[37])(37)}); ================================================ FILE: docs/examples/transcrypt/sketch_007/target/org.transcrypt.__runtime__.js ================================================ // Transcrypt'ed from Python, 2021-11-02 13:06:15 var __name__ = 'org.transcrypt.__runtime__'; export var __envir__ = {}; __envir__.interpreter_name = 'python'; __envir__.transpiler_name = 'transcrypt'; __envir__.executor_name = __envir__.transpiler_name; __envir__.transpiler_version = '3.9.0'; export function __nest__ (headObject, tailNames, value) { var current = headObject; if (tailNames != '') { var tailChain = tailNames.split ('.'); var firstNewIndex = tailChain.length; for (var index = 0; index < tailChain.length; index++) { if (!current.hasOwnProperty (tailChain [index])) { firstNewIndex = index; break; } current = current [tailChain [index]]; } for (var index = firstNewIndex; index < tailChain.length; index++) { current [tailChain [index]] = {}; current = current [tailChain [index]]; } } for (let attrib of Object.getOwnPropertyNames (value)) { Object.defineProperty (current, attrib, { get () {return value [attrib];}, enumerable: true, configurable: true }); } }; export function __init__ (module) { if (!module.__inited__) { module.__all__.__init__ (module.__all__); module.__inited__ = true; } return module.__all__; }; export function __get__ (aThis, func, quotedFuncName) { if (aThis) { if (aThis.hasOwnProperty ('__class__') || typeof aThis == 'string' || aThis instanceof String) { if (quotedFuncName) { Object.defineProperty (aThis, quotedFuncName, { value: function () { var args = [] .slice.apply (arguments); return func.apply (null, [aThis] .concat (args)); }, writable: true, enumerable: true, configurable: true }); } return function () { var args = [] .slice.apply (arguments); return func.apply (null, [aThis.__proxy__ ? aThis.__proxy__ : aThis] .concat (args)); }; } else { return func; } } else { return func; } }; export function __getcm__ (aThis, func, quotedFuncName) { if (aThis.hasOwnProperty ('__class__')) { return function () { var args = [] .slice.apply (arguments); return func.apply (null, [aThis.__class__] .concat (args)); }; } else { return function () { var args = [] .slice.apply (arguments); return func.apply (null, [aThis] .concat (args)); }; } }; export function __getsm__ (aThis, func, quotedFuncName) { return func; }; export var py_metatype = { __name__: 'type', __bases__: [], __new__: function (meta, name, bases, attribs) { var cls = function () { var args = [] .slice.apply (arguments); return cls.__new__ (args); }; for (var index = bases.length - 1; index >= 0; index--) { var base = bases [index]; for (var attrib in base) { var descrip = Object.getOwnPropertyDescriptor (base, attrib); if (descrip == null) { continue; } Object.defineProperty (cls, attrib, descrip); } for (let symbol of Object.getOwnPropertySymbols (base)) { let descrip = Object.getOwnPropertyDescriptor (base, symbol); Object.defineProperty (cls, symbol, descrip); } } cls.__metaclass__ = meta; cls.__name__ = name.startsWith ('py_') ? name.slice (3) : name; cls.__bases__ = bases; for (var attrib in attribs) { var descrip = Object.getOwnPropertyDescriptor (attribs, attrib); Object.defineProperty (cls, attrib, descrip); } for (let symbol of Object.getOwnPropertySymbols (attribs)) { let descrip = Object.getOwnPropertyDescriptor (attribs, symbol); Object.defineProperty (cls, symbol, descrip); } return cls; } }; py_metatype.__metaclass__ = py_metatype; export var object = { __init__: function (self) {}, __metaclass__: py_metatype, __name__: 'object', __bases__: [], __new__: function (args) { var instance = Object.create (this, {__class__: {value: this, enumerable: true}}); if ('__getattr__' in this || '__setattr__' in this) { instance.__proxy__ = new Proxy (instance, { get: function (target, name) { let result = target [name]; if (result == undefined) { return target.__getattr__ (name); } else { return result; } }, set: function (target, name, value) { try { target.__setattr__ (name, value); } catch (exception) { target [name] = value; } return true; } }) instance = instance.__proxy__ } this.__init__.apply (null, [instance] .concat (args)); return instance; } }; export function __class__ (name, bases, attribs, meta) { if (meta === undefined) { meta = bases [0] .__metaclass__; } return meta.__new__ (meta, name, bases, attribs); }; export function __pragma__ () {}; export function __call__ (/* , , * */) { var args = [] .slice.apply (arguments); if (typeof args [0] == 'object' && '__call__' in args [0]) { return args [0] .__call__ .apply (args [1], args.slice (2)); } else { return args [0] .apply (args [1], args.slice (2)); } }; __envir__.executor_name = __envir__.transpiler_name; var __main__ = {__file__: ''}; var __except__ = null; export function __kwargtrans__ (anObject) { anObject.__kwargtrans__ = null; anObject.constructor = Object; return anObject; } export function __super__ (aClass, methodName) { for (let base of aClass.__bases__) { if (methodName in base) { return base [methodName]; } } throw new Exception ('Superclass method not found'); } export function property (getter, setter) { if (!setter) { setter = function () {}; } return {get: function () {return getter (this)}, set: function (value) {setter (this, value)}, enumerable: true}; } export function __setproperty__ (anObject, name, descriptor) { if (!anObject.hasOwnProperty (name)) { Object.defineProperty (anObject, name, descriptor); } } export function assert (condition, message) { if (!condition) { throw AssertionError (message, new Error ()); } } export function __mergekwargtrans__ (object0, object1) { var result = {}; for (var attrib in object0) { result [attrib] = object0 [attrib]; } for (var attrib in object1) { result [attrib] = object1 [attrib]; } return result; }; export function __mergefields__ (targetClass, sourceClass) { let fieldNames = ['__reprfields__', '__comparefields__', '__initfields__'] if (sourceClass [fieldNames [0]]) { if (targetClass [fieldNames [0]]) { for (let fieldName of fieldNames) { targetClass [fieldName] = new Set ([...targetClass [fieldName], ...sourceClass [fieldName]]); } } else { for (let fieldName of fieldNames) { targetClass [fieldName] = new Set (sourceClass [fieldName]); } } } } export function __withblock__ (manager, statements) { if (hasattr (manager, '__enter__')) { try { manager.__enter__ (); statements (); manager.__exit__ (); } catch (exception) { if (! (manager.__exit__ (exception.name, exception, exception.stack))) { throw exception; } } } else { statements (); manager.close (); } }; export function dir (obj) { var aList = []; for (var aKey in obj) { aList.push (aKey.startsWith ('py_') ? aKey.slice (3) : aKey); } aList.sort (); return aList; }; export function setattr (obj, name, value) { obj [name] = value; }; export function getattr (obj, name) { return name in obj ? obj [name] : obj ['py_' + name]; }; export function hasattr (obj, name) { try { return name in obj || 'py_' + name in obj; } catch (exception) { return false; } }; export function delattr (obj, name) { if (name in obj) { delete obj [name]; } else { delete obj ['py_' + name]; } }; export function __in__ (element, container) { if (container === undefined || container === null) { return false; } if (container.__contains__ instanceof Function) { return container.__contains__ (element); } else { return ( container.indexOf ? container.indexOf (element) > -1 : container.hasOwnProperty (element) ); } }; export function __specialattrib__ (attrib) { return (attrib.startswith ('__') && attrib.endswith ('__')) || attrib == 'constructor' || attrib.startswith ('py_'); }; export function len (anObject) { if (anObject === undefined || anObject === null) { return 0; } if (anObject.__len__ instanceof Function) { return anObject.__len__ (); } if (anObject.length !== undefined) { return anObject.length; } var length = 0; for (var attr in anObject) { if (!__specialattrib__ (attr)) { length++; } } return length; }; export function __i__ (any) { return py_typeof (any) == dict ? any.py_keys () : any; } export function __k__ (keyed, key) { var result = keyed [key]; if (typeof result == 'undefined') { if (keyed instanceof Array) if (key == +key && key >= 0 && keyed.length > key) return result; else throw IndexError (key, new Error()); else throw KeyError (key, new Error()); } return result; } export function __t__ (target) { return ( target === undefined || target === null ? false : ['boolean', 'number'] .indexOf (typeof target) >= 0 ? target : target.__bool__ instanceof Function ? (target.__bool__ () ? target : false) : target.__len__ instanceof Function ? (target.__len__ () !== 0 ? target : false) : target instanceof Function ? target : len (target) !== 0 ? target : false ); } export function float (any) { if (any == 'inf') { return Infinity; } else if (any == '-inf') { return -Infinity; } else if (any == 'nan') { return NaN; } else if (isNaN (parseFloat (any))) { if (any === false) { return 0; } else if (any === true) { return 1; } else { throw ValueError ("could not convert string to float: '" + str(any) + "'", new Error ()); } } else { return +any; } }; float.__name__ = 'float'; float.__bases__ = [object]; export function int (any) { return float (any) | 0 }; int.__name__ = 'int'; int.__bases__ = [object]; export function bool (any) { return !!__t__ (any); }; bool.__name__ = 'bool'; bool.__bases__ = [int]; export function py_typeof (anObject) { var aType = typeof anObject; if (aType == 'object') { try { return '__class__' in anObject ? anObject.__class__ : object; } catch (exception) { return aType; } } else { return ( aType == 'boolean' ? bool : aType == 'string' ? str : aType == 'number' ? (anObject % 1 == 0 ? int : float) : null ); } }; export function issubclass (aClass, classinfo) { if (classinfo instanceof Array) { for (let aClass2 of classinfo) { if (issubclass (aClass, aClass2)) { return true; } } return false; } try { var aClass2 = aClass; if (aClass2 == classinfo) { return true; } else { var bases = [].slice.call (aClass2.__bases__); while (bases.length) { aClass2 = bases.shift (); if (aClass2 == classinfo) { return true; } if (aClass2.__bases__.length) { bases = [].slice.call (aClass2.__bases__).concat (bases); } } return false; } } catch (exception) { return aClass == classinfo || classinfo == object; } }; export function isinstance (anObject, classinfo) { try { return '__class__' in anObject ? issubclass (anObject.__class__, classinfo) : issubclass (py_typeof (anObject), classinfo); } catch (exception) { return issubclass (py_typeof (anObject), classinfo); } }; export function callable (anObject) { return anObject && typeof anObject == 'object' && '__call__' in anObject ? true : typeof anObject === 'function'; }; export function repr (anObject) { try { return anObject.__repr__ (); } catch (exception) { try { return anObject.__str__ (); } catch (exception) { try { if (anObject == null) { return 'None'; } else if (anObject.constructor == Object) { var result = '{'; var comma = false; for (var attrib in anObject) { if (!__specialattrib__ (attrib)) { if (attrib.isnumeric ()) { var attribRepr = attrib; } else { var attribRepr = '\'' + attrib + '\''; } if (comma) { result += ', '; } else { comma = true; } result += attribRepr + ': ' + repr (anObject [attrib]); } } result += '}'; return result; } else { return typeof anObject == 'boolean' ? anObject.toString () .capitalize () : anObject.toString (); } } catch (exception) { return ''; } } } }; export function chr (charCode) { return String.fromCharCode (charCode); }; export function ord (aChar) { return aChar.charCodeAt (0); }; export function max (nrOrSeq) { return arguments.length == 1 ? Math.max (...nrOrSeq) : Math.max (...arguments); }; export function min (nrOrSeq) { return arguments.length == 1 ? Math.min (...nrOrSeq) : Math.min (...arguments); }; export var abs = Math.abs; export function round (number, ndigits) { if (ndigits) { var scale = Math.pow (10, ndigits); number *= scale; } var rounded = Math.round (number); if (rounded - number == 0.5 && rounded % 2) { rounded -= 1; } if (ndigits) { rounded /= scale; } return rounded; }; export function __jsUsePyNext__ () { try { var result = this.__next__ (); return {value: result, done: false}; } catch (exception) { return {value: undefined, done: true}; } } export function __pyUseJsNext__ () { var result = this.next (); if (result.done) { throw StopIteration (new Error ()); } else { return result.value; } } export function py_iter (iterable) { if (typeof iterable == 'string' || '__iter__' in iterable) { var result = iterable.__iter__ (); result.next = __jsUsePyNext__; } else if ('selector' in iterable) { var result = list (iterable) .__iter__ (); result.next = __jsUsePyNext__; } else if ('next' in iterable) { var result = iterable if (! ('__next__' in result)) { result.__next__ = __pyUseJsNext__; } } else if (Symbol.iterator in iterable) { var result = iterable [Symbol.iterator] (); result.__next__ = __pyUseJsNext__; } else { throw IterableError (new Error ()); } result [Symbol.iterator] = function () {return result;}; return result; } export function py_next (iterator) { try { var result = iterator.__next__ (); } catch (exception) { var result = iterator.next (); if (result.done) { throw StopIteration (new Error ()); } else { return result.value; } } if (result == undefined) { throw StopIteration (new Error ()); } else { return result; } } export function __PyIterator__ (iterable) { this.iterable = iterable; this.index = 0; } __PyIterator__.prototype.__next__ = function() { if (this.index < this.iterable.length) { return this.iterable [this.index++]; } else { throw StopIteration (new Error ()); } }; export function __JsIterator__ (iterable) { this.iterable = iterable; this.index = 0; } __JsIterator__.prototype.next = function () { if (this.index < this.iterable.py_keys.length) { return {value: this.index++, done: false}; } else { return {value: undefined, done: true}; } }; export function py_reversed (iterable) { iterable = iterable.slice (); iterable.reverse (); return iterable; }; export function zip () { var args = [] .slice.call (arguments); for (var i = 0; i < args.length; i++) { if (typeof args [i] == 'string') { args [i] = args [i] .split (''); } else if (!Array.isArray (args [i])) { args [i] = Array.from (args [i]); } } var shortest = args.length == 0 ? [] : args.reduce ( function (array0, array1) { return array0.length < array1.length ? array0 : array1; } ); return shortest.map ( function (current, index) { return args.map ( function (current) { return current [index]; } ); } ); }; export function range (start, stop, step) { if (stop == undefined) { stop = start; start = 0; } if (step == undefined) { step = 1; } if ((step > 0 && start >= stop) || (step < 0 && start <= stop)) { return []; } var result = []; for (var i = start; step > 0 ? i < stop : i > stop; i += step) { result.push(i); } return result; }; export function any (iterable) { for (let item of iterable) { if (bool (item)) { return true; } } return false; } export function all (iterable) { for (let item of iterable) { if (! bool (item)) { return false; } } return true; } export function sum (iterable) { let result = 0; for (let item of iterable) { result += item; } return result; } export function enumerate (iterable) { return zip (range (len (iterable)), iterable); } export function copy (anObject) { if (anObject == null || typeof anObject == "object") { return anObject; } else { var result = {}; for (var attrib in obj) { if (anObject.hasOwnProperty (attrib)) { result [attrib] = anObject [attrib]; } } return result; } } export function deepcopy (anObject) { if (anObject == null || typeof anObject == "object") { return anObject; } else { var result = {}; for (var attrib in obj) { if (anObject.hasOwnProperty (attrib)) { result [attrib] = deepcopy (anObject [attrib]); } } return result; } } export function list (iterable) { let instance = iterable ? Array.from (iterable) : []; return instance; } Array.prototype.__class__ = list; list.__name__ = 'list'; list.__bases__ = [object]; Array.prototype.__iter__ = function () {return new __PyIterator__ (this);}; Array.prototype.__getslice__ = function (start, stop, step) { if (start < 0) { start = this.length + start; } if (stop == null) { stop = this.length; } else if (stop < 0) { stop = this.length + stop; } else if (stop > this.length) { stop = this.length; } if (step == 1) { return Array.prototype.slice.call(this, start, stop); } let result = list ([]); for (let index = start; index < stop; index += step) { result.push (this [index]); } return result; }; Array.prototype.__setslice__ = function (start, stop, step, source) { if (start < 0) { start = this.length + start; } if (stop == null) { stop = this.length; } else if (stop < 0) { stop = this.length + stop; } if (step == null) { Array.prototype.splice.apply (this, [start, stop - start] .concat (source)); } else { let sourceIndex = 0; for (let targetIndex = start; targetIndex < stop; targetIndex += step) { this [targetIndex] = source [sourceIndex++]; } } }; Array.prototype.__repr__ = function () { if (this.__class__ == set && !this.length) { return 'set()'; } let result = !this.__class__ || this.__class__ == list ? '[' : this.__class__ == tuple ? '(' : '{'; for (let index = 0; index < this.length; index++) { if (index) { result += ', '; } result += repr (this [index]); } if (this.__class__ == tuple && this.length == 1) { result += ','; } result += !this.__class__ || this.__class__ == list ? ']' : this.__class__ == tuple ? ')' : '}';; return result; }; Array.prototype.__str__ = Array.prototype.__repr__; Array.prototype.append = function (element) { this.push (element); }; Array.prototype.py_clear = function () { this.length = 0; }; Array.prototype.extend = function (aList) { this.push.apply (this, aList); }; Array.prototype.insert = function (index, element) { this.splice (index, 0, element); }; Array.prototype.remove = function (element) { let index = this.indexOf (element); if (index == -1) { throw ValueError ("list.remove(x): x not in list", new Error ()); } this.splice (index, 1); }; Array.prototype.index = function (element) { return this.indexOf (element); }; Array.prototype.py_pop = function (index) { if (index == undefined) { return this.pop (); } else { return this.splice (index, 1) [0]; } }; Array.prototype.py_sort = function () { __sort__.apply (null, [this].concat ([] .slice.apply (arguments))); }; Array.prototype.__add__ = function (aList) { return list (this.concat (aList)); }; Array.prototype.__mul__ = function (scalar) { let result = this; for (let i = 1; i < scalar; i++) { result = result.concat (this); } return result; }; Array.prototype.__rmul__ = Array.prototype.__mul__; export function tuple (iterable) { let instance = iterable ? [] .slice.apply (iterable) : []; instance.__class__ = tuple; return instance; } tuple.__name__ = 'tuple'; tuple.__bases__ = [object]; export function set (iterable) { let instance = []; if (iterable) { for (let index = 0; index < iterable.length; index++) { instance.add (iterable [index]); } } instance.__class__ = set; return instance; } set.__name__ = 'set'; set.__bases__ = [object]; Array.prototype.__bindexOf__ = function (element) { element += ''; let mindex = 0; let maxdex = this.length - 1; while (mindex <= maxdex) { let index = (mindex + maxdex) / 2 | 0; let middle = this [index] + ''; if (middle < element) { mindex = index + 1; } else if (middle > element) { maxdex = index - 1; } else { return index; } } return -1; }; Array.prototype.add = function (element) { if (this.indexOf (element) == -1) { this.push (element); } }; Array.prototype.discard = function (element) { var index = this.indexOf (element); if (index != -1) { this.splice (index, 1); } }; Array.prototype.isdisjoint = function (other) { this.sort (); for (let i = 0; i < other.length; i++) { if (this.__bindexOf__ (other [i]) != -1) { return false; } } return true; }; Array.prototype.issuperset = function (other) { this.sort (); for (let i = 0; i < other.length; i++) { if (this.__bindexOf__ (other [i]) == -1) { return false; } } return true; }; Array.prototype.issubset = function (other) { return set (other.slice ()) .issuperset (this); }; Array.prototype.union = function (other) { let result = set (this.slice () .sort ()); for (let i = 0; i < other.length; i++) { if (result.__bindexOf__ (other [i]) == -1) { result.push (other [i]); } } return result; }; Array.prototype.intersection = function (other) { this.sort (); let result = set (); for (let i = 0; i < other.length; i++) { if (this.__bindexOf__ (other [i]) != -1) { result.push (other [i]); } } return result; }; Array.prototype.difference = function (other) { let sother = set (other.slice () .sort ()); let result = set (); for (let i = 0; i < this.length; i++) { if (sother.__bindexOf__ (this [i]) == -1) { result.push (this [i]); } } return result; }; Array.prototype.symmetric_difference = function (other) { return this.union (other) .difference (this.intersection (other)); }; Array.prototype.py_update = function () { let updated = [] .concat.apply (this.slice (), arguments) .sort (); this.py_clear (); for (let i = 0; i < updated.length; i++) { if (updated [i] != updated [i - 1]) { this.push (updated [i]); } } }; Array.prototype.__eq__ = function (other) { if (this.length != other.length) { return false; } if (this.__class__ == set) { this.sort (); other.sort (); } for (let i = 0; i < this.length; i++) { if (this [i] != other [i]) { return false; } } return true; }; Array.prototype.__ne__ = function (other) { return !this.__eq__ (other); }; Array.prototype.__le__ = function (other) { if (this.__class__ == set) { return this.issubset (other); } else { for (let i = 0; i < this.length; i++) { if (this [i] > other [i]) { return false; } else if (this [i] < other [i]) { return true; } } return true; } }; Array.prototype.__ge__ = function (other) { if (this.__class__ == set) { return this.issuperset (other); } else { for (let i = 0; i < this.length; i++) { if (this [i] < other [i]) { return false; } else if (this [i] > other [i]) { return true; } } return true; } }; Array.prototype.__lt__ = function (other) { return ( this.__class__ == set ? this.issubset (other) && !this.issuperset (other) : !this.__ge__ (other) ); }; Array.prototype.__gt__ = function (other) { return ( this.__class__ == set ? this.issuperset (other) && !this.issubset (other) : !this.__le__ (other) ); }; export function bytearray (bytable, encoding) { if (bytable == undefined) { return new Uint8Array (0); } else { let aType = py_typeof (bytable); if (aType == int) { return new Uint8Array (bytable); } else if (aType == str) { let aBytes = new Uint8Array (len (bytable)); for (let i = 0; i < len (bytable); i++) { aBytes [i] = bytable.charCodeAt (i); } return aBytes; } else if (aType == list || aType == tuple) { return new Uint8Array (bytable); } else { throw py_TypeError; } } } export var bytes = bytearray; Uint8Array.prototype.__add__ = function (aBytes) { let result = new Uint8Array (this.length + aBytes.length); result.set (this); result.set (aBytes, this.length); return result; }; Uint8Array.prototype.__mul__ = function (scalar) { let result = new Uint8Array (scalar * this.length); for (let i = 0; i < scalar; i++) { result.set (this, i * this.length); } return result; }; Uint8Array.prototype.__rmul__ = Uint8Array.prototype.__mul__; export function str (stringable) { if (typeof stringable === 'number') return stringable.toString(); else { try { return stringable.__str__ (); } catch (exception) { try { return repr (stringable); } catch (exception) { return String (stringable); } } } }; String.prototype.__class__ = str; str.__name__ = 'str'; str.__bases__ = [object]; String.prototype.__iter__ = function () {new __PyIterator__ (this);}; String.prototype.__repr__ = function () { return (this.indexOf ('\'') == -1 ? '\'' + this + '\'' : '"' + this + '"') .py_replace ('\t', '\\t') .py_replace ('\n', '\\n'); }; String.prototype.__str__ = function () { return this; }; String.prototype.capitalize = function () { return this.charAt (0).toUpperCase () + this.slice (1); }; String.prototype.endswith = function (suffix) { if (suffix instanceof Array) { for (var i=0;i> b; } }; export function __or__ (a, b) { if (typeof a == 'object' && '__or__' in a) { return a.__or__ (b); } else if (typeof b == 'object' && '__ror__' in b) { return b.__ror__ (a); } else { return a | b; } }; export function __xor__ (a, b) { if (typeof a == 'object' && '__xor__' in a) { return a.__xor__ (b); } else if (typeof b == 'object' && '__rxor__' in b) { return b.__rxor__ (a); } else { return a ^ b; } }; export function __and__ (a, b) { if (typeof a == 'object' && '__and__' in a) { return a.__and__ (b); } else if (typeof b == 'object' && '__rand__' in b) { return b.__rand__ (a); } else { return a & b; } }; export function __eq__ (a, b) { if (typeof a == 'object' && '__eq__' in a) { return a.__eq__ (b); } else { return a == b; } }; export function __ne__ (a, b) { if (typeof a == 'object' && '__ne__' in a) { return a.__ne__ (b); } else { return a != b } }; export function __lt__ (a, b) { if (typeof a == 'object' && '__lt__' in a) { return a.__lt__ (b); } else { return a < b; } }; export function __le__ (a, b) { if (typeof a == 'object' && '__le__' in a) { return a.__le__ (b); } else { return a <= b; } }; export function __gt__ (a, b) { if (typeof a == 'object' && '__gt__' in a) { return a.__gt__ (b); } else { return a > b; } }; export function __ge__ (a, b) { if (typeof a == 'object' && '__ge__' in a) { return a.__ge__ (b); } else { return a >= b; } }; export function __imatmul__ (a, b) { if ('__imatmul__' in a) { return a.__imatmul__ (b); } else { return a.__matmul__ (b); } }; export function __ipow__ (a, b) { if (typeof a == 'object' && '__pow__' in a) { return a.__ipow__ (b); } else if (typeof a == 'object' && '__ipow__' in a) { return a.__pow__ (b); } else if (typeof b == 'object' && '__rpow__' in b) { return b.__rpow__ (a); } else { return Math.pow (a, b); } }; export function __ijsmod__ (a, b) { if (typeof a == 'object' && '__imod__' in a) { return a.__ismod__ (b); } else if (typeof a == 'object' && '__mod__' in a) { return a.__mod__ (b); } else if (typeof b == 'object' && '__rpow__' in b) { return b.__rmod__ (a); } else { return a % b; } }; export function __imod__ (a, b) { if (typeof a == 'object' && '__imod__' in a) { return a.__imod__ (b); } else if (typeof a == 'object' && '__mod__' in a) { return a.__mod__ (b); } else if (typeof b == 'object' && '__rmod__' in b) { return b.__rmod__ (a); } else { return ((a % b) + b) % b; } }; export function __imul__ (a, b) { if (typeof a == 'object' && '__imul__' in a) { return a.__imul__ (b); } else if (typeof a == 'object' && '__mul__' in a) { return a = a.__mul__ (b); } else if (typeof b == 'object' && '__rmul__' in b) { return a = b.__rmul__ (a); } else if (typeof a == 'string') { return a = a.__mul__ (b); } else if (typeof b == 'string') { return a = b.__rmul__ (a); } else { return a *= b; } }; export function __idiv__ (a, b) { if (typeof a == 'object' && '__idiv__' in a) { return a.__idiv__ (b); } else if (typeof a == 'object' && '__div__' in a) { return a = a.__div__ (b); } else if (typeof b == 'object' && '__rdiv__' in b) { return a = b.__rdiv__ (a); } else { return a /= b; } }; export function __iadd__ (a, b) { if (typeof a == 'object' && '__iadd__' in a) { return a.__iadd__ (b); } else if (typeof a == 'object' && '__add__' in a) { return a = a.__add__ (b); } else if (typeof b == 'object' && '__radd__' in b) { return a = b.__radd__ (a); } else { return a += b; } }; export function __isub__ (a, b) { if (typeof a == 'object' && '__isub__' in a) { return a.__isub__ (b); } else if (typeof a == 'object' && '__sub__' in a) { return a = a.__sub__ (b); } else if (typeof b == 'object' && '__rsub__' in b) { return a = b.__rsub__ (a); } else { return a -= b; } }; export function __ilshift__ (a, b) { if (typeof a == 'object' && '__ilshift__' in a) { return a.__ilshift__ (b); } else if (typeof a == 'object' && '__lshift__' in a) { return a = a.__lshift__ (b); } else if (typeof b == 'object' && '__rlshift__' in b) { return a = b.__rlshift__ (a); } else { return a <<= b; } }; export function __irshift__ (a, b) { if (typeof a == 'object' && '__irshift__' in a) { return a.__irshift__ (b); } else if (typeof a == 'object' && '__rshift__' in a) { return a = a.__rshift__ (b); } else if (typeof b == 'object' && '__rrshift__' in b) { return a = b.__rrshift__ (a); } else { return a >>= b; } }; export function __ior__ (a, b) { if (typeof a == 'object' && '__ior__' in a) { return a.__ior__ (b); } else if (typeof a == 'object' && '__or__' in a) { return a = a.__or__ (b); } else if (typeof b == 'object' && '__ror__' in b) { return a = b.__ror__ (a); } else { return a |= b; } }; export function __ixor__ (a, b) { if (typeof a == 'object' && '__ixor__' in a) { return a.__ixor__ (b); } else if (typeof a == 'object' && '__xor__' in a) { return a = a.__xor__ (b); } else if (typeof b == 'object' && '__rxor__' in b) { return a = b.__rxor__ (a); } else { return a ^= b; } }; export function __iand__ (a, b) { if (typeof a == 'object' && '__iand__' in a) { return a.__iand__ (b); } else if (typeof a == 'object' && '__and__' in a) { return a = a.__and__ (b); } else if (typeof b == 'object' && '__rand__' in b) { return a = b.__rand__ (a); } else { return a &= b; } }; export function __getitem__ (container, key) { if (typeof container == 'object' && '__getitem__' in container) { return container.__getitem__ (key); } else if ((typeof container == 'string' || container instanceof Array) && key < 0) { return container [container.length + key]; } else { return container [key]; } }; export function __setitem__ (container, key, value) { if (typeof container == 'object' && '__setitem__' in container) { container.__setitem__ (key, value); } else if ((typeof container == 'string' || container instanceof Array) && key < 0) { container [container.length + key] = value; } else { container [key] = value; } }; export function __getslice__ (container, lower, upper, step) { if (typeof container == 'object' && '__getitem__' in container) { return container.__getitem__ ([lower, upper, step]); } else { return container.__getslice__ (lower, upper, step); } }; export function __setslice__ (container, lower, upper, step, value) { if (typeof container == 'object' && '__setitem__' in container) { container.__setitem__ ([lower, upper, step], value); } else { container.__setslice__ (lower, upper, step, value); } }; export var BaseException = __class__ ('BaseException', [object], { __module__: __name__, }); export var Exception = __class__ ('Exception', [BaseException], { __module__: __name__, get __init__ () {return __get__ (this, function (self) { var kwargs = dict (); if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'self': var self = __allkwargs0__ [__attrib0__]; break; default: kwargs [__attrib0__] = __allkwargs0__ [__attrib0__]; } } delete kwargs.__kwargtrans__; } var args = tuple ([].slice.apply (arguments).slice (1, __ilastarg0__ + 1)); } else { var args = tuple (); } self.__args__ = args; if (kwargs.error != null) { self.stack = kwargs.error.stack; } else if (Error) { self.stack = new Error ().stack; } else { self.stack = 'No stack trace available'; } });}, get __repr__ () {return __get__ (this, function (self) { if (len (self.__args__) > 1) { return '{}{}'.format (self.__class__.__name__, repr (tuple (self.__args__))); } else if (len (self.__args__)) { return '{}({})'.format (self.__class__.__name__, repr (self.__args__ [0])); } else { return '{}()'.format (self.__class__.__name__); } });}, get __str__ () {return __get__ (this, function (self) { if (len (self.__args__) > 1) { return str (tuple (self.__args__)); } else if (len (self.__args__)) { return str (self.__args__ [0]); } else { return ''; } });} }); export var IterableError = __class__ ('IterableError', [Exception], { __module__: __name__, get __init__ () {return __get__ (this, function (self, error) { Exception.__init__ (self, "Can't iterate over non-iterable", __kwargtrans__ ({error: error})); });} }); export var StopIteration = __class__ ('StopIteration', [Exception], { __module__: __name__, get __init__ () {return __get__ (this, function (self, error) { Exception.__init__ (self, 'Iterator exhausted', __kwargtrans__ ({error: error})); });} }); export var ValueError = __class__ ('ValueError', [Exception], { __module__: __name__, get __init__ () {return __get__ (this, function (self, message, error) { Exception.__init__ (self, message, __kwargtrans__ ({error: error})); });} }); export var KeyError = __class__ ('KeyError', [Exception], { __module__: __name__, get __init__ () {return __get__ (this, function (self, message, error) { Exception.__init__ (self, message, __kwargtrans__ ({error: error})); });} }); export var AssertionError = __class__ ('AssertionError', [Exception], { __module__: __name__, get __init__ () {return __get__ (this, function (self, message, error) { if (message) { Exception.__init__ (self, message, __kwargtrans__ ({error: error})); } else { Exception.__init__ (self, __kwargtrans__ ({error: error})); } });} }); export var NotImplementedError = __class__ ('NotImplementedError', [Exception], { __module__: __name__, get __init__ () {return __get__ (this, function (self, message, error) { Exception.__init__ (self, message, __kwargtrans__ ({error: error})); });} }); export var IndexError = __class__ ('IndexError', [Exception], { __module__: __name__, get __init__ () {return __get__ (this, function (self, message, error) { Exception.__init__ (self, message, __kwargtrans__ ({error: error})); });} }); export var AttributeError = __class__ ('AttributeError', [Exception], { __module__: __name__, get __init__ () {return __get__ (this, function (self, message, error) { Exception.__init__ (self, message, __kwargtrans__ ({error: error})); });} }); export var py_TypeError = __class__ ('py_TypeError', [Exception], { __module__: __name__, get __init__ () {return __get__ (this, function (self, message, error) { Exception.__init__ (self, message, __kwargtrans__ ({error: error})); });} }); export var Warning = __class__ ('Warning', [Exception], { __module__: __name__, }); export var UserWarning = __class__ ('UserWarning', [Warning], { __module__: __name__, }); export var DeprecationWarning = __class__ ('DeprecationWarning', [Warning], { __module__: __name__, }); export var RuntimeWarning = __class__ ('RuntimeWarning', [Warning], { __module__: __name__, }); export var __sort__ = function (iterable, key, reverse) { if (typeof key == 'undefined' || (key != null && key.hasOwnProperty ("__kwargtrans__"))) {; var key = null; }; if (typeof reverse == 'undefined' || (reverse != null && reverse.hasOwnProperty ("__kwargtrans__"))) {; var reverse = false; }; if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'iterable': var iterable = __allkwargs0__ [__attrib0__]; break; case 'key': var key = __allkwargs0__ [__attrib0__]; break; case 'reverse': var reverse = __allkwargs0__ [__attrib0__]; break; } } } } else { } if (key) { iterable.sort ((function __lambda__ (a, b) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'a': var a = __allkwargs0__ [__attrib0__]; break; case 'b': var b = __allkwargs0__ [__attrib0__]; break; } } } } else { } return (key (a) > key (b) ? 1 : -(1)); })); } else { iterable.sort (); } if (reverse) { iterable.reverse (); } }; export var sorted = function (iterable, key, reverse) { if (typeof key == 'undefined' || (key != null && key.hasOwnProperty ("__kwargtrans__"))) {; var key = null; }; if (typeof reverse == 'undefined' || (reverse != null && reverse.hasOwnProperty ("__kwargtrans__"))) {; var reverse = false; }; if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'iterable': var iterable = __allkwargs0__ [__attrib0__]; break; case 'key': var key = __allkwargs0__ [__attrib0__]; break; case 'reverse': var reverse = __allkwargs0__ [__attrib0__]; break; } } } } else { } if (py_typeof (iterable) == dict) { var result = copy (iterable.py_keys ()); } else { var result = copy (iterable); } __sort__ (result, key, reverse); return result; }; export var map = function (func, iterable) { return (function () { var __accu0__ = []; for (var item of iterable) { __accu0__.append (func (item)); } return __accu0__; }) (); }; export var filter = function (func, iterable) { if (func == null) { var func = bool; } return (function () { var __accu0__ = []; for (var item of iterable) { if (func (item)) { __accu0__.append (item); } } return __accu0__; }) (); }; export var divmod = function (n, d) { return tuple ([Math.floor (n / d), __mod__ (n, d)]); }; export var __Terminal__ = __class__ ('__Terminal__', [object], { __module__: __name__, get __init__ () {return __get__ (this, function (self) { self.buffer = ''; try { self.element = document.getElementById ('__terminal__'); } catch (__except0__) { self.element = null; } if (self.element) { self.element.style.overflowX = 'auto'; self.element.style.boxSizing = 'border-box'; self.element.style.padding = '5px'; self.element.innerHTML = '_'; } });}, get print () {return __get__ (this, function (self) { var sep = ' '; var end = '\n'; if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'self': var self = __allkwargs0__ [__attrib0__]; break; case 'sep': var sep = __allkwargs0__ [__attrib0__]; break; case 'end': var end = __allkwargs0__ [__attrib0__]; break; } } } var args = tuple ([].slice.apply (arguments).slice (1, __ilastarg0__ + 1)); } else { var args = tuple (); } self.buffer = '{}{}{}'.format (self.buffer, sep.join ((function () { var __accu0__ = []; for (var arg of args) { __accu0__.append (str (arg)); } return __accu0__; }) ()), end).__getslice__ (-(4096), null, 1); if (self.element) { self.element.innerHTML = self.buffer.py_replace ('\n', '
').py_replace (' ', ' '); self.element.scrollTop = self.element.scrollHeight; } else { console.log (sep.join ((function () { var __accu0__ = []; for (var arg of args) { __accu0__.append (str (arg)); } return __accu0__; }) ())); } });}, get input () {return __get__ (this, function (self, question) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'self': var self = __allkwargs0__ [__attrib0__]; break; case 'question': var question = __allkwargs0__ [__attrib0__]; break; } } } } else { } self.print ('{}'.format (question), __kwargtrans__ ({end: ''})); var answer = window.prompt ('\n'.join (self.buffer.py_split ('\n').__getslice__ (-(8), null, 1))); self.print (answer); return answer; });} }); export var __terminal__ = __Terminal__ (); export var print = __terminal__.print; export var input = __terminal__.input; //# sourceMappingURL=org.transcrypt.__runtime__.map ================================================ FILE: docs/examples/transcrypt/sketch_007/target/org.transcrypt.__runtime__.py ================================================ # Transcrypt runtime module #__pragma__ ('js', 'export var __envir__ = {{}};\n{}', __include__ ('org/transcrypt/__envir__.js')) #__pragma__ ('js', '{}', __include__ ('org/transcrypt/__core__.js')) #__pragma__ ('js', '{}', __include__ ('org/transcrypt/__builtin__.js')) #__pragma__ ('skip') copy = Math = __typeof__ = __repr__ = document = console = window = 0 #__pragma__ ('noskip') #__pragma__ ('notconv') # !!! tconv gives a problem with __terminal__, needs investigation #__pragma__ ('nokwargs') #__pragma__ ('noalias', 'sort') class BaseException: pass class Exception (BaseException): #__pragma__ ('kwargs') def __init__ (self, *args, **kwargs): self.__args__ = args if kwargs.error != None: self.stack = kwargs.error.stack # Integrate with JavaScript Error object elif Error: self.stack = (__new__(Error())).stack # Create our own stack if we aren't given one else: self.stack = 'No stack trace available' #__pragma__ ('nokwargs') def __repr__ (self): if len (self.__args__) > 1: return '{}{}'.format (self.__class__.__name__, repr (tuple (self.__args__))) elif len (self.__args__): return '{}({})'.format (self.__class__.__name__, repr (self.__args__ [0])) else: return '{}()'.format (self.__class__.__name__) def __str__ (self): if len (self.__args__) > 1: return str (tuple (self.__args__)) elif len (self.__args__): return str (self.__args__ [0]) else: return '' class IterableError (Exception): def __init__ (self, error): Exception.__init__ (self, 'Can\'t iterate over non-iterable', error = error) class StopIteration (Exception): def __init__ (self, error): Exception.__init__ (self, 'Iterator exhausted', error = error) class ValueError (Exception): def __init__ (self, message, error): Exception.__init__ (self, message, error = error) class KeyError (Exception): def __init__ (self, message, error): Exception.__init__ (self, message, error = error) class AssertionError (Exception): def __init__ (self, message, error): if message: Exception.__init__ (self, message, error = error) else: Exception.__init__ (self, error = error) class NotImplementedError (Exception): def __init__(self, message, error): Exception.__init__(self, message, error = error) class IndexError (Exception): def __init__(self, message, error): Exception.__init__(self, message, error = error) class AttributeError (Exception): def __init__(self, message, error): Exception.__init__(self, message, error = error) class TypeError (Exception): def __init__(self, message, error): Exception.__init__(self, message, error = error) # Warnings Exceptions # N.B. This is a limited subset of the warnings defined in # the cpython implementation to keep things small for now. class Warning (Exception): ''' Warning Base Class ''' pass class UserWarning (Warning): pass class DeprecationWarning (Warning): pass class RuntimeWarning (Warning): pass #__pragma__ ('kwargs') def __sort__ (iterable, key = None, reverse = False): # Used by py_sort, can deal with kwargs if key: iterable.sort (lambda a, b: 1 if key (a) > key (b) else -1) # JavaScript sort, case '==' is irrelevant for sorting else: iterable.sort () # JavaScript sort if reverse: iterable.reverse () def sorted (iterable, key = None, reverse = False): if type (iterable) == dict: result = copy (iterable.keys ()) else: result = copy (iterable) __sort__ (result, key, reverse) return result #__pragma__ ('nokwargs') def map (func, iterable): return [func (item) for item in iterable] def filter (func, iterable): if func == None: func = bool return [item for item in iterable if func (item)] def divmod (n, d): return n // d, n % d #__pragma__ ('ifdef', '__complex__') class complex: def __init__ (self, real, imag = None): if imag == None: if type (real) == complex: self.real = real.real self.imag = real.imag else: self.real = real self.imag = 0 else: self.real = real self.imag = imag def __neg__ (self): return complex (-self.real, -self.imag) def __exp__ (self): modulus = Math.exp (self.real) return complex (modulus * Math.cos (self.imag), modulus * Math.sin (self.imag)) def __log__ (self): return complex (Math.log (Math.sqrt (self.real * self.real + self.imag * self.imag)), Math.atan2 (self.imag, self.real)) def __pow__ (self, other): # a ** b = exp (b log a) return (self.__log__ () .__mul__ (other)) .__exp__ () def __rpow__ (self, real): # real ** comp -> comp.__rpow__ (real) return self.__mul__ (Math.log (real)) .__exp__ () def __mul__ (self, other): if __typeof__ (other) is 'number': return complex (self.real * other, self.imag * other) else: return complex (self.real * other.real - self.imag * other.imag, self.real * other.imag + self.imag * other.real) def __rmul__ (self, real): # real + comp -> comp.__rmul__ (real) return complex (self.real * real, self.imag * real) def __div__ (self, other): if __typeof__ (other) is 'number': return complex (self.real / other, self.imag / other) else: denom = other.real * other.real + other.imag * other.imag return complex ( (self.real * other.real + self.imag * other.imag) / denom, (self.imag * other.real - self.real * other.imag) / denom ) def __rdiv__ (self, real): # real / comp -> comp.__rdiv__ (real) denom = self.real * self.real return complex ( (real * self.real) / denom, (real * self.imag) / denom ) def __add__ (self, other): if __typeof__ (other) is 'number': return complex (self.real + other, self.imag) else: # Assume other is complex return complex (self.real + other.real, self.imag + other.imag) def __radd__ (self, real): # real + comp -> comp.__radd__ (real) return complex (self.real + real, self.imag) def __sub__ (self, other): if __typeof__ (other) is 'number': return complex (self.real - other, self.imag) else: return complex (self.real - other.real, self.imag - other.imag) def __rsub__ (self, real): # real - comp -> comp.__rsub__ (real) return complex (real - self.real, -self.imag) def __repr__ (self): return '({}{}{}j)'.format (self.real, '+' if self.imag >= 0 else '', self.imag) def __str__ (self): return __repr__ (self) [1 : -1] def __eq__ (self, other): if __typeof__ (other) is 'number': return self.real == other else: return self.real == other.real and self.imag == other.imag def __ne__ (self, other): if __typeof__ (other) is 'number': return self.real != other else: return self.real != other.real or self.imag != other.imag def conjugate (self): return complex (self.real, -self.imag) def __conj__ (aNumber): if isinstance (aNumber, complex): return complex (aNumber.real, -aNumber.imag) else: return complex (aNumber, 0) #__pragma__ ('endif') class __Terminal__: ''' Printing to either the console or to html happens async, but is blocked by calling window.prompt. So while all input and print statements are encountered in normal order, the print's exit immediately without yet having actually printed This means the next input takes control, blocking actual printing and so on indefinitely The effect is that everything's only printed after all inputs are done To prevent that, what's needed is to only execute the next window.prompt after actual printing has been done Since we've no way to find out when that is, a timeout is used. ''' def __init__ (self): self.buffer = '' try: self.element = document.getElementById ('__terminal__') except: self.element = None if self.element: self.element.style.overflowX = 'auto' self.element.style.boxSizing = 'border-box' self.element.style.padding = '5px' self.element.innerHTML = '_' #__pragma__ ('kwargs') def print (self, *args, sep = ' ', end = '\n'): self.buffer = '{}{}{}'.format (self.buffer, sep.join ([str (arg) for arg in args]), end) [-4096 : ] if self.element: self.element.innerHTML = self.buffer.replace ('\n', '
') .replace (' ', ' ') self.element.scrollTop = self.element.scrollHeight else: console.log (sep.join ([str (arg) for arg in args])) def input (self, question): self.print ('{}'.format (question), end = '') answer = window.prompt ('\n'.join (self.buffer.split ('\n') [-8:])) self.print (answer) return answer #__pragma__ ('nokwargs') __terminal__ = __Terminal__ () print = __terminal__.print input = __terminal__.input ================================================ FILE: docs/examples/transcrypt/sketch_007/target/pyp5js.js ================================================ // Transcrypt'ed from Python, 2021-11-02 13:06:15 import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, all, any, assert, bool, bytearray, bytes, callable, chr, deepcopy, delattr, dict, dir, divmod, enumerate, getattr, hasattr, isinstance, issubclass, len, list, object, ord, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, setattr, sorted, sum, tuple, zip} from './org.transcrypt.__runtime__.js'; import {PythonFunctions} from './python_functions.js'; var __name__ = 'pyp5js'; export var _P5_INSTANCE = null; export var _CTX_MIDDLE = null; export var _DEFAULT_FILL = null; export var _DEFAULT_LEADMULT = null; export var _DEFAULT_STROKE = null; export var _DEFAULT_TEXT_FILL = null; export var ADD = null; export var ALT = null; export var ARROW = null; export var AUDIO = null; export var AUTO = null; export var AXES = null; export var BACKSPACE = null; export var BASELINE = null; export var BEVEL = null; export var BEZIER = null; export var BLEND = null; export var BLUR = null; export var BOLD = null; export var BOLDITALIC = null; export var BOTTOM = null; export var BURN = null; export var CENTER = null; export var CHORD = null; export var CLAMP = null; export var CLOSE = null; export var CONTROL = null; export var CORNER = null; export var CORNERS = null; export var CROSS = null; export var CURVE = null; export var DARKEST = null; export var DEG_TO_RAD = null; export var DEGREES = null; export var DELETE = null; export var DIFFERENCE = null; export var DILATE = null; export var DODGE = null; export var DOWN_ARROW = null; export var ENTER = null; export var ERODE = null; export var ESCAPE = null; export var EXCLUSION = null; export var FILL = null; export var GRAY = null; export var GRID = null; export var HALF_PI = null; export var HAND = null; export var HARD_LIGHT = null; export var HSB = null; export var HSL = null; export var IMAGE = null; export var IMMEDIATE = null; export var INVERT = null; export var ITALIC = null; export var LANDSCAPE = null; export var LEFT = null; export var LEFT_ARROW = null; export var LIGHTEST = null; export var LINE_LOOP = null; export var LINE_STRIP = null; export var LINEAR = null; export var LINES = null; export var MIRROR = null; export var MITER = null; export var MOVE = null; export var MULTIPLY = null; export var NEAREST = null; export var NORMAL = null; export var OPAQUE = null; export var OPEN = null; export var OPTION = null; export var OVERLAY = null; export var PI = null; export var PIE = null; export var POINTS = null; export var PORTRAIT = null; export var POSTERIZE = null; export var PROJECT = null; export var QUAD_STRIP = null; export var QUADRATIC = null; export var QUADS = null; export var QUARTER_PI = null; export var RAD_TO_DEG = null; export var RADIANS = null; export var RADIUS = null; export var REPEAT = null; export var REPLACE = null; export var RETURN = null; export var RGB = null; export var RIGHT = null; export var RIGHT_ARROW = null; export var ROUND = null; export var SCREEN = null; export var SHIFT = null; export var SOFT_LIGHT = null; export var SQUARE = null; export var STROKE = null; export var SUBTRACT = null; export var TAB = null; export var TAU = null; export var TEXT = null; export var TEXTURE = null; export var THRESHOLD = null; export var TOP = null; export var TRIANGLE_FAN = null; export var TRIANGLE_STRIP = null; export var TRIANGLES = null; export var TWO_PI = null; export var UP_ARROW = null; export var VIDEO = null; export var WAIT = null; export var WEBGL = null; export var P2D = null; var PI = null; export var frameCount = null; export var focused = null; export var displayWidth = null; export var displayHeight = null; export var windowWidth = null; export var windowHeight = null; export var width = null; export var height = null; export var disableFriendlyErrors = null; export var deviceOrientation = null; export var accelerationX = null; export var accelerationY = null; export var accelerationZ = null; export var pAccelerationX = null; export var pAccelerationY = null; export var pAccelerationZ = null; export var rotationX = null; export var rotationY = null; export var rotationZ = null; export var pRotationX = null; export var pRotationY = null; export var pRotationZ = null; export var turnAxis = null; export var keyIsPressed = null; export var key = null; export var keyCode = null; export var mouseX = null; export var mouseY = null; export var pmouseX = null; export var pmouseY = null; export var winMouseX = null; export var winMouseY = null; export var pwinMouseX = null; export var pwinMouseY = null; export var mouseButton = null; export var mouseIsPressed = null; export var touches = null; export var pixels = null; export var alpha = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.alpha (...args); }; export var blue = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.blue (...args); }; export var brightness = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.brightness (...args); }; export var color = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.color (...args); }; export var green = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.green (...args); }; export var hue = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.hue (...args); }; export var lerpColor = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.lerpColor (...args); }; export var lightness = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.lightness (...args); }; export var red = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.red (...args); }; export var saturation = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.saturation (...args); }; export var background = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.background (...args); }; export var py_clear = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } var p5_clear = _P5_INSTANCE.clear (...args); return p5_clear; }; export var erase = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.erase (...args); }; export var noErase = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noErase (...args); }; export var colorMode = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.colorMode (...args); }; export var fill = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.fill (...args); }; export var noFill = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noFill (...args); }; export var noStroke = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noStroke (...args); }; export var stroke = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.stroke (...args); }; export var arc = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.arc (...args); }; export var ellipse = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.ellipse (...args); }; export var circle = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.circle (...args); }; export var line = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.line (...args); }; export var point = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.point (...args); }; export var quad = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.quad (...args); }; export var rect = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.rect (...args); }; export var square = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.square (...args); }; export var triangle = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.triangle (...args); }; export var plane = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.plane (...args); }; export var box = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.box (...args); }; export var sphere = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.sphere (...args); }; export var cylinder = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.cylinder (...args); }; export var cone = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.cone (...args); }; export var ellipsoid = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.ellipsoid (...args); }; export var torus = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.torus (...args); }; export var loadModel = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.loadModel (...args); }; export var model = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.model (...args); }; export var ellipseMode = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.ellipseMode (...args); }; export var noSmooth = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noSmooth (...args); }; export var rectMode = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.rectMode (...args); }; export var smooth = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.smooth (...args); }; export var strokeCap = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.strokeCap (...args); }; export var strokeJoin = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.strokeJoin (...args); }; export var strokeWeight = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.strokeWeight (...args); }; export var bezier = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.bezier (...args); }; export var bezierDetail = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.bezierDetail (...args); }; export var bezierPoint = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.bezierPoint (...args); }; export var bezierTangent = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.bezierTangent (...args); }; export var curve = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.curve (...args); }; export var curveDetail = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.curveDetail (...args); }; export var curveTightness = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.curveTightness (...args); }; export var curvePoint = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.curvePoint (...args); }; export var curveTangent = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.curveTangent (...args); }; export var beginContour = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.beginContour (...args); }; export var beginShape = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.beginShape (...args); }; export var bezierVertex = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.bezierVertex (...args); }; export var curveVertex = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.curveVertex (...args); }; export var endContour = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.endContour (...args); }; export var endShape = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.endShape (...args); }; export var quadraticVertex = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.quadraticVertex (...args); }; export var vertex = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.vertex (...args); }; export var cursor = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.cursor (...args); }; export var frameRate = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.frameRate (...args); }; export var noCursor = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noCursor (...args); }; export var fullscreen = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.fullscreen (...args); }; export var pixelDensity = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.pixelDensity (...args); }; export var displayDensity = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.displayDensity (...args); }; export var getURL = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.getURL (...args); }; export var getURLPath = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.getURLPath (...args); }; export var getURLParams = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.getURLParams (...args); }; export var preload = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.preload (...args); }; export var setup = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.setup (...args); }; export var draw = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.draw (...args); }; export var remove = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.remove (...args); }; export var noLoop = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noLoop (...args); }; export var loop = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.loop (...args); }; export var push = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.push (...args); }; export var redraw = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.redraw (...args); }; export var resizeCanvas = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.resizeCanvas (...args); }; export var noCanvas = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noCanvas (...args); }; export var createGraphics = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createGraphics (...args); }; export var blendMode = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.blendMode (...args); }; export var setAttributes = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.setAttributes (...args); }; export var applyMatrix = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.applyMatrix (...args); }; export var resetMatrix = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.resetMatrix (...args); }; export var rotate = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.rotate (...args); }; export var rotateX = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.rotateX (...args); }; export var rotateY = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.rotateY (...args); }; export var rotateZ = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.rotateZ (...args); }; export var scale = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.scale (...args); }; export var shearX = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.shearX (...args); }; export var shearY = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.shearY (...args); }; export var translate = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.translate (...args); }; export var createStringDict = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createStringDict (...args); }; export var createNumberDict = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createNumberDict (...args); }; export var append = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.append (...args); }; export var arrayCopy = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.arrayCopy (...args); }; export var concat = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.concat (...args); }; export var reverse = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.reverse (...args); }; export var shorten = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.shorten (...args); }; export var shuffle = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.shuffle (...args); }; export var py_sort = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.py_sort (...args); }; export var splice = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.splice (...args); }; export var subset = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.subset (...args); }; export var float = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.float (...args); }; export var int = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.int (...args); }; export var str = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.str (...args); }; export var boolean = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.boolean (...args); }; export var byte = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.byte (...args); }; export var char = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.char (...args); }; export var unchar = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.unchar (...args); }; export var hex = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.hex (...args); }; export var unhex = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.unhex (...args); }; export var join = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.join (...args); }; export var match = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.match (...args); }; export var matchAll = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.matchAll (...args); }; export var nf = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.nf (...args); }; export var nfc = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.nfc (...args); }; export var nfp = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.nfp (...args); }; export var nfs = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.nfs (...args); }; export var py_split = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.py_split (...args); }; export var splitTokens = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.splitTokens (...args); }; export var trim = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.trim (...args); }; export var setMoveThreshold = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.setMoveThreshold (...args); }; export var setShakeThreshold = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.setShakeThreshold (...args); }; export var keyIsDown = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.keyIsDown (...args); }; export var createImage = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createImage (...args); }; export var saveCanvas = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.saveCanvas (...args); }; export var saveFrames = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.saveFrames (...args); }; export var image_proxy = function (img) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'img': var img = __allkwargs0__ [__attrib0__]; break; } } } } else { } var _set = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } var value = img.set (...args); return value; }; var _get = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } var value = img.get (...args); return value; }; img.py_set = _set; img.py_get = _get; return img; }; export var loadImage = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } var imageObj = _P5_INSTANCE.loadImage (...args); return image_proxy (imageObj); }; export var image = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.image (...args); }; export var tint = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.tint (...args); }; export var noTint = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noTint (...args); }; export var imageMode = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.imageMode (...args); }; export var blend = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.blend (...args); }; export var copy = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.copy (...args); }; export var filter = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } if (len (args) > 1 && (args [0] === null || callable (args [0]))) { return PythonFunctions.filter (...args); } else { return _P5_INSTANCE.filter (...args); } }; export var py_get = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } var p5_get = _P5_INSTANCE.get (...args); return p5_get; }; export var loadPixels = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.loadPixels (...args); }; export var py_set = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } if (len (args) <= 1) { return PythonFunctions.py_set (...args); } else { return _P5_INSTANCE.py_set (...args); } }; export var updatePixels = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.updatePixels (...args); }; export var loadJSON = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.loadJSON (...args); }; export var loadStrings = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.loadStrings (...args); }; export var loadTable = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.loadTable (...args); }; export var loadXML = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.loadXML (...args); }; export var loadBytes = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.loadBytes (...args); }; export var httpGet = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.httpGet (...args); }; export var httpPost = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.httpPost (...args); }; export var httpDo = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.httpDo (...args); }; export var createWriter = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createWriter (...args); }; export var save = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.save (...args); }; export var saveJSON = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.saveJSON (...args); }; export var saveStrings = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.saveStrings (...args); }; export var saveTable = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.saveTable (...args); }; export var day = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.day (...args); }; export var hour = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.hour (...args); }; export var minute = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.minute (...args); }; export var millis = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.millis (...args); }; export var month = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.month (...args); }; export var second = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.second (...args); }; export var year = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.year (...args); }; export var createVector = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createVector (...args); }; export var abs = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.abs (...args); }; export var ceil = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.ceil (...args); }; export var constrain = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.constrain (...args); }; export var dist = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.dist (...args); }; export var exp = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.exp (...args); }; export var floor = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.floor (...args); }; export var lerp = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.lerp (...args); }; export var log = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.log (...args); }; export var mag = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.mag (...args); }; export var map = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } if (len (args) > 1 && callable (args [0])) { return PythonFunctions.map (...args); } else { return _P5_INSTANCE.map (...args); } }; export var max = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.max (...args); }; export var min = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.min (...args); }; export var norm = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.norm (...args); }; export var pow = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.pow (...args); }; export var round = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.round (...args); }; export var sq = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.sq (...args); }; export var sqrt = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.sqrt (...args); }; export var noise = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noise (...args); }; export var noiseDetail = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noiseDetail (...args); }; export var noiseSeed = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noiseSeed (...args); }; export var randomSeed = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.randomSeed (...args); }; export var random = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.random (...args); }; export var randomGaussian = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.randomGaussian (...args); }; export var acos = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.acos (...args); }; export var asin = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.asin (...args); }; export var atan = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.atan (...args); }; export var atan2 = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.atan2 (...args); }; export var cos = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.cos (...args); }; export var sin = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.sin (...args); }; export var tan = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.tan (...args); }; export var degrees = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.degrees (...args); }; export var radians = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.radians (...args); }; export var angleMode = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.angleMode (...args); }; export var textAlign = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.textAlign (...args); }; export var textLeading = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.textLeading (...args); }; export var textSize = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.textSize (...args); }; export var textStyle = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.textStyle (...args); }; export var textWidth = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.textWidth (...args); }; export var textAscent = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.textAscent (...args); }; export var textDescent = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.textDescent (...args); }; export var loadFont = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.loadFont (...args); }; export var text = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.text (...args); }; export var textFont = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.textFont (...args); }; export var orbitControl = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.orbitControl (...args); }; export var debugMode = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.debugMode (...args); }; export var noDebugMode = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noDebugMode (...args); }; export var ambientLight = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.ambientLight (...args); }; export var directionalLight = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.directionalLight (...args); }; export var pointLight = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.pointLight (...args); }; export var lights = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.lights (...args); }; export var loadShader = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.loadShader (...args); }; export var createShader = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createShader (...args); }; export var shader = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.shader (...args); }; export var resetShader = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.resetShader (...args); }; export var normalMaterial = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.normalMaterial (...args); }; export var texture = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.texture (...args); }; export var textureMode = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.textureMode (...args); }; export var textureWrap = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.textureWrap (...args); }; export var ambientMaterial = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.ambientMaterial (...args); }; export var specularMaterial = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.specularMaterial (...args); }; export var shininess = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.shininess (...args); }; export var camera = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.camera (...args); }; export var perspective = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.perspective (...args); }; export var ortho = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.ortho (...args); }; export var createCamera = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createCamera (...args); }; export var setCamera = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.setCamera (...args); }; export var select = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.select (...args); }; export var selectAll = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.selectAll (...args); }; export var removeElements = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.removeElements (...args); }; export var changed = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.changed (...args); }; export var input = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.input (...args); }; export var createDiv = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createDiv (...args); }; export var createP = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createP (...args); }; export var createSpan = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createSpan (...args); }; export var createImg = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createImg (...args); }; export var createA = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createA (...args); }; export var createSlider = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createSlider (...args); }; export var createButton = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createButton (...args); }; export var createCheckbox = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createCheckbox (...args); }; export var createSelect = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createSelect (...args); }; export var createRadio = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createRadio (...args); }; export var createColorPicker = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createColorPicker (...args); }; export var createInput = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createInput (...args); }; export var createFileInput = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createFileInput (...args); }; export var createVideo = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createVideo (...args); }; export var createAudio = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createAudio (...args); }; export var createCapture = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createCapture (...args); }; export var createElement = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createElement (...args); }; export var createCanvas = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } var canvas = _P5_INSTANCE.createCanvas (...args); width = _P5_INSTANCE.width; height = _P5_INSTANCE.height; return canvas; }; export var py_pop = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } var p5_pop = _P5_INSTANCE.pop (...args); return p5_pop; }; export var size = createCanvas; export var popMatrix = py_pop; export var popStyle = py_pop; export var pushMatrix = push; export var pushStyle = push; export var PVector = function (x, y, z) { if (typeof x == 'undefined' || (x != null && x.hasOwnProperty ("__kwargtrans__"))) {; var x = 0; }; if (typeof y == 'undefined' || (y != null && y.hasOwnProperty ("__kwargtrans__"))) {; var y = 0; }; if (typeof z == 'undefined' || (z != null && z.hasOwnProperty ("__kwargtrans__"))) {; var z = 0; }; if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'x': var x = __allkwargs0__ [__attrib0__]; break; case 'y': var y = __allkwargs0__ [__attrib0__]; break; case 'z': var z = __allkwargs0__ [__attrib0__]; break; } } } } else { } return _P5_INSTANCE.createVector (x, y, z); }; setattr (PVector, 'dist', p5.Vector.dist); setattr (PVector, 'add', p5.Vector.add); setattr (PVector, 'sub', p5.Vector.sub); setattr (PVector, 'mult', p5.Vector.mult); setattr (PVector, 'div', p5.Vector.div); setattr (PVector, 'dot', p5.Vector.dot); setattr (PVector, 'cross', p5.Vector.cross); setattr (PVector, 'lerp', p5.Vector.lerp); setattr (PVector, 'random2D', p5.Vector.random2D); setattr (PVector, 'random3D', p5.Vector.random3D); setattr (PVector, 'angleBetween', p5.Vector.angleBetween); setattr (PVector, 'fromAngle', p5.Vector.fromAngle); setattr (PVector, 'fromAngles', p5.Vector.fromAngles); setattr (PVector, 'equals', p5.Vector.equals); export var pre_draw = function (p5_instance, draw_func) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'p5_instance': var p5_instance = __allkwargs0__ [__attrib0__]; break; case 'draw_func': var draw_func = __allkwargs0__ [__attrib0__]; break; } } } } else { } _CTX_MIDDLE = p5_instance._CTX_MIDDLE; _DEFAULT_FILL = p5_instance._DEFAULT_FILL; _DEFAULT_LEADMULT = p5_instance._DEFAULT_LEADMULT; _DEFAULT_STROKE = p5_instance._DEFAULT_STROKE; _DEFAULT_TEXT_FILL = p5_instance._DEFAULT_TEXT_FILL; ADD = p5_instance.ADD; ALT = p5_instance.ALT; ARROW = p5_instance.ARROW; AUDIO = p5_instance.AUDIO; AUTO = p5_instance.AUTO; AXES = p5_instance.AXES; BACKSPACE = p5_instance.BACKSPACE; BASELINE = p5_instance.BASELINE; BEVEL = p5_instance.BEVEL; BEZIER = p5_instance.BEZIER; BLEND = p5_instance.BLEND; BLUR = p5_instance.BLUR; BOLD = p5_instance.BOLD; BOLDITALIC = p5_instance.BOLDITALIC; BOTTOM = p5_instance.BOTTOM; BURN = p5_instance.BURN; CENTER = p5_instance.CENTER; CHORD = p5_instance.CHORD; CLAMP = p5_instance.CLAMP; CLOSE = p5_instance.CLOSE; CONTROL = p5_instance.CONTROL; CORNER = p5_instance.CORNER; CORNERS = p5_instance.CORNERS; CROSS = p5_instance.CROSS; CURVE = p5_instance.CURVE; DARKEST = p5_instance.DARKEST; DEG_TO_RAD = p5_instance.DEG_TO_RAD; DEGREES = p5_instance.DEGREES; DELETE = p5_instance.DELETE; DIFFERENCE = p5_instance.DIFFERENCE; DILATE = p5_instance.DILATE; DODGE = p5_instance.DODGE; DOWN_ARROW = p5_instance.DOWN_ARROW; ENTER = p5_instance.ENTER; ERODE = p5_instance.ERODE; ESCAPE = p5_instance.ESCAPE; EXCLUSION = p5_instance.EXCLUSION; FILL = p5_instance.FILL; GRAY = p5_instance.GRAY; GRID = p5_instance.GRID; HALF_PI = p5_instance.HALF_PI; HAND = p5_instance.HAND; HARD_LIGHT = p5_instance.HARD_LIGHT; HSB = p5_instance.HSB; HSL = p5_instance.HSL; IMAGE = p5_instance.IMAGE; IMMEDIATE = p5_instance.IMMEDIATE; INVERT = p5_instance.INVERT; ITALIC = p5_instance.ITALIC; LANDSCAPE = p5_instance.LANDSCAPE; LEFT = p5_instance.LEFT; LEFT_ARROW = p5_instance.LEFT_ARROW; LIGHTEST = p5_instance.LIGHTEST; LINE_LOOP = p5_instance.LINE_LOOP; LINE_STRIP = p5_instance.LINE_STRIP; LINEAR = p5_instance.LINEAR; LINES = p5_instance.LINES; MIRROR = p5_instance.MIRROR; MITER = p5_instance.MITER; MOVE = p5_instance.MOVE; MULTIPLY = p5_instance.MULTIPLY; NEAREST = p5_instance.NEAREST; NORMAL = p5_instance.NORMAL; OPAQUE = p5_instance.OPAQUE; OPEN = p5_instance.OPEN; OPTION = p5_instance.OPTION; OVERLAY = p5_instance.OVERLAY; P2D = p5_instance.P2D; var P3D = p5_instance.WEBGL; PI = p5_instance.PI; PIE = p5_instance.PIE; POINTS = p5_instance.POINTS; PORTRAIT = p5_instance.PORTRAIT; POSTERIZE = p5_instance.POSTERIZE; PROJECT = p5_instance.PROJECT; QUAD_STRIP = p5_instance.QUAD_STRIP; QUADRATIC = p5_instance.QUADRATIC; QUADS = p5_instance.QUADS; QUARTER_PI = p5_instance.QUARTER_PI; RAD_TO_DEG = p5_instance.RAD_TO_DEG; RADIANS = p5_instance.RADIANS; RADIUS = p5_instance.RADIUS; REPEAT = p5_instance.REPEAT; REPLACE = p5_instance.REPLACE; RETURN = p5_instance.RETURN; RGB = p5_instance.RGB; RIGHT = p5_instance.RIGHT; RIGHT_ARROW = p5_instance.RIGHT_ARROW; ROUND = p5_instance.ROUND; SCREEN = p5_instance.SCREEN; SHIFT = p5_instance.SHIFT; SOFT_LIGHT = p5_instance.SOFT_LIGHT; SQUARE = p5_instance.SQUARE; STROKE = p5_instance.STROKE; SUBTRACT = p5_instance.SUBTRACT; TAB = p5_instance.TAB; TAU = p5_instance.TAU; TEXT = p5_instance.TEXT; TEXTURE = p5_instance.TEXTURE; THRESHOLD = p5_instance.THRESHOLD; TOP = p5_instance.TOP; TRIANGLE_FAN = p5_instance.TRIANGLE_FAN; TRIANGLE_STRIP = p5_instance.TRIANGLE_STRIP; TRIANGLES = p5_instance.TRIANGLES; TWO_PI = p5_instance.TWO_PI; UP_ARROW = p5_instance.UP_ARROW; VIDEO = p5_instance.VIDEO; WAIT = p5_instance.WAIT; WEBGL = p5_instance.WEBGL; frameCount = p5_instance.frameCount; focused = p5_instance.focused; displayWidth = p5_instance.displayWidth; displayHeight = p5_instance.displayHeight; windowWidth = p5_instance.windowWidth; windowHeight = p5_instance.windowHeight; width = p5_instance.width; height = p5_instance.height; disableFriendlyErrors = p5_instance.disableFriendlyErrors; deviceOrientation = p5_instance.deviceOrientation; accelerationX = p5_instance.accelerationX; accelerationY = p5_instance.accelerationY; accelerationZ = p5_instance.accelerationZ; pAccelerationX = p5_instance.pAccelerationX; pAccelerationY = p5_instance.pAccelerationY; pAccelerationZ = p5_instance.pAccelerationZ; rotationX = p5_instance.rotationX; rotationY = p5_instance.rotationY; rotationZ = p5_instance.rotationZ; pRotationX = p5_instance.pRotationX; pRotationY = p5_instance.pRotationY; pRotationZ = p5_instance.pRotationZ; turnAxis = p5_instance.turnAxis; keyIsPressed = p5_instance.keyIsPressed; key = p5_instance.key; keyCode = p5_instance.keyCode; mouseX = p5_instance.mouseX; mouseY = p5_instance.mouseY; pmouseX = p5_instance.pmouseX; pmouseY = p5_instance.pmouseY; winMouseX = p5_instance.winMouseX; winMouseY = p5_instance.winMouseY; pwinMouseX = p5_instance.pwinMouseX; pwinMouseY = p5_instance.pwinMouseY; mouseButton = p5_instance.mouseButton; mouseIsPressed = p5_instance.mouseIsPressed; touches = p5_instance.touches; pixels = p5_instance.pixels; return draw_func (); }; export var global_p5_injection = function (p5_sketch) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'p5_sketch': var p5_sketch = __allkwargs0__ [__attrib0__]; break; } } } } else { } var decorator = function (f) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'f': var f = __allkwargs0__ [__attrib0__]; break; } } } } else { } var wrapper = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } } else { } _P5_INSTANCE = p5_sketch; return pre_draw (_P5_INSTANCE, f); }; return wrapper; }; return decorator; }; export var start_p5 = function (preload_func, setup_func, draw_func, event_functions) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'preload_func': var preload_func = __allkwargs0__ [__attrib0__]; break; case 'setup_func': var setup_func = __allkwargs0__ [__attrib0__]; break; case 'draw_func': var draw_func = __allkwargs0__ [__attrib0__]; break; case 'event_functions': var event_functions = __allkwargs0__ [__attrib0__]; break; } } } } else { } var sketch_setup = function (p5_sketch) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'p5_sketch': var p5_sketch = __allkwargs0__ [__attrib0__]; break; } } } } else { } p5_sketch.preload = global_p5_injection (p5_sketch) (preload_func); p5_sketch.setup = global_p5_injection (p5_sketch) (setup_func); p5_sketch.draw = global_p5_injection (p5_sketch) (draw_func); }; var instance = new p5 (sketch_setup, 'sketch-holder'); var event_function_names = tuple (['deviceMoved', 'deviceTurned', 'deviceShaken', 'windowResized', 'keyPressed', 'keyReleased', 'keyTyped', 'mousePressed', 'mouseReleased', 'mouseClicked', 'doubleClicked', 'mouseMoved', 'mouseDragged', 'mouseWheel', 'touchStarted', 'touchMoved', 'touchEnded', 'keyIsDown']); for (var f_name of (function () { var __accu0__ = []; for (var f of event_function_names) { if (event_functions.py_get (f, null)) { __accu0__.append (f); } } return __accu0__; }) ()) { var func = event_functions [f_name]; var event_func = global_p5_injection (instance) (func); setattr (instance, f_name, event_func); } }; export var logOnloaded = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } } else { } console.log ('Lib loaded!'); }; export var add_library = function (lib_name) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'lib_name': var lib_name = __allkwargs0__ [__attrib0__]; break; } } } } else { } var src = ''; return console.log ('Lib name is not valid:', lib_name); console.log ('Importing:', src); var script = document.createElement ('script'); script.onload = logOnloaded; script.src = src; document.head.appendChild (script); }; //# sourceMappingURL=pyp5js.map ================================================ FILE: docs/examples/transcrypt/sketch_007/target/pyp5js.py ================================================ from python_functions import PythonFunctions _P5_INSTANCE = None _CTX_MIDDLE = None _DEFAULT_FILL = None _DEFAULT_LEADMULT = None _DEFAULT_STROKE = None _DEFAULT_TEXT_FILL = None ADD = None ALT = None ARROW = None AUDIO = None AUTO = None AXES = None BACKSPACE = None BASELINE = None BEVEL = None BEZIER = None BLEND = None BLUR = None BOLD = None BOLDITALIC = None BOTTOM = None BURN = None CENTER = None CHORD = None CLAMP = None CLOSE = None CONTROL = None CORNER = None CORNERS = None CROSS = None CURVE = None DARKEST = None DEG_TO_RAD = None DEGREES = None DELETE = None DIFFERENCE = None DILATE = None DODGE = None DOWN_ARROW = None ENTER = None ERODE = None ESCAPE = None EXCLUSION = None FILL = None GRAY = None GRID = None HALF_PI = None HAND = None HARD_LIGHT = None HSB = None HSL = None IMAGE = None IMMEDIATE = None INVERT = None ITALIC = None LANDSCAPE = None LEFT = None LEFT_ARROW = None LIGHTEST = None LINE_LOOP = None LINE_STRIP = None LINEAR = None LINES = None MIRROR = None MITER = None MOVE = None MULTIPLY = None NEAREST = None NORMAL = None OPAQUE = None OPEN = None OPTION = None OVERLAY = None PI = None PIE = None POINTS = None PORTRAIT = None POSTERIZE = None PROJECT = None QUAD_STRIP = None QUADRATIC = None QUADS = None QUARTER_PI = None RAD_TO_DEG = None RADIANS = None RADIUS = None REPEAT = None REPLACE = None RETURN = None RGB = None RIGHT = None RIGHT_ARROW = None ROUND = None SCREEN = None SHIFT = None SOFT_LIGHT = None SQUARE = None STROKE = None SUBTRACT = None TAB = None TAU = None TEXT = None TEXTURE = None THRESHOLD = None TOP = None TRIANGLE_FAN = None TRIANGLE_STRIP = None TRIANGLES = None TWO_PI = None UP_ARROW = None VIDEO = None WAIT = None WEBGL = None P2D = None PI = None frameCount = None focused = None displayWidth = None displayHeight = None windowWidth = None windowHeight = None width = None height = None disableFriendlyErrors = None deviceOrientation = None accelerationX = None accelerationY = None accelerationZ = None pAccelerationX = None pAccelerationY = None pAccelerationZ = None rotationX = None rotationY = None rotationZ = None pRotationX = None pRotationY = None pRotationZ = None turnAxis = None keyIsPressed = None key = None keyCode = None mouseX = None mouseY = None pmouseX = None pmouseY = None winMouseX = None winMouseY = None pwinMouseX = None pwinMouseY = None mouseButton = None mouseIsPressed = None touches = None pixels = None def alpha(*args): return _P5_INSTANCE.alpha(*args) def blue(*args): return _P5_INSTANCE.blue(*args) def brightness(*args): return _P5_INSTANCE.brightness(*args) def color(*args): return _P5_INSTANCE.color(*args) def green(*args): return _P5_INSTANCE.green(*args) def hue(*args): return _P5_INSTANCE.hue(*args) def lerpColor(*args): return _P5_INSTANCE.lerpColor(*args) def lightness(*args): return _P5_INSTANCE.lightness(*args) def red(*args): return _P5_INSTANCE.red(*args) def saturation(*args): return _P5_INSTANCE.saturation(*args) def background(*args): return _P5_INSTANCE.background(*args) def clear(*args): __pragma__('noalias', 'clear') p5_clear = _P5_INSTANCE.clear(*args) __pragma__('alias', 'clear', 'py_clear') return p5_clear def erase(*args): return _P5_INSTANCE.erase(*args) def noErase(*args): return _P5_INSTANCE.noErase(*args) def colorMode(*args): return _P5_INSTANCE.colorMode(*args) def fill(*args): return _P5_INSTANCE.fill(*args) def noFill(*args): return _P5_INSTANCE.noFill(*args) def noStroke(*args): return _P5_INSTANCE.noStroke(*args) def stroke(*args): return _P5_INSTANCE.stroke(*args) def arc(*args): return _P5_INSTANCE.arc(*args) def ellipse(*args): return _P5_INSTANCE.ellipse(*args) def circle(*args): return _P5_INSTANCE.circle(*args) def line(*args): return _P5_INSTANCE.line(*args) def point(*args): return _P5_INSTANCE.point(*args) def quad(*args): return _P5_INSTANCE.quad(*args) def rect(*args): return _P5_INSTANCE.rect(*args) def square(*args): return _P5_INSTANCE.square(*args) def triangle(*args): return _P5_INSTANCE.triangle(*args) def plane(*args): return _P5_INSTANCE.plane(*args) def box(*args): return _P5_INSTANCE.box(*args) def sphere(*args): return _P5_INSTANCE.sphere(*args) def cylinder(*args): return _P5_INSTANCE.cylinder(*args) def cone(*args): return _P5_INSTANCE.cone(*args) def ellipsoid(*args): return _P5_INSTANCE.ellipsoid(*args) def torus(*args): return _P5_INSTANCE.torus(*args) def loadModel(*args): return _P5_INSTANCE.loadModel(*args) def model(*args): return _P5_INSTANCE.model(*args) def ellipseMode(*args): return _P5_INSTANCE.ellipseMode(*args) def noSmooth(*args): return _P5_INSTANCE.noSmooth(*args) def rectMode(*args): return _P5_INSTANCE.rectMode(*args) def smooth(*args): return _P5_INSTANCE.smooth(*args) def strokeCap(*args): return _P5_INSTANCE.strokeCap(*args) def strokeJoin(*args): return _P5_INSTANCE.strokeJoin(*args) def strokeWeight(*args): return _P5_INSTANCE.strokeWeight(*args) def bezier(*args): return _P5_INSTANCE.bezier(*args) def bezierDetail(*args): return _P5_INSTANCE.bezierDetail(*args) def bezierPoint(*args): return _P5_INSTANCE.bezierPoint(*args) def bezierTangent(*args): return _P5_INSTANCE.bezierTangent(*args) def curve(*args): return _P5_INSTANCE.curve(*args) def curveDetail(*args): return _P5_INSTANCE.curveDetail(*args) def curveTightness(*args): return _P5_INSTANCE.curveTightness(*args) def curvePoint(*args): return _P5_INSTANCE.curvePoint(*args) def curveTangent(*args): return _P5_INSTANCE.curveTangent(*args) def beginContour(*args): return _P5_INSTANCE.beginContour(*args) def beginShape(*args): return _P5_INSTANCE.beginShape(*args) def bezierVertex(*args): return _P5_INSTANCE.bezierVertex(*args) def curveVertex(*args): return _P5_INSTANCE.curveVertex(*args) def endContour(*args): return _P5_INSTANCE.endContour(*args) def endShape(*args): return _P5_INSTANCE.endShape(*args) def quadraticVertex(*args): return _P5_INSTANCE.quadraticVertex(*args) def vertex(*args): return _P5_INSTANCE.vertex(*args) def cursor(*args): return _P5_INSTANCE.cursor(*args) def frameRate(*args): return _P5_INSTANCE.frameRate(*args) def noCursor(*args): return _P5_INSTANCE.noCursor(*args) def fullscreen(*args): return _P5_INSTANCE.fullscreen(*args) def pixelDensity(*args): return _P5_INSTANCE.pixelDensity(*args) def displayDensity(*args): return _P5_INSTANCE.displayDensity(*args) def getURL(*args): return _P5_INSTANCE.getURL(*args) def getURLPath(*args): return _P5_INSTANCE.getURLPath(*args) def getURLParams(*args): return _P5_INSTANCE.getURLParams(*args) def preload(*args): return _P5_INSTANCE.preload(*args) def setup(*args): return _P5_INSTANCE.setup(*args) def draw(*args): return _P5_INSTANCE.draw(*args) def remove(*args): return _P5_INSTANCE.remove(*args) def noLoop(*args): return _P5_INSTANCE.noLoop(*args) def loop(*args): return _P5_INSTANCE.loop(*args) def push(*args): return _P5_INSTANCE.push(*args) def redraw(*args): return _P5_INSTANCE.redraw(*args) def resizeCanvas(*args): return _P5_INSTANCE.resizeCanvas(*args) def noCanvas(*args): return _P5_INSTANCE.noCanvas(*args) def createGraphics(*args): return _P5_INSTANCE.createGraphics(*args) def blendMode(*args): return _P5_INSTANCE.blendMode(*args) def setAttributes(*args): return _P5_INSTANCE.setAttributes(*args) def applyMatrix(*args): return _P5_INSTANCE.applyMatrix(*args) def resetMatrix(*args): return _P5_INSTANCE.resetMatrix(*args) def rotate(*args): return _P5_INSTANCE.rotate(*args) def rotateX(*args): return _P5_INSTANCE.rotateX(*args) def rotateY(*args): return _P5_INSTANCE.rotateY(*args) def rotateZ(*args): return _P5_INSTANCE.rotateZ(*args) def scale(*args): return _P5_INSTANCE.scale(*args) def shearX(*args): return _P5_INSTANCE.shearX(*args) def shearY(*args): return _P5_INSTANCE.shearY(*args) def translate(*args): return _P5_INSTANCE.translate(*args) def createStringDict(*args): return _P5_INSTANCE.createStringDict(*args) def createNumberDict(*args): return _P5_INSTANCE.createNumberDict(*args) def append(*args): return _P5_INSTANCE.append(*args) def arrayCopy(*args): return _P5_INSTANCE.arrayCopy(*args) def concat(*args): return _P5_INSTANCE.concat(*args) def reverse(*args): return _P5_INSTANCE.reverse(*args) def shorten(*args): return _P5_INSTANCE.shorten(*args) def shuffle(*args): return _P5_INSTANCE.shuffle(*args) def sort(*args): return _P5_INSTANCE.sort(*args) def splice(*args): return _P5_INSTANCE.splice(*args) def subset(*args): return _P5_INSTANCE.subset(*args) def float(*args): return _P5_INSTANCE.float(*args) def int(*args): return _P5_INSTANCE.int(*args) def str(*args): return _P5_INSTANCE.str(*args) def boolean(*args): return _P5_INSTANCE.boolean(*args) def byte(*args): return _P5_INSTANCE.byte(*args) def char(*args): return _P5_INSTANCE.char(*args) def unchar(*args): return _P5_INSTANCE.unchar(*args) def hex(*args): return _P5_INSTANCE.hex(*args) def unhex(*args): return _P5_INSTANCE.unhex(*args) def join(*args): return _P5_INSTANCE.join(*args) def match(*args): return _P5_INSTANCE.match(*args) def matchAll(*args): return _P5_INSTANCE.matchAll(*args) def nf(*args): return _P5_INSTANCE.nf(*args) def nfc(*args): return _P5_INSTANCE.nfc(*args) def nfp(*args): return _P5_INSTANCE.nfp(*args) def nfs(*args): return _P5_INSTANCE.nfs(*args) def split(*args): return _P5_INSTANCE.split(*args) def splitTokens(*args): return _P5_INSTANCE.splitTokens(*args) def trim(*args): return _P5_INSTANCE.trim(*args) def setMoveThreshold(*args): return _P5_INSTANCE.setMoveThreshold(*args) def setShakeThreshold(*args): return _P5_INSTANCE.setShakeThreshold(*args) def keyIsDown(*args): return _P5_INSTANCE.keyIsDown(*args) def createImage(*args): return _P5_INSTANCE.createImage(*args) def saveCanvas(*args): return _P5_INSTANCE.saveCanvas(*args) def saveFrames(*args): return _P5_INSTANCE.saveFrames(*args) def image_proxy(img): """ Proxy to turn of transcypt when calling img.get/set methods """ def _set(*args): __pragma__('noalias', 'set') value = img.set(*args) __pragma__('alias', 'set', 'py_set') return value def _get(*args): __pragma__('noalias', 'get') value = img.get(*args) __pragma__('alias', 'get', 'py_get') return value img.set = _set img.get = _get return img def loadImage(*args): imageObj = _P5_INSTANCE.loadImage(*args) return image_proxy(imageObj) def image(*args): return _P5_INSTANCE.image(*args) def tint(*args): return _P5_INSTANCE.tint(*args) def noTint(*args): return _P5_INSTANCE.noTint(*args) def imageMode(*args): return _P5_INSTANCE.imageMode(*args) def blend(*args): return _P5_INSTANCE.blend(*args) def copy(*args): return _P5_INSTANCE.copy(*args) def filter(*args): if len(args) > 1 and (args[0] is None or callable(args[0])): return PythonFunctions.filter(*args) else: return _P5_INSTANCE.filter(*args) def get(*args): __pragma__('noalias', 'get') p5_get = _P5_INSTANCE.get(*args) __pragma__('alias', 'get', 'py_get') return p5_get def loadPixels(*args): return _P5_INSTANCE.loadPixels(*args) def set(*args): if len(args) <= 1: return PythonFunctions.set(*args) else: return _P5_INSTANCE.set(*args) def updatePixels(*args): return _P5_INSTANCE.updatePixels(*args) def loadJSON(*args): return _P5_INSTANCE.loadJSON(*args) def loadStrings(*args): return _P5_INSTANCE.loadStrings(*args) def loadTable(*args): return _P5_INSTANCE.loadTable(*args) def loadXML(*args): return _P5_INSTANCE.loadXML(*args) def loadBytes(*args): return _P5_INSTANCE.loadBytes(*args) def httpGet(*args): return _P5_INSTANCE.httpGet(*args) def httpPost(*args): return _P5_INSTANCE.httpPost(*args) def httpDo(*args): return _P5_INSTANCE.httpDo(*args) def createWriter(*args): return _P5_INSTANCE.createWriter(*args) def save(*args): return _P5_INSTANCE.save(*args) def saveJSON(*args): return _P5_INSTANCE.saveJSON(*args) def saveStrings(*args): return _P5_INSTANCE.saveStrings(*args) def saveTable(*args): return _P5_INSTANCE.saveTable(*args) def day(*args): return _P5_INSTANCE.day(*args) def hour(*args): return _P5_INSTANCE.hour(*args) def minute(*args): return _P5_INSTANCE.minute(*args) def millis(*args): return _P5_INSTANCE.millis(*args) def month(*args): return _P5_INSTANCE.month(*args) def second(*args): return _P5_INSTANCE.second(*args) def year(*args): return _P5_INSTANCE.year(*args) def createVector(*args): return _P5_INSTANCE.createVector(*args) def abs(*args): return _P5_INSTANCE.abs(*args) def ceil(*args): return _P5_INSTANCE.ceil(*args) def constrain(*args): return _P5_INSTANCE.constrain(*args) def dist(*args): return _P5_INSTANCE.dist(*args) def exp(*args): return _P5_INSTANCE.exp(*args) def floor(*args): return _P5_INSTANCE.floor(*args) def lerp(*args): return _P5_INSTANCE.lerp(*args) def log(*args): return _P5_INSTANCE.log(*args) def mag(*args): return _P5_INSTANCE.mag(*args) def map(*args): if len(args) > 1 and callable(args[0]): return PythonFunctions.map(*args) else: return _P5_INSTANCE.map(*args) def max(*args): return _P5_INSTANCE.max(*args) def min(*args): return _P5_INSTANCE.min(*args) def norm(*args): return _P5_INSTANCE.norm(*args) def pow(*args): return _P5_INSTANCE.pow(*args) def round(*args): return _P5_INSTANCE.round(*args) def sq(*args): return _P5_INSTANCE.sq(*args) def sqrt(*args): return _P5_INSTANCE.sqrt(*args) def noise(*args): return _P5_INSTANCE.noise(*args) def noiseDetail(*args): return _P5_INSTANCE.noiseDetail(*args) def noiseSeed(*args): return _P5_INSTANCE.noiseSeed(*args) def randomSeed(*args): return _P5_INSTANCE.randomSeed(*args) def random(*args): return _P5_INSTANCE.random(*args) def randomGaussian(*args): return _P5_INSTANCE.randomGaussian(*args) def acos(*args): return _P5_INSTANCE.acos(*args) def asin(*args): return _P5_INSTANCE.asin(*args) def atan(*args): return _P5_INSTANCE.atan(*args) def atan2(*args): return _P5_INSTANCE.atan2(*args) def cos(*args): return _P5_INSTANCE.cos(*args) def sin(*args): return _P5_INSTANCE.sin(*args) def tan(*args): return _P5_INSTANCE.tan(*args) def degrees(*args): return _P5_INSTANCE.degrees(*args) def radians(*args): return _P5_INSTANCE.radians(*args) def angleMode(*args): return _P5_INSTANCE.angleMode(*args) def textAlign(*args): return _P5_INSTANCE.textAlign(*args) def textLeading(*args): return _P5_INSTANCE.textLeading(*args) def textSize(*args): return _P5_INSTANCE.textSize(*args) def textStyle(*args): return _P5_INSTANCE.textStyle(*args) def textWidth(*args): return _P5_INSTANCE.textWidth(*args) def textAscent(*args): return _P5_INSTANCE.textAscent(*args) def textDescent(*args): return _P5_INSTANCE.textDescent(*args) def loadFont(*args): return _P5_INSTANCE.loadFont(*args) def text(*args): return _P5_INSTANCE.text(*args) def textFont(*args): return _P5_INSTANCE.textFont(*args) def orbitControl(*args): return _P5_INSTANCE.orbitControl(*args) def debugMode(*args): return _P5_INSTANCE.debugMode(*args) def noDebugMode(*args): return _P5_INSTANCE.noDebugMode(*args) def ambientLight(*args): return _P5_INSTANCE.ambientLight(*args) def directionalLight(*args): return _P5_INSTANCE.directionalLight(*args) def pointLight(*args): return _P5_INSTANCE.pointLight(*args) def lights(*args): return _P5_INSTANCE.lights(*args) def loadShader(*args): return _P5_INSTANCE.loadShader(*args) def createShader(*args): return _P5_INSTANCE.createShader(*args) def shader(*args): return _P5_INSTANCE.shader(*args) def resetShader(*args): return _P5_INSTANCE.resetShader(*args) def normalMaterial(*args): return _P5_INSTANCE.normalMaterial(*args) def texture(*args): return _P5_INSTANCE.texture(*args) def textureMode(*args): return _P5_INSTANCE.textureMode(*args) def textureWrap(*args): return _P5_INSTANCE.textureWrap(*args) def ambientMaterial(*args): return _P5_INSTANCE.ambientMaterial(*args) def specularMaterial(*args): return _P5_INSTANCE.specularMaterial(*args) def shininess(*args): return _P5_INSTANCE.shininess(*args) def camera(*args): return _P5_INSTANCE.camera(*args) def perspective(*args): return _P5_INSTANCE.perspective(*args) def ortho(*args): return _P5_INSTANCE.ortho(*args) def createCamera(*args): return _P5_INSTANCE.createCamera(*args) def setCamera(*args): return _P5_INSTANCE.setCamera(*args) def select(*args): return _P5_INSTANCE.select(*args) def selectAll(*args): return _P5_INSTANCE.selectAll(*args) def removeElements(*args): return _P5_INSTANCE.removeElements(*args) def changed(*args): return _P5_INSTANCE.changed(*args) def input(*args): return _P5_INSTANCE.input(*args) def createDiv(*args): return _P5_INSTANCE.createDiv(*args) def createP(*args): return _P5_INSTANCE.createP(*args) def createSpan(*args): return _P5_INSTANCE.createSpan(*args) def createImg(*args): return _P5_INSTANCE.createImg(*args) def createA(*args): return _P5_INSTANCE.createA(*args) def createSlider(*args): return _P5_INSTANCE.createSlider(*args) def createButton(*args): return _P5_INSTANCE.createButton(*args) def createCheckbox(*args): return _P5_INSTANCE.createCheckbox(*args) def createSelect(*args): return _P5_INSTANCE.createSelect(*args) def createRadio(*args): return _P5_INSTANCE.createRadio(*args) def createColorPicker(*args): return _P5_INSTANCE.createColorPicker(*args) def createInput(*args): return _P5_INSTANCE.createInput(*args) def createFileInput(*args): return _P5_INSTANCE.createFileInput(*args) def createVideo(*args): return _P5_INSTANCE.createVideo(*args) def createAudio(*args): return _P5_INSTANCE.createAudio(*args) def createCapture(*args): return _P5_INSTANCE.createCapture(*args) def createElement(*args): return _P5_INSTANCE.createElement(*args) def createCanvas(*args): canvas = _P5_INSTANCE.createCanvas(*args) global width, height width = _P5_INSTANCE.width height = _P5_INSTANCE.height return canvas def pop(*args): __pragma__('noalias', 'pop') p5_pop = _P5_INSTANCE.pop(*args) __pragma__('alias', 'pop', 'py_pop') return p5_pop # Processing Python or Java mode compatibility aliases size = createCanvas popMatrix = pop popStyle = pop pushMatrix = push pushStyle = push # PVector is a helper/alias to create p5.Vector objects def PVector(x=0, y=0, z=0): return _P5_INSTANCE.createVector(x, y, z) # aliases for p5.Vector class methods setattr(PVector, 'dist', p5.Vector.dist) setattr(PVector, 'add', p5.Vector.add) setattr(PVector, 'sub', p5.Vector.sub) setattr(PVector, 'mult', p5.Vector.mult) setattr(PVector, 'div', p5.Vector.div) setattr(PVector, 'dot', p5.Vector.dot) setattr(PVector, 'cross', p5.Vector.cross) setattr(PVector, 'lerp', p5.Vector.lerp) setattr(PVector, 'random2D', p5.Vector.random2D) setattr(PVector, 'random3D', p5.Vector.random3D) setattr(PVector, 'angleBetween', p5.Vector.angleBetween) setattr(PVector, 'fromAngle', p5.Vector.fromAngle) setattr(PVector, 'fromAngles', p5.Vector.fromAngles) setattr(PVector, 'equals', p5.Vector.equals) def pre_draw(p5_instance, draw_func): """ We need to run this before the actual draw to insert and update p5 env variables """ global _CTX_MIDDLE, _DEFAULT_FILL, _DEFAULT_LEADMULT, _DEFAULT_STROKE, _DEFAULT_TEXT_FILL global ADD, ALT, ARROW, AUTO, AUDIO, AXES, BACKSPACE, BASELINE, BEVEL, BEZIER, BLEND, BLUR, BOLD, BOLDITALIC global BOTTOM, BURN, CENTER, CHORD, CLAMP, CLOSE, CONTROL, CORNER, CORNERS, CROSS, CURVE, DARKEST global DEG_TO_RAD, DEGREES, DELETE, DIFFERENCE, DILATE, DODGE, DOWN_ARROW, ENTER, ERODE, ESCAPE, EXCLUSION global FILL, GRAY, GRID, HALF_PI, HAND, HARD_LIGHT, HSB, HSL, IMAGE, IMMEDIATE, INVERT, ITALIC, LANDSCAPE global LEFT, LEFT_ARROW, LIGHTEST, LINE_LOOP, LINE_STRIP, LINEAR, LINES, MIRROR, MITER, MOVE, MULTIPLY, NEAREST global NORMAL, OPAQUE, OPEN, OPTION, OVERLAY, P2D, PI, PIE, POINTS, PORTRAIT, POSTERIZE, PROJECT, QUAD_STRIP, QUADRATIC global QUADS, QUARTER_PI, RAD_TO_DEG, RADIANS, RADIUS, REPEAT, REPLACE, RETURN, RGB, RIGHT, RIGHT_ARROW global ROUND, SCREEN, SHIFT, SOFT_LIGHT, SQUARE, STROKE, SUBTRACT, TAB, TAU, TEXT, TEXTURE, THRESHOLD, TOP global TRIANGLE_FAN, TRIANGLE_STRIP, TRIANGLES, TWO_PI, UP_ARROW, VIDEO, WAIT, WEBGL global frameCount, focused, displayWidth, displayHeight, windowWidth, windowHeight, width, height global disableFriendlyErrors, deviceOrientation, accelerationX, accelerationY, accelerationZ global pAccelerationX, pAccelerationY, pAccelerationZ, rotationX, rotationY, rotationZ global pRotationX, pRotationY, pRotationZ, turnAxis, keyIsPressed, key, keyCode, mouseX, mouseY, pmouseX, pmouseY global winMouseX, winMouseY, pwinMouseX, pwinMouseY, mouseButton, mouseIsPressed, touches, pixels _CTX_MIDDLE = p5_instance._CTX_MIDDLE _DEFAULT_FILL = p5_instance._DEFAULT_FILL _DEFAULT_LEADMULT = p5_instance._DEFAULT_LEADMULT _DEFAULT_STROKE = p5_instance._DEFAULT_STROKE _DEFAULT_TEXT_FILL = p5_instance._DEFAULT_TEXT_FILL ADD = p5_instance.ADD ALT = p5_instance.ALT ARROW = p5_instance.ARROW AUDIO = p5_instance.AUDIO AUTO = p5_instance.AUTO AXES = p5_instance.AXES BACKSPACE = p5_instance.BACKSPACE BASELINE = p5_instance.BASELINE BEVEL = p5_instance.BEVEL BEZIER = p5_instance.BEZIER BLEND = p5_instance.BLEND BLUR = p5_instance.BLUR BOLD = p5_instance.BOLD BOLDITALIC = p5_instance.BOLDITALIC BOTTOM = p5_instance.BOTTOM BURN = p5_instance.BURN CENTER = p5_instance.CENTER CHORD = p5_instance.CHORD CLAMP = p5_instance.CLAMP CLOSE = p5_instance.CLOSE CONTROL = p5_instance.CONTROL CORNER = p5_instance.CORNER CORNERS = p5_instance.CORNERS CROSS = p5_instance.CROSS CURVE = p5_instance.CURVE DARKEST = p5_instance.DARKEST DEG_TO_RAD = p5_instance.DEG_TO_RAD DEGREES = p5_instance.DEGREES DELETE = p5_instance.DELETE DIFFERENCE = p5_instance.DIFFERENCE DILATE = p5_instance.DILATE DODGE = p5_instance.DODGE DOWN_ARROW = p5_instance.DOWN_ARROW ENTER = p5_instance.ENTER ERODE = p5_instance.ERODE ESCAPE = p5_instance.ESCAPE EXCLUSION = p5_instance.EXCLUSION FILL = p5_instance.FILL GRAY = p5_instance.GRAY GRID = p5_instance.GRID HALF_PI = p5_instance.HALF_PI HAND = p5_instance.HAND HARD_LIGHT = p5_instance.HARD_LIGHT HSB = p5_instance.HSB HSL = p5_instance.HSL IMAGE = p5_instance.IMAGE IMMEDIATE = p5_instance.IMMEDIATE INVERT = p5_instance.INVERT ITALIC = p5_instance.ITALIC LANDSCAPE = p5_instance.LANDSCAPE LEFT = p5_instance.LEFT LEFT_ARROW = p5_instance.LEFT_ARROW LIGHTEST = p5_instance.LIGHTEST LINE_LOOP = p5_instance.LINE_LOOP LINE_STRIP = p5_instance.LINE_STRIP LINEAR = p5_instance.LINEAR LINES = p5_instance.LINES MIRROR = p5_instance.MIRROR MITER = p5_instance.MITER MOVE = p5_instance.MOVE MULTIPLY = p5_instance.MULTIPLY NEAREST = p5_instance.NEAREST NORMAL = p5_instance.NORMAL OPAQUE = p5_instance.OPAQUE OPEN = p5_instance.OPEN OPTION = p5_instance.OPTION OVERLAY = p5_instance.OVERLAY P2D = p5_instance.P2D P3D = p5_instance.WEBGL PI = p5_instance.PI PIE = p5_instance.PIE POINTS = p5_instance.POINTS PORTRAIT = p5_instance.PORTRAIT POSTERIZE = p5_instance.POSTERIZE PROJECT = p5_instance.PROJECT QUAD_STRIP = p5_instance.QUAD_STRIP QUADRATIC = p5_instance.QUADRATIC QUADS = p5_instance.QUADS QUARTER_PI = p5_instance.QUARTER_PI RAD_TO_DEG = p5_instance.RAD_TO_DEG RADIANS = p5_instance.RADIANS RADIUS = p5_instance.RADIUS REPEAT = p5_instance.REPEAT REPLACE = p5_instance.REPLACE RETURN = p5_instance.RETURN RGB = p5_instance.RGB RIGHT = p5_instance.RIGHT RIGHT_ARROW = p5_instance.RIGHT_ARROW ROUND = p5_instance.ROUND SCREEN = p5_instance.SCREEN SHIFT = p5_instance.SHIFT SOFT_LIGHT = p5_instance.SOFT_LIGHT SQUARE = p5_instance.SQUARE STROKE = p5_instance.STROKE SUBTRACT = p5_instance.SUBTRACT TAB = p5_instance.TAB TAU = p5_instance.TAU TEXT = p5_instance.TEXT TEXTURE = p5_instance.TEXTURE THRESHOLD = p5_instance.THRESHOLD TOP = p5_instance.TOP TRIANGLE_FAN = p5_instance.TRIANGLE_FAN TRIANGLE_STRIP = p5_instance.TRIANGLE_STRIP TRIANGLES = p5_instance.TRIANGLES TWO_PI = p5_instance.TWO_PI UP_ARROW = p5_instance.UP_ARROW VIDEO = p5_instance.VIDEO WAIT = p5_instance.WAIT WEBGL = p5_instance.WEBGL frameCount = p5_instance.frameCount focused = p5_instance.focused displayWidth = p5_instance.displayWidth displayHeight = p5_instance.displayHeight windowWidth = p5_instance.windowWidth windowHeight = p5_instance.windowHeight width = p5_instance.width height = p5_instance.height disableFriendlyErrors = p5_instance.disableFriendlyErrors deviceOrientation = p5_instance.deviceOrientation accelerationX = p5_instance.accelerationX accelerationY = p5_instance.accelerationY accelerationZ = p5_instance.accelerationZ pAccelerationX = p5_instance.pAccelerationX pAccelerationY = p5_instance.pAccelerationY pAccelerationZ = p5_instance.pAccelerationZ rotationX = p5_instance.rotationX rotationY = p5_instance.rotationY rotationZ = p5_instance.rotationZ pRotationX = p5_instance.pRotationX pRotationY = p5_instance.pRotationY pRotationZ = p5_instance.pRotationZ turnAxis = p5_instance.turnAxis keyIsPressed = p5_instance.keyIsPressed key = p5_instance.key keyCode = p5_instance.keyCode mouseX = p5_instance.mouseX mouseY = p5_instance.mouseY pmouseX = p5_instance.pmouseX pmouseY = p5_instance.pmouseY winMouseX = p5_instance.winMouseX winMouseY = p5_instance.winMouseY pwinMouseX = p5_instance.pwinMouseX pwinMouseY = p5_instance.pwinMouseY mouseButton = p5_instance.mouseButton mouseIsPressed = p5_instance.mouseIsPressed touches = p5_instance.touches pixels = p5_instance.pixels return draw_func() def global_p5_injection(p5_sketch): """ Injects the p5js's skecth instance as a global variable to setup and draw functions """ def decorator(f): def wrapper(): global _P5_INSTANCE _P5_INSTANCE = p5_sketch return pre_draw(_P5_INSTANCE, f) return wrapper return decorator def start_p5(preload_func, setup_func, draw_func, event_functions): """ This is the entrypoint function. It accepts 2 parameters: - preload_func: a Python preload callable - setup_func: a Python setup callable - draw_func: a Python draw callable - event_functions: a config dict for the event functions in the format: {"eventFunctionName": python_event_function} This method gets the p5js's sketch instance and injects them """ def sketch_setup(p5_sketch): p5_sketch.preload = global_p5_injection(p5_sketch)(preload_func) p5_sketch.setup = global_p5_injection(p5_sketch)(setup_func) p5_sketch.draw = global_p5_injection(p5_sketch)(draw_func) instance = __new__(p5(sketch_setup, 'sketch-holder')) # inject event functions into p5 event_function_names = ( "deviceMoved", "deviceTurned", "deviceShaken", "windowResized", "keyPressed", "keyReleased", "keyTyped", "mousePressed", "mouseReleased", "mouseClicked", "doubleClicked", "mouseMoved", "mouseDragged", "mouseWheel", "touchStarted", "touchMoved", "touchEnded", "keyIsDown" ) for f_name in [f for f in event_function_names if event_functions.get(f, None)]: func = event_functions[f_name] event_func = global_p5_injection(instance)(func) setattr(instance, f_name, event_func) def logOnloaded(): console.log("Lib loaded!") def add_library(lib_name): # placeholder for https://github.com/berinhard/pyp5js/issues/31 src = '' return console.log("Lib name is not valid:", lib_name) console.log("Importing:", src) script = document.createElement("script") script.onload = logOnloaded script.src = src document.head.appendChild(script) ================================================ FILE: docs/examples/transcrypt/sketch_007/target/python_functions.js ================================================ // Transcrypt'ed from Python, 2021-11-02 13:06:16 import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, abs, all, any, assert, bool, bytearray, bytes, callable, chr, copy, deepcopy, delattr, dict, dir, divmod, enumerate, filter, float, getattr, hasattr, input, int, isinstance, issubclass, len, list, map, max, min, object, ord, pow, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, round, set, setattr, sorted, str, sum, tuple, zip} from './org.transcrypt.__runtime__.js'; var __name__ = 'python_functions'; export var PythonFunctions = __class__ ('PythonFunctions', [object], { __module__: __name__, }); setattr (PythonFunctions, 'map', map); setattr (PythonFunctions, 'filter', filter); setattr (PythonFunctions, 'set', set); //# sourceMappingURL=python_functions.map ================================================ FILE: docs/examples/transcrypt/sketch_007/target/python_functions.py ================================================ class PythonFunctions: pass setattr(PythonFunctions, 'map', map) setattr(PythonFunctions, 'filter', filter) setattr(PythonFunctions, 'set', set) ================================================ FILE: docs/examples/transcrypt/sketch_007/target/target_sketch.js ================================================ // Transcrypt'ed from Python, 2021-11-02 13:06:15 import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, all, any, assert, bool, bytearray, bytes, callable, chr, deepcopy, delattr, dict, dir, divmod, enumerate, getattr, hasattr, isinstance, issubclass, len, list, object, ord, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, set, setattr, sorted, sum, tuple, zip} from './org.transcrypt.__runtime__.js'; import {ADD, ALT, ARROW, AUDIO, AUTO, AXES, BACKSPACE, BASELINE, BEVEL, BEZIER, BLEND, BLUR, BOLD, BOLDITALIC, BOTTOM, BURN, CENTER, CHORD, CLAMP, CLOSE, CONTROL, CORNER, CORNERS, CROSS, CURVE, DARKEST, DEGREES, DEG_TO_RAD, DELETE, DIFFERENCE, DILATE, DODGE, DOWN_ARROW, ENTER, ERODE, ESCAPE, EXCLUSION, FILL, GRAY, GRID, HALF_PI, HAND, HARD_LIGHT, HSB, HSL, IMAGE, IMMEDIATE, INVERT, ITALIC, LANDSCAPE, LEFT, LEFT_ARROW, LIGHTEST, LINEAR, LINES, LINE_LOOP, LINE_STRIP, MIRROR, MITER, MOVE, MULTIPLY, NEAREST, NORMAL, OPAQUE, OPEN, OPTION, OVERLAY, P2D, PI, PIE, POINTS, PORTRAIT, POSTERIZE, PROJECT, PVector, QUADRATIC, QUADS, QUAD_STRIP, QUARTER_PI, RADIANS, RADIUS, RAD_TO_DEG, REPEAT, REPLACE, RETURN, RGB, RIGHT, RIGHT_ARROW, ROUND, SCREEN, SHIFT, SOFT_LIGHT, SQUARE, STROKE, SUBTRACT, TAB, TAU, TEXT, TEXTURE, THRESHOLD, TOP, TRIANGLES, TRIANGLE_FAN, TRIANGLE_STRIP, TWO_PI, UP_ARROW, VIDEO, WAIT, WEBGL, _CTX_MIDDLE, _DEFAULT_FILL, _DEFAULT_LEADMULT, _DEFAULT_STROKE, _DEFAULT_TEXT_FILL, _P5_INSTANCE, abs, accelerationX, accelerationY, accelerationZ, acos, add_library, alpha, ambientLight, ambientMaterial, angleMode, append, applyMatrix, arc, arrayCopy, asin, atan, atan2, background, beginContour, beginShape, bezier, bezierDetail, bezierPoint, bezierTangent, bezierVertex, blend, blendMode, blue, boolean, box, brightness, byte, camera, ceil, changed, char, circle, color, colorMode, concat, cone, constrain, copy, cos, createA, createAudio, createButton, createCamera, createCanvas, createCapture, createCheckbox, createColorPicker, createDiv, createElement, createFileInput, createGraphics, createImage, createImg, createInput, createNumberDict, createP, createRadio, createSelect, createShader, createSlider, createSpan, createStringDict, createVector, createVideo, createWriter, cursor, curve, curveDetail, curvePoint, curveTangent, curveTightness, curveVertex, cylinder, day, debugMode, degrees, deviceOrientation, directionalLight, disableFriendlyErrors, displayDensity, displayHeight, displayWidth, dist, ellipse, ellipseMode, ellipsoid, endContour, endShape, erase, exp, fill, filter, float, floor, focused, frameCount, frameRate, fullscreen, getURL, getURLParams, getURLPath, global_p5_injection, green, height, hex, hour, httpDo, httpGet, httpPost, hue, image, imageMode, image_proxy, input, int, join, key, keyCode, keyIsPressed, lerp, lerpColor, lightness, lights, line, loadBytes, loadFont, loadImage, loadJSON, loadModel, loadPixels, loadShader, loadStrings, loadTable, loadXML, log, logOnloaded, loop, mag, map, match, matchAll, max, millis, min, minute, model, month, mouseButton, mouseIsPressed, mouseX, mouseY, nf, nfc, nfp, nfs, noCanvas, noCursor, noDebugMode, noErase, noFill, noLoop, noSmooth, noStroke, noTint, noise, noiseDetail, noiseSeed, norm, normalMaterial, orbitControl, ortho, pAccelerationX, pAccelerationY, pAccelerationZ, pRotationX, pRotationY, pRotationZ, perspective, pixelDensity, pixels, plane, pmouseX, pmouseY, point, pointLight, popMatrix, popStyle, pow, pre_draw, push, pushMatrix, pushStyle, pwinMouseX, pwinMouseY, py_clear, py_get, py_pop, py_set, py_sort, py_split, quad, quadraticVertex, radians, random, randomGaussian, randomSeed, rect, rectMode, red, redraw, remove, removeElements, resetMatrix, resetShader, resizeCanvas, reverse, rotate, rotateX, rotateY, rotateZ, rotationX, rotationY, rotationZ, round, saturation, save, saveCanvas, saveFrames, saveJSON, saveStrings, saveTable, scale, second, select, selectAll, setAttributes, setCamera, setMoveThreshold, setShakeThreshold, shader, shearX, shearY, shininess, shorten, shuffle, sin, size, smooth, specularMaterial, sphere, splice, splitTokens, sq, sqrt, square, start_p5, str, stroke, strokeCap, strokeJoin, strokeWeight, subset, tan, text, textAlign, textAscent, textDescent, textFont, textLeading, textSize, textStyle, textWidth, texture, textureMode, textureWrap, tint, torus, touches, translate, triangle, trim, turnAxis, unchar, unhex, updatePixels, vertex, width, winMouseX, winMouseY, windowHeight, windowWidth, year} from './pyp5js.js'; var __name__ = '__main__'; export var preload = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } } else { } // pass; }; export var setup = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } } else { } // pass; }; export var draw = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } } else { } // pass; }; export var deviceMoved = null; export var deviceTurned = null; export var deviceShaken = null; export var keyPressed = null; export var keyReleased = null; export var keyTyped = null; export var mouseMoved = null; export var mouseDragged = null; export var mousePressed = null; export var mouseReleased = null; export var mouseClicked = null; export var doubleClicked = null; export var mouseWheel = null; export var touchStarted = null; export var touchMoved = null; export var touchEnded = null; export var windowResized = null; export var keyIsDown = null; var setup = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } } else { } createCanvas (900, 900); stroke (27, 27, 27, 10); strokeWeight (2); }; var draw = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } } else { } push (); translate (width / 2, height / 2); var v = p5.Vector.random2D (); v.normalize (); v.mult (random (100, 400)); line (0, 0, v.x, v.y); py_pop (); }; export var event_functions = dict ({'deviceMoved': deviceMoved, 'deviceTurned': deviceTurned, 'deviceShaken': deviceShaken, 'keyPressed': keyPressed, 'keyReleased': keyReleased, 'keyTyped': keyTyped, 'mouseMoved': mouseMoved, 'mouseDragged': mouseDragged, 'mousePressed': mousePressed, 'mouseReleased': mouseReleased, 'mouseClicked': mouseClicked, 'doubleClicked': doubleClicked, 'mouseWheel': mouseWheel, 'touchStarted': touchStarted, 'touchMoved': touchMoved, 'touchEnded': touchEnded, 'windowResized': windowResized, 'keyIsDown': keyIsDown}); start_p5 (preload, setup, draw, event_functions); //# sourceMappingURL=target_sketch.map ================================================ FILE: docs/examples/transcrypt/sketch_007/target/target_sketch.project ================================================ {"options": {"source": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_007/target_sketch.py", "anno": false, "alimod": false, "build": true, "complex": false, "docat": false, "dassert": false, "dcheck": false, "dextex": false, "dlog": false, "dmap": false, "dnostrip": false, "dstat": false, "dtree": false, "esv": null, "ecom": false, "fcall": false, "gen": false, "iconv": false, "jscall": false, "jskeys": false, "jsmod": false, "kwargs": true, "keycheck": false, "license": false, "map": true, "nomin": true, "opov": false, "outdir": null, "parent": null, "run": false, "symbols": null, "sform": false, "tconv": false, "unit": null, "verbose": false, "x": null, "xreex": false, "xglobs": false, "xpath": "/home/bernardo/envs/pyp5js/pyp5js/templates/transcrypt", "xtiny": false, "star": false}, "modules": [{"source": "/home/bernardo/.pyenv/versions/pyp5js/lib/python3.8/site-packages/transcrypt/modules/org/transcrypt/__runtime__.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_007/__target__/org.transcrypt.__runtime__.js"}, {"source": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_007/target_sketch.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_007/__target__/target_sketch.js"}, {"source": "/home/bernardo/envs/pyp5js/pyp5js/templates/transcrypt/pyp5js.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_007/__target__/pyp5js.js"}, {"source": "/home/bernardo/envs/pyp5js/pyp5js/templates/transcrypt/python_functions.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_007/__target__/python_functions.js"}]} ================================================ FILE: docs/examples/transcrypt/sketch_007/target/target_sketch.py ================================================ from pyp5js import * def preload(): pass def setup(): pass def draw(): pass deviceMoved = None deviceTurned = None deviceShaken = None keyPressed = None keyReleased = None keyTyped = None mouseMoved = None mouseDragged = None mousePressed = None mouseReleased = None mouseClicked = None doubleClicked = None mouseWheel = None touchStarted = None touchMoved = None touchEnded = None windowResized = None keyIsDown = None def setup(): createCanvas(900, 900) stroke(27, 27, 27, 10) strokeWeight(2) def draw(): push() translate(width / 2, height / 2) v = p5.Vector.random2D() v.normalize() v.mult(random(100, 400)) line(0, 0, v.x, v.y) pop() event_functions = { "deviceMoved": deviceMoved, "deviceTurned": deviceTurned, "deviceShaken": deviceShaken, "keyPressed": keyPressed, "keyReleased": keyReleased, "keyTyped": keyTyped, "mouseMoved": mouseMoved, "mouseDragged": mouseDragged, "mousePressed": mousePressed, "mouseReleased": mouseReleased, "mouseClicked": mouseClicked, "doubleClicked": doubleClicked, "mouseWheel": mouseWheel, "touchStarted": touchStarted, "touchMoved": touchMoved, "touchEnded": touchEnded, "windowResized": windowResized, "keyIsDown": keyIsDown, } start_p5(preload, setup, draw, event_functions) ================================================ FILE: docs/examples/transcrypt/sketch_008/index.html ================================================ sketch_008 - pyp5js (using Transcrypt)

Python code here.

             
rect_base_size = 30
positions = []
rect_size = None

def setup():
    global rect_size

    createP("Hi! This is an example of how to use p5.dom.js with pyp5js")

    # creates a container div
    slider_div = createDiv()
    slider_div.style("display", "block")

    # creates the slider
    rect_size = createSlider(0, 600, 100)
    rect_size.style('width', '50%')

    # adds the slider to the container div
    slider_div.child(rect_size)

    createCanvas(600, 600)

    for x in range(-rect_base_size, width + rect_base_size, rect_base_size):
        for y in range(-rect_base_size, height + rect_base_size, rect_base_size):
            positions.append((x, y))

    noFill()
    strokeWeight(2)
    rectMode(CENTER)


def draw():
    background(255)
    size = rect_size.value()
    for x, y in positions:
        rect(x, y, size, size)

              
          
================================================ FILE: docs/examples/transcrypt/sketch_008/sketch_008.py ================================================ rect_base_size = 30 positions = [] rect_size = None def setup(): global rect_size createP("Hi! This is an example of how to use p5.dom.js with pyp5js") # creates a container div slider_div = createDiv() slider_div.style("display", "block") # creates the slider rect_size = createSlider(0, 600, 100) rect_size.style('width', '50%') # adds the slider to the container div slider_div.child(rect_size) createCanvas(600, 600) for x in range(-rect_base_size, width + rect_base_size, rect_base_size): for y in range(-rect_base_size, height + rect_base_size, rect_base_size): positions.append((x, y)) noFill() strokeWeight(2) rectMode(CENTER) def draw(): background(255) size = rect_size.value() for x, y in positions: rect(x, y, size, size) ================================================ FILE: docs/examples/transcrypt/sketch_008/static/p5.js ================================================ /*! p5.js v1.0.0 February 29, 2020 */ !function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).p5=e()}}(function(){return function o(a,s,l){function u(t,e){if(!s[t]){if(!a[t]){var r="function"==typeof require&&require;if(!e&&r)return r(t,!0);if(h)return h(t,!0);var i=new Error("Cannot find module '"+t+"'");throw i.code="MODULE_NOT_FOUND",i}var n=s[t]={exports:{}};a[t][0].call(n.exports,function(e){return u(a[t][1][e]||e)},n,n.exports,o,a,s,l)}return s[t].exports}for(var h="function"==typeof require&&require,e=0;e>16&255,a[s++]=t>>8&255,a[s++]=255&t;2===o&&(t=u[e.charCodeAt(r)]<<2|u[e.charCodeAt(r+1)]>>4,a[s++]=255&t);1===o&&(t=u[e.charCodeAt(r)]<<10|u[e.charCodeAt(r+1)]<<4|u[e.charCodeAt(r+2)]>>2,a[s++]=t>>8&255,a[s++]=255&t);return a},r.fromByteArray=function(e){for(var t,r=e.length,i=r%3,n=[],o=0,a=r-i;o>2]+s[t<<4&63]+"==")):2==i&&(t=(e[r-2]<<8)+e[r-1],n.push(s[t>>10]+s[t>>4&63]+s[t<<2&63]+"="));return n.join("")};for(var s=[],u=[],h="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=0,o=i.length;n>18&63]+s[n>>12&63]+s[n>>6&63]+s[63&n]);return o.join("")}u["-".charCodeAt(0)]=62,u["_".charCodeAt(0)]=63},{}],20:[function(e,t,r){},{}],21:[function(N,e,F){(function(c){"use strict";var i=N("base64-js"),o=N("ieee754"),e="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;F.Buffer=c,F.SlowBuffer=function(e){+e!=e&&(e=0);return c.alloc(+e)},F.INSPECT_MAX_BYTES=50;var r=2147483647;function a(e){if(r>>1;case"base64":return O(e).length;default:if(n)return i?-1:R(e).length;t=(""+t).toLowerCase(),n=!0}}function d(e,t,r){var i=e[t];e[t]=e[r],e[r]=i}function p(e,t,r,i,n){if(0===e.length)return-1;if("string"==typeof r?(i=r,r=0):2147483647=e.length){if(n)return-1;r=e.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof t&&(t=c.from(t,i)),c.isBuffer(t))return 0===t.length?-1:m(e,t,r,i,n);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):m(e,[t],r,i,n);throw new TypeError("val must be string, number or Buffer")}function m(e,t,r,i,n){var o,a=1,s=e.length,l=t.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(e.length<2||t.length<2)return-1;s/=a=2,l/=2,r/=2}function u(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(n){var h=-1;for(o=r;o>8,n=r%256,o.push(n),o.push(i);return o}(t,e.length-r),e,r,i)}function b(e,t,r){return 0===t&&r===e.length?i.fromByteArray(e):i.fromByteArray(e.slice(t,r))}function _(e,t,r){r=Math.min(e.length,r);for(var i=[],n=t;n>>10&1023|55296),h=56320|1023&h),i.push(h),n+=c}return function(e){var t=e.length;if(t<=x)return String.fromCharCode.apply(String,e);var r="",i=0;for(;ithis.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e=e||"utf8";;)switch(e){case"hex":return M(this,t,r);case"utf8":case"utf-8":return _(this,t,r);case"ascii":return w(this,t,r);case"latin1":case"binary":return S(this,t,r);case"base64":return b(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,t,r);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}.apply(this,arguments)},c.prototype.equals=function(e){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===c.compare(this,e)},c.prototype.inspect=function(){var e="",t=F.INSPECT_MAX_BYTES;return e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(e+=" ... "),""},e&&(c.prototype[e]=c.prototype.inspect),c.prototype.compare=function(e,t,r,i,n){if(A(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),t<0||r>e.length||i<0||n>this.length)throw new RangeError("out of range index");if(n<=i&&r<=t)return 0;if(n<=i)return-1;if(r<=t)return 1;if(this===e)return 0;for(var o=(n>>>=0)-(i>>>=0),a=(r>>>=0)-(t>>>=0),s=Math.min(o,a),l=this.slice(i,n),u=e.slice(t,r),h=0;h>>=0,isFinite(r)?(r>>>=0,void 0===i&&(i="utf8")):(i=r,r=void 0)}var n=this.length-t;if((void 0===r||nthis.length)throw new RangeError("Attempt to write outside buffer bounds");i=i||"utf8";for(var o,a,s,l,u,h,c=!1;;)switch(i){case"hex":return g(this,e,t,r);case"utf8":case"utf-8":return u=t,h=r,D(R(e,(l=this).length-u),l,u,h);case"ascii":return v(this,e,t,r);case"latin1":case"binary":return v(this,e,t,r);case"base64":return o=this,a=t,s=r,D(O(e),o,a,s);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return y(this,e,t,r);default:if(c)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),c=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var x=4096;function w(e,t,r){var i="";r=Math.min(e.length,r);for(var n=t;ne.length)throw new RangeError("Index out of range")}function P(e,t,r,i){if(r+i>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function L(e,t,r,i,n){return t=+t,r>>>=0,n||P(e,0,r,4),o.write(e,t,r,i,23,4),r+4}function k(e,t,r,i,n){return t=+t,r>>>=0,n||P(e,0,r,8),o.write(e,t,r,i,52,8),r+8}c.prototype.slice=function(e,t){var r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):r>>=0,t>>>=0,r||T(e,t,this.length);for(var i=this[e],n=1,o=0;++o>>=0,t>>>=0,r||T(e,t,this.length);for(var i=this[e+--t],n=1;0>>=0,t||T(e,1,this.length),this[e]},c.prototype.readUInt16LE=function(e,t){return e>>>=0,t||T(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUInt16BE=function(e,t){return e>>>=0,t||T(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUInt32LE=function(e,t){return e>>>=0,t||T(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUInt32BE=function(e,t){return e>>>=0,t||T(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||T(e,t,this.length);for(var i=this[e],n=1,o=0;++o>>=0,t>>>=0,r||T(e,t,this.length);for(var i=t,n=1,o=this[e+--i];0>>=0,t||T(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){e>>>=0,t||T(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(e,t){e>>>=0,t||T(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(e,t){return e>>>=0,t||T(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return e>>>=0,t||T(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readFloatLE=function(e,t){return e>>>=0,t||T(e,4,this.length),o.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return e>>>=0,t||T(e,4,this.length),o.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return e>>>=0,t||T(e,8,this.length),o.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return e>>>=0,t||T(e,8,this.length),o.read(this,e,!1,52,8)},c.prototype.writeUIntLE=function(e,t,r,i){e=+e,t>>>=0,r>>>=0,i||C(this,e,t,r,Math.pow(2,8*r)-1,0);var n=1,o=0;for(this[t]=255&e;++o>>=0,r>>>=0,i||C(this,e,t,r,Math.pow(2,8*r)-1,0);var n=r-1,o=1;for(this[t+n]=255&e;0<=--n&&(o*=256);)this[t+n]=e/o&255;return t+r},c.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,1,255,0),this[t]=255&e,t+1},c.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},c.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeIntLE=function(e,t,r,i){if(e=+e,t>>>=0,!i){var n=Math.pow(2,8*r-1);C(this,e,t,r,n-1,-n)}var o=0,a=1,s=0;for(this[t]=255&e;++o>0)-s&255;return t+r},c.prototype.writeIntBE=function(e,t,r,i){if(e=+e,t>>>=0,!i){var n=Math.pow(2,8*r-1);C(this,e,t,r,n-1,-n)}var o=r-1,a=1,s=0;for(this[t+o]=255&e;0<=--o&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+r},c.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},c.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeFloatLE=function(e,t,r){return L(this,e,t,!0,r)},c.prototype.writeFloatBE=function(e,t,r){return L(this,e,t,!1,r)},c.prototype.writeDoubleLE=function(e,t,r){return k(this,e,t,!0,r)},c.prototype.writeDoubleBE=function(e,t,r){return k(this,e,t,!1,r)},c.prototype.copy=function(e,t,r,i){if(!c.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r=r||0,i||0===i||(i=this.length),t>=e.length&&(t=e.length),t=t||0,0=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t>>=0,r=void 0===r?this.length:r>>>0,"number"==typeof(e=e||0))for(o=t;o>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function O(e){return i.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(t,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function D(e,t,r,i){for(var n=0;n=t.length||n>=e.length);++n)t[n+r]=e[n];return n}function A(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function I(e){return e!=e}var U=function(){for(var e="0123456789abcdef",t=new Array(256),r=0;r<16;++r)for(var i=16*r,n=0;n<16;++n)t[i+n]=e[r]+e[n];return t}()}).call(this,N("buffer").Buffer)},{"base64-js":19,buffer:21,ieee754:30}],22:[function(e,t,r){"use strict";t.exports=e("./").polyfill()},{"./":23}],23:[function(z,r,i){(function(j,V){var e,t;e=this,t=function(){"use strict";function l(e){return"function"==typeof e}var r=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},i=0,t=void 0,n=void 0,a=function(e,t){f[i]=e,f[i+1]=t,2===(i+=2)&&(n?n(d):y())};var e="undefined"!=typeof window?window:void 0,o=e||{},s=o.MutationObserver||o.WebKitMutationObserver,u="undefined"==typeof self&&void 0!==j&&"[object process]"==={}.toString.call(j),h="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function c(){var e=setTimeout;return function(){return e(d,1)}}var f=new Array(1e3);function d(){for(var e=0;e":">",'"':""","'":"'","/":"/"};function S(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,function(e){return w[e]}):e}var M=function(){function i(e){var t,r=1=this.maxReplaces)break}for(a=0;r=this.regexp.exec(e);){if(void 0===(i=h(r[1].trim())))if("function"==typeof c){var d=c(e,r,t);i="string"==typeof d?d:""}else this.logger.warn("missed to pass in variable ".concat(r[1]," for interpolating ").concat(e)),i="";else"string"==typeof i||this.useRawValueToEscape||(i=v(i));if(i=this.escapeValue?u(this.escape(i)):u(i),e=e.replace(r[0],i),this.regexp.lastIndex=0,++a>=this.maxReplaces)break}return e}},{key:"nest",value:function(e,t,r){var i,n,o=D({},2>1,h=-7,c=r?n-1:0,f=r?-1:1,d=e[t+c];for(c+=f,o=d&(1<<-h)-1,d>>=-h,h+=s;0>=-h,h+=i;0>1,f=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,d=i?0:o-1,p=i?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=h):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),2<=(t+=1<=a+c?f/l:f*Math.pow(2,1-c))*l&&(a++,l/=2),h<=a+c?(s=0,a=h):1<=a+c?(s=(t*l-1)*Math.pow(2,n),a+=c):(s=t*Math.pow(2,c-1)*Math.pow(2,n),a=0));8<=n;e[r+d]=255&s,d+=p,s/=256,n-=8);for(a=a<Math.abs(e[0])&&(t=1),Math.abs(e[2])>Math.abs(e[t])&&(t=2),t}var C=4e150;function P(e,t){e.f+=t.f,e.b.f+=t.b.f}function u(e,t,r){return e=e.a,t=t.a,r=r.a,t.b.a===e?r.b.a===e?v(t.a,r.a)?b(r.b.a,t.a,r.a)<=0:0<=b(t.b.a,r.a,t.a):b(r.b.a,e,r.a)<=0:r.b.a===e?0<=b(t.b.a,e,t.a):(t=y(t.b.a,e,t.a),(e=y(r.b.a,e,r.a))<=t)}function L(e){e.a.i=null;var t=e.e;t.a.c=t.c,t.c.a=t.a,e.e=null}function h(e,t){c(e.a),e.c=!1,(e.a=t).i=e}function k(e){for(var t=e.a.a;(e=fe(e)).a.a===t;);return e.c&&(h(e,t=f(ce(e).a.b,e.a.e)),e=fe(e)),e}function R(e,t,r){var i=new he;return i.a=r,i.e=W(e.f,t.e,i),r.i=i}function O(e,t){switch(e.s){case 100130:return 0!=(1&t);case 100131:return 0!==t;case 100132:return 0>1]],s[a[u]])?le(r,u):ue(r,u)),s[o]=null,l[o]=r.b,r.b=o}else for(r.c[-(o+1)]=null;0Math.max(a.a,l.a))return!1;if(v(o,a)){if(0i.f&&(i.f*=2,i.c=oe(i.c,i.f+1)),0===i.b?r=n:(r=i.b,i.b=i.c[i.b]),i.e[r]=t,i.c[r]=n,i.d[n]=r,i.h&&ue(i,n),r}return i=e.a++,e.c[i]=t,-(i+1)}function ie(e){if(0===e.a)return se(e.b);var t=e.c[e.d[e.a-1]];if(0!==e.b.a&&v(ae(e.b),t))return se(e.b);for(;--e.a,0e.a||v(i[a],i[l])){n[r[o]=a]=o;break}n[r[o]=l]=o,o=s}}function ue(e,t){for(var r=e.d,i=e.e,n=e.c,o=t,a=r[o];;){var s=o>>1,l=r[s];if(0==s||v(i[l],i[a])){n[r[o]=a]=o;break}n[r[o]=l]=o,o=s}}function he(){this.e=this.a=null,this.f=0,this.c=this.b=this.h=this.d=!1}function ce(e){return e.e.c.b}function fe(e){return e.e.a.b}(i=q.prototype).x=function(){Y(this,0)},i.B=function(e,t){switch(e){case 100142:return;case 100140:switch(t){case 100130:case 100131:case 100132:case 100133:case 100134:return void(this.s=t)}break;case 100141:return void(this.m=!!t);default:return void Z(this,100900)}Z(this,100901)},i.y=function(e){switch(e){case 100142:return 0;case 100140:return this.s;case 100141:return this.m;default:Z(this,100900)}return!1},i.A=function(e,t,r){this.j[0]=e,this.j[1]=t,this.j[2]=r},i.z=function(e,t){var r=t||null;switch(e){case 100100:case 100106:this.h=r;break;case 100104:case 100110:this.l=r;break;case 100101:case 100107:this.k=r;break;case 100102:case 100108:this.i=r;break;case 100103:case 100109:this.p=r;break;case 100105:case 100111:this.o=r;break;case 100112:this.r=r;break;default:Z(this,100900)}},i.C=function(e,t){var r=!1,i=[0,0,0];Y(this,2);for(var n=0;n<3;++n){var o=e[n];o<-1e150&&(o=-1e150,r=!0),1e150n[u]&&(n[u]=h,a[u]=l)}if(l=0,n[1]-o[1]>n[0]-o[0]&&(l=1),n[2]-o[2]>n[l]-o[l]&&(l=2),o[l]>=n[l])i[0]=0,i[1]=0,i[2]=1;else{for(n=0,o=s[l],a=a[l],s=[0,0,0],o=[o.g[0]-a.g[0],o.g[1]-a.g[1],o.g[2]-a.g[2]],u=[0,0,0],l=r.e;l!==r;l=l.e)u[0]=l.g[0]-a.g[0],u[1]=l.g[1]-a.g[1],u[2]=l.g[2]-a.g[2],s[0]=o[1]*u[2]-o[2]*u[1],s[1]=o[2]*u[0]-o[0]*u[2],s[2]=o[0]*u[1]-o[1]*u[0],n<(h=s[0]*s[0]+s[1]*s[1]+s[2]*s[2])&&(n=h,i[0]=s[0],i[1]=s[1],i[2]=s[2]);n<=0&&(i[0]=i[1]=i[2]=0,i[T(o)]=1)}r=!0}for(s=T(i),l=this.b.c,n=(s+1)%3,a=(s+2)%3,s=0>=l,h-=l,g!=o){if(g==a)break;for(var v=g>8,++y;var _=b;if(i>=8;null!==m&&s<4096&&(p[s++]=m<<8|_,u+1<=s&&l<12&&(++l,u=u<<1|1)),m=g}else s=1+a,u=(1<<(l=n+1))-1,m=null}return f!==i&&console.log("Warning, gif stream shorter than expected."),r}try{r.GifWriter=function(v,e,t,r){var y=0,i=void 0===(r=void 0===r?{}:r).loop?null:r.loop,b=void 0===r.palette?null:r.palette;if(e<=0||t<=0||65535>=1;)++n;if(a=1<>8&255,v[y++]=255&t,v[y++]=t>>8&255,v[y++]=(null!==b?128:0)|n,v[y++]=o,v[y++]=0,null!==b)for(var s=0,l=b.length;s>16&255,v[y++]=u>>8&255,v[y++]=255&u}if(null!==i){if(i<0||65535>8&255,v[y++]=0}var x=!1;this.addFrame=function(e,t,r,i,n,o){if(!0===x&&(--y,x=!1),o=void 0===o?{}:o,e<0||t<0||65535>=1;)++u;l=1<>8&255,v[y++]=d,v[y++]=0),v[y++]=44,v[y++]=255&e,v[y++]=e>>8&255,v[y++]=255&t,v[y++]=t>>8&255,v[y++]=255&r,v[y++]=r>>8&255,v[y++]=255&i,v[y++]=i>>8&255,v[y++]=!0===a?128|u-1:0,!0===a)for(var p=0,m=s.length;p>16&255,v[y++]=g>>8&255,v[y++]=255&g}return y=function(t,r,e,i){t[r++]=e;var n=r++,o=1<>=8,h-=8,r===n+256&&(t[n]=255,n=r++)}function d(e){c|=e<>=8,h-=8,r===n+256&&(t[n]=255,n=r++);4096===l?(d(o),l=1+s,u=e+1,m={}):(1<>7,n=1<<1+(7&r);x[e++],x[e++];var o=null,a=null;i&&(o=e,e+=3*(a=n));var s=!0,l=[],u=0,h=null,c=0,f=null;for(this.width=w,this.height=t;s&&e>2&7,e++;break;case 254:for(;;){if(!(0<=(C=x[e++])))throw Error("Invalid block size");if(0===C)break;e+=C}break;default:throw new Error("Unknown graphic control label: 0x"+x[e-1].toString(16))}break;case 44:var p=x[e++]|x[e++]<<8,m=x[e++]|x[e++]<<8,g=x[e++]|x[e++]<<8,v=x[e++]|x[e++]<<8,y=x[e++],b=y>>6&1,_=1<<1+(7&y),S=o,M=a,E=!1;if(y>>7){E=!0;S=e,e+=3*(M=_)}var T=e;for(e++;;){var C;if(!(0<=(C=x[e++])))throw Error("Invalid block size");if(0===C)break;e+=C}l.push({x:p,y:m,width:g,height:v,has_local_palette:E,palette_offset:S,palette_size:M,data_offset:T,data_length:e-T,transparent_index:h,interlaced:!!b,delay:u,disposal:c});break;case 59:s=!1;break;default:throw new Error("Unknown gif block: 0x"+x[e-1].toString(16))}this.numFrames=function(){return l.length},this.loopCount=function(){return f},this.frameInfo=function(e){if(e<0||e>=l.length)throw new Error("Frame index out of range.");return l[e]},this.decodeAndBlitFrameBGRA=function(e,t){var r=this.frameInfo(e),i=r.width*r.height,n=new Uint8Array(i);P(x,r.data_offset,n,i);var o=r.palette_offset,a=r.transparent_index;null===a&&(a=256);var s=r.width,l=w-s,u=s,h=4*(r.y*w+r.x),c=4*((r.y+r.height)*w+r.x),f=h,d=4*l;!0===r.interlaced&&(d+=4*w*7);for(var p=8,m=0,g=n.length;m>=1)),v===a)f+=4;else{var y=x[o+3*v],b=x[o+3*v+1],_=x[o+3*v+2];t[f++]=_,t[f++]=b,t[f++]=y,t[f++]=255}--u}},this.decodeAndBlitFrameRGBA=function(e,t){var r=this.frameInfo(e),i=r.width*r.height,n=new Uint8Array(i);P(x,r.data_offset,n,i);var o=r.palette_offset,a=r.transparent_index;null===a&&(a=256);var s=r.width,l=w-s,u=s,h=4*(r.y*w+r.x),c=4*((r.y+r.height)*w+r.x),f=h,d=4*l;!0===r.interlaced&&(d+=4*w*7);for(var p=8,m=0,g=n.length;m>=1)),v===a)f+=4;else{var y=x[o+3*v],b=x[o+3*v+1],_=x[o+3*v+2];t[f++]=y,t[f++]=b,t[f++]=_,t[f++]=255}--u}}}}catch(e){}},{}],33:[function(jr,t,r){(function(Gr){var e;e=this,function(E){"use strict";function e(e){if(null==this)throw TypeError();var t=String(this),r=t.length,i=e?Number(e):0;if(i!=i&&(i=0),!(i<0||r<=i)){var n,o=t.charCodeAt(i);return 55296<=o&&o<=56319&&i+1>>=1,t}function _(e,t,r){if(!t)return r;for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<>>16-t;return e.tag>>>=t,e.bitcount-=t,i+r}function x(e,t){for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<>>=1,++n,r+=t.table[n],0<=(i-=t.table[n]););return e.tag=o,e.bitcount-=n,t.trans[r+i]}function w(e,t,r){var i,n,o,a,s,l;for(i=_(e,5,257),n=_(e,5,1),o=_(e,4,4),a=0;a<19;++a)g[a]=0;for(a=0;athis.x2&&(this.x2=e)),"number"==typeof t&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=t,this.y2=t),tthis.y2&&(this.y2=t))},C.prototype.addX=function(e){this.addPoint(e,null)},C.prototype.addY=function(e){this.addPoint(null,e)},C.prototype.addBezier=function(e,t,r,i,n,o,a,s){var l=this,u=[e,t],h=[r,i],c=[n,o],f=[a,s];this.addPoint(e,t),this.addPoint(a,s);for(var d=0;d<=1;d++){var p=6*u[d]-12*h[d]+6*c[d],m=-3*u[d]+9*h[d]-9*c[d]+3*f[d],g=3*h[d]-3*u[d];if(0!=m){var v=Math.pow(p,2)-4*g*m;if(!(v<0)){var y=(-p+Math.sqrt(v))/(2*m);0>8&255,255&e]},A.USHORT=U(2),D.SHORT=function(e){return 32768<=e&&(e=-(65536-e)),[e>>8&255,255&e]},A.SHORT=U(2),D.UINT24=function(e){return[e>>16&255,e>>8&255,255&e]},A.UINT24=U(3),D.ULONG=function(e){return[e>>24&255,e>>16&255,e>>8&255,255&e]},A.ULONG=U(4),D.LONG=function(e){return R<=e&&(e=-(2*R-e)),[e>>24&255,e>>16&255,e>>8&255,255&e]},A.LONG=U(4),D.FIXED=D.ULONG,A.FIXED=A.ULONG,D.FWORD=D.SHORT,A.FWORD=A.SHORT,D.UFWORD=D.USHORT,A.UFWORD=A.USHORT,D.LONGDATETIME=function(e){return[0,0,0,0,e>>24&255,e>>16&255,e>>8&255,255&e]},A.LONGDATETIME=U(8),D.TAG=function(e){return k.argument(4===e.length,"Tag should be exactly 4 ASCII characters."),[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]},A.TAG=U(4),D.Card8=D.BYTE,A.Card8=A.BYTE,D.Card16=D.USHORT,A.Card16=A.USHORT,D.OffSize=D.BYTE,A.OffSize=A.BYTE,D.SID=D.USHORT,A.SID=A.USHORT,D.NUMBER=function(e){return-107<=e&&e<=107?[e+139]:108<=e&&e<=1131?[247+((e-=108)>>8),255&e]:-1131<=e&&e<=-108?[251+((e=-e-108)>>8),255&e]:-32768<=e&&e<=32767?D.NUMBER16(e):D.NUMBER32(e)},A.NUMBER=function(e){return D.NUMBER(e).length},D.NUMBER16=function(e){return[28,e>>8&255,255&e]},A.NUMBER16=U(3),D.NUMBER32=function(e){return[29,e>>24&255,e>>16&255,e>>8&255,255&e]},A.NUMBER32=U(5),D.REAL=function(e){var t=e.toString(),r=/\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec(t);if(r){var i=parseFloat("1e"+((r[2]?+r[2]:0)+r[1].length));t=(Math.round(e*i)/i).toString()}for(var n="",o=0,a=t.length;o>8&255,t[t.length]=255&i}return t},A.UTF16=function(e){return 2*e.length};var N={"x-mac-croatian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈ƫȅ ÀÃÕŒœĐ—“”‘’÷◊©⁄€‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ","x-mac-cyrillic":"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю","x-mac-gaelic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØḂ±≤≥ḃĊċḊḋḞḟĠġṀæøṁṖṗɼƒſṠ«»… ÀÃÕŒœ–—“”‘’ṡẛÿŸṪ€‹›Ŷŷṫ·Ỳỳ⁊ÂÊÁËÈÍÎÏÌÓÔ♣ÒÚÛÙıÝýŴŵẄẅẀẁẂẃ","x-mac-greek":"Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦€ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ­","x-mac-icelandic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüݰ¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-inuit":"ᐃᐄᐅᐆᐊᐋᐱᐲᐳᐴᐸᐹᑉᑎᑏᑐᑑᑕᑖᑦᑭᑮᑯᑰᑲᑳᒃᒋᒌᒍᒎᒐᒑ°ᒡᒥᒦ•¶ᒧ®©™ᒨᒪᒫᒻᓂᓃᓄᓅᓇᓈᓐᓯᓰᓱᓲᓴᓵᔅᓕᓖᓗᓘᓚᓛᓪᔨᔩᔪᔫᔭ… ᔮᔾᕕᕖᕗ–—“”‘’ᕘᕙᕚᕝᕆᕇᕈᕉᕋᕌᕐᕿᖀᖁᖂᖃᖄᖅᖏᖐᖑᖒᖓᖔᖕᙱᙲᙳᙴᙵᙶᖖᖠᖡᖢᖣᖤᖥᖦᕼŁł","x-mac-ce":"ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ",macintosh:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-romanian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂȘ∞±≤≥¥µ∂∑∏π∫ªºΩăș¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›Țț‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-turkish":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙˆ˜¯˘˙˚¸˝˛ˇ"};O.MACSTRING=function(e,t,r,i){var n=N[i];if(void 0!==n){for(var o="",a=0;a>8&255,l+256&255)}return o}D.MACSTRING=function(e,t){var r=function(e){if(!F)for(var t in F={},N)F[t]=new String(t);var r=F[e];if(void 0!==r){if(B){var i=B.get(r);if(void 0!==i)return i}var n=N[e];if(void 0!==n){for(var o={},a=0;a>8,t[c+1]=255&f,t=t.concat(i[h])}return t},A.TABLE=function(e){for(var t=0,r=e.fields.length,i=0;i>1,t.skip("uShort",3),e.glyphIndexMap={};for(var a=new se.Parser(r,i+n+14),s=new se.Parser(r,i+n+16+2*o),l=new se.Parser(r,i+n+16+4*o),u=new se.Parser(r,i+n+16+6*o),h=i+n+16+8*o,c=0;c>4,o=15&i;if(15==n)break;if(t+=r[n],15==o)break;t+=r[o]}return parseFloat(t)}(e);if(32<=t&&t<=246)return t-139;if(247<=t&&t<=250)return 256*(t-247)+e.parseByte()+108;if(251<=t&&t<=254)return 256*-(t-251)-e.parseByte()-108;throw new Error("Invalid b0 "+t)}function Te(e,t,r){t=void 0!==t?t:0;var i=new se.Parser(e,t),n=[],o=[];for(r=void 0!==r?r:e.length;i.relativeOffset>1,T.length=0,P=!0}return function e(t){for(var r,i,n,o,a,s,l,u,h,c,f,d,p=0;pMath.abs(d-R)?k=f+T.shift():R=d+T.shift(),E.curveTo(y,b,_,x,l,u),E.curveTo(h,c,f,d,k,R);break;default:console.log("Glyph "+v.index+": unknown operator 1200"+m),T.length=0}break;case 14:0>3;break;case 21:2>16),p+=2;break;case 29:a=T.pop()+g.gsubrsBias,(s=g.gsubrs[a])&&e(s);break;case 30:for(;0=r.begin&&e=fe.length){var a=i.parseChar();r.names.push(i.parseString(a))}break;case 2.5:r.numberOfGlyphs=i.parseUShort(),r.offset=new Array(r.numberOfGlyphs);for(var s=0;st.value.tag?1:-1}),t.fields=t.fields.concat(i),t.fields=t.fields.concat(n),t}function gt(e,t,r){for(var i=0;i 123 are reserved for internal usage");d|=1<>>1,o=e[n].tag;if(o===t)return n;o>>1,o=e[n];if(o===t)return n;o>>1,a=(r=e[o]).start;if(a===t)return r;a(r=e[i-1]).end?0:r}function xt(e,t){this.font=e,this.tableName=t}function wt(e){xt.call(this,e,"gpos")}function St(e){xt.call(this,e,"gsub")}function Mt(e,t){var r=e.length;if(r!==t.length)return!1;for(var i=0;it.points.length-1||i.matchedPoints[1]>n.points.length-1)throw Error("Matched points out of range in "+t.name);var a=t.points[i.matchedPoints[0]],s=n.points[i.matchedPoints[1]],l={xScale:i.xScale,scale01:i.scale01,scale10:i.scale10,yScale:i.yScale,dx:0,dy:0};s=kt([s],l)[0],l.dx=a.x-s.x,l.dy=a.y-s.y,o=kt(n.points,l)}t.points=t.points.concat(o)}}return Rt(t.points)}(wt.prototype=xt.prototype={searchTag:yt,binSearch:bt,getTable:function(e){var t=this.font.tables[this.tableName];return!t&&e&&(t=this.font.tables[this.tableName]=this.createDefaultTable()),t},getScriptNames:function(){var e=this.getTable();return e?e.scripts.map(function(e){return e.tag}):[]},getDefaultScriptName:function(){var e=this.getTable();if(e){for(var t=!1,r=0;r=s[u-1].tag,"Features must be added in alphabetical order."),o={tag:r,feature:{params:0,lookupListIndexes:[]}},s.push(o),a.push(u),o.feature}}},getLookupTables:function(e,t,r,i,n){var o=this.getFeatureTable(e,t,r,n),a=[];if(o){for(var s,l=o.lookupListIndexes,u=this.font.tables[this.tableName].lookups,h=0;h",s),t.stack.push(Math.round(64*s))}function vr(e,t){var r=t.stack,i=r.pop(),n=t.fv,o=t.pv,a=t.ppem,s=t.deltaBase+16*(e-1),l=t.deltaShift,u=t.z0;E.DEBUG&&console.log(t.step,"DELTAP["+e+"]",i,r);for(var h=0;h>4)===a){var d=(15&f)-8;0<=d&&d++,E.DEBUG&&console.log(t.step,"DELTAPFIX",c,"by",d*l);var p=u[c];n.setRelative(p,p,d*l,o)}}}function yr(e,t){var r=t.stack,i=r.pop();E.DEBUG&&console.log(t.step,"ROUND[]"),r.push(64*t.round(i/64))}function br(e,t){var r=t.stack,i=r.pop(),n=t.ppem,o=t.deltaBase+16*(e-1),a=t.deltaShift;E.DEBUG&&console.log(t.step,"DELTAC["+e+"]",i,r);for(var s=0;s>4)===n){var h=(15&u)-8;0<=h&&h++;var c=h*a;E.DEBUG&&console.log(t.step,"DELTACFIX",l,"by",c),t.cvt[l]+=c}}}function _r(e,t){var r,i,n=t.stack,o=n.pop(),a=n.pop(),s=t.z2[o],l=t.z1[a];E.DEBUG&&console.log(t.step,"SDPVTL["+e+"]",o,a),i=e?(r=s.y-l.y,l.x-s.x):(r=l.x-s.x,l.y-s.y),t.dpv=Zt(r,i)}function xr(e,t){var r=t.stack,i=t.prog,n=t.ip;E.DEBUG&&console.log(t.step,"PUSHB["+e+"]");for(var o=0;o":"_")+(i?"R":"_")+(0===n?"Gr":1===n?"Bl":2===n?"Wh":"")+"]",e?c+"("+o.cvt[c]+","+u+")":"",f,"(d =",a,"->",l*s,")"),o.rp1=o.rp0,o.rp2=f,t&&(o.rp0=f)}Ft.prototype.exec=function(e,t){if("number"!=typeof t)throw new Error("Point size is not a number!");if(!(2",i),s.interpolate(c,o,a,l),s.touch(c)}e.loop=1},dr.bind(void 0,0),dr.bind(void 0,1),function(e){for(var t=e.stack,r=e.rp0,i=e.z0[r],n=e.loop,o=e.fv,a=e.pv,s=e.z1;n--;){var l=t.pop(),u=s[l];E.DEBUG&&console.log(e.step,(1=a.width||t>=a.height?[0,0,0,0]:this._getPixel(e,t);var s=new l.default.Image(r,i);return s.canvas.getContext("2d").drawImage(a,e,t,r*o,i*o,0,0,r,i),s},l.default.Renderer.prototype.textLeading=function(e){return"number"==typeof e?(this._setProperty("_textLeading",e),this._pInst):this._textLeading},l.default.Renderer.prototype.textSize=function(e){return"number"==typeof e?(this._setProperty("_textSize",e),this._setProperty("_textLeading",e*y._DEFAULT_LEADMULT),this._applyTextProperties()):this._textSize},l.default.Renderer.prototype.textStyle=function(e){return e?(e!==y.NORMAL&&e!==y.ITALIC&&e!==y.BOLD&&e!==y.BOLDITALIC||this._setProperty("_textStyle",e),this._applyTextProperties()):this._textStyle},l.default.Renderer.prototype.textAscent=function(){return null===this._textAscent&&this._updateTextMetrics(),this._textAscent},l.default.Renderer.prototype.textDescent=function(){return null===this._textDescent&&this._updateTextMetrics(),this._textDescent},l.default.Renderer.prototype.textAlign=function(e,t){return void 0!==e?(this._setProperty("_textAlign",e),void 0!==t&&this._setProperty("_textBaseline",t),this._applyTextProperties()):{horizontal:this._textAlign,vertical:this._textBaseline}},l.default.Renderer.prototype.text=function(e,t,r,i,n){var o,a,s,l,u,h,c,f,d=this._pInst,p=Number.MAX_VALUE;if((this._doFill||this._doStroke)&&void 0!==e){if("string"!=typeof e&&(e=e.toString()),o=(e=e.replace(/(\t)/g," ")).split("\n"),void 0!==i){for(s=f=0;ss.HALF_PI&&e<=3*s.HALF_PI?Math.atan(r/i*Math.tan(e))+s.PI:Math.atan(r/i*Math.tan(e))+s.TWO_PI,t=t<=s.HALF_PI?Math.atan(r/i*Math.tan(t)):t>s.HALF_PI&&t<=3*s.HALF_PI?Math.atan(r/i*Math.tan(t))+s.PI:Math.atan(r/i*Math.tan(t))+s.TWO_PI),tv||Math.abs(this.accelerationY-this.pAccelerationY)>v||Math.abs(this.accelerationZ-this.pAccelerationZ)>v)&&e();var t=this.deviceTurned||window.deviceTurned;if("function"==typeof t){var r=this.rotationX+180,i=this.pRotationX+180,n=c+180;0>>24],i+=x[(16711680&C)>>16],n+=x[(65280&C)>>8],o+=x[255&C],r+=k[_],s++}w[l=T+y]=a/r,S[l]=i/r,M[l]=n/r,E[l]=o/r}T+=d}for(h=(u=-P)*d,b=T=0;b>>16,e[r+1]=(65280&t[i])>>>8,e[r+2]=255&t[i],e[r+3]=(4278190080&t[i])>>>24},O._toImageData=function(e){return e instanceof ImageData?e:e.getContext("2d").getImageData(0,0,e.width,e.height)},O._createImageData=function(e,t){return O._tmpCanvas=document.createElement("canvas"),O._tmpCtx=O._tmpCanvas.getContext("2d"),this._tmpCtx.createImageData(e,t)},O.apply=function(e,t,r){var i=e.getContext("2d"),n=i.getImageData(0,0,e.width,e.height),o=t(n,r);o instanceof ImageData?i.putImageData(o,0,0,0,0,e.width,e.height):i.putImageData(n,0,0,0,0,e.width,e.height)},O.threshold=function(e,t){var r=O._toPixels(e);void 0===t&&(t=.5);for(var i=Math.floor(255*t),n=0;n>8)/i,r[n+1]=255*(a*t>>8)/i,r[n+2]=255*(s*t>>8)/i}},O.dilate=function(e){for(var t,r,i,n,o,a,s,l,u,h,c,f,d,p,m,g,v,y=O._toPixels(e),b=0,_=y.length?y.length/4:0,x=new Int32Array(_);b<_;)for(r=(t=b)+e.width;b>16&255)+151*(i>>8&255)+28*(255&i))<(m=77*(c>>16&255)+151*(c>>8&255)+28*(255&c))&&(n=c,o=m),o<(p=77*((h=O._getARGB(y,a))>>16&255)+151*(h>>8&255)+28*(255&h))&&(n=h,o=p),o<(g=77*(f>>16&255)+151*(f>>8&255)+28*(255&f))&&(n=f,o=g),o<(v=77*(d>>16&255)+151*(d>>8&255)+28*(255&d))&&(n=d,o=v),x[b++]=n;O._setPixels(y,x)},O.erode=function(e){for(var t,r,i,n,o,a,s,l,u,h,c,f,d,p,m,g,v,y=O._toPixels(e),b=0,_=y.length?y.length/4:0,x=new Int32Array(_);b<_;)for(r=(t=b)+e.width;b>16&255)+151*(c>>8&255)+28*(255&c))<(o=77*(i>>16&255)+151*(i>>8&255)+28*(255&i))&&(n=c,o=m),(p=77*((h=O._getARGB(y,a))>>16&255)+151*(h>>8&255)+28*(255&h))>16&255)+151*(f>>8&255)+28*(255&f))>16&255)+151*(d>>8&255)+28*(255&d))=r){var i=Math.floor(t.timeDisplayed/r);if(t.timeDisplayed=0,t.displayIndex+=i,t.loopCount=Math.floor(t.displayIndex/t.numFrames),null!==t.loopLimit&&t.loopCount>=t.loopLimit)t.playing=!1;else{var n=t.displayIndex%t.numFrames;this.drawingContext.putImageData(t.frames[n].image,0,0),t.displayIndex=n,this.setModified(!0)}}}},n.default.Image.prototype._setProperty=function(e,t){this[e]=t,this.setModified(!0)},n.default.Image.prototype.loadPixels=function(){n.default.Renderer2D.prototype.loadPixels.call(this),this.setModified(!0)},n.default.Image.prototype.updatePixels=function(e,t,r,i){n.default.Renderer2D.prototype.updatePixels.call(this,e,t,r,i),this.setModified(!0)},n.default.Image.prototype.get=function(e,t,r,i){return n.default._validateParameters("p5.Image.get",arguments),n.default.Renderer2D.prototype.get.apply(this,arguments)},n.default.Image.prototype._getPixel=n.default.Renderer2D.prototype._getPixel,n.default.Image.prototype.set=function(e,t,r){n.default.Renderer2D.prototype.set.call(this,e,t,r),this.setModified(!0)},n.default.Image.prototype.resize=function(e,t){0===e&&0===t?(e=this.canvas.width,t=this.canvas.height):0===e?e=this.canvas.width*t/this.canvas.height:0===t&&(t=this.canvas.height*e/this.canvas.width),e=Math.floor(e),t=Math.floor(t);var r=document.createElement("canvas");if(r.width=e,r.height=t,this.gifProperties)for(var i=this.gifProperties,n=function(e,t){for(var r=0,i=0;i/g,">").replace(/"/g,""").replace(/'/g,"'")}function l(e,t){t&&!0!==t&&"true"!==t||(t="");var r="";return(e=e||"untitled")&&e.includes(".")&&(r=e.split(".").pop()),t&&r!==t&&(r=t,e="".concat(e,".").concat(r)),[e,r]}e("../core/error_helpers"),v.default.prototype.loadJSON=function(){for(var e=arguments.length,t=new Array(e),r=0;r"),n.print("");if(n.print(' '),n.print(""),n.print(""),n.print(" "),"0"!==o[0]){n.print(" ");for(var h=0;h".concat(c)),n.print(" ")}n.print(" ")}for(var f=0;f");for(var d=0;d".concat(p)),n.print(" ")}n.print(" ")}n.print("
"),n.print(""),n.print("")}n.close(),n.clear()},v.default.prototype.writeFile=function(e,t,r){var i="application/octet-stream";v.default.prototype._isSafari()&&(i="text/plain");var n=new Blob(e,{type:i});v.default.prototype.downloadFile(n,t,r)},v.default.prototype.downloadFile=function(e,t,r){var i=l(t,r),n=i[0];if(e instanceof Blob)s.default.saveAs(e,n);else{var o=document.createElement("a");if(o.href=e,o.download=n,o.onclick=function(e){var t;t=e,document.body.removeChild(t.target),e.stopPropagation()},o.style.display="none",document.body.appendChild(o),v.default.prototype._isSafari()){var a="Hello, Safari user! To download this file...\n";a+="1. Go to File --\x3e Save As.\n",a+='2. Choose "Page Source" as the Format.\n',a+='3. Name it with this extension: ."'.concat(i[1],'"'),alert(a)}o.click()}},v.default.prototype._checkFileExtension=l,v.default.prototype._isSafari=function(){return 0>>0},getSeed:function(){return t},rand:function(){return(r=(1664525*r+1013904223)%i)/i}});n.setSeed(e),_=new Array(4096);for(var o=0;o<4096;o++)_[o]=n.rand()};var o=n.default;r.default=o},{"../core/main":49}],82:[function(e,t,r){"use strict";function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i,l=(i=e("../core/main"))&&i.__esModule?i:{default:i},o=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==a(e)&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var o=i?Object.getOwnPropertyDescriptor(e,n):null;o&&(o.get||o.set)?Object.defineProperty(r,n,o):r[n]=e[n]}r.default=e,t&&t.set(e,r);return r}(e("../core/constants"));function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}l.default.Vector=function(e,t,r){var i,n,o;o=e instanceof l.default?(this.p5=e,i=t[0]||0,n=t[1]||0,t[2]||0):(i=e||0,n=t||0,r||0),this.x=i,this.y=n,this.z=o},l.default.Vector.prototype.toString=function(){return"p5.Vector Object : [".concat(this.x,", ").concat(this.y,", ").concat(this.z,"]")},l.default.Vector.prototype.set=function(e,t,r){return e instanceof l.default.Vector?(this.x=e.x||0,this.y=e.y||0,this.z=e.z||0):e instanceof Array?(this.x=e[0]||0,this.y=e[1]||0,this.z=e[2]||0):(this.x=e||0,this.y=t||0,this.z=r||0),this},l.default.Vector.prototype.copy=function(){return this.p5?new l.default.Vector(this.p5,[this.x,this.y,this.z]):new l.default.Vector(this.x,this.y,this.z)},l.default.Vector.prototype.add=function(e,t,r){return e instanceof l.default.Vector?(this.x+=e.x||0,this.y+=e.y||0,this.z+=e.z||0):e instanceof Array?(this.x+=e[0]||0,this.y+=e[1]||0,this.z+=e[2]||0):(this.x+=e||0,this.y+=t||0,this.z+=r||0),this};function u(e,t){return 0!==e&&(this.x=this.x%e),0!==t&&(this.y=this.y%t),this}function h(e,t,r){return 0!==e&&(this.x=this.x%e),0!==t&&(this.y=this.y%t),0!==r&&(this.z=this.z%r),this}l.default.Vector.prototype.rem=function(e,t,r){if(e instanceof l.default.Vector){if(Number.isFinite(e.x)&&Number.isFinite(e.y)&&Number.isFinite(e.z)){var i=parseFloat(e.x),n=parseFloat(e.y),o=parseFloat(e.z);h.call(this,i,n,o)}}else if(e instanceof Array)e.every(function(e){return Number.isFinite(e)})&&(2===e.length&&u.call(this,e[0],e[1]),3===e.length&&h.call(this,e[0],e[1],e[2]));else if(1===arguments.length){if(Number.isFinite(e)&&0!==e)return this.x=this.x%e,this.y=this.y%e,this.z=this.z%e,this}else if(2===arguments.length){var a=Array.prototype.slice.call(arguments);a.every(function(e){return Number.isFinite(e)})&&2===a.length&&u.call(this,a[0],a[1])}else if(3===arguments.length){var s=Array.prototype.slice.call(arguments);s.every(function(e){return Number.isFinite(e)})&&3===s.length&&h.call(this,s[0],s[1],s[2])}},l.default.Vector.prototype.sub=function(e,t,r){return e instanceof l.default.Vector?(this.x-=e.x||0,this.y-=e.y||0,this.z-=e.z||0):e instanceof Array?(this.x-=e[0]||0,this.y-=e[1]||0,this.z-=e[2]||0):(this.x-=e||0,this.y-=t||0,this.z-=r||0),this},l.default.Vector.prototype.mult=function(e){return"number"==typeof e&&isFinite(e)?(this.x*=e,this.y*=e,this.z*=e):console.warn("p5.Vector.prototype.mult:","n is undefined or not a finite number"),this},l.default.Vector.prototype.div=function(e){return"number"==typeof e&&isFinite(e)?0===e?console.warn("p5.Vector.prototype.div:","divide by 0"):(this.x/=e,this.y/=e,this.z/=e):console.warn("p5.Vector.prototype.div:","n is undefined or not a finite number"),this},l.default.Vector.prototype.mag=function(){return Math.sqrt(this.magSq())},l.default.Vector.prototype.magSq=function(){var e=this.x,t=this.y,r=this.z;return e*e+t*t+r*r},l.default.Vector.prototype.dot=function(e,t,r){return e instanceof l.default.Vector?this.dot(e.x,e.y,e.z):this.x*(e||0)+this.y*(t||0)+this.z*(r||0)},l.default.Vector.prototype.cross=function(e){var t=this.y*e.z-this.z*e.y,r=this.z*e.x-this.x*e.z,i=this.x*e.y-this.y*e.x;return this.p5?new l.default.Vector(this.p5,[t,r,i]):new l.default.Vector(t,r,i)},l.default.Vector.prototype.dist=function(e){return e.copy().sub(this).mag()},l.default.Vector.prototype.normalize=function(){var e=this.mag();return 0!==e&&this.mult(1/e),this},l.default.Vector.prototype.limit=function(e){var t=this.magSq();return e*e>>0},n.default.prototype.randomSeed=function(e){this._lcgSetSeed(o,e),this._gaussian_previous=!1},n.default.prototype.random=function(e,t){var r;if(n.default._validateParameters("random",arguments),r=null!=this[o]?this._lcg(o):Math.random(),void 0===e)return r;if(void 0===t)return e instanceof Array?e[Math.floor(r*e.length)]:r*e;if(tf){var P=p,L=l,k=u;p=d+f*(s&&d=t&&(r=r.substring(r.length-t,r.length)),r}},n.default.prototype.unhex=function(e){return e instanceof Array?e.map(n.default.prototype.unhex):parseInt("0x".concat(e),16)};var o=n.default;r.default=o},{"../core/main":49}],90:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i,a=(i=e("../core/main"))&&i.__esModule?i:{default:i};function n(e,t,r){var i=e<0,n=i?e.toString().substring(1):e.toString(),o=n.indexOf("."),a=-1!==o?n.substring(0,o):n,s=-1!==o?n.substring(o+1):"",l=i?"-":"";if(void 0!==r){var u="";(-1!==o||0r&&(s=s.substring(0,r));for(var h=0;hi.length)for(var o=t-(i+=-1===r?".":"").length+1,a=0;a=d.TWO_PI?"".concat("ellipse","|").concat(u,"|"):"".concat("arc","|").concat(a,"|").concat(s,"|").concat(l,"|").concat(u,"|"),!this.geometryInHash(t)){var h=new T.default.Geometry(u,1,function(){if(this.strokeIndices=[],a.toFixed(10)!==s.toFixed(10)){l!==d.PIE&&void 0!==l||(this.vertices.push(new T.default.Vector(.5,.5,0)),this.uvs.push([.5,.5]));for(var e=0;e<=u;e++){var t=(s-a)*(e/u)+a,r=.5+Math.cos(t)/2,i=.5+Math.sin(t)/2;this.vertices.push(new T.default.Vector(r,i,0)),this.uvs.push([r,i]),e>5&31)/31,(y>>10&31)/31):(r=a,i=s,l)}for(var b=1;b<=3;b++){var _=p+12*b,x=new S.default.Vector(u.getFloat32(_,!0),u.getFloat32(8+_,!0),u.getFloat32(4+_,!0));e.vertices.push(x),c&&o.push(r,i,n)}var w=new S.default.Vector(m,g,v);e.vertexNormals.push(w,w,w),e.faces.push([3*d,3*d+1,3*d+2]),e.uvs.push([0,0],[0,0],[0,0])}}(e,t);else{var r=new DataView(t);if(!("TextDecoder"in window))return console.warn("Sorry, ASCII STL loading only works in browsers that support TextDecoder (https://caniuse.com/#feat=textencoder)");var i=new TextDecoder("utf-8").decode(r).split("\n");!function(e,t){for(var r,i,n="",o=[],a=0;aMath.PI?l=Math.PI:l<=0&&(l=.001);var u=Math.sin(l)*a*Math.sin(s),h=Math.cos(l)*a,c=Math.sin(l)*a*Math.cos(s);this.camera(u+this.centerX,h+this.centerY,c+this.centerZ,this.centerX,this.centerY,this.centerZ,0,1,0)},m.default.Camera.prototype._isActive=function(){return this===this._renderer._curCamera},m.default.prototype.setCamera=function(e){this._renderer._curCamera=e,this._renderer.uPMatrix.set(e.projMatrix.mat4[0],e.projMatrix.mat4[1],e.projMatrix.mat4[2],e.projMatrix.mat4[3],e.projMatrix.mat4[4],e.projMatrix.mat4[5],e.projMatrix.mat4[6],e.projMatrix.mat4[7],e.projMatrix.mat4[8],e.projMatrix.mat4[9],e.projMatrix.mat4[10],e.projMatrix.mat4[11],e.projMatrix.mat4[12],e.projMatrix.mat4[13],e.projMatrix.mat4[14],e.projMatrix.mat4[15])};var n=m.default.Camera;r.default=n},{"../core/main":49}],98:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i,h=(i=e("../core/main"))&&i.__esModule?i:{default:i};h.default.Geometry=function(e,t,r){return this.vertices=[],this.lineVertices=[],this.lineNormals=[],this.vertexNormals=[],this.faces=[],this.uvs=[],this.edges=[],this.vertexColors=[],this.detailX=void 0!==e?e:1,this.detailY=void 0!==t?t:1,this.dirtyFlags={},r instanceof Function&&r.call(this),this},h.default.Geometry.prototype.reset=function(){this.lineVertices.length=0,this.lineNormals.length=0,this.vertices.length=0,this.edges.length=0,this.vertexColors.length=0,this.vertexNormals.length=0,this.uvs.length=0,this.dirtyFlags={}},h.default.Geometry.prototype.computeFaces=function(){this.faces.length=0;for(var e,t,r,i,n=this.detailX+1,o=0;othis.vertices.length-1-this.detailX;i--)e.add(this.vertexNormals[i]);e=h.default.Vector.div(e,this.detailX);for(var n=this.vertices.length-1;n>this.vertices.length-1-this.detailX;n--)this.vertexNormals[n]=e;return this},h.default.Geometry.prototype._makeTriangleEdges=function(){if(this.edges.length=0,Array.isArray(this.strokeIndices))for(var e=0,t=this.strokeIndices.length;e vTexCoord.y;\n bool y1 = p1.y > vTexCoord.y;\n bool y2 = p2.y > vTexCoord.y;\n\n // could web be under the curve (after t1)?\n if (y1 ? !y2 : y0) {\n // add the coverage for t1\n coverage.x += saturate(C1.x + 0.5);\n // calculate the anti-aliasing for t1\n weight.x = min(weight.x, abs(C1.x));\n }\n\n // are we outside the curve (after t2)?\n if (y1 ? !y0 : y2) {\n // subtract the coverage for t2\n coverage.x -= saturate(C2.x + 0.5);\n // calculate the anti-aliasing for t2\n weight.x = min(weight.x, abs(C2.x));\n }\n}\n\n// this is essentially the same as coverageX, but with the axes swapped\nvoid coverageY(vec2 p0, vec2 p1, vec2 p2) {\n\n vec2 C1, C2;\n calulateCrossings(p0, p1, p2, C1, C2);\n\n bool x0 = p0.x > vTexCoord.x;\n bool x1 = p1.x > vTexCoord.x;\n bool x2 = p2.x > vTexCoord.x;\n\n if (x1 ? !x2 : x0) {\n coverage.y -= saturate(C1.y + 0.5);\n weight.y = min(weight.y, abs(C1.y));\n }\n\n if (x1 ? !x0 : x2) {\n coverage.y += saturate(C2.y + 0.5);\n weight.y = min(weight.y, abs(C2.y));\n }\n}\n\nvoid main() {\n\n // calculate the pixel scale based on screen-coordinates\n pixelScale = hardness / fwidth(vTexCoord);\n\n // which grid cell is this pixel in?\n ivec2 gridCoord = ifloor(vTexCoord * vec2(uGridSize));\n\n // intersect curves in this row\n {\n // the index into the row info bitmap\n int rowIndex = gridCoord.y + uGridOffset.y;\n // fetch the info texel\n vec4 rowInfo = getTexel(uSamplerRows, rowIndex, uGridImageSize);\n // unpack the rowInfo\n int rowStrokeIndex = getInt16(rowInfo.xy);\n int rowStrokeCount = getInt16(rowInfo.zw);\n\n for (int iRowStroke = INT(0); iRowStroke < N; iRowStroke++) {\n if (iRowStroke >= rowStrokeCount)\n break;\n\n // each stroke is made up of 3 points: the start and control point\n // and the start of the next curve.\n // fetch the indices of this pair of strokes:\n vec4 strokeIndices = getTexel(uSamplerRowStrokes, rowStrokeIndex++, uCellsImageSize);\n\n // unpack the stroke index\n int strokePos = getInt16(strokeIndices.xy);\n\n // fetch the two strokes\n vec4 stroke0 = getTexel(uSamplerStrokes, strokePos + INT(0), uStrokeImageSize);\n vec4 stroke1 = getTexel(uSamplerStrokes, strokePos + INT(1), uStrokeImageSize);\n\n // calculate the coverage\n coverageX(stroke0.xy, stroke0.zw, stroke1.xy);\n }\n }\n\n // intersect curves in this column\n {\n int colIndex = gridCoord.x + uGridOffset.x;\n vec4 colInfo = getTexel(uSamplerCols, colIndex, uGridImageSize);\n int colStrokeIndex = getInt16(colInfo.xy);\n int colStrokeCount = getInt16(colInfo.zw);\n \n for (int iColStroke = INT(0); iColStroke < N; iColStroke++) {\n if (iColStroke >= colStrokeCount)\n break;\n\n vec4 strokeIndices = getTexel(uSamplerColStrokes, colStrokeIndex++, uCellsImageSize);\n\n int strokePos = getInt16(strokeIndices.xy);\n vec4 stroke0 = getTexel(uSamplerStrokes, strokePos + INT(0), uStrokeImageSize);\n vec4 stroke1 = getTexel(uSamplerStrokes, strokePos + INT(1), uStrokeImageSize);\n coverageY(stroke0.xy, stroke0.zw, stroke1.xy);\n }\n }\n\n weight = saturate(1.0 - weight * 2.0);\n float distance = max(weight.x + weight.y, minDistance); // manhattan approx.\n float antialias = abs(dot(coverage, weight) / distance);\n float cover = min(abs(coverage.x), abs(coverage.y));\n gl_FragColor = uMaterialColor;\n gl_FragColor.a *= saturate(max(antialias, cover));\n}",lineVert:"/*\n Part of the Processing project - http://processing.org\n Copyright (c) 2012-15 The Processing Foundation\n Copyright (c) 2004-12 Ben Fry and Casey Reas\n Copyright (c) 2001-04 Massachusetts Institute of Technology\n This library is free software; you can redistribute it and/or\n modify it under the terms of the GNU Lesser General Public\n License as published by the Free Software Foundation, version 2.1.\n This library is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n Lesser General Public License for more details.\n You should have received a copy of the GNU Lesser General\n Public License along with this library; if not, write to the\n Free Software Foundation, Inc., 59 Temple Place, Suite 330,\n Boston, MA 02111-1307 USA\n*/\n\n#define PROCESSING_LINE_SHADER\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform float uStrokeWeight;\n\nuniform vec4 uViewport;\nuniform int uPerspective;\n\nattribute vec4 aPosition;\nattribute vec4 aDirection;\n \nvoid main() {\n // using a scale <1 moves the lines towards the camera\n // in order to prevent popping effects due to half of\n // the line disappearing behind the geometry faces.\n vec3 scale = vec3(0.9995);\n\n vec4 posp = uModelViewMatrix * aPosition;\n vec4 posq = uModelViewMatrix * (aPosition + vec4(aDirection.xyz, 0));\n\n // Moving vertices slightly toward the camera\n // to avoid depth-fighting with the fill triangles.\n // Discussed here:\n // http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Number=252848 \n posp.xyz = posp.xyz * scale;\n posq.xyz = posq.xyz * scale;\n\n vec4 p = uProjectionMatrix * posp;\n vec4 q = uProjectionMatrix * posq;\n\n // formula to convert from clip space (range -1..1) to screen space (range 0..[width or height])\n // screen_p = (p.xy/p.w + <1,1>) * 0.5 * uViewport.zw\n\n // prevent division by W by transforming the tangent formula (div by 0 causes\n // the line to disappear, see https://github.com/processing/processing/issues/5183)\n // t = screen_q - screen_p\n //\n // tangent is normalized and we don't care which aDirection it points to (+-)\n // t = +- normalize( screen_q - screen_p )\n // t = +- normalize( (q.xy/q.w+<1,1>)*0.5*uViewport.zw - (p.xy/p.w+<1,1>)*0.5*uViewport.zw )\n //\n // extract common factor, <1,1> - <1,1> cancels out\n // t = +- normalize( (q.xy/q.w - p.xy/p.w) * 0.5 * uViewport.zw )\n //\n // convert to common divisor\n // t = +- normalize( ((q.xy*p.w - p.xy*q.w) / (p.w*q.w)) * 0.5 * uViewport.zw )\n //\n // remove the common scalar divisor/factor, not needed due to normalize and +-\n // (keep uViewport - can't remove because it has different components for x and y\n // and corrects for aspect ratio, see https://github.com/processing/processing/issues/5181)\n // t = +- normalize( (q.xy*p.w - p.xy*q.w) * uViewport.zw )\n\n vec2 tangent = normalize((q.xy*p.w - p.xy*q.w) * uViewport.zw);\n\n // flip tangent to normal (it's already normalized)\n vec2 normal = vec2(-tangent.y, tangent.x);\n\n float thickness = aDirection.w * uStrokeWeight;\n vec2 offset = normal * thickness / 2.0;\n\n vec2 curPerspScale;\n\n if(uPerspective == 1) {\n // Perspective ---\n // convert from world to clip by multiplying with projection scaling factor\n // to get the right thickness (see https://github.com/processing/processing/issues/5182)\n // invert Y, projections in Processing invert Y\n curPerspScale = (uProjectionMatrix * vec4(1, -1, 0, 0)).xy;\n } else {\n // No Perspective ---\n // multiply by W (to cancel out division by W later in the pipeline) and\n // convert from screen to clip (derived from clip to screen above)\n curPerspScale = p.w / (0.5 * uViewport.zw);\n }\n\n gl_Position.xy = p.xy + offset.xy * curPerspScale;\n gl_Position.zw = p.zw;\n}\n",lineFrag:"precision mediump float;\nprecision mediump int;\n\nuniform vec4 uMaterialColor;\n\nvoid main() {\n gl_FragColor = uMaterialColor;\n}",pointVert:"attribute vec3 aPosition;\nuniform float uPointSize;\nvarying float vStrokeWeight;\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nvoid main() {\n\tvec4 positionVec4 = vec4(aPosition, 1.0);\n\tgl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n\tgl_PointSize = uPointSize;\n\tvStrokeWeight = uPointSize;\n}",pointFrag:"precision mediump float;\nprecision mediump int;\nuniform vec4 uMaterialColor;\nvarying float vStrokeWeight;\n\nvoid main(){\n\tfloat mask = 0.0;\n\n\t// make a circular mask using the gl_PointCoord (goes from 0 - 1 on a point)\n // might be able to get a nicer edge on big strokeweights with smoothstep but slightly less performant\n\n\tmask = step(0.98, length(gl_PointCoord * 2.0 - 1.0));\n\n\t// if strokeWeight is 1 or less lets just draw a square\n\t// this prevents weird artifacting from carving circles when our points are really small\n\t// if strokeWeight is larger than 1, we just use it as is\n\n\tmask = mix(0.0, mask, clamp(floor(vStrokeWeight - 0.5),0.0,1.0));\n\n\t// throw away the borders of the mask\n // otherwise we get weird alpha blending issues\n\n\tif(mask > 0.98){\n discard;\n \t}\n\n \tgl_FragColor = vec4(uMaterialColor.rgb * (1.0 - mask), uMaterialColor.a) ;\n}"};u.default.RendererGL=function(e,t,r,i){return u.default.Renderer.call(this,e,t,r),this._setAttributeDefaults(t),this._initContext(),this.isP3D=!0,this.GL=this.drawingContext,this._isErasing=!1,this._enableLighting=!1,this.ambientLightColors=[],this.specularColors=[1,1,1],this.directionalLightDirections=[],this.directionalLightDiffuseColors=[],this.directionalLightSpecularColors=[],this.pointLightPositions=[],this.pointLightDiffuseColors=[],this.pointLightSpecularColors=[],this.spotLightPositions=[],this.spotLightDirections=[],this.spotLightDiffuseColors=[],this.spotLightSpecularColors=[],this.spotLightAngle=[],this.spotLightConc=[],this.drawMode=o.FILL,this.curFillColor=this._cachedFillStyle=[1,1,1,1],this.curStrokeColor=this._cachedStrokeStyle=[0,0,0,1],this.curBlendMode=o.BLEND,this._cachedBlendMode=void 0,this.blendExt=this.GL.getExtension("EXT_blend_minmax"),this._isBlending=!1,this._useSpecularMaterial=!1,this._useEmissiveMaterial=!1,this._useNormalMaterial=!1,this._useShininess=1,this._tint=[255,255,255,255],this.constantAttenuation=1,this.linearAttenuation=0,this.quadraticAttenuation=0,this.uMVMatrix=new u.default.Matrix,this.uPMatrix=new u.default.Matrix,this.uNMatrix=new u.default.Matrix("mat3"),this._curCamera=new u.default.Camera(this),this._curCamera._computeCameraDefaultSettings(),this._curCamera._setDefaultCamera(),this._defaultLightShader=void 0,this._defaultImmediateModeShader=void 0,this._defaultNormalShader=void 0,this._defaultColorShader=void 0,this._defaultPointShader=void 0,this.userFillShader=void 0,this.userStrokeShader=void 0,this.userPointShader=void 0,this.retainedMode={geometry:{},buffers:{stroke:[new u.default.RenderBuffer(3,"lineVertices","lineVertexBuffer","aPosition",this,this._flatten),new u.default.RenderBuffer(4,"lineNormals","lineNormalBuffer","aDirection",this,this._flatten)],fill:[new u.default.RenderBuffer(3,"vertices","vertexBuffer","aPosition",this,this._vToNArray),new u.default.RenderBuffer(3,"vertexNormals","normalBuffer","aNormal",this,this._vToNArray),new u.default.RenderBuffer(4,"vertexColors","colorBuffer","aMaterialColor",this),new u.default.RenderBuffer(3,"vertexAmbients","ambientBuffer","aAmbientColor",this),new u.default.RenderBuffer(2,"uvs","uvBuffer","aTexCoord",this,this._flatten)],text:[new u.default.RenderBuffer(3,"vertices","vertexBuffer","aPosition",this,this._vToNArray),new u.default.RenderBuffer(2,"uvs","uvBuffer","aTexCoord",this,this._flatten)]}},this.immediateMode={geometry:new u.default.Geometry,shapeMode:o.TRIANGLE_FAN,_bezierVertex:[],_quadraticVertex:[],_curveVertex:[],buffers:{fill:[new u.default.RenderBuffer(3,"vertices","vertexBuffer","aPosition",this,this._vToNArray),new u.default.RenderBuffer(3,"vertexNormals","normalBuffer","aNormal",this,this._vToNArray),new u.default.RenderBuffer(4,"vertexColors","colorBuffer","aVertexColor",this),new u.default.RenderBuffer(3,"vertexAmbients","ambientBuffer","aAmbientColor",this),new u.default.RenderBuffer(2,"uvs","uvBuffer","aTexCoord",this,this._flatten)],stroke:[new u.default.RenderBuffer(3,"lineVertices","lineVertexBuffer","aPosition",this,this._flatten),new u.default.RenderBuffer(4,"lineNormals","lineNormalBuffer","aDirection",this,this._flatten)],point:this.GL.createBuffer()}},this.pointSize=5,this.curStrokeWeight=1,this.textures=[],this.textureMode=o.IMAGE,this.textureWrapX=o.CLAMP,this.textureWrapY=o.CLAMP,this._tex=null,this._curveTightness=6,this._lookUpTableBezier=[],this._lookUpTableQuadratic=[],this._lutBezierDetail=0,this._lutQuadraticDetail=0,this._tessy=this._initTessy(),this.fontInfos={},this._curShader=void 0,this},u.default.RendererGL.prototype=Object.create(u.default.Renderer.prototype),u.default.RendererGL.prototype._setAttributeDefaults=function(e){var t={alpha:!0,depth:!0,stencil:!0,antialias:navigator.userAgent.toLowerCase().includes("safari"),premultipliedAlpha:!1,preserveDrawingBuffer:!0,perPixelLighting:!0};null===e._glAttributes?e._glAttributes=t:e._glAttributes=Object.assign(t,e._glAttributes)},u.default.RendererGL.prototype._initContext=function(){try{if(this.drawingContext=this.canvas.getContext("webgl",this._pInst._glAttributes)||this.canvas.getContext("experimental-webgl",this._pInst._glAttributes),null===this.drawingContext)throw new Error("Error creating webgl context");var e=this.drawingContext;e.enable(e.DEPTH_TEST),e.depthFunc(e.LEQUAL),e.viewport(0,0,e.drawingBufferWidth,e.drawingBufferHeight),this._viewport=this.drawingContext.getParameter(this.drawingContext.VIEWPORT)}catch(e){throw e}},u.default.RendererGL.prototype._resetContext=function(e,t){var r=this.width,i=this.height,n=this.canvas.id,o=this._pInst instanceof u.default.Graphics;if(o){var a=this._pInst;a.canvas.parentNode.removeChild(a.canvas),a.canvas=document.createElement("canvas"),(a._pInst._userNode||document.body).appendChild(a.canvas),u.default.Element.call(a,a.canvas,a._pInst),a.width=r,a.height=i}else{var s=this.canvas;s&&s.parentNode.removeChild(s),(s=document.createElement("canvas")).id=n,this._pInst._userNode?this._pInst._userNode.appendChild(s):document.body.appendChild(s),this._pInst.canvas=s}var l=new u.default.RendererGL(this._pInst.canvas,this._pInst,!o);this._pInst._setProperty("_renderer",l),l.resize(r,i),l._applyDefaults(),o||this._pInst._elements.push(l),"function"==typeof t&&setTimeout(function(){t.apply(window._renderer,e)},0)},u.default.prototype.setAttributes=function(e,t){if(void 0!==this._glAttributes){var r=!0;if(void 0!==t?(null===this._glAttributes&&(this._glAttributes={}),this._glAttributes[e]!==t&&(this._glAttributes[e]=t,r=!1)):e instanceof Object&&this._glAttributes!==e&&(this._glAttributes=e,r=!1),this._renderer.isP3D&&!r){if(!this._setupDone)for(var i in this._renderer.retainedMode.geometry)if(this._renderer.retainedMode.geometry.hasOwnProperty(i))return void console.error("Sorry, Could not set the attributes, you need to call setAttributes() before calling the other drawing methods in setup()");this.push(),this._renderer._resetContext(),this.pop(),this._renderer._curCamera&&(this._renderer._curCamera._renderer=this._renderer)}}else console.log("You are trying to use setAttributes on a p5.Graphics object that does not use a WEBGL renderer.")},u.default.RendererGL.prototype._update=function(){this.uMVMatrix.set(this._curCamera.cameraMatrix.mat4[0],this._curCamera.cameraMatrix.mat4[1],this._curCamera.cameraMatrix.mat4[2],this._curCamera.cameraMatrix.mat4[3],this._curCamera.cameraMatrix.mat4[4],this._curCamera.cameraMatrix.mat4[5],this._curCamera.cameraMatrix.mat4[6],this._curCamera.cameraMatrix.mat4[7],this._curCamera.cameraMatrix.mat4[8],this._curCamera.cameraMatrix.mat4[9],this._curCamera.cameraMatrix.mat4[10],this._curCamera.cameraMatrix.mat4[11],this._curCamera.cameraMatrix.mat4[12],this._curCamera.cameraMatrix.mat4[13],this._curCamera.cameraMatrix.mat4[14],this._curCamera.cameraMatrix.mat4[15]),this.ambientLightColors.length=0,this.specularColors=[1,1,1],this.directionalLightDirections.length=0,this.directionalLightDiffuseColors.length=0,this.directionalLightSpecularColors.length=0,this.pointLightPositions.length=0,this.pointLightDiffuseColors.length=0,this.pointLightSpecularColors.length=0,this.spotLightPositions.length=0,this.spotLightDirections.length=0,this.spotLightDiffuseColors.length=0,this.spotLightSpecularColors.length=0,this.spotLightAngle.length=0,this.spotLightConc.length=0,this._enableLighting=!1,this._tint=[255,255,255,255],this.GL.clear(this.GL.DEPTH_BUFFER_BIT)},u.default.RendererGL.prototype.background=function(){var e,t=(e=this._pInst).color.apply(e,arguments),r=t.levels[0]/255,i=t.levels[1]/255,n=t.levels[2]/255,o=t.levels[3]/255;this.GL.clearColor(r,i,n,o),this.GL.clear(this.GL.COLOR_BUFFER_BIT)},u.default.RendererGL.prototype.fill=function(e,t,r,i){var n=u.default.prototype.color.apply(this._pInst,arguments);this.curFillColor=n._array,this.drawMode=o.FILL,this._useNormalMaterial=!1,this._tex=null},u.default.RendererGL.prototype.stroke=function(e,t,r,i){arguments[3]=255;var n=u.default.prototype.color.apply(this._pInst,arguments);this.curStrokeColor=n._array},u.default.RendererGL.prototype.strokeCap=function(e){console.error("Sorry, strokeCap() is not yet implemented in WEBGL mode")},u.default.RendererGL.prototype.strokeJoin=function(e){console.error("Sorry, strokeJoin() is not yet implemented in WEBGL mode")},u.default.RendererGL.prototype.filter=function(e){console.error("filter() does not work in WEBGL mode")},u.default.RendererGL.prototype.blendMode=function(e){e===o.DARKEST||e===o.LIGHTEST||e===o.ADD||e===o.BLEND||e===o.SUBTRACT||e===o.SCREEN||e===o.EXCLUSION||e===o.REPLACE||e===o.MULTIPLY||e===o.REMOVE?this.curBlendMode=e:e!==o.BURN&&e!==o.OVERLAY&&e!==o.HARD_LIGHT&&e!==o.SOFT_LIGHT&&e!==o.DODGE||console.warn("BURN, OVERLAY, HARD_LIGHT, SOFT_LIGHT, and DODGE only work for blendMode in 2D mode.")},u.default.RendererGL.prototype.erase=function(e,t){this._isErasing||(this._cachedBlendMode=this.curBlendMode,this.blendMode(o.REMOVE),this._cachedFillStyle=this.curFillColor.slice(),this.curFillColor=[1,1,1,e/255],this._cachedStrokeStyle=this.curStrokeColor.slice(),this.curStrokeColor=[1,1,1,t/255],this._isErasing=!0)},u.default.RendererGL.prototype.noErase=function(){this._isErasing&&(this.curFillColor=this._cachedFillStyle.slice(),this.curStrokeColor=this._cachedStrokeStyle.slice(),this.blendMode(this._cachedBlendMode),this._isErasing=!1)},u.default.RendererGL.prototype.strokeWeight=function(e){this.curStrokeWeight!==e&&(this.pointSize=e,this.curStrokeWeight=e)},u.default.RendererGL.prototype._getPixel=function(e,t){var r;return r=new Uint8Array(4),this.drawingContext.readPixels(e,t,1,1,this.drawingContext.RGBA,this.drawingContext.UNSIGNED_BYTE,r),[r[0],r[1],r[2],r[3]]},u.default.RendererGL.prototype.loadPixels=function(){var e=this._pixelsState;if(!0===this._pInst._glAttributes.preserveDrawingBuffer){var t=e.pixels,r=this.GL.drawingBufferWidth*this.GL.drawingBufferHeight*4;t instanceof Uint8Array&&t.length===r||(t=new Uint8Array(r),this._pixelsState._setProperty("pixels",t));var i=this._pInst._pixelDensity;this.GL.readPixels(0,0,this.width*i,this.height*i,this.GL.RGBA,this.GL.UNSIGNED_BYTE,t)}else console.log("loadPixels only works in WebGL when preserveDrawingBuffer is true.")},u.default.RendererGL.prototype.geometryInHash=function(e){return void 0!==this.retainedMode.geometry[e]},u.default.RendererGL.prototype.resize=function(e,t){u.default.Renderer.prototype.resize.call(this,e,t),this.GL.viewport(0,0,this.GL.drawingBufferWidth,this.GL.drawingBufferHeight),this._viewport=this.GL.getParameter(this.GL.VIEWPORT),this._curCamera._resize();var r=this._pixelsState;void 0!==r.pixels&&r._setProperty("pixels",new Uint8Array(this.GL.drawingBufferWidth*this.GL.drawingBufferHeight*4))},u.default.RendererGL.prototype.clear=function(){var e=(arguments.length<=0?void 0:arguments[0])||0,t=(arguments.length<=1?void 0:arguments[1])||0,r=(arguments.length<=2?void 0:arguments[2])||0,i=(arguments.length<=3?void 0:arguments[3])||0;this.GL.clearColor(e,t,r,i),this.GL.clear(this.GL.COLOR_BUFFER_BIT|this.GL.DEPTH_BUFFER_BIT)},u.default.RendererGL.prototype.applyMatrix=function(e,t,r,i,n,o){16===arguments.length?u.default.Matrix.prototype.apply.apply(this.uMVMatrix,arguments):this.uMVMatrix.apply([e,t,0,0,r,i,0,0,0,0,1,0,n,o,0,1])},u.default.RendererGL.prototype.translate=function(e,t,r){return e instanceof u.default.Vector&&(r=e.z,t=e.y,e=e.x),this.uMVMatrix.translate([e,t,r]),this},u.default.RendererGL.prototype.scale=function(e,t,r){return this.uMVMatrix.scale(e,t,r),this},u.default.RendererGL.prototype.rotate=function(e,t){return void 0===t?this.rotateZ(e):(u.default.Matrix.prototype.rotate.apply(this.uMVMatrix,arguments),this)},u.default.RendererGL.prototype.rotateX=function(e){return this.rotate(e,1,0,0),this},u.default.RendererGL.prototype.rotateY=function(e){return this.rotate(e,0,1,0),this},u.default.RendererGL.prototype.rotateZ=function(e){return this.rotate(e,0,0,1),this},u.default.RendererGL.prototype.push=function(){var e=u.default.Renderer.prototype.push.apply(this),t=e.properties;return t.uMVMatrix=this.uMVMatrix.copy(),t.uPMatrix=this.uPMatrix.copy(),t._curCamera=this._curCamera,this._curCamera=this._curCamera.copy(),t.ambientLightColors=this.ambientLightColors.slice(),t.specularColors=this.specularColors.slice(),t.directionalLightDirections=this.directionalLightDirections.slice(),t.directionalLightDiffuseColors=this.directionalLightDiffuseColors.slice(),t.directionalLightSpecularColors=this.directionalLightSpecularColors.slice(),t.pointLightPositions=this.pointLightPositions.slice(),t.pointLightDiffuseColors=this.pointLightDiffuseColors.slice(),t.pointLightSpecularColors=this.pointLightSpecularColors.slice(),t.spotLightPositions=this.spotLightPositions.slice(),t.spotLightDirections=this.spotLightDirections.slice(),t.spotLightDiffuseColors=this.spotLightDiffuseColors.slice(),t.spotLightSpecularColors=this.spotLightSpecularColors.slice(),t.spotLightAngle=this.spotLightAngle.slice(),t.spotLightConc=this.spotLightConc.slice(),t.userFillShader=this.userFillShader,t.userStrokeShader=this.userStrokeShader,t.userPointShader=this.userPointShader,t.pointSize=this.pointSize,t.curStrokeWeight=this.curStrokeWeight,t.curStrokeColor=this.curStrokeColor,t.curFillColor=this.curFillColor,t._useSpecularMaterial=this._useSpecularMaterial,t._useEmissiveMaterial=this._useEmissiveMaterial,t._useShininess=this._useShininess,t.constantAttenuation=this.constantAttenuation,t.linearAttenuation=this.linearAttenuation,t.quadraticAttenuation=this.quadraticAttenuation,t._enableLighting=this._enableLighting,t._useNormalMaterial=this._useNormalMaterial,t._tex=this._tex,t.drawMode=this.drawMode,e},u.default.RendererGL.prototype.resetMatrix=function(){return this.uMVMatrix=u.default.Matrix.identity(this._pInst),this},u.default.RendererGL.prototype._getImmediateStrokeShader=function(){var e=this.userStrokeShader;return e&&e.isStrokeShader()?e:this._getLineShader()},u.default.RendererGL.prototype._getRetainedStrokeShader=u.default.RendererGL.prototype._getImmediateStrokeShader,u.default.RendererGL.prototype._getImmediateFillShader=function(){var e=this.userFillShader;if(this._useNormalMaterial&&(!e||!e.isNormalShader()))return this._getNormalShader();if(this._enableLighting){if(!e||!e.isLightShader())return this._getLightShader()}else if(this._tex){if(!e||!e.isTextureShader())return this._getLightShader()}else if(!e)return this._getImmediateModeShader();return e},u.default.RendererGL.prototype._getRetainedFillShader=function(){if(this._useNormalMaterial)return this._getNormalShader();var e=this.userFillShader;if(this._enableLighting){if(!e||!e.isLightShader())return this._getLightShader()}else if(this._tex){if(!e||!e.isTextureShader())return this._getLightShader()}else if(!e)return this._getColorShader();return e},u.default.RendererGL.prototype._getImmediatePointShader=function(){var e=this.userPointShader;return e&&e.isPointShader()?e:this._getPointShader()},u.default.RendererGL.prototype._getRetainedLineShader=u.default.RendererGL.prototype._getImmediateLineShader,u.default.RendererGL.prototype._getLightShader=function(){return this._defaultLightShader||(this._pInst._glAttributes.perPixelLighting?this._defaultLightShader=new u.default.Shader(this,c.phongVert,c.phongFrag):this._defaultLightShader=new u.default.Shader(this,c.lightVert,c.lightTextureFrag)),this._defaultLightShader},u.default.RendererGL.prototype._getImmediateModeShader=function(){return this._defaultImmediateModeShader||(this._defaultImmediateModeShader=new u.default.Shader(this,c.immediateVert,c.vertexColorFrag)),this._defaultImmediateModeShader},u.default.RendererGL.prototype._getNormalShader=function(){return this._defaultNormalShader||(this._defaultNormalShader=new u.default.Shader(this,c.normalVert,c.normalFrag)),this._defaultNormalShader},u.default.RendererGL.prototype._getColorShader=function(){return this._defaultColorShader||(this._defaultColorShader=new u.default.Shader(this,c.normalVert,c.basicFrag)),this._defaultColorShader},u.default.RendererGL.prototype._getPointShader=function(){return this._defaultPointShader||(this._defaultPointShader=new u.default.Shader(this,c.pointVert,c.pointFrag)),this._defaultPointShader},u.default.RendererGL.prototype._getLineShader=function(){return this._defaultLineShader||(this._defaultLineShader=new u.default.Shader(this,c.lineVert,c.lineFrag)),this._defaultLineShader},u.default.RendererGL.prototype._getFontShader=function(){return this._defaultFontShader||(this.GL.getExtension("OES_standard_derivatives"),this._defaultFontShader=new u.default.Shader(this,c.fontVert,c.fontFrag)),this._defaultFontShader},u.default.RendererGL.prototype._getEmptyTexture=function(){if(!this._emptyTexture){var e=new u.default.Image(1,1);e.set(0,0,255),this._emptyTexture=new u.default.Texture(this,e)}return this._emptyTexture},u.default.RendererGL.prototype.getTexture=function(e){var t=this.textures,r=!0,i=!1,n=void 0;try{for(var o,a=t[Symbol.iterator]();!(r=(o=a.next()).done);r=!0){var s=o.value;if(s.src===e)return s}}catch(e){i=!0,n=e}finally{try{r||null==a.return||a.return()}finally{if(i)throw n}}var l=new u.default.Texture(this,e);return t.push(l),l},u.default.RendererGL.prototype._setStrokeUniforms=function(e){e.bindShader(),e.setUniform("uMaterialColor",this.curStrokeColor),e.setUniform("uStrokeWeight",this.curStrokeWeight)},u.default.RendererGL.prototype._setFillUniforms=function(e){e.bindShader(),e.setUniform("uMaterialColor",this.curFillColor),e.setUniform("isTexture",!!this._tex),this._tex&&e.setUniform("uSampler",this._tex),e.setUniform("uTint",this._tint),e.setUniform("uSpecular",this._useSpecularMaterial),e.setUniform("uEmissive",this._useEmissiveMaterial),e.setUniform("uShininess",this._useShininess),e.setUniform("uUseLighting",this._enableLighting);var t=this.pointLightDiffuseColors.length/3;e.setUniform("uPointLightCount",t),e.setUniform("uPointLightLocation",this.pointLightPositions),e.setUniform("uPointLightDiffuseColors",this.pointLightDiffuseColors),e.setUniform("uPointLightSpecularColors",this.pointLightSpecularColors);var r=this.directionalLightDiffuseColors.length/3;e.setUniform("uDirectionalLightCount",r),e.setUniform("uLightingDirection",this.directionalLightDirections),e.setUniform("uDirectionalDiffuseColors",this.directionalLightDiffuseColors),e.setUniform("uDirectionalSpecularColors",this.directionalLightSpecularColors);var i=this.ambientLightColors.length/3;e.setUniform("uAmbientLightCount",i),e.setUniform("uAmbientColor",this.ambientLightColors);var n=this.spotLightDiffuseColors.length/3;e.setUniform("uSpotLightCount",n),e.setUniform("uSpotLightAngle",this.spotLightAngle),e.setUniform("uSpotLightConc",this.spotLightConc),e.setUniform("uSpotLightDiffuseColors",this.spotLightDiffuseColors),e.setUniform("uSpotLightSpecularColors",this.spotLightSpecularColors),e.setUniform("uSpotLightLocation",this.spotLightPositions),e.setUniform("uSpotLightDirection",this.spotLightDirections),e.setUniform("uConstantAttenuation",this.constantAttenuation),e.setUniform("uLinearAttenuation",this.linearAttenuation),e.setUniform("uQuadraticAttenuation",this.quadraticAttenuation),e.bindTextures()},u.default.RendererGL.prototype._setPointUniforms=function(e){e.bindShader(),e.setUniform("uMaterialColor",this.curStrokeColor),e.setUniform("uPointSize",this.pointSize)},u.default.RendererGL.prototype._bindBuffer=function(e,t,r,i,n){if(t=t||this.GL.ARRAY_BUFFER,this.GL.bindBuffer(t,e),void 0!==r){var o=new(i||Float32Array)(r);this.GL.bufferData(t,o,n||this.GL.STATIC_DRAW)}},u.default.RendererGL.prototype._arraysEqual=function(e,t){var r=e.length;if(r!==t.length)return!1;for(var i=0;i>7,127&f,c>>7,127&c);for(var d=0;d>7,127&p,0,0)}}return{cellImageInfo:l,dimOffset:o,dimImageInfo:n}}return(t=this.glyphInfos[e.index]={glyph:e,uGlyphRect:[i.x1,-i.y1,i.x2,-i.y2],strokeImageInfo:U,strokes:d,colInfo:G(m,this.colDimImageInfos,this.colCellImageInfos),rowInfo:G(p,this.rowDimImageInfos,this.rowCellImageInfos)}).uGridOffset=[t.colInfo.dimOffset,t.rowInfo.dimOffset],t}}var z=Math.sqrt(3);j.default.RendererGL.prototype._renderText=function(e,t,r,i,n){if(this._textFont&&"string"!=typeof this._textFont){if(!(n<=i)&&this._doFill){if(!this._isOpenType())return console.log("WEBGL: only Opentype (.otf) and Truetype (.ttf) fonts are supported"),e;e.push();var o=this._doStroke,a=this.drawMode;this._doStroke=!1,this.drawMode=D.TEXTURE;var s=this._textFont.font,l=this._textFont._fontInfo;l=l||(this._textFont._fontInfo=new A(s));var u=this._textFont._handleAlignment(this,t,r,i),h=this._textSize/s.unitsPerEm;this.translate(u.x,u.y,0),this.scale(h,h,1);var c=this.GL,f=!this._defaultFontShader,d=this._getFontShader();d.init(),d.bindShader(),f&&(d.setUniform("uGridImageSize",[64,64]),d.setUniform("uCellsImageSize",[64,64]),d.setUniform("uStrokeImageSize",[64,64]),d.setUniform("uGridSize",[9,9])),this._applyColorBlend(this.curFillColor);var p=this.retainedMode.geometry.glyph;if(!p){var m=this._textGeom=new j.default.Geometry(1,1,function(){for(var e=0;e<=1;e++)for(var t=0;t<=1;t++)this.vertices.push(new j.default.Vector(t,e,0)),this.uvs.push(t,e)});m.computeFaces().computeNormals(),p=this.createBuffers("glyph",m)}var g=!0,v=!1,y=void 0;try{for(var b,_=this.retainedMode.buffers.text[Symbol.iterator]();!(g=(b=_.next()).done);g=!0){b.value._prepareBuffer(p,d)}}catch(e){v=!0,y=e}finally{try{g||null==_.return||_.return()}finally{if(v)throw y}}this._bindBuffer(p.indexBuffer,c.ELEMENT_ARRAY_BUFFER),d.setUniform("uMaterialColor",this.curFillColor);try{var x=0,w=null,S=s.stringToGlyphs(t),M=!0,E=!1,T=void 0;try{for(var C,P=S[Symbol.iterator]();!(M=(C=P.next()).done);M=!0){var L=C.value;w&&(x+=s.getKerningValue(w,L));var k=l.getGlyphInfo(L);if(k.uGlyphRect){var R=k.rowInfo,O=k.colInfo;d.setUniform("uSamplerStrokes",k.strokeImageInfo.imageData),d.setUniform("uSamplerRowStrokes",R.cellImageInfo.imageData),d.setUniform("uSamplerRows",R.dimImageInfo.imageData),d.setUniform("uSamplerColStrokes",O.cellImageInfo.imageData),d.setUniform("uSamplerCols",O.dimImageInfo.imageData),d.setUniform("uGridOffset",k.uGridOffset),d.setUniform("uGlyphRect",k.uGlyphRect),d.setUniform("uGlyphOffset",x),d.bindTextures(),c.drawElements(c.TRIANGLES,6,this.GL.UNSIGNED_SHORT,0)}x+=L.advanceWidth,w=L}}catch(e){E=!0,T=e}finally{try{M||null==P.return||P.return()}finally{if(E)throw T}}}finally{d.unbindShader(),this._doStroke=o,this.drawMode=a,e.pop()}return e}}else console.log("WEBGL: you must load and set a font before drawing text. See `loadFont` and `textFont` for more details.")}},{"../core/constants":42,"../core/main":49,"./p5.RendererGL.Retained":102,"./p5.Shader":104}],107:[function(e,t,r){t.exports={fes:{autoplay:"The media that tried to play (with '{{src}}') wasn't allowed to by this browser, most likely due to the browser's autoplay policy. Check out {{link}} for more information about why.",fileLoadError:{bytes:"It looks like there was a problem loading your file. {{suggestion}}",font:"It looks like there was a problem loading your font. {{suggestion}}",gif:"There was some trouble loading your GIF. Make sure that your GIF is using 87a or 89a encoding.",image:"It looks like there was a problem loading your image. {{suggestion}}",json:"It looks like there was a problem loading your JSON file. {{suggestion}}",large:"If your large file isn't fetched successfully, we recommend splitting the file into smaller segments and fetching those.",strings:"It looks like there was a problem loading your text file. {{suggestion}}",suggestion:"Try checking if the file path ({{filePath}}) is correct, hosting the file online, or running a local server. (More info at {{link}})",table:"It looks like there was a problem loading your table file. {{suggestion}}",xml:"It looks like there was a problem loading your XML file. {{suggestion}}"},misusedTopLevel:"Did you just try to use p5.js's {{symbolName}} {{symbolType}}? If so, you may want to move it into your sketch's setup() function.\n\nFor more details, see: {{link}}",pre:"🌸 p5.js says: {{message}}",welcome:"Welcome! This is your friendly debugger. To turn me off, switch to using p5.min.js."}}},{}],108:[function(e,t,r){t.exports={fes:{autoplay:"Su browser impidío un medio tocar (de '{{src}}'), posiblemente porque las reglas de autoplay. Para aprender más, visite {{link}}.",fileLoadError:{bytes:"",font:"",gif:"",image:"",json:"",large:"",strings:"",suggestion:"",table:"",xml:""},misusedTopLevel:"",pre:"🌸 p5.js dice: {{message}}",welcome:""}}},{}],109:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i=o(e("./en/translation")),n=o(e("./es/translation"));function o(e){return e&&e.__esModule?e:{default:e}}var a={en:{translation:i.default},es:{translation:n.default}};r.default=a},{"./en/translation":107,"./es/translation":108}]},{},[37])(37)}); ================================================ FILE: docs/examples/transcrypt/sketch_008/target/org.transcrypt.__runtime__.js ================================================ // Transcrypt'ed from Python, 2021-11-02 13:06:16 var __name__ = 'org.transcrypt.__runtime__'; export var __envir__ = {}; __envir__.interpreter_name = 'python'; __envir__.transpiler_name = 'transcrypt'; __envir__.executor_name = __envir__.transpiler_name; __envir__.transpiler_version = '3.9.0'; export function __nest__ (headObject, tailNames, value) { var current = headObject; if (tailNames != '') { var tailChain = tailNames.split ('.'); var firstNewIndex = tailChain.length; for (var index = 0; index < tailChain.length; index++) { if (!current.hasOwnProperty (tailChain [index])) { firstNewIndex = index; break; } current = current [tailChain [index]]; } for (var index = firstNewIndex; index < tailChain.length; index++) { current [tailChain [index]] = {}; current = current [tailChain [index]]; } } for (let attrib of Object.getOwnPropertyNames (value)) { Object.defineProperty (current, attrib, { get () {return value [attrib];}, enumerable: true, configurable: true }); } }; export function __init__ (module) { if (!module.__inited__) { module.__all__.__init__ (module.__all__); module.__inited__ = true; } return module.__all__; }; export function __get__ (aThis, func, quotedFuncName) { if (aThis) { if (aThis.hasOwnProperty ('__class__') || typeof aThis == 'string' || aThis instanceof String) { if (quotedFuncName) { Object.defineProperty (aThis, quotedFuncName, { value: function () { var args = [] .slice.apply (arguments); return func.apply (null, [aThis] .concat (args)); }, writable: true, enumerable: true, configurable: true }); } return function () { var args = [] .slice.apply (arguments); return func.apply (null, [aThis.__proxy__ ? aThis.__proxy__ : aThis] .concat (args)); }; } else { return func; } } else { return func; } }; export function __getcm__ (aThis, func, quotedFuncName) { if (aThis.hasOwnProperty ('__class__')) { return function () { var args = [] .slice.apply (arguments); return func.apply (null, [aThis.__class__] .concat (args)); }; } else { return function () { var args = [] .slice.apply (arguments); return func.apply (null, [aThis] .concat (args)); }; } }; export function __getsm__ (aThis, func, quotedFuncName) { return func; }; export var py_metatype = { __name__: 'type', __bases__: [], __new__: function (meta, name, bases, attribs) { var cls = function () { var args = [] .slice.apply (arguments); return cls.__new__ (args); }; for (var index = bases.length - 1; index >= 0; index--) { var base = bases [index]; for (var attrib in base) { var descrip = Object.getOwnPropertyDescriptor (base, attrib); if (descrip == null) { continue; } Object.defineProperty (cls, attrib, descrip); } for (let symbol of Object.getOwnPropertySymbols (base)) { let descrip = Object.getOwnPropertyDescriptor (base, symbol); Object.defineProperty (cls, symbol, descrip); } } cls.__metaclass__ = meta; cls.__name__ = name.startsWith ('py_') ? name.slice (3) : name; cls.__bases__ = bases; for (var attrib in attribs) { var descrip = Object.getOwnPropertyDescriptor (attribs, attrib); Object.defineProperty (cls, attrib, descrip); } for (let symbol of Object.getOwnPropertySymbols (attribs)) { let descrip = Object.getOwnPropertyDescriptor (attribs, symbol); Object.defineProperty (cls, symbol, descrip); } return cls; } }; py_metatype.__metaclass__ = py_metatype; export var object = { __init__: function (self) {}, __metaclass__: py_metatype, __name__: 'object', __bases__: [], __new__: function (args) { var instance = Object.create (this, {__class__: {value: this, enumerable: true}}); if ('__getattr__' in this || '__setattr__' in this) { instance.__proxy__ = new Proxy (instance, { get: function (target, name) { let result = target [name]; if (result == undefined) { return target.__getattr__ (name); } else { return result; } }, set: function (target, name, value) { try { target.__setattr__ (name, value); } catch (exception) { target [name] = value; } return true; } }) instance = instance.__proxy__ } this.__init__.apply (null, [instance] .concat (args)); return instance; } }; export function __class__ (name, bases, attribs, meta) { if (meta === undefined) { meta = bases [0] .__metaclass__; } return meta.__new__ (meta, name, bases, attribs); }; export function __pragma__ () {}; export function __call__ (/* , , * */) { var args = [] .slice.apply (arguments); if (typeof args [0] == 'object' && '__call__' in args [0]) { return args [0] .__call__ .apply (args [1], args.slice (2)); } else { return args [0] .apply (args [1], args.slice (2)); } }; __envir__.executor_name = __envir__.transpiler_name; var __main__ = {__file__: ''}; var __except__ = null; export function __kwargtrans__ (anObject) { anObject.__kwargtrans__ = null; anObject.constructor = Object; return anObject; } export function __super__ (aClass, methodName) { for (let base of aClass.__bases__) { if (methodName in base) { return base [methodName]; } } throw new Exception ('Superclass method not found'); } export function property (getter, setter) { if (!setter) { setter = function () {}; } return {get: function () {return getter (this)}, set: function (value) {setter (this, value)}, enumerable: true}; } export function __setproperty__ (anObject, name, descriptor) { if (!anObject.hasOwnProperty (name)) { Object.defineProperty (anObject, name, descriptor); } } export function assert (condition, message) { if (!condition) { throw AssertionError (message, new Error ()); } } export function __mergekwargtrans__ (object0, object1) { var result = {}; for (var attrib in object0) { result [attrib] = object0 [attrib]; } for (var attrib in object1) { result [attrib] = object1 [attrib]; } return result; }; export function __mergefields__ (targetClass, sourceClass) { let fieldNames = ['__reprfields__', '__comparefields__', '__initfields__'] if (sourceClass [fieldNames [0]]) { if (targetClass [fieldNames [0]]) { for (let fieldName of fieldNames) { targetClass [fieldName] = new Set ([...targetClass [fieldName], ...sourceClass [fieldName]]); } } else { for (let fieldName of fieldNames) { targetClass [fieldName] = new Set (sourceClass [fieldName]); } } } } export function __withblock__ (manager, statements) { if (hasattr (manager, '__enter__')) { try { manager.__enter__ (); statements (); manager.__exit__ (); } catch (exception) { if (! (manager.__exit__ (exception.name, exception, exception.stack))) { throw exception; } } } else { statements (); manager.close (); } }; export function dir (obj) { var aList = []; for (var aKey in obj) { aList.push (aKey.startsWith ('py_') ? aKey.slice (3) : aKey); } aList.sort (); return aList; }; export function setattr (obj, name, value) { obj [name] = value; }; export function getattr (obj, name) { return name in obj ? obj [name] : obj ['py_' + name]; }; export function hasattr (obj, name) { try { return name in obj || 'py_' + name in obj; } catch (exception) { return false; } }; export function delattr (obj, name) { if (name in obj) { delete obj [name]; } else { delete obj ['py_' + name]; } }; export function __in__ (element, container) { if (container === undefined || container === null) { return false; } if (container.__contains__ instanceof Function) { return container.__contains__ (element); } else { return ( container.indexOf ? container.indexOf (element) > -1 : container.hasOwnProperty (element) ); } }; export function __specialattrib__ (attrib) { return (attrib.startswith ('__') && attrib.endswith ('__')) || attrib == 'constructor' || attrib.startswith ('py_'); }; export function len (anObject) { if (anObject === undefined || anObject === null) { return 0; } if (anObject.__len__ instanceof Function) { return anObject.__len__ (); } if (anObject.length !== undefined) { return anObject.length; } var length = 0; for (var attr in anObject) { if (!__specialattrib__ (attr)) { length++; } } return length; }; export function __i__ (any) { return py_typeof (any) == dict ? any.py_keys () : any; } export function __k__ (keyed, key) { var result = keyed [key]; if (typeof result == 'undefined') { if (keyed instanceof Array) if (key == +key && key >= 0 && keyed.length > key) return result; else throw IndexError (key, new Error()); else throw KeyError (key, new Error()); } return result; } export function __t__ (target) { return ( target === undefined || target === null ? false : ['boolean', 'number'] .indexOf (typeof target) >= 0 ? target : target.__bool__ instanceof Function ? (target.__bool__ () ? target : false) : target.__len__ instanceof Function ? (target.__len__ () !== 0 ? target : false) : target instanceof Function ? target : len (target) !== 0 ? target : false ); } export function float (any) { if (any == 'inf') { return Infinity; } else if (any == '-inf') { return -Infinity; } else if (any == 'nan') { return NaN; } else if (isNaN (parseFloat (any))) { if (any === false) { return 0; } else if (any === true) { return 1; } else { throw ValueError ("could not convert string to float: '" + str(any) + "'", new Error ()); } } else { return +any; } }; float.__name__ = 'float'; float.__bases__ = [object]; export function int (any) { return float (any) | 0 }; int.__name__ = 'int'; int.__bases__ = [object]; export function bool (any) { return !!__t__ (any); }; bool.__name__ = 'bool'; bool.__bases__ = [int]; export function py_typeof (anObject) { var aType = typeof anObject; if (aType == 'object') { try { return '__class__' in anObject ? anObject.__class__ : object; } catch (exception) { return aType; } } else { return ( aType == 'boolean' ? bool : aType == 'string' ? str : aType == 'number' ? (anObject % 1 == 0 ? int : float) : null ); } }; export function issubclass (aClass, classinfo) { if (classinfo instanceof Array) { for (let aClass2 of classinfo) { if (issubclass (aClass, aClass2)) { return true; } } return false; } try { var aClass2 = aClass; if (aClass2 == classinfo) { return true; } else { var bases = [].slice.call (aClass2.__bases__); while (bases.length) { aClass2 = bases.shift (); if (aClass2 == classinfo) { return true; } if (aClass2.__bases__.length) { bases = [].slice.call (aClass2.__bases__).concat (bases); } } return false; } } catch (exception) { return aClass == classinfo || classinfo == object; } }; export function isinstance (anObject, classinfo) { try { return '__class__' in anObject ? issubclass (anObject.__class__, classinfo) : issubclass (py_typeof (anObject), classinfo); } catch (exception) { return issubclass (py_typeof (anObject), classinfo); } }; export function callable (anObject) { return anObject && typeof anObject == 'object' && '__call__' in anObject ? true : typeof anObject === 'function'; }; export function repr (anObject) { try { return anObject.__repr__ (); } catch (exception) { try { return anObject.__str__ (); } catch (exception) { try { if (anObject == null) { return 'None'; } else if (anObject.constructor == Object) { var result = '{'; var comma = false; for (var attrib in anObject) { if (!__specialattrib__ (attrib)) { if (attrib.isnumeric ()) { var attribRepr = attrib; } else { var attribRepr = '\'' + attrib + '\''; } if (comma) { result += ', '; } else { comma = true; } result += attribRepr + ': ' + repr (anObject [attrib]); } } result += '}'; return result; } else { return typeof anObject == 'boolean' ? anObject.toString () .capitalize () : anObject.toString (); } } catch (exception) { return ''; } } } }; export function chr (charCode) { return String.fromCharCode (charCode); }; export function ord (aChar) { return aChar.charCodeAt (0); }; export function max (nrOrSeq) { return arguments.length == 1 ? Math.max (...nrOrSeq) : Math.max (...arguments); }; export function min (nrOrSeq) { return arguments.length == 1 ? Math.min (...nrOrSeq) : Math.min (...arguments); }; export var abs = Math.abs; export function round (number, ndigits) { if (ndigits) { var scale = Math.pow (10, ndigits); number *= scale; } var rounded = Math.round (number); if (rounded - number == 0.5 && rounded % 2) { rounded -= 1; } if (ndigits) { rounded /= scale; } return rounded; }; export function __jsUsePyNext__ () { try { var result = this.__next__ (); return {value: result, done: false}; } catch (exception) { return {value: undefined, done: true}; } } export function __pyUseJsNext__ () { var result = this.next (); if (result.done) { throw StopIteration (new Error ()); } else { return result.value; } } export function py_iter (iterable) { if (typeof iterable == 'string' || '__iter__' in iterable) { var result = iterable.__iter__ (); result.next = __jsUsePyNext__; } else if ('selector' in iterable) { var result = list (iterable) .__iter__ (); result.next = __jsUsePyNext__; } else if ('next' in iterable) { var result = iterable if (! ('__next__' in result)) { result.__next__ = __pyUseJsNext__; } } else if (Symbol.iterator in iterable) { var result = iterable [Symbol.iterator] (); result.__next__ = __pyUseJsNext__; } else { throw IterableError (new Error ()); } result [Symbol.iterator] = function () {return result;}; return result; } export function py_next (iterator) { try { var result = iterator.__next__ (); } catch (exception) { var result = iterator.next (); if (result.done) { throw StopIteration (new Error ()); } else { return result.value; } } if (result == undefined) { throw StopIteration (new Error ()); } else { return result; } } export function __PyIterator__ (iterable) { this.iterable = iterable; this.index = 0; } __PyIterator__.prototype.__next__ = function() { if (this.index < this.iterable.length) { return this.iterable [this.index++]; } else { throw StopIteration (new Error ()); } }; export function __JsIterator__ (iterable) { this.iterable = iterable; this.index = 0; } __JsIterator__.prototype.next = function () { if (this.index < this.iterable.py_keys.length) { return {value: this.index++, done: false}; } else { return {value: undefined, done: true}; } }; export function py_reversed (iterable) { iterable = iterable.slice (); iterable.reverse (); return iterable; }; export function zip () { var args = [] .slice.call (arguments); for (var i = 0; i < args.length; i++) { if (typeof args [i] == 'string') { args [i] = args [i] .split (''); } else if (!Array.isArray (args [i])) { args [i] = Array.from (args [i]); } } var shortest = args.length == 0 ? [] : args.reduce ( function (array0, array1) { return array0.length < array1.length ? array0 : array1; } ); return shortest.map ( function (current, index) { return args.map ( function (current) { return current [index]; } ); } ); }; export function range (start, stop, step) { if (stop == undefined) { stop = start; start = 0; } if (step == undefined) { step = 1; } if ((step > 0 && start >= stop) || (step < 0 && start <= stop)) { return []; } var result = []; for (var i = start; step > 0 ? i < stop : i > stop; i += step) { result.push(i); } return result; }; export function any (iterable) { for (let item of iterable) { if (bool (item)) { return true; } } return false; } export function all (iterable) { for (let item of iterable) { if (! bool (item)) { return false; } } return true; } export function sum (iterable) { let result = 0; for (let item of iterable) { result += item; } return result; } export function enumerate (iterable) { return zip (range (len (iterable)), iterable); } export function copy (anObject) { if (anObject == null || typeof anObject == "object") { return anObject; } else { var result = {}; for (var attrib in obj) { if (anObject.hasOwnProperty (attrib)) { result [attrib] = anObject [attrib]; } } return result; } } export function deepcopy (anObject) { if (anObject == null || typeof anObject == "object") { return anObject; } else { var result = {}; for (var attrib in obj) { if (anObject.hasOwnProperty (attrib)) { result [attrib] = deepcopy (anObject [attrib]); } } return result; } } export function list (iterable) { let instance = iterable ? Array.from (iterable) : []; return instance; } Array.prototype.__class__ = list; list.__name__ = 'list'; list.__bases__ = [object]; Array.prototype.__iter__ = function () {return new __PyIterator__ (this);}; Array.prototype.__getslice__ = function (start, stop, step) { if (start < 0) { start = this.length + start; } if (stop == null) { stop = this.length; } else if (stop < 0) { stop = this.length + stop; } else if (stop > this.length) { stop = this.length; } if (step == 1) { return Array.prototype.slice.call(this, start, stop); } let result = list ([]); for (let index = start; index < stop; index += step) { result.push (this [index]); } return result; }; Array.prototype.__setslice__ = function (start, stop, step, source) { if (start < 0) { start = this.length + start; } if (stop == null) { stop = this.length; } else if (stop < 0) { stop = this.length + stop; } if (step == null) { Array.prototype.splice.apply (this, [start, stop - start] .concat (source)); } else { let sourceIndex = 0; for (let targetIndex = start; targetIndex < stop; targetIndex += step) { this [targetIndex] = source [sourceIndex++]; } } }; Array.prototype.__repr__ = function () { if (this.__class__ == set && !this.length) { return 'set()'; } let result = !this.__class__ || this.__class__ == list ? '[' : this.__class__ == tuple ? '(' : '{'; for (let index = 0; index < this.length; index++) { if (index) { result += ', '; } result += repr (this [index]); } if (this.__class__ == tuple && this.length == 1) { result += ','; } result += !this.__class__ || this.__class__ == list ? ']' : this.__class__ == tuple ? ')' : '}';; return result; }; Array.prototype.__str__ = Array.prototype.__repr__; Array.prototype.append = function (element) { this.push (element); }; Array.prototype.py_clear = function () { this.length = 0; }; Array.prototype.extend = function (aList) { this.push.apply (this, aList); }; Array.prototype.insert = function (index, element) { this.splice (index, 0, element); }; Array.prototype.remove = function (element) { let index = this.indexOf (element); if (index == -1) { throw ValueError ("list.remove(x): x not in list", new Error ()); } this.splice (index, 1); }; Array.prototype.index = function (element) { return this.indexOf (element); }; Array.prototype.py_pop = function (index) { if (index == undefined) { return this.pop (); } else { return this.splice (index, 1) [0]; } }; Array.prototype.py_sort = function () { __sort__.apply (null, [this].concat ([] .slice.apply (arguments))); }; Array.prototype.__add__ = function (aList) { return list (this.concat (aList)); }; Array.prototype.__mul__ = function (scalar) { let result = this; for (let i = 1; i < scalar; i++) { result = result.concat (this); } return result; }; Array.prototype.__rmul__ = Array.prototype.__mul__; export function tuple (iterable) { let instance = iterable ? [] .slice.apply (iterable) : []; instance.__class__ = tuple; return instance; } tuple.__name__ = 'tuple'; tuple.__bases__ = [object]; export function set (iterable) { let instance = []; if (iterable) { for (let index = 0; index < iterable.length; index++) { instance.add (iterable [index]); } } instance.__class__ = set; return instance; } set.__name__ = 'set'; set.__bases__ = [object]; Array.prototype.__bindexOf__ = function (element) { element += ''; let mindex = 0; let maxdex = this.length - 1; while (mindex <= maxdex) { let index = (mindex + maxdex) / 2 | 0; let middle = this [index] + ''; if (middle < element) { mindex = index + 1; } else if (middle > element) { maxdex = index - 1; } else { return index; } } return -1; }; Array.prototype.add = function (element) { if (this.indexOf (element) == -1) { this.push (element); } }; Array.prototype.discard = function (element) { var index = this.indexOf (element); if (index != -1) { this.splice (index, 1); } }; Array.prototype.isdisjoint = function (other) { this.sort (); for (let i = 0; i < other.length; i++) { if (this.__bindexOf__ (other [i]) != -1) { return false; } } return true; }; Array.prototype.issuperset = function (other) { this.sort (); for (let i = 0; i < other.length; i++) { if (this.__bindexOf__ (other [i]) == -1) { return false; } } return true; }; Array.prototype.issubset = function (other) { return set (other.slice ()) .issuperset (this); }; Array.prototype.union = function (other) { let result = set (this.slice () .sort ()); for (let i = 0; i < other.length; i++) { if (result.__bindexOf__ (other [i]) == -1) { result.push (other [i]); } } return result; }; Array.prototype.intersection = function (other) { this.sort (); let result = set (); for (let i = 0; i < other.length; i++) { if (this.__bindexOf__ (other [i]) != -1) { result.push (other [i]); } } return result; }; Array.prototype.difference = function (other) { let sother = set (other.slice () .sort ()); let result = set (); for (let i = 0; i < this.length; i++) { if (sother.__bindexOf__ (this [i]) == -1) { result.push (this [i]); } } return result; }; Array.prototype.symmetric_difference = function (other) { return this.union (other) .difference (this.intersection (other)); }; Array.prototype.py_update = function () { let updated = [] .concat.apply (this.slice (), arguments) .sort (); this.py_clear (); for (let i = 0; i < updated.length; i++) { if (updated [i] != updated [i - 1]) { this.push (updated [i]); } } }; Array.prototype.__eq__ = function (other) { if (this.length != other.length) { return false; } if (this.__class__ == set) { this.sort (); other.sort (); } for (let i = 0; i < this.length; i++) { if (this [i] != other [i]) { return false; } } return true; }; Array.prototype.__ne__ = function (other) { return !this.__eq__ (other); }; Array.prototype.__le__ = function (other) { if (this.__class__ == set) { return this.issubset (other); } else { for (let i = 0; i < this.length; i++) { if (this [i] > other [i]) { return false; } else if (this [i] < other [i]) { return true; } } return true; } }; Array.prototype.__ge__ = function (other) { if (this.__class__ == set) { return this.issuperset (other); } else { for (let i = 0; i < this.length; i++) { if (this [i] < other [i]) { return false; } else if (this [i] > other [i]) { return true; } } return true; } }; Array.prototype.__lt__ = function (other) { return ( this.__class__ == set ? this.issubset (other) && !this.issuperset (other) : !this.__ge__ (other) ); }; Array.prototype.__gt__ = function (other) { return ( this.__class__ == set ? this.issuperset (other) && !this.issubset (other) : !this.__le__ (other) ); }; export function bytearray (bytable, encoding) { if (bytable == undefined) { return new Uint8Array (0); } else { let aType = py_typeof (bytable); if (aType == int) { return new Uint8Array (bytable); } else if (aType == str) { let aBytes = new Uint8Array (len (bytable)); for (let i = 0; i < len (bytable); i++) { aBytes [i] = bytable.charCodeAt (i); } return aBytes; } else if (aType == list || aType == tuple) { return new Uint8Array (bytable); } else { throw py_TypeError; } } } export var bytes = bytearray; Uint8Array.prototype.__add__ = function (aBytes) { let result = new Uint8Array (this.length + aBytes.length); result.set (this); result.set (aBytes, this.length); return result; }; Uint8Array.prototype.__mul__ = function (scalar) { let result = new Uint8Array (scalar * this.length); for (let i = 0; i < scalar; i++) { result.set (this, i * this.length); } return result; }; Uint8Array.prototype.__rmul__ = Uint8Array.prototype.__mul__; export function str (stringable) { if (typeof stringable === 'number') return stringable.toString(); else { try { return stringable.__str__ (); } catch (exception) { try { return repr (stringable); } catch (exception) { return String (stringable); } } } }; String.prototype.__class__ = str; str.__name__ = 'str'; str.__bases__ = [object]; String.prototype.__iter__ = function () {new __PyIterator__ (this);}; String.prototype.__repr__ = function () { return (this.indexOf ('\'') == -1 ? '\'' + this + '\'' : '"' + this + '"') .py_replace ('\t', '\\t') .py_replace ('\n', '\\n'); }; String.prototype.__str__ = function () { return this; }; String.prototype.capitalize = function () { return this.charAt (0).toUpperCase () + this.slice (1); }; String.prototype.endswith = function (suffix) { if (suffix instanceof Array) { for (var i=0;i> b; } }; export function __or__ (a, b) { if (typeof a == 'object' && '__or__' in a) { return a.__or__ (b); } else if (typeof b == 'object' && '__ror__' in b) { return b.__ror__ (a); } else { return a | b; } }; export function __xor__ (a, b) { if (typeof a == 'object' && '__xor__' in a) { return a.__xor__ (b); } else if (typeof b == 'object' && '__rxor__' in b) { return b.__rxor__ (a); } else { return a ^ b; } }; export function __and__ (a, b) { if (typeof a == 'object' && '__and__' in a) { return a.__and__ (b); } else if (typeof b == 'object' && '__rand__' in b) { return b.__rand__ (a); } else { return a & b; } }; export function __eq__ (a, b) { if (typeof a == 'object' && '__eq__' in a) { return a.__eq__ (b); } else { return a == b; } }; export function __ne__ (a, b) { if (typeof a == 'object' && '__ne__' in a) { return a.__ne__ (b); } else { return a != b } }; export function __lt__ (a, b) { if (typeof a == 'object' && '__lt__' in a) { return a.__lt__ (b); } else { return a < b; } }; export function __le__ (a, b) { if (typeof a == 'object' && '__le__' in a) { return a.__le__ (b); } else { return a <= b; } }; export function __gt__ (a, b) { if (typeof a == 'object' && '__gt__' in a) { return a.__gt__ (b); } else { return a > b; } }; export function __ge__ (a, b) { if (typeof a == 'object' && '__ge__' in a) { return a.__ge__ (b); } else { return a >= b; } }; export function __imatmul__ (a, b) { if ('__imatmul__' in a) { return a.__imatmul__ (b); } else { return a.__matmul__ (b); } }; export function __ipow__ (a, b) { if (typeof a == 'object' && '__pow__' in a) { return a.__ipow__ (b); } else if (typeof a == 'object' && '__ipow__' in a) { return a.__pow__ (b); } else if (typeof b == 'object' && '__rpow__' in b) { return b.__rpow__ (a); } else { return Math.pow (a, b); } }; export function __ijsmod__ (a, b) { if (typeof a == 'object' && '__imod__' in a) { return a.__ismod__ (b); } else if (typeof a == 'object' && '__mod__' in a) { return a.__mod__ (b); } else if (typeof b == 'object' && '__rpow__' in b) { return b.__rmod__ (a); } else { return a % b; } }; export function __imod__ (a, b) { if (typeof a == 'object' && '__imod__' in a) { return a.__imod__ (b); } else if (typeof a == 'object' && '__mod__' in a) { return a.__mod__ (b); } else if (typeof b == 'object' && '__rmod__' in b) { return b.__rmod__ (a); } else { return ((a % b) + b) % b; } }; export function __imul__ (a, b) { if (typeof a == 'object' && '__imul__' in a) { return a.__imul__ (b); } else if (typeof a == 'object' && '__mul__' in a) { return a = a.__mul__ (b); } else if (typeof b == 'object' && '__rmul__' in b) { return a = b.__rmul__ (a); } else if (typeof a == 'string') { return a = a.__mul__ (b); } else if (typeof b == 'string') { return a = b.__rmul__ (a); } else { return a *= b; } }; export function __idiv__ (a, b) { if (typeof a == 'object' && '__idiv__' in a) { return a.__idiv__ (b); } else if (typeof a == 'object' && '__div__' in a) { return a = a.__div__ (b); } else if (typeof b == 'object' && '__rdiv__' in b) { return a = b.__rdiv__ (a); } else { return a /= b; } }; export function __iadd__ (a, b) { if (typeof a == 'object' && '__iadd__' in a) { return a.__iadd__ (b); } else if (typeof a == 'object' && '__add__' in a) { return a = a.__add__ (b); } else if (typeof b == 'object' && '__radd__' in b) { return a = b.__radd__ (a); } else { return a += b; } }; export function __isub__ (a, b) { if (typeof a == 'object' && '__isub__' in a) { return a.__isub__ (b); } else if (typeof a == 'object' && '__sub__' in a) { return a = a.__sub__ (b); } else if (typeof b == 'object' && '__rsub__' in b) { return a = b.__rsub__ (a); } else { return a -= b; } }; export function __ilshift__ (a, b) { if (typeof a == 'object' && '__ilshift__' in a) { return a.__ilshift__ (b); } else if (typeof a == 'object' && '__lshift__' in a) { return a = a.__lshift__ (b); } else if (typeof b == 'object' && '__rlshift__' in b) { return a = b.__rlshift__ (a); } else { return a <<= b; } }; export function __irshift__ (a, b) { if (typeof a == 'object' && '__irshift__' in a) { return a.__irshift__ (b); } else if (typeof a == 'object' && '__rshift__' in a) { return a = a.__rshift__ (b); } else if (typeof b == 'object' && '__rrshift__' in b) { return a = b.__rrshift__ (a); } else { return a >>= b; } }; export function __ior__ (a, b) { if (typeof a == 'object' && '__ior__' in a) { return a.__ior__ (b); } else if (typeof a == 'object' && '__or__' in a) { return a = a.__or__ (b); } else if (typeof b == 'object' && '__ror__' in b) { return a = b.__ror__ (a); } else { return a |= b; } }; export function __ixor__ (a, b) { if (typeof a == 'object' && '__ixor__' in a) { return a.__ixor__ (b); } else if (typeof a == 'object' && '__xor__' in a) { return a = a.__xor__ (b); } else if (typeof b == 'object' && '__rxor__' in b) { return a = b.__rxor__ (a); } else { return a ^= b; } }; export function __iand__ (a, b) { if (typeof a == 'object' && '__iand__' in a) { return a.__iand__ (b); } else if (typeof a == 'object' && '__and__' in a) { return a = a.__and__ (b); } else if (typeof b == 'object' && '__rand__' in b) { return a = b.__rand__ (a); } else { return a &= b; } }; export function __getitem__ (container, key) { if (typeof container == 'object' && '__getitem__' in container) { return container.__getitem__ (key); } else if ((typeof container == 'string' || container instanceof Array) && key < 0) { return container [container.length + key]; } else { return container [key]; } }; export function __setitem__ (container, key, value) { if (typeof container == 'object' && '__setitem__' in container) { container.__setitem__ (key, value); } else if ((typeof container == 'string' || container instanceof Array) && key < 0) { container [container.length + key] = value; } else { container [key] = value; } }; export function __getslice__ (container, lower, upper, step) { if (typeof container == 'object' && '__getitem__' in container) { return container.__getitem__ ([lower, upper, step]); } else { return container.__getslice__ (lower, upper, step); } }; export function __setslice__ (container, lower, upper, step, value) { if (typeof container == 'object' && '__setitem__' in container) { container.__setitem__ ([lower, upper, step], value); } else { container.__setslice__ (lower, upper, step, value); } }; export var BaseException = __class__ ('BaseException', [object], { __module__: __name__, }); export var Exception = __class__ ('Exception', [BaseException], { __module__: __name__, get __init__ () {return __get__ (this, function (self) { var kwargs = dict (); if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'self': var self = __allkwargs0__ [__attrib0__]; break; default: kwargs [__attrib0__] = __allkwargs0__ [__attrib0__]; } } delete kwargs.__kwargtrans__; } var args = tuple ([].slice.apply (arguments).slice (1, __ilastarg0__ + 1)); } else { var args = tuple (); } self.__args__ = args; if (kwargs.error != null) { self.stack = kwargs.error.stack; } else if (Error) { self.stack = new Error ().stack; } else { self.stack = 'No stack trace available'; } });}, get __repr__ () {return __get__ (this, function (self) { if (len (self.__args__) > 1) { return '{}{}'.format (self.__class__.__name__, repr (tuple (self.__args__))); } else if (len (self.__args__)) { return '{}({})'.format (self.__class__.__name__, repr (self.__args__ [0])); } else { return '{}()'.format (self.__class__.__name__); } });}, get __str__ () {return __get__ (this, function (self) { if (len (self.__args__) > 1) { return str (tuple (self.__args__)); } else if (len (self.__args__)) { return str (self.__args__ [0]); } else { return ''; } });} }); export var IterableError = __class__ ('IterableError', [Exception], { __module__: __name__, get __init__ () {return __get__ (this, function (self, error) { Exception.__init__ (self, "Can't iterate over non-iterable", __kwargtrans__ ({error: error})); });} }); export var StopIteration = __class__ ('StopIteration', [Exception], { __module__: __name__, get __init__ () {return __get__ (this, function (self, error) { Exception.__init__ (self, 'Iterator exhausted', __kwargtrans__ ({error: error})); });} }); export var ValueError = __class__ ('ValueError', [Exception], { __module__: __name__, get __init__ () {return __get__ (this, function (self, message, error) { Exception.__init__ (self, message, __kwargtrans__ ({error: error})); });} }); export var KeyError = __class__ ('KeyError', [Exception], { __module__: __name__, get __init__ () {return __get__ (this, function (self, message, error) { Exception.__init__ (self, message, __kwargtrans__ ({error: error})); });} }); export var AssertionError = __class__ ('AssertionError', [Exception], { __module__: __name__, get __init__ () {return __get__ (this, function (self, message, error) { if (message) { Exception.__init__ (self, message, __kwargtrans__ ({error: error})); } else { Exception.__init__ (self, __kwargtrans__ ({error: error})); } });} }); export var NotImplementedError = __class__ ('NotImplementedError', [Exception], { __module__: __name__, get __init__ () {return __get__ (this, function (self, message, error) { Exception.__init__ (self, message, __kwargtrans__ ({error: error})); });} }); export var IndexError = __class__ ('IndexError', [Exception], { __module__: __name__, get __init__ () {return __get__ (this, function (self, message, error) { Exception.__init__ (self, message, __kwargtrans__ ({error: error})); });} }); export var AttributeError = __class__ ('AttributeError', [Exception], { __module__: __name__, get __init__ () {return __get__ (this, function (self, message, error) { Exception.__init__ (self, message, __kwargtrans__ ({error: error})); });} }); export var py_TypeError = __class__ ('py_TypeError', [Exception], { __module__: __name__, get __init__ () {return __get__ (this, function (self, message, error) { Exception.__init__ (self, message, __kwargtrans__ ({error: error})); });} }); export var Warning = __class__ ('Warning', [Exception], { __module__: __name__, }); export var UserWarning = __class__ ('UserWarning', [Warning], { __module__: __name__, }); export var DeprecationWarning = __class__ ('DeprecationWarning', [Warning], { __module__: __name__, }); export var RuntimeWarning = __class__ ('RuntimeWarning', [Warning], { __module__: __name__, }); export var __sort__ = function (iterable, key, reverse) { if (typeof key == 'undefined' || (key != null && key.hasOwnProperty ("__kwargtrans__"))) {; var key = null; }; if (typeof reverse == 'undefined' || (reverse != null && reverse.hasOwnProperty ("__kwargtrans__"))) {; var reverse = false; }; if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'iterable': var iterable = __allkwargs0__ [__attrib0__]; break; case 'key': var key = __allkwargs0__ [__attrib0__]; break; case 'reverse': var reverse = __allkwargs0__ [__attrib0__]; break; } } } } else { } if (key) { iterable.sort ((function __lambda__ (a, b) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'a': var a = __allkwargs0__ [__attrib0__]; break; case 'b': var b = __allkwargs0__ [__attrib0__]; break; } } } } else { } return (key (a) > key (b) ? 1 : -(1)); })); } else { iterable.sort (); } if (reverse) { iterable.reverse (); } }; export var sorted = function (iterable, key, reverse) { if (typeof key == 'undefined' || (key != null && key.hasOwnProperty ("__kwargtrans__"))) {; var key = null; }; if (typeof reverse == 'undefined' || (reverse != null && reverse.hasOwnProperty ("__kwargtrans__"))) {; var reverse = false; }; if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'iterable': var iterable = __allkwargs0__ [__attrib0__]; break; case 'key': var key = __allkwargs0__ [__attrib0__]; break; case 'reverse': var reverse = __allkwargs0__ [__attrib0__]; break; } } } } else { } if (py_typeof (iterable) == dict) { var result = copy (iterable.py_keys ()); } else { var result = copy (iterable); } __sort__ (result, key, reverse); return result; }; export var map = function (func, iterable) { return (function () { var __accu0__ = []; for (var item of iterable) { __accu0__.append (func (item)); } return __accu0__; }) (); }; export var filter = function (func, iterable) { if (func == null) { var func = bool; } return (function () { var __accu0__ = []; for (var item of iterable) { if (func (item)) { __accu0__.append (item); } } return __accu0__; }) (); }; export var divmod = function (n, d) { return tuple ([Math.floor (n / d), __mod__ (n, d)]); }; export var __Terminal__ = __class__ ('__Terminal__', [object], { __module__: __name__, get __init__ () {return __get__ (this, function (self) { self.buffer = ''; try { self.element = document.getElementById ('__terminal__'); } catch (__except0__) { self.element = null; } if (self.element) { self.element.style.overflowX = 'auto'; self.element.style.boxSizing = 'border-box'; self.element.style.padding = '5px'; self.element.innerHTML = '_'; } });}, get print () {return __get__ (this, function (self) { var sep = ' '; var end = '\n'; if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'self': var self = __allkwargs0__ [__attrib0__]; break; case 'sep': var sep = __allkwargs0__ [__attrib0__]; break; case 'end': var end = __allkwargs0__ [__attrib0__]; break; } } } var args = tuple ([].slice.apply (arguments).slice (1, __ilastarg0__ + 1)); } else { var args = tuple (); } self.buffer = '{}{}{}'.format (self.buffer, sep.join ((function () { var __accu0__ = []; for (var arg of args) { __accu0__.append (str (arg)); } return __accu0__; }) ()), end).__getslice__ (-(4096), null, 1); if (self.element) { self.element.innerHTML = self.buffer.py_replace ('\n', '
').py_replace (' ', ' '); self.element.scrollTop = self.element.scrollHeight; } else { console.log (sep.join ((function () { var __accu0__ = []; for (var arg of args) { __accu0__.append (str (arg)); } return __accu0__; }) ())); } });}, get input () {return __get__ (this, function (self, question) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'self': var self = __allkwargs0__ [__attrib0__]; break; case 'question': var question = __allkwargs0__ [__attrib0__]; break; } } } } else { } self.print ('{}'.format (question), __kwargtrans__ ({end: ''})); var answer = window.prompt ('\n'.join (self.buffer.py_split ('\n').__getslice__ (-(8), null, 1))); self.print (answer); return answer; });} }); export var __terminal__ = __Terminal__ (); export var print = __terminal__.print; export var input = __terminal__.input; //# sourceMappingURL=org.transcrypt.__runtime__.map ================================================ FILE: docs/examples/transcrypt/sketch_008/target/org.transcrypt.__runtime__.py ================================================ # Transcrypt runtime module #__pragma__ ('js', 'export var __envir__ = {{}};\n{}', __include__ ('org/transcrypt/__envir__.js')) #__pragma__ ('js', '{}', __include__ ('org/transcrypt/__core__.js')) #__pragma__ ('js', '{}', __include__ ('org/transcrypt/__builtin__.js')) #__pragma__ ('skip') copy = Math = __typeof__ = __repr__ = document = console = window = 0 #__pragma__ ('noskip') #__pragma__ ('notconv') # !!! tconv gives a problem with __terminal__, needs investigation #__pragma__ ('nokwargs') #__pragma__ ('noalias', 'sort') class BaseException: pass class Exception (BaseException): #__pragma__ ('kwargs') def __init__ (self, *args, **kwargs): self.__args__ = args if kwargs.error != None: self.stack = kwargs.error.stack # Integrate with JavaScript Error object elif Error: self.stack = (__new__(Error())).stack # Create our own stack if we aren't given one else: self.stack = 'No stack trace available' #__pragma__ ('nokwargs') def __repr__ (self): if len (self.__args__) > 1: return '{}{}'.format (self.__class__.__name__, repr (tuple (self.__args__))) elif len (self.__args__): return '{}({})'.format (self.__class__.__name__, repr (self.__args__ [0])) else: return '{}()'.format (self.__class__.__name__) def __str__ (self): if len (self.__args__) > 1: return str (tuple (self.__args__)) elif len (self.__args__): return str (self.__args__ [0]) else: return '' class IterableError (Exception): def __init__ (self, error): Exception.__init__ (self, 'Can\'t iterate over non-iterable', error = error) class StopIteration (Exception): def __init__ (self, error): Exception.__init__ (self, 'Iterator exhausted', error = error) class ValueError (Exception): def __init__ (self, message, error): Exception.__init__ (self, message, error = error) class KeyError (Exception): def __init__ (self, message, error): Exception.__init__ (self, message, error = error) class AssertionError (Exception): def __init__ (self, message, error): if message: Exception.__init__ (self, message, error = error) else: Exception.__init__ (self, error = error) class NotImplementedError (Exception): def __init__(self, message, error): Exception.__init__(self, message, error = error) class IndexError (Exception): def __init__(self, message, error): Exception.__init__(self, message, error = error) class AttributeError (Exception): def __init__(self, message, error): Exception.__init__(self, message, error = error) class TypeError (Exception): def __init__(self, message, error): Exception.__init__(self, message, error = error) # Warnings Exceptions # N.B. This is a limited subset of the warnings defined in # the cpython implementation to keep things small for now. class Warning (Exception): ''' Warning Base Class ''' pass class UserWarning (Warning): pass class DeprecationWarning (Warning): pass class RuntimeWarning (Warning): pass #__pragma__ ('kwargs') def __sort__ (iterable, key = None, reverse = False): # Used by py_sort, can deal with kwargs if key: iterable.sort (lambda a, b: 1 if key (a) > key (b) else -1) # JavaScript sort, case '==' is irrelevant for sorting else: iterable.sort () # JavaScript sort if reverse: iterable.reverse () def sorted (iterable, key = None, reverse = False): if type (iterable) == dict: result = copy (iterable.keys ()) else: result = copy (iterable) __sort__ (result, key, reverse) return result #__pragma__ ('nokwargs') def map (func, iterable): return [func (item) for item in iterable] def filter (func, iterable): if func == None: func = bool return [item for item in iterable if func (item)] def divmod (n, d): return n // d, n % d #__pragma__ ('ifdef', '__complex__') class complex: def __init__ (self, real, imag = None): if imag == None: if type (real) == complex: self.real = real.real self.imag = real.imag else: self.real = real self.imag = 0 else: self.real = real self.imag = imag def __neg__ (self): return complex (-self.real, -self.imag) def __exp__ (self): modulus = Math.exp (self.real) return complex (modulus * Math.cos (self.imag), modulus * Math.sin (self.imag)) def __log__ (self): return complex (Math.log (Math.sqrt (self.real * self.real + self.imag * self.imag)), Math.atan2 (self.imag, self.real)) def __pow__ (self, other): # a ** b = exp (b log a) return (self.__log__ () .__mul__ (other)) .__exp__ () def __rpow__ (self, real): # real ** comp -> comp.__rpow__ (real) return self.__mul__ (Math.log (real)) .__exp__ () def __mul__ (self, other): if __typeof__ (other) is 'number': return complex (self.real * other, self.imag * other) else: return complex (self.real * other.real - self.imag * other.imag, self.real * other.imag + self.imag * other.real) def __rmul__ (self, real): # real + comp -> comp.__rmul__ (real) return complex (self.real * real, self.imag * real) def __div__ (self, other): if __typeof__ (other) is 'number': return complex (self.real / other, self.imag / other) else: denom = other.real * other.real + other.imag * other.imag return complex ( (self.real * other.real + self.imag * other.imag) / denom, (self.imag * other.real - self.real * other.imag) / denom ) def __rdiv__ (self, real): # real / comp -> comp.__rdiv__ (real) denom = self.real * self.real return complex ( (real * self.real) / denom, (real * self.imag) / denom ) def __add__ (self, other): if __typeof__ (other) is 'number': return complex (self.real + other, self.imag) else: # Assume other is complex return complex (self.real + other.real, self.imag + other.imag) def __radd__ (self, real): # real + comp -> comp.__radd__ (real) return complex (self.real + real, self.imag) def __sub__ (self, other): if __typeof__ (other) is 'number': return complex (self.real - other, self.imag) else: return complex (self.real - other.real, self.imag - other.imag) def __rsub__ (self, real): # real - comp -> comp.__rsub__ (real) return complex (real - self.real, -self.imag) def __repr__ (self): return '({}{}{}j)'.format (self.real, '+' if self.imag >= 0 else '', self.imag) def __str__ (self): return __repr__ (self) [1 : -1] def __eq__ (self, other): if __typeof__ (other) is 'number': return self.real == other else: return self.real == other.real and self.imag == other.imag def __ne__ (self, other): if __typeof__ (other) is 'number': return self.real != other else: return self.real != other.real or self.imag != other.imag def conjugate (self): return complex (self.real, -self.imag) def __conj__ (aNumber): if isinstance (aNumber, complex): return complex (aNumber.real, -aNumber.imag) else: return complex (aNumber, 0) #__pragma__ ('endif') class __Terminal__: ''' Printing to either the console or to html happens async, but is blocked by calling window.prompt. So while all input and print statements are encountered in normal order, the print's exit immediately without yet having actually printed This means the next input takes control, blocking actual printing and so on indefinitely The effect is that everything's only printed after all inputs are done To prevent that, what's needed is to only execute the next window.prompt after actual printing has been done Since we've no way to find out when that is, a timeout is used. ''' def __init__ (self): self.buffer = '' try: self.element = document.getElementById ('__terminal__') except: self.element = None if self.element: self.element.style.overflowX = 'auto' self.element.style.boxSizing = 'border-box' self.element.style.padding = '5px' self.element.innerHTML = '_' #__pragma__ ('kwargs') def print (self, *args, sep = ' ', end = '\n'): self.buffer = '{}{}{}'.format (self.buffer, sep.join ([str (arg) for arg in args]), end) [-4096 : ] if self.element: self.element.innerHTML = self.buffer.replace ('\n', '
') .replace (' ', ' ') self.element.scrollTop = self.element.scrollHeight else: console.log (sep.join ([str (arg) for arg in args])) def input (self, question): self.print ('{}'.format (question), end = '') answer = window.prompt ('\n'.join (self.buffer.split ('\n') [-8:])) self.print (answer) return answer #__pragma__ ('nokwargs') __terminal__ = __Terminal__ () print = __terminal__.print input = __terminal__.input ================================================ FILE: docs/examples/transcrypt/sketch_008/target/pyp5js.js ================================================ // Transcrypt'ed from Python, 2021-11-02 13:06:16 import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, all, any, assert, bool, bytearray, bytes, callable, chr, deepcopy, delattr, dict, dir, divmod, enumerate, getattr, hasattr, isinstance, issubclass, len, list, object, ord, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, setattr, sorted, sum, tuple, zip} from './org.transcrypt.__runtime__.js'; import {PythonFunctions} from './python_functions.js'; var __name__ = 'pyp5js'; export var _P5_INSTANCE = null; export var _CTX_MIDDLE = null; export var _DEFAULT_FILL = null; export var _DEFAULT_LEADMULT = null; export var _DEFAULT_STROKE = null; export var _DEFAULT_TEXT_FILL = null; export var ADD = null; export var ALT = null; export var ARROW = null; export var AUDIO = null; export var AUTO = null; export var AXES = null; export var BACKSPACE = null; export var BASELINE = null; export var BEVEL = null; export var BEZIER = null; export var BLEND = null; export var BLUR = null; export var BOLD = null; export var BOLDITALIC = null; export var BOTTOM = null; export var BURN = null; export var CENTER = null; export var CHORD = null; export var CLAMP = null; export var CLOSE = null; export var CONTROL = null; export var CORNER = null; export var CORNERS = null; export var CROSS = null; export var CURVE = null; export var DARKEST = null; export var DEG_TO_RAD = null; export var DEGREES = null; export var DELETE = null; export var DIFFERENCE = null; export var DILATE = null; export var DODGE = null; export var DOWN_ARROW = null; export var ENTER = null; export var ERODE = null; export var ESCAPE = null; export var EXCLUSION = null; export var FILL = null; export var GRAY = null; export var GRID = null; export var HALF_PI = null; export var HAND = null; export var HARD_LIGHT = null; export var HSB = null; export var HSL = null; export var IMAGE = null; export var IMMEDIATE = null; export var INVERT = null; export var ITALIC = null; export var LANDSCAPE = null; export var LEFT = null; export var LEFT_ARROW = null; export var LIGHTEST = null; export var LINE_LOOP = null; export var LINE_STRIP = null; export var LINEAR = null; export var LINES = null; export var MIRROR = null; export var MITER = null; export var MOVE = null; export var MULTIPLY = null; export var NEAREST = null; export var NORMAL = null; export var OPAQUE = null; export var OPEN = null; export var OPTION = null; export var OVERLAY = null; export var PI = null; export var PIE = null; export var POINTS = null; export var PORTRAIT = null; export var POSTERIZE = null; export var PROJECT = null; export var QUAD_STRIP = null; export var QUADRATIC = null; export var QUADS = null; export var QUARTER_PI = null; export var RAD_TO_DEG = null; export var RADIANS = null; export var RADIUS = null; export var REPEAT = null; export var REPLACE = null; export var RETURN = null; export var RGB = null; export var RIGHT = null; export var RIGHT_ARROW = null; export var ROUND = null; export var SCREEN = null; export var SHIFT = null; export var SOFT_LIGHT = null; export var SQUARE = null; export var STROKE = null; export var SUBTRACT = null; export var TAB = null; export var TAU = null; export var TEXT = null; export var TEXTURE = null; export var THRESHOLD = null; export var TOP = null; export var TRIANGLE_FAN = null; export var TRIANGLE_STRIP = null; export var TRIANGLES = null; export var TWO_PI = null; export var UP_ARROW = null; export var VIDEO = null; export var WAIT = null; export var WEBGL = null; export var P2D = null; var PI = null; export var frameCount = null; export var focused = null; export var displayWidth = null; export var displayHeight = null; export var windowWidth = null; export var windowHeight = null; export var width = null; export var height = null; export var disableFriendlyErrors = null; export var deviceOrientation = null; export var accelerationX = null; export var accelerationY = null; export var accelerationZ = null; export var pAccelerationX = null; export var pAccelerationY = null; export var pAccelerationZ = null; export var rotationX = null; export var rotationY = null; export var rotationZ = null; export var pRotationX = null; export var pRotationY = null; export var pRotationZ = null; export var turnAxis = null; export var keyIsPressed = null; export var key = null; export var keyCode = null; export var mouseX = null; export var mouseY = null; export var pmouseX = null; export var pmouseY = null; export var winMouseX = null; export var winMouseY = null; export var pwinMouseX = null; export var pwinMouseY = null; export var mouseButton = null; export var mouseIsPressed = null; export var touches = null; export var pixels = null; export var alpha = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.alpha (...args); }; export var blue = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.blue (...args); }; export var brightness = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.brightness (...args); }; export var color = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.color (...args); }; export var green = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.green (...args); }; export var hue = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.hue (...args); }; export var lerpColor = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.lerpColor (...args); }; export var lightness = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.lightness (...args); }; export var red = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.red (...args); }; export var saturation = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.saturation (...args); }; export var background = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.background (...args); }; export var py_clear = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } var p5_clear = _P5_INSTANCE.clear (...args); return p5_clear; }; export var erase = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.erase (...args); }; export var noErase = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noErase (...args); }; export var colorMode = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.colorMode (...args); }; export var fill = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.fill (...args); }; export var noFill = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noFill (...args); }; export var noStroke = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noStroke (...args); }; export var stroke = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.stroke (...args); }; export var arc = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.arc (...args); }; export var ellipse = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.ellipse (...args); }; export var circle = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.circle (...args); }; export var line = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.line (...args); }; export var point = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.point (...args); }; export var quad = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.quad (...args); }; export var rect = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.rect (...args); }; export var square = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.square (...args); }; export var triangle = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.triangle (...args); }; export var plane = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.plane (...args); }; export var box = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.box (...args); }; export var sphere = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.sphere (...args); }; export var cylinder = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.cylinder (...args); }; export var cone = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.cone (...args); }; export var ellipsoid = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.ellipsoid (...args); }; export var torus = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.torus (...args); }; export var loadModel = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.loadModel (...args); }; export var model = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.model (...args); }; export var ellipseMode = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.ellipseMode (...args); }; export var noSmooth = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noSmooth (...args); }; export var rectMode = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.rectMode (...args); }; export var smooth = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.smooth (...args); }; export var strokeCap = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.strokeCap (...args); }; export var strokeJoin = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.strokeJoin (...args); }; export var strokeWeight = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.strokeWeight (...args); }; export var bezier = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.bezier (...args); }; export var bezierDetail = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.bezierDetail (...args); }; export var bezierPoint = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.bezierPoint (...args); }; export var bezierTangent = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.bezierTangent (...args); }; export var curve = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.curve (...args); }; export var curveDetail = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.curveDetail (...args); }; export var curveTightness = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.curveTightness (...args); }; export var curvePoint = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.curvePoint (...args); }; export var curveTangent = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.curveTangent (...args); }; export var beginContour = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.beginContour (...args); }; export var beginShape = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.beginShape (...args); }; export var bezierVertex = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.bezierVertex (...args); }; export var curveVertex = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.curveVertex (...args); }; export var endContour = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.endContour (...args); }; export var endShape = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.endShape (...args); }; export var quadraticVertex = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.quadraticVertex (...args); }; export var vertex = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.vertex (...args); }; export var cursor = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.cursor (...args); }; export var frameRate = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.frameRate (...args); }; export var noCursor = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noCursor (...args); }; export var fullscreen = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.fullscreen (...args); }; export var pixelDensity = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.pixelDensity (...args); }; export var displayDensity = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.displayDensity (...args); }; export var getURL = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.getURL (...args); }; export var getURLPath = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.getURLPath (...args); }; export var getURLParams = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.getURLParams (...args); }; export var preload = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.preload (...args); }; export var setup = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.setup (...args); }; export var draw = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.draw (...args); }; export var remove = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.remove (...args); }; export var noLoop = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noLoop (...args); }; export var loop = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.loop (...args); }; export var push = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.push (...args); }; export var redraw = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.redraw (...args); }; export var resizeCanvas = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.resizeCanvas (...args); }; export var noCanvas = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noCanvas (...args); }; export var createGraphics = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createGraphics (...args); }; export var blendMode = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.blendMode (...args); }; export var setAttributes = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.setAttributes (...args); }; export var applyMatrix = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.applyMatrix (...args); }; export var resetMatrix = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.resetMatrix (...args); }; export var rotate = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.rotate (...args); }; export var rotateX = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.rotateX (...args); }; export var rotateY = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.rotateY (...args); }; export var rotateZ = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.rotateZ (...args); }; export var scale = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.scale (...args); }; export var shearX = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.shearX (...args); }; export var shearY = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.shearY (...args); }; export var translate = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.translate (...args); }; export var createStringDict = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createStringDict (...args); }; export var createNumberDict = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createNumberDict (...args); }; export var append = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.append (...args); }; export var arrayCopy = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.arrayCopy (...args); }; export var concat = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.concat (...args); }; export var reverse = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.reverse (...args); }; export var shorten = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.shorten (...args); }; export var shuffle = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.shuffle (...args); }; export var py_sort = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.py_sort (...args); }; export var splice = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.splice (...args); }; export var subset = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.subset (...args); }; export var float = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.float (...args); }; export var int = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.int (...args); }; export var str = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.str (...args); }; export var boolean = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.boolean (...args); }; export var byte = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.byte (...args); }; export var char = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.char (...args); }; export var unchar = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.unchar (...args); }; export var hex = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.hex (...args); }; export var unhex = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.unhex (...args); }; export var join = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.join (...args); }; export var match = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.match (...args); }; export var matchAll = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.matchAll (...args); }; export var nf = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.nf (...args); }; export var nfc = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.nfc (...args); }; export var nfp = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.nfp (...args); }; export var nfs = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.nfs (...args); }; export var py_split = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.py_split (...args); }; export var splitTokens = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.splitTokens (...args); }; export var trim = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.trim (...args); }; export var setMoveThreshold = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.setMoveThreshold (...args); }; export var setShakeThreshold = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.setShakeThreshold (...args); }; export var keyIsDown = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.keyIsDown (...args); }; export var createImage = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createImage (...args); }; export var saveCanvas = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.saveCanvas (...args); }; export var saveFrames = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.saveFrames (...args); }; export var image_proxy = function (img) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'img': var img = __allkwargs0__ [__attrib0__]; break; } } } } else { } var _set = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } var value = img.set (...args); return value; }; var _get = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } var value = img.get (...args); return value; }; img.py_set = _set; img.py_get = _get; return img; }; export var loadImage = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } var imageObj = _P5_INSTANCE.loadImage (...args); return image_proxy (imageObj); }; export var image = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.image (...args); }; export var tint = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.tint (...args); }; export var noTint = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noTint (...args); }; export var imageMode = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.imageMode (...args); }; export var blend = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.blend (...args); }; export var copy = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.copy (...args); }; export var filter = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } if (len (args) > 1 && (args [0] === null || callable (args [0]))) { return PythonFunctions.filter (...args); } else { return _P5_INSTANCE.filter (...args); } }; export var py_get = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } var p5_get = _P5_INSTANCE.get (...args); return p5_get; }; export var loadPixels = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.loadPixels (...args); }; export var py_set = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } if (len (args) <= 1) { return PythonFunctions.py_set (...args); } else { return _P5_INSTANCE.py_set (...args); } }; export var updatePixels = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.updatePixels (...args); }; export var loadJSON = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.loadJSON (...args); }; export var loadStrings = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.loadStrings (...args); }; export var loadTable = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.loadTable (...args); }; export var loadXML = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.loadXML (...args); }; export var loadBytes = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.loadBytes (...args); }; export var httpGet = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.httpGet (...args); }; export var httpPost = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.httpPost (...args); }; export var httpDo = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.httpDo (...args); }; export var createWriter = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createWriter (...args); }; export var save = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.save (...args); }; export var saveJSON = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.saveJSON (...args); }; export var saveStrings = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.saveStrings (...args); }; export var saveTable = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.saveTable (...args); }; export var day = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.day (...args); }; export var hour = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.hour (...args); }; export var minute = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.minute (...args); }; export var millis = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.millis (...args); }; export var month = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.month (...args); }; export var second = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.second (...args); }; export var year = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.year (...args); }; export var createVector = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createVector (...args); }; export var abs = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.abs (...args); }; export var ceil = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.ceil (...args); }; export var constrain = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.constrain (...args); }; export var dist = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.dist (...args); }; export var exp = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.exp (...args); }; export var floor = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.floor (...args); }; export var lerp = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.lerp (...args); }; export var log = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.log (...args); }; export var mag = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.mag (...args); }; export var map = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } if (len (args) > 1 && callable (args [0])) { return PythonFunctions.map (...args); } else { return _P5_INSTANCE.map (...args); } }; export var max = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.max (...args); }; export var min = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.min (...args); }; export var norm = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.norm (...args); }; export var pow = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.pow (...args); }; export var round = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.round (...args); }; export var sq = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.sq (...args); }; export var sqrt = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.sqrt (...args); }; export var noise = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noise (...args); }; export var noiseDetail = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noiseDetail (...args); }; export var noiseSeed = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noiseSeed (...args); }; export var randomSeed = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.randomSeed (...args); }; export var random = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.random (...args); }; export var randomGaussian = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.randomGaussian (...args); }; export var acos = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.acos (...args); }; export var asin = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.asin (...args); }; export var atan = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.atan (...args); }; export var atan2 = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.atan2 (...args); }; export var cos = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.cos (...args); }; export var sin = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.sin (...args); }; export var tan = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.tan (...args); }; export var degrees = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.degrees (...args); }; export var radians = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.radians (...args); }; export var angleMode = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.angleMode (...args); }; export var textAlign = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.textAlign (...args); }; export var textLeading = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.textLeading (...args); }; export var textSize = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.textSize (...args); }; export var textStyle = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.textStyle (...args); }; export var textWidth = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.textWidth (...args); }; export var textAscent = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.textAscent (...args); }; export var textDescent = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.textDescent (...args); }; export var loadFont = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.loadFont (...args); }; export var text = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.text (...args); }; export var textFont = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.textFont (...args); }; export var orbitControl = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.orbitControl (...args); }; export var debugMode = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.debugMode (...args); }; export var noDebugMode = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noDebugMode (...args); }; export var ambientLight = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.ambientLight (...args); }; export var directionalLight = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.directionalLight (...args); }; export var pointLight = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.pointLight (...args); }; export var lights = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.lights (...args); }; export var loadShader = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.loadShader (...args); }; export var createShader = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createShader (...args); }; export var shader = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.shader (...args); }; export var resetShader = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.resetShader (...args); }; export var normalMaterial = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.normalMaterial (...args); }; export var texture = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.texture (...args); }; export var textureMode = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.textureMode (...args); }; export var textureWrap = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.textureWrap (...args); }; export var ambientMaterial = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.ambientMaterial (...args); }; export var specularMaterial = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.specularMaterial (...args); }; export var shininess = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.shininess (...args); }; export var camera = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.camera (...args); }; export var perspective = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.perspective (...args); }; export var ortho = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.ortho (...args); }; export var createCamera = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createCamera (...args); }; export var setCamera = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.setCamera (...args); }; export var select = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.select (...args); }; export var selectAll = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.selectAll (...args); }; export var removeElements = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.removeElements (...args); }; export var changed = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.changed (...args); }; export var input = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.input (...args); }; export var createDiv = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createDiv (...args); }; export var createP = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createP (...args); }; export var createSpan = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createSpan (...args); }; export var createImg = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createImg (...args); }; export var createA = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createA (...args); }; export var createSlider = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createSlider (...args); }; export var createButton = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createButton (...args); }; export var createCheckbox = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createCheckbox (...args); }; export var createSelect = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createSelect (...args); }; export var createRadio = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createRadio (...args); }; export var createColorPicker = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createColorPicker (...args); }; export var createInput = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createInput (...args); }; export var createFileInput = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createFileInput (...args); }; export var createVideo = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createVideo (...args); }; export var createAudio = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createAudio (...args); }; export var createCapture = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createCapture (...args); }; export var createElement = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createElement (...args); }; export var createCanvas = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } var canvas = _P5_INSTANCE.createCanvas (...args); width = _P5_INSTANCE.width; height = _P5_INSTANCE.height; return canvas; }; export var py_pop = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } var p5_pop = _P5_INSTANCE.pop (...args); return p5_pop; }; export var size = createCanvas; export var popMatrix = py_pop; export var popStyle = py_pop; export var pushMatrix = push; export var pushStyle = push; export var PVector = function (x, y, z) { if (typeof x == 'undefined' || (x != null && x.hasOwnProperty ("__kwargtrans__"))) {; var x = 0; }; if (typeof y == 'undefined' || (y != null && y.hasOwnProperty ("__kwargtrans__"))) {; var y = 0; }; if (typeof z == 'undefined' || (z != null && z.hasOwnProperty ("__kwargtrans__"))) {; var z = 0; }; if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'x': var x = __allkwargs0__ [__attrib0__]; break; case 'y': var y = __allkwargs0__ [__attrib0__]; break; case 'z': var z = __allkwargs0__ [__attrib0__]; break; } } } } else { } return _P5_INSTANCE.createVector (x, y, z); }; setattr (PVector, 'dist', p5.Vector.dist); setattr (PVector, 'add', p5.Vector.add); setattr (PVector, 'sub', p5.Vector.sub); setattr (PVector, 'mult', p5.Vector.mult); setattr (PVector, 'div', p5.Vector.div); setattr (PVector, 'dot', p5.Vector.dot); setattr (PVector, 'cross', p5.Vector.cross); setattr (PVector, 'lerp', p5.Vector.lerp); setattr (PVector, 'random2D', p5.Vector.random2D); setattr (PVector, 'random3D', p5.Vector.random3D); setattr (PVector, 'angleBetween', p5.Vector.angleBetween); setattr (PVector, 'fromAngle', p5.Vector.fromAngle); setattr (PVector, 'fromAngles', p5.Vector.fromAngles); setattr (PVector, 'equals', p5.Vector.equals); export var pre_draw = function (p5_instance, draw_func) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'p5_instance': var p5_instance = __allkwargs0__ [__attrib0__]; break; case 'draw_func': var draw_func = __allkwargs0__ [__attrib0__]; break; } } } } else { } _CTX_MIDDLE = p5_instance._CTX_MIDDLE; _DEFAULT_FILL = p5_instance._DEFAULT_FILL; _DEFAULT_LEADMULT = p5_instance._DEFAULT_LEADMULT; _DEFAULT_STROKE = p5_instance._DEFAULT_STROKE; _DEFAULT_TEXT_FILL = p5_instance._DEFAULT_TEXT_FILL; ADD = p5_instance.ADD; ALT = p5_instance.ALT; ARROW = p5_instance.ARROW; AUDIO = p5_instance.AUDIO; AUTO = p5_instance.AUTO; AXES = p5_instance.AXES; BACKSPACE = p5_instance.BACKSPACE; BASELINE = p5_instance.BASELINE; BEVEL = p5_instance.BEVEL; BEZIER = p5_instance.BEZIER; BLEND = p5_instance.BLEND; BLUR = p5_instance.BLUR; BOLD = p5_instance.BOLD; BOLDITALIC = p5_instance.BOLDITALIC; BOTTOM = p5_instance.BOTTOM; BURN = p5_instance.BURN; CENTER = p5_instance.CENTER; CHORD = p5_instance.CHORD; CLAMP = p5_instance.CLAMP; CLOSE = p5_instance.CLOSE; CONTROL = p5_instance.CONTROL; CORNER = p5_instance.CORNER; CORNERS = p5_instance.CORNERS; CROSS = p5_instance.CROSS; CURVE = p5_instance.CURVE; DARKEST = p5_instance.DARKEST; DEG_TO_RAD = p5_instance.DEG_TO_RAD; DEGREES = p5_instance.DEGREES; DELETE = p5_instance.DELETE; DIFFERENCE = p5_instance.DIFFERENCE; DILATE = p5_instance.DILATE; DODGE = p5_instance.DODGE; DOWN_ARROW = p5_instance.DOWN_ARROW; ENTER = p5_instance.ENTER; ERODE = p5_instance.ERODE; ESCAPE = p5_instance.ESCAPE; EXCLUSION = p5_instance.EXCLUSION; FILL = p5_instance.FILL; GRAY = p5_instance.GRAY; GRID = p5_instance.GRID; HALF_PI = p5_instance.HALF_PI; HAND = p5_instance.HAND; HARD_LIGHT = p5_instance.HARD_LIGHT; HSB = p5_instance.HSB; HSL = p5_instance.HSL; IMAGE = p5_instance.IMAGE; IMMEDIATE = p5_instance.IMMEDIATE; INVERT = p5_instance.INVERT; ITALIC = p5_instance.ITALIC; LANDSCAPE = p5_instance.LANDSCAPE; LEFT = p5_instance.LEFT; LEFT_ARROW = p5_instance.LEFT_ARROW; LIGHTEST = p5_instance.LIGHTEST; LINE_LOOP = p5_instance.LINE_LOOP; LINE_STRIP = p5_instance.LINE_STRIP; LINEAR = p5_instance.LINEAR; LINES = p5_instance.LINES; MIRROR = p5_instance.MIRROR; MITER = p5_instance.MITER; MOVE = p5_instance.MOVE; MULTIPLY = p5_instance.MULTIPLY; NEAREST = p5_instance.NEAREST; NORMAL = p5_instance.NORMAL; OPAQUE = p5_instance.OPAQUE; OPEN = p5_instance.OPEN; OPTION = p5_instance.OPTION; OVERLAY = p5_instance.OVERLAY; P2D = p5_instance.P2D; var P3D = p5_instance.WEBGL; PI = p5_instance.PI; PIE = p5_instance.PIE; POINTS = p5_instance.POINTS; PORTRAIT = p5_instance.PORTRAIT; POSTERIZE = p5_instance.POSTERIZE; PROJECT = p5_instance.PROJECT; QUAD_STRIP = p5_instance.QUAD_STRIP; QUADRATIC = p5_instance.QUADRATIC; QUADS = p5_instance.QUADS; QUARTER_PI = p5_instance.QUARTER_PI; RAD_TO_DEG = p5_instance.RAD_TO_DEG; RADIANS = p5_instance.RADIANS; RADIUS = p5_instance.RADIUS; REPEAT = p5_instance.REPEAT; REPLACE = p5_instance.REPLACE; RETURN = p5_instance.RETURN; RGB = p5_instance.RGB; RIGHT = p5_instance.RIGHT; RIGHT_ARROW = p5_instance.RIGHT_ARROW; ROUND = p5_instance.ROUND; SCREEN = p5_instance.SCREEN; SHIFT = p5_instance.SHIFT; SOFT_LIGHT = p5_instance.SOFT_LIGHT; SQUARE = p5_instance.SQUARE; STROKE = p5_instance.STROKE; SUBTRACT = p5_instance.SUBTRACT; TAB = p5_instance.TAB; TAU = p5_instance.TAU; TEXT = p5_instance.TEXT; TEXTURE = p5_instance.TEXTURE; THRESHOLD = p5_instance.THRESHOLD; TOP = p5_instance.TOP; TRIANGLE_FAN = p5_instance.TRIANGLE_FAN; TRIANGLE_STRIP = p5_instance.TRIANGLE_STRIP; TRIANGLES = p5_instance.TRIANGLES; TWO_PI = p5_instance.TWO_PI; UP_ARROW = p5_instance.UP_ARROW; VIDEO = p5_instance.VIDEO; WAIT = p5_instance.WAIT; WEBGL = p5_instance.WEBGL; frameCount = p5_instance.frameCount; focused = p5_instance.focused; displayWidth = p5_instance.displayWidth; displayHeight = p5_instance.displayHeight; windowWidth = p5_instance.windowWidth; windowHeight = p5_instance.windowHeight; width = p5_instance.width; height = p5_instance.height; disableFriendlyErrors = p5_instance.disableFriendlyErrors; deviceOrientation = p5_instance.deviceOrientation; accelerationX = p5_instance.accelerationX; accelerationY = p5_instance.accelerationY; accelerationZ = p5_instance.accelerationZ; pAccelerationX = p5_instance.pAccelerationX; pAccelerationY = p5_instance.pAccelerationY; pAccelerationZ = p5_instance.pAccelerationZ; rotationX = p5_instance.rotationX; rotationY = p5_instance.rotationY; rotationZ = p5_instance.rotationZ; pRotationX = p5_instance.pRotationX; pRotationY = p5_instance.pRotationY; pRotationZ = p5_instance.pRotationZ; turnAxis = p5_instance.turnAxis; keyIsPressed = p5_instance.keyIsPressed; key = p5_instance.key; keyCode = p5_instance.keyCode; mouseX = p5_instance.mouseX; mouseY = p5_instance.mouseY; pmouseX = p5_instance.pmouseX; pmouseY = p5_instance.pmouseY; winMouseX = p5_instance.winMouseX; winMouseY = p5_instance.winMouseY; pwinMouseX = p5_instance.pwinMouseX; pwinMouseY = p5_instance.pwinMouseY; mouseButton = p5_instance.mouseButton; mouseIsPressed = p5_instance.mouseIsPressed; touches = p5_instance.touches; pixels = p5_instance.pixels; return draw_func (); }; export var global_p5_injection = function (p5_sketch) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'p5_sketch': var p5_sketch = __allkwargs0__ [__attrib0__]; break; } } } } else { } var decorator = function (f) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'f': var f = __allkwargs0__ [__attrib0__]; break; } } } } else { } var wrapper = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } } else { } _P5_INSTANCE = p5_sketch; return pre_draw (_P5_INSTANCE, f); }; return wrapper; }; return decorator; }; export var start_p5 = function (preload_func, setup_func, draw_func, event_functions) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'preload_func': var preload_func = __allkwargs0__ [__attrib0__]; break; case 'setup_func': var setup_func = __allkwargs0__ [__attrib0__]; break; case 'draw_func': var draw_func = __allkwargs0__ [__attrib0__]; break; case 'event_functions': var event_functions = __allkwargs0__ [__attrib0__]; break; } } } } else { } var sketch_setup = function (p5_sketch) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'p5_sketch': var p5_sketch = __allkwargs0__ [__attrib0__]; break; } } } } else { } p5_sketch.preload = global_p5_injection (p5_sketch) (preload_func); p5_sketch.setup = global_p5_injection (p5_sketch) (setup_func); p5_sketch.draw = global_p5_injection (p5_sketch) (draw_func); }; var instance = new p5 (sketch_setup, 'sketch-holder'); var event_function_names = tuple (['deviceMoved', 'deviceTurned', 'deviceShaken', 'windowResized', 'keyPressed', 'keyReleased', 'keyTyped', 'mousePressed', 'mouseReleased', 'mouseClicked', 'doubleClicked', 'mouseMoved', 'mouseDragged', 'mouseWheel', 'touchStarted', 'touchMoved', 'touchEnded', 'keyIsDown']); for (var f_name of (function () { var __accu0__ = []; for (var f of event_function_names) { if (event_functions.py_get (f, null)) { __accu0__.append (f); } } return __accu0__; }) ()) { var func = event_functions [f_name]; var event_func = global_p5_injection (instance) (func); setattr (instance, f_name, event_func); } }; export var logOnloaded = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } } else { } console.log ('Lib loaded!'); }; export var add_library = function (lib_name) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'lib_name': var lib_name = __allkwargs0__ [__attrib0__]; break; } } } } else { } var src = ''; return console.log ('Lib name is not valid:', lib_name); console.log ('Importing:', src); var script = document.createElement ('script'); script.onload = logOnloaded; script.src = src; document.head.appendChild (script); }; //# sourceMappingURL=pyp5js.map ================================================ FILE: docs/examples/transcrypt/sketch_008/target/pyp5js.py ================================================ from python_functions import PythonFunctions _P5_INSTANCE = None _CTX_MIDDLE = None _DEFAULT_FILL = None _DEFAULT_LEADMULT = None _DEFAULT_STROKE = None _DEFAULT_TEXT_FILL = None ADD = None ALT = None ARROW = None AUDIO = None AUTO = None AXES = None BACKSPACE = None BASELINE = None BEVEL = None BEZIER = None BLEND = None BLUR = None BOLD = None BOLDITALIC = None BOTTOM = None BURN = None CENTER = None CHORD = None CLAMP = None CLOSE = None CONTROL = None CORNER = None CORNERS = None CROSS = None CURVE = None DARKEST = None DEG_TO_RAD = None DEGREES = None DELETE = None DIFFERENCE = None DILATE = None DODGE = None DOWN_ARROW = None ENTER = None ERODE = None ESCAPE = None EXCLUSION = None FILL = None GRAY = None GRID = None HALF_PI = None HAND = None HARD_LIGHT = None HSB = None HSL = None IMAGE = None IMMEDIATE = None INVERT = None ITALIC = None LANDSCAPE = None LEFT = None LEFT_ARROW = None LIGHTEST = None LINE_LOOP = None LINE_STRIP = None LINEAR = None LINES = None MIRROR = None MITER = None MOVE = None MULTIPLY = None NEAREST = None NORMAL = None OPAQUE = None OPEN = None OPTION = None OVERLAY = None PI = None PIE = None POINTS = None PORTRAIT = None POSTERIZE = None PROJECT = None QUAD_STRIP = None QUADRATIC = None QUADS = None QUARTER_PI = None RAD_TO_DEG = None RADIANS = None RADIUS = None REPEAT = None REPLACE = None RETURN = None RGB = None RIGHT = None RIGHT_ARROW = None ROUND = None SCREEN = None SHIFT = None SOFT_LIGHT = None SQUARE = None STROKE = None SUBTRACT = None TAB = None TAU = None TEXT = None TEXTURE = None THRESHOLD = None TOP = None TRIANGLE_FAN = None TRIANGLE_STRIP = None TRIANGLES = None TWO_PI = None UP_ARROW = None VIDEO = None WAIT = None WEBGL = None P2D = None PI = None frameCount = None focused = None displayWidth = None displayHeight = None windowWidth = None windowHeight = None width = None height = None disableFriendlyErrors = None deviceOrientation = None accelerationX = None accelerationY = None accelerationZ = None pAccelerationX = None pAccelerationY = None pAccelerationZ = None rotationX = None rotationY = None rotationZ = None pRotationX = None pRotationY = None pRotationZ = None turnAxis = None keyIsPressed = None key = None keyCode = None mouseX = None mouseY = None pmouseX = None pmouseY = None winMouseX = None winMouseY = None pwinMouseX = None pwinMouseY = None mouseButton = None mouseIsPressed = None touches = None pixels = None def alpha(*args): return _P5_INSTANCE.alpha(*args) def blue(*args): return _P5_INSTANCE.blue(*args) def brightness(*args): return _P5_INSTANCE.brightness(*args) def color(*args): return _P5_INSTANCE.color(*args) def green(*args): return _P5_INSTANCE.green(*args) def hue(*args): return _P5_INSTANCE.hue(*args) def lerpColor(*args): return _P5_INSTANCE.lerpColor(*args) def lightness(*args): return _P5_INSTANCE.lightness(*args) def red(*args): return _P5_INSTANCE.red(*args) def saturation(*args): return _P5_INSTANCE.saturation(*args) def background(*args): return _P5_INSTANCE.background(*args) def clear(*args): __pragma__('noalias', 'clear') p5_clear = _P5_INSTANCE.clear(*args) __pragma__('alias', 'clear', 'py_clear') return p5_clear def erase(*args): return _P5_INSTANCE.erase(*args) def noErase(*args): return _P5_INSTANCE.noErase(*args) def colorMode(*args): return _P5_INSTANCE.colorMode(*args) def fill(*args): return _P5_INSTANCE.fill(*args) def noFill(*args): return _P5_INSTANCE.noFill(*args) def noStroke(*args): return _P5_INSTANCE.noStroke(*args) def stroke(*args): return _P5_INSTANCE.stroke(*args) def arc(*args): return _P5_INSTANCE.arc(*args) def ellipse(*args): return _P5_INSTANCE.ellipse(*args) def circle(*args): return _P5_INSTANCE.circle(*args) def line(*args): return _P5_INSTANCE.line(*args) def point(*args): return _P5_INSTANCE.point(*args) def quad(*args): return _P5_INSTANCE.quad(*args) def rect(*args): return _P5_INSTANCE.rect(*args) def square(*args): return _P5_INSTANCE.square(*args) def triangle(*args): return _P5_INSTANCE.triangle(*args) def plane(*args): return _P5_INSTANCE.plane(*args) def box(*args): return _P5_INSTANCE.box(*args) def sphere(*args): return _P5_INSTANCE.sphere(*args) def cylinder(*args): return _P5_INSTANCE.cylinder(*args) def cone(*args): return _P5_INSTANCE.cone(*args) def ellipsoid(*args): return _P5_INSTANCE.ellipsoid(*args) def torus(*args): return _P5_INSTANCE.torus(*args) def loadModel(*args): return _P5_INSTANCE.loadModel(*args) def model(*args): return _P5_INSTANCE.model(*args) def ellipseMode(*args): return _P5_INSTANCE.ellipseMode(*args) def noSmooth(*args): return _P5_INSTANCE.noSmooth(*args) def rectMode(*args): return _P5_INSTANCE.rectMode(*args) def smooth(*args): return _P5_INSTANCE.smooth(*args) def strokeCap(*args): return _P5_INSTANCE.strokeCap(*args) def strokeJoin(*args): return _P5_INSTANCE.strokeJoin(*args) def strokeWeight(*args): return _P5_INSTANCE.strokeWeight(*args) def bezier(*args): return _P5_INSTANCE.bezier(*args) def bezierDetail(*args): return _P5_INSTANCE.bezierDetail(*args) def bezierPoint(*args): return _P5_INSTANCE.bezierPoint(*args) def bezierTangent(*args): return _P5_INSTANCE.bezierTangent(*args) def curve(*args): return _P5_INSTANCE.curve(*args) def curveDetail(*args): return _P5_INSTANCE.curveDetail(*args) def curveTightness(*args): return _P5_INSTANCE.curveTightness(*args) def curvePoint(*args): return _P5_INSTANCE.curvePoint(*args) def curveTangent(*args): return _P5_INSTANCE.curveTangent(*args) def beginContour(*args): return _P5_INSTANCE.beginContour(*args) def beginShape(*args): return _P5_INSTANCE.beginShape(*args) def bezierVertex(*args): return _P5_INSTANCE.bezierVertex(*args) def curveVertex(*args): return _P5_INSTANCE.curveVertex(*args) def endContour(*args): return _P5_INSTANCE.endContour(*args) def endShape(*args): return _P5_INSTANCE.endShape(*args) def quadraticVertex(*args): return _P5_INSTANCE.quadraticVertex(*args) def vertex(*args): return _P5_INSTANCE.vertex(*args) def cursor(*args): return _P5_INSTANCE.cursor(*args) def frameRate(*args): return _P5_INSTANCE.frameRate(*args) def noCursor(*args): return _P5_INSTANCE.noCursor(*args) def fullscreen(*args): return _P5_INSTANCE.fullscreen(*args) def pixelDensity(*args): return _P5_INSTANCE.pixelDensity(*args) def displayDensity(*args): return _P5_INSTANCE.displayDensity(*args) def getURL(*args): return _P5_INSTANCE.getURL(*args) def getURLPath(*args): return _P5_INSTANCE.getURLPath(*args) def getURLParams(*args): return _P5_INSTANCE.getURLParams(*args) def preload(*args): return _P5_INSTANCE.preload(*args) def setup(*args): return _P5_INSTANCE.setup(*args) def draw(*args): return _P5_INSTANCE.draw(*args) def remove(*args): return _P5_INSTANCE.remove(*args) def noLoop(*args): return _P5_INSTANCE.noLoop(*args) def loop(*args): return _P5_INSTANCE.loop(*args) def push(*args): return _P5_INSTANCE.push(*args) def redraw(*args): return _P5_INSTANCE.redraw(*args) def resizeCanvas(*args): return _P5_INSTANCE.resizeCanvas(*args) def noCanvas(*args): return _P5_INSTANCE.noCanvas(*args) def createGraphics(*args): return _P5_INSTANCE.createGraphics(*args) def blendMode(*args): return _P5_INSTANCE.blendMode(*args) def setAttributes(*args): return _P5_INSTANCE.setAttributes(*args) def applyMatrix(*args): return _P5_INSTANCE.applyMatrix(*args) def resetMatrix(*args): return _P5_INSTANCE.resetMatrix(*args) def rotate(*args): return _P5_INSTANCE.rotate(*args) def rotateX(*args): return _P5_INSTANCE.rotateX(*args) def rotateY(*args): return _P5_INSTANCE.rotateY(*args) def rotateZ(*args): return _P5_INSTANCE.rotateZ(*args) def scale(*args): return _P5_INSTANCE.scale(*args) def shearX(*args): return _P5_INSTANCE.shearX(*args) def shearY(*args): return _P5_INSTANCE.shearY(*args) def translate(*args): return _P5_INSTANCE.translate(*args) def createStringDict(*args): return _P5_INSTANCE.createStringDict(*args) def createNumberDict(*args): return _P5_INSTANCE.createNumberDict(*args) def append(*args): return _P5_INSTANCE.append(*args) def arrayCopy(*args): return _P5_INSTANCE.arrayCopy(*args) def concat(*args): return _P5_INSTANCE.concat(*args) def reverse(*args): return _P5_INSTANCE.reverse(*args) def shorten(*args): return _P5_INSTANCE.shorten(*args) def shuffle(*args): return _P5_INSTANCE.shuffle(*args) def sort(*args): return _P5_INSTANCE.sort(*args) def splice(*args): return _P5_INSTANCE.splice(*args) def subset(*args): return _P5_INSTANCE.subset(*args) def float(*args): return _P5_INSTANCE.float(*args) def int(*args): return _P5_INSTANCE.int(*args) def str(*args): return _P5_INSTANCE.str(*args) def boolean(*args): return _P5_INSTANCE.boolean(*args) def byte(*args): return _P5_INSTANCE.byte(*args) def char(*args): return _P5_INSTANCE.char(*args) def unchar(*args): return _P5_INSTANCE.unchar(*args) def hex(*args): return _P5_INSTANCE.hex(*args) def unhex(*args): return _P5_INSTANCE.unhex(*args) def join(*args): return _P5_INSTANCE.join(*args) def match(*args): return _P5_INSTANCE.match(*args) def matchAll(*args): return _P5_INSTANCE.matchAll(*args) def nf(*args): return _P5_INSTANCE.nf(*args) def nfc(*args): return _P5_INSTANCE.nfc(*args) def nfp(*args): return _P5_INSTANCE.nfp(*args) def nfs(*args): return _P5_INSTANCE.nfs(*args) def split(*args): return _P5_INSTANCE.split(*args) def splitTokens(*args): return _P5_INSTANCE.splitTokens(*args) def trim(*args): return _P5_INSTANCE.trim(*args) def setMoveThreshold(*args): return _P5_INSTANCE.setMoveThreshold(*args) def setShakeThreshold(*args): return _P5_INSTANCE.setShakeThreshold(*args) def keyIsDown(*args): return _P5_INSTANCE.keyIsDown(*args) def createImage(*args): return _P5_INSTANCE.createImage(*args) def saveCanvas(*args): return _P5_INSTANCE.saveCanvas(*args) def saveFrames(*args): return _P5_INSTANCE.saveFrames(*args) def image_proxy(img): """ Proxy to turn of transcypt when calling img.get/set methods """ def _set(*args): __pragma__('noalias', 'set') value = img.set(*args) __pragma__('alias', 'set', 'py_set') return value def _get(*args): __pragma__('noalias', 'get') value = img.get(*args) __pragma__('alias', 'get', 'py_get') return value img.set = _set img.get = _get return img def loadImage(*args): imageObj = _P5_INSTANCE.loadImage(*args) return image_proxy(imageObj) def image(*args): return _P5_INSTANCE.image(*args) def tint(*args): return _P5_INSTANCE.tint(*args) def noTint(*args): return _P5_INSTANCE.noTint(*args) def imageMode(*args): return _P5_INSTANCE.imageMode(*args) def blend(*args): return _P5_INSTANCE.blend(*args) def copy(*args): return _P5_INSTANCE.copy(*args) def filter(*args): if len(args) > 1 and (args[0] is None or callable(args[0])): return PythonFunctions.filter(*args) else: return _P5_INSTANCE.filter(*args) def get(*args): __pragma__('noalias', 'get') p5_get = _P5_INSTANCE.get(*args) __pragma__('alias', 'get', 'py_get') return p5_get def loadPixels(*args): return _P5_INSTANCE.loadPixels(*args) def set(*args): if len(args) <= 1: return PythonFunctions.set(*args) else: return _P5_INSTANCE.set(*args) def updatePixels(*args): return _P5_INSTANCE.updatePixels(*args) def loadJSON(*args): return _P5_INSTANCE.loadJSON(*args) def loadStrings(*args): return _P5_INSTANCE.loadStrings(*args) def loadTable(*args): return _P5_INSTANCE.loadTable(*args) def loadXML(*args): return _P5_INSTANCE.loadXML(*args) def loadBytes(*args): return _P5_INSTANCE.loadBytes(*args) def httpGet(*args): return _P5_INSTANCE.httpGet(*args) def httpPost(*args): return _P5_INSTANCE.httpPost(*args) def httpDo(*args): return _P5_INSTANCE.httpDo(*args) def createWriter(*args): return _P5_INSTANCE.createWriter(*args) def save(*args): return _P5_INSTANCE.save(*args) def saveJSON(*args): return _P5_INSTANCE.saveJSON(*args) def saveStrings(*args): return _P5_INSTANCE.saveStrings(*args) def saveTable(*args): return _P5_INSTANCE.saveTable(*args) def day(*args): return _P5_INSTANCE.day(*args) def hour(*args): return _P5_INSTANCE.hour(*args) def minute(*args): return _P5_INSTANCE.minute(*args) def millis(*args): return _P5_INSTANCE.millis(*args) def month(*args): return _P5_INSTANCE.month(*args) def second(*args): return _P5_INSTANCE.second(*args) def year(*args): return _P5_INSTANCE.year(*args) def createVector(*args): return _P5_INSTANCE.createVector(*args) def abs(*args): return _P5_INSTANCE.abs(*args) def ceil(*args): return _P5_INSTANCE.ceil(*args) def constrain(*args): return _P5_INSTANCE.constrain(*args) def dist(*args): return _P5_INSTANCE.dist(*args) def exp(*args): return _P5_INSTANCE.exp(*args) def floor(*args): return _P5_INSTANCE.floor(*args) def lerp(*args): return _P5_INSTANCE.lerp(*args) def log(*args): return _P5_INSTANCE.log(*args) def mag(*args): return _P5_INSTANCE.mag(*args) def map(*args): if len(args) > 1 and callable(args[0]): return PythonFunctions.map(*args) else: return _P5_INSTANCE.map(*args) def max(*args): return _P5_INSTANCE.max(*args) def min(*args): return _P5_INSTANCE.min(*args) def norm(*args): return _P5_INSTANCE.norm(*args) def pow(*args): return _P5_INSTANCE.pow(*args) def round(*args): return _P5_INSTANCE.round(*args) def sq(*args): return _P5_INSTANCE.sq(*args) def sqrt(*args): return _P5_INSTANCE.sqrt(*args) def noise(*args): return _P5_INSTANCE.noise(*args) def noiseDetail(*args): return _P5_INSTANCE.noiseDetail(*args) def noiseSeed(*args): return _P5_INSTANCE.noiseSeed(*args) def randomSeed(*args): return _P5_INSTANCE.randomSeed(*args) def random(*args): return _P5_INSTANCE.random(*args) def randomGaussian(*args): return _P5_INSTANCE.randomGaussian(*args) def acos(*args): return _P5_INSTANCE.acos(*args) def asin(*args): return _P5_INSTANCE.asin(*args) def atan(*args): return _P5_INSTANCE.atan(*args) def atan2(*args): return _P5_INSTANCE.atan2(*args) def cos(*args): return _P5_INSTANCE.cos(*args) def sin(*args): return _P5_INSTANCE.sin(*args) def tan(*args): return _P5_INSTANCE.tan(*args) def degrees(*args): return _P5_INSTANCE.degrees(*args) def radians(*args): return _P5_INSTANCE.radians(*args) def angleMode(*args): return _P5_INSTANCE.angleMode(*args) def textAlign(*args): return _P5_INSTANCE.textAlign(*args) def textLeading(*args): return _P5_INSTANCE.textLeading(*args) def textSize(*args): return _P5_INSTANCE.textSize(*args) def textStyle(*args): return _P5_INSTANCE.textStyle(*args) def textWidth(*args): return _P5_INSTANCE.textWidth(*args) def textAscent(*args): return _P5_INSTANCE.textAscent(*args) def textDescent(*args): return _P5_INSTANCE.textDescent(*args) def loadFont(*args): return _P5_INSTANCE.loadFont(*args) def text(*args): return _P5_INSTANCE.text(*args) def textFont(*args): return _P5_INSTANCE.textFont(*args) def orbitControl(*args): return _P5_INSTANCE.orbitControl(*args) def debugMode(*args): return _P5_INSTANCE.debugMode(*args) def noDebugMode(*args): return _P5_INSTANCE.noDebugMode(*args) def ambientLight(*args): return _P5_INSTANCE.ambientLight(*args) def directionalLight(*args): return _P5_INSTANCE.directionalLight(*args) def pointLight(*args): return _P5_INSTANCE.pointLight(*args) def lights(*args): return _P5_INSTANCE.lights(*args) def loadShader(*args): return _P5_INSTANCE.loadShader(*args) def createShader(*args): return _P5_INSTANCE.createShader(*args) def shader(*args): return _P5_INSTANCE.shader(*args) def resetShader(*args): return _P5_INSTANCE.resetShader(*args) def normalMaterial(*args): return _P5_INSTANCE.normalMaterial(*args) def texture(*args): return _P5_INSTANCE.texture(*args) def textureMode(*args): return _P5_INSTANCE.textureMode(*args) def textureWrap(*args): return _P5_INSTANCE.textureWrap(*args) def ambientMaterial(*args): return _P5_INSTANCE.ambientMaterial(*args) def specularMaterial(*args): return _P5_INSTANCE.specularMaterial(*args) def shininess(*args): return _P5_INSTANCE.shininess(*args) def camera(*args): return _P5_INSTANCE.camera(*args) def perspective(*args): return _P5_INSTANCE.perspective(*args) def ortho(*args): return _P5_INSTANCE.ortho(*args) def createCamera(*args): return _P5_INSTANCE.createCamera(*args) def setCamera(*args): return _P5_INSTANCE.setCamera(*args) def select(*args): return _P5_INSTANCE.select(*args) def selectAll(*args): return _P5_INSTANCE.selectAll(*args) def removeElements(*args): return _P5_INSTANCE.removeElements(*args) def changed(*args): return _P5_INSTANCE.changed(*args) def input(*args): return _P5_INSTANCE.input(*args) def createDiv(*args): return _P5_INSTANCE.createDiv(*args) def createP(*args): return _P5_INSTANCE.createP(*args) def createSpan(*args): return _P5_INSTANCE.createSpan(*args) def createImg(*args): return _P5_INSTANCE.createImg(*args) def createA(*args): return _P5_INSTANCE.createA(*args) def createSlider(*args): return _P5_INSTANCE.createSlider(*args) def createButton(*args): return _P5_INSTANCE.createButton(*args) def createCheckbox(*args): return _P5_INSTANCE.createCheckbox(*args) def createSelect(*args): return _P5_INSTANCE.createSelect(*args) def createRadio(*args): return _P5_INSTANCE.createRadio(*args) def createColorPicker(*args): return _P5_INSTANCE.createColorPicker(*args) def createInput(*args): return _P5_INSTANCE.createInput(*args) def createFileInput(*args): return _P5_INSTANCE.createFileInput(*args) def createVideo(*args): return _P5_INSTANCE.createVideo(*args) def createAudio(*args): return _P5_INSTANCE.createAudio(*args) def createCapture(*args): return _P5_INSTANCE.createCapture(*args) def createElement(*args): return _P5_INSTANCE.createElement(*args) def createCanvas(*args): canvas = _P5_INSTANCE.createCanvas(*args) global width, height width = _P5_INSTANCE.width height = _P5_INSTANCE.height return canvas def pop(*args): __pragma__('noalias', 'pop') p5_pop = _P5_INSTANCE.pop(*args) __pragma__('alias', 'pop', 'py_pop') return p5_pop # Processing Python or Java mode compatibility aliases size = createCanvas popMatrix = pop popStyle = pop pushMatrix = push pushStyle = push # PVector is a helper/alias to create p5.Vector objects def PVector(x=0, y=0, z=0): return _P5_INSTANCE.createVector(x, y, z) # aliases for p5.Vector class methods setattr(PVector, 'dist', p5.Vector.dist) setattr(PVector, 'add', p5.Vector.add) setattr(PVector, 'sub', p5.Vector.sub) setattr(PVector, 'mult', p5.Vector.mult) setattr(PVector, 'div', p5.Vector.div) setattr(PVector, 'dot', p5.Vector.dot) setattr(PVector, 'cross', p5.Vector.cross) setattr(PVector, 'lerp', p5.Vector.lerp) setattr(PVector, 'random2D', p5.Vector.random2D) setattr(PVector, 'random3D', p5.Vector.random3D) setattr(PVector, 'angleBetween', p5.Vector.angleBetween) setattr(PVector, 'fromAngle', p5.Vector.fromAngle) setattr(PVector, 'fromAngles', p5.Vector.fromAngles) setattr(PVector, 'equals', p5.Vector.equals) def pre_draw(p5_instance, draw_func): """ We need to run this before the actual draw to insert and update p5 env variables """ global _CTX_MIDDLE, _DEFAULT_FILL, _DEFAULT_LEADMULT, _DEFAULT_STROKE, _DEFAULT_TEXT_FILL global ADD, ALT, ARROW, AUTO, AUDIO, AXES, BACKSPACE, BASELINE, BEVEL, BEZIER, BLEND, BLUR, BOLD, BOLDITALIC global BOTTOM, BURN, CENTER, CHORD, CLAMP, CLOSE, CONTROL, CORNER, CORNERS, CROSS, CURVE, DARKEST global DEG_TO_RAD, DEGREES, DELETE, DIFFERENCE, DILATE, DODGE, DOWN_ARROW, ENTER, ERODE, ESCAPE, EXCLUSION global FILL, GRAY, GRID, HALF_PI, HAND, HARD_LIGHT, HSB, HSL, IMAGE, IMMEDIATE, INVERT, ITALIC, LANDSCAPE global LEFT, LEFT_ARROW, LIGHTEST, LINE_LOOP, LINE_STRIP, LINEAR, LINES, MIRROR, MITER, MOVE, MULTIPLY, NEAREST global NORMAL, OPAQUE, OPEN, OPTION, OVERLAY, P2D, PI, PIE, POINTS, PORTRAIT, POSTERIZE, PROJECT, QUAD_STRIP, QUADRATIC global QUADS, QUARTER_PI, RAD_TO_DEG, RADIANS, RADIUS, REPEAT, REPLACE, RETURN, RGB, RIGHT, RIGHT_ARROW global ROUND, SCREEN, SHIFT, SOFT_LIGHT, SQUARE, STROKE, SUBTRACT, TAB, TAU, TEXT, TEXTURE, THRESHOLD, TOP global TRIANGLE_FAN, TRIANGLE_STRIP, TRIANGLES, TWO_PI, UP_ARROW, VIDEO, WAIT, WEBGL global frameCount, focused, displayWidth, displayHeight, windowWidth, windowHeight, width, height global disableFriendlyErrors, deviceOrientation, accelerationX, accelerationY, accelerationZ global pAccelerationX, pAccelerationY, pAccelerationZ, rotationX, rotationY, rotationZ global pRotationX, pRotationY, pRotationZ, turnAxis, keyIsPressed, key, keyCode, mouseX, mouseY, pmouseX, pmouseY global winMouseX, winMouseY, pwinMouseX, pwinMouseY, mouseButton, mouseIsPressed, touches, pixels _CTX_MIDDLE = p5_instance._CTX_MIDDLE _DEFAULT_FILL = p5_instance._DEFAULT_FILL _DEFAULT_LEADMULT = p5_instance._DEFAULT_LEADMULT _DEFAULT_STROKE = p5_instance._DEFAULT_STROKE _DEFAULT_TEXT_FILL = p5_instance._DEFAULT_TEXT_FILL ADD = p5_instance.ADD ALT = p5_instance.ALT ARROW = p5_instance.ARROW AUDIO = p5_instance.AUDIO AUTO = p5_instance.AUTO AXES = p5_instance.AXES BACKSPACE = p5_instance.BACKSPACE BASELINE = p5_instance.BASELINE BEVEL = p5_instance.BEVEL BEZIER = p5_instance.BEZIER BLEND = p5_instance.BLEND BLUR = p5_instance.BLUR BOLD = p5_instance.BOLD BOLDITALIC = p5_instance.BOLDITALIC BOTTOM = p5_instance.BOTTOM BURN = p5_instance.BURN CENTER = p5_instance.CENTER CHORD = p5_instance.CHORD CLAMP = p5_instance.CLAMP CLOSE = p5_instance.CLOSE CONTROL = p5_instance.CONTROL CORNER = p5_instance.CORNER CORNERS = p5_instance.CORNERS CROSS = p5_instance.CROSS CURVE = p5_instance.CURVE DARKEST = p5_instance.DARKEST DEG_TO_RAD = p5_instance.DEG_TO_RAD DEGREES = p5_instance.DEGREES DELETE = p5_instance.DELETE DIFFERENCE = p5_instance.DIFFERENCE DILATE = p5_instance.DILATE DODGE = p5_instance.DODGE DOWN_ARROW = p5_instance.DOWN_ARROW ENTER = p5_instance.ENTER ERODE = p5_instance.ERODE ESCAPE = p5_instance.ESCAPE EXCLUSION = p5_instance.EXCLUSION FILL = p5_instance.FILL GRAY = p5_instance.GRAY GRID = p5_instance.GRID HALF_PI = p5_instance.HALF_PI HAND = p5_instance.HAND HARD_LIGHT = p5_instance.HARD_LIGHT HSB = p5_instance.HSB HSL = p5_instance.HSL IMAGE = p5_instance.IMAGE IMMEDIATE = p5_instance.IMMEDIATE INVERT = p5_instance.INVERT ITALIC = p5_instance.ITALIC LANDSCAPE = p5_instance.LANDSCAPE LEFT = p5_instance.LEFT LEFT_ARROW = p5_instance.LEFT_ARROW LIGHTEST = p5_instance.LIGHTEST LINE_LOOP = p5_instance.LINE_LOOP LINE_STRIP = p5_instance.LINE_STRIP LINEAR = p5_instance.LINEAR LINES = p5_instance.LINES MIRROR = p5_instance.MIRROR MITER = p5_instance.MITER MOVE = p5_instance.MOVE MULTIPLY = p5_instance.MULTIPLY NEAREST = p5_instance.NEAREST NORMAL = p5_instance.NORMAL OPAQUE = p5_instance.OPAQUE OPEN = p5_instance.OPEN OPTION = p5_instance.OPTION OVERLAY = p5_instance.OVERLAY P2D = p5_instance.P2D P3D = p5_instance.WEBGL PI = p5_instance.PI PIE = p5_instance.PIE POINTS = p5_instance.POINTS PORTRAIT = p5_instance.PORTRAIT POSTERIZE = p5_instance.POSTERIZE PROJECT = p5_instance.PROJECT QUAD_STRIP = p5_instance.QUAD_STRIP QUADRATIC = p5_instance.QUADRATIC QUADS = p5_instance.QUADS QUARTER_PI = p5_instance.QUARTER_PI RAD_TO_DEG = p5_instance.RAD_TO_DEG RADIANS = p5_instance.RADIANS RADIUS = p5_instance.RADIUS REPEAT = p5_instance.REPEAT REPLACE = p5_instance.REPLACE RETURN = p5_instance.RETURN RGB = p5_instance.RGB RIGHT = p5_instance.RIGHT RIGHT_ARROW = p5_instance.RIGHT_ARROW ROUND = p5_instance.ROUND SCREEN = p5_instance.SCREEN SHIFT = p5_instance.SHIFT SOFT_LIGHT = p5_instance.SOFT_LIGHT SQUARE = p5_instance.SQUARE STROKE = p5_instance.STROKE SUBTRACT = p5_instance.SUBTRACT TAB = p5_instance.TAB TAU = p5_instance.TAU TEXT = p5_instance.TEXT TEXTURE = p5_instance.TEXTURE THRESHOLD = p5_instance.THRESHOLD TOP = p5_instance.TOP TRIANGLE_FAN = p5_instance.TRIANGLE_FAN TRIANGLE_STRIP = p5_instance.TRIANGLE_STRIP TRIANGLES = p5_instance.TRIANGLES TWO_PI = p5_instance.TWO_PI UP_ARROW = p5_instance.UP_ARROW VIDEO = p5_instance.VIDEO WAIT = p5_instance.WAIT WEBGL = p5_instance.WEBGL frameCount = p5_instance.frameCount focused = p5_instance.focused displayWidth = p5_instance.displayWidth displayHeight = p5_instance.displayHeight windowWidth = p5_instance.windowWidth windowHeight = p5_instance.windowHeight width = p5_instance.width height = p5_instance.height disableFriendlyErrors = p5_instance.disableFriendlyErrors deviceOrientation = p5_instance.deviceOrientation accelerationX = p5_instance.accelerationX accelerationY = p5_instance.accelerationY accelerationZ = p5_instance.accelerationZ pAccelerationX = p5_instance.pAccelerationX pAccelerationY = p5_instance.pAccelerationY pAccelerationZ = p5_instance.pAccelerationZ rotationX = p5_instance.rotationX rotationY = p5_instance.rotationY rotationZ = p5_instance.rotationZ pRotationX = p5_instance.pRotationX pRotationY = p5_instance.pRotationY pRotationZ = p5_instance.pRotationZ turnAxis = p5_instance.turnAxis keyIsPressed = p5_instance.keyIsPressed key = p5_instance.key keyCode = p5_instance.keyCode mouseX = p5_instance.mouseX mouseY = p5_instance.mouseY pmouseX = p5_instance.pmouseX pmouseY = p5_instance.pmouseY winMouseX = p5_instance.winMouseX winMouseY = p5_instance.winMouseY pwinMouseX = p5_instance.pwinMouseX pwinMouseY = p5_instance.pwinMouseY mouseButton = p5_instance.mouseButton mouseIsPressed = p5_instance.mouseIsPressed touches = p5_instance.touches pixels = p5_instance.pixels return draw_func() def global_p5_injection(p5_sketch): """ Injects the p5js's skecth instance as a global variable to setup and draw functions """ def decorator(f): def wrapper(): global _P5_INSTANCE _P5_INSTANCE = p5_sketch return pre_draw(_P5_INSTANCE, f) return wrapper return decorator def start_p5(preload_func, setup_func, draw_func, event_functions): """ This is the entrypoint function. It accepts 2 parameters: - preload_func: a Python preload callable - setup_func: a Python setup callable - draw_func: a Python draw callable - event_functions: a config dict for the event functions in the format: {"eventFunctionName": python_event_function} This method gets the p5js's sketch instance and injects them """ def sketch_setup(p5_sketch): p5_sketch.preload = global_p5_injection(p5_sketch)(preload_func) p5_sketch.setup = global_p5_injection(p5_sketch)(setup_func) p5_sketch.draw = global_p5_injection(p5_sketch)(draw_func) instance = __new__(p5(sketch_setup, 'sketch-holder')) # inject event functions into p5 event_function_names = ( "deviceMoved", "deviceTurned", "deviceShaken", "windowResized", "keyPressed", "keyReleased", "keyTyped", "mousePressed", "mouseReleased", "mouseClicked", "doubleClicked", "mouseMoved", "mouseDragged", "mouseWheel", "touchStarted", "touchMoved", "touchEnded", "keyIsDown" ) for f_name in [f for f in event_function_names if event_functions.get(f, None)]: func = event_functions[f_name] event_func = global_p5_injection(instance)(func) setattr(instance, f_name, event_func) def logOnloaded(): console.log("Lib loaded!") def add_library(lib_name): # placeholder for https://github.com/berinhard/pyp5js/issues/31 src = '' return console.log("Lib name is not valid:", lib_name) console.log("Importing:", src) script = document.createElement("script") script.onload = logOnloaded script.src = src document.head.appendChild(script) ================================================ FILE: docs/examples/transcrypt/sketch_008/target/python_functions.js ================================================ // Transcrypt'ed from Python, 2021-11-02 13:06:17 import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, abs, all, any, assert, bool, bytearray, bytes, callable, chr, copy, deepcopy, delattr, dict, dir, divmod, enumerate, filter, float, getattr, hasattr, input, int, isinstance, issubclass, len, list, map, max, min, object, ord, pow, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, round, set, setattr, sorted, str, sum, tuple, zip} from './org.transcrypt.__runtime__.js'; var __name__ = 'python_functions'; export var PythonFunctions = __class__ ('PythonFunctions', [object], { __module__: __name__, }); setattr (PythonFunctions, 'map', map); setattr (PythonFunctions, 'filter', filter); setattr (PythonFunctions, 'set', set); //# sourceMappingURL=python_functions.map ================================================ FILE: docs/examples/transcrypt/sketch_008/target/python_functions.py ================================================ class PythonFunctions: pass setattr(PythonFunctions, 'map', map) setattr(PythonFunctions, 'filter', filter) setattr(PythonFunctions, 'set', set) ================================================ FILE: docs/examples/transcrypt/sketch_008/target/target_sketch.js ================================================ // Transcrypt'ed from Python, 2021-11-02 13:06:16 import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, all, any, assert, bool, bytearray, bytes, callable, chr, deepcopy, delattr, dict, dir, divmod, enumerate, getattr, hasattr, isinstance, issubclass, len, list, object, ord, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, set, setattr, sorted, sum, tuple, zip} from './org.transcrypt.__runtime__.js'; import {ADD, ALT, ARROW, AUDIO, AUTO, AXES, BACKSPACE, BASELINE, BEVEL, BEZIER, BLEND, BLUR, BOLD, BOLDITALIC, BOTTOM, BURN, CENTER, CHORD, CLAMP, CLOSE, CONTROL, CORNER, CORNERS, CROSS, CURVE, DARKEST, DEGREES, DEG_TO_RAD, DELETE, DIFFERENCE, DILATE, DODGE, DOWN_ARROW, ENTER, ERODE, ESCAPE, EXCLUSION, FILL, GRAY, GRID, HALF_PI, HAND, HARD_LIGHT, HSB, HSL, IMAGE, IMMEDIATE, INVERT, ITALIC, LANDSCAPE, LEFT, LEFT_ARROW, LIGHTEST, LINEAR, LINES, LINE_LOOP, LINE_STRIP, MIRROR, MITER, MOVE, MULTIPLY, NEAREST, NORMAL, OPAQUE, OPEN, OPTION, OVERLAY, P2D, PI, PIE, POINTS, PORTRAIT, POSTERIZE, PROJECT, PVector, QUADRATIC, QUADS, QUAD_STRIP, QUARTER_PI, RADIANS, RADIUS, RAD_TO_DEG, REPEAT, REPLACE, RETURN, RGB, RIGHT, RIGHT_ARROW, ROUND, SCREEN, SHIFT, SOFT_LIGHT, SQUARE, STROKE, SUBTRACT, TAB, TAU, TEXT, TEXTURE, THRESHOLD, TOP, TRIANGLES, TRIANGLE_FAN, TRIANGLE_STRIP, TWO_PI, UP_ARROW, VIDEO, WAIT, WEBGL, _CTX_MIDDLE, _DEFAULT_FILL, _DEFAULT_LEADMULT, _DEFAULT_STROKE, _DEFAULT_TEXT_FILL, _P5_INSTANCE, abs, accelerationX, accelerationY, accelerationZ, acos, add_library, alpha, ambientLight, ambientMaterial, angleMode, append, applyMatrix, arc, arrayCopy, asin, atan, atan2, background, beginContour, beginShape, bezier, bezierDetail, bezierPoint, bezierTangent, bezierVertex, blend, blendMode, blue, boolean, box, brightness, byte, camera, ceil, changed, char, circle, color, colorMode, concat, cone, constrain, copy, cos, createA, createAudio, createButton, createCamera, createCanvas, createCapture, createCheckbox, createColorPicker, createDiv, createElement, createFileInput, createGraphics, createImage, createImg, createInput, createNumberDict, createP, createRadio, createSelect, createShader, createSlider, createSpan, createStringDict, createVector, createVideo, createWriter, cursor, curve, curveDetail, curvePoint, curveTangent, curveTightness, curveVertex, cylinder, day, debugMode, degrees, deviceOrientation, directionalLight, disableFriendlyErrors, displayDensity, displayHeight, displayWidth, dist, ellipse, ellipseMode, ellipsoid, endContour, endShape, erase, exp, fill, filter, float, floor, focused, frameCount, frameRate, fullscreen, getURL, getURLParams, getURLPath, global_p5_injection, green, height, hex, hour, httpDo, httpGet, httpPost, hue, image, imageMode, image_proxy, input, int, join, key, keyCode, keyIsPressed, lerp, lerpColor, lightness, lights, line, loadBytes, loadFont, loadImage, loadJSON, loadModel, loadPixels, loadShader, loadStrings, loadTable, loadXML, log, logOnloaded, loop, mag, map, match, matchAll, max, millis, min, minute, model, month, mouseButton, mouseIsPressed, mouseX, mouseY, nf, nfc, nfp, nfs, noCanvas, noCursor, noDebugMode, noErase, noFill, noLoop, noSmooth, noStroke, noTint, noise, noiseDetail, noiseSeed, norm, normalMaterial, orbitControl, ortho, pAccelerationX, pAccelerationY, pAccelerationZ, pRotationX, pRotationY, pRotationZ, perspective, pixelDensity, pixels, plane, pmouseX, pmouseY, point, pointLight, popMatrix, popStyle, pow, pre_draw, push, pushMatrix, pushStyle, pwinMouseX, pwinMouseY, py_clear, py_get, py_pop, py_set, py_sort, py_split, quad, quadraticVertex, radians, random, randomGaussian, randomSeed, rect, rectMode, red, redraw, remove, removeElements, resetMatrix, resetShader, resizeCanvas, reverse, rotate, rotateX, rotateY, rotateZ, rotationX, rotationY, rotationZ, round, saturation, save, saveCanvas, saveFrames, saveJSON, saveStrings, saveTable, scale, second, select, selectAll, setAttributes, setCamera, setMoveThreshold, setShakeThreshold, shader, shearX, shearY, shininess, shorten, shuffle, sin, size, smooth, specularMaterial, sphere, splice, splitTokens, sq, sqrt, square, start_p5, str, stroke, strokeCap, strokeJoin, strokeWeight, subset, tan, text, textAlign, textAscent, textDescent, textFont, textLeading, textSize, textStyle, textWidth, texture, textureMode, textureWrap, tint, torus, touches, translate, triangle, trim, turnAxis, unchar, unhex, updatePixels, vertex, width, winMouseX, winMouseY, windowHeight, windowWidth, year} from './pyp5js.js'; var __name__ = '__main__'; export var preload = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } } else { } // pass; }; export var setup = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } } else { } // pass; }; export var draw = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } } else { } // pass; }; export var deviceMoved = null; export var deviceTurned = null; export var deviceShaken = null; export var keyPressed = null; export var keyReleased = null; export var keyTyped = null; export var mouseMoved = null; export var mouseDragged = null; export var mousePressed = null; export var mouseReleased = null; export var mouseClicked = null; export var doubleClicked = null; export var mouseWheel = null; export var touchStarted = null; export var touchMoved = null; export var touchEnded = null; export var windowResized = null; export var keyIsDown = null; export var rect_base_size = 30; export var positions = []; export var rect_size = null; var setup = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } } else { } createP ('Hi! This is an example of how to use p5.dom.js with pyp5js'); var slider_div = createDiv (); slider_div.style ('display', 'block'); rect_size = createSlider (0, 600, 100); rect_size.style ('width', '50%'); slider_div.child (rect_size); createCanvas (600, 600); for (var x of range (-(rect_base_size), width + rect_base_size, rect_base_size)) { for (var y of range (-(rect_base_size), height + rect_base_size, rect_base_size)) { positions.append (tuple ([x, y])); } } noFill (); strokeWeight (2); rectMode (CENTER); }; var draw = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } } else { } background (255); var size = rect_size.value (); for (var [x, y] of positions) { rect (x, y, size, size); } }; export var event_functions = dict ({'deviceMoved': deviceMoved, 'deviceTurned': deviceTurned, 'deviceShaken': deviceShaken, 'keyPressed': keyPressed, 'keyReleased': keyReleased, 'keyTyped': keyTyped, 'mouseMoved': mouseMoved, 'mouseDragged': mouseDragged, 'mousePressed': mousePressed, 'mouseReleased': mouseReleased, 'mouseClicked': mouseClicked, 'doubleClicked': doubleClicked, 'mouseWheel': mouseWheel, 'touchStarted': touchStarted, 'touchMoved': touchMoved, 'touchEnded': touchEnded, 'windowResized': windowResized, 'keyIsDown': keyIsDown}); start_p5 (preload, setup, draw, event_functions); //# sourceMappingURL=target_sketch.map ================================================ FILE: docs/examples/transcrypt/sketch_008/target/target_sketch.project ================================================ {"options": {"source": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_008/target_sketch.py", "anno": false, "alimod": false, "build": true, "complex": false, "docat": false, "dassert": false, "dcheck": false, "dextex": false, "dlog": false, "dmap": false, "dnostrip": false, "dstat": false, "dtree": false, "esv": null, "ecom": false, "fcall": false, "gen": false, "iconv": false, "jscall": false, "jskeys": false, "jsmod": false, "kwargs": true, "keycheck": false, "license": false, "map": true, "nomin": true, "opov": false, "outdir": null, "parent": null, "run": false, "symbols": null, "sform": false, "tconv": false, "unit": null, "verbose": false, "x": null, "xreex": false, "xglobs": false, "xpath": "/home/bernardo/envs/pyp5js/pyp5js/templates/transcrypt", "xtiny": false, "star": false}, "modules": [{"source": "/home/bernardo/.pyenv/versions/pyp5js/lib/python3.8/site-packages/transcrypt/modules/org/transcrypt/__runtime__.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_008/__target__/org.transcrypt.__runtime__.js"}, {"source": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_008/target_sketch.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_008/__target__/target_sketch.js"}, {"source": "/home/bernardo/envs/pyp5js/pyp5js/templates/transcrypt/pyp5js.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_008/__target__/pyp5js.js"}, {"source": "/home/bernardo/envs/pyp5js/pyp5js/templates/transcrypt/python_functions.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_008/__target__/python_functions.js"}]} ================================================ FILE: docs/examples/transcrypt/sketch_008/target/target_sketch.py ================================================ from pyp5js import * def preload(): pass def setup(): pass def draw(): pass deviceMoved = None deviceTurned = None deviceShaken = None keyPressed = None keyReleased = None keyTyped = None mouseMoved = None mouseDragged = None mousePressed = None mouseReleased = None mouseClicked = None doubleClicked = None mouseWheel = None touchStarted = None touchMoved = None touchEnded = None windowResized = None keyIsDown = None rect_base_size = 30 positions = [] rect_size = None def setup(): global rect_size createP("Hi! This is an example of how to use p5.dom.js with pyp5js") # creates a container div slider_div = createDiv() slider_div.style("display", "block") # creates the slider rect_size = createSlider(0, 600, 100) rect_size.style('width', '50%') # adds the slider to the container div slider_div.child(rect_size) createCanvas(600, 600) for x in range(-rect_base_size, width + rect_base_size, rect_base_size): for y in range(-rect_base_size, height + rect_base_size, rect_base_size): positions.append((x, y)) noFill() strokeWeight(2) rectMode(CENTER) def draw(): background(255) size = rect_size.value() for x, y in positions: rect(x, y, size, size) event_functions = { "deviceMoved": deviceMoved, "deviceTurned": deviceTurned, "deviceShaken": deviceShaken, "keyPressed": keyPressed, "keyReleased": keyReleased, "keyTyped": keyTyped, "mouseMoved": mouseMoved, "mouseDragged": mouseDragged, "mousePressed": mousePressed, "mouseReleased": mouseReleased, "mouseClicked": mouseClicked, "doubleClicked": doubleClicked, "mouseWheel": mouseWheel, "touchStarted": touchStarted, "touchMoved": touchMoved, "touchEnded": touchEnded, "windowResized": windowResized, "keyIsDown": keyIsDown, } start_p5(preload, setup, draw, event_functions) ================================================ FILE: docs/examples/transcrypt/sketch_009/index.html ================================================ sketch_009 - pyp5js (using Transcrypt)

Python code here.

             
from random import choice


images = []

def setup():
    global images

    createP("Click to add a new image")
    createCanvas(600, 600)
    background(200)
    images = [
        loadImage('smile.png'),
        loadImage('alien.png'),
        loadImage('rainbow.png'),
    ]


def mousePressed():
    x, y = mouseX, mouseY
    img = choice(images)
    image(img, x, y)


def draw():
    pass

              
          
================================================ FILE: docs/examples/transcrypt/sketch_009/sketch_009.py ================================================ from random import choice images = [] def setup(): global images createP("Click to add a new image") createCanvas(600, 600) background(200) images = [ loadImage('smile.png'), loadImage('alien.png'), loadImage('rainbow.png'), ] def mousePressed(): x, y = mouseX, mouseY img = choice(images) image(img, x, y) def draw(): pass ================================================ FILE: docs/examples/transcrypt/sketch_009/static/p5.js ================================================ /*! p5.js v1.0.0 February 29, 2020 */ !function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).p5=e()}}(function(){return function o(a,s,l){function u(t,e){if(!s[t]){if(!a[t]){var r="function"==typeof require&&require;if(!e&&r)return r(t,!0);if(h)return h(t,!0);var i=new Error("Cannot find module '"+t+"'");throw i.code="MODULE_NOT_FOUND",i}var n=s[t]={exports:{}};a[t][0].call(n.exports,function(e){return u(a[t][1][e]||e)},n,n.exports,o,a,s,l)}return s[t].exports}for(var h="function"==typeof require&&require,e=0;e>16&255,a[s++]=t>>8&255,a[s++]=255&t;2===o&&(t=u[e.charCodeAt(r)]<<2|u[e.charCodeAt(r+1)]>>4,a[s++]=255&t);1===o&&(t=u[e.charCodeAt(r)]<<10|u[e.charCodeAt(r+1)]<<4|u[e.charCodeAt(r+2)]>>2,a[s++]=t>>8&255,a[s++]=255&t);return a},r.fromByteArray=function(e){for(var t,r=e.length,i=r%3,n=[],o=0,a=r-i;o>2]+s[t<<4&63]+"==")):2==i&&(t=(e[r-2]<<8)+e[r-1],n.push(s[t>>10]+s[t>>4&63]+s[t<<2&63]+"="));return n.join("")};for(var s=[],u=[],h="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=0,o=i.length;n>18&63]+s[n>>12&63]+s[n>>6&63]+s[63&n]);return o.join("")}u["-".charCodeAt(0)]=62,u["_".charCodeAt(0)]=63},{}],20:[function(e,t,r){},{}],21:[function(N,e,F){(function(c){"use strict";var i=N("base64-js"),o=N("ieee754"),e="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;F.Buffer=c,F.SlowBuffer=function(e){+e!=e&&(e=0);return c.alloc(+e)},F.INSPECT_MAX_BYTES=50;var r=2147483647;function a(e){if(r>>1;case"base64":return O(e).length;default:if(n)return i?-1:R(e).length;t=(""+t).toLowerCase(),n=!0}}function d(e,t,r){var i=e[t];e[t]=e[r],e[r]=i}function p(e,t,r,i,n){if(0===e.length)return-1;if("string"==typeof r?(i=r,r=0):2147483647=e.length){if(n)return-1;r=e.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof t&&(t=c.from(t,i)),c.isBuffer(t))return 0===t.length?-1:m(e,t,r,i,n);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):m(e,[t],r,i,n);throw new TypeError("val must be string, number or Buffer")}function m(e,t,r,i,n){var o,a=1,s=e.length,l=t.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(e.length<2||t.length<2)return-1;s/=a=2,l/=2,r/=2}function u(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(n){var h=-1;for(o=r;o>8,n=r%256,o.push(n),o.push(i);return o}(t,e.length-r),e,r,i)}function b(e,t,r){return 0===t&&r===e.length?i.fromByteArray(e):i.fromByteArray(e.slice(t,r))}function _(e,t,r){r=Math.min(e.length,r);for(var i=[],n=t;n>>10&1023|55296),h=56320|1023&h),i.push(h),n+=c}return function(e){var t=e.length;if(t<=x)return String.fromCharCode.apply(String,e);var r="",i=0;for(;ithis.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e=e||"utf8";;)switch(e){case"hex":return M(this,t,r);case"utf8":case"utf-8":return _(this,t,r);case"ascii":return w(this,t,r);case"latin1":case"binary":return S(this,t,r);case"base64":return b(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,t,r);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}.apply(this,arguments)},c.prototype.equals=function(e){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===c.compare(this,e)},c.prototype.inspect=function(){var e="",t=F.INSPECT_MAX_BYTES;return e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(e+=" ... "),""},e&&(c.prototype[e]=c.prototype.inspect),c.prototype.compare=function(e,t,r,i,n){if(A(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),t<0||r>e.length||i<0||n>this.length)throw new RangeError("out of range index");if(n<=i&&r<=t)return 0;if(n<=i)return-1;if(r<=t)return 1;if(this===e)return 0;for(var o=(n>>>=0)-(i>>>=0),a=(r>>>=0)-(t>>>=0),s=Math.min(o,a),l=this.slice(i,n),u=e.slice(t,r),h=0;h>>=0,isFinite(r)?(r>>>=0,void 0===i&&(i="utf8")):(i=r,r=void 0)}var n=this.length-t;if((void 0===r||nthis.length)throw new RangeError("Attempt to write outside buffer bounds");i=i||"utf8";for(var o,a,s,l,u,h,c=!1;;)switch(i){case"hex":return g(this,e,t,r);case"utf8":case"utf-8":return u=t,h=r,D(R(e,(l=this).length-u),l,u,h);case"ascii":return v(this,e,t,r);case"latin1":case"binary":return v(this,e,t,r);case"base64":return o=this,a=t,s=r,D(O(e),o,a,s);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return y(this,e,t,r);default:if(c)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),c=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var x=4096;function w(e,t,r){var i="";r=Math.min(e.length,r);for(var n=t;ne.length)throw new RangeError("Index out of range")}function P(e,t,r,i){if(r+i>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function L(e,t,r,i,n){return t=+t,r>>>=0,n||P(e,0,r,4),o.write(e,t,r,i,23,4),r+4}function k(e,t,r,i,n){return t=+t,r>>>=0,n||P(e,0,r,8),o.write(e,t,r,i,52,8),r+8}c.prototype.slice=function(e,t){var r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):r>>=0,t>>>=0,r||T(e,t,this.length);for(var i=this[e],n=1,o=0;++o>>=0,t>>>=0,r||T(e,t,this.length);for(var i=this[e+--t],n=1;0>>=0,t||T(e,1,this.length),this[e]},c.prototype.readUInt16LE=function(e,t){return e>>>=0,t||T(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUInt16BE=function(e,t){return e>>>=0,t||T(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUInt32LE=function(e,t){return e>>>=0,t||T(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUInt32BE=function(e,t){return e>>>=0,t||T(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||T(e,t,this.length);for(var i=this[e],n=1,o=0;++o>>=0,t>>>=0,r||T(e,t,this.length);for(var i=t,n=1,o=this[e+--i];0>>=0,t||T(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){e>>>=0,t||T(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(e,t){e>>>=0,t||T(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(e,t){return e>>>=0,t||T(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return e>>>=0,t||T(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readFloatLE=function(e,t){return e>>>=0,t||T(e,4,this.length),o.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return e>>>=0,t||T(e,4,this.length),o.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return e>>>=0,t||T(e,8,this.length),o.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return e>>>=0,t||T(e,8,this.length),o.read(this,e,!1,52,8)},c.prototype.writeUIntLE=function(e,t,r,i){e=+e,t>>>=0,r>>>=0,i||C(this,e,t,r,Math.pow(2,8*r)-1,0);var n=1,o=0;for(this[t]=255&e;++o>>=0,r>>>=0,i||C(this,e,t,r,Math.pow(2,8*r)-1,0);var n=r-1,o=1;for(this[t+n]=255&e;0<=--n&&(o*=256);)this[t+n]=e/o&255;return t+r},c.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,1,255,0),this[t]=255&e,t+1},c.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},c.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeIntLE=function(e,t,r,i){if(e=+e,t>>>=0,!i){var n=Math.pow(2,8*r-1);C(this,e,t,r,n-1,-n)}var o=0,a=1,s=0;for(this[t]=255&e;++o>0)-s&255;return t+r},c.prototype.writeIntBE=function(e,t,r,i){if(e=+e,t>>>=0,!i){var n=Math.pow(2,8*r-1);C(this,e,t,r,n-1,-n)}var o=r-1,a=1,s=0;for(this[t+o]=255&e;0<=--o&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+r},c.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},c.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeFloatLE=function(e,t,r){return L(this,e,t,!0,r)},c.prototype.writeFloatBE=function(e,t,r){return L(this,e,t,!1,r)},c.prototype.writeDoubleLE=function(e,t,r){return k(this,e,t,!0,r)},c.prototype.writeDoubleBE=function(e,t,r){return k(this,e,t,!1,r)},c.prototype.copy=function(e,t,r,i){if(!c.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r=r||0,i||0===i||(i=this.length),t>=e.length&&(t=e.length),t=t||0,0=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t>>=0,r=void 0===r?this.length:r>>>0,"number"==typeof(e=e||0))for(o=t;o>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function O(e){return i.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(t,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function D(e,t,r,i){for(var n=0;n=t.length||n>=e.length);++n)t[n+r]=e[n];return n}function A(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function I(e){return e!=e}var U=function(){for(var e="0123456789abcdef",t=new Array(256),r=0;r<16;++r)for(var i=16*r,n=0;n<16;++n)t[i+n]=e[r]+e[n];return t}()}).call(this,N("buffer").Buffer)},{"base64-js":19,buffer:21,ieee754:30}],22:[function(e,t,r){"use strict";t.exports=e("./").polyfill()},{"./":23}],23:[function(z,r,i){(function(j,V){var e,t;e=this,t=function(){"use strict";function l(e){return"function"==typeof e}var r=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},i=0,t=void 0,n=void 0,a=function(e,t){f[i]=e,f[i+1]=t,2===(i+=2)&&(n?n(d):y())};var e="undefined"!=typeof window?window:void 0,o=e||{},s=o.MutationObserver||o.WebKitMutationObserver,u="undefined"==typeof self&&void 0!==j&&"[object process]"==={}.toString.call(j),h="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function c(){var e=setTimeout;return function(){return e(d,1)}}var f=new Array(1e3);function d(){for(var e=0;e":">",'"':""","'":"'","/":"/"};function S(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,function(e){return w[e]}):e}var M=function(){function i(e){var t,r=1=this.maxReplaces)break}for(a=0;r=this.regexp.exec(e);){if(void 0===(i=h(r[1].trim())))if("function"==typeof c){var d=c(e,r,t);i="string"==typeof d?d:""}else this.logger.warn("missed to pass in variable ".concat(r[1]," for interpolating ").concat(e)),i="";else"string"==typeof i||this.useRawValueToEscape||(i=v(i));if(i=this.escapeValue?u(this.escape(i)):u(i),e=e.replace(r[0],i),this.regexp.lastIndex=0,++a>=this.maxReplaces)break}return e}},{key:"nest",value:function(e,t,r){var i,n,o=D({},2>1,h=-7,c=r?n-1:0,f=r?-1:1,d=e[t+c];for(c+=f,o=d&(1<<-h)-1,d>>=-h,h+=s;0>=-h,h+=i;0>1,f=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,d=i?0:o-1,p=i?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=h):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),2<=(t+=1<=a+c?f/l:f*Math.pow(2,1-c))*l&&(a++,l/=2),h<=a+c?(s=0,a=h):1<=a+c?(s=(t*l-1)*Math.pow(2,n),a+=c):(s=t*Math.pow(2,c-1)*Math.pow(2,n),a=0));8<=n;e[r+d]=255&s,d+=p,s/=256,n-=8);for(a=a<Math.abs(e[0])&&(t=1),Math.abs(e[2])>Math.abs(e[t])&&(t=2),t}var C=4e150;function P(e,t){e.f+=t.f,e.b.f+=t.b.f}function u(e,t,r){return e=e.a,t=t.a,r=r.a,t.b.a===e?r.b.a===e?v(t.a,r.a)?b(r.b.a,t.a,r.a)<=0:0<=b(t.b.a,r.a,t.a):b(r.b.a,e,r.a)<=0:r.b.a===e?0<=b(t.b.a,e,t.a):(t=y(t.b.a,e,t.a),(e=y(r.b.a,e,r.a))<=t)}function L(e){e.a.i=null;var t=e.e;t.a.c=t.c,t.c.a=t.a,e.e=null}function h(e,t){c(e.a),e.c=!1,(e.a=t).i=e}function k(e){for(var t=e.a.a;(e=fe(e)).a.a===t;);return e.c&&(h(e,t=f(ce(e).a.b,e.a.e)),e=fe(e)),e}function R(e,t,r){var i=new he;return i.a=r,i.e=W(e.f,t.e,i),r.i=i}function O(e,t){switch(e.s){case 100130:return 0!=(1&t);case 100131:return 0!==t;case 100132:return 0>1]],s[a[u]])?le(r,u):ue(r,u)),s[o]=null,l[o]=r.b,r.b=o}else for(r.c[-(o+1)]=null;0Math.max(a.a,l.a))return!1;if(v(o,a)){if(0i.f&&(i.f*=2,i.c=oe(i.c,i.f+1)),0===i.b?r=n:(r=i.b,i.b=i.c[i.b]),i.e[r]=t,i.c[r]=n,i.d[n]=r,i.h&&ue(i,n),r}return i=e.a++,e.c[i]=t,-(i+1)}function ie(e){if(0===e.a)return se(e.b);var t=e.c[e.d[e.a-1]];if(0!==e.b.a&&v(ae(e.b),t))return se(e.b);for(;--e.a,0e.a||v(i[a],i[l])){n[r[o]=a]=o;break}n[r[o]=l]=o,o=s}}function ue(e,t){for(var r=e.d,i=e.e,n=e.c,o=t,a=r[o];;){var s=o>>1,l=r[s];if(0==s||v(i[l],i[a])){n[r[o]=a]=o;break}n[r[o]=l]=o,o=s}}function he(){this.e=this.a=null,this.f=0,this.c=this.b=this.h=this.d=!1}function ce(e){return e.e.c.b}function fe(e){return e.e.a.b}(i=q.prototype).x=function(){Y(this,0)},i.B=function(e,t){switch(e){case 100142:return;case 100140:switch(t){case 100130:case 100131:case 100132:case 100133:case 100134:return void(this.s=t)}break;case 100141:return void(this.m=!!t);default:return void Z(this,100900)}Z(this,100901)},i.y=function(e){switch(e){case 100142:return 0;case 100140:return this.s;case 100141:return this.m;default:Z(this,100900)}return!1},i.A=function(e,t,r){this.j[0]=e,this.j[1]=t,this.j[2]=r},i.z=function(e,t){var r=t||null;switch(e){case 100100:case 100106:this.h=r;break;case 100104:case 100110:this.l=r;break;case 100101:case 100107:this.k=r;break;case 100102:case 100108:this.i=r;break;case 100103:case 100109:this.p=r;break;case 100105:case 100111:this.o=r;break;case 100112:this.r=r;break;default:Z(this,100900)}},i.C=function(e,t){var r=!1,i=[0,0,0];Y(this,2);for(var n=0;n<3;++n){var o=e[n];o<-1e150&&(o=-1e150,r=!0),1e150n[u]&&(n[u]=h,a[u]=l)}if(l=0,n[1]-o[1]>n[0]-o[0]&&(l=1),n[2]-o[2]>n[l]-o[l]&&(l=2),o[l]>=n[l])i[0]=0,i[1]=0,i[2]=1;else{for(n=0,o=s[l],a=a[l],s=[0,0,0],o=[o.g[0]-a.g[0],o.g[1]-a.g[1],o.g[2]-a.g[2]],u=[0,0,0],l=r.e;l!==r;l=l.e)u[0]=l.g[0]-a.g[0],u[1]=l.g[1]-a.g[1],u[2]=l.g[2]-a.g[2],s[0]=o[1]*u[2]-o[2]*u[1],s[1]=o[2]*u[0]-o[0]*u[2],s[2]=o[0]*u[1]-o[1]*u[0],n<(h=s[0]*s[0]+s[1]*s[1]+s[2]*s[2])&&(n=h,i[0]=s[0],i[1]=s[1],i[2]=s[2]);n<=0&&(i[0]=i[1]=i[2]=0,i[T(o)]=1)}r=!0}for(s=T(i),l=this.b.c,n=(s+1)%3,a=(s+2)%3,s=0>=l,h-=l,g!=o){if(g==a)break;for(var v=g>8,++y;var _=b;if(i>=8;null!==m&&s<4096&&(p[s++]=m<<8|_,u+1<=s&&l<12&&(++l,u=u<<1|1)),m=g}else s=1+a,u=(1<<(l=n+1))-1,m=null}return f!==i&&console.log("Warning, gif stream shorter than expected."),r}try{r.GifWriter=function(v,e,t,r){var y=0,i=void 0===(r=void 0===r?{}:r).loop?null:r.loop,b=void 0===r.palette?null:r.palette;if(e<=0||t<=0||65535>=1;)++n;if(a=1<>8&255,v[y++]=255&t,v[y++]=t>>8&255,v[y++]=(null!==b?128:0)|n,v[y++]=o,v[y++]=0,null!==b)for(var s=0,l=b.length;s>16&255,v[y++]=u>>8&255,v[y++]=255&u}if(null!==i){if(i<0||65535>8&255,v[y++]=0}var x=!1;this.addFrame=function(e,t,r,i,n,o){if(!0===x&&(--y,x=!1),o=void 0===o?{}:o,e<0||t<0||65535>=1;)++u;l=1<>8&255,v[y++]=d,v[y++]=0),v[y++]=44,v[y++]=255&e,v[y++]=e>>8&255,v[y++]=255&t,v[y++]=t>>8&255,v[y++]=255&r,v[y++]=r>>8&255,v[y++]=255&i,v[y++]=i>>8&255,v[y++]=!0===a?128|u-1:0,!0===a)for(var p=0,m=s.length;p>16&255,v[y++]=g>>8&255,v[y++]=255&g}return y=function(t,r,e,i){t[r++]=e;var n=r++,o=1<>=8,h-=8,r===n+256&&(t[n]=255,n=r++)}function d(e){c|=e<>=8,h-=8,r===n+256&&(t[n]=255,n=r++);4096===l?(d(o),l=1+s,u=e+1,m={}):(1<>7,n=1<<1+(7&r);x[e++],x[e++];var o=null,a=null;i&&(o=e,e+=3*(a=n));var s=!0,l=[],u=0,h=null,c=0,f=null;for(this.width=w,this.height=t;s&&e>2&7,e++;break;case 254:for(;;){if(!(0<=(C=x[e++])))throw Error("Invalid block size");if(0===C)break;e+=C}break;default:throw new Error("Unknown graphic control label: 0x"+x[e-1].toString(16))}break;case 44:var p=x[e++]|x[e++]<<8,m=x[e++]|x[e++]<<8,g=x[e++]|x[e++]<<8,v=x[e++]|x[e++]<<8,y=x[e++],b=y>>6&1,_=1<<1+(7&y),S=o,M=a,E=!1;if(y>>7){E=!0;S=e,e+=3*(M=_)}var T=e;for(e++;;){var C;if(!(0<=(C=x[e++])))throw Error("Invalid block size");if(0===C)break;e+=C}l.push({x:p,y:m,width:g,height:v,has_local_palette:E,palette_offset:S,palette_size:M,data_offset:T,data_length:e-T,transparent_index:h,interlaced:!!b,delay:u,disposal:c});break;case 59:s=!1;break;default:throw new Error("Unknown gif block: 0x"+x[e-1].toString(16))}this.numFrames=function(){return l.length},this.loopCount=function(){return f},this.frameInfo=function(e){if(e<0||e>=l.length)throw new Error("Frame index out of range.");return l[e]},this.decodeAndBlitFrameBGRA=function(e,t){var r=this.frameInfo(e),i=r.width*r.height,n=new Uint8Array(i);P(x,r.data_offset,n,i);var o=r.palette_offset,a=r.transparent_index;null===a&&(a=256);var s=r.width,l=w-s,u=s,h=4*(r.y*w+r.x),c=4*((r.y+r.height)*w+r.x),f=h,d=4*l;!0===r.interlaced&&(d+=4*w*7);for(var p=8,m=0,g=n.length;m>=1)),v===a)f+=4;else{var y=x[o+3*v],b=x[o+3*v+1],_=x[o+3*v+2];t[f++]=_,t[f++]=b,t[f++]=y,t[f++]=255}--u}},this.decodeAndBlitFrameRGBA=function(e,t){var r=this.frameInfo(e),i=r.width*r.height,n=new Uint8Array(i);P(x,r.data_offset,n,i);var o=r.palette_offset,a=r.transparent_index;null===a&&(a=256);var s=r.width,l=w-s,u=s,h=4*(r.y*w+r.x),c=4*((r.y+r.height)*w+r.x),f=h,d=4*l;!0===r.interlaced&&(d+=4*w*7);for(var p=8,m=0,g=n.length;m>=1)),v===a)f+=4;else{var y=x[o+3*v],b=x[o+3*v+1],_=x[o+3*v+2];t[f++]=y,t[f++]=b,t[f++]=_,t[f++]=255}--u}}}}catch(e){}},{}],33:[function(jr,t,r){(function(Gr){var e;e=this,function(E){"use strict";function e(e){if(null==this)throw TypeError();var t=String(this),r=t.length,i=e?Number(e):0;if(i!=i&&(i=0),!(i<0||r<=i)){var n,o=t.charCodeAt(i);return 55296<=o&&o<=56319&&i+1>>=1,t}function _(e,t,r){if(!t)return r;for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<>>16-t;return e.tag>>>=t,e.bitcount-=t,i+r}function x(e,t){for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<>>=1,++n,r+=t.table[n],0<=(i-=t.table[n]););return e.tag=o,e.bitcount-=n,t.trans[r+i]}function w(e,t,r){var i,n,o,a,s,l;for(i=_(e,5,257),n=_(e,5,1),o=_(e,4,4),a=0;a<19;++a)g[a]=0;for(a=0;athis.x2&&(this.x2=e)),"number"==typeof t&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=t,this.y2=t),tthis.y2&&(this.y2=t))},C.prototype.addX=function(e){this.addPoint(e,null)},C.prototype.addY=function(e){this.addPoint(null,e)},C.prototype.addBezier=function(e,t,r,i,n,o,a,s){var l=this,u=[e,t],h=[r,i],c=[n,o],f=[a,s];this.addPoint(e,t),this.addPoint(a,s);for(var d=0;d<=1;d++){var p=6*u[d]-12*h[d]+6*c[d],m=-3*u[d]+9*h[d]-9*c[d]+3*f[d],g=3*h[d]-3*u[d];if(0!=m){var v=Math.pow(p,2)-4*g*m;if(!(v<0)){var y=(-p+Math.sqrt(v))/(2*m);0>8&255,255&e]},A.USHORT=U(2),D.SHORT=function(e){return 32768<=e&&(e=-(65536-e)),[e>>8&255,255&e]},A.SHORT=U(2),D.UINT24=function(e){return[e>>16&255,e>>8&255,255&e]},A.UINT24=U(3),D.ULONG=function(e){return[e>>24&255,e>>16&255,e>>8&255,255&e]},A.ULONG=U(4),D.LONG=function(e){return R<=e&&(e=-(2*R-e)),[e>>24&255,e>>16&255,e>>8&255,255&e]},A.LONG=U(4),D.FIXED=D.ULONG,A.FIXED=A.ULONG,D.FWORD=D.SHORT,A.FWORD=A.SHORT,D.UFWORD=D.USHORT,A.UFWORD=A.USHORT,D.LONGDATETIME=function(e){return[0,0,0,0,e>>24&255,e>>16&255,e>>8&255,255&e]},A.LONGDATETIME=U(8),D.TAG=function(e){return k.argument(4===e.length,"Tag should be exactly 4 ASCII characters."),[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]},A.TAG=U(4),D.Card8=D.BYTE,A.Card8=A.BYTE,D.Card16=D.USHORT,A.Card16=A.USHORT,D.OffSize=D.BYTE,A.OffSize=A.BYTE,D.SID=D.USHORT,A.SID=A.USHORT,D.NUMBER=function(e){return-107<=e&&e<=107?[e+139]:108<=e&&e<=1131?[247+((e-=108)>>8),255&e]:-1131<=e&&e<=-108?[251+((e=-e-108)>>8),255&e]:-32768<=e&&e<=32767?D.NUMBER16(e):D.NUMBER32(e)},A.NUMBER=function(e){return D.NUMBER(e).length},D.NUMBER16=function(e){return[28,e>>8&255,255&e]},A.NUMBER16=U(3),D.NUMBER32=function(e){return[29,e>>24&255,e>>16&255,e>>8&255,255&e]},A.NUMBER32=U(5),D.REAL=function(e){var t=e.toString(),r=/\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec(t);if(r){var i=parseFloat("1e"+((r[2]?+r[2]:0)+r[1].length));t=(Math.round(e*i)/i).toString()}for(var n="",o=0,a=t.length;o>8&255,t[t.length]=255&i}return t},A.UTF16=function(e){return 2*e.length};var N={"x-mac-croatian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈ƫȅ ÀÃÕŒœĐ—“”‘’÷◊©⁄€‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ","x-mac-cyrillic":"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю","x-mac-gaelic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØḂ±≤≥ḃĊċḊḋḞḟĠġṀæøṁṖṗɼƒſṠ«»… ÀÃÕŒœ–—“”‘’ṡẛÿŸṪ€‹›Ŷŷṫ·Ỳỳ⁊ÂÊÁËÈÍÎÏÌÓÔ♣ÒÚÛÙıÝýŴŵẄẅẀẁẂẃ","x-mac-greek":"Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦€ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ­","x-mac-icelandic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüݰ¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-inuit":"ᐃᐄᐅᐆᐊᐋᐱᐲᐳᐴᐸᐹᑉᑎᑏᑐᑑᑕᑖᑦᑭᑮᑯᑰᑲᑳᒃᒋᒌᒍᒎᒐᒑ°ᒡᒥᒦ•¶ᒧ®©™ᒨᒪᒫᒻᓂᓃᓄᓅᓇᓈᓐᓯᓰᓱᓲᓴᓵᔅᓕᓖᓗᓘᓚᓛᓪᔨᔩᔪᔫᔭ… ᔮᔾᕕᕖᕗ–—“”‘’ᕘᕙᕚᕝᕆᕇᕈᕉᕋᕌᕐᕿᖀᖁᖂᖃᖄᖅᖏᖐᖑᖒᖓᖔᖕᙱᙲᙳᙴᙵᙶᖖᖠᖡᖢᖣᖤᖥᖦᕼŁł","x-mac-ce":"ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ",macintosh:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-romanian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂȘ∞±≤≥¥µ∂∑∏π∫ªºΩăș¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›Țț‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-turkish":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙˆ˜¯˘˙˚¸˝˛ˇ"};O.MACSTRING=function(e,t,r,i){var n=N[i];if(void 0!==n){for(var o="",a=0;a>8&255,l+256&255)}return o}D.MACSTRING=function(e,t){var r=function(e){if(!F)for(var t in F={},N)F[t]=new String(t);var r=F[e];if(void 0!==r){if(B){var i=B.get(r);if(void 0!==i)return i}var n=N[e];if(void 0!==n){for(var o={},a=0;a>8,t[c+1]=255&f,t=t.concat(i[h])}return t},A.TABLE=function(e){for(var t=0,r=e.fields.length,i=0;i>1,t.skip("uShort",3),e.glyphIndexMap={};for(var a=new se.Parser(r,i+n+14),s=new se.Parser(r,i+n+16+2*o),l=new se.Parser(r,i+n+16+4*o),u=new se.Parser(r,i+n+16+6*o),h=i+n+16+8*o,c=0;c>4,o=15&i;if(15==n)break;if(t+=r[n],15==o)break;t+=r[o]}return parseFloat(t)}(e);if(32<=t&&t<=246)return t-139;if(247<=t&&t<=250)return 256*(t-247)+e.parseByte()+108;if(251<=t&&t<=254)return 256*-(t-251)-e.parseByte()-108;throw new Error("Invalid b0 "+t)}function Te(e,t,r){t=void 0!==t?t:0;var i=new se.Parser(e,t),n=[],o=[];for(r=void 0!==r?r:e.length;i.relativeOffset>1,T.length=0,P=!0}return function e(t){for(var r,i,n,o,a,s,l,u,h,c,f,d,p=0;pMath.abs(d-R)?k=f+T.shift():R=d+T.shift(),E.curveTo(y,b,_,x,l,u),E.curveTo(h,c,f,d,k,R);break;default:console.log("Glyph "+v.index+": unknown operator 1200"+m),T.length=0}break;case 14:0>3;break;case 21:2>16),p+=2;break;case 29:a=T.pop()+g.gsubrsBias,(s=g.gsubrs[a])&&e(s);break;case 30:for(;0=r.begin&&e=fe.length){var a=i.parseChar();r.names.push(i.parseString(a))}break;case 2.5:r.numberOfGlyphs=i.parseUShort(),r.offset=new Array(r.numberOfGlyphs);for(var s=0;st.value.tag?1:-1}),t.fields=t.fields.concat(i),t.fields=t.fields.concat(n),t}function gt(e,t,r){for(var i=0;i 123 are reserved for internal usage");d|=1<>>1,o=e[n].tag;if(o===t)return n;o>>1,o=e[n];if(o===t)return n;o>>1,a=(r=e[o]).start;if(a===t)return r;a(r=e[i-1]).end?0:r}function xt(e,t){this.font=e,this.tableName=t}function wt(e){xt.call(this,e,"gpos")}function St(e){xt.call(this,e,"gsub")}function Mt(e,t){var r=e.length;if(r!==t.length)return!1;for(var i=0;it.points.length-1||i.matchedPoints[1]>n.points.length-1)throw Error("Matched points out of range in "+t.name);var a=t.points[i.matchedPoints[0]],s=n.points[i.matchedPoints[1]],l={xScale:i.xScale,scale01:i.scale01,scale10:i.scale10,yScale:i.yScale,dx:0,dy:0};s=kt([s],l)[0],l.dx=a.x-s.x,l.dy=a.y-s.y,o=kt(n.points,l)}t.points=t.points.concat(o)}}return Rt(t.points)}(wt.prototype=xt.prototype={searchTag:yt,binSearch:bt,getTable:function(e){var t=this.font.tables[this.tableName];return!t&&e&&(t=this.font.tables[this.tableName]=this.createDefaultTable()),t},getScriptNames:function(){var e=this.getTable();return e?e.scripts.map(function(e){return e.tag}):[]},getDefaultScriptName:function(){var e=this.getTable();if(e){for(var t=!1,r=0;r=s[u-1].tag,"Features must be added in alphabetical order."),o={tag:r,feature:{params:0,lookupListIndexes:[]}},s.push(o),a.push(u),o.feature}}},getLookupTables:function(e,t,r,i,n){var o=this.getFeatureTable(e,t,r,n),a=[];if(o){for(var s,l=o.lookupListIndexes,u=this.font.tables[this.tableName].lookups,h=0;h",s),t.stack.push(Math.round(64*s))}function vr(e,t){var r=t.stack,i=r.pop(),n=t.fv,o=t.pv,a=t.ppem,s=t.deltaBase+16*(e-1),l=t.deltaShift,u=t.z0;E.DEBUG&&console.log(t.step,"DELTAP["+e+"]",i,r);for(var h=0;h>4)===a){var d=(15&f)-8;0<=d&&d++,E.DEBUG&&console.log(t.step,"DELTAPFIX",c,"by",d*l);var p=u[c];n.setRelative(p,p,d*l,o)}}}function yr(e,t){var r=t.stack,i=r.pop();E.DEBUG&&console.log(t.step,"ROUND[]"),r.push(64*t.round(i/64))}function br(e,t){var r=t.stack,i=r.pop(),n=t.ppem,o=t.deltaBase+16*(e-1),a=t.deltaShift;E.DEBUG&&console.log(t.step,"DELTAC["+e+"]",i,r);for(var s=0;s>4)===n){var h=(15&u)-8;0<=h&&h++;var c=h*a;E.DEBUG&&console.log(t.step,"DELTACFIX",l,"by",c),t.cvt[l]+=c}}}function _r(e,t){var r,i,n=t.stack,o=n.pop(),a=n.pop(),s=t.z2[o],l=t.z1[a];E.DEBUG&&console.log(t.step,"SDPVTL["+e+"]",o,a),i=e?(r=s.y-l.y,l.x-s.x):(r=l.x-s.x,l.y-s.y),t.dpv=Zt(r,i)}function xr(e,t){var r=t.stack,i=t.prog,n=t.ip;E.DEBUG&&console.log(t.step,"PUSHB["+e+"]");for(var o=0;o":"_")+(i?"R":"_")+(0===n?"Gr":1===n?"Bl":2===n?"Wh":"")+"]",e?c+"("+o.cvt[c]+","+u+")":"",f,"(d =",a,"->",l*s,")"),o.rp1=o.rp0,o.rp2=f,t&&(o.rp0=f)}Ft.prototype.exec=function(e,t){if("number"!=typeof t)throw new Error("Point size is not a number!");if(!(2",i),s.interpolate(c,o,a,l),s.touch(c)}e.loop=1},dr.bind(void 0,0),dr.bind(void 0,1),function(e){for(var t=e.stack,r=e.rp0,i=e.z0[r],n=e.loop,o=e.fv,a=e.pv,s=e.z1;n--;){var l=t.pop(),u=s[l];E.DEBUG&&console.log(e.step,(1=a.width||t>=a.height?[0,0,0,0]:this._getPixel(e,t);var s=new l.default.Image(r,i);return s.canvas.getContext("2d").drawImage(a,e,t,r*o,i*o,0,0,r,i),s},l.default.Renderer.prototype.textLeading=function(e){return"number"==typeof e?(this._setProperty("_textLeading",e),this._pInst):this._textLeading},l.default.Renderer.prototype.textSize=function(e){return"number"==typeof e?(this._setProperty("_textSize",e),this._setProperty("_textLeading",e*y._DEFAULT_LEADMULT),this._applyTextProperties()):this._textSize},l.default.Renderer.prototype.textStyle=function(e){return e?(e!==y.NORMAL&&e!==y.ITALIC&&e!==y.BOLD&&e!==y.BOLDITALIC||this._setProperty("_textStyle",e),this._applyTextProperties()):this._textStyle},l.default.Renderer.prototype.textAscent=function(){return null===this._textAscent&&this._updateTextMetrics(),this._textAscent},l.default.Renderer.prototype.textDescent=function(){return null===this._textDescent&&this._updateTextMetrics(),this._textDescent},l.default.Renderer.prototype.textAlign=function(e,t){return void 0!==e?(this._setProperty("_textAlign",e),void 0!==t&&this._setProperty("_textBaseline",t),this._applyTextProperties()):{horizontal:this._textAlign,vertical:this._textBaseline}},l.default.Renderer.prototype.text=function(e,t,r,i,n){var o,a,s,l,u,h,c,f,d=this._pInst,p=Number.MAX_VALUE;if((this._doFill||this._doStroke)&&void 0!==e){if("string"!=typeof e&&(e=e.toString()),o=(e=e.replace(/(\t)/g," ")).split("\n"),void 0!==i){for(s=f=0;ss.HALF_PI&&e<=3*s.HALF_PI?Math.atan(r/i*Math.tan(e))+s.PI:Math.atan(r/i*Math.tan(e))+s.TWO_PI,t=t<=s.HALF_PI?Math.atan(r/i*Math.tan(t)):t>s.HALF_PI&&t<=3*s.HALF_PI?Math.atan(r/i*Math.tan(t))+s.PI:Math.atan(r/i*Math.tan(t))+s.TWO_PI),tv||Math.abs(this.accelerationY-this.pAccelerationY)>v||Math.abs(this.accelerationZ-this.pAccelerationZ)>v)&&e();var t=this.deviceTurned||window.deviceTurned;if("function"==typeof t){var r=this.rotationX+180,i=this.pRotationX+180,n=c+180;0>>24],i+=x[(16711680&C)>>16],n+=x[(65280&C)>>8],o+=x[255&C],r+=k[_],s++}w[l=T+y]=a/r,S[l]=i/r,M[l]=n/r,E[l]=o/r}T+=d}for(h=(u=-P)*d,b=T=0;b>>16,e[r+1]=(65280&t[i])>>>8,e[r+2]=255&t[i],e[r+3]=(4278190080&t[i])>>>24},O._toImageData=function(e){return e instanceof ImageData?e:e.getContext("2d").getImageData(0,0,e.width,e.height)},O._createImageData=function(e,t){return O._tmpCanvas=document.createElement("canvas"),O._tmpCtx=O._tmpCanvas.getContext("2d"),this._tmpCtx.createImageData(e,t)},O.apply=function(e,t,r){var i=e.getContext("2d"),n=i.getImageData(0,0,e.width,e.height),o=t(n,r);o instanceof ImageData?i.putImageData(o,0,0,0,0,e.width,e.height):i.putImageData(n,0,0,0,0,e.width,e.height)},O.threshold=function(e,t){var r=O._toPixels(e);void 0===t&&(t=.5);for(var i=Math.floor(255*t),n=0;n>8)/i,r[n+1]=255*(a*t>>8)/i,r[n+2]=255*(s*t>>8)/i}},O.dilate=function(e){for(var t,r,i,n,o,a,s,l,u,h,c,f,d,p,m,g,v,y=O._toPixels(e),b=0,_=y.length?y.length/4:0,x=new Int32Array(_);b<_;)for(r=(t=b)+e.width;b>16&255)+151*(i>>8&255)+28*(255&i))<(m=77*(c>>16&255)+151*(c>>8&255)+28*(255&c))&&(n=c,o=m),o<(p=77*((h=O._getARGB(y,a))>>16&255)+151*(h>>8&255)+28*(255&h))&&(n=h,o=p),o<(g=77*(f>>16&255)+151*(f>>8&255)+28*(255&f))&&(n=f,o=g),o<(v=77*(d>>16&255)+151*(d>>8&255)+28*(255&d))&&(n=d,o=v),x[b++]=n;O._setPixels(y,x)},O.erode=function(e){for(var t,r,i,n,o,a,s,l,u,h,c,f,d,p,m,g,v,y=O._toPixels(e),b=0,_=y.length?y.length/4:0,x=new Int32Array(_);b<_;)for(r=(t=b)+e.width;b>16&255)+151*(c>>8&255)+28*(255&c))<(o=77*(i>>16&255)+151*(i>>8&255)+28*(255&i))&&(n=c,o=m),(p=77*((h=O._getARGB(y,a))>>16&255)+151*(h>>8&255)+28*(255&h))>16&255)+151*(f>>8&255)+28*(255&f))>16&255)+151*(d>>8&255)+28*(255&d))=r){var i=Math.floor(t.timeDisplayed/r);if(t.timeDisplayed=0,t.displayIndex+=i,t.loopCount=Math.floor(t.displayIndex/t.numFrames),null!==t.loopLimit&&t.loopCount>=t.loopLimit)t.playing=!1;else{var n=t.displayIndex%t.numFrames;this.drawingContext.putImageData(t.frames[n].image,0,0),t.displayIndex=n,this.setModified(!0)}}}},n.default.Image.prototype._setProperty=function(e,t){this[e]=t,this.setModified(!0)},n.default.Image.prototype.loadPixels=function(){n.default.Renderer2D.prototype.loadPixels.call(this),this.setModified(!0)},n.default.Image.prototype.updatePixels=function(e,t,r,i){n.default.Renderer2D.prototype.updatePixels.call(this,e,t,r,i),this.setModified(!0)},n.default.Image.prototype.get=function(e,t,r,i){return n.default._validateParameters("p5.Image.get",arguments),n.default.Renderer2D.prototype.get.apply(this,arguments)},n.default.Image.prototype._getPixel=n.default.Renderer2D.prototype._getPixel,n.default.Image.prototype.set=function(e,t,r){n.default.Renderer2D.prototype.set.call(this,e,t,r),this.setModified(!0)},n.default.Image.prototype.resize=function(e,t){0===e&&0===t?(e=this.canvas.width,t=this.canvas.height):0===e?e=this.canvas.width*t/this.canvas.height:0===t&&(t=this.canvas.height*e/this.canvas.width),e=Math.floor(e),t=Math.floor(t);var r=document.createElement("canvas");if(r.width=e,r.height=t,this.gifProperties)for(var i=this.gifProperties,n=function(e,t){for(var r=0,i=0;i/g,">").replace(/"/g,""").replace(/'/g,"'")}function l(e,t){t&&!0!==t&&"true"!==t||(t="");var r="";return(e=e||"untitled")&&e.includes(".")&&(r=e.split(".").pop()),t&&r!==t&&(r=t,e="".concat(e,".").concat(r)),[e,r]}e("../core/error_helpers"),v.default.prototype.loadJSON=function(){for(var e=arguments.length,t=new Array(e),r=0;r"),n.print("");if(n.print(' '),n.print(""),n.print(""),n.print(" "),"0"!==o[0]){n.print(" ");for(var h=0;h".concat(c)),n.print(" ")}n.print(" ")}for(var f=0;f");for(var d=0;d".concat(p)),n.print(" ")}n.print(" ")}n.print("
"),n.print(""),n.print("")}n.close(),n.clear()},v.default.prototype.writeFile=function(e,t,r){var i="application/octet-stream";v.default.prototype._isSafari()&&(i="text/plain");var n=new Blob(e,{type:i});v.default.prototype.downloadFile(n,t,r)},v.default.prototype.downloadFile=function(e,t,r){var i=l(t,r),n=i[0];if(e instanceof Blob)s.default.saveAs(e,n);else{var o=document.createElement("a");if(o.href=e,o.download=n,o.onclick=function(e){var t;t=e,document.body.removeChild(t.target),e.stopPropagation()},o.style.display="none",document.body.appendChild(o),v.default.prototype._isSafari()){var a="Hello, Safari user! To download this file...\n";a+="1. Go to File --\x3e Save As.\n",a+='2. Choose "Page Source" as the Format.\n',a+='3. Name it with this extension: ."'.concat(i[1],'"'),alert(a)}o.click()}},v.default.prototype._checkFileExtension=l,v.default.prototype._isSafari=function(){return 0>>0},getSeed:function(){return t},rand:function(){return(r=(1664525*r+1013904223)%i)/i}});n.setSeed(e),_=new Array(4096);for(var o=0;o<4096;o++)_[o]=n.rand()};var o=n.default;r.default=o},{"../core/main":49}],82:[function(e,t,r){"use strict";function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i,l=(i=e("../core/main"))&&i.__esModule?i:{default:i},o=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==a(e)&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var o=i?Object.getOwnPropertyDescriptor(e,n):null;o&&(o.get||o.set)?Object.defineProperty(r,n,o):r[n]=e[n]}r.default=e,t&&t.set(e,r);return r}(e("../core/constants"));function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}l.default.Vector=function(e,t,r){var i,n,o;o=e instanceof l.default?(this.p5=e,i=t[0]||0,n=t[1]||0,t[2]||0):(i=e||0,n=t||0,r||0),this.x=i,this.y=n,this.z=o},l.default.Vector.prototype.toString=function(){return"p5.Vector Object : [".concat(this.x,", ").concat(this.y,", ").concat(this.z,"]")},l.default.Vector.prototype.set=function(e,t,r){return e instanceof l.default.Vector?(this.x=e.x||0,this.y=e.y||0,this.z=e.z||0):e instanceof Array?(this.x=e[0]||0,this.y=e[1]||0,this.z=e[2]||0):(this.x=e||0,this.y=t||0,this.z=r||0),this},l.default.Vector.prototype.copy=function(){return this.p5?new l.default.Vector(this.p5,[this.x,this.y,this.z]):new l.default.Vector(this.x,this.y,this.z)},l.default.Vector.prototype.add=function(e,t,r){return e instanceof l.default.Vector?(this.x+=e.x||0,this.y+=e.y||0,this.z+=e.z||0):e instanceof Array?(this.x+=e[0]||0,this.y+=e[1]||0,this.z+=e[2]||0):(this.x+=e||0,this.y+=t||0,this.z+=r||0),this};function u(e,t){return 0!==e&&(this.x=this.x%e),0!==t&&(this.y=this.y%t),this}function h(e,t,r){return 0!==e&&(this.x=this.x%e),0!==t&&(this.y=this.y%t),0!==r&&(this.z=this.z%r),this}l.default.Vector.prototype.rem=function(e,t,r){if(e instanceof l.default.Vector){if(Number.isFinite(e.x)&&Number.isFinite(e.y)&&Number.isFinite(e.z)){var i=parseFloat(e.x),n=parseFloat(e.y),o=parseFloat(e.z);h.call(this,i,n,o)}}else if(e instanceof Array)e.every(function(e){return Number.isFinite(e)})&&(2===e.length&&u.call(this,e[0],e[1]),3===e.length&&h.call(this,e[0],e[1],e[2]));else if(1===arguments.length){if(Number.isFinite(e)&&0!==e)return this.x=this.x%e,this.y=this.y%e,this.z=this.z%e,this}else if(2===arguments.length){var a=Array.prototype.slice.call(arguments);a.every(function(e){return Number.isFinite(e)})&&2===a.length&&u.call(this,a[0],a[1])}else if(3===arguments.length){var s=Array.prototype.slice.call(arguments);s.every(function(e){return Number.isFinite(e)})&&3===s.length&&h.call(this,s[0],s[1],s[2])}},l.default.Vector.prototype.sub=function(e,t,r){return e instanceof l.default.Vector?(this.x-=e.x||0,this.y-=e.y||0,this.z-=e.z||0):e instanceof Array?(this.x-=e[0]||0,this.y-=e[1]||0,this.z-=e[2]||0):(this.x-=e||0,this.y-=t||0,this.z-=r||0),this},l.default.Vector.prototype.mult=function(e){return"number"==typeof e&&isFinite(e)?(this.x*=e,this.y*=e,this.z*=e):console.warn("p5.Vector.prototype.mult:","n is undefined or not a finite number"),this},l.default.Vector.prototype.div=function(e){return"number"==typeof e&&isFinite(e)?0===e?console.warn("p5.Vector.prototype.div:","divide by 0"):(this.x/=e,this.y/=e,this.z/=e):console.warn("p5.Vector.prototype.div:","n is undefined or not a finite number"),this},l.default.Vector.prototype.mag=function(){return Math.sqrt(this.magSq())},l.default.Vector.prototype.magSq=function(){var e=this.x,t=this.y,r=this.z;return e*e+t*t+r*r},l.default.Vector.prototype.dot=function(e,t,r){return e instanceof l.default.Vector?this.dot(e.x,e.y,e.z):this.x*(e||0)+this.y*(t||0)+this.z*(r||0)},l.default.Vector.prototype.cross=function(e){var t=this.y*e.z-this.z*e.y,r=this.z*e.x-this.x*e.z,i=this.x*e.y-this.y*e.x;return this.p5?new l.default.Vector(this.p5,[t,r,i]):new l.default.Vector(t,r,i)},l.default.Vector.prototype.dist=function(e){return e.copy().sub(this).mag()},l.default.Vector.prototype.normalize=function(){var e=this.mag();return 0!==e&&this.mult(1/e),this},l.default.Vector.prototype.limit=function(e){var t=this.magSq();return e*e>>0},n.default.prototype.randomSeed=function(e){this._lcgSetSeed(o,e),this._gaussian_previous=!1},n.default.prototype.random=function(e,t){var r;if(n.default._validateParameters("random",arguments),r=null!=this[o]?this._lcg(o):Math.random(),void 0===e)return r;if(void 0===t)return e instanceof Array?e[Math.floor(r*e.length)]:r*e;if(tf){var P=p,L=l,k=u;p=d+f*(s&&d=t&&(r=r.substring(r.length-t,r.length)),r}},n.default.prototype.unhex=function(e){return e instanceof Array?e.map(n.default.prototype.unhex):parseInt("0x".concat(e),16)};var o=n.default;r.default=o},{"../core/main":49}],90:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i,a=(i=e("../core/main"))&&i.__esModule?i:{default:i};function n(e,t,r){var i=e<0,n=i?e.toString().substring(1):e.toString(),o=n.indexOf("."),a=-1!==o?n.substring(0,o):n,s=-1!==o?n.substring(o+1):"",l=i?"-":"";if(void 0!==r){var u="";(-1!==o||0r&&(s=s.substring(0,r));for(var h=0;hi.length)for(var o=t-(i+=-1===r?".":"").length+1,a=0;a=d.TWO_PI?"".concat("ellipse","|").concat(u,"|"):"".concat("arc","|").concat(a,"|").concat(s,"|").concat(l,"|").concat(u,"|"),!this.geometryInHash(t)){var h=new T.default.Geometry(u,1,function(){if(this.strokeIndices=[],a.toFixed(10)!==s.toFixed(10)){l!==d.PIE&&void 0!==l||(this.vertices.push(new T.default.Vector(.5,.5,0)),this.uvs.push([.5,.5]));for(var e=0;e<=u;e++){var t=(s-a)*(e/u)+a,r=.5+Math.cos(t)/2,i=.5+Math.sin(t)/2;this.vertices.push(new T.default.Vector(r,i,0)),this.uvs.push([r,i]),e>5&31)/31,(y>>10&31)/31):(r=a,i=s,l)}for(var b=1;b<=3;b++){var _=p+12*b,x=new S.default.Vector(u.getFloat32(_,!0),u.getFloat32(8+_,!0),u.getFloat32(4+_,!0));e.vertices.push(x),c&&o.push(r,i,n)}var w=new S.default.Vector(m,g,v);e.vertexNormals.push(w,w,w),e.faces.push([3*d,3*d+1,3*d+2]),e.uvs.push([0,0],[0,0],[0,0])}}(e,t);else{var r=new DataView(t);if(!("TextDecoder"in window))return console.warn("Sorry, ASCII STL loading only works in browsers that support TextDecoder (https://caniuse.com/#feat=textencoder)");var i=new TextDecoder("utf-8").decode(r).split("\n");!function(e,t){for(var r,i,n="",o=[],a=0;aMath.PI?l=Math.PI:l<=0&&(l=.001);var u=Math.sin(l)*a*Math.sin(s),h=Math.cos(l)*a,c=Math.sin(l)*a*Math.cos(s);this.camera(u+this.centerX,h+this.centerY,c+this.centerZ,this.centerX,this.centerY,this.centerZ,0,1,0)},m.default.Camera.prototype._isActive=function(){return this===this._renderer._curCamera},m.default.prototype.setCamera=function(e){this._renderer._curCamera=e,this._renderer.uPMatrix.set(e.projMatrix.mat4[0],e.projMatrix.mat4[1],e.projMatrix.mat4[2],e.projMatrix.mat4[3],e.projMatrix.mat4[4],e.projMatrix.mat4[5],e.projMatrix.mat4[6],e.projMatrix.mat4[7],e.projMatrix.mat4[8],e.projMatrix.mat4[9],e.projMatrix.mat4[10],e.projMatrix.mat4[11],e.projMatrix.mat4[12],e.projMatrix.mat4[13],e.projMatrix.mat4[14],e.projMatrix.mat4[15])};var n=m.default.Camera;r.default=n},{"../core/main":49}],98:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i,h=(i=e("../core/main"))&&i.__esModule?i:{default:i};h.default.Geometry=function(e,t,r){return this.vertices=[],this.lineVertices=[],this.lineNormals=[],this.vertexNormals=[],this.faces=[],this.uvs=[],this.edges=[],this.vertexColors=[],this.detailX=void 0!==e?e:1,this.detailY=void 0!==t?t:1,this.dirtyFlags={},r instanceof Function&&r.call(this),this},h.default.Geometry.prototype.reset=function(){this.lineVertices.length=0,this.lineNormals.length=0,this.vertices.length=0,this.edges.length=0,this.vertexColors.length=0,this.vertexNormals.length=0,this.uvs.length=0,this.dirtyFlags={}},h.default.Geometry.prototype.computeFaces=function(){this.faces.length=0;for(var e,t,r,i,n=this.detailX+1,o=0;othis.vertices.length-1-this.detailX;i--)e.add(this.vertexNormals[i]);e=h.default.Vector.div(e,this.detailX);for(var n=this.vertices.length-1;n>this.vertices.length-1-this.detailX;n--)this.vertexNormals[n]=e;return this},h.default.Geometry.prototype._makeTriangleEdges=function(){if(this.edges.length=0,Array.isArray(this.strokeIndices))for(var e=0,t=this.strokeIndices.length;e vTexCoord.y;\n bool y1 = p1.y > vTexCoord.y;\n bool y2 = p2.y > vTexCoord.y;\n\n // could web be under the curve (after t1)?\n if (y1 ? !y2 : y0) {\n // add the coverage for t1\n coverage.x += saturate(C1.x + 0.5);\n // calculate the anti-aliasing for t1\n weight.x = min(weight.x, abs(C1.x));\n }\n\n // are we outside the curve (after t2)?\n if (y1 ? !y0 : y2) {\n // subtract the coverage for t2\n coverage.x -= saturate(C2.x + 0.5);\n // calculate the anti-aliasing for t2\n weight.x = min(weight.x, abs(C2.x));\n }\n}\n\n// this is essentially the same as coverageX, but with the axes swapped\nvoid coverageY(vec2 p0, vec2 p1, vec2 p2) {\n\n vec2 C1, C2;\n calulateCrossings(p0, p1, p2, C1, C2);\n\n bool x0 = p0.x > vTexCoord.x;\n bool x1 = p1.x > vTexCoord.x;\n bool x2 = p2.x > vTexCoord.x;\n\n if (x1 ? !x2 : x0) {\n coverage.y -= saturate(C1.y + 0.5);\n weight.y = min(weight.y, abs(C1.y));\n }\n\n if (x1 ? !x0 : x2) {\n coverage.y += saturate(C2.y + 0.5);\n weight.y = min(weight.y, abs(C2.y));\n }\n}\n\nvoid main() {\n\n // calculate the pixel scale based on screen-coordinates\n pixelScale = hardness / fwidth(vTexCoord);\n\n // which grid cell is this pixel in?\n ivec2 gridCoord = ifloor(vTexCoord * vec2(uGridSize));\n\n // intersect curves in this row\n {\n // the index into the row info bitmap\n int rowIndex = gridCoord.y + uGridOffset.y;\n // fetch the info texel\n vec4 rowInfo = getTexel(uSamplerRows, rowIndex, uGridImageSize);\n // unpack the rowInfo\n int rowStrokeIndex = getInt16(rowInfo.xy);\n int rowStrokeCount = getInt16(rowInfo.zw);\n\n for (int iRowStroke = INT(0); iRowStroke < N; iRowStroke++) {\n if (iRowStroke >= rowStrokeCount)\n break;\n\n // each stroke is made up of 3 points: the start and control point\n // and the start of the next curve.\n // fetch the indices of this pair of strokes:\n vec4 strokeIndices = getTexel(uSamplerRowStrokes, rowStrokeIndex++, uCellsImageSize);\n\n // unpack the stroke index\n int strokePos = getInt16(strokeIndices.xy);\n\n // fetch the two strokes\n vec4 stroke0 = getTexel(uSamplerStrokes, strokePos + INT(0), uStrokeImageSize);\n vec4 stroke1 = getTexel(uSamplerStrokes, strokePos + INT(1), uStrokeImageSize);\n\n // calculate the coverage\n coverageX(stroke0.xy, stroke0.zw, stroke1.xy);\n }\n }\n\n // intersect curves in this column\n {\n int colIndex = gridCoord.x + uGridOffset.x;\n vec4 colInfo = getTexel(uSamplerCols, colIndex, uGridImageSize);\n int colStrokeIndex = getInt16(colInfo.xy);\n int colStrokeCount = getInt16(colInfo.zw);\n \n for (int iColStroke = INT(0); iColStroke < N; iColStroke++) {\n if (iColStroke >= colStrokeCount)\n break;\n\n vec4 strokeIndices = getTexel(uSamplerColStrokes, colStrokeIndex++, uCellsImageSize);\n\n int strokePos = getInt16(strokeIndices.xy);\n vec4 stroke0 = getTexel(uSamplerStrokes, strokePos + INT(0), uStrokeImageSize);\n vec4 stroke1 = getTexel(uSamplerStrokes, strokePos + INT(1), uStrokeImageSize);\n coverageY(stroke0.xy, stroke0.zw, stroke1.xy);\n }\n }\n\n weight = saturate(1.0 - weight * 2.0);\n float distance = max(weight.x + weight.y, minDistance); // manhattan approx.\n float antialias = abs(dot(coverage, weight) / distance);\n float cover = min(abs(coverage.x), abs(coverage.y));\n gl_FragColor = uMaterialColor;\n gl_FragColor.a *= saturate(max(antialias, cover));\n}",lineVert:"/*\n Part of the Processing project - http://processing.org\n Copyright (c) 2012-15 The Processing Foundation\n Copyright (c) 2004-12 Ben Fry and Casey Reas\n Copyright (c) 2001-04 Massachusetts Institute of Technology\n This library is free software; you can redistribute it and/or\n modify it under the terms of the GNU Lesser General Public\n License as published by the Free Software Foundation, version 2.1.\n This library is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n Lesser General Public License for more details.\n You should have received a copy of the GNU Lesser General\n Public License along with this library; if not, write to the\n Free Software Foundation, Inc., 59 Temple Place, Suite 330,\n Boston, MA 02111-1307 USA\n*/\n\n#define PROCESSING_LINE_SHADER\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform float uStrokeWeight;\n\nuniform vec4 uViewport;\nuniform int uPerspective;\n\nattribute vec4 aPosition;\nattribute vec4 aDirection;\n \nvoid main() {\n // using a scale <1 moves the lines towards the camera\n // in order to prevent popping effects due to half of\n // the line disappearing behind the geometry faces.\n vec3 scale = vec3(0.9995);\n\n vec4 posp = uModelViewMatrix * aPosition;\n vec4 posq = uModelViewMatrix * (aPosition + vec4(aDirection.xyz, 0));\n\n // Moving vertices slightly toward the camera\n // to avoid depth-fighting with the fill triangles.\n // Discussed here:\n // http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Number=252848 \n posp.xyz = posp.xyz * scale;\n posq.xyz = posq.xyz * scale;\n\n vec4 p = uProjectionMatrix * posp;\n vec4 q = uProjectionMatrix * posq;\n\n // formula to convert from clip space (range -1..1) to screen space (range 0..[width or height])\n // screen_p = (p.xy/p.w + <1,1>) * 0.5 * uViewport.zw\n\n // prevent division by W by transforming the tangent formula (div by 0 causes\n // the line to disappear, see https://github.com/processing/processing/issues/5183)\n // t = screen_q - screen_p\n //\n // tangent is normalized and we don't care which aDirection it points to (+-)\n // t = +- normalize( screen_q - screen_p )\n // t = +- normalize( (q.xy/q.w+<1,1>)*0.5*uViewport.zw - (p.xy/p.w+<1,1>)*0.5*uViewport.zw )\n //\n // extract common factor, <1,1> - <1,1> cancels out\n // t = +- normalize( (q.xy/q.w - p.xy/p.w) * 0.5 * uViewport.zw )\n //\n // convert to common divisor\n // t = +- normalize( ((q.xy*p.w - p.xy*q.w) / (p.w*q.w)) * 0.5 * uViewport.zw )\n //\n // remove the common scalar divisor/factor, not needed due to normalize and +-\n // (keep uViewport - can't remove because it has different components for x and y\n // and corrects for aspect ratio, see https://github.com/processing/processing/issues/5181)\n // t = +- normalize( (q.xy*p.w - p.xy*q.w) * uViewport.zw )\n\n vec2 tangent = normalize((q.xy*p.w - p.xy*q.w) * uViewport.zw);\n\n // flip tangent to normal (it's already normalized)\n vec2 normal = vec2(-tangent.y, tangent.x);\n\n float thickness = aDirection.w * uStrokeWeight;\n vec2 offset = normal * thickness / 2.0;\n\n vec2 curPerspScale;\n\n if(uPerspective == 1) {\n // Perspective ---\n // convert from world to clip by multiplying with projection scaling factor\n // to get the right thickness (see https://github.com/processing/processing/issues/5182)\n // invert Y, projections in Processing invert Y\n curPerspScale = (uProjectionMatrix * vec4(1, -1, 0, 0)).xy;\n } else {\n // No Perspective ---\n // multiply by W (to cancel out division by W later in the pipeline) and\n // convert from screen to clip (derived from clip to screen above)\n curPerspScale = p.w / (0.5 * uViewport.zw);\n }\n\n gl_Position.xy = p.xy + offset.xy * curPerspScale;\n gl_Position.zw = p.zw;\n}\n",lineFrag:"precision mediump float;\nprecision mediump int;\n\nuniform vec4 uMaterialColor;\n\nvoid main() {\n gl_FragColor = uMaterialColor;\n}",pointVert:"attribute vec3 aPosition;\nuniform float uPointSize;\nvarying float vStrokeWeight;\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nvoid main() {\n\tvec4 positionVec4 = vec4(aPosition, 1.0);\n\tgl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n\tgl_PointSize = uPointSize;\n\tvStrokeWeight = uPointSize;\n}",pointFrag:"precision mediump float;\nprecision mediump int;\nuniform vec4 uMaterialColor;\nvarying float vStrokeWeight;\n\nvoid main(){\n\tfloat mask = 0.0;\n\n\t// make a circular mask using the gl_PointCoord (goes from 0 - 1 on a point)\n // might be able to get a nicer edge on big strokeweights with smoothstep but slightly less performant\n\n\tmask = step(0.98, length(gl_PointCoord * 2.0 - 1.0));\n\n\t// if strokeWeight is 1 or less lets just draw a square\n\t// this prevents weird artifacting from carving circles when our points are really small\n\t// if strokeWeight is larger than 1, we just use it as is\n\n\tmask = mix(0.0, mask, clamp(floor(vStrokeWeight - 0.5),0.0,1.0));\n\n\t// throw away the borders of the mask\n // otherwise we get weird alpha blending issues\n\n\tif(mask > 0.98){\n discard;\n \t}\n\n \tgl_FragColor = vec4(uMaterialColor.rgb * (1.0 - mask), uMaterialColor.a) ;\n}"};u.default.RendererGL=function(e,t,r,i){return u.default.Renderer.call(this,e,t,r),this._setAttributeDefaults(t),this._initContext(),this.isP3D=!0,this.GL=this.drawingContext,this._isErasing=!1,this._enableLighting=!1,this.ambientLightColors=[],this.specularColors=[1,1,1],this.directionalLightDirections=[],this.directionalLightDiffuseColors=[],this.directionalLightSpecularColors=[],this.pointLightPositions=[],this.pointLightDiffuseColors=[],this.pointLightSpecularColors=[],this.spotLightPositions=[],this.spotLightDirections=[],this.spotLightDiffuseColors=[],this.spotLightSpecularColors=[],this.spotLightAngle=[],this.spotLightConc=[],this.drawMode=o.FILL,this.curFillColor=this._cachedFillStyle=[1,1,1,1],this.curStrokeColor=this._cachedStrokeStyle=[0,0,0,1],this.curBlendMode=o.BLEND,this._cachedBlendMode=void 0,this.blendExt=this.GL.getExtension("EXT_blend_minmax"),this._isBlending=!1,this._useSpecularMaterial=!1,this._useEmissiveMaterial=!1,this._useNormalMaterial=!1,this._useShininess=1,this._tint=[255,255,255,255],this.constantAttenuation=1,this.linearAttenuation=0,this.quadraticAttenuation=0,this.uMVMatrix=new u.default.Matrix,this.uPMatrix=new u.default.Matrix,this.uNMatrix=new u.default.Matrix("mat3"),this._curCamera=new u.default.Camera(this),this._curCamera._computeCameraDefaultSettings(),this._curCamera._setDefaultCamera(),this._defaultLightShader=void 0,this._defaultImmediateModeShader=void 0,this._defaultNormalShader=void 0,this._defaultColorShader=void 0,this._defaultPointShader=void 0,this.userFillShader=void 0,this.userStrokeShader=void 0,this.userPointShader=void 0,this.retainedMode={geometry:{},buffers:{stroke:[new u.default.RenderBuffer(3,"lineVertices","lineVertexBuffer","aPosition",this,this._flatten),new u.default.RenderBuffer(4,"lineNormals","lineNormalBuffer","aDirection",this,this._flatten)],fill:[new u.default.RenderBuffer(3,"vertices","vertexBuffer","aPosition",this,this._vToNArray),new u.default.RenderBuffer(3,"vertexNormals","normalBuffer","aNormal",this,this._vToNArray),new u.default.RenderBuffer(4,"vertexColors","colorBuffer","aMaterialColor",this),new u.default.RenderBuffer(3,"vertexAmbients","ambientBuffer","aAmbientColor",this),new u.default.RenderBuffer(2,"uvs","uvBuffer","aTexCoord",this,this._flatten)],text:[new u.default.RenderBuffer(3,"vertices","vertexBuffer","aPosition",this,this._vToNArray),new u.default.RenderBuffer(2,"uvs","uvBuffer","aTexCoord",this,this._flatten)]}},this.immediateMode={geometry:new u.default.Geometry,shapeMode:o.TRIANGLE_FAN,_bezierVertex:[],_quadraticVertex:[],_curveVertex:[],buffers:{fill:[new u.default.RenderBuffer(3,"vertices","vertexBuffer","aPosition",this,this._vToNArray),new u.default.RenderBuffer(3,"vertexNormals","normalBuffer","aNormal",this,this._vToNArray),new u.default.RenderBuffer(4,"vertexColors","colorBuffer","aVertexColor",this),new u.default.RenderBuffer(3,"vertexAmbients","ambientBuffer","aAmbientColor",this),new u.default.RenderBuffer(2,"uvs","uvBuffer","aTexCoord",this,this._flatten)],stroke:[new u.default.RenderBuffer(3,"lineVertices","lineVertexBuffer","aPosition",this,this._flatten),new u.default.RenderBuffer(4,"lineNormals","lineNormalBuffer","aDirection",this,this._flatten)],point:this.GL.createBuffer()}},this.pointSize=5,this.curStrokeWeight=1,this.textures=[],this.textureMode=o.IMAGE,this.textureWrapX=o.CLAMP,this.textureWrapY=o.CLAMP,this._tex=null,this._curveTightness=6,this._lookUpTableBezier=[],this._lookUpTableQuadratic=[],this._lutBezierDetail=0,this._lutQuadraticDetail=0,this._tessy=this._initTessy(),this.fontInfos={},this._curShader=void 0,this},u.default.RendererGL.prototype=Object.create(u.default.Renderer.prototype),u.default.RendererGL.prototype._setAttributeDefaults=function(e){var t={alpha:!0,depth:!0,stencil:!0,antialias:navigator.userAgent.toLowerCase().includes("safari"),premultipliedAlpha:!1,preserveDrawingBuffer:!0,perPixelLighting:!0};null===e._glAttributes?e._glAttributes=t:e._glAttributes=Object.assign(t,e._glAttributes)},u.default.RendererGL.prototype._initContext=function(){try{if(this.drawingContext=this.canvas.getContext("webgl",this._pInst._glAttributes)||this.canvas.getContext("experimental-webgl",this._pInst._glAttributes),null===this.drawingContext)throw new Error("Error creating webgl context");var e=this.drawingContext;e.enable(e.DEPTH_TEST),e.depthFunc(e.LEQUAL),e.viewport(0,0,e.drawingBufferWidth,e.drawingBufferHeight),this._viewport=this.drawingContext.getParameter(this.drawingContext.VIEWPORT)}catch(e){throw e}},u.default.RendererGL.prototype._resetContext=function(e,t){var r=this.width,i=this.height,n=this.canvas.id,o=this._pInst instanceof u.default.Graphics;if(o){var a=this._pInst;a.canvas.parentNode.removeChild(a.canvas),a.canvas=document.createElement("canvas"),(a._pInst._userNode||document.body).appendChild(a.canvas),u.default.Element.call(a,a.canvas,a._pInst),a.width=r,a.height=i}else{var s=this.canvas;s&&s.parentNode.removeChild(s),(s=document.createElement("canvas")).id=n,this._pInst._userNode?this._pInst._userNode.appendChild(s):document.body.appendChild(s),this._pInst.canvas=s}var l=new u.default.RendererGL(this._pInst.canvas,this._pInst,!o);this._pInst._setProperty("_renderer",l),l.resize(r,i),l._applyDefaults(),o||this._pInst._elements.push(l),"function"==typeof t&&setTimeout(function(){t.apply(window._renderer,e)},0)},u.default.prototype.setAttributes=function(e,t){if(void 0!==this._glAttributes){var r=!0;if(void 0!==t?(null===this._glAttributes&&(this._glAttributes={}),this._glAttributes[e]!==t&&(this._glAttributes[e]=t,r=!1)):e instanceof Object&&this._glAttributes!==e&&(this._glAttributes=e,r=!1),this._renderer.isP3D&&!r){if(!this._setupDone)for(var i in this._renderer.retainedMode.geometry)if(this._renderer.retainedMode.geometry.hasOwnProperty(i))return void console.error("Sorry, Could not set the attributes, you need to call setAttributes() before calling the other drawing methods in setup()");this.push(),this._renderer._resetContext(),this.pop(),this._renderer._curCamera&&(this._renderer._curCamera._renderer=this._renderer)}}else console.log("You are trying to use setAttributes on a p5.Graphics object that does not use a WEBGL renderer.")},u.default.RendererGL.prototype._update=function(){this.uMVMatrix.set(this._curCamera.cameraMatrix.mat4[0],this._curCamera.cameraMatrix.mat4[1],this._curCamera.cameraMatrix.mat4[2],this._curCamera.cameraMatrix.mat4[3],this._curCamera.cameraMatrix.mat4[4],this._curCamera.cameraMatrix.mat4[5],this._curCamera.cameraMatrix.mat4[6],this._curCamera.cameraMatrix.mat4[7],this._curCamera.cameraMatrix.mat4[8],this._curCamera.cameraMatrix.mat4[9],this._curCamera.cameraMatrix.mat4[10],this._curCamera.cameraMatrix.mat4[11],this._curCamera.cameraMatrix.mat4[12],this._curCamera.cameraMatrix.mat4[13],this._curCamera.cameraMatrix.mat4[14],this._curCamera.cameraMatrix.mat4[15]),this.ambientLightColors.length=0,this.specularColors=[1,1,1],this.directionalLightDirections.length=0,this.directionalLightDiffuseColors.length=0,this.directionalLightSpecularColors.length=0,this.pointLightPositions.length=0,this.pointLightDiffuseColors.length=0,this.pointLightSpecularColors.length=0,this.spotLightPositions.length=0,this.spotLightDirections.length=0,this.spotLightDiffuseColors.length=0,this.spotLightSpecularColors.length=0,this.spotLightAngle.length=0,this.spotLightConc.length=0,this._enableLighting=!1,this._tint=[255,255,255,255],this.GL.clear(this.GL.DEPTH_BUFFER_BIT)},u.default.RendererGL.prototype.background=function(){var e,t=(e=this._pInst).color.apply(e,arguments),r=t.levels[0]/255,i=t.levels[1]/255,n=t.levels[2]/255,o=t.levels[3]/255;this.GL.clearColor(r,i,n,o),this.GL.clear(this.GL.COLOR_BUFFER_BIT)},u.default.RendererGL.prototype.fill=function(e,t,r,i){var n=u.default.prototype.color.apply(this._pInst,arguments);this.curFillColor=n._array,this.drawMode=o.FILL,this._useNormalMaterial=!1,this._tex=null},u.default.RendererGL.prototype.stroke=function(e,t,r,i){arguments[3]=255;var n=u.default.prototype.color.apply(this._pInst,arguments);this.curStrokeColor=n._array},u.default.RendererGL.prototype.strokeCap=function(e){console.error("Sorry, strokeCap() is not yet implemented in WEBGL mode")},u.default.RendererGL.prototype.strokeJoin=function(e){console.error("Sorry, strokeJoin() is not yet implemented in WEBGL mode")},u.default.RendererGL.prototype.filter=function(e){console.error("filter() does not work in WEBGL mode")},u.default.RendererGL.prototype.blendMode=function(e){e===o.DARKEST||e===o.LIGHTEST||e===o.ADD||e===o.BLEND||e===o.SUBTRACT||e===o.SCREEN||e===o.EXCLUSION||e===o.REPLACE||e===o.MULTIPLY||e===o.REMOVE?this.curBlendMode=e:e!==o.BURN&&e!==o.OVERLAY&&e!==o.HARD_LIGHT&&e!==o.SOFT_LIGHT&&e!==o.DODGE||console.warn("BURN, OVERLAY, HARD_LIGHT, SOFT_LIGHT, and DODGE only work for blendMode in 2D mode.")},u.default.RendererGL.prototype.erase=function(e,t){this._isErasing||(this._cachedBlendMode=this.curBlendMode,this.blendMode(o.REMOVE),this._cachedFillStyle=this.curFillColor.slice(),this.curFillColor=[1,1,1,e/255],this._cachedStrokeStyle=this.curStrokeColor.slice(),this.curStrokeColor=[1,1,1,t/255],this._isErasing=!0)},u.default.RendererGL.prototype.noErase=function(){this._isErasing&&(this.curFillColor=this._cachedFillStyle.slice(),this.curStrokeColor=this._cachedStrokeStyle.slice(),this.blendMode(this._cachedBlendMode),this._isErasing=!1)},u.default.RendererGL.prototype.strokeWeight=function(e){this.curStrokeWeight!==e&&(this.pointSize=e,this.curStrokeWeight=e)},u.default.RendererGL.prototype._getPixel=function(e,t){var r;return r=new Uint8Array(4),this.drawingContext.readPixels(e,t,1,1,this.drawingContext.RGBA,this.drawingContext.UNSIGNED_BYTE,r),[r[0],r[1],r[2],r[3]]},u.default.RendererGL.prototype.loadPixels=function(){var e=this._pixelsState;if(!0===this._pInst._glAttributes.preserveDrawingBuffer){var t=e.pixels,r=this.GL.drawingBufferWidth*this.GL.drawingBufferHeight*4;t instanceof Uint8Array&&t.length===r||(t=new Uint8Array(r),this._pixelsState._setProperty("pixels",t));var i=this._pInst._pixelDensity;this.GL.readPixels(0,0,this.width*i,this.height*i,this.GL.RGBA,this.GL.UNSIGNED_BYTE,t)}else console.log("loadPixels only works in WebGL when preserveDrawingBuffer is true.")},u.default.RendererGL.prototype.geometryInHash=function(e){return void 0!==this.retainedMode.geometry[e]},u.default.RendererGL.prototype.resize=function(e,t){u.default.Renderer.prototype.resize.call(this,e,t),this.GL.viewport(0,0,this.GL.drawingBufferWidth,this.GL.drawingBufferHeight),this._viewport=this.GL.getParameter(this.GL.VIEWPORT),this._curCamera._resize();var r=this._pixelsState;void 0!==r.pixels&&r._setProperty("pixels",new Uint8Array(this.GL.drawingBufferWidth*this.GL.drawingBufferHeight*4))},u.default.RendererGL.prototype.clear=function(){var e=(arguments.length<=0?void 0:arguments[0])||0,t=(arguments.length<=1?void 0:arguments[1])||0,r=(arguments.length<=2?void 0:arguments[2])||0,i=(arguments.length<=3?void 0:arguments[3])||0;this.GL.clearColor(e,t,r,i),this.GL.clear(this.GL.COLOR_BUFFER_BIT|this.GL.DEPTH_BUFFER_BIT)},u.default.RendererGL.prototype.applyMatrix=function(e,t,r,i,n,o){16===arguments.length?u.default.Matrix.prototype.apply.apply(this.uMVMatrix,arguments):this.uMVMatrix.apply([e,t,0,0,r,i,0,0,0,0,1,0,n,o,0,1])},u.default.RendererGL.prototype.translate=function(e,t,r){return e instanceof u.default.Vector&&(r=e.z,t=e.y,e=e.x),this.uMVMatrix.translate([e,t,r]),this},u.default.RendererGL.prototype.scale=function(e,t,r){return this.uMVMatrix.scale(e,t,r),this},u.default.RendererGL.prototype.rotate=function(e,t){return void 0===t?this.rotateZ(e):(u.default.Matrix.prototype.rotate.apply(this.uMVMatrix,arguments),this)},u.default.RendererGL.prototype.rotateX=function(e){return this.rotate(e,1,0,0),this},u.default.RendererGL.prototype.rotateY=function(e){return this.rotate(e,0,1,0),this},u.default.RendererGL.prototype.rotateZ=function(e){return this.rotate(e,0,0,1),this},u.default.RendererGL.prototype.push=function(){var e=u.default.Renderer.prototype.push.apply(this),t=e.properties;return t.uMVMatrix=this.uMVMatrix.copy(),t.uPMatrix=this.uPMatrix.copy(),t._curCamera=this._curCamera,this._curCamera=this._curCamera.copy(),t.ambientLightColors=this.ambientLightColors.slice(),t.specularColors=this.specularColors.slice(),t.directionalLightDirections=this.directionalLightDirections.slice(),t.directionalLightDiffuseColors=this.directionalLightDiffuseColors.slice(),t.directionalLightSpecularColors=this.directionalLightSpecularColors.slice(),t.pointLightPositions=this.pointLightPositions.slice(),t.pointLightDiffuseColors=this.pointLightDiffuseColors.slice(),t.pointLightSpecularColors=this.pointLightSpecularColors.slice(),t.spotLightPositions=this.spotLightPositions.slice(),t.spotLightDirections=this.spotLightDirections.slice(),t.spotLightDiffuseColors=this.spotLightDiffuseColors.slice(),t.spotLightSpecularColors=this.spotLightSpecularColors.slice(),t.spotLightAngle=this.spotLightAngle.slice(),t.spotLightConc=this.spotLightConc.slice(),t.userFillShader=this.userFillShader,t.userStrokeShader=this.userStrokeShader,t.userPointShader=this.userPointShader,t.pointSize=this.pointSize,t.curStrokeWeight=this.curStrokeWeight,t.curStrokeColor=this.curStrokeColor,t.curFillColor=this.curFillColor,t._useSpecularMaterial=this._useSpecularMaterial,t._useEmissiveMaterial=this._useEmissiveMaterial,t._useShininess=this._useShininess,t.constantAttenuation=this.constantAttenuation,t.linearAttenuation=this.linearAttenuation,t.quadraticAttenuation=this.quadraticAttenuation,t._enableLighting=this._enableLighting,t._useNormalMaterial=this._useNormalMaterial,t._tex=this._tex,t.drawMode=this.drawMode,e},u.default.RendererGL.prototype.resetMatrix=function(){return this.uMVMatrix=u.default.Matrix.identity(this._pInst),this},u.default.RendererGL.prototype._getImmediateStrokeShader=function(){var e=this.userStrokeShader;return e&&e.isStrokeShader()?e:this._getLineShader()},u.default.RendererGL.prototype._getRetainedStrokeShader=u.default.RendererGL.prototype._getImmediateStrokeShader,u.default.RendererGL.prototype._getImmediateFillShader=function(){var e=this.userFillShader;if(this._useNormalMaterial&&(!e||!e.isNormalShader()))return this._getNormalShader();if(this._enableLighting){if(!e||!e.isLightShader())return this._getLightShader()}else if(this._tex){if(!e||!e.isTextureShader())return this._getLightShader()}else if(!e)return this._getImmediateModeShader();return e},u.default.RendererGL.prototype._getRetainedFillShader=function(){if(this._useNormalMaterial)return this._getNormalShader();var e=this.userFillShader;if(this._enableLighting){if(!e||!e.isLightShader())return this._getLightShader()}else if(this._tex){if(!e||!e.isTextureShader())return this._getLightShader()}else if(!e)return this._getColorShader();return e},u.default.RendererGL.prototype._getImmediatePointShader=function(){var e=this.userPointShader;return e&&e.isPointShader()?e:this._getPointShader()},u.default.RendererGL.prototype._getRetainedLineShader=u.default.RendererGL.prototype._getImmediateLineShader,u.default.RendererGL.prototype._getLightShader=function(){return this._defaultLightShader||(this._pInst._glAttributes.perPixelLighting?this._defaultLightShader=new u.default.Shader(this,c.phongVert,c.phongFrag):this._defaultLightShader=new u.default.Shader(this,c.lightVert,c.lightTextureFrag)),this._defaultLightShader},u.default.RendererGL.prototype._getImmediateModeShader=function(){return this._defaultImmediateModeShader||(this._defaultImmediateModeShader=new u.default.Shader(this,c.immediateVert,c.vertexColorFrag)),this._defaultImmediateModeShader},u.default.RendererGL.prototype._getNormalShader=function(){return this._defaultNormalShader||(this._defaultNormalShader=new u.default.Shader(this,c.normalVert,c.normalFrag)),this._defaultNormalShader},u.default.RendererGL.prototype._getColorShader=function(){return this._defaultColorShader||(this._defaultColorShader=new u.default.Shader(this,c.normalVert,c.basicFrag)),this._defaultColorShader},u.default.RendererGL.prototype._getPointShader=function(){return this._defaultPointShader||(this._defaultPointShader=new u.default.Shader(this,c.pointVert,c.pointFrag)),this._defaultPointShader},u.default.RendererGL.prototype._getLineShader=function(){return this._defaultLineShader||(this._defaultLineShader=new u.default.Shader(this,c.lineVert,c.lineFrag)),this._defaultLineShader},u.default.RendererGL.prototype._getFontShader=function(){return this._defaultFontShader||(this.GL.getExtension("OES_standard_derivatives"),this._defaultFontShader=new u.default.Shader(this,c.fontVert,c.fontFrag)),this._defaultFontShader},u.default.RendererGL.prototype._getEmptyTexture=function(){if(!this._emptyTexture){var e=new u.default.Image(1,1);e.set(0,0,255),this._emptyTexture=new u.default.Texture(this,e)}return this._emptyTexture},u.default.RendererGL.prototype.getTexture=function(e){var t=this.textures,r=!0,i=!1,n=void 0;try{for(var o,a=t[Symbol.iterator]();!(r=(o=a.next()).done);r=!0){var s=o.value;if(s.src===e)return s}}catch(e){i=!0,n=e}finally{try{r||null==a.return||a.return()}finally{if(i)throw n}}var l=new u.default.Texture(this,e);return t.push(l),l},u.default.RendererGL.prototype._setStrokeUniforms=function(e){e.bindShader(),e.setUniform("uMaterialColor",this.curStrokeColor),e.setUniform("uStrokeWeight",this.curStrokeWeight)},u.default.RendererGL.prototype._setFillUniforms=function(e){e.bindShader(),e.setUniform("uMaterialColor",this.curFillColor),e.setUniform("isTexture",!!this._tex),this._tex&&e.setUniform("uSampler",this._tex),e.setUniform("uTint",this._tint),e.setUniform("uSpecular",this._useSpecularMaterial),e.setUniform("uEmissive",this._useEmissiveMaterial),e.setUniform("uShininess",this._useShininess),e.setUniform("uUseLighting",this._enableLighting);var t=this.pointLightDiffuseColors.length/3;e.setUniform("uPointLightCount",t),e.setUniform("uPointLightLocation",this.pointLightPositions),e.setUniform("uPointLightDiffuseColors",this.pointLightDiffuseColors),e.setUniform("uPointLightSpecularColors",this.pointLightSpecularColors);var r=this.directionalLightDiffuseColors.length/3;e.setUniform("uDirectionalLightCount",r),e.setUniform("uLightingDirection",this.directionalLightDirections),e.setUniform("uDirectionalDiffuseColors",this.directionalLightDiffuseColors),e.setUniform("uDirectionalSpecularColors",this.directionalLightSpecularColors);var i=this.ambientLightColors.length/3;e.setUniform("uAmbientLightCount",i),e.setUniform("uAmbientColor",this.ambientLightColors);var n=this.spotLightDiffuseColors.length/3;e.setUniform("uSpotLightCount",n),e.setUniform("uSpotLightAngle",this.spotLightAngle),e.setUniform("uSpotLightConc",this.spotLightConc),e.setUniform("uSpotLightDiffuseColors",this.spotLightDiffuseColors),e.setUniform("uSpotLightSpecularColors",this.spotLightSpecularColors),e.setUniform("uSpotLightLocation",this.spotLightPositions),e.setUniform("uSpotLightDirection",this.spotLightDirections),e.setUniform("uConstantAttenuation",this.constantAttenuation),e.setUniform("uLinearAttenuation",this.linearAttenuation),e.setUniform("uQuadraticAttenuation",this.quadraticAttenuation),e.bindTextures()},u.default.RendererGL.prototype._setPointUniforms=function(e){e.bindShader(),e.setUniform("uMaterialColor",this.curStrokeColor),e.setUniform("uPointSize",this.pointSize)},u.default.RendererGL.prototype._bindBuffer=function(e,t,r,i,n){if(t=t||this.GL.ARRAY_BUFFER,this.GL.bindBuffer(t,e),void 0!==r){var o=new(i||Float32Array)(r);this.GL.bufferData(t,o,n||this.GL.STATIC_DRAW)}},u.default.RendererGL.prototype._arraysEqual=function(e,t){var r=e.length;if(r!==t.length)return!1;for(var i=0;i>7,127&f,c>>7,127&c);for(var d=0;d>7,127&p,0,0)}}return{cellImageInfo:l,dimOffset:o,dimImageInfo:n}}return(t=this.glyphInfos[e.index]={glyph:e,uGlyphRect:[i.x1,-i.y1,i.x2,-i.y2],strokeImageInfo:U,strokes:d,colInfo:G(m,this.colDimImageInfos,this.colCellImageInfos),rowInfo:G(p,this.rowDimImageInfos,this.rowCellImageInfos)}).uGridOffset=[t.colInfo.dimOffset,t.rowInfo.dimOffset],t}}var z=Math.sqrt(3);j.default.RendererGL.prototype._renderText=function(e,t,r,i,n){if(this._textFont&&"string"!=typeof this._textFont){if(!(n<=i)&&this._doFill){if(!this._isOpenType())return console.log("WEBGL: only Opentype (.otf) and Truetype (.ttf) fonts are supported"),e;e.push();var o=this._doStroke,a=this.drawMode;this._doStroke=!1,this.drawMode=D.TEXTURE;var s=this._textFont.font,l=this._textFont._fontInfo;l=l||(this._textFont._fontInfo=new A(s));var u=this._textFont._handleAlignment(this,t,r,i),h=this._textSize/s.unitsPerEm;this.translate(u.x,u.y,0),this.scale(h,h,1);var c=this.GL,f=!this._defaultFontShader,d=this._getFontShader();d.init(),d.bindShader(),f&&(d.setUniform("uGridImageSize",[64,64]),d.setUniform("uCellsImageSize",[64,64]),d.setUniform("uStrokeImageSize",[64,64]),d.setUniform("uGridSize",[9,9])),this._applyColorBlend(this.curFillColor);var p=this.retainedMode.geometry.glyph;if(!p){var m=this._textGeom=new j.default.Geometry(1,1,function(){for(var e=0;e<=1;e++)for(var t=0;t<=1;t++)this.vertices.push(new j.default.Vector(t,e,0)),this.uvs.push(t,e)});m.computeFaces().computeNormals(),p=this.createBuffers("glyph",m)}var g=!0,v=!1,y=void 0;try{for(var b,_=this.retainedMode.buffers.text[Symbol.iterator]();!(g=(b=_.next()).done);g=!0){b.value._prepareBuffer(p,d)}}catch(e){v=!0,y=e}finally{try{g||null==_.return||_.return()}finally{if(v)throw y}}this._bindBuffer(p.indexBuffer,c.ELEMENT_ARRAY_BUFFER),d.setUniform("uMaterialColor",this.curFillColor);try{var x=0,w=null,S=s.stringToGlyphs(t),M=!0,E=!1,T=void 0;try{for(var C,P=S[Symbol.iterator]();!(M=(C=P.next()).done);M=!0){var L=C.value;w&&(x+=s.getKerningValue(w,L));var k=l.getGlyphInfo(L);if(k.uGlyphRect){var R=k.rowInfo,O=k.colInfo;d.setUniform("uSamplerStrokes",k.strokeImageInfo.imageData),d.setUniform("uSamplerRowStrokes",R.cellImageInfo.imageData),d.setUniform("uSamplerRows",R.dimImageInfo.imageData),d.setUniform("uSamplerColStrokes",O.cellImageInfo.imageData),d.setUniform("uSamplerCols",O.dimImageInfo.imageData),d.setUniform("uGridOffset",k.uGridOffset),d.setUniform("uGlyphRect",k.uGlyphRect),d.setUniform("uGlyphOffset",x),d.bindTextures(),c.drawElements(c.TRIANGLES,6,this.GL.UNSIGNED_SHORT,0)}x+=L.advanceWidth,w=L}}catch(e){E=!0,T=e}finally{try{M||null==P.return||P.return()}finally{if(E)throw T}}}finally{d.unbindShader(),this._doStroke=o,this.drawMode=a,e.pop()}return e}}else console.log("WEBGL: you must load and set a font before drawing text. See `loadFont` and `textFont` for more details.")}},{"../core/constants":42,"../core/main":49,"./p5.RendererGL.Retained":102,"./p5.Shader":104}],107:[function(e,t,r){t.exports={fes:{autoplay:"The media that tried to play (with '{{src}}') wasn't allowed to by this browser, most likely due to the browser's autoplay policy. Check out {{link}} for more information about why.",fileLoadError:{bytes:"It looks like there was a problem loading your file. {{suggestion}}",font:"It looks like there was a problem loading your font. {{suggestion}}",gif:"There was some trouble loading your GIF. Make sure that your GIF is using 87a or 89a encoding.",image:"It looks like there was a problem loading your image. {{suggestion}}",json:"It looks like there was a problem loading your JSON file. {{suggestion}}",large:"If your large file isn't fetched successfully, we recommend splitting the file into smaller segments and fetching those.",strings:"It looks like there was a problem loading your text file. {{suggestion}}",suggestion:"Try checking if the file path ({{filePath}}) is correct, hosting the file online, or running a local server. (More info at {{link}})",table:"It looks like there was a problem loading your table file. {{suggestion}}",xml:"It looks like there was a problem loading your XML file. {{suggestion}}"},misusedTopLevel:"Did you just try to use p5.js's {{symbolName}} {{symbolType}}? If so, you may want to move it into your sketch's setup() function.\n\nFor more details, see: {{link}}",pre:"🌸 p5.js says: {{message}}",welcome:"Welcome! This is your friendly debugger. To turn me off, switch to using p5.min.js."}}},{}],108:[function(e,t,r){t.exports={fes:{autoplay:"Su browser impidío un medio tocar (de '{{src}}'), posiblemente porque las reglas de autoplay. Para aprender más, visite {{link}}.",fileLoadError:{bytes:"",font:"",gif:"",image:"",json:"",large:"",strings:"",suggestion:"",table:"",xml:""},misusedTopLevel:"",pre:"🌸 p5.js dice: {{message}}",welcome:""}}},{}],109:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i=o(e("./en/translation")),n=o(e("./es/translation"));function o(e){return e&&e.__esModule?e:{default:e}}var a={en:{translation:i.default},es:{translation:n.default}};r.default=a},{"./en/translation":107,"./es/translation":108}]},{},[37])(37)}); ================================================ FILE: docs/examples/transcrypt/sketch_009/target/math.js ================================================ // Transcrypt'ed from Python, 2021-11-02 13:06:17 import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, abs, all, any, assert, bool, bytearray, bytes, callable, chr, copy, deepcopy, delattr, dict, dir, divmod, enumerate, filter, float, getattr, hasattr, input, int, isinstance, issubclass, len, list, map, max, min, object, ord, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, round, set, setattr, sorted, str, sum, tuple, zip} from './org.transcrypt.__runtime__.js'; var __name__ = 'math'; export var pi = Math.PI; export var e = Math.E; export var exp = Math.exp; export var expm1 = function (x) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'x': var x = __allkwargs0__ [__attrib0__]; break; } } } } else { } return Math.exp (x) - 1; }; export var log = function (x, base) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'x': var x = __allkwargs0__ [__attrib0__]; break; case 'base': var base = __allkwargs0__ [__attrib0__]; break; } } } } else { } return (base === undefined ? Math.log (x) : Math.log (x) / Math.log (base)); }; export var log1p = function (x) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'x': var x = __allkwargs0__ [__attrib0__]; break; } } } } else { } return Math.log (x + 1); }; export var log2 = function (x) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'x': var x = __allkwargs0__ [__attrib0__]; break; } } } } else { } return Math.log (x) / Math.LN2; }; export var log10 = function (x) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'x': var x = __allkwargs0__ [__attrib0__]; break; } } } } else { } return Math.log (x) / Math.LN10; }; export var pow = Math.pow; export var sqrt = Math.sqrt; export var sin = Math.sin; export var cos = Math.cos; export var tan = Math.tan; export var asin = Math.asin; export var acos = Math.acos; export var atan = Math.atan; export var atan2 = Math.atan2; export var hypot = Math.hypot; export var degrees = function (x) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'x': var x = __allkwargs0__ [__attrib0__]; break; } } } } else { } return (x * 180) / Math.PI; }; export var radians = function (x) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'x': var x = __allkwargs0__ [__attrib0__]; break; } } } } else { } return (x * Math.PI) / 180; }; export var sinh = Math.sinh; export var cosh = Math.cosh; export var tanh = Math.tanh; export var asinh = Math.asinh; export var acosh = Math.acosh; export var atanh = Math.atanh; export var floor = Math.floor; export var ceil = Math.ceil; export var trunc = Math.trunc; export var isnan = isNaN; export var inf = Infinity; export var nan = NaN; export var modf = function (n) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'n': var n = __allkwargs0__ [__attrib0__]; break; } } } } else { } var sign = (n >= 0 ? 1 : -(1)); var __left0__ = divmod (abs (n), 1); var f = __left0__ [0]; var mod = __left0__ [1]; return tuple ([mod * sign, f * sign]); }; //# sourceMappingURL=math.map ================================================ FILE: docs/examples/transcrypt/sketch_009/target/math.py ================================================ pi = Math.PI e = Math.E exp = Math.exp def expm1 (x): # IE workaround return Math.exp (x) - 1 def log (x, base): return Math.log (x) if base is js_undefined else Math.log (x) / Math.log (base) def log1p (x): # IE workaround return Math.log (x + 1) def log2 (x): # IE workaround return Math.log (x) / Math.LN2 def log10 (x): # IE workaround return Math.log (x) / Math.LN10 pow = Math.pow sqrt = Math.sqrt sin = Math.sin cos = Math.cos tan = Math.tan asin = Math.asin acos = Math.acos atan = Math.atan atan2 = Math.atan2 hypot = Math.hypot def degrees (x): return x * 180 / Math.PI def radians (x): return x * Math.PI / 180 sinh = Math.sinh cosh = Math.cosh tanh = Math.tanh asinh = Math.asinh acosh = Math.acosh atanh = Math.atanh floor = Math.floor ceil = Math.ceil trunc = Math.trunc isnan = js_isNaN inf = js_Infinity nan = js_NaN def modf(n): sign = 1 if n >= 0 else -1 f, mod = divmod (abs(n), 1) return mod * sign, f * sign ================================================ FILE: docs/examples/transcrypt/sketch_009/target/org.transcrypt.__runtime__.js ================================================ // Transcrypt'ed from Python, 2021-11-02 13:06:17 var __name__ = 'org.transcrypt.__runtime__'; export var __envir__ = {}; __envir__.interpreter_name = 'python'; __envir__.transpiler_name = 'transcrypt'; __envir__.executor_name = __envir__.transpiler_name; __envir__.transpiler_version = '3.9.0'; export function __nest__ (headObject, tailNames, value) { var current = headObject; if (tailNames != '') { var tailChain = tailNames.split ('.'); var firstNewIndex = tailChain.length; for (var index = 0; index < tailChain.length; index++) { if (!current.hasOwnProperty (tailChain [index])) { firstNewIndex = index; break; } current = current [tailChain [index]]; } for (var index = firstNewIndex; index < tailChain.length; index++) { current [tailChain [index]] = {}; current = current [tailChain [index]]; } } for (let attrib of Object.getOwnPropertyNames (value)) { Object.defineProperty (current, attrib, { get () {return value [attrib];}, enumerable: true, configurable: true }); } }; export function __init__ (module) { if (!module.__inited__) { module.__all__.__init__ (module.__all__); module.__inited__ = true; } return module.__all__; }; export function __get__ (aThis, func, quotedFuncName) { if (aThis) { if (aThis.hasOwnProperty ('__class__') || typeof aThis == 'string' || aThis instanceof String) { if (quotedFuncName) { Object.defineProperty (aThis, quotedFuncName, { value: function () { var args = [] .slice.apply (arguments); return func.apply (null, [aThis] .concat (args)); }, writable: true, enumerable: true, configurable: true }); } return function () { var args = [] .slice.apply (arguments); return func.apply (null, [aThis.__proxy__ ? aThis.__proxy__ : aThis] .concat (args)); }; } else { return func; } } else { return func; } }; export function __getcm__ (aThis, func, quotedFuncName) { if (aThis.hasOwnProperty ('__class__')) { return function () { var args = [] .slice.apply (arguments); return func.apply (null, [aThis.__class__] .concat (args)); }; } else { return function () { var args = [] .slice.apply (arguments); return func.apply (null, [aThis] .concat (args)); }; } }; export function __getsm__ (aThis, func, quotedFuncName) { return func; }; export var py_metatype = { __name__: 'type', __bases__: [], __new__: function (meta, name, bases, attribs) { var cls = function () { var args = [] .slice.apply (arguments); return cls.__new__ (args); }; for (var index = bases.length - 1; index >= 0; index--) { var base = bases [index]; for (var attrib in base) { var descrip = Object.getOwnPropertyDescriptor (base, attrib); if (descrip == null) { continue; } Object.defineProperty (cls, attrib, descrip); } for (let symbol of Object.getOwnPropertySymbols (base)) { let descrip = Object.getOwnPropertyDescriptor (base, symbol); Object.defineProperty (cls, symbol, descrip); } } cls.__metaclass__ = meta; cls.__name__ = name.startsWith ('py_') ? name.slice (3) : name; cls.__bases__ = bases; for (var attrib in attribs) { var descrip = Object.getOwnPropertyDescriptor (attribs, attrib); Object.defineProperty (cls, attrib, descrip); } for (let symbol of Object.getOwnPropertySymbols (attribs)) { let descrip = Object.getOwnPropertyDescriptor (attribs, symbol); Object.defineProperty (cls, symbol, descrip); } return cls; } }; py_metatype.__metaclass__ = py_metatype; export var object = { __init__: function (self) {}, __metaclass__: py_metatype, __name__: 'object', __bases__: [], __new__: function (args) { var instance = Object.create (this, {__class__: {value: this, enumerable: true}}); if ('__getattr__' in this || '__setattr__' in this) { instance.__proxy__ = new Proxy (instance, { get: function (target, name) { let result = target [name]; if (result == undefined) { return target.__getattr__ (name); } else { return result; } }, set: function (target, name, value) { try { target.__setattr__ (name, value); } catch (exception) { target [name] = value; } return true; } }) instance = instance.__proxy__ } this.__init__.apply (null, [instance] .concat (args)); return instance; } }; export function __class__ (name, bases, attribs, meta) { if (meta === undefined) { meta = bases [0] .__metaclass__; } return meta.__new__ (meta, name, bases, attribs); }; export function __pragma__ () {}; export function __call__ (/* , , * */) { var args = [] .slice.apply (arguments); if (typeof args [0] == 'object' && '__call__' in args [0]) { return args [0] .__call__ .apply (args [1], args.slice (2)); } else { return args [0] .apply (args [1], args.slice (2)); } }; __envir__.executor_name = __envir__.transpiler_name; var __main__ = {__file__: ''}; var __except__ = null; export function __kwargtrans__ (anObject) { anObject.__kwargtrans__ = null; anObject.constructor = Object; return anObject; } export function __super__ (aClass, methodName) { for (let base of aClass.__bases__) { if (methodName in base) { return base [methodName]; } } throw new Exception ('Superclass method not found'); } export function property (getter, setter) { if (!setter) { setter = function () {}; } return {get: function () {return getter (this)}, set: function (value) {setter (this, value)}, enumerable: true}; } export function __setproperty__ (anObject, name, descriptor) { if (!anObject.hasOwnProperty (name)) { Object.defineProperty (anObject, name, descriptor); } } export function assert (condition, message) { if (!condition) { throw AssertionError (message, new Error ()); } } export function __mergekwargtrans__ (object0, object1) { var result = {}; for (var attrib in object0) { result [attrib] = object0 [attrib]; } for (var attrib in object1) { result [attrib] = object1 [attrib]; } return result; }; export function __mergefields__ (targetClass, sourceClass) { let fieldNames = ['__reprfields__', '__comparefields__', '__initfields__'] if (sourceClass [fieldNames [0]]) { if (targetClass [fieldNames [0]]) { for (let fieldName of fieldNames) { targetClass [fieldName] = new Set ([...targetClass [fieldName], ...sourceClass [fieldName]]); } } else { for (let fieldName of fieldNames) { targetClass [fieldName] = new Set (sourceClass [fieldName]); } } } } export function __withblock__ (manager, statements) { if (hasattr (manager, '__enter__')) { try { manager.__enter__ (); statements (); manager.__exit__ (); } catch (exception) { if (! (manager.__exit__ (exception.name, exception, exception.stack))) { throw exception; } } } else { statements (); manager.close (); } }; export function dir (obj) { var aList = []; for (var aKey in obj) { aList.push (aKey.startsWith ('py_') ? aKey.slice (3) : aKey); } aList.sort (); return aList; }; export function setattr (obj, name, value) { obj [name] = value; }; export function getattr (obj, name) { return name in obj ? obj [name] : obj ['py_' + name]; }; export function hasattr (obj, name) { try { return name in obj || 'py_' + name in obj; } catch (exception) { return false; } }; export function delattr (obj, name) { if (name in obj) { delete obj [name]; } else { delete obj ['py_' + name]; } }; export function __in__ (element, container) { if (container === undefined || container === null) { return false; } if (container.__contains__ instanceof Function) { return container.__contains__ (element); } else { return ( container.indexOf ? container.indexOf (element) > -1 : container.hasOwnProperty (element) ); } }; export function __specialattrib__ (attrib) { return (attrib.startswith ('__') && attrib.endswith ('__')) || attrib == 'constructor' || attrib.startswith ('py_'); }; export function len (anObject) { if (anObject === undefined || anObject === null) { return 0; } if (anObject.__len__ instanceof Function) { return anObject.__len__ (); } if (anObject.length !== undefined) { return anObject.length; } var length = 0; for (var attr in anObject) { if (!__specialattrib__ (attr)) { length++; } } return length; }; export function __i__ (any) { return py_typeof (any) == dict ? any.py_keys () : any; } export function __k__ (keyed, key) { var result = keyed [key]; if (typeof result == 'undefined') { if (keyed instanceof Array) if (key == +key && key >= 0 && keyed.length > key) return result; else throw IndexError (key, new Error()); else throw KeyError (key, new Error()); } return result; } export function __t__ (target) { return ( target === undefined || target === null ? false : ['boolean', 'number'] .indexOf (typeof target) >= 0 ? target : target.__bool__ instanceof Function ? (target.__bool__ () ? target : false) : target.__len__ instanceof Function ? (target.__len__ () !== 0 ? target : false) : target instanceof Function ? target : len (target) !== 0 ? target : false ); } export function float (any) { if (any == 'inf') { return Infinity; } else if (any == '-inf') { return -Infinity; } else if (any == 'nan') { return NaN; } else if (isNaN (parseFloat (any))) { if (any === false) { return 0; } else if (any === true) { return 1; } else { throw ValueError ("could not convert string to float: '" + str(any) + "'", new Error ()); } } else { return +any; } }; float.__name__ = 'float'; float.__bases__ = [object]; export function int (any) { return float (any) | 0 }; int.__name__ = 'int'; int.__bases__ = [object]; export function bool (any) { return !!__t__ (any); }; bool.__name__ = 'bool'; bool.__bases__ = [int]; export function py_typeof (anObject) { var aType = typeof anObject; if (aType == 'object') { try { return '__class__' in anObject ? anObject.__class__ : object; } catch (exception) { return aType; } } else { return ( aType == 'boolean' ? bool : aType == 'string' ? str : aType == 'number' ? (anObject % 1 == 0 ? int : float) : null ); } }; export function issubclass (aClass, classinfo) { if (classinfo instanceof Array) { for (let aClass2 of classinfo) { if (issubclass (aClass, aClass2)) { return true; } } return false; } try { var aClass2 = aClass; if (aClass2 == classinfo) { return true; } else { var bases = [].slice.call (aClass2.__bases__); while (bases.length) { aClass2 = bases.shift (); if (aClass2 == classinfo) { return true; } if (aClass2.__bases__.length) { bases = [].slice.call (aClass2.__bases__).concat (bases); } } return false; } } catch (exception) { return aClass == classinfo || classinfo == object; } }; export function isinstance (anObject, classinfo) { try { return '__class__' in anObject ? issubclass (anObject.__class__, classinfo) : issubclass (py_typeof (anObject), classinfo); } catch (exception) { return issubclass (py_typeof (anObject), classinfo); } }; export function callable (anObject) { return anObject && typeof anObject == 'object' && '__call__' in anObject ? true : typeof anObject === 'function'; }; export function repr (anObject) { try { return anObject.__repr__ (); } catch (exception) { try { return anObject.__str__ (); } catch (exception) { try { if (anObject == null) { return 'None'; } else if (anObject.constructor == Object) { var result = '{'; var comma = false; for (var attrib in anObject) { if (!__specialattrib__ (attrib)) { if (attrib.isnumeric ()) { var attribRepr = attrib; } else { var attribRepr = '\'' + attrib + '\''; } if (comma) { result += ', '; } else { comma = true; } result += attribRepr + ': ' + repr (anObject [attrib]); } } result += '}'; return result; } else { return typeof anObject == 'boolean' ? anObject.toString () .capitalize () : anObject.toString (); } } catch (exception) { return ''; } } } }; export function chr (charCode) { return String.fromCharCode (charCode); }; export function ord (aChar) { return aChar.charCodeAt (0); }; export function max (nrOrSeq) { return arguments.length == 1 ? Math.max (...nrOrSeq) : Math.max (...arguments); }; export function min (nrOrSeq) { return arguments.length == 1 ? Math.min (...nrOrSeq) : Math.min (...arguments); }; export var abs = Math.abs; export function round (number, ndigits) { if (ndigits) { var scale = Math.pow (10, ndigits); number *= scale; } var rounded = Math.round (number); if (rounded - number == 0.5 && rounded % 2) { rounded -= 1; } if (ndigits) { rounded /= scale; } return rounded; }; export function __jsUsePyNext__ () { try { var result = this.__next__ (); return {value: result, done: false}; } catch (exception) { return {value: undefined, done: true}; } } export function __pyUseJsNext__ () { var result = this.next (); if (result.done) { throw StopIteration (new Error ()); } else { return result.value; } } export function py_iter (iterable) { if (typeof iterable == 'string' || '__iter__' in iterable) { var result = iterable.__iter__ (); result.next = __jsUsePyNext__; } else if ('selector' in iterable) { var result = list (iterable) .__iter__ (); result.next = __jsUsePyNext__; } else if ('next' in iterable) { var result = iterable if (! ('__next__' in result)) { result.__next__ = __pyUseJsNext__; } } else if (Symbol.iterator in iterable) { var result = iterable [Symbol.iterator] (); result.__next__ = __pyUseJsNext__; } else { throw IterableError (new Error ()); } result [Symbol.iterator] = function () {return result;}; return result; } export function py_next (iterator) { try { var result = iterator.__next__ (); } catch (exception) { var result = iterator.next (); if (result.done) { throw StopIteration (new Error ()); } else { return result.value; } } if (result == undefined) { throw StopIteration (new Error ()); } else { return result; } } export function __PyIterator__ (iterable) { this.iterable = iterable; this.index = 0; } __PyIterator__.prototype.__next__ = function() { if (this.index < this.iterable.length) { return this.iterable [this.index++]; } else { throw StopIteration (new Error ()); } }; export function __JsIterator__ (iterable) { this.iterable = iterable; this.index = 0; } __JsIterator__.prototype.next = function () { if (this.index < this.iterable.py_keys.length) { return {value: this.index++, done: false}; } else { return {value: undefined, done: true}; } }; export function py_reversed (iterable) { iterable = iterable.slice (); iterable.reverse (); return iterable; }; export function zip () { var args = [] .slice.call (arguments); for (var i = 0; i < args.length; i++) { if (typeof args [i] == 'string') { args [i] = args [i] .split (''); } else if (!Array.isArray (args [i])) { args [i] = Array.from (args [i]); } } var shortest = args.length == 0 ? [] : args.reduce ( function (array0, array1) { return array0.length < array1.length ? array0 : array1; } ); return shortest.map ( function (current, index) { return args.map ( function (current) { return current [index]; } ); } ); }; export function range (start, stop, step) { if (stop == undefined) { stop = start; start = 0; } if (step == undefined) { step = 1; } if ((step > 0 && start >= stop) || (step < 0 && start <= stop)) { return []; } var result = []; for (var i = start; step > 0 ? i < stop : i > stop; i += step) { result.push(i); } return result; }; export function any (iterable) { for (let item of iterable) { if (bool (item)) { return true; } } return false; } export function all (iterable) { for (let item of iterable) { if (! bool (item)) { return false; } } return true; } export function sum (iterable) { let result = 0; for (let item of iterable) { result += item; } return result; } export function enumerate (iterable) { return zip (range (len (iterable)), iterable); } export function copy (anObject) { if (anObject == null || typeof anObject == "object") { return anObject; } else { var result = {}; for (var attrib in obj) { if (anObject.hasOwnProperty (attrib)) { result [attrib] = anObject [attrib]; } } return result; } } export function deepcopy (anObject) { if (anObject == null || typeof anObject == "object") { return anObject; } else { var result = {}; for (var attrib in obj) { if (anObject.hasOwnProperty (attrib)) { result [attrib] = deepcopy (anObject [attrib]); } } return result; } } export function list (iterable) { let instance = iterable ? Array.from (iterable) : []; return instance; } Array.prototype.__class__ = list; list.__name__ = 'list'; list.__bases__ = [object]; Array.prototype.__iter__ = function () {return new __PyIterator__ (this);}; Array.prototype.__getslice__ = function (start, stop, step) { if (start < 0) { start = this.length + start; } if (stop == null) { stop = this.length; } else if (stop < 0) { stop = this.length + stop; } else if (stop > this.length) { stop = this.length; } if (step == 1) { return Array.prototype.slice.call(this, start, stop); } let result = list ([]); for (let index = start; index < stop; index += step) { result.push (this [index]); } return result; }; Array.prototype.__setslice__ = function (start, stop, step, source) { if (start < 0) { start = this.length + start; } if (stop == null) { stop = this.length; } else if (stop < 0) { stop = this.length + stop; } if (step == null) { Array.prototype.splice.apply (this, [start, stop - start] .concat (source)); } else { let sourceIndex = 0; for (let targetIndex = start; targetIndex < stop; targetIndex += step) { this [targetIndex] = source [sourceIndex++]; } } }; Array.prototype.__repr__ = function () { if (this.__class__ == set && !this.length) { return 'set()'; } let result = !this.__class__ || this.__class__ == list ? '[' : this.__class__ == tuple ? '(' : '{'; for (let index = 0; index < this.length; index++) { if (index) { result += ', '; } result += repr (this [index]); } if (this.__class__ == tuple && this.length == 1) { result += ','; } result += !this.__class__ || this.__class__ == list ? ']' : this.__class__ == tuple ? ')' : '}';; return result; }; Array.prototype.__str__ = Array.prototype.__repr__; Array.prototype.append = function (element) { this.push (element); }; Array.prototype.py_clear = function () { this.length = 0; }; Array.prototype.extend = function (aList) { this.push.apply (this, aList); }; Array.prototype.insert = function (index, element) { this.splice (index, 0, element); }; Array.prototype.remove = function (element) { let index = this.indexOf (element); if (index == -1) { throw ValueError ("list.remove(x): x not in list", new Error ()); } this.splice (index, 1); }; Array.prototype.index = function (element) { return this.indexOf (element); }; Array.prototype.py_pop = function (index) { if (index == undefined) { return this.pop (); } else { return this.splice (index, 1) [0]; } }; Array.prototype.py_sort = function () { __sort__.apply (null, [this].concat ([] .slice.apply (arguments))); }; Array.prototype.__add__ = function (aList) { return list (this.concat (aList)); }; Array.prototype.__mul__ = function (scalar) { let result = this; for (let i = 1; i < scalar; i++) { result = result.concat (this); } return result; }; Array.prototype.__rmul__ = Array.prototype.__mul__; export function tuple (iterable) { let instance = iterable ? [] .slice.apply (iterable) : []; instance.__class__ = tuple; return instance; } tuple.__name__ = 'tuple'; tuple.__bases__ = [object]; export function set (iterable) { let instance = []; if (iterable) { for (let index = 0; index < iterable.length; index++) { instance.add (iterable [index]); } } instance.__class__ = set; return instance; } set.__name__ = 'set'; set.__bases__ = [object]; Array.prototype.__bindexOf__ = function (element) { element += ''; let mindex = 0; let maxdex = this.length - 1; while (mindex <= maxdex) { let index = (mindex + maxdex) / 2 | 0; let middle = this [index] + ''; if (middle < element) { mindex = index + 1; } else if (middle > element) { maxdex = index - 1; } else { return index; } } return -1; }; Array.prototype.add = function (element) { if (this.indexOf (element) == -1) { this.push (element); } }; Array.prototype.discard = function (element) { var index = this.indexOf (element); if (index != -1) { this.splice (index, 1); } }; Array.prototype.isdisjoint = function (other) { this.sort (); for (let i = 0; i < other.length; i++) { if (this.__bindexOf__ (other [i]) != -1) { return false; } } return true; }; Array.prototype.issuperset = function (other) { this.sort (); for (let i = 0; i < other.length; i++) { if (this.__bindexOf__ (other [i]) == -1) { return false; } } return true; }; Array.prototype.issubset = function (other) { return set (other.slice ()) .issuperset (this); }; Array.prototype.union = function (other) { let result = set (this.slice () .sort ()); for (let i = 0; i < other.length; i++) { if (result.__bindexOf__ (other [i]) == -1) { result.push (other [i]); } } return result; }; Array.prototype.intersection = function (other) { this.sort (); let result = set (); for (let i = 0; i < other.length; i++) { if (this.__bindexOf__ (other [i]) != -1) { result.push (other [i]); } } return result; }; Array.prototype.difference = function (other) { let sother = set (other.slice () .sort ()); let result = set (); for (let i = 0; i < this.length; i++) { if (sother.__bindexOf__ (this [i]) == -1) { result.push (this [i]); } } return result; }; Array.prototype.symmetric_difference = function (other) { return this.union (other) .difference (this.intersection (other)); }; Array.prototype.py_update = function () { let updated = [] .concat.apply (this.slice (), arguments) .sort (); this.py_clear (); for (let i = 0; i < updated.length; i++) { if (updated [i] != updated [i - 1]) { this.push (updated [i]); } } }; Array.prototype.__eq__ = function (other) { if (this.length != other.length) { return false; } if (this.__class__ == set) { this.sort (); other.sort (); } for (let i = 0; i < this.length; i++) { if (this [i] != other [i]) { return false; } } return true; }; Array.prototype.__ne__ = function (other) { return !this.__eq__ (other); }; Array.prototype.__le__ = function (other) { if (this.__class__ == set) { return this.issubset (other); } else { for (let i = 0; i < this.length; i++) { if (this [i] > other [i]) { return false; } else if (this [i] < other [i]) { return true; } } return true; } }; Array.prototype.__ge__ = function (other) { if (this.__class__ == set) { return this.issuperset (other); } else { for (let i = 0; i < this.length; i++) { if (this [i] < other [i]) { return false; } else if (this [i] > other [i]) { return true; } } return true; } }; Array.prototype.__lt__ = function (other) { return ( this.__class__ == set ? this.issubset (other) && !this.issuperset (other) : !this.__ge__ (other) ); }; Array.prototype.__gt__ = function (other) { return ( this.__class__ == set ? this.issuperset (other) && !this.issubset (other) : !this.__le__ (other) ); }; export function bytearray (bytable, encoding) { if (bytable == undefined) { return new Uint8Array (0); } else { let aType = py_typeof (bytable); if (aType == int) { return new Uint8Array (bytable); } else if (aType == str) { let aBytes = new Uint8Array (len (bytable)); for (let i = 0; i < len (bytable); i++) { aBytes [i] = bytable.charCodeAt (i); } return aBytes; } else if (aType == list || aType == tuple) { return new Uint8Array (bytable); } else { throw py_TypeError; } } } export var bytes = bytearray; Uint8Array.prototype.__add__ = function (aBytes) { let result = new Uint8Array (this.length + aBytes.length); result.set (this); result.set (aBytes, this.length); return result; }; Uint8Array.prototype.__mul__ = function (scalar) { let result = new Uint8Array (scalar * this.length); for (let i = 0; i < scalar; i++) { result.set (this, i * this.length); } return result; }; Uint8Array.prototype.__rmul__ = Uint8Array.prototype.__mul__; export function str (stringable) { if (typeof stringable === 'number') return stringable.toString(); else { try { return stringable.__str__ (); } catch (exception) { try { return repr (stringable); } catch (exception) { return String (stringable); } } } }; String.prototype.__class__ = str; str.__name__ = 'str'; str.__bases__ = [object]; String.prototype.__iter__ = function () {new __PyIterator__ (this);}; String.prototype.__repr__ = function () { return (this.indexOf ('\'') == -1 ? '\'' + this + '\'' : '"' + this + '"') .py_replace ('\t', '\\t') .py_replace ('\n', '\\n'); }; String.prototype.__str__ = function () { return this; }; String.prototype.capitalize = function () { return this.charAt (0).toUpperCase () + this.slice (1); }; String.prototype.endswith = function (suffix) { if (suffix instanceof Array) { for (var i=0;i> b; } }; export function __or__ (a, b) { if (typeof a == 'object' && '__or__' in a) { return a.__or__ (b); } else if (typeof b == 'object' && '__ror__' in b) { return b.__ror__ (a); } else { return a | b; } }; export function __xor__ (a, b) { if (typeof a == 'object' && '__xor__' in a) { return a.__xor__ (b); } else if (typeof b == 'object' && '__rxor__' in b) { return b.__rxor__ (a); } else { return a ^ b; } }; export function __and__ (a, b) { if (typeof a == 'object' && '__and__' in a) { return a.__and__ (b); } else if (typeof b == 'object' && '__rand__' in b) { return b.__rand__ (a); } else { return a & b; } }; export function __eq__ (a, b) { if (typeof a == 'object' && '__eq__' in a) { return a.__eq__ (b); } else { return a == b; } }; export function __ne__ (a, b) { if (typeof a == 'object' && '__ne__' in a) { return a.__ne__ (b); } else { return a != b } }; export function __lt__ (a, b) { if (typeof a == 'object' && '__lt__' in a) { return a.__lt__ (b); } else { return a < b; } }; export function __le__ (a, b) { if (typeof a == 'object' && '__le__' in a) { return a.__le__ (b); } else { return a <= b; } }; export function __gt__ (a, b) { if (typeof a == 'object' && '__gt__' in a) { return a.__gt__ (b); } else { return a > b; } }; export function __ge__ (a, b) { if (typeof a == 'object' && '__ge__' in a) { return a.__ge__ (b); } else { return a >= b; } }; export function __imatmul__ (a, b) { if ('__imatmul__' in a) { return a.__imatmul__ (b); } else { return a.__matmul__ (b); } }; export function __ipow__ (a, b) { if (typeof a == 'object' && '__pow__' in a) { return a.__ipow__ (b); } else if (typeof a == 'object' && '__ipow__' in a) { return a.__pow__ (b); } else if (typeof b == 'object' && '__rpow__' in b) { return b.__rpow__ (a); } else { return Math.pow (a, b); } }; export function __ijsmod__ (a, b) { if (typeof a == 'object' && '__imod__' in a) { return a.__ismod__ (b); } else if (typeof a == 'object' && '__mod__' in a) { return a.__mod__ (b); } else if (typeof b == 'object' && '__rpow__' in b) { return b.__rmod__ (a); } else { return a % b; } }; export function __imod__ (a, b) { if (typeof a == 'object' && '__imod__' in a) { return a.__imod__ (b); } else if (typeof a == 'object' && '__mod__' in a) { return a.__mod__ (b); } else if (typeof b == 'object' && '__rmod__' in b) { return b.__rmod__ (a); } else { return ((a % b) + b) % b; } }; export function __imul__ (a, b) { if (typeof a == 'object' && '__imul__' in a) { return a.__imul__ (b); } else if (typeof a == 'object' && '__mul__' in a) { return a = a.__mul__ (b); } else if (typeof b == 'object' && '__rmul__' in b) { return a = b.__rmul__ (a); } else if (typeof a == 'string') { return a = a.__mul__ (b); } else if (typeof b == 'string') { return a = b.__rmul__ (a); } else { return a *= b; } }; export function __idiv__ (a, b) { if (typeof a == 'object' && '__idiv__' in a) { return a.__idiv__ (b); } else if (typeof a == 'object' && '__div__' in a) { return a = a.__div__ (b); } else if (typeof b == 'object' && '__rdiv__' in b) { return a = b.__rdiv__ (a); } else { return a /= b; } }; export function __iadd__ (a, b) { if (typeof a == 'object' && '__iadd__' in a) { return a.__iadd__ (b); } else if (typeof a == 'object' && '__add__' in a) { return a = a.__add__ (b); } else if (typeof b == 'object' && '__radd__' in b) { return a = b.__radd__ (a); } else { return a += b; } }; export function __isub__ (a, b) { if (typeof a == 'object' && '__isub__' in a) { return a.__isub__ (b); } else if (typeof a == 'object' && '__sub__' in a) { return a = a.__sub__ (b); } else if (typeof b == 'object' && '__rsub__' in b) { return a = b.__rsub__ (a); } else { return a -= b; } }; export function __ilshift__ (a, b) { if (typeof a == 'object' && '__ilshift__' in a) { return a.__ilshift__ (b); } else if (typeof a == 'object' && '__lshift__' in a) { return a = a.__lshift__ (b); } else if (typeof b == 'object' && '__rlshift__' in b) { return a = b.__rlshift__ (a); } else { return a <<= b; } }; export function __irshift__ (a, b) { if (typeof a == 'object' && '__irshift__' in a) { return a.__irshift__ (b); } else if (typeof a == 'object' && '__rshift__' in a) { return a = a.__rshift__ (b); } else if (typeof b == 'object' && '__rrshift__' in b) { return a = b.__rrshift__ (a); } else { return a >>= b; } }; export function __ior__ (a, b) { if (typeof a == 'object' && '__ior__' in a) { return a.__ior__ (b); } else if (typeof a == 'object' && '__or__' in a) { return a = a.__or__ (b); } else if (typeof b == 'object' && '__ror__' in b) { return a = b.__ror__ (a); } else { return a |= b; } }; export function __ixor__ (a, b) { if (typeof a == 'object' && '__ixor__' in a) { return a.__ixor__ (b); } else if (typeof a == 'object' && '__xor__' in a) { return a = a.__xor__ (b); } else if (typeof b == 'object' && '__rxor__' in b) { return a = b.__rxor__ (a); } else { return a ^= b; } }; export function __iand__ (a, b) { if (typeof a == 'object' && '__iand__' in a) { return a.__iand__ (b); } else if (typeof a == 'object' && '__and__' in a) { return a = a.__and__ (b); } else if (typeof b == 'object' && '__rand__' in b) { return a = b.__rand__ (a); } else { return a &= b; } }; export function __getitem__ (container, key) { if (typeof container == 'object' && '__getitem__' in container) { return container.__getitem__ (key); } else if ((typeof container == 'string' || container instanceof Array) && key < 0) { return container [container.length + key]; } else { return container [key]; } }; export function __setitem__ (container, key, value) { if (typeof container == 'object' && '__setitem__' in container) { container.__setitem__ (key, value); } else if ((typeof container == 'string' || container instanceof Array) && key < 0) { container [container.length + key] = value; } else { container [key] = value; } }; export function __getslice__ (container, lower, upper, step) { if (typeof container == 'object' && '__getitem__' in container) { return container.__getitem__ ([lower, upper, step]); } else { return container.__getslice__ (lower, upper, step); } }; export function __setslice__ (container, lower, upper, step, value) { if (typeof container == 'object' && '__setitem__' in container) { container.__setitem__ ([lower, upper, step], value); } else { container.__setslice__ (lower, upper, step, value); } }; export var BaseException = __class__ ('BaseException', [object], { __module__: __name__, }); export var Exception = __class__ ('Exception', [BaseException], { __module__: __name__, get __init__ () {return __get__ (this, function (self) { var kwargs = dict (); if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'self': var self = __allkwargs0__ [__attrib0__]; break; default: kwargs [__attrib0__] = __allkwargs0__ [__attrib0__]; } } delete kwargs.__kwargtrans__; } var args = tuple ([].slice.apply (arguments).slice (1, __ilastarg0__ + 1)); } else { var args = tuple (); } self.__args__ = args; if (kwargs.error != null) { self.stack = kwargs.error.stack; } else if (Error) { self.stack = new Error ().stack; } else { self.stack = 'No stack trace available'; } });}, get __repr__ () {return __get__ (this, function (self) { if (len (self.__args__) > 1) { return '{}{}'.format (self.__class__.__name__, repr (tuple (self.__args__))); } else if (len (self.__args__)) { return '{}({})'.format (self.__class__.__name__, repr (self.__args__ [0])); } else { return '{}()'.format (self.__class__.__name__); } });}, get __str__ () {return __get__ (this, function (self) { if (len (self.__args__) > 1) { return str (tuple (self.__args__)); } else if (len (self.__args__)) { return str (self.__args__ [0]); } else { return ''; } });} }); export var IterableError = __class__ ('IterableError', [Exception], { __module__: __name__, get __init__ () {return __get__ (this, function (self, error) { Exception.__init__ (self, "Can't iterate over non-iterable", __kwargtrans__ ({error: error})); });} }); export var StopIteration = __class__ ('StopIteration', [Exception], { __module__: __name__, get __init__ () {return __get__ (this, function (self, error) { Exception.__init__ (self, 'Iterator exhausted', __kwargtrans__ ({error: error})); });} }); export var ValueError = __class__ ('ValueError', [Exception], { __module__: __name__, get __init__ () {return __get__ (this, function (self, message, error) { Exception.__init__ (self, message, __kwargtrans__ ({error: error})); });} }); export var KeyError = __class__ ('KeyError', [Exception], { __module__: __name__, get __init__ () {return __get__ (this, function (self, message, error) { Exception.__init__ (self, message, __kwargtrans__ ({error: error})); });} }); export var AssertionError = __class__ ('AssertionError', [Exception], { __module__: __name__, get __init__ () {return __get__ (this, function (self, message, error) { if (message) { Exception.__init__ (self, message, __kwargtrans__ ({error: error})); } else { Exception.__init__ (self, __kwargtrans__ ({error: error})); } });} }); export var NotImplementedError = __class__ ('NotImplementedError', [Exception], { __module__: __name__, get __init__ () {return __get__ (this, function (self, message, error) { Exception.__init__ (self, message, __kwargtrans__ ({error: error})); });} }); export var IndexError = __class__ ('IndexError', [Exception], { __module__: __name__, get __init__ () {return __get__ (this, function (self, message, error) { Exception.__init__ (self, message, __kwargtrans__ ({error: error})); });} }); export var AttributeError = __class__ ('AttributeError', [Exception], { __module__: __name__, get __init__ () {return __get__ (this, function (self, message, error) { Exception.__init__ (self, message, __kwargtrans__ ({error: error})); });} }); export var py_TypeError = __class__ ('py_TypeError', [Exception], { __module__: __name__, get __init__ () {return __get__ (this, function (self, message, error) { Exception.__init__ (self, message, __kwargtrans__ ({error: error})); });} }); export var Warning = __class__ ('Warning', [Exception], { __module__: __name__, }); export var UserWarning = __class__ ('UserWarning', [Warning], { __module__: __name__, }); export var DeprecationWarning = __class__ ('DeprecationWarning', [Warning], { __module__: __name__, }); export var RuntimeWarning = __class__ ('RuntimeWarning', [Warning], { __module__: __name__, }); export var __sort__ = function (iterable, key, reverse) { if (typeof key == 'undefined' || (key != null && key.hasOwnProperty ("__kwargtrans__"))) {; var key = null; }; if (typeof reverse == 'undefined' || (reverse != null && reverse.hasOwnProperty ("__kwargtrans__"))) {; var reverse = false; }; if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'iterable': var iterable = __allkwargs0__ [__attrib0__]; break; case 'key': var key = __allkwargs0__ [__attrib0__]; break; case 'reverse': var reverse = __allkwargs0__ [__attrib0__]; break; } } } } else { } if (key) { iterable.sort ((function __lambda__ (a, b) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'a': var a = __allkwargs0__ [__attrib0__]; break; case 'b': var b = __allkwargs0__ [__attrib0__]; break; } } } } else { } return (key (a) > key (b) ? 1 : -(1)); })); } else { iterable.sort (); } if (reverse) { iterable.reverse (); } }; export var sorted = function (iterable, key, reverse) { if (typeof key == 'undefined' || (key != null && key.hasOwnProperty ("__kwargtrans__"))) {; var key = null; }; if (typeof reverse == 'undefined' || (reverse != null && reverse.hasOwnProperty ("__kwargtrans__"))) {; var reverse = false; }; if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'iterable': var iterable = __allkwargs0__ [__attrib0__]; break; case 'key': var key = __allkwargs0__ [__attrib0__]; break; case 'reverse': var reverse = __allkwargs0__ [__attrib0__]; break; } } } } else { } if (py_typeof (iterable) == dict) { var result = copy (iterable.py_keys ()); } else { var result = copy (iterable); } __sort__ (result, key, reverse); return result; }; export var map = function (func, iterable) { return (function () { var __accu0__ = []; for (var item of iterable) { __accu0__.append (func (item)); } return __accu0__; }) (); }; export var filter = function (func, iterable) { if (func == null) { var func = bool; } return (function () { var __accu0__ = []; for (var item of iterable) { if (func (item)) { __accu0__.append (item); } } return __accu0__; }) (); }; export var divmod = function (n, d) { return tuple ([Math.floor (n / d), __mod__ (n, d)]); }; export var __Terminal__ = __class__ ('__Terminal__', [object], { __module__: __name__, get __init__ () {return __get__ (this, function (self) { self.buffer = ''; try { self.element = document.getElementById ('__terminal__'); } catch (__except0__) { self.element = null; } if (self.element) { self.element.style.overflowX = 'auto'; self.element.style.boxSizing = 'border-box'; self.element.style.padding = '5px'; self.element.innerHTML = '_'; } });}, get print () {return __get__ (this, function (self) { var sep = ' '; var end = '\n'; if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'self': var self = __allkwargs0__ [__attrib0__]; break; case 'sep': var sep = __allkwargs0__ [__attrib0__]; break; case 'end': var end = __allkwargs0__ [__attrib0__]; break; } } } var args = tuple ([].slice.apply (arguments).slice (1, __ilastarg0__ + 1)); } else { var args = tuple (); } self.buffer = '{}{}{}'.format (self.buffer, sep.join ((function () { var __accu0__ = []; for (var arg of args) { __accu0__.append (str (arg)); } return __accu0__; }) ()), end).__getslice__ (-(4096), null, 1); if (self.element) { self.element.innerHTML = self.buffer.py_replace ('\n', '
').py_replace (' ', ' '); self.element.scrollTop = self.element.scrollHeight; } else { console.log (sep.join ((function () { var __accu0__ = []; for (var arg of args) { __accu0__.append (str (arg)); } return __accu0__; }) ())); } });}, get input () {return __get__ (this, function (self, question) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'self': var self = __allkwargs0__ [__attrib0__]; break; case 'question': var question = __allkwargs0__ [__attrib0__]; break; } } } } else { } self.print ('{}'.format (question), __kwargtrans__ ({end: ''})); var answer = window.prompt ('\n'.join (self.buffer.py_split ('\n').__getslice__ (-(8), null, 1))); self.print (answer); return answer; });} }); export var __terminal__ = __Terminal__ (); export var print = __terminal__.print; export var input = __terminal__.input; //# sourceMappingURL=org.transcrypt.__runtime__.map ================================================ FILE: docs/examples/transcrypt/sketch_009/target/org.transcrypt.__runtime__.py ================================================ # Transcrypt runtime module #__pragma__ ('js', 'export var __envir__ = {{}};\n{}', __include__ ('org/transcrypt/__envir__.js')) #__pragma__ ('js', '{}', __include__ ('org/transcrypt/__core__.js')) #__pragma__ ('js', '{}', __include__ ('org/transcrypt/__builtin__.js')) #__pragma__ ('skip') copy = Math = __typeof__ = __repr__ = document = console = window = 0 #__pragma__ ('noskip') #__pragma__ ('notconv') # !!! tconv gives a problem with __terminal__, needs investigation #__pragma__ ('nokwargs') #__pragma__ ('noalias', 'sort') class BaseException: pass class Exception (BaseException): #__pragma__ ('kwargs') def __init__ (self, *args, **kwargs): self.__args__ = args if kwargs.error != None: self.stack = kwargs.error.stack # Integrate with JavaScript Error object elif Error: self.stack = (__new__(Error())).stack # Create our own stack if we aren't given one else: self.stack = 'No stack trace available' #__pragma__ ('nokwargs') def __repr__ (self): if len (self.__args__) > 1: return '{}{}'.format (self.__class__.__name__, repr (tuple (self.__args__))) elif len (self.__args__): return '{}({})'.format (self.__class__.__name__, repr (self.__args__ [0])) else: return '{}()'.format (self.__class__.__name__) def __str__ (self): if len (self.__args__) > 1: return str (tuple (self.__args__)) elif len (self.__args__): return str (self.__args__ [0]) else: return '' class IterableError (Exception): def __init__ (self, error): Exception.__init__ (self, 'Can\'t iterate over non-iterable', error = error) class StopIteration (Exception): def __init__ (self, error): Exception.__init__ (self, 'Iterator exhausted', error = error) class ValueError (Exception): def __init__ (self, message, error): Exception.__init__ (self, message, error = error) class KeyError (Exception): def __init__ (self, message, error): Exception.__init__ (self, message, error = error) class AssertionError (Exception): def __init__ (self, message, error): if message: Exception.__init__ (self, message, error = error) else: Exception.__init__ (self, error = error) class NotImplementedError (Exception): def __init__(self, message, error): Exception.__init__(self, message, error = error) class IndexError (Exception): def __init__(self, message, error): Exception.__init__(self, message, error = error) class AttributeError (Exception): def __init__(self, message, error): Exception.__init__(self, message, error = error) class TypeError (Exception): def __init__(self, message, error): Exception.__init__(self, message, error = error) # Warnings Exceptions # N.B. This is a limited subset of the warnings defined in # the cpython implementation to keep things small for now. class Warning (Exception): ''' Warning Base Class ''' pass class UserWarning (Warning): pass class DeprecationWarning (Warning): pass class RuntimeWarning (Warning): pass #__pragma__ ('kwargs') def __sort__ (iterable, key = None, reverse = False): # Used by py_sort, can deal with kwargs if key: iterable.sort (lambda a, b: 1 if key (a) > key (b) else -1) # JavaScript sort, case '==' is irrelevant for sorting else: iterable.sort () # JavaScript sort if reverse: iterable.reverse () def sorted (iterable, key = None, reverse = False): if type (iterable) == dict: result = copy (iterable.keys ()) else: result = copy (iterable) __sort__ (result, key, reverse) return result #__pragma__ ('nokwargs') def map (func, iterable): return [func (item) for item in iterable] def filter (func, iterable): if func == None: func = bool return [item for item in iterable if func (item)] def divmod (n, d): return n // d, n % d #__pragma__ ('ifdef', '__complex__') class complex: def __init__ (self, real, imag = None): if imag == None: if type (real) == complex: self.real = real.real self.imag = real.imag else: self.real = real self.imag = 0 else: self.real = real self.imag = imag def __neg__ (self): return complex (-self.real, -self.imag) def __exp__ (self): modulus = Math.exp (self.real) return complex (modulus * Math.cos (self.imag), modulus * Math.sin (self.imag)) def __log__ (self): return complex (Math.log (Math.sqrt (self.real * self.real + self.imag * self.imag)), Math.atan2 (self.imag, self.real)) def __pow__ (self, other): # a ** b = exp (b log a) return (self.__log__ () .__mul__ (other)) .__exp__ () def __rpow__ (self, real): # real ** comp -> comp.__rpow__ (real) return self.__mul__ (Math.log (real)) .__exp__ () def __mul__ (self, other): if __typeof__ (other) is 'number': return complex (self.real * other, self.imag * other) else: return complex (self.real * other.real - self.imag * other.imag, self.real * other.imag + self.imag * other.real) def __rmul__ (self, real): # real + comp -> comp.__rmul__ (real) return complex (self.real * real, self.imag * real) def __div__ (self, other): if __typeof__ (other) is 'number': return complex (self.real / other, self.imag / other) else: denom = other.real * other.real + other.imag * other.imag return complex ( (self.real * other.real + self.imag * other.imag) / denom, (self.imag * other.real - self.real * other.imag) / denom ) def __rdiv__ (self, real): # real / comp -> comp.__rdiv__ (real) denom = self.real * self.real return complex ( (real * self.real) / denom, (real * self.imag) / denom ) def __add__ (self, other): if __typeof__ (other) is 'number': return complex (self.real + other, self.imag) else: # Assume other is complex return complex (self.real + other.real, self.imag + other.imag) def __radd__ (self, real): # real + comp -> comp.__radd__ (real) return complex (self.real + real, self.imag) def __sub__ (self, other): if __typeof__ (other) is 'number': return complex (self.real - other, self.imag) else: return complex (self.real - other.real, self.imag - other.imag) def __rsub__ (self, real): # real - comp -> comp.__rsub__ (real) return complex (real - self.real, -self.imag) def __repr__ (self): return '({}{}{}j)'.format (self.real, '+' if self.imag >= 0 else '', self.imag) def __str__ (self): return __repr__ (self) [1 : -1] def __eq__ (self, other): if __typeof__ (other) is 'number': return self.real == other else: return self.real == other.real and self.imag == other.imag def __ne__ (self, other): if __typeof__ (other) is 'number': return self.real != other else: return self.real != other.real or self.imag != other.imag def conjugate (self): return complex (self.real, -self.imag) def __conj__ (aNumber): if isinstance (aNumber, complex): return complex (aNumber.real, -aNumber.imag) else: return complex (aNumber, 0) #__pragma__ ('endif') class __Terminal__: ''' Printing to either the console or to html happens async, but is blocked by calling window.prompt. So while all input and print statements are encountered in normal order, the print's exit immediately without yet having actually printed This means the next input takes control, blocking actual printing and so on indefinitely The effect is that everything's only printed after all inputs are done To prevent that, what's needed is to only execute the next window.prompt after actual printing has been done Since we've no way to find out when that is, a timeout is used. ''' def __init__ (self): self.buffer = '' try: self.element = document.getElementById ('__terminal__') except: self.element = None if self.element: self.element.style.overflowX = 'auto' self.element.style.boxSizing = 'border-box' self.element.style.padding = '5px' self.element.innerHTML = '_' #__pragma__ ('kwargs') def print (self, *args, sep = ' ', end = '\n'): self.buffer = '{}{}{}'.format (self.buffer, sep.join ([str (arg) for arg in args]), end) [-4096 : ] if self.element: self.element.innerHTML = self.buffer.replace ('\n', '
') .replace (' ', ' ') self.element.scrollTop = self.element.scrollHeight else: console.log (sep.join ([str (arg) for arg in args])) def input (self, question): self.print ('{}'.format (question), end = '') answer = window.prompt ('\n'.join (self.buffer.split ('\n') [-8:])) self.print (answer) return answer #__pragma__ ('nokwargs') __terminal__ = __Terminal__ () print = __terminal__.print input = __terminal__.input ================================================ FILE: docs/examples/transcrypt/sketch_009/target/pyp5js.js ================================================ // Transcrypt'ed from Python, 2021-11-02 13:06:17 import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, all, any, assert, bool, bytearray, bytes, callable, chr, deepcopy, delattr, dict, dir, divmod, enumerate, getattr, hasattr, isinstance, issubclass, len, list, object, ord, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, setattr, sorted, sum, tuple, zip} from './org.transcrypt.__runtime__.js'; import {PythonFunctions} from './python_functions.js'; var __name__ = 'pyp5js'; export var _P5_INSTANCE = null; export var _CTX_MIDDLE = null; export var _DEFAULT_FILL = null; export var _DEFAULT_LEADMULT = null; export var _DEFAULT_STROKE = null; export var _DEFAULT_TEXT_FILL = null; export var ADD = null; export var ALT = null; export var ARROW = null; export var AUDIO = null; export var AUTO = null; export var AXES = null; export var BACKSPACE = null; export var BASELINE = null; export var BEVEL = null; export var BEZIER = null; export var BLEND = null; export var BLUR = null; export var BOLD = null; export var BOLDITALIC = null; export var BOTTOM = null; export var BURN = null; export var CENTER = null; export var CHORD = null; export var CLAMP = null; export var CLOSE = null; export var CONTROL = null; export var CORNER = null; export var CORNERS = null; export var CROSS = null; export var CURVE = null; export var DARKEST = null; export var DEG_TO_RAD = null; export var DEGREES = null; export var DELETE = null; export var DIFFERENCE = null; export var DILATE = null; export var DODGE = null; export var DOWN_ARROW = null; export var ENTER = null; export var ERODE = null; export var ESCAPE = null; export var EXCLUSION = null; export var FILL = null; export var GRAY = null; export var GRID = null; export var HALF_PI = null; export var HAND = null; export var HARD_LIGHT = null; export var HSB = null; export var HSL = null; export var IMAGE = null; export var IMMEDIATE = null; export var INVERT = null; export var ITALIC = null; export var LANDSCAPE = null; export var LEFT = null; export var LEFT_ARROW = null; export var LIGHTEST = null; export var LINE_LOOP = null; export var LINE_STRIP = null; export var LINEAR = null; export var LINES = null; export var MIRROR = null; export var MITER = null; export var MOVE = null; export var MULTIPLY = null; export var NEAREST = null; export var NORMAL = null; export var OPAQUE = null; export var OPEN = null; export var OPTION = null; export var OVERLAY = null; export var PI = null; export var PIE = null; export var POINTS = null; export var PORTRAIT = null; export var POSTERIZE = null; export var PROJECT = null; export var QUAD_STRIP = null; export var QUADRATIC = null; export var QUADS = null; export var QUARTER_PI = null; export var RAD_TO_DEG = null; export var RADIANS = null; export var RADIUS = null; export var REPEAT = null; export var REPLACE = null; export var RETURN = null; export var RGB = null; export var RIGHT = null; export var RIGHT_ARROW = null; export var ROUND = null; export var SCREEN = null; export var SHIFT = null; export var SOFT_LIGHT = null; export var SQUARE = null; export var STROKE = null; export var SUBTRACT = null; export var TAB = null; export var TAU = null; export var TEXT = null; export var TEXTURE = null; export var THRESHOLD = null; export var TOP = null; export var TRIANGLE_FAN = null; export var TRIANGLE_STRIP = null; export var TRIANGLES = null; export var TWO_PI = null; export var UP_ARROW = null; export var VIDEO = null; export var WAIT = null; export var WEBGL = null; export var P2D = null; var PI = null; export var frameCount = null; export var focused = null; export var displayWidth = null; export var displayHeight = null; export var windowWidth = null; export var windowHeight = null; export var width = null; export var height = null; export var disableFriendlyErrors = null; export var deviceOrientation = null; export var accelerationX = null; export var accelerationY = null; export var accelerationZ = null; export var pAccelerationX = null; export var pAccelerationY = null; export var pAccelerationZ = null; export var rotationX = null; export var rotationY = null; export var rotationZ = null; export var pRotationX = null; export var pRotationY = null; export var pRotationZ = null; export var turnAxis = null; export var keyIsPressed = null; export var key = null; export var keyCode = null; export var mouseX = null; export var mouseY = null; export var pmouseX = null; export var pmouseY = null; export var winMouseX = null; export var winMouseY = null; export var pwinMouseX = null; export var pwinMouseY = null; export var mouseButton = null; export var mouseIsPressed = null; export var touches = null; export var pixels = null; export var alpha = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.alpha (...args); }; export var blue = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.blue (...args); }; export var brightness = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.brightness (...args); }; export var color = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.color (...args); }; export var green = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.green (...args); }; export var hue = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.hue (...args); }; export var lerpColor = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.lerpColor (...args); }; export var lightness = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.lightness (...args); }; export var red = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.red (...args); }; export var saturation = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.saturation (...args); }; export var background = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.background (...args); }; export var py_clear = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } var p5_clear = _P5_INSTANCE.clear (...args); return p5_clear; }; export var erase = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.erase (...args); }; export var noErase = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noErase (...args); }; export var colorMode = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.colorMode (...args); }; export var fill = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.fill (...args); }; export var noFill = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noFill (...args); }; export var noStroke = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noStroke (...args); }; export var stroke = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.stroke (...args); }; export var arc = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.arc (...args); }; export var ellipse = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.ellipse (...args); }; export var circle = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.circle (...args); }; export var line = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.line (...args); }; export var point = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.point (...args); }; export var quad = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.quad (...args); }; export var rect = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.rect (...args); }; export var square = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.square (...args); }; export var triangle = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.triangle (...args); }; export var plane = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.plane (...args); }; export var box = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.box (...args); }; export var sphere = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.sphere (...args); }; export var cylinder = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.cylinder (...args); }; export var cone = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.cone (...args); }; export var ellipsoid = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.ellipsoid (...args); }; export var torus = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.torus (...args); }; export var loadModel = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.loadModel (...args); }; export var model = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.model (...args); }; export var ellipseMode = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.ellipseMode (...args); }; export var noSmooth = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noSmooth (...args); }; export var rectMode = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.rectMode (...args); }; export var smooth = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.smooth (...args); }; export var strokeCap = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.strokeCap (...args); }; export var strokeJoin = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.strokeJoin (...args); }; export var strokeWeight = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.strokeWeight (...args); }; export var bezier = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.bezier (...args); }; export var bezierDetail = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.bezierDetail (...args); }; export var bezierPoint = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.bezierPoint (...args); }; export var bezierTangent = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.bezierTangent (...args); }; export var curve = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.curve (...args); }; export var curveDetail = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.curveDetail (...args); }; export var curveTightness = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.curveTightness (...args); }; export var curvePoint = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.curvePoint (...args); }; export var curveTangent = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.curveTangent (...args); }; export var beginContour = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.beginContour (...args); }; export var beginShape = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.beginShape (...args); }; export var bezierVertex = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.bezierVertex (...args); }; export var curveVertex = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.curveVertex (...args); }; export var endContour = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.endContour (...args); }; export var endShape = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.endShape (...args); }; export var quadraticVertex = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.quadraticVertex (...args); }; export var vertex = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.vertex (...args); }; export var cursor = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.cursor (...args); }; export var frameRate = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.frameRate (...args); }; export var noCursor = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noCursor (...args); }; export var fullscreen = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.fullscreen (...args); }; export var pixelDensity = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.pixelDensity (...args); }; export var displayDensity = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.displayDensity (...args); }; export var getURL = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.getURL (...args); }; export var getURLPath = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.getURLPath (...args); }; export var getURLParams = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.getURLParams (...args); }; export var preload = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.preload (...args); }; export var setup = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.setup (...args); }; export var draw = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.draw (...args); }; export var remove = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.remove (...args); }; export var noLoop = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noLoop (...args); }; export var loop = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.loop (...args); }; export var push = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.push (...args); }; export var redraw = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.redraw (...args); }; export var resizeCanvas = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.resizeCanvas (...args); }; export var noCanvas = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noCanvas (...args); }; export var createGraphics = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createGraphics (...args); }; export var blendMode = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.blendMode (...args); }; export var setAttributes = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.setAttributes (...args); }; export var applyMatrix = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.applyMatrix (...args); }; export var resetMatrix = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.resetMatrix (...args); }; export var rotate = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.rotate (...args); }; export var rotateX = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.rotateX (...args); }; export var rotateY = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.rotateY (...args); }; export var rotateZ = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.rotateZ (...args); }; export var scale = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.scale (...args); }; export var shearX = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.shearX (...args); }; export var shearY = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.shearY (...args); }; export var translate = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.translate (...args); }; export var createStringDict = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createStringDict (...args); }; export var createNumberDict = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createNumberDict (...args); }; export var append = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.append (...args); }; export var arrayCopy = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.arrayCopy (...args); }; export var concat = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.concat (...args); }; export var reverse = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.reverse (...args); }; export var shorten = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.shorten (...args); }; export var shuffle = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.shuffle (...args); }; export var py_sort = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.py_sort (...args); }; export var splice = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.splice (...args); }; export var subset = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.subset (...args); }; export var float = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.float (...args); }; export var int = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.int (...args); }; export var str = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.str (...args); }; export var boolean = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.boolean (...args); }; export var byte = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.byte (...args); }; export var char = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.char (...args); }; export var unchar = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.unchar (...args); }; export var hex = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.hex (...args); }; export var unhex = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.unhex (...args); }; export var join = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.join (...args); }; export var match = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.match (...args); }; export var matchAll = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.matchAll (...args); }; export var nf = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.nf (...args); }; export var nfc = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.nfc (...args); }; export var nfp = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.nfp (...args); }; export var nfs = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.nfs (...args); }; export var py_split = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.py_split (...args); }; export var splitTokens = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.splitTokens (...args); }; export var trim = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.trim (...args); }; export var setMoveThreshold = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.setMoveThreshold (...args); }; export var setShakeThreshold = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.setShakeThreshold (...args); }; export var keyIsDown = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.keyIsDown (...args); }; export var createImage = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createImage (...args); }; export var saveCanvas = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.saveCanvas (...args); }; export var saveFrames = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.saveFrames (...args); }; export var image_proxy = function (img) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'img': var img = __allkwargs0__ [__attrib0__]; break; } } } } else { } var _set = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } var value = img.set (...args); return value; }; var _get = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } var value = img.get (...args); return value; }; img.py_set = _set; img.py_get = _get; return img; }; export var loadImage = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } var imageObj = _P5_INSTANCE.loadImage (...args); return image_proxy (imageObj); }; export var image = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.image (...args); }; export var tint = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.tint (...args); }; export var noTint = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noTint (...args); }; export var imageMode = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.imageMode (...args); }; export var blend = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.blend (...args); }; export var copy = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.copy (...args); }; export var filter = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } if (len (args) > 1 && (args [0] === null || callable (args [0]))) { return PythonFunctions.filter (...args); } else { return _P5_INSTANCE.filter (...args); } }; export var py_get = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } var p5_get = _P5_INSTANCE.get (...args); return p5_get; }; export var loadPixels = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.loadPixels (...args); }; export var py_set = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } if (len (args) <= 1) { return PythonFunctions.py_set (...args); } else { return _P5_INSTANCE.py_set (...args); } }; export var updatePixels = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.updatePixels (...args); }; export var loadJSON = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.loadJSON (...args); }; export var loadStrings = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.loadStrings (...args); }; export var loadTable = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.loadTable (...args); }; export var loadXML = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.loadXML (...args); }; export var loadBytes = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.loadBytes (...args); }; export var httpGet = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.httpGet (...args); }; export var httpPost = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.httpPost (...args); }; export var httpDo = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.httpDo (...args); }; export var createWriter = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createWriter (...args); }; export var save = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.save (...args); }; export var saveJSON = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.saveJSON (...args); }; export var saveStrings = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.saveStrings (...args); }; export var saveTable = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.saveTable (...args); }; export var day = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.day (...args); }; export var hour = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.hour (...args); }; export var minute = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.minute (...args); }; export var millis = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.millis (...args); }; export var month = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.month (...args); }; export var second = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.second (...args); }; export var year = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.year (...args); }; export var createVector = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createVector (...args); }; export var abs = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.abs (...args); }; export var ceil = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.ceil (...args); }; export var constrain = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.constrain (...args); }; export var dist = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.dist (...args); }; export var exp = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.exp (...args); }; export var floor = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.floor (...args); }; export var lerp = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.lerp (...args); }; export var log = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.log (...args); }; export var mag = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.mag (...args); }; export var map = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } if (len (args) > 1 && callable (args [0])) { return PythonFunctions.map (...args); } else { return _P5_INSTANCE.map (...args); } }; export var max = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.max (...args); }; export var min = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.min (...args); }; export var norm = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.norm (...args); }; export var pow = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.pow (...args); }; export var round = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.round (...args); }; export var sq = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.sq (...args); }; export var sqrt = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.sqrt (...args); }; export var noise = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noise (...args); }; export var noiseDetail = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noiseDetail (...args); }; export var noiseSeed = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noiseSeed (...args); }; export var randomSeed = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.randomSeed (...args); }; export var random = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.random (...args); }; export var randomGaussian = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.randomGaussian (...args); }; export var acos = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.acos (...args); }; export var asin = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.asin (...args); }; export var atan = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.atan (...args); }; export var atan2 = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.atan2 (...args); }; export var cos = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.cos (...args); }; export var sin = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.sin (...args); }; export var tan = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.tan (...args); }; export var degrees = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.degrees (...args); }; export var radians = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.radians (...args); }; export var angleMode = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.angleMode (...args); }; export var textAlign = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.textAlign (...args); }; export var textLeading = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.textLeading (...args); }; export var textSize = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.textSize (...args); }; export var textStyle = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.textStyle (...args); }; export var textWidth = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.textWidth (...args); }; export var textAscent = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.textAscent (...args); }; export var textDescent = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.textDescent (...args); }; export var loadFont = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.loadFont (...args); }; export var text = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.text (...args); }; export var textFont = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.textFont (...args); }; export var orbitControl = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.orbitControl (...args); }; export var debugMode = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.debugMode (...args); }; export var noDebugMode = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noDebugMode (...args); }; export var ambientLight = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.ambientLight (...args); }; export var directionalLight = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.directionalLight (...args); }; export var pointLight = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.pointLight (...args); }; export var lights = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.lights (...args); }; export var loadShader = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.loadShader (...args); }; export var createShader = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createShader (...args); }; export var shader = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.shader (...args); }; export var resetShader = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.resetShader (...args); }; export var normalMaterial = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.normalMaterial (...args); }; export var texture = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.texture (...args); }; export var textureMode = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.textureMode (...args); }; export var textureWrap = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.textureWrap (...args); }; export var ambientMaterial = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.ambientMaterial (...args); }; export var specularMaterial = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.specularMaterial (...args); }; export var shininess = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.shininess (...args); }; export var camera = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.camera (...args); }; export var perspective = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.perspective (...args); }; export var ortho = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.ortho (...args); }; export var createCamera = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createCamera (...args); }; export var setCamera = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.setCamera (...args); }; export var select = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.select (...args); }; export var selectAll = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.selectAll (...args); }; export var removeElements = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.removeElements (...args); }; export var changed = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.changed (...args); }; export var input = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.input (...args); }; export var createDiv = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createDiv (...args); }; export var createP = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createP (...args); }; export var createSpan = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createSpan (...args); }; export var createImg = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createImg (...args); }; export var createA = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createA (...args); }; export var createSlider = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createSlider (...args); }; export var createButton = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createButton (...args); }; export var createCheckbox = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createCheckbox (...args); }; export var createSelect = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createSelect (...args); }; export var createRadio = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createRadio (...args); }; export var createColorPicker = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createColorPicker (...args); }; export var createInput = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createInput (...args); }; export var createFileInput = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createFileInput (...args); }; export var createVideo = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createVideo (...args); }; export var createAudio = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createAudio (...args); }; export var createCapture = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createCapture (...args); }; export var createElement = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createElement (...args); }; export var createCanvas = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } var canvas = _P5_INSTANCE.createCanvas (...args); width = _P5_INSTANCE.width; height = _P5_INSTANCE.height; return canvas; }; export var py_pop = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } var p5_pop = _P5_INSTANCE.pop (...args); return p5_pop; }; export var size = createCanvas; export var popMatrix = py_pop; export var popStyle = py_pop; export var pushMatrix = push; export var pushStyle = push; export var PVector = function (x, y, z) { if (typeof x == 'undefined' || (x != null && x.hasOwnProperty ("__kwargtrans__"))) {; var x = 0; }; if (typeof y == 'undefined' || (y != null && y.hasOwnProperty ("__kwargtrans__"))) {; var y = 0; }; if (typeof z == 'undefined' || (z != null && z.hasOwnProperty ("__kwargtrans__"))) {; var z = 0; }; if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'x': var x = __allkwargs0__ [__attrib0__]; break; case 'y': var y = __allkwargs0__ [__attrib0__]; break; case 'z': var z = __allkwargs0__ [__attrib0__]; break; } } } } else { } return _P5_INSTANCE.createVector (x, y, z); }; setattr (PVector, 'dist', p5.Vector.dist); setattr (PVector, 'add', p5.Vector.add); setattr (PVector, 'sub', p5.Vector.sub); setattr (PVector, 'mult', p5.Vector.mult); setattr (PVector, 'div', p5.Vector.div); setattr (PVector, 'dot', p5.Vector.dot); setattr (PVector, 'cross', p5.Vector.cross); setattr (PVector, 'lerp', p5.Vector.lerp); setattr (PVector, 'random2D', p5.Vector.random2D); setattr (PVector, 'random3D', p5.Vector.random3D); setattr (PVector, 'angleBetween', p5.Vector.angleBetween); setattr (PVector, 'fromAngle', p5.Vector.fromAngle); setattr (PVector, 'fromAngles', p5.Vector.fromAngles); setattr (PVector, 'equals', p5.Vector.equals); export var pre_draw = function (p5_instance, draw_func) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'p5_instance': var p5_instance = __allkwargs0__ [__attrib0__]; break; case 'draw_func': var draw_func = __allkwargs0__ [__attrib0__]; break; } } } } else { } _CTX_MIDDLE = p5_instance._CTX_MIDDLE; _DEFAULT_FILL = p5_instance._DEFAULT_FILL; _DEFAULT_LEADMULT = p5_instance._DEFAULT_LEADMULT; _DEFAULT_STROKE = p5_instance._DEFAULT_STROKE; _DEFAULT_TEXT_FILL = p5_instance._DEFAULT_TEXT_FILL; ADD = p5_instance.ADD; ALT = p5_instance.ALT; ARROW = p5_instance.ARROW; AUDIO = p5_instance.AUDIO; AUTO = p5_instance.AUTO; AXES = p5_instance.AXES; BACKSPACE = p5_instance.BACKSPACE; BASELINE = p5_instance.BASELINE; BEVEL = p5_instance.BEVEL; BEZIER = p5_instance.BEZIER; BLEND = p5_instance.BLEND; BLUR = p5_instance.BLUR; BOLD = p5_instance.BOLD; BOLDITALIC = p5_instance.BOLDITALIC; BOTTOM = p5_instance.BOTTOM; BURN = p5_instance.BURN; CENTER = p5_instance.CENTER; CHORD = p5_instance.CHORD; CLAMP = p5_instance.CLAMP; CLOSE = p5_instance.CLOSE; CONTROL = p5_instance.CONTROL; CORNER = p5_instance.CORNER; CORNERS = p5_instance.CORNERS; CROSS = p5_instance.CROSS; CURVE = p5_instance.CURVE; DARKEST = p5_instance.DARKEST; DEG_TO_RAD = p5_instance.DEG_TO_RAD; DEGREES = p5_instance.DEGREES; DELETE = p5_instance.DELETE; DIFFERENCE = p5_instance.DIFFERENCE; DILATE = p5_instance.DILATE; DODGE = p5_instance.DODGE; DOWN_ARROW = p5_instance.DOWN_ARROW; ENTER = p5_instance.ENTER; ERODE = p5_instance.ERODE; ESCAPE = p5_instance.ESCAPE; EXCLUSION = p5_instance.EXCLUSION; FILL = p5_instance.FILL; GRAY = p5_instance.GRAY; GRID = p5_instance.GRID; HALF_PI = p5_instance.HALF_PI; HAND = p5_instance.HAND; HARD_LIGHT = p5_instance.HARD_LIGHT; HSB = p5_instance.HSB; HSL = p5_instance.HSL; IMAGE = p5_instance.IMAGE; IMMEDIATE = p5_instance.IMMEDIATE; INVERT = p5_instance.INVERT; ITALIC = p5_instance.ITALIC; LANDSCAPE = p5_instance.LANDSCAPE; LEFT = p5_instance.LEFT; LEFT_ARROW = p5_instance.LEFT_ARROW; LIGHTEST = p5_instance.LIGHTEST; LINE_LOOP = p5_instance.LINE_LOOP; LINE_STRIP = p5_instance.LINE_STRIP; LINEAR = p5_instance.LINEAR; LINES = p5_instance.LINES; MIRROR = p5_instance.MIRROR; MITER = p5_instance.MITER; MOVE = p5_instance.MOVE; MULTIPLY = p5_instance.MULTIPLY; NEAREST = p5_instance.NEAREST; NORMAL = p5_instance.NORMAL; OPAQUE = p5_instance.OPAQUE; OPEN = p5_instance.OPEN; OPTION = p5_instance.OPTION; OVERLAY = p5_instance.OVERLAY; P2D = p5_instance.P2D; var P3D = p5_instance.WEBGL; PI = p5_instance.PI; PIE = p5_instance.PIE; POINTS = p5_instance.POINTS; PORTRAIT = p5_instance.PORTRAIT; POSTERIZE = p5_instance.POSTERIZE; PROJECT = p5_instance.PROJECT; QUAD_STRIP = p5_instance.QUAD_STRIP; QUADRATIC = p5_instance.QUADRATIC; QUADS = p5_instance.QUADS; QUARTER_PI = p5_instance.QUARTER_PI; RAD_TO_DEG = p5_instance.RAD_TO_DEG; RADIANS = p5_instance.RADIANS; RADIUS = p5_instance.RADIUS; REPEAT = p5_instance.REPEAT; REPLACE = p5_instance.REPLACE; RETURN = p5_instance.RETURN; RGB = p5_instance.RGB; RIGHT = p5_instance.RIGHT; RIGHT_ARROW = p5_instance.RIGHT_ARROW; ROUND = p5_instance.ROUND; SCREEN = p5_instance.SCREEN; SHIFT = p5_instance.SHIFT; SOFT_LIGHT = p5_instance.SOFT_LIGHT; SQUARE = p5_instance.SQUARE; STROKE = p5_instance.STROKE; SUBTRACT = p5_instance.SUBTRACT; TAB = p5_instance.TAB; TAU = p5_instance.TAU; TEXT = p5_instance.TEXT; TEXTURE = p5_instance.TEXTURE; THRESHOLD = p5_instance.THRESHOLD; TOP = p5_instance.TOP; TRIANGLE_FAN = p5_instance.TRIANGLE_FAN; TRIANGLE_STRIP = p5_instance.TRIANGLE_STRIP; TRIANGLES = p5_instance.TRIANGLES; TWO_PI = p5_instance.TWO_PI; UP_ARROW = p5_instance.UP_ARROW; VIDEO = p5_instance.VIDEO; WAIT = p5_instance.WAIT; WEBGL = p5_instance.WEBGL; frameCount = p5_instance.frameCount; focused = p5_instance.focused; displayWidth = p5_instance.displayWidth; displayHeight = p5_instance.displayHeight; windowWidth = p5_instance.windowWidth; windowHeight = p5_instance.windowHeight; width = p5_instance.width; height = p5_instance.height; disableFriendlyErrors = p5_instance.disableFriendlyErrors; deviceOrientation = p5_instance.deviceOrientation; accelerationX = p5_instance.accelerationX; accelerationY = p5_instance.accelerationY; accelerationZ = p5_instance.accelerationZ; pAccelerationX = p5_instance.pAccelerationX; pAccelerationY = p5_instance.pAccelerationY; pAccelerationZ = p5_instance.pAccelerationZ; rotationX = p5_instance.rotationX; rotationY = p5_instance.rotationY; rotationZ = p5_instance.rotationZ; pRotationX = p5_instance.pRotationX; pRotationY = p5_instance.pRotationY; pRotationZ = p5_instance.pRotationZ; turnAxis = p5_instance.turnAxis; keyIsPressed = p5_instance.keyIsPressed; key = p5_instance.key; keyCode = p5_instance.keyCode; mouseX = p5_instance.mouseX; mouseY = p5_instance.mouseY; pmouseX = p5_instance.pmouseX; pmouseY = p5_instance.pmouseY; winMouseX = p5_instance.winMouseX; winMouseY = p5_instance.winMouseY; pwinMouseX = p5_instance.pwinMouseX; pwinMouseY = p5_instance.pwinMouseY; mouseButton = p5_instance.mouseButton; mouseIsPressed = p5_instance.mouseIsPressed; touches = p5_instance.touches; pixels = p5_instance.pixels; return draw_func (); }; export var global_p5_injection = function (p5_sketch) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'p5_sketch': var p5_sketch = __allkwargs0__ [__attrib0__]; break; } } } } else { } var decorator = function (f) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'f': var f = __allkwargs0__ [__attrib0__]; break; } } } } else { } var wrapper = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } } else { } _P5_INSTANCE = p5_sketch; return pre_draw (_P5_INSTANCE, f); }; return wrapper; }; return decorator; }; export var start_p5 = function (preload_func, setup_func, draw_func, event_functions) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'preload_func': var preload_func = __allkwargs0__ [__attrib0__]; break; case 'setup_func': var setup_func = __allkwargs0__ [__attrib0__]; break; case 'draw_func': var draw_func = __allkwargs0__ [__attrib0__]; break; case 'event_functions': var event_functions = __allkwargs0__ [__attrib0__]; break; } } } } else { } var sketch_setup = function (p5_sketch) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'p5_sketch': var p5_sketch = __allkwargs0__ [__attrib0__]; break; } } } } else { } p5_sketch.preload = global_p5_injection (p5_sketch) (preload_func); p5_sketch.setup = global_p5_injection (p5_sketch) (setup_func); p5_sketch.draw = global_p5_injection (p5_sketch) (draw_func); }; var instance = new p5 (sketch_setup, 'sketch-holder'); var event_function_names = tuple (['deviceMoved', 'deviceTurned', 'deviceShaken', 'windowResized', 'keyPressed', 'keyReleased', 'keyTyped', 'mousePressed', 'mouseReleased', 'mouseClicked', 'doubleClicked', 'mouseMoved', 'mouseDragged', 'mouseWheel', 'touchStarted', 'touchMoved', 'touchEnded', 'keyIsDown']); for (var f_name of (function () { var __accu0__ = []; for (var f of event_function_names) { if (event_functions.py_get (f, null)) { __accu0__.append (f); } } return __accu0__; }) ()) { var func = event_functions [f_name]; var event_func = global_p5_injection (instance) (func); setattr (instance, f_name, event_func); } }; export var logOnloaded = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } } else { } console.log ('Lib loaded!'); }; export var add_library = function (lib_name) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'lib_name': var lib_name = __allkwargs0__ [__attrib0__]; break; } } } } else { } var src = ''; return console.log ('Lib name is not valid:', lib_name); console.log ('Importing:', src); var script = document.createElement ('script'); script.onload = logOnloaded; script.src = src; document.head.appendChild (script); }; //# sourceMappingURL=pyp5js.map ================================================ FILE: docs/examples/transcrypt/sketch_009/target/pyp5js.py ================================================ from python_functions import PythonFunctions _P5_INSTANCE = None _CTX_MIDDLE = None _DEFAULT_FILL = None _DEFAULT_LEADMULT = None _DEFAULT_STROKE = None _DEFAULT_TEXT_FILL = None ADD = None ALT = None ARROW = None AUDIO = None AUTO = None AXES = None BACKSPACE = None BASELINE = None BEVEL = None BEZIER = None BLEND = None BLUR = None BOLD = None BOLDITALIC = None BOTTOM = None BURN = None CENTER = None CHORD = None CLAMP = None CLOSE = None CONTROL = None CORNER = None CORNERS = None CROSS = None CURVE = None DARKEST = None DEG_TO_RAD = None DEGREES = None DELETE = None DIFFERENCE = None DILATE = None DODGE = None DOWN_ARROW = None ENTER = None ERODE = None ESCAPE = None EXCLUSION = None FILL = None GRAY = None GRID = None HALF_PI = None HAND = None HARD_LIGHT = None HSB = None HSL = None IMAGE = None IMMEDIATE = None INVERT = None ITALIC = None LANDSCAPE = None LEFT = None LEFT_ARROW = None LIGHTEST = None LINE_LOOP = None LINE_STRIP = None LINEAR = None LINES = None MIRROR = None MITER = None MOVE = None MULTIPLY = None NEAREST = None NORMAL = None OPAQUE = None OPEN = None OPTION = None OVERLAY = None PI = None PIE = None POINTS = None PORTRAIT = None POSTERIZE = None PROJECT = None QUAD_STRIP = None QUADRATIC = None QUADS = None QUARTER_PI = None RAD_TO_DEG = None RADIANS = None RADIUS = None REPEAT = None REPLACE = None RETURN = None RGB = None RIGHT = None RIGHT_ARROW = None ROUND = None SCREEN = None SHIFT = None SOFT_LIGHT = None SQUARE = None STROKE = None SUBTRACT = None TAB = None TAU = None TEXT = None TEXTURE = None THRESHOLD = None TOP = None TRIANGLE_FAN = None TRIANGLE_STRIP = None TRIANGLES = None TWO_PI = None UP_ARROW = None VIDEO = None WAIT = None WEBGL = None P2D = None PI = None frameCount = None focused = None displayWidth = None displayHeight = None windowWidth = None windowHeight = None width = None height = None disableFriendlyErrors = None deviceOrientation = None accelerationX = None accelerationY = None accelerationZ = None pAccelerationX = None pAccelerationY = None pAccelerationZ = None rotationX = None rotationY = None rotationZ = None pRotationX = None pRotationY = None pRotationZ = None turnAxis = None keyIsPressed = None key = None keyCode = None mouseX = None mouseY = None pmouseX = None pmouseY = None winMouseX = None winMouseY = None pwinMouseX = None pwinMouseY = None mouseButton = None mouseIsPressed = None touches = None pixels = None def alpha(*args): return _P5_INSTANCE.alpha(*args) def blue(*args): return _P5_INSTANCE.blue(*args) def brightness(*args): return _P5_INSTANCE.brightness(*args) def color(*args): return _P5_INSTANCE.color(*args) def green(*args): return _P5_INSTANCE.green(*args) def hue(*args): return _P5_INSTANCE.hue(*args) def lerpColor(*args): return _P5_INSTANCE.lerpColor(*args) def lightness(*args): return _P5_INSTANCE.lightness(*args) def red(*args): return _P5_INSTANCE.red(*args) def saturation(*args): return _P5_INSTANCE.saturation(*args) def background(*args): return _P5_INSTANCE.background(*args) def clear(*args): __pragma__('noalias', 'clear') p5_clear = _P5_INSTANCE.clear(*args) __pragma__('alias', 'clear', 'py_clear') return p5_clear def erase(*args): return _P5_INSTANCE.erase(*args) def noErase(*args): return _P5_INSTANCE.noErase(*args) def colorMode(*args): return _P5_INSTANCE.colorMode(*args) def fill(*args): return _P5_INSTANCE.fill(*args) def noFill(*args): return _P5_INSTANCE.noFill(*args) def noStroke(*args): return _P5_INSTANCE.noStroke(*args) def stroke(*args): return _P5_INSTANCE.stroke(*args) def arc(*args): return _P5_INSTANCE.arc(*args) def ellipse(*args): return _P5_INSTANCE.ellipse(*args) def circle(*args): return _P5_INSTANCE.circle(*args) def line(*args): return _P5_INSTANCE.line(*args) def point(*args): return _P5_INSTANCE.point(*args) def quad(*args): return _P5_INSTANCE.quad(*args) def rect(*args): return _P5_INSTANCE.rect(*args) def square(*args): return _P5_INSTANCE.square(*args) def triangle(*args): return _P5_INSTANCE.triangle(*args) def plane(*args): return _P5_INSTANCE.plane(*args) def box(*args): return _P5_INSTANCE.box(*args) def sphere(*args): return _P5_INSTANCE.sphere(*args) def cylinder(*args): return _P5_INSTANCE.cylinder(*args) def cone(*args): return _P5_INSTANCE.cone(*args) def ellipsoid(*args): return _P5_INSTANCE.ellipsoid(*args) def torus(*args): return _P5_INSTANCE.torus(*args) def loadModel(*args): return _P5_INSTANCE.loadModel(*args) def model(*args): return _P5_INSTANCE.model(*args) def ellipseMode(*args): return _P5_INSTANCE.ellipseMode(*args) def noSmooth(*args): return _P5_INSTANCE.noSmooth(*args) def rectMode(*args): return _P5_INSTANCE.rectMode(*args) def smooth(*args): return _P5_INSTANCE.smooth(*args) def strokeCap(*args): return _P5_INSTANCE.strokeCap(*args) def strokeJoin(*args): return _P5_INSTANCE.strokeJoin(*args) def strokeWeight(*args): return _P5_INSTANCE.strokeWeight(*args) def bezier(*args): return _P5_INSTANCE.bezier(*args) def bezierDetail(*args): return _P5_INSTANCE.bezierDetail(*args) def bezierPoint(*args): return _P5_INSTANCE.bezierPoint(*args) def bezierTangent(*args): return _P5_INSTANCE.bezierTangent(*args) def curve(*args): return _P5_INSTANCE.curve(*args) def curveDetail(*args): return _P5_INSTANCE.curveDetail(*args) def curveTightness(*args): return _P5_INSTANCE.curveTightness(*args) def curvePoint(*args): return _P5_INSTANCE.curvePoint(*args) def curveTangent(*args): return _P5_INSTANCE.curveTangent(*args) def beginContour(*args): return _P5_INSTANCE.beginContour(*args) def beginShape(*args): return _P5_INSTANCE.beginShape(*args) def bezierVertex(*args): return _P5_INSTANCE.bezierVertex(*args) def curveVertex(*args): return _P5_INSTANCE.curveVertex(*args) def endContour(*args): return _P5_INSTANCE.endContour(*args) def endShape(*args): return _P5_INSTANCE.endShape(*args) def quadraticVertex(*args): return _P5_INSTANCE.quadraticVertex(*args) def vertex(*args): return _P5_INSTANCE.vertex(*args) def cursor(*args): return _P5_INSTANCE.cursor(*args) def frameRate(*args): return _P5_INSTANCE.frameRate(*args) def noCursor(*args): return _P5_INSTANCE.noCursor(*args) def fullscreen(*args): return _P5_INSTANCE.fullscreen(*args) def pixelDensity(*args): return _P5_INSTANCE.pixelDensity(*args) def displayDensity(*args): return _P5_INSTANCE.displayDensity(*args) def getURL(*args): return _P5_INSTANCE.getURL(*args) def getURLPath(*args): return _P5_INSTANCE.getURLPath(*args) def getURLParams(*args): return _P5_INSTANCE.getURLParams(*args) def preload(*args): return _P5_INSTANCE.preload(*args) def setup(*args): return _P5_INSTANCE.setup(*args) def draw(*args): return _P5_INSTANCE.draw(*args) def remove(*args): return _P5_INSTANCE.remove(*args) def noLoop(*args): return _P5_INSTANCE.noLoop(*args) def loop(*args): return _P5_INSTANCE.loop(*args) def push(*args): return _P5_INSTANCE.push(*args) def redraw(*args): return _P5_INSTANCE.redraw(*args) def resizeCanvas(*args): return _P5_INSTANCE.resizeCanvas(*args) def noCanvas(*args): return _P5_INSTANCE.noCanvas(*args) def createGraphics(*args): return _P5_INSTANCE.createGraphics(*args) def blendMode(*args): return _P5_INSTANCE.blendMode(*args) def setAttributes(*args): return _P5_INSTANCE.setAttributes(*args) def applyMatrix(*args): return _P5_INSTANCE.applyMatrix(*args) def resetMatrix(*args): return _P5_INSTANCE.resetMatrix(*args) def rotate(*args): return _P5_INSTANCE.rotate(*args) def rotateX(*args): return _P5_INSTANCE.rotateX(*args) def rotateY(*args): return _P5_INSTANCE.rotateY(*args) def rotateZ(*args): return _P5_INSTANCE.rotateZ(*args) def scale(*args): return _P5_INSTANCE.scale(*args) def shearX(*args): return _P5_INSTANCE.shearX(*args) def shearY(*args): return _P5_INSTANCE.shearY(*args) def translate(*args): return _P5_INSTANCE.translate(*args) def createStringDict(*args): return _P5_INSTANCE.createStringDict(*args) def createNumberDict(*args): return _P5_INSTANCE.createNumberDict(*args) def append(*args): return _P5_INSTANCE.append(*args) def arrayCopy(*args): return _P5_INSTANCE.arrayCopy(*args) def concat(*args): return _P5_INSTANCE.concat(*args) def reverse(*args): return _P5_INSTANCE.reverse(*args) def shorten(*args): return _P5_INSTANCE.shorten(*args) def shuffle(*args): return _P5_INSTANCE.shuffle(*args) def sort(*args): return _P5_INSTANCE.sort(*args) def splice(*args): return _P5_INSTANCE.splice(*args) def subset(*args): return _P5_INSTANCE.subset(*args) def float(*args): return _P5_INSTANCE.float(*args) def int(*args): return _P5_INSTANCE.int(*args) def str(*args): return _P5_INSTANCE.str(*args) def boolean(*args): return _P5_INSTANCE.boolean(*args) def byte(*args): return _P5_INSTANCE.byte(*args) def char(*args): return _P5_INSTANCE.char(*args) def unchar(*args): return _P5_INSTANCE.unchar(*args) def hex(*args): return _P5_INSTANCE.hex(*args) def unhex(*args): return _P5_INSTANCE.unhex(*args) def join(*args): return _P5_INSTANCE.join(*args) def match(*args): return _P5_INSTANCE.match(*args) def matchAll(*args): return _P5_INSTANCE.matchAll(*args) def nf(*args): return _P5_INSTANCE.nf(*args) def nfc(*args): return _P5_INSTANCE.nfc(*args) def nfp(*args): return _P5_INSTANCE.nfp(*args) def nfs(*args): return _P5_INSTANCE.nfs(*args) def split(*args): return _P5_INSTANCE.split(*args) def splitTokens(*args): return _P5_INSTANCE.splitTokens(*args) def trim(*args): return _P5_INSTANCE.trim(*args) def setMoveThreshold(*args): return _P5_INSTANCE.setMoveThreshold(*args) def setShakeThreshold(*args): return _P5_INSTANCE.setShakeThreshold(*args) def keyIsDown(*args): return _P5_INSTANCE.keyIsDown(*args) def createImage(*args): return _P5_INSTANCE.createImage(*args) def saveCanvas(*args): return _P5_INSTANCE.saveCanvas(*args) def saveFrames(*args): return _P5_INSTANCE.saveFrames(*args) def image_proxy(img): """ Proxy to turn of transcypt when calling img.get/set methods """ def _set(*args): __pragma__('noalias', 'set') value = img.set(*args) __pragma__('alias', 'set', 'py_set') return value def _get(*args): __pragma__('noalias', 'get') value = img.get(*args) __pragma__('alias', 'get', 'py_get') return value img.set = _set img.get = _get return img def loadImage(*args): imageObj = _P5_INSTANCE.loadImage(*args) return image_proxy(imageObj) def image(*args): return _P5_INSTANCE.image(*args) def tint(*args): return _P5_INSTANCE.tint(*args) def noTint(*args): return _P5_INSTANCE.noTint(*args) def imageMode(*args): return _P5_INSTANCE.imageMode(*args) def blend(*args): return _P5_INSTANCE.blend(*args) def copy(*args): return _P5_INSTANCE.copy(*args) def filter(*args): if len(args) > 1 and (args[0] is None or callable(args[0])): return PythonFunctions.filter(*args) else: return _P5_INSTANCE.filter(*args) def get(*args): __pragma__('noalias', 'get') p5_get = _P5_INSTANCE.get(*args) __pragma__('alias', 'get', 'py_get') return p5_get def loadPixels(*args): return _P5_INSTANCE.loadPixels(*args) def set(*args): if len(args) <= 1: return PythonFunctions.set(*args) else: return _P5_INSTANCE.set(*args) def updatePixels(*args): return _P5_INSTANCE.updatePixels(*args) def loadJSON(*args): return _P5_INSTANCE.loadJSON(*args) def loadStrings(*args): return _P5_INSTANCE.loadStrings(*args) def loadTable(*args): return _P5_INSTANCE.loadTable(*args) def loadXML(*args): return _P5_INSTANCE.loadXML(*args) def loadBytes(*args): return _P5_INSTANCE.loadBytes(*args) def httpGet(*args): return _P5_INSTANCE.httpGet(*args) def httpPost(*args): return _P5_INSTANCE.httpPost(*args) def httpDo(*args): return _P5_INSTANCE.httpDo(*args) def createWriter(*args): return _P5_INSTANCE.createWriter(*args) def save(*args): return _P5_INSTANCE.save(*args) def saveJSON(*args): return _P5_INSTANCE.saveJSON(*args) def saveStrings(*args): return _P5_INSTANCE.saveStrings(*args) def saveTable(*args): return _P5_INSTANCE.saveTable(*args) def day(*args): return _P5_INSTANCE.day(*args) def hour(*args): return _P5_INSTANCE.hour(*args) def minute(*args): return _P5_INSTANCE.minute(*args) def millis(*args): return _P5_INSTANCE.millis(*args) def month(*args): return _P5_INSTANCE.month(*args) def second(*args): return _P5_INSTANCE.second(*args) def year(*args): return _P5_INSTANCE.year(*args) def createVector(*args): return _P5_INSTANCE.createVector(*args) def abs(*args): return _P5_INSTANCE.abs(*args) def ceil(*args): return _P5_INSTANCE.ceil(*args) def constrain(*args): return _P5_INSTANCE.constrain(*args) def dist(*args): return _P5_INSTANCE.dist(*args) def exp(*args): return _P5_INSTANCE.exp(*args) def floor(*args): return _P5_INSTANCE.floor(*args) def lerp(*args): return _P5_INSTANCE.lerp(*args) def log(*args): return _P5_INSTANCE.log(*args) def mag(*args): return _P5_INSTANCE.mag(*args) def map(*args): if len(args) > 1 and callable(args[0]): return PythonFunctions.map(*args) else: return _P5_INSTANCE.map(*args) def max(*args): return _P5_INSTANCE.max(*args) def min(*args): return _P5_INSTANCE.min(*args) def norm(*args): return _P5_INSTANCE.norm(*args) def pow(*args): return _P5_INSTANCE.pow(*args) def round(*args): return _P5_INSTANCE.round(*args) def sq(*args): return _P5_INSTANCE.sq(*args) def sqrt(*args): return _P5_INSTANCE.sqrt(*args) def noise(*args): return _P5_INSTANCE.noise(*args) def noiseDetail(*args): return _P5_INSTANCE.noiseDetail(*args) def noiseSeed(*args): return _P5_INSTANCE.noiseSeed(*args) def randomSeed(*args): return _P5_INSTANCE.randomSeed(*args) def random(*args): return _P5_INSTANCE.random(*args) def randomGaussian(*args): return _P5_INSTANCE.randomGaussian(*args) def acos(*args): return _P5_INSTANCE.acos(*args) def asin(*args): return _P5_INSTANCE.asin(*args) def atan(*args): return _P5_INSTANCE.atan(*args) def atan2(*args): return _P5_INSTANCE.atan2(*args) def cos(*args): return _P5_INSTANCE.cos(*args) def sin(*args): return _P5_INSTANCE.sin(*args) def tan(*args): return _P5_INSTANCE.tan(*args) def degrees(*args): return _P5_INSTANCE.degrees(*args) def radians(*args): return _P5_INSTANCE.radians(*args) def angleMode(*args): return _P5_INSTANCE.angleMode(*args) def textAlign(*args): return _P5_INSTANCE.textAlign(*args) def textLeading(*args): return _P5_INSTANCE.textLeading(*args) def textSize(*args): return _P5_INSTANCE.textSize(*args) def textStyle(*args): return _P5_INSTANCE.textStyle(*args) def textWidth(*args): return _P5_INSTANCE.textWidth(*args) def textAscent(*args): return _P5_INSTANCE.textAscent(*args) def textDescent(*args): return _P5_INSTANCE.textDescent(*args) def loadFont(*args): return _P5_INSTANCE.loadFont(*args) def text(*args): return _P5_INSTANCE.text(*args) def textFont(*args): return _P5_INSTANCE.textFont(*args) def orbitControl(*args): return _P5_INSTANCE.orbitControl(*args) def debugMode(*args): return _P5_INSTANCE.debugMode(*args) def noDebugMode(*args): return _P5_INSTANCE.noDebugMode(*args) def ambientLight(*args): return _P5_INSTANCE.ambientLight(*args) def directionalLight(*args): return _P5_INSTANCE.directionalLight(*args) def pointLight(*args): return _P5_INSTANCE.pointLight(*args) def lights(*args): return _P5_INSTANCE.lights(*args) def loadShader(*args): return _P5_INSTANCE.loadShader(*args) def createShader(*args): return _P5_INSTANCE.createShader(*args) def shader(*args): return _P5_INSTANCE.shader(*args) def resetShader(*args): return _P5_INSTANCE.resetShader(*args) def normalMaterial(*args): return _P5_INSTANCE.normalMaterial(*args) def texture(*args): return _P5_INSTANCE.texture(*args) def textureMode(*args): return _P5_INSTANCE.textureMode(*args) def textureWrap(*args): return _P5_INSTANCE.textureWrap(*args) def ambientMaterial(*args): return _P5_INSTANCE.ambientMaterial(*args) def specularMaterial(*args): return _P5_INSTANCE.specularMaterial(*args) def shininess(*args): return _P5_INSTANCE.shininess(*args) def camera(*args): return _P5_INSTANCE.camera(*args) def perspective(*args): return _P5_INSTANCE.perspective(*args) def ortho(*args): return _P5_INSTANCE.ortho(*args) def createCamera(*args): return _P5_INSTANCE.createCamera(*args) def setCamera(*args): return _P5_INSTANCE.setCamera(*args) def select(*args): return _P5_INSTANCE.select(*args) def selectAll(*args): return _P5_INSTANCE.selectAll(*args) def removeElements(*args): return _P5_INSTANCE.removeElements(*args) def changed(*args): return _P5_INSTANCE.changed(*args) def input(*args): return _P5_INSTANCE.input(*args) def createDiv(*args): return _P5_INSTANCE.createDiv(*args) def createP(*args): return _P5_INSTANCE.createP(*args) def createSpan(*args): return _P5_INSTANCE.createSpan(*args) def createImg(*args): return _P5_INSTANCE.createImg(*args) def createA(*args): return _P5_INSTANCE.createA(*args) def createSlider(*args): return _P5_INSTANCE.createSlider(*args) def createButton(*args): return _P5_INSTANCE.createButton(*args) def createCheckbox(*args): return _P5_INSTANCE.createCheckbox(*args) def createSelect(*args): return _P5_INSTANCE.createSelect(*args) def createRadio(*args): return _P5_INSTANCE.createRadio(*args) def createColorPicker(*args): return _P5_INSTANCE.createColorPicker(*args) def createInput(*args): return _P5_INSTANCE.createInput(*args) def createFileInput(*args): return _P5_INSTANCE.createFileInput(*args) def createVideo(*args): return _P5_INSTANCE.createVideo(*args) def createAudio(*args): return _P5_INSTANCE.createAudio(*args) def createCapture(*args): return _P5_INSTANCE.createCapture(*args) def createElement(*args): return _P5_INSTANCE.createElement(*args) def createCanvas(*args): canvas = _P5_INSTANCE.createCanvas(*args) global width, height width = _P5_INSTANCE.width height = _P5_INSTANCE.height return canvas def pop(*args): __pragma__('noalias', 'pop') p5_pop = _P5_INSTANCE.pop(*args) __pragma__('alias', 'pop', 'py_pop') return p5_pop # Processing Python or Java mode compatibility aliases size = createCanvas popMatrix = pop popStyle = pop pushMatrix = push pushStyle = push # PVector is a helper/alias to create p5.Vector objects def PVector(x=0, y=0, z=0): return _P5_INSTANCE.createVector(x, y, z) # aliases for p5.Vector class methods setattr(PVector, 'dist', p5.Vector.dist) setattr(PVector, 'add', p5.Vector.add) setattr(PVector, 'sub', p5.Vector.sub) setattr(PVector, 'mult', p5.Vector.mult) setattr(PVector, 'div', p5.Vector.div) setattr(PVector, 'dot', p5.Vector.dot) setattr(PVector, 'cross', p5.Vector.cross) setattr(PVector, 'lerp', p5.Vector.lerp) setattr(PVector, 'random2D', p5.Vector.random2D) setattr(PVector, 'random3D', p5.Vector.random3D) setattr(PVector, 'angleBetween', p5.Vector.angleBetween) setattr(PVector, 'fromAngle', p5.Vector.fromAngle) setattr(PVector, 'fromAngles', p5.Vector.fromAngles) setattr(PVector, 'equals', p5.Vector.equals) def pre_draw(p5_instance, draw_func): """ We need to run this before the actual draw to insert and update p5 env variables """ global _CTX_MIDDLE, _DEFAULT_FILL, _DEFAULT_LEADMULT, _DEFAULT_STROKE, _DEFAULT_TEXT_FILL global ADD, ALT, ARROW, AUTO, AUDIO, AXES, BACKSPACE, BASELINE, BEVEL, BEZIER, BLEND, BLUR, BOLD, BOLDITALIC global BOTTOM, BURN, CENTER, CHORD, CLAMP, CLOSE, CONTROL, CORNER, CORNERS, CROSS, CURVE, DARKEST global DEG_TO_RAD, DEGREES, DELETE, DIFFERENCE, DILATE, DODGE, DOWN_ARROW, ENTER, ERODE, ESCAPE, EXCLUSION global FILL, GRAY, GRID, HALF_PI, HAND, HARD_LIGHT, HSB, HSL, IMAGE, IMMEDIATE, INVERT, ITALIC, LANDSCAPE global LEFT, LEFT_ARROW, LIGHTEST, LINE_LOOP, LINE_STRIP, LINEAR, LINES, MIRROR, MITER, MOVE, MULTIPLY, NEAREST global NORMAL, OPAQUE, OPEN, OPTION, OVERLAY, P2D, PI, PIE, POINTS, PORTRAIT, POSTERIZE, PROJECT, QUAD_STRIP, QUADRATIC global QUADS, QUARTER_PI, RAD_TO_DEG, RADIANS, RADIUS, REPEAT, REPLACE, RETURN, RGB, RIGHT, RIGHT_ARROW global ROUND, SCREEN, SHIFT, SOFT_LIGHT, SQUARE, STROKE, SUBTRACT, TAB, TAU, TEXT, TEXTURE, THRESHOLD, TOP global TRIANGLE_FAN, TRIANGLE_STRIP, TRIANGLES, TWO_PI, UP_ARROW, VIDEO, WAIT, WEBGL global frameCount, focused, displayWidth, displayHeight, windowWidth, windowHeight, width, height global disableFriendlyErrors, deviceOrientation, accelerationX, accelerationY, accelerationZ global pAccelerationX, pAccelerationY, pAccelerationZ, rotationX, rotationY, rotationZ global pRotationX, pRotationY, pRotationZ, turnAxis, keyIsPressed, key, keyCode, mouseX, mouseY, pmouseX, pmouseY global winMouseX, winMouseY, pwinMouseX, pwinMouseY, mouseButton, mouseIsPressed, touches, pixels _CTX_MIDDLE = p5_instance._CTX_MIDDLE _DEFAULT_FILL = p5_instance._DEFAULT_FILL _DEFAULT_LEADMULT = p5_instance._DEFAULT_LEADMULT _DEFAULT_STROKE = p5_instance._DEFAULT_STROKE _DEFAULT_TEXT_FILL = p5_instance._DEFAULT_TEXT_FILL ADD = p5_instance.ADD ALT = p5_instance.ALT ARROW = p5_instance.ARROW AUDIO = p5_instance.AUDIO AUTO = p5_instance.AUTO AXES = p5_instance.AXES BACKSPACE = p5_instance.BACKSPACE BASELINE = p5_instance.BASELINE BEVEL = p5_instance.BEVEL BEZIER = p5_instance.BEZIER BLEND = p5_instance.BLEND BLUR = p5_instance.BLUR BOLD = p5_instance.BOLD BOLDITALIC = p5_instance.BOLDITALIC BOTTOM = p5_instance.BOTTOM BURN = p5_instance.BURN CENTER = p5_instance.CENTER CHORD = p5_instance.CHORD CLAMP = p5_instance.CLAMP CLOSE = p5_instance.CLOSE CONTROL = p5_instance.CONTROL CORNER = p5_instance.CORNER CORNERS = p5_instance.CORNERS CROSS = p5_instance.CROSS CURVE = p5_instance.CURVE DARKEST = p5_instance.DARKEST DEG_TO_RAD = p5_instance.DEG_TO_RAD DEGREES = p5_instance.DEGREES DELETE = p5_instance.DELETE DIFFERENCE = p5_instance.DIFFERENCE DILATE = p5_instance.DILATE DODGE = p5_instance.DODGE DOWN_ARROW = p5_instance.DOWN_ARROW ENTER = p5_instance.ENTER ERODE = p5_instance.ERODE ESCAPE = p5_instance.ESCAPE EXCLUSION = p5_instance.EXCLUSION FILL = p5_instance.FILL GRAY = p5_instance.GRAY GRID = p5_instance.GRID HALF_PI = p5_instance.HALF_PI HAND = p5_instance.HAND HARD_LIGHT = p5_instance.HARD_LIGHT HSB = p5_instance.HSB HSL = p5_instance.HSL IMAGE = p5_instance.IMAGE IMMEDIATE = p5_instance.IMMEDIATE INVERT = p5_instance.INVERT ITALIC = p5_instance.ITALIC LANDSCAPE = p5_instance.LANDSCAPE LEFT = p5_instance.LEFT LEFT_ARROW = p5_instance.LEFT_ARROW LIGHTEST = p5_instance.LIGHTEST LINE_LOOP = p5_instance.LINE_LOOP LINE_STRIP = p5_instance.LINE_STRIP LINEAR = p5_instance.LINEAR LINES = p5_instance.LINES MIRROR = p5_instance.MIRROR MITER = p5_instance.MITER MOVE = p5_instance.MOVE MULTIPLY = p5_instance.MULTIPLY NEAREST = p5_instance.NEAREST NORMAL = p5_instance.NORMAL OPAQUE = p5_instance.OPAQUE OPEN = p5_instance.OPEN OPTION = p5_instance.OPTION OVERLAY = p5_instance.OVERLAY P2D = p5_instance.P2D P3D = p5_instance.WEBGL PI = p5_instance.PI PIE = p5_instance.PIE POINTS = p5_instance.POINTS PORTRAIT = p5_instance.PORTRAIT POSTERIZE = p5_instance.POSTERIZE PROJECT = p5_instance.PROJECT QUAD_STRIP = p5_instance.QUAD_STRIP QUADRATIC = p5_instance.QUADRATIC QUADS = p5_instance.QUADS QUARTER_PI = p5_instance.QUARTER_PI RAD_TO_DEG = p5_instance.RAD_TO_DEG RADIANS = p5_instance.RADIANS RADIUS = p5_instance.RADIUS REPEAT = p5_instance.REPEAT REPLACE = p5_instance.REPLACE RETURN = p5_instance.RETURN RGB = p5_instance.RGB RIGHT = p5_instance.RIGHT RIGHT_ARROW = p5_instance.RIGHT_ARROW ROUND = p5_instance.ROUND SCREEN = p5_instance.SCREEN SHIFT = p5_instance.SHIFT SOFT_LIGHT = p5_instance.SOFT_LIGHT SQUARE = p5_instance.SQUARE STROKE = p5_instance.STROKE SUBTRACT = p5_instance.SUBTRACT TAB = p5_instance.TAB TAU = p5_instance.TAU TEXT = p5_instance.TEXT TEXTURE = p5_instance.TEXTURE THRESHOLD = p5_instance.THRESHOLD TOP = p5_instance.TOP TRIANGLE_FAN = p5_instance.TRIANGLE_FAN TRIANGLE_STRIP = p5_instance.TRIANGLE_STRIP TRIANGLES = p5_instance.TRIANGLES TWO_PI = p5_instance.TWO_PI UP_ARROW = p5_instance.UP_ARROW VIDEO = p5_instance.VIDEO WAIT = p5_instance.WAIT WEBGL = p5_instance.WEBGL frameCount = p5_instance.frameCount focused = p5_instance.focused displayWidth = p5_instance.displayWidth displayHeight = p5_instance.displayHeight windowWidth = p5_instance.windowWidth windowHeight = p5_instance.windowHeight width = p5_instance.width height = p5_instance.height disableFriendlyErrors = p5_instance.disableFriendlyErrors deviceOrientation = p5_instance.deviceOrientation accelerationX = p5_instance.accelerationX accelerationY = p5_instance.accelerationY accelerationZ = p5_instance.accelerationZ pAccelerationX = p5_instance.pAccelerationX pAccelerationY = p5_instance.pAccelerationY pAccelerationZ = p5_instance.pAccelerationZ rotationX = p5_instance.rotationX rotationY = p5_instance.rotationY rotationZ = p5_instance.rotationZ pRotationX = p5_instance.pRotationX pRotationY = p5_instance.pRotationY pRotationZ = p5_instance.pRotationZ turnAxis = p5_instance.turnAxis keyIsPressed = p5_instance.keyIsPressed key = p5_instance.key keyCode = p5_instance.keyCode mouseX = p5_instance.mouseX mouseY = p5_instance.mouseY pmouseX = p5_instance.pmouseX pmouseY = p5_instance.pmouseY winMouseX = p5_instance.winMouseX winMouseY = p5_instance.winMouseY pwinMouseX = p5_instance.pwinMouseX pwinMouseY = p5_instance.pwinMouseY mouseButton = p5_instance.mouseButton mouseIsPressed = p5_instance.mouseIsPressed touches = p5_instance.touches pixels = p5_instance.pixels return draw_func() def global_p5_injection(p5_sketch): """ Injects the p5js's skecth instance as a global variable to setup and draw functions """ def decorator(f): def wrapper(): global _P5_INSTANCE _P5_INSTANCE = p5_sketch return pre_draw(_P5_INSTANCE, f) return wrapper return decorator def start_p5(preload_func, setup_func, draw_func, event_functions): """ This is the entrypoint function. It accepts 2 parameters: - preload_func: a Python preload callable - setup_func: a Python setup callable - draw_func: a Python draw callable - event_functions: a config dict for the event functions in the format: {"eventFunctionName": python_event_function} This method gets the p5js's sketch instance and injects them """ def sketch_setup(p5_sketch): p5_sketch.preload = global_p5_injection(p5_sketch)(preload_func) p5_sketch.setup = global_p5_injection(p5_sketch)(setup_func) p5_sketch.draw = global_p5_injection(p5_sketch)(draw_func) instance = __new__(p5(sketch_setup, 'sketch-holder')) # inject event functions into p5 event_function_names = ( "deviceMoved", "deviceTurned", "deviceShaken", "windowResized", "keyPressed", "keyReleased", "keyTyped", "mousePressed", "mouseReleased", "mouseClicked", "doubleClicked", "mouseMoved", "mouseDragged", "mouseWheel", "touchStarted", "touchMoved", "touchEnded", "keyIsDown" ) for f_name in [f for f in event_function_names if event_functions.get(f, None)]: func = event_functions[f_name] event_func = global_p5_injection(instance)(func) setattr(instance, f_name, event_func) def logOnloaded(): console.log("Lib loaded!") def add_library(lib_name): # placeholder for https://github.com/berinhard/pyp5js/issues/31 src = '' return console.log("Lib name is not valid:", lib_name) console.log("Importing:", src) script = document.createElement("script") script.onload = logOnloaded script.src = src document.head.appendChild(script) ================================================ FILE: docs/examples/transcrypt/sketch_009/target/python_functions.js ================================================ // Transcrypt'ed from Python, 2021-11-02 13:06:18 import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, abs, all, any, assert, bool, bytearray, bytes, callable, chr, copy, deepcopy, delattr, dict, dir, divmod, enumerate, filter, float, getattr, hasattr, input, int, isinstance, issubclass, len, list, map, max, min, object, ord, pow, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, round, set, setattr, sorted, str, sum, tuple, zip} from './org.transcrypt.__runtime__.js'; var __name__ = 'python_functions'; export var PythonFunctions = __class__ ('PythonFunctions', [object], { __module__: __name__, }); setattr (PythonFunctions, 'map', map); setattr (PythonFunctions, 'filter', filter); setattr (PythonFunctions, 'set', set); //# sourceMappingURL=python_functions.map ================================================ FILE: docs/examples/transcrypt/sketch_009/target/python_functions.py ================================================ class PythonFunctions: pass setattr(PythonFunctions, 'map', map) setattr(PythonFunctions, 'filter', filter) setattr(PythonFunctions, 'set', set) ================================================ FILE: docs/examples/transcrypt/sketch_009/target/random.js ================================================ // Transcrypt'ed from Python, 2021-11-02 13:06:17 var math = {}; import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, abs, all, any, assert, bool, bytearray, bytes, callable, chr, copy, deepcopy, delattr, dict, dir, divmod, enumerate, filter, float, getattr, hasattr, input, int, isinstance, issubclass, len, list, map, max, min, object, ord, pow, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, round, set, setattr, sorted, str, sum, tuple, zip} from './org.transcrypt.__runtime__.js'; import * as __module_math__ from './math.js'; __nest__ (math, '', __module_math__); var __name__ = 'random'; export var _array = (function () { var __accu0__ = []; for (var i = 0; i < 624; i++) { __accu0__.append (0); } return __accu0__; }) (); export var _index = 0; export var _bitmask1 = Math.pow (2, 32) - 1; export var _bitmask2 = Math.pow (2, 31); export var _bitmask3 = Math.pow (2, 31) - 1; export var _fill_array = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } } else { } for (var i = 0; i < 624; i++) { var y = (_array [i] & _bitmask2) + (_array [__mod__ (i + 1, 624)] & _bitmask3); _array [i] = _array [__mod__ (i + 397, 624)] ^ y >> 1; if (__mod__ (y, 2) != 0) { _array [i] ^= 2567483615; } } }; export var _random_integer = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } } else { } if (_index == 0) { _fill_array (); } var y = _array [_index]; y ^= y >> 11; y ^= y << 7 & 2636928640; y ^= y << 15 & 4022730752; y ^= y >> 18; _index = __mod__ (_index + 1, 624); return y; }; export var seed = function (x) { if (typeof x == 'undefined' || (x != null && x.hasOwnProperty ("__kwargtrans__"))) {; var x = int (_bitmask3 * Math.random ()); }; if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'x': var x = __allkwargs0__ [__attrib0__]; break; } } } } else { } _array [0] = x; for (var i = 1; i < 624; i++) { _array [i] = (1812433253 * _array [i - 1] ^ (_array [i - 1] >> 30) + i) & _bitmask1; } }; export var randint = function (a, b) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'a': var a = __allkwargs0__ [__attrib0__]; break; case 'b': var b = __allkwargs0__ [__attrib0__]; break; } } } } else { } return a + __mod__ (_random_integer (), (b - a) + 1); }; export var choice = function (seq) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'seq': var seq = __allkwargs0__ [__attrib0__]; break; } } } } else { } return seq [randint (0, len (seq) - 1)]; }; export var random = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } } else { } return _random_integer () / _bitmask3; }; export var shuffle = function (x) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'x': var x = __allkwargs0__ [__attrib0__]; break; } } } } else { } for (var i = len (x) - 1; i > 0; i--) { var j = math.floor (random () * (i + 1)); var temp = x [i]; x [i] = x [j]; x [j] = temp; } }; seed (); //# sourceMappingURL=random.map ================================================ FILE: docs/examples/transcrypt/sketch_009/target/random.py ================================================ # Mersenne-Twister random number algorithm import math _array = [0 for i in range (624)] _index = 0 _bitmask1 = (2 ** 32) - 1 _bitmask2 = 2 ** 31 _bitmask3 = (2 ** 31) - 1 def _fill_array(): global _array for i in range (624): y = (_array [i] & _bitmask2) + (_array [(i + 1) % 624] & _bitmask3) _array [i] = _array [(i + 397) % 624] ^ (y >> 1) if y % 2 != 0: _array[i] ^= 2567483615 def _random_integer (): global _index global _array if _index == 0: _fill_array () y = _array [_index] y ^= y >> 11 y ^= (y << 7) & 2636928640 y ^= (y << 15) & 4022730752 y ^= y >> 18 _index = (_index + 1) % 624 return y def seed (x = int (_bitmask3 * Math.random ())): global _array global _bitmask1 _array [0] = x for i in range (1, 624): _array [i] = ((1812433253 * _array [i - 1]) ^ ((_array [i - 1] >> 30) + i)) & _bitmask1 def randint (a, b): return a + _random_integer () % (b - a + 1) def choice (seq): return seq [randint (0, len (seq) - 1)] def random (): return _random_integer () / _bitmask3 def shuffle (x): # Fisher-Yates unbiased shuffle for i in range (len (x) - 1, 0, -1): j = math.floor (random () * (i + 1)) temp = x [i] x [i] = x [j] x [j] = temp seed () ================================================ FILE: docs/examples/transcrypt/sketch_009/target/target_sketch.js ================================================ // Transcrypt'ed from Python, 2021-11-02 13:06:17 import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, all, any, assert, bool, bytearray, bytes, callable, chr, deepcopy, delattr, dict, dir, divmod, enumerate, getattr, hasattr, isinstance, issubclass, len, list, object, ord, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, set, setattr, sorted, sum, tuple, zip} from './org.transcrypt.__runtime__.js'; import {choice} from './random.js'; import {ADD, ALT, ARROW, AUDIO, AUTO, AXES, BACKSPACE, BASELINE, BEVEL, BEZIER, BLEND, BLUR, BOLD, BOLDITALIC, BOTTOM, BURN, CENTER, CHORD, CLAMP, CLOSE, CONTROL, CORNER, CORNERS, CROSS, CURVE, DARKEST, DEGREES, DEG_TO_RAD, DELETE, DIFFERENCE, DILATE, DODGE, DOWN_ARROW, ENTER, ERODE, ESCAPE, EXCLUSION, FILL, GRAY, GRID, HALF_PI, HAND, HARD_LIGHT, HSB, HSL, IMAGE, IMMEDIATE, INVERT, ITALIC, LANDSCAPE, LEFT, LEFT_ARROW, LIGHTEST, LINEAR, LINES, LINE_LOOP, LINE_STRIP, MIRROR, MITER, MOVE, MULTIPLY, NEAREST, NORMAL, OPAQUE, OPEN, OPTION, OVERLAY, P2D, PI, PIE, POINTS, PORTRAIT, POSTERIZE, PROJECT, PVector, QUADRATIC, QUADS, QUAD_STRIP, QUARTER_PI, RADIANS, RADIUS, RAD_TO_DEG, REPEAT, REPLACE, RETURN, RGB, RIGHT, RIGHT_ARROW, ROUND, SCREEN, SHIFT, SOFT_LIGHT, SQUARE, STROKE, SUBTRACT, TAB, TAU, TEXT, TEXTURE, THRESHOLD, TOP, TRIANGLES, TRIANGLE_FAN, TRIANGLE_STRIP, TWO_PI, UP_ARROW, VIDEO, WAIT, WEBGL, _CTX_MIDDLE, _DEFAULT_FILL, _DEFAULT_LEADMULT, _DEFAULT_STROKE, _DEFAULT_TEXT_FILL, _P5_INSTANCE, abs, accelerationX, accelerationY, accelerationZ, acos, add_library, alpha, ambientLight, ambientMaterial, angleMode, append, applyMatrix, arc, arrayCopy, asin, atan, atan2, background, beginContour, beginShape, bezier, bezierDetail, bezierPoint, bezierTangent, bezierVertex, blend, blendMode, blue, boolean, box, brightness, byte, camera, ceil, changed, char, circle, color, colorMode, concat, cone, constrain, copy, cos, createA, createAudio, createButton, createCamera, createCanvas, createCapture, createCheckbox, createColorPicker, createDiv, createElement, createFileInput, createGraphics, createImage, createImg, createInput, createNumberDict, createP, createRadio, createSelect, createShader, createSlider, createSpan, createStringDict, createVector, createVideo, createWriter, cursor, curve, curveDetail, curvePoint, curveTangent, curveTightness, curveVertex, cylinder, day, debugMode, degrees, deviceOrientation, directionalLight, disableFriendlyErrors, displayDensity, displayHeight, displayWidth, dist, ellipse, ellipseMode, ellipsoid, endContour, endShape, erase, exp, fill, filter, float, floor, focused, frameCount, frameRate, fullscreen, getURL, getURLParams, getURLPath, global_p5_injection, green, height, hex, hour, httpDo, httpGet, httpPost, hue, image, imageMode, image_proxy, input, int, join, key, keyCode, keyIsPressed, lerp, lerpColor, lightness, lights, line, loadBytes, loadFont, loadImage, loadJSON, loadModel, loadPixels, loadShader, loadStrings, loadTable, loadXML, log, logOnloaded, loop, mag, map, match, matchAll, max, millis, min, minute, model, month, mouseButton, mouseIsPressed, mouseX, mouseY, nf, nfc, nfp, nfs, noCanvas, noCursor, noDebugMode, noErase, noFill, noLoop, noSmooth, noStroke, noTint, noise, noiseDetail, noiseSeed, norm, normalMaterial, orbitControl, ortho, pAccelerationX, pAccelerationY, pAccelerationZ, pRotationX, pRotationY, pRotationZ, perspective, pixelDensity, pixels, plane, pmouseX, pmouseY, point, pointLight, popMatrix, popStyle, pow, pre_draw, push, pushMatrix, pushStyle, pwinMouseX, pwinMouseY, py_clear, py_get, py_pop, py_set, py_sort, py_split, quad, quadraticVertex, radians, random, randomGaussian, randomSeed, rect, rectMode, red, redraw, remove, removeElements, resetMatrix, resetShader, resizeCanvas, reverse, rotate, rotateX, rotateY, rotateZ, rotationX, rotationY, rotationZ, round, saturation, save, saveCanvas, saveFrames, saveJSON, saveStrings, saveTable, scale, second, select, selectAll, setAttributes, setCamera, setMoveThreshold, setShakeThreshold, shader, shearX, shearY, shininess, shorten, shuffle, sin, size, smooth, specularMaterial, sphere, splice, splitTokens, sq, sqrt, square, start_p5, str, stroke, strokeCap, strokeJoin, strokeWeight, subset, tan, text, textAlign, textAscent, textDescent, textFont, textLeading, textSize, textStyle, textWidth, texture, textureMode, textureWrap, tint, torus, touches, translate, triangle, trim, turnAxis, unchar, unhex, updatePixels, vertex, width, winMouseX, winMouseY, windowHeight, windowWidth, year} from './pyp5js.js'; var __name__ = '__main__'; export var preload = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } } else { } // pass; }; export var setup = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } } else { } // pass; }; export var draw = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } } else { } // pass; }; export var deviceMoved = null; export var deviceTurned = null; export var deviceShaken = null; export var keyPressed = null; export var keyReleased = null; export var keyTyped = null; export var mouseMoved = null; export var mouseDragged = null; export var mousePressed = null; export var mouseReleased = null; export var mouseClicked = null; export var doubleClicked = null; export var mouseWheel = null; export var touchStarted = null; export var touchMoved = null; export var touchEnded = null; export var windowResized = null; export var keyIsDown = null; export var images = []; var setup = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } } else { } createP ('Click to add a new image'); createCanvas (600, 600); background (200); images = [loadImage ('smile.png'), loadImage ('alien.png'), loadImage ('rainbow.png')]; }; var mousePressed = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } } else { } var __left0__ = tuple ([mouseX, mouseY]); var x = __left0__ [0]; var y = __left0__ [1]; var img = choice (images); image (img, x, y); }; var draw = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } } else { } // pass; }; export var event_functions = dict ({'deviceMoved': deviceMoved, 'deviceTurned': deviceTurned, 'deviceShaken': deviceShaken, 'keyPressed': keyPressed, 'keyReleased': keyReleased, 'keyTyped': keyTyped, 'mouseMoved': mouseMoved, 'mouseDragged': mouseDragged, 'mousePressed': mousePressed, 'mouseReleased': mouseReleased, 'mouseClicked': mouseClicked, 'doubleClicked': doubleClicked, 'mouseWheel': mouseWheel, 'touchStarted': touchStarted, 'touchMoved': touchMoved, 'touchEnded': touchEnded, 'windowResized': windowResized, 'keyIsDown': keyIsDown}); start_p5 (preload, setup, draw, event_functions); //# sourceMappingURL=target_sketch.map ================================================ FILE: docs/examples/transcrypt/sketch_009/target/target_sketch.project ================================================ {"options": {"source": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_009/target_sketch.py", "anno": false, "alimod": false, "build": true, "complex": false, "docat": false, "dassert": false, "dcheck": false, "dextex": false, "dlog": false, "dmap": false, "dnostrip": false, "dstat": false, "dtree": false, "esv": null, "ecom": false, "fcall": false, "gen": false, "iconv": false, "jscall": false, "jskeys": false, "jsmod": false, "kwargs": true, "keycheck": false, "license": false, "map": true, "nomin": true, "opov": false, "outdir": null, "parent": null, "run": false, "symbols": null, "sform": false, "tconv": false, "unit": null, "verbose": false, "x": null, "xreex": false, "xglobs": false, "xpath": "/home/bernardo/envs/pyp5js/pyp5js/templates/transcrypt", "xtiny": false, "star": false}, "modules": [{"source": "/home/bernardo/.pyenv/versions/pyp5js/lib/python3.8/site-packages/transcrypt/modules/org/transcrypt/__runtime__.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_009/__target__/org.transcrypt.__runtime__.js"}, {"source": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_009/target_sketch.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_009/__target__/target_sketch.js"}, {"source": "/home/bernardo/.pyenv/versions/pyp5js/lib/python3.8/site-packages/transcrypt/modules/random/__init__.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_009/__target__/random.js"}, {"source": "/home/bernardo/.pyenv/versions/pyp5js/lib/python3.8/site-packages/transcrypt/modules/math/__init__.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_009/__target__/math.js"}, {"source": "/home/bernardo/envs/pyp5js/pyp5js/templates/transcrypt/pyp5js.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_009/__target__/pyp5js.js"}, {"source": "/home/bernardo/envs/pyp5js/pyp5js/templates/transcrypt/python_functions.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_009/__target__/python_functions.js"}]} ================================================ FILE: docs/examples/transcrypt/sketch_009/target/target_sketch.py ================================================ from pyp5js import * def preload(): pass def setup(): pass def draw(): pass deviceMoved = None deviceTurned = None deviceShaken = None keyPressed = None keyReleased = None keyTyped = None mouseMoved = None mouseDragged = None mousePressed = None mouseReleased = None mouseClicked = None doubleClicked = None mouseWheel = None touchStarted = None touchMoved = None touchEnded = None windowResized = None keyIsDown = None from random import choice images = [] def setup(): global images createP("Click to add a new image") createCanvas(600, 600) background(200) images = [ loadImage('smile.png'), loadImage('alien.png'), loadImage('rainbow.png'), ] def mousePressed(): x, y = mouseX, mouseY img = choice(images) image(img, x, y) def draw(): pass event_functions = { "deviceMoved": deviceMoved, "deviceTurned": deviceTurned, "deviceShaken": deviceShaken, "keyPressed": keyPressed, "keyReleased": keyReleased, "keyTyped": keyTyped, "mouseMoved": mouseMoved, "mouseDragged": mouseDragged, "mousePressed": mousePressed, "mouseReleased": mouseReleased, "mouseClicked": mouseClicked, "doubleClicked": doubleClicked, "mouseWheel": mouseWheel, "touchStarted": touchStarted, "touchMoved": touchMoved, "touchEnded": touchEnded, "windowResized": windowResized, "keyIsDown": keyIsDown, } start_p5(preload, setup, draw, event_functions) ================================================ FILE: docs/examples/transcrypt/sketch_010/index.html ================================================ sketch_010 - pyp5js (using Transcrypt)

Python code here.

             
MY_POINTS = [
    (100, 50),
    (300, 100),
    (200, 300),
    (100, 300),
]
FRAME_IDX = 0
POINT_SIZE = 10
CNV = None

def setup():
    global CNV
    CNV = createCanvas(400, 400)

    BUTTON_PREV = createButton('Previous frame')
    BUTTON_PREV.position(CNV.position().x,
                         CNV.height + CNV.position().y)
    BUTTON_PREV.mousePressed(prev_frame)

    BUTTON_NEXT = createButton('Next frame')
    BUTTON_NEXT.position(CNV.position().x + BUTTON_PREV.size().width,
                         BUTTON_PREV.position().y)
    BUTTON_NEXT.mousePressed(next_frame)

    background(190)
    draw_labels(MY_POINTS)

def draw():
    background(190)
    draw_closed_curve_vertex(MY_POINTS, FRAME_IDX)
    draw_labels(MY_POINTS)

def mouseClicked():
    global FRAME_IDX
    global MY_POINTS
    if is_point_in_canvas(mouseX, mouseY):
        i = get_point_index(mouseX, mouseY)
        if i != None:
            MY_POINTS.pop(i)
            if FRAME_IDX >= len(MY_POINTS):
                # cap i if it exceeds maximum length now.
                FRAME_IDX = len(MY_POINTS) - 1
        else:
            MY_POINTS.append((mouseX, mouseY))

def get_point_index(x, y):
    for idx, (p_x,p_y) in enumerate(MY_POINTS):
        if (p_x - POINT_SIZE < x and x < p_x + POINT_SIZE) and \
           (p_y - POINT_SIZE < y and y < p_y + POINT_SIZE):
            return idx

def is_point_in_canvas(x, y):
    if (x < 0 or x > CNV.width) or \
       (y < 0 or y > CNV.height):
        return False
    return True

def next_frame():
    global FRAME_IDX
    if FRAME_IDX < len(MY_POINTS) - 1:
        FRAME_IDX += 1

def prev_frame():
    global FRAME_IDX
    if FRAME_IDX > 0:
        FRAME_IDX -= 1

def draw_closed_curve_vertex(points, max_idx):
    if len(points) < 2:
        return
    used_points = []
    beginShape()

    # start by using the last point as the initial control point
    idx = len(points) - 1
    curveVertex(*points[idx])
    used_points.append(idx)

    # add each point to the curve
    for idx,p in enumerate(points):
        if idx > max_idx:
            break
        curveVertex(*p)
        used_points.append(idx)

    # to close the curve, we need to create the last curve.
    # for that, we must go to the first point
    idx = 0
    curveVertex(*points[idx])
    used_points.append(idx)

    # and use the next point as a control point.
    idx = 1
    curveVertex(*points[idx])
    used_points.append(idx)
    endShape()

    textSize(10)
    noStroke()
    text('Points used to draw this curve (first and last are control points only)', 5, CNV.height - 30)

    textSize(20)
    text(', '.join(used_points), 10, CNV.height - 10)
    stroke(0)

    for i in range(len(used_points) - 1):
        draw_dotted_line(points[used_points[i]],
                         points[used_points[i + 1]])

def draw_labels(points):
    strokeWeight(POINT_SIZE)
    for idx, p in enumerate(points):
        ts = 32
        textSize(ts)
        textY = p[1] - ts / 2

        if p[1] > CNV.height / 2:
            textY = p[1] + ts

        noStroke()
        text(idx, p[0], textY)
        stroke(0)
        point(*p)

    strokeWeight(1)

def draw_dotted_line(p1, p2):
    stroke(100)
    strokeWeight(3)
    for i in range(11):
        x = lerp(p1[0], p2[0], i/10)
        y = lerp(p1[1], p2[1], i/10)
        point(x, y)

    stroke(0)
    strokeWeight(1)

              
          
================================================ FILE: docs/examples/transcrypt/sketch_010/sketch_010.py ================================================ MY_POINTS = [ (100, 50), (300, 100), (200, 300), (100, 300), ] FRAME_IDX = 0 POINT_SIZE = 10 CNV = None def setup(): global CNV CNV = createCanvas(400, 400) BUTTON_PREV = createButton('Previous frame') BUTTON_PREV.position(CNV.position().x, CNV.height + CNV.position().y) BUTTON_PREV.mousePressed(prev_frame) BUTTON_NEXT = createButton('Next frame') BUTTON_NEXT.position(CNV.position().x + BUTTON_PREV.size().width, BUTTON_PREV.position().y) BUTTON_NEXT.mousePressed(next_frame) background(190) draw_labels(MY_POINTS) def draw(): background(190) draw_closed_curve_vertex(MY_POINTS, FRAME_IDX) draw_labels(MY_POINTS) def mouseClicked(): global FRAME_IDX global MY_POINTS if is_point_in_canvas(mouseX, mouseY): i = get_point_index(mouseX, mouseY) if i != None: MY_POINTS.pop(i) if FRAME_IDX >= len(MY_POINTS): # cap i if it exceeds maximum length now. FRAME_IDX = len(MY_POINTS) - 1 else: MY_POINTS.append((mouseX, mouseY)) def get_point_index(x, y): for idx, (p_x,p_y) in enumerate(MY_POINTS): if (p_x - POINT_SIZE < x and x < p_x + POINT_SIZE) and \ (p_y - POINT_SIZE < y and y < p_y + POINT_SIZE): return idx def is_point_in_canvas(x, y): if (x < 0 or x > CNV.width) or \ (y < 0 or y > CNV.height): return False return True def next_frame(): global FRAME_IDX if FRAME_IDX < len(MY_POINTS) - 1: FRAME_IDX += 1 def prev_frame(): global FRAME_IDX if FRAME_IDX > 0: FRAME_IDX -= 1 def draw_closed_curve_vertex(points, max_idx): if len(points) < 2: return used_points = [] beginShape() # start by using the last point as the initial control point idx = len(points) - 1 curveVertex(*points[idx]) used_points.append(idx) # add each point to the curve for idx,p in enumerate(points): if idx > max_idx: break curveVertex(*p) used_points.append(idx) # to close the curve, we need to create the last curve. # for that, we must go to the first point idx = 0 curveVertex(*points[idx]) used_points.append(idx) # and use the next point as a control point. idx = 1 curveVertex(*points[idx]) used_points.append(idx) endShape() textSize(10) noStroke() text('Points used to draw this curve (first and last are control points only)', 5, CNV.height - 30) textSize(20) text(', '.join(used_points), 10, CNV.height - 10) stroke(0) for i in range(len(used_points) - 1): draw_dotted_line(points[used_points[i]], points[used_points[i + 1]]) def draw_labels(points): strokeWeight(POINT_SIZE) for idx, p in enumerate(points): ts = 32 textSize(ts) textY = p[1] - ts / 2 if p[1] > CNV.height / 2: textY = p[1] + ts noStroke() text(idx, p[0], textY) stroke(0) point(*p) strokeWeight(1) def draw_dotted_line(p1, p2): stroke(100) strokeWeight(3) for i in range(11): x = lerp(p1[0], p2[0], i/10) y = lerp(p1[1], p2[1], i/10) point(x, y) stroke(0) strokeWeight(1) ================================================ FILE: docs/examples/transcrypt/sketch_010/static/p5.js ================================================ /*! p5.js v1.0.0 February 29, 2020 */ !function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).p5=e()}}(function(){return function o(a,s,l){function u(t,e){if(!s[t]){if(!a[t]){var r="function"==typeof require&&require;if(!e&&r)return r(t,!0);if(h)return h(t,!0);var i=new Error("Cannot find module '"+t+"'");throw i.code="MODULE_NOT_FOUND",i}var n=s[t]={exports:{}};a[t][0].call(n.exports,function(e){return u(a[t][1][e]||e)},n,n.exports,o,a,s,l)}return s[t].exports}for(var h="function"==typeof require&&require,e=0;e>16&255,a[s++]=t>>8&255,a[s++]=255&t;2===o&&(t=u[e.charCodeAt(r)]<<2|u[e.charCodeAt(r+1)]>>4,a[s++]=255&t);1===o&&(t=u[e.charCodeAt(r)]<<10|u[e.charCodeAt(r+1)]<<4|u[e.charCodeAt(r+2)]>>2,a[s++]=t>>8&255,a[s++]=255&t);return a},r.fromByteArray=function(e){for(var t,r=e.length,i=r%3,n=[],o=0,a=r-i;o>2]+s[t<<4&63]+"==")):2==i&&(t=(e[r-2]<<8)+e[r-1],n.push(s[t>>10]+s[t>>4&63]+s[t<<2&63]+"="));return n.join("")};for(var s=[],u=[],h="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=0,o=i.length;n>18&63]+s[n>>12&63]+s[n>>6&63]+s[63&n]);return o.join("")}u["-".charCodeAt(0)]=62,u["_".charCodeAt(0)]=63},{}],20:[function(e,t,r){},{}],21:[function(N,e,F){(function(c){"use strict";var i=N("base64-js"),o=N("ieee754"),e="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;F.Buffer=c,F.SlowBuffer=function(e){+e!=e&&(e=0);return c.alloc(+e)},F.INSPECT_MAX_BYTES=50;var r=2147483647;function a(e){if(r>>1;case"base64":return O(e).length;default:if(n)return i?-1:R(e).length;t=(""+t).toLowerCase(),n=!0}}function d(e,t,r){var i=e[t];e[t]=e[r],e[r]=i}function p(e,t,r,i,n){if(0===e.length)return-1;if("string"==typeof r?(i=r,r=0):2147483647=e.length){if(n)return-1;r=e.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof t&&(t=c.from(t,i)),c.isBuffer(t))return 0===t.length?-1:m(e,t,r,i,n);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):m(e,[t],r,i,n);throw new TypeError("val must be string, number or Buffer")}function m(e,t,r,i,n){var o,a=1,s=e.length,l=t.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(e.length<2||t.length<2)return-1;s/=a=2,l/=2,r/=2}function u(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(n){var h=-1;for(o=r;o>8,n=r%256,o.push(n),o.push(i);return o}(t,e.length-r),e,r,i)}function b(e,t,r){return 0===t&&r===e.length?i.fromByteArray(e):i.fromByteArray(e.slice(t,r))}function _(e,t,r){r=Math.min(e.length,r);for(var i=[],n=t;n>>10&1023|55296),h=56320|1023&h),i.push(h),n+=c}return function(e){var t=e.length;if(t<=x)return String.fromCharCode.apply(String,e);var r="",i=0;for(;ithis.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e=e||"utf8";;)switch(e){case"hex":return M(this,t,r);case"utf8":case"utf-8":return _(this,t,r);case"ascii":return w(this,t,r);case"latin1":case"binary":return S(this,t,r);case"base64":return b(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,t,r);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}.apply(this,arguments)},c.prototype.equals=function(e){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===c.compare(this,e)},c.prototype.inspect=function(){var e="",t=F.INSPECT_MAX_BYTES;return e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(e+=" ... "),""},e&&(c.prototype[e]=c.prototype.inspect),c.prototype.compare=function(e,t,r,i,n){if(A(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),t<0||r>e.length||i<0||n>this.length)throw new RangeError("out of range index");if(n<=i&&r<=t)return 0;if(n<=i)return-1;if(r<=t)return 1;if(this===e)return 0;for(var o=(n>>>=0)-(i>>>=0),a=(r>>>=0)-(t>>>=0),s=Math.min(o,a),l=this.slice(i,n),u=e.slice(t,r),h=0;h>>=0,isFinite(r)?(r>>>=0,void 0===i&&(i="utf8")):(i=r,r=void 0)}var n=this.length-t;if((void 0===r||nthis.length)throw new RangeError("Attempt to write outside buffer bounds");i=i||"utf8";for(var o,a,s,l,u,h,c=!1;;)switch(i){case"hex":return g(this,e,t,r);case"utf8":case"utf-8":return u=t,h=r,D(R(e,(l=this).length-u),l,u,h);case"ascii":return v(this,e,t,r);case"latin1":case"binary":return v(this,e,t,r);case"base64":return o=this,a=t,s=r,D(O(e),o,a,s);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return y(this,e,t,r);default:if(c)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),c=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var x=4096;function w(e,t,r){var i="";r=Math.min(e.length,r);for(var n=t;ne.length)throw new RangeError("Index out of range")}function P(e,t,r,i){if(r+i>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function L(e,t,r,i,n){return t=+t,r>>>=0,n||P(e,0,r,4),o.write(e,t,r,i,23,4),r+4}function k(e,t,r,i,n){return t=+t,r>>>=0,n||P(e,0,r,8),o.write(e,t,r,i,52,8),r+8}c.prototype.slice=function(e,t){var r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):r>>=0,t>>>=0,r||T(e,t,this.length);for(var i=this[e],n=1,o=0;++o>>=0,t>>>=0,r||T(e,t,this.length);for(var i=this[e+--t],n=1;0>>=0,t||T(e,1,this.length),this[e]},c.prototype.readUInt16LE=function(e,t){return e>>>=0,t||T(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUInt16BE=function(e,t){return e>>>=0,t||T(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUInt32LE=function(e,t){return e>>>=0,t||T(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUInt32BE=function(e,t){return e>>>=0,t||T(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||T(e,t,this.length);for(var i=this[e],n=1,o=0;++o>>=0,t>>>=0,r||T(e,t,this.length);for(var i=t,n=1,o=this[e+--i];0>>=0,t||T(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){e>>>=0,t||T(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(e,t){e>>>=0,t||T(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(e,t){return e>>>=0,t||T(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return e>>>=0,t||T(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readFloatLE=function(e,t){return e>>>=0,t||T(e,4,this.length),o.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return e>>>=0,t||T(e,4,this.length),o.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return e>>>=0,t||T(e,8,this.length),o.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return e>>>=0,t||T(e,8,this.length),o.read(this,e,!1,52,8)},c.prototype.writeUIntLE=function(e,t,r,i){e=+e,t>>>=0,r>>>=0,i||C(this,e,t,r,Math.pow(2,8*r)-1,0);var n=1,o=0;for(this[t]=255&e;++o>>=0,r>>>=0,i||C(this,e,t,r,Math.pow(2,8*r)-1,0);var n=r-1,o=1;for(this[t+n]=255&e;0<=--n&&(o*=256);)this[t+n]=e/o&255;return t+r},c.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,1,255,0),this[t]=255&e,t+1},c.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},c.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeIntLE=function(e,t,r,i){if(e=+e,t>>>=0,!i){var n=Math.pow(2,8*r-1);C(this,e,t,r,n-1,-n)}var o=0,a=1,s=0;for(this[t]=255&e;++o>0)-s&255;return t+r},c.prototype.writeIntBE=function(e,t,r,i){if(e=+e,t>>>=0,!i){var n=Math.pow(2,8*r-1);C(this,e,t,r,n-1,-n)}var o=r-1,a=1,s=0;for(this[t+o]=255&e;0<=--o&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+r},c.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},c.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeFloatLE=function(e,t,r){return L(this,e,t,!0,r)},c.prototype.writeFloatBE=function(e,t,r){return L(this,e,t,!1,r)},c.prototype.writeDoubleLE=function(e,t,r){return k(this,e,t,!0,r)},c.prototype.writeDoubleBE=function(e,t,r){return k(this,e,t,!1,r)},c.prototype.copy=function(e,t,r,i){if(!c.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r=r||0,i||0===i||(i=this.length),t>=e.length&&(t=e.length),t=t||0,0=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t>>=0,r=void 0===r?this.length:r>>>0,"number"==typeof(e=e||0))for(o=t;o>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function O(e){return i.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(t,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function D(e,t,r,i){for(var n=0;n=t.length||n>=e.length);++n)t[n+r]=e[n];return n}function A(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function I(e){return e!=e}var U=function(){for(var e="0123456789abcdef",t=new Array(256),r=0;r<16;++r)for(var i=16*r,n=0;n<16;++n)t[i+n]=e[r]+e[n];return t}()}).call(this,N("buffer").Buffer)},{"base64-js":19,buffer:21,ieee754:30}],22:[function(e,t,r){"use strict";t.exports=e("./").polyfill()},{"./":23}],23:[function(z,r,i){(function(j,V){var e,t;e=this,t=function(){"use strict";function l(e){return"function"==typeof e}var r=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},i=0,t=void 0,n=void 0,a=function(e,t){f[i]=e,f[i+1]=t,2===(i+=2)&&(n?n(d):y())};var e="undefined"!=typeof window?window:void 0,o=e||{},s=o.MutationObserver||o.WebKitMutationObserver,u="undefined"==typeof self&&void 0!==j&&"[object process]"==={}.toString.call(j),h="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function c(){var e=setTimeout;return function(){return e(d,1)}}var f=new Array(1e3);function d(){for(var e=0;e":">",'"':""","'":"'","/":"/"};function S(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,function(e){return w[e]}):e}var M=function(){function i(e){var t,r=1=this.maxReplaces)break}for(a=0;r=this.regexp.exec(e);){if(void 0===(i=h(r[1].trim())))if("function"==typeof c){var d=c(e,r,t);i="string"==typeof d?d:""}else this.logger.warn("missed to pass in variable ".concat(r[1]," for interpolating ").concat(e)),i="";else"string"==typeof i||this.useRawValueToEscape||(i=v(i));if(i=this.escapeValue?u(this.escape(i)):u(i),e=e.replace(r[0],i),this.regexp.lastIndex=0,++a>=this.maxReplaces)break}return e}},{key:"nest",value:function(e,t,r){var i,n,o=D({},2>1,h=-7,c=r?n-1:0,f=r?-1:1,d=e[t+c];for(c+=f,o=d&(1<<-h)-1,d>>=-h,h+=s;0>=-h,h+=i;0>1,f=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,d=i?0:o-1,p=i?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=h):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),2<=(t+=1<=a+c?f/l:f*Math.pow(2,1-c))*l&&(a++,l/=2),h<=a+c?(s=0,a=h):1<=a+c?(s=(t*l-1)*Math.pow(2,n),a+=c):(s=t*Math.pow(2,c-1)*Math.pow(2,n),a=0));8<=n;e[r+d]=255&s,d+=p,s/=256,n-=8);for(a=a<Math.abs(e[0])&&(t=1),Math.abs(e[2])>Math.abs(e[t])&&(t=2),t}var C=4e150;function P(e,t){e.f+=t.f,e.b.f+=t.b.f}function u(e,t,r){return e=e.a,t=t.a,r=r.a,t.b.a===e?r.b.a===e?v(t.a,r.a)?b(r.b.a,t.a,r.a)<=0:0<=b(t.b.a,r.a,t.a):b(r.b.a,e,r.a)<=0:r.b.a===e?0<=b(t.b.a,e,t.a):(t=y(t.b.a,e,t.a),(e=y(r.b.a,e,r.a))<=t)}function L(e){e.a.i=null;var t=e.e;t.a.c=t.c,t.c.a=t.a,e.e=null}function h(e,t){c(e.a),e.c=!1,(e.a=t).i=e}function k(e){for(var t=e.a.a;(e=fe(e)).a.a===t;);return e.c&&(h(e,t=f(ce(e).a.b,e.a.e)),e=fe(e)),e}function R(e,t,r){var i=new he;return i.a=r,i.e=W(e.f,t.e,i),r.i=i}function O(e,t){switch(e.s){case 100130:return 0!=(1&t);case 100131:return 0!==t;case 100132:return 0>1]],s[a[u]])?le(r,u):ue(r,u)),s[o]=null,l[o]=r.b,r.b=o}else for(r.c[-(o+1)]=null;0Math.max(a.a,l.a))return!1;if(v(o,a)){if(0i.f&&(i.f*=2,i.c=oe(i.c,i.f+1)),0===i.b?r=n:(r=i.b,i.b=i.c[i.b]),i.e[r]=t,i.c[r]=n,i.d[n]=r,i.h&&ue(i,n),r}return i=e.a++,e.c[i]=t,-(i+1)}function ie(e){if(0===e.a)return se(e.b);var t=e.c[e.d[e.a-1]];if(0!==e.b.a&&v(ae(e.b),t))return se(e.b);for(;--e.a,0e.a||v(i[a],i[l])){n[r[o]=a]=o;break}n[r[o]=l]=o,o=s}}function ue(e,t){for(var r=e.d,i=e.e,n=e.c,o=t,a=r[o];;){var s=o>>1,l=r[s];if(0==s||v(i[l],i[a])){n[r[o]=a]=o;break}n[r[o]=l]=o,o=s}}function he(){this.e=this.a=null,this.f=0,this.c=this.b=this.h=this.d=!1}function ce(e){return e.e.c.b}function fe(e){return e.e.a.b}(i=q.prototype).x=function(){Y(this,0)},i.B=function(e,t){switch(e){case 100142:return;case 100140:switch(t){case 100130:case 100131:case 100132:case 100133:case 100134:return void(this.s=t)}break;case 100141:return void(this.m=!!t);default:return void Z(this,100900)}Z(this,100901)},i.y=function(e){switch(e){case 100142:return 0;case 100140:return this.s;case 100141:return this.m;default:Z(this,100900)}return!1},i.A=function(e,t,r){this.j[0]=e,this.j[1]=t,this.j[2]=r},i.z=function(e,t){var r=t||null;switch(e){case 100100:case 100106:this.h=r;break;case 100104:case 100110:this.l=r;break;case 100101:case 100107:this.k=r;break;case 100102:case 100108:this.i=r;break;case 100103:case 100109:this.p=r;break;case 100105:case 100111:this.o=r;break;case 100112:this.r=r;break;default:Z(this,100900)}},i.C=function(e,t){var r=!1,i=[0,0,0];Y(this,2);for(var n=0;n<3;++n){var o=e[n];o<-1e150&&(o=-1e150,r=!0),1e150n[u]&&(n[u]=h,a[u]=l)}if(l=0,n[1]-o[1]>n[0]-o[0]&&(l=1),n[2]-o[2]>n[l]-o[l]&&(l=2),o[l]>=n[l])i[0]=0,i[1]=0,i[2]=1;else{for(n=0,o=s[l],a=a[l],s=[0,0,0],o=[o.g[0]-a.g[0],o.g[1]-a.g[1],o.g[2]-a.g[2]],u=[0,0,0],l=r.e;l!==r;l=l.e)u[0]=l.g[0]-a.g[0],u[1]=l.g[1]-a.g[1],u[2]=l.g[2]-a.g[2],s[0]=o[1]*u[2]-o[2]*u[1],s[1]=o[2]*u[0]-o[0]*u[2],s[2]=o[0]*u[1]-o[1]*u[0],n<(h=s[0]*s[0]+s[1]*s[1]+s[2]*s[2])&&(n=h,i[0]=s[0],i[1]=s[1],i[2]=s[2]);n<=0&&(i[0]=i[1]=i[2]=0,i[T(o)]=1)}r=!0}for(s=T(i),l=this.b.c,n=(s+1)%3,a=(s+2)%3,s=0>=l,h-=l,g!=o){if(g==a)break;for(var v=g>8,++y;var _=b;if(i>=8;null!==m&&s<4096&&(p[s++]=m<<8|_,u+1<=s&&l<12&&(++l,u=u<<1|1)),m=g}else s=1+a,u=(1<<(l=n+1))-1,m=null}return f!==i&&console.log("Warning, gif stream shorter than expected."),r}try{r.GifWriter=function(v,e,t,r){var y=0,i=void 0===(r=void 0===r?{}:r).loop?null:r.loop,b=void 0===r.palette?null:r.palette;if(e<=0||t<=0||65535>=1;)++n;if(a=1<>8&255,v[y++]=255&t,v[y++]=t>>8&255,v[y++]=(null!==b?128:0)|n,v[y++]=o,v[y++]=0,null!==b)for(var s=0,l=b.length;s>16&255,v[y++]=u>>8&255,v[y++]=255&u}if(null!==i){if(i<0||65535>8&255,v[y++]=0}var x=!1;this.addFrame=function(e,t,r,i,n,o){if(!0===x&&(--y,x=!1),o=void 0===o?{}:o,e<0||t<0||65535>=1;)++u;l=1<>8&255,v[y++]=d,v[y++]=0),v[y++]=44,v[y++]=255&e,v[y++]=e>>8&255,v[y++]=255&t,v[y++]=t>>8&255,v[y++]=255&r,v[y++]=r>>8&255,v[y++]=255&i,v[y++]=i>>8&255,v[y++]=!0===a?128|u-1:0,!0===a)for(var p=0,m=s.length;p>16&255,v[y++]=g>>8&255,v[y++]=255&g}return y=function(t,r,e,i){t[r++]=e;var n=r++,o=1<>=8,h-=8,r===n+256&&(t[n]=255,n=r++)}function d(e){c|=e<>=8,h-=8,r===n+256&&(t[n]=255,n=r++);4096===l?(d(o),l=1+s,u=e+1,m={}):(1<>7,n=1<<1+(7&r);x[e++],x[e++];var o=null,a=null;i&&(o=e,e+=3*(a=n));var s=!0,l=[],u=0,h=null,c=0,f=null;for(this.width=w,this.height=t;s&&e>2&7,e++;break;case 254:for(;;){if(!(0<=(C=x[e++])))throw Error("Invalid block size");if(0===C)break;e+=C}break;default:throw new Error("Unknown graphic control label: 0x"+x[e-1].toString(16))}break;case 44:var p=x[e++]|x[e++]<<8,m=x[e++]|x[e++]<<8,g=x[e++]|x[e++]<<8,v=x[e++]|x[e++]<<8,y=x[e++],b=y>>6&1,_=1<<1+(7&y),S=o,M=a,E=!1;if(y>>7){E=!0;S=e,e+=3*(M=_)}var T=e;for(e++;;){var C;if(!(0<=(C=x[e++])))throw Error("Invalid block size");if(0===C)break;e+=C}l.push({x:p,y:m,width:g,height:v,has_local_palette:E,palette_offset:S,palette_size:M,data_offset:T,data_length:e-T,transparent_index:h,interlaced:!!b,delay:u,disposal:c});break;case 59:s=!1;break;default:throw new Error("Unknown gif block: 0x"+x[e-1].toString(16))}this.numFrames=function(){return l.length},this.loopCount=function(){return f},this.frameInfo=function(e){if(e<0||e>=l.length)throw new Error("Frame index out of range.");return l[e]},this.decodeAndBlitFrameBGRA=function(e,t){var r=this.frameInfo(e),i=r.width*r.height,n=new Uint8Array(i);P(x,r.data_offset,n,i);var o=r.palette_offset,a=r.transparent_index;null===a&&(a=256);var s=r.width,l=w-s,u=s,h=4*(r.y*w+r.x),c=4*((r.y+r.height)*w+r.x),f=h,d=4*l;!0===r.interlaced&&(d+=4*w*7);for(var p=8,m=0,g=n.length;m>=1)),v===a)f+=4;else{var y=x[o+3*v],b=x[o+3*v+1],_=x[o+3*v+2];t[f++]=_,t[f++]=b,t[f++]=y,t[f++]=255}--u}},this.decodeAndBlitFrameRGBA=function(e,t){var r=this.frameInfo(e),i=r.width*r.height,n=new Uint8Array(i);P(x,r.data_offset,n,i);var o=r.palette_offset,a=r.transparent_index;null===a&&(a=256);var s=r.width,l=w-s,u=s,h=4*(r.y*w+r.x),c=4*((r.y+r.height)*w+r.x),f=h,d=4*l;!0===r.interlaced&&(d+=4*w*7);for(var p=8,m=0,g=n.length;m>=1)),v===a)f+=4;else{var y=x[o+3*v],b=x[o+3*v+1],_=x[o+3*v+2];t[f++]=y,t[f++]=b,t[f++]=_,t[f++]=255}--u}}}}catch(e){}},{}],33:[function(jr,t,r){(function(Gr){var e;e=this,function(E){"use strict";function e(e){if(null==this)throw TypeError();var t=String(this),r=t.length,i=e?Number(e):0;if(i!=i&&(i=0),!(i<0||r<=i)){var n,o=t.charCodeAt(i);return 55296<=o&&o<=56319&&i+1>>=1,t}function _(e,t,r){if(!t)return r;for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<>>16-t;return e.tag>>>=t,e.bitcount-=t,i+r}function x(e,t){for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<>>=1,++n,r+=t.table[n],0<=(i-=t.table[n]););return e.tag=o,e.bitcount-=n,t.trans[r+i]}function w(e,t,r){var i,n,o,a,s,l;for(i=_(e,5,257),n=_(e,5,1),o=_(e,4,4),a=0;a<19;++a)g[a]=0;for(a=0;athis.x2&&(this.x2=e)),"number"==typeof t&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=t,this.y2=t),tthis.y2&&(this.y2=t))},C.prototype.addX=function(e){this.addPoint(e,null)},C.prototype.addY=function(e){this.addPoint(null,e)},C.prototype.addBezier=function(e,t,r,i,n,o,a,s){var l=this,u=[e,t],h=[r,i],c=[n,o],f=[a,s];this.addPoint(e,t),this.addPoint(a,s);for(var d=0;d<=1;d++){var p=6*u[d]-12*h[d]+6*c[d],m=-3*u[d]+9*h[d]-9*c[d]+3*f[d],g=3*h[d]-3*u[d];if(0!=m){var v=Math.pow(p,2)-4*g*m;if(!(v<0)){var y=(-p+Math.sqrt(v))/(2*m);0>8&255,255&e]},A.USHORT=U(2),D.SHORT=function(e){return 32768<=e&&(e=-(65536-e)),[e>>8&255,255&e]},A.SHORT=U(2),D.UINT24=function(e){return[e>>16&255,e>>8&255,255&e]},A.UINT24=U(3),D.ULONG=function(e){return[e>>24&255,e>>16&255,e>>8&255,255&e]},A.ULONG=U(4),D.LONG=function(e){return R<=e&&(e=-(2*R-e)),[e>>24&255,e>>16&255,e>>8&255,255&e]},A.LONG=U(4),D.FIXED=D.ULONG,A.FIXED=A.ULONG,D.FWORD=D.SHORT,A.FWORD=A.SHORT,D.UFWORD=D.USHORT,A.UFWORD=A.USHORT,D.LONGDATETIME=function(e){return[0,0,0,0,e>>24&255,e>>16&255,e>>8&255,255&e]},A.LONGDATETIME=U(8),D.TAG=function(e){return k.argument(4===e.length,"Tag should be exactly 4 ASCII characters."),[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]},A.TAG=U(4),D.Card8=D.BYTE,A.Card8=A.BYTE,D.Card16=D.USHORT,A.Card16=A.USHORT,D.OffSize=D.BYTE,A.OffSize=A.BYTE,D.SID=D.USHORT,A.SID=A.USHORT,D.NUMBER=function(e){return-107<=e&&e<=107?[e+139]:108<=e&&e<=1131?[247+((e-=108)>>8),255&e]:-1131<=e&&e<=-108?[251+((e=-e-108)>>8),255&e]:-32768<=e&&e<=32767?D.NUMBER16(e):D.NUMBER32(e)},A.NUMBER=function(e){return D.NUMBER(e).length},D.NUMBER16=function(e){return[28,e>>8&255,255&e]},A.NUMBER16=U(3),D.NUMBER32=function(e){return[29,e>>24&255,e>>16&255,e>>8&255,255&e]},A.NUMBER32=U(5),D.REAL=function(e){var t=e.toString(),r=/\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec(t);if(r){var i=parseFloat("1e"+((r[2]?+r[2]:0)+r[1].length));t=(Math.round(e*i)/i).toString()}for(var n="",o=0,a=t.length;o>8&255,t[t.length]=255&i}return t},A.UTF16=function(e){return 2*e.length};var N={"x-mac-croatian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈ƫȅ ÀÃÕŒœĐ—“”‘’÷◊©⁄€‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ","x-mac-cyrillic":"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю","x-mac-gaelic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØḂ±≤≥ḃĊċḊḋḞḟĠġṀæøṁṖṗɼƒſṠ«»… ÀÃÕŒœ–—“”‘’ṡẛÿŸṪ€‹›Ŷŷṫ·Ỳỳ⁊ÂÊÁËÈÍÎÏÌÓÔ♣ÒÚÛÙıÝýŴŵẄẅẀẁẂẃ","x-mac-greek":"Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦€ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ­","x-mac-icelandic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüݰ¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-inuit":"ᐃᐄᐅᐆᐊᐋᐱᐲᐳᐴᐸᐹᑉᑎᑏᑐᑑᑕᑖᑦᑭᑮᑯᑰᑲᑳᒃᒋᒌᒍᒎᒐᒑ°ᒡᒥᒦ•¶ᒧ®©™ᒨᒪᒫᒻᓂᓃᓄᓅᓇᓈᓐᓯᓰᓱᓲᓴᓵᔅᓕᓖᓗᓘᓚᓛᓪᔨᔩᔪᔫᔭ… ᔮᔾᕕᕖᕗ–—“”‘’ᕘᕙᕚᕝᕆᕇᕈᕉᕋᕌᕐᕿᖀᖁᖂᖃᖄᖅᖏᖐᖑᖒᖓᖔᖕᙱᙲᙳᙴᙵᙶᖖᖠᖡᖢᖣᖤᖥᖦᕼŁł","x-mac-ce":"ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ",macintosh:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-romanian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂȘ∞±≤≥¥µ∂∑∏π∫ªºΩăș¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›Țț‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-turkish":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙˆ˜¯˘˙˚¸˝˛ˇ"};O.MACSTRING=function(e,t,r,i){var n=N[i];if(void 0!==n){for(var o="",a=0;a>8&255,l+256&255)}return o}D.MACSTRING=function(e,t){var r=function(e){if(!F)for(var t in F={},N)F[t]=new String(t);var r=F[e];if(void 0!==r){if(B){var i=B.get(r);if(void 0!==i)return i}var n=N[e];if(void 0!==n){for(var o={},a=0;a>8,t[c+1]=255&f,t=t.concat(i[h])}return t},A.TABLE=function(e){for(var t=0,r=e.fields.length,i=0;i>1,t.skip("uShort",3),e.glyphIndexMap={};for(var a=new se.Parser(r,i+n+14),s=new se.Parser(r,i+n+16+2*o),l=new se.Parser(r,i+n+16+4*o),u=new se.Parser(r,i+n+16+6*o),h=i+n+16+8*o,c=0;c>4,o=15&i;if(15==n)break;if(t+=r[n],15==o)break;t+=r[o]}return parseFloat(t)}(e);if(32<=t&&t<=246)return t-139;if(247<=t&&t<=250)return 256*(t-247)+e.parseByte()+108;if(251<=t&&t<=254)return 256*-(t-251)-e.parseByte()-108;throw new Error("Invalid b0 "+t)}function Te(e,t,r){t=void 0!==t?t:0;var i=new se.Parser(e,t),n=[],o=[];for(r=void 0!==r?r:e.length;i.relativeOffset>1,T.length=0,P=!0}return function e(t){for(var r,i,n,o,a,s,l,u,h,c,f,d,p=0;pMath.abs(d-R)?k=f+T.shift():R=d+T.shift(),E.curveTo(y,b,_,x,l,u),E.curveTo(h,c,f,d,k,R);break;default:console.log("Glyph "+v.index+": unknown operator 1200"+m),T.length=0}break;case 14:0>3;break;case 21:2>16),p+=2;break;case 29:a=T.pop()+g.gsubrsBias,(s=g.gsubrs[a])&&e(s);break;case 30:for(;0=r.begin&&e=fe.length){var a=i.parseChar();r.names.push(i.parseString(a))}break;case 2.5:r.numberOfGlyphs=i.parseUShort(),r.offset=new Array(r.numberOfGlyphs);for(var s=0;st.value.tag?1:-1}),t.fields=t.fields.concat(i),t.fields=t.fields.concat(n),t}function gt(e,t,r){for(var i=0;i 123 are reserved for internal usage");d|=1<>>1,o=e[n].tag;if(o===t)return n;o>>1,o=e[n];if(o===t)return n;o>>1,a=(r=e[o]).start;if(a===t)return r;a(r=e[i-1]).end?0:r}function xt(e,t){this.font=e,this.tableName=t}function wt(e){xt.call(this,e,"gpos")}function St(e){xt.call(this,e,"gsub")}function Mt(e,t){var r=e.length;if(r!==t.length)return!1;for(var i=0;it.points.length-1||i.matchedPoints[1]>n.points.length-1)throw Error("Matched points out of range in "+t.name);var a=t.points[i.matchedPoints[0]],s=n.points[i.matchedPoints[1]],l={xScale:i.xScale,scale01:i.scale01,scale10:i.scale10,yScale:i.yScale,dx:0,dy:0};s=kt([s],l)[0],l.dx=a.x-s.x,l.dy=a.y-s.y,o=kt(n.points,l)}t.points=t.points.concat(o)}}return Rt(t.points)}(wt.prototype=xt.prototype={searchTag:yt,binSearch:bt,getTable:function(e){var t=this.font.tables[this.tableName];return!t&&e&&(t=this.font.tables[this.tableName]=this.createDefaultTable()),t},getScriptNames:function(){var e=this.getTable();return e?e.scripts.map(function(e){return e.tag}):[]},getDefaultScriptName:function(){var e=this.getTable();if(e){for(var t=!1,r=0;r=s[u-1].tag,"Features must be added in alphabetical order."),o={tag:r,feature:{params:0,lookupListIndexes:[]}},s.push(o),a.push(u),o.feature}}},getLookupTables:function(e,t,r,i,n){var o=this.getFeatureTable(e,t,r,n),a=[];if(o){for(var s,l=o.lookupListIndexes,u=this.font.tables[this.tableName].lookups,h=0;h",s),t.stack.push(Math.round(64*s))}function vr(e,t){var r=t.stack,i=r.pop(),n=t.fv,o=t.pv,a=t.ppem,s=t.deltaBase+16*(e-1),l=t.deltaShift,u=t.z0;E.DEBUG&&console.log(t.step,"DELTAP["+e+"]",i,r);for(var h=0;h>4)===a){var d=(15&f)-8;0<=d&&d++,E.DEBUG&&console.log(t.step,"DELTAPFIX",c,"by",d*l);var p=u[c];n.setRelative(p,p,d*l,o)}}}function yr(e,t){var r=t.stack,i=r.pop();E.DEBUG&&console.log(t.step,"ROUND[]"),r.push(64*t.round(i/64))}function br(e,t){var r=t.stack,i=r.pop(),n=t.ppem,o=t.deltaBase+16*(e-1),a=t.deltaShift;E.DEBUG&&console.log(t.step,"DELTAC["+e+"]",i,r);for(var s=0;s>4)===n){var h=(15&u)-8;0<=h&&h++;var c=h*a;E.DEBUG&&console.log(t.step,"DELTACFIX",l,"by",c),t.cvt[l]+=c}}}function _r(e,t){var r,i,n=t.stack,o=n.pop(),a=n.pop(),s=t.z2[o],l=t.z1[a];E.DEBUG&&console.log(t.step,"SDPVTL["+e+"]",o,a),i=e?(r=s.y-l.y,l.x-s.x):(r=l.x-s.x,l.y-s.y),t.dpv=Zt(r,i)}function xr(e,t){var r=t.stack,i=t.prog,n=t.ip;E.DEBUG&&console.log(t.step,"PUSHB["+e+"]");for(var o=0;o":"_")+(i?"R":"_")+(0===n?"Gr":1===n?"Bl":2===n?"Wh":"")+"]",e?c+"("+o.cvt[c]+","+u+")":"",f,"(d =",a,"->",l*s,")"),o.rp1=o.rp0,o.rp2=f,t&&(o.rp0=f)}Ft.prototype.exec=function(e,t){if("number"!=typeof t)throw new Error("Point size is not a number!");if(!(2",i),s.interpolate(c,o,a,l),s.touch(c)}e.loop=1},dr.bind(void 0,0),dr.bind(void 0,1),function(e){for(var t=e.stack,r=e.rp0,i=e.z0[r],n=e.loop,o=e.fv,a=e.pv,s=e.z1;n--;){var l=t.pop(),u=s[l];E.DEBUG&&console.log(e.step,(1=a.width||t>=a.height?[0,0,0,0]:this._getPixel(e,t);var s=new l.default.Image(r,i);return s.canvas.getContext("2d").drawImage(a,e,t,r*o,i*o,0,0,r,i),s},l.default.Renderer.prototype.textLeading=function(e){return"number"==typeof e?(this._setProperty("_textLeading",e),this._pInst):this._textLeading},l.default.Renderer.prototype.textSize=function(e){return"number"==typeof e?(this._setProperty("_textSize",e),this._setProperty("_textLeading",e*y._DEFAULT_LEADMULT),this._applyTextProperties()):this._textSize},l.default.Renderer.prototype.textStyle=function(e){return e?(e!==y.NORMAL&&e!==y.ITALIC&&e!==y.BOLD&&e!==y.BOLDITALIC||this._setProperty("_textStyle",e),this._applyTextProperties()):this._textStyle},l.default.Renderer.prototype.textAscent=function(){return null===this._textAscent&&this._updateTextMetrics(),this._textAscent},l.default.Renderer.prototype.textDescent=function(){return null===this._textDescent&&this._updateTextMetrics(),this._textDescent},l.default.Renderer.prototype.textAlign=function(e,t){return void 0!==e?(this._setProperty("_textAlign",e),void 0!==t&&this._setProperty("_textBaseline",t),this._applyTextProperties()):{horizontal:this._textAlign,vertical:this._textBaseline}},l.default.Renderer.prototype.text=function(e,t,r,i,n){var o,a,s,l,u,h,c,f,d=this._pInst,p=Number.MAX_VALUE;if((this._doFill||this._doStroke)&&void 0!==e){if("string"!=typeof e&&(e=e.toString()),o=(e=e.replace(/(\t)/g," ")).split("\n"),void 0!==i){for(s=f=0;ss.HALF_PI&&e<=3*s.HALF_PI?Math.atan(r/i*Math.tan(e))+s.PI:Math.atan(r/i*Math.tan(e))+s.TWO_PI,t=t<=s.HALF_PI?Math.atan(r/i*Math.tan(t)):t>s.HALF_PI&&t<=3*s.HALF_PI?Math.atan(r/i*Math.tan(t))+s.PI:Math.atan(r/i*Math.tan(t))+s.TWO_PI),tv||Math.abs(this.accelerationY-this.pAccelerationY)>v||Math.abs(this.accelerationZ-this.pAccelerationZ)>v)&&e();var t=this.deviceTurned||window.deviceTurned;if("function"==typeof t){var r=this.rotationX+180,i=this.pRotationX+180,n=c+180;0>>24],i+=x[(16711680&C)>>16],n+=x[(65280&C)>>8],o+=x[255&C],r+=k[_],s++}w[l=T+y]=a/r,S[l]=i/r,M[l]=n/r,E[l]=o/r}T+=d}for(h=(u=-P)*d,b=T=0;b>>16,e[r+1]=(65280&t[i])>>>8,e[r+2]=255&t[i],e[r+3]=(4278190080&t[i])>>>24},O._toImageData=function(e){return e instanceof ImageData?e:e.getContext("2d").getImageData(0,0,e.width,e.height)},O._createImageData=function(e,t){return O._tmpCanvas=document.createElement("canvas"),O._tmpCtx=O._tmpCanvas.getContext("2d"),this._tmpCtx.createImageData(e,t)},O.apply=function(e,t,r){var i=e.getContext("2d"),n=i.getImageData(0,0,e.width,e.height),o=t(n,r);o instanceof ImageData?i.putImageData(o,0,0,0,0,e.width,e.height):i.putImageData(n,0,0,0,0,e.width,e.height)},O.threshold=function(e,t){var r=O._toPixels(e);void 0===t&&(t=.5);for(var i=Math.floor(255*t),n=0;n>8)/i,r[n+1]=255*(a*t>>8)/i,r[n+2]=255*(s*t>>8)/i}},O.dilate=function(e){for(var t,r,i,n,o,a,s,l,u,h,c,f,d,p,m,g,v,y=O._toPixels(e),b=0,_=y.length?y.length/4:0,x=new Int32Array(_);b<_;)for(r=(t=b)+e.width;b>16&255)+151*(i>>8&255)+28*(255&i))<(m=77*(c>>16&255)+151*(c>>8&255)+28*(255&c))&&(n=c,o=m),o<(p=77*((h=O._getARGB(y,a))>>16&255)+151*(h>>8&255)+28*(255&h))&&(n=h,o=p),o<(g=77*(f>>16&255)+151*(f>>8&255)+28*(255&f))&&(n=f,o=g),o<(v=77*(d>>16&255)+151*(d>>8&255)+28*(255&d))&&(n=d,o=v),x[b++]=n;O._setPixels(y,x)},O.erode=function(e){for(var t,r,i,n,o,a,s,l,u,h,c,f,d,p,m,g,v,y=O._toPixels(e),b=0,_=y.length?y.length/4:0,x=new Int32Array(_);b<_;)for(r=(t=b)+e.width;b>16&255)+151*(c>>8&255)+28*(255&c))<(o=77*(i>>16&255)+151*(i>>8&255)+28*(255&i))&&(n=c,o=m),(p=77*((h=O._getARGB(y,a))>>16&255)+151*(h>>8&255)+28*(255&h))>16&255)+151*(f>>8&255)+28*(255&f))>16&255)+151*(d>>8&255)+28*(255&d))=r){var i=Math.floor(t.timeDisplayed/r);if(t.timeDisplayed=0,t.displayIndex+=i,t.loopCount=Math.floor(t.displayIndex/t.numFrames),null!==t.loopLimit&&t.loopCount>=t.loopLimit)t.playing=!1;else{var n=t.displayIndex%t.numFrames;this.drawingContext.putImageData(t.frames[n].image,0,0),t.displayIndex=n,this.setModified(!0)}}}},n.default.Image.prototype._setProperty=function(e,t){this[e]=t,this.setModified(!0)},n.default.Image.prototype.loadPixels=function(){n.default.Renderer2D.prototype.loadPixels.call(this),this.setModified(!0)},n.default.Image.prototype.updatePixels=function(e,t,r,i){n.default.Renderer2D.prototype.updatePixels.call(this,e,t,r,i),this.setModified(!0)},n.default.Image.prototype.get=function(e,t,r,i){return n.default._validateParameters("p5.Image.get",arguments),n.default.Renderer2D.prototype.get.apply(this,arguments)},n.default.Image.prototype._getPixel=n.default.Renderer2D.prototype._getPixel,n.default.Image.prototype.set=function(e,t,r){n.default.Renderer2D.prototype.set.call(this,e,t,r),this.setModified(!0)},n.default.Image.prototype.resize=function(e,t){0===e&&0===t?(e=this.canvas.width,t=this.canvas.height):0===e?e=this.canvas.width*t/this.canvas.height:0===t&&(t=this.canvas.height*e/this.canvas.width),e=Math.floor(e),t=Math.floor(t);var r=document.createElement("canvas");if(r.width=e,r.height=t,this.gifProperties)for(var i=this.gifProperties,n=function(e,t){for(var r=0,i=0;i/g,">").replace(/"/g,""").replace(/'/g,"'")}function l(e,t){t&&!0!==t&&"true"!==t||(t="");var r="";return(e=e||"untitled")&&e.includes(".")&&(r=e.split(".").pop()),t&&r!==t&&(r=t,e="".concat(e,".").concat(r)),[e,r]}e("../core/error_helpers"),v.default.prototype.loadJSON=function(){for(var e=arguments.length,t=new Array(e),r=0;r"),n.print("");if(n.print(' '),n.print(""),n.print(""),n.print(" "),"0"!==o[0]){n.print(" ");for(var h=0;h".concat(c)),n.print(" ")}n.print(" ")}for(var f=0;f");for(var d=0;d".concat(p)),n.print(" ")}n.print(" ")}n.print("
"),n.print(""),n.print("")}n.close(),n.clear()},v.default.prototype.writeFile=function(e,t,r){var i="application/octet-stream";v.default.prototype._isSafari()&&(i="text/plain");var n=new Blob(e,{type:i});v.default.prototype.downloadFile(n,t,r)},v.default.prototype.downloadFile=function(e,t,r){var i=l(t,r),n=i[0];if(e instanceof Blob)s.default.saveAs(e,n);else{var o=document.createElement("a");if(o.href=e,o.download=n,o.onclick=function(e){var t;t=e,document.body.removeChild(t.target),e.stopPropagation()},o.style.display="none",document.body.appendChild(o),v.default.prototype._isSafari()){var a="Hello, Safari user! To download this file...\n";a+="1. Go to File --\x3e Save As.\n",a+='2. Choose "Page Source" as the Format.\n',a+='3. Name it with this extension: ."'.concat(i[1],'"'),alert(a)}o.click()}},v.default.prototype._checkFileExtension=l,v.default.prototype._isSafari=function(){return 0>>0},getSeed:function(){return t},rand:function(){return(r=(1664525*r+1013904223)%i)/i}});n.setSeed(e),_=new Array(4096);for(var o=0;o<4096;o++)_[o]=n.rand()};var o=n.default;r.default=o},{"../core/main":49}],82:[function(e,t,r){"use strict";function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i,l=(i=e("../core/main"))&&i.__esModule?i:{default:i},o=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==a(e)&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var o=i?Object.getOwnPropertyDescriptor(e,n):null;o&&(o.get||o.set)?Object.defineProperty(r,n,o):r[n]=e[n]}r.default=e,t&&t.set(e,r);return r}(e("../core/constants"));function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}l.default.Vector=function(e,t,r){var i,n,o;o=e instanceof l.default?(this.p5=e,i=t[0]||0,n=t[1]||0,t[2]||0):(i=e||0,n=t||0,r||0),this.x=i,this.y=n,this.z=o},l.default.Vector.prototype.toString=function(){return"p5.Vector Object : [".concat(this.x,", ").concat(this.y,", ").concat(this.z,"]")},l.default.Vector.prototype.set=function(e,t,r){return e instanceof l.default.Vector?(this.x=e.x||0,this.y=e.y||0,this.z=e.z||0):e instanceof Array?(this.x=e[0]||0,this.y=e[1]||0,this.z=e[2]||0):(this.x=e||0,this.y=t||0,this.z=r||0),this},l.default.Vector.prototype.copy=function(){return this.p5?new l.default.Vector(this.p5,[this.x,this.y,this.z]):new l.default.Vector(this.x,this.y,this.z)},l.default.Vector.prototype.add=function(e,t,r){return e instanceof l.default.Vector?(this.x+=e.x||0,this.y+=e.y||0,this.z+=e.z||0):e instanceof Array?(this.x+=e[0]||0,this.y+=e[1]||0,this.z+=e[2]||0):(this.x+=e||0,this.y+=t||0,this.z+=r||0),this};function u(e,t){return 0!==e&&(this.x=this.x%e),0!==t&&(this.y=this.y%t),this}function h(e,t,r){return 0!==e&&(this.x=this.x%e),0!==t&&(this.y=this.y%t),0!==r&&(this.z=this.z%r),this}l.default.Vector.prototype.rem=function(e,t,r){if(e instanceof l.default.Vector){if(Number.isFinite(e.x)&&Number.isFinite(e.y)&&Number.isFinite(e.z)){var i=parseFloat(e.x),n=parseFloat(e.y),o=parseFloat(e.z);h.call(this,i,n,o)}}else if(e instanceof Array)e.every(function(e){return Number.isFinite(e)})&&(2===e.length&&u.call(this,e[0],e[1]),3===e.length&&h.call(this,e[0],e[1],e[2]));else if(1===arguments.length){if(Number.isFinite(e)&&0!==e)return this.x=this.x%e,this.y=this.y%e,this.z=this.z%e,this}else if(2===arguments.length){var a=Array.prototype.slice.call(arguments);a.every(function(e){return Number.isFinite(e)})&&2===a.length&&u.call(this,a[0],a[1])}else if(3===arguments.length){var s=Array.prototype.slice.call(arguments);s.every(function(e){return Number.isFinite(e)})&&3===s.length&&h.call(this,s[0],s[1],s[2])}},l.default.Vector.prototype.sub=function(e,t,r){return e instanceof l.default.Vector?(this.x-=e.x||0,this.y-=e.y||0,this.z-=e.z||0):e instanceof Array?(this.x-=e[0]||0,this.y-=e[1]||0,this.z-=e[2]||0):(this.x-=e||0,this.y-=t||0,this.z-=r||0),this},l.default.Vector.prototype.mult=function(e){return"number"==typeof e&&isFinite(e)?(this.x*=e,this.y*=e,this.z*=e):console.warn("p5.Vector.prototype.mult:","n is undefined or not a finite number"),this},l.default.Vector.prototype.div=function(e){return"number"==typeof e&&isFinite(e)?0===e?console.warn("p5.Vector.prototype.div:","divide by 0"):(this.x/=e,this.y/=e,this.z/=e):console.warn("p5.Vector.prototype.div:","n is undefined or not a finite number"),this},l.default.Vector.prototype.mag=function(){return Math.sqrt(this.magSq())},l.default.Vector.prototype.magSq=function(){var e=this.x,t=this.y,r=this.z;return e*e+t*t+r*r},l.default.Vector.prototype.dot=function(e,t,r){return e instanceof l.default.Vector?this.dot(e.x,e.y,e.z):this.x*(e||0)+this.y*(t||0)+this.z*(r||0)},l.default.Vector.prototype.cross=function(e){var t=this.y*e.z-this.z*e.y,r=this.z*e.x-this.x*e.z,i=this.x*e.y-this.y*e.x;return this.p5?new l.default.Vector(this.p5,[t,r,i]):new l.default.Vector(t,r,i)},l.default.Vector.prototype.dist=function(e){return e.copy().sub(this).mag()},l.default.Vector.prototype.normalize=function(){var e=this.mag();return 0!==e&&this.mult(1/e),this},l.default.Vector.prototype.limit=function(e){var t=this.magSq();return e*e>>0},n.default.prototype.randomSeed=function(e){this._lcgSetSeed(o,e),this._gaussian_previous=!1},n.default.prototype.random=function(e,t){var r;if(n.default._validateParameters("random",arguments),r=null!=this[o]?this._lcg(o):Math.random(),void 0===e)return r;if(void 0===t)return e instanceof Array?e[Math.floor(r*e.length)]:r*e;if(tf){var P=p,L=l,k=u;p=d+f*(s&&d=t&&(r=r.substring(r.length-t,r.length)),r}},n.default.prototype.unhex=function(e){return e instanceof Array?e.map(n.default.prototype.unhex):parseInt("0x".concat(e),16)};var o=n.default;r.default=o},{"../core/main":49}],90:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i,a=(i=e("../core/main"))&&i.__esModule?i:{default:i};function n(e,t,r){var i=e<0,n=i?e.toString().substring(1):e.toString(),o=n.indexOf("."),a=-1!==o?n.substring(0,o):n,s=-1!==o?n.substring(o+1):"",l=i?"-":"";if(void 0!==r){var u="";(-1!==o||0r&&(s=s.substring(0,r));for(var h=0;hi.length)for(var o=t-(i+=-1===r?".":"").length+1,a=0;a=d.TWO_PI?"".concat("ellipse","|").concat(u,"|"):"".concat("arc","|").concat(a,"|").concat(s,"|").concat(l,"|").concat(u,"|"),!this.geometryInHash(t)){var h=new T.default.Geometry(u,1,function(){if(this.strokeIndices=[],a.toFixed(10)!==s.toFixed(10)){l!==d.PIE&&void 0!==l||(this.vertices.push(new T.default.Vector(.5,.5,0)),this.uvs.push([.5,.5]));for(var e=0;e<=u;e++){var t=(s-a)*(e/u)+a,r=.5+Math.cos(t)/2,i=.5+Math.sin(t)/2;this.vertices.push(new T.default.Vector(r,i,0)),this.uvs.push([r,i]),e>5&31)/31,(y>>10&31)/31):(r=a,i=s,l)}for(var b=1;b<=3;b++){var _=p+12*b,x=new S.default.Vector(u.getFloat32(_,!0),u.getFloat32(8+_,!0),u.getFloat32(4+_,!0));e.vertices.push(x),c&&o.push(r,i,n)}var w=new S.default.Vector(m,g,v);e.vertexNormals.push(w,w,w),e.faces.push([3*d,3*d+1,3*d+2]),e.uvs.push([0,0],[0,0],[0,0])}}(e,t);else{var r=new DataView(t);if(!("TextDecoder"in window))return console.warn("Sorry, ASCII STL loading only works in browsers that support TextDecoder (https://caniuse.com/#feat=textencoder)");var i=new TextDecoder("utf-8").decode(r).split("\n");!function(e,t){for(var r,i,n="",o=[],a=0;aMath.PI?l=Math.PI:l<=0&&(l=.001);var u=Math.sin(l)*a*Math.sin(s),h=Math.cos(l)*a,c=Math.sin(l)*a*Math.cos(s);this.camera(u+this.centerX,h+this.centerY,c+this.centerZ,this.centerX,this.centerY,this.centerZ,0,1,0)},m.default.Camera.prototype._isActive=function(){return this===this._renderer._curCamera},m.default.prototype.setCamera=function(e){this._renderer._curCamera=e,this._renderer.uPMatrix.set(e.projMatrix.mat4[0],e.projMatrix.mat4[1],e.projMatrix.mat4[2],e.projMatrix.mat4[3],e.projMatrix.mat4[4],e.projMatrix.mat4[5],e.projMatrix.mat4[6],e.projMatrix.mat4[7],e.projMatrix.mat4[8],e.projMatrix.mat4[9],e.projMatrix.mat4[10],e.projMatrix.mat4[11],e.projMatrix.mat4[12],e.projMatrix.mat4[13],e.projMatrix.mat4[14],e.projMatrix.mat4[15])};var n=m.default.Camera;r.default=n},{"../core/main":49}],98:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i,h=(i=e("../core/main"))&&i.__esModule?i:{default:i};h.default.Geometry=function(e,t,r){return this.vertices=[],this.lineVertices=[],this.lineNormals=[],this.vertexNormals=[],this.faces=[],this.uvs=[],this.edges=[],this.vertexColors=[],this.detailX=void 0!==e?e:1,this.detailY=void 0!==t?t:1,this.dirtyFlags={},r instanceof Function&&r.call(this),this},h.default.Geometry.prototype.reset=function(){this.lineVertices.length=0,this.lineNormals.length=0,this.vertices.length=0,this.edges.length=0,this.vertexColors.length=0,this.vertexNormals.length=0,this.uvs.length=0,this.dirtyFlags={}},h.default.Geometry.prototype.computeFaces=function(){this.faces.length=0;for(var e,t,r,i,n=this.detailX+1,o=0;othis.vertices.length-1-this.detailX;i--)e.add(this.vertexNormals[i]);e=h.default.Vector.div(e,this.detailX);for(var n=this.vertices.length-1;n>this.vertices.length-1-this.detailX;n--)this.vertexNormals[n]=e;return this},h.default.Geometry.prototype._makeTriangleEdges=function(){if(this.edges.length=0,Array.isArray(this.strokeIndices))for(var e=0,t=this.strokeIndices.length;e vTexCoord.y;\n bool y1 = p1.y > vTexCoord.y;\n bool y2 = p2.y > vTexCoord.y;\n\n // could web be under the curve (after t1)?\n if (y1 ? !y2 : y0) {\n // add the coverage for t1\n coverage.x += saturate(C1.x + 0.5);\n // calculate the anti-aliasing for t1\n weight.x = min(weight.x, abs(C1.x));\n }\n\n // are we outside the curve (after t2)?\n if (y1 ? !y0 : y2) {\n // subtract the coverage for t2\n coverage.x -= saturate(C2.x + 0.5);\n // calculate the anti-aliasing for t2\n weight.x = min(weight.x, abs(C2.x));\n }\n}\n\n// this is essentially the same as coverageX, but with the axes swapped\nvoid coverageY(vec2 p0, vec2 p1, vec2 p2) {\n\n vec2 C1, C2;\n calulateCrossings(p0, p1, p2, C1, C2);\n\n bool x0 = p0.x > vTexCoord.x;\n bool x1 = p1.x > vTexCoord.x;\n bool x2 = p2.x > vTexCoord.x;\n\n if (x1 ? !x2 : x0) {\n coverage.y -= saturate(C1.y + 0.5);\n weight.y = min(weight.y, abs(C1.y));\n }\n\n if (x1 ? !x0 : x2) {\n coverage.y += saturate(C2.y + 0.5);\n weight.y = min(weight.y, abs(C2.y));\n }\n}\n\nvoid main() {\n\n // calculate the pixel scale based on screen-coordinates\n pixelScale = hardness / fwidth(vTexCoord);\n\n // which grid cell is this pixel in?\n ivec2 gridCoord = ifloor(vTexCoord * vec2(uGridSize));\n\n // intersect curves in this row\n {\n // the index into the row info bitmap\n int rowIndex = gridCoord.y + uGridOffset.y;\n // fetch the info texel\n vec4 rowInfo = getTexel(uSamplerRows, rowIndex, uGridImageSize);\n // unpack the rowInfo\n int rowStrokeIndex = getInt16(rowInfo.xy);\n int rowStrokeCount = getInt16(rowInfo.zw);\n\n for (int iRowStroke = INT(0); iRowStroke < N; iRowStroke++) {\n if (iRowStroke >= rowStrokeCount)\n break;\n\n // each stroke is made up of 3 points: the start and control point\n // and the start of the next curve.\n // fetch the indices of this pair of strokes:\n vec4 strokeIndices = getTexel(uSamplerRowStrokes, rowStrokeIndex++, uCellsImageSize);\n\n // unpack the stroke index\n int strokePos = getInt16(strokeIndices.xy);\n\n // fetch the two strokes\n vec4 stroke0 = getTexel(uSamplerStrokes, strokePos + INT(0), uStrokeImageSize);\n vec4 stroke1 = getTexel(uSamplerStrokes, strokePos + INT(1), uStrokeImageSize);\n\n // calculate the coverage\n coverageX(stroke0.xy, stroke0.zw, stroke1.xy);\n }\n }\n\n // intersect curves in this column\n {\n int colIndex = gridCoord.x + uGridOffset.x;\n vec4 colInfo = getTexel(uSamplerCols, colIndex, uGridImageSize);\n int colStrokeIndex = getInt16(colInfo.xy);\n int colStrokeCount = getInt16(colInfo.zw);\n \n for (int iColStroke = INT(0); iColStroke < N; iColStroke++) {\n if (iColStroke >= colStrokeCount)\n break;\n\n vec4 strokeIndices = getTexel(uSamplerColStrokes, colStrokeIndex++, uCellsImageSize);\n\n int strokePos = getInt16(strokeIndices.xy);\n vec4 stroke0 = getTexel(uSamplerStrokes, strokePos + INT(0), uStrokeImageSize);\n vec4 stroke1 = getTexel(uSamplerStrokes, strokePos + INT(1), uStrokeImageSize);\n coverageY(stroke0.xy, stroke0.zw, stroke1.xy);\n }\n }\n\n weight = saturate(1.0 - weight * 2.0);\n float distance = max(weight.x + weight.y, minDistance); // manhattan approx.\n float antialias = abs(dot(coverage, weight) / distance);\n float cover = min(abs(coverage.x), abs(coverage.y));\n gl_FragColor = uMaterialColor;\n gl_FragColor.a *= saturate(max(antialias, cover));\n}",lineVert:"/*\n Part of the Processing project - http://processing.org\n Copyright (c) 2012-15 The Processing Foundation\n Copyright (c) 2004-12 Ben Fry and Casey Reas\n Copyright (c) 2001-04 Massachusetts Institute of Technology\n This library is free software; you can redistribute it and/or\n modify it under the terms of the GNU Lesser General Public\n License as published by the Free Software Foundation, version 2.1.\n This library is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n Lesser General Public License for more details.\n You should have received a copy of the GNU Lesser General\n Public License along with this library; if not, write to the\n Free Software Foundation, Inc., 59 Temple Place, Suite 330,\n Boston, MA 02111-1307 USA\n*/\n\n#define PROCESSING_LINE_SHADER\n\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nuniform float uStrokeWeight;\n\nuniform vec4 uViewport;\nuniform int uPerspective;\n\nattribute vec4 aPosition;\nattribute vec4 aDirection;\n \nvoid main() {\n // using a scale <1 moves the lines towards the camera\n // in order to prevent popping effects due to half of\n // the line disappearing behind the geometry faces.\n vec3 scale = vec3(0.9995);\n\n vec4 posp = uModelViewMatrix * aPosition;\n vec4 posq = uModelViewMatrix * (aPosition + vec4(aDirection.xyz, 0));\n\n // Moving vertices slightly toward the camera\n // to avoid depth-fighting with the fill triangles.\n // Discussed here:\n // http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Number=252848 \n posp.xyz = posp.xyz * scale;\n posq.xyz = posq.xyz * scale;\n\n vec4 p = uProjectionMatrix * posp;\n vec4 q = uProjectionMatrix * posq;\n\n // formula to convert from clip space (range -1..1) to screen space (range 0..[width or height])\n // screen_p = (p.xy/p.w + <1,1>) * 0.5 * uViewport.zw\n\n // prevent division by W by transforming the tangent formula (div by 0 causes\n // the line to disappear, see https://github.com/processing/processing/issues/5183)\n // t = screen_q - screen_p\n //\n // tangent is normalized and we don't care which aDirection it points to (+-)\n // t = +- normalize( screen_q - screen_p )\n // t = +- normalize( (q.xy/q.w+<1,1>)*0.5*uViewport.zw - (p.xy/p.w+<1,1>)*0.5*uViewport.zw )\n //\n // extract common factor, <1,1> - <1,1> cancels out\n // t = +- normalize( (q.xy/q.w - p.xy/p.w) * 0.5 * uViewport.zw )\n //\n // convert to common divisor\n // t = +- normalize( ((q.xy*p.w - p.xy*q.w) / (p.w*q.w)) * 0.5 * uViewport.zw )\n //\n // remove the common scalar divisor/factor, not needed due to normalize and +-\n // (keep uViewport - can't remove because it has different components for x and y\n // and corrects for aspect ratio, see https://github.com/processing/processing/issues/5181)\n // t = +- normalize( (q.xy*p.w - p.xy*q.w) * uViewport.zw )\n\n vec2 tangent = normalize((q.xy*p.w - p.xy*q.w) * uViewport.zw);\n\n // flip tangent to normal (it's already normalized)\n vec2 normal = vec2(-tangent.y, tangent.x);\n\n float thickness = aDirection.w * uStrokeWeight;\n vec2 offset = normal * thickness / 2.0;\n\n vec2 curPerspScale;\n\n if(uPerspective == 1) {\n // Perspective ---\n // convert from world to clip by multiplying with projection scaling factor\n // to get the right thickness (see https://github.com/processing/processing/issues/5182)\n // invert Y, projections in Processing invert Y\n curPerspScale = (uProjectionMatrix * vec4(1, -1, 0, 0)).xy;\n } else {\n // No Perspective ---\n // multiply by W (to cancel out division by W later in the pipeline) and\n // convert from screen to clip (derived from clip to screen above)\n curPerspScale = p.w / (0.5 * uViewport.zw);\n }\n\n gl_Position.xy = p.xy + offset.xy * curPerspScale;\n gl_Position.zw = p.zw;\n}\n",lineFrag:"precision mediump float;\nprecision mediump int;\n\nuniform vec4 uMaterialColor;\n\nvoid main() {\n gl_FragColor = uMaterialColor;\n}",pointVert:"attribute vec3 aPosition;\nuniform float uPointSize;\nvarying float vStrokeWeight;\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nvoid main() {\n\tvec4 positionVec4 = vec4(aPosition, 1.0);\n\tgl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n\tgl_PointSize = uPointSize;\n\tvStrokeWeight = uPointSize;\n}",pointFrag:"precision mediump float;\nprecision mediump int;\nuniform vec4 uMaterialColor;\nvarying float vStrokeWeight;\n\nvoid main(){\n\tfloat mask = 0.0;\n\n\t// make a circular mask using the gl_PointCoord (goes from 0 - 1 on a point)\n // might be able to get a nicer edge on big strokeweights with smoothstep but slightly less performant\n\n\tmask = step(0.98, length(gl_PointCoord * 2.0 - 1.0));\n\n\t// if strokeWeight is 1 or less lets just draw a square\n\t// this prevents weird artifacting from carving circles when our points are really small\n\t// if strokeWeight is larger than 1, we just use it as is\n\n\tmask = mix(0.0, mask, clamp(floor(vStrokeWeight - 0.5),0.0,1.0));\n\n\t// throw away the borders of the mask\n // otherwise we get weird alpha blending issues\n\n\tif(mask > 0.98){\n discard;\n \t}\n\n \tgl_FragColor = vec4(uMaterialColor.rgb * (1.0 - mask), uMaterialColor.a) ;\n}"};u.default.RendererGL=function(e,t,r,i){return u.default.Renderer.call(this,e,t,r),this._setAttributeDefaults(t),this._initContext(),this.isP3D=!0,this.GL=this.drawingContext,this._isErasing=!1,this._enableLighting=!1,this.ambientLightColors=[],this.specularColors=[1,1,1],this.directionalLightDirections=[],this.directionalLightDiffuseColors=[],this.directionalLightSpecularColors=[],this.pointLightPositions=[],this.pointLightDiffuseColors=[],this.pointLightSpecularColors=[],this.spotLightPositions=[],this.spotLightDirections=[],this.spotLightDiffuseColors=[],this.spotLightSpecularColors=[],this.spotLightAngle=[],this.spotLightConc=[],this.drawMode=o.FILL,this.curFillColor=this._cachedFillStyle=[1,1,1,1],this.curStrokeColor=this._cachedStrokeStyle=[0,0,0,1],this.curBlendMode=o.BLEND,this._cachedBlendMode=void 0,this.blendExt=this.GL.getExtension("EXT_blend_minmax"),this._isBlending=!1,this._useSpecularMaterial=!1,this._useEmissiveMaterial=!1,this._useNormalMaterial=!1,this._useShininess=1,this._tint=[255,255,255,255],this.constantAttenuation=1,this.linearAttenuation=0,this.quadraticAttenuation=0,this.uMVMatrix=new u.default.Matrix,this.uPMatrix=new u.default.Matrix,this.uNMatrix=new u.default.Matrix("mat3"),this._curCamera=new u.default.Camera(this),this._curCamera._computeCameraDefaultSettings(),this._curCamera._setDefaultCamera(),this._defaultLightShader=void 0,this._defaultImmediateModeShader=void 0,this._defaultNormalShader=void 0,this._defaultColorShader=void 0,this._defaultPointShader=void 0,this.userFillShader=void 0,this.userStrokeShader=void 0,this.userPointShader=void 0,this.retainedMode={geometry:{},buffers:{stroke:[new u.default.RenderBuffer(3,"lineVertices","lineVertexBuffer","aPosition",this,this._flatten),new u.default.RenderBuffer(4,"lineNormals","lineNormalBuffer","aDirection",this,this._flatten)],fill:[new u.default.RenderBuffer(3,"vertices","vertexBuffer","aPosition",this,this._vToNArray),new u.default.RenderBuffer(3,"vertexNormals","normalBuffer","aNormal",this,this._vToNArray),new u.default.RenderBuffer(4,"vertexColors","colorBuffer","aMaterialColor",this),new u.default.RenderBuffer(3,"vertexAmbients","ambientBuffer","aAmbientColor",this),new u.default.RenderBuffer(2,"uvs","uvBuffer","aTexCoord",this,this._flatten)],text:[new u.default.RenderBuffer(3,"vertices","vertexBuffer","aPosition",this,this._vToNArray),new u.default.RenderBuffer(2,"uvs","uvBuffer","aTexCoord",this,this._flatten)]}},this.immediateMode={geometry:new u.default.Geometry,shapeMode:o.TRIANGLE_FAN,_bezierVertex:[],_quadraticVertex:[],_curveVertex:[],buffers:{fill:[new u.default.RenderBuffer(3,"vertices","vertexBuffer","aPosition",this,this._vToNArray),new u.default.RenderBuffer(3,"vertexNormals","normalBuffer","aNormal",this,this._vToNArray),new u.default.RenderBuffer(4,"vertexColors","colorBuffer","aVertexColor",this),new u.default.RenderBuffer(3,"vertexAmbients","ambientBuffer","aAmbientColor",this),new u.default.RenderBuffer(2,"uvs","uvBuffer","aTexCoord",this,this._flatten)],stroke:[new u.default.RenderBuffer(3,"lineVertices","lineVertexBuffer","aPosition",this,this._flatten),new u.default.RenderBuffer(4,"lineNormals","lineNormalBuffer","aDirection",this,this._flatten)],point:this.GL.createBuffer()}},this.pointSize=5,this.curStrokeWeight=1,this.textures=[],this.textureMode=o.IMAGE,this.textureWrapX=o.CLAMP,this.textureWrapY=o.CLAMP,this._tex=null,this._curveTightness=6,this._lookUpTableBezier=[],this._lookUpTableQuadratic=[],this._lutBezierDetail=0,this._lutQuadraticDetail=0,this._tessy=this._initTessy(),this.fontInfos={},this._curShader=void 0,this},u.default.RendererGL.prototype=Object.create(u.default.Renderer.prototype),u.default.RendererGL.prototype._setAttributeDefaults=function(e){var t={alpha:!0,depth:!0,stencil:!0,antialias:navigator.userAgent.toLowerCase().includes("safari"),premultipliedAlpha:!1,preserveDrawingBuffer:!0,perPixelLighting:!0};null===e._glAttributes?e._glAttributes=t:e._glAttributes=Object.assign(t,e._glAttributes)},u.default.RendererGL.prototype._initContext=function(){try{if(this.drawingContext=this.canvas.getContext("webgl",this._pInst._glAttributes)||this.canvas.getContext("experimental-webgl",this._pInst._glAttributes),null===this.drawingContext)throw new Error("Error creating webgl context");var e=this.drawingContext;e.enable(e.DEPTH_TEST),e.depthFunc(e.LEQUAL),e.viewport(0,0,e.drawingBufferWidth,e.drawingBufferHeight),this._viewport=this.drawingContext.getParameter(this.drawingContext.VIEWPORT)}catch(e){throw e}},u.default.RendererGL.prototype._resetContext=function(e,t){var r=this.width,i=this.height,n=this.canvas.id,o=this._pInst instanceof u.default.Graphics;if(o){var a=this._pInst;a.canvas.parentNode.removeChild(a.canvas),a.canvas=document.createElement("canvas"),(a._pInst._userNode||document.body).appendChild(a.canvas),u.default.Element.call(a,a.canvas,a._pInst),a.width=r,a.height=i}else{var s=this.canvas;s&&s.parentNode.removeChild(s),(s=document.createElement("canvas")).id=n,this._pInst._userNode?this._pInst._userNode.appendChild(s):document.body.appendChild(s),this._pInst.canvas=s}var l=new u.default.RendererGL(this._pInst.canvas,this._pInst,!o);this._pInst._setProperty("_renderer",l),l.resize(r,i),l._applyDefaults(),o||this._pInst._elements.push(l),"function"==typeof t&&setTimeout(function(){t.apply(window._renderer,e)},0)},u.default.prototype.setAttributes=function(e,t){if(void 0!==this._glAttributes){var r=!0;if(void 0!==t?(null===this._glAttributes&&(this._glAttributes={}),this._glAttributes[e]!==t&&(this._glAttributes[e]=t,r=!1)):e instanceof Object&&this._glAttributes!==e&&(this._glAttributes=e,r=!1),this._renderer.isP3D&&!r){if(!this._setupDone)for(var i in this._renderer.retainedMode.geometry)if(this._renderer.retainedMode.geometry.hasOwnProperty(i))return void console.error("Sorry, Could not set the attributes, you need to call setAttributes() before calling the other drawing methods in setup()");this.push(),this._renderer._resetContext(),this.pop(),this._renderer._curCamera&&(this._renderer._curCamera._renderer=this._renderer)}}else console.log("You are trying to use setAttributes on a p5.Graphics object that does not use a WEBGL renderer.")},u.default.RendererGL.prototype._update=function(){this.uMVMatrix.set(this._curCamera.cameraMatrix.mat4[0],this._curCamera.cameraMatrix.mat4[1],this._curCamera.cameraMatrix.mat4[2],this._curCamera.cameraMatrix.mat4[3],this._curCamera.cameraMatrix.mat4[4],this._curCamera.cameraMatrix.mat4[5],this._curCamera.cameraMatrix.mat4[6],this._curCamera.cameraMatrix.mat4[7],this._curCamera.cameraMatrix.mat4[8],this._curCamera.cameraMatrix.mat4[9],this._curCamera.cameraMatrix.mat4[10],this._curCamera.cameraMatrix.mat4[11],this._curCamera.cameraMatrix.mat4[12],this._curCamera.cameraMatrix.mat4[13],this._curCamera.cameraMatrix.mat4[14],this._curCamera.cameraMatrix.mat4[15]),this.ambientLightColors.length=0,this.specularColors=[1,1,1],this.directionalLightDirections.length=0,this.directionalLightDiffuseColors.length=0,this.directionalLightSpecularColors.length=0,this.pointLightPositions.length=0,this.pointLightDiffuseColors.length=0,this.pointLightSpecularColors.length=0,this.spotLightPositions.length=0,this.spotLightDirections.length=0,this.spotLightDiffuseColors.length=0,this.spotLightSpecularColors.length=0,this.spotLightAngle.length=0,this.spotLightConc.length=0,this._enableLighting=!1,this._tint=[255,255,255,255],this.GL.clear(this.GL.DEPTH_BUFFER_BIT)},u.default.RendererGL.prototype.background=function(){var e,t=(e=this._pInst).color.apply(e,arguments),r=t.levels[0]/255,i=t.levels[1]/255,n=t.levels[2]/255,o=t.levels[3]/255;this.GL.clearColor(r,i,n,o),this.GL.clear(this.GL.COLOR_BUFFER_BIT)},u.default.RendererGL.prototype.fill=function(e,t,r,i){var n=u.default.prototype.color.apply(this._pInst,arguments);this.curFillColor=n._array,this.drawMode=o.FILL,this._useNormalMaterial=!1,this._tex=null},u.default.RendererGL.prototype.stroke=function(e,t,r,i){arguments[3]=255;var n=u.default.prototype.color.apply(this._pInst,arguments);this.curStrokeColor=n._array},u.default.RendererGL.prototype.strokeCap=function(e){console.error("Sorry, strokeCap() is not yet implemented in WEBGL mode")},u.default.RendererGL.prototype.strokeJoin=function(e){console.error("Sorry, strokeJoin() is not yet implemented in WEBGL mode")},u.default.RendererGL.prototype.filter=function(e){console.error("filter() does not work in WEBGL mode")},u.default.RendererGL.prototype.blendMode=function(e){e===o.DARKEST||e===o.LIGHTEST||e===o.ADD||e===o.BLEND||e===o.SUBTRACT||e===o.SCREEN||e===o.EXCLUSION||e===o.REPLACE||e===o.MULTIPLY||e===o.REMOVE?this.curBlendMode=e:e!==o.BURN&&e!==o.OVERLAY&&e!==o.HARD_LIGHT&&e!==o.SOFT_LIGHT&&e!==o.DODGE||console.warn("BURN, OVERLAY, HARD_LIGHT, SOFT_LIGHT, and DODGE only work for blendMode in 2D mode.")},u.default.RendererGL.prototype.erase=function(e,t){this._isErasing||(this._cachedBlendMode=this.curBlendMode,this.blendMode(o.REMOVE),this._cachedFillStyle=this.curFillColor.slice(),this.curFillColor=[1,1,1,e/255],this._cachedStrokeStyle=this.curStrokeColor.slice(),this.curStrokeColor=[1,1,1,t/255],this._isErasing=!0)},u.default.RendererGL.prototype.noErase=function(){this._isErasing&&(this.curFillColor=this._cachedFillStyle.slice(),this.curStrokeColor=this._cachedStrokeStyle.slice(),this.blendMode(this._cachedBlendMode),this._isErasing=!1)},u.default.RendererGL.prototype.strokeWeight=function(e){this.curStrokeWeight!==e&&(this.pointSize=e,this.curStrokeWeight=e)},u.default.RendererGL.prototype._getPixel=function(e,t){var r;return r=new Uint8Array(4),this.drawingContext.readPixels(e,t,1,1,this.drawingContext.RGBA,this.drawingContext.UNSIGNED_BYTE,r),[r[0],r[1],r[2],r[3]]},u.default.RendererGL.prototype.loadPixels=function(){var e=this._pixelsState;if(!0===this._pInst._glAttributes.preserveDrawingBuffer){var t=e.pixels,r=this.GL.drawingBufferWidth*this.GL.drawingBufferHeight*4;t instanceof Uint8Array&&t.length===r||(t=new Uint8Array(r),this._pixelsState._setProperty("pixels",t));var i=this._pInst._pixelDensity;this.GL.readPixels(0,0,this.width*i,this.height*i,this.GL.RGBA,this.GL.UNSIGNED_BYTE,t)}else console.log("loadPixels only works in WebGL when preserveDrawingBuffer is true.")},u.default.RendererGL.prototype.geometryInHash=function(e){return void 0!==this.retainedMode.geometry[e]},u.default.RendererGL.prototype.resize=function(e,t){u.default.Renderer.prototype.resize.call(this,e,t),this.GL.viewport(0,0,this.GL.drawingBufferWidth,this.GL.drawingBufferHeight),this._viewport=this.GL.getParameter(this.GL.VIEWPORT),this._curCamera._resize();var r=this._pixelsState;void 0!==r.pixels&&r._setProperty("pixels",new Uint8Array(this.GL.drawingBufferWidth*this.GL.drawingBufferHeight*4))},u.default.RendererGL.prototype.clear=function(){var e=(arguments.length<=0?void 0:arguments[0])||0,t=(arguments.length<=1?void 0:arguments[1])||0,r=(arguments.length<=2?void 0:arguments[2])||0,i=(arguments.length<=3?void 0:arguments[3])||0;this.GL.clearColor(e,t,r,i),this.GL.clear(this.GL.COLOR_BUFFER_BIT|this.GL.DEPTH_BUFFER_BIT)},u.default.RendererGL.prototype.applyMatrix=function(e,t,r,i,n,o){16===arguments.length?u.default.Matrix.prototype.apply.apply(this.uMVMatrix,arguments):this.uMVMatrix.apply([e,t,0,0,r,i,0,0,0,0,1,0,n,o,0,1])},u.default.RendererGL.prototype.translate=function(e,t,r){return e instanceof u.default.Vector&&(r=e.z,t=e.y,e=e.x),this.uMVMatrix.translate([e,t,r]),this},u.default.RendererGL.prototype.scale=function(e,t,r){return this.uMVMatrix.scale(e,t,r),this},u.default.RendererGL.prototype.rotate=function(e,t){return void 0===t?this.rotateZ(e):(u.default.Matrix.prototype.rotate.apply(this.uMVMatrix,arguments),this)},u.default.RendererGL.prototype.rotateX=function(e){return this.rotate(e,1,0,0),this},u.default.RendererGL.prototype.rotateY=function(e){return this.rotate(e,0,1,0),this},u.default.RendererGL.prototype.rotateZ=function(e){return this.rotate(e,0,0,1),this},u.default.RendererGL.prototype.push=function(){var e=u.default.Renderer.prototype.push.apply(this),t=e.properties;return t.uMVMatrix=this.uMVMatrix.copy(),t.uPMatrix=this.uPMatrix.copy(),t._curCamera=this._curCamera,this._curCamera=this._curCamera.copy(),t.ambientLightColors=this.ambientLightColors.slice(),t.specularColors=this.specularColors.slice(),t.directionalLightDirections=this.directionalLightDirections.slice(),t.directionalLightDiffuseColors=this.directionalLightDiffuseColors.slice(),t.directionalLightSpecularColors=this.directionalLightSpecularColors.slice(),t.pointLightPositions=this.pointLightPositions.slice(),t.pointLightDiffuseColors=this.pointLightDiffuseColors.slice(),t.pointLightSpecularColors=this.pointLightSpecularColors.slice(),t.spotLightPositions=this.spotLightPositions.slice(),t.spotLightDirections=this.spotLightDirections.slice(),t.spotLightDiffuseColors=this.spotLightDiffuseColors.slice(),t.spotLightSpecularColors=this.spotLightSpecularColors.slice(),t.spotLightAngle=this.spotLightAngle.slice(),t.spotLightConc=this.spotLightConc.slice(),t.userFillShader=this.userFillShader,t.userStrokeShader=this.userStrokeShader,t.userPointShader=this.userPointShader,t.pointSize=this.pointSize,t.curStrokeWeight=this.curStrokeWeight,t.curStrokeColor=this.curStrokeColor,t.curFillColor=this.curFillColor,t._useSpecularMaterial=this._useSpecularMaterial,t._useEmissiveMaterial=this._useEmissiveMaterial,t._useShininess=this._useShininess,t.constantAttenuation=this.constantAttenuation,t.linearAttenuation=this.linearAttenuation,t.quadraticAttenuation=this.quadraticAttenuation,t._enableLighting=this._enableLighting,t._useNormalMaterial=this._useNormalMaterial,t._tex=this._tex,t.drawMode=this.drawMode,e},u.default.RendererGL.prototype.resetMatrix=function(){return this.uMVMatrix=u.default.Matrix.identity(this._pInst),this},u.default.RendererGL.prototype._getImmediateStrokeShader=function(){var e=this.userStrokeShader;return e&&e.isStrokeShader()?e:this._getLineShader()},u.default.RendererGL.prototype._getRetainedStrokeShader=u.default.RendererGL.prototype._getImmediateStrokeShader,u.default.RendererGL.prototype._getImmediateFillShader=function(){var e=this.userFillShader;if(this._useNormalMaterial&&(!e||!e.isNormalShader()))return this._getNormalShader();if(this._enableLighting){if(!e||!e.isLightShader())return this._getLightShader()}else if(this._tex){if(!e||!e.isTextureShader())return this._getLightShader()}else if(!e)return this._getImmediateModeShader();return e},u.default.RendererGL.prototype._getRetainedFillShader=function(){if(this._useNormalMaterial)return this._getNormalShader();var e=this.userFillShader;if(this._enableLighting){if(!e||!e.isLightShader())return this._getLightShader()}else if(this._tex){if(!e||!e.isTextureShader())return this._getLightShader()}else if(!e)return this._getColorShader();return e},u.default.RendererGL.prototype._getImmediatePointShader=function(){var e=this.userPointShader;return e&&e.isPointShader()?e:this._getPointShader()},u.default.RendererGL.prototype._getRetainedLineShader=u.default.RendererGL.prototype._getImmediateLineShader,u.default.RendererGL.prototype._getLightShader=function(){return this._defaultLightShader||(this._pInst._glAttributes.perPixelLighting?this._defaultLightShader=new u.default.Shader(this,c.phongVert,c.phongFrag):this._defaultLightShader=new u.default.Shader(this,c.lightVert,c.lightTextureFrag)),this._defaultLightShader},u.default.RendererGL.prototype._getImmediateModeShader=function(){return this._defaultImmediateModeShader||(this._defaultImmediateModeShader=new u.default.Shader(this,c.immediateVert,c.vertexColorFrag)),this._defaultImmediateModeShader},u.default.RendererGL.prototype._getNormalShader=function(){return this._defaultNormalShader||(this._defaultNormalShader=new u.default.Shader(this,c.normalVert,c.normalFrag)),this._defaultNormalShader},u.default.RendererGL.prototype._getColorShader=function(){return this._defaultColorShader||(this._defaultColorShader=new u.default.Shader(this,c.normalVert,c.basicFrag)),this._defaultColorShader},u.default.RendererGL.prototype._getPointShader=function(){return this._defaultPointShader||(this._defaultPointShader=new u.default.Shader(this,c.pointVert,c.pointFrag)),this._defaultPointShader},u.default.RendererGL.prototype._getLineShader=function(){return this._defaultLineShader||(this._defaultLineShader=new u.default.Shader(this,c.lineVert,c.lineFrag)),this._defaultLineShader},u.default.RendererGL.prototype._getFontShader=function(){return this._defaultFontShader||(this.GL.getExtension("OES_standard_derivatives"),this._defaultFontShader=new u.default.Shader(this,c.fontVert,c.fontFrag)),this._defaultFontShader},u.default.RendererGL.prototype._getEmptyTexture=function(){if(!this._emptyTexture){var e=new u.default.Image(1,1);e.set(0,0,255),this._emptyTexture=new u.default.Texture(this,e)}return this._emptyTexture},u.default.RendererGL.prototype.getTexture=function(e){var t=this.textures,r=!0,i=!1,n=void 0;try{for(var o,a=t[Symbol.iterator]();!(r=(o=a.next()).done);r=!0){var s=o.value;if(s.src===e)return s}}catch(e){i=!0,n=e}finally{try{r||null==a.return||a.return()}finally{if(i)throw n}}var l=new u.default.Texture(this,e);return t.push(l),l},u.default.RendererGL.prototype._setStrokeUniforms=function(e){e.bindShader(),e.setUniform("uMaterialColor",this.curStrokeColor),e.setUniform("uStrokeWeight",this.curStrokeWeight)},u.default.RendererGL.prototype._setFillUniforms=function(e){e.bindShader(),e.setUniform("uMaterialColor",this.curFillColor),e.setUniform("isTexture",!!this._tex),this._tex&&e.setUniform("uSampler",this._tex),e.setUniform("uTint",this._tint),e.setUniform("uSpecular",this._useSpecularMaterial),e.setUniform("uEmissive",this._useEmissiveMaterial),e.setUniform("uShininess",this._useShininess),e.setUniform("uUseLighting",this._enableLighting);var t=this.pointLightDiffuseColors.length/3;e.setUniform("uPointLightCount",t),e.setUniform("uPointLightLocation",this.pointLightPositions),e.setUniform("uPointLightDiffuseColors",this.pointLightDiffuseColors),e.setUniform("uPointLightSpecularColors",this.pointLightSpecularColors);var r=this.directionalLightDiffuseColors.length/3;e.setUniform("uDirectionalLightCount",r),e.setUniform("uLightingDirection",this.directionalLightDirections),e.setUniform("uDirectionalDiffuseColors",this.directionalLightDiffuseColors),e.setUniform("uDirectionalSpecularColors",this.directionalLightSpecularColors);var i=this.ambientLightColors.length/3;e.setUniform("uAmbientLightCount",i),e.setUniform("uAmbientColor",this.ambientLightColors);var n=this.spotLightDiffuseColors.length/3;e.setUniform("uSpotLightCount",n),e.setUniform("uSpotLightAngle",this.spotLightAngle),e.setUniform("uSpotLightConc",this.spotLightConc),e.setUniform("uSpotLightDiffuseColors",this.spotLightDiffuseColors),e.setUniform("uSpotLightSpecularColors",this.spotLightSpecularColors),e.setUniform("uSpotLightLocation",this.spotLightPositions),e.setUniform("uSpotLightDirection",this.spotLightDirections),e.setUniform("uConstantAttenuation",this.constantAttenuation),e.setUniform("uLinearAttenuation",this.linearAttenuation),e.setUniform("uQuadraticAttenuation",this.quadraticAttenuation),e.bindTextures()},u.default.RendererGL.prototype._setPointUniforms=function(e){e.bindShader(),e.setUniform("uMaterialColor",this.curStrokeColor),e.setUniform("uPointSize",this.pointSize)},u.default.RendererGL.prototype._bindBuffer=function(e,t,r,i,n){if(t=t||this.GL.ARRAY_BUFFER,this.GL.bindBuffer(t,e),void 0!==r){var o=new(i||Float32Array)(r);this.GL.bufferData(t,o,n||this.GL.STATIC_DRAW)}},u.default.RendererGL.prototype._arraysEqual=function(e,t){var r=e.length;if(r!==t.length)return!1;for(var i=0;i>7,127&f,c>>7,127&c);for(var d=0;d>7,127&p,0,0)}}return{cellImageInfo:l,dimOffset:o,dimImageInfo:n}}return(t=this.glyphInfos[e.index]={glyph:e,uGlyphRect:[i.x1,-i.y1,i.x2,-i.y2],strokeImageInfo:U,strokes:d,colInfo:G(m,this.colDimImageInfos,this.colCellImageInfos),rowInfo:G(p,this.rowDimImageInfos,this.rowCellImageInfos)}).uGridOffset=[t.colInfo.dimOffset,t.rowInfo.dimOffset],t}}var z=Math.sqrt(3);j.default.RendererGL.prototype._renderText=function(e,t,r,i,n){if(this._textFont&&"string"!=typeof this._textFont){if(!(n<=i)&&this._doFill){if(!this._isOpenType())return console.log("WEBGL: only Opentype (.otf) and Truetype (.ttf) fonts are supported"),e;e.push();var o=this._doStroke,a=this.drawMode;this._doStroke=!1,this.drawMode=D.TEXTURE;var s=this._textFont.font,l=this._textFont._fontInfo;l=l||(this._textFont._fontInfo=new A(s));var u=this._textFont._handleAlignment(this,t,r,i),h=this._textSize/s.unitsPerEm;this.translate(u.x,u.y,0),this.scale(h,h,1);var c=this.GL,f=!this._defaultFontShader,d=this._getFontShader();d.init(),d.bindShader(),f&&(d.setUniform("uGridImageSize",[64,64]),d.setUniform("uCellsImageSize",[64,64]),d.setUniform("uStrokeImageSize",[64,64]),d.setUniform("uGridSize",[9,9])),this._applyColorBlend(this.curFillColor);var p=this.retainedMode.geometry.glyph;if(!p){var m=this._textGeom=new j.default.Geometry(1,1,function(){for(var e=0;e<=1;e++)for(var t=0;t<=1;t++)this.vertices.push(new j.default.Vector(t,e,0)),this.uvs.push(t,e)});m.computeFaces().computeNormals(),p=this.createBuffers("glyph",m)}var g=!0,v=!1,y=void 0;try{for(var b,_=this.retainedMode.buffers.text[Symbol.iterator]();!(g=(b=_.next()).done);g=!0){b.value._prepareBuffer(p,d)}}catch(e){v=!0,y=e}finally{try{g||null==_.return||_.return()}finally{if(v)throw y}}this._bindBuffer(p.indexBuffer,c.ELEMENT_ARRAY_BUFFER),d.setUniform("uMaterialColor",this.curFillColor);try{var x=0,w=null,S=s.stringToGlyphs(t),M=!0,E=!1,T=void 0;try{for(var C,P=S[Symbol.iterator]();!(M=(C=P.next()).done);M=!0){var L=C.value;w&&(x+=s.getKerningValue(w,L));var k=l.getGlyphInfo(L);if(k.uGlyphRect){var R=k.rowInfo,O=k.colInfo;d.setUniform("uSamplerStrokes",k.strokeImageInfo.imageData),d.setUniform("uSamplerRowStrokes",R.cellImageInfo.imageData),d.setUniform("uSamplerRows",R.dimImageInfo.imageData),d.setUniform("uSamplerColStrokes",O.cellImageInfo.imageData),d.setUniform("uSamplerCols",O.dimImageInfo.imageData),d.setUniform("uGridOffset",k.uGridOffset),d.setUniform("uGlyphRect",k.uGlyphRect),d.setUniform("uGlyphOffset",x),d.bindTextures(),c.drawElements(c.TRIANGLES,6,this.GL.UNSIGNED_SHORT,0)}x+=L.advanceWidth,w=L}}catch(e){E=!0,T=e}finally{try{M||null==P.return||P.return()}finally{if(E)throw T}}}finally{d.unbindShader(),this._doStroke=o,this.drawMode=a,e.pop()}return e}}else console.log("WEBGL: you must load and set a font before drawing text. See `loadFont` and `textFont` for more details.")}},{"../core/constants":42,"../core/main":49,"./p5.RendererGL.Retained":102,"./p5.Shader":104}],107:[function(e,t,r){t.exports={fes:{autoplay:"The media that tried to play (with '{{src}}') wasn't allowed to by this browser, most likely due to the browser's autoplay policy. Check out {{link}} for more information about why.",fileLoadError:{bytes:"It looks like there was a problem loading your file. {{suggestion}}",font:"It looks like there was a problem loading your font. {{suggestion}}",gif:"There was some trouble loading your GIF. Make sure that your GIF is using 87a or 89a encoding.",image:"It looks like there was a problem loading your image. {{suggestion}}",json:"It looks like there was a problem loading your JSON file. {{suggestion}}",large:"If your large file isn't fetched successfully, we recommend splitting the file into smaller segments and fetching those.",strings:"It looks like there was a problem loading your text file. {{suggestion}}",suggestion:"Try checking if the file path ({{filePath}}) is correct, hosting the file online, or running a local server. (More info at {{link}})",table:"It looks like there was a problem loading your table file. {{suggestion}}",xml:"It looks like there was a problem loading your XML file. {{suggestion}}"},misusedTopLevel:"Did you just try to use p5.js's {{symbolName}} {{symbolType}}? If so, you may want to move it into your sketch's setup() function.\n\nFor more details, see: {{link}}",pre:"🌸 p5.js says: {{message}}",welcome:"Welcome! This is your friendly debugger. To turn me off, switch to using p5.min.js."}}},{}],108:[function(e,t,r){t.exports={fes:{autoplay:"Su browser impidío un medio tocar (de '{{src}}'), posiblemente porque las reglas de autoplay. Para aprender más, visite {{link}}.",fileLoadError:{bytes:"",font:"",gif:"",image:"",json:"",large:"",strings:"",suggestion:"",table:"",xml:""},misusedTopLevel:"",pre:"🌸 p5.js dice: {{message}}",welcome:""}}},{}],109:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i=o(e("./en/translation")),n=o(e("./es/translation"));function o(e){return e&&e.__esModule?e:{default:e}}var a={en:{translation:i.default},es:{translation:n.default}};r.default=a},{"./en/translation":107,"./es/translation":108}]},{},[37])(37)}); ================================================ FILE: docs/examples/transcrypt/sketch_010/target/org.transcrypt.__runtime__.js ================================================ // Transcrypt'ed from Python, 2021-11-02 13:06:18 var __name__ = 'org.transcrypt.__runtime__'; export var __envir__ = {}; __envir__.interpreter_name = 'python'; __envir__.transpiler_name = 'transcrypt'; __envir__.executor_name = __envir__.transpiler_name; __envir__.transpiler_version = '3.9.0'; export function __nest__ (headObject, tailNames, value) { var current = headObject; if (tailNames != '') { var tailChain = tailNames.split ('.'); var firstNewIndex = tailChain.length; for (var index = 0; index < tailChain.length; index++) { if (!current.hasOwnProperty (tailChain [index])) { firstNewIndex = index; break; } current = current [tailChain [index]]; } for (var index = firstNewIndex; index < tailChain.length; index++) { current [tailChain [index]] = {}; current = current [tailChain [index]]; } } for (let attrib of Object.getOwnPropertyNames (value)) { Object.defineProperty (current, attrib, { get () {return value [attrib];}, enumerable: true, configurable: true }); } }; export function __init__ (module) { if (!module.__inited__) { module.__all__.__init__ (module.__all__); module.__inited__ = true; } return module.__all__; }; export function __get__ (aThis, func, quotedFuncName) { if (aThis) { if (aThis.hasOwnProperty ('__class__') || typeof aThis == 'string' || aThis instanceof String) { if (quotedFuncName) { Object.defineProperty (aThis, quotedFuncName, { value: function () { var args = [] .slice.apply (arguments); return func.apply (null, [aThis] .concat (args)); }, writable: true, enumerable: true, configurable: true }); } return function () { var args = [] .slice.apply (arguments); return func.apply (null, [aThis.__proxy__ ? aThis.__proxy__ : aThis] .concat (args)); }; } else { return func; } } else { return func; } }; export function __getcm__ (aThis, func, quotedFuncName) { if (aThis.hasOwnProperty ('__class__')) { return function () { var args = [] .slice.apply (arguments); return func.apply (null, [aThis.__class__] .concat (args)); }; } else { return function () { var args = [] .slice.apply (arguments); return func.apply (null, [aThis] .concat (args)); }; } }; export function __getsm__ (aThis, func, quotedFuncName) { return func; }; export var py_metatype = { __name__: 'type', __bases__: [], __new__: function (meta, name, bases, attribs) { var cls = function () { var args = [] .slice.apply (arguments); return cls.__new__ (args); }; for (var index = bases.length - 1; index >= 0; index--) { var base = bases [index]; for (var attrib in base) { var descrip = Object.getOwnPropertyDescriptor (base, attrib); if (descrip == null) { continue; } Object.defineProperty (cls, attrib, descrip); } for (let symbol of Object.getOwnPropertySymbols (base)) { let descrip = Object.getOwnPropertyDescriptor (base, symbol); Object.defineProperty (cls, symbol, descrip); } } cls.__metaclass__ = meta; cls.__name__ = name.startsWith ('py_') ? name.slice (3) : name; cls.__bases__ = bases; for (var attrib in attribs) { var descrip = Object.getOwnPropertyDescriptor (attribs, attrib); Object.defineProperty (cls, attrib, descrip); } for (let symbol of Object.getOwnPropertySymbols (attribs)) { let descrip = Object.getOwnPropertyDescriptor (attribs, symbol); Object.defineProperty (cls, symbol, descrip); } return cls; } }; py_metatype.__metaclass__ = py_metatype; export var object = { __init__: function (self) {}, __metaclass__: py_metatype, __name__: 'object', __bases__: [], __new__: function (args) { var instance = Object.create (this, {__class__: {value: this, enumerable: true}}); if ('__getattr__' in this || '__setattr__' in this) { instance.__proxy__ = new Proxy (instance, { get: function (target, name) { let result = target [name]; if (result == undefined) { return target.__getattr__ (name); } else { return result; } }, set: function (target, name, value) { try { target.__setattr__ (name, value); } catch (exception) { target [name] = value; } return true; } }) instance = instance.__proxy__ } this.__init__.apply (null, [instance] .concat (args)); return instance; } }; export function __class__ (name, bases, attribs, meta) { if (meta === undefined) { meta = bases [0] .__metaclass__; } return meta.__new__ (meta, name, bases, attribs); }; export function __pragma__ () {}; export function __call__ (/* , , * */) { var args = [] .slice.apply (arguments); if (typeof args [0] == 'object' && '__call__' in args [0]) { return args [0] .__call__ .apply (args [1], args.slice (2)); } else { return args [0] .apply (args [1], args.slice (2)); } }; __envir__.executor_name = __envir__.transpiler_name; var __main__ = {__file__: ''}; var __except__ = null; export function __kwargtrans__ (anObject) { anObject.__kwargtrans__ = null; anObject.constructor = Object; return anObject; } export function __super__ (aClass, methodName) { for (let base of aClass.__bases__) { if (methodName in base) { return base [methodName]; } } throw new Exception ('Superclass method not found'); } export function property (getter, setter) { if (!setter) { setter = function () {}; } return {get: function () {return getter (this)}, set: function (value) {setter (this, value)}, enumerable: true}; } export function __setproperty__ (anObject, name, descriptor) { if (!anObject.hasOwnProperty (name)) { Object.defineProperty (anObject, name, descriptor); } } export function assert (condition, message) { if (!condition) { throw AssertionError (message, new Error ()); } } export function __mergekwargtrans__ (object0, object1) { var result = {}; for (var attrib in object0) { result [attrib] = object0 [attrib]; } for (var attrib in object1) { result [attrib] = object1 [attrib]; } return result; }; export function __mergefields__ (targetClass, sourceClass) { let fieldNames = ['__reprfields__', '__comparefields__', '__initfields__'] if (sourceClass [fieldNames [0]]) { if (targetClass [fieldNames [0]]) { for (let fieldName of fieldNames) { targetClass [fieldName] = new Set ([...targetClass [fieldName], ...sourceClass [fieldName]]); } } else { for (let fieldName of fieldNames) { targetClass [fieldName] = new Set (sourceClass [fieldName]); } } } } export function __withblock__ (manager, statements) { if (hasattr (manager, '__enter__')) { try { manager.__enter__ (); statements (); manager.__exit__ (); } catch (exception) { if (! (manager.__exit__ (exception.name, exception, exception.stack))) { throw exception; } } } else { statements (); manager.close (); } }; export function dir (obj) { var aList = []; for (var aKey in obj) { aList.push (aKey.startsWith ('py_') ? aKey.slice (3) : aKey); } aList.sort (); return aList; }; export function setattr (obj, name, value) { obj [name] = value; }; export function getattr (obj, name) { return name in obj ? obj [name] : obj ['py_' + name]; }; export function hasattr (obj, name) { try { return name in obj || 'py_' + name in obj; } catch (exception) { return false; } }; export function delattr (obj, name) { if (name in obj) { delete obj [name]; } else { delete obj ['py_' + name]; } }; export function __in__ (element, container) { if (container === undefined || container === null) { return false; } if (container.__contains__ instanceof Function) { return container.__contains__ (element); } else { return ( container.indexOf ? container.indexOf (element) > -1 : container.hasOwnProperty (element) ); } }; export function __specialattrib__ (attrib) { return (attrib.startswith ('__') && attrib.endswith ('__')) || attrib == 'constructor' || attrib.startswith ('py_'); }; export function len (anObject) { if (anObject === undefined || anObject === null) { return 0; } if (anObject.__len__ instanceof Function) { return anObject.__len__ (); } if (anObject.length !== undefined) { return anObject.length; } var length = 0; for (var attr in anObject) { if (!__specialattrib__ (attr)) { length++; } } return length; }; export function __i__ (any) { return py_typeof (any) == dict ? any.py_keys () : any; } export function __k__ (keyed, key) { var result = keyed [key]; if (typeof result == 'undefined') { if (keyed instanceof Array) if (key == +key && key >= 0 && keyed.length > key) return result; else throw IndexError (key, new Error()); else throw KeyError (key, new Error()); } return result; } export function __t__ (target) { return ( target === undefined || target === null ? false : ['boolean', 'number'] .indexOf (typeof target) >= 0 ? target : target.__bool__ instanceof Function ? (target.__bool__ () ? target : false) : target.__len__ instanceof Function ? (target.__len__ () !== 0 ? target : false) : target instanceof Function ? target : len (target) !== 0 ? target : false ); } export function float (any) { if (any == 'inf') { return Infinity; } else if (any == '-inf') { return -Infinity; } else if (any == 'nan') { return NaN; } else if (isNaN (parseFloat (any))) { if (any === false) { return 0; } else if (any === true) { return 1; } else { throw ValueError ("could not convert string to float: '" + str(any) + "'", new Error ()); } } else { return +any; } }; float.__name__ = 'float'; float.__bases__ = [object]; export function int (any) { return float (any) | 0 }; int.__name__ = 'int'; int.__bases__ = [object]; export function bool (any) { return !!__t__ (any); }; bool.__name__ = 'bool'; bool.__bases__ = [int]; export function py_typeof (anObject) { var aType = typeof anObject; if (aType == 'object') { try { return '__class__' in anObject ? anObject.__class__ : object; } catch (exception) { return aType; } } else { return ( aType == 'boolean' ? bool : aType == 'string' ? str : aType == 'number' ? (anObject % 1 == 0 ? int : float) : null ); } }; export function issubclass (aClass, classinfo) { if (classinfo instanceof Array) { for (let aClass2 of classinfo) { if (issubclass (aClass, aClass2)) { return true; } } return false; } try { var aClass2 = aClass; if (aClass2 == classinfo) { return true; } else { var bases = [].slice.call (aClass2.__bases__); while (bases.length) { aClass2 = bases.shift (); if (aClass2 == classinfo) { return true; } if (aClass2.__bases__.length) { bases = [].slice.call (aClass2.__bases__).concat (bases); } } return false; } } catch (exception) { return aClass == classinfo || classinfo == object; } }; export function isinstance (anObject, classinfo) { try { return '__class__' in anObject ? issubclass (anObject.__class__, classinfo) : issubclass (py_typeof (anObject), classinfo); } catch (exception) { return issubclass (py_typeof (anObject), classinfo); } }; export function callable (anObject) { return anObject && typeof anObject == 'object' && '__call__' in anObject ? true : typeof anObject === 'function'; }; export function repr (anObject) { try { return anObject.__repr__ (); } catch (exception) { try { return anObject.__str__ (); } catch (exception) { try { if (anObject == null) { return 'None'; } else if (anObject.constructor == Object) { var result = '{'; var comma = false; for (var attrib in anObject) { if (!__specialattrib__ (attrib)) { if (attrib.isnumeric ()) { var attribRepr = attrib; } else { var attribRepr = '\'' + attrib + '\''; } if (comma) { result += ', '; } else { comma = true; } result += attribRepr + ': ' + repr (anObject [attrib]); } } result += '}'; return result; } else { return typeof anObject == 'boolean' ? anObject.toString () .capitalize () : anObject.toString (); } } catch (exception) { return ''; } } } }; export function chr (charCode) { return String.fromCharCode (charCode); }; export function ord (aChar) { return aChar.charCodeAt (0); }; export function max (nrOrSeq) { return arguments.length == 1 ? Math.max (...nrOrSeq) : Math.max (...arguments); }; export function min (nrOrSeq) { return arguments.length == 1 ? Math.min (...nrOrSeq) : Math.min (...arguments); }; export var abs = Math.abs; export function round (number, ndigits) { if (ndigits) { var scale = Math.pow (10, ndigits); number *= scale; } var rounded = Math.round (number); if (rounded - number == 0.5 && rounded % 2) { rounded -= 1; } if (ndigits) { rounded /= scale; } return rounded; }; export function __jsUsePyNext__ () { try { var result = this.__next__ (); return {value: result, done: false}; } catch (exception) { return {value: undefined, done: true}; } } export function __pyUseJsNext__ () { var result = this.next (); if (result.done) { throw StopIteration (new Error ()); } else { return result.value; } } export function py_iter (iterable) { if (typeof iterable == 'string' || '__iter__' in iterable) { var result = iterable.__iter__ (); result.next = __jsUsePyNext__; } else if ('selector' in iterable) { var result = list (iterable) .__iter__ (); result.next = __jsUsePyNext__; } else if ('next' in iterable) { var result = iterable if (! ('__next__' in result)) { result.__next__ = __pyUseJsNext__; } } else if (Symbol.iterator in iterable) { var result = iterable [Symbol.iterator] (); result.__next__ = __pyUseJsNext__; } else { throw IterableError (new Error ()); } result [Symbol.iterator] = function () {return result;}; return result; } export function py_next (iterator) { try { var result = iterator.__next__ (); } catch (exception) { var result = iterator.next (); if (result.done) { throw StopIteration (new Error ()); } else { return result.value; } } if (result == undefined) { throw StopIteration (new Error ()); } else { return result; } } export function __PyIterator__ (iterable) { this.iterable = iterable; this.index = 0; } __PyIterator__.prototype.__next__ = function() { if (this.index < this.iterable.length) { return this.iterable [this.index++]; } else { throw StopIteration (new Error ()); } }; export function __JsIterator__ (iterable) { this.iterable = iterable; this.index = 0; } __JsIterator__.prototype.next = function () { if (this.index < this.iterable.py_keys.length) { return {value: this.index++, done: false}; } else { return {value: undefined, done: true}; } }; export function py_reversed (iterable) { iterable = iterable.slice (); iterable.reverse (); return iterable; }; export function zip () { var args = [] .slice.call (arguments); for (var i = 0; i < args.length; i++) { if (typeof args [i] == 'string') { args [i] = args [i] .split (''); } else if (!Array.isArray (args [i])) { args [i] = Array.from (args [i]); } } var shortest = args.length == 0 ? [] : args.reduce ( function (array0, array1) { return array0.length < array1.length ? array0 : array1; } ); return shortest.map ( function (current, index) { return args.map ( function (current) { return current [index]; } ); } ); }; export function range (start, stop, step) { if (stop == undefined) { stop = start; start = 0; } if (step == undefined) { step = 1; } if ((step > 0 && start >= stop) || (step < 0 && start <= stop)) { return []; } var result = []; for (var i = start; step > 0 ? i < stop : i > stop; i += step) { result.push(i); } return result; }; export function any (iterable) { for (let item of iterable) { if (bool (item)) { return true; } } return false; } export function all (iterable) { for (let item of iterable) { if (! bool (item)) { return false; } } return true; } export function sum (iterable) { let result = 0; for (let item of iterable) { result += item; } return result; } export function enumerate (iterable) { return zip (range (len (iterable)), iterable); } export function copy (anObject) { if (anObject == null || typeof anObject == "object") { return anObject; } else { var result = {}; for (var attrib in obj) { if (anObject.hasOwnProperty (attrib)) { result [attrib] = anObject [attrib]; } } return result; } } export function deepcopy (anObject) { if (anObject == null || typeof anObject == "object") { return anObject; } else { var result = {}; for (var attrib in obj) { if (anObject.hasOwnProperty (attrib)) { result [attrib] = deepcopy (anObject [attrib]); } } return result; } } export function list (iterable) { let instance = iterable ? Array.from (iterable) : []; return instance; } Array.prototype.__class__ = list; list.__name__ = 'list'; list.__bases__ = [object]; Array.prototype.__iter__ = function () {return new __PyIterator__ (this);}; Array.prototype.__getslice__ = function (start, stop, step) { if (start < 0) { start = this.length + start; } if (stop == null) { stop = this.length; } else if (stop < 0) { stop = this.length + stop; } else if (stop > this.length) { stop = this.length; } if (step == 1) { return Array.prototype.slice.call(this, start, stop); } let result = list ([]); for (let index = start; index < stop; index += step) { result.push (this [index]); } return result; }; Array.prototype.__setslice__ = function (start, stop, step, source) { if (start < 0) { start = this.length + start; } if (stop == null) { stop = this.length; } else if (stop < 0) { stop = this.length + stop; } if (step == null) { Array.prototype.splice.apply (this, [start, stop - start] .concat (source)); } else { let sourceIndex = 0; for (let targetIndex = start; targetIndex < stop; targetIndex += step) { this [targetIndex] = source [sourceIndex++]; } } }; Array.prototype.__repr__ = function () { if (this.__class__ == set && !this.length) { return 'set()'; } let result = !this.__class__ || this.__class__ == list ? '[' : this.__class__ == tuple ? '(' : '{'; for (let index = 0; index < this.length; index++) { if (index) { result += ', '; } result += repr (this [index]); } if (this.__class__ == tuple && this.length == 1) { result += ','; } result += !this.__class__ || this.__class__ == list ? ']' : this.__class__ == tuple ? ')' : '}';; return result; }; Array.prototype.__str__ = Array.prototype.__repr__; Array.prototype.append = function (element) { this.push (element); }; Array.prototype.py_clear = function () { this.length = 0; }; Array.prototype.extend = function (aList) { this.push.apply (this, aList); }; Array.prototype.insert = function (index, element) { this.splice (index, 0, element); }; Array.prototype.remove = function (element) { let index = this.indexOf (element); if (index == -1) { throw ValueError ("list.remove(x): x not in list", new Error ()); } this.splice (index, 1); }; Array.prototype.index = function (element) { return this.indexOf (element); }; Array.prototype.py_pop = function (index) { if (index == undefined) { return this.pop (); } else { return this.splice (index, 1) [0]; } }; Array.prototype.py_sort = function () { __sort__.apply (null, [this].concat ([] .slice.apply (arguments))); }; Array.prototype.__add__ = function (aList) { return list (this.concat (aList)); }; Array.prototype.__mul__ = function (scalar) { let result = this; for (let i = 1; i < scalar; i++) { result = result.concat (this); } return result; }; Array.prototype.__rmul__ = Array.prototype.__mul__; export function tuple (iterable) { let instance = iterable ? [] .slice.apply (iterable) : []; instance.__class__ = tuple; return instance; } tuple.__name__ = 'tuple'; tuple.__bases__ = [object]; export function set (iterable) { let instance = []; if (iterable) { for (let index = 0; index < iterable.length; index++) { instance.add (iterable [index]); } } instance.__class__ = set; return instance; } set.__name__ = 'set'; set.__bases__ = [object]; Array.prototype.__bindexOf__ = function (element) { element += ''; let mindex = 0; let maxdex = this.length - 1; while (mindex <= maxdex) { let index = (mindex + maxdex) / 2 | 0; let middle = this [index] + ''; if (middle < element) { mindex = index + 1; } else if (middle > element) { maxdex = index - 1; } else { return index; } } return -1; }; Array.prototype.add = function (element) { if (this.indexOf (element) == -1) { this.push (element); } }; Array.prototype.discard = function (element) { var index = this.indexOf (element); if (index != -1) { this.splice (index, 1); } }; Array.prototype.isdisjoint = function (other) { this.sort (); for (let i = 0; i < other.length; i++) { if (this.__bindexOf__ (other [i]) != -1) { return false; } } return true; }; Array.prototype.issuperset = function (other) { this.sort (); for (let i = 0; i < other.length; i++) { if (this.__bindexOf__ (other [i]) == -1) { return false; } } return true; }; Array.prototype.issubset = function (other) { return set (other.slice ()) .issuperset (this); }; Array.prototype.union = function (other) { let result = set (this.slice () .sort ()); for (let i = 0; i < other.length; i++) { if (result.__bindexOf__ (other [i]) == -1) { result.push (other [i]); } } return result; }; Array.prototype.intersection = function (other) { this.sort (); let result = set (); for (let i = 0; i < other.length; i++) { if (this.__bindexOf__ (other [i]) != -1) { result.push (other [i]); } } return result; }; Array.prototype.difference = function (other) { let sother = set (other.slice () .sort ()); let result = set (); for (let i = 0; i < this.length; i++) { if (sother.__bindexOf__ (this [i]) == -1) { result.push (this [i]); } } return result; }; Array.prototype.symmetric_difference = function (other) { return this.union (other) .difference (this.intersection (other)); }; Array.prototype.py_update = function () { let updated = [] .concat.apply (this.slice (), arguments) .sort (); this.py_clear (); for (let i = 0; i < updated.length; i++) { if (updated [i] != updated [i - 1]) { this.push (updated [i]); } } }; Array.prototype.__eq__ = function (other) { if (this.length != other.length) { return false; } if (this.__class__ == set) { this.sort (); other.sort (); } for (let i = 0; i < this.length; i++) { if (this [i] != other [i]) { return false; } } return true; }; Array.prototype.__ne__ = function (other) { return !this.__eq__ (other); }; Array.prototype.__le__ = function (other) { if (this.__class__ == set) { return this.issubset (other); } else { for (let i = 0; i < this.length; i++) { if (this [i] > other [i]) { return false; } else if (this [i] < other [i]) { return true; } } return true; } }; Array.prototype.__ge__ = function (other) { if (this.__class__ == set) { return this.issuperset (other); } else { for (let i = 0; i < this.length; i++) { if (this [i] < other [i]) { return false; } else if (this [i] > other [i]) { return true; } } return true; } }; Array.prototype.__lt__ = function (other) { return ( this.__class__ == set ? this.issubset (other) && !this.issuperset (other) : !this.__ge__ (other) ); }; Array.prototype.__gt__ = function (other) { return ( this.__class__ == set ? this.issuperset (other) && !this.issubset (other) : !this.__le__ (other) ); }; export function bytearray (bytable, encoding) { if (bytable == undefined) { return new Uint8Array (0); } else { let aType = py_typeof (bytable); if (aType == int) { return new Uint8Array (bytable); } else if (aType == str) { let aBytes = new Uint8Array (len (bytable)); for (let i = 0; i < len (bytable); i++) { aBytes [i] = bytable.charCodeAt (i); } return aBytes; } else if (aType == list || aType == tuple) { return new Uint8Array (bytable); } else { throw py_TypeError; } } } export var bytes = bytearray; Uint8Array.prototype.__add__ = function (aBytes) { let result = new Uint8Array (this.length + aBytes.length); result.set (this); result.set (aBytes, this.length); return result; }; Uint8Array.prototype.__mul__ = function (scalar) { let result = new Uint8Array (scalar * this.length); for (let i = 0; i < scalar; i++) { result.set (this, i * this.length); } return result; }; Uint8Array.prototype.__rmul__ = Uint8Array.prototype.__mul__; export function str (stringable) { if (typeof stringable === 'number') return stringable.toString(); else { try { return stringable.__str__ (); } catch (exception) { try { return repr (stringable); } catch (exception) { return String (stringable); } } } }; String.prototype.__class__ = str; str.__name__ = 'str'; str.__bases__ = [object]; String.prototype.__iter__ = function () {new __PyIterator__ (this);}; String.prototype.__repr__ = function () { return (this.indexOf ('\'') == -1 ? '\'' + this + '\'' : '"' + this + '"') .py_replace ('\t', '\\t') .py_replace ('\n', '\\n'); }; String.prototype.__str__ = function () { return this; }; String.prototype.capitalize = function () { return this.charAt (0).toUpperCase () + this.slice (1); }; String.prototype.endswith = function (suffix) { if (suffix instanceof Array) { for (var i=0;i> b; } }; export function __or__ (a, b) { if (typeof a == 'object' && '__or__' in a) { return a.__or__ (b); } else if (typeof b == 'object' && '__ror__' in b) { return b.__ror__ (a); } else { return a | b; } }; export function __xor__ (a, b) { if (typeof a == 'object' && '__xor__' in a) { return a.__xor__ (b); } else if (typeof b == 'object' && '__rxor__' in b) { return b.__rxor__ (a); } else { return a ^ b; } }; export function __and__ (a, b) { if (typeof a == 'object' && '__and__' in a) { return a.__and__ (b); } else if (typeof b == 'object' && '__rand__' in b) { return b.__rand__ (a); } else { return a & b; } }; export function __eq__ (a, b) { if (typeof a == 'object' && '__eq__' in a) { return a.__eq__ (b); } else { return a == b; } }; export function __ne__ (a, b) { if (typeof a == 'object' && '__ne__' in a) { return a.__ne__ (b); } else { return a != b } }; export function __lt__ (a, b) { if (typeof a == 'object' && '__lt__' in a) { return a.__lt__ (b); } else { return a < b; } }; export function __le__ (a, b) { if (typeof a == 'object' && '__le__' in a) { return a.__le__ (b); } else { return a <= b; } }; export function __gt__ (a, b) { if (typeof a == 'object' && '__gt__' in a) { return a.__gt__ (b); } else { return a > b; } }; export function __ge__ (a, b) { if (typeof a == 'object' && '__ge__' in a) { return a.__ge__ (b); } else { return a >= b; } }; export function __imatmul__ (a, b) { if ('__imatmul__' in a) { return a.__imatmul__ (b); } else { return a.__matmul__ (b); } }; export function __ipow__ (a, b) { if (typeof a == 'object' && '__pow__' in a) { return a.__ipow__ (b); } else if (typeof a == 'object' && '__ipow__' in a) { return a.__pow__ (b); } else if (typeof b == 'object' && '__rpow__' in b) { return b.__rpow__ (a); } else { return Math.pow (a, b); } }; export function __ijsmod__ (a, b) { if (typeof a == 'object' && '__imod__' in a) { return a.__ismod__ (b); } else if (typeof a == 'object' && '__mod__' in a) { return a.__mod__ (b); } else if (typeof b == 'object' && '__rpow__' in b) { return b.__rmod__ (a); } else { return a % b; } }; export function __imod__ (a, b) { if (typeof a == 'object' && '__imod__' in a) { return a.__imod__ (b); } else if (typeof a == 'object' && '__mod__' in a) { return a.__mod__ (b); } else if (typeof b == 'object' && '__rmod__' in b) { return b.__rmod__ (a); } else { return ((a % b) + b) % b; } }; export function __imul__ (a, b) { if (typeof a == 'object' && '__imul__' in a) { return a.__imul__ (b); } else if (typeof a == 'object' && '__mul__' in a) { return a = a.__mul__ (b); } else if (typeof b == 'object' && '__rmul__' in b) { return a = b.__rmul__ (a); } else if (typeof a == 'string') { return a = a.__mul__ (b); } else if (typeof b == 'string') { return a = b.__rmul__ (a); } else { return a *= b; } }; export function __idiv__ (a, b) { if (typeof a == 'object' && '__idiv__' in a) { return a.__idiv__ (b); } else if (typeof a == 'object' && '__div__' in a) { return a = a.__div__ (b); } else if (typeof b == 'object' && '__rdiv__' in b) { return a = b.__rdiv__ (a); } else { return a /= b; } }; export function __iadd__ (a, b) { if (typeof a == 'object' && '__iadd__' in a) { return a.__iadd__ (b); } else if (typeof a == 'object' && '__add__' in a) { return a = a.__add__ (b); } else if (typeof b == 'object' && '__radd__' in b) { return a = b.__radd__ (a); } else { return a += b; } }; export function __isub__ (a, b) { if (typeof a == 'object' && '__isub__' in a) { return a.__isub__ (b); } else if (typeof a == 'object' && '__sub__' in a) { return a = a.__sub__ (b); } else if (typeof b == 'object' && '__rsub__' in b) { return a = b.__rsub__ (a); } else { return a -= b; } }; export function __ilshift__ (a, b) { if (typeof a == 'object' && '__ilshift__' in a) { return a.__ilshift__ (b); } else if (typeof a == 'object' && '__lshift__' in a) { return a = a.__lshift__ (b); } else if (typeof b == 'object' && '__rlshift__' in b) { return a = b.__rlshift__ (a); } else { return a <<= b; } }; export function __irshift__ (a, b) { if (typeof a == 'object' && '__irshift__' in a) { return a.__irshift__ (b); } else if (typeof a == 'object' && '__rshift__' in a) { return a = a.__rshift__ (b); } else if (typeof b == 'object' && '__rrshift__' in b) { return a = b.__rrshift__ (a); } else { return a >>= b; } }; export function __ior__ (a, b) { if (typeof a == 'object' && '__ior__' in a) { return a.__ior__ (b); } else if (typeof a == 'object' && '__or__' in a) { return a = a.__or__ (b); } else if (typeof b == 'object' && '__ror__' in b) { return a = b.__ror__ (a); } else { return a |= b; } }; export function __ixor__ (a, b) { if (typeof a == 'object' && '__ixor__' in a) { return a.__ixor__ (b); } else if (typeof a == 'object' && '__xor__' in a) { return a = a.__xor__ (b); } else if (typeof b == 'object' && '__rxor__' in b) { return a = b.__rxor__ (a); } else { return a ^= b; } }; export function __iand__ (a, b) { if (typeof a == 'object' && '__iand__' in a) { return a.__iand__ (b); } else if (typeof a == 'object' && '__and__' in a) { return a = a.__and__ (b); } else if (typeof b == 'object' && '__rand__' in b) { return a = b.__rand__ (a); } else { return a &= b; } }; export function __getitem__ (container, key) { if (typeof container == 'object' && '__getitem__' in container) { return container.__getitem__ (key); } else if ((typeof container == 'string' || container instanceof Array) && key < 0) { return container [container.length + key]; } else { return container [key]; } }; export function __setitem__ (container, key, value) { if (typeof container == 'object' && '__setitem__' in container) { container.__setitem__ (key, value); } else if ((typeof container == 'string' || container instanceof Array) && key < 0) { container [container.length + key] = value; } else { container [key] = value; } }; export function __getslice__ (container, lower, upper, step) { if (typeof container == 'object' && '__getitem__' in container) { return container.__getitem__ ([lower, upper, step]); } else { return container.__getslice__ (lower, upper, step); } }; export function __setslice__ (container, lower, upper, step, value) { if (typeof container == 'object' && '__setitem__' in container) { container.__setitem__ ([lower, upper, step], value); } else { container.__setslice__ (lower, upper, step, value); } }; export var BaseException = __class__ ('BaseException', [object], { __module__: __name__, }); export var Exception = __class__ ('Exception', [BaseException], { __module__: __name__, get __init__ () {return __get__ (this, function (self) { var kwargs = dict (); if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'self': var self = __allkwargs0__ [__attrib0__]; break; default: kwargs [__attrib0__] = __allkwargs0__ [__attrib0__]; } } delete kwargs.__kwargtrans__; } var args = tuple ([].slice.apply (arguments).slice (1, __ilastarg0__ + 1)); } else { var args = tuple (); } self.__args__ = args; if (kwargs.error != null) { self.stack = kwargs.error.stack; } else if (Error) { self.stack = new Error ().stack; } else { self.stack = 'No stack trace available'; } });}, get __repr__ () {return __get__ (this, function (self) { if (len (self.__args__) > 1) { return '{}{}'.format (self.__class__.__name__, repr (tuple (self.__args__))); } else if (len (self.__args__)) { return '{}({})'.format (self.__class__.__name__, repr (self.__args__ [0])); } else { return '{}()'.format (self.__class__.__name__); } });}, get __str__ () {return __get__ (this, function (self) { if (len (self.__args__) > 1) { return str (tuple (self.__args__)); } else if (len (self.__args__)) { return str (self.__args__ [0]); } else { return ''; } });} }); export var IterableError = __class__ ('IterableError', [Exception], { __module__: __name__, get __init__ () {return __get__ (this, function (self, error) { Exception.__init__ (self, "Can't iterate over non-iterable", __kwargtrans__ ({error: error})); });} }); export var StopIteration = __class__ ('StopIteration', [Exception], { __module__: __name__, get __init__ () {return __get__ (this, function (self, error) { Exception.__init__ (self, 'Iterator exhausted', __kwargtrans__ ({error: error})); });} }); export var ValueError = __class__ ('ValueError', [Exception], { __module__: __name__, get __init__ () {return __get__ (this, function (self, message, error) { Exception.__init__ (self, message, __kwargtrans__ ({error: error})); });} }); export var KeyError = __class__ ('KeyError', [Exception], { __module__: __name__, get __init__ () {return __get__ (this, function (self, message, error) { Exception.__init__ (self, message, __kwargtrans__ ({error: error})); });} }); export var AssertionError = __class__ ('AssertionError', [Exception], { __module__: __name__, get __init__ () {return __get__ (this, function (self, message, error) { if (message) { Exception.__init__ (self, message, __kwargtrans__ ({error: error})); } else { Exception.__init__ (self, __kwargtrans__ ({error: error})); } });} }); export var NotImplementedError = __class__ ('NotImplementedError', [Exception], { __module__: __name__, get __init__ () {return __get__ (this, function (self, message, error) { Exception.__init__ (self, message, __kwargtrans__ ({error: error})); });} }); export var IndexError = __class__ ('IndexError', [Exception], { __module__: __name__, get __init__ () {return __get__ (this, function (self, message, error) { Exception.__init__ (self, message, __kwargtrans__ ({error: error})); });} }); export var AttributeError = __class__ ('AttributeError', [Exception], { __module__: __name__, get __init__ () {return __get__ (this, function (self, message, error) { Exception.__init__ (self, message, __kwargtrans__ ({error: error})); });} }); export var py_TypeError = __class__ ('py_TypeError', [Exception], { __module__: __name__, get __init__ () {return __get__ (this, function (self, message, error) { Exception.__init__ (self, message, __kwargtrans__ ({error: error})); });} }); export var Warning = __class__ ('Warning', [Exception], { __module__: __name__, }); export var UserWarning = __class__ ('UserWarning', [Warning], { __module__: __name__, }); export var DeprecationWarning = __class__ ('DeprecationWarning', [Warning], { __module__: __name__, }); export var RuntimeWarning = __class__ ('RuntimeWarning', [Warning], { __module__: __name__, }); export var __sort__ = function (iterable, key, reverse) { if (typeof key == 'undefined' || (key != null && key.hasOwnProperty ("__kwargtrans__"))) {; var key = null; }; if (typeof reverse == 'undefined' || (reverse != null && reverse.hasOwnProperty ("__kwargtrans__"))) {; var reverse = false; }; if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'iterable': var iterable = __allkwargs0__ [__attrib0__]; break; case 'key': var key = __allkwargs0__ [__attrib0__]; break; case 'reverse': var reverse = __allkwargs0__ [__attrib0__]; break; } } } } else { } if (key) { iterable.sort ((function __lambda__ (a, b) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'a': var a = __allkwargs0__ [__attrib0__]; break; case 'b': var b = __allkwargs0__ [__attrib0__]; break; } } } } else { } return (key (a) > key (b) ? 1 : -(1)); })); } else { iterable.sort (); } if (reverse) { iterable.reverse (); } }; export var sorted = function (iterable, key, reverse) { if (typeof key == 'undefined' || (key != null && key.hasOwnProperty ("__kwargtrans__"))) {; var key = null; }; if (typeof reverse == 'undefined' || (reverse != null && reverse.hasOwnProperty ("__kwargtrans__"))) {; var reverse = false; }; if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'iterable': var iterable = __allkwargs0__ [__attrib0__]; break; case 'key': var key = __allkwargs0__ [__attrib0__]; break; case 'reverse': var reverse = __allkwargs0__ [__attrib0__]; break; } } } } else { } if (py_typeof (iterable) == dict) { var result = copy (iterable.py_keys ()); } else { var result = copy (iterable); } __sort__ (result, key, reverse); return result; }; export var map = function (func, iterable) { return (function () { var __accu0__ = []; for (var item of iterable) { __accu0__.append (func (item)); } return __accu0__; }) (); }; export var filter = function (func, iterable) { if (func == null) { var func = bool; } return (function () { var __accu0__ = []; for (var item of iterable) { if (func (item)) { __accu0__.append (item); } } return __accu0__; }) (); }; export var divmod = function (n, d) { return tuple ([Math.floor (n / d), __mod__ (n, d)]); }; export var __Terminal__ = __class__ ('__Terminal__', [object], { __module__: __name__, get __init__ () {return __get__ (this, function (self) { self.buffer = ''; try { self.element = document.getElementById ('__terminal__'); } catch (__except0__) { self.element = null; } if (self.element) { self.element.style.overflowX = 'auto'; self.element.style.boxSizing = 'border-box'; self.element.style.padding = '5px'; self.element.innerHTML = '_'; } });}, get print () {return __get__ (this, function (self) { var sep = ' '; var end = '\n'; if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'self': var self = __allkwargs0__ [__attrib0__]; break; case 'sep': var sep = __allkwargs0__ [__attrib0__]; break; case 'end': var end = __allkwargs0__ [__attrib0__]; break; } } } var args = tuple ([].slice.apply (arguments).slice (1, __ilastarg0__ + 1)); } else { var args = tuple (); } self.buffer = '{}{}{}'.format (self.buffer, sep.join ((function () { var __accu0__ = []; for (var arg of args) { __accu0__.append (str (arg)); } return __accu0__; }) ()), end).__getslice__ (-(4096), null, 1); if (self.element) { self.element.innerHTML = self.buffer.py_replace ('\n', '
').py_replace (' ', ' '); self.element.scrollTop = self.element.scrollHeight; } else { console.log (sep.join ((function () { var __accu0__ = []; for (var arg of args) { __accu0__.append (str (arg)); } return __accu0__; }) ())); } });}, get input () {return __get__ (this, function (self, question) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'self': var self = __allkwargs0__ [__attrib0__]; break; case 'question': var question = __allkwargs0__ [__attrib0__]; break; } } } } else { } self.print ('{}'.format (question), __kwargtrans__ ({end: ''})); var answer = window.prompt ('\n'.join (self.buffer.py_split ('\n').__getslice__ (-(8), null, 1))); self.print (answer); return answer; });} }); export var __terminal__ = __Terminal__ (); export var print = __terminal__.print; export var input = __terminal__.input; //# sourceMappingURL=org.transcrypt.__runtime__.map ================================================ FILE: docs/examples/transcrypt/sketch_010/target/org.transcrypt.__runtime__.py ================================================ # Transcrypt runtime module #__pragma__ ('js', 'export var __envir__ = {{}};\n{}', __include__ ('org/transcrypt/__envir__.js')) #__pragma__ ('js', '{}', __include__ ('org/transcrypt/__core__.js')) #__pragma__ ('js', '{}', __include__ ('org/transcrypt/__builtin__.js')) #__pragma__ ('skip') copy = Math = __typeof__ = __repr__ = document = console = window = 0 #__pragma__ ('noskip') #__pragma__ ('notconv') # !!! tconv gives a problem with __terminal__, needs investigation #__pragma__ ('nokwargs') #__pragma__ ('noalias', 'sort') class BaseException: pass class Exception (BaseException): #__pragma__ ('kwargs') def __init__ (self, *args, **kwargs): self.__args__ = args if kwargs.error != None: self.stack = kwargs.error.stack # Integrate with JavaScript Error object elif Error: self.stack = (__new__(Error())).stack # Create our own stack if we aren't given one else: self.stack = 'No stack trace available' #__pragma__ ('nokwargs') def __repr__ (self): if len (self.__args__) > 1: return '{}{}'.format (self.__class__.__name__, repr (tuple (self.__args__))) elif len (self.__args__): return '{}({})'.format (self.__class__.__name__, repr (self.__args__ [0])) else: return '{}()'.format (self.__class__.__name__) def __str__ (self): if len (self.__args__) > 1: return str (tuple (self.__args__)) elif len (self.__args__): return str (self.__args__ [0]) else: return '' class IterableError (Exception): def __init__ (self, error): Exception.__init__ (self, 'Can\'t iterate over non-iterable', error = error) class StopIteration (Exception): def __init__ (self, error): Exception.__init__ (self, 'Iterator exhausted', error = error) class ValueError (Exception): def __init__ (self, message, error): Exception.__init__ (self, message, error = error) class KeyError (Exception): def __init__ (self, message, error): Exception.__init__ (self, message, error = error) class AssertionError (Exception): def __init__ (self, message, error): if message: Exception.__init__ (self, message, error = error) else: Exception.__init__ (self, error = error) class NotImplementedError (Exception): def __init__(self, message, error): Exception.__init__(self, message, error = error) class IndexError (Exception): def __init__(self, message, error): Exception.__init__(self, message, error = error) class AttributeError (Exception): def __init__(self, message, error): Exception.__init__(self, message, error = error) class TypeError (Exception): def __init__(self, message, error): Exception.__init__(self, message, error = error) # Warnings Exceptions # N.B. This is a limited subset of the warnings defined in # the cpython implementation to keep things small for now. class Warning (Exception): ''' Warning Base Class ''' pass class UserWarning (Warning): pass class DeprecationWarning (Warning): pass class RuntimeWarning (Warning): pass #__pragma__ ('kwargs') def __sort__ (iterable, key = None, reverse = False): # Used by py_sort, can deal with kwargs if key: iterable.sort (lambda a, b: 1 if key (a) > key (b) else -1) # JavaScript sort, case '==' is irrelevant for sorting else: iterable.sort () # JavaScript sort if reverse: iterable.reverse () def sorted (iterable, key = None, reverse = False): if type (iterable) == dict: result = copy (iterable.keys ()) else: result = copy (iterable) __sort__ (result, key, reverse) return result #__pragma__ ('nokwargs') def map (func, iterable): return [func (item) for item in iterable] def filter (func, iterable): if func == None: func = bool return [item for item in iterable if func (item)] def divmod (n, d): return n // d, n % d #__pragma__ ('ifdef', '__complex__') class complex: def __init__ (self, real, imag = None): if imag == None: if type (real) == complex: self.real = real.real self.imag = real.imag else: self.real = real self.imag = 0 else: self.real = real self.imag = imag def __neg__ (self): return complex (-self.real, -self.imag) def __exp__ (self): modulus = Math.exp (self.real) return complex (modulus * Math.cos (self.imag), modulus * Math.sin (self.imag)) def __log__ (self): return complex (Math.log (Math.sqrt (self.real * self.real + self.imag * self.imag)), Math.atan2 (self.imag, self.real)) def __pow__ (self, other): # a ** b = exp (b log a) return (self.__log__ () .__mul__ (other)) .__exp__ () def __rpow__ (self, real): # real ** comp -> comp.__rpow__ (real) return self.__mul__ (Math.log (real)) .__exp__ () def __mul__ (self, other): if __typeof__ (other) is 'number': return complex (self.real * other, self.imag * other) else: return complex (self.real * other.real - self.imag * other.imag, self.real * other.imag + self.imag * other.real) def __rmul__ (self, real): # real + comp -> comp.__rmul__ (real) return complex (self.real * real, self.imag * real) def __div__ (self, other): if __typeof__ (other) is 'number': return complex (self.real / other, self.imag / other) else: denom = other.real * other.real + other.imag * other.imag return complex ( (self.real * other.real + self.imag * other.imag) / denom, (self.imag * other.real - self.real * other.imag) / denom ) def __rdiv__ (self, real): # real / comp -> comp.__rdiv__ (real) denom = self.real * self.real return complex ( (real * self.real) / denom, (real * self.imag) / denom ) def __add__ (self, other): if __typeof__ (other) is 'number': return complex (self.real + other, self.imag) else: # Assume other is complex return complex (self.real + other.real, self.imag + other.imag) def __radd__ (self, real): # real + comp -> comp.__radd__ (real) return complex (self.real + real, self.imag) def __sub__ (self, other): if __typeof__ (other) is 'number': return complex (self.real - other, self.imag) else: return complex (self.real - other.real, self.imag - other.imag) def __rsub__ (self, real): # real - comp -> comp.__rsub__ (real) return complex (real - self.real, -self.imag) def __repr__ (self): return '({}{}{}j)'.format (self.real, '+' if self.imag >= 0 else '', self.imag) def __str__ (self): return __repr__ (self) [1 : -1] def __eq__ (self, other): if __typeof__ (other) is 'number': return self.real == other else: return self.real == other.real and self.imag == other.imag def __ne__ (self, other): if __typeof__ (other) is 'number': return self.real != other else: return self.real != other.real or self.imag != other.imag def conjugate (self): return complex (self.real, -self.imag) def __conj__ (aNumber): if isinstance (aNumber, complex): return complex (aNumber.real, -aNumber.imag) else: return complex (aNumber, 0) #__pragma__ ('endif') class __Terminal__: ''' Printing to either the console or to html happens async, but is blocked by calling window.prompt. So while all input and print statements are encountered in normal order, the print's exit immediately without yet having actually printed This means the next input takes control, blocking actual printing and so on indefinitely The effect is that everything's only printed after all inputs are done To prevent that, what's needed is to only execute the next window.prompt after actual printing has been done Since we've no way to find out when that is, a timeout is used. ''' def __init__ (self): self.buffer = '' try: self.element = document.getElementById ('__terminal__') except: self.element = None if self.element: self.element.style.overflowX = 'auto' self.element.style.boxSizing = 'border-box' self.element.style.padding = '5px' self.element.innerHTML = '_' #__pragma__ ('kwargs') def print (self, *args, sep = ' ', end = '\n'): self.buffer = '{}{}{}'.format (self.buffer, sep.join ([str (arg) for arg in args]), end) [-4096 : ] if self.element: self.element.innerHTML = self.buffer.replace ('\n', '
') .replace (' ', ' ') self.element.scrollTop = self.element.scrollHeight else: console.log (sep.join ([str (arg) for arg in args])) def input (self, question): self.print ('{}'.format (question), end = '') answer = window.prompt ('\n'.join (self.buffer.split ('\n') [-8:])) self.print (answer) return answer #__pragma__ ('nokwargs') __terminal__ = __Terminal__ () print = __terminal__.print input = __terminal__.input ================================================ FILE: docs/examples/transcrypt/sketch_010/target/pyp5js.js ================================================ // Transcrypt'ed from Python, 2021-11-02 13:06:19 import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, all, any, assert, bool, bytearray, bytes, callable, chr, deepcopy, delattr, dict, dir, divmod, enumerate, getattr, hasattr, isinstance, issubclass, len, list, object, ord, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, setattr, sorted, sum, tuple, zip} from './org.transcrypt.__runtime__.js'; import {PythonFunctions} from './python_functions.js'; var __name__ = 'pyp5js'; export var _P5_INSTANCE = null; export var _CTX_MIDDLE = null; export var _DEFAULT_FILL = null; export var _DEFAULT_LEADMULT = null; export var _DEFAULT_STROKE = null; export var _DEFAULT_TEXT_FILL = null; export var ADD = null; export var ALT = null; export var ARROW = null; export var AUDIO = null; export var AUTO = null; export var AXES = null; export var BACKSPACE = null; export var BASELINE = null; export var BEVEL = null; export var BEZIER = null; export var BLEND = null; export var BLUR = null; export var BOLD = null; export var BOLDITALIC = null; export var BOTTOM = null; export var BURN = null; export var CENTER = null; export var CHORD = null; export var CLAMP = null; export var CLOSE = null; export var CONTROL = null; export var CORNER = null; export var CORNERS = null; export var CROSS = null; export var CURVE = null; export var DARKEST = null; export var DEG_TO_RAD = null; export var DEGREES = null; export var DELETE = null; export var DIFFERENCE = null; export var DILATE = null; export var DODGE = null; export var DOWN_ARROW = null; export var ENTER = null; export var ERODE = null; export var ESCAPE = null; export var EXCLUSION = null; export var FILL = null; export var GRAY = null; export var GRID = null; export var HALF_PI = null; export var HAND = null; export var HARD_LIGHT = null; export var HSB = null; export var HSL = null; export var IMAGE = null; export var IMMEDIATE = null; export var INVERT = null; export var ITALIC = null; export var LANDSCAPE = null; export var LEFT = null; export var LEFT_ARROW = null; export var LIGHTEST = null; export var LINE_LOOP = null; export var LINE_STRIP = null; export var LINEAR = null; export var LINES = null; export var MIRROR = null; export var MITER = null; export var MOVE = null; export var MULTIPLY = null; export var NEAREST = null; export var NORMAL = null; export var OPAQUE = null; export var OPEN = null; export var OPTION = null; export var OVERLAY = null; export var PI = null; export var PIE = null; export var POINTS = null; export var PORTRAIT = null; export var POSTERIZE = null; export var PROJECT = null; export var QUAD_STRIP = null; export var QUADRATIC = null; export var QUADS = null; export var QUARTER_PI = null; export var RAD_TO_DEG = null; export var RADIANS = null; export var RADIUS = null; export var REPEAT = null; export var REPLACE = null; export var RETURN = null; export var RGB = null; export var RIGHT = null; export var RIGHT_ARROW = null; export var ROUND = null; export var SCREEN = null; export var SHIFT = null; export var SOFT_LIGHT = null; export var SQUARE = null; export var STROKE = null; export var SUBTRACT = null; export var TAB = null; export var TAU = null; export var TEXT = null; export var TEXTURE = null; export var THRESHOLD = null; export var TOP = null; export var TRIANGLE_FAN = null; export var TRIANGLE_STRIP = null; export var TRIANGLES = null; export var TWO_PI = null; export var UP_ARROW = null; export var VIDEO = null; export var WAIT = null; export var WEBGL = null; export var P2D = null; var PI = null; export var frameCount = null; export var focused = null; export var displayWidth = null; export var displayHeight = null; export var windowWidth = null; export var windowHeight = null; export var width = null; export var height = null; export var disableFriendlyErrors = null; export var deviceOrientation = null; export var accelerationX = null; export var accelerationY = null; export var accelerationZ = null; export var pAccelerationX = null; export var pAccelerationY = null; export var pAccelerationZ = null; export var rotationX = null; export var rotationY = null; export var rotationZ = null; export var pRotationX = null; export var pRotationY = null; export var pRotationZ = null; export var turnAxis = null; export var keyIsPressed = null; export var key = null; export var keyCode = null; export var mouseX = null; export var mouseY = null; export var pmouseX = null; export var pmouseY = null; export var winMouseX = null; export var winMouseY = null; export var pwinMouseX = null; export var pwinMouseY = null; export var mouseButton = null; export var mouseIsPressed = null; export var touches = null; export var pixels = null; export var alpha = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.alpha (...args); }; export var blue = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.blue (...args); }; export var brightness = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.brightness (...args); }; export var color = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.color (...args); }; export var green = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.green (...args); }; export var hue = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.hue (...args); }; export var lerpColor = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.lerpColor (...args); }; export var lightness = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.lightness (...args); }; export var red = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.red (...args); }; export var saturation = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.saturation (...args); }; export var background = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.background (...args); }; export var py_clear = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } var p5_clear = _P5_INSTANCE.clear (...args); return p5_clear; }; export var erase = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.erase (...args); }; export var noErase = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noErase (...args); }; export var colorMode = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.colorMode (...args); }; export var fill = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.fill (...args); }; export var noFill = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noFill (...args); }; export var noStroke = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noStroke (...args); }; export var stroke = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.stroke (...args); }; export var arc = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.arc (...args); }; export var ellipse = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.ellipse (...args); }; export var circle = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.circle (...args); }; export var line = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.line (...args); }; export var point = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.point (...args); }; export var quad = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.quad (...args); }; export var rect = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.rect (...args); }; export var square = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.square (...args); }; export var triangle = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.triangle (...args); }; export var plane = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.plane (...args); }; export var box = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.box (...args); }; export var sphere = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.sphere (...args); }; export var cylinder = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.cylinder (...args); }; export var cone = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.cone (...args); }; export var ellipsoid = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.ellipsoid (...args); }; export var torus = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.torus (...args); }; export var loadModel = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.loadModel (...args); }; export var model = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.model (...args); }; export var ellipseMode = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.ellipseMode (...args); }; export var noSmooth = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noSmooth (...args); }; export var rectMode = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.rectMode (...args); }; export var smooth = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.smooth (...args); }; export var strokeCap = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.strokeCap (...args); }; export var strokeJoin = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.strokeJoin (...args); }; export var strokeWeight = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.strokeWeight (...args); }; export var bezier = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.bezier (...args); }; export var bezierDetail = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.bezierDetail (...args); }; export var bezierPoint = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.bezierPoint (...args); }; export var bezierTangent = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.bezierTangent (...args); }; export var curve = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.curve (...args); }; export var curveDetail = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.curveDetail (...args); }; export var curveTightness = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.curveTightness (...args); }; export var curvePoint = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.curvePoint (...args); }; export var curveTangent = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.curveTangent (...args); }; export var beginContour = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.beginContour (...args); }; export var beginShape = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.beginShape (...args); }; export var bezierVertex = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.bezierVertex (...args); }; export var curveVertex = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.curveVertex (...args); }; export var endContour = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.endContour (...args); }; export var endShape = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.endShape (...args); }; export var quadraticVertex = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.quadraticVertex (...args); }; export var vertex = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.vertex (...args); }; export var cursor = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.cursor (...args); }; export var frameRate = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.frameRate (...args); }; export var noCursor = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noCursor (...args); }; export var fullscreen = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.fullscreen (...args); }; export var pixelDensity = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.pixelDensity (...args); }; export var displayDensity = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.displayDensity (...args); }; export var getURL = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.getURL (...args); }; export var getURLPath = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.getURLPath (...args); }; export var getURLParams = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.getURLParams (...args); }; export var preload = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.preload (...args); }; export var setup = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.setup (...args); }; export var draw = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.draw (...args); }; export var remove = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.remove (...args); }; export var noLoop = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noLoop (...args); }; export var loop = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.loop (...args); }; export var push = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.push (...args); }; export var redraw = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.redraw (...args); }; export var resizeCanvas = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.resizeCanvas (...args); }; export var noCanvas = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noCanvas (...args); }; export var createGraphics = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createGraphics (...args); }; export var blendMode = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.blendMode (...args); }; export var setAttributes = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.setAttributes (...args); }; export var applyMatrix = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.applyMatrix (...args); }; export var resetMatrix = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.resetMatrix (...args); }; export var rotate = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.rotate (...args); }; export var rotateX = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.rotateX (...args); }; export var rotateY = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.rotateY (...args); }; export var rotateZ = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.rotateZ (...args); }; export var scale = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.scale (...args); }; export var shearX = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.shearX (...args); }; export var shearY = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.shearY (...args); }; export var translate = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.translate (...args); }; export var createStringDict = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createStringDict (...args); }; export var createNumberDict = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createNumberDict (...args); }; export var append = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.append (...args); }; export var arrayCopy = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.arrayCopy (...args); }; export var concat = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.concat (...args); }; export var reverse = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.reverse (...args); }; export var shorten = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.shorten (...args); }; export var shuffle = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.shuffle (...args); }; export var py_sort = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.py_sort (...args); }; export var splice = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.splice (...args); }; export var subset = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.subset (...args); }; export var float = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.float (...args); }; export var int = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.int (...args); }; export var str = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.str (...args); }; export var boolean = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.boolean (...args); }; export var byte = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.byte (...args); }; export var char = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.char (...args); }; export var unchar = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.unchar (...args); }; export var hex = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.hex (...args); }; export var unhex = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.unhex (...args); }; export var join = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.join (...args); }; export var match = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.match (...args); }; export var matchAll = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.matchAll (...args); }; export var nf = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.nf (...args); }; export var nfc = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.nfc (...args); }; export var nfp = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.nfp (...args); }; export var nfs = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.nfs (...args); }; export var py_split = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.py_split (...args); }; export var splitTokens = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.splitTokens (...args); }; export var trim = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.trim (...args); }; export var setMoveThreshold = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.setMoveThreshold (...args); }; export var setShakeThreshold = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.setShakeThreshold (...args); }; export var keyIsDown = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.keyIsDown (...args); }; export var createImage = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createImage (...args); }; export var saveCanvas = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.saveCanvas (...args); }; export var saveFrames = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.saveFrames (...args); }; export var image_proxy = function (img) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'img': var img = __allkwargs0__ [__attrib0__]; break; } } } } else { } var _set = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } var value = img.set (...args); return value; }; var _get = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } var value = img.get (...args); return value; }; img.py_set = _set; img.py_get = _get; return img; }; export var loadImage = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } var imageObj = _P5_INSTANCE.loadImage (...args); return image_proxy (imageObj); }; export var image = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.image (...args); }; export var tint = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.tint (...args); }; export var noTint = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noTint (...args); }; export var imageMode = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.imageMode (...args); }; export var blend = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.blend (...args); }; export var copy = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.copy (...args); }; export var filter = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } if (len (args) > 1 && (args [0] === null || callable (args [0]))) { return PythonFunctions.filter (...args); } else { return _P5_INSTANCE.filter (...args); } }; export var py_get = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } var p5_get = _P5_INSTANCE.get (...args); return p5_get; }; export var loadPixels = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.loadPixels (...args); }; export var py_set = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } if (len (args) <= 1) { return PythonFunctions.py_set (...args); } else { return _P5_INSTANCE.py_set (...args); } }; export var updatePixels = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.updatePixels (...args); }; export var loadJSON = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.loadJSON (...args); }; export var loadStrings = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.loadStrings (...args); }; export var loadTable = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.loadTable (...args); }; export var loadXML = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.loadXML (...args); }; export var loadBytes = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.loadBytes (...args); }; export var httpGet = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.httpGet (...args); }; export var httpPost = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.httpPost (...args); }; export var httpDo = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.httpDo (...args); }; export var createWriter = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createWriter (...args); }; export var save = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.save (...args); }; export var saveJSON = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.saveJSON (...args); }; export var saveStrings = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.saveStrings (...args); }; export var saveTable = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.saveTable (...args); }; export var day = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.day (...args); }; export var hour = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.hour (...args); }; export var minute = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.minute (...args); }; export var millis = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.millis (...args); }; export var month = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.month (...args); }; export var second = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.second (...args); }; export var year = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.year (...args); }; export var createVector = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createVector (...args); }; export var abs = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.abs (...args); }; export var ceil = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.ceil (...args); }; export var constrain = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.constrain (...args); }; export var dist = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.dist (...args); }; export var exp = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.exp (...args); }; export var floor = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.floor (...args); }; export var lerp = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.lerp (...args); }; export var log = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.log (...args); }; export var mag = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.mag (...args); }; export var map = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } if (len (args) > 1 && callable (args [0])) { return PythonFunctions.map (...args); } else { return _P5_INSTANCE.map (...args); } }; export var max = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.max (...args); }; export var min = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.min (...args); }; export var norm = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.norm (...args); }; export var pow = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.pow (...args); }; export var round = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.round (...args); }; export var sq = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.sq (...args); }; export var sqrt = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.sqrt (...args); }; export var noise = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noise (...args); }; export var noiseDetail = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noiseDetail (...args); }; export var noiseSeed = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noiseSeed (...args); }; export var randomSeed = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.randomSeed (...args); }; export var random = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.random (...args); }; export var randomGaussian = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.randomGaussian (...args); }; export var acos = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.acos (...args); }; export var asin = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.asin (...args); }; export var atan = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.atan (...args); }; export var atan2 = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.atan2 (...args); }; export var cos = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.cos (...args); }; export var sin = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.sin (...args); }; export var tan = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.tan (...args); }; export var degrees = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.degrees (...args); }; export var radians = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.radians (...args); }; export var angleMode = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.angleMode (...args); }; export var textAlign = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.textAlign (...args); }; export var textLeading = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.textLeading (...args); }; export var textSize = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.textSize (...args); }; export var textStyle = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.textStyle (...args); }; export var textWidth = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.textWidth (...args); }; export var textAscent = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.textAscent (...args); }; export var textDescent = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.textDescent (...args); }; export var loadFont = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.loadFont (...args); }; export var text = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.text (...args); }; export var textFont = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.textFont (...args); }; export var orbitControl = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.orbitControl (...args); }; export var debugMode = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.debugMode (...args); }; export var noDebugMode = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.noDebugMode (...args); }; export var ambientLight = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.ambientLight (...args); }; export var directionalLight = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.directionalLight (...args); }; export var pointLight = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.pointLight (...args); }; export var lights = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.lights (...args); }; export var loadShader = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.loadShader (...args); }; export var createShader = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createShader (...args); }; export var shader = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.shader (...args); }; export var resetShader = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.resetShader (...args); }; export var normalMaterial = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.normalMaterial (...args); }; export var texture = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.texture (...args); }; export var textureMode = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.textureMode (...args); }; export var textureWrap = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.textureWrap (...args); }; export var ambientMaterial = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.ambientMaterial (...args); }; export var specularMaterial = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.specularMaterial (...args); }; export var shininess = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.shininess (...args); }; export var camera = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.camera (...args); }; export var perspective = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.perspective (...args); }; export var ortho = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.ortho (...args); }; export var createCamera = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createCamera (...args); }; export var setCamera = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.setCamera (...args); }; export var select = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.select (...args); }; export var selectAll = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.selectAll (...args); }; export var removeElements = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.removeElements (...args); }; export var changed = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.changed (...args); }; export var input = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.input (...args); }; export var createDiv = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createDiv (...args); }; export var createP = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createP (...args); }; export var createSpan = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createSpan (...args); }; export var createImg = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createImg (...args); }; export var createA = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createA (...args); }; export var createSlider = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createSlider (...args); }; export var createButton = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createButton (...args); }; export var createCheckbox = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createCheckbox (...args); }; export var createSelect = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createSelect (...args); }; export var createRadio = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createRadio (...args); }; export var createColorPicker = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createColorPicker (...args); }; export var createInput = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createInput (...args); }; export var createFileInput = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createFileInput (...args); }; export var createVideo = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createVideo (...args); }; export var createAudio = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createAudio (...args); }; export var createCapture = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createCapture (...args); }; export var createElement = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } return _P5_INSTANCE.createElement (...args); }; export var createCanvas = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } var canvas = _P5_INSTANCE.createCanvas (...args); width = _P5_INSTANCE.width; height = _P5_INSTANCE.height; return canvas; }; export var py_pop = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); } else { var args = tuple (); } var p5_pop = _P5_INSTANCE.pop (...args); return p5_pop; }; export var size = createCanvas; export var popMatrix = py_pop; export var popStyle = py_pop; export var pushMatrix = push; export var pushStyle = push; export var PVector = function (x, y, z) { if (typeof x == 'undefined' || (x != null && x.hasOwnProperty ("__kwargtrans__"))) {; var x = 0; }; if (typeof y == 'undefined' || (y != null && y.hasOwnProperty ("__kwargtrans__"))) {; var y = 0; }; if (typeof z == 'undefined' || (z != null && z.hasOwnProperty ("__kwargtrans__"))) {; var z = 0; }; if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'x': var x = __allkwargs0__ [__attrib0__]; break; case 'y': var y = __allkwargs0__ [__attrib0__]; break; case 'z': var z = __allkwargs0__ [__attrib0__]; break; } } } } else { } return _P5_INSTANCE.createVector (x, y, z); }; setattr (PVector, 'dist', p5.Vector.dist); setattr (PVector, 'add', p5.Vector.add); setattr (PVector, 'sub', p5.Vector.sub); setattr (PVector, 'mult', p5.Vector.mult); setattr (PVector, 'div', p5.Vector.div); setattr (PVector, 'dot', p5.Vector.dot); setattr (PVector, 'cross', p5.Vector.cross); setattr (PVector, 'lerp', p5.Vector.lerp); setattr (PVector, 'random2D', p5.Vector.random2D); setattr (PVector, 'random3D', p5.Vector.random3D); setattr (PVector, 'angleBetween', p5.Vector.angleBetween); setattr (PVector, 'fromAngle', p5.Vector.fromAngle); setattr (PVector, 'fromAngles', p5.Vector.fromAngles); setattr (PVector, 'equals', p5.Vector.equals); export var pre_draw = function (p5_instance, draw_func) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'p5_instance': var p5_instance = __allkwargs0__ [__attrib0__]; break; case 'draw_func': var draw_func = __allkwargs0__ [__attrib0__]; break; } } } } else { } _CTX_MIDDLE = p5_instance._CTX_MIDDLE; _DEFAULT_FILL = p5_instance._DEFAULT_FILL; _DEFAULT_LEADMULT = p5_instance._DEFAULT_LEADMULT; _DEFAULT_STROKE = p5_instance._DEFAULT_STROKE; _DEFAULT_TEXT_FILL = p5_instance._DEFAULT_TEXT_FILL; ADD = p5_instance.ADD; ALT = p5_instance.ALT; ARROW = p5_instance.ARROW; AUDIO = p5_instance.AUDIO; AUTO = p5_instance.AUTO; AXES = p5_instance.AXES; BACKSPACE = p5_instance.BACKSPACE; BASELINE = p5_instance.BASELINE; BEVEL = p5_instance.BEVEL; BEZIER = p5_instance.BEZIER; BLEND = p5_instance.BLEND; BLUR = p5_instance.BLUR; BOLD = p5_instance.BOLD; BOLDITALIC = p5_instance.BOLDITALIC; BOTTOM = p5_instance.BOTTOM; BURN = p5_instance.BURN; CENTER = p5_instance.CENTER; CHORD = p5_instance.CHORD; CLAMP = p5_instance.CLAMP; CLOSE = p5_instance.CLOSE; CONTROL = p5_instance.CONTROL; CORNER = p5_instance.CORNER; CORNERS = p5_instance.CORNERS; CROSS = p5_instance.CROSS; CURVE = p5_instance.CURVE; DARKEST = p5_instance.DARKEST; DEG_TO_RAD = p5_instance.DEG_TO_RAD; DEGREES = p5_instance.DEGREES; DELETE = p5_instance.DELETE; DIFFERENCE = p5_instance.DIFFERENCE; DILATE = p5_instance.DILATE; DODGE = p5_instance.DODGE; DOWN_ARROW = p5_instance.DOWN_ARROW; ENTER = p5_instance.ENTER; ERODE = p5_instance.ERODE; ESCAPE = p5_instance.ESCAPE; EXCLUSION = p5_instance.EXCLUSION; FILL = p5_instance.FILL; GRAY = p5_instance.GRAY; GRID = p5_instance.GRID; HALF_PI = p5_instance.HALF_PI; HAND = p5_instance.HAND; HARD_LIGHT = p5_instance.HARD_LIGHT; HSB = p5_instance.HSB; HSL = p5_instance.HSL; IMAGE = p5_instance.IMAGE; IMMEDIATE = p5_instance.IMMEDIATE; INVERT = p5_instance.INVERT; ITALIC = p5_instance.ITALIC; LANDSCAPE = p5_instance.LANDSCAPE; LEFT = p5_instance.LEFT; LEFT_ARROW = p5_instance.LEFT_ARROW; LIGHTEST = p5_instance.LIGHTEST; LINE_LOOP = p5_instance.LINE_LOOP; LINE_STRIP = p5_instance.LINE_STRIP; LINEAR = p5_instance.LINEAR; LINES = p5_instance.LINES; MIRROR = p5_instance.MIRROR; MITER = p5_instance.MITER; MOVE = p5_instance.MOVE; MULTIPLY = p5_instance.MULTIPLY; NEAREST = p5_instance.NEAREST; NORMAL = p5_instance.NORMAL; OPAQUE = p5_instance.OPAQUE; OPEN = p5_instance.OPEN; OPTION = p5_instance.OPTION; OVERLAY = p5_instance.OVERLAY; P2D = p5_instance.P2D; var P3D = p5_instance.WEBGL; PI = p5_instance.PI; PIE = p5_instance.PIE; POINTS = p5_instance.POINTS; PORTRAIT = p5_instance.PORTRAIT; POSTERIZE = p5_instance.POSTERIZE; PROJECT = p5_instance.PROJECT; QUAD_STRIP = p5_instance.QUAD_STRIP; QUADRATIC = p5_instance.QUADRATIC; QUADS = p5_instance.QUADS; QUARTER_PI = p5_instance.QUARTER_PI; RAD_TO_DEG = p5_instance.RAD_TO_DEG; RADIANS = p5_instance.RADIANS; RADIUS = p5_instance.RADIUS; REPEAT = p5_instance.REPEAT; REPLACE = p5_instance.REPLACE; RETURN = p5_instance.RETURN; RGB = p5_instance.RGB; RIGHT = p5_instance.RIGHT; RIGHT_ARROW = p5_instance.RIGHT_ARROW; ROUND = p5_instance.ROUND; SCREEN = p5_instance.SCREEN; SHIFT = p5_instance.SHIFT; SOFT_LIGHT = p5_instance.SOFT_LIGHT; SQUARE = p5_instance.SQUARE; STROKE = p5_instance.STROKE; SUBTRACT = p5_instance.SUBTRACT; TAB = p5_instance.TAB; TAU = p5_instance.TAU; TEXT = p5_instance.TEXT; TEXTURE = p5_instance.TEXTURE; THRESHOLD = p5_instance.THRESHOLD; TOP = p5_instance.TOP; TRIANGLE_FAN = p5_instance.TRIANGLE_FAN; TRIANGLE_STRIP = p5_instance.TRIANGLE_STRIP; TRIANGLES = p5_instance.TRIANGLES; TWO_PI = p5_instance.TWO_PI; UP_ARROW = p5_instance.UP_ARROW; VIDEO = p5_instance.VIDEO; WAIT = p5_instance.WAIT; WEBGL = p5_instance.WEBGL; frameCount = p5_instance.frameCount; focused = p5_instance.focused; displayWidth = p5_instance.displayWidth; displayHeight = p5_instance.displayHeight; windowWidth = p5_instance.windowWidth; windowHeight = p5_instance.windowHeight; width = p5_instance.width; height = p5_instance.height; disableFriendlyErrors = p5_instance.disableFriendlyErrors; deviceOrientation = p5_instance.deviceOrientation; accelerationX = p5_instance.accelerationX; accelerationY = p5_instance.accelerationY; accelerationZ = p5_instance.accelerationZ; pAccelerationX = p5_instance.pAccelerationX; pAccelerationY = p5_instance.pAccelerationY; pAccelerationZ = p5_instance.pAccelerationZ; rotationX = p5_instance.rotationX; rotationY = p5_instance.rotationY; rotationZ = p5_instance.rotationZ; pRotationX = p5_instance.pRotationX; pRotationY = p5_instance.pRotationY; pRotationZ = p5_instance.pRotationZ; turnAxis = p5_instance.turnAxis; keyIsPressed = p5_instance.keyIsPressed; key = p5_instance.key; keyCode = p5_instance.keyCode; mouseX = p5_instance.mouseX; mouseY = p5_instance.mouseY; pmouseX = p5_instance.pmouseX; pmouseY = p5_instance.pmouseY; winMouseX = p5_instance.winMouseX; winMouseY = p5_instance.winMouseY; pwinMouseX = p5_instance.pwinMouseX; pwinMouseY = p5_instance.pwinMouseY; mouseButton = p5_instance.mouseButton; mouseIsPressed = p5_instance.mouseIsPressed; touches = p5_instance.touches; pixels = p5_instance.pixels; return draw_func (); }; export var global_p5_injection = function (p5_sketch) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'p5_sketch': var p5_sketch = __allkwargs0__ [__attrib0__]; break; } } } } else { } var decorator = function (f) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'f': var f = __allkwargs0__ [__attrib0__]; break; } } } } else { } var wrapper = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } } else { } _P5_INSTANCE = p5_sketch; return pre_draw (_P5_INSTANCE, f); }; return wrapper; }; return decorator; }; export var start_p5 = function (preload_func, setup_func, draw_func, event_functions) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'preload_func': var preload_func = __allkwargs0__ [__attrib0__]; break; case 'setup_func': var setup_func = __allkwargs0__ [__attrib0__]; break; case 'draw_func': var draw_func = __allkwargs0__ [__attrib0__]; break; case 'event_functions': var event_functions = __allkwargs0__ [__attrib0__]; break; } } } } else { } var sketch_setup = function (p5_sketch) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'p5_sketch': var p5_sketch = __allkwargs0__ [__attrib0__]; break; } } } } else { } p5_sketch.preload = global_p5_injection (p5_sketch) (preload_func); p5_sketch.setup = global_p5_injection (p5_sketch) (setup_func); p5_sketch.draw = global_p5_injection (p5_sketch) (draw_func); }; var instance = new p5 (sketch_setup, 'sketch-holder'); var event_function_names = tuple (['deviceMoved', 'deviceTurned', 'deviceShaken', 'windowResized', 'keyPressed', 'keyReleased', 'keyTyped', 'mousePressed', 'mouseReleased', 'mouseClicked', 'doubleClicked', 'mouseMoved', 'mouseDragged', 'mouseWheel', 'touchStarted', 'touchMoved', 'touchEnded', 'keyIsDown']); for (var f_name of (function () { var __accu0__ = []; for (var f of event_function_names) { if (event_functions.py_get (f, null)) { __accu0__.append (f); } } return __accu0__; }) ()) { var func = event_functions [f_name]; var event_func = global_p5_injection (instance) (func); setattr (instance, f_name, event_func); } }; export var logOnloaded = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } } else { } console.log ('Lib loaded!'); }; export var add_library = function (lib_name) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'lib_name': var lib_name = __allkwargs0__ [__attrib0__]; break; } } } } else { } var src = ''; return console.log ('Lib name is not valid:', lib_name); console.log ('Importing:', src); var script = document.createElement ('script'); script.onload = logOnloaded; script.src = src; document.head.appendChild (script); }; //# sourceMappingURL=pyp5js.map ================================================ FILE: docs/examples/transcrypt/sketch_010/target/pyp5js.py ================================================ from python_functions import PythonFunctions _P5_INSTANCE = None _CTX_MIDDLE = None _DEFAULT_FILL = None _DEFAULT_LEADMULT = None _DEFAULT_STROKE = None _DEFAULT_TEXT_FILL = None ADD = None ALT = None ARROW = None AUDIO = None AUTO = None AXES = None BACKSPACE = None BASELINE = None BEVEL = None BEZIER = None BLEND = None BLUR = None BOLD = None BOLDITALIC = None BOTTOM = None BURN = None CENTER = None CHORD = None CLAMP = None CLOSE = None CONTROL = None CORNER = None CORNERS = None CROSS = None CURVE = None DARKEST = None DEG_TO_RAD = None DEGREES = None DELETE = None DIFFERENCE = None DILATE = None DODGE = None DOWN_ARROW = None ENTER = None ERODE = None ESCAPE = None EXCLUSION = None FILL = None GRAY = None GRID = None HALF_PI = None HAND = None HARD_LIGHT = None HSB = None HSL = None IMAGE = None IMMEDIATE = None INVERT = None ITALIC = None LANDSCAPE = None LEFT = None LEFT_ARROW = None LIGHTEST = None LINE_LOOP = None LINE_STRIP = None LINEAR = None LINES = None MIRROR = None MITER = None MOVE = None MULTIPLY = None NEAREST = None NORMAL = None OPAQUE = None OPEN = None OPTION = None OVERLAY = None PI = None PIE = None POINTS = None PORTRAIT = None POSTERIZE = None PROJECT = None QUAD_STRIP = None QUADRATIC = None QUADS = None QUARTER_PI = None RAD_TO_DEG = None RADIANS = None RADIUS = None REPEAT = None REPLACE = None RETURN = None RGB = None RIGHT = None RIGHT_ARROW = None ROUND = None SCREEN = None SHIFT = None SOFT_LIGHT = None SQUARE = None STROKE = None SUBTRACT = None TAB = None TAU = None TEXT = None TEXTURE = None THRESHOLD = None TOP = None TRIANGLE_FAN = None TRIANGLE_STRIP = None TRIANGLES = None TWO_PI = None UP_ARROW = None VIDEO = None WAIT = None WEBGL = None P2D = None PI = None frameCount = None focused = None displayWidth = None displayHeight = None windowWidth = None windowHeight = None width = None height = None disableFriendlyErrors = None deviceOrientation = None accelerationX = None accelerationY = None accelerationZ = None pAccelerationX = None pAccelerationY = None pAccelerationZ = None rotationX = None rotationY = None rotationZ = None pRotationX = None pRotationY = None pRotationZ = None turnAxis = None keyIsPressed = None key = None keyCode = None mouseX = None mouseY = None pmouseX = None pmouseY = None winMouseX = None winMouseY = None pwinMouseX = None pwinMouseY = None mouseButton = None mouseIsPressed = None touches = None pixels = None def alpha(*args): return _P5_INSTANCE.alpha(*args) def blue(*args): return _P5_INSTANCE.blue(*args) def brightness(*args): return _P5_INSTANCE.brightness(*args) def color(*args): return _P5_INSTANCE.color(*args) def green(*args): return _P5_INSTANCE.green(*args) def hue(*args): return _P5_INSTANCE.hue(*args) def lerpColor(*args): return _P5_INSTANCE.lerpColor(*args) def lightness(*args): return _P5_INSTANCE.lightness(*args) def red(*args): return _P5_INSTANCE.red(*args) def saturation(*args): return _P5_INSTANCE.saturation(*args) def background(*args): return _P5_INSTANCE.background(*args) def clear(*args): __pragma__('noalias', 'clear') p5_clear = _P5_INSTANCE.clear(*args) __pragma__('alias', 'clear', 'py_clear') return p5_clear def erase(*args): return _P5_INSTANCE.erase(*args) def noErase(*args): return _P5_INSTANCE.noErase(*args) def colorMode(*args): return _P5_INSTANCE.colorMode(*args) def fill(*args): return _P5_INSTANCE.fill(*args) def noFill(*args): return _P5_INSTANCE.noFill(*args) def noStroke(*args): return _P5_INSTANCE.noStroke(*args) def stroke(*args): return _P5_INSTANCE.stroke(*args) def arc(*args): return _P5_INSTANCE.arc(*args) def ellipse(*args): return _P5_INSTANCE.ellipse(*args) def circle(*args): return _P5_INSTANCE.circle(*args) def line(*args): return _P5_INSTANCE.line(*args) def point(*args): return _P5_INSTANCE.point(*args) def quad(*args): return _P5_INSTANCE.quad(*args) def rect(*args): return _P5_INSTANCE.rect(*args) def square(*args): return _P5_INSTANCE.square(*args) def triangle(*args): return _P5_INSTANCE.triangle(*args) def plane(*args): return _P5_INSTANCE.plane(*args) def box(*args): return _P5_INSTANCE.box(*args) def sphere(*args): return _P5_INSTANCE.sphere(*args) def cylinder(*args): return _P5_INSTANCE.cylinder(*args) def cone(*args): return _P5_INSTANCE.cone(*args) def ellipsoid(*args): return _P5_INSTANCE.ellipsoid(*args) def torus(*args): return _P5_INSTANCE.torus(*args) def loadModel(*args): return _P5_INSTANCE.loadModel(*args) def model(*args): return _P5_INSTANCE.model(*args) def ellipseMode(*args): return _P5_INSTANCE.ellipseMode(*args) def noSmooth(*args): return _P5_INSTANCE.noSmooth(*args) def rectMode(*args): return _P5_INSTANCE.rectMode(*args) def smooth(*args): return _P5_INSTANCE.smooth(*args) def strokeCap(*args): return _P5_INSTANCE.strokeCap(*args) def strokeJoin(*args): return _P5_INSTANCE.strokeJoin(*args) def strokeWeight(*args): return _P5_INSTANCE.strokeWeight(*args) def bezier(*args): return _P5_INSTANCE.bezier(*args) def bezierDetail(*args): return _P5_INSTANCE.bezierDetail(*args) def bezierPoint(*args): return _P5_INSTANCE.bezierPoint(*args) def bezierTangent(*args): return _P5_INSTANCE.bezierTangent(*args) def curve(*args): return _P5_INSTANCE.curve(*args) def curveDetail(*args): return _P5_INSTANCE.curveDetail(*args) def curveTightness(*args): return _P5_INSTANCE.curveTightness(*args) def curvePoint(*args): return _P5_INSTANCE.curvePoint(*args) def curveTangent(*args): return _P5_INSTANCE.curveTangent(*args) def beginContour(*args): return _P5_INSTANCE.beginContour(*args) def beginShape(*args): return _P5_INSTANCE.beginShape(*args) def bezierVertex(*args): return _P5_INSTANCE.bezierVertex(*args) def curveVertex(*args): return _P5_INSTANCE.curveVertex(*args) def endContour(*args): return _P5_INSTANCE.endContour(*args) def endShape(*args): return _P5_INSTANCE.endShape(*args) def quadraticVertex(*args): return _P5_INSTANCE.quadraticVertex(*args) def vertex(*args): return _P5_INSTANCE.vertex(*args) def cursor(*args): return _P5_INSTANCE.cursor(*args) def frameRate(*args): return _P5_INSTANCE.frameRate(*args) def noCursor(*args): return _P5_INSTANCE.noCursor(*args) def fullscreen(*args): return _P5_INSTANCE.fullscreen(*args) def pixelDensity(*args): return _P5_INSTANCE.pixelDensity(*args) def displayDensity(*args): return _P5_INSTANCE.displayDensity(*args) def getURL(*args): return _P5_INSTANCE.getURL(*args) def getURLPath(*args): return _P5_INSTANCE.getURLPath(*args) def getURLParams(*args): return _P5_INSTANCE.getURLParams(*args) def preload(*args): return _P5_INSTANCE.preload(*args) def setup(*args): return _P5_INSTANCE.setup(*args) def draw(*args): return _P5_INSTANCE.draw(*args) def remove(*args): return _P5_INSTANCE.remove(*args) def noLoop(*args): return _P5_INSTANCE.noLoop(*args) def loop(*args): return _P5_INSTANCE.loop(*args) def push(*args): return _P5_INSTANCE.push(*args) def redraw(*args): return _P5_INSTANCE.redraw(*args) def resizeCanvas(*args): return _P5_INSTANCE.resizeCanvas(*args) def noCanvas(*args): return _P5_INSTANCE.noCanvas(*args) def createGraphics(*args): return _P5_INSTANCE.createGraphics(*args) def blendMode(*args): return _P5_INSTANCE.blendMode(*args) def setAttributes(*args): return _P5_INSTANCE.setAttributes(*args) def applyMatrix(*args): return _P5_INSTANCE.applyMatrix(*args) def resetMatrix(*args): return _P5_INSTANCE.resetMatrix(*args) def rotate(*args): return _P5_INSTANCE.rotate(*args) def rotateX(*args): return _P5_INSTANCE.rotateX(*args) def rotateY(*args): return _P5_INSTANCE.rotateY(*args) def rotateZ(*args): return _P5_INSTANCE.rotateZ(*args) def scale(*args): return _P5_INSTANCE.scale(*args) def shearX(*args): return _P5_INSTANCE.shearX(*args) def shearY(*args): return _P5_INSTANCE.shearY(*args) def translate(*args): return _P5_INSTANCE.translate(*args) def createStringDict(*args): return _P5_INSTANCE.createStringDict(*args) def createNumberDict(*args): return _P5_INSTANCE.createNumberDict(*args) def append(*args): return _P5_INSTANCE.append(*args) def arrayCopy(*args): return _P5_INSTANCE.arrayCopy(*args) def concat(*args): return _P5_INSTANCE.concat(*args) def reverse(*args): return _P5_INSTANCE.reverse(*args) def shorten(*args): return _P5_INSTANCE.shorten(*args) def shuffle(*args): return _P5_INSTANCE.shuffle(*args) def sort(*args): return _P5_INSTANCE.sort(*args) def splice(*args): return _P5_INSTANCE.splice(*args) def subset(*args): return _P5_INSTANCE.subset(*args) def float(*args): return _P5_INSTANCE.float(*args) def int(*args): return _P5_INSTANCE.int(*args) def str(*args): return _P5_INSTANCE.str(*args) def boolean(*args): return _P5_INSTANCE.boolean(*args) def byte(*args): return _P5_INSTANCE.byte(*args) def char(*args): return _P5_INSTANCE.char(*args) def unchar(*args): return _P5_INSTANCE.unchar(*args) def hex(*args): return _P5_INSTANCE.hex(*args) def unhex(*args): return _P5_INSTANCE.unhex(*args) def join(*args): return _P5_INSTANCE.join(*args) def match(*args): return _P5_INSTANCE.match(*args) def matchAll(*args): return _P5_INSTANCE.matchAll(*args) def nf(*args): return _P5_INSTANCE.nf(*args) def nfc(*args): return _P5_INSTANCE.nfc(*args) def nfp(*args): return _P5_INSTANCE.nfp(*args) def nfs(*args): return _P5_INSTANCE.nfs(*args) def split(*args): return _P5_INSTANCE.split(*args) def splitTokens(*args): return _P5_INSTANCE.splitTokens(*args) def trim(*args): return _P5_INSTANCE.trim(*args) def setMoveThreshold(*args): return _P5_INSTANCE.setMoveThreshold(*args) def setShakeThreshold(*args): return _P5_INSTANCE.setShakeThreshold(*args) def keyIsDown(*args): return _P5_INSTANCE.keyIsDown(*args) def createImage(*args): return _P5_INSTANCE.createImage(*args) def saveCanvas(*args): return _P5_INSTANCE.saveCanvas(*args) def saveFrames(*args): return _P5_INSTANCE.saveFrames(*args) def image_proxy(img): """ Proxy to turn of transcypt when calling img.get/set methods """ def _set(*args): __pragma__('noalias', 'set') value = img.set(*args) __pragma__('alias', 'set', 'py_set') return value def _get(*args): __pragma__('noalias', 'get') value = img.get(*args) __pragma__('alias', 'get', 'py_get') return value img.set = _set img.get = _get return img def loadImage(*args): imageObj = _P5_INSTANCE.loadImage(*args) return image_proxy(imageObj) def image(*args): return _P5_INSTANCE.image(*args) def tint(*args): return _P5_INSTANCE.tint(*args) def noTint(*args): return _P5_INSTANCE.noTint(*args) def imageMode(*args): return _P5_INSTANCE.imageMode(*args) def blend(*args): return _P5_INSTANCE.blend(*args) def copy(*args): return _P5_INSTANCE.copy(*args) def filter(*args): if len(args) > 1 and (args[0] is None or callable(args[0])): return PythonFunctions.filter(*args) else: return _P5_INSTANCE.filter(*args) def get(*args): __pragma__('noalias', 'get') p5_get = _P5_INSTANCE.get(*args) __pragma__('alias', 'get', 'py_get') return p5_get def loadPixels(*args): return _P5_INSTANCE.loadPixels(*args) def set(*args): if len(args) <= 1: return PythonFunctions.set(*args) else: return _P5_INSTANCE.set(*args) def updatePixels(*args): return _P5_INSTANCE.updatePixels(*args) def loadJSON(*args): return _P5_INSTANCE.loadJSON(*args) def loadStrings(*args): return _P5_INSTANCE.loadStrings(*args) def loadTable(*args): return _P5_INSTANCE.loadTable(*args) def loadXML(*args): return _P5_INSTANCE.loadXML(*args) def loadBytes(*args): return _P5_INSTANCE.loadBytes(*args) def httpGet(*args): return _P5_INSTANCE.httpGet(*args) def httpPost(*args): return _P5_INSTANCE.httpPost(*args) def httpDo(*args): return _P5_INSTANCE.httpDo(*args) def createWriter(*args): return _P5_INSTANCE.createWriter(*args) def save(*args): return _P5_INSTANCE.save(*args) def saveJSON(*args): return _P5_INSTANCE.saveJSON(*args) def saveStrings(*args): return _P5_INSTANCE.saveStrings(*args) def saveTable(*args): return _P5_INSTANCE.saveTable(*args) def day(*args): return _P5_INSTANCE.day(*args) def hour(*args): return _P5_INSTANCE.hour(*args) def minute(*args): return _P5_INSTANCE.minute(*args) def millis(*args): return _P5_INSTANCE.millis(*args) def month(*args): return _P5_INSTANCE.month(*args) def second(*args): return _P5_INSTANCE.second(*args) def year(*args): return _P5_INSTANCE.year(*args) def createVector(*args): return _P5_INSTANCE.createVector(*args) def abs(*args): return _P5_INSTANCE.abs(*args) def ceil(*args): return _P5_INSTANCE.ceil(*args) def constrain(*args): return _P5_INSTANCE.constrain(*args) def dist(*args): return _P5_INSTANCE.dist(*args) def exp(*args): return _P5_INSTANCE.exp(*args) def floor(*args): return _P5_INSTANCE.floor(*args) def lerp(*args): return _P5_INSTANCE.lerp(*args) def log(*args): return _P5_INSTANCE.log(*args) def mag(*args): return _P5_INSTANCE.mag(*args) def map(*args): if len(args) > 1 and callable(args[0]): return PythonFunctions.map(*args) else: return _P5_INSTANCE.map(*args) def max(*args): return _P5_INSTANCE.max(*args) def min(*args): return _P5_INSTANCE.min(*args) def norm(*args): return _P5_INSTANCE.norm(*args) def pow(*args): return _P5_INSTANCE.pow(*args) def round(*args): return _P5_INSTANCE.round(*args) def sq(*args): return _P5_INSTANCE.sq(*args) def sqrt(*args): return _P5_INSTANCE.sqrt(*args) def noise(*args): return _P5_INSTANCE.noise(*args) def noiseDetail(*args): return _P5_INSTANCE.noiseDetail(*args) def noiseSeed(*args): return _P5_INSTANCE.noiseSeed(*args) def randomSeed(*args): return _P5_INSTANCE.randomSeed(*args) def random(*args): return _P5_INSTANCE.random(*args) def randomGaussian(*args): return _P5_INSTANCE.randomGaussian(*args) def acos(*args): return _P5_INSTANCE.acos(*args) def asin(*args): return _P5_INSTANCE.asin(*args) def atan(*args): return _P5_INSTANCE.atan(*args) def atan2(*args): return _P5_INSTANCE.atan2(*args) def cos(*args): return _P5_INSTANCE.cos(*args) def sin(*args): return _P5_INSTANCE.sin(*args) def tan(*args): return _P5_INSTANCE.tan(*args) def degrees(*args): return _P5_INSTANCE.degrees(*args) def radians(*args): return _P5_INSTANCE.radians(*args) def angleMode(*args): return _P5_INSTANCE.angleMode(*args) def textAlign(*args): return _P5_INSTANCE.textAlign(*args) def textLeading(*args): return _P5_INSTANCE.textLeading(*args) def textSize(*args): return _P5_INSTANCE.textSize(*args) def textStyle(*args): return _P5_INSTANCE.textStyle(*args) def textWidth(*args): return _P5_INSTANCE.textWidth(*args) def textAscent(*args): return _P5_INSTANCE.textAscent(*args) def textDescent(*args): return _P5_INSTANCE.textDescent(*args) def loadFont(*args): return _P5_INSTANCE.loadFont(*args) def text(*args): return _P5_INSTANCE.text(*args) def textFont(*args): return _P5_INSTANCE.textFont(*args) def orbitControl(*args): return _P5_INSTANCE.orbitControl(*args) def debugMode(*args): return _P5_INSTANCE.debugMode(*args) def noDebugMode(*args): return _P5_INSTANCE.noDebugMode(*args) def ambientLight(*args): return _P5_INSTANCE.ambientLight(*args) def directionalLight(*args): return _P5_INSTANCE.directionalLight(*args) def pointLight(*args): return _P5_INSTANCE.pointLight(*args) def lights(*args): return _P5_INSTANCE.lights(*args) def loadShader(*args): return _P5_INSTANCE.loadShader(*args) def createShader(*args): return _P5_INSTANCE.createShader(*args) def shader(*args): return _P5_INSTANCE.shader(*args) def resetShader(*args): return _P5_INSTANCE.resetShader(*args) def normalMaterial(*args): return _P5_INSTANCE.normalMaterial(*args) def texture(*args): return _P5_INSTANCE.texture(*args) def textureMode(*args): return _P5_INSTANCE.textureMode(*args) def textureWrap(*args): return _P5_INSTANCE.textureWrap(*args) def ambientMaterial(*args): return _P5_INSTANCE.ambientMaterial(*args) def specularMaterial(*args): return _P5_INSTANCE.specularMaterial(*args) def shininess(*args): return _P5_INSTANCE.shininess(*args) def camera(*args): return _P5_INSTANCE.camera(*args) def perspective(*args): return _P5_INSTANCE.perspective(*args) def ortho(*args): return _P5_INSTANCE.ortho(*args) def createCamera(*args): return _P5_INSTANCE.createCamera(*args) def setCamera(*args): return _P5_INSTANCE.setCamera(*args) def select(*args): return _P5_INSTANCE.select(*args) def selectAll(*args): return _P5_INSTANCE.selectAll(*args) def removeElements(*args): return _P5_INSTANCE.removeElements(*args) def changed(*args): return _P5_INSTANCE.changed(*args) def input(*args): return _P5_INSTANCE.input(*args) def createDiv(*args): return _P5_INSTANCE.createDiv(*args) def createP(*args): return _P5_INSTANCE.createP(*args) def createSpan(*args): return _P5_INSTANCE.createSpan(*args) def createImg(*args): return _P5_INSTANCE.createImg(*args) def createA(*args): return _P5_INSTANCE.createA(*args) def createSlider(*args): return _P5_INSTANCE.createSlider(*args) def createButton(*args): return _P5_INSTANCE.createButton(*args) def createCheckbox(*args): return _P5_INSTANCE.createCheckbox(*args) def createSelect(*args): return _P5_INSTANCE.createSelect(*args) def createRadio(*args): return _P5_INSTANCE.createRadio(*args) def createColorPicker(*args): return _P5_INSTANCE.createColorPicker(*args) def createInput(*args): return _P5_INSTANCE.createInput(*args) def createFileInput(*args): return _P5_INSTANCE.createFileInput(*args) def createVideo(*args): return _P5_INSTANCE.createVideo(*args) def createAudio(*args): return _P5_INSTANCE.createAudio(*args) def createCapture(*args): return _P5_INSTANCE.createCapture(*args) def createElement(*args): return _P5_INSTANCE.createElement(*args) def createCanvas(*args): canvas = _P5_INSTANCE.createCanvas(*args) global width, height width = _P5_INSTANCE.width height = _P5_INSTANCE.height return canvas def pop(*args): __pragma__('noalias', 'pop') p5_pop = _P5_INSTANCE.pop(*args) __pragma__('alias', 'pop', 'py_pop') return p5_pop # Processing Python or Java mode compatibility aliases size = createCanvas popMatrix = pop popStyle = pop pushMatrix = push pushStyle = push # PVector is a helper/alias to create p5.Vector objects def PVector(x=0, y=0, z=0): return _P5_INSTANCE.createVector(x, y, z) # aliases for p5.Vector class methods setattr(PVector, 'dist', p5.Vector.dist) setattr(PVector, 'add', p5.Vector.add) setattr(PVector, 'sub', p5.Vector.sub) setattr(PVector, 'mult', p5.Vector.mult) setattr(PVector, 'div', p5.Vector.div) setattr(PVector, 'dot', p5.Vector.dot) setattr(PVector, 'cross', p5.Vector.cross) setattr(PVector, 'lerp', p5.Vector.lerp) setattr(PVector, 'random2D', p5.Vector.random2D) setattr(PVector, 'random3D', p5.Vector.random3D) setattr(PVector, 'angleBetween', p5.Vector.angleBetween) setattr(PVector, 'fromAngle', p5.Vector.fromAngle) setattr(PVector, 'fromAngles', p5.Vector.fromAngles) setattr(PVector, 'equals', p5.Vector.equals) def pre_draw(p5_instance, draw_func): """ We need to run this before the actual draw to insert and update p5 env variables """ global _CTX_MIDDLE, _DEFAULT_FILL, _DEFAULT_LEADMULT, _DEFAULT_STROKE, _DEFAULT_TEXT_FILL global ADD, ALT, ARROW, AUTO, AUDIO, AXES, BACKSPACE, BASELINE, BEVEL, BEZIER, BLEND, BLUR, BOLD, BOLDITALIC global BOTTOM, BURN, CENTER, CHORD, CLAMP, CLOSE, CONTROL, CORNER, CORNERS, CROSS, CURVE, DARKEST global DEG_TO_RAD, DEGREES, DELETE, DIFFERENCE, DILATE, DODGE, DOWN_ARROW, ENTER, ERODE, ESCAPE, EXCLUSION global FILL, GRAY, GRID, HALF_PI, HAND, HARD_LIGHT, HSB, HSL, IMAGE, IMMEDIATE, INVERT, ITALIC, LANDSCAPE global LEFT, LEFT_ARROW, LIGHTEST, LINE_LOOP, LINE_STRIP, LINEAR, LINES, MIRROR, MITER, MOVE, MULTIPLY, NEAREST global NORMAL, OPAQUE, OPEN, OPTION, OVERLAY, P2D, PI, PIE, POINTS, PORTRAIT, POSTERIZE, PROJECT, QUAD_STRIP, QUADRATIC global QUADS, QUARTER_PI, RAD_TO_DEG, RADIANS, RADIUS, REPEAT, REPLACE, RETURN, RGB, RIGHT, RIGHT_ARROW global ROUND, SCREEN, SHIFT, SOFT_LIGHT, SQUARE, STROKE, SUBTRACT, TAB, TAU, TEXT, TEXTURE, THRESHOLD, TOP global TRIANGLE_FAN, TRIANGLE_STRIP, TRIANGLES, TWO_PI, UP_ARROW, VIDEO, WAIT, WEBGL global frameCount, focused, displayWidth, displayHeight, windowWidth, windowHeight, width, height global disableFriendlyErrors, deviceOrientation, accelerationX, accelerationY, accelerationZ global pAccelerationX, pAccelerationY, pAccelerationZ, rotationX, rotationY, rotationZ global pRotationX, pRotationY, pRotationZ, turnAxis, keyIsPressed, key, keyCode, mouseX, mouseY, pmouseX, pmouseY global winMouseX, winMouseY, pwinMouseX, pwinMouseY, mouseButton, mouseIsPressed, touches, pixels _CTX_MIDDLE = p5_instance._CTX_MIDDLE _DEFAULT_FILL = p5_instance._DEFAULT_FILL _DEFAULT_LEADMULT = p5_instance._DEFAULT_LEADMULT _DEFAULT_STROKE = p5_instance._DEFAULT_STROKE _DEFAULT_TEXT_FILL = p5_instance._DEFAULT_TEXT_FILL ADD = p5_instance.ADD ALT = p5_instance.ALT ARROW = p5_instance.ARROW AUDIO = p5_instance.AUDIO AUTO = p5_instance.AUTO AXES = p5_instance.AXES BACKSPACE = p5_instance.BACKSPACE BASELINE = p5_instance.BASELINE BEVEL = p5_instance.BEVEL BEZIER = p5_instance.BEZIER BLEND = p5_instance.BLEND BLUR = p5_instance.BLUR BOLD = p5_instance.BOLD BOLDITALIC = p5_instance.BOLDITALIC BOTTOM = p5_instance.BOTTOM BURN = p5_instance.BURN CENTER = p5_instance.CENTER CHORD = p5_instance.CHORD CLAMP = p5_instance.CLAMP CLOSE = p5_instance.CLOSE CONTROL = p5_instance.CONTROL CORNER = p5_instance.CORNER CORNERS = p5_instance.CORNERS CROSS = p5_instance.CROSS CURVE = p5_instance.CURVE DARKEST = p5_instance.DARKEST DEG_TO_RAD = p5_instance.DEG_TO_RAD DEGREES = p5_instance.DEGREES DELETE = p5_instance.DELETE DIFFERENCE = p5_instance.DIFFERENCE DILATE = p5_instance.DILATE DODGE = p5_instance.DODGE DOWN_ARROW = p5_instance.DOWN_ARROW ENTER = p5_instance.ENTER ERODE = p5_instance.ERODE ESCAPE = p5_instance.ESCAPE EXCLUSION = p5_instance.EXCLUSION FILL = p5_instance.FILL GRAY = p5_instance.GRAY GRID = p5_instance.GRID HALF_PI = p5_instance.HALF_PI HAND = p5_instance.HAND HARD_LIGHT = p5_instance.HARD_LIGHT HSB = p5_instance.HSB HSL = p5_instance.HSL IMAGE = p5_instance.IMAGE IMMEDIATE = p5_instance.IMMEDIATE INVERT = p5_instance.INVERT ITALIC = p5_instance.ITALIC LANDSCAPE = p5_instance.LANDSCAPE LEFT = p5_instance.LEFT LEFT_ARROW = p5_instance.LEFT_ARROW LIGHTEST = p5_instance.LIGHTEST LINE_LOOP = p5_instance.LINE_LOOP LINE_STRIP = p5_instance.LINE_STRIP LINEAR = p5_instance.LINEAR LINES = p5_instance.LINES MIRROR = p5_instance.MIRROR MITER = p5_instance.MITER MOVE = p5_instance.MOVE MULTIPLY = p5_instance.MULTIPLY NEAREST = p5_instance.NEAREST NORMAL = p5_instance.NORMAL OPAQUE = p5_instance.OPAQUE OPEN = p5_instance.OPEN OPTION = p5_instance.OPTION OVERLAY = p5_instance.OVERLAY P2D = p5_instance.P2D P3D = p5_instance.WEBGL PI = p5_instance.PI PIE = p5_instance.PIE POINTS = p5_instance.POINTS PORTRAIT = p5_instance.PORTRAIT POSTERIZE = p5_instance.POSTERIZE PROJECT = p5_instance.PROJECT QUAD_STRIP = p5_instance.QUAD_STRIP QUADRATIC = p5_instance.QUADRATIC QUADS = p5_instance.QUADS QUARTER_PI = p5_instance.QUARTER_PI RAD_TO_DEG = p5_instance.RAD_TO_DEG RADIANS = p5_instance.RADIANS RADIUS = p5_instance.RADIUS REPEAT = p5_instance.REPEAT REPLACE = p5_instance.REPLACE RETURN = p5_instance.RETURN RGB = p5_instance.RGB RIGHT = p5_instance.RIGHT RIGHT_ARROW = p5_instance.RIGHT_ARROW ROUND = p5_instance.ROUND SCREEN = p5_instance.SCREEN SHIFT = p5_instance.SHIFT SOFT_LIGHT = p5_instance.SOFT_LIGHT SQUARE = p5_instance.SQUARE STROKE = p5_instance.STROKE SUBTRACT = p5_instance.SUBTRACT TAB = p5_instance.TAB TAU = p5_instance.TAU TEXT = p5_instance.TEXT TEXTURE = p5_instance.TEXTURE THRESHOLD = p5_instance.THRESHOLD TOP = p5_instance.TOP TRIANGLE_FAN = p5_instance.TRIANGLE_FAN TRIANGLE_STRIP = p5_instance.TRIANGLE_STRIP TRIANGLES = p5_instance.TRIANGLES TWO_PI = p5_instance.TWO_PI UP_ARROW = p5_instance.UP_ARROW VIDEO = p5_instance.VIDEO WAIT = p5_instance.WAIT WEBGL = p5_instance.WEBGL frameCount = p5_instance.frameCount focused = p5_instance.focused displayWidth = p5_instance.displayWidth displayHeight = p5_instance.displayHeight windowWidth = p5_instance.windowWidth windowHeight = p5_instance.windowHeight width = p5_instance.width height = p5_instance.height disableFriendlyErrors = p5_instance.disableFriendlyErrors deviceOrientation = p5_instance.deviceOrientation accelerationX = p5_instance.accelerationX accelerationY = p5_instance.accelerationY accelerationZ = p5_instance.accelerationZ pAccelerationX = p5_instance.pAccelerationX pAccelerationY = p5_instance.pAccelerationY pAccelerationZ = p5_instance.pAccelerationZ rotationX = p5_instance.rotationX rotationY = p5_instance.rotationY rotationZ = p5_instance.rotationZ pRotationX = p5_instance.pRotationX pRotationY = p5_instance.pRotationY pRotationZ = p5_instance.pRotationZ turnAxis = p5_instance.turnAxis keyIsPressed = p5_instance.keyIsPressed key = p5_instance.key keyCode = p5_instance.keyCode mouseX = p5_instance.mouseX mouseY = p5_instance.mouseY pmouseX = p5_instance.pmouseX pmouseY = p5_instance.pmouseY winMouseX = p5_instance.winMouseX winMouseY = p5_instance.winMouseY pwinMouseX = p5_instance.pwinMouseX pwinMouseY = p5_instance.pwinMouseY mouseButton = p5_instance.mouseButton mouseIsPressed = p5_instance.mouseIsPressed touches = p5_instance.touches pixels = p5_instance.pixels return draw_func() def global_p5_injection(p5_sketch): """ Injects the p5js's skecth instance as a global variable to setup and draw functions """ def decorator(f): def wrapper(): global _P5_INSTANCE _P5_INSTANCE = p5_sketch return pre_draw(_P5_INSTANCE, f) return wrapper return decorator def start_p5(preload_func, setup_func, draw_func, event_functions): """ This is the entrypoint function. It accepts 2 parameters: - preload_func: a Python preload callable - setup_func: a Python setup callable - draw_func: a Python draw callable - event_functions: a config dict for the event functions in the format: {"eventFunctionName": python_event_function} This method gets the p5js's sketch instance and injects them """ def sketch_setup(p5_sketch): p5_sketch.preload = global_p5_injection(p5_sketch)(preload_func) p5_sketch.setup = global_p5_injection(p5_sketch)(setup_func) p5_sketch.draw = global_p5_injection(p5_sketch)(draw_func) instance = __new__(p5(sketch_setup, 'sketch-holder')) # inject event functions into p5 event_function_names = ( "deviceMoved", "deviceTurned", "deviceShaken", "windowResized", "keyPressed", "keyReleased", "keyTyped", "mousePressed", "mouseReleased", "mouseClicked", "doubleClicked", "mouseMoved", "mouseDragged", "mouseWheel", "touchStarted", "touchMoved", "touchEnded", "keyIsDown" ) for f_name in [f for f in event_function_names if event_functions.get(f, None)]: func = event_functions[f_name] event_func = global_p5_injection(instance)(func) setattr(instance, f_name, event_func) def logOnloaded(): console.log("Lib loaded!") def add_library(lib_name): # placeholder for https://github.com/berinhard/pyp5js/issues/31 src = '' return console.log("Lib name is not valid:", lib_name) console.log("Importing:", src) script = document.createElement("script") script.onload = logOnloaded script.src = src document.head.appendChild(script) ================================================ FILE: docs/examples/transcrypt/sketch_010/target/python_functions.js ================================================ // Transcrypt'ed from Python, 2021-11-02 13:06:19 import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, abs, all, any, assert, bool, bytearray, bytes, callable, chr, copy, deepcopy, delattr, dict, dir, divmod, enumerate, filter, float, getattr, hasattr, input, int, isinstance, issubclass, len, list, map, max, min, object, ord, pow, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, round, set, setattr, sorted, str, sum, tuple, zip} from './org.transcrypt.__runtime__.js'; var __name__ = 'python_functions'; export var PythonFunctions = __class__ ('PythonFunctions', [object], { __module__: __name__, }); setattr (PythonFunctions, 'map', map); setattr (PythonFunctions, 'filter', filter); setattr (PythonFunctions, 'set', set); //# sourceMappingURL=python_functions.map ================================================ FILE: docs/examples/transcrypt/sketch_010/target/python_functions.py ================================================ class PythonFunctions: pass setattr(PythonFunctions, 'map', map) setattr(PythonFunctions, 'filter', filter) setattr(PythonFunctions, 'set', set) ================================================ FILE: docs/examples/transcrypt/sketch_010/target/target_sketch.js ================================================ // Transcrypt'ed from Python, 2021-11-02 13:06:19 import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, all, any, assert, bool, bytearray, bytes, callable, chr, deepcopy, delattr, dict, dir, divmod, enumerate, getattr, hasattr, isinstance, issubclass, len, list, object, ord, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, set, setattr, sorted, sum, tuple, zip} from './org.transcrypt.__runtime__.js'; import {ADD, ALT, ARROW, AUDIO, AUTO, AXES, BACKSPACE, BASELINE, BEVEL, BEZIER, BLEND, BLUR, BOLD, BOLDITALIC, BOTTOM, BURN, CENTER, CHORD, CLAMP, CLOSE, CONTROL, CORNER, CORNERS, CROSS, CURVE, DARKEST, DEGREES, DEG_TO_RAD, DELETE, DIFFERENCE, DILATE, DODGE, DOWN_ARROW, ENTER, ERODE, ESCAPE, EXCLUSION, FILL, GRAY, GRID, HALF_PI, HAND, HARD_LIGHT, HSB, HSL, IMAGE, IMMEDIATE, INVERT, ITALIC, LANDSCAPE, LEFT, LEFT_ARROW, LIGHTEST, LINEAR, LINES, LINE_LOOP, LINE_STRIP, MIRROR, MITER, MOVE, MULTIPLY, NEAREST, NORMAL, OPAQUE, OPEN, OPTION, OVERLAY, P2D, PI, PIE, POINTS, PORTRAIT, POSTERIZE, PROJECT, PVector, QUADRATIC, QUADS, QUAD_STRIP, QUARTER_PI, RADIANS, RADIUS, RAD_TO_DEG, REPEAT, REPLACE, RETURN, RGB, RIGHT, RIGHT_ARROW, ROUND, SCREEN, SHIFT, SOFT_LIGHT, SQUARE, STROKE, SUBTRACT, TAB, TAU, TEXT, TEXTURE, THRESHOLD, TOP, TRIANGLES, TRIANGLE_FAN, TRIANGLE_STRIP, TWO_PI, UP_ARROW, VIDEO, WAIT, WEBGL, _CTX_MIDDLE, _DEFAULT_FILL, _DEFAULT_LEADMULT, _DEFAULT_STROKE, _DEFAULT_TEXT_FILL, _P5_INSTANCE, abs, accelerationX, accelerationY, accelerationZ, acos, add_library, alpha, ambientLight, ambientMaterial, angleMode, append, applyMatrix, arc, arrayCopy, asin, atan, atan2, background, beginContour, beginShape, bezier, bezierDetail, bezierPoint, bezierTangent, bezierVertex, blend, blendMode, blue, boolean, box, brightness, byte, camera, ceil, changed, char, circle, color, colorMode, concat, cone, constrain, copy, cos, createA, createAudio, createButton, createCamera, createCanvas, createCapture, createCheckbox, createColorPicker, createDiv, createElement, createFileInput, createGraphics, createImage, createImg, createInput, createNumberDict, createP, createRadio, createSelect, createShader, createSlider, createSpan, createStringDict, createVector, createVideo, createWriter, cursor, curve, curveDetail, curvePoint, curveTangent, curveTightness, curveVertex, cylinder, day, debugMode, degrees, deviceOrientation, directionalLight, disableFriendlyErrors, displayDensity, displayHeight, displayWidth, dist, ellipse, ellipseMode, ellipsoid, endContour, endShape, erase, exp, fill, filter, float, floor, focused, frameCount, frameRate, fullscreen, getURL, getURLParams, getURLPath, global_p5_injection, green, height, hex, hour, httpDo, httpGet, httpPost, hue, image, imageMode, image_proxy, input, int, join, key, keyCode, keyIsPressed, lerp, lerpColor, lightness, lights, line, loadBytes, loadFont, loadImage, loadJSON, loadModel, loadPixels, loadShader, loadStrings, loadTable, loadXML, log, logOnloaded, loop, mag, map, match, matchAll, max, millis, min, minute, model, month, mouseButton, mouseIsPressed, mouseX, mouseY, nf, nfc, nfp, nfs, noCanvas, noCursor, noDebugMode, noErase, noFill, noLoop, noSmooth, noStroke, noTint, noise, noiseDetail, noiseSeed, norm, normalMaterial, orbitControl, ortho, pAccelerationX, pAccelerationY, pAccelerationZ, pRotationX, pRotationY, pRotationZ, perspective, pixelDensity, pixels, plane, pmouseX, pmouseY, point, pointLight, popMatrix, popStyle, pow, pre_draw, push, pushMatrix, pushStyle, pwinMouseX, pwinMouseY, py_clear, py_get, py_pop, py_set, py_sort, py_split, quad, quadraticVertex, radians, random, randomGaussian, randomSeed, rect, rectMode, red, redraw, remove, removeElements, resetMatrix, resetShader, resizeCanvas, reverse, rotate, rotateX, rotateY, rotateZ, rotationX, rotationY, rotationZ, round, saturation, save, saveCanvas, saveFrames, saveJSON, saveStrings, saveTable, scale, second, select, selectAll, setAttributes, setCamera, setMoveThreshold, setShakeThreshold, shader, shearX, shearY, shininess, shorten, shuffle, sin, size, smooth, specularMaterial, sphere, splice, splitTokens, sq, sqrt, square, start_p5, str, stroke, strokeCap, strokeJoin, strokeWeight, subset, tan, text, textAlign, textAscent, textDescent, textFont, textLeading, textSize, textStyle, textWidth, texture, textureMode, textureWrap, tint, torus, touches, translate, triangle, trim, turnAxis, unchar, unhex, updatePixels, vertex, width, winMouseX, winMouseY, windowHeight, windowWidth, year} from './pyp5js.js'; var __name__ = '__main__'; export var preload = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } } else { } // pass; }; export var setup = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } } else { } // pass; }; export var draw = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } } else { } // pass; }; export var deviceMoved = null; export var deviceTurned = null; export var deviceShaken = null; export var keyPressed = null; export var keyReleased = null; export var keyTyped = null; export var mouseMoved = null; export var mouseDragged = null; export var mousePressed = null; export var mouseReleased = null; export var mouseClicked = null; export var doubleClicked = null; export var mouseWheel = null; export var touchStarted = null; export var touchMoved = null; export var touchEnded = null; export var windowResized = null; export var keyIsDown = null; export var MY_POINTS = [tuple ([100, 50]), tuple ([300, 100]), tuple ([200, 300]), tuple ([100, 300])]; export var FRAME_IDX = 0; export var POINT_SIZE = 10; export var CNV = null; var setup = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } } else { } CNV = createCanvas (400, 400); var BUTTON_PREV = createButton ('Previous frame'); BUTTON_PREV.position (CNV.position ().x, CNV.height + CNV.position ().y); BUTTON_PREV.mousePressed (prev_frame); var BUTTON_NEXT = createButton ('Next frame'); BUTTON_NEXT.position (CNV.position ().x + BUTTON_PREV.size ().width, BUTTON_PREV.position ().y); BUTTON_NEXT.mousePressed (next_frame); background (190); draw_labels (MY_POINTS); }; var draw = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } } else { } background (190); draw_closed_curve_vertex (MY_POINTS, FRAME_IDX); draw_labels (MY_POINTS); }; var mouseClicked = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } } else { } if (is_point_in_canvas (mouseX, mouseY)) { var i = get_point_index (mouseX, mouseY); if (i != null) { MY_POINTS.py_pop (i); if (FRAME_IDX >= len (MY_POINTS)) { FRAME_IDX = len (MY_POINTS) - 1; } } else { MY_POINTS.append (tuple ([mouseX, mouseY])); } } }; export var get_point_index = function (x, y) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'x': var x = __allkwargs0__ [__attrib0__]; break; case 'y': var y = __allkwargs0__ [__attrib0__]; break; } } } } else { } for (var [idx, [p_x, p_y]] of enumerate (MY_POINTS)) { if ((p_x - POINT_SIZE < x && x < p_x + POINT_SIZE) && (p_y - POINT_SIZE < y && y < p_y + POINT_SIZE)) { return idx; } } }; export var is_point_in_canvas = function (x, y) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'x': var x = __allkwargs0__ [__attrib0__]; break; case 'y': var y = __allkwargs0__ [__attrib0__]; break; } } } } else { } if ((x < 0 || x > CNV.width) || (y < 0 || y > CNV.height)) { return false; } return true; }; export var next_frame = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } } else { } if (FRAME_IDX < len (MY_POINTS) - 1) { FRAME_IDX++; } }; export var prev_frame = function () { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { } } } else { } if (FRAME_IDX > 0) { FRAME_IDX--; } }; export var draw_closed_curve_vertex = function (points, max_idx) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'points': var points = __allkwargs0__ [__attrib0__]; break; case 'max_idx': var max_idx = __allkwargs0__ [__attrib0__]; break; } } } } else { } if (len (points) < 2) { return ; } var used_points = []; beginShape (); var idx = len (points) - 1; curveVertex (...points [idx]); used_points.append (idx); for (var [idx, p] of enumerate (points)) { if (idx > max_idx) { break; } curveVertex (...p); used_points.append (idx); } var idx = 0; curveVertex (...points [idx]); used_points.append (idx); var idx = 1; curveVertex (...points [idx]); used_points.append (idx); endShape (); textSize (10); noStroke (); text ('Points used to draw this curve (first and last are control points only)', 5, CNV.height - 30); textSize (20); text (', '.join (used_points), 10, CNV.height - 10); stroke (0); for (var i = 0; i < len (used_points) - 1; i++) { draw_dotted_line (points [used_points [i]], points [used_points [i + 1]]); } }; export var draw_labels = function (points) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'points': var points = __allkwargs0__ [__attrib0__]; break; } } } } else { } strokeWeight (POINT_SIZE); for (var [idx, p] of enumerate (points)) { var ts = 32; textSize (ts); var textY = p [1] - ts / 2; if (p [1] > CNV.height / 2) { var textY = p [1] + ts; } noStroke (); text (idx, p [0], textY); stroke (0); point (...p); } strokeWeight (1); }; export var draw_dotted_line = function (p1, p2) { if (arguments.length) { var __ilastarg0__ = arguments.length - 1; if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { var __allkwargs0__ = arguments [__ilastarg0__--]; for (var __attrib0__ in __allkwargs0__) { switch (__attrib0__) { case 'p1': var p1 = __allkwargs0__ [__attrib0__]; break; case 'p2': var p2 = __allkwargs0__ [__attrib0__]; break; } } } } else { } stroke (100); strokeWeight (3); for (var i = 0; i < 11; i++) { var x = lerp (p1 [0], p2 [0], i / 10); var y = lerp (p1 [1], p2 [1], i / 10); point (x, y); } stroke (0); strokeWeight (1); }; export var event_functions = dict ({'deviceMoved': deviceMoved, 'deviceTurned': deviceTurned, 'deviceShaken': deviceShaken, 'keyPressed': keyPressed, 'keyReleased': keyReleased, 'keyTyped': keyTyped, 'mouseMoved': mouseMoved, 'mouseDragged': mouseDragged, 'mousePressed': mousePressed, 'mouseReleased': mouseReleased, 'mouseClicked': mouseClicked, 'doubleClicked': doubleClicked, 'mouseWheel': mouseWheel, 'touchStarted': touchStarted, 'touchMoved': touchMoved, 'touchEnded': touchEnded, 'windowResized': windowResized, 'keyIsDown': keyIsDown}); start_p5 (preload, setup, draw, event_functions); //# sourceMappingURL=target_sketch.map ================================================ FILE: docs/examples/transcrypt/sketch_010/target/target_sketch.project ================================================ {"options": {"source": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_010/target_sketch.py", "anno": false, "alimod": false, "build": true, "complex": false, "docat": false, "dassert": false, "dcheck": false, "dextex": false, "dlog": false, "dmap": false, "dnostrip": false, "dstat": false, "dtree": false, "esv": null, "ecom": false, "fcall": false, "gen": false, "iconv": false, "jscall": false, "jskeys": false, "jsmod": false, "kwargs": true, "keycheck": false, "license": false, "map": true, "nomin": true, "opov": false, "outdir": null, "parent": null, "run": false, "symbols": null, "sform": false, "tconv": false, "unit": null, "verbose": false, "x": null, "xreex": false, "xglobs": false, "xpath": "/home/bernardo/envs/pyp5js/pyp5js/templates/transcrypt", "xtiny": false, "star": false}, "modules": [{"source": "/home/bernardo/.pyenv/versions/pyp5js/lib/python3.8/site-packages/transcrypt/modules/org/transcrypt/__runtime__.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_010/__target__/org.transcrypt.__runtime__.js"}, {"source": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_010/target_sketch.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_010/__target__/target_sketch.js"}, {"source": "/home/bernardo/envs/pyp5js/pyp5js/templates/transcrypt/pyp5js.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_010/__target__/pyp5js.js"}, {"source": "/home/bernardo/envs/pyp5js/pyp5js/templates/transcrypt/python_functions.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_010/__target__/python_functions.js"}]} ================================================ FILE: docs/examples/transcrypt/sketch_010/target/target_sketch.py ================================================ from pyp5js import * def preload(): pass def setup(): pass def draw(): pass deviceMoved = None deviceTurned = None deviceShaken = None keyPressed = None keyReleased = None keyTyped = None mouseMoved = None mouseDragged = None mousePressed = None mouseReleased = None mouseClicked = None doubleClicked = None mouseWheel = None touchStarted = None touchMoved = None touchEnded = None windowResized = None keyIsDown = None MY_POINTS = [ (100, 50), (300, 100), (200, 300), (100, 300), ] FRAME_IDX = 0 POINT_SIZE = 10 CNV = None def setup(): global CNV CNV = createCanvas(400, 400) BUTTON_PREV = createButton('Previous frame') BUTTON_PREV.position(CNV.position().x, CNV.height + CNV.position().y) BUTTON_PREV.mousePressed(prev_frame) BUTTON_NEXT = createButton('Next frame') BUTTON_NEXT.position(CNV.position().x + BUTTON_PREV.size().width, BUTTON_PREV.position().y) BUTTON_NEXT.mousePressed(next_frame) background(190) draw_labels(MY_POINTS) def draw(): background(190) draw_closed_curve_vertex(MY_POINTS, FRAME_IDX) draw_labels(MY_POINTS) def mouseClicked(): global FRAME_IDX global MY_POINTS if is_point_in_canvas(mouseX, mouseY): i = get_point_index(mouseX, mouseY) if i != None: MY_POINTS.pop(i) if FRAME_IDX >= len(MY_POINTS): # cap i if it exceeds maximum length now. FRAME_IDX = len(MY_POINTS) - 1 else: MY_POINTS.append((mouseX, mouseY)) def get_point_index(x, y): for idx, (p_x,p_y) in enumerate(MY_POINTS): if (p_x - POINT_SIZE < x and x < p_x + POINT_SIZE) and \ (p_y - POINT_SIZE < y and y < p_y + POINT_SIZE): return idx def is_point_in_canvas(x, y): if (x < 0 or x > CNV.width) or \ (y < 0 or y > CNV.height): return False return True def next_frame(): global FRAME_IDX if FRAME_IDX < len(MY_POINTS) - 1: FRAME_IDX += 1 def prev_frame(): global FRAME_IDX if FRAME_IDX > 0: FRAME_IDX -= 1 def draw_closed_curve_vertex(points, max_idx): if len(points) < 2: return used_points = [] beginShape() # start by using the last point as the initial control point idx = len(points) - 1 curveVertex(*points[idx]) used_points.append(idx) # add each point to the curve for idx,p in enumerate(points): if idx > max_idx: break curveVertex(*p) used_points.append(idx) # to close the curve, we need to create the last curve. # for that, we must go to the first point idx = 0 curveVertex(*points[idx]) used_points.append(idx) # and use the next point as a control point. idx = 1 curveVertex(*points[idx]) used_points.append(idx) endShape() textSize(10) noStroke() text('Points used to draw this curve (first and last are control points only)', 5, CNV.height - 30) textSize(20) text(', '.join(used_points), 10, CNV.height - 10) stroke(0) for i in range(len(used_points) - 1): draw_dotted_line(points[used_points[i]], points[used_points[i + 1]]) def draw_labels(points): strokeWeight(POINT_SIZE) for idx, p in enumerate(points): ts = 32 textSize(ts) textY = p[1] - ts / 2 if p[1] > CNV.height / 2: textY = p[1] + ts noStroke() text(idx, p[0], textY) stroke(0) point(*p) strokeWeight(1) def draw_dotted_line(p1, p2): stroke(100) strokeWeight(3) for i in range(11): x = lerp(p1[0], p2[0], i/10) y = lerp(p1[1], p2[1], i/10) point(x, y) stroke(0) strokeWeight(1) event_functions = { "deviceMoved": deviceMoved, "deviceTurned": deviceTurned, "deviceShaken": deviceShaken, "keyPressed": keyPressed, "keyReleased": keyReleased, "keyTyped": keyTyped, "mouseMoved": mouseMoved, "mouseDragged": mouseDragged, "mousePressed": mousePressed, "mouseReleased": mouseReleased, "mouseClicked": mouseClicked, "doubleClicked": doubleClicked, "mouseWheel": mouseWheel, "touchStarted": touchStarted, "touchMoved": touchMoved, "touchEnded": touchEnded, "windowResized": windowResized, "keyIsDown": keyIsDown, } start_p5(preload, setup, draw, event_functions) ================================================ FILE: docs/index.md ================================================ ## pyp5js: drawing with Python 3 [![PyPI version](https://badge.fury.io/py/pyp5js.svg)](https://badge.fury.io/py/pyp5js) ![Continuous Integration](https://github.com/berinhard/pyp5js/workflows/Continuous%20Integration/badge.svg?branch=develop&event=push) [![Gitpod ready-to-code](https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/berinhard/pyp5js/tree/main) > [Processing](https://processing.org) ideas and Python 3 together with [P5.js](https://p5js.org) in the browser, using [Transcrypt](https://transcrypt.org/). Python 3 drawing in the web 🐍 🐍 🐍 Try it [here](https://berinhard.github.io/pyp5js/pyodide/)! `pyp5js` covers **all** the methods, variables and event handlers listed in [the p5.js API documentation](https://p5js.org/reference/). Here's an example of a valid Python code using p5.js API: ```python def setup(): createCanvas(200, 200) def draw(): background(200) diameter = sin(frameCount / 60) * 50 + 50 fill("blue") ellipse(100, 100, diameter, diameter) ``` ## Examples [Click here](https://berinhard.github.io/pyp5js/examples/) to see a list of examples generated with `pyp5js`. ## Installation This project requires Python 3 and is now on PyPI, so you can install it with `pip` or `pip3`, depending on your environment: ``` $ pip install pyp5js ``` (You might have to install `setuptools` first, if it's not already installed) ## Quickstart Since you'll be writing Python code and then generating the correspondent P5.js code from it, pyp5js provides a web application interface to help you generate the files. So, to start the application, you'll have to run: ```bash $ pyp5js serve ``` Then point your browser to [http://localhost:5000/](http://localhost:5000/) and create a new sketch via the browser by filling the form with the name of your sketch. This command will compile the sketches on the fly, so after changing/saving the sketch file, you just need to reload the page on your browser. It'll also guide you on which file you have to edit the Python code and how to see it running after you save it. `pyp5js` will create a new directory in your home called `sketchbook-pyp5js`. If you don't want to save your sketch in this default directory, you can set the environment variable `SKETCHBOOK_DIR` to point to the directory you want to use. Or you can also run the `serve` command as: ```bash $ SKETCHBOOK_DIR='~/my-custom-sketchbook' pyp5js serve ``` Now, have fun =] ## Command Line Interface So, to start a new sketch, you'll have to run: ```bash $ pyp5js new my_sketch ``` This command will create a directory with the following code structure using **p5.js 1.0.0**: ``` ~ my_sketch/ ~ static / ~ target / - index.html - my_sketch.py ``` The `index.html` is prepared to display your sketch, so you'll have to keep it open in your browser (I really advise you to use [Firefox](https://www.mozilla.org/en-US/firefox/new/)) to see results from the code you'll add to `my_sketch.py`. To see your app on your browser you'll need to run a Web server (opening the "index.html" file directly won't work since [it is disabled by default](https://github.com/berinhard/pyp5js/issues/72)) - we packaged it already for you, just run: ```bash $ pyp5js serve ``` If you just want to compile your code (without running the Web server) there's the `compile` command: ``` $ pyp5js compile my_sketch ``` If you're lazy like me, you can use the `monitor` command instead of the previous one. The command will monitor your sketch directory and keep track of any changes on any `.py` files. When it notices a new change, it automatically runs the compile process for you: ``` $ pyp5js monitor my_sketch ``` You can also use the `--monitor` option within the `new` command by running: ``` $ pyp5js new my_sketch --monitor ``` All of the command-line interface methods have a few optional arguments, such as specifying the sketch directory. You can check them by running: ``` $ pyp5js --help # or also $ pyp5js new --help ``` ### Known [issues](https://github.com/berinhard/pyp5js/issues), differences to the Processing.Py and P5.js ways of doing things and limitations - Remember to use **P5.js** method names & conventions for most things. - There are no Py.Processing `with` context facilities for `push/pop` or `beginShape/endShape`. - There are no `PVector` objects, with their nice syntatic operator overloaded sugar - use `p5.Vector` with `createVector()` and P5.js conventions ... for now... - For the `mouseWheel()` event funtion, use `def mouseWheel()` with NO parameters, then, inside the function, the magic `event.delta` will have a value equivalent to the one returned by Java&Python Mode's `event.getCount()`. - At this point, it is a known limitation that you have to "declare" global variables before `setup()` and `draw()`, maybe using `name = None`, as they can't be created inside methods. - Not all Python libs are available when using Transcrypt because they required a JS-version to be enabled. In [this link](https://github.com/QQuick/Transcrypt/tree/master/transcrypt/modules) you can take a look in all modules Transcrypt enables. ## How can I contribute? More details [here](https://github.com/berinhard/pyp5js/blob/develop/CONTRIBUTING.md). ### References This project started from a proof of concept based in [Axel Tanner's "Transcrypt & p5js" blogpost](https://4nomore.net/2018/transcrypt_p5js/). The source code in [this Github repo](https://github.com/berinhard/pyp5js). The [Pyodide](https://github.com/iodide-project/pyodide) interpreter was implemented based on [Luca Damasco's experiment](https://github.com/Luxapodular/Py5.js) supported by [COSA (The Clinic for Open Source Arts)](https://www.du.edu/ahss/opensourcearts/) at the University of Denver College of Arts and Sciences. ================================================ FILE: docs/pyodide/afterBody.js ================================================ const initialSketch = checkForSketch(); //// Configure ACE editor const editor = ace.edit("text-editor"); editor.session.setMode("ace/mode/python"); editor.setFontSize(18); editor.session.setOptions({ tabSize: 4, }); editor.setValue(initialSketch); //// Update div's content with most up to date code editor.session.on("change", function () { document.getElementById("id_py_code").innerHTML = editor .getSession() .getValue(); }); document.getElementById("id_py_code").innerHTML = initialSketch; document.addEventListener("DOMContentLoaded", function () { //// Buttons const shareBtn = document.getElementById("shareBtn"); const collapseBtn = document.getElementById("collapseBtn"); const executeBtn = document.getElementById("executeBtn"); const clearBtn = document.getElementById("clearBtn"); //// Event functions function runCode() { document.getElementById("sketch-holder").innerHTML = ""; const userCode = editor.getSession().getValue(); // from pyp5js window.runSketchCode(userCode); } function cleanKeyCode(e) { // Shortcuts work for Ctrl or Cmd if (e.ctrlKey || e.metaKey) { return e.keyCode; } } function keyDown(e) { if (cleanKeyCode(e) === 13) { // Ctrl + Enter to run e.preventDefault(); executeBtn.click(); } else if (cleanKeyCode(e) === 190) { // Ctrl + . to clear e.preventDefault(); clearBtn.click(); } } executeBtn.addEventListener("click", () => { if (window.instance) { runCode(); } else { window.alert( "Pyodide is still loading.\nPlease, wait a few seconds and try to run it again." ); } }); clearBtn.addEventListener("click", () => { if (window.instance) { document.getElementById("sketch-holder").innerHTML = ""; window.instance.remove(); } }); shareBtn.addEventListener("click", () => { if (window.instance) { const sketchUrl = createSketchUrl(); copyTextToClipboard(sketchUrl); shareBtn.textContent = "Copied URL!"; setTimeout(() => { shareBtn.textContent = "Share"; }, 3000); runCode(); } }); collapseBtn.addEventListener("click", () => { const textEditorEl = document.getElementById("text-editor"); textEditorEl.classList.toggle("hidden-editor"); collapseBtn.textContent = collapseBtn.textContent.includes("Collapse") ? "Expand" : "Collapse"; }); document.body.addEventListener("keydown", keyDown); }); ================================================ FILE: docs/pyodide/index.html ================================================ pyp5js with Pyodide Demo

pyp5js demo editor

If you execute the code but nothing is being rendered in the browser, please open your browser's console to read the error traceback (usually you can do this by pressing F12 and clicking in the Console tab).

pyp5js running on top of pyodide

================================================ FILE: docs/pyodide/index.html.template ================================================ pyp5js with Pyodide Demo

pyp5js demo editor

If you execute the code but nothing is being rendered in the browser, please open your browser's console to read the error traceback (usually you can do this by pressing F12 and clicking in the Console tab).

pyp5js running on top of pyodide

================================================ FILE: docs/pyodide/pyodide.py ================================================ def setup(): createCanvas(200, 200) def draw(): background(200) diameter = sin(frameCount / 60) * 50 + 50 fill("blue") ellipse(100, 100, diameter, diameter) ================================================ FILE: docs/pyodide/share.js ================================================ function createSketchUrl() { const baseUrl = window.location.origin + window.location.pathname; const userCode = editor.getSession().getValue(); const encodedUserCode = btoa(encodeURIComponent(userCode)); const sketchUrl = new URL(baseUrl); sketchUrl.searchParams.append("sketch", encodedUserCode); return sketchUrl; } function decodeSketchUrl(encodedSketch) { const decodedSketch = decodeURIComponent(atob(encodedSketch)); return decodedSketch; } function checkForSketch() { let initialSketch = `def setup(): createCanvas(200, 200) def draw(): background(200) diameter = sin(frameCount / 60) * 50 + 50 fill("blue") ellipse(100, 100, diameter, diameter) `; const currentUrl = new URLSearchParams(window.location.search); if (currentUrl.has("sketch")) { initialSketch = decodeSketchUrl(currentUrl.get("sketch")); } return initialSketch; } // Made by user Dean Taylor in // https://stackoverflow.com/questions/400212/how-do-i-copy-to-the-clipboard-in-javascript function fallbackCopyTextToClipboard(text) { var textArea = document.createElement("textarea"); textArea.value = text; // Avoid scrolling to bottom textArea.style.top = "0"; textArea.style.left = "0"; textArea.style.position = "fixed"; document.body.appendChild(textArea); textArea.focus(); textArea.select(); try { document.execCommand("copy"); } catch (err) { console.error("Fallback: Oops, unable to copy URL", err); } document.body.removeChild(textArea); } function copyTextToClipboard(text) { if (!navigator.clipboard) { fallbackCopyTextToClipboard(text); return; } navigator.clipboard.writeText(text).then( function () { return; }, function (err) { console.error("Async: Could not copy URL: ", err); } ); } ================================================ FILE: docs/pyodide/styles.css ================================================ body, html, canvas { padding: 0; margin: 0; } html { overflow-y: scroll; overflow-x: scroll; } .demoContainer { display: flex; } pre { margin-right: 2em; } .text-editor-box { margin: 0 1.5em; max-width: 800px; display: flex; flex-direction: column; align-items: flex-end; } #text-editor { float: left; margin: 0.5em 0; height: 600px; border: 1px solid #ccc; border-radius: 8px; } .text-editor { width: 700px; transition-property: width; transition: 500ms ease-out; } #sketch-buttons { width: 100%; min-width: 250px; display: flex; justify-content: space-between; align-self: flex-start; } .left-buttons { width: 100%; } .hidden-editor { opacity: 0.2; width: 250px; transition-property: width; transition: 500ms ease-in; } .code-container { display: flex; align-items: flex-start; justify-content: flex-start; } .display-none { display: none; } ================================================ FILE: docs/pyodide/target/target_sketch.js ================================================ const wrapperContent = ` class PythonFunctions: pass setattr(PythonFunctions, 'map', map) setattr(PythonFunctions, 'filter', filter) setattr(PythonFunctions, 'set', set) _P5_INSTANCE = None _CTX_MIDDLE = None _DEFAULT_FILL = None _DEFAULT_LEADMULT = None _DEFAULT_STROKE = None _DEFAULT_TEXT_FILL = None ADD = None ALT = None ARROW = None AUDIO = None AUTO = None AXES = None BACKSPACE = None BASELINE = None BEVEL = None BEZIER = None BLEND = None BLUR = None BOLD = None BOLDITALIC = None BOTTOM = None BURN = None CENTER = None CHORD = None CLAMP = None CLOSE = None CONTROL = None CORNER = None CORNERS = None CROSS = None CURVE = None DARKEST = None DEG_TO_RAD = None DEGREES = None DELETE = None DIFFERENCE = None DILATE = None DODGE = None DOWN_ARROW = None ENTER = None ERODE = None ESCAPE = None EXCLUSION = None FILL = None GRAY = None GRID = None HALF_PI = None HAND = None HARD_LIGHT = None HSB = None HSL = None IMAGE = None IMMEDIATE = None INVERT = None ITALIC = None LANDSCAPE = None LEFT = None LEFT_ARROW = None LIGHTEST = None LINE_LOOP = None LINE_STRIP = None LINEAR = None LINES = None MIRROR = None MITER = None MOVE = None MULTIPLY = None NEAREST = None NORMAL = None OPAQUE = None OPEN = None OPTION = None OVERLAY = None PI = None PIE = None POINTS = None PORTRAIT = None POSTERIZE = None PROJECT = None QUAD_STRIP = None QUADRATIC = None QUADS = None QUARTER_PI = None RAD_TO_DEG = None RADIANS = None RADIUS = None REPEAT = None REPLACE = None RETURN = None RGB = None RIGHT = None RIGHT_ARROW = None ROUND = None SCREEN = None SHIFT = None SOFT_LIGHT = None SQUARE = None STROKE = None SUBTRACT = None TAB = None TAU = None TEXT = None TEXTURE = None THRESHOLD = None TOP = None TRIANGLE_FAN = None TRIANGLE_STRIP = None TRIANGLES = None TWO_PI = None UP_ARROW = None VIDEO = None WAIT = None WEBGL = None P2D = None PI = None frameCount = None focused = None displayWidth = None displayHeight = None windowWidth = None windowHeight = None width = None height = None deviceOrientation = None accelerationX = None accelerationY = None accelerationZ = None pAccelerationX = None pAccelerationY = None pAccelerationZ = None rotationX = None rotationY = None rotationZ = None pRotationX = None pRotationY = None pRotationZ = None turnAxis = None keyIsPressed = None key = None keyCode = None mouseX = None mouseY = None pmouseX = None pmouseY = None winMouseX = None winMouseY = None pwinMouseX = None pwinMouseY = None mouseButton = None mouseIsPressed = None touches = None pixels = None def alpha(*args): return _P5_INSTANCE.alpha(*args) def blue(*args): return _P5_INSTANCE.blue(*args) def brightness(*args): return _P5_INSTANCE.brightness(*args) def color(*args): return _P5_INSTANCE.color(*args) def green(*args): return _P5_INSTANCE.green(*args) def hue(*args): return _P5_INSTANCE.hue(*args) def lerpColor(*args): return _P5_INSTANCE.lerpColor(*args) def lightness(*args): return _P5_INSTANCE.lightness(*args) def red(*args): return _P5_INSTANCE.red(*args) def saturation(*args): return _P5_INSTANCE.saturation(*args) def background(*args): return _P5_INSTANCE.background(*args) def clear(*args): p5_clear = _P5_INSTANCE.clear(*args) return p5_clear def erase(*args): return _P5_INSTANCE.erase(*args) def noErase(*args): return _P5_INSTANCE.noErase(*args) def colorMode(*args): return _P5_INSTANCE.colorMode(*args) def fill(*args): return _P5_INSTANCE.fill(*args) def noFill(*args): return _P5_INSTANCE.noFill(*args) def noStroke(*args): return _P5_INSTANCE.noStroke(*args) def stroke(*args): return _P5_INSTANCE.stroke(*args) def arc(*args): return _P5_INSTANCE.arc(*args) def ellipse(*args): return _P5_INSTANCE.ellipse(*args) def circle(*args): return _P5_INSTANCE.circle(*args) def line(*args): return _P5_INSTANCE.line(*args) def point(*args): return _P5_INSTANCE.point(*args) def quad(*args): return _P5_INSTANCE.quad(*args) def rect(*args): return _P5_INSTANCE.rect(*args) def square(*args): return _P5_INSTANCE.square(*args) def triangle(*args): return _P5_INSTANCE.triangle(*args) def plane(*args): return _P5_INSTANCE.plane(*args) def box(*args): return _P5_INSTANCE.box(*args) def sphere(*args): return _P5_INSTANCE.sphere(*args) def cylinder(*args): return _P5_INSTANCE.cylinder(*args) def cone(*args): return _P5_INSTANCE.cone(*args) def ellipsoid(*args): return _P5_INSTANCE.ellipsoid(*args) def torus(*args): return _P5_INSTANCE.torus(*args) def loadModel(*args): return _P5_INSTANCE.loadModel(*args) def model(*args): return _P5_INSTANCE.model(*args) def ellipseMode(*args): return _P5_INSTANCE.ellipseMode(*args) def noSmooth(*args): return _P5_INSTANCE.noSmooth(*args) def rectMode(*args): return _P5_INSTANCE.rectMode(*args) def smooth(*args): return _P5_INSTANCE.smooth(*args) def strokeCap(*args): return _P5_INSTANCE.strokeCap(*args) def strokeJoin(*args): return _P5_INSTANCE.strokeJoin(*args) def strokeWeight(*args): return _P5_INSTANCE.strokeWeight(*args) def bezier(*args): return _P5_INSTANCE.bezier(*args) def bezierDetail(*args): return _P5_INSTANCE.bezierDetail(*args) def bezierPoint(*args): return _P5_INSTANCE.bezierPoint(*args) def bezierTangent(*args): return _P5_INSTANCE.bezierTangent(*args) def curve(*args): return _P5_INSTANCE.curve(*args) def curveDetail(*args): return _P5_INSTANCE.curveDetail(*args) def curveTightness(*args): return _P5_INSTANCE.curveTightness(*args) def curvePoint(*args): return _P5_INSTANCE.curvePoint(*args) def curveTangent(*args): return _P5_INSTANCE.curveTangent(*args) def beginContour(*args): return _P5_INSTANCE.beginContour(*args) def beginShape(*args): return _P5_INSTANCE.beginShape(*args) def bezierVertex(*args): return _P5_INSTANCE.bezierVertex(*args) def curveVertex(*args): return _P5_INSTANCE.curveVertex(*args) def endContour(*args): return _P5_INSTANCE.endContour(*args) def endShape(*args): return _P5_INSTANCE.endShape(*args) def quadraticVertex(*args): return _P5_INSTANCE.quadraticVertex(*args) def vertex(*args): return _P5_INSTANCE.vertex(*args) def cursor(*args): return _P5_INSTANCE.cursor(*args) def frameRate(*args): return _P5_INSTANCE.frameRate(*args) def noCursor(*args): return _P5_INSTANCE.noCursor(*args) def fullscreen(*args): return _P5_INSTANCE.fullscreen(*args) def pixelDensity(*args): return _P5_INSTANCE.pixelDensity(*args) def displayDensity(*args): return _P5_INSTANCE.displayDensity(*args) def getURL(*args): return _P5_INSTANCE.getURL(*args) def getURLPath(*args): return _P5_INSTANCE.getURLPath(*args) def getURLParams(*args): return _P5_INSTANCE.getURLParams(*args) def remove(*args): return _P5_INSTANCE.remove(*args) def noLoop(*args): return _P5_INSTANCE.noLoop(*args) def loop(*args): return _P5_INSTANCE.loop(*args) def push(*args): return _P5_INSTANCE.push(*args) def redraw(*args): return _P5_INSTANCE.redraw(*args) def resizeCanvas(*args): return _P5_INSTANCE.resizeCanvas(*args) def noCanvas(*args): return _P5_INSTANCE.noCanvas(*args) def createGraphics(*args): return _P5_INSTANCE.createGraphics(*args) def blendMode(*args): return _P5_INSTANCE.blendMode(*args) def setAttributes(*args): return _P5_INSTANCE.setAttributes(*args) def applyMatrix(*args): return _P5_INSTANCE.applyMatrix(*args) def resetMatrix(*args): return _P5_INSTANCE.resetMatrix(*args) def rotate(*args): return _P5_INSTANCE.rotate(*args) def rotateX(*args): return _P5_INSTANCE.rotateX(*args) def rotateY(*args): return _P5_INSTANCE.rotateY(*args) def rotateZ(*args): return _P5_INSTANCE.rotateZ(*args) def scale(*args): return _P5_INSTANCE.scale(*args) def shearX(*args): return _P5_INSTANCE.shearX(*args) def shearY(*args): return _P5_INSTANCE.shearY(*args) def translate(*args): return _P5_INSTANCE.translate(*args) def createStringDict(*args): return _P5_INSTANCE.createStringDict(*args) def createNumberDict(*args): return _P5_INSTANCE.createNumberDict(*args) def append(*args): return _P5_INSTANCE.append(*args) def arrayCopy(*args): return _P5_INSTANCE.arrayCopy(*args) def concat(*args): return _P5_INSTANCE.concat(*args) def reverse(*args): return _P5_INSTANCE.reverse(*args) def shorten(*args): return _P5_INSTANCE.shorten(*args) def shuffle(*args): return _P5_INSTANCE.shuffle(*args) def sort(*args): return _P5_INSTANCE.sort(*args) def splice(*args): return _P5_INSTANCE.splice(*args) def subset(*args): return _P5_INSTANCE.subset(*args) def float(*args): return _P5_INSTANCE.float(*args) def int(*args): return _P5_INSTANCE.int(*args) def str(*args): return _P5_INSTANCE.str(*args) def boolean(*args): return _P5_INSTANCE.boolean(*args) def byte(*args): return _P5_INSTANCE.byte(*args) def char(*args): return _P5_INSTANCE.char(*args) def unchar(*args): return _P5_INSTANCE.unchar(*args) def hex(*args): return _P5_INSTANCE.hex(*args) def unhex(*args): return _P5_INSTANCE.unhex(*args) def join(*args): return _P5_INSTANCE.join(*args) def match(*args): return _P5_INSTANCE.match(*args) def matchAll(*args): return _P5_INSTANCE.matchAll(*args) def nf(*args): return _P5_INSTANCE.nf(*args) def nfc(*args): return _P5_INSTANCE.nfc(*args) def nfp(*args): return _P5_INSTANCE.nfp(*args) def nfs(*args): return _P5_INSTANCE.nfs(*args) def split(*args): return _P5_INSTANCE.split(*args) def splitTokens(*args): return _P5_INSTANCE.splitTokens(*args) def trim(*args): return _P5_INSTANCE.trim(*args) def setMoveThreshold(*args): return _P5_INSTANCE.setMoveThreshold(*args) def setShakeThreshold(*args): return _P5_INSTANCE.setShakeThreshold(*args) def keyIsDown(*args): return _P5_INSTANCE.keyIsDown(*args) def createImage(*args): return _P5_INSTANCE.createImage(*args) def saveCanvas(*args): return _P5_INSTANCE.saveCanvas(*args) def saveFrames(*args): return _P5_INSTANCE.saveFrames(*args) def loadImage(*args): return _P5_INSTANCE.loadImage(*args) def image(*args): return _P5_INSTANCE.image(*args) def tint(*args): return _P5_INSTANCE.tint(*args) def noTint(*args): return _P5_INSTANCE.noTint(*args) def imageMode(*args): return _P5_INSTANCE.imageMode(*args) def blend(*args): return _P5_INSTANCE.blend(*args) def copy(*args): return _P5_INSTANCE.copy(*args) def filter(*args): if len(args) > 1 and (args[0] is None or callable(args[0])): return PythonFunctions.filter(*args) else: return _P5_INSTANCE.filter(*args) def get(*args): return _P5_INSTANCE.get(*args) def loadPixels(*args): return _P5_INSTANCE.loadPixels(*args) def set(*args): if len(args) <= 1: return PythonFunctions.set(*args) else: return _P5_INSTANCE.set(*args) def updatePixels(*args): return _P5_INSTANCE.updatePixels(*args) def loadJSON(*args): return _P5_INSTANCE.loadJSON(*args) def loadStrings(*args): return _P5_INSTANCE.loadStrings(*args) def loadTable(*args): return _P5_INSTANCE.loadTable(*args) def loadXML(*args): return _P5_INSTANCE.loadXML(*args) def loadBytes(*args): return _P5_INSTANCE.loadBytes(*args) def httpGet(*args): return _P5_INSTANCE.httpGet(*args) def httpPost(*args): return _P5_INSTANCE.httpPost(*args) def httpDo(*args): return _P5_INSTANCE.httpDo(*args) def createWriter(*args): return _P5_INSTANCE.createWriter(*args) def save(*args): return _P5_INSTANCE.save(*args) def saveJSON(*args): return _P5_INSTANCE.saveJSON(*args) def saveStrings(*args): return _P5_INSTANCE.saveStrings(*args) def saveTable(*args): return _P5_INSTANCE.saveTable(*args) def day(*args): return _P5_INSTANCE.day(*args) def hour(*args): return _P5_INSTANCE.hour(*args) def minute(*args): return _P5_INSTANCE.minute(*args) def millis(*args): return _P5_INSTANCE.millis(*args) def month(*args): return _P5_INSTANCE.month(*args) def second(*args): return _P5_INSTANCE.second(*args) def year(*args): return _P5_INSTANCE.year(*args) def createVector(*args): return _P5_INSTANCE.createVector(*args) def abs(*args): return _P5_INSTANCE.abs(*args) def ceil(*args): return _P5_INSTANCE.ceil(*args) def constrain(*args): return _P5_INSTANCE.constrain(*args) def dist(*args): return _P5_INSTANCE.dist(*args) def exp(*args): return _P5_INSTANCE.exp(*args) def floor(*args): return _P5_INSTANCE.floor(*args) def lerp(*args): return _P5_INSTANCE.lerp(*args) def log(*args): return _P5_INSTANCE.log(*args) def mag(*args): return _P5_INSTANCE.mag(*args) def map(*args): if len(args) > 1 and callable(args[0]): return PythonFunctions.map(*args) else: return _P5_INSTANCE.map(*args) def max(*args): return _P5_INSTANCE.max(*args) def min(*args): return _P5_INSTANCE.min(*args) def norm(*args): return _P5_INSTANCE.norm(*args) def pow(*args): return _P5_INSTANCE.pow(*args) def round(*args): return _P5_INSTANCE.round(*args) def sq(*args): return _P5_INSTANCE.sq(*args) def sqrt(*args): return _P5_INSTANCE.sqrt(*args) def noise(*args): return _P5_INSTANCE.noise(*args) def noiseDetail(*args): return _P5_INSTANCE.noiseDetail(*args) def noiseSeed(*args): return _P5_INSTANCE.noiseSeed(*args) def randomSeed(*args): return _P5_INSTANCE.randomSeed(*args) def random(*args): return _P5_INSTANCE.random(*args) def randomGaussian(*args): return _P5_INSTANCE.randomGaussian(*args) def acos(*args): return _P5_INSTANCE.acos(*args) def asin(*args): return _P5_INSTANCE.asin(*args) def atan(*args): return _P5_INSTANCE.atan(*args) def atan2(*args): return _P5_INSTANCE.atan2(*args) def cos(*args): return _P5_INSTANCE.cos(*args) def sin(*args): return _P5_INSTANCE.sin(*args) def tan(*args): return _P5_INSTANCE.tan(*args) def degrees(*args): return _P5_INSTANCE.degrees(*args) def radians(*args): return _P5_INSTANCE.radians(*args) def angleMode(*args): return _P5_INSTANCE.angleMode(*args) def textAlign(*args): return _P5_INSTANCE.textAlign(*args) def textLeading(*args): return _P5_INSTANCE.textLeading(*args) def textSize(*args): return _P5_INSTANCE.textSize(*args) def textStyle(*args): return _P5_INSTANCE.textStyle(*args) def textWidth(*args): return _P5_INSTANCE.textWidth(*args) def textAscent(*args): return _P5_INSTANCE.textAscent(*args) def textDescent(*args): return _P5_INSTANCE.textDescent(*args) def loadFont(*args): return _P5_INSTANCE.loadFont(*args) def text(*args): return _P5_INSTANCE.text(*args) def textFont(*args): return _P5_INSTANCE.textFont(*args) def orbitControl(*args): return _P5_INSTANCE.orbitControl(*args) def debugMode(*args): return _P5_INSTANCE.debugMode(*args) def noDebugMode(*args): return _P5_INSTANCE.noDebugMode(*args) def ambientLight(*args): return _P5_INSTANCE.ambientLight(*args) def directionalLight(*args): return _P5_INSTANCE.directionalLight(*args) def pointLight(*args): return _P5_INSTANCE.pointLight(*args) def lights(*args): return _P5_INSTANCE.lights(*args) def loadShader(*args): return _P5_INSTANCE.loadShader(*args) def createShader(*args): return _P5_INSTANCE.createShader(*args) def shader(*args): return _P5_INSTANCE.shader(*args) def resetShader(*args): return _P5_INSTANCE.resetShader(*args) def normalMaterial(*args): return _P5_INSTANCE.normalMaterial(*args) def texture(*args): return _P5_INSTANCE.texture(*args) def textureMode(*args): return _P5_INSTANCE.textureMode(*args) def textureWrap(*args): return _P5_INSTANCE.textureWrap(*args) def ambientMaterial(*args): return _P5_INSTANCE.ambientMaterial(*args) def specularMaterial(*args): return _P5_INSTANCE.specularMaterial(*args) def shininess(*args): return _P5_INSTANCE.shininess(*args) def camera(*args): return _P5_INSTANCE.camera(*args) def perspective(*args): return _P5_INSTANCE.perspective(*args) def ortho(*args): return _P5_INSTANCE.ortho(*args) def createCamera(*args): return _P5_INSTANCE.createCamera(*args) def setCamera(*args): return _P5_INSTANCE.setCamera(*args) def select(*args): return _P5_INSTANCE.select(*args) def selectAll(*args): return _P5_INSTANCE.selectAll(*args) def removeElements(*args): return _P5_INSTANCE.removeElements(*args) def changed(*args): return _P5_INSTANCE.changed(*args) def input(*args): return _P5_INSTANCE.input(*args) def createDiv(*args): return _P5_INSTANCE.createDiv(*args) def createP(*args): return _P5_INSTANCE.createP(*args) def createSpan(*args): return _P5_INSTANCE.createSpan(*args) def createImg(*args): return _P5_INSTANCE.createImg(*args) def createA(*args): return _P5_INSTANCE.createA(*args) def createSlider(*args): return _P5_INSTANCE.createSlider(*args) def createButton(*args): return _P5_INSTANCE.createButton(*args) def createCheckbox(*args): return _P5_INSTANCE.createCheckbox(*args) def createSelect(*args): return _P5_INSTANCE.createSelect(*args) def createRadio(*args): return _P5_INSTANCE.createRadio(*args) def createColorPicker(*args): return _P5_INSTANCE.createColorPicker(*args) def createInput(*args): return _P5_INSTANCE.createInput(*args) def createFileInput(*args): return _P5_INSTANCE.createFileInput(*args) def createVideo(*args): return _P5_INSTANCE.createVideo(*args) def createAudio(*args): return _P5_INSTANCE.createAudio(*args) def createCapture(*args): return _P5_INSTANCE.createCapture(*args) def createElement(*args): return _P5_INSTANCE.createElement(*args) def createCanvas(*args): canvas = _P5_INSTANCE.createCanvas(*args) global width, height width = _P5_INSTANCE.width height = _P5_INSTANCE.height return canvas def __deviceMoved(e): try: _bind_event_function(deviceMoved, e) except NameError: pass def __deviceTurned(e): try: _bind_event_function(deviceTurned, e) except NameError: pass def __deviceShaken(e): try: _bind_event_function(deviceShaken, e) except NameError: pass def __touchEnded(e): try: _bind_event_function(deviceShaken, e) except NameError: pass def __touchStarted(e): try: _bind_event_function(touchStarted, e) except NameError: pass def __windowResized(e): try: _bind_event_function(windowResized, e) except NameError: pass def __touchMoved(e): try: _bind_event_function(touchMoved, e) except NameError: pass def __mouseMoved(e): try: _bind_event_function(mouseMoved, e) except NameError: pass def __mouseDragged(e): try: _bind_event_function(mouseDragged, e) except NameError: pass def __mousePressed(e): try: _bind_event_function(mousePressed, e) except NameError: pass def __mouseReleased(e): try: _bind_event_function(mouseReleased, e) except NameError: pass def __mouseClicked(e): try: _bind_event_function(mouseClicked, e) except NameError: pass def __doubleClicked(e): try: _bind_event_function(doubleClicked, e) except NameError: pass def __mouseWheel(e): try: _bind_event_function(mouseWheel, e) except NameError: pass def __keyPressed(e): try: _bind_event_function(keyPressed, e) except NameError: pass def __keyReleased(e): try: _bind_event_function(keyReleased, e) except NameError: pass def __keyTyped(e): try: _bind_event_function(keyTyped, e) except NameError: pass def __keyIsDown(e): try: _bind_event_function(keyIsDown, e) except NameError: pass def pop(*args): p5_pop = _P5_INSTANCE.pop(*args) return p5_pop # Processing Python or Java mode compatibility aliases size = createCanvas popMatrix = pop popStyle = pop pushMatrix = push pushStyle = push # PVector is a wrapper/helper class for p5.Vector objets # providing names similar to Processing Python or Java modes # but mostly keeping p5js functionality from numbers import Number class PVector: def __init__(self, x=0, y=0, z=0): self.__vector = createVector(x, y, z) self.add = self.__instance_add__ self.sub = self.__instance_sub__ self.mult = self.__instance_mult__ self.div = self.__instance_div__ self.cross = self.__instance_cross__ self.dist = self.__instance_dist__ self.dot = self.__instance_dot__ self.lerp = self.__instance_lerp__ @property def x(self): return self.__vector.x @x.setter def x(self, x): self.__vector.x = x @property def y(self): return self.__vector.y @y.setter def y(self, y): self.__vector.y = y @property def z(self): return self.__vector.z @z.setter def z(self, z): self.__vector.z = z def mag(self): return self.__vector.mag() def magSq(self): return self.__vector.magSq() def setMag(self, mag): self.__vector.setMag(mag) return self def normalize(self): self.__vector.normalize() return self def limit(self, max): self.__vector.limit(max) return self def heading(self): return self.__vector.heading() def rotate(self, angle): self.__vector.rotate(angle) return self def __instance_add__(self, *args): if len(args) == 1: return PVector.add(self, args[0], self) else: return PVector.add(self, PVector(*args), self) def __instance_sub__(self, *args): if len(args) == 1: return PVector.sub(self, args[0], self) else: return PVector.sub(self, PVector(*args), self) def __instance_mult__(self, o): return PVector.mult(self, o, self) def __instance_div__(self, f): return PVector.div(self, f, self) def __instance_cross__(self, o): return PVector.cross(self, o, self) def __instance_dist__(self, o): return PVector.dist(self, o) def __instance_dot__(self, *args): if len(args) == 1: v = args[0] else: v = args return self.x * v[0] + self.y * v[1] + self.z * v[2] def __instance_lerp__(self, *args): if len(args) == 2: return PVector.lerp(self, args[0], args[1], self) else: vx, vy, vz, f = args return PVector.lerp(self, PVector(vx, vy, vz), f, self) def get(self): return PVector(self.x, self.y, self.z) def copy(self): return PVector(self.x, self.y, self.z) def __getitem__(self, k): return getattr(self, ('x', 'y', 'z')[k]) def __setitem__(self, k, v): setattr(self, ('x', 'y', 'z')[k], v) def __copy__(self): return PVector(self.x, self.y, self.z) def __deepcopy__(self, memo): return PVector(self.x, self.y, self.z) def __repr__(self): # PROVISÓRIO return f'PVector({self.x}, {self.y}, {self.z})' def set(self, *args): """ Sets the x, y, and z component of the vector using two or three separate variables, the data from a p5.Vector, or the values from a float array. """ self.__vector.set(*args) @classmethod def add(cls, a, b, dest=None): if dest is None: return PVector(a.x + b[0], a.y + b[1], a.z + b[2]) dest.__vector.set(a.x + b[0], a.y + b[1], a.z + b[2]) return dest @classmethod def sub(cls, a, b, dest=None): if dest is None: return PVector(a.x - b[0], a.y - b[1], a.z - b[2]) dest.__vector.set(a.x - b[0], a.y - b[1], a.z - b[2]) return dest @classmethod def mult(cls, a, b, dest=None): if dest is None: return PVector(a.x * b, a.y * b, a.z * b) dest.__vector.set(a.x * b, a.y * b, a.z * b) return dest @classmethod def div(cls, a, b, dest=None): if dest is None: return PVector(a.x / b, a.y / b, a.z / b) dest.__vector.set(a.x / b, a.y / b, a.z / b) return dest @classmethod def dist(cls, a, b): return a.__vector.dist(b.__vector) @classmethod def dot(cls, a, b): return a.__vector.dot(b.__vector) def __add__(a, b): return PVector.add(a, b, None) def __sub__(a, b): return PVector.sub(a, b, None) def __isub__(a, b): a.sub(b) return a def __iadd__(a, b): a.add(b) return a def __mul__(a, b): if not isinstance(b, Number): raise TypeError( "The * operator can only be used to multiply a PVector by a number") return PVector.mult(a, float(b), None) def __rmul__(a, b): if not isinstance(b, Number): raise TypeError( "The * operator can only be used to multiply a PVector by a number") return PVector.mult(a, float(b), None) def __imul__(a, b): if not isinstance(b, Number): raise TypeError( "The *= operator can only be used to multiply a PVector by a number") a.__vector.mult(float(b)) return a def __truediv__(a, b): if not isinstance(b, Number): raise TypeError( "The * operator can only be used to multiply a PVector by a number") return PVector(a.x / float(b), a.y / float(b), a.z / float(b)) def __itruediv__(a, b): if not isinstance(b, Number): raise TypeError( "The /= operator can only be used to multiply a PVector by a number") a.__vector.set(a.x / float(b), a.y / float(b), a.z / float(b)) return a def __eq__(a, b): return a.x == b[0] and a.y == b[1] and a.z == b[2] def __lt__(a, b): return a.magSq() < b.magSq() def __le__(a, b): return a.magSq() <= b.magSq() def __gt__(a, b): return a.magSq() > b.magSq() def __ge__(a, b): return a.magSq() >= b.magSq() # Problematic class methods, we would rather use p5.Vector when possible... @classmethod def lerp(cls, a, b, f, dest=None): v = createVector(a.x, a.y, a.z) v.lerp(b.__vector, f) if dest is None: return PVector(v.x, v.y, v.z) dest.set(v.x, v.y, v.z) return dest @classmethod def cross(cls, a, b, dest=None): x = a.y * b[2] - b[1] * a.z y = a.z * b[0] - b[2] * a.x z = a.x * b[1] - b[0] * a.y if dest is None: return PVector(x, y, z) dest.set(x, y, z) return dest @classmethod def fromAngle(cls, angle, length=1): # https://github.com/processing/p5.js/blob/3f0b2f0fe575dc81c724474154f5b23a517b7233/src/math/p5.Vector.js return PVector(length * cos(angle), length * sin(angle), 0) @classmethod def fromAngles(theta, phi, length=1): # https://github.com/processing/p5.js/blob/3f0b2f0fe575dc81c724474154f5b23a517b7233/src/math/p5.Vector.js cosPhi = cos(phi) sinPhi = sin(phi) cosTheta = cos(theta) sinTheta = sin(theta) return PVector(length * sinTheta * sinPhi, -length * cosTheta, length * sinTheta * cosPhi) @classmethod def random2D(cls): return PVector.fromAngle(random(TWO_PI)) @classmethod def random3D(cls, dest=None): angle = random(TWO_PI) vz = random(2) - 1 mult = sqrt(1 - vz * vz) vx = mult * cos(angle) vy = mult * sin(angle) if dest is None: return PVector(vx, vy, vz) dest.set(vx, vy, vz) return dest @classmethod def angleBetween(cls, a, b): return acos(a.dot(b) / sqrt(a.magSq() * b.magSq())) # Other harmless p5js methods def equals(self, v): return self == v def heading2D(self): return self.__vector.heading() def reflect(self, *args): # Reflect the incoming vector about a normal to a line in 2D, or about # a normal to a plane in 3D This method acts on the vector directly r = self.__vector.reflect(*args) return r def array(self): # Return a representation of this vector as a float array. This is only # for temporary use. If used in any w fashion, the contents should be # copied by using the p5.Vector.copy() method to copy into your own # array. return self.__vector.array() def toString(self): # Returns a string representation of a vector v by calling String(v) or v.toString(). # return self.__vector.toString() would be something like "p5.vector # Object […, …, …]" return str(self) def rem(self, *args): # Gives remainder of a vector when it is divided by anw vector. See # examples for more context. self.__vector.rem(*args) return self def pre_draw(p5_instance, draw_func, *args, **kwargs): """ We need to run this before the actual draw to insert and update p5 env variables """ global _CTX_MIDDLE, _DEFAULT_FILL, _DEFAULT_LEADMULT, _DEFAULT_STROKE, _DEFAULT_TEXT_FILL global ADD, ALT, ARROW, AUTO, AUDIO, AXES, BACKSPACE, BASELINE, BEVEL, BEZIER, BLEND, BLUR, BOLD, BOLDITALIC global BOTTOM, BURN, CENTER, CHORD, CLAMP, CLOSE, CONTROL, CORNER, CORNERS, CROSS, CURVE, DARKEST global DEG_TO_RAD, DEGREES, DELETE, DIFFERENCE, DILATE, DODGE, DOWN_ARROW, ENTER, ERODE, ESCAPE, EXCLUSION global FILL, GRAY, GRID, HALF_PI, HAND, HARD_LIGHT, HSB, HSL, IMAGE, IMMEDIATE, INVERT, ITALIC, LANDSCAPE global LEFT, LEFT_ARROW, LIGHTEST, LINE_LOOP, LINE_STRIP, LINEAR, LINES, MIRROR, MITER, MOVE, MULTIPLY, NEAREST global NORMAL, OPAQUE, OPEN, OPTION, OVERLAY, P2D, P3D, PI, PIE, POINTS, PORTRAIT, POSTERIZE, PROJECT, QUAD_STRIP global QUADRATIC, QUADS, QUARTER_PI, RAD_TO_DEG, RADIANS, RADIUS, REPEAT, REPLACE, RETURN, RGB, RIGHT, RIGHT_ARROW global ROUND, SCREEN, SHIFT, SOFT_LIGHT, SQUARE, STROKE, SUBTRACT, TAB, TAU, TEXT, TEXTURE, THRESHOLD, TOP global TRIANGLE_FAN, TRIANGLE_STRIP, TRIANGLES, TWO_PI, UP_ARROW, VIDEO, WAIT, WEBGL global frameCount, focused, displayWidth, displayHeight, windowWidth, windowHeight, width, height global deviceOrientation, accelerationX, accelerationY, accelerationZ global pAccelerationX, pAccelerationY, pAccelerationZ, rotationX, rotationY, rotationZ global pRotationX, pRotationY, pRotationZ, turnAxis, keyIsPressed, key, keyCode, mouseX, mouseY, pmouseX, pmouseY global winMouseX, winMouseY, pwinMouseX, pwinMouseY, mouseButton, mouseIsPressed, touches, pixels _CTX_MIDDLE = p5_instance._CTX_MIDDLE _DEFAULT_FILL = p5_instance._DEFAULT_FILL _DEFAULT_LEADMULT = p5_instance._DEFAULT_LEADMULT _DEFAULT_STROKE = p5_instance._DEFAULT_STROKE _DEFAULT_TEXT_FILL = p5_instance._DEFAULT_TEXT_FILL ADD = p5_instance.ADD ALT = p5_instance.ALT ARROW = p5_instance.ARROW AUDIO = p5_instance.AUDIO AUTO = p5_instance.AUTO AXES = p5_instance.AXES BACKSPACE = p5_instance.BACKSPACE BASELINE = p5_instance.BASELINE BEVEL = p5_instance.BEVEL BEZIER = p5_instance.BEZIER BLEND = p5_instance.BLEND BLUR = p5_instance.BLUR BOLD = p5_instance.BOLD BOLDITALIC = p5_instance.BOLDITALIC BOTTOM = p5_instance.BOTTOM BURN = p5_instance.BURN CENTER = p5_instance.CENTER CHORD = p5_instance.CHORD CLAMP = p5_instance.CLAMP CLOSE = p5_instance.CLOSE CONTROL = p5_instance.CONTROL CORNER = p5_instance.CORNER CORNERS = p5_instance.CORNERS CROSS = p5_instance.CROSS CURVE = p5_instance.CURVE DARKEST = p5_instance.DARKEST DEG_TO_RAD = p5_instance.DEG_TO_RAD DEGREES = p5_instance.DEGREES DELETE = p5_instance.DELETE DIFFERENCE = p5_instance.DIFFERENCE DILATE = p5_instance.DILATE DODGE = p5_instance.DODGE DOWN_ARROW = p5_instance.DOWN_ARROW ENTER = p5_instance.ENTER ERODE = p5_instance.ERODE ESCAPE = p5_instance.ESCAPE EXCLUSION = p5_instance.EXCLUSION FILL = p5_instance.FILL GRAY = p5_instance.GRAY GRID = p5_instance.GRID HALF_PI = p5_instance.HALF_PI HAND = p5_instance.HAND HARD_LIGHT = p5_instance.HARD_LIGHT HSB = p5_instance.HSB HSL = p5_instance.HSL IMAGE = p5_instance.IMAGE IMMEDIATE = p5_instance.IMMEDIATE INVERT = p5_instance.INVERT ITALIC = p5_instance.ITALIC LANDSCAPE = p5_instance.LANDSCAPE LEFT = p5_instance.LEFT LEFT_ARROW = p5_instance.LEFT_ARROW LIGHTEST = p5_instance.LIGHTEST LINE_LOOP = p5_instance.LINE_LOOP LINE_STRIP = p5_instance.LINE_STRIP LINEAR = p5_instance.LINEAR LINES = p5_instance.LINES MIRROR = p5_instance.MIRROR MITER = p5_instance.MITER MOVE = p5_instance.MOVE MULTIPLY = p5_instance.MULTIPLY NEAREST = p5_instance.NEAREST NORMAL = p5_instance.NORMAL OPAQUE = p5_instance.OPAQUE OPEN = p5_instance.OPEN OPTION = p5_instance.OPTION OVERLAY = p5_instance.OVERLAY P2D = p5_instance.P2D P3D = p5_instance.WEBGL PI = p5_instance.PI PIE = p5_instance.PIE POINTS = p5_instance.POINTS PORTRAIT = p5_instance.PORTRAIT POSTERIZE = p5_instance.POSTERIZE PROJECT = p5_instance.PROJECT QUAD_STRIP = p5_instance.QUAD_STRIP QUADRATIC = p5_instance.QUADRATIC QUADS = p5_instance.QUADS QUARTER_PI = p5_instance.QUARTER_PI RAD_TO_DEG = p5_instance.RAD_TO_DEG RADIANS = p5_instance.RADIANS RADIUS = p5_instance.RADIUS REPEAT = p5_instance.REPEAT REPLACE = p5_instance.REPLACE RETURN = p5_instance.RETURN RGB = p5_instance.RGB RIGHT = p5_instance.RIGHT RIGHT_ARROW = p5_instance.RIGHT_ARROW ROUND = p5_instance.ROUND SCREEN = p5_instance.SCREEN SHIFT = p5_instance.SHIFT SOFT_LIGHT = p5_instance.SOFT_LIGHT SQUARE = p5_instance.SQUARE STROKE = p5_instance.STROKE SUBTRACT = p5_instance.SUBTRACT TAB = p5_instance.TAB TAU = p5_instance.TAU TEXT = p5_instance.TEXT TEXTURE = p5_instance.TEXTURE THRESHOLD = p5_instance.THRESHOLD TOP = p5_instance.TOP TRIANGLE_FAN = p5_instance.TRIANGLE_FAN TRIANGLE_STRIP = p5_instance.TRIANGLE_STRIP TRIANGLES = p5_instance.TRIANGLES TWO_PI = p5_instance.TWO_PI UP_ARROW = p5_instance.UP_ARROW VIDEO = p5_instance.VIDEO WAIT = p5_instance.WAIT WEBGL = p5_instance.WEBGL frameCount = p5_instance.frameCount focused = p5_instance.focused displayWidth = p5_instance.displayWidth displayHeight = p5_instance.displayHeight windowWidth = p5_instance.windowWidth windowHeight = p5_instance.windowHeight width = p5_instance.width height = p5_instance.height deviceOrientation = p5_instance.deviceOrientation accelerationX = p5_instance.accelerationX accelerationY = p5_instance.accelerationY accelerationZ = p5_instance.accelerationZ pAccelerationX = p5_instance.pAccelerationX pAccelerationY = p5_instance.pAccelerationY pAccelerationZ = p5_instance.pAccelerationZ rotationX = p5_instance.rotationX rotationY = p5_instance.rotationY rotationZ = p5_instance.rotationZ pRotationX = p5_instance.pRotationX pRotationY = p5_instance.pRotationY pRotationZ = p5_instance.pRotationZ turnAxis = p5_instance.turnAxis keyIsPressed = p5_instance.keyIsPressed key = p5_instance.key keyCode = p5_instance.keyCode mouseX = p5_instance.mouseX mouseY = p5_instance.mouseY pmouseX = p5_instance.pmouseX pmouseY = p5_instance.pmouseY winMouseX = p5_instance.winMouseX winMouseY = p5_instance.winMouseY pwinMouseX = p5_instance.pwinMouseX pwinMouseY = p5_instance.pwinMouseY mouseButton = p5_instance.mouseButton mouseIsPressed = p5_instance.mouseIsPressed touches = p5_instance.touches pixels = p5_instance.pixels return draw_func(*args, **kwargs) def global_p5_injection(p5_sketch): """ Injects the p5js's skecth instance as a global variable to setup and draw functions """ def decorator(f, *args, **kwargs): def wrapper(*args, **kwargs): global _P5_INSTANCE _P5_INSTANCE = p5_sketch return pre_draw(_P5_INSTANCE, f, *args, **kwargs) return wrapper return decorator def start_p5(preload_func, setup_func, draw_func, event_functions): """ This is the entrypoint function. It accepts 2 parameters: - preload_func: A Python preload callable - setup_func: a Python setup callable - draw_func: a Python draw callable - event_functions: a config dict for the event functions in the format: {"eventFunctionName": python_event_function} This method gets the p5js's sketch instance and injects them """ def sketch_setup(p5_sketch): """ Callback function called to configure new p5 instance """ p5_sketch.preload = global_p5_injection(p5_sketch)(preload_func) p5_sketch.setup = global_p5_injection(p5_sketch)(setup_func) p5_sketch.draw = global_p5_injection(p5_sketch)(draw_func) window.instance = p5.new(sketch_setup, 'sketch-holder') # Register event functions event_function_names = ( "deviceMoved", "deviceTurned", "deviceShaken", "windowResized", "keyPressed", "keyReleased", "keyTyped", "mousePressed", "mouseReleased", "mouseClicked", "doubleClicked", "mouseMoved", "mouseDragged", "mouseWheel", "touchStarted", "touchMoved", "touchEnded", "keyIsDown", ) for f_name in [f for f in event_function_names if event_functions.get(f, None)]: func = event_functions[f_name] event_func = global_p5_injection(window.instance)(func) setattr(window.instance, f_name, event_func) `; const placeholder = ` def preload(): pass def setup(): pass def draw(): pass deviceMoved = None deviceTurned = None deviceShaken = None keyPressed = None keyReleased = None keyTyped = None mouseMoved = None mouseDragged = None mousePressed = None mouseReleased = None mouseClicked = None doubleClicked = None mouseWheel = None touchStarted = None touchMoved = None touchEnded = None windowResized = None `; let userCode = ""; const startCode = ` event_functions = { "deviceMoved": deviceMoved, "deviceTurned": deviceTurned, "deviceShaken": deviceShaken, "keyPressed": keyPressed, "keyReleased": keyReleased, "keyTyped": keyTyped, "mouseMoved": mouseMoved, "mouseDragged": mouseDragged, "mousePressed": mousePressed, "mouseReleased": mouseReleased, "mouseClicked": mouseClicked, "doubleClicked": doubleClicked, "mouseWheel": mouseWheel, "touchStarted": touchStarted, "touchMoved": touchMoved, "touchEnded": touchEnded, "windowResized": windowResized, } start_p5(preload, setup, draw, event_functions) `; function runCode() { let code = [ placeholder, userCode, wrapperContent, startCode, ].join('\n'); if (window.instance) { window.instance.remove(); } console.log("Python execution output:"); window.pyodide.runPython(code); } async function main() { const config = { indexURL : "https://cdn.jsdelivr.net/pyodide/v0.18.1/full/", fullStdLib: false, } window.pyodide = await loadPyodide(config); // Pyodide is now ready to use... console.log(window.pyodide.runPython(` import io, code, sys from js import p5, window, document print(sys.version) `)); window.runSketchCode = (code) => { userCode = code; runCode(); } runCode(); }; // async method main(); ================================================ FILE: pyp5js/__init__.py ================================================ """ pyp5js Copyright (C) 2019-2021 Bernardo Fontes This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . """ ================================================ FILE: pyp5js/cli.py ================================================ #!/usr/bin/env python3 """ pyp5js Copyright (C) 2019-2021 Bernardo Fontes This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . """ import warnings from pathlib import Path from cprint import cprint import click from pyp5js import commands from pyp5js.config import SKETCHBOOK_DIR, AVAILABLE_INTERPRETERS, PYODIDE_INTERPRETER @click.group() @click.version_option(package_name="pyp5js", prog_name="pyp5js") def command_line_entrypoint(): """ pyp5js is a command line tool to conver Python 3 code to p5.js. Every sketch will be stored in ~/sketchbook-pyp5js/. You can customize this by defining an env variable SKETCHBOOK_DIR. """ pass @command_line_entrypoint.command('new') @click.argument('sketch_name') @click.option('--monitor', '-m', is_flag=True, help='Starts the monitor command too') @click.option('--interpreter', '-i', type=click.Choice(AVAILABLE_INTERPRETERS), default=PYODIDE_INTERPRETER, help='Which python tool to use to run the sketch. (defaults to pyodide)') @click.option('--template', '-t', type=click.Path(exists=True), help='Specify a custom index.html template to use.') @click.option('--cdn/--local', default=True) def configure_new_sketch(sketch_name, monitor, interpreter, template, cdn): """ Create dir and configure boilerplate - Example:\n $ pyp5js new my_sketch -i pyodide """ files = commands.new_sketch(sketch_name, interpreter, template_file=template, use_cdn=cdn) cprint.ok(f"Your sketch was created!") if not monitor: cprint.ok(f"Please, open and edit the file {files.sketch_py} to draw. When you're ready to see your results, just run:") cmd = f"\t pyp5js compile {sketch_name}" cprint.ok(cmd) cprint.ok(f"And open file://{files.index_html.absolute()} on your browser to see yor results!") else: cprint.ok(f"Please, open and edit the file {files.sketch_py} to draw.") cprint.ok(f"And open file://{files.index_html.absolute()} on your browser to see yor results!") commands.monitor_sketch(sketch_name) @command_line_entrypoint.command("transcrypt") @click.argument("sketch_name") def transcrypt_sketch(sketch_name): """ [DEPRECATED] Command to generate the P5.js code for a python sketch \nExample: $ pyp5js transcrypt my_sketch """ msg = f"transcript command is deprecated. Instead, please run: \n\n\tpyp5js compile {sketch_name}\n" warnings.warn(msg, UserWarning) @command_line_entrypoint.command("compile") @click.argument("sketch_name") @click.option('--refresh', is_flag=True, help="Update the skech index.html before it ends.") @click.option('--template', '-t', type=click.Path(exists=True), help='Specify a custom index.html template to use. Must be used with --refresh in order to work.') def compile_sketch(sketch_name, refresh, template): """ Command to update your sketch files (index, js codes etc) \nExample: $ pyp5js compile my_sketch """ files = commands.compile_sketch(sketch_name.replace("/", ""), refresh, template) cprint.ok(f"Your sketch is ready and available at file://{files.index_html.absolute()}") @command_line_entrypoint.command("monitor") @click.argument("sketch_name") def monitor_sketch(sketch_name): """ Command to generate keep watching a sketch's dir and, after any change, it'll automatically generate the JS files as in pyp5js transcrypt command """ commands.monitor_sketch(sketch_name) @command_line_entrypoint.command("serve") @click.option("--host", default="127.0.0.1", help="HTTP server host (defaults to 127.0.0.1)") @click.option("--port", default=5000, help="Listened by the server (defaults to 5000)") @click.option('--debug', is_flag=True, help="Debug mode: re-run server after any file update") def serve_sketches(host, port, debug): """ Run HTTP server to compile and serve sketches Opitionals: - host: - port: Example: $ pyp5js serve """ if not SKETCHBOOK_DIR.exists(): SKETCHBOOK_DIR.mkdir() commands.serve_http(host, port, debug) if __name__ == "__main__": command_line_entrypoint() ================================================ FILE: pyp5js/commands.py ================================================ """ pyp5js Copyright (C) 2019-2021 Bernardo Fontes This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . """ import os import shutil from cprint import cprint from jinja2 import Environment, FileSystemLoader from pyp5js.compiler import compile_sketch_js from pyp5js.exceptions import PythonSketchDoesNotExist from pyp5js.sketch import Sketch from pyp5js.http_local.web_app import app as pyp5js_web_app from pyp5js.monitor import monitor_sketch as monitor_sketch_service from pyp5js.templates_renderers import get_sketch_index_content from pyp5js.config import PYODIDE_INTERPRETER def new_sketch(sketch_name, interpreter=PYODIDE_INTERPRETER, template_file="", use_cdn=True): """ Creates a new sketch with the required assets and a index.html file, based on pyp5js's templates :param sketch_name: name for new sketch :param interpreter: interpreter to use (transcrypt or pyodide) :param template_file: use a custom template for index.html instead of default one :param use_cdn: if false, the sketch will have copies of required static assets (p5.js and pyodide) :type sketch_name: string :return: file names :rtype: list of strings """ cfg = { "interpreter": interpreter, "index_template": template_file, } sketch = Sketch(sketch_name, **cfg) sketch.create_sketch_dir() sketch.copy_initial_files(use_cdn=use_cdn) index_contet = get_sketch_index_content(sketch) with open(sketch.index_html, "w", encoding="utf-8") as fd: fd.write(index_contet) return sketch def compile_sketch(sketch_name, generate_index=False, index_template=None, force_local=False): """ Transcrypt the sketch python code to javascript. :param sketch_name: name for new sketch :param generate_index: boolean to flag if the index.html file should be updated :param force_local: boolean to flag to force local run (used by web editor only) :type sketch_name: string :return: file names :rtype: list of strings """ sketch = Sketch(sketch_name) sketch.validate_name() if not sketch.sketch_exists: raise PythonSketchDoesNotExist(sketch) compile_sketch_js(sketch, force_local=force_local) if generate_index: # to be able to overwrite default index template file # useful for generating the docs or debugging sketch.config.index_template = index_template index_contet = get_sketch_index_content(sketch) with open(sketch.index_html, "w", encoding="utf-8") as fd: fd.write(index_contet) cprint.info(f"{sketch.index_html.resolve()} updated") return sketch def monitor_sketch(sketch_name): """ Monitor for any change in any .py inside the sketch dir. For every new change, runs the transcrypt to update the js files. :param sketch_name: name for new sketch :type sketch_name: string :return: file names :rtype: list of strings """ sketch = Sketch(sketch_name) sketch.validate_name() if not sketch.sketch_exists: raise PythonSketchDoesNotExist(sketch) cprint(f"Monitoring for changes in {sketch.sketch_dir.resolve()}...") try: monitor_sketch_service(sketch) except KeyboardInterrupt: cprint.info("Exiting monitor...") def serve_http(host, port, debug=False): """ Run a HTTP server which compiles sketches on the fly and serves static files :param host: server's hostname :type host: string :param port: server's port :type port: int :param debug: turn on/off debug mode :type debug: bool """ pyp5js_web_app.run(host=host, port=port, debug=debug) ================================================ FILE: pyp5js/compiler.py ================================================ """ pyp5js Copyright (C) 2019-2021 Bernardo Fontes This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . """ import shutil import subprocess from cprint import cprint from pyp5js.config.fs import PYP5JS_FILES from pyp5js.templates_renderers import get_target_sketch_content class BasePyp5jsCompiler: def __init__(self, sketch, force_local=False): self.sketch = sketch self.force_local = force_local @property def target_dir(self): """ Path to directory with the js and assets files """ return self.sketch.sketch_dir.joinpath('__target__') def compile_sketch_js(self): self.prepare() self.run_compiler() self.clean_up() def run_compiler(self): pass def clean_up(self): pass def prepare(self): """ Creates target_sketch.py to import the sketch's functions """ content = get_target_sketch_content(self.sketch) with self.sketch.target_sketch.open('w', encoding="utf-8") as fd: fd.write(content) cprint.info(f"{self.sketch.target_sketch.resolve()} updated with sketch code") class TranscryptCompiler(BasePyp5jsCompiler): @property def command_line(self): """ Builds transcrypt command line with the required parameters and flags """ pyp5_dir = PYP5JS_FILES.transcrypt_conf_dir target = self.sketch.target_sketch return ' '.join([str(c) for c in [ 'transcrypt', '-xp', f'"{pyp5_dir}"', '-k', '-ks', '-b', '-m', '-n', f'"{target}"' ]]) def run_compiler(self): """ Execute transcrypt command to generate the JS files """ command = self.command_line cprint.info( f"Converting Python to P5.js...\nRunning command:\n\t {command}") subprocess.call(command, shell=True) def clean_up(self): """ Rename the assets dir from __target__ to target and delete target_sketch.py This is required because github pages can't deal with assets under a __target__ directory """ if self.sketch.target_dir.exists(): shutil.rmtree(self.sketch.target_dir) # mv __target__ target shutil.move(self.target_dir, self.sketch.target_dir) if self.sketch.target_sketch.exists(): self.sketch.target_sketch.unlink() class PyodideCompiler(BasePyp5jsCompiler): def prepare(self): # this is a hack for web editor to always run using local JS files if self.force_local: self.sketch.config.pyodide_js_url = "/static/js/pyodide/pyodide_v0.18.1.js" return super().prepare() def compile_sketch_js(sketch, force_local=False): if sketch.config.is_transcrypt: compiler = TranscryptCompiler(sketch, force_local=force_local) else: compiler = PyodideCompiler(sketch, force_local=force_local) compiler.compile_sketch_js() ================================================ FILE: pyp5js/config/__init__.py ================================================ """ pyp5js Copyright (C) 2019-2021 Bernardo Fontes This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . """ from . import sketch from .sketch import TRANSCRYPT_INTERPRETER, PYODIDE_INTERPRETER from decouple import config from pathlib import Path SKETCHBOOK_DIR = config("SKETCHBOOK_DIR", cast=Path, default=Path.home().joinpath('sketchbook-pyp5js')) if not SKETCHBOOK_DIR.exists(): SKETCHBOOK_DIR.mkdir() AVAILABLE_INTERPRETERS = [TRANSCRYPT_INTERPRETER, PYODIDE_INTERPRETER] ================================================ FILE: pyp5js/config/fs.py ================================================ """ pyp5js Copyright (C) 2019-2021 Bernardo Fontes This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . """ from pathlib import Path class LibFiles(): """ This class abstracts pyp5js lib files path from the filesystem. It expose properties for the directories and files. Every property returns a pathlib.Path object """ def __init__(self): self.install = Path(__file__).parents[1] ##### GENERAL PURPOSE @property def templates_dir(self): return self.install.joinpath('templates') @property def static_dir(self): return self.install.joinpath('http_local', 'static') @property def pytop5js(self): return self.transcrypt_conf_dir.joinpath('pyp5js.py') @property def p5js(self): return self.static_dir.joinpath('js', 'p5', 'p5.min.js') @property def p5_yml(self): return self.static_dir.joinpath('p5_reference.yml') ##### TRANSCRYPT SPECIFICS @property def transcrypt_conf_dir(self): return self.templates_dir.joinpath('transcrypt') @property def transcrypt_index_html(self): return self.templates_dir.joinpath('transcrypt', 'index.html') @property def transcrypt_target_sketch_template(self): return self.templates_dir.joinpath('transcrypt', 'target_sketch.py.template') @property def transcrypt_base_sketch_template(self): return self.templates_dir.joinpath('transcrypt', 'base_sketch.py.template') ##### PYODIDE SPECIFICS @property def pyodide_target_sketch_template(self): return self.templates_dir.joinpath('pyodide', 'target_sketch.js.template') @property def pyodide_index_html(self): return self.templates_dir.joinpath('pyodide', 'index.html') @property def pyodide_base_sketch_template(self): return self.templates_dir.joinpath('pyodide', 'base_sketch.py.template') @property def pyodide_js_dir(self): return self.static_dir / "js" / "pyodide" PYP5JS_FILES = LibFiles() ================================================ FILE: pyp5js/config/sketch.py ================================================ """ pyp5js Copyright (C) 2019-2021 Bernardo Fontes This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . """ import json from pathlib import Path from pyp5js.config.fs import PYP5JS_FILES TRANSCRYPT_INTERPRETER = 'transcrypt' PYODIDE_INTERPRETER = 'pyodide' P5_JS_CDN = 'https://cdn.jsdelivr.net/npm/p5@1.4.0/lib/p5.min.js' PYODIDE_JS_CDN = 'https://cdn.jsdelivr.net/pyodide/v0.18.1/full/pyodide.js' class SketchConfig: @classmethod def from_json(cls, json_file_path): with open(json_file_path) as fd: config_data = json.load(fd) return cls(**config_data) def __init__(self, interpreter, **kwargs): self.interpreter = interpreter self.index_template = kwargs.get("index_template", "") self.p5_js_url = kwargs.get("p5_js_url", P5_JS_CDN) self.pyodide_js_url = kwargs.get("pyodide_js_url", PYODIDE_JS_CDN) @property def index_template_path(self): return Path(self.index_template).absolute() def write(self, fname): index_template = "" if self.index_template and self.index_template_path.exists(): index_template = str(self.index_template_path.resolve()) with open(fname, "w") as fd: data = { "interpreter": self.interpreter, "p5_js_url": self.p5_js_url, } if self.index_template: data.update({"index_template": index_template}) if self.is_pyodide: data.update({"pyodide_js_url": self.pyodide_js_url}) json.dump(data, fd) @property def is_transcrypt(self): return self.interpreter == TRANSCRYPT_INTERPRETER @property def is_pyodide(self): return self.interpreter == PYODIDE_INTERPRETER def get_index_template(self): if self.index_template and self.index_template_path.exists(): return self.index_template_path index_map = { TRANSCRYPT_INTERPRETER: PYP5JS_FILES.transcrypt_index_html, PYODIDE_INTERPRETER: PYP5JS_FILES.pyodide_index_html, } return index_map[self.interpreter] def get_target_js_template(self): target_map = { TRANSCRYPT_INTERPRETER: PYP5JS_FILES.transcrypt_target_sketch_template, PYODIDE_INTERPRETER: PYP5JS_FILES.pyodide_target_sketch_template, } return target_map[self.interpreter] def get_base_sketch_template(self): base_map = { TRANSCRYPT_INTERPRETER: PYP5JS_FILES.transcrypt_base_sketch_template, PYODIDE_INTERPRETER: PYP5JS_FILES.pyodide_base_sketch_template, } return base_map[self.interpreter] ================================================ FILE: pyp5js/exceptions.py ================================================ """ pyp5js Copyright (C) 2019-2021 Bernardo Fontes This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . """ class PythonSketchDoesNotExist(Exception): def __init__(self, sketch): sketch_py = sketch.sketch_py.resolve() message = f"Sketch file {sketch_py} does not exist" super().__init__(message) class SketchDirAlreadyExistException(Exception): def __init__(self, sketch): sketch_dir = sketch.sketch_dir.resolve() message = f'The directory {sketch_dir} already exists.' super().__init__(message) class InvalidName(Exception): def __init__(self, sketch): sketch_name = sketch.sketch_name message = f'The name {sketch_name} must start with a letter or an underscore and ' + \ 'contain alphanumeric and underscore characters only.' super().__init__(message) ================================================ FILE: pyp5js/http_local/__init__.py ================================================ """ pyp5js Copyright (C) 2019-2021 Bernardo Fontes This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . """ ================================================ FILE: pyp5js/http_local/static/js/ace/ace.js ================================================ (function(){function o(n){var i=e;n&&(e[n]||(e[n]={}),i=e[n]);if(!i.define||!i.define.packaged)t.original=i.define,i.define=t,i.define.packaged=!0;if(!i.require||!i.require.packaged)r.original=i.require,i.require=r,i.require.packaged=!0}var ACE_NAMESPACE="",e=function(){return this}();!e&&typeof window!="undefined"&&(e=window);if(!ACE_NAMESPACE&&typeof requirejs!="undefined")return;var t=function(e,n,r){if(typeof e!="string"){t.original?t.original.apply(this,arguments):(console.error("dropping module because define wasn't a string."),console.trace());return}arguments.length==2&&(r=n),t.modules[e]||(t.payloads[e]=r,t.modules[e]=null)};t.modules={},t.payloads={};var n=function(e,t,n){if(typeof t=="string"){var i=s(e,t);if(i!=undefined)return n&&n(),i}else if(Object.prototype.toString.call(t)==="[object Array]"){var o=[];for(var u=0,a=t.length;u1&&u(t,"")>-1&&(a=RegExp(this.source,r.replace.call(o(this),"g","")),r.replace.call(e.slice(t.index),a,function(){for(var e=1;et.index&&this.lastIndex--}return t},s||(RegExp.prototype.test=function(e){var t=r.exec.call(this,e);return t&&this.global&&!t[0].length&&this.lastIndex>t.index&&this.lastIndex--,!!t})}),define("ace/lib/es5-shim",["require","exports","module"],function(e,t,n){function r(){}function w(e){try{return Object.defineProperty(e,"sentinel",{}),"sentinel"in e}catch(t){}}function H(e){return e=+e,e!==e?e=0:e!==0&&e!==1/0&&e!==-1/0&&(e=(e>0||-1)*Math.floor(Math.abs(e))),e}function B(e){var t=typeof e;return e===null||t==="undefined"||t==="boolean"||t==="number"||t==="string"}function j(e){var t,n,r;if(B(e))return e;n=e.valueOf;if(typeof n=="function"){t=n.call(e);if(B(t))return t}r=e.toString;if(typeof r=="function"){t=r.call(e);if(B(t))return t}throw new TypeError}Function.prototype.bind||(Function.prototype.bind=function(t){var n=this;if(typeof n!="function")throw new TypeError("Function.prototype.bind called on incompatible "+n);var i=u.call(arguments,1),s=function(){if(this instanceof s){var e=n.apply(this,i.concat(u.call(arguments)));return Object(e)===e?e:this}return n.apply(t,i.concat(u.call(arguments)))};return n.prototype&&(r.prototype=n.prototype,s.prototype=new r,r.prototype=null),s});var i=Function.prototype.call,s=Array.prototype,o=Object.prototype,u=s.slice,a=i.bind(o.toString),f=i.bind(o.hasOwnProperty),l,c,h,p,d;if(d=f(o,"__defineGetter__"))l=i.bind(o.__defineGetter__),c=i.bind(o.__defineSetter__),h=i.bind(o.__lookupGetter__),p=i.bind(o.__lookupSetter__);if([1,2].splice(0).length!=2)if(!function(){function e(e){var t=new Array(e+2);return t[0]=t[1]=0,t}var t=[],n;t.splice.apply(t,e(20)),t.splice.apply(t,e(26)),n=t.length,t.splice(5,0,"XXX"),n+1==t.length;if(n+1==t.length)return!0}())Array.prototype.splice=function(e,t){var n=this.length;e>0?e>n&&(e=n):e==void 0?e=0:e<0&&(e=Math.max(n+e,0)),e+ta)for(h=l;h--;)this[f+h]=this[a+h];if(s&&e===c)this.length=c,this.push.apply(this,i);else{this.length=c+s;for(h=0;h>>0;if(a(t)!="[object Function]")throw new TypeError;while(++s>>0,s=Array(i),o=arguments[1];if(a(t)!="[object Function]")throw new TypeError(t+" is not a function");for(var u=0;u>>0,s=[],o,u=arguments[1];if(a(t)!="[object Function]")throw new TypeError(t+" is not a function");for(var f=0;f>>0,s=arguments[1];if(a(t)!="[object Function]")throw new TypeError(t+" is not a function");for(var o=0;o>>0,s=arguments[1];if(a(t)!="[object Function]")throw new TypeError(t+" is not a function");for(var o=0;o>>0;if(a(t)!="[object Function]")throw new TypeError(t+" is not a function");if(!i&&arguments.length==1)throw new TypeError("reduce of empty array with no initial value");var s=0,o;if(arguments.length>=2)o=arguments[1];else do{if(s in r){o=r[s++];break}if(++s>=i)throw new TypeError("reduce of empty array with no initial value")}while(!0);for(;s>>0;if(a(t)!="[object Function]")throw new TypeError(t+" is not a function");if(!i&&arguments.length==1)throw new TypeError("reduceRight of empty array with no initial value");var s,o=i-1;if(arguments.length>=2)s=arguments[1];else do{if(o in r){s=r[o--];break}if(--o<0)throw new TypeError("reduceRight of empty array with no initial value")}while(!0);do o in this&&(s=t.call(void 0,s,r[o],o,n));while(o--);return s});if(!Array.prototype.indexOf||[0,1].indexOf(1,2)!=-1)Array.prototype.indexOf=function(t){var n=g&&a(this)=="[object String]"?this.split(""):F(this),r=n.length>>>0;if(!r)return-1;var i=0;arguments.length>1&&(i=H(arguments[1])),i=i>=0?i:Math.max(0,r+i);for(;i>>0;if(!r)return-1;var i=r-1;arguments.length>1&&(i=Math.min(i,H(arguments[1]))),i=i>=0?i:r-Math.abs(i);for(;i>=0;i--)if(i in n&&t===n[i])return i;return-1};Object.getPrototypeOf||(Object.getPrototypeOf=function(t){return t.__proto__||(t.constructor?t.constructor.prototype:o)});if(!Object.getOwnPropertyDescriptor){var y="Object.getOwnPropertyDescriptor called on a non-object: ";Object.getOwnPropertyDescriptor=function(t,n){if(typeof t!="object"&&typeof t!="function"||t===null)throw new TypeError(y+t);if(!f(t,n))return;var r,i,s;r={enumerable:!0,configurable:!0};if(d){var u=t.__proto__;t.__proto__=o;var i=h(t,n),s=p(t,n);t.__proto__=u;if(i||s)return i&&(r.get=i),s&&(r.set=s),r}return r.value=t[n],r}}Object.getOwnPropertyNames||(Object.getOwnPropertyNames=function(t){return Object.keys(t)});if(!Object.create){var b;Object.prototype.__proto__===null?b=function(){return{__proto__:null}}:b=function(){var e={};for(var t in e)e[t]=null;return e.constructor=e.hasOwnProperty=e.propertyIsEnumerable=e.isPrototypeOf=e.toLocaleString=e.toString=e.valueOf=e.__proto__=null,e},Object.create=function(t,n){var r;if(t===null)r=b();else{if(typeof t!="object")throw new TypeError("typeof prototype["+typeof t+"] != 'object'");var i=function(){};i.prototype=t,r=new i,r.__proto__=t}return n!==void 0&&Object.defineProperties(r,n),r}}if(Object.defineProperty){var E=w({}),S=typeof document=="undefined"||w(document.createElement("div"));if(!E||!S)var x=Object.defineProperty}if(!Object.defineProperty||x){var T="Property description must be an object: ",N="Object.defineProperty called on non-object: ",C="getters & setters can not be defined on this javascript engine";Object.defineProperty=function(t,n,r){if(typeof t!="object"&&typeof t!="function"||t===null)throw new TypeError(N+t);if(typeof r!="object"&&typeof r!="function"||r===null)throw new TypeError(T+r);if(x)try{return x.call(Object,t,n,r)}catch(i){}if(f(r,"value"))if(d&&(h(t,n)||p(t,n))){var s=t.__proto__;t.__proto__=o,delete t[n],t[n]=r.value,t.__proto__=s}else t[n]=r.value;else{if(!d)throw new TypeError(C);f(r,"get")&&l(t,n,r.get),f(r,"set")&&c(t,n,r.set)}return t}}Object.defineProperties||(Object.defineProperties=function(t,n){for(var r in n)f(n,r)&&Object.defineProperty(t,r,n[r]);return t}),Object.seal||(Object.seal=function(t){return t}),Object.freeze||(Object.freeze=function(t){return t});try{Object.freeze(function(){})}catch(k){Object.freeze=function(t){return function(n){return typeof n=="function"?n:t(n)}}(Object.freeze)}Object.preventExtensions||(Object.preventExtensions=function(t){return t}),Object.isSealed||(Object.isSealed=function(t){return!1}),Object.isFrozen||(Object.isFrozen=function(t){return!1}),Object.isExtensible||(Object.isExtensible=function(t){if(Object(t)===t)throw new TypeError;var n="";while(f(t,n))n+="?";t[n]=!0;var r=f(t,n);return delete t[n],r});if(!Object.keys){var L=!0,A=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],O=A.length;for(var M in{toString:null})L=!1;Object.keys=function I(e){if(typeof e!="object"&&typeof e!="function"||e===null)throw new TypeError("Object.keys called on a non-object");var I=[];for(var t in e)f(e,t)&&I.push(t);if(L)for(var n=0,r=O;n=0?parseFloat((s.match(/(?:MSIE |Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]):parseFloat((s.match(/(?:Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]),t.isOldIE=t.isIE&&t.isIE<9,t.isGecko=t.isMozilla=s.match(/ Gecko\/\d+/),t.isOpera=typeof opera=="object"&&Object.prototype.toString.call(window.opera)=="[object Opera]",t.isWebKit=parseFloat(s.split("WebKit/")[1])||undefined,t.isChrome=parseFloat(s.split(" Chrome/")[1])||undefined,t.isEdge=parseFloat(s.split(" Edge/")[1])||undefined,t.isAIR=s.indexOf("AdobeAIR")>=0,t.isAndroid=s.indexOf("Android")>=0,t.isChromeOS=s.indexOf(" CrOS ")>=0,t.isIOS=/iPad|iPhone|iPod/.test(s)&&!window.MSStream,t.isIOS&&(t.isMac=!0),t.isMobile=t.isIOS||t.isAndroid}),define("ace/lib/dom",["require","exports","module","ace/lib/useragent"],function(e,t,n){"use strict";var r=e("./useragent"),i="http://www.w3.org/1999/xhtml";t.buildDom=function o(e,t,n){if(typeof e=="string"&&e){var r=document.createTextNode(e);return t&&t.appendChild(r),r}if(!Array.isArray(e))return e&&e.appendChild&&t&&t.appendChild(e),e;if(typeof e[0]!="string"||!e[0]){var i=[];for(var s=0;s=1.5:!0;if(typeof document!="undefined"){var s=document.createElement("div");t.HI_DPI&&s.style.transform!==undefined&&(t.HAS_CSS_TRANSFORMS=!0),!r.isEdge&&typeof s.style.animationName!="undefined"&&(t.HAS_CSS_ANIMATION=!0),s=null}t.HAS_CSS_TRANSFORMS?t.translate=function(e,t,n){e.style.transform="translate("+Math.round(t)+"px, "+Math.round(n)+"px)"}:t.translate=function(e,t,n){e.style.top=Math.round(n)+"px",e.style.left=Math.round(t)+"px"}}),define("ace/lib/oop",["require","exports","module"],function(e,t,n){"use strict";t.inherits=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})},t.mixin=function(e,t){for(var n in t)e[n]=t[n];return e},t.implement=function(e,n){t.mixin(e,n)}}),define("ace/lib/keys",["require","exports","module","ace/lib/oop"],function(e,t,n){"use strict";var r=e("./oop"),i=function(){var e={MODIFIER_KEYS:{16:"Shift",17:"Ctrl",18:"Alt",224:"Meta",91:"MetaLeft",92:"MetaRight",93:"ContextMenu"},KEY_MODS:{ctrl:1,alt:2,option:2,shift:4,"super":8,meta:8,command:8,cmd:8,control:1},FUNCTION_KEYS:{8:"Backspace",9:"Tab",13:"Return",19:"Pause",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"Print",45:"Insert",46:"Delete",96:"Numpad0",97:"Numpad1",98:"Numpad2",99:"Numpad3",100:"Numpad4",101:"Numpad5",102:"Numpad6",103:"Numpad7",104:"Numpad8",105:"Numpad9","-13":"NumpadEnter",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"Numlock",145:"Scrolllock"},PRINTABLE_KEYS:{32:" ",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",59:";",61:"=",65:"a",66:"b",67:"c",68:"d",69:"e",70:"f",71:"g",72:"h",73:"i",74:"j",75:"k",76:"l",77:"m",78:"n",79:"o",80:"p",81:"q",82:"r",83:"s",84:"t",85:"u",86:"v",87:"w",88:"x",89:"y",90:"z",107:"+",109:"-",110:".",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",111:"/",106:"*"}},t,n;for(n in e.FUNCTION_KEYS)t=e.FUNCTION_KEYS[n].toLowerCase(),e[t]=parseInt(n,10);for(n in e.PRINTABLE_KEYS)t=e.PRINTABLE_KEYS[n].toLowerCase(),e[t]=parseInt(n,10);return r.mixin(e,e.MODIFIER_KEYS),r.mixin(e,e.PRINTABLE_KEYS),r.mixin(e,e.FUNCTION_KEYS),e.enter=e["return"],e.escape=e.esc,e.del=e["delete"],e[173]="-",function(){var t=["cmd","ctrl","alt","shift"];for(var n=Math.pow(2,t.length);n--;)e.KEY_MODS[n]=t.filter(function(t){return n&e.KEY_MODS[t]}).join("-")+"-"}(),e.KEY_MODS[0]="",e.KEY_MODS[-1]="input-",e}();r.mixin(t,i),t.keyCodeToString=function(e){var t=i[e];return typeof t!="string"&&(t=String.fromCharCode(e)),t.toLowerCase()}}),define("ace/lib/event",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(e,t,n){"use strict";function a(){u=!1;try{document.createComment("").addEventListener("test",function(){},{get passive(){u={passive:!1}}})}catch(e){}}function f(){return u==undefined&&a(),u}function l(e,t,n){this.elem=e,this.type=t,this.callback=n}function d(e,t,n){var u=p(t);if(!i.isMac&&s){t.getModifierState&&(t.getModifierState("OS")||t.getModifierState("Win"))&&(u|=8);if(s.altGr){if((3&u)==3)return;s.altGr=0}if(n===18||n===17){var a="location"in t?t.location:t.keyLocation;if(n===17&&a===1)s[n]==1&&(o=t.timeStamp);else if(n===18&&u===3&&a===2){var f=t.timeStamp-o;f<50&&(s.altGr=!0)}}}n in r.MODIFIER_KEYS&&(n=-1);if(!u&&n===13){var a="location"in t?t.location:t.keyLocation;if(a===3){e(t,u,-n);if(t.defaultPrevented)return}}if(i.isChromeOS&&u&8){e(t,u,n);if(t.defaultPrevented)return;u&=-9}return!!u||n in r.FUNCTION_KEYS||n in r.PRINTABLE_KEYS?e(t,u,n):!1}function v(){s=Object.create(null)}var r=e("./keys"),i=e("./useragent"),s=null,o=0,u;l.prototype.destroy=function(){h(this.elem,this.type,this.callback),this.elem=this.type=this.callback=undefined};var c=t.addListener=function(e,t,n,r){e.addEventListener(t,n,f()),r&&r.$toDestroy.push(new l(e,t,n))},h=t.removeListener=function(e,t,n){e.removeEventListener(t,n,f())};t.stopEvent=function(e){return t.stopPropagation(e),t.preventDefault(e),!1},t.stopPropagation=function(e){e.stopPropagation&&e.stopPropagation()},t.preventDefault=function(e){e.preventDefault&&e.preventDefault()},t.getButton=function(e){return e.type=="dblclick"?0:e.type=="contextmenu"||i.isMac&&e.ctrlKey&&!e.altKey&&!e.shiftKey?2:e.button},t.capture=function(e,t,n){function r(e){t&&t(e),n&&n(e),h(document,"mousemove",t),h(document,"mouseup",r),h(document,"dragstart",r)}return c(document,"mousemove",t),c(document,"mouseup",r),c(document,"dragstart",r),r},t.addMouseWheelListener=function(e,t,n){"onmousewheel"in e?c(e,"mousewheel",function(e){var n=8;e.wheelDeltaX!==undefined?(e.wheelX=-e.wheelDeltaX/n,e.wheelY=-e.wheelDeltaY/n):(e.wheelX=0,e.wheelY=-e.wheelDelta/n),t(e)},n):"onwheel"in e?c(e,"wheel",function(e){var n=.35;switch(e.deltaMode){case e.DOM_DELTA_PIXEL:e.wheelX=e.deltaX*n||0,e.wheelY=e.deltaY*n||0;break;case e.DOM_DELTA_LINE:case e.DOM_DELTA_PAGE:e.wheelX=(e.deltaX||0)*5,e.wheelY=(e.deltaY||0)*5}t(e)},n):c(e,"DOMMouseScroll",function(e){e.axis&&e.axis==e.HORIZONTAL_AXIS?(e.wheelX=(e.detail||0)*5,e.wheelY=0):(e.wheelX=0,e.wheelY=(e.detail||0)*5),t(e)},n)},t.addMultiMouseDownListener=function(e,n,r,s,o){function p(e){t.getButton(e)!==0?u=0:e.detail>1?(u++,u>4&&(u=1)):u=1;if(i.isIE){var o=Math.abs(e.clientX-a)>5||Math.abs(e.clientY-f)>5;if(!l||o)u=1;l&&clearTimeout(l),l=setTimeout(function(){l=null},n[u-1]||600),u==1&&(a=e.clientX,f=e.clientY)}e._clicks=u,r[s]("mousedown",e);if(u>4)u=0;else if(u>1)return r[s](h[u],e)}var u=0,a,f,l,h={2:"dblclick",3:"tripleclick",4:"quadclick"};Array.isArray(e)||(e=[e]),e.forEach(function(e){c(e,"mousedown",p,o)})};var p=function(e){return 0|(e.ctrlKey?1:0)|(e.altKey?2:0)|(e.shiftKey?4:0)|(e.metaKey?8:0)};t.getModifierString=function(e){return r.KEY_MODS[p(e)]},t.addCommandKeyListener=function(e,n,r){if(i.isOldGecko||i.isOpera&&!("KeyboardEvent"in window)){var o=null;c(e,"keydown",function(e){o=e.keyCode},r),c(e,"keypress",function(e){return d(n,e,o)},r)}else{var u=null;c(e,"keydown",function(e){s[e.keyCode]=(s[e.keyCode]||0)+1;var t=d(n,e,e.keyCode);return u=e.defaultPrevented,t},r),c(e,"keypress",function(e){u&&(e.ctrlKey||e.altKey||e.shiftKey||e.metaKey)&&(t.stopEvent(e),u=null)},r),c(e,"keyup",function(e){s[e.keyCode]=null},r),s||(v(),c(window,"focus",v))}};if(typeof window=="object"&&window.postMessage&&!i.isOldIE){var m=1;t.nextTick=function(e,n){n=n||window;var r="zero-timeout-message-"+m++,i=function(s){s.data==r&&(t.stopPropagation(s),h(n,"message",i),e())};c(n,"message",i),n.postMessage(r,"*")}}t.$idleBlocked=!1,t.onIdle=function(e,n){return setTimeout(function r(){t.$idleBlocked?setTimeout(r,100):e()},n)},t.$idleBlockId=null,t.blockIdle=function(e){t.$idleBlockId&&clearTimeout(t.$idleBlockId),t.$idleBlocked=!0,t.$idleBlockId=setTimeout(function(){t.$idleBlocked=!1},e||100)},t.nextFrame=typeof window=="object"&&(window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame),t.nextFrame?t.nextFrame=t.nextFrame.bind(window):t.nextFrame=function(e){setTimeout(e,17)}}),define("ace/range",["require","exports","module"],function(e,t,n){"use strict";var r=function(e,t){return e.row-t.row||e.column-t.column},i=function(e,t,n,r){this.start={row:e,column:t},this.end={row:n,column:r}};(function(){this.isEqual=function(e){return this.start.row===e.start.row&&this.end.row===e.end.row&&this.start.column===e.start.column&&this.end.column===e.end.column},this.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},this.contains=function(e,t){return this.compare(e,t)==0},this.compareRange=function(e){var t,n=e.end,r=e.start;return t=this.compare(n.row,n.column),t==1?(t=this.compare(r.row,r.column),t==1?2:t==0?1:0):t==-1?-2:(t=this.compare(r.row,r.column),t==-1?-1:t==1?42:0)},this.comparePoint=function(e){return this.compare(e.row,e.column)},this.containsRange=function(e){return this.comparePoint(e.start)==0&&this.comparePoint(e.end)==0},this.intersects=function(e){var t=this.compareRange(e);return t==-1||t==0||t==1},this.isEnd=function(e,t){return this.end.row==e&&this.end.column==t},this.isStart=function(e,t){return this.start.row==e&&this.start.column==t},this.setStart=function(e,t){typeof e=="object"?(this.start.column=e.column,this.start.row=e.row):(this.start.row=e,this.start.column=t)},this.setEnd=function(e,t){typeof e=="object"?(this.end.column=e.column,this.end.row=e.row):(this.end.row=e,this.end.column=t)},this.inside=function(e,t){return this.compare(e,t)==0?this.isEnd(e,t)||this.isStart(e,t)?!1:!0:!1},this.insideStart=function(e,t){return this.compare(e,t)==0?this.isEnd(e,t)?!1:!0:!1},this.insideEnd=function(e,t){return this.compare(e,t)==0?this.isStart(e,t)?!1:!0:!1},this.compare=function(e,t){return!this.isMultiLine()&&e===this.start.row?tthis.end.column?1:0:ethis.end.row?1:this.start.row===e?t>=this.start.column?0:-1:this.end.row===e?t<=this.end.column?0:1:0},this.compareStart=function(e,t){return this.start.row==e&&this.start.column==t?-1:this.compare(e,t)},this.compareEnd=function(e,t){return this.end.row==e&&this.end.column==t?1:this.compare(e,t)},this.compareInside=function(e,t){return this.end.row==e&&this.end.column==t?1:this.start.row==e&&this.start.column==t?-1:this.compare(e,t)},this.clipRows=function(e,t){if(this.end.row>t)var n={row:t+1,column:0};else if(this.end.rowt)var r={row:t+1,column:0};else if(this.start.row0){t&1&&(n+=e);if(t>>=1)e+=e}return n};var r=/^\s\s*/,i=/\s\s*$/;t.stringTrimLeft=function(e){return e.replace(r,"")},t.stringTrimRight=function(e){return e.replace(i,"")},t.copyObject=function(e){var t={};for(var n in e)t[n]=e[n];return t},t.copyArray=function(e){var t=[];for(var n=0,r=e.length;nDate.now()-50?!0:r=!1},cancel:function(){r=Date.now()}}}),define("ace/keyboard/textinput",["require","exports","module","ace/lib/event","ace/lib/useragent","ace/lib/dom","ace/lib/lang","ace/clipboard","ace/lib/keys"],function(e,t,n){"use strict";var r=e("../lib/event"),i=e("../lib/useragent"),s=e("../lib/dom"),o=e("../lib/lang"),u=e("../clipboard"),a=i.isChrome<18,f=i.isIE,l=i.isChrome>63,c=400,h=e("../lib/keys"),p=h.KEY_MODS,d=i.isIOS,v=d?/\s/:/\n/,m=i.isMobile,g=function(e,t){function X(){x=!0,n.blur(),n.focus(),x=!1}function $(e){e.keyCode==27&&n.value.lengthC&&T[s]=="\n")o=h.end;else if(rC&&T.slice(0,s).split("\n").length>2)o=h.down;else if(s>C&&T[s-1]==" ")o=h.right,u=p.option;else if(s>C||s==C&&C!=N&&r==s)o=h.right;r!==s&&(u|=p.shift);if(o){var a=t.onCommandKey({},u,o);if(!a&&t.commands){o=h.keyCodeToString(o);var f=t.commands.findKeyCommand(u,o);f&&t.execCommand(f)}N=r,C=s,O("")}};document.addEventListener("selectionchange",s),t.on("destroy",function(){document.removeEventListener("selectionchange",s)})}var n=s.createElement("textarea");n.className="ace_text-input",n.setAttribute("wrap","off"),n.setAttribute("autocorrect","off"),n.setAttribute("autocapitalize","off"),n.setAttribute("spellcheck",!1),n.style.opacity="0",e.insertBefore(n,e.firstChild);var g=!1,y=!1,b=!1,w=!1,E="";m||(n.style.fontSize="1px");var S=!1,x=!1,T="",N=0,C=0,k=0;try{var L=document.activeElement===n}catch(A){}r.addListener(n,"blur",function(e){if(x)return;t.onBlur(e),L=!1},t),r.addListener(n,"focus",function(e){if(x)return;L=!0;if(i.isEdge)try{if(!document.hasFocus())return}catch(e){}t.onFocus(e),i.isEdge?setTimeout(O):O()},t),this.$focusScroll=!1,this.focus=function(){if(E||l||this.$focusScroll=="browser")return n.focus({preventScroll:!0});var e=n.style.top;n.style.position="fixed",n.style.top="0px";try{var t=n.getBoundingClientRect().top!=0}catch(r){return}var i=[];if(t){var s=n.parentElement;while(s&&s.nodeType==1)i.push(s),s.setAttribute("ace_nocontext",!0),!s.parentElement&&s.getRootNode?s=s.getRootNode().host:s=s.parentElement}n.focus({preventScroll:!0}),t&&i.forEach(function(e){e.removeAttribute("ace_nocontext")}),setTimeout(function(){n.style.position="",n.style.top=="0px"&&(n.style.top=e)},0)},this.blur=function(){n.blur()},this.isFocused=function(){return L},t.on("beforeEndOperation",function(){var e=t.curOp,r=e&&e.command&&e.command.name;if(r=="insertstring")return;var i=r&&(e.docChanged||e.selectionChanged);b&&i&&(T=n.value="",W()),O()});var O=d?function(e){if(!L||g&&!e||w)return;e||(e="");var r="\n ab"+e+"cde fg\n";r!=n.value&&(n.value=T=r);var i=4,s=4+(e.length||(t.selection.isEmpty()?0:1));(N!=i||C!=s)&&n.setSelectionRange(i,s),N=i,C=s}:function(){if(b||w)return;if(!L&&!P)return;b=!0;var e=0,r=0,i="";if(t.session){var s=t.selection,o=s.getRange(),u=s.cursor.row;e=o.start.column,r=o.end.column,i=t.session.getLine(u);if(o.start.row!=u){var a=t.session.getLine(u-1);e=o.start.rowu+1?f.length:r,r+=i.length+1,i=i+"\n"+f}else m&&u>0&&(i="\n"+i,r+=1,e+=1);i.length>c&&(e=T.length&&e.value===T&&T&&e.selectionEnd!==C},_=function(e){if(b)return;g?g=!1:M(n)?(t.selectAll(),O()):m&&n.selectionStart!=N&&O()},D=null;this.setInputHandler=function(e){D=e},this.getInputHandler=function(){return D};var P=!1,H=function(e,r){P&&(P=!1);if(y)return O(),e&&t.onPaste(e),y=!1,"";var i=n.selectionStart,s=n.selectionEnd,o=N,u=T.length-C,a=e,f=e.length-i,l=e.length-s,c=0;while(o>0&&T[c]==e[c])c++,o--;a=a.slice(c),c=1;while(u>0&&T.length-c>N-1&&T[T.length-c]==e[e.length-c])c++,u--;f-=c-1,l-=c-1;var h=a.length-c+1;return h<0&&(o=-h,h=0),a=a.slice(0,h),!r&&!a&&!f&&!o&&!u&&!l?"":(w=!0,a&&!o&&!u&&!f&&!l||S?t.onTextInput(a):t.onTextInput(a,{extendLeft:o,extendRight:u,restoreStart:f,restoreEnd:l}),w=!1,T=e,N=i,C=s,k=l,a)},B=function(e){if(b)return z();if(e&&e.inputType){if(e.inputType=="historyUndo")return t.execCommand("undo");if(e.inputType=="historyRedo")return t.execCommand("redo")}var r=n.value,i=H(r,!0);(r.length>c+100||v.test(i)||m&&N<1&&N==C)&&O()},j=function(e,t,n){var r=e.clipboardData||window.clipboardData;if(!r||a)return;var i=f||n?"Text":"text/plain";try{return t?r.setData(i,t)!==!1:r.getData(i)}catch(e){if(!n)return j(e,t,!0)}},F=function(e,i){var s=t.getCopyText();if(!s)return r.preventDefault(e);j(e,s)?(d&&(O(s),g=s,setTimeout(function(){g=!1},10)),i?t.onCut():t.onCopy(),r.preventDefault(e)):(g=!0,n.value=s,n.select(),setTimeout(function(){g=!1,O(),i?t.onCut():t.onCopy()}))},I=function(e){F(e,!0)},q=function(e){F(e,!1)},R=function(e){var s=j(e);if(u.pasteCancelled())return;typeof s=="string"?(s&&t.onPaste(s,e),i.isIE&&setTimeout(O),r.preventDefault(e)):(n.value="",y=!0)};r.addCommandKeyListener(n,t.onCommandKey.bind(t),t),r.addListener(n,"select",_,t),r.addListener(n,"input",B,t),r.addListener(n,"cut",I,t),r.addListener(n,"copy",q,t),r.addListener(n,"paste",R,t),(!("oncut"in n)||!("oncopy"in n)||!("onpaste"in n))&&r.addListener(e,"keydown",function(e){if(i.isMac&&!e.metaKey||!e.ctrlKey)return;switch(e.keyCode){case 67:q(e);break;case 86:R(e);break;case 88:I(e)}},t);var U=function(e){if(b||!t.onCompositionStart||t.$readOnly)return;b={};if(S)return;e.data&&(b.useTextareaForIME=!1),setTimeout(z,0),t._signal("compositionStart"),t.on("mousedown",X);var r=t.getSelectionRange();r.end.row=r.start.row,r.end.column=r.start.column,b.markerRange=r,b.selectionStart=N,t.onCompositionStart(b),b.useTextareaForIME?(T=n.value="",N=0,C=0):(n.msGetInputContext&&(b.context=n.msGetInputContext()),n.getInputContext&&(b.context=n.getInputContext()))},z=function(){if(!b||!t.onCompositionUpdate||t.$readOnly)return;if(S)return X();if(b.useTextareaForIME)t.onCompositionUpdate(n.value);else{var e=n.value;H(e),b.markerRange&&(b.context&&(b.markerRange.start.column=b.selectionStart=b.context.compositionStartOffset),b.markerRange.end.column=b.markerRange.start.column+C-b.selectionStart+k)}},W=function(e){if(!t.onCompositionEnd||t.$readOnly)return;b=!1,t.onCompositionEnd(),t.off("mousedown",X),e&&B()},V=o.delayedCall(z,50).schedule.bind(null,null);r.addListener(n,"compositionstart",U,t),r.addListener(n,"compositionupdate",z,t),r.addListener(n,"keyup",$,t),r.addListener(n,"keydown",V,t),r.addListener(n,"compositionend",W,t),this.getElement=function(){return n},this.setCommandMode=function(e){S=e,n.readOnly=!1},this.setReadOnly=function(e){S||(n.readOnly=e)},this.setCopyWithEmptySelection=function(e){},this.onContextMenu=function(e){P=!0,O(),t._emit("nativecontextmenu",{target:t,domEvent:e}),this.moveToMouse(e,!0)},this.moveToMouse=function(e,o){E||(E=n.style.cssText),n.style.cssText=(o?"z-index:100000;":"")+(i.isIE?"opacity:0.1;":"")+"text-indent: -"+(N+C)*t.renderer.characterWidth*.5+"px;";var u=t.container.getBoundingClientRect(),a=s.computedStyle(t.container),f=u.top+(parseInt(a.borderTopWidth)||0),l=u.left+(parseInt(u.borderLeftWidth)||0),c=u.bottom-f-n.clientHeight-2,h=function(e){s.translate(n,e.clientX-l-2,Math.min(e.clientY-f-2,c))};h(e);if(e.type!="mousedown")return;t.renderer.$isMousePressed=!0,clearTimeout(J),i.isWin&&r.capture(t.container,h,K)},this.onContextMenuClose=K;var J,Q=function(e){t.textInput.onContextMenu(e),K()};r.addListener(n,"mouseup",Q,t),r.addListener(n,"mousedown",function(e){e.preventDefault(),K()},t),r.addListener(t.renderer.scroller,"contextmenu",Q,t),r.addListener(n,"contextmenu",Q,t),d&&G(e,t,n)};t.TextInput=g,t.$setUserAgentForTests=function(e,t){m=e,d=t}}),define("ace/mouse/default_handlers",["require","exports","module","ace/lib/useragent"],function(e,t,n){"use strict";function o(e){e.$clickSelection=null;var t=e.editor;t.setDefaultHandler("mousedown",this.onMouseDown.bind(e)),t.setDefaultHandler("dblclick",this.onDoubleClick.bind(e)),t.setDefaultHandler("tripleclick",this.onTripleClick.bind(e)),t.setDefaultHandler("quadclick",this.onQuadClick.bind(e)),t.setDefaultHandler("mousewheel",this.onMouseWheel.bind(e));var n=["select","startSelect","selectEnd","selectAllEnd","selectByWordsEnd","selectByLinesEnd","dragWait","dragWaitEnd","focusWait"];n.forEach(function(t){e[t]=this[t]},this),e.selectByLines=this.extendSelectionBy.bind(e,"getLineRange"),e.selectByWords=this.extendSelectionBy.bind(e,"getWordRange")}function u(e,t,n,r){return Math.sqrt(Math.pow(n-e,2)+Math.pow(r-t,2))}function a(e,t){if(e.start.row==e.end.row)var n=2*t.column-e.start.column-e.end.column;else if(e.start.row==e.end.row-1&&!e.start.column&&!e.end.column)var n=t.column-4;else var n=2*t.row-e.start.row-e.end.row;return n<0?{cursor:e.start,anchor:e.end}:{cursor:e.end,anchor:e.start}}var r=e("../lib/useragent"),i=0,s=550;(function(){this.onMouseDown=function(e){var t=e.inSelection(),n=e.getDocumentPosition();this.mousedownEvent=e;var i=this.editor,s=e.getButton();if(s!==0){var o=i.getSelectionRange(),u=o.isEmpty();(u||s==1)&&i.selection.moveToPosition(n),s==2&&(i.textInput.onContextMenu(e.domEvent),r.isMozilla||e.preventDefault());return}this.mousedownEvent.time=Date.now();if(t&&!i.isFocused()){i.focus();if(this.$focusTimeout&&!this.$clickSelection&&!i.inMultiSelectMode){this.setState("focusWait"),this.captureMouse(e);return}}return this.captureMouse(e),this.startSelect(n,e.domEvent._clicks>1),e.preventDefault()},this.startSelect=function(e,t){e=e||this.editor.renderer.screenToTextCoordinates(this.x,this.y);var n=this.editor;if(!this.mousedownEvent)return;this.mousedownEvent.getShiftKey()?n.selection.selectToPosition(e):t||n.selection.moveToPosition(e),t||this.select(),n.renderer.scroller.setCapture&&n.renderer.scroller.setCapture(),n.setStyle("ace_selecting"),this.setState("select")},this.select=function(){var e,t=this.editor,n=t.renderer.screenToTextCoordinates(this.x,this.y);if(this.$clickSelection){var r=this.$clickSelection.comparePoint(n);if(r==-1)e=this.$clickSelection.end;else if(r==1)e=this.$clickSelection.start;else{var i=a(this.$clickSelection,n);n=i.cursor,e=i.anchor}t.selection.setSelectionAnchor(e.row,e.column)}t.selection.selectToPosition(n),t.renderer.scrollCursorIntoView()},this.extendSelectionBy=function(e){var t,n=this.editor,r=n.renderer.screenToTextCoordinates(this.x,this.y),i=n.selection[e](r.row,r.column);if(this.$clickSelection){var s=this.$clickSelection.comparePoint(i.start),o=this.$clickSelection.comparePoint(i.end);if(s==-1&&o<=0){t=this.$clickSelection.end;if(i.end.row!=r.row||i.end.column!=r.column)r=i.start}else if(o==1&&s>=0){t=this.$clickSelection.start;if(i.start.row!=r.row||i.start.column!=r.column)r=i.end}else if(s==-1&&o==1)r=i.end,t=i.start;else{var u=a(this.$clickSelection,r);r=u.cursor,t=u.anchor}n.selection.setSelectionAnchor(t.row,t.column)}n.selection.selectToPosition(r),n.renderer.scrollCursorIntoView()},this.selectEnd=this.selectAllEnd=this.selectByWordsEnd=this.selectByLinesEnd=function(){this.$clickSelection=null,this.editor.unsetStyle("ace_selecting"),this.editor.renderer.scroller.releaseCapture&&this.editor.renderer.scroller.releaseCapture()},this.focusWait=function(){var e=u(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y),t=Date.now();(e>i||t-this.mousedownEvent.time>this.$focusTimeout)&&this.startSelect(this.mousedownEvent.getDocumentPosition())},this.onDoubleClick=function(e){var t=e.getDocumentPosition(),n=this.editor,r=n.session,i=r.getBracketRange(t);i?(i.isEmpty()&&(i.start.column--,i.end.column++),this.setState("select")):(i=n.selection.getWordRange(t.row,t.column),this.setState("selectByWords")),this.$clickSelection=i,this.select()},this.onTripleClick=function(e){var t=e.getDocumentPosition(),n=this.editor;this.setState("selectByLines");var r=n.getSelectionRange();r.isMultiLine()&&r.contains(t.row,t.column)?(this.$clickSelection=n.selection.getLineRange(r.start.row),this.$clickSelection.end=n.selection.getLineRange(r.end.row).end):this.$clickSelection=n.selection.getLineRange(t.row),this.select()},this.onQuadClick=function(e){var t=this.editor;t.selectAll(),this.$clickSelection=t.getSelectionRange(),this.setState("selectAll")},this.onMouseWheel=function(e){if(e.getAccelKey())return;e.getShiftKey()&&e.wheelY&&!e.wheelX&&(e.wheelX=e.wheelY,e.wheelY=0);var t=this.editor;this.$lastScroll||(this.$lastScroll={t:0,vx:0,vy:0,allowed:0});var n=this.$lastScroll,r=e.domEvent.timeStamp,i=r-n.t,o=i?e.wheelX/i:n.vx,u=i?e.wheelY/i:n.vy;i=1&&t.renderer.isScrollableBy(e.wheelX*e.speed,0)&&(f=!0),a<=1&&t.renderer.isScrollableBy(0,e.wheelY*e.speed)&&(f=!0);if(f)n.allowed=r;else if(r-n.allowedt.session.documentToScreenRow(l.row,l.column))return c()}if(f==s)return;f=s.text.join("
"),i.setHtml(f),i.show(),t._signal("showGutterTooltip",i),t.on("mousewheel",c);if(e.$tooltipFollowsMouse)h(u);else{var p=u.domEvent.target,d=p.getBoundingClientRect(),v=i.getElement().style;v.left=d.right+"px",v.top=d.bottom+"px"}}function c(){o&&(o=clearTimeout(o)),f&&(i.hide(),f=null,t._signal("hideGutterTooltip",i),t.off("mousewheel",c))}function h(e){i.setPosition(e.x,e.y)}var t=e.editor,n=t.renderer.$gutterLayer,i=new a(t.container);e.editor.setDefaultHandler("guttermousedown",function(r){if(!t.isFocused()||r.getButton()!=0)return;var i=n.getRegion(r);if(i=="foldWidgets")return;var s=r.getDocumentPosition().row,o=t.session.selection;if(r.getShiftKey())o.selectTo(s,0);else{if(r.domEvent.detail==2)return t.selectAll(),r.preventDefault();e.$clickSelection=t.selection.getLineRange(s)}return e.setState("selectByLines"),e.captureMouse(r),r.preventDefault()});var o,u,f;e.editor.setDefaultHandler("guttermousemove",function(t){var n=t.domEvent.target||t.domEvent.srcElement;if(r.hasCssClass(n,"ace_fold-widget"))return c();f&&e.$tooltipFollowsMouse&&h(t),u=t;if(o)return;o=setTimeout(function(){o=null,u&&!e.isMousePressed?l():c()},50)}),s.addListener(t.renderer.$gutter,"mouseout",function(e){u=null;if(!f||o)return;o=setTimeout(function(){o=null,c()},50)},t),t.on("changeSession",c)}function a(e){o.call(this,e)}var r=e("../lib/dom"),i=e("../lib/oop"),s=e("../lib/event"),o=e("../tooltip").Tooltip;i.inherits(a,o),function(){this.setPosition=function(e,t){var n=window.innerWidth||document.documentElement.clientWidth,r=window.innerHeight||document.documentElement.clientHeight,i=this.getWidth(),s=this.getHeight();e+=15,t+=15,e+i>n&&(e-=e+i-n),t+s>r&&(t-=20+s),o.prototype.setPosition.call(this,e,t)}}.call(a.prototype),t.GutterHandler=u}),define("ace/mouse/mouse_event",["require","exports","module","ace/lib/event","ace/lib/useragent"],function(e,t,n){"use strict";var r=e("../lib/event"),i=e("../lib/useragent"),s=t.MouseEvent=function(e,t){this.domEvent=e,this.editor=t,this.x=this.clientX=e.clientX,this.y=this.clientY=e.clientY,this.$pos=null,this.$inSelection=null,this.propagationStopped=!1,this.defaultPrevented=!1};(function(){this.stopPropagation=function(){r.stopPropagation(this.domEvent),this.propagationStopped=!0},this.preventDefault=function(){r.preventDefault(this.domEvent),this.defaultPrevented=!0},this.stop=function(){this.stopPropagation(),this.preventDefault()},this.getDocumentPosition=function(){return this.$pos?this.$pos:(this.$pos=this.editor.renderer.screenToTextCoordinates(this.clientX,this.clientY),this.$pos)},this.inSelection=function(){if(this.$inSelection!==null)return this.$inSelection;var e=this.editor,t=e.getSelectionRange();if(t.isEmpty())this.$inSelection=!1;else{var n=this.getDocumentPosition();this.$inSelection=t.contains(n.row,n.column)}return this.$inSelection},this.getButton=function(){return r.getButton(this.domEvent)},this.getShiftKey=function(){return this.domEvent.shiftKey},this.getAccelKey=i.isMac?function(){return this.domEvent.metaKey}:function(){return this.domEvent.ctrlKey}}).call(s.prototype)}),define("ace/mouse/dragdrop_handler",["require","exports","module","ace/lib/dom","ace/lib/event","ace/lib/useragent"],function(e,t,n){"use strict";function f(e){function T(e,n){var r=Date.now(),i=!n||e.row!=n.row,s=!n||e.column!=n.column;if(!S||i||s)t.moveCursorToPosition(e),S=r,x={x:p,y:d};else{var o=l(x.x,x.y,p,d);o>a?S=null:r-S>=u&&(t.renderer.scrollCursorIntoView(),S=null)}}function N(e,n){var r=Date.now(),i=t.renderer.layerConfig.lineHeight,s=t.renderer.layerConfig.characterWidth,u=t.renderer.scroller.getBoundingClientRect(),a={x:{left:p-u.left,right:u.right-p},y:{top:d-u.top,bottom:u.bottom-d}},f=Math.min(a.x.left,a.x.right),l=Math.min(a.y.top,a.y.bottom),c={row:e.row,column:e.column};f/s<=2&&(c.column+=a.x.left=o&&t.renderer.scrollCursorIntoView(c):E=r:E=null}function C(){var e=g;g=t.renderer.screenToTextCoordinates(p,d),T(g,e),N(g,e)}function k(){m=t.selection.toOrientedRange(),h=t.session.addMarker(m,"ace_selection",t.getSelectionStyle()),t.clearSelection(),t.isFocused()&&t.renderer.$cursorLayer.setBlinking(!1),clearInterval(v),C(),v=setInterval(C,20),y=0,i.addListener(document,"mousemove",O)}function L(){clearInterval(v),t.session.removeMarker(h),h=null,t.selection.fromOrientedRange(m),t.isFocused()&&!w&&t.$resetCursorStyle(),m=null,g=null,y=0,E=null,S=null,i.removeListener(document,"mousemove",O)}function O(){A==null&&(A=setTimeout(function(){A!=null&&h&&L()},20))}function M(e){var t=e.types;return!t||Array.prototype.some.call(t,function(e){return e=="text/plain"||e=="Text"})}function _(e){var t=["copy","copymove","all","uninitialized"],n=["move","copymove","linkmove","all","uninitialized"],r=s.isMac?e.altKey:e.ctrlKey,i="uninitialized";try{i=e.dataTransfer.effectAllowed.toLowerCase()}catch(e){}var o="none";return r&&t.indexOf(i)>=0?o="copy":n.indexOf(i)>=0?o="move":t.indexOf(i)>=0&&(o="copy"),o}var t=e.editor,n=r.createElement("img");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",s.isOpera&&(n.style.cssText="width:1px;height:1px;position:fixed;top:0;left:0;z-index:2147483647;opacity:0;");var f=["dragWait","dragWaitEnd","startDrag","dragReadyEnd","onMouseDrag"];f.forEach(function(t){e[t]=this[t]},this),t.on("mousedown",this.onMouseDown.bind(e));var c=t.container,h,p,d,v,m,g,y=0,b,w,E,S,x;this.onDragStart=function(e){if(this.cancelDrag||!c.draggable){var r=this;return setTimeout(function(){r.startSelect(),r.captureMouse(e)},0),e.preventDefault()}m=t.getSelectionRange();var i=e.dataTransfer;i.effectAllowed=t.getReadOnly()?"copy":"copyMove",s.isOpera&&(t.container.appendChild(n),n.scrollTop=0),i.setDragImage&&i.setDragImage(n,0,0),s.isOpera&&t.container.removeChild(n),i.clearData(),i.setData("Text",t.session.getTextRange()),w=!0,this.setState("drag")},this.onDragEnd=function(e){c.draggable=!1,w=!1,this.setState(null);if(!t.getReadOnly()){var n=e.dataTransfer.dropEffect;!b&&n=="move"&&t.session.remove(t.getSelectionRange()),t.$resetCursorStyle()}this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle("")},this.onDragEnter=function(e){if(t.getReadOnly()||!M(e.dataTransfer))return;return p=e.clientX,d=e.clientY,h||k(),y++,e.dataTransfer.dropEffect=b=_(e),i.preventDefault(e)},this.onDragOver=function(e){if(t.getReadOnly()||!M(e.dataTransfer))return;return p=e.clientX,d=e.clientY,h||(k(),y++),A!==null&&(A=null),e.dataTransfer.dropEffect=b=_(e),i.preventDefault(e)},this.onDragLeave=function(e){y--;if(y<=0&&h)return L(),b=null,i.preventDefault(e)},this.onDrop=function(e){if(!g)return;var n=e.dataTransfer;if(w)switch(b){case"move":m.contains(g.row,g.column)?m={start:g,end:g}:m=t.moveText(m,g);break;case"copy":m=t.moveText(m,g,!0)}else{var r=n.getData("Text");m={start:g,end:t.session.insert(g,r)},t.focus(),b=null}return L(),i.preventDefault(e)},i.addListener(c,"dragstart",this.onDragStart.bind(e),t),i.addListener(c,"dragend",this.onDragEnd.bind(e),t),i.addListener(c,"dragenter",this.onDragEnter.bind(e),t),i.addListener(c,"dragover",this.onDragOver.bind(e),t),i.addListener(c,"dragleave",this.onDragLeave.bind(e),t),i.addListener(c,"drop",this.onDrop.bind(e),t);var A=null}function l(e,t,n,r){return Math.sqrt(Math.pow(n-e,2)+Math.pow(r-t,2))}var r=e("../lib/dom"),i=e("../lib/event"),s=e("../lib/useragent"),o=200,u=200,a=5;(function(){this.dragWait=function(){var e=Date.now()-this.mousedownEvent.time;e>this.editor.getDragDelay()&&this.startDrag()},this.dragWaitEnd=function(){var e=this.editor.container;e.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()),this.selectEnd()},this.dragReadyEnd=function(e){this.editor.$resetCursorStyle(),this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle(""),this.dragWaitEnd()},this.startDrag=function(){this.cancelDrag=!1;var e=this.editor,t=e.container;t.draggable=!0,e.renderer.$cursorLayer.setBlinking(!1),e.setStyle("ace_dragging");var n=s.isWin?"default":"move";e.renderer.setCursorStyle(n),this.setState("dragReady")},this.onMouseDrag=function(e){var t=this.editor.container;if(s.isIE&&this.state=="dragReady"){var n=l(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y);n>3&&t.dragDrop()}if(this.state==="dragWait"){var n=l(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y);n>0&&(t.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()))}},this.onMouseDown=function(e){if(!this.$dragEnabled)return;this.mousedownEvent=e;var t=this.editor,n=e.inSelection(),r=e.getButton(),i=e.domEvent.detail||1;if(i===1&&r===0&&n){if(e.editor.inMultiSelectMode&&(e.getAccelKey()||e.getShiftKey()))return;this.mousedownEvent.time=Date.now();var o=e.domEvent.target||e.domEvent.srcElement;"unselectable"in o&&(o.unselectable="on");if(t.getDragDelay()){if(s.isWebKit){this.cancelDrag=!0;var u=t.container;u.draggable=!0}this.setState("dragWait")}else this.startDrag();this.captureMouse(e,this.onMouseDrag.bind(this)),e.defaultPrevented=!0}}}).call(f.prototype),t.DragdropHandler=f}),define("ace/mouse/touch_handler",["require","exports","module","ace/mouse/mouse_event","ace/lib/event","ace/lib/dom"],function(e,t,n){"use strict";var r=e("./mouse_event").MouseEvent,i=e("../lib/event"),s=e("../lib/dom");t.addTouchListeners=function(e,t){function b(){var e=window.navigator&&window.navigator.clipboard,r=!1,i=function(){var n=t.getCopyText(),i=t.session.getUndoManager().hasUndo();y.replaceChild(s.buildDom(r?["span",!n&&["span",{"class":"ace_mobile-button",action:"selectall"},"Select All"],n&&["span",{"class":"ace_mobile-button",action:"copy"},"Copy"],n&&["span",{"class":"ace_mobile-button",action:"cut"},"Cut"],e&&["span",{"class":"ace_mobile-button",action:"paste"},"Paste"],i&&["span",{"class":"ace_mobile-button",action:"undo"},"Undo"],["span",{"class":"ace_mobile-button",action:"find"},"Find"],["span",{"class":"ace_mobile-button",action:"openCommandPallete"},"Pallete"]]:["span"]),y.firstChild)},o=function(n){var s=n.target.getAttribute("action");if(s=="more"||!r)return r=!r,i();if(s=="paste")e.readText().then(function(e){t.execCommand(s,e)});else if(s){if(s=="cut"||s=="copy")e?e.writeText(t.getCopyText()):document.execCommand("copy");t.execCommand(s)}y.firstChild.style.display="none",r=!1,s!="openCommandPallete"&&t.focus()};y=s.buildDom(["div",{"class":"ace_mobile-menu",ontouchstart:function(e){n="menu",e.stopPropagation(),e.preventDefault(),t.textInput.focus()},ontouchend:function(e){e.stopPropagation(),e.preventDefault(),o(e)},onclick:o},["span"],["span",{"class":"ace_mobile-button",action:"more"},"..."]],t.container)}function w(){y||b();var e=t.selection.cursor,n=t.renderer.textToScreenCoordinates(e.row,e.column),r=t.container.getBoundingClientRect();y.style.top=n.pageY-r.top-3+"px",y.style.right="10px",y.style.display="",y.firstChild.style.display="none",t.on("input",E)}function E(e){y&&(y.style.display="none"),t.off("input",E)}function S(){l=null,clearTimeout(l);var e=t.selection.getRange(),r=e.contains(p.row,p.column);if(e.isEmpty()||!r)t.selection.moveToPosition(p),t.selection.selectWord();n="wait",w()}function x(){l=null,clearTimeout(l),t.selection.moveToPosition(p);var e=d>=2?t.selection.getLineRange(p.row):t.session.getBracketRange(p);e&&!e.isEmpty()?t.selection.setRange(e):t.selection.selectWord(),n="wait"}function T(){h+=60,c=setInterval(function(){h--<=0&&(clearInterval(c),c=null),Math.abs(v)<.01&&(v=0),Math.abs(m)<.01&&(m=0),h<20&&(v=.9*v),h<20&&(m=.9*m);var e=t.session.getScrollTop();t.renderer.scrollBy(10*v,10*m),e==t.session.getScrollTop()&&(h=0)},10)}var n="scroll",o,u,a,f,l,c,h=0,p,d=0,v=0,m=0,g,y;i.addListener(e,"contextmenu",function(e){if(!g)return;var n=t.textInput.getElement();n.focus()},t),i.addListener(e,"touchstart",function(e){var i=e.touches;if(l||i.length>1){clearTimeout(l),l=null,a=-1,n="zoom";return}g=t.$mouseHandler.isMousePressed=!0;var s=t.renderer.layerConfig.lineHeight,c=t.renderer.layerConfig.lineHeight,y=e.timeStamp;f=y;var b=i[0],w=b.clientX,E=b.clientY;Math.abs(o-w)+Math.abs(u-E)>s&&(a=-1),o=e.clientX=w,u=e.clientY=E,v=m=0;var T=new r(e,t);p=T.getDocumentPosition();if(y-a<500&&i.length==1&&!h)d++,e.preventDefault(),e.button=0,x();else{d=0;var N=t.selection.cursor,C=t.selection.isEmpty()?N:t.selection.anchor,k=t.renderer.$cursorLayer.getPixelPosition(N,!0),L=t.renderer.$cursorLayer.getPixelPosition(C,!0),A=t.renderer.scroller.getBoundingClientRect(),O=function(e,t){return e/=c,t=t/s-.75,e*e+t*t};if(e.clientX_?"cursor":"anchor"),_<3.5?n="anchor":M<3.5?n="cursor":n="scroll",l=setTimeout(S,450)}a=y},t),i.addListener(e,"touchend",function(e){g=t.$mouseHandler.isMousePressed=!1,c&&clearInterval(c),n=="zoom"?(n="",h=0):l?(t.selection.moveToPosition(p),h=0,w()):n=="scroll"?(T(),E()):w(),clearTimeout(l),l=null},t),i.addListener(e,"touchmove",function(e){l&&(clearTimeout(l),l=null);var i=e.touches;if(i.length>1||n=="zoom")return;var s=i[0],a=o-s.clientX,c=u-s.clientY;if(n=="wait"){if(!(a*a+c*c>4))return e.preventDefault();n="cursor"}o=s.clientX,u=s.clientY,e.clientX=s.clientX,e.clientY=s.clientY;var h=e.timeStamp,p=h-f;f=h;if(n=="scroll"){var d=new r(e,t);d.speed=1,d.wheelX=a,d.wheelY=c,10*Math.abs(a)1&&(i=n[n.length-2]);var o=a[t+"Path"];return o==null?o=a.basePath:r=="/"&&(t=r=""),o&&o.slice(-1)!="/"&&(o+="/"),o+t+r+i+this.get("suffix")},t.setModuleUrl=function(e,t){return a.$moduleUrls[e]=t},t.$loading={},t.loadModule=function(n,r){var i,o;Array.isArray(n)&&(o=n[0],n=n[1]);try{i=e(n)}catch(u){}if(i&&!t.$loading[n])return r&&r(i);t.$loading[n]||(t.$loading[n]=[]),t.$loading[n].push(r);if(t.$loading[n].length>1)return;var a=function(){e([n],function(e){t._emit("load.module",{name:n,module:e});var r=t.$loading[n];t.$loading[n]=null,r.forEach(function(t){t&&t(e)})})};if(!t.get("packaged"))return a();s.loadScript(t.moduleUrl(n,o),a),f()};var f=function(){!a.basePath&&!a.workerPath&&!a.modePath&&!a.themePath&&!Object.keys(a.$moduleUrls).length&&(console.error("Unable to infer path to ace from script src,","use ace.config.set('basePath', 'path') to enable dynamic loading of modes and themes","or with webpack use ace/webpack-resolver"),f=function(){})};t.init=l,t.version="1.4.10"}),define("ace/mouse/mouse_handler",["require","exports","module","ace/lib/event","ace/lib/useragent","ace/mouse/default_handlers","ace/mouse/default_gutter_handler","ace/mouse/mouse_event","ace/mouse/dragdrop_handler","ace/mouse/touch_handler","ace/config"],function(e,t,n){"use strict";var r=e("../lib/event"),i=e("../lib/useragent"),s=e("./default_handlers").DefaultHandlers,o=e("./default_gutter_handler").GutterHandler,u=e("./mouse_event").MouseEvent,a=e("./dragdrop_handler").DragdropHandler,f=e("./touch_handler").addTouchListeners,l=e("../config"),c=function(e){var t=this;this.editor=e,new s(this),new o(this),new a(this);var n=function(t){var n=!document.hasFocus||!document.hasFocus()||!e.isFocused()&&document.activeElement==(e.textInput&&e.textInput.getElement());n&&window.focus(),e.focus()},u=e.renderer.getMouseEventTarget();r.addListener(u,"click",this.onMouseEvent.bind(this,"click"),e),r.addListener(u,"mousemove",this.onMouseMove.bind(this,"mousemove"),e),r.addMultiMouseDownListener([u,e.renderer.scrollBarV&&e.renderer.scrollBarV.inner,e.renderer.scrollBarH&&e.renderer.scrollBarH.inner,e.textInput&&e.textInput.getElement()].filter(Boolean),[400,300,250],this,"onMouseEvent",e),r.addMouseWheelListener(e.container,this.onMouseWheel.bind(this,"mousewheel"),e),f(e.container,e);var l=e.renderer.$gutter;r.addListener(l,"mousedown",this.onMouseEvent.bind(this,"guttermousedown"),e),r.addListener(l,"click",this.onMouseEvent.bind(this,"gutterclick"),e),r.addListener(l,"dblclick",this.onMouseEvent.bind(this,"gutterdblclick"),e),r.addListener(l,"mousemove",this.onMouseEvent.bind(this,"guttermousemove"),e),r.addListener(u,"mousedown",n,e),r.addListener(l,"mousedown",n,e),i.isIE&&e.renderer.scrollBarV&&(r.addListener(e.renderer.scrollBarV.element,"mousedown",n,e),r.addListener(e.renderer.scrollBarH.element,"mousedown",n,e)),e.on("mousemove",function(n){if(t.state||t.$dragDelay||!t.$dragEnabled)return;var r=e.renderer.screenToTextCoordinates(n.x,n.y),i=e.session.selection.getRange(),s=e.renderer;!i.isEmpty()&&i.insideStart(r.row,r.column)?s.setCursorStyle("default"):s.setCursorStyle("")},e)};(function(){this.onMouseEvent=function(e,t){this.editor._emit(e,new u(t,this.editor))},this.onMouseMove=function(e,t){var n=this.editor._eventRegistry&&this.editor._eventRegistry.mousemove;if(!n||!n.length)return;this.editor._emit(e,new u(t,this.editor))},this.onMouseWheel=function(e,t){var n=new u(t,this.editor);n.speed=this.$scrollSpeed*2,n.wheelX=t.wheelX,n.wheelY=t.wheelY,this.editor._emit(e,n)},this.setState=function(e){this.state=e},this.captureMouse=function(e,t){this.x=e.x,this.y=e.y,this.isMousePressed=!0;var n=this.editor,s=this.editor.renderer;s.$isMousePressed=!0;var o=this,a=function(e){if(!e)return;if(i.isWebKit&&!e.which&&o.releaseMouse)return o.releaseMouse();o.x=e.clientX,o.y=e.clientY,t&&t(e),o.mouseEvent=new u(e,o.editor),o.$mouseMoved=!0},f=function(e){n.off("beforeEndOperation",c),clearInterval(h),l(),o[o.state+"End"]&&o[o.state+"End"](e),o.state="",o.isMousePressed=s.$isMousePressed=!1,s.$keepTextAreaAtCursor&&s.$moveTextAreaToCursor(),o.$onCaptureMouseMove=o.releaseMouse=null,e&&o.onMouseEvent("mouseup",e),n.endOperation()},l=function(){o[o.state]&&o[o.state](),o.$mouseMoved=!1};if(i.isOldIE&&e.domEvent.type=="dblclick")return setTimeout(function(){f(e)});var c=function(e){if(!o.releaseMouse)return;n.curOp.command.name&&n.curOp.selectionChanged&&(o[o.state+"End"]&&o[o.state+"End"](),o.state="",o.releaseMouse())};n.on("beforeEndOperation",c),n.startOperation({command:{name:"mouse"}}),o.$onCaptureMouseMove=a,o.releaseMouse=r.capture(this.editor.container,a,f);var h=setInterval(l,20)},this.releaseMouse=null,this.cancelContextMenu=function(){var e=function(t){if(t&&t.domEvent&&t.domEvent.type!="contextmenu")return;this.editor.off("nativecontextmenu",e),t&&t.domEvent&&r.stopEvent(t.domEvent)}.bind(this);setTimeout(e,10),this.editor.on("nativecontextmenu",e)}}).call(c.prototype),l.defineOptions(c.prototype,"mouseHandler",{scrollSpeed:{initialValue:2},dragDelay:{initialValue:i.isMac?150:0},dragEnabled:{initialValue:!0},focusTimeout:{initialValue:0},tooltipFollowsMouse:{initialValue:!0}}),t.MouseHandler=c}),define("ace/mouse/fold_handler",["require","exports","module","ace/lib/dom"],function(e,t,n){"use strict";function i(e){e.on("click",function(t){var n=t.getDocumentPosition(),i=e.session,s=i.getFoldAt(n.row,n.column,1);s&&(t.getAccelKey()?i.removeFold(s):i.expandFold(s),t.stop());var o=t.domEvent&&t.domEvent.target;o&&r.hasCssClass(o,"ace_inline_button")&&r.hasCssClass(o,"ace_toggle_wrap")&&(i.setOption("wrap",!i.getUseWrapMode()),e.renderer.scrollCursorIntoView())}),e.on("gutterclick",function(t){var n=e.renderer.$gutterLayer.getRegion(t);if(n=="foldWidgets"){var r=t.getDocumentPosition().row,i=e.session;i.foldWidgets&&i.foldWidgets[r]&&e.session.onFoldWidgetClick(r,t),e.isFocused()||e.focus(),t.stop()}}),e.on("gutterdblclick",function(t){var n=e.renderer.$gutterLayer.getRegion(t);if(n=="foldWidgets"){var r=t.getDocumentPosition().row,i=e.session,s=i.getParentFoldRangeData(r,!0),o=s.range||s.firstRange;if(o){r=o.start.row;var u=i.getFoldAt(r,i.getLine(r).length,1);u?i.removeFold(u):(i.addFold("...",o),e.renderer.scrollCursorIntoView({row:o.start.row,column:0}))}t.stop()}})}var r=e("../lib/dom");t.FoldHandler=i}),define("ace/keyboard/keybinding",["require","exports","module","ace/lib/keys","ace/lib/event"],function(e,t,n){"use strict";var r=e("../lib/keys"),i=e("../lib/event"),s=function(e){this.$editor=e,this.$data={editor:e},this.$handlers=[],this.setDefaultHandler(e.commands)};(function(){this.setDefaultHandler=function(e){this.removeKeyboardHandler(this.$defaultHandler),this.$defaultHandler=e,this.addKeyboardHandler(e,0)},this.setKeyboardHandler=function(e){var t=this.$handlers;if(t[t.length-1]==e)return;while(t[t.length-1]&&t[t.length-1]!=this.$defaultHandler)this.removeKeyboardHandler(t[t.length-1]);this.addKeyboardHandler(e,1)},this.addKeyboardHandler=function(e,t){if(!e)return;typeof e=="function"&&!e.handleKeyboard&&(e.handleKeyboard=e);var n=this.$handlers.indexOf(e);n!=-1&&this.$handlers.splice(n,1),t==undefined?this.$handlers.push(e):this.$handlers.splice(t,0,e),n==-1&&e.attach&&e.attach(this.$editor)},this.removeKeyboardHandler=function(e){var t=this.$handlers.indexOf(e);return t==-1?!1:(this.$handlers.splice(t,1),e.detach&&e.detach(this.$editor),!0)},this.getKeyboardHandler=function(){return this.$handlers[this.$handlers.length-1]},this.getStatusText=function(){var e=this.$data,t=e.editor;return this.$handlers.map(function(n){return n.getStatusText&&n.getStatusText(t,e)||""}).filter(Boolean).join(" ")},this.$callKeyboardHandlers=function(e,t,n,r){var s,o=!1,u=this.$editor.commands;for(var a=this.$handlers.length;a--;){s=this.$handlers[a].handleKeyboard(this.$data,e,t,n,r);if(!s||!s.command)continue;s.command=="null"?o=!0:o=u.exec(s.command,this.$editor,s.args,r),o&&r&&e!=-1&&s.passEvent!=1&&s.command.passEvent!=1&&i.stopEvent(r);if(o)break}return!o&&e==-1&&(s={command:"insertstring"},o=u.exec("insertstring",this.$editor,t)),o&&this.$editor._signal&&this.$editor._signal("keyboardActivity",s),o},this.onCommandKey=function(e,t,n){var i=r.keyCodeToString(n);return this.$callKeyboardHandlers(t,i,n,e)},this.onTextInput=function(e){return this.$callKeyboardHandlers(-1,e)}}).call(s.prototype),t.KeyBinding=s}),define("ace/lib/bidiutil",["require","exports","module"],function(e,t,n){"use strict";function F(e,t,n,r){var i=s?d:p,c=null,h=null,v=null,m=0,g=null,y=null,b=-1,w=null,E=null,T=[];if(!r)for(w=0,r=[];w0)if(g==16){for(w=b;w-1){for(w=b;w=0;C--){if(r[C]!=N)break;t[C]=s}}}function I(e,t,n){if(o=e){u=i+1;while(u=e)u++;for(a=i,l=u-1;a=t.length||(o=n[r-1])!=b&&o!=w||(c=t[r+1])!=b&&c!=w)return E;return u&&(c=w),c==o?c:E;case k:o=r>0?n[r-1]:S;if(o==b&&r+10&&n[r-1]==b)return b;if(u)return E;p=r+1,h=t.length;while(p=1425&&d<=2303||d==64286;o=t[p];if(v&&(o==y||o==T))return y}if(r<1||(o=t[r-1])==S)return E;return n[r-1];case S:return u=!1,f=!0,s;case x:return l=!0,E;case O:case M:case D:case P:case _:u=!1;case H:return E}}function R(e){var t=e.charCodeAt(0),n=t>>8;return n==0?t>191?g:B[t]:n==5?/[\u0591-\u05f4]/.test(e)?y:g:n==6?/[\u0610-\u061a\u064b-\u065f\u06d6-\u06e4\u06e7-\u06ed]/.test(e)?A:/[\u0660-\u0669\u066b-\u066c]/.test(e)?w:t==1642?L:/[\u06f0-\u06f9]/.test(e)?b:T:n==32&&t<=8287?j[t&255]:n==254?t>=65136?T:E:E}function U(e){return e>="\u064b"&&e<="\u0655"}var r=["\u0621","\u0641"],i=["\u063a","\u064a"],s=0,o=0,u=!1,a=!1,f=!1,l=!1,c=!1,h=!1,p=[[0,3,0,1,0,0,0],[0,3,0,1,2,2,0],[0,3,0,17,2,0,1],[0,3,5,5,4,1,0],[0,3,21,21,4,0,1],[0,3,5,5,4,2,0]],d=[[2,0,1,1,0,1,0],[2,0,1,1,0,2,0],[2,0,2,1,3,2,0],[2,0,2,33,3,1,1]],v=0,m=1,g=0,y=1,b=2,w=3,E=4,S=5,x=6,T=7,N=8,C=9,k=10,L=11,A=12,O=13,M=14,_=15,D=16,P=17,H=18,B=[H,H,H,H,H,H,H,H,H,x,S,x,N,S,H,H,H,H,H,H,H,H,H,H,H,H,H,H,S,S,S,x,N,E,E,L,L,L,E,E,E,E,E,k,C,k,C,C,b,b,b,b,b,b,b,b,b,b,C,E,E,E,E,E,E,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,E,E,E,E,E,E,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,E,E,E,E,H,H,H,H,H,H,S,H,H,H,H,H,H,H,H,H,H,H,H,H,H,H,H,H,H,H,H,H,H,H,H,H,H,C,E,L,L,L,L,E,E,E,E,g,E,E,H,E,E,L,L,b,b,E,g,E,E,E,b,g,E,E,E,E,E],j=[N,N,N,N,N,N,N,N,N,N,N,H,H,H,g,y,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,N,S,O,M,_,D,P,C,L,L,L,L,L,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,C,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,N];t.L=g,t.R=y,t.EN=b,t.ON_R=3,t.AN=4,t.R_H=5,t.B=6,t.RLE=7,t.DOT="\u00b7",t.doBidiReorder=function(e,n,r){if(e.length<2)return{};var i=e.split(""),o=new Array(i.length),u=new Array(i.length),a=[];s=r?m:v,F(i,a,i.length,n);for(var f=0;fT&&n[f]0&&i[f-1]==="\u0644"&&/\u0622|\u0623|\u0625|\u0627/.test(i[f])&&(a[f-1]=a[f]=t.R_H,f++);i[i.length-1]===t.DOT&&(a[i.length-1]=t.B),i[0]==="\u202b"&&(a[0]=t.RLE);for(var f=0;f=0&&(e=this.session.$docRowCache[n])}return e},this.getSplitIndex=function(){var e=0,t=this.session.$screenRowCache;if(t.length){var n,r=this.session.$getRowCacheIndex(t,this.currentRow);while(this.currentRow-e>0){n=this.session.$getRowCacheIndex(t,this.currentRow-e-1);if(n!==r)break;r=n,e++}}else e=this.currentRow;return e},this.updateRowLine=function(e,t){e===undefined&&(e=this.getDocumentRow());var n=e===this.session.getLength()-1,s=n?this.EOF:this.EOL;this.wrapIndent=0,this.line=this.session.getLine(e),this.isRtlDir=this.$isRtl||this.line.charAt(0)===this.RLE;if(this.session.$useWrapMode){var o=this.session.$wrapData[e];o&&(t===undefined&&(t=this.getSplitIndex()),t>0&&o.length?(this.wrapIndent=o.indent,this.wrapOffset=this.wrapIndent*this.charWidths[r.L],this.line=tt?this.session.getOverwrite()?e:e-1:t,i=r.getVisualFromLogicalIdx(n,this.bidiMap),s=this.bidiMap.bidiLevels,o=0;!this.session.getOverwrite()&&e<=t&&s[i]%2!==0&&i++;for(var u=0;ut&&s[i]%2===0&&(o+=this.charWidths[s[i]]),this.wrapIndent&&(o+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset),this.isRtlDir&&(o+=this.rtlLineOffset),o},this.getSelections=function(e,t){var n=this.bidiMap,r=n.bidiLevels,i,s=[],o=0,u=Math.min(e,t)-this.wrapIndent,a=Math.max(e,t)-this.wrapIndent,f=!1,l=!1,c=0;this.wrapIndent&&(o+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset);for(var h,p=0;p=u&&hn+s/2){n+=s;if(r===i.length-1){s=0;break}s=this.charWidths[i[++r]]}return r>0&&i[r-1]%2!==0&&i[r]%2===0?(e0&&i[r-1]%2===0&&i[r]%2!==0?t=1+(e>n?this.bidiMap.logicalFromVisual[r]:this.bidiMap.logicalFromVisual[r-1]):this.isRtlDir&&r===i.length-1&&s===0&&i[r-1]%2===0||!this.isRtlDir&&r===0&&i[r]%2!==0?t=1+this.bidiMap.logicalFromVisual[r]:(r>0&&i[r-1]%2!==0&&s!==0&&r--,t=this.bidiMap.logicalFromVisual[r]),t===0&&this.isRtlDir&&t++,t+this.wrapIndent}}).call(o.prototype),t.BidiHandler=o}),define("ace/selection",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/range"],function(e,t,n){"use strict";var r=e("./lib/oop"),i=e("./lib/lang"),s=e("./lib/event_emitter").EventEmitter,o=e("./range").Range,u=function(e){this.session=e,this.doc=e.getDocument(),this.clearSelection(),this.cursor=this.lead=this.doc.createAnchor(0,0),this.anchor=this.doc.createAnchor(0,0),this.$silent=!1;var t=this;this.cursor.on("change",function(e){t.$cursorChanged=!0,t.$silent||t._emit("changeCursor"),!t.$isEmpty&&!t.$silent&&t._emit("changeSelection"),!t.$keepDesiredColumnOnChange&&e.old.column!=e.value.column&&(t.$desiredColumn=null)}),this.anchor.on("change",function(){t.$anchorChanged=!0,!t.$isEmpty&&!t.$silent&&t._emit("changeSelection")})};(function(){r.implement(this,s),this.isEmpty=function(){return this.$isEmpty||this.anchor.row==this.lead.row&&this.anchor.column==this.lead.column},this.isMultiLine=function(){return!this.$isEmpty&&this.anchor.row!=this.cursor.row},this.getCursor=function(){return this.lead.getPosition()},this.setSelectionAnchor=function(e,t){this.$isEmpty=!1,this.anchor.setPosition(e,t)},this.getAnchor=this.getSelectionAnchor=function(){return this.$isEmpty?this.getSelectionLead():this.anchor.getPosition()},this.getSelectionLead=function(){return this.lead.getPosition()},this.isBackwards=function(){var e=this.anchor,t=this.lead;return e.row>t.row||e.row==t.row&&e.column>t.column},this.getRange=function(){var e=this.anchor,t=this.lead;return this.$isEmpty?o.fromPoints(t,t):this.isBackwards()?o.fromPoints(t,e):o.fromPoints(e,t)},this.clearSelection=function(){this.$isEmpty||(this.$isEmpty=!0,this._emit("changeSelection"))},this.selectAll=function(){this.$setSelection(0,0,Number.MAX_VALUE,Number.MAX_VALUE)},this.setRange=this.setSelectionRange=function(e,t){var n=t?e.end:e.start,r=t?e.start:e.end;this.$setSelection(n.row,n.column,r.row,r.column)},this.$setSelection=function(e,t,n,r){if(this.$silent)return;var i=this.$isEmpty,s=this.inMultiSelectMode;this.$silent=!0,this.$cursorChanged=this.$anchorChanged=!1,this.anchor.setPosition(e,t),this.cursor.setPosition(n,r),this.$isEmpty=!o.comparePoints(this.anchor,this.cursor),this.$silent=!1,this.$cursorChanged&&this._emit("changeCursor"),(this.$cursorChanged||this.$anchorChanged||i!=this.$isEmpty||s)&&this._emit("changeSelection")},this.$moveSelection=function(e){var t=this.lead;this.$isEmpty&&this.setSelectionAnchor(t.row,t.column),e.call(this)},this.selectTo=function(e,t){this.$moveSelection(function(){this.moveCursorTo(e,t)})},this.selectToPosition=function(e){this.$moveSelection(function(){this.moveCursorToPosition(e)})},this.moveTo=function(e,t){this.clearSelection(),this.moveCursorTo(e,t)},this.moveToPosition=function(e){this.clearSelection(),this.moveCursorToPosition(e)},this.selectUp=function(){this.$moveSelection(this.moveCursorUp)},this.selectDown=function(){this.$moveSelection(this.moveCursorDown)},this.selectRight=function(){this.$moveSelection(this.moveCursorRight)},this.selectLeft=function(){this.$moveSelection(this.moveCursorLeft)},this.selectLineStart=function(){this.$moveSelection(this.moveCursorLineStart)},this.selectLineEnd=function(){this.$moveSelection(this.moveCursorLineEnd)},this.selectFileEnd=function(){this.$moveSelection(this.moveCursorFileEnd)},this.selectFileStart=function(){this.$moveSelection(this.moveCursorFileStart)},this.selectWordRight=function(){this.$moveSelection(this.moveCursorWordRight)},this.selectWordLeft=function(){this.$moveSelection(this.moveCursorWordLeft)},this.getWordRange=function(e,t){if(typeof t=="undefined"){var n=e||this.lead;e=n.row,t=n.column}return this.session.getWordRange(e,t)},this.selectWord=function(){this.setSelectionRange(this.getWordRange())},this.selectAWord=function(){var e=this.getCursor(),t=this.session.getAWordRange(e.row,e.column);this.setSelectionRange(t)},this.getLineRange=function(e,t){var n=typeof e=="number"?e:this.lead.row,r,i=this.session.getFoldLine(n);return i?(n=i.start.row,r=i.end.row):r=n,t===!0?new o(n,0,r,this.session.getLine(r).length):new o(n,0,r+1,0)},this.selectLine=function(){this.setSelectionRange(this.getLineRange())},this.moveCursorUp=function(){this.moveCursorBy(-1,0)},this.moveCursorDown=function(){this.moveCursorBy(1,0)},this.wouldMoveIntoSoftTab=function(e,t,n){var r=e.column,i=e.column+t;return n<0&&(r=e.column-t,i=e.column),this.session.isTabStop(e)&&this.doc.getLine(e.row).slice(r,i).split(" ").length-1==t},this.moveCursorLeft=function(){var e=this.lead.getPosition(),t;if(t=this.session.getFoldAt(e.row,e.column,-1))this.moveCursorTo(t.start.row,t.start.column);else if(e.column===0)e.row>0&&this.moveCursorTo(e.row-1,this.doc.getLine(e.row-1).length);else{var n=this.session.getTabSize();this.wouldMoveIntoSoftTab(e,n,-1)&&!this.session.getNavigateWithinSoftTabs()?this.moveCursorBy(0,-n):this.moveCursorBy(0,-1)}},this.moveCursorRight=function(){var e=this.lead.getPosition(),t;if(t=this.session.getFoldAt(e.row,e.column,1))this.moveCursorTo(t.end.row,t.end.column);else if(this.lead.column==this.doc.getLine(this.lead.row).length)this.lead.row0&&(t.column=r)}}this.moveCursorTo(t.row,t.column)},this.moveCursorFileEnd=function(){var e=this.doc.getLength()-1,t=this.doc.getLine(e).length;this.moveCursorTo(e,t)},this.moveCursorFileStart=function(){this.moveCursorTo(0,0)},this.moveCursorLongWordRight=function(){var e=this.lead.row,t=this.lead.column,n=this.doc.getLine(e),r=n.substring(t);this.session.nonTokenRe.lastIndex=0,this.session.tokenRe.lastIndex=0;var i=this.session.getFoldAt(e,t,1);if(i){this.moveCursorTo(i.end.row,i.end.column);return}this.session.nonTokenRe.exec(r)&&(t+=this.session.nonTokenRe.lastIndex,this.session.nonTokenRe.lastIndex=0,r=n.substring(t));if(t>=n.length){this.moveCursorTo(e,n.length),this.moveCursorRight(),e0&&this.moveCursorWordLeft();return}this.session.tokenRe.exec(s)&&(t-=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0),this.moveCursorTo(e,t)},this.$shortWordEndIndex=function(e){var t=0,n,r=/\s/,i=this.session.tokenRe;i.lastIndex=0;if(this.session.tokenRe.exec(e))t=this.session.tokenRe.lastIndex;else{while((n=e[t])&&r.test(n))t++;if(t<1){i.lastIndex=0;while((n=e[t])&&!i.test(n)){i.lastIndex=0,t++;if(r.test(n)){if(t>2){t--;break}while((n=e[t])&&r.test(n))t++;if(t>2)break}}}}return i.lastIndex=0,t},this.moveCursorShortWordRight=function(){var e=this.lead.row,t=this.lead.column,n=this.doc.getLine(e),r=n.substring(t),i=this.session.getFoldAt(e,t,1);if(i)return this.moveCursorTo(i.end.row,i.end.column);if(t==n.length){var s=this.doc.getLength();do e++,r=this.doc.getLine(e);while(e0&&/^\s*$/.test(r));t=r.length,/\s+$/.test(r)||(r="")}var s=i.stringReverse(r),o=this.$shortWordEndIndex(s);return this.moveCursorTo(e,t-o)},this.moveCursorWordRight=function(){this.session.$selectLongWords?this.moveCursorLongWordRight():this.moveCursorShortWordRight()},this.moveCursorWordLeft=function(){this.session.$selectLongWords?this.moveCursorLongWordLeft():this.moveCursorShortWordLeft()},this.moveCursorBy=function(e,t){var n=this.session.documentToScreenPosition(this.lead.row,this.lead.column),r;t===0&&(e!==0&&(this.session.$bidiHandler.isBidiRow(n.row,this.lead.row)?(r=this.session.$bidiHandler.getPosLeft(n.column),n.column=Math.round(r/this.session.$bidiHandler.charWidths[0])):r=n.column*this.session.$bidiHandler.charWidths[0]),this.$desiredColumn?n.column=this.$desiredColumn:this.$desiredColumn=n.column);if(e!=0&&this.session.lineWidgets&&this.session.lineWidgets[this.lead.row]){var i=this.session.lineWidgets[this.lead.row];e<0?e-=i.rowsAbove||0:e>0&&(e+=i.rowCount-(i.rowsAbove||0))}var s=this.session.screenToDocumentPosition(n.row+e,n.column,r);e!==0&&t===0&&s.row===this.lead.row&&s.column===this.lead.column,this.moveCursorTo(s.row,s.column+t,t===0)},this.moveCursorToPosition=function(e){this.moveCursorTo(e.row,e.column)},this.moveCursorTo=function(e,t,n){var r=this.session.getFoldAt(e,t,1);r&&(e=r.start.row,t=r.start.column),this.$keepDesiredColumnOnChange=!0;var i=this.session.getLine(e);/[\uDC00-\uDFFF]/.test(i.charAt(t))&&i.charAt(t-1)&&(this.lead.row==e&&this.lead.column==t+1?t-=1:t+=1),this.lead.setPosition(e,t),this.$keepDesiredColumnOnChange=!1,n||(this.$desiredColumn=null)},this.moveCursorToScreen=function(e,t,n){var r=this.session.screenToDocumentPosition(e,t);this.moveCursorTo(r.row,r.column,n)},this.detach=function(){this.lead.detach(),this.anchor.detach(),this.session=this.doc=null},this.fromOrientedRange=function(e){this.setSelectionRange(e,e.cursor==e.start),this.$desiredColumn=e.desiredColumn||this.$desiredColumn},this.toOrientedRange=function(e){var t=this.getRange();return e?(e.start.column=t.start.column,e.start.row=t.start.row,e.end.column=t.end.column,e.end.row=t.end.row):e=t,e.cursor=this.isBackwards()?e.start:e.end,e.desiredColumn=this.$desiredColumn,e},this.getRangeOfMovements=function(e){var t=this.getCursor();try{e(this);var n=this.getCursor();return o.fromPoints(t,n)}catch(r){return o.fromPoints(t,t)}finally{this.moveCursorToPosition(t)}},this.toJSON=function(){if(this.rangeCount)var e=this.ranges.map(function(e){var t=e.clone();return t.isBackwards=e.cursor==e.start,t});else{var e=this.getRange();e.isBackwards=this.isBackwards()}return e},this.fromJSON=function(e){if(e.start==undefined){if(this.rangeList&&e.length>1){this.toSingleRange(e[0]);for(var t=e.length;t--;){var n=o.fromPoints(e[t].start,e[t].end);e[t].isBackwards&&(n.cursor=n.start),this.addRange(n,!0)}return}e=e[0]}this.rangeList&&this.toSingleRange(e),this.setSelectionRange(e,e.isBackwards)},this.isEqual=function(e){if((e.length||this.rangeCount)&&e.length!=this.rangeCount)return!1;if(!e.length||!this.ranges)return this.getRange().isEqual(e);for(var t=this.ranges.length;t--;)if(!this.ranges[t].isEqual(e[t]))return!1;return!0}}).call(u.prototype),t.Selection=u}),define("ace/tokenizer",["require","exports","module","ace/config"],function(e,t,n){"use strict";var r=e("./config"),i=2e3,s=function(e){this.states=e,this.regExps={},this.matchMappings={};for(var t in this.states){var n=this.states[t],r=[],i=0,s=this.matchMappings[t]={defaultToken:"text"},o="g",u=[];for(var a=0;a1?f.onMatch=this.$applyToken:f.onMatch=f.token),c>1&&(/\\\d/.test(f.regex)?l=f.regex.replace(/\\([0-9]+)/g,function(e,t){return"\\"+(parseInt(t,10)+i+1)}):(c=1,l=this.removeCapturingGroups(f.regex)),!f.splitRegex&&typeof f.token!="string"&&u.push(f)),s[i]=a,i+=c,r.push(l),f.onMatch||(f.onMatch=null)}r.length||(s[0]=0,r.push("$")),u.forEach(function(e){e.splitRegex=this.createSplitterRegexp(e.regex,o)},this),this.regExps[t]=new RegExp("("+r.join(")|(")+")|($)",o)}};(function(){this.$setMaxTokenCount=function(e){i=e|0},this.$applyToken=function(e){var t=this.splitRegex.exec(e).slice(1),n=this.token.apply(this,t);if(typeof n=="string")return[{type:n,value:e}];var r=[];for(var i=0,s=n.length;il){var g=e.substring(l,m-v.length);h.type==p?h.value+=g:(h.type&&f.push(h),h={type:p,value:g})}for(var y=0;yi){c>2*e.length&&this.reportError("infinite loop with in ace tokenizer",{startState:t,line:e});while(l1&&n[0]!==r&&n.unshift("#tmp",r),{tokens:f,state:n.length?n:r}},this.reportError=r.reportError}).call(s.prototype),t.Tokenizer=s}),define("ace/mode/text_highlight_rules",["require","exports","module","ace/lib/lang"],function(e,t,n){"use strict";var r=e("../lib/lang"),i=function(){this.$rules={start:[{token:"empty_line",regex:"^$"},{defaultToken:"text"}]}};(function(){this.addRules=function(e,t){if(!t){for(var n in e)this.$rules[n]=e[n];return}for(var n in e){var r=e[n];for(var i=0;i=this.$rowTokens.length){this.$row+=1,e||(e=this.$session.getLength());if(this.$row>=e)return this.$row=e-1,null;this.$rowTokens=this.$session.getTokens(this.$row),this.$tokenIndex=0}return this.$rowTokens[this.$tokenIndex]},this.getCurrentToken=function(){return this.$rowTokens[this.$tokenIndex]},this.getCurrentTokenRow=function(){return this.$row},this.getCurrentTokenColumn=function(){var e=this.$rowTokens,t=this.$tokenIndex,n=e[t].start;if(n!==undefined)return n;n=0;while(t>0)t-=1,n+=e[t].value.length;return n},this.getCurrentTokenPosition=function(){return{row:this.$row,column:this.getCurrentTokenColumn()}},this.getCurrentTokenRange=function(){var e=this.$rowTokens[this.$tokenIndex],t=this.getCurrentTokenColumn();return new r(this.$row,t,this.$row,t+e.value.length)}}).call(i.prototype),t.TokenIterator=i}),define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("../behaviour").Behaviour,s=e("../../token_iterator").TokenIterator,o=e("../../lib/lang"),u=["text","paren.rparen","rparen","paren","punctuation.operator"],a=["text","paren.rparen","rparen","paren","punctuation.operator","comment"],f,l={},c={'"':'"',"'":"'"},h=function(e){var t=-1;e.multiSelect&&(t=e.selection.index,l.rangeCount!=e.multiSelect.rangeCount&&(l={rangeCount:e.multiSelect.rangeCount}));if(l[t])return f=l[t];f=l[t]={autoInsertedBrackets:0,autoInsertedRow:-1,autoInsertedLineEnd:"",maybeInsertedBrackets:0,maybeInsertedRow:-1,maybeInsertedLineStart:"",maybeInsertedLineEnd:""}},p=function(e,t,n,r){var i=e.end.row-e.start.row;return{text:n+t+r,selection:[0,e.start.column+1,i,e.end.column+(i?0:1)]}},d=function(e){this.add("braces","insertion",function(t,n,r,i,s){var u=r.getCursorPosition(),a=i.doc.getLine(u.row);if(s=="{"){h(r);var l=r.getSelectionRange(),c=i.doc.getTextRange(l);if(c!==""&&c!=="{"&&r.getWrapBehavioursEnabled())return p(l,c,"{","}");if(d.isSaneInsertion(r,i))return/[\]\}\)]/.test(a[u.column])||r.inMultiSelectMode||e&&e.braces?(d.recordAutoInsert(r,i,"}"),{text:"{}",selection:[1,1]}):(d.recordMaybeInsert(r,i,"{"),{text:"{",selection:[1,1]})}else if(s=="}"){h(r);var v=a.substring(u.column,u.column+1);if(v=="}"){var m=i.$findOpeningBracket("}",{column:u.column+1,row:u.row});if(m!==null&&d.isAutoInsertedClosing(u,a,s))return d.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}else{if(s=="\n"||s=="\r\n"){h(r);var g="";d.isMaybeInsertedClosing(u,a)&&(g=o.stringRepeat("}",f.maybeInsertedBrackets),d.clearMaybeInsertedClosing());var v=a.substring(u.column,u.column+1);if(v==="}"){var y=i.findMatchingBracket({row:u.row,column:u.column+1},"}");if(!y)return null;var b=this.$getIndent(i.getLine(y.row))}else{if(!g){d.clearMaybeInsertedClosing();return}var b=this.$getIndent(a)}var w=b+i.getTabString();return{text:"\n"+w+"\n"+b+g,selection:[1,w.length,1,w.length]}}d.clearMaybeInsertedClosing()}}),this.add("braces","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&s=="{"){h(n);var o=r.doc.getLine(i.start.row),u=o.substring(i.end.column,i.end.column+1);if(u=="}")return i.end.column++,i;f.maybeInsertedBrackets--}}),this.add("parens","insertion",function(e,t,n,r,i){if(i=="("){h(n);var s=n.getSelectionRange(),o=r.doc.getTextRange(s);if(o!==""&&n.getWrapBehavioursEnabled())return p(s,o,"(",")");if(d.isSaneInsertion(n,r))return d.recordAutoInsert(n,r,")"),{text:"()",selection:[1,1]}}else if(i==")"){h(n);var u=n.getCursorPosition(),a=r.doc.getLine(u.row),f=a.substring(u.column,u.column+1);if(f==")"){var l=r.$findOpeningBracket(")",{column:u.column+1,row:u.row});if(l!==null&&d.isAutoInsertedClosing(u,a,i))return d.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}}),this.add("parens","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&s=="("){h(n);var o=r.doc.getLine(i.start.row),u=o.substring(i.start.column+1,i.start.column+2);if(u==")")return i.end.column++,i}}),this.add("brackets","insertion",function(e,t,n,r,i){if(i=="["){h(n);var s=n.getSelectionRange(),o=r.doc.getTextRange(s);if(o!==""&&n.getWrapBehavioursEnabled())return p(s,o,"[","]");if(d.isSaneInsertion(n,r))return d.recordAutoInsert(n,r,"]"),{text:"[]",selection:[1,1]}}else if(i=="]"){h(n);var u=n.getCursorPosition(),a=r.doc.getLine(u.row),f=a.substring(u.column,u.column+1);if(f=="]"){var l=r.$findOpeningBracket("]",{column:u.column+1,row:u.row});if(l!==null&&d.isAutoInsertedClosing(u,a,i))return d.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}}),this.add("brackets","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&s=="["){h(n);var o=r.doc.getLine(i.start.row),u=o.substring(i.start.column+1,i.start.column+2);if(u=="]")return i.end.column++,i}}),this.add("string_dquotes","insertion",function(e,t,n,r,i){var s=r.$mode.$quotes||c;if(i.length==1&&s[i]){if(this.lineCommentStart&&this.lineCommentStart.indexOf(i)!=-1)return;h(n);var o=i,u=n.getSelectionRange(),a=r.doc.getTextRange(u);if(a!==""&&(a.length!=1||!s[a])&&n.getWrapBehavioursEnabled())return p(u,a,o,o);if(!a){var f=n.getCursorPosition(),l=r.doc.getLine(f.row),d=l.substring(f.column-1,f.column),v=l.substring(f.column,f.column+1),m=r.getTokenAt(f.row,f.column),g=r.getTokenAt(f.row,f.column+1);if(d=="\\"&&m&&/escape/.test(m.type))return null;var y=m&&/string|escape/.test(m.type),b=!g||/string|escape/.test(g.type),w;if(v==o)w=y!==b,w&&/string\.end/.test(g.type)&&(w=!1);else{if(y&&!b)return null;if(y&&b)return null;var E=r.$mode.tokenRe;E.lastIndex=0;var S=E.test(d);E.lastIndex=0;var x=E.test(d);if(S||x)return null;if(v&&!/[\s;,.})\]\\]/.test(v))return null;var T=l[f.column-2];if(!(d!=o||T!=o&&!E.test(T)))return null;w=!0}return{text:w?o+o:"",selection:[1,1]}}}}),this.add("string_dquotes","deletion",function(e,t,n,r,i){var s=r.$mode.$quotes||c,o=r.doc.getTextRange(i);if(!i.isMultiLine()&&s.hasOwnProperty(o)){h(n);var u=r.doc.getLine(i.start.row),a=u.substring(i.start.column+1,i.start.column+2);if(a==o)return i.end.column++,i}})};d.isSaneInsertion=function(e,t){var n=e.getCursorPosition(),r=new s(t,n.row,n.column);if(!this.$matchTokenType(r.getCurrentToken()||"text",u)){if(/[)}\]]/.test(e.session.getLine(n.row)[n.column]))return!0;var i=new s(t,n.row,n.column+1);if(!this.$matchTokenType(i.getCurrentToken()||"text",u))return!1}return r.stepForward(),r.getCurrentTokenRow()!==n.row||this.$matchTokenType(r.getCurrentToken()||"text",a)},d.$matchTokenType=function(e,t){return t.indexOf(e.type||e)>-1},d.recordAutoInsert=function(e,t,n){var r=e.getCursorPosition(),i=t.doc.getLine(r.row);this.isAutoInsertedClosing(r,i,f.autoInsertedLineEnd[0])||(f.autoInsertedBrackets=0),f.autoInsertedRow=r.row,f.autoInsertedLineEnd=n+i.substr(r.column),f.autoInsertedBrackets++},d.recordMaybeInsert=function(e,t,n){var r=e.getCursorPosition(),i=t.doc.getLine(r.row);this.isMaybeInsertedClosing(r,i)||(f.maybeInsertedBrackets=0),f.maybeInsertedRow=r.row,f.maybeInsertedLineStart=i.substr(0,r.column)+n,f.maybeInsertedLineEnd=i.substr(r.column),f.maybeInsertedBrackets++},d.isAutoInsertedClosing=function(e,t,n){return f.autoInsertedBrackets>0&&e.row===f.autoInsertedRow&&n===f.autoInsertedLineEnd[0]&&t.substr(e.column)===f.autoInsertedLineEnd},d.isMaybeInsertedClosing=function(e,t){return f.maybeInsertedBrackets>0&&e.row===f.maybeInsertedRow&&t.substr(e.column)===f.maybeInsertedLineEnd&&t.substr(0,e.column)==f.maybeInsertedLineStart},d.popAutoInsertedClosing=function(){f.autoInsertedLineEnd=f.autoInsertedLineEnd.substr(1),f.autoInsertedBrackets--},d.clearMaybeInsertedClosing=function(){f&&(f.maybeInsertedBrackets=0,f.maybeInsertedRow=-1)},r.inherits(d,i),t.CstyleBehaviour=d}),define("ace/unicode",["require","exports","module"],function(e,t,n){"use strict";var r=[48,9,8,25,5,0,2,25,48,0,11,0,5,0,6,22,2,30,2,457,5,11,15,4,8,0,2,0,18,116,2,1,3,3,9,0,2,2,2,0,2,19,2,82,2,138,2,4,3,155,12,37,3,0,8,38,10,44,2,0,2,1,2,1,2,0,9,26,6,2,30,10,7,61,2,9,5,101,2,7,3,9,2,18,3,0,17,58,3,100,15,53,5,0,6,45,211,57,3,18,2,5,3,11,3,9,2,1,7,6,2,2,2,7,3,1,3,21,2,6,2,0,4,3,3,8,3,1,3,3,9,0,5,1,2,4,3,11,16,2,2,5,5,1,3,21,2,6,2,1,2,1,2,1,3,0,2,4,5,1,3,2,4,0,8,3,2,0,8,15,12,2,2,8,2,2,2,21,2,6,2,1,2,4,3,9,2,2,2,2,3,0,16,3,3,9,18,2,2,7,3,1,3,21,2,6,2,1,2,4,3,8,3,1,3,2,9,1,5,1,2,4,3,9,2,0,17,1,2,5,4,2,2,3,4,1,2,0,2,1,4,1,4,2,4,11,5,4,4,2,2,3,3,0,7,0,15,9,18,2,2,7,2,2,2,22,2,9,2,4,4,7,2,2,2,3,8,1,2,1,7,3,3,9,19,1,2,7,2,2,2,22,2,9,2,4,3,8,2,2,2,3,8,1,8,0,2,3,3,9,19,1,2,7,2,2,2,22,2,15,4,7,2,2,2,3,10,0,9,3,3,9,11,5,3,1,2,17,4,23,2,8,2,0,3,6,4,0,5,5,2,0,2,7,19,1,14,57,6,14,2,9,40,1,2,0,3,1,2,0,3,0,7,3,2,6,2,2,2,0,2,0,3,1,2,12,2,2,3,4,2,0,2,5,3,9,3,1,35,0,24,1,7,9,12,0,2,0,2,0,5,9,2,35,5,19,2,5,5,7,2,35,10,0,58,73,7,77,3,37,11,42,2,0,4,328,2,3,3,6,2,0,2,3,3,40,2,3,3,32,2,3,3,6,2,0,2,3,3,14,2,56,2,3,3,66,5,0,33,15,17,84,13,619,3,16,2,25,6,74,22,12,2,6,12,20,12,19,13,12,2,2,2,1,13,51,3,29,4,0,5,1,3,9,34,2,3,9,7,87,9,42,6,69,11,28,4,11,5,11,11,39,3,4,12,43,5,25,7,10,38,27,5,62,2,28,3,10,7,9,14,0,89,75,5,9,18,8,13,42,4,11,71,55,9,9,4,48,83,2,2,30,14,230,23,280,3,5,3,37,3,5,3,7,2,0,2,0,2,0,2,30,3,52,2,6,2,0,4,2,2,6,4,3,3,5,5,12,6,2,2,6,67,1,20,0,29,0,14,0,17,4,60,12,5,0,4,11,18,0,5,0,3,9,2,0,4,4,7,0,2,0,2,0,2,3,2,10,3,3,6,4,5,0,53,1,2684,46,2,46,2,132,7,6,15,37,11,53,10,0,17,22,10,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,31,48,0,470,1,36,5,2,4,6,1,5,85,3,1,3,2,2,89,2,3,6,40,4,93,18,23,57,15,513,6581,75,20939,53,1164,68,45,3,268,4,27,21,31,3,13,13,1,2,24,9,69,11,1,38,8,3,102,3,1,111,44,25,51,13,68,12,9,7,23,4,0,5,45,3,35,13,28,4,64,15,10,39,54,10,13,3,9,7,22,4,1,5,66,25,2,227,42,2,1,3,9,7,11171,13,22,5,48,8453,301,3,61,3,105,39,6,13,4,6,11,2,12,2,4,2,0,2,1,2,1,2,107,34,362,19,63,3,53,41,11,5,15,17,6,13,1,25,2,33,4,2,134,20,9,8,25,5,0,2,25,12,88,4,5,3,5,3,5,3,2],i=0,s=[];for(var o=0;o2?r%f!=f-1:r%f==0}}var E=Infinity;w(function(e,t){var n=e.search(/\S/);n!==-1?(ne.length&&(E=e.length)}),u==Infinity&&(u=E,s=!1,o=!1),l&&u%f!=0&&(u=Math.floor(u/f)*f),w(o?m:v)},this.toggleBlockComment=function(e,t,n,r){var i=this.blockComment;if(!i)return;!i.start&&i[0]&&(i=i[0]);var s=new f(t,r.row,r.column),o=s.getCurrentToken(),u=t.selection,a=t.selection.toOrientedRange(),c,h;if(o&&/comment/.test(o.type)){var p,d;while(o&&/comment/.test(o.type)){var v=o.value.indexOf(i.start);if(v!=-1){var m=s.getCurrentTokenRow(),g=s.getCurrentTokenColumn()+v;p=new l(m,g,m,g+i.start.length);break}o=s.stepBackward()}var s=new f(t,r.row,r.column),o=s.getCurrentToken();while(o&&/comment/.test(o.type)){var v=o.value.indexOf(i.end);if(v!=-1){var m=s.getCurrentTokenRow(),g=s.getCurrentTokenColumn()+v;d=new l(m,g,m,g+i.end.length);break}o=s.stepForward()}d&&t.remove(d),p&&(t.remove(p),c=p.start.row,h=-i.start.length)}else h=i.start.length,c=n.start.row,t.insert(n.end,i.end),t.insert(n.start,i.start);a.start.row==c&&(a.start.column+=h),a.end.row==c&&(a.end.column+=h),t.selection.fromOrientedRange(a)},this.getNextLineIndent=function(e,t,n){return this.$getIndent(t)},this.checkOutdent=function(e,t,n){return!1},this.autoOutdent=function(e,t,n){},this.$getIndent=function(e){return e.match(/^\s*/)[0]},this.createWorker=function(e){return null},this.createModeDelegates=function(e){this.$embeds=[],this.$modes={};for(var t in e)if(e[t]){var n=e[t],i=n.prototype.$id,s=r.$modes[i];s||(r.$modes[i]=s=new n),r.$modes[t]||(r.$modes[t]=s),this.$embeds.push(t),this.$modes[t]=s}var o=["toggleBlockComment","toggleCommentLines","getNextLineIndent","checkOutdent","autoOutdent","transformAction","getCompletions"];for(var t=0;t=0&&t.row=0&&t.column<=e[t.row].length}function s(e,t){t.action!="insert"&&t.action!="remove"&&r(t,"delta.action must be 'insert' or 'remove'"),t.lines instanceof Array||r(t,"delta.lines must be an Array"),(!t.start||!t.end)&&r(t,"delta.start/end must be an present");var n=t.start;i(e,t.start)||r(t,"delta.start must be contained in document");var s=t.end;t.action=="remove"&&!i(e,s)&&r(t,"delta.end must contained in document for 'remove' actions");var o=s.row-n.row,u=s.column-(o==0?n.column:0);(o!=t.lines.length-1||t.lines[o].length!=u)&&r(t,"delta.range must match delta lines")}t.applyDelta=function(e,t,n){var r=t.start.row,i=t.start.column,s=e[r]||"";switch(t.action){case"insert":var o=t.lines;if(o.length===1)e[r]=s.substring(0,i)+t.lines[0]+s.substring(i);else{var u=[r,1].concat(t.lines);e.splice.apply(e,u),e[r]=s.substring(0,i)+e[r],e[r+t.lines.length-1]+=s.substring(i)}break;case"remove":var a=t.end.column,f=t.end.row;r===f?e[r]=s.substring(0,i)+s.substring(a):e.splice(r,f-r+1,s.substring(0,i)+e[f].substring(a))}}}),define("ace/anchor",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],function(e,t,n){"use strict";var r=e("./lib/oop"),i=e("./lib/event_emitter").EventEmitter,s=t.Anchor=function(e,t,n){this.$onChange=this.onChange.bind(this),this.attach(e),typeof n=="undefined"?this.setPosition(t.row,t.column):this.setPosition(t,n)};(function(){function e(e,t,n){var r=n?e.column<=t.column:e.columnthis.row)return;var n=t(e,{row:this.row,column:this.column},this.$insertRight);this.setPosition(n.row,n.column,!0)},this.setPosition=function(e,t,n){var r;n?r={row:e,column:t}:r=this.$clipPositionToDocument(e,t);if(this.row==r.row&&this.column==r.column)return;var i={row:this.row,column:this.column};this.row=r.row,this.column=r.column,this._signal("change",{old:i,value:r})},this.detach=function(){this.document.off("change",this.$onChange)},this.attach=function(e){this.document=e||this.document,this.document.on("change",this.$onChange)},this.$clipPositionToDocument=function(e,t){var n={};return e>=this.document.getLength()?(n.row=Math.max(0,this.document.getLength()-1),n.column=this.document.getLine(n.row).length):e<0?(n.row=0,n.column=0):(n.row=e,n.column=Math.min(this.document.getLine(n.row).length,Math.max(0,t))),t<0&&(n.column=0),n}}).call(s.prototype)}),define("ace/document",["require","exports","module","ace/lib/oop","ace/apply_delta","ace/lib/event_emitter","ace/range","ace/anchor"],function(e,t,n){"use strict";var r=e("./lib/oop"),i=e("./apply_delta").applyDelta,s=e("./lib/event_emitter").EventEmitter,o=e("./range").Range,u=e("./anchor").Anchor,a=function(e){this.$lines=[""],e.length===0?this.$lines=[""]:Array.isArray(e)?this.insertMergedLines({row:0,column:0},e):this.insert({row:0,column:0},e)};(function(){r.implement(this,s),this.setValue=function(e){var t=this.getLength()-1;this.remove(new o(0,0,t,this.getLine(t).length)),this.insert({row:0,column:0},e)},this.getValue=function(){return this.getAllLines().join(this.getNewLineCharacter())},this.createAnchor=function(e,t){return new u(this,e,t)},"aaa".split(/a/).length===0?this.$split=function(e){return e.replace(/\r\n|\r/g,"\n").split("\n")}:this.$split=function(e){return e.split(/\r\n|\r|\n/)},this.$detectNewLine=function(e){var t=e.match(/^.*?(\r\n|\r|\n)/m);this.$autoNewLine=t?t[1]:"\n",this._signal("changeNewLineMode")},this.getNewLineCharacter=function(){switch(this.$newLineMode){case"windows":return"\r\n";case"unix":return"\n";default:return this.$autoNewLine||"\n"}},this.$autoNewLine="",this.$newLineMode="auto",this.setNewLineMode=function(e){if(this.$newLineMode===e)return;this.$newLineMode=e,this._signal("changeNewLineMode")},this.getNewLineMode=function(){return this.$newLineMode},this.isNewLine=function(e){return e=="\r\n"||e=="\r"||e=="\n"},this.getLine=function(e){return this.$lines[e]||""},this.getLines=function(e,t){return this.$lines.slice(e,t+1)},this.getAllLines=function(){return this.getLines(0,this.getLength())},this.getLength=function(){return this.$lines.length},this.getTextRange=function(e){return this.getLinesForRange(e).join(this.getNewLineCharacter())},this.getLinesForRange=function(e){var t;if(e.start.row===e.end.row)t=[this.getLine(e.start.row).substring(e.start.column,e.end.column)];else{t=this.getLines(e.start.row,e.end.row),t[0]=(t[0]||"").substring(e.start.column);var n=t.length-1;e.end.row-e.start.row==n&&(t[n]=t[n].substring(0,e.end.column))}return t},this.insertLines=function(e,t){return console.warn("Use of document.insertLines is deprecated. Use the insertFullLines method instead."),this.insertFullLines(e,t)},this.removeLines=function(e,t){return console.warn("Use of document.removeLines is deprecated. Use the removeFullLines method instead."),this.removeFullLines(e,t)},this.insertNewLine=function(e){return console.warn("Use of document.insertNewLine is deprecated. Use insertMergedLines(position, ['', '']) instead."),this.insertMergedLines(e,["",""])},this.insert=function(e,t){return this.getLength()<=1&&this.$detectNewLine(t),this.insertMergedLines(e,this.$split(t))},this.insertInLine=function(e,t){var n=this.clippedPos(e.row,e.column),r=this.pos(e.row,e.column+t.length);return this.applyDelta({start:n,end:r,action:"insert",lines:[t]},!0),this.clonePos(r)},this.clippedPos=function(e,t){var n=this.getLength();e===undefined?e=n:e<0?e=0:e>=n&&(e=n-1,t=undefined);var r=this.getLine(e);return t==undefined&&(t=r.length),t=Math.min(Math.max(t,0),r.length),{row:e,column:t}},this.clonePos=function(e){return{row:e.row,column:e.column}},this.pos=function(e,t){return{row:e,column:t}},this.$clipPosition=function(e){var t=this.getLength();return e.row>=t?(e.row=Math.max(0,t-1),e.column=this.getLine(t-1).length):(e.row=Math.max(0,e.row),e.column=Math.min(Math.max(e.column,0),this.getLine(e.row).length)),e},this.insertFullLines=function(e,t){e=Math.min(Math.max(e,0),this.getLength());var n=0;e0,r=t=0&&this.applyDelta({start:this.pos(e,this.getLine(e).length),end:this.pos(e+1,0),action:"remove",lines:["",""]})},this.replace=function(e,t){e instanceof o||(e=o.fromPoints(e.start,e.end));if(t.length===0&&e.isEmpty())return e.start;if(t==this.getTextRange(e))return e.end;this.remove(e);var n;return t?n=this.insert(e.start,t):n=e.start,n},this.applyDeltas=function(e){for(var t=0;t=0;t--)this.revertDelta(e[t])},this.applyDelta=function(e,t){var n=e.action=="insert";if(n?e.lines.length<=1&&!e.lines[0]:!o.comparePoints(e.start,e.end))return;n&&e.lines.length>2e4?this.$splitAndapplyLargeDelta(e,2e4):(i(this.$lines,e,t),this._signal("change",e))},this.$safeApplyDelta=function(e){var t=this.$lines.length;(e.action=="remove"&&e.start.row20){n.running=setTimeout(n.$worker,20);break}}n.currentLine=t,r==-1&&(r=t),s<=r&&n.fireUpdateEvent(s,r)}};(function(){r.implement(this,i),this.setTokenizer=function(e){this.tokenizer=e,this.lines=[],this.states=[],this.start(0)},this.setDocument=function(e){this.doc=e,this.lines=[],this.states=[],this.stop()},this.fireUpdateEvent=function(e,t){var n={first:e,last:t};this._signal("update",{data:n})},this.start=function(e){this.currentLine=Math.min(e||0,this.currentLine,this.doc.getLength()),this.lines.splice(this.currentLine,this.lines.length),this.states.splice(this.currentLine,this.states.length),this.stop(),this.running=setTimeout(this.$worker,700)},this.scheduleStart=function(){this.running||(this.running=setTimeout(this.$worker,700))},this.$updateOnChange=function(e){var t=e.start.row,n=e.end.row-t;if(n===0)this.lines[t]=null;else if(e.action=="remove")this.lines.splice(t,n+1,null),this.states.splice(t,n+1,null);else{var r=Array(n+1);r.unshift(t,1),this.lines.splice.apply(this.lines,r),this.states.splice.apply(this.states,r)}this.currentLine=Math.min(t,this.currentLine,this.doc.getLength()),this.stop()},this.stop=function(){this.running&&clearTimeout(this.running),this.running=!1},this.getTokens=function(e){return this.lines[e]||this.$tokenizeRow(e)},this.getState=function(e){return this.currentLine==e&&this.$tokenizeRow(e),this.states[e]||"start"},this.$tokenizeRow=function(e){var t=this.doc.getLine(e),n=this.states[e-1],r=this.tokenizer.getLineTokens(t,n,e);return this.states[e]+""!=r.state+""?(this.states[e]=r.state,this.lines[e+1]=null,this.currentLine>e+1&&(this.currentLine=e+1)):this.currentLine==e&&(this.currentLine=e+1),this.lines[e]=r.tokens}}).call(s.prototype),t.BackgroundTokenizer=s}),define("ace/search_highlight",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"],function(e,t,n){"use strict";var r=e("./lib/lang"),i=e("./lib/oop"),s=e("./range").Range,o=function(e,t,n){this.setRegexp(e),this.clazz=t,this.type=n||"text"};(function(){this.MAX_RANGES=500,this.setRegexp=function(e){if(this.regExp+""==e+"")return;this.regExp=e,this.cache=[]},this.update=function(e,t,n,i){if(!this.regExp)return;var o=i.firstRow,u=i.lastRow;for(var a=o;a<=u;a++){var f=this.cache[a];f==null&&(f=r.getMatchOffsets(n.getLine(a),this.regExp),f.length>this.MAX_RANGES&&(f=f.slice(0,this.MAX_RANGES)),f=f.map(function(e){return new s(a,e.offset,a,e.offset+e.length)}),this.cache[a]=f.length?f:"");for(var l=f.length;l--;)t.drawSingleLineMarker(e,f[l].toScreenRange(n),this.clazz,i)}}}).call(o.prototype),t.SearchHighlight=o}),define("ace/edit_session/fold_line",["require","exports","module","ace/range"],function(e,t,n){"use strict";function i(e,t){this.foldData=e,Array.isArray(t)?this.folds=t:t=this.folds=[t];var n=t[t.length-1];this.range=new r(t[0].start.row,t[0].start.column,n.end.row,n.end.column),this.start=this.range.start,this.end=this.range.end,this.folds.forEach(function(e){e.setFoldLine(this)},this)}var r=e("../range").Range;(function(){this.shiftRow=function(e){this.start.row+=e,this.end.row+=e,this.folds.forEach(function(t){t.start.row+=e,t.end.row+=e})},this.addFold=function(e){if(e.sameRow){if(e.start.rowthis.endRow)throw new Error("Can't add a fold to this FoldLine as it has no connection");this.folds.push(e),this.folds.sort(function(e,t){return-e.range.compareEnd(t.start.row,t.start.column)}),this.range.compareEnd(e.start.row,e.start.column)>0?(this.end.row=e.end.row,this.end.column=e.end.column):this.range.compareStart(e.end.row,e.end.column)<0&&(this.start.row=e.start.row,this.start.column=e.start.column)}else if(e.start.row==this.end.row)this.folds.push(e),this.end.row=e.end.row,this.end.column=e.end.column;else{if(e.end.row!=this.start.row)throw new Error("Trying to add fold to FoldRow that doesn't have a matching row");this.folds.unshift(e),this.start.row=e.start.row,this.start.column=e.start.column}e.foldLine=this},this.containsRow=function(e){return e>=this.start.row&&e<=this.end.row},this.walk=function(e,t,n){var r=0,i=this.folds,s,o,u,a=!0;t==null&&(t=this.end.row,n=this.end.column);for(var f=0;f0)continue;var a=i(e,o.start);return u===0?t&&a!==0?-s-2:s:a>0||a===0&&!t?s:-s-1}return-s-1},this.add=function(e){var t=!e.isEmpty(),n=this.pointIndex(e.start,t);n<0&&(n=-n-1);var r=this.pointIndex(e.end,t,n);return r<0?r=-r-1:r++,this.ranges.splice(n,r-n,e)},this.addList=function(e){var t=[];for(var n=e.length;n--;)t.push.apply(t,this.add(e[n]));return t},this.substractPoint=function(e){var t=this.pointIndex(e);if(t>=0)return this.ranges.splice(t,1)},this.merge=function(){var e=[],t=this.ranges;t=t.sort(function(e,t){return i(e.start,t.start)});var n=t[0],r;for(var s=1;s=0},this.containsPoint=function(e){return this.pointIndex(e)>=0},this.rangeAtPoint=function(e){var t=this.pointIndex(e);if(t>=0)return this.ranges[t]},this.clipRows=function(e,t){var n=this.ranges;if(n[0].start.row>t||n[n.length-1].start.row=r)break}if(e.action=="insert"){var f=i-r,l=-t.column+n.column;for(;or)break;a.start.row==r&&a.start.column>=t.column&&(a.start.column==t.column&&this.$bias<=0||(a.start.column+=l,a.start.row+=f));if(a.end.row==r&&a.end.column>=t.column){if(a.end.column==t.column&&this.$bias<0)continue;a.end.column==t.column&&l>0&&oa.start.column&&a.end.column==s[o+1].start.column&&(a.end.column-=l),a.end.column+=l,a.end.row+=f}}}else{var f=r-i,l=t.column-n.column;for(;oi)break;if(a.end.rowt.column)a.end.column=t.column,a.end.row=t.row}else a.end.column+=l,a.end.row+=f;else a.end.row>i&&(a.end.row+=f);if(a.start.rowt.column)a.start.column=t.column,a.start.row=t.row}else a.start.column+=l,a.start.row+=f;else a.start.row>i&&(a.start.row+=f)}}if(f!=0&&o=e)return i;if(i.end.row>e)return null}return null},this.getNextFoldLine=function(e,t){var n=this.$foldData,r=0;t&&(r=n.indexOf(t)),r==-1&&(r=0);for(r;r=e)return i}return null},this.getFoldedRowCount=function(e,t){var n=this.$foldData,r=t-e+1;for(var i=0;i=t){u=e?r-=t-u:r=0);break}o>=e&&(u>=e?r-=o-u:r-=o-e+1)}return r},this.$addFoldLine=function(e){return this.$foldData.push(e),this.$foldData.sort(function(e,t){return e.start.row-t.start.row}),e},this.addFold=function(e,t){var n=this.$foldData,r=!1,o;e instanceof s?o=e:(o=new s(t,e),o.collapseChildren=t.collapseChildren),this.$clipRangeToDocument(o.range);var u=o.start.row,a=o.start.column,f=o.end.row,l=o.end.column,c=this.getFoldAt(u,a,1),h=this.getFoldAt(f,l,-1);if(c&&h==c)return c.addSubFold(o);c&&!c.range.isStart(u,a)&&this.removeFold(c),h&&!h.range.isEnd(f,l)&&this.removeFold(h);var p=this.getFoldsInRange(o.range);p.length>0&&(this.removeFolds(p),p.forEach(function(e){o.addSubFold(e)}));for(var d=0;d0&&this.foldAll(e.start.row+1,e.end.row,e.collapseChildren-1),e.subFolds=[]},this.expandFolds=function(e){e.forEach(function(e){this.expandFold(e)},this)},this.unfold=function(e,t){var n,i;e==null?(n=new r(0,0,this.getLength(),0),t=!0):typeof e=="number"?n=new r(e,0,e,this.getLine(e).length):"row"in e?n=r.fromPoints(e,e):n=e,i=this.getFoldsInRangeList(n);if(t)this.removeFolds(i);else{var s=i;while(s.length)this.expandFolds(s),s=this.getFoldsInRangeList(n)}if(i.length)return i},this.isRowFolded=function(e,t){return!!this.getFoldLine(e,t)},this.getRowFoldEnd=function(e,t){var n=this.getFoldLine(e,t);return n?n.end.row:e},this.getRowFoldStart=function(e,t){var n=this.getFoldLine(e,t);return n?n.start.row:e},this.getFoldDisplayLine=function(e,t,n,r,i){r==null&&(r=e.start.row),i==null&&(i=0),t==null&&(t=e.end.row),n==null&&(n=this.getLine(t).length);var s=this.doc,o="";return e.walk(function(e,t,n,u){if(tl)break}while(s&&a.test(s.type));s=i.stepBackward()}else s=i.getCurrentToken();return f.end.row=i.getCurrentTokenRow(),f.end.column=i.getCurrentTokenColumn()+s.value.length-2,f}},this.foldAll=function(e,t,n){n==undefined&&(n=1e5);var r=this.foldWidgets;if(!r)return;t=t||this.getLength(),e=e||0;for(var i=e;i=e){i=s.end.row;try{var o=this.addFold("...",s);o&&(o.collapseChildren=n)}catch(u){}}}},this.$foldStyles={manual:1,markbegin:1,markbeginend:1},this.$foldStyle="markbegin",this.setFoldStyle=function(e){if(!this.$foldStyles[e])throw new Error("invalid fold style: "+e+"["+Object.keys(this.$foldStyles).join(", ")+"]");if(this.$foldStyle==e)return;this.$foldStyle=e,e=="manual"&&this.unfold();var t=this.$foldMode;this.$setFolding(null),this.$setFolding(t)},this.$setFolding=function(e){if(this.$foldMode==e)return;this.$foldMode=e,this.off("change",this.$updateFoldWidgets),this.off("tokenizerUpdate",this.$tokenizerUpdateFoldWidgets),this._signal("changeAnnotation");if(!e||this.$foldStyle=="manual"){this.foldWidgets=null;return}this.foldWidgets=[],this.getFoldWidget=e.getFoldWidget.bind(e,this,this.$foldStyle),this.getFoldWidgetRange=e.getFoldWidgetRange.bind(e,this,this.$foldStyle),this.$updateFoldWidgets=this.updateFoldWidgets.bind(this),this.$tokenizerUpdateFoldWidgets=this.tokenizerUpdateFoldWidgets.bind(this),this.on("change",this.$updateFoldWidgets),this.on("tokenizerUpdate",this.$tokenizerUpdateFoldWidgets)},this.getParentFoldRangeData=function(e,t){var n=this.foldWidgets;if(!n||t&&n[e])return{};var r=e-1,i;while(r>=0){var s=n[r];s==null&&(s=n[r]=this.getFoldWidget(r));if(s=="start"){var o=this.getFoldWidgetRange(r);i||(i=o);if(o&&o.end.row>=e)break}r--}return{range:r!==-1&&o,firstRange:i}},this.onFoldWidgetClick=function(e,t){t=t.domEvent;var n={children:t.shiftKey,all:t.ctrlKey||t.metaKey,siblings:t.altKey},r=this.$toggleFoldWidget(e,n);if(!r){var i=t.target||t.srcElement;i&&/ace_fold-widget/.test(i.className)&&(i.className+=" ace_invalid")}},this.$toggleFoldWidget=function(e,t){if(!this.getFoldWidget)return;var n=this.getFoldWidget(e),r=this.getLine(e),i=n==="end"?-1:1,s=this.getFoldAt(e,i===-1?0:r.length,i);if(s)return t.children||t.all?this.removeFold(s):this.expandFold(s),s;var o=this.getFoldWidgetRange(e,!0);if(o&&!o.isMultiLine()){s=this.getFoldAt(o.start.row,o.start.column,1);if(s&&o.isEqual(s.range))return this.removeFold(s),s}if(t.siblings){var u=this.getParentFoldRangeData(e);if(u.range)var a=u.range.start.row+1,f=u.range.end.row;this.foldAll(a,f,t.all?1e4:0)}else t.children?(f=o?o.end.row:this.getLength(),this.foldAll(e+1,f,t.all?1e4:0)):o&&(t.all&&(o.collapseChildren=1e4),this.addFold("...",o));return o},this.toggleFoldWidget=function(e){var t=this.selection.getCursor().row;t=this.getRowFoldStart(t);var n=this.$toggleFoldWidget(t,{});if(n)return;var r=this.getParentFoldRangeData(t,!0);n=r.range||r.firstRange;if(n){t=n.start.row;var i=this.getFoldAt(t,this.getLine(t).length,1);i?this.removeFold(i):this.addFold("...",n)}},this.updateFoldWidgets=function(e){var t=e.start.row,n=e.end.row-t;if(n===0)this.foldWidgets[t]=null;else if(e.action=="remove")this.foldWidgets.splice(t,n+1,null);else{var r=Array(n+1);r.unshift(t,1),this.foldWidgets.splice.apply(this.foldWidgets,r)}},this.tokenizerUpdateFoldWidgets=function(e){var t=e.data;t.first!=t.last&&this.foldWidgets.length>t.first&&this.foldWidgets.splice(t.first,this.foldWidgets.length)}}var r=e("../range").Range,i=e("./fold_line").FoldLine,s=e("./fold").Fold,o=e("../token_iterator").TokenIterator;t.Folding=u}),define("ace/edit_session/bracket_match",["require","exports","module","ace/token_iterator","ace/range"],function(e,t,n){"use strict";function s(){this.findMatchingBracket=function(e,t){if(e.column==0)return null;var n=t||this.getLine(e.row).charAt(e.column-1);if(n=="")return null;var r=n.match(/([\(\[\{])|([\)\]\}])/);return r?r[1]?this.$findClosingBracket(r[1],e):this.$findOpeningBracket(r[2],e):null},this.getBracketRange=function(e){var t=this.getLine(e.row),n=!0,r,s=t.charAt(e.column-1),o=s&&s.match(/([\(\[\{])|([\)\]\}])/);o||(s=t.charAt(e.column),e={row:e.row,column:e.column+1},o=s&&s.match(/([\(\[\{])|([\)\]\}])/),n=!1);if(!o)return null;if(o[1]){var u=this.$findClosingBracket(o[1],e);if(!u)return null;r=i.fromPoints(e,u),n||(r.end.column++,r.start.column--),r.cursor=r.end}else{var u=this.$findOpeningBracket(o[2],e);if(!u)return null;r=i.fromPoints(u,e),n||(r.start.column++,r.end.column--),r.cursor=r.start}return r},this.getMatchingBracketRanges=function(e){var t=this.getLine(e.row),n=t.charAt(e.column-1),r=n&&n.match(/([\(\[\{])|([\)\]\}])/);r||(n=t.charAt(e.column),e={row:e.row,column:e.column+1},r=n&&n.match(/([\(\[\{])|([\)\]\}])/));if(!r)return null;var s=new i(e.row,e.column-1,e.row,e.column),o=r[1]?this.$findClosingBracket(r[1],e):this.$findOpeningBracket(r[2],e);if(!o)return[s];var u=new i(o.row,o.column,o.row,o.column+1);return[s,u]},this.$brackets={")":"(","(":")","]":"[","[":"]","{":"}","}":"{","<":">",">":"<"},this.$findOpeningBracket=function(e,t,n){var i=this.$brackets[e],s=1,o=new r(this,t.row,t.column),u=o.getCurrentToken();u||(u=o.stepForward());if(!u)return;n||(n=new RegExp("(\\.?"+u.type.replace(".","\\.").replace("rparen",".paren").replace(/\b(?:end)\b/,"(?:start|begin|end)")+")+"));var a=t.column-o.getCurrentTokenColumn()-2,f=u.value;for(;;){while(a>=0){var l=f.charAt(a);if(l==i){s-=1;if(s==0)return{row:o.getCurrentTokenRow(),column:a+o.getCurrentTokenColumn()}}else l==e&&(s+=1);a-=1}do u=o.stepBackward();while(u&&!n.test(u.type));if(u==null)break;f=u.value,a=f.length-1}return null},this.$findClosingBracket=function(e,t,n){var i=this.$brackets[e],s=1,o=new r(this,t.row,t.column),u=o.getCurrentToken();u||(u=o.stepForward());if(!u)return;n||(n=new RegExp("(\\.?"+u.type.replace(".","\\.").replace("lparen",".paren").replace(/\b(?:start|begin)\b/,"(?:start|begin|end)")+")+"));var a=t.column-o.getCurrentTokenColumn();for(;;){var f=u.value,l=f.length;while(a=4352&&e<=4447||e>=4515&&e<=4519||e>=4602&&e<=4607||e>=9001&&e<=9002||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12283||e>=12288&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12589||e>=12593&&e<=12686||e>=12688&&e<=12730||e>=12736&&e<=12771||e>=12784&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=13054||e>=13056&&e<=19903||e>=19968&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=55216&&e<=55238||e>=55243&&e<=55291||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=65281&&e<=65376||e>=65504&&e<=65510}r.implement(this,u),this.setDocument=function(e){this.doc&&this.doc.removeListener("change",this.$onChange),this.doc=e,e.on("change",this.$onChange),this.bgTokenizer&&this.bgTokenizer.setDocument(this.getDocument()),this.resetCaches()},this.getDocument=function(){return this.doc},this.$resetRowCache=function(e){if(!e){this.$docRowCache=[],this.$screenRowCache=[];return}var t=this.$docRowCache.length,n=this.$getRowCacheIndex(this.$docRowCache,e)+1;t>n&&(this.$docRowCache.splice(n,t),this.$screenRowCache.splice(n,t))},this.$getRowCacheIndex=function(e,t){var n=0,r=e.length-1;while(n<=r){var i=n+r>>1,s=e[i];if(t>s)n=i+1;else{if(!(t=t)break}return r=n[s],r?(r.index=s,r.start=i-r.value.length,r):null},this.setUndoManager=function(e){this.$undoManager=e,this.$informUndoManager&&this.$informUndoManager.cancel();if(e){var t=this;e.addSession(this),this.$syncInformUndoManager=function(){t.$informUndoManager.cancel(),t.mergeUndoDeltas=!1},this.$informUndoManager=i.delayedCall(this.$syncInformUndoManager)}else this.$syncInformUndoManager=function(){}},this.markUndoGroup=function(){this.$syncInformUndoManager&&this.$syncInformUndoManager()},this.$defaultUndoManager={undo:function(){},redo:function(){},hasUndo:function(){},hasRedo:function(){},reset:function(){},add:function(){},addSelection:function(){},startNewGroup:function(){},addSession:function(){}},this.getUndoManager=function(){return this.$undoManager||this.$defaultUndoManager},this.getTabString=function(){return this.getUseSoftTabs()?i.stringRepeat(" ",this.getTabSize()):" "},this.setUseSoftTabs=function(e){this.setOption("useSoftTabs",e)},this.getUseSoftTabs=function(){return this.$useSoftTabs&&!this.$mode.$indentWithTabs},this.setTabSize=function(e){this.setOption("tabSize",e)},this.getTabSize=function(){return this.$tabSize},this.isTabStop=function(e){return this.$useSoftTabs&&e.column%this.$tabSize===0},this.setNavigateWithinSoftTabs=function(e){this.setOption("navigateWithinSoftTabs",e)},this.getNavigateWithinSoftTabs=function(){return this.$navigateWithinSoftTabs},this.$overwrite=!1,this.setOverwrite=function(e){this.setOption("overwrite",e)},this.getOverwrite=function(){return this.$overwrite},this.toggleOverwrite=function(){this.setOverwrite(!this.$overwrite)},this.addGutterDecoration=function(e,t){this.$decorations[e]||(this.$decorations[e]=""),this.$decorations[e]+=" "+t,this._signal("changeBreakpoint",{})},this.removeGutterDecoration=function(e,t){this.$decorations[e]=(this.$decorations[e]||"").replace(" "+t,""),this._signal("changeBreakpoint",{})},this.getBreakpoints=function(){return this.$breakpoints},this.setBreakpoints=function(e){this.$breakpoints=[];for(var t=0;t0&&(r=!!n.charAt(t-1).match(this.tokenRe)),r||(r=!!n.charAt(t).match(this.tokenRe));if(r)var i=this.tokenRe;else if(/^\s+$/.test(n.slice(t-1,t+1)))var i=/\s/;else var i=this.nonTokenRe;var s=t;if(s>0){do s--;while(s>=0&&n.charAt(s).match(i));s++}var o=t;while(oe&&(e=t.screenWidth)}),this.lineWidgetWidth=e},this.$computeWidth=function(e){if(this.$modified||e){this.$modified=!1;if(this.$useWrapMode)return this.screenWidth=this.$wrapLimit;var t=this.doc.getAllLines(),n=this.$rowLengthCache,r=0,i=0,s=this.$foldData[i],o=s?s.start.row:Infinity,u=t.length;for(var a=0;ao){a=s.end.row+1;if(a>=u)break;s=this.$foldData[i++],o=s?s.start.row:Infinity}n[a]==null&&(n[a]=this.$getStringScreenWidth(t[a])[0]),n[a]>r&&(r=n[a])}this.screenWidth=r}},this.getLine=function(e){return this.doc.getLine(e)},this.getLines=function(e,t){return this.doc.getLines(e,t)},this.getLength=function(){return this.doc.getLength()},this.getTextRange=function(e){return this.doc.getTextRange(e||this.selection.getRange())},this.insert=function(e,t){return this.doc.insert(e,t)},this.remove=function(e){return this.doc.remove(e)},this.removeFullLines=function(e,t){return this.doc.removeFullLines(e,t)},this.undoChanges=function(e,t){if(!e.length)return;this.$fromUndo=!0;for(var n=e.length-1;n!=-1;n--){var r=e[n];r.action=="insert"||r.action=="remove"?this.doc.revertDelta(r):r.folds&&this.addFolds(r.folds)}!t&&this.$undoSelect&&(e.selectionBefore?this.selection.fromJSON(e.selectionBefore):this.selection.setRange(this.$getUndoSelection(e,!0))),this.$fromUndo=!1},this.redoChanges=function(e,t){if(!e.length)return;this.$fromUndo=!0;for(var n=0;ne.end.column&&(s.start.column+=u),s.end.row==e.end.row&&s.end.column>e.end.column&&(s.end.column+=u)),o&&s.start.row>=e.end.row&&(s.start.row+=o,s.end.row+=o)}s.end=this.insert(s.start,r);if(i.length){var a=e.start,f=s.start,o=f.row-a.row,u=f.column-a.column;this.addFolds(i.map(function(e){return e=e.clone(),e.start.row==a.row&&(e.start.column+=u),e.end.row==a.row&&(e.end.column+=u),e.start.row+=o,e.end.row+=o,e}))}return s},this.indentRows=function(e,t,n){n=n.replace(/\t/g,this.getTabString());for(var r=e;r<=t;r++)this.doc.insertInLine({row:r,column:0},n)},this.outdentRows=function(e){var t=e.collapseRows(),n=new l(0,0,0,0),r=this.getTabSize();for(var i=t.start.row;i<=t.end.row;++i){var s=this.getLine(i);n.start.row=i,n.end.row=i;for(var o=0;o0){var r=this.getRowFoldEnd(t+n);if(r>this.doc.getLength()-1)return 0;var i=r-t}else{e=this.$clipRowToDocument(e),t=this.$clipRowToDocument(t);var i=t-e+1}var s=new l(e,0,t,Number.MAX_VALUE),o=this.getFoldsInRange(s).map(function(e){return e=e.clone(),e.start.row+=i,e.end.row+=i,e}),u=n==0?this.doc.getLines(e,t):this.doc.removeFullLines(e,t);return this.doc.insertFullLines(e+i,u),o.length&&this.addFolds(o),i},this.moveLinesUp=function(e,t){return this.$moveLines(e,t,-1)},this.moveLinesDown=function(e,t){return this.$moveLines(e,t,1)},this.duplicateLines=function(e,t){return this.$moveLines(e,t,0)},this.$clipRowToDocument=function(e){return Math.max(0,Math.min(e,this.doc.getLength()-1))},this.$clipColumnToRow=function(e,t){return t<0?0:Math.min(this.doc.getLine(e).length,t)},this.$clipPositionToDocument=function(e,t){t=Math.max(0,t);if(e<0)e=0,t=0;else{var n=this.doc.getLength();e>=n?(e=n-1,t=this.doc.getLine(n-1).length):t=Math.min(this.doc.getLine(e).length,t)}return{row:e,column:t}},this.$clipRangeToDocument=function(e){e.start.row<0?(e.start.row=0,e.start.column=0):e.start.column=this.$clipColumnToRow(e.start.row,e.start.column);var t=this.doc.getLength()-1;return e.end.row>t?(e.end.row=t,e.end.column=this.doc.getLine(t).length):e.end.column=this.$clipColumnToRow(e.end.row,e.end.column),e},this.$wrapLimit=80,this.$useWrapMode=!1,this.$wrapLimitRange={min:null,max:null},this.setUseWrapMode=function(e){if(e!=this.$useWrapMode){this.$useWrapMode=e,this.$modified=!0,this.$resetRowCache(0);if(e){var t=this.getLength();this.$wrapData=Array(t),this.$updateWrapData(0,t-1)}this._signal("changeWrapMode")}},this.getUseWrapMode=function(){return this.$useWrapMode},this.setWrapLimitRange=function(e,t){if(this.$wrapLimitRange.min!==e||this.$wrapLimitRange.max!==t)this.$wrapLimitRange={min:e,max:t},this.$modified=!0,this.$bidiHandler.markAsDirty(),this.$useWrapMode&&this._signal("changeWrapMode")},this.adjustWrapLimit=function(e,t){var n=this.$wrapLimitRange;n.max<0&&(n={min:t,max:t});var r=this.$constrainWrapLimit(e,n.min,n.max);return r!=this.$wrapLimit&&r>1?(this.$wrapLimit=r,this.$modified=!0,this.$useWrapMode&&(this.$updateWrapData(0,this.getLength()-1),this.$resetRowCache(0),this._signal("changeWrapLimit")),!0):!1},this.$constrainWrapLimit=function(e,t,n){return t&&(e=Math.max(t,e)),n&&(e=Math.min(n,e)),e},this.getWrapLimit=function(){return this.$wrapLimit},this.setWrapLimit=function(e){this.setWrapLimitRange(e,e)},this.getWrapLimitRange=function(){return{min:this.$wrapLimitRange.min,max:this.$wrapLimitRange.max}},this.$updateInternalDataOnChange=function(e){var t=this.$useWrapMode,n=e.action,r=e.start,i=e.end,s=r.row,o=i.row,u=o-s,a=null;this.$updating=!0;if(u!=0)if(n==="remove"){this[t?"$wrapData":"$rowLengthCache"].splice(s,u);var f=this.$foldData;a=this.getFoldsInRange(e),this.removeFolds(a);var l=this.getFoldLine(i.row),c=0;if(l){l.addRemoveChars(i.row,i.column,r.column-i.column),l.shiftRow(-u);var h=this.getFoldLine(s);h&&h!==l&&(h.merge(l),l=h),c=f.indexOf(l)+1}for(c;c=i.row&&l.shiftRow(-u)}o=s}else{var p=Array(u);p.unshift(s,0);var d=t?this.$wrapData:this.$rowLengthCache;d.splice.apply(d,p);var f=this.$foldData,l=this.getFoldLine(s),c=0;if(l){var v=l.range.compareInside(r.row,r.column);v==0?(l=l.split(r.row,r.column),l&&(l.shiftRow(u),l.addRemoveChars(o,0,i.column-r.column))):v==-1&&(l.addRemoveChars(s,0,i.column-r.column),l.shiftRow(u)),c=f.indexOf(l)+1}for(c;c=s&&l.shiftRow(u)}}else{u=Math.abs(e.start.column-e.end.column),n==="remove"&&(a=this.getFoldsInRange(e),this.removeFolds(a),u=-u);var l=this.getFoldLine(s);l&&l.addRemoveChars(s,r.column,u)}return t&&this.$wrapData.length!=this.doc.getLength()&&console.error("doc.getLength() and $wrapData.length have to be the same!"),this.$updating=!1,t?this.$updateWrapData(s,o):this.$updateRowLengthCache(s,o),a},this.$updateRowLengthCache=function(e,t,n){this.$rowLengthCache[e]=null,this.$rowLengthCache[t]=null},this.$updateWrapData=function(e,t){var r=this.doc.getAllLines(),i=this.getTabSize(),o=this.$wrapData,u=this.$wrapLimit,a,f,l=e;t=Math.min(t,r.length-1);while(l<=t)f=this.getFoldLine(l,f),f?(a=[],f.walk(function(e,t,i,o){var u;if(e!=null){u=this.$getDisplayTokens(e,a.length),u[0]=n;for(var f=1;fr-b){var w=f+r-b;if(e[w-1]>=c&&e[w]>=c){y(w);continue}if(e[w]==n||e[w]==s){for(w;w!=f-1;w--)if(e[w]==n)break;if(w>f){y(w);continue}w=f+r;for(w;w>2)),f-1);while(w>E&&e[w]E&&e[w]E&&e[w]==a)w--}else while(w>E&&e[w]E){y(++w);continue}w=f+r,e[w]==t&&w--,y(w-b)}return o},this.$getDisplayTokens=function(n,r){var i=[],s;r=r||0;for(var o=0;o39&&u<48||u>57&&u<64?i.push(a):u>=4352&&m(u)?i.push(e,t):i.push(e)}return i},this.$getStringScreenWidth=function(e,t,n){if(t==0)return[0,0];t==null&&(t=Infinity),n=n||0;var r,i;for(i=0;i=4352&&m(r)?n+=2:n+=1;if(n>t)break}return[n,i]},this.lineWidgets=null,this.getRowLength=function(e){var t=1;return this.lineWidgets&&(t+=this.lineWidgets[e]&&this.lineWidgets[e].rowCount||0),!this.$useWrapMode||!this.$wrapData[e]?t:this.$wrapData[e].length+t},this.getRowLineCount=function(e){return!this.$useWrapMode||!this.$wrapData[e]?1:this.$wrapData[e].length+1},this.getRowWrapIndent=function(e){if(this.$useWrapMode){var t=this.screenToDocumentPosition(e,Number.MAX_VALUE),n=this.$wrapData[t.row];return n.length&&n[0]=0)var u=f[l],i=this.$docRowCache[l],h=e>f[c-1];else var h=!c;var p=this.getLength()-1,d=this.getNextFoldLine(i),v=d?d.start.row:Infinity;while(u<=e){a=this.getRowLength(i);if(u+a>e||i>=p)break;u+=a,i++,i>v&&(i=d.end.row+1,d=this.getNextFoldLine(i,d),v=d?d.start.row:Infinity),h&&(this.$docRowCache.push(i),this.$screenRowCache.push(u))}if(d&&d.start.row<=i)r=this.getFoldDisplayLine(d),i=d.start.row;else{if(u+a<=e||i>p)return{row:p,column:this.getLine(p).length};r=this.getLine(i),d=null}var m=0,g=Math.floor(e-u);if(this.$useWrapMode){var y=this.$wrapData[i];y&&(o=y[g],g>0&&y.length&&(m=y.indent,s=y[g-1]||y[y.length-1],r=r.substring(s)))}return n!==undefined&&this.$bidiHandler.isBidiRow(u+g,i,g)&&(t=this.$bidiHandler.offsetToCol(n)),s+=this.$getStringScreenWidth(r,t-m)[1],this.$useWrapMode&&s>=o&&(s=o-1),d?d.idxToPosition(s):{row:i,column:s}},this.documentToScreenPosition=function(e,t){if(typeof t=="undefined")var n=this.$clipPositionToDocument(e.row,e.column);else n=this.$clipPositionToDocument(e,t);e=n.row,t=n.column;var r=0,i=null,s=null;s=this.getFoldAt(e,t,1),s&&(e=s.start.row,t=s.start.column);var o,u=0,a=this.$docRowCache,f=this.$getRowCacheIndex(a,e),l=a.length;if(l&&f>=0)var u=a[f],r=this.$screenRowCache[f],c=e>a[l-1];else var c=!l;var h=this.getNextFoldLine(u),p=h?h.start.row:Infinity;while(u=p){o=h.end.row+1;if(o>e)break;h=this.getNextFoldLine(o,h),p=h?h.start.row:Infinity}else o=u+1;r+=this.getRowLength(u),u=o,c&&(this.$docRowCache.push(u),this.$screenRowCache.push(r))}var d="";h&&u>=p?(d=this.getFoldDisplayLine(h,e,t),i=h.start.row):(d=this.getLine(e).substring(0,t),i=e);var v=0;if(this.$useWrapMode){var m=this.$wrapData[i];if(m){var g=0;while(d.length>=m[g])r++,g++;d=d.substring(m[g-1]||0,d.length),v=g>0?m.indent:0}}return this.lineWidgets&&this.lineWidgets[u]&&this.lineWidgets[u].rowsAbove&&(r+=this.lineWidgets[u].rowsAbove),{row:r,column:v+this.$getStringScreenWidth(d)[0]}},this.documentToScreenColumn=function(e,t){return this.documentToScreenPosition(e,t).column},this.documentToScreenRow=function(e,t){return this.documentToScreenPosition(e,t).row},this.getScreenLength=function(){var e=0,t=null;if(!this.$useWrapMode){e=this.getLength();var n=this.$foldData;for(var r=0;ro&&(s=t.end.row+1,t=this.$foldData[r++],o=t?t.start.row:Infinity)}}return this.lineWidgets&&(e+=this.$getWidgetScreenLength()),e},this.$setFontMetrics=function(e){if(!this.$enableVarChar)return;this.$getStringScreenWidth=function(t,n,r){if(n===0)return[0,0];n||(n=Infinity),r=r||0;var i,s;for(s=0;sn)break}return[r,s]}},this.destroy=function(){this.bgTokenizer&&(this.bgTokenizer.setDocument(null),this.bgTokenizer=null),this.$stopWorker(),this.removeAllListeners(),this.selection.detach()},this.isFullWidth=m}.call(d.prototype),e("./edit_session/folding").Folding.call(d.prototype),e("./edit_session/bracket_match").BracketMatch.call(d.prototype),o.defineOptions(d.prototype,"session",{wrap:{set:function(e){!e||e=="off"?e=!1:e=="free"?e=!0:e=="printMargin"?e=-1:typeof e=="string"&&(e=parseInt(e,10)||!1);if(this.$wrap==e)return;this.$wrap=e;if(!e)this.setUseWrapMode(!1);else{var t=typeof e=="number"?e:null;this.setWrapLimitRange(t,t),this.setUseWrapMode(!0)}},get:function(){return this.getUseWrapMode()?this.$wrap==-1?"printMargin":this.getWrapLimitRange().min?this.$wrap:"free":"off"},handlesSet:!0},wrapMethod:{set:function(e){e=e=="auto"?this.$mode.type!="text":e!="text",e!=this.$wrapAsCode&&(this.$wrapAsCode=e,this.$useWrapMode&&(this.$useWrapMode=!1,this.setUseWrapMode(!0)))},initialValue:"auto"},indentedSoftWrap:{set:function(){this.$useWrapMode&&(this.$useWrapMode=!1,this.setUseWrapMode(!0))},initialValue:!0},firstLineNumber:{set:function(){this._signal("changeBreakpoint")},initialValue:1},useWorker:{set:function(e){this.$useWorker=e,this.$stopWorker(),e&&this.$startWorker()},initialValue:!0},useSoftTabs:{initialValue:!0},tabSize:{set:function(e){e=parseInt(e),e>0&&this.$tabSize!==e&&(this.$modified=!0,this.$rowLengthCache=[],this.$tabSize=e,this._signal("changeTabSize"))},initialValue:4,handlesSet:!0},navigateWithinSoftTabs:{initialValue:!1},foldStyle:{set:function(e){this.setFoldStyle(e)},handlesSet:!0},overwrite:{set:function(e){this._signal("changeOverwrite")},initialValue:!1},newLineMode:{set:function(e){this.doc.setNewLineMode(e)},get:function(){return this.doc.getNewLineMode()},handlesSet:!0},mode:{set:function(e){this.setMode(e)},get:function(){return this.$modeId},handlesSet:!0}}),t.EditSession=d}),define("ace/search",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"],function(e,t,n){"use strict";function u(e,t){function n(e){return/\w/.test(e)||t.regExp?"\\b":""}return n(e[0])+e+n(e[e.length-1])}var r=e("./lib/lang"),i=e("./lib/oop"),s=e("./range").Range,o=function(){this.$options={}};(function(){this.set=function(e){return i.mixin(this.$options,e),this},this.getOptions=function(){return r.copyObject(this.$options)},this.setOptions=function(e){this.$options=e},this.find=function(e){var t=this.$options,n=this.$matchIterator(e,t);if(!n)return!1;var r=null;return n.forEach(function(e,n,i,o){return r=new s(e,n,i,o),n==o&&t.start&&t.start.start&&t.skipCurrent!=0&&r.isEqual(t.start)?(r=null,!1):!0}),r},this.findAll=function(e){var t=this.$options;if(!t.needle)return[];this.$assembleRegExp(t);var n=t.range,i=n?e.getLines(n.start.row,n.end.row):e.doc.getAllLines(),o=[],u=t.re;if(t.$isMultiLine){var a=u.length,f=i.length-a,l;e:for(var c=u.offset||0;c<=f;c++){for(var h=0;hv)continue;o.push(l=new s(c,v,c+a-1,m)),a>2&&(c=c+a-2)}}else for(var g=0;gE&&o[h].end.row==n.end.row)h--;o=o.slice(g,h+1);for(g=0,h=o.length;g=u;n--)if(c(n,Number.MAX_VALUE,e))return;if(t.wrap==0)return;for(n=a,u=o.row;n>=u;n--)if(c(n,Number.MAX_VALUE,e))return};else var f=function(e){var n=o.row;if(c(n,o.column,e))return;for(n+=1;n<=a;n++)if(c(n,0,e))return;if(t.wrap==0)return;for(n=u,a=o.row;n<=a;n++)if(c(n,0,e))return};if(t.$isMultiLine)var l=n.length,c=function(t,i,s){var o=r?t-l+1:t;if(o<0)return;var u=e.getLine(o),a=u.search(n[0]);if(!r&&ai)return;if(s(o,a,o+l-1,c))return!0};else if(r)var c=function(t,r,i){var s=e.getLine(t),o=[],u,a=0;n.lastIndex=0;while(u=n.exec(s)){var f=u[0].length;a=u.index;if(!f){if(a>=s.length)break;n.lastIndex=a+=1}if(u.index+f>r)break;o.push(u.index,f)}for(var l=o.length-1;l>=0;l-=2){var c=o[l-1],f=o[l];if(i(t,c,t,c+f))return!0}};else var c=function(t,r,i){var s=e.getLine(t),o,u;n.lastIndex=r;while(u=n.exec(s)){var a=u[0].length;o=u.index;if(i(t,o,t,o+a))return!0;if(!a){n.lastIndex=o+=1;if(o>=s.length)return!1}}};return{forEach:f}}}).call(o.prototype),t.Search=o}),define("ace/keyboard/hash_handler",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(e,t,n){"use strict";function o(e,t){this.platform=t||(i.isMac?"mac":"win"),this.commands={},this.commandKeyBinding={},this.addCommands(e),this.$singleCommand=!0}function u(e,t){o.call(this,e,t),this.$singleCommand=!1}var r=e("../lib/keys"),i=e("../lib/useragent"),s=r.KEY_MODS;u.prototype=o.prototype,function(){function e(e){return typeof e=="object"&&e.bindKey&&e.bindKey.position||(e.isDefault?-100:0)}this.addCommand=function(e){this.commands[e.name]&&this.removeCommand(e),this.commands[e.name]=e,e.bindKey&&this._buildKeyHash(e)},this.removeCommand=function(e,t){var n=e&&(typeof e=="string"?e:e.name);e=this.commands[n],t||delete this.commands[n];var r=this.commandKeyBinding;for(var i in r){var s=r[i];if(s==e)delete r[i];else if(Array.isArray(s)){var o=s.indexOf(e);o!=-1&&(s.splice(o,1),s.length==1&&(r[i]=s[0]))}}},this.bindKey=function(e,t,n){typeof e=="object"&&e&&(n==undefined&&(n=e.position),e=e[this.platform]);if(!e)return;if(typeof t=="function")return this.addCommand({exec:t,bindKey:e,name:t.name||e});e.split("|").forEach(function(e){var r="";if(e.indexOf(" ")!=-1){var i=e.split(/\s+/);e=i.pop(),i.forEach(function(e){var t=this.parseKeys(e),n=s[t.hashId]+t.key;r+=(r?" ":"")+n,this._addCommandToBinding(r,"chainKeys")},this),r+=" "}var o=this.parseKeys(e),u=s[o.hashId]+o.key;this._addCommandToBinding(r+u,t,n)},this)},this._addCommandToBinding=function(t,n,r){var i=this.commandKeyBinding,s;if(!n)delete i[t];else if(!i[t]||this.$singleCommand)i[t]=n;else{Array.isArray(i[t])?(s=i[t].indexOf(n))!=-1&&i[t].splice(s,1):i[t]=[i[t]],typeof r!="number"&&(r=e(n));var o=i[t];for(s=0;sr)break}o.splice(s,0,n)}},this.addCommands=function(e){e&&Object.keys(e).forEach(function(t){var n=e[t];if(!n)return;if(typeof n=="string")return this.bindKey(n,t);typeof n=="function"&&(n={exec:n});if(typeof n!="object")return;n.name||(n.name=t),this.addCommand(n)},this)},this.removeCommands=function(e){Object.keys(e).forEach(function(t){this.removeCommand(e[t])},this)},this.bindKeys=function(e){Object.keys(e).forEach(function(t){this.bindKey(t,e[t])},this)},this._buildKeyHash=function(e){this.bindKey(e.bindKey,e)},this.parseKeys=function(e){var t=e.toLowerCase().split(/[\-\+]([\-\+])?/).filter(function(e){return e}),n=t.pop(),i=r[n];if(r.FUNCTION_KEYS[i])n=r.FUNCTION_KEYS[i].toLowerCase();else{if(!t.length)return{key:n,hashId:-1};if(t.length==1&&t[0]=="shift")return{key:n.toUpperCase(),hashId:-1}}var s=0;for(var o=t.length;o--;){var u=r.KEY_MODS[t[o]];if(u==null)return typeof console!="undefined"&&console.error("invalid modifier "+t[o]+" in "+e),!1;s|=u}return{key:n,hashId:s}},this.findKeyCommand=function(t,n){var r=s[t]+n;return this.commandKeyBinding[r]},this.handleKeyboard=function(e,t,n,r){if(r<0)return;var i=s[t]+n,o=this.commandKeyBinding[i];e.$keyChain&&(e.$keyChain+=" "+i,o=this.commandKeyBinding[e.$keyChain]||o);if(o)if(o=="chainKeys"||o[o.length-1]=="chainKeys")return e.$keyChain=e.$keyChain||i,{command:"null"};if(e.$keyChain)if(!!t&&t!=4||n.length!=1){if(t==-1||r>0)e.$keyChain=""}else e.$keyChain=e.$keyChain.slice(0,-i.length-1);return{command:o}},this.getStatusText=function(e,t){return t.$keyChain||""}}.call(o.prototype),t.HashHandler=o,t.MultiHashHandler=u}),define("ace/commands/command_manager",["require","exports","module","ace/lib/oop","ace/keyboard/hash_handler","ace/lib/event_emitter"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("../keyboard/hash_handler").MultiHashHandler,s=e("../lib/event_emitter").EventEmitter,o=function(e,t){i.call(this,t,e),this.byName=this.commands,this.setDefaultHandler("exec",function(e){return e.command.exec(e.editor,e.args||{})})};r.inherits(o,i),function(){r.implement(this,s),this.exec=function(e,t,n){if(Array.isArray(e)){for(var r=e.length;r--;)if(this.exec(e[r],t,n))return!0;return!1}typeof e=="string"&&(e=this.commands[e]);if(!e)return!1;if(t&&t.$readOnly&&!e.readOnly)return!1;if(this.$checkCommandState!=0&&e.isAvailable&&!e.isAvailable(t))return!1;var i={editor:t,command:e,args:n};return i.returnValue=this._emit("exec",i),this._signal("afterExec",i),i.returnValue===!1?!1:!0},this.toggleRecording=function(e){if(this.$inReplay)return;return e&&e._emit("changeStatus"),this.recording?(this.macro.pop(),this.off("exec",this.$addCommandToMacro),this.macro.length||(this.macro=this.oldMacro),this.recording=!1):(this.$addCommandToMacro||(this.$addCommandToMacro=function(e){this.macro.push([e.command,e.args])}.bind(this)),this.oldMacro=this.macro,this.macro=[],this.on("exec",this.$addCommandToMacro),this.recording=!0)},this.replay=function(e){if(this.$inReplay||!this.macro)return;if(this.recording)return this.toggleRecording(e);try{this.$inReplay=!0,this.macro.forEach(function(t){typeof t=="string"?this.exec(t,e):this.exec(t[0],e,t[1])},this)}finally{this.$inReplay=!1}},this.trimMacro=function(e){return e.map(function(e){return typeof e[0]!="string"&&(e[0]=e[0].name),e[1]||(e=e[0]),e})}}.call(o.prototype),t.CommandManager=o}),define("ace/commands/default_commands",["require","exports","module","ace/lib/lang","ace/config","ace/range"],function(e,t,n){"use strict";function o(e,t){return{win:e,mac:t}}var r=e("../lib/lang"),i=e("../config"),s=e("../range").Range;t.commands=[{name:"showSettingsMenu",bindKey:o("Ctrl-,","Command-,"),exec:function(e){i.loadModule("ace/ext/settings_menu",function(t){t.init(e),e.showSettingsMenu()})},readOnly:!0},{name:"goToNextError",bindKey:o("Alt-E","F4"),exec:function(e){i.loadModule("./ext/error_marker",function(t){t.showErrorMarker(e,1)})},scrollIntoView:"animate",readOnly:!0},{name:"goToPreviousError",bindKey:o("Alt-Shift-E","Shift-F4"),exec:function(e){i.loadModule("./ext/error_marker",function(t){t.showErrorMarker(e,-1)})},scrollIntoView:"animate",readOnly:!0},{name:"selectall",description:"Select all",bindKey:o("Ctrl-A","Command-A"),exec:function(e){e.selectAll()},readOnly:!0},{name:"centerselection",description:"Center selection",bindKey:o(null,"Ctrl-L"),exec:function(e){e.centerSelection()},readOnly:!0},{name:"gotoline",description:"Go to line...",bindKey:o("Ctrl-L","Command-L"),exec:function(e,t){typeof t=="number"&&!isNaN(t)&&e.gotoLine(t),e.prompt({$type:"gotoLine"})},readOnly:!0},{name:"fold",bindKey:o("Alt-L|Ctrl-F1","Command-Alt-L|Command-F1"),exec:function(e){e.session.toggleFold(!1)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"unfold",bindKey:o("Alt-Shift-L|Ctrl-Shift-F1","Command-Alt-Shift-L|Command-Shift-F1"),exec:function(e){e.session.toggleFold(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleFoldWidget",bindKey:o("F2","F2"),exec:function(e){e.session.toggleFoldWidget()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleParentFoldWidget",bindKey:o("Alt-F2","Alt-F2"),exec:function(e){e.session.toggleFoldWidget(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"foldall",description:"Fold all",bindKey:o(null,"Ctrl-Command-Option-0"),exec:function(e){e.session.foldAll()},scrollIntoView:"center",readOnly:!0},{name:"foldOther",description:"Fold other",bindKey:o("Alt-0","Command-Option-0"),exec:function(e){e.session.foldAll(),e.session.unfold(e.selection.getAllRanges())},scrollIntoView:"center",readOnly:!0},{name:"unfoldall",description:"Unfold all",bindKey:o("Alt-Shift-0","Command-Option-Shift-0"),exec:function(e){e.session.unfold()},scrollIntoView:"center",readOnly:!0},{name:"findnext",description:"Find next",bindKey:o("Ctrl-K","Command-G"),exec:function(e){e.findNext()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"findprevious",description:"Find previous",bindKey:o("Ctrl-Shift-K","Command-Shift-G"),exec:function(e){e.findPrevious()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"selectOrFindNext",description:"Select or find next",bindKey:o("Alt-K","Ctrl-G"),exec:function(e){e.selection.isEmpty()?e.selection.selectWord():e.findNext()},readOnly:!0},{name:"selectOrFindPrevious",description:"Select or find previous",bindKey:o("Alt-Shift-K","Ctrl-Shift-G"),exec:function(e){e.selection.isEmpty()?e.selection.selectWord():e.findPrevious()},readOnly:!0},{name:"find",description:"Find",bindKey:o("Ctrl-F","Command-F"),exec:function(e){i.loadModule("ace/ext/searchbox",function(t){t.Search(e)})},readOnly:!0},{name:"overwrite",description:"Overwrite",bindKey:"Insert",exec:function(e){e.toggleOverwrite()},readOnly:!0},{name:"selecttostart",description:"Select to start",bindKey:o("Ctrl-Shift-Home","Command-Shift-Home|Command-Shift-Up"),exec:function(e){e.getSelection().selectFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotostart",description:"Go to start",bindKey:o("Ctrl-Home","Command-Home|Command-Up"),exec:function(e){e.navigateFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectup",description:"Select up",bindKey:o("Shift-Up","Shift-Up|Ctrl-Shift-P"),exec:function(e){e.getSelection().selectUp()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golineup",description:"Go line up",bindKey:o("Up","Up|Ctrl-P"),exec:function(e,t){e.navigateUp(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttoend",description:"Select to end",bindKey:o("Ctrl-Shift-End","Command-Shift-End|Command-Shift-Down"),exec:function(e){e.getSelection().selectFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotoend",description:"Go to end",bindKey:o("Ctrl-End","Command-End|Command-Down"),exec:function(e){e.navigateFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectdown",description:"Select down",bindKey:o("Shift-Down","Shift-Down|Ctrl-Shift-N"),exec:function(e){e.getSelection().selectDown()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golinedown",description:"Go line down",bindKey:o("Down","Down|Ctrl-N"),exec:function(e,t){e.navigateDown(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordleft",description:"Select word left",bindKey:o("Ctrl-Shift-Left","Option-Shift-Left"),exec:function(e){e.getSelection().selectWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordleft",description:"Go to word left",bindKey:o("Ctrl-Left","Option-Left"),exec:function(e){e.navigateWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolinestart",description:"Select to line start",bindKey:o("Alt-Shift-Left","Command-Shift-Left|Ctrl-Shift-A"),exec:function(e){e.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolinestart",description:"Go to line start",bindKey:o("Alt-Left|Home","Command-Left|Home|Ctrl-A"),exec:function(e){e.navigateLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectleft",description:"Select left",bindKey:o("Shift-Left","Shift-Left|Ctrl-Shift-B"),exec:function(e){e.getSelection().selectLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoleft",description:"Go to left",bindKey:o("Left","Left|Ctrl-B"),exec:function(e,t){e.navigateLeft(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordright",description:"Select word right",bindKey:o("Ctrl-Shift-Right","Option-Shift-Right"),exec:function(e){e.getSelection().selectWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordright",description:"Go to word right",bindKey:o("Ctrl-Right","Option-Right"),exec:function(e){e.navigateWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolineend",description:"Select to line end",bindKey:o("Alt-Shift-Right","Command-Shift-Right|Shift-End|Ctrl-Shift-E"),exec:function(e){e.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolineend",description:"Go to line end",bindKey:o("Alt-Right|End","Command-Right|End|Ctrl-E"),exec:function(e){e.navigateLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectright",description:"Select right",bindKey:o("Shift-Right","Shift-Right"),exec:function(e){e.getSelection().selectRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoright",description:"Go to right",bindKey:o("Right","Right|Ctrl-F"),exec:function(e,t){e.navigateRight(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectpagedown",description:"Select page down",bindKey:"Shift-PageDown",exec:function(e){e.selectPageDown()},readOnly:!0},{name:"pagedown",description:"Page down",bindKey:o(null,"Option-PageDown"),exec:function(e){e.scrollPageDown()},readOnly:!0},{name:"gotopagedown",description:"Go to page down",bindKey:o("PageDown","PageDown|Ctrl-V"),exec:function(e){e.gotoPageDown()},readOnly:!0},{name:"selectpageup",description:"Select page up",bindKey:"Shift-PageUp",exec:function(e){e.selectPageUp()},readOnly:!0},{name:"pageup",description:"Page up",bindKey:o(null,"Option-PageUp"),exec:function(e){e.scrollPageUp()},readOnly:!0},{name:"gotopageup",description:"Go to page up",bindKey:"PageUp",exec:function(e){e.gotoPageUp()},readOnly:!0},{name:"scrollup",description:"Scroll up",bindKey:o("Ctrl-Up",null),exec:function(e){e.renderer.scrollBy(0,-2*e.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"scrolldown",description:"Scroll down",bindKey:o("Ctrl-Down",null),exec:function(e){e.renderer.scrollBy(0,2*e.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"selectlinestart",description:"Select line start",bindKey:"Shift-Home",exec:function(e){e.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectlineend",description:"Select line end",bindKey:"Shift-End",exec:function(e){e.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"togglerecording",description:"Toggle recording",bindKey:o("Ctrl-Alt-E","Command-Option-E"),exec:function(e){e.commands.toggleRecording(e)},readOnly:!0},{name:"replaymacro",description:"Replay macro",bindKey:o("Ctrl-Shift-E","Command-Shift-E"),exec:function(e){e.commands.replay(e)},readOnly:!0},{name:"jumptomatching",description:"Jump to matching",bindKey:o("Ctrl-\\|Ctrl-P","Command-\\"),exec:function(e){e.jumpToMatching()},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"selecttomatching",description:"Select to matching",bindKey:o("Ctrl-Shift-\\|Ctrl-Shift-P","Command-Shift-\\"),exec:function(e){e.jumpToMatching(!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"expandToMatching",description:"Expand to matching",bindKey:o("Ctrl-Shift-M","Ctrl-Shift-M"),exec:function(e){e.jumpToMatching(!0,!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"passKeysToBrowser",description:"Pass keys to browser",bindKey:o(null,null),exec:function(){},passEvent:!0,readOnly:!0},{name:"copy",description:"Copy",exec:function(e){},readOnly:!0},{name:"cut",description:"Cut",exec:function(e){var t=e.$copyWithEmptySelection&&e.selection.isEmpty(),n=t?e.selection.getLineRange():e.selection.getRange();e._emit("cut",n),n.isEmpty()||e.session.remove(n),e.clearSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"paste",description:"Paste",exec:function(e,t){e.$handlePaste(t)},scrollIntoView:"cursor"},{name:"removeline",description:"Remove line",bindKey:o("Ctrl-D","Command-D"),exec:function(e){e.removeLines()},scrollIntoView:"cursor",multiSelectAction:"forEachLine"},{name:"duplicateSelection",description:"Duplicate selection",bindKey:o("Ctrl-Shift-D","Command-Shift-D"),exec:function(e){e.duplicateSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"sortlines",description:"Sort lines",bindKey:o("Ctrl-Alt-S","Command-Alt-S"),exec:function(e){e.sortLines()},scrollIntoView:"selection",multiSelectAction:"forEachLine"},{name:"togglecomment",description:"Toggle comment",bindKey:o("Ctrl-/","Command-/"),exec:function(e){e.toggleCommentLines()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"toggleBlockComment",description:"Toggle block comment",bindKey:o("Ctrl-Shift-/","Command-Shift-/"),exec:function(e){e.toggleBlockComment()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"modifyNumberUp",description:"Modify number up",bindKey:o("Ctrl-Shift-Up","Alt-Shift-Up"),exec:function(e){e.modifyNumber(1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"modifyNumberDown",description:"Modify number down",bindKey:o("Ctrl-Shift-Down","Alt-Shift-Down"),exec:function(e){e.modifyNumber(-1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"replace",description:"Replace",bindKey:o("Ctrl-H","Command-Option-F"),exec:function(e){i.loadModule("ace/ext/searchbox",function(t){t.Search(e,!0)})}},{name:"undo",description:"Undo",bindKey:o("Ctrl-Z","Command-Z"),exec:function(e){e.undo()}},{name:"redo",description:"Redo",bindKey:o("Ctrl-Shift-Z|Ctrl-Y","Command-Shift-Z|Command-Y"),exec:function(e){e.redo()}},{name:"copylinesup",description:"Copy lines up",bindKey:o("Alt-Shift-Up","Command-Option-Up"),exec:function(e){e.copyLinesUp()},scrollIntoView:"cursor"},{name:"movelinesup",description:"Move lines up",bindKey:o("Alt-Up","Option-Up"),exec:function(e){e.moveLinesUp()},scrollIntoView:"cursor"},{name:"copylinesdown",description:"Copy lines down",bindKey:o("Alt-Shift-Down","Command-Option-Down"),exec:function(e){e.copyLinesDown()},scrollIntoView:"cursor"},{name:"movelinesdown",description:"Move lines down",bindKey:o("Alt-Down","Option-Down"),exec:function(e){e.moveLinesDown()},scrollIntoView:"cursor"},{name:"del",description:"Delete",bindKey:o("Delete","Delete|Ctrl-D|Shift-Delete"),exec:function(e){e.remove("right")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"backspace",description:"Backspace",bindKey:o("Shift-Backspace|Backspace","Ctrl-Backspace|Shift-Backspace|Backspace|Ctrl-H"),exec:function(e){e.remove("left")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"cut_or_delete",description:"Cut or delete",bindKey:o("Shift-Delete",null),exec:function(e){if(!e.selection.isEmpty())return!1;e.remove("left")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestart",description:"Remove to line start",bindKey:o("Alt-Backspace","Command-Backspace"),exec:function(e){e.removeToLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineend",description:"Remove to line end",bindKey:o("Alt-Delete","Ctrl-K|Command-Delete"),exec:function(e){e.removeToLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestarthard",description:"Remove to line start hard",bindKey:o("Ctrl-Shift-Backspace",null),exec:function(e){var t=e.selection.getRange();t.start.column=0,e.session.remove(t)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineendhard",description:"Remove to line end hard",bindKey:o("Ctrl-Shift-Delete",null),exec:function(e){var t=e.selection.getRange();t.end.column=Number.MAX_VALUE,e.session.remove(t)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordleft",description:"Remove word left",bindKey:o("Ctrl-Backspace","Alt-Backspace|Ctrl-Alt-Backspace"),exec:function(e){e.removeWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordright",description:"Remove word right",bindKey:o("Ctrl-Delete","Alt-Delete"),exec:function(e){e.removeWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"outdent",description:"Outdent",bindKey:o("Shift-Tab","Shift-Tab"),exec:function(e){e.blockOutdent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"indent",description:"Indent",bindKey:o("Tab","Tab"),exec:function(e){e.indent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"blockoutdent",description:"Block outdent",bindKey:o("Ctrl-[","Ctrl-["),exec:function(e){e.blockOutdent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"blockindent",description:"Block indent",bindKey:o("Ctrl-]","Ctrl-]"),exec:function(e){e.blockIndent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"insertstring",description:"Insert string",exec:function(e,t){e.insert(t)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"inserttext",description:"Insert text",exec:function(e,t){e.insert(r.stringRepeat(t.text||"",t.times||1))},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"splitline",description:"Split line",bindKey:o(null,"Ctrl-O"),exec:function(e){e.splitLine()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"transposeletters",description:"Transpose letters",bindKey:o("Alt-Shift-X","Ctrl-T"),exec:function(e){e.transposeLetters()},multiSelectAction:function(e){e.transposeSelections(1)},scrollIntoView:"cursor"},{name:"touppercase",description:"To uppercase",bindKey:o("Ctrl-U","Ctrl-U"),exec:function(e){e.toUpperCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"tolowercase",description:"To lowercase",bindKey:o("Ctrl-Shift-U","Ctrl-Shift-U"),exec:function(e){e.toLowerCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"autoindent",description:"Auto Indent",bindKey:o(null,null),exec:function(e){e.autoIndent()},multiSelectAction:"forEachLine",scrollIntoView:"animate"},{name:"expandtoline",description:"Expand to line",bindKey:o("Ctrl-Shift-L","Command-Shift-L"),exec:function(e){var t=e.selection.getRange();t.start.column=t.end.column=0,t.end.row++,e.selection.setRange(t,!1)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"joinlines",description:"Join lines",bindKey:o(null,null),exec:function(e){var t=e.selection.isBackwards(),n=t?e.selection.getSelectionLead():e.selection.getSelectionAnchor(),i=t?e.selection.getSelectionAnchor():e.selection.getSelectionLead(),o=e.session.doc.getLine(n.row).length,u=e.session.doc.getTextRange(e.selection.getRange()),a=u.replace(/\n\s*/," ").length,f=e.session.doc.getLine(n.row);for(var l=n.row+1;l<=i.row+1;l++){var c=r.stringTrimLeft(r.stringTrimRight(e.session.doc.getLine(l)));c.length!==0&&(c=" "+c),f+=c}i.row+10?(e.selection.moveCursorTo(n.row,n.column),e.selection.selectTo(n.row,n.column+a)):(o=e.session.doc.getLine(n.row).length>o?o+1:o,e.selection.moveCursorTo(n.row,o))},multiSelectAction:"forEach",readOnly:!0},{name:"invertSelection",description:"Invert selection",bindKey:o(null,null),exec:function(e){var t=e.session.doc.getLength()-1,n=e.session.doc.getLine(t).length,r=e.selection.rangeList.ranges,i=[];r.length<1&&(r=[e.selection.getRange()]);for(var o=0;o=i.lastRow||r.end.row<=i.firstRow)&&this.renderer.scrollSelectionIntoView(this.selection.anchor,this.selection.lead);break;default:}n=="animate"&&this.renderer.animateScrolling(this.curOp.scrollTop)}var s=this.selection.toJSON();this.curOp.selectionAfter=s,this.$lastSel=this.selection.toJSON(),this.session.getUndoManager().addSelection(s),this.prevOp=this.curOp,this.curOp=null}},this.$mergeableCommands=["backspace","del","insertstring"],this.$historyTracker=function(e){if(!this.$mergeUndoDeltas)return;var t=this.prevOp,n=this.$mergeableCommands,r=t.command&&e.command.name==t.command.name;if(e.command.name=="insertstring"){var i=e.args;this.mergeNextCommand===undefined&&(this.mergeNextCommand=!0),r=r&&this.mergeNextCommand&&(!/\s/.test(i)||/\s/.test(t.args)),this.mergeNextCommand=!0}else r=r&&n.indexOf(e.command.name)!==-1;this.$mergeUndoDeltas!="always"&&Date.now()-this.sequenceStartTime>2e3&&(r=!1),r?this.session.mergeUndoDeltas=!0:n.indexOf(e.command.name)!==-1&&(this.sequenceStartTime=Date.now())},this.setKeyboardHandler=function(e,t){if(e&&typeof e=="string"&&e!="ace"){this.$keybindingId=e;var n=this;g.loadModule(["keybinding",e],function(r){n.$keybindingId==e&&n.keyBinding.setKeyboardHandler(r&&r.handler),t&&t()})}else this.$keybindingId=null,this.keyBinding.setKeyboardHandler(e),t&&t()},this.getKeyboardHandler=function(){return this.keyBinding.getKeyboardHandler()},this.setSession=function(e){if(this.session==e)return;this.curOp&&this.endOperation(),this.curOp={};var t=this.session;if(t){this.session.off("change",this.$onDocumentChange),this.session.off("changeMode",this.$onChangeMode),this.session.off("tokenizerUpdate",this.$onTokenizerUpdate),this.session.off("changeTabSize",this.$onChangeTabSize),this.session.off("changeWrapLimit",this.$onChangeWrapLimit),this.session.off("changeWrapMode",this.$onChangeWrapMode),this.session.off("changeFold",this.$onChangeFold),this.session.off("changeFrontMarker",this.$onChangeFrontMarker),this.session.off("changeBackMarker",this.$onChangeBackMarker),this.session.off("changeBreakpoint",this.$onChangeBreakpoint),this.session.off("changeAnnotation",this.$onChangeAnnotation),this.session.off("changeOverwrite",this.$onCursorChange),this.session.off("changeScrollTop",this.$onScrollTopChange),this.session.off("changeScrollLeft",this.$onScrollLeftChange);var n=this.session.getSelection();n.off("changeCursor",this.$onCursorChange),n.off("changeSelection",this.$onSelectionChange)}this.session=e,e?(this.$onDocumentChange=this.onDocumentChange.bind(this),e.on("change",this.$onDocumentChange),this.renderer.setSession(e),this.$onChangeMode=this.onChangeMode.bind(this),e.on("changeMode",this.$onChangeMode),this.$onTokenizerUpdate=this.onTokenizerUpdate.bind(this),e.on("tokenizerUpdate",this.$onTokenizerUpdate),this.$onChangeTabSize=this.renderer.onChangeTabSize.bind(this.renderer),e.on("changeTabSize",this.$onChangeTabSize),this.$onChangeWrapLimit=this.onChangeWrapLimit.bind(this),e.on("changeWrapLimit",this.$onChangeWrapLimit),this.$onChangeWrapMode=this.onChangeWrapMode.bind(this),e.on("changeWrapMode",this.$onChangeWrapMode),this.$onChangeFold=this.onChangeFold.bind(this),e.on("changeFold",this.$onChangeFold),this.$onChangeFrontMarker=this.onChangeFrontMarker.bind(this),this.session.on("changeFrontMarker",this.$onChangeFrontMarker),this.$onChangeBackMarker=this.onChangeBackMarker.bind(this),this.session.on("changeBackMarker",this.$onChangeBackMarker),this.$onChangeBreakpoint=this.onChangeBreakpoint.bind(this),this.session.on("changeBreakpoint",this.$onChangeBreakpoint),this.$onChangeAnnotation=this.onChangeAnnotation.bind(this),this.session.on("changeAnnotation",this.$onChangeAnnotation),this.$onCursorChange=this.onCursorChange.bind(this),this.session.on("changeOverwrite",this.$onCursorChange),this.$onScrollTopChange=this.onScrollTopChange.bind(this),this.session.on("changeScrollTop",this.$onScrollTopChange),this.$onScrollLeftChange=this.onScrollLeftChange.bind(this),this.session.on("changeScrollLeft",this.$onScrollLeftChange),this.selection=e.getSelection(),this.selection.on("changeCursor",this.$onCursorChange),this.$onSelectionChange=this.onSelectionChange.bind(this),this.selection.on("changeSelection",this.$onSelectionChange),this.onChangeMode(),this.onCursorChange(),this.onScrollTopChange(),this.onScrollLeftChange(),this.onSelectionChange(),this.onChangeFrontMarker(),this.onChangeBackMarker(),this.onChangeBreakpoint(),this.onChangeAnnotation(),this.session.getUseWrapMode()&&this.renderer.adjustWrapLimit(),this.renderer.updateFull()):(this.selection=null,this.renderer.setSession(e)),this._signal("changeSession",{session:e,oldSession:t}),this.curOp=null,t&&t._signal("changeEditor",{oldEditor:this}),e&&e._signal("changeEditor",{editor:this}),e&&e.bgTokenizer&&e.bgTokenizer.scheduleStart()},this.getSession=function(){return this.session},this.setValue=function(e,t){return this.session.doc.setValue(e),t?t==1?this.navigateFileEnd():t==-1&&this.navigateFileStart():this.selectAll(),e},this.getValue=function(){return this.session.getValue()},this.getSelection=function(){return this.selection},this.resize=function(e){this.renderer.onResize(e)},this.setTheme=function(e,t){this.renderer.setTheme(e,t)},this.getTheme=function(){return this.renderer.getTheme()},this.setStyle=function(e){this.renderer.setStyle(e)},this.unsetStyle=function(e){this.renderer.unsetStyle(e)},this.getFontSize=function(){return this.getOption("fontSize")||i.computedStyle(this.container).fontSize},this.setFontSize=function(e){this.setOption("fontSize",e)},this.$highlightBrackets=function(){if(this.$highlightPending)return;var e=this;this.$highlightPending=!0,setTimeout(function(){e.$highlightPending=!1;var t=e.session;if(!t||!t.bgTokenizer)return;t.$bracketHighlight&&(t.$bracketHighlight.markerIds.forEach(function(e){t.removeMarker(e)}),t.$bracketHighlight=null);var n=t.getMatchingBracketRanges(e.getCursorPosition());!n&&t.$mode.getMatching&&(n=t.$mode.getMatching(e.session));if(!n)return;var r="ace_bracket";Array.isArray(n)?n.length==1&&(r="ace_error_bracket"):n=[n],n.length==2&&(p.comparePoints(n[0].end,n[1].start)==0?n=[p.fromPoints(n[0].start,n[1].end)]:p.comparePoints(n[0].start,n[1].end)==0&&(n=[p.fromPoints(n[1].start,n[0].end)])),t.$bracketHighlight={ranges:n,markerIds:n.map(function(e){return t.addMarker(e,r,"text")})}},50)},this.$highlightTags=function(){if(this.$highlightTagPending)return;var e=this;this.$highlightTagPending=!0,setTimeout(function(){e.$highlightTagPending=!1;var t=e.session;if(!t||!t.bgTokenizer)return;var n=e.getCursorPosition(),r=new y(e.session,n.row,n.column),i=r.getCurrentToken();if(!i||!/\b(?:tag-open|tag-name)/.test(i.type)){t.removeMarker(t.$tagHighlight),t.$tagHighlight=null;return}if(i.type.indexOf("tag-open")!=-1){i=r.stepForward();if(!i)return}var s=i.value,o=0,u=r.stepBackward();if(u.value=="<"){do u=i,i=r.stepForward(),i&&i.value===s&&i.type.indexOf("tag-name")!==-1&&(u.value==="<"?o++:u.value==="=0)}else{do i=u,u=r.stepBackward(),i&&i.value===s&&i.type.indexOf("tag-name")!==-1&&(u.value==="<"?o++:u.value==="1)&&(t=!1)}if(e.$highlightLineMarker&&!t)e.removeMarker(e.$highlightLineMarker.id),e.$highlightLineMarker=null;else if(!e.$highlightLineMarker&&t){var n=new p(t.row,t.column,t.row,Infinity);n.id=e.addMarker(n,"ace_active-line","screenLine"),e.$highlightLineMarker=n}else t&&(e.$highlightLineMarker.start.row=t.row,e.$highlightLineMarker.end.row=t.row,e.$highlightLineMarker.start.column=t.column,e._signal("changeBackMarker"))},this.onSelectionChange=function(e){var t=this.session;t.$selectionMarker&&t.removeMarker(t.$selectionMarker),t.$selectionMarker=null;if(!this.selection.isEmpty()){var n=this.selection.getRange(),r=this.getSelectionStyle();t.$selectionMarker=t.addMarker(n,"ace_selection",r)}else this.$updateHighlightActiveLine();var i=this.$highlightSelectedWord&&this.$getSelectionHighLightRegexp();this.session.highlight(i),this._signal("changeSelection")},this.$getSelectionHighLightRegexp=function(){var e=this.session,t=this.getSelectionRange();if(t.isEmpty()||t.isMultiLine())return;var n=t.start.column,r=t.end.column,i=e.getLine(t.start.row),s=i.substring(n,r);if(s.length>5e3||!/[\w\d]/.test(s))return;var o=this.$search.$assembleRegExp({wholeWord:!0,caseSensitive:!0,needle:s}),u=i.substring(n-1,r+1);if(!o.test(u))return;return o},this.onChangeFrontMarker=function(){this.renderer.updateFrontMarkers()},this.onChangeBackMarker=function(){this.renderer.updateBackMarkers()},this.onChangeBreakpoint=function(){this.renderer.updateBreakpoints()},this.onChangeAnnotation=function(){this.renderer.setAnnotations(this.session.getAnnotations())},this.onChangeMode=function(e){this.renderer.updateText(),this._emit("changeMode",e)},this.onChangeWrapLimit=function(){this.renderer.updateFull()},this.onChangeWrapMode=function(){this.renderer.onResize(!0)},this.onChangeFold=function(){this.$updateHighlightActiveLine(),this.renderer.updateFull()},this.getSelectedText=function(){return this.session.getTextRange(this.getSelectionRange())},this.getCopyText=function(){var e=this.getSelectedText(),t=this.session.doc.getNewLineCharacter(),n=!1;if(!e&&this.$copyWithEmptySelection){n=!0;var r=this.selection.getAllRanges();for(var i=0;iu.search(/\S|$/)){var a=u.substr(i.column).search(/\S|$/);n.doc.removeInLine(i.row,i.column,i.column+a)}}this.clearSelection();var f=i.column,l=n.getState(i.row),u=n.getLine(i.row),c=r.checkOutdent(l,u,e);n.insert(i,e),s&&s.selection&&(s.selection.length==2?this.selection.setSelectionRange(new p(i.row,f+s.selection[0],i.row,f+s.selection[1])):this.selection.setSelectionRange(new p(i.row+s.selection[0],s.selection[1],i.row+s.selection[2],s.selection[3])));if(this.$enableAutoIndent){if(n.getDocument().isNewLine(e)){var h=r.getNextLineIndent(l,u.slice(0,i.column),n.getTabString());n.insert({row:i.row+1,column:0},h)}c&&r.autoOutdent(l,n,i.row)}},this.autoIndent=function(){var e=this.session,t=e.getMode(),n,r;if(this.selection.isEmpty())n=0,r=e.doc.getLength()-1;else{var i=this.getSelectionRange();n=i.start.row,r=i.end.row}var s="",o="",u="",a,f,l,c=e.getTabString();for(var h=n;h<=r;h++)h>0&&(s=e.getState(h-1),o=e.getLine(h-1),u=t.getNextLineIndent(s,o,c)),a=e.getLine(h),f=t.$getIndent(a),u!==f&&(f.length>0&&(l=new p(h,0,h,f.length),e.remove(l)),u.length>0&&e.insert({row:h,column:0},u)),t.autoOutdent(s,e,h)},this.onTextInput=function(e,t){if(!t)return this.keyBinding.onTextInput(e);this.startOperation({command:{name:"insertstring"}});var n=this.applyComposition.bind(this,e,t);this.selection.rangeCount?this.forEachSelection(n):n(),this.endOperation()},this.applyComposition=function(e,t){if(t.extendLeft||t.extendRight){var n=this.selection.getRange();n.start.column-=t.extendLeft,n.end.column+=t.extendRight,n.start.column<0&&(n.start.row--,n.start.column+=this.session.getLine(n.start.row).length+1),this.selection.setRange(n),!e&&!n.isEmpty()&&this.remove()}(e||!this.selection.isEmpty())&&this.insert(e,!0);if(t.restoreStart||t.restoreEnd){var n=this.selection.getRange();n.start.column-=t.restoreStart,n.end.column-=t.restoreEnd,this.selection.setRange(n)}},this.onCommandKey=function(e,t,n){return this.keyBinding.onCommandKey(e,t,n)},this.setOverwrite=function(e){this.session.setOverwrite(e)},this.getOverwrite=function(){return this.session.getOverwrite()},this.toggleOverwrite=function(){this.session.toggleOverwrite()},this.setScrollSpeed=function(e){this.setOption("scrollSpeed",e)},this.getScrollSpeed=function(){return this.getOption("scrollSpeed")},this.setDragDelay=function(e){this.setOption("dragDelay",e)},this.getDragDelay=function(){return this.getOption("dragDelay")},this.setSelectionStyle=function(e){this.setOption("selectionStyle",e)},this.getSelectionStyle=function(){return this.getOption("selectionStyle")},this.setHighlightActiveLine=function(e){this.setOption("highlightActiveLine",e)},this.getHighlightActiveLine=function(){return this.getOption("highlightActiveLine")},this.setHighlightGutterLine=function(e){this.setOption("highlightGutterLine",e)},this.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},this.setHighlightSelectedWord=function(e){this.setOption("highlightSelectedWord",e)},this.getHighlightSelectedWord=function(){return this.$highlightSelectedWord},this.setAnimatedScroll=function(e){this.renderer.setAnimatedScroll(e)},this.getAnimatedScroll=function(){return this.renderer.getAnimatedScroll()},this.setShowInvisibles=function(e){this.renderer.setShowInvisibles(e)},this.getShowInvisibles=function(){return this.renderer.getShowInvisibles()},this.setDisplayIndentGuides=function(e){this.renderer.setDisplayIndentGuides(e)},this.getDisplayIndentGuides=function(){return this.renderer.getDisplayIndentGuides()},this.setShowPrintMargin=function(e){this.renderer.setShowPrintMargin(e)},this.getShowPrintMargin=function(){return this.renderer.getShowPrintMargin()},this.setPrintMarginColumn=function(e){this.renderer.setPrintMarginColumn(e)},this.getPrintMarginColumn=function(){return this.renderer.getPrintMarginColumn()},this.setReadOnly=function(e){this.setOption("readOnly",e)},this.getReadOnly=function(){return this.getOption("readOnly")},this.setBehavioursEnabled=function(e){this.setOption("behavioursEnabled",e)},this.getBehavioursEnabled=function(){return this.getOption("behavioursEnabled")},this.setWrapBehavioursEnabled=function(e){this.setOption("wrapBehavioursEnabled",e)},this.getWrapBehavioursEnabled=function(){return this.getOption("wrapBehavioursEnabled")},this.setShowFoldWidgets=function(e){this.setOption("showFoldWidgets",e)},this.getShowFoldWidgets=function(){return this.getOption("showFoldWidgets")},this.setFadeFoldWidgets=function(e){this.setOption("fadeFoldWidgets",e)},this.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},this.remove=function(e){this.selection.isEmpty()&&(e=="left"?this.selection.selectLeft():this.selection.selectRight());var t=this.getSelectionRange();if(this.getBehavioursEnabled()){var n=this.session,r=n.getState(t.start.row),i=n.getMode().transformAction(r,"deletion",this,n,t);if(t.end.column===0){var s=n.getTextRange(t);if(s[s.length-1]=="\n"){var o=n.getLine(t.end.row);/^\s+$/.test(o)&&(t.end.column=o.length)}}i&&(t=i)}this.session.remove(t),this.clearSelection()},this.removeWordRight=function(){this.selection.isEmpty()&&this.selection.selectWordRight(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeWordLeft=function(){this.selection.isEmpty()&&this.selection.selectWordLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeToLineStart=function(){this.selection.isEmpty()&&this.selection.selectLineStart(),this.selection.isEmpty()&&this.selection.selectLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeToLineEnd=function(){this.selection.isEmpty()&&this.selection.selectLineEnd();var e=this.getSelectionRange();e.start.column==e.end.column&&e.start.row==e.end.row&&(e.end.column=0,e.end.row++),this.session.remove(e),this.clearSelection()},this.splitLine=function(){this.selection.isEmpty()||(this.session.remove(this.getSelectionRange()),this.clearSelection());var e=this.getCursorPosition();this.insert("\n"),this.moveCursorToPosition(e)},this.transposeLetters=function(){if(!this.selection.isEmpty())return;var e=this.getCursorPosition(),t=e.column;if(t===0)return;var n=this.session.getLine(e.row),r,i;tt.toLowerCase()?1:0});var i=new p(0,0,0,0);for(var r=e.first;r<=e.last;r++){var s=t.getLine(r);i.start.row=r,i.end.row=r,i.end.column=s.length,t.replace(i,n[r-e.first])}},this.toggleCommentLines=function(){var e=this.session.getState(this.getCursorPosition().row),t=this.$getSelectedRows();this.session.getMode().toggleCommentLines(e,this.session,t.first,t.last)},this.toggleBlockComment=function(){var e=this.getCursorPosition(),t=this.session.getState(e.row),n=this.getSelectionRange();this.session.getMode().toggleBlockComment(t,this.session,n,e)},this.getNumberAt=function(e,t){var n=/[\-]?[0-9]+(?:\.[0-9]+)?/g;n.lastIndex=0;var r=this.session.getLine(e);while(n.lastIndex=t){var s={value:i[0],start:i.index,end:i.index+i[0].length};return s}}return null},this.modifyNumber=function(e){var t=this.selection.getCursor().row,n=this.selection.getCursor().column,r=new p(t,n-1,t,n),i=this.session.getTextRange(r);if(!isNaN(parseFloat(i))&&isFinite(i)){var s=this.getNumberAt(t,n);if(s){var o=s.value.indexOf(".")>=0?s.start+s.value.indexOf(".")+1:s.end,u=s.start+s.value.length-o,a=parseFloat(s.value);a*=Math.pow(10,u),o!==s.end&&n=u&&o<=a&&(n=t,f.selection.clearSelection(),f.moveCursorTo(e,u+r),f.selection.selectTo(e,a+r)),u=a});var l=this.$toggleWordPairs,c;for(var h=0;hp+1)break;p=d.last}l--,u=this.session.$moveLines(h,p,t?0:e),t&&e==-1&&(c=l+1);while(c<=l)o[c].moveBy(u,0),c++;t||(u=0),a+=u}i.fromOrientedRange(i.ranges[0]),i.rangeList.attach(this.session),this.inVirtualSelectionMode=!1}},this.$getSelectedRows=function(e){return e=(e||this.getSelectionRange()).collapseRows(),{first:this.session.getRowFoldStart(e.start.row),last:this.session.getRowFoldEnd(e.end.row)}},this.onCompositionStart=function(e){this.renderer.showComposition(e)},this.onCompositionUpdate=function(e){this.renderer.setCompositionText(e)},this.onCompositionEnd=function(){this.renderer.hideComposition()},this.getFirstVisibleRow=function(){return this.renderer.getFirstVisibleRow()},this.getLastVisibleRow=function(){return this.renderer.getLastVisibleRow()},this.isRowVisible=function(e){return e>=this.getFirstVisibleRow()&&e<=this.getLastVisibleRow()},this.isRowFullyVisible=function(e){return e>=this.renderer.getFirstFullyVisibleRow()&&e<=this.renderer.getLastFullyVisibleRow()},this.$getVisibleRowCount=function(){return this.renderer.getScrollBottomRow()-this.renderer.getScrollTopRow()+1},this.$moveByPage=function(e,t){var n=this.renderer,r=this.renderer.layerConfig,i=e*Math.floor(r.height/r.lineHeight);t===!0?this.selection.$moveSelection(function(){this.moveCursorBy(i,0)}):t===!1&&(this.selection.moveCursorBy(i,0),this.selection.clearSelection());var s=n.scrollTop;n.scrollBy(0,i*r.lineHeight),t!=null&&n.scrollCursorIntoView(null,.5),n.animateScrolling(s)},this.selectPageDown=function(){this.$moveByPage(1,!0)},this.selectPageUp=function(){this.$moveByPage(-1,!0)},this.gotoPageDown=function(){this.$moveByPage(1,!1)},this.gotoPageUp=function(){this.$moveByPage(-1,!1)},this.scrollPageDown=function(){this.$moveByPage(1)},this.scrollPageUp=function(){this.$moveByPage(-1)},this.scrollToRow=function(e){this.renderer.scrollToRow(e)},this.scrollToLine=function(e,t,n,r){this.renderer.scrollToLine(e,t,n,r)},this.centerSelection=function(){var e=this.getSelectionRange(),t={row:Math.floor(e.start.row+(e.end.row-e.start.row)/2),column:Math.floor(e.start.column+(e.end.column-e.start.column)/2)};this.renderer.alignCursor(t,.5)},this.getCursorPosition=function(){return this.selection.getCursor()},this.getCursorPositionScreen=function(){return this.session.documentToScreenPosition(this.getCursorPosition())},this.getSelectionRange=function(){return this.selection.getRange()},this.selectAll=function(){this.selection.selectAll()},this.clearSelection=function(){this.selection.clearSelection()},this.moveCursorTo=function(e,t){this.selection.moveCursorTo(e,t)},this.moveCursorToPosition=function(e){this.selection.moveCursorToPosition(e)},this.jumpToMatching=function(e,t){var n=this.getCursorPosition(),r=new y(this.session,n.row,n.column),i=r.getCurrentToken(),s=i||r.stepForward();if(!s)return;var o,u=!1,a={},f=n.column-s.start,l,c={")":"(","(":"(","]":"[","[":"[","{":"{","}":"{"};do{if(s.value.match(/[{}()\[\]]/g))for(;f=0;--s)this.$tryReplace(n[s],e)&&r++;return this.selection.setSelectionRange(i),r},this.$tryReplace=function(e,t){var n=this.session.getTextRange(e);return t=this.$search.replace(n,t),t!==null?(e.end=this.session.replace(e,t),e):null},this.getLastSearchOptions=function(){return this.$search.getOptions()},this.find=function(e,t,n){t||(t={}),typeof e=="string"||e instanceof RegExp?t.needle=e:typeof e=="object"&&r.mixin(t,e);var i=this.selection.getRange();t.needle==null&&(e=this.session.getTextRange(i)||this.$search.$options.needle,e||(i=this.session.getWordRange(i.start.row,i.start.column),e=this.session.getTextRange(i)),this.$search.set({needle:e})),this.$search.set(t),t.start||this.$search.set({start:i});var s=this.$search.find(this.session);if(t.preventScroll)return s;if(s)return this.revealRange(s,n),s;t.backwards?i.start=i.end:i.end=i.start,this.selection.setRange(i)},this.findNext=function(e,t){this.find({skipCurrent:!0,backwards:!1},e,t)},this.findPrevious=function(e,t){this.find(e,{skipCurrent:!0,backwards:!0},t)},this.revealRange=function(e,t){this.session.unfold(e),this.selection.setSelectionRange(e);var n=this.renderer.scrollTop;this.renderer.scrollSelectionIntoView(e.start,e.end,.5),t!==!1&&this.renderer.animateScrolling(n)},this.undo=function(){this.session.getUndoManager().undo(this.session),this.renderer.scrollCursorIntoView(null,.5)},this.redo=function(){this.session.getUndoManager().redo(this.session),this.renderer.scrollCursorIntoView(null,.5)},this.destroy=function(){this.$toDestroy&&(this.$toDestroy.forEach(function(e){e.destroy()}),this.$toDestroy=null),this.renderer.destroy(),this._signal("destroy",this),this.session&&this.session.destroy(),this._$emitInputEvent&&this._$emitInputEvent.cancel(),this.removeAllListeners()},this.setAutoScrollEditorIntoView=function(e){if(!e)return;var t,n=this,r=!1;this.$scrollAnchor||(this.$scrollAnchor=document.createElement("div"));var i=this.$scrollAnchor;i.style.cssText="position:absolute",this.container.insertBefore(i,this.container.firstChild);var s=this.on("changeSelection",function(){r=!0}),o=this.renderer.on("beforeRender",function(){r&&(t=n.renderer.container.getBoundingClientRect())}),u=this.renderer.on("afterRender",function(){if(r&&t&&(n.isFocused()||n.searchBox&&n.searchBox.isFocused())){var e=n.renderer,s=e.$cursorLayer.$pixelPos,o=e.layerConfig,u=s.top-o.offset;s.top>=0&&u+t.top<0?r=!0:s.topwindow.innerHeight?r=!1:r=null,r!=null&&(i.style.top=u+"px",i.style.left=s.left+"px",i.style.height=o.lineHeight+"px",i.scrollIntoView(r)),r=t=null}});this.setAutoScrollEditorIntoView=function(e){if(e)return;delete this.setAutoScrollEditorIntoView,this.off("changeSelection",s),this.renderer.off("afterRender",u),this.renderer.off("beforeRender",o)}},this.$resetCursorStyle=function(){var e=this.$cursorStyle||"ace",t=this.renderer.$cursorLayer;if(!t)return;t.setSmoothBlinking(/smooth/.test(e)),t.isBlinking=!this.$readOnly&&e!="wide",i.setCssClass(t.element,"ace_slim-cursors",/slim/.test(e))},this.prompt=function(e,t,n){var r=this;g.loadModule("./ext/prompt",function(i){i.prompt(r,e,t,n)})}}.call(w.prototype),g.defineOptions(w.prototype,"editor",{selectionStyle:{set:function(e){this.onSelectionChange(),this._signal("changeSelectionStyle",{data:e})},initialValue:"line"},highlightActiveLine:{set:function(){this.$updateHighlightActiveLine()},initialValue:!0},highlightSelectedWord:{set:function(e){this.$onSelectionChange()},initialValue:!0},readOnly:{set:function(e){this.textInput.setReadOnly(e),this.$resetCursorStyle()},initialValue:!1},copyWithEmptySelection:{set:function(e){this.textInput.setCopyWithEmptySelection(e)},initialValue:!1},cursorStyle:{set:function(e){this.$resetCursorStyle()},values:["ace","slim","smooth","wide"],initialValue:"ace"},mergeUndoDeltas:{values:[!1,!0,"always"],initialValue:!0},behavioursEnabled:{initialValue:!0},wrapBehavioursEnabled:{initialValue:!0},enableAutoIndent:{initialValue:!0},autoScrollEditorIntoView:{set:function(e){this.setAutoScrollEditorIntoView(e)}},keyboardHandler:{set:function(e){this.setKeyboardHandler(e)},get:function(){return this.$keybindingId},handlesSet:!0},value:{set:function(e){this.session.setValue(e)},get:function(){return this.getValue()},handlesSet:!0,hidden:!0},session:{set:function(e){this.setSession(e)},get:function(){return this.session},handlesSet:!0,hidden:!0},showLineNumbers:{set:function(e){this.renderer.$gutterLayer.setShowLineNumbers(e),this.renderer.$loop.schedule(this.renderer.CHANGE_GUTTER),e&&this.$relativeLineNumbers?E.attach(this):E.detach(this)},initialValue:!0},relativeLineNumbers:{set:function(e){this.$showLineNumbers&&e?E.attach(this):E.detach(this)}},placeholder:{set:function(e){this.$updatePlaceholder||(this.$updatePlaceholder=function(){var e=this.session&&(this.renderer.$composition||this.getValue());if(e&&this.renderer.placeholderNode)this.renderer.off("afterRender",this.$updatePlaceholder),i.removeCssClass(this.container,"ace_hasPlaceholder"),this.renderer.placeholderNode.remove(),this.renderer.placeholderNode=null;else if(!e&&!this.renderer.placeholderNode){this.renderer.on("afterRender",this.$updatePlaceholder),i.addCssClass(this.container,"ace_hasPlaceholder");var t=i.createElement("div");t.className="ace_placeholder",t.textContent=this.$placeholder||"",this.renderer.placeholderNode=t,this.renderer.content.appendChild(this.renderer.placeholderNode)}else!e&&this.renderer.placeholderNode&&(this.renderer.placeholderNode.textContent=this.$placeholder||"")}.bind(this),this.on("input",this.$updatePlaceholder)),this.$updatePlaceholder()}},hScrollBarAlwaysVisible:"renderer",vScrollBarAlwaysVisible:"renderer",highlightGutterLine:"renderer",animatedScroll:"renderer",showInvisibles:"renderer",showPrintMargin:"renderer",printMarginColumn:"renderer",printMargin:"renderer",fadeFoldWidgets:"renderer",showFoldWidgets:"renderer",displayIndentGuides:"renderer",showGutter:"renderer",fontSize:"renderer",fontFamily:"renderer",maxLines:"renderer",minLines:"renderer",scrollPastEnd:"renderer",fixedWidthGutter:"renderer",theme:"renderer",hasCssTransforms:"renderer",maxPixelHeight:"renderer",useTextareaForIME:"renderer",scrollSpeed:"$mouseHandler",dragDelay:"$mouseHandler",dragEnabled:"$mouseHandler",focusTimeout:"$mouseHandler",tooltipFollowsMouse:"$mouseHandler",firstLineNumber:"session",overwrite:"session",newLineMode:"session",useWorker:"session",useSoftTabs:"session",navigateWithinSoftTabs:"session",tabSize:"session",wrap:"session",indentedSoftWrap:"session",foldStyle:"session",mode:"session"});var E={getText:function(e,t){return(Math.abs(e.selection.lead.row-t)||t+1+(t<9?"\u00b7":""))+""},getWidth:function(e,t,n){return Math.max(t.toString().length,(n.lastRow+1).toString().length,2)*n.characterWidth},update:function(e,t){t.renderer.$loop.schedule(t.renderer.CHANGE_GUTTER)},attach:function(e){e.renderer.$gutterLayer.$renderer=this,e.on("changeSelection",this.update),this.update(null,e)},detach:function(e){e.renderer.$gutterLayer.$renderer==this&&(e.renderer.$gutterLayer.$renderer=null),e.off("changeSelection",this.update),this.update(null,e)}};t.Editor=w}),define("ace/undomanager",["require","exports","module","ace/range"],function(e,t,n){"use strict";function i(e,t){for(var n=t;n--;){var r=e[n];if(r&&!r[0].ignore){while(n0){a.row+=i,a.column+=a.row==r.row?s:0;continue}!t&&l<=0&&(a.row=n.row,a.column=n.column,l===0&&(a.bias=1))}}function f(e){return{row:e.row,column:e.column}}function l(e){return{start:f(e.start),end:f(e.end),action:e.action,lines:e.lines.slice()}}function c(e){e=e||this;if(Array.isArray(e))return e.map(c).join("\n");var t="";e.action?(t=e.action=="insert"?"+":"-",t+="["+e.lines+"]"):e.value&&(Array.isArray(e.value)?t=e.value.map(h).join("\n"):t=h(e.value)),e.start&&(t+=h(e));if(e.id||e.rev)t+=" ("+(e.id||e.rev)+")";return t}function h(e){return e.start.row+":"+e.start.column+"=>"+e.end.row+":"+e.end.column}function p(e,t){var n=e.action=="insert",r=t.action=="insert";if(n&&r)if(o(t.start,e.end)>=0)m(t,e,-1);else{if(!(o(t.start,e.start)<=0))return null;m(e,t,1)}else if(n&&!r)if(o(t.start,e.end)>=0)m(t,e,-1);else{if(!(o(t.end,e.start)<=0))return null;m(e,t,-1)}else if(!n&&r)if(o(t.start,e.start)>=0)m(t,e,1);else{if(!(o(t.start,e.start)<=0))return null;m(e,t,1)}else if(!n&&!r)if(o(t.start,e.start)>=0)m(t,e,1);else{if(!(o(t.end,e.start)<=0))return null;m(e,t,-1)}return[t,e]}function d(e,t){for(var n=e.length;n--;)for(var r=0;r=0?m(e,t,-1):o(e.start,t.start)<=0?m(t,e,1):(m(e,s.fromPoints(t.start,e.start),-1),m(t,e,1));else if(!n&&r)o(t.start,e.end)>=0?m(t,e,-1):o(t.start,e.start)<=0?m(e,t,1):(m(t,s.fromPoints(e.start,t.start),-1),m(e,t,1));else if(!n&&!r)if(o(t.start,e.end)>=0)m(t,e,-1);else{if(!(o(t.end,e.start)<=0)){var i,u;return o(e.start,t.start)<0&&(i=e,e=y(e,t.start)),o(e.end,t.end)>0&&(u=y(e,t.end)),g(t.end,e.start,e.end,-1),u&&!i&&(e.lines=u.lines,e.start=u.start,e.end=u.end,u=e),[t,i,u].filter(Boolean)}m(e,t,-1)}return[t,e]}function m(e,t,n){g(e.start,t.start,t.end,n),g(e.end,t.start,t.end,n)}function g(e,t,n,r){e.row==(r==1?t:n).row&&(e.column+=r*(n.column-t.column)),e.row+=r*(n.row-t.row)}function y(e,t){var n=e.lines,r=e.end;e.end=f(t);var i=e.end.row-e.start.row,s=n.splice(i,n.length),o=i?t.column:t.column-e.start.column;n.push(s[0].substring(0,o)),s[0]=s[0].substr(o);var u={start:f(t),end:r,lines:s,action:e.action};return u}function b(e,t){t=l(t);for(var n=e.length;n--;){var r=e[n];for(var i=0;i0},this.canRedo=function(){return this.$redoStack.length>0},this.bookmark=function(e){e==undefined&&(e=this.$rev),this.mark=e},this.isAtBookmark=function(){return this.$rev===this.mark},this.toJSON=function(){},this.fromJSON=function(){},this.hasUndo=this.canUndo,this.hasRedo=this.canRedo,this.isClean=this.isAtBookmark,this.markClean=this.bookmark,this.$prettyPrint=function(e){return e?c(e):c(this.$undoStack)+"\n---\n"+c(this.$redoStack)}}).call(r.prototype);var s=e("./range").Range,o=s.comparePoints,u=s.comparePoints;t.UndoManager=r}),define("ace/layer/lines",["require","exports","module","ace/lib/dom"],function(e,t,n){"use strict";var r=e("../lib/dom"),i=function(e,t){this.element=e,this.canvasHeight=t||5e5,this.element.style.height=this.canvasHeight*2+"px",this.cells=[],this.cellCache=[],this.$offsetCoefficient=0};(function(){this.moveContainer=function(e){r.translate(this.element,0,-(e.firstRowScreen*e.lineHeight%this.canvasHeight)-e.offset*this.$offsetCoefficient)},this.pageChanged=function(e,t){return Math.floor(e.firstRowScreen*e.lineHeight/this.canvasHeight)!==Math.floor(t.firstRowScreen*t.lineHeight/this.canvasHeight)},this.computeLineTop=function(e,t,n){var r=t.firstRowScreen*t.lineHeight,i=Math.floor(r/this.canvasHeight),s=n.documentToScreenRow(e,0)*t.lineHeight;return s-i*this.canvasHeight},this.computeLineHeight=function(e,t,n){return t.lineHeight*n.getRowLineCount(e)},this.getLength=function(){return this.cells.length},this.get=function(e){return this.cells[e]},this.shift=function(){this.$cacheCell(this.cells.shift())},this.pop=function(){this.$cacheCell(this.cells.pop())},this.push=function(e){if(Array.isArray(e)){this.cells.push.apply(this.cells,e);var t=r.createFragment(this.element);for(var n=0;ns&&(a=i.end.row+1,i=t.getNextFoldLine(a,i),s=i?i.start.row:Infinity);if(a>r){while(this.$lines.getLength()>u+1)this.$lines.pop();break}o=this.$lines.get(++u),o?o.row=a:(o=this.$lines.createCell(a,e,this.session,f),this.$lines.push(o)),this.$renderCell(o,e,i,a),a++}this._signal("afterRender"),this.$updateGutterWidth(e)},this.$updateGutterWidth=function(e){var t=this.session,n=t.gutterRenderer||this.$renderer,r=t.$firstLineNumber,i=this.$lines.last()?this.$lines.last().text:"";if(this.$fixedWidth||t.$useWrapMode)i=t.getLength()+r-1;var s=n?n.getWidth(t,i,e):i.toString().length*e.characterWidth,o=this.$padding||this.$computePadding();s+=o.left+o.right,s!==this.gutterWidth&&!isNaN(s)&&(this.gutterWidth=s,this.element.parentNode.style.width=this.element.style.width=Math.ceil(this.gutterWidth)+"px",this._signal("changeGutterWidth",s))},this.$updateCursorRow=function(){if(!this.$highlightGutterLine)return;var e=this.session.selection.getCursor();if(this.$cursorRow===e.row)return;this.$cursorRow=e.row},this.updateLineHighlight=function(){if(!this.$highlightGutterLine)return;var e=this.session.selection.cursor.row;this.$cursorRow=e;if(this.$cursorCell&&this.$cursorCell.row==e)return;this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ",""));var t=this.$lines.cells;this.$cursorCell=null;for(var n=0;n=this.$cursorRow){if(r.row>this.$cursorRow){var i=this.session.getFoldLine(this.$cursorRow);if(!(n>0&&i&&i.start.row==t[n-1].row))break;r=t[n-1]}r.element.className="ace_gutter-active-line "+r.element.className,this.$cursorCell=r;break}}},this.scrollLines=function(e){var t=this.config;this.config=e,this.$updateCursorRow();if(this.$lines.pageChanged(t,e))return this.update(e);this.$lines.moveContainer(e);var n=Math.min(e.lastRow+e.gutterOffset,this.session.getLength()-1),r=this.oldLastRow;this.oldLastRow=n;if(!t||r0;i--)this.$lines.shift();if(r>n)for(var i=this.session.getFoldedRowCount(n+1,r);i>0;i--)this.$lines.pop();e.firstRowr&&this.$lines.push(this.$renderLines(e,r+1,n)),this.updateLineHighlight(),this._signal("afterRender"),this.$updateGutterWidth(e)},this.$renderLines=function(e,t,n){var r=[],i=t,s=this.session.getNextFoldLine(i),o=s?s.start.row:Infinity;for(;;){i>o&&(i=s.end.row+1,s=this.session.getNextFoldLine(i,s),o=s?s.start.row:Infinity);if(i>n)break;var u=this.$lines.createCell(i,e,this.session,f);this.$renderCell(u,e,s,i),r.push(u),i++}return r},this.$renderCell=function(e,t,n,i){var s=e.element,o=this.session,u=s.childNodes[0],a=s.childNodes[1],f=o.$firstLineNumber,l=o.$breakpoints,c=o.$decorations,h=o.gutterRenderer||this.$renderer,p=this.$showFoldWidgets&&o.foldWidgets,d=n?n.start.row:Number.MAX_VALUE,v="ace_gutter-cell ";this.$highlightGutterLine&&(i==this.$cursorRow||n&&i=d&&this.$cursorRow<=n.end.row)&&(v+="ace_gutter-active-line ",this.$cursorCell!=e&&(this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ","")),this.$cursorCell=e)),l[i]&&(v+=l[i]),c[i]&&(v+=c[i]),this.$annotations[i]&&(v+=this.$annotations[i].className),s.className!=v&&(s.className=v);if(p){var m=p[i];m==null&&(m=p[i]=o.getFoldWidget(i))}if(m){var v="ace_fold-widget ace_"+m;m=="start"&&i==d&&in.right-t.right)return"foldWidgets"}}).call(a.prototype),t.Gutter=a}),define("ace/layer/marker",["require","exports","module","ace/range","ace/lib/dom"],function(e,t,n){"use strict";var r=e("../range").Range,i=e("../lib/dom"),s=function(e){this.element=i.createElement("div"),this.element.className="ace_layer ace_marker-layer",e.appendChild(this.element)};(function(){function e(e,t,n,r){return(e?1:0)|(t?2:0)|(n?4:0)|(r?8:0)}this.$padding=0,this.setPadding=function(e){this.$padding=e},this.setSession=function(e){this.session=e},this.setMarkers=function(e){this.markers=e},this.elt=function(e,t){var n=this.i!=-1&&this.element.childNodes[this.i];n?this.i++:(n=document.createElement("div"),this.element.appendChild(n),this.i=-1),n.style.cssText=t,n.className=e},this.update=function(e){if(!e)return;this.config=e,this.i=0;var t;for(var n in this.markers){var r=this.markers[n];if(!r.range){r.update(t,this,this.session,e);continue}var i=r.range.clipRows(e.firstRow,e.lastRow);if(i.isEmpty())continue;i=i.toScreenRange(this.session);if(r.renderer){var s=this.$getTop(i.start.row,e),o=this.$padding+i.start.column*e.characterWidth;r.renderer(t,i,o,s,e)}else r.type=="fullLine"?this.drawFullLineMarker(t,i,r.clazz,e):r.type=="screenLine"?this.drawScreenLineMarker(t,i,r.clazz,e):i.isMultiLine()?r.type=="text"?this.drawTextMarker(t,i,r.clazz,e):this.drawMultiLineMarker(t,i,r.clazz,e):this.drawSingleLineMarker(t,i,r.clazz+" ace_start"+" ace_br15",e)}if(this.i!=-1)while(this.ip,l==f),s,l==f?0:1,o)},this.drawMultiLineMarker=function(e,t,n,r,i){var s=this.$padding,o=r.lineHeight,u=this.$getTop(t.start.row,r),a=s+t.start.column*r.characterWidth;i=i||"";if(this.session.$bidiHandler.isBidiRow(t.start.row)){var f=t.clone();f.end.row=f.start.row,f.end.column=this.session.getLine(f.start.row).length,this.drawBidiSingleLineMarker(e,f,n+" ace_br1 ace_start",r,null,i)}else this.elt(n+" ace_br1 ace_start","height:"+o+"px;"+"right:0;"+"top:"+u+"px;left:"+a+"px;"+(i||""));if(this.session.$bidiHandler.isBidiRow(t.end.row)){var f=t.clone();f.start.row=f.end.row,f.start.column=0,this.drawBidiSingleLineMarker(e,f,n+" ace_br12",r,null,i)}else{u=this.$getTop(t.end.row,r);var l=t.end.column*r.characterWidth;this.elt(n+" ace_br12","height:"+o+"px;"+"width:"+l+"px;"+"top:"+u+"px;"+"left:"+s+"px;"+(i||""))}o=(t.end.row-t.start.row-1)*r.lineHeight;if(o<=0)return;u=this.$getTop(t.start.row+1,r);var c=(t.start.column?1:0)|(t.end.column?0:8);this.elt(n+(c?" ace_br"+c:""),"height:"+o+"px;"+"right:0;"+"top:"+u+"px;"+"left:"+s+"px;"+(i||""))},this.drawSingleLineMarker=function(e,t,n,r,i,s){if(this.session.$bidiHandler.isBidiRow(t.start.row))return this.drawBidiSingleLineMarker(e,t,n,r,i,s);var o=r.lineHeight,u=(t.end.column+(i||0)-t.start.column)*r.characterWidth,a=this.$getTop(t.start.row,r),f=this.$padding+t.start.column*r.characterWidth;this.elt(n,"height:"+o+"px;"+"width:"+u+"px;"+"top:"+a+"px;"+"left:"+f+"px;"+(s||""))},this.drawBidiSingleLineMarker=function(e,t,n,r,i,s){var o=r.lineHeight,u=this.$getTop(t.start.row,r),a=this.$padding,f=this.session.$bidiHandler.getSelections(t.start.column,t.end.column);f.forEach(function(e){this.elt(n,"height:"+o+"px;"+"width:"+e.width+(i||0)+"px;"+"top:"+u+"px;"+"left:"+(a+e.left)+"px;"+(s||""))},this)},this.drawFullLineMarker=function(e,t,n,r,i){var s=this.$getTop(t.start.row,r),o=r.lineHeight;t.start.row!=t.end.row&&(o+=this.$getTop(t.end.row,r)-s),this.elt(n,"height:"+o+"px;"+"top:"+s+"px;"+"left:0;right:0;"+(i||""))},this.drawScreenLineMarker=function(e,t,n,r,i){var s=this.$getTop(t.start.row,r),o=r.lineHeight;this.elt(n,"height:"+o+"px;"+"top:"+s+"px;"+"left:0;right:0;"+(i||""))}}).call(s.prototype),t.Marker=s}),define("ace/layer/text",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/layer/lines","ace/lib/event_emitter"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("../lib/dom"),s=e("../lib/lang"),o=e("./lines").Lines,u=e("../lib/event_emitter").EventEmitter,a=function(e){this.dom=i,this.element=this.dom.createElement("div"),this.element.className="ace_layer ace_text-layer",e.appendChild(this.element),this.$updateEolChar=this.$updateEolChar.bind(this),this.$lines=new o(this.element)};(function(){r.implement(this,u),this.EOF_CHAR="\u00b6",this.EOL_CHAR_LF="\u00ac",this.EOL_CHAR_CRLF="\u00a4",this.EOL_CHAR=this.EOL_CHAR_LF,this.TAB_CHAR="\u2014",this.SPACE_CHAR="\u00b7",this.$padding=0,this.MAX_LINE_LENGTH=1e4,this.$updateEolChar=function(){var e=this.session.doc,t=e.getNewLineCharacter()=="\n"&&e.getNewLineMode()!="windows",n=t?this.EOL_CHAR_LF:this.EOL_CHAR_CRLF;if(this.EOL_CHAR!=n)return this.EOL_CHAR=n,!0},this.setPadding=function(e){this.$padding=e,this.element.style.margin="0 "+e+"px"},this.getLineHeight=function(){return this.$fontMetrics.$characterSize.height||0},this.getCharacterWidth=function(){return this.$fontMetrics.$characterSize.width||0},this.$setFontMetrics=function(e){this.$fontMetrics=e,this.$fontMetrics.on("changeCharacterSize",function(e){this._signal("changeCharacterSize",e)}.bind(this)),this.$pollSizeChanges()},this.checkForSizeChanges=function(){this.$fontMetrics.checkForSizeChanges()},this.$pollSizeChanges=function(){return this.$pollSizeChangesTimer=this.$fontMetrics.$pollSizeChanges()},this.setSession=function(e){this.session=e,e&&this.$computeTabString()},this.showInvisibles=!1,this.showSpaces=!1,this.showTabs=!1,this.showEOL=!1,this.setShowInvisibles=function(e){return this.showInvisibles==e?!1:(this.showInvisibles=e,typeof e=="string"?(this.showSpaces=/tab/i.test(e),this.showTabs=/space/i.test(e),this.showEOL=/eol/i.test(e)):this.showSpaces=this.showTabs=this.showEOL=e,this.$computeTabString(),!0)},this.displayIndentGuides=!0,this.setDisplayIndentGuides=function(e){return this.displayIndentGuides==e?!1:(this.displayIndentGuides=e,this.$computeTabString(),!0)},this.$tabStrings=[],this.onChangeTabSize=this.$computeTabString=function(){var e=this.session.getTabSize();this.tabSize=e;var t=this.$tabStrings=[0];for(var n=1;nl&&(u=a.end.row+1,a=this.session.getNextFoldLine(u,a),l=a?a.start.row:Infinity);if(u>i)break;var c=s[o++];if(c){this.dom.removeChildren(c),this.$renderLine(c,u,u==l?a:!1),f&&(c.style.top=this.$lines.computeLineTop(u,e,this.session)+"px");var h=e.lineHeight*this.session.getRowLength(u)+"px";c.style.height!=h&&(f=!0,c.style.height=h)}u++}if(f)while(o0;i--)this.$lines.shift();if(t.lastRow>e.lastRow)for(var i=this.session.getFoldedRowCount(e.lastRow+1,t.lastRow);i>0;i--)this.$lines.pop();e.firstRowt.lastRow&&this.$lines.push(this.$renderLinesFragment(e,t.lastRow+1,e.lastRow))},this.$renderLinesFragment=function(e,t,n){var r=[],s=t,o=this.session.getNextFoldLine(s),u=o?o.start.row:Infinity;for(;;){s>u&&(s=o.end.row+1,o=this.session.getNextFoldLine(s,o),u=o?o.start.row:Infinity);if(s>n)break;var a=this.$lines.createCell(s,e,this.session),f=a.element;this.dom.removeChildren(f),i.setStyle(f.style,"height",this.$lines.computeLineHeight(s,e,this.session)+"px"),i.setStyle(f.style,"top",this.$lines.computeLineTop(s,e,this.session)+"px"),this.$renderLine(f,s,s==u?o:!1),this.$useLineGroups()?f.className="ace_line_group":f.className="ace_line",r.push(a),s++}return r},this.update=function(e){this.$lines.moveContainer(e),this.config=e;var t=e.firstRow,n=e.lastRow,r=this.$lines;while(r.getLength())r.pop();r.push(this.$renderLinesFragment(e,t,n))},this.$textToken={text:!0,rparen:!0,lparen:!0},this.$renderToken=function(e,t,n,r){var i=this,o=/(\t)|( +)|([\x00-\x1f\x80-\xa0\xad\u1680\u180E\u2000-\u200f\u2028\u2029\u202F\u205F\uFEFF\uFFF9-\uFFFC]+)|(\u3000)|([\u1100-\u115F\u11A3-\u11A7\u11FA-\u11FF\u2329-\u232A\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3001-\u303E\u3041-\u3096\u3099-\u30FF\u3105-\u312D\u3131-\u318E\u3190-\u31BA\u31C0-\u31E3\u31F0-\u321E\u3220-\u3247\u3250-\u32FE\u3300-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFAFF\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFF01-\uFF60\uFFE0-\uFFE6]|[\uD800-\uDBFF][\uDC00-\uDFFF])/g,u=this.dom.createFragment(this.element),a,f=0;while(a=o.exec(r)){var l=a[1],c=a[2],h=a[3],p=a[4],d=a[5];if(!i.showSpaces&&c)continue;var v=f!=a.index?r.slice(f,a.index):"";f=a.index+a[0].length,v&&u.appendChild(this.dom.createTextNode(v,this.element));if(l){var m=i.session.getScreenTabSize(t+a.index);u.appendChild(i.$tabStrings[m].cloneNode(!0)),t+=m-1}else if(c)if(i.showSpaces){var g=this.dom.createElement("span");g.className="ace_invisible ace_invisible_space",g.textContent=s.stringRepeat(i.SPACE_CHAR,c.length),u.appendChild(g)}else u.appendChild(this.com.createTextNode(c,this.element));else if(h){var g=this.dom.createElement("span");g.className="ace_invisible ace_invisible_space ace_invalid",g.textContent=s.stringRepeat(i.SPACE_CHAR,h.length),u.appendChild(g)}else if(p){t+=1;var g=this.dom.createElement("span");g.style.width=i.config.characterWidth*2+"px",g.className=i.showSpaces?"ace_cjk ace_invisible ace_invisible_space":"ace_cjk",g.textContent=i.showSpaces?i.SPACE_CHAR:p,u.appendChild(g)}else if(d){t+=1;var g=this.dom.createElement("span");g.style.width=i.config.characterWidth*2+"px",g.className="ace_cjk",g.textContent=d,u.appendChild(g)}}u.appendChild(this.dom.createTextNode(f?r.slice(f):r,this.element));if(!this.$textToken[n.type]){var y="ace_"+n.type.replace(/\./g," ace_"),g=this.dom.createElement("span");n.type=="fold"&&(g.style.width=n.value.length*this.config.characterWidth+"px"),g.className=y,g.appendChild(u),e.appendChild(g)}else e.appendChild(u);return t+r.length},this.renderIndentGuide=function(e,t,n){var r=t.search(this.$indentGuideRe);if(r<=0||r>=n)return t;if(t[0]==" "){r-=r%this.tabSize;var i=r/this.tabSize;for(var s=0;s=o)u=this.$renderToken(a,u,l,c.substring(0,o-r)),c=c.substring(o-r),r=o,a=this.$createLineElement(),e.appendChild(a),a.appendChild(this.dom.createTextNode(s.stringRepeat("\u00a0",n.indent),this.element)),i++,u=0,o=n[i]||Number.MAX_VALUE;c.length!=0&&(r+=c.length,u=this.$renderToken(a,u,l,c))}}n[n.length-1]>this.MAX_LINE_LENGTH&&this.$renderOverflowMessage(a,u,null,"",!0)},this.$renderSimpleLine=function(e,t){var n=0,r=t[0],i=r.value;this.displayIndentGuides&&(i=this.renderIndentGuide(e,i)),i&&(n=this.$renderToken(e,n,r,i));for(var s=1;sthis.MAX_LINE_LENGTH)return this.$renderOverflowMessage(e,n,r,i);n=this.$renderToken(e,n,r,i)}},this.$renderOverflowMessage=function(e,t,n,r,i){n&&this.$renderToken(e,t,n,r.slice(0,this.MAX_LINE_LENGTH-t));var s=this.dom.createElement("span");s.className="ace_inline_button ace_keyword ace_toggle_wrap",s.textContent=i?"":"",e.appendChild(s)},this.$renderLine=function(e,t,n){!n&&n!=0&&(n=this.session.getFoldLine(t));if(n)var r=this.$getFoldLineTokens(t,n);else var r=this.session.getTokens(t);var i=e;if(r.length){var s=this.session.getRowSplitData(t);if(s&&s.length){this.$renderWrappedLine(e,r,s);var i=e.lastChild}else{var i=e;this.$useLineGroups()&&(i=this.$createLineElement(),e.appendChild(i)),this.$renderSimpleLine(i,r)}}else this.$useLineGroups()&&(i=this.$createLineElement(),e.appendChild(i));if(this.showEOL&&i){n&&(t=n.end.row);var o=this.dom.createElement("span");o.className="ace_invisible ace_invisible_eol",o.textContent=t==this.session.getLength()-1?this.EOF_CHAR:this.EOL_CHAR,i.appendChild(o)}},this.$getFoldLineTokens=function(e,t){function i(e,t,n){var i=0,s=0;while(s+e[i].value.lengthn-t&&(o=o.substring(0,n-t)),r.push({type:e[i].type,value:o}),s=t+o.length,i+=1}while(sn?r.push({type:e[i].type,value:o.substring(0,n-s)}):r.push(e[i]),s+=o.length,i+=1}}var n=this.session,r=[],s=n.getTokens(e);return t.walk(function(e,t,o,u,a){e!=null?r.push({type:"fold",value:e}):(a&&(s=n.getTokens(t)),s.length&&i(s,u,o))},t.end.row,this.session.getLine(t.end.row).length),r},this.$useLineGroups=function(){return this.session.getUseWrapMode()},this.destroy=function(){}}).call(a.prototype),t.Text=a}),define("ace/layer/cursor",["require","exports","module","ace/lib/dom"],function(e,t,n){"use strict";var r=e("../lib/dom"),i=function(e){this.element=r.createElement("div"),this.element.className="ace_layer ace_cursor-layer",e.appendChild(this.element),this.isVisible=!1,this.isBlinking=!0,this.blinkInterval=1e3,this.smoothBlinking=!1,this.cursors=[],this.cursor=this.addCursor(),r.addCssClass(this.element,"ace_hidden-cursors"),this.$updateCursors=this.$updateOpacity.bind(this)};(function(){this.$updateOpacity=function(e){var t=this.cursors;for(var n=t.length;n--;)r.setStyle(t[n].style,"opacity",e?"":"0")},this.$startCssAnimation=function(){var e=this.cursors;for(var t=e.length;t--;)e[t].style.animationDuration=this.blinkInterval+"ms";setTimeout(function(){r.addCssClass(this.element,"ace_animate-blinking")}.bind(this))},this.$stopCssAnimation=function(){r.removeCssClass(this.element,"ace_animate-blinking")},this.$padding=0,this.setPadding=function(e){this.$padding=e},this.setSession=function(e){this.session=e},this.setBlinking=function(e){e!=this.isBlinking&&(this.isBlinking=e,this.restartTimer())},this.setBlinkInterval=function(e){e!=this.blinkInterval&&(this.blinkInterval=e,this.restartTimer())},this.setSmoothBlinking=function(e){e!=this.smoothBlinking&&(this.smoothBlinking=e,r.setCssClass(this.element,"ace_smooth-blinking",e),this.$updateCursors(!0),this.restartTimer())},this.addCursor=function(){var e=r.createElement("div");return e.className="ace_cursor",this.element.appendChild(e),this.cursors.push(e),e},this.removeCursor=function(){if(this.cursors.length>1){var e=this.cursors.pop();return e.parentNode.removeChild(e),e}},this.hideCursor=function(){this.isVisible=!1,r.addCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},this.showCursor=function(){this.isVisible=!0,r.removeCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},this.restartTimer=function(){var e=this.$updateCursors;clearInterval(this.intervalId),clearTimeout(this.timeoutId),this.$stopCssAnimation(),this.smoothBlinking&&r.removeCssClass(this.element,"ace_smooth-blinking"),e(!0);if(!this.isBlinking||!this.blinkInterval||!this.isVisible){this.$stopCssAnimation();return}this.smoothBlinking&&setTimeout(function(){r.addCssClass(this.element,"ace_smooth-blinking")}.bind(this));if(r.HAS_CSS_ANIMATION)this.$startCssAnimation();else{var t=function(){this.timeoutId=setTimeout(function(){e(!1)},.6*this.blinkInterval)}.bind(this);this.intervalId=setInterval(function(){e(!0),t()},this.blinkInterval),t()}},this.getPixelPosition=function(e,t){if(!this.config||!this.session)return{left:0,top:0};e||(e=this.session.selection.getCursor());var n=this.session.documentToScreenPosition(e),r=this.$padding+(this.session.$bidiHandler.isBidiRow(n.row,e.row)?this.session.$bidiHandler.getPosLeft(n.column):n.column*this.config.characterWidth),i=(n.row-(t?this.config.firstRowScreen:0))*this.config.lineHeight;return{left:r,top:i}},this.isCursorInView=function(e,t){return e.top>=0&&e.tope.height+e.offset||o.top<0)&&n>1)continue;var u=this.cursors[i++]||this.addCursor(),a=u.style;this.drawCursor?this.drawCursor(u,o,e,t[n],this.session):this.isCursorInView(o,e)?(r.setStyle(a,"display","block"),r.translate(u,o.left,o.top),r.setStyle(a,"width",Math.round(e.characterWidth)+"px"),r.setStyle(a,"height",e.lineHeight+"px")):r.setStyle(a,"display","none")}while(this.cursors.length>i)this.removeCursor();var f=this.session.getOverwrite();this.$setOverwrite(f),this.$pixelPos=o,this.restartTimer()},this.drawCursor=null,this.$setOverwrite=function(e){e!=this.overwrite&&(this.overwrite=e,e?r.addCssClass(this.element,"ace_overwrite-cursors"):r.removeCssClass(this.element,"ace_overwrite-cursors"))},this.destroy=function(){clearInterval(this.intervalId),clearTimeout(this.timeoutId)}}).call(i.prototype),t.Cursor=i}),define("ace/scrollbar",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/event_emitter"],function(e,t,n){"use strict";var r=e("./lib/oop"),i=e("./lib/dom"),s=e("./lib/event"),o=e("./lib/event_emitter").EventEmitter,u=32768,a=function(e){this.element=i.createElement("div"),this.element.className="ace_scrollbar ace_scrollbar"+this.classSuffix,this.inner=i.createElement("div"),this.inner.className="ace_scrollbar-inner",this.inner.textContent="\u00a0",this.element.appendChild(this.inner),e.appendChild(this.element),this.setVisible(!1),this.skipEvent=!1,s.addListener(this.element,"scroll",this.onScroll.bind(this)),s.addListener(this.element,"mousedown",s.preventDefault)};(function(){r.implement(this,o),this.setVisible=function(e){this.element.style.display=e?"":"none",this.isVisible=e,this.coeff=1}}).call(a.prototype);var f=function(e,t){a.call(this,e),this.scrollTop=0,this.scrollHeight=0,t.$scrollbarWidth=this.width=i.scrollbarWidth(e.ownerDocument),this.inner.style.width=this.element.style.width=(this.width||15)+5+"px",this.$minWidth=0};r.inherits(f,a),function(){this.classSuffix="-v",this.onScroll=function(){if(!this.skipEvent){this.scrollTop=this.element.scrollTop;if(this.coeff!=1){var e=this.element.clientHeight/this.scrollHeight;this.scrollTop=this.scrollTop*(1-e)/(this.coeff-e)}this._emit("scroll",{data:this.scrollTop})}this.skipEvent=!1},this.getWidth=function(){return Math.max(this.isVisible?this.width:0,this.$minWidth||0)},this.setHeight=function(e){this.element.style.height=e+"px"},this.setInnerHeight=this.setScrollHeight=function(e){this.scrollHeight=e,e>u?(this.coeff=u/e,e=u):this.coeff!=1&&(this.coeff=1),this.inner.style.height=e+"px"},this.setScrollTop=function(e){this.scrollTop!=e&&(this.skipEvent=!0,this.scrollTop=e,this.element.scrollTop=e*this.coeff)}}.call(f.prototype);var l=function(e,t){a.call(this,e),this.scrollLeft=0,this.height=t.$scrollbarWidth,this.inner.style.height=this.element.style.height=(this.height||15)+5+"px"};r.inherits(l,a),function(){this.classSuffix="-h",this.onScroll=function(){this.skipEvent||(this.scrollLeft=this.element.scrollLeft,this._emit("scroll",{data:this.scrollLeft})),this.skipEvent=!1},this.getHeight=function(){return this.isVisible?this.height:0},this.setWidth=function(e){this.element.style.width=e+"px"},this.setInnerWidth=function(e){this.inner.style.width=e+"px"},this.setScrollWidth=function(e){this.inner.style.width=e+"px"},this.setScrollLeft=function(e){this.scrollLeft!=e&&(this.skipEvent=!0,this.scrollLeft=this.element.scrollLeft=e)}}.call(l.prototype),t.ScrollBar=f,t.ScrollBarV=f,t.ScrollBarH=l,t.VScrollBar=f,t.HScrollBar=l}),define("ace/renderloop",["require","exports","module","ace/lib/event"],function(e,t,n){"use strict";var r=e("./lib/event"),i=function(e,t){this.onRender=e,this.pending=!1,this.changes=0,this.$recursionLimit=2,this.window=t||window;var n=this;this._flush=function(e){n.pending=!1;var t=n.changes;t&&(r.blockIdle(100),n.changes=0,n.onRender(t));if(n.changes){if(n.$recursionLimit--<0)return;n.schedule()}else n.$recursionLimit=2}};(function(){this.schedule=function(e){this.changes=this.changes|e,this.changes&&!this.pending&&(r.nextFrame(this._flush),this.pending=!0)},this.clear=function(e){var t=this.changes;return this.changes=0,t}}).call(i.prototype),t.RenderLoop=i}),define("ace/layer/font_metrics",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/lib/event","ace/lib/useragent","ace/lib/event_emitter"],function(e,t,n){var r=e("../lib/oop"),i=e("../lib/dom"),s=e("../lib/lang"),o=e("../lib/event"),u=e("../lib/useragent"),a=e("../lib/event_emitter").EventEmitter,f=256,l=typeof ResizeObserver=="function",c=200,h=t.FontMetrics=function(e){this.el=i.createElement("div"),this.$setMeasureNodeStyles(this.el.style,!0),this.$main=i.createElement("div"),this.$setMeasureNodeStyles(this.$main.style),this.$measureNode=i.createElement("div"),this.$setMeasureNodeStyles(this.$measureNode.style),this.el.appendChild(this.$main),this.el.appendChild(this.$measureNode),e.appendChild(this.el),this.$measureNode.textContent=s.stringRepeat("X",f),this.$characterSize={width:0,height:0},l?this.$addObserver():this.checkForSizeChanges()};(function(){r.implement(this,a),this.$characterSize={width:0,height:0},this.$setMeasureNodeStyles=function(e,t){e.width=e.height="auto",e.left=e.top="0px",e.visibility="hidden",e.position="absolute",e.whiteSpace="pre",u.isIE<8?e["font-family"]="inherit":e.font="inherit",e.overflow=t?"hidden":"visible"},this.checkForSizeChanges=function(e){e===undefined&&(e=this.$measureSizes());if(e&&(this.$characterSize.width!==e.width||this.$characterSize.height!==e.height)){this.$measureNode.style.fontWeight="bold";var t=this.$measureSizes();this.$measureNode.style.fontWeight="",this.$characterSize=e,this.charSizes=Object.create(null),this.allowBoldFonts=t&&t.width===e.width&&t.height===e.height,this._emit("changeCharacterSize",{data:e})}},this.$addObserver=function(){var e=this;this.$observer=new window.ResizeObserver(function(t){e.checkForSizeChanges()}),this.$observer.observe(this.$measureNode)},this.$pollSizeChanges=function(){if(this.$pollSizeChangesTimer||this.$observer)return this.$pollSizeChangesTimer;var e=this;return this.$pollSizeChangesTimer=o.onIdle(function t(){e.checkForSizeChanges(),o.onIdle(t,500)},500)},this.setPolling=function(e){e?this.$pollSizeChanges():this.$pollSizeChangesTimer&&(clearInterval(this.$pollSizeChangesTimer),this.$pollSizeChangesTimer=0)},this.$measureSizes=function(e){var t={height:(e||this.$measureNode).clientHeight,width:(e||this.$measureNode).clientWidth/f};return t.width===0||t.height===0?null:t},this.$measureCharWidth=function(e){this.$main.textContent=s.stringRepeat(e,f);var t=this.$main.getBoundingClientRect();return t.width/f},this.getCharacterWidth=function(e){var t=this.charSizes[e];return t===undefined&&(t=this.charSizes[e]=this.$measureCharWidth(e)/this.$characterSize.width),t},this.destroy=function(){clearInterval(this.$pollSizeChangesTimer),this.$observer&&this.$observer.disconnect(),this.el&&this.el.parentNode&&this.el.parentNode.removeChild(this.el)},this.$getZoom=function e(t){return t?(window.getComputedStyle(t).zoom||1)*e(t.parentElement):1},this.$initTransformMeasureNodes=function(){var e=function(e,t){return["div",{style:"position: absolute;top:"+e+"px;left:"+t+"px;"}]};this.els=i.buildDom([e(0,0),e(c,0),e(0,c),e(c,c)],this.el)},this.transformCoordinates=function(e,t){function r(e,t,n){var r=e[1]*t[0]-e[0]*t[1];return[(-t[1]*n[0]+t[0]*n[1])/r,(+e[1]*n[0]-e[0]*n[1])/r]}function i(e,t){return[e[0]-t[0],e[1]-t[1]]}function s(e,t){return[e[0]+t[0],e[1]+t[1]]}function o(e,t){return[e*t[0],e*t[1]]}function u(e){var t=e.getBoundingClientRect();return[t.left,t.top]}if(e){var n=this.$getZoom(this.el);e=o(1/n,e)}this.els||this.$initTransformMeasureNodes();var a=u(this.els[0]),f=u(this.els[1]),l=u(this.els[2]),h=u(this.els[3]),p=r(i(h,f),i(h,l),i(s(f,l),s(h,a))),d=o(1+p[0],i(f,a)),v=o(1+p[1],i(l,a));if(t){var m=t,g=p[0]*m[0]/c+p[1]*m[1]/c+1,y=s(o(m[0],d),o(m[1],v));return s(o(1/g/c,y),a)}var b=i(e,a),w=r(i(d,o(p[0],b)),i(v,o(p[1],b)),b);return o(c,w)}}).call(h.prototype)}),define("ace/virtual_renderer",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/config","ace/layer/gutter","ace/layer/marker","ace/layer/text","ace/layer/cursor","ace/scrollbar","ace/scrollbar","ace/renderloop","ace/layer/font_metrics","ace/lib/event_emitter","ace/lib/useragent"],function(e,t,n){"use strict";var r=e("./lib/oop"),i=e("./lib/dom"),s=e("./config"),o=e("./layer/gutter").Gutter,u=e("./layer/marker").Marker,a=e("./layer/text").Text,f=e("./layer/cursor").Cursor,l=e("./scrollbar").HScrollBar,c=e("./scrollbar").VScrollBar,h=e("./renderloop").RenderLoop,p=e("./layer/font_metrics").FontMetrics,d=e("./lib/event_emitter").EventEmitter,v='.ace_br1 {border-top-left-radius : 3px;}.ace_br2 {border-top-right-radius : 3px;}.ace_br3 {border-top-left-radius : 3px; border-top-right-radius: 3px;}.ace_br4 {border-bottom-right-radius: 3px;}.ace_br5 {border-top-left-radius : 3px; border-bottom-right-radius: 3px;}.ace_br6 {border-top-right-radius : 3px; border-bottom-right-radius: 3px;}.ace_br7 {border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px;}.ace_br8 {border-bottom-left-radius : 3px;}.ace_br9 {border-top-left-radius : 3px; border-bottom-left-radius: 3px;}.ace_br10{border-top-right-radius : 3px; border-bottom-left-radius: 3px;}.ace_br11{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br12{border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br13{border-top-left-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br14{border-top-right-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br15{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_editor {position: relative;overflow: hidden;padding: 0;font: 12px/normal \'Monaco\', \'Menlo\', \'Ubuntu Mono\', \'Consolas\', \'source-code-pro\', monospace;direction: ltr;text-align: left;-webkit-tap-highlight-color: rgba(0, 0, 0, 0);}.ace_scroller {position: absolute;overflow: hidden;top: 0;bottom: 0;background-color: inherit;-ms-user-select: none;-moz-user-select: none;-webkit-user-select: none;user-select: none;cursor: text;}.ace_content {position: absolute;box-sizing: border-box;min-width: 100%;contain: style size layout;font-variant-ligatures: no-common-ligatures;}.ace_dragging .ace_scroller:before{position: absolute;top: 0;left: 0;right: 0;bottom: 0;content: \'\';background: rgba(250, 250, 250, 0.01);z-index: 1000;}.ace_dragging.ace_dark .ace_scroller:before{background: rgba(0, 0, 0, 0.01);}.ace_selecting, .ace_selecting * {cursor: text !important;}.ace_gutter {position: absolute;overflow : hidden;width: auto;top: 0;bottom: 0;left: 0;cursor: default;z-index: 4;-ms-user-select: none;-moz-user-select: none;-webkit-user-select: none;user-select: none;contain: style size layout;}.ace_gutter-active-line {position: absolute;left: 0;right: 0;}.ace_scroller.ace_scroll-left {box-shadow: 17px 0 16px -16px rgba(0, 0, 0, 0.4) inset;}.ace_gutter-cell {position: absolute;top: 0;left: 0;right: 0;padding-left: 19px;padding-right: 6px;background-repeat: no-repeat;}.ace_gutter-cell.ace_error {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAABOFBMVEX/////////QRswFAb/Ui4wFAYwFAYwFAaWGAfDRymzOSH/PxswFAb/SiUwFAYwFAbUPRvjQiDllog5HhHdRybsTi3/Tyv9Tir+Syj/UC3////XurebMBIwFAb/RSHbPx/gUzfdwL3kzMivKBAwFAbbvbnhPx66NhowFAYwFAaZJg8wFAaxKBDZurf/RB6mMxb/SCMwFAYwFAbxQB3+RB4wFAb/Qhy4Oh+4QifbNRcwFAYwFAYwFAb/QRzdNhgwFAYwFAbav7v/Uy7oaE68MBK5LxLewr/r2NXewLswFAaxJw4wFAbkPRy2PyYwFAaxKhLm1tMwFAazPiQwFAaUGAb/QBrfOx3bvrv/VC/maE4wFAbRPBq6MRO8Qynew8Dp2tjfwb0wFAbx6eju5+by6uns4uH9/f36+vr/GkHjAAAAYnRSTlMAGt+64rnWu/bo8eAA4InH3+DwoN7j4eLi4xP99Nfg4+b+/u9B/eDs1MD1mO7+4PHg2MXa347g7vDizMLN4eG+Pv7i5evs/v79yu7S3/DV7/498Yv24eH+4ufQ3Ozu/v7+y13sRqwAAADLSURBVHjaZc/XDsFgGIBhtDrshlitmk2IrbHFqL2pvXf/+78DPokj7+Fz9qpU/9UXJIlhmPaTaQ6QPaz0mm+5gwkgovcV6GZzd5JtCQwgsxoHOvJO15kleRLAnMgHFIESUEPmawB9ngmelTtipwwfASilxOLyiV5UVUyVAfbG0cCPHig+GBkzAENHS0AstVF6bacZIOzgLmxsHbt2OecNgJC83JERmePUYq8ARGkJx6XtFsdddBQgZE2nPR6CICZhawjA4Fb/chv+399kfR+MMMDGOQAAAABJRU5ErkJggg==");background-repeat: no-repeat;background-position: 2px center;}.ace_gutter-cell.ace_warning {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAmVBMVEX///8AAAD///8AAAAAAABPSzb/5sAAAAB/blH/73z/ulkAAAAAAAD85pkAAAAAAAACAgP/vGz/rkDerGbGrV7/pkQICAf////e0IsAAAD/oED/qTvhrnUAAAD/yHD/njcAAADuv2r/nz//oTj/p064oGf/zHAAAAA9Nir/tFIAAAD/tlTiuWf/tkIAAACynXEAAAAAAAAtIRW7zBpBAAAAM3RSTlMAABR1m7RXO8Ln31Z36zT+neXe5OzooRDfn+TZ4p3h2hTf4t3k3ucyrN1K5+Xaks52Sfs9CXgrAAAAjklEQVR42o3PbQ+CIBQFYEwboPhSYgoYunIqqLn6/z8uYdH8Vmdnu9vz4WwXgN/xTPRD2+sgOcZjsge/whXZgUaYYvT8QnuJaUrjrHUQreGczuEafQCO/SJTufTbroWsPgsllVhq3wJEk2jUSzX3CUEDJC84707djRc5MTAQxoLgupWRwW6UB5fS++NV8AbOZgnsC7BpEAAAAABJRU5ErkJggg==");background-position: 2px center;}.ace_gutter-cell.ace_info {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAAAAAA6mKC9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAJ0Uk5TAAB2k804AAAAPklEQVQY02NgIB68QuO3tiLznjAwpKTgNyDbMegwisCHZUETUZV0ZqOquBpXj2rtnpSJT1AEnnRmL2OgGgAAIKkRQap2htgAAAAASUVORK5CYII=");background-position: 2px center;}.ace_dark .ace_gutter-cell.ace_info {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAJFBMVEUAAAChoaGAgIAqKiq+vr6tra1ZWVmUlJSbm5s8PDxubm56enrdgzg3AAAAAXRSTlMAQObYZgAAAClJREFUeNpjYMAPdsMYHegyJZFQBlsUlMFVCWUYKkAZMxZAGdxlDMQBAG+TBP4B6RyJAAAAAElFTkSuQmCC");}.ace_scrollbar {contain: strict;position: absolute;right: 0;bottom: 0;z-index: 6;}.ace_scrollbar-inner {position: absolute;cursor: text;left: 0;top: 0;}.ace_scrollbar-v{overflow-x: hidden;overflow-y: scroll;top: 0;}.ace_scrollbar-h {overflow-x: scroll;overflow-y: hidden;left: 0;}.ace_print-margin {position: absolute;height: 100%;}.ace_text-input {position: absolute;z-index: 0;width: 0.5em;height: 1em;opacity: 0;background: transparent;-moz-appearance: none;appearance: none;border: none;resize: none;outline: none;overflow: hidden;font: inherit;padding: 0 1px;margin: 0 -1px;contain: strict;-ms-user-select: text;-moz-user-select: text;-webkit-user-select: text;user-select: text;white-space: pre!important;}.ace_text-input.ace_composition {background: transparent;color: inherit;z-index: 1000;opacity: 1;}.ace_composition_placeholder { color: transparent }.ace_composition_marker { border-bottom: 1px solid;position: absolute;border-radius: 0;margin-top: 1px;}[ace_nocontext=true] {transform: none!important;filter: none!important;clip-path: none!important;mask : none!important;contain: none!important;perspective: none!important;mix-blend-mode: initial!important;z-index: auto;}.ace_layer {z-index: 1;position: absolute;overflow: hidden;word-wrap: normal;white-space: pre;height: 100%;width: 100%;box-sizing: border-box;pointer-events: none;}.ace_gutter-layer {position: relative;width: auto;text-align: right;pointer-events: auto;height: 1000000px;contain: style size layout;}.ace_text-layer {font: inherit !important;position: absolute;height: 1000000px;width: 1000000px;contain: style size layout;}.ace_text-layer > .ace_line, .ace_text-layer > .ace_line_group {contain: style size layout;position: absolute;top: 0;left: 0;right: 0;}.ace_hidpi .ace_text-layer,.ace_hidpi .ace_gutter-layer,.ace_hidpi .ace_content,.ace_hidpi .ace_gutter {contain: strict;will-change: transform;}.ace_hidpi .ace_text-layer > .ace_line, .ace_hidpi .ace_text-layer > .ace_line_group {contain: strict;}.ace_cjk {display: inline-block;text-align: center;}.ace_cursor-layer {z-index: 4;}.ace_cursor {z-index: 4;position: absolute;box-sizing: border-box;border-left: 2px solid;transform: translatez(0);}.ace_multiselect .ace_cursor {border-left-width: 1px;}.ace_slim-cursors .ace_cursor {border-left-width: 1px;}.ace_overwrite-cursors .ace_cursor {border-left-width: 0;border-bottom: 1px solid;}.ace_hidden-cursors .ace_cursor {opacity: 0.2;}.ace_hasPlaceholder .ace_hidden-cursors .ace_cursor {opacity: 0;}.ace_smooth-blinking .ace_cursor {transition: opacity 0.18s;}.ace_animate-blinking .ace_cursor {animation-duration: 1000ms;animation-timing-function: step-end;animation-name: blink-ace-animate;animation-iteration-count: infinite;}.ace_animate-blinking.ace_smooth-blinking .ace_cursor {animation-duration: 1000ms;animation-timing-function: ease-in-out;animation-name: blink-ace-animate-smooth;}@keyframes blink-ace-animate {from, to { opacity: 1; }60% { opacity: 0; }}@keyframes blink-ace-animate-smooth {from, to { opacity: 1; }45% { opacity: 1; }60% { opacity: 0; }85% { opacity: 0; }}.ace_marker-layer .ace_step, .ace_marker-layer .ace_stack {position: absolute;z-index: 3;}.ace_marker-layer .ace_selection {position: absolute;z-index: 5;}.ace_marker-layer .ace_bracket {position: absolute;z-index: 6;}.ace_marker-layer .ace_error_bracket {position: absolute;border-bottom: 1px solid #DE5555;border-radius: 0;}.ace_marker-layer .ace_active-line {position: absolute;z-index: 2;}.ace_marker-layer .ace_selected-word {position: absolute;z-index: 4;box-sizing: border-box;}.ace_line .ace_fold {box-sizing: border-box;display: inline-block;height: 11px;margin-top: -2px;vertical-align: middle;background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACJJREFUeNpi+P//fxgTAwPDBxDxD078RSX+YeEyDFMCIMAAI3INmXiwf2YAAAAASUVORK5CYII=");background-repeat: no-repeat, repeat-x;background-position: center center, top left;color: transparent;border: 1px solid black;border-radius: 2px;cursor: pointer;pointer-events: auto;}.ace_dark .ace_fold {}.ace_fold:hover{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACBJREFUeNpi+P//fz4TAwPDZxDxD5X4i5fLMEwJgAADAEPVDbjNw87ZAAAAAElFTkSuQmCC");}.ace_tooltip {background-color: #FFF;background-image: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.1));border: 1px solid gray;border-radius: 1px;box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);color: black;max-width: 100%;padding: 3px 4px;position: fixed;z-index: 999999;box-sizing: border-box;cursor: default;white-space: pre;word-wrap: break-word;line-height: normal;font-style: normal;font-weight: normal;letter-spacing: normal;pointer-events: none;}.ace_folding-enabled > .ace_gutter-cell {padding-right: 13px;}.ace_fold-widget {box-sizing: border-box;margin: 0 -12px 0 1px;display: none;width: 11px;vertical-align: top;background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42mWKsQ0AMAzC8ixLlrzQjzmBiEjp0A6WwBCSPgKAXoLkqSot7nN3yMwR7pZ32NzpKkVoDBUxKAAAAABJRU5ErkJggg==");background-repeat: no-repeat;background-position: center;border-radius: 3px;border: 1px solid transparent;cursor: pointer;}.ace_folding-enabled .ace_fold-widget {display: inline-block; }.ace_fold-widget.ace_end {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42m3HwQkAMAhD0YzsRchFKI7sAikeWkrxwScEB0nh5e7KTPWimZki4tYfVbX+MNl4pyZXejUO1QAAAABJRU5ErkJggg==");}.ace_fold-widget.ace_closed {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAGCAYAAAAG5SQMAAAAOUlEQVR42jXKwQkAMAgDwKwqKD4EwQ26sSOkVWjgIIHAzPiCgaqiqnJHZnKICBERHN194O5b9vbLuAVRL+l0YWnZAAAAAElFTkSuQmCCXA==");}.ace_fold-widget:hover {border: 1px solid rgba(0, 0, 0, 0.3);background-color: rgba(255, 255, 255, 0.2);box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);}.ace_fold-widget:active {border: 1px solid rgba(0, 0, 0, 0.4);background-color: rgba(0, 0, 0, 0.05);box-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);}.ace_dark .ace_fold-widget {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHklEQVQIW2P4//8/AzoGEQ7oGCaLLAhWiSwB146BAQCSTPYocqT0AAAAAElFTkSuQmCC");}.ace_dark .ace_fold-widget.ace_end {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAH0lEQVQIW2P4//8/AxQ7wNjIAjDMgC4AxjCVKBirIAAF0kz2rlhxpAAAAABJRU5ErkJggg==");}.ace_dark .ace_fold-widget.ace_closed {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAFCAYAAACAcVaiAAAAHElEQVQIW2P4//+/AxAzgDADlOOAznHAKgPWAwARji8UIDTfQQAAAABJRU5ErkJggg==");}.ace_dark .ace_fold-widget:hover {box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);background-color: rgba(255, 255, 255, 0.1);}.ace_dark .ace_fold-widget:active {box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);}.ace_inline_button {border: 1px solid lightgray;display: inline-block;margin: -1px 8px;padding: 0 5px;pointer-events: auto;cursor: pointer;}.ace_inline_button:hover {border-color: gray;background: rgba(200,200,200,0.2);display: inline-block;pointer-events: auto;}.ace_fold-widget.ace_invalid {background-color: #FFB4B4;border-color: #DE5555;}.ace_fade-fold-widgets .ace_fold-widget {transition: opacity 0.4s ease 0.05s;opacity: 0;}.ace_fade-fold-widgets:hover .ace_fold-widget {transition: opacity 0.05s ease 0.05s;opacity:1;}.ace_underline {text-decoration: underline;}.ace_bold {font-weight: bold;}.ace_nobold .ace_bold {font-weight: normal;}.ace_italic {font-style: italic;}.ace_error-marker {background-color: rgba(255, 0, 0,0.2);position: absolute;z-index: 9;}.ace_highlight-marker {background-color: rgba(255, 255, 0,0.2);position: absolute;z-index: 8;}.ace_mobile-menu {position: absolute;line-height: 1.5;border-radius: 4px;-ms-user-select: none;-moz-user-select: none;-webkit-user-select: none;user-select: none;background: white;box-shadow: 1px 3px 2px grey;border: 1px solid #dcdcdc;color: black;}.ace_dark > .ace_mobile-menu {background: #333;color: #ccc;box-shadow: 1px 3px 2px grey;border: 1px solid #444;}.ace_mobile-button {padding: 2px;cursor: pointer;overflow: hidden;}.ace_mobile-button:hover {background-color: #eee;opacity:1;}.ace_mobile-button:active {background-color: #ddd;}.ace_placeholder {font-family: arial;transform: scale(0.9);transform-origin: left;white-space: pre;opacity: 0.7;margin: 0 10px;}',m=e("./lib/useragent"),g=m.isIE;i.importCssString(v,"ace_editor.css");var y=function(e,t){var n=this;this.container=e||i.createElement("div"),i.addCssClass(this.container,"ace_editor"),i.HI_DPI&&i.addCssClass(this.container,"ace_hidpi"),this.setTheme(t),this.$gutter=i.createElement("div"),this.$gutter.className="ace_gutter",this.container.appendChild(this.$gutter),this.$gutter.setAttribute("aria-hidden",!0),this.scroller=i.createElement("div"),this.scroller.className="ace_scroller",this.container.appendChild(this.scroller),this.content=i.createElement("div"),this.content.className="ace_content",this.scroller.appendChild(this.content),this.$gutterLayer=new o(this.$gutter),this.$gutterLayer.on("changeGutterWidth",this.onGutterResize.bind(this)),this.$markerBack=new u(this.content);var r=this.$textLayer=new a(this.content);this.canvas=r.element,this.$markerFront=new u(this.content),this.$cursorLayer=new f(this.content),this.$horizScroll=!1,this.$vScroll=!1,this.scrollBar=this.scrollBarV=new c(this.container,this),this.scrollBarH=new l(this.container,this),this.scrollBarV.on("scroll",function(e){n.$scrollAnimation||n.session.setScrollTop(e.data-n.scrollMargin.top)}),this.scrollBarH.on("scroll",function(e){n.$scrollAnimation||n.session.setScrollLeft(e.data-n.scrollMargin.left)}),this.scrollTop=0,this.scrollLeft=0,this.cursorPos={row:0,column:0},this.$fontMetrics=new p(this.container),this.$textLayer.$setFontMetrics(this.$fontMetrics),this.$textLayer.on("changeCharacterSize",function(e){n.updateCharacterSize(),n.onResize(!0,n.gutterWidth,n.$size.width,n.$size.height),n._signal("changeCharacterSize",e)}),this.$size={width:0,height:0,scrollerHeight:0,scrollerWidth:0,$dirty:!0},this.layerConfig={width:1,padding:0,firstRow:0,firstRowScreen:0,lastRow:0,lineHeight:0,characterWidth:0,minHeight:1,maxHeight:1,offset:0,height:1,gutterOffset:1},this.scrollMargin={left:0,right:0,top:0,bottom:0,v:0,h:0},this.margin={left:0,right:0,top:0,bottom:0,v:0,h:0},this.$keepTextAreaAtCursor=!m.isIOS,this.$loop=new h(this.$renderChanges.bind(this),this.container.ownerDocument.defaultView),this.$loop.schedule(this.CHANGE_FULL),this.updateCharacterSize(),this.setPadding(4),s.resetOptions(this),s._signal("renderer",this)};(function(){this.CHANGE_CURSOR=1,this.CHANGE_MARKER=2,this.CHANGE_GUTTER=4,this.CHANGE_SCROLL=8,this.CHANGE_LINES=16,this.CHANGE_TEXT=32,this.CHANGE_SIZE=64,this.CHANGE_MARKER_BACK=128,this.CHANGE_MARKER_FRONT=256,this.CHANGE_FULL=512,this.CHANGE_H_SCROLL=1024,r.implement(this,d),this.updateCharacterSize=function(){this.$textLayer.allowBoldFonts!=this.$allowBoldFonts&&(this.$allowBoldFonts=this.$textLayer.allowBoldFonts,this.setStyle("ace_nobold",!this.$allowBoldFonts)),this.layerConfig.characterWidth=this.characterWidth=this.$textLayer.getCharacterWidth(),this.layerConfig.lineHeight=this.lineHeight=this.$textLayer.getLineHeight(),this.$updatePrintMargin(),i.setStyle(this.scroller.style,"line-height",this.lineHeight+"px")},this.setSession=function(e){this.session&&this.session.doc.off("changeNewLineMode",this.onChangeNewLineMode),this.session=e,e&&this.scrollMargin.top&&e.getScrollTop()<=0&&e.setScrollTop(-this.scrollMargin.top),this.$cursorLayer.setSession(e),this.$markerBack.setSession(e),this.$markerFront.setSession(e),this.$gutterLayer.setSession(e),this.$textLayer.setSession(e);if(!e)return;this.$loop.schedule(this.CHANGE_FULL),this.session.$setFontMetrics(this.$fontMetrics),this.scrollBarH.scrollLeft=this.scrollBarV.scrollTop=null,this.onChangeNewLineMode=this.onChangeNewLineMode.bind(this),this.onChangeNewLineMode(),this.session.doc.on("changeNewLineMode",this.onChangeNewLineMode)},this.updateLines=function(e,t,n){t===undefined&&(t=Infinity),this.$changedLines?(this.$changedLines.firstRow>e&&(this.$changedLines.firstRow=e),this.$changedLines.lastRowthis.layerConfig.lastRow)return;this.$loop.schedule(this.CHANGE_LINES)},this.onChangeNewLineMode=function(){this.$loop.schedule(this.CHANGE_TEXT),this.$textLayer.$updateEolChar(),this.session.$bidiHandler.setEolChar(this.$textLayer.EOL_CHAR)},this.onChangeTabSize=function(){this.$loop.schedule(this.CHANGE_TEXT|this.CHANGE_MARKER),this.$textLayer.onChangeTabSize()},this.updateText=function(){this.$loop.schedule(this.CHANGE_TEXT)},this.updateFull=function(e){e?this.$renderChanges(this.CHANGE_FULL,!0):this.$loop.schedule(this.CHANGE_FULL)},this.updateFontSize=function(){this.$textLayer.checkForSizeChanges()},this.$changes=0,this.$updateSizeAsync=function(){this.$loop.pending?this.$size.$dirty=!0:this.onResize()},this.onResize=function(e,t,n,r){if(this.resizing>2)return;this.resizing>0?this.resizing++:this.resizing=e?1:0;var i=this.container;r||(r=i.clientHeight||i.scrollHeight),n||(n=i.clientWidth||i.scrollWidth);var s=this.$updateCachedSize(e,t,n,r);if(!this.$size.scrollerHeight||!n&&!r)return this.resizing=0;e&&(this.$gutterLayer.$padding=null),e?this.$renderChanges(s|this.$changes,!0):this.$loop.schedule(s|this.$changes),this.resizing&&(this.resizing=0),this.scrollBarV.scrollLeft=this.scrollBarV.scrollTop=null},this.$updateCachedSize=function(e,t,n,r){r-=this.$extraHeight||0;var s=0,o=this.$size,u={width:o.width,height:o.height,scrollerHeight:o.scrollerHeight,scrollerWidth:o.scrollerWidth};r&&(e||o.height!=r)&&(o.height=r,s|=this.CHANGE_SIZE,o.scrollerHeight=o.height,this.$horizScroll&&(o.scrollerHeight-=this.scrollBarH.getHeight()),this.scrollBarV.element.style.bottom=this.scrollBarH.getHeight()+"px",s|=this.CHANGE_SCROLL);if(n&&(e||o.width!=n)){s|=this.CHANGE_SIZE,o.width=n,t==null&&(t=this.$showGutter?this.$gutter.offsetWidth:0),this.gutterWidth=t,i.setStyle(this.scrollBarH.element.style,"left",t+"px"),i.setStyle(this.scroller.style,"left",t+this.margin.left+"px"),o.scrollerWidth=Math.max(0,n-t-this.scrollBarV.getWidth()-this.margin.h),i.setStyle(this.$gutter.style,"left",this.margin.left+"px");var a=this.scrollBarV.getWidth()+"px";i.setStyle(this.scrollBarH.element.style,"right",a),i.setStyle(this.scroller.style,"right",a),i.setStyle(this.scroller.style,"bottom",this.scrollBarH.getHeight());if(this.session&&this.session.getUseWrapMode()&&this.adjustWrapLimit()||e)s|=this.CHANGE_FULL}return o.$dirty=!n||!r,s&&this._signal("resize",u),s},this.onGutterResize=function(e){var t=this.$showGutter?e:0;t!=this.gutterWidth&&(this.$changes|=this.$updateCachedSize(!0,t,this.$size.width,this.$size.height)),this.session.getUseWrapMode()&&this.adjustWrapLimit()?this.$loop.schedule(this.CHANGE_FULL):this.$size.$dirty?this.$loop.schedule(this.CHANGE_FULL):this.$computeLayerConfig()},this.adjustWrapLimit=function(){var e=this.$size.scrollerWidth-this.$padding*2,t=Math.floor(e/this.characterWidth);return this.session.adjustWrapLimit(t,this.$showPrintMargin&&this.$printMarginColumn)},this.setAnimatedScroll=function(e){this.setOption("animatedScroll",e)},this.getAnimatedScroll=function(){return this.$animatedScroll},this.setShowInvisibles=function(e){this.setOption("showInvisibles",e),this.session.$bidiHandler.setShowInvisibles(e)},this.getShowInvisibles=function(){return this.getOption("showInvisibles")},this.getDisplayIndentGuides=function(){return this.getOption("displayIndentGuides")},this.setDisplayIndentGuides=function(e){this.setOption("displayIndentGuides",e)},this.setShowPrintMargin=function(e){this.setOption("showPrintMargin",e)},this.getShowPrintMargin=function(){return this.getOption("showPrintMargin")},this.setPrintMarginColumn=function(e){this.setOption("printMarginColumn",e)},this.getPrintMarginColumn=function(){return this.getOption("printMarginColumn")},this.getShowGutter=function(){return this.getOption("showGutter")},this.setShowGutter=function(e){return this.setOption("showGutter",e)},this.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},this.setFadeFoldWidgets=function(e){this.setOption("fadeFoldWidgets",e)},this.setHighlightGutterLine=function(e){this.setOption("highlightGutterLine",e)},this.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},this.$updatePrintMargin=function(){if(!this.$showPrintMargin&&!this.$printMarginEl)return;if(!this.$printMarginEl){var e=i.createElement("div");e.className="ace_layer ace_print-margin-layer",this.$printMarginEl=i.createElement("div"),this.$printMarginEl.className="ace_print-margin",e.appendChild(this.$printMarginEl),this.content.insertBefore(e,this.content.firstChild)}var t=this.$printMarginEl.style;t.left=Math.round(this.characterWidth*this.$printMarginColumn+this.$padding)+"px",t.visibility=this.$showPrintMargin?"visible":"hidden",this.session&&this.session.$wrap==-1&&this.adjustWrapLimit()},this.getContainerElement=function(){return this.container},this.getMouseEventTarget=function(){return this.scroller},this.getTextAreaContainer=function(){return this.container},this.$moveTextAreaToCursor=function(){if(this.$isMousePressed)return;var e=this.textarea.style,t=this.$composition;if(!this.$keepTextAreaAtCursor&&!t){i.translate(this.textarea,-100,0);return}var n=this.$cursorLayer.$pixelPos;if(!n)return;t&&t.markerRange&&(n=this.$cursorLayer.getPixelPosition(t.markerRange.start,!0));var r=this.layerConfig,s=n.top,o=n.left;s-=r.offset;var u=t&&t.useTextareaForIME?this.lineHeight:g?0:1;if(s<0||s>r.height-u){i.translate(this.textarea,0,0);return}var a=1,f=this.$size.height-u;if(!t)s+=this.lineHeight;else if(t.useTextareaForIME){var l=this.textarea.value;a=this.characterWidth*this.session.$getStringScreenWidth(l)[0]}else s+=this.lineHeight+2;o-=this.scrollLeft,o>this.$size.scrollerWidth-a&&(o=this.$size.scrollerWidth-a),o+=this.gutterWidth+this.margin.left,i.setStyle(e,"height",u+"px"),i.setStyle(e,"width",a+"px"),i.translate(this.textarea,Math.min(o,this.$size.scrollerWidth-a),Math.min(s,f))},this.getFirstVisibleRow=function(){return this.layerConfig.firstRow},this.getFirstFullyVisibleRow=function(){return this.layerConfig.firstRow+(this.layerConfig.offset===0?0:1)},this.getLastFullyVisibleRow=function(){var e=this.layerConfig,t=e.lastRow,n=this.session.documentToScreenRow(t,0)*e.lineHeight;return n-this.session.getScrollTop()>e.height-e.lineHeight?t-1:t},this.getLastVisibleRow=function(){return this.layerConfig.lastRow},this.$padding=null,this.setPadding=function(e){this.$padding=e,this.$textLayer.setPadding(e),this.$cursorLayer.setPadding(e),this.$markerFront.setPadding(e),this.$markerBack.setPadding(e),this.$loop.schedule(this.CHANGE_FULL),this.$updatePrintMargin()},this.setScrollMargin=function(e,t,n,r){var i=this.scrollMargin;i.top=e|0,i.bottom=t|0,i.right=r|0,i.left=n|0,i.v=i.top+i.bottom,i.h=i.left+i.right,i.top&&this.scrollTop<=0&&this.session&&this.session.setScrollTop(-i.top),this.updateFull()},this.setMargin=function(e,t,n,r){var i=this.margin;i.top=e|0,i.bottom=t|0,i.right=r|0,i.left=n|0,i.v=i.top+i.bottom,i.h=i.left+i.right,this.$updateCachedSize(!0,this.gutterWidth,this.$size.width,this.$size.height),this.updateFull()},this.getHScrollBarAlwaysVisible=function(){return this.$hScrollBarAlwaysVisible},this.setHScrollBarAlwaysVisible=function(e){this.setOption("hScrollBarAlwaysVisible",e)},this.getVScrollBarAlwaysVisible=function(){return this.$vScrollBarAlwaysVisible},this.setVScrollBarAlwaysVisible=function(e){this.setOption("vScrollBarAlwaysVisible",e)},this.$updateScrollBarV=function(){var e=this.layerConfig.maxHeight,t=this.$size.scrollerHeight;!this.$maxLines&&this.$scrollPastEnd&&(e-=(t-this.lineHeight)*this.$scrollPastEnd,this.scrollTop>e-t&&(e=this.scrollTop+t,this.scrollBarV.scrollTop=null)),this.scrollBarV.setScrollHeight(e+this.scrollMargin.v),this.scrollBarV.setScrollTop(this.scrollTop+this.scrollMargin.top)},this.$updateScrollBarH=function(){this.scrollBarH.setScrollWidth(this.layerConfig.width+2*this.$padding+this.scrollMargin.h),this.scrollBarH.setScrollLeft(this.scrollLeft+this.scrollMargin.left)},this.$frozen=!1,this.freeze=function(){this.$frozen=!0},this.unfreeze=function(){this.$frozen=!1},this.$renderChanges=function(e,t){this.$changes&&(e|=this.$changes,this.$changes=0);if(!this.session||!this.container.offsetWidth||this.$frozen||!e&&!t){this.$changes|=e;return}if(this.$size.$dirty)return this.$changes|=e,this.onResize(!0);this.lineHeight||this.$textLayer.checkForSizeChanges(),this._signal("beforeRender",e),this.session&&this.session.$bidiHandler&&this.session.$bidiHandler.updateCharacterWidths(this.$fontMetrics);var n=this.layerConfig;if(e&this.CHANGE_FULL||e&this.CHANGE_SIZE||e&this.CHANGE_TEXT||e&this.CHANGE_LINES||e&this.CHANGE_SCROLL||e&this.CHANGE_H_SCROLL){e|=this.$computeLayerConfig()|this.$loop.clear();if(n.firstRow!=this.layerConfig.firstRow&&n.firstRowScreen==this.layerConfig.firstRowScreen){var r=this.scrollTop+(n.firstRow-this.layerConfig.firstRow)*this.lineHeight;r>0&&(this.scrollTop=r,e|=this.CHANGE_SCROLL,e|=this.$computeLayerConfig()|this.$loop.clear())}n=this.layerConfig,this.$updateScrollBarV(),e&this.CHANGE_H_SCROLL&&this.$updateScrollBarH(),i.translate(this.content,-this.scrollLeft,-n.offset);var s=n.width+2*this.$padding+"px",o=n.minHeight+"px";i.setStyle(this.content.style,"width",s),i.setStyle(this.content.style,"height",o)}e&this.CHANGE_H_SCROLL&&(i.translate(this.content,-this.scrollLeft,-n.offset),this.scroller.className=this.scrollLeft<=0?"ace_scroller":"ace_scroller ace_scroll-left");if(e&this.CHANGE_FULL){this.$changedLines=null,this.$textLayer.update(n),this.$showGutter&&this.$gutterLayer.update(n),this.$markerBack.update(n),this.$markerFront.update(n),this.$cursorLayer.update(n),this.$moveTextAreaToCursor(),this._signal("afterRender",e);return}if(e&this.CHANGE_SCROLL){this.$changedLines=null,e&this.CHANGE_TEXT||e&this.CHANGE_LINES?this.$textLayer.update(n):this.$textLayer.scrollLines(n),this.$showGutter&&(e&this.CHANGE_GUTTER||e&this.CHANGE_LINES?this.$gutterLayer.update(n):this.$gutterLayer.scrollLines(n)),this.$markerBack.update(n),this.$markerFront.update(n),this.$cursorLayer.update(n),this.$moveTextAreaToCursor(),this._signal("afterRender",e);return}e&this.CHANGE_TEXT?(this.$changedLines=null,this.$textLayer.update(n),this.$showGutter&&this.$gutterLayer.update(n)):e&this.CHANGE_LINES?(this.$updateLines()||e&this.CHANGE_GUTTER&&this.$showGutter)&&this.$gutterLayer.update(n):e&this.CHANGE_TEXT||e&this.CHANGE_GUTTER?this.$showGutter&&this.$gutterLayer.update(n):e&this.CHANGE_CURSOR&&this.$highlightGutterLine&&this.$gutterLayer.updateLineHighlight(n),e&this.CHANGE_CURSOR&&(this.$cursorLayer.update(n),this.$moveTextAreaToCursor()),e&(this.CHANGE_MARKER|this.CHANGE_MARKER_FRONT)&&this.$markerFront.update(n),e&(this.CHANGE_MARKER|this.CHANGE_MARKER_BACK)&&this.$markerBack.update(n),this._signal("afterRender",e)},this.$autosize=function(){var e=this.session.getScreenLength()*this.lineHeight,t=this.$maxLines*this.lineHeight,n=Math.min(t,Math.max((this.$minLines||1)*this.lineHeight,e))+this.scrollMargin.v+(this.$extraHeight||0);this.$horizScroll&&(n+=this.scrollBarH.getHeight()),this.$maxPixelHeight&&n>this.$maxPixelHeight&&(n=this.$maxPixelHeight);var r=n<=2*this.lineHeight,i=!r&&e>t;if(n!=this.desiredHeight||this.$size.height!=this.desiredHeight||i!=this.$vScroll){i!=this.$vScroll&&(this.$vScroll=i,this.scrollBarV.setVisible(i));var s=this.container.clientWidth;this.container.style.height=n+"px",this.$updateCachedSize(!0,this.$gutterWidth,s,n),this.desiredHeight=n,this._signal("autosize")}},this.$computeLayerConfig=function(){var e=this.session,t=this.$size,n=t.height<=2*this.lineHeight,r=this.session.getScreenLength(),i=r*this.lineHeight,s=this.$getLongestLine(),o=!n&&(this.$hScrollBarAlwaysVisible||t.scrollerWidth-s-2*this.$padding<0),u=this.$horizScroll!==o;u&&(this.$horizScroll=o,this.scrollBarH.setVisible(o));var a=this.$vScroll;this.$maxLines&&this.lineHeight>1&&this.$autosize();var f=t.scrollerHeight+this.lineHeight,l=!this.$maxLines&&this.$scrollPastEnd?(t.scrollerHeight-this.lineHeight)*this.$scrollPastEnd:0;i+=l;var c=this.scrollMargin;this.session.setScrollTop(Math.max(-c.top,Math.min(this.scrollTop,i-t.scrollerHeight+c.bottom))),this.session.setScrollLeft(Math.max(-c.left,Math.min(this.scrollLeft,s+2*this.$padding-t.scrollerWidth+c.right)));var h=!n&&(this.$vScrollBarAlwaysVisible||t.scrollerHeight-i+l<0||this.scrollTop>c.top),p=a!==h;p&&(this.$vScroll=h,this.scrollBarV.setVisible(h));var d=this.scrollTop%this.lineHeight,v=Math.ceil(f/this.lineHeight)-1,m=Math.max(0,Math.round((this.scrollTop-d)/this.lineHeight)),g=m+v,y,b,w=this.lineHeight;m=e.screenToDocumentRow(m,0);var E=e.getFoldLine(m);E&&(m=E.start.row),y=e.documentToScreenRow(m,0),b=e.getRowLength(m)*w,g=Math.min(e.screenToDocumentRow(g,0),e.getLength()-1),f=t.scrollerHeight+e.getRowLength(g)*w+b,d=this.scrollTop-y*w;var S=0;if(this.layerConfig.width!=s||u)S=this.CHANGE_H_SCROLL;if(u||p)S|=this.$updateCachedSize(!0,this.gutterWidth,t.width,t.height),this._signal("scrollbarVisibilityChanged"),p&&(s=this.$getLongestLine());return this.layerConfig={width:s,padding:this.$padding,firstRow:m,firstRowScreen:y,lastRow:g,lineHeight:w,characterWidth:this.characterWidth,minHeight:f,maxHeight:i,offset:d,gutterOffset:w?Math.max(0,Math.ceil((d+t.height-t.scrollerHeight)/w)):0,height:this.$size.scrollerHeight},this.session.$bidiHandler&&this.session.$bidiHandler.setContentWidth(s-this.$padding),S},this.$updateLines=function(){if(!this.$changedLines)return;var e=this.$changedLines.firstRow,t=this.$changedLines.lastRow;this.$changedLines=null;var n=this.layerConfig;if(e>n.lastRow+1)return;if(tthis.$textLayer.MAX_LINE_LENGTH&&(e=this.$textLayer.MAX_LINE_LENGTH+30),Math.max(this.$size.scrollerWidth-2*this.$padding,Math.round(e*this.characterWidth))},this.updateFrontMarkers=function(){this.$markerFront.setMarkers(this.session.getMarkers(!0)),this.$loop.schedule(this.CHANGE_MARKER_FRONT)},this.updateBackMarkers=function(){this.$markerBack.setMarkers(this.session.getMarkers()),this.$loop.schedule(this.CHANGE_MARKER_BACK)},this.addGutterDecoration=function(e,t){this.$gutterLayer.addGutterDecoration(e,t)},this.removeGutterDecoration=function(e,t){this.$gutterLayer.removeGutterDecoration(e,t)},this.updateBreakpoints=function(e){this.$loop.schedule(this.CHANGE_GUTTER)},this.setAnnotations=function(e){this.$gutterLayer.setAnnotations(e),this.$loop.schedule(this.CHANGE_GUTTER)},this.updateCursor=function(){this.$loop.schedule(this.CHANGE_CURSOR)},this.hideCursor=function(){this.$cursorLayer.hideCursor()},this.showCursor=function(){this.$cursorLayer.showCursor()},this.scrollSelectionIntoView=function(e,t,n){this.scrollCursorIntoView(e,n),this.scrollCursorIntoView(t,n)},this.scrollCursorIntoView=function(e,t,n){if(this.$size.scrollerHeight===0)return;var r=this.$cursorLayer.getPixelPosition(e),i=r.left,s=r.top,o=n&&n.top||0,u=n&&n.bottom||0,a=this.$scrollAnimation?this.session.getScrollTop():this.scrollTop;a+o>s?(t&&a+o>s+this.lineHeight&&(s-=t*this.$size.scrollerHeight),s===0&&(s=-this.scrollMargin.top),this.session.setScrollTop(s)):a+this.$size.scrollerHeight-ui?(i=1-this.scrollMargin.top)return!0;if(t>0&&this.session.getScrollTop()+this.$size.scrollerHeight-this.layerConfig.maxHeight<-1+this.scrollMargin.bottom)return!0;if(e<0&&this.session.getScrollLeft()>=1-this.scrollMargin.left)return!0;if(e>0&&this.session.getScrollLeft()+this.$size.scrollerWidth-this.layerConfig.width<-1+this.scrollMargin.right)return!0},this.pixelToScreenCoordinates=function(e,t){var n;if(this.$hasCssTransforms){n={top:0,left:0};var r=this.$fontMetrics.transformCoordinates([e,t]);e=r[1]-this.gutterWidth-this.margin.left,t=r[0]}else n=this.scroller.getBoundingClientRect();var i=e+this.scrollLeft-n.left-this.$padding,s=i/this.characterWidth,o=Math.floor((t+this.scrollTop-n.top)/this.lineHeight),u=this.$blockCursor?Math.floor(s):Math.round(s);return{row:o,column:u,side:s-u>0?1:-1,offsetX:i}},this.screenToTextCoordinates=function(e,t){var n;if(this.$hasCssTransforms){n={top:0,left:0};var r=this.$fontMetrics.transformCoordinates([e,t]);e=r[1]-this.gutterWidth-this.margin.left,t=r[0]}else n=this.scroller.getBoundingClientRect();var i=e+this.scrollLeft-n.left-this.$padding,s=i/this.characterWidth,o=this.$blockCursor?Math.floor(s):Math.round(s),u=Math.floor((t+this.scrollTop-n.top)/this.lineHeight);return this.session.screenToDocumentPosition(u,Math.max(o,0),i)},this.textToScreenCoordinates=function(e,t){var n=this.scroller.getBoundingClientRect(),r=this.session.documentToScreenPosition(e,t),i=this.$padding+(this.session.$bidiHandler.isBidiRow(r.row,e)?this.session.$bidiHandler.getPosLeft(r.column):Math.round(r.column*this.characterWidth)),s=r.row*this.lineHeight;return{pageX:n.left+i-this.scrollLeft,pageY:n.top+s-this.scrollTop}},this.visualizeFocus=function(){i.addCssClass(this.container,"ace_focus")},this.visualizeBlur=function(){i.removeCssClass(this.container,"ace_focus")},this.showComposition=function(e){this.$composition=e,e.cssText||(e.cssText=this.textarea.style.cssText),e.useTextareaForIME==undefined&&(e.useTextareaForIME=this.$useTextareaForIME),this.$useTextareaForIME?(i.addCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText="",this.$moveTextAreaToCursor(),this.$cursorLayer.element.style.display="none"):e.markerId=this.session.addMarker(e.markerRange,"ace_composition_marker","text")},this.setCompositionText=function(e){var t=this.session.selection.cursor;this.addToken(e,"composition_placeholder",t.row,t.column),this.$moveTextAreaToCursor()},this.hideComposition=function(){if(!this.$composition)return;this.$composition.markerId&&this.session.removeMarker(this.$composition.markerId),i.removeCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText=this.$composition.cssText;var e=this.session.selection.cursor;this.removeExtraToken(e.row,e.column),this.$composition=null,this.$cursorLayer.element.style.display=""},this.addToken=function(e,t,n,r){var i=this.session;i.bgTokenizer.lines[n]=null;var s={type:t,value:e},o=i.getTokens(n);if(r==null)o.push(s);else{var u=0;for(var a=0;a50&&e.length>this.$doc.getLength()>>1?this.call("setValue",[this.$doc.getValue()]):this.emit("change",{data:e})}}).call(f.prototype);var l=function(e,t,n){var r=null,i=!1,u=Object.create(s),a=[],l=new f({messageBuffer:a,terminate:function(){},postMessage:function(e){a.push(e);if(!r)return;i?setTimeout(c):c()}});l.setEmitSync=function(e){i=e};var c=function(){var e=a.shift();e.command?r[e.command].apply(r,e.args):e.event&&u._signal(e.event,e.data)};return u.postMessage=function(e){l.onMessage({data:e})},u.callback=function(e,t){this.postMessage({type:"call",id:t,data:e})},u.emit=function(e,t){this.postMessage({type:"event",name:e,data:t})},o.loadModule(["worker",t],function(e){r=new e[n](u);while(a.length)c()}),l};t.UIWorkerClient=l,t.WorkerClient=f,t.createWorker=a}),define("ace/placeholder",["require","exports","module","ace/range","ace/lib/event_emitter","ace/lib/oop"],function(e,t,n){"use strict";var r=e("./range").Range,i=e("./lib/event_emitter").EventEmitter,s=e("./lib/oop"),o=function(e,t,n,r,i,s){var o=this;this.length=t,this.session=e,this.doc=e.getDocument(),this.mainClass=i,this.othersClass=s,this.$onUpdate=this.onUpdate.bind(this),this.doc.on("change",this.$onUpdate),this.$others=r,this.$onCursorChange=function(){setTimeout(function(){o.onCursorChange()})},this.$pos=n;var u=e.getUndoManager().$undoStack||e.getUndoManager().$undostack||{length:-1};this.$undoStackDepth=u.length,this.setup(),e.selection.on("changeCursor",this.$onCursorChange)};(function(){s.implement(this,i),this.setup=function(){var e=this,t=this.doc,n=this.session;this.selectionBefore=n.selection.toJSON(),n.selection.inMultiSelectMode&&n.selection.toSingleRange(),this.pos=t.createAnchor(this.$pos.row,this.$pos.column);var i=this.pos;i.$insertRight=!0,i.detach(),i.markerId=n.addMarker(new r(i.row,i.column,i.row,i.column+this.length),this.mainClass,null,!1),this.others=[],this.$others.forEach(function(n){var r=t.createAnchor(n.row,n.column);r.$insertRight=!0,r.detach(),e.others.push(r)}),n.setUndoSelect(!1)},this.showOtherMarkers=function(){if(this.othersActive)return;var e=this.session,t=this;this.othersActive=!0,this.others.forEach(function(n){n.markerId=e.addMarker(new r(n.row,n.column,n.row,n.column+t.length),t.othersClass,null,!1)})},this.hideOtherMarkers=function(){if(!this.othersActive)return;this.othersActive=!1;for(var e=0;e=this.pos.column&&t.start.column<=this.pos.column+this.length+1,s=t.start.column-this.pos.column;this.updateAnchors(e),i&&(this.length+=n);if(i&&!this.session.$fromUndo)if(e.action==="insert")for(var o=this.others.length-1;o>=0;o--){var u=this.others[o],a={row:u.row,column:u.column+s};this.doc.insertMergedLines(a,e.lines)}else if(e.action==="remove")for(var o=this.others.length-1;o>=0;o--){var u=this.others[o],a={row:u.row,column:u.column+s};this.doc.remove(new r(a.row,a.column,a.row,a.column-n))}this.$updating=!1,this.updateMarkers()},this.updateAnchors=function(e){this.pos.onChange(e);for(var t=this.others.length;t--;)this.others[t].onChange(e);this.updateMarkers()},this.updateMarkers=function(){if(this.$updating)return;var e=this,t=this.session,n=function(n,i){t.removeMarker(n.markerId),n.markerId=t.addMarker(new r(n.row,n.column,n.row,n.column+e.length),i,null,!1)};n(this.pos,this.mainClass);for(var i=this.others.length;i--;)n(this.others[i],this.othersClass)},this.onCursorChange=function(e){if(this.$updating||!this.session)return;var t=this.session.selection.getCursor();t.row===this.pos.row&&t.column>=this.pos.column&&t.column<=this.pos.column+this.length?(this.showOtherMarkers(),this._emit("cursorEnter",e)):(this.hideOtherMarkers(),this._emit("cursorLeave",e))},this.detach=function(){this.session.removeMarker(this.pos&&this.pos.markerId),this.hideOtherMarkers(),this.doc.off("change",this.$onUpdate),this.session.selection.off("changeCursor",this.$onCursorChange),this.session.setUndoSelect(!0),this.session=null},this.cancel=function(){if(this.$undoStackDepth===-1)return;var e=this.session.getUndoManager(),t=(e.$undoStack||e.$undostack).length-this.$undoStackDepth;for(var n=0;n1?e.multiSelect.joinSelections():e.multiSelect.splitIntoLines()},bindKey:{win:"Ctrl-Alt-L",mac:"Ctrl-Alt-L"},readOnly:!0},{name:"splitSelectionIntoLines",description:"Split into lines",exec:function(e){e.multiSelect.splitIntoLines()},readOnly:!0},{name:"alignCursors",description:"Align cursors",exec:function(e){e.alignCursors()},bindKey:{win:"Ctrl-Alt-A",mac:"Ctrl-Alt-A"},scrollIntoView:"cursor"},{name:"findAll",description:"Find all",exec:function(e){e.findAll()},bindKey:{win:"Ctrl-Alt-K",mac:"Ctrl-Alt-G"},scrollIntoView:"cursor",readOnly:!0}],t.multiSelectCommands=[{name:"singleSelection",description:"Single selection",bindKey:"esc",exec:function(e){e.exitMultiSelectMode()},scrollIntoView:"cursor",readOnly:!0,isAvailable:function(e){return e&&e.inMultiSelectMode}}];var r=e("../keyboard/hash_handler").HashHandler;t.keyboardHandler=new r(t.multiSelectCommands)}),define("ace/multi_select",["require","exports","module","ace/range_list","ace/range","ace/selection","ace/mouse/multi_select_handler","ace/lib/event","ace/lib/lang","ace/commands/multi_select_commands","ace/search","ace/edit_session","ace/editor","ace/config"],function(e,t,n){function h(e,t,n){return c.$options.wrap=!0,c.$options.needle=t,c.$options.backwards=n==-1,c.find(e)}function v(e,t){return e.row==t.row&&e.column==t.column}function m(e){if(e.$multiselectOnSessionChange)return;e.$onAddRange=e.$onAddRange.bind(e),e.$onRemoveRange=e.$onRemoveRange.bind(e),e.$onMultiSelect=e.$onMultiSelect.bind(e),e.$onSingleSelect=e.$onSingleSelect.bind(e),e.$multiselectOnSessionChange=t.onSessionChange.bind(e),e.$checkMultiselectChange=e.$checkMultiselectChange.bind(e),e.$multiselectOnSessionChange(e),e.on("changeSession",e.$multiselectOnSessionChange),e.on("mousedown",o),e.commands.addCommands(f.defaultCommands),g(e)}function g(e){function r(t){n&&(e.renderer.setMouseCursor(""),n=!1)}if(!e.textInput)return;var t=e.textInput.getElement(),n=!1;u.addListener(t,"keydown",function(t){var i=t.keyCode==18&&!(t.ctrlKey||t.shiftKey||t.metaKey);e.$blockSelectEnabled&&i?n||(e.renderer.setMouseCursor("crosshair"),n=!0):n&&r()},e),u.addListener(t,"keyup",r,e),u.addListener(t,"blur",r,e)}var r=e("./range_list").RangeList,i=e("./range").Range,s=e("./selection").Selection,o=e("./mouse/multi_select_handler").onMouseDown,u=e("./lib/event"),a=e("./lib/lang"),f=e("./commands/multi_select_commands");t.commands=f.defaultCommands.concat(f.multiSelectCommands);var l=e("./search").Search,c=new l,p=e("./edit_session").EditSession;(function(){this.getSelectionMarkers=function(){return this.$selectionMarkers}}).call(p.prototype),function(){this.ranges=null,this.rangeList=null,this.addRange=function(e,t){if(!e)return;if(!this.inMultiSelectMode&&this.rangeCount===0){var n=this.toOrientedRange();this.rangeList.add(n),this.rangeList.add(e);if(this.rangeList.ranges.length!=2)return this.rangeList.removeAll(),t||this.fromOrientedRange(e);this.rangeList.removeAll(),this.rangeList.add(n),this.$onAddRange(n)}e.cursor||(e.cursor=e.end);var r=this.rangeList.add(e);return this.$onAddRange(e),r.length&&this.$onRemoveRange(r),this.rangeCount>1&&!this.inMultiSelectMode&&(this._signal("multiSelect"),this.inMultiSelectMode=!0,this.session.$undoSelect=!1,this.rangeList.attach(this.session)),t||this.fromOrientedRange(e)},this.toSingleRange=function(e){e=e||this.ranges[0];var t=this.rangeList.removeAll();t.length&&this.$onRemoveRange(t),e&&this.fromOrientedRange(e)},this.substractPoint=function(e){var t=this.rangeList.substractPoint(e);if(t)return this.$onRemoveRange(t),t[0]},this.mergeOverlappingRanges=function(){var e=this.rangeList.merge();e.length&&this.$onRemoveRange(e)},this.$onAddRange=function(e){this.rangeCount=this.rangeList.ranges.length,this.ranges.unshift(e),this._signal("addRange",{range:e})},this.$onRemoveRange=function(e){this.rangeCount=this.rangeList.ranges.length;if(this.rangeCount==1&&this.inMultiSelectMode){var t=this.rangeList.ranges.pop();e.push(t),this.rangeCount=0}for(var n=e.length;n--;){var r=this.ranges.indexOf(e[n]);this.ranges.splice(r,1)}this._signal("removeRange",{ranges:e}),this.rangeCount===0&&this.inMultiSelectMode&&(this.inMultiSelectMode=!1,this._signal("singleSelect"),this.session.$undoSelect=!0,this.rangeList.detach(this.session)),t=t||this.ranges[0],t&&!t.isEqual(this.getRange())&&this.fromOrientedRange(t)},this.$initRangeList=function(){if(this.rangeList)return;this.rangeList=new r,this.ranges=[],this.rangeCount=0},this.getAllRanges=function(){return this.rangeCount?this.rangeList.ranges.concat():[this.getRange()]},this.splitIntoLines=function(){var e=this.ranges.length?this.ranges:[this.getRange()],t=[];for(var n=0;n1){var e=this.rangeList.ranges,t=e[e.length-1],n=i.fromPoints(e[0].start,t.end);this.toSingleRange(),this.setSelectionRange(n,t.cursor==t.start)}else{var r=this.session.documentToScreenPosition(this.cursor),s=this.session.documentToScreenPosition(this.anchor),o=this.rectangularRangeBlock(r,s);o.forEach(this.addRange,this)}},this.rectangularRangeBlock=function(e,t,n){var r=[],s=e.column0)g--;if(g>0){var y=0;while(r[y].isEmpty())y++}for(var b=g;b>=y;b--)r[b].isEmpty()&&r.splice(b,1)}return r}}.call(s.prototype);var d=e("./editor").Editor;(function(){this.updateSelectionMarkers=function(){this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.addSelectionMarker=function(e){e.cursor||(e.cursor=e.end);var t=this.getSelectionStyle();return e.marker=this.session.addMarker(e,"ace_selection",t),this.session.$selectionMarkers.push(e),this.session.selectionMarkerCount=this.session.$selectionMarkers.length,e},this.removeSelectionMarker=function(e){if(!e.marker)return;this.session.removeMarker(e.marker);var t=this.session.$selectionMarkers.indexOf(e);t!=-1&&this.session.$selectionMarkers.splice(t,1),this.session.selectionMarkerCount=this.session.$selectionMarkers.length},this.removeSelectionMarkers=function(e){var t=this.session.$selectionMarkers;for(var n=e.length;n--;){var r=e[n];if(!r.marker)continue;this.session.removeMarker(r.marker);var i=t.indexOf(r);i!=-1&&t.splice(i,1)}this.session.selectionMarkerCount=t.length},this.$onAddRange=function(e){this.addSelectionMarker(e.range),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onRemoveRange=function(e){this.removeSelectionMarkers(e.ranges),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onMultiSelect=function(e){if(this.inMultiSelectMode)return;this.inMultiSelectMode=!0,this.setStyle("ace_multiselect"),this.keyBinding.addKeyboardHandler(f.keyboardHandler),this.commands.setDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onSingleSelect=function(e){if(this.session.multiSelect.inVirtualMode)return;this.inMultiSelectMode=!1,this.unsetStyle("ace_multiselect"),this.keyBinding.removeKeyboardHandler(f.keyboardHandler),this.commands.removeDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers(),this._emit("changeSelection")},this.$onMultiSelectExec=function(e){var t=e.command,n=e.editor;if(!n.multiSelect)return;if(!t.multiSelectAction){var r=t.exec(n,e.args||{});n.multiSelect.addRange(n.multiSelect.toOrientedRange()),n.multiSelect.mergeOverlappingRanges()}else t.multiSelectAction=="forEach"?r=n.forEachSelection(t,e.args):t.multiSelectAction=="forEachLine"?r=n.forEachSelection(t,e.args,!0):t.multiSelectAction=="single"?(n.exitMultiSelectMode(),r=t.exec(n,e.args||{})):r=t.multiSelectAction(n,e.args||{});return r},this.forEachSelection=function(e,t,n){if(this.inVirtualSelectionMode)return;var r=n&&n.keepOrder,i=n==1||n&&n.$byLines,o=this.session,u=this.selection,a=u.rangeList,f=(r?u:a).ranges,l;if(!f.length)return e.exec?e.exec(this,t||{}):e(this,t||{});var c=u._eventRegistry;u._eventRegistry={};var h=new s(o);this.inVirtualSelectionMode=!0;for(var p=f.length;p--;){if(i)while(p>0&&f[p].start.row==f[p-1].end.row)p--;h.fromOrientedRange(f[p]),h.index=p,this.selection=o.selection=h;var d=e.exec?e.exec(this,t||{}):e(this,t||{});!l&&d!==undefined&&(l=d),h.toOrientedRange(f[p])}h.detach(),this.selection=o.selection=u,this.inVirtualSelectionMode=!1,u._eventRegistry=c,u.mergeOverlappingRanges(),u.ranges[0]&&u.fromOrientedRange(u.ranges[0]);var v=this.renderer.$scrollAnimation;return this.onCursorChange(),this.onSelectionChange(),v&&v.from==v.to&&this.renderer.animateScrolling(v.from),l},this.exitMultiSelectMode=function(){if(!this.inMultiSelectMode||this.inVirtualSelectionMode)return;this.multiSelect.toSingleRange()},this.getSelectedText=function(){var e="";if(this.inMultiSelectMode&&!this.inVirtualSelectionMode){var t=this.multiSelect.rangeList.ranges,n=[];for(var r=0;r0);u<0&&(u=0),f>=c&&(f=c-1)}var p=this.session.removeFullLines(u,f);p=this.$reAlignText(p,l),this.session.insert({row:u,column:0},p.join("\n")+"\n"),l||(o.start.column=0,o.end.column=p[p.length-1].length),this.selection.setRange(o)}else{s.forEach(function(e){t.substractPoint(e.cursor)});var d=0,v=Infinity,m=n.map(function(t){var n=t.cursor,r=e.getLine(n.row),i=r.substr(n.column).search(/\S/g);return i==-1&&(i=0),n.column>d&&(d=n.column),io?e.insert(r,a.stringRepeat(" ",s-o)):e.remove(new i(r.row,r.column,r.row,r.column-s+o)),t.start.column=t.end.column=d,t.start.row=t.end.row=r.row,t.cursor=t.end}),t.fromOrientedRange(n[0]),this.renderer.updateCursor(),this.renderer.updateBackMarkers()}},this.$reAlignText=function(e,t){function u(e){return a.stringRepeat(" ",e)}function f(e){return e[2]?u(i)+e[2]+u(s-e[2].length+o)+e[4].replace(/^([=:])\s+/,"$1 "):e[0]}function l(e){return e[2]?u(i+s-e[2].length)+e[2]+u(o)+e[4].replace(/^([=:])\s+/,"$1 "):e[0]}function c(e){return e[2]?u(i)+e[2]+u(o)+e[4].replace(/^([=:])\s+/,"$1 "):e[0]}var n=!0,r=!0,i,s,o;return e.map(function(e){var t=e.match(/(\s*)(.*?)(\s*)([=:].*)/);return t?i==null?(i=t[1].length,s=t[2].length,o=t[3].length,t):(i+s+o!=t[1].length+t[2].length+t[3].length&&(r=!1),i!=t[1].length&&(n=!1),i>t[1].length&&(i=t[1].length),st[3].length&&(o=t[3].length),t):[e]}).map(t?f:n?r?l:f:c)}}).call(d.prototype),t.onSessionChange=function(e){var t=e.session;t&&!t.multiSelect&&(t.$selectionMarkers=[],t.selection.$initRangeList(),t.multiSelect=t.selection),this.multiSelect=t&&t.multiSelect;var n=e.oldSession;n&&(n.multiSelect.off("addRange",this.$onAddRange),n.multiSelect.off("removeRange",this.$onRemoveRange),n.multiSelect.off("multiSelect",this.$onMultiSelect),n.multiSelect.off("singleSelect",this.$onSingleSelect),n.multiSelect.lead.off("change",this.$checkMultiselectChange),n.multiSelect.anchor.off("change",this.$checkMultiselectChange)),t&&(t.multiSelect.on("addRange",this.$onAddRange),t.multiSelect.on("removeRange",this.$onRemoveRange),t.multiSelect.on("multiSelect",this.$onMultiSelect),t.multiSelect.on("singleSelect",this.$onSingleSelect),t.multiSelect.lead.on("change",this.$checkMultiselectChange),t.multiSelect.anchor.on("change",this.$checkMultiselectChange)),t&&this.inMultiSelectMode!=t.selection.inMultiSelectMode&&(t.selection.inMultiSelectMode?this.$onMultiSelect():this.$onSingleSelect())},t.MultiSelect=m,e("./config").defineOptions(d.prototype,"editor",{enableMultiselect:{set:function(e){m(this),e?(this.on("changeSession",this.$multiselectOnSessionChange),this.on("mousedown",o)):(this.off("changeSession",this.$multiselectOnSessionChange),this.off("mousedown",o))},value:!0},enableBlockSelect:{set:function(e){this.$blockSelectEnabled=e},value:!0}})}),define("ace/mode/folding/fold_mode",["require","exports","module","ace/range"],function(e,t,n){"use strict";var r=e("../../range").Range,i=t.FoldMode=function(){};(function(){this.foldingStartMarker=null,this.foldingStopMarker=null,this.getFoldWidget=function(e,t,n){var r=e.getLine(n);return this.foldingStartMarker.test(r)?"start":t=="markbeginend"&&this.foldingStopMarker&&this.foldingStopMarker.test(r)?"end":""},this.getFoldWidgetRange=function(e,t,n){return null},this.indentationBlock=function(e,t,n){var i=/\S/,s=e.getLine(t),o=s.search(i);if(o==-1)return;var u=n||s.length,a=e.getLength(),f=t,l=t;while(++tf){var p=e.getLine(l).length;return new r(f,u,l,p)}},this.openingBracketBlock=function(e,t,n,i,s){var o={row:n,column:i+1},u=e.$findClosingBracket(t,o,s);if(!u)return;var a=e.foldWidgets[u.row];return a==null&&(a=e.getFoldWidget(u.row)),a=="start"&&u.row>o.row&&(u.row--,u.column=e.getLine(u.row).length),r.fromPoints(o,u)},this.closingBracketBlock=function(e,t,n,i,s){var o={row:n,column:i},u=e.$findOpeningBracket(t,o);if(!u)return;return u.column++,o.column--,r.fromPoints(u,o)}}).call(i.prototype)}),define("ace/theme/textmate",["require","exports","module","ace/lib/dom"],function(e,t,n){"use strict";t.isDark=!1,t.cssClass="ace-tm",t.cssText='.ace-tm .ace_gutter {background: #f0f0f0;color: #333;}.ace-tm .ace_print-margin {width: 1px;background: #e8e8e8;}.ace-tm .ace_fold {background-color: #6B72E6;}.ace-tm {background-color: #FFFFFF;color: black;}.ace-tm .ace_cursor {color: black;}.ace-tm .ace_invisible {color: rgb(191, 191, 191);}.ace-tm .ace_storage,.ace-tm .ace_keyword {color: blue;}.ace-tm .ace_constant {color: rgb(197, 6, 11);}.ace-tm .ace_constant.ace_buildin {color: rgb(88, 72, 246);}.ace-tm .ace_constant.ace_language {color: rgb(88, 92, 246);}.ace-tm .ace_constant.ace_library {color: rgb(6, 150, 14);}.ace-tm .ace_invalid {background-color: rgba(255, 0, 0, 0.1);color: red;}.ace-tm .ace_support.ace_function {color: rgb(60, 76, 114);}.ace-tm .ace_support.ace_constant {color: rgb(6, 150, 14);}.ace-tm .ace_support.ace_type,.ace-tm .ace_support.ace_class {color: rgb(109, 121, 222);}.ace-tm .ace_keyword.ace_operator {color: rgb(104, 118, 135);}.ace-tm .ace_string {color: rgb(3, 106, 7);}.ace-tm .ace_comment {color: rgb(76, 136, 107);}.ace-tm .ace_comment.ace_doc {color: rgb(0, 102, 255);}.ace-tm .ace_comment.ace_doc.ace_tag {color: rgb(128, 159, 191);}.ace-tm .ace_constant.ace_numeric {color: rgb(0, 0, 205);}.ace-tm .ace_variable {color: rgb(49, 132, 149);}.ace-tm .ace_xml-pe {color: rgb(104, 104, 91);}.ace-tm .ace_entity.ace_name.ace_function {color: #0000A2;}.ace-tm .ace_heading {color: rgb(12, 7, 255);}.ace-tm .ace_list {color:rgb(185, 6, 144);}.ace-tm .ace_meta.ace_tag {color:rgb(0, 22, 142);}.ace-tm .ace_string.ace_regex {color: rgb(255, 0, 0)}.ace-tm .ace_marker-layer .ace_selection {background: rgb(181, 213, 255);}.ace-tm.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px white;}.ace-tm .ace_marker-layer .ace_step {background: rgb(252, 255, 0);}.ace-tm .ace_marker-layer .ace_stack {background: rgb(164, 229, 101);}.ace-tm .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgb(192, 192, 192);}.ace-tm .ace_marker-layer .ace_active-line {background: rgba(0, 0, 0, 0.07);}.ace-tm .ace_gutter-active-line {background-color : #dcdcdc;}.ace-tm .ace_marker-layer .ace_selected-word {background: rgb(250, 250, 255);border: 1px solid rgb(200, 200, 250);}.ace-tm .ace_indent-guide {background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y;}',t.$id="ace/theme/textmate";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}),define("ace/line_widgets",["require","exports","module","ace/lib/dom"],function(e,t,n){"use strict";function i(e){this.session=e,this.session.widgetManager=this,this.session.getRowLength=this.getRowLength,this.session.$getWidgetScreenLength=this.$getWidgetScreenLength,this.updateOnChange=this.updateOnChange.bind(this),this.renderWidgets=this.renderWidgets.bind(this),this.measureWidgets=this.measureWidgets.bind(this),this.session._changedWidgets=[],this.$onChangeEditor=this.$onChangeEditor.bind(this),this.session.on("change",this.updateOnChange),this.session.on("changeFold",this.updateOnFold),this.session.on("changeEditor",this.$onChangeEditor)}var r=e("./lib/dom");(function(){this.getRowLength=function(e){var t;return this.lineWidgets?t=this.lineWidgets[e]&&this.lineWidgets[e].rowCount||0:t=0,!this.$useWrapMode||!this.$wrapData[e]?1+t:this.$wrapData[e].length+1+t},this.$getWidgetScreenLength=function(){var e=0;return this.lineWidgets.forEach(function(t){t&&t.rowCount&&!t.hidden&&(e+=t.rowCount)}),e},this.$onChangeEditor=function(e){this.attach(e.editor)},this.attach=function(e){e&&e.widgetManager&&e.widgetManager!=this&&e.widgetManager.detach();if(this.editor==e)return;this.detach(),this.editor=e,e&&(e.widgetManager=this,e.renderer.on("beforeRender",this.measureWidgets),e.renderer.on("afterRender",this.renderWidgets))},this.detach=function(e){var t=this.editor;if(!t)return;this.editor=null,t.widgetManager=null,t.renderer.off("beforeRender",this.measureWidgets),t.renderer.off("afterRender",this.renderWidgets);var n=this.session.lineWidgets;n&&n.forEach(function(e){e&&e.el&&e.el.parentNode&&(e._inDocument=!1,e.el.parentNode.removeChild(e.el))})},this.updateOnFold=function(e,t){var n=t.lineWidgets;if(!n||!e.action)return;var r=e.data,i=r.start.row,s=r.end.row,o=e.action=="add";for(var u=i+1;ut[n].column&&n++,s.unshift(n,0),t.splice.apply(t,s),this.$updateRows()}},this.$updateRows=function(){var e=this.session.lineWidgets;if(!e)return;var t=!0;e.forEach(function(e,n){if(e){t=!1,e.row=n;while(e.$oldWidget)e.$oldWidget.row=n,e=e.$oldWidget}}),t&&(this.session.lineWidgets=null)},this.$registerLineWidget=function(e){this.session.lineWidgets||(this.session.lineWidgets=new Array(this.session.getLength()));var t=this.session.lineWidgets[e.row];return t&&(e.$oldWidget=t,t.el&&t.el.parentNode&&(t.el.parentNode.removeChild(t.el),t._inDocument=!1)),this.session.lineWidgets[e.row]=e,e},this.addLineWidget=function(e){this.$registerLineWidget(e),e.session=this.session;if(!this.editor)return e;var t=this.editor.renderer;e.html&&!e.el&&(e.el=r.createElement("div"),e.el.innerHTML=e.html),e.el&&(r.addCssClass(e.el,"ace_lineWidgetContainer"),e.el.style.position="absolute",e.el.style.zIndex=5,t.container.appendChild(e.el),e._inDocument=!0,e.coverGutter||(e.el.style.zIndex=3),e.pixelHeight==null&&(e.pixelHeight=e.el.offsetHeight)),e.rowCount==null&&(e.rowCount=e.pixelHeight/t.layerConfig.lineHeight);var n=this.session.getFoldAt(e.row,0);e.$fold=n;if(n){var i=this.session.lineWidgets;e.row==n.end.row&&!i[n.start.row]?i[n.start.row]=e:e.hidden=!0}return this.session._emit("changeFold",{data:{start:{row:e.row}}}),this.$updateRows(),this.renderWidgets(null,t),this.onWidgetChanged(e),e},this.removeLineWidget=function(e){e._inDocument=!1,e.session=null,e.el&&e.el.parentNode&&e.el.parentNode.removeChild(e.el);if(e.editor&&e.editor.destroy)try{e.editor.destroy()}catch(t){}if(this.session.lineWidgets){var n=this.session.lineWidgets[e.row];if(n==e)this.session.lineWidgets[e.row]=e.$oldWidget,e.$oldWidget&&this.onWidgetChanged(e.$oldWidget);else while(n){if(n.$oldWidget==e){n.$oldWidget=e.$oldWidget;break}n=n.$oldWidget}}this.session._emit("changeFold",{data:{start:{row:e.row}}}),this.$updateRows()},this.getWidgetsAtRow=function(e){var t=this.session.lineWidgets,n=t&&t[e],r=[];while(n)r.push(n),n=n.$oldWidget;return r},this.onWidgetChanged=function(e){this.session._changedWidgets.push(e),this.editor&&this.editor.renderer.updateFull()},this.measureWidgets=function(e,t){var n=this.session._changedWidgets,r=t.layerConfig;if(!n||!n.length)return;var i=Infinity;for(var s=0;s0&&!r[i])i--;this.firstRow=n.firstRow,this.lastRow=n.lastRow,t.$cursorLayer.config=n;for(var o=i;o<=s;o++){var u=r[o];if(!u||!u.el)continue;if(u.hidden){u.el.style.top=-100-(u.pixelHeight||0)+"px";continue}u._inDocument||(u._inDocument=!0,t.container.appendChild(u.el));var a=t.$cursorLayer.getPixelPosition({row:o,column:0},!0).top;u.coverLine||(a+=n.lineHeight*this.session.getRowLineCount(u.row)),u.el.style.top=a-n.offset+"px";var f=u.coverGutter?0:t.gutterWidth;u.fixedWidth||(f-=t.scrollLeft),u.el.style.left=f+"px",u.fullWidth&&u.screenWidth&&(u.el.style.minWidth=n.width+2*n.padding+"px"),u.fixedWidth?u.el.style.right=t.scrollBar.getWidth()+"px":u.el.style.right=""}}}).call(i.prototype),t.LineWidgets=i}),define("ace/ext/error_marker",["require","exports","module","ace/line_widgets","ace/lib/dom","ace/range"],function(e,t,n){"use strict";function o(e,t,n){var r=0,i=e.length-1;while(r<=i){var s=r+i>>1,o=n(t,e[s]);if(o>0)r=s+1;else{if(!(o<0))return s;i=s-1}}return-(r+1)}function u(e,t,n){var r=e.getAnnotations().sort(s.comparePoints);if(!r.length)return;var i=o(r,{row:t,column:-1},s.comparePoints);i<0&&(i=-i-1),i>=r.length?i=n>0?0:r.length-1:i===0&&n<0&&(i=r.length-1);var u=r[i];if(!u||!n)return;if(u.row===t){do u=r[i+=n];while(u&&u.row===t);if(!u)return r.slice()}var a=[];t=u.row;do a[n<0?"unshift":"push"](u),u=r[i+=n];while(u&&u.row==t);return a.length&&a}var r=e("../line_widgets").LineWidgets,i=e("../lib/dom"),s=e("../range").Range;t.showErrorMarker=function(e,t){var n=e.session;n.widgetManager||(n.widgetManager=new r(n),n.widgetManager.attach(e));var s=e.getCursorPosition(),o=s.row,a=n.widgetManager.getWidgetsAtRow(o).filter(function(e){return e.type=="errorMarker"})[0];a?a.destroy():o-=t;var f=u(n,o,t),l;if(f){var c=f[0];s.column=(c.pos&&typeof c.column!="number"?c.pos.sc:c.column)||0,s.row=c.row,l=e.renderer.$gutterLayer.$annotations[s.row]}else{if(a)return;l={text:["Looks good!"],className:"ace_ok"}}e.session.unfold(s.row),e.selection.moveToPosition(s);var h={row:s.row,fixedWidth:!0,coverGutter:!0,el:i.createElement("div"),type:"errorMarker"},p=h.el.appendChild(i.createElement("div")),d=h.el.appendChild(i.createElement("div"));d.className="error_widget_arrow "+l.className;var v=e.renderer.$cursorLayer.getPixelPosition(s).left;d.style.left=v+e.renderer.gutterWidth-5+"px",h.el.className="error_widget_wrapper",p.className="error_widget "+l.className,p.innerHTML=l.text.join("
"),p.appendChild(i.createElement("div"));var m=function(e,t,n){if(t===0&&(n==="esc"||n==="return"))return h.destroy(),{command:"null"}};h.destroy=function(){if(e.$mouseHandler.isMousePressed)return;e.keyBinding.removeKeyboardHandler(m),n.widgetManager.removeLineWidget(h),e.off("changeSelection",h.destroy),e.off("changeSession",h.destroy),e.off("mouseup",h.destroy),e.off("change",h.destroy)},e.keyBinding.addKeyboardHandler(m),e.on("changeSelection",h.destroy),e.on("changeSession",h.destroy),e.on("mouseup",h.destroy),e.on("change",h.destroy),e.session.widgetManager.addLineWidget(h),h.el.onmousedown=e.focus.bind(e),e.renderer.scrollCursorIntoView(null,.5,{bottom:h.el.offsetHeight})},i.importCssString(" .error_widget_wrapper { background: inherit; color: inherit; border:none } .error_widget { border-top: solid 2px; border-bottom: solid 2px; margin: 5px 0; padding: 10px 40px; white-space: pre-wrap; } .error_widget.ace_error, .error_widget_arrow.ace_error{ border-color: #ff5a5a } .error_widget.ace_warning, .error_widget_arrow.ace_warning{ border-color: #F1D817 } .error_widget.ace_info, .error_widget_arrow.ace_info{ border-color: #5a5a5a } .error_widget.ace_ok, .error_widget_arrow.ace_ok{ border-color: #5aaa5a } .error_widget_arrow { position: absolute; border: solid 5px; border-top-color: transparent!important; border-right-color: transparent!important; border-left-color: transparent!important; top: -5px; }","")}),define("ace/ace",["require","exports","module","ace/lib/fixoldbrowsers","ace/lib/dom","ace/lib/event","ace/range","ace/editor","ace/edit_session","ace/undomanager","ace/virtual_renderer","ace/worker/worker_client","ace/keyboard/hash_handler","ace/placeholder","ace/multi_select","ace/mode/folding/fold_mode","ace/theme/textmate","ace/ext/error_marker","ace/config"],function(e,t,n){"use strict";e("./lib/fixoldbrowsers");var r=e("./lib/dom"),i=e("./lib/event"),s=e("./range").Range,o=e("./editor").Editor,u=e("./edit_session").EditSession,a=e("./undomanager").UndoManager,f=e("./virtual_renderer").VirtualRenderer;e("./worker/worker_client"),e("./keyboard/hash_handler"),e("./placeholder"),e("./multi_select"),e("./mode/folding/fold_mode"),e("./theme/textmate"),e("./ext/error_marker"),t.config=e("./config"),t.require=e,typeof define=="function"&&(t.define=define),t.edit=function(e,n){if(typeof e=="string"){var s=e;e=document.getElementById(s);if(!e)throw new Error("ace.edit can't find div #"+s)}if(e&&e.env&&e.env.editor instanceof o)return e.env.editor;var u="";if(e&&/input|textarea/i.test(e.tagName)){var a=e;u=a.value,e=r.createElement("pre"),a.parentNode.replaceChild(e,a)}else e&&(u=e.textContent,e.innerHTML="");var l=t.createEditSession(u),c=new o(new f(e),l,n),h={document:l,editor:c,onResize:c.resize.bind(c,null)};return a&&(h.textarea=a),i.addListener(window,"resize",h.onResize),c.on("destroy",function(){i.removeListener(window,"resize",h.onResize),h.editor.container.env=null}),c.container.env=c.env=h,c},t.createEditSession=function(e,t){var n=new u(e,t);return n.setUndoManager(new a),n},t.Range=s,t.Editor=o,t.EditSession=u,t.UndoManager=a,t.VirtualRenderer=f,t.version=t.config.version}); (function() { window.require(["ace/ace"], function(a) { if (a) { a.config.init(true); a.define = window.define; } if (!window.ace) window.ace = a; for (var key in a) if (a.hasOwnProperty(key)) window.ace[key] = a[key]; window.ace["default"] = window.ace; if (typeof module == "object" && typeof exports == "object" && module) { module.exports = window.ace; } }); })(); ================================================ FILE: pyp5js/http_local/static/js/ace/ext-beautify.js ================================================ define("ace/ext/beautify",["require","exports","module","ace/token_iterator"],function(e,t,n){"use strict";function i(e,t){return e.type.lastIndexOf(t+".xml")>-1}var r=e("../token_iterator").TokenIterator;t.singletonTags=["area","base","br","col","command","embed","hr","html","img","input","keygen","link","meta","param","source","track","wbr"],t.blockTags=["article","aside","blockquote","body","div","dl","fieldset","footer","form","head","header","html","nav","ol","p","script","section","style","table","tbody","tfoot","thead","ul"],t.beautify=function(e){var n=new r(e,0,0),s=n.getCurrentToken(),o=e.getTabString(),u=t.singletonTags,a=t.blockTags,f,l=!1,c=!1,h=!1,p="",d="",v="",m=0,g=0,y=0,b=0,w=0,E=0,S=0,x,T=0,N=0,C=[],k=!1,L,A=!1,O=!1,M=!1,_=!1,D={0:0},P=[],H=function(){f&&f.value&&f.type!=="string.regexp"&&(f.value=f.value.replace(/^\s*/,""))},B=function(){p=p.replace(/ +$/,"")},j=function(){p=p.trimRight(),l=!1};while(s!==null){T=n.getCurrentTokenRow(),C=n.$rowTokens,f=n.stepForward();if(typeof s!="undefined"){d=s.value,w=0,M=v==="style"||e.$modeId==="ace/mode/css",i(s,"tag-open")?(O=!0,f&&(_=a.indexOf(f.value)!==-1),d==="0;N--)p+="\n";l=!0,!i(s,"comment")&&!s.type.match(/^(comment|string)$/)&&(d=d.trimLeft())}if(d){s.type==="keyword"&&d.match(/^(if|else|elseif|for|foreach|while|switch)$/)?(P[m]=d,H(),h=!0,d.match(/^(else|elseif)$/)&&p.match(/\}[\s]*$/)&&(j(),c=!0)):s.type==="paren.lparen"?(H(),d.substr(-1)==="{"&&(h=!0,A=!1,O||(N=1)),d.substr(0,1)==="{"&&(c=!0,p.substr(-1)!=="["&&p.trimRight().substr(-1)==="["?(j(),c=!1):p.trimRight().substr(-1)===")"?j():B())):s.type==="paren.rparen"?(w=1,d.substr(0,1)==="}"&&(P[m-1]==="case"&&w++,p.trimRight().substr(-1)==="{"?j():(c=!0,M&&(N+=2))),d.substr(0,1)==="]"&&p.substr(-1)!=="}"&&p.trimRight().substr(-1)==="}"&&(c=!1,b++,j()),d.substr(0,1)===")"&&p.substr(-1)!=="("&&p.trimRight().substr(-1)==="("&&(c=!1,b++,j()),B()):s.type!=="keyword.operator"&&s.type!=="keyword"||!d.match(/^(=|==|===|!=|!==|&&|\|\||and|or|xor|\+=|.=|>|>=|<|<=|=>)$/)?s.type==="punctuation.operator"&&d===";"?(j(),H(),h=!0,M&&N++):s.type==="punctuation.operator"&&d.match(/^(:|,)$/)?(j(),H(),d.match(/^(,)$/)&&S>0&&E===0?N++:(h=!0,l=!1)):s.type==="support.php_tag"&&d==="?>"&&!l?(j(),c=!0):i(s,"attribute-name")&&p.substr(-1).match(/^\s$/)?c=!0:i(s,"attribute-equals")?(B(),H()):i(s,"tag-close")&&(B(),d==="/>"&&(c=!0)):(j(),H(),c=!0,h=!0);if(l&&(!s.type.match(/^(comment)$/)||!!d.substr(0,1).match(/^[/#]$/))&&(!s.type.match(/^(string)$/)||!!d.substr(0,1).match(/^['"]$/))){b=y;if(m>g){b++;for(L=m;L>g;L--)D[L]=b}else m")_&&f&&f.value===""&&u.indexOf(v)===-1&&m--,x=T}}s=f}p=p.trim(),e.doc.setValue(p)},t.commands=[{name:"beautify",description:"Format selection (Beautify)",exec:function(e){t.beautify(e.session)},bindKey:"Ctrl-Shift-B"}]}); (function() { window.require(["ace/ext/beautify"], function(m) { if (typeof module == "object" && typeof exports == "object" && module) { module.exports = m; } }); })(); ================================================ FILE: pyp5js/http_local/static/js/ace/ext-code_lens.js ================================================ define("ace/ext/code_lens",["require","exports","module","ace/line_widgets","ace/lib/event","ace/lib/lang","ace/lib/dom","ace/editor","ace/config"],function(e,t,n){"use strict";function u(e){var t=e.$textLayer,n=t.$lenses;n&&n.forEach(function(e){e.remove()}),t.$lenses=null}function a(e,t){var n=e&t.CHANGE_LINES||e&t.CHANGE_FULL||e&t.CHANGE_SCROLL||e&t.CHANGE_TEXT;if(!n)return;var r=t.session,i=t.session.lineWidgets,s=t.$textLayer,a=s.$lenses;if(!i){a&&u(t);return}var f=t.$textLayer.$lines.cells,l=t.layerConfig,c=t.$padding;a||(a=s.$lenses=[]);var h=0;for(var p=0;p2*y-1)g.lastChild.remove();var w=t.$cursorLayer.getPixelPosition({row:d,column:0},!0).top-l.lineHeight*v.rowsAbove-l.offset;g.style.top=w+"px";var E=t.gutterWidth,S=r.getLine(d).search(/\S|$/);S==-1&&(S=0),E+=S*l.characterWidth,E-=t.scrollLeft,g.style.paddingLeft=c+E+"px"}while(h1)return;var u=n.documentToScreenRow(r),a=e.renderer.layerConfig.lineHeight,f=n.getScrollTop()+(u-i)*a;n.setScrollTop(f)}var n=e.session;if(!n)return;n.widgetManager||(n.widgetManager=new r(n),n.widgetManager.attach(e));var i=e.codeLensProviders.length,s=[];e.codeLensProviders.forEach(function(e){e.provideCodeLenses(n,function(e,t){if(e)return;t.forEach(function(e){s.push(e)}),i--,i==0&&o()})})};var n=s.delayedCall(e.$updateLenses);e.$updateLensesOnInput=function(){n.delay(250)},e.on("input",e.$updateLensesOnInput)}function c(e){e.off("input",e.$updateLensesOnInput),e.renderer.off("afterRender",a),e.$codeLensClickHandler&&e.container.removeEventListener("click",e.$codeLensClickHandler)}var r=e("../line_widgets").LineWidgets,i=e("../lib/event"),s=e("../lib/lang"),o=e("../lib/dom");t.setLenses=function(e,t){var n=Number.MAX_VALUE;f(e),t&&t.forEach(function(t){var r=t.start.row,i=t.start.column,s=e.lineWidgets&&e.lineWidgets[r];if(!s||!s.lenses)s=e.widgetManager.$registerLineWidget({rowCount:1,rowsAbove:1,row:r,column:i,lenses:[]});s.lenses.push(t.command),r a { cursor: pointer; pointer-events: auto;}.ace_codeLens > a:hover { color: #0000ff; text-decoration: underline;}.ace_dark > .ace_codeLens > a:hover { color: #4e94ce;}","")}); (function() { window.require(["ace/ext/code_lens"], function(m) { if (typeof module == "object" && typeof exports == "object" && module) { module.exports = m; } }); })(); ================================================ FILE: pyp5js/http_local/static/js/ace/ext-elastic_tabstops_lite.js ================================================ define("ace/ext/elastic_tabstops_lite",["require","exports","module","ace/editor","ace/config"],function(e,t,n){"use strict";var r=function(e){this.$editor=e;var t=this,n=[],r=!1;this.onAfterExec=function(){r=!1,t.processRows(n),n=[]},this.onExec=function(){r=!0},this.onChange=function(e){r&&(n.indexOf(e.start.row)==-1&&n.push(e.start.row),e.end.row!=e.start.row&&n.push(e.end.row))}};(function(){this.processRows=function(e){this.$inChange=!0;var t=[];for(var n=0,r=e.length;n-1)continue;var s=this.$findCellWidthsForBlock(i),o=this.$setBlockCellWidthsToMax(s.cellWidths),u=s.firstRow;for(var a=0,f=o.length;a=0){n=this.$cellWidthsForRow(r);if(n.length==0)break;t.unshift(n),r--}var i=r+1;r=e;var s=this.$editor.session.getLength();while(r0&&(this.$editor.session.getDocument().insertInLine({row:e,column:f+1},Array(l+1).join(" ")+" "),this.$editor.session.getDocument().removeInLine(e,f,f+1),r+=l),l<0&&p>=-l&&(this.$editor.session.getDocument().removeInLine(e,f+l,f),r+=l)}},this.$izip_longest=function(e){if(!e[0])return[];var t=e[0].length,n=e.length;for(var r=1;rt&&(t=i)}var s=[];for(var o=0;o=t.length?t.length:e.length,r=[];for(var i=0;i"a"}),[e]}},{regex:"/\\w*}",onMatch:function(e,t,n){var r=n.shift();return r&&(r.flag=e.slice(1,-1)),this.next=r&&r.tabstopId?"start":"",[r||e]},next:"start"},{regex:/\$(?:\d+|\w+)/,onMatch:function(e,t,n){return[{text:e.slice(1)}]}},{regex:/\${\w+/,onMatch:function(e,t,n){var r={text:e.slice(2)};return n.unshift(r),[r]},next:"formatStringVar"},{regex:/\n/,token:"newline",merge:!1},{regex:/}/,onMatch:function(e,t,n){var r=n.shift();return this.next=r&&r.tabstopId?"start":"",[r||e]},next:"start"}],formatStringVar:[{regex:/:\/\w+}/,onMatch:function(e,t,n){var r=n[0];return r.formatFunction=e.slice(2,-1),[n.shift()]},next:"formatString"},n,{regex:/:[\?\-+]?/,onMatch:function(e,t,n){e[1]=="+"&&(n[0].ifEnd=n[0]),e[1]=="?"&&(n[0].expectElse=!0)},next:"formatString"},{regex:"([^:}\\\\]|\\\\.)*:?",token:"",next:"formatString"}]}),p.$tokenizer},this.tokenizeTmSnippet=function(e,t){return this.getTokenizer().getLineTokens(e,t).tokens.map(function(e){return e.value||e})},this.getVariableValue=function(e,t,n){if(/^\d+$/.test(t))return(this.variables.__||{})[t]||"";if(/^[A-Z]\d+$/.test(t))return(this.variables[t[0]+"__"]||{})[t.substr(1)]||"";t=t.replace(/^TM_/,"");if(!this.variables.hasOwnProperty(t))return"";var r=this.variables[t];return typeof r=="function"&&(r=this.variables[t](e,t,n)),r==null?"":r},this.variables=c,this.tmStrFormat=function(e,t,n){if(!t.fmt)return e;var r=t.flag||"",i=t.guard;i=new RegExp(i,r.replace(/[^gim]/g,""));var s=typeof t.fmt=="string"?this.tokenizeTmSnippet(t.fmt,"formatString"):t.fmt,o=this,u=e.replace(i,function(){var e=o.variables.__;o.variables.__=[].slice.call(arguments);var t=o.resolveVariables(s,n),r="E";for(var i=0;i1?(y=t[t.length-1].length,g+=t.length-1):y+=e.length,b+=e}else e&&(e.start?e.end={row:g,column:y}:e.start={row:g,column:y})});var w=e.getSelectionRange(),E=e.session.replace(w,b),S=new d(e),x=e.inVirtualSelectionMode&&e.selection.index;S.addTabstops(u,w.start,E,x)},this.insertSnippet=function(e,t){var n=this;if(e.inVirtualSelectionMode)return n.insertSnippetForSelection(e,t);e.forEachSelection(function(){n.insertSnippetForSelection(e,t)},null,{keepOrder:!0}),e.tabstopManager&&e.tabstopManager.tabNext()},this.$getScope=function(e){var t=e.session.$mode.$id||"";t=t.split("/").pop();if(t==="html"||t==="php"){t==="php"&&!e.session.$mode.inlinePhp&&(t="html");var n=e.getCursorPosition(),r=e.session.getState(n.row);typeof r=="object"&&(r=r[0]),r.substring&&(r.substring(0,3)=="js-"?t="javascript":r.substring(0,4)=="css-"?t="css":r.substring(0,4)=="php-"&&(t="php"))}return t},this.getActiveScopes=function(e){var t=this.$getScope(e),n=[t],r=this.snippetMap;return r[t]&&r[t].includeScopes&&n.push.apply(n,r[t].includeScopes),n.push("_"),n},this.expandWithTab=function(e,t){var n=this,r=e.forEachSelection(function(){return n.expandSnippetForSelection(e,t)},null,{keepOrder:!0});return r&&e.tabstopManager&&e.tabstopManager.tabNext(),r},this.expandSnippetForSelection=function(e,t){var n=e.getCursorPosition(),r=e.session.getLine(n.row),i=r.substring(0,n.column),s=r.substr(n.column),o=this.snippetMap,u;return this.getActiveScopes(e).some(function(e){var t=o[e];return t&&(u=this.findMatchingSnippet(t,i,s)),!!u},this),u?t&&t.dryRun?!0:(e.session.doc.removeInLine(n.row,n.column-u.replaceBefore.length,n.column+u.replaceAfter.length),this.variables.M__=u.matchBefore,this.variables.T__=u.matchAfter,this.insertSnippetForSelection(e,u.content),this.variables.M__=this.variables.T__=null,!0):!1},this.findMatchingSnippet=function(e,t,n){for(var r=e.length;r--;){var i=e[r];if(i.startRe&&!i.startRe.test(t))continue;if(i.endRe&&!i.endRe.test(n))continue;if(!i.startRe&&!i.endRe)continue;return i.matchBefore=i.startRe?i.startRe.exec(t):[""],i.matchAfter=i.endRe?i.endRe.exec(n):[""],i.replaceBefore=i.triggerRe?i.triggerRe.exec(t)[0]:"",i.replaceAfter=i.endTriggerRe?i.endTriggerRe.exec(n)[0]:"",i}},this.snippetMap={},this.snippetNameMap={},this.register=function(e,t){function o(e){return e&&!/^\^?\(.*\)\$?$|^\\b$/.test(e)&&(e="(?:"+e+")"),e||""}function u(e,t,n){return e=o(e),t=o(t),n?(e=t+e,e&&e[e.length-1]!="$"&&(e+="$")):(e+=t,e&&e[0]!="^"&&(e="^"+e)),new RegExp(e)}function a(e){e.scope||(e.scope=t||"_"),t=e.scope,n[t]||(n[t]=[],r[t]={});var o=r[t];if(e.name){var a=o[e.name];a&&i.unregister(a),o[e.name]=e}n[t].push(e),e.prefix&&(e.tabTrigger=e.prefix),!e.content&&e.body&&(e.content=Array.isArray(e.body)?e.body.join("\n"):e.body),e.tabTrigger&&!e.trigger&&(!e.guard&&/^\w/.test(e.tabTrigger)&&(e.guard="\\b"),e.trigger=s.escapeRegExp(e.tabTrigger));if(!e.trigger&&!e.guard&&!e.endTrigger&&!e.endGuard)return;e.startRe=u(e.trigger,e.guard,!0),e.triggerRe=new RegExp(e.trigger),e.endRe=u(e.endTrigger,e.endGuard,!0),e.endTriggerRe=new RegExp(e.endTrigger)}var n=this.snippetMap,r=this.snippetNameMap,i=this;e||(e=[]),Array.isArray(e)?e.forEach(a):Object.keys(e).forEach(function(t){a(e[t])}),this._signal("registerSnippets",{scope:t})},this.unregister=function(e,t){function i(e){var i=r[e.scope||t];if(i&&i[e.name]){delete i[e.name];var s=n[e.scope||t],o=s&&s.indexOf(e);o>=0&&s.splice(o,1)}}var n=this.snippetMap,r=this.snippetNameMap;e.content?i(e):Array.isArray(e)&&e.forEach(i)},this.parseSnippetFile=function(e){e=e.replace(/\r/g,"");var t=[],n={},r=/^#.*|^({[\s\S]*})\s*$|^(\S+) (.*)$|^((?:\n*\t.*)+)/gm,i;while(i=r.exec(e)){if(i[1])try{n=JSON.parse(i[1]),t.push(n)}catch(s){}if(i[4])n.content=i[4].replace(/^\t/gm,""),t.push(n),n={};else{var o=i[2],u=i[3];if(o=="regex"){var a=/\/((?:[^\/\\]|\\.)*)|$/g;n.guard=a.exec(u)[1],n.trigger=a.exec(u)[1],n.endTrigger=a.exec(u)[1],n.endGuard=a.exec(u)[1]}else o=="snippet"?(n.tabTrigger=u.match(/^\S*/)[0],n.name||(n.name=u)):o&&(n[o]=u)}}return t},this.getSnippetByName=function(e,t){var n=this.snippetNameMap,r;return this.getActiveScopes(t).some(function(t){var i=n[t];return i&&(r=i[e]),!!r},this),r}}).call(p.prototype);var d=function(e){if(e.tabstopManager)return e.tabstopManager;e.tabstopManager=this,this.$onChange=this.onChange.bind(this),this.$onChangeSelection=s.delayedCall(this.onChangeSelection.bind(this)).schedule,this.$onChangeSession=this.onChangeSession.bind(this),this.$onAfterExec=this.onAfterExec.bind(this),this.attach(e)};(function(){this.attach=function(e){this.index=0,this.ranges=[],this.tabstops=[],this.$openTabstops=null,this.selectedTabstop=null,this.editor=e,this.editor.on("change",this.$onChange),this.editor.on("changeSelection",this.$onChangeSelection),this.editor.on("changeSession",this.$onChangeSession),this.editor.commands.on("afterExec",this.$onAfterExec),this.editor.keyBinding.addKeyboardHandler(this.keyboardHandler)},this.detach=function(){this.tabstops.forEach(this.removeTabstopMarkers,this),this.ranges=null,this.tabstops=null,this.selectedTabstop=null,this.editor.removeListener("change",this.$onChange),this.editor.removeListener("changeSelection",this.$onChangeSelection),this.editor.removeListener("changeSession",this.$onChangeSession),this.editor.commands.removeListener("afterExec",this.$onAfterExec),this.editor.keyBinding.removeKeyboardHandler(this.keyboardHandler),this.editor.tabstopManager=null,this.editor=null},this.onChange=function(e){var t=e.action[0]=="r",n=this.selectedTabstop||{},r=n.parents||{},i=(this.tabstops||[]).slice();for(var s=0;s2&&(this.tabstops.length&&a.push(a.splice(2,1)[0]),this.tabstops.splice.apply(this.tabstops,a))},this.addTabstopMarkers=function(e){var t=this.editor.session;e.forEach(function(e){e.markerId||(e.markerId=t.addMarker(e,"ace_snippet-marker","text"))})},this.removeTabstopMarkers=function(e){var t=this.editor.session;e.forEach(function(e){t.removeMarker(e.markerId),e.markerId=null})},this.removeRange=function(e){var t=e.tabstop.indexOf(e);t!=-1&&e.tabstop.splice(t,1),t=this.ranges.indexOf(e),t!=-1&&this.ranges.splice(t,1),t=e.tabstop.rangeList.ranges.indexOf(e),t!=-1&&e.tabstop.splice(t,1),this.editor.session.removeMarker(e.markerId),e.tabstop.length||(t=this.tabstops.indexOf(e.tabstop),t!=-1&&this.tabstops.splice(t,1),this.tabstops.length||this.detach())},this.keyboardHandler=new a,this.keyboardHandler.bindKeys({Tab:function(e){if(t.snippetManager&&t.snippetManager.expandWithTab(e))return;e.tabstopManager.tabNext(1),e.renderer.scrollCursorIntoView()},"Shift-Tab":function(e){e.tabstopManager.tabNext(-1),e.renderer.scrollCursorIntoView()},Esc:function(e){e.tabstopManager.detach()}})}).call(d.prototype);var v=function(e,t){e.row==0&&(e.column+=t.column),e.row+=t.row},m=function(e,t){e.row==t.row&&(e.column-=t.column),e.row-=t.row};e("./lib/dom").importCssString(".ace_snippet-marker { -moz-box-sizing: border-box; box-sizing: border-box; background: rgba(194, 193, 208, 0.09); border: 1px dotted rgba(211, 208, 235, 0.62); position: absolute;}"),t.snippetManager=new p;var g=e("./editor").Editor;(function(){this.insertSnippet=function(e,n){return t.snippetManager.insertSnippet(this,e,n)},this.expandSnippet=function(e){return t.snippetManager.expandWithTab(this,e)}}).call(g.prototype)}),define("ace/ext/emmet",["require","exports","module","ace/keyboard/hash_handler","ace/editor","ace/snippets","ace/range","ace/config","resources","resources","tabStops","resources","utils","actions"],function(e,t,n){"use strict";function l(){}var r=e("../keyboard/hash_handler").HashHandler,i=e("../editor").Editor,s=e("../snippets").snippetManager,o=e("../range").Range,u=e("../config"),a,f;l.prototype={setupContext:function(e){this.ace=e,this.indentation=e.session.getTabString(),a||(a=window.emmet);var t=a.resources||a.require("resources");t.setVariable("indentation",this.indentation),this.$syntax=null,this.$syntax=this.getSyntax()},getSelectionRange:function(){var e=this.ace.getSelectionRange(),t=this.ace.session.doc;return{start:t.positionToIndex(e.start),end:t.positionToIndex(e.end)}},createSelection:function(e,t){var n=this.ace.session.doc;this.ace.selection.setRange({start:n.indexToPosition(e),end:n.indexToPosition(t)})},getCurrentLineRange:function(){var e=this.ace,t=e.getCursorPosition().row,n=e.session.getLine(t).length,r=e.session.doc.positionToIndex({row:t,column:0});return{start:r,end:r+n}},getCaretPos:function(){var e=this.ace.getCursorPosition();return this.ace.session.doc.positionToIndex(e)},setCaretPos:function(e){var t=this.ace.session.doc.indexToPosition(e);this.ace.selection.moveToPosition(t)},getCurrentLine:function(){var e=this.ace.getCursorPosition().row;return this.ace.session.getLine(e)},replaceContent:function(e,t,n,r){n==null&&(n=t==null?this.getContent().length:t),t==null&&(t=0);var i=this.ace,u=i.session.doc,a=o.fromPoints(u.indexToPosition(t),u.indexToPosition(n));i.session.remove(a),a.end=a.start,e=this.$updateTabstops(e),s.insertSnippet(i,e)},getContent:function(){return this.ace.getValue()},getSyntax:function(){if(this.$syntax)return this.$syntax;var e=this.ace.session.$modeId.split("/").pop();if(e=="html"||e=="php"){var t=this.ace.getCursorPosition(),n=this.ace.session.getState(t.row);typeof n!="string"&&(n=n[0]),n&&(n=n.split("-"),n.length>1?e=n[0]:e=="php"&&(e="html"))}return e},getProfileName:function(){var e=a.resources||a.require("resources");switch(this.getSyntax()){case"css":return"css";case"xml":case"xsl":return"xml";case"html":var t=e.getVariable("profile");return t||(t=this.ace.session.getLines(0,2).join("").search(/]+XHTML/i)!=-1?"xhtml":"html"),t;default:var n=this.ace.session.$mode;return n.emmetConfig&&n.emmetConfig.profile||"xhtml"}},prompt:function(e){return prompt(e)},getSelection:function(){return this.ace.session.getTextRange()},getFilePath:function(){return""},$updateTabstops:function(e){var t=1e3,n=0,r=null,i=a.tabStops||a.require("tabStops"),s=a.resources||a.require("resources"),o=s.getVocabulary("user"),u={tabstop:function(e){var s=parseInt(e.group,10),o=s===0;o?s=++n:s+=t;var a=e.placeholder;a&&(a=i.processText(a,u));var f="${"+s+(a?":"+a:"")+"}";return o&&(r=[e.start,f]),f},escape:function(e){return e=="$"?"\\$":e=="\\"?"\\\\":e}};e=i.processText(e,u);if(o.variables.insert_final_tabstop&&!/\$\{0\}$/.test(e))e+="${0}";else if(r){var f=a.utils?a.utils.common:a.require("utils");e=f.replaceSubstring(e,"${0}",r[0],r[1])}return e}};var c={expand_abbreviation:{mac:"ctrl+alt+e",win:"alt+e"},match_pair_outward:{mac:"ctrl+d",win:"ctrl+,"},match_pair_inward:{mac:"ctrl+j",win:"ctrl+shift+0"},matching_pair:{mac:"ctrl+alt+j",win:"alt+j"},next_edit_point:"alt+right",prev_edit_point:"alt+left",toggle_comment:{mac:"command+/",win:"ctrl+/"},split_join_tag:{mac:"shift+command+'",win:"shift+ctrl+`"},remove_tag:{mac:"command+'",win:"shift+ctrl+;"},evaluate_math_expression:{mac:"shift+command+y",win:"shift+ctrl+y"},increment_number_by_1:"ctrl+up",decrement_number_by_1:"ctrl+down",increment_number_by_01:"alt+up",decrement_number_by_01:"alt+down",increment_number_by_10:{mac:"alt+command+up",win:"shift+alt+up"},decrement_number_by_10:{mac:"alt+command+down",win:"shift+alt+down"},select_next_item:{mac:"shift+command+.",win:"shift+ctrl+."},select_previous_item:{mac:"shift+command+,",win:"shift+ctrl+,"},reflect_css_value:{mac:"shift+command+r",win:"shift+ctrl+r"},encode_decode_data_url:{mac:"shift+ctrl+d",win:"ctrl+'"},expand_abbreviation_with_tab:"Tab",wrap_with_abbreviation:{mac:"shift+ctrl+a",win:"shift+ctrl+a"}},h=new l;t.commands=new r,t.runEmmetCommand=function v(e){if(this.action=="expand_abbreviation_with_tab"){if(!e.selection.isEmpty())return!1;var n=e.selection.lead,r=e.session.getTokenAt(n.row,n.column);if(r&&/\btag\b/.test(r.type))return!1}try{h.setupContext(e);var i=a.actions||a.require("actions");if(this.action=="wrap_with_abbreviation")return setTimeout(function(){i.run("wrap_with_abbreviation",h)},0);var s=i.run(this.action,h)}catch(o){if(!a){var f=t.load(v.bind(this,e));return this.action=="expand_abbreviation_with_tab"?!1:f}e._signal("changeStatus",typeof o=="string"?o:o.message),u.warn(o),s=!1}return s};for(var p in c)t.commands.addCommand({name:"emmet:"+p,action:p,bindKey:c[p],exec:t.runEmmetCommand,multiSelectAction:"forEach"});t.updateCommands=function(e,n){n?e.keyBinding.addKeyboardHandler(t.commands):e.keyBinding.removeKeyboardHandler(t.commands)},t.isSupportedMode=function(e){if(!e)return!1;if(e.emmetConfig)return!0;var t=e.$id||e;return/css|less|scss|sass|stylus|html|php|twig|ejs|handlebars/.test(t)},t.isAvailable=function(e,n){if(/(evaluate_math_expression|expand_abbreviation)$/.test(n))return!0;var r=e.session.$mode,i=t.isSupportedMode(r);if(i&&r.$modes)try{h.setupContext(e),/js|php/.test(h.getSyntax())&&(i=!1)}catch(s){}return i};var d=function(e,n){var r=n;if(!r)return;var i=t.isSupportedMode(r.session.$mode);e.enableEmmet===!1&&(i=!1),i&&t.load(),t.updateCommands(r,i)};t.load=function(e){return typeof f!="string"?(u.warn("script for emmet-core is not loaded"),!1):(u.loadModule(f,function(){f=null,e&&e()}),!0)},t.AceEmmetEditor=l,u.defineOptions(i.prototype,"editor",{enableEmmet:{set:function(e){this[e?"on":"removeListener"]("changeMode",d),d({enableEmmet:!!e},this)},value:!0}}),t.setCore=function(e){typeof e=="string"?f=e:a=e}}); (function() { window.require(["ace/ext/emmet"], function(m) { if (typeof module == "object" && typeof exports == "object" && module) { module.exports = m; } }); })(); ================================================ FILE: pyp5js/http_local/static/js/ace/ext-error_marker.js ================================================ ; (function() { window.require(["ace/ext/error_marker"], function(m) { if (typeof module == "object" && typeof exports == "object" && module) { module.exports = m; } }); })(); ================================================ FILE: pyp5js/http_local/static/js/ace/ext-keybinding_menu.js ================================================ define("ace/ext/menu_tools/overlay_page",["require","exports","module","ace/lib/dom"],function(e,t,n){"use strict";var r=e("../../lib/dom"),i="#ace_settingsmenu, #kbshortcutmenu {background-color: #F7F7F7;color: black;box-shadow: -5px 4px 5px rgba(126, 126, 126, 0.55);padding: 1em 0.5em 2em 1em;overflow: auto;position: absolute;margin: 0;bottom: 0;right: 0;top: 0;z-index: 9991;cursor: default;}.ace_dark #ace_settingsmenu, .ace_dark #kbshortcutmenu {box-shadow: -20px 10px 25px rgba(126, 126, 126, 0.25);background-color: rgba(255, 255, 255, 0.6);color: black;}.ace_optionsMenuEntry:hover {background-color: rgba(100, 100, 100, 0.1);transition: all 0.3s}.ace_closeButton {background: rgba(245, 146, 146, 0.5);border: 1px solid #F48A8A;border-radius: 50%;padding: 7px;position: absolute;right: -8px;top: -8px;z-index: 100000;}.ace_closeButton{background: rgba(245, 146, 146, 0.9);}.ace_optionsMenuKey {color: darkslateblue;font-weight: bold;}.ace_optionsMenuCommand {color: darkcyan;font-weight: normal;}.ace_optionsMenuEntry input, .ace_optionsMenuEntry button {vertical-align: middle;}.ace_optionsMenuEntry button[ace_selected_button=true] {background: #e7e7e7;box-shadow: 1px 0px 2px 0px #adadad inset;border-color: #adadad;}.ace_optionsMenuEntry button {background: white;border: 1px solid lightgray;margin: 0px;}.ace_optionsMenuEntry button:hover{background: #f0f0f0;}";r.importCssString(i),n.exports.overlayPage=function(t,n,r){function o(e){e.keyCode===27&&u()}function u(){if(!i)return;document.removeEventListener("keydown",o),i.parentNode.removeChild(i),t&&t.focus(),i=null,r&&r()}function a(e){s=e,e&&(i.style.pointerEvents="none",n.style.pointerEvents="auto")}var i=document.createElement("div"),s=!1;return i.style.cssText="margin: 0; padding: 0; position: fixed; top:0; bottom:0; left:0; right:0;z-index: 9990; "+(t?"background-color: rgba(0, 0, 0, 0.3);":""),i.addEventListener("click",function(e){s||u()}),document.addEventListener("keydown",o),n.addEventListener("click",function(e){e.stopPropagation()}),i.appendChild(n),document.body.appendChild(i),t&&t.blur(),{close:u,setIgnoreFocusOut:a}}}),define("ace/ext/menu_tools/get_editor_keyboard_shortcuts",["require","exports","module","ace/lib/keys"],function(e,t,n){"use strict";var r=e("../../lib/keys");n.exports.getEditorKeybordShortcuts=function(e){var t=r.KEY_MODS,n=[],i={};return e.keyBinding.$handlers.forEach(function(e){var t=e.commandKeyBinding;for(var r in t){var s=r.replace(/(^|-)\w/g,function(e){return e.toUpperCase()}),o=t[r];Array.isArray(o)||(o=[o]),o.forEach(function(e){typeof e!="string"&&(e=e.name),i[e]?i[e].key+="|"+s:(i[e]={key:s,command:e},n.push(i[e]))})}}),n}}),define("ace/ext/keybinding_menu",["require","exports","module","ace/editor","ace/ext/menu_tools/overlay_page","ace/ext/menu_tools/get_editor_keyboard_shortcuts"],function(e,t,n){"use strict";function i(t){if(!document.getElementById("kbshortcutmenu")){var n=e("./menu_tools/overlay_page").overlayPage,r=e("./menu_tools/get_editor_keyboard_shortcuts").getEditorKeybordShortcuts,i=r(t),s=document.createElement("div"),o=i.reduce(function(e,t){return e+'
'+t.command+" : "+''+t.key+"
"},"");s.id="kbshortcutmenu",s.innerHTML="

Keyboard Shortcuts

"+o+"",n(t,s)}}var r=e("../editor").Editor;n.exports.init=function(e){r.prototype.showKeyboardShortcuts=function(){i(this)},e.commands.addCommands([{name:"showKeyboardShortcuts",bindKey:{win:"Ctrl-Alt-h",mac:"Command-Alt-h"},exec:function(e,t){e.showKeyboardShortcuts()}}])}}); (function() { window.require(["ace/ext/keybinding_menu"], function(m) { if (typeof module == "object" && typeof exports == "object" && module) { module.exports = m; } }); })(); ================================================ FILE: pyp5js/http_local/static/js/ace/ext-language_tools.js ================================================ define("ace/snippets",["require","exports","module","ace/lib/oop","ace/lib/event_emitter","ace/lib/lang","ace/range","ace/range_list","ace/keyboard/hash_handler","ace/tokenizer","ace/clipboard","ace/lib/dom","ace/editor"],function(e,t,n){"use strict";function h(e){var t=(new Date).toLocaleString("en-us",e);return t.length==1?"0"+t:t}var r=e("./lib/oop"),i=e("./lib/event_emitter").EventEmitter,s=e("./lib/lang"),o=e("./range").Range,u=e("./range_list").RangeList,a=e("./keyboard/hash_handler").HashHandler,f=e("./tokenizer").Tokenizer,l=e("./clipboard"),c={CURRENT_WORD:function(e){return e.session.getTextRange(e.session.getWordRange())},SELECTION:function(e,t,n){var r=e.session.getTextRange();return n?r.replace(/\n\r?([ \t]*\S)/g,"\n"+n+"$1"):r},CURRENT_LINE:function(e){return e.session.getLine(e.getCursorPosition().row)},PREV_LINE:function(e){return e.session.getLine(e.getCursorPosition().row-1)},LINE_INDEX:function(e){return e.getCursorPosition().row},LINE_NUMBER:function(e){return e.getCursorPosition().row+1},SOFT_TABS:function(e){return e.session.getUseSoftTabs()?"YES":"NO"},TAB_SIZE:function(e){return e.session.getTabSize()},CLIPBOARD:function(e){return l.getText&&l.getText()},FILENAME:function(e){return/[^/\\]*$/.exec(this.FILEPATH(e))[0]},FILENAME_BASE:function(e){return/[^/\\]*$/.exec(this.FILEPATH(e))[0].replace(/\.[^.]*$/,"")},DIRECTORY:function(e){return this.FILEPATH(e).replace(/[^/\\]*$/,"")},FILEPATH:function(e){return"/not implemented.txt"},WORKSPACE_NAME:function(){return"Unknown"},FULLNAME:function(){return"Unknown"},BLOCK_COMMENT_START:function(e){var t=e.session.$mode||{};return t.blockComment&&t.blockComment.start||""},BLOCK_COMMENT_END:function(e){var t=e.session.$mode||{};return t.blockComment&&t.blockComment.end||""},LINE_COMMENT:function(e){var t=e.session.$mode||{};return t.lineCommentStart||""},CURRENT_YEAR:h.bind(null,{year:"numeric"}),CURRENT_YEAR_SHORT:h.bind(null,{year:"2-digit"}),CURRENT_MONTH:h.bind(null,{month:"numeric"}),CURRENT_MONTH_NAME:h.bind(null,{month:"long"}),CURRENT_MONTH_NAME_SHORT:h.bind(null,{month:"short"}),CURRENT_DATE:h.bind(null,{day:"2-digit"}),CURRENT_DAY_NAME:h.bind(null,{weekday:"long"}),CURRENT_DAY_NAME_SHORT:h.bind(null,{weekday:"short"}),CURRENT_HOUR:h.bind(null,{hour:"2-digit",hour12:!1}),CURRENT_MINUTE:h.bind(null,{minute:"2-digit"}),CURRENT_SECOND:h.bind(null,{second:"2-digit"})};c.SELECTED_TEXT=c.SELECTION;var p=function(){this.snippetMap={},this.snippetNameMap={}};(function(){r.implement(this,i),this.getTokenizer=function(){return p.$tokenizer||this.createTokenizer()},this.createTokenizer=function(){function e(e){return e=e.substr(1),/^\d+$/.test(e)?[{tabstopId:parseInt(e,10)}]:[{text:e}]}function t(e){return"(?:[^\\\\"+e+"]|\\\\.)"}var n={regex:"/("+t("/")+"+)/",onMatch:function(e,t,n){var r=n[0];return r.fmtString=!0,r.guard=e.slice(1,-1),r.flag="",""},next:"formatString"};return p.$tokenizer=new f({start:[{regex:/\\./,onMatch:function(e,t,n){var r=e[1];return r=="}"&&n.length?e=r:"`$\\".indexOf(r)!=-1&&(e=r),[e]}},{regex:/}/,onMatch:function(e,t,n){return[n.length?n.shift():e]}},{regex:/\$(?:\d+|\w+)/,onMatch:e},{regex:/\$\{[\dA-Z_a-z]+/,onMatch:function(t,n,r){var i=e(t.substr(1));return r.unshift(i[0]),i},next:"snippetVar"},{regex:/\n/,token:"newline",merge:!1}],snippetVar:[{regex:"\\|"+t("\\|")+"*\\|",onMatch:function(e,t,n){var r=e.slice(1,-1).replace(/\\[,|\\]|,/g,function(e){return e.length==2?e[1]:"\0"}).split("\0");return n[0].choices=r,[r[0]]},next:"start"},n,{regex:"([^:}\\\\]|\\\\.)*:?",token:"",next:"start"}],formatString:[{regex:/:/,onMatch:function(e,t,n){return n.length&&n[0].expectElse?(n[0].expectElse=!1,n[0].ifEnd={elseEnd:n[0]},[n[0].ifEnd]):":"}},{regex:/\\./,onMatch:function(e,t,n){var r=e[1];return r=="}"&&n.length?e=r:"`$\\".indexOf(r)!=-1?e=r:r=="n"?e="\n":r=="t"?e=" ":"ulULE".indexOf(r)!=-1&&(e={changeCase:r,local:r>"a"}),[e]}},{regex:"/\\w*}",onMatch:function(e,t,n){var r=n.shift();return r&&(r.flag=e.slice(1,-1)),this.next=r&&r.tabstopId?"start":"",[r||e]},next:"start"},{regex:/\$(?:\d+|\w+)/,onMatch:function(e,t,n){return[{text:e.slice(1)}]}},{regex:/\${\w+/,onMatch:function(e,t,n){var r={text:e.slice(2)};return n.unshift(r),[r]},next:"formatStringVar"},{regex:/\n/,token:"newline",merge:!1},{regex:/}/,onMatch:function(e,t,n){var r=n.shift();return this.next=r&&r.tabstopId?"start":"",[r||e]},next:"start"}],formatStringVar:[{regex:/:\/\w+}/,onMatch:function(e,t,n){var r=n[0];return r.formatFunction=e.slice(2,-1),[n.shift()]},next:"formatString"},n,{regex:/:[\?\-+]?/,onMatch:function(e,t,n){e[1]=="+"&&(n[0].ifEnd=n[0]),e[1]=="?"&&(n[0].expectElse=!0)},next:"formatString"},{regex:"([^:}\\\\]|\\\\.)*:?",token:"",next:"formatString"}]}),p.$tokenizer},this.tokenizeTmSnippet=function(e,t){return this.getTokenizer().getLineTokens(e,t).tokens.map(function(e){return e.value||e})},this.getVariableValue=function(e,t,n){if(/^\d+$/.test(t))return(this.variables.__||{})[t]||"";if(/^[A-Z]\d+$/.test(t))return(this.variables[t[0]+"__"]||{})[t.substr(1)]||"";t=t.replace(/^TM_/,"");if(!this.variables.hasOwnProperty(t))return"";var r=this.variables[t];return typeof r=="function"&&(r=this.variables[t](e,t,n)),r==null?"":r},this.variables=c,this.tmStrFormat=function(e,t,n){if(!t.fmt)return e;var r=t.flag||"",i=t.guard;i=new RegExp(i,r.replace(/[^gim]/g,""));var s=typeof t.fmt=="string"?this.tokenizeTmSnippet(t.fmt,"formatString"):t.fmt,o=this,u=e.replace(i,function(){var e=o.variables.__;o.variables.__=[].slice.call(arguments);var t=o.resolveVariables(s,n),r="E";for(var i=0;i1?(y=t[t.length-1].length,g+=t.length-1):y+=e.length,b+=e}else e&&(e.start?e.end={row:g,column:y}:e.start={row:g,column:y})});var w=e.getSelectionRange(),E=e.session.replace(w,b),S=new d(e),x=e.inVirtualSelectionMode&&e.selection.index;S.addTabstops(u,w.start,E,x)},this.insertSnippet=function(e,t){var n=this;if(e.inVirtualSelectionMode)return n.insertSnippetForSelection(e,t);e.forEachSelection(function(){n.insertSnippetForSelection(e,t)},null,{keepOrder:!0}),e.tabstopManager&&e.tabstopManager.tabNext()},this.$getScope=function(e){var t=e.session.$mode.$id||"";t=t.split("/").pop();if(t==="html"||t==="php"){t==="php"&&!e.session.$mode.inlinePhp&&(t="html");var n=e.getCursorPosition(),r=e.session.getState(n.row);typeof r=="object"&&(r=r[0]),r.substring&&(r.substring(0,3)=="js-"?t="javascript":r.substring(0,4)=="css-"?t="css":r.substring(0,4)=="php-"&&(t="php"))}return t},this.getActiveScopes=function(e){var t=this.$getScope(e),n=[t],r=this.snippetMap;return r[t]&&r[t].includeScopes&&n.push.apply(n,r[t].includeScopes),n.push("_"),n},this.expandWithTab=function(e,t){var n=this,r=e.forEachSelection(function(){return n.expandSnippetForSelection(e,t)},null,{keepOrder:!0});return r&&e.tabstopManager&&e.tabstopManager.tabNext(),r},this.expandSnippetForSelection=function(e,t){var n=e.getCursorPosition(),r=e.session.getLine(n.row),i=r.substring(0,n.column),s=r.substr(n.column),o=this.snippetMap,u;return this.getActiveScopes(e).some(function(e){var t=o[e];return t&&(u=this.findMatchingSnippet(t,i,s)),!!u},this),u?t&&t.dryRun?!0:(e.session.doc.removeInLine(n.row,n.column-u.replaceBefore.length,n.column+u.replaceAfter.length),this.variables.M__=u.matchBefore,this.variables.T__=u.matchAfter,this.insertSnippetForSelection(e,u.content),this.variables.M__=this.variables.T__=null,!0):!1},this.findMatchingSnippet=function(e,t,n){for(var r=e.length;r--;){var i=e[r];if(i.startRe&&!i.startRe.test(t))continue;if(i.endRe&&!i.endRe.test(n))continue;if(!i.startRe&&!i.endRe)continue;return i.matchBefore=i.startRe?i.startRe.exec(t):[""],i.matchAfter=i.endRe?i.endRe.exec(n):[""],i.replaceBefore=i.triggerRe?i.triggerRe.exec(t)[0]:"",i.replaceAfter=i.endTriggerRe?i.endTriggerRe.exec(n)[0]:"",i}},this.snippetMap={},this.snippetNameMap={},this.register=function(e,t){function o(e){return e&&!/^\^?\(.*\)\$?$|^\\b$/.test(e)&&(e="(?:"+e+")"),e||""}function u(e,t,n){return e=o(e),t=o(t),n?(e=t+e,e&&e[e.length-1]!="$"&&(e+="$")):(e+=t,e&&e[0]!="^"&&(e="^"+e)),new RegExp(e)}function a(e){e.scope||(e.scope=t||"_"),t=e.scope,n[t]||(n[t]=[],r[t]={});var o=r[t];if(e.name){var a=o[e.name];a&&i.unregister(a),o[e.name]=e}n[t].push(e),e.prefix&&(e.tabTrigger=e.prefix),!e.content&&e.body&&(e.content=Array.isArray(e.body)?e.body.join("\n"):e.body),e.tabTrigger&&!e.trigger&&(!e.guard&&/^\w/.test(e.tabTrigger)&&(e.guard="\\b"),e.trigger=s.escapeRegExp(e.tabTrigger));if(!e.trigger&&!e.guard&&!e.endTrigger&&!e.endGuard)return;e.startRe=u(e.trigger,e.guard,!0),e.triggerRe=new RegExp(e.trigger),e.endRe=u(e.endTrigger,e.endGuard,!0),e.endTriggerRe=new RegExp(e.endTrigger)}var n=this.snippetMap,r=this.snippetNameMap,i=this;e||(e=[]),Array.isArray(e)?e.forEach(a):Object.keys(e).forEach(function(t){a(e[t])}),this._signal("registerSnippets",{scope:t})},this.unregister=function(e,t){function i(e){var i=r[e.scope||t];if(i&&i[e.name]){delete i[e.name];var s=n[e.scope||t],o=s&&s.indexOf(e);o>=0&&s.splice(o,1)}}var n=this.snippetMap,r=this.snippetNameMap;e.content?i(e):Array.isArray(e)&&e.forEach(i)},this.parseSnippetFile=function(e){e=e.replace(/\r/g,"");var t=[],n={},r=/^#.*|^({[\s\S]*})\s*$|^(\S+) (.*)$|^((?:\n*\t.*)+)/gm,i;while(i=r.exec(e)){if(i[1])try{n=JSON.parse(i[1]),t.push(n)}catch(s){}if(i[4])n.content=i[4].replace(/^\t/gm,""),t.push(n),n={};else{var o=i[2],u=i[3];if(o=="regex"){var a=/\/((?:[^\/\\]|\\.)*)|$/g;n.guard=a.exec(u)[1],n.trigger=a.exec(u)[1],n.endTrigger=a.exec(u)[1],n.endGuard=a.exec(u)[1]}else o=="snippet"?(n.tabTrigger=u.match(/^\S*/)[0],n.name||(n.name=u)):o&&(n[o]=u)}}return t},this.getSnippetByName=function(e,t){var n=this.snippetNameMap,r;return this.getActiveScopes(t).some(function(t){var i=n[t];return i&&(r=i[e]),!!r},this),r}}).call(p.prototype);var d=function(e){if(e.tabstopManager)return e.tabstopManager;e.tabstopManager=this,this.$onChange=this.onChange.bind(this),this.$onChangeSelection=s.delayedCall(this.onChangeSelection.bind(this)).schedule,this.$onChangeSession=this.onChangeSession.bind(this),this.$onAfterExec=this.onAfterExec.bind(this),this.attach(e)};(function(){this.attach=function(e){this.index=0,this.ranges=[],this.tabstops=[],this.$openTabstops=null,this.selectedTabstop=null,this.editor=e,this.editor.on("change",this.$onChange),this.editor.on("changeSelection",this.$onChangeSelection),this.editor.on("changeSession",this.$onChangeSession),this.editor.commands.on("afterExec",this.$onAfterExec),this.editor.keyBinding.addKeyboardHandler(this.keyboardHandler)},this.detach=function(){this.tabstops.forEach(this.removeTabstopMarkers,this),this.ranges=null,this.tabstops=null,this.selectedTabstop=null,this.editor.removeListener("change",this.$onChange),this.editor.removeListener("changeSelection",this.$onChangeSelection),this.editor.removeListener("changeSession",this.$onChangeSession),this.editor.commands.removeListener("afterExec",this.$onAfterExec),this.editor.keyBinding.removeKeyboardHandler(this.keyboardHandler),this.editor.tabstopManager=null,this.editor=null},this.onChange=function(e){var t=e.action[0]=="r",n=this.selectedTabstop||{},r=n.parents||{},i=(this.tabstops||[]).slice();for(var s=0;s2&&(this.tabstops.length&&a.push(a.splice(2,1)[0]),this.tabstops.splice.apply(this.tabstops,a))},this.addTabstopMarkers=function(e){var t=this.editor.session;e.forEach(function(e){e.markerId||(e.markerId=t.addMarker(e,"ace_snippet-marker","text"))})},this.removeTabstopMarkers=function(e){var t=this.editor.session;e.forEach(function(e){t.removeMarker(e.markerId),e.markerId=null})},this.removeRange=function(e){var t=e.tabstop.indexOf(e);t!=-1&&e.tabstop.splice(t,1),t=this.ranges.indexOf(e),t!=-1&&this.ranges.splice(t,1),t=e.tabstop.rangeList.ranges.indexOf(e),t!=-1&&e.tabstop.splice(t,1),this.editor.session.removeMarker(e.markerId),e.tabstop.length||(t=this.tabstops.indexOf(e.tabstop),t!=-1&&this.tabstops.splice(t,1),this.tabstops.length||this.detach())},this.keyboardHandler=new a,this.keyboardHandler.bindKeys({Tab:function(e){if(t.snippetManager&&t.snippetManager.expandWithTab(e))return;e.tabstopManager.tabNext(1),e.renderer.scrollCursorIntoView()},"Shift-Tab":function(e){e.tabstopManager.tabNext(-1),e.renderer.scrollCursorIntoView()},Esc:function(e){e.tabstopManager.detach()}})}).call(d.prototype);var v=function(e,t){e.row==0&&(e.column+=t.column),e.row+=t.row},m=function(e,t){e.row==t.row&&(e.column-=t.column),e.row-=t.row};e("./lib/dom").importCssString(".ace_snippet-marker { -moz-box-sizing: border-box; box-sizing: border-box; background: rgba(194, 193, 208, 0.09); border: 1px dotted rgba(211, 208, 235, 0.62); position: absolute;}"),t.snippetManager=new p;var g=e("./editor").Editor;(function(){this.insertSnippet=function(e,n){return t.snippetManager.insertSnippet(this,e,n)},this.expandSnippet=function(e){return t.snippetManager.expandWithTab(this,e)}}).call(g.prototype)}),define("ace/autocomplete/popup",["require","exports","module","ace/virtual_renderer","ace/editor","ace/range","ace/lib/event","ace/lib/lang","ace/lib/dom"],function(e,t,n){"use strict";var r=e("../virtual_renderer").VirtualRenderer,i=e("../editor").Editor,s=e("../range").Range,o=e("../lib/event"),u=e("../lib/lang"),a=e("../lib/dom"),f=function(e){var t=new r(e);t.$maxLines=4;var n=new i(t);return n.setHighlightActiveLine(!1),n.setShowPrintMargin(!1),n.renderer.setShowGutter(!1),n.renderer.setHighlightGutterLine(!1),n.$mouseHandler.$focusTimeout=0,n.$highlightTagPending=!0,n},l=function(e){var t=a.createElement("div"),n=new f(t);e&&e.appendChild(t),t.style.display="none",n.renderer.content.style.cursor="default",n.renderer.setStyle("ace_autocomplete"),n.setOption("displayIndentGuides",!1),n.setOption("dragDelay",150);var r=function(){};n.focus=r,n.$isFocused=!0,n.renderer.$cursorLayer.restartTimer=r,n.renderer.$cursorLayer.element.style.opacity=0,n.renderer.$maxLines=8,n.renderer.$keepTextAreaAtCursor=!1,n.setHighlightActiveLine(!1),n.session.highlight(""),n.session.$searchHighlight.clazz="ace_highlight-marker",n.on("mousedown",function(e){var t=e.getDocumentPosition();n.selection.moveToPosition(t),c.start.row=c.end.row=t.row,e.stop()});var i,l=new s(-1,0,-1,Infinity),c=new s(-1,0,-1,Infinity);c.id=n.session.addMarker(c,"ace_active-line","fullLine"),n.setSelectOnHover=function(e){e?l.id&&(n.session.removeMarker(l.id),l.id=null):l.id=n.session.addMarker(l,"ace_line-hover","fullLine")},n.setSelectOnHover(!1),n.on("mousemove",function(e){if(!i){i=e;return}if(i.x==e.x&&i.y==e.y)return;i=e,i.scrollTop=n.renderer.scrollTop;var t=i.getDocumentPosition().row;l.start.row!=t&&(l.id||n.setRow(t),p(t))}),n.renderer.on("beforeRender",function(){if(i&&l.start.row!=-1){i.$pos=null;var e=i.getDocumentPosition().row;l.id||n.setRow(e),p(e,!0)}}),n.renderer.on("afterRender",function(){var e=n.getRow(),t=n.renderer.$textLayer,r=t.element.childNodes[e-t.config.firstRow];r!==t.selectedNode&&t.selectedNode&&a.removeCssClass(t.selectedNode,"ace_selected"),t.selectedNode=r,r&&a.addCssClass(r,"ace_selected")});var h=function(){p(-1)},p=function(e,t){e!==l.start.row&&(l.start.row=l.end.row=e,t||n.session._emit("changeBackMarker"),n._emit("changeHoverMarker"))};n.getHoveredRow=function(){return l.start.row},o.addListener(n.container,"mouseout",h),n.on("hide",h),n.on("changeSelection",h),n.session.doc.getLength=function(){return n.data.length},n.session.doc.getLine=function(e){var t=n.data[e];return typeof t=="string"?t:t&&t.value||""};var d=n.session.bgTokenizer;return d.$tokenizeRow=function(e){function s(e,n){e&&r.push({type:(t.className||"")+(n||""),value:e})}var t=n.data[e],r=[];if(!t)return r;typeof t=="string"&&(t={value:t});var i=t.caption||t.value||t.name,o=i.toLowerCase(),u=(n.filterText||"").toLowerCase(),a=0,f=0;for(var l=0;l<=u.length;l++)if(l!=f&&(t.matchMask&1<o/2&&!r;c&&l+t+f>o?(a.$maxPixelHeight=l-2*this.$borderSize,s.style.top="",s.style.bottom=o-l+"px",n.isTopdown=!1):(l+=t,a.$maxPixelHeight=o-l-.2*t,s.style.top=l+"px",s.style.bottom="",n.isTopdown=!0),s.style.display="";var h=e.left;h+s.offsetWidth>u&&(h=u-s.offsetWidth),s.style.left=h+"px",this._signal("show"),i=null,n.isOpen=!0},n.goTo=function(e){var t=this.getRow(),n=this.session.getLength()-1;switch(e){case"up":t=t<=0?n:t-1;break;case"down":t=t>=n?-1:t+1;break;case"start":t=0;break;case"end":t=n}this.setRow(t)},n.getTextLeftOffset=function(){return this.$borderSize+this.renderer.$padding+this.$imageSize},n.$imageSize=0,n.$borderSize=1,n};a.importCssString(".ace_editor.ace_autocomplete .ace_marker-layer .ace_active-line { background-color: #CAD6FA; z-index: 1;}.ace_dark.ace_editor.ace_autocomplete .ace_marker-layer .ace_active-line { background-color: #3a674e;}.ace_editor.ace_autocomplete .ace_line-hover { border: 1px solid #abbffe; margin-top: -1px; background: rgba(233,233,253,0.4); position: absolute; z-index: 2;}.ace_dark.ace_editor.ace_autocomplete .ace_line-hover { border: 1px solid rgba(109, 150, 13, 0.8); background: rgba(58, 103, 78, 0.62);}.ace_completion-meta { opacity: 0.5; margin: 0.9em;}.ace_completion-message { color: blue;}.ace_editor.ace_autocomplete .ace_completion-highlight{ color: #2d69c7;}.ace_dark.ace_editor.ace_autocomplete .ace_completion-highlight{ color: #93ca12;}.ace_editor.ace_autocomplete { width: 300px; z-index: 200000; border: 1px lightgray solid; position: fixed; box-shadow: 2px 3px 5px rgba(0,0,0,.2); line-height: 1.4; background: #fefefe; color: #111;}.ace_dark.ace_editor.ace_autocomplete { border: 1px #484747 solid; box-shadow: 2px 3px 5px rgba(0, 0, 0, 0.51); line-height: 1.4; background: #25282c; color: #c1c1c1;}","autocompletion.css"),t.AcePopup=l,t.$singleLineEditor=f}),define("ace/autocomplete/util",["require","exports","module"],function(e,t,n){"use strict";t.parForEach=function(e,t,n){var r=0,i=e.length;i===0&&n();for(var s=0;s=0;s--){if(!n.test(e[s]))break;i.push(e[s])}return i.reverse().join("")},t.retrieveFollowingIdentifier=function(e,t,n){n=n||r;var i=[];for(var s=t;sthis.filterText&&e.lastIndexOf(this.filterText,0)===0)var t=this.filtered;else var t=this.all;this.filterText=e,t=this.filterCompletions(t,this.filterText),t=t.sort(function(e,t){return t.exactMatch-e.exactMatch||t.$score-e.$score||(e.caption||e.value).localeCompare(t.caption||t.value)});var n=null;t=t.filter(function(e){var t=e.snippet||e.caption||e.value;return t===n?!1:(n=t,!0)}),this.filtered=t},this.filterCompletions=function(e,t){var n=[],r=t.toUpperCase(),i=t.toLowerCase();e:for(var s=0,o;o=e[s];s++){var u=o.caption||o.value||o.snippet;if(!u)continue;var a=-1,f=0,l=0,c,h;if(this.exactMatch){if(t!==u.substr(0,t.length))continue e}else{var p=u.toLowerCase().indexOf(i);if(p>-1)l=p;else for(var d=0;d=0?m<0||v0&&(a===-1&&(l+=10),l+=h,f|=1<",o.escapeHTML(e.caption),"","
",o.escapeHTML(e.snippet)].join(""))}},c=[l,a,f];t.setCompleters=function(e){c.length=0,e&&c.push.apply(c,e)},t.addCompleter=function(e){c.push(e)},t.textCompleter=a,t.keyWordCompleter=f,t.snippetCompleter=l;var h={name:"expandSnippet",exec:function(e){return r.expandWithTab(e)},bindKey:"Tab"},p=function(e,t){d(t.session.$mode)},d=function(e){typeof e=="string"&&(e=s.$modes[e]);if(!e)return;r.files||(r.files={}),v(e.$id,e.snippetFileId),e.modes&&e.modes.forEach(d)},v=function(e,t){if(!t||!e||r.files[e])return;r.files[e]={},s.loadModule(t,function(t){if(!t)return;r.files[e]=t,!t.snippets&&t.snippetText&&(t.snippets=r.parseSnippetFile(t.snippetText)),r.register(t.snippets||[],t.scope),t.includeScopes&&(r.snippetMap[t.scope].includeScopes=t.includeScopes,t.includeScopes.forEach(function(e){d("ace/mode/"+e)}))})},m=function(e){var t=e.editor,n=t.completer&&t.completer.activated;if(e.command.name==="backspace")n&&!u.getCompletionPrefix(t)&&t.completer.detach();else if(e.command.name==="insertstring"){var r=u.getCompletionPrefix(t);if(r&&!n){var s=i.for(t);s.autoInsert=!1,s.showPopup(t)}}},g=e("../editor").Editor;e("../config").defineOptions(g.prototype,"editor",{enableBasicAutocompletion:{set:function(e){e?(this.completers||(this.completers=Array.isArray(e)?e:c),this.commands.addCommand(i.startCommand)):this.commands.removeCommand(i.startCommand)},value:!1},enableLiveAutocompletion:{set:function(e){e?(this.completers||(this.completers=Array.isArray(e)?e:c),this.commands.on("afterExec",m)):this.commands.removeListener("afterExec",m)},value:!1},enableSnippets:{set:function(e){e?(this.commands.addCommand(h),this.on("changeMode",p),p(null,this)):(this.commands.removeCommand(h),this.off("changeMode",p))},value:!1}})}); (function() { window.require(["ace/ext/language_tools"], function(m) { if (typeof module == "object" && typeof exports == "object" && module) { module.exports = m; } }); })(); ================================================ FILE: pyp5js/http_local/static/js/ace/ext-linking.js ================================================ define("ace/ext/linking",["require","exports","module","ace/editor","ace/config"],function(e,t,n){function i(e){var n=e.editor,r=e.getAccelKey();if(r){var n=e.editor,i=e.getDocumentPosition(),s=n.session,o=s.getTokenAt(i.row,i.column);t.previousLinkingHover&&t.previousLinkingHover!=o&&n._emit("linkHoverOut"),n._emit("linkHover",{position:i,token:o}),t.previousLinkingHover=o}else t.previousLinkingHover&&(n._emit("linkHoverOut"),t.previousLinkingHover=!1)}function s(e){var t=e.getAccelKey(),n=e.getButton();if(n==0&&t){var r=e.editor,i=e.getDocumentPosition(),s=r.session,o=s.getTokenAt(i.row,i.column);r._emit("linkClick",{position:i,token:o})}}var r=e("../editor").Editor;e("../config").defineOptions(r.prototype,"editor",{enableLinking:{set:function(e){e?(this.on("click",s),this.on("mousemove",i)):(this.off("click",s),this.off("mousemove",i))},value:!1}}),t.previousLinkingHover=!1}); (function() { window.require(["ace/ext/linking"], function(m) { if (typeof module == "object" && typeof exports == "object" && module) { module.exports = m; } }); })(); ================================================ FILE: pyp5js/http_local/static/js/ace/ext-modelist.js ================================================ define("ace/ext/modelist",["require","exports","module"],function(e,t,n){"use strict";function i(e){var t=a.text,n=e.split(/[\/\\]/).pop();for(var i=0;io/2&&!r;c&&l+t+f>o?(a.$maxPixelHeight=l-2*this.$borderSize,s.style.top="",s.style.bottom=o-l+"px",n.isTopdown=!1):(l+=t,a.$maxPixelHeight=o-l-.2*t,s.style.top=l+"px",s.style.bottom="",n.isTopdown=!0),s.style.display="";var h=e.left;h+s.offsetWidth>u&&(h=u-s.offsetWidth),s.style.left=h+"px",this._signal("show"),i=null,n.isOpen=!0},n.goTo=function(e){var t=this.getRow(),n=this.session.getLength()-1;switch(e){case"up":t=t<=0?n:t-1;break;case"down":t=t>=n?-1:t+1;break;case"start":t=0;break;case"end":t=n}this.setRow(t)},n.getTextLeftOffset=function(){return this.$borderSize+this.renderer.$padding+this.$imageSize},n.$imageSize=0,n.$borderSize=1,n};a.importCssString(".ace_editor.ace_autocomplete .ace_marker-layer .ace_active-line { background-color: #CAD6FA; z-index: 1;}.ace_dark.ace_editor.ace_autocomplete .ace_marker-layer .ace_active-line { background-color: #3a674e;}.ace_editor.ace_autocomplete .ace_line-hover { border: 1px solid #abbffe; margin-top: -1px; background: rgba(233,233,253,0.4); position: absolute; z-index: 2;}.ace_dark.ace_editor.ace_autocomplete .ace_line-hover { border: 1px solid rgba(109, 150, 13, 0.8); background: rgba(58, 103, 78, 0.62);}.ace_completion-meta { opacity: 0.5; margin: 0.9em;}.ace_completion-message { color: blue;}.ace_editor.ace_autocomplete .ace_completion-highlight{ color: #2d69c7;}.ace_dark.ace_editor.ace_autocomplete .ace_completion-highlight{ color: #93ca12;}.ace_editor.ace_autocomplete { width: 300px; z-index: 200000; border: 1px lightgray solid; position: fixed; box-shadow: 2px 3px 5px rgba(0,0,0,.2); line-height: 1.4; background: #fefefe; color: #111;}.ace_dark.ace_editor.ace_autocomplete { border: 1px #484747 solid; box-shadow: 2px 3px 5px rgba(0, 0, 0, 0.51); line-height: 1.4; background: #25282c; color: #c1c1c1;}","autocompletion.css"),t.AcePopup=l,t.$singleLineEditor=f}),define("ace/autocomplete/util",["require","exports","module"],function(e,t,n){"use strict";t.parForEach=function(e,t,n){var r=0,i=e.length;i===0&&n();for(var s=0;s=0;s--){if(!n.test(e[s]))break;i.push(e[s])}return i.reverse().join("")},t.retrieveFollowingIdentifier=function(e,t,n){n=n||r;var i=[];for(var s=t;s"a"}),[e]}},{regex:"/\\w*}",onMatch:function(e,t,n){var r=n.shift();return r&&(r.flag=e.slice(1,-1)),this.next=r&&r.tabstopId?"start":"",[r||e]},next:"start"},{regex:/\$(?:\d+|\w+)/,onMatch:function(e,t,n){return[{text:e.slice(1)}]}},{regex:/\${\w+/,onMatch:function(e,t,n){var r={text:e.slice(2)};return n.unshift(r),[r]},next:"formatStringVar"},{regex:/\n/,token:"newline",merge:!1},{regex:/}/,onMatch:function(e,t,n){var r=n.shift();return this.next=r&&r.tabstopId?"start":"",[r||e]},next:"start"}],formatStringVar:[{regex:/:\/\w+}/,onMatch:function(e,t,n){var r=n[0];return r.formatFunction=e.slice(2,-1),[n.shift()]},next:"formatString"},n,{regex:/:[\?\-+]?/,onMatch:function(e,t,n){e[1]=="+"&&(n[0].ifEnd=n[0]),e[1]=="?"&&(n[0].expectElse=!0)},next:"formatString"},{regex:"([^:}\\\\]|\\\\.)*:?",token:"",next:"formatString"}]}),p.$tokenizer},this.tokenizeTmSnippet=function(e,t){return this.getTokenizer().getLineTokens(e,t).tokens.map(function(e){return e.value||e})},this.getVariableValue=function(e,t,n){if(/^\d+$/.test(t))return(this.variables.__||{})[t]||"";if(/^[A-Z]\d+$/.test(t))return(this.variables[t[0]+"__"]||{})[t.substr(1)]||"";t=t.replace(/^TM_/,"");if(!this.variables.hasOwnProperty(t))return"";var r=this.variables[t];return typeof r=="function"&&(r=this.variables[t](e,t,n)),r==null?"":r},this.variables=c,this.tmStrFormat=function(e,t,n){if(!t.fmt)return e;var r=t.flag||"",i=t.guard;i=new RegExp(i,r.replace(/[^gim]/g,""));var s=typeof t.fmt=="string"?this.tokenizeTmSnippet(t.fmt,"formatString"):t.fmt,o=this,u=e.replace(i,function(){var e=o.variables.__;o.variables.__=[].slice.call(arguments);var t=o.resolveVariables(s,n),r="E";for(var i=0;i1?(y=t[t.length-1].length,g+=t.length-1):y+=e.length,b+=e}else e&&(e.start?e.end={row:g,column:y}:e.start={row:g,column:y})});var w=e.getSelectionRange(),E=e.session.replace(w,b),S=new d(e),x=e.inVirtualSelectionMode&&e.selection.index;S.addTabstops(u,w.start,E,x)},this.insertSnippet=function(e,t){var n=this;if(e.inVirtualSelectionMode)return n.insertSnippetForSelection(e,t);e.forEachSelection(function(){n.insertSnippetForSelection(e,t)},null,{keepOrder:!0}),e.tabstopManager&&e.tabstopManager.tabNext()},this.$getScope=function(e){var t=e.session.$mode.$id||"";t=t.split("/").pop();if(t==="html"||t==="php"){t==="php"&&!e.session.$mode.inlinePhp&&(t="html");var n=e.getCursorPosition(),r=e.session.getState(n.row);typeof r=="object"&&(r=r[0]),r.substring&&(r.substring(0,3)=="js-"?t="javascript":r.substring(0,4)=="css-"?t="css":r.substring(0,4)=="php-"&&(t="php"))}return t},this.getActiveScopes=function(e){var t=this.$getScope(e),n=[t],r=this.snippetMap;return r[t]&&r[t].includeScopes&&n.push.apply(n,r[t].includeScopes),n.push("_"),n},this.expandWithTab=function(e,t){var n=this,r=e.forEachSelection(function(){return n.expandSnippetForSelection(e,t)},null,{keepOrder:!0});return r&&e.tabstopManager&&e.tabstopManager.tabNext(),r},this.expandSnippetForSelection=function(e,t){var n=e.getCursorPosition(),r=e.session.getLine(n.row),i=r.substring(0,n.column),s=r.substr(n.column),o=this.snippetMap,u;return this.getActiveScopes(e).some(function(e){var t=o[e];return t&&(u=this.findMatchingSnippet(t,i,s)),!!u},this),u?t&&t.dryRun?!0:(e.session.doc.removeInLine(n.row,n.column-u.replaceBefore.length,n.column+u.replaceAfter.length),this.variables.M__=u.matchBefore,this.variables.T__=u.matchAfter,this.insertSnippetForSelection(e,u.content),this.variables.M__=this.variables.T__=null,!0):!1},this.findMatchingSnippet=function(e,t,n){for(var r=e.length;r--;){var i=e[r];if(i.startRe&&!i.startRe.test(t))continue;if(i.endRe&&!i.endRe.test(n))continue;if(!i.startRe&&!i.endRe)continue;return i.matchBefore=i.startRe?i.startRe.exec(t):[""],i.matchAfter=i.endRe?i.endRe.exec(n):[""],i.replaceBefore=i.triggerRe?i.triggerRe.exec(t)[0]:"",i.replaceAfter=i.endTriggerRe?i.endTriggerRe.exec(n)[0]:"",i}},this.snippetMap={},this.snippetNameMap={},this.register=function(e,t){function o(e){return e&&!/^\^?\(.*\)\$?$|^\\b$/.test(e)&&(e="(?:"+e+")"),e||""}function u(e,t,n){return e=o(e),t=o(t),n?(e=t+e,e&&e[e.length-1]!="$"&&(e+="$")):(e+=t,e&&e[0]!="^"&&(e="^"+e)),new RegExp(e)}function a(e){e.scope||(e.scope=t||"_"),t=e.scope,n[t]||(n[t]=[],r[t]={});var o=r[t];if(e.name){var a=o[e.name];a&&i.unregister(a),o[e.name]=e}n[t].push(e),e.prefix&&(e.tabTrigger=e.prefix),!e.content&&e.body&&(e.content=Array.isArray(e.body)?e.body.join("\n"):e.body),e.tabTrigger&&!e.trigger&&(!e.guard&&/^\w/.test(e.tabTrigger)&&(e.guard="\\b"),e.trigger=s.escapeRegExp(e.tabTrigger));if(!e.trigger&&!e.guard&&!e.endTrigger&&!e.endGuard)return;e.startRe=u(e.trigger,e.guard,!0),e.triggerRe=new RegExp(e.trigger),e.endRe=u(e.endTrigger,e.endGuard,!0),e.endTriggerRe=new RegExp(e.endTrigger)}var n=this.snippetMap,r=this.snippetNameMap,i=this;e||(e=[]),Array.isArray(e)?e.forEach(a):Object.keys(e).forEach(function(t){a(e[t])}),this._signal("registerSnippets",{scope:t})},this.unregister=function(e,t){function i(e){var i=r[e.scope||t];if(i&&i[e.name]){delete i[e.name];var s=n[e.scope||t],o=s&&s.indexOf(e);o>=0&&s.splice(o,1)}}var n=this.snippetMap,r=this.snippetNameMap;e.content?i(e):Array.isArray(e)&&e.forEach(i)},this.parseSnippetFile=function(e){e=e.replace(/\r/g,"");var t=[],n={},r=/^#.*|^({[\s\S]*})\s*$|^(\S+) (.*)$|^((?:\n*\t.*)+)/gm,i;while(i=r.exec(e)){if(i[1])try{n=JSON.parse(i[1]),t.push(n)}catch(s){}if(i[4])n.content=i[4].replace(/^\t/gm,""),t.push(n),n={};else{var o=i[2],u=i[3];if(o=="regex"){var a=/\/((?:[^\/\\]|\\.)*)|$/g;n.guard=a.exec(u)[1],n.trigger=a.exec(u)[1],n.endTrigger=a.exec(u)[1],n.endGuard=a.exec(u)[1]}else o=="snippet"?(n.tabTrigger=u.match(/^\S*/)[0],n.name||(n.name=u)):o&&(n[o]=u)}}return t},this.getSnippetByName=function(e,t){var n=this.snippetNameMap,r;return this.getActiveScopes(t).some(function(t){var i=n[t];return i&&(r=i[e]),!!r},this),r}}).call(p.prototype);var d=function(e){if(e.tabstopManager)return e.tabstopManager;e.tabstopManager=this,this.$onChange=this.onChange.bind(this),this.$onChangeSelection=s.delayedCall(this.onChangeSelection.bind(this)).schedule,this.$onChangeSession=this.onChangeSession.bind(this),this.$onAfterExec=this.onAfterExec.bind(this),this.attach(e)};(function(){this.attach=function(e){this.index=0,this.ranges=[],this.tabstops=[],this.$openTabstops=null,this.selectedTabstop=null,this.editor=e,this.editor.on("change",this.$onChange),this.editor.on("changeSelection",this.$onChangeSelection),this.editor.on("changeSession",this.$onChangeSession),this.editor.commands.on("afterExec",this.$onAfterExec),this.editor.keyBinding.addKeyboardHandler(this.keyboardHandler)},this.detach=function(){this.tabstops.forEach(this.removeTabstopMarkers,this),this.ranges=null,this.tabstops=null,this.selectedTabstop=null,this.editor.removeListener("change",this.$onChange),this.editor.removeListener("changeSelection",this.$onChangeSelection),this.editor.removeListener("changeSession",this.$onChangeSession),this.editor.commands.removeListener("afterExec",this.$onAfterExec),this.editor.keyBinding.removeKeyboardHandler(this.keyboardHandler),this.editor.tabstopManager=null,this.editor=null},this.onChange=function(e){var t=e.action[0]=="r",n=this.selectedTabstop||{},r=n.parents||{},i=(this.tabstops||[]).slice();for(var s=0;s2&&(this.tabstops.length&&a.push(a.splice(2,1)[0]),this.tabstops.splice.apply(this.tabstops,a))},this.addTabstopMarkers=function(e){var t=this.editor.session;e.forEach(function(e){e.markerId||(e.markerId=t.addMarker(e,"ace_snippet-marker","text"))})},this.removeTabstopMarkers=function(e){var t=this.editor.session;e.forEach(function(e){t.removeMarker(e.markerId),e.markerId=null})},this.removeRange=function(e){var t=e.tabstop.indexOf(e);t!=-1&&e.tabstop.splice(t,1),t=this.ranges.indexOf(e),t!=-1&&this.ranges.splice(t,1),t=e.tabstop.rangeList.ranges.indexOf(e),t!=-1&&e.tabstop.splice(t,1),this.editor.session.removeMarker(e.markerId),e.tabstop.length||(t=this.tabstops.indexOf(e.tabstop),t!=-1&&this.tabstops.splice(t,1),this.tabstops.length||this.detach())},this.keyboardHandler=new a,this.keyboardHandler.bindKeys({Tab:function(e){if(t.snippetManager&&t.snippetManager.expandWithTab(e))return;e.tabstopManager.tabNext(1),e.renderer.scrollCursorIntoView()},"Shift-Tab":function(e){e.tabstopManager.tabNext(-1),e.renderer.scrollCursorIntoView()},Esc:function(e){e.tabstopManager.detach()}})}).call(d.prototype);var v=function(e,t){e.row==0&&(e.column+=t.column),e.row+=t.row},m=function(e,t){e.row==t.row&&(e.column-=t.column),e.row-=t.row};e("./lib/dom").importCssString(".ace_snippet-marker { -moz-box-sizing: border-box; box-sizing: border-box; background: rgba(194, 193, 208, 0.09); border: 1px dotted rgba(211, 208, 235, 0.62); position: absolute;}"),t.snippetManager=new p;var g=e("./editor").Editor;(function(){this.insertSnippet=function(e,n){return t.snippetManager.insertSnippet(this,e,n)},this.expandSnippet=function(e){return t.snippetManager.expandWithTab(this,e)}}).call(g.prototype)}),define("ace/autocomplete",["require","exports","module","ace/keyboard/hash_handler","ace/autocomplete/popup","ace/autocomplete/util","ace/lib/lang","ace/lib/dom","ace/snippets","ace/config"],function(e,t,n){"use strict";var r=e("./keyboard/hash_handler").HashHandler,i=e("./autocomplete/popup").AcePopup,s=e("./autocomplete/util"),o=e("./lib/lang"),u=e("./lib/dom"),a=e("./snippets").snippetManager,f=e("./config"),l=function(){this.autoInsert=!1,this.autoSelect=!0,this.exactMatch=!1,this.gatherCompletionsId=0,this.keyboardHandler=new r,this.keyboardHandler.bindKeys(this.commands),this.blurListener=this.blurListener.bind(this),this.changeListener=this.changeListener.bind(this),this.mousedownListener=this.mousedownListener.bind(this),this.mousewheelListener=this.mousewheelListener.bind(this),this.changeTimer=o.delayedCall(function(){this.updateCompletions(!0)}.bind(this)),this.tooltipTimer=o.delayedCall(this.updateDocTooltip.bind(this),50)};(function(){this.$init=function(){return this.popup=new i(document.body||document.documentElement),this.popup.on("click",function(e){this.insertMatch(),e.stop()}.bind(this)),this.popup.focus=this.editor.focus.bind(this.editor),this.popup.on("show",this.tooltipTimer.bind(null,null)),this.popup.on("select",this.tooltipTimer.bind(null,null)),this.popup.on("changeHoverMarker",this.tooltipTimer.bind(null,null)),this.popup},this.getPopup=function(){return this.popup||this.$init()},this.openPopup=function(e,t,n){this.popup||this.$init(),this.popup.autoSelect=this.autoSelect,this.popup.setData(this.completions.filtered,this.completions.filterText),e.keyBinding.addKeyboardHandler(this.keyboardHandler);var r=e.renderer;this.popup.setRow(this.autoSelect?0:-1);if(!n){this.popup.setTheme(e.getTheme()),this.popup.setFontSize(e.getFontSize());var i=r.layerConfig.lineHeight,s=r.$cursorLayer.getPixelPosition(this.base,!0);s.left-=this.popup.getTextLeftOffset();var o=e.container.getBoundingClientRect();s.top+=o.top-r.layerConfig.offset,s.left+=o.left-e.renderer.scrollLeft,s.left+=r.gutterWidth,this.popup.show(s,i)}else n&&!t&&this.detach()},this.detach=function(){this.editor.keyBinding.removeKeyboardHandler(this.keyboardHandler),this.editor.off("changeSelection",this.changeListener),this.editor.off("blur",this.blurListener),this.editor.off("mousedown",this.mousedownListener),this.editor.off("mousewheel",this.mousewheelListener),this.changeTimer.cancel(),this.hideDocTooltip(),this.gatherCompletionsId+=1,this.popup&&this.popup.isOpen&&this.popup.hide(),this.base&&this.base.detach(),this.activated=!1,this.completions=this.base=null},this.changeListener=function(e){var t=this.editor.selection.lead;(t.row!=this.base.row||t.columnthis.filterText&&e.lastIndexOf(this.filterText,0)===0)var t=this.filtered;else var t=this.all;this.filterText=e,t=this.filterCompletions(t,this.filterText),t=t.sort(function(e,t){return t.exactMatch-e.exactMatch||t.$score-e.$score||(e.caption||e.value).localeCompare(t.caption||t.value)});var n=null;t=t.filter(function(e){var t=e.snippet||e.caption||e.value;return t===n?!1:(n=t,!0)}),this.filtered=t},this.filterCompletions=function(e,t){var n=[],r=t.toUpperCase(),i=t.toLowerCase();e:for(var s=0,o;o=e[s];s++){var u=o.caption||o.value||o.snippet;if(!u)continue;var a=-1,f=0,l=0,c,h;if(this.exactMatch){if(t!==u.substr(0,t.length))continue e}else{var p=u.toLowerCase().indexOf(i);if(p>-1)l=p;else for(var d=0;d=0?m<0||v0&&(a===-1&&(l+=10),l+=h,f|=1<0?e=x():e=o.getValue();var t=m?m.getData(m.getRow()):e;t&&!t.error&&(E(),n.onAccept&&n.onAccept({value:e,item:t},o))}function E(){v.close(),r&&r(),p=null}function S(){if(n.getCompletions){var e;n.getPrefix&&(e=n.getPrefix(o));var t=n.getCompletions(o);m.setData(t,e),m.resize(!0)}}function x(){var e=m.getData(m.getRow());if(e&&!e.error)return e.value||e.caption||e}if(typeof t=="object")return d(e,"",t,n);if(p){var s=p;e=s.editor,s.close();if(s.name&&s.name==n.name)return}if(n.$type)return d[n.$type](e,r);var o=a();o.session.setUndoManager(new f);var h=i.buildDom(["div",{"class":"ace_prompt_container"+(n.hasDescription?" input-box-with-description":"")}]),v=c(e,h,E);h.appendChild(o.container),e&&(e.cmdLine=o,o.setOption("fontSize",e.getOption("fontSize"))),t&&o.setValue(t,1),n.selection&&o.selection.setRange({start:o.session.doc.indexToPosition(n.selection[0]),end:o.session.doc.indexToPosition(n.selection[1])});if(n.getCompletions){var m=new u;m.renderer.setStyle("ace_autocomplete_inline"),m.container.style.display="block",m.container.style.maxWidth="600px",m.container.style.width="100%",m.container.style.marginTop="3px",m.renderer.setScrollMargin(2,2,0,0),m.autoSelect=!1,m.renderer.$maxLines=15,m.setRow(-1),m.on("click",function(e){var t=m.getData(m.getRow());t.error||(o.setValue(t.value||t.name||t),b(),e.stop())}),h.appendChild(m.container),S()}if(n.$rules){var g=new l(n.$rules);o.session.bgTokenizer.setTokenizer(g)}n.placeholder&&o.setOption("placeholder",n.placeholder);if(n.hasDescription){var y=i.buildDom(["div",{"class":"ace_prompt_text_container"}]);i.buildDom(n.prompt||"Press 'Enter' to confirm or 'Escape' to cancel",y),h.appendChild(y)}v.setIgnoreFocusOut(n.ignoreFocusOut);var w={Enter:b,"Esc|Shift-Esc":function(){n.onCancel&&n.onCancel(o.getValue(),o),E()}};m&&Object.assign(w,{Up:function(e){m.goTo("up"),x()},Down:function(e){m.goTo("down"),x()},"Ctrl-Up|Ctrl-Home":function(e){m.goTo("start"),x()},"Ctrl-Down|Ctrl-End":function(e){m.goTo("end"),x()},Tab:function(e){m.goTo("down"),x()},PageUp:function(e){m.gotoPageUp(),x()},PageDown:function(e){m.gotoPageDown(),x()}}),o.commands.bindKeys(w),o.on("input",function(){n.onInput&&n.onInput(),S()}),o.resize(!0),m&&m.resize(!0),o.focus(),p={close:E,name:n.name,editor:e}}var r=e("../range").Range,i=e("../lib/dom"),s=e("../ext/menu_tools/get_editor_keyboard_shortcuts"),o=e("../autocomplete").FilteredList,u=e("../autocomplete/popup").AcePopup,a=e("../autocomplete/popup").$singleLineEditor,f=e("../undomanager").UndoManager,l=e("../tokenizer").Tokenizer,c=e("./menu_tools/overlay_page").overlayPage,h=e("./modelist"),p;d.gotoLine=function(e,t){function n(e){return Array.isArray(e)||(e=[e]),e.map(function(e){var t=e.isBackwards?e.start:e.end,n=e.isBackwards?e.end:e.start,r=n.row,i=r+1+":"+n.column;return n.row==t.row?n.column!=t.column&&(i+=">:"+t.column):i+=">"+(t.row+1)+":"+t.column,i}).reverse().join(", ")}d(e,":"+n(e.selection.toJSON()),{name:"gotoLine",selection:[1,Number.MAX_VALUE],onAccept:function(t){var n=t.value,i=d.gotoLine._history;i||(d.gotoLine._history=i=[]),i.indexOf(n)!=-1&&i.splice(i.indexOf(n),1),i.unshift(n),i.length>20&&(i.length=20);var s=e.getCursorPosition(),o=[];n.replace(/^:/,"").split(/,/).map(function(t){function u(){var t=n[i++];if(!t)return;if(t[0]=="c"){var r=parseInt(t.slice(1))||0;return e.session.doc.indexToPosition(r)}var o=s.row,u=0;return/\d/.test(t)&&(o=parseInt(t)-1,t=n[i++]),t==":"&&(t=n[i++],/\d/.test(t)&&(u=parseInt(t)||0)),{row:o,column:u}}var n=t.split(/([<>:+-]|c?\d+)|[^c\d<>:+-]+/).filter(Boolean),i=0;s=u();var a=r.fromPoints(s,s);n[i]==">"?(i++,a.end=u()):n[i]=="<"&&(i++,a.start=u()),o.unshift(a)}),e.selection.fromJSON(o);var u=e.renderer.scrollTop;e.renderer.scrollSelectionIntoView(e.selection.anchor,e.selection.cursor,.5),e.renderer.animateScrolling(u)},history:function(){var t=e.session.getUndoManager();return d.gotoLine._history?d.gotoLine._history:[]},getCompletions:function(t){var n=t.getValue(),r=n.replace(/^:/,"").split(":"),i=Math.min(parseInt(r[0])||1,e.session.getLength())-1,s=e.session.getLine(i),o=n+" "+s;return[o].concat(this.history())},$rules:{start:[{regex:/\d+/,token:"string"},{regex:/[:,><+\-c]/,token:"keyword"}]}})},d.commands=function(e,t){function n(e){return(e||"").replace(/^./,function(e){return e.toUpperCase(e)}).replace(/[a-z][A-Z]/g,function(e){return e[0]+" "+e[1].toLowerCase(e)})}function r(t){var r=[],i={};return e.keyBinding.$handlers.forEach(function(e){var s=e.platform,o=e.byName;for(var u in o){var a;o[u].bindKey&&o[u].bindKey[s]!==null?a=o[u].bindKey.win:a="";var f=o[u],l=f.description||n(f.name);Array.isArray(f)||(f=[f]),f.forEach(function(e){typeof e!="string"&&(e=e.name);var n=t.find(function(t){return t===e});n||(i[e]?i[e].key+="|"+a:(i[e]={key:a,command:e,description:l},r.push(i[e])))})}}),r}var i=["insertstring","inserttext","setIndentation","paste"],s=r(i);s=s.map(function(e){return{value:e.description,meta:e.key,command:e.command}}),d(e,"",{name:"commands",selection:[0,Number.MAX_VALUE],maxHistoryCount:5,onAccept:function(t){if(t.item){var n=t.item.command;this.addToHistory(t.item),e.execCommand(n)}},addToHistory:function(e){var t=this.history();t.unshift(e),delete e.message;for(var n=1;n0&&t.length>this.maxHistoryCount&&t.splice(t.length-1,1),d.commands.history=t},history:function(){return d.commands.history||[]},getPrefix:function(e){var t=e.getCursorPosition(),n=e.getValue();return n.substring(0,t.column)},getCompletions:function(e){function t(e,t){var n=JSON.parse(JSON.stringify(e)),r=new o(n);return r.filterCompletions(n,t)}function n(e,t){if(!t||!t.length)return e;var n=[];t.forEach(function(e){n.push(e.command)});var r=[];return e.forEach(function(e){n.indexOf(e.command)===-1&&r.push(e)}),r}var r=this.getPrefix(e),i=t(this.history(),r),u=n(s,i);u=t(u,r),i.length&&u.length&&(i[0].message=" Recently used",u[0].message=" Other commands");var a=i.concat(u);return a.length>0?a:[{value:"No matching commands",error:1}]}})},d.modes=function(e,t){var n=h.modes;n=n.map(function(e){return{value:e.caption,mode:e.name}}),d(e,"",{name:"modes",selection:[0,Number.MAX_VALUE],onAccept:function(t){if(t.item){var n="ace/mode/"+t.item.mode;e.session.setMode(n)}},getPrefix:function(e){var t=e.getCursorPosition(),n=e.getValue();return n.substring(0,t.column)},getCompletions:function(e){function t(e,t){var n=JSON.parse(JSON.stringify(e)),r=new o(n);return r.filterCompletions(n,t)}var r=this.getPrefix(e),i=t(n,r);return i.length>0?i:[{caption:"No mode matching",value:"No mode matching",error:1}]}})},i.importCssString(".ace_prompt_container { max-width: 600px; width: 100%; margin: 20px auto; padding: 3px; background: white; border-radius: 2px; box-shadow: 0px 2px 3px 0px #555;}"),t.prompt=d}); (function() { window.require(["ace/ext/prompt"], function(m) { if (typeof module == "object" && typeof exports == "object" && module) { module.exports = m; } }); })(); ================================================ FILE: pyp5js/http_local/static/js/ace/ext-rtl.js ================================================ define("ace/ext/rtl",["require","exports","module","ace/editor","ace/config"],function(e,t,n){"use strict";function s(e,t){var n=t.getSelection().lead;t.session.$bidiHandler.isRtlLine(n.row)&&n.column===0&&(t.session.$bidiHandler.isMoveLeftOperation&&n.row>0?t.getSelection().moveCursorTo(n.row-1,t.session.getLine(n.row-1).length):t.getSelection().isEmpty()?n.column+=1:n.setPosition(n.row,n.column+1))}function o(e){e.editor.session.$bidiHandler.isMoveLeftOperation=/gotoleft|selectleft|backspace|removewordleft/.test(e.command.name)}function u(e,t){var n=t.session;n.$bidiHandler.currentRow=null;if(n.$bidiHandler.isRtlLine(e.start.row)&&e.action==="insert"&&e.lines.length>1)for(var r=e.start.row;rf)break;if(!u[0]){t.lastIndex=o+=1;if(o>=i.length)break}}}this.searchCounter.textContent=r+" of "+(n>f?f+"+":n)},this.findNext=function(){this.find(!0,!1)},this.findPrev=function(){this.find(!0,!0)},this.findAll=function(){var e=this.editor.findAll(this.searchInput.value,{regExp:this.regExpOption.checked,caseSensitive:this.caseSensitiveOption.checked,wholeWord:this.wholeWordOption.checked}),t=!e&&this.searchInput.value;r.setCssClass(this.searchBox,"ace_nomatch",t),this.editor._emit("findSearchBox",{match:!t}),this.highlight(),this.hide()},this.replace=function(){this.editor.getReadOnly()||this.editor.replace(this.replaceInput.value)},this.replaceAndFindNext=function(){this.editor.getReadOnly()||(this.editor.replace(this.replaceInput.value),this.findNext())},this.replaceAll=function(){this.editor.getReadOnly()||this.editor.replaceAll(this.replaceInput.value)},this.hide=function(){this.active=!1,this.setSearchRange(null),this.editor.off("changeSession",this.setSession),this.element.style.display="none",this.editor.keyBinding.removeKeyboardHandler(this.$closeSearchBarKb),this.editor.focus()},this.show=function(e,t){this.active=!0,this.editor.on("changeSession",this.setSession),this.element.style.display="",this.replaceOption.checked=t,e&&(this.searchInput.value=e),this.searchInput.focus(),this.searchInput.select(),this.editor.keyBinding.addKeyboardHandler(this.$closeSearchBarKb),this.$syncOptions(!0)},this.isFocused=function(){var e=document.activeElement;return e==this.searchInput||e==this.replaceInput}}).call(l.prototype),t.SearchBox=l,t.Search=function(e,t){var n=e.searchBox||new l(e);n.show(e.session.getTextRange(),t)}}); (function() { window.require(["ace/ext/searchbox"], function(m) { if (typeof module == "object" && typeof exports == "object" && module) { module.exports = m; } }); })(); ================================================ FILE: pyp5js/http_local/static/js/ace/ext-settings_menu.js ================================================ define("ace/ext/menu_tools/overlay_page",["require","exports","module","ace/lib/dom"],function(e,t,n){"use strict";var r=e("../../lib/dom"),i="#ace_settingsmenu, #kbshortcutmenu {background-color: #F7F7F7;color: black;box-shadow: -5px 4px 5px rgba(126, 126, 126, 0.55);padding: 1em 0.5em 2em 1em;overflow: auto;position: absolute;margin: 0;bottom: 0;right: 0;top: 0;z-index: 9991;cursor: default;}.ace_dark #ace_settingsmenu, .ace_dark #kbshortcutmenu {box-shadow: -20px 10px 25px rgba(126, 126, 126, 0.25);background-color: rgba(255, 255, 255, 0.6);color: black;}.ace_optionsMenuEntry:hover {background-color: rgba(100, 100, 100, 0.1);transition: all 0.3s}.ace_closeButton {background: rgba(245, 146, 146, 0.5);border: 1px solid #F48A8A;border-radius: 50%;padding: 7px;position: absolute;right: -8px;top: -8px;z-index: 100000;}.ace_closeButton{background: rgba(245, 146, 146, 0.9);}.ace_optionsMenuKey {color: darkslateblue;font-weight: bold;}.ace_optionsMenuCommand {color: darkcyan;font-weight: normal;}.ace_optionsMenuEntry input, .ace_optionsMenuEntry button {vertical-align: middle;}.ace_optionsMenuEntry button[ace_selected_button=true] {background: #e7e7e7;box-shadow: 1px 0px 2px 0px #adadad inset;border-color: #adadad;}.ace_optionsMenuEntry button {background: white;border: 1px solid lightgray;margin: 0px;}.ace_optionsMenuEntry button:hover{background: #f0f0f0;}";r.importCssString(i),n.exports.overlayPage=function(t,n,r){function o(e){e.keyCode===27&&u()}function u(){if(!i)return;document.removeEventListener("keydown",o),i.parentNode.removeChild(i),t&&t.focus(),i=null,r&&r()}function a(e){s=e,e&&(i.style.pointerEvents="none",n.style.pointerEvents="auto")}var i=document.createElement("div"),s=!1;return i.style.cssText="margin: 0; padding: 0; position: fixed; top:0; bottom:0; left:0; right:0;z-index: 9990; "+(t?"background-color: rgba(0, 0, 0, 0.3);":""),i.addEventListener("click",function(e){s||u()}),document.addEventListener("keydown",o),n.addEventListener("click",function(e){e.stopPropagation()}),i.appendChild(n),document.body.appendChild(i),t&&t.blur(),{close:u,setIgnoreFocusOut:a}}}),define("ace/ext/modelist",["require","exports","module"],function(e,t,n){"use strict";function i(e){var t=a.text,n=e.split(/[\/\\]/).pop();for(var i=0;i 0!";if(e==this.$splits)return;if(e>this.$splits){while(this.$splitse)t=this.$editors[this.$splits-1],this.$container.removeChild(t.container),this.$splits--;this.resize()},this.getSplits=function(){return this.$splits},this.getEditor=function(e){return this.$editors[e]},this.getCurrentEditor=function(){return this.$cEditor},this.focus=function(){this.$cEditor.focus()},this.blur=function(){this.$cEditor.blur()},this.setTheme=function(e){this.$editors.forEach(function(t){t.setTheme(e)})},this.setKeyboardHandler=function(e){this.$editors.forEach(function(t){t.setKeyboardHandler(e)})},this.forEach=function(e,t){this.$editors.forEach(e,t)},this.$fontSize="",this.setFontSize=function(e){this.$fontSize=e,this.forEach(function(t){t.setFontSize(e)})},this.$cloneSession=function(e){var t=new a(e.getDocument(),e.getMode()),n=e.getUndoManager();return t.setUndoManager(n),t.setTabSize(e.getTabSize()),t.setUseSoftTabs(e.getUseSoftTabs()),t.setOverwrite(e.getOverwrite()),t.setBreakpoints(e.getBreakpoints()),t.setUseWrapMode(e.getUseWrapMode()),t.setUseWorker(e.getUseWorker()),t.setWrapLimitRange(e.$wrapLimitRange.min,e.$wrapLimitRange.max),t.$foldData=e.$cloneFoldData(),t},this.setSession=function(e,t){var n;t==null?n=this.$cEditor:n=this.$editors[t];var r=this.$editors.some(function(t){return t.session===e});return r&&(e=this.$cloneSession(e)),n.setSession(e),e},this.getOrientation=function(){return this.$orientation},this.setOrientation=function(e){if(this.$orientation==e)return;this.$orientation=e,this.resize()},this.resize=function(){var e=this.$container.clientWidth,t=this.$container.clientHeight,n;if(this.$orientation==this.BESIDE){var r=e/this.$splits;for(var i=0;i")}return this.textContent&&e.push(this.textContent),this.type!="fragment"&&e.push(""),e.join("")};var l={createTextNode:function(e,t){return a(e)},createElement:function(e){return new f(e)},createFragment:function(){return new f("fragment")}},c=function(){this.config={},this.dom=l};c.prototype=i.prototype;var h=function(e,t,n){var r=e.className.match(/lang-(\w+)/),i=t.mode||r&&"ace/mode/"+r[1];if(!i)return!1;var s=t.theme||"ace/theme/textmate",o="",a=[];if(e.firstElementChild){var f=0;for(var l=0;l");return}e.push("")}var s=null,o={mode:"Mode:",wrap:"Soft Wrap:",theme:"Theme:",fontSize:"Font Size:",showGutter:"Display Gutter:",keybindings:"Keyboard",showPrintMargin:"Show Print Margin:",useSoftTabs:"Use Soft Tabs:",showInvisibles:"Show Invisibles"},u={mode:{text:"Plain",javascript:"JavaScript",xml:"XML",html:"HTML",css:"CSS",scss:"SCSS",python:"Python",php:"PHP",java:"Java",ruby:"Ruby",c_cpp:"C/C++",coffee:"CoffeeScript",json:"json",perl:"Perl",clojure:"Clojure",ocaml:"OCaml",csharp:"C#",haxe:"haXe",svg:"SVG",textile:"Textile",groovy:"Groovy",liquid:"Liquid",Scala:"Scala"},theme:{clouds:"Clouds",clouds_midnight:"Clouds Midnight",cobalt:"Cobalt",crimson_editor:"Crimson Editor",dawn:"Dawn",gob:"Green on Black",eclipse:"Eclipse",idle_fingers:"Idle Fingers",kr_theme:"Kr Theme",merbivore:"Merbivore",merbivore_soft:"Merbivore Soft",mono_industrial:"Mono Industrial",monokai:"Monokai",pastel_on_dark:"Pastel On Dark",solarized_dark:"Solarized Dark",solarized_light:"Solarized Light",textmate:"Textmate",twilight:"Twilight",vibrant_ink:"Vibrant Ink"},showGutter:s,fontSize:{"10px":"10px","11px":"11px","12px":"12px","14px":"14px","16px":"16px"},wrap:{off:"Off",40:"40",80:"80",free:"Free"},keybindings:{ace:"ace",vim:"vim",emacs:"emacs"},showPrintMargin:s,useSoftTabs:s,showInvisibles:s},a=[];a.push("");for(var l in t.defaultOptions)a.push(""),a.push("");a.push("
SettingValue
",o[l],""),f(a,l,u[l],i.getOption(l)),a.push("
"),e.innerHTML=a.join("");var c=function(e){var t=e.currentTarget;i.setOption(t.title,t.value)},h=function(e){var t=e.currentTarget;i.setOption(t.title,t.checked)},p=e.getElementsByTagName("select");for(var d=0;d0&&!(s%l)&&!(f%l)&&(r[l]=(r[l]||0)+1),n[f]=(n[f]||0)+1}s=f}while(up.score&&(p={score:v,length:u})}if(p.score&&p.score>1.4)var m=p.length;if(i>d+1){if(m==1||di+1)return{ch:" ",length:m}},t.detectIndentation=function(e){var n=e.getLines(0,1e3),r=t.$detectIndentation(n)||{};return r.ch&&e.setUseSoftTabs(r.ch==" "),r.length&&e.setTabSize(r.length),r},t.trimTrailingSpace=function(e,t){var n=e.getDocument(),r=n.getAllLines(),i=t&&t.trimEmpty?-1:0,s=[],o=-1;t&&t.keepCursorPosition&&(e.selection.rangeCount?e.selection.rangeList.ranges.forEach(function(e,t,n){var r=n[t+1];if(r&&r.cursor.row==e.cursor.row)return;s.push(e.cursor)}):s.push(e.selection.getCursor()),o=0);var u=s[o]&&s[o].row;for(var a=0,f=r.length;ai&&(c=s[o].column),o++,u=s[o]?s[o].row:-1),c>i&&n.removeInLine(a,c,l.length)}},t.convertIndentation=function(e,t,n){var i=e.getTabString()[0],s=e.getTabSize();n||(n=s),t||(t=i);var o=t==" "?t:r.stringRepeat(t,n),u=e.doc,a=u.getAllLines(),f={},l={};for(var c=0,h=a.length;c30&&this.$data.shift()},append:function(e){var t=this.$data.length-1,n=this.$data[t]||"";e&&(n+=e),n&&(this.$data[t]=n)},get:function(e){return e=e||1,this.$data.slice(this.$data.length-e,this.$data.length).reverse().join("\n")},pop:function(){return this.$data.length>1&&this.$data.pop(),this.get()},rotate:function(){return this.$data.unshift(this.$data.pop()),this.get()}}}); (function() { window.require(["ace/keyboard/emacs"], function(m) { if (typeof module == "object" && typeof exports == "object" && module) { module.exports = m; } }); })(); ================================================ FILE: pyp5js/http_local/static/js/ace/keybinding-sublime.js ================================================ define("ace/keyboard/sublime",["require","exports","module","ace/keyboard/hash_handler"],function(e,t,n){"use strict";function i(e,t,n){function f(e){return e?/\s/.test(e)?"s":e=="_"?"_":e.toUpperCase()==e&&e.toLowerCase()!=e?"W":e.toUpperCase()!=e&&e.toLowerCase()==e?"w":"o":"-"}var r=e.selection,i=r.lead.row,s=r.lead.column,o=e.session.getLine(i);if(!o[s+t]){var u=(n?"selectWord":"moveCursorShortWord")+(t==1?"Right":"Left");return e.selection[u]()}t==-1&&s--;while(o[s]){var a=f(o[s])+f(o[s+t]);s+=t;if(t==1){if(a=="WW"&&f(o[s+1])=="w")break}else{if(a=="wW"){if(f(o[s-1])=="W"){s-=1;break}continue}if(a=="Ww")break}if(/w[s_oW]|_[sWo]|o[s_wW]|s[W]|W[so]/.test(a))break}t==-1&&s++,n?e.selection.moveCursorTo(i,s):e.selection.moveTo(i,s)}var r=e("../keyboard/hash_handler").HashHandler;t.handler=new r,t.handler.addCommands([{name:"find_all_under",exec:function(e){e.selection.isEmpty()&&e.selection.selectWord(),e.findAll()},readOnly:!0},{name:"find_under",exec:function(e){e.selection.isEmpty()&&e.selection.selectWord(),e.findNext()},readOnly:!0},{name:"find_under_prev",exec:function(e){e.selection.isEmpty()&&e.selection.selectWord(),e.findPrevious()},readOnly:!0},{name:"find_under_expand",exec:function(e){e.selectMore(1,!1,!0)},scrollIntoView:"animate",readOnly:!0},{name:"find_under_expand_skip",exec:function(e){e.selectMore(1,!0,!0)},scrollIntoView:"animate",readOnly:!0},{name:"delete_to_hard_bol",exec:function(e){var t=e.selection.getCursor();e.session.remove({start:{row:t.row,column:0},end:t})},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"delete_to_hard_eol",exec:function(e){var t=e.selection.getCursor();e.session.remove({start:t,end:{row:t.row,column:Infinity}})},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"moveToWordStartLeft",exec:function(e){e.selection.moveCursorLongWordLeft(),e.clearSelection()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"moveToWordEndRight",exec:function(e){e.selection.moveCursorLongWordRight(),e.clearSelection()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"selectToWordStartLeft",exec:function(e){var t=e.selection;t.$moveSelection(t.moveCursorLongWordLeft)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"selectToWordEndRight",exec:function(e){var t=e.selection;t.$moveSelection(t.moveCursorLongWordRight)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"selectSubWordRight",exec:function(e){i(e,1,!0)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectSubWordLeft",exec:function(e){i(e,-1,!0)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"moveSubWordRight",exec:function(e){i(e,1)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"moveSubWordLeft",exec:function(e){i(e,-1)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0}]),[{bindKey:{mac:"cmd-k cmd-backspace|cmd-backspace",win:"ctrl-shift-backspace|ctrl-k ctrl-backspace"},name:"removetolinestarthard"},{bindKey:{mac:"cmd-k cmd-k|cmd-delete|ctrl-k",win:"ctrl-shift-delete|ctrl-k ctrl-k"},name:"removetolineendhard"},{bindKey:{mac:"cmd-shift-d",win:"ctrl-shift-d"},name:"duplicateSelection"},{bindKey:{mac:"cmd-l",win:"ctrl-l"},name:"expandtoline"},{bindKey:{mac:"cmd-shift-a",win:"ctrl-shift-a"},name:"expandSelection",args:{to:"tag"}},{bindKey:{mac:"cmd-shift-j",win:"ctrl-shift-j"},name:"expandSelection",args:{to:"indentation"}},{bindKey:{mac:"ctrl-shift-m",win:"ctrl-shift-m"},name:"expandSelection",args:{to:"brackets"}},{bindKey:{mac:"cmd-shift-space",win:"ctrl-shift-space"},name:"expandSelection",args:{to:"scope"}},{bindKey:{mac:"ctrl-cmd-g",win:"alt-f3"},name:"find_all_under"},{bindKey:{mac:"alt-cmd-g",win:"ctrl-f3"},name:"find_under"},{bindKey:{mac:"shift-alt-cmd-g",win:"ctrl-shift-f3"},name:"find_under_prev"},{bindKey:{mac:"cmd-g",win:"f3"},name:"findnext"},{bindKey:{mac:"shift-cmd-g",win:"shift-f3"},name:"findprevious"},{bindKey:{mac:"cmd-d",win:"ctrl-d"},name:"find_under_expand"},{bindKey:{mac:"cmd-k cmd-d",win:"ctrl-k ctrl-d"},name:"find_under_expand_skip"},{bindKey:{mac:"cmd-alt-[",win:"ctrl-shift-["},name:"toggleFoldWidget"},{bindKey:{mac:"cmd-alt-]",win:"ctrl-shift-]"},name:"unfold"},{bindKey:{mac:"cmd-k cmd-0|cmd-k cmd-j",win:"ctrl-k ctrl-0|ctrl-k ctrl-j"},name:"unfoldall"},{bindKey:{mac:"cmd-k cmd-1",win:"ctrl-k ctrl-1"},name:"foldOther",args:{level:1}},{bindKey:{win:"ctrl-left",mac:"alt-left"},name:"moveToWordStartLeft"},{bindKey:{win:"ctrl-right",mac:"alt-right"},name:"moveToWordEndRight"},{bindKey:{win:"ctrl-shift-left",mac:"alt-shift-left"},name:"selectToWordStartLeft"},{bindKey:{win:"ctrl-shift-right",mac:"alt-shift-right"},name:"selectToWordEndRight"},{bindKey:{mac:"ctrl-alt-shift-right|ctrl-shift-right",win:"alt-shift-right"},name:"selectSubWordRight"},{bindKey:{mac:"ctrl-alt-shift-left|ctrl-shift-left",win:"alt-shift-left"},name:"selectSubWordLeft"},{bindKey:{mac:"ctrl-alt-right|ctrl-right",win:"alt-right"},name:"moveSubWordRight"},{bindKey:{mac:"ctrl-alt-left|ctrl-left",win:"alt-left"},name:"moveSubWordLeft"},{bindKey:{mac:"ctrl-m",win:"ctrl-m"},name:"jumptomatching",args:{to:"brackets"}},{bindKey:{mac:"ctrl-f6",win:"ctrl-f6"},name:"goToNextError"},{bindKey:{mac:"ctrl-shift-f6",win:"ctrl-shift-f6"},name:"goToPreviousError"},{bindKey:{mac:"ctrl-o"},name:"splitline"},{bindKey:{mac:"ctrl-shift-w",win:"alt-shift-w"},name:"surrowndWithTag"},{bindKey:{mac:"cmd-alt-.",win:"alt-."},name:"close_tag"},{bindKey:{mac:"cmd-j",win:"ctrl-j"},name:"joinlines"},{bindKey:{mac:"ctrl--",win:"alt--"},name:"jumpBack"},{bindKey:{mac:"ctrl-shift--",win:"alt-shift--"},name:"jumpForward"},{bindKey:{mac:"cmd-k cmd-l",win:"ctrl-k ctrl-l"},name:"tolowercase"},{bindKey:{mac:"cmd-k cmd-u",win:"ctrl-k ctrl-u"},name:"touppercase"},{bindKey:{mac:"cmd-shift-v",win:"ctrl-shift-v"},name:"paste_and_indent"},{bindKey:{mac:"cmd-k cmd-v|cmd-alt-v",win:"ctrl-k ctrl-v"},name:"paste_from_history"},{bindKey:{mac:"cmd-shift-enter",win:"ctrl-shift-enter"},name:"addLineBefore"},{bindKey:{mac:"cmd-enter",win:"ctrl-enter"},name:"addLineAfter"},{bindKey:{mac:"ctrl-shift-k",win:"ctrl-shift-k"},name:"removeline"},{bindKey:{mac:"ctrl-alt-up",win:"ctrl-up"},name:"scrollup"},{bindKey:{mac:"ctrl-alt-down",win:"ctrl-down"},name:"scrolldown"},{bindKey:{mac:"cmd-a",win:"ctrl-a"},name:"selectall"},{bindKey:{linux:"alt-shift-down",mac:"ctrl-shift-down",win:"ctrl-alt-down"},name:"addCursorBelow"},{bindKey:{linux:"alt-shift-up",mac:"ctrl-shift-up",win:"ctrl-alt-up"},name:"addCursorAbove"},{bindKey:{mac:"cmd-k cmd-c|ctrl-l",win:"ctrl-k ctrl-c"},name:"centerselection"},{bindKey:{mac:"f5",win:"f9"},name:"sortlines"},{bindKey:{mac:"ctrl-f5",win:"ctrl-f9"},name:"sortlines",args:{caseSensitive:!0}},{bindKey:{mac:"cmd-shift-l",win:"ctrl-shift-l"},name:"splitSelectionIntoLines"},{bindKey:{mac:"ctrl-cmd-down",win:"ctrl-shift-down"},name:"movelinesdown"},{bindKey:{mac:"ctrl-cmd-up",win:"ctrl-shift-up"},name:"movelinesup"},{bindKey:{mac:"alt-down",win:"alt-down"},name:"modifyNumberDown"},{bindKey:{mac:"alt-up",win:"alt-up"},name:"modifyNumberUp"},{bindKey:{mac:"cmd-/",win:"ctrl-/"},name:"togglecomment"},{bindKey:{mac:"cmd-alt-/",win:"ctrl-shift-/"},name:"toggleBlockComment"},{bindKey:{linux:"ctrl-alt-q",mac:"ctrl-q",win:"ctrl-q"},name:"togglerecording"},{bindKey:{linux:"ctrl-alt-shift-q",mac:"ctrl-shift-q",win:"ctrl-shift-q"},name:"replaymacro"},{bindKey:{mac:"ctrl-t",win:"ctrl-t"},name:"transpose"}].forEach(function(e){var n=t.handler.commands[e.name];n&&(n.bindKey=e.bindKey),t.handler.bindKey(e.bindKey,n||e.name)})}); (function() { window.require(["ace/keyboard/sublime"], function(m) { if (typeof module == "object" && typeof exports == "object" && module) { module.exports = m; } }); })(); ================================================ FILE: pyp5js/http_local/static/js/ace/keybinding-vim.js ================================================ define("ace/keyboard/vim",["require","exports","module","ace/range","ace/lib/event_emitter","ace/lib/dom","ace/lib/oop","ace/lib/keys","ace/lib/event","ace/search","ace/lib/useragent","ace/search_highlight","ace/commands/multi_select_commands","ace/mode/text","ace/multi_select"],function(e,t,n){"use strict";function r(){function t(e){return typeof e!="object"?e+"":"line"in e?e.line+":"+e.ch:"anchor"in e?t(e.anchor)+"->"+t(e.head):Array.isArray(e)?"["+e.map(function(e){return t(e)})+"]":JSON.stringify(e)}var e="";for(var n=0;n"):!1}function _(e){var t=e.state.vim;return t.onPasteFn||(t.onPasteFn=function(){t.insertMode||(e.setCursor(Tt(e.getCursor(),0,1)),wt.enterInsertMode(e,{},t))}),t.onPasteFn}function B(e,t){var n=[];for(var r=e;r=e.firstLine()&&t<=e.lastLine()}function z(e){return/^[a-z]$/.test(e)}function W(e){return"()[]{}".indexOf(e)!=-1}function X(e){return D.test(e)}function V(e){return/^[A-Z]$/.test(e)}function $(e){return/^\s*$/.test(e)}function J(e){return".?!".indexOf(e)!=-1}function K(e,t){for(var n=0;n"){var n=t.length-11,r=e.slice(0,n),i=t.slice(0,n);return r==i&&e.length>n?"full":i.indexOf(r)==0?"partial":!1}return e==t?"full":t.indexOf(e)==0?"partial":!1}function kt(e){var t=/^.*(<[^>]+>)$/.exec(e),n=t?t[1]:e.slice(-1);if(n.length>1)switch(n){case"":n="\n";break;case"":n=" ";break;default:n=""}return n}function Lt(e,t,n){return function(){for(var r=0;r2&&(t=_t.apply(undefined,Array.prototype.slice.call(arguments,1))),Mt(e,t)?e:t}function Dt(e,t){return arguments.length>2&&(t=Dt.apply(undefined,Array.prototype.slice.call(arguments,1))),Mt(e,t)?t:e}function Pt(e,t,n){var r=Mt(e,t),i=Mt(t,n);return r&&i}function Ht(e,t){return e.getLine(t).length}function Bt(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function jt(e){return e.replace(/([.?*+$\[\]\/\\(){}|\-])/g,"\\$1")}function Ft(e,t,n){var r=Ht(e,t),i=(new Array(n-r+1)).join(" ");e.setCursor(S(t,r)),e.replaceRange(i,e.getCursor())}function It(e,t){var n=[],r=e.listSelections(),i=At(e.clipPos(t)),s=!Ot(t,i),o=e.getCursor("head"),u=Rt(r,o),a=Ot(r[u].head,r[u].anchor),f=r.length-1,l=f-u>u?f:0,c=r[l].anchor,h=Math.min(c.line,i.line),p=Math.max(c.line,i.line),d=c.ch,v=i.ch,m=r[l].head.ch-d,g=v-d;m>0&&g<=0?(d++,s||v--):m<0&&g>=0?(d--,a||v++):m<0&&g==-1&&(d--,v++);for(var y=h;y<=p;y++){var b={anchor:new S(y,d),head:new S(y,v)};n.push(b)}return e.setSelections(n),t.ch=v,c.ch=d,c}function qt(e,t,n){var r=[];for(var i=0;ia&&(i.line=a),i.ch=Ht(e,i.line)}else i.ch=0,s.ch=Ht(e,s.line);return{ranges:[{anchor:s,head:i}],primary:0}}if(n=="block"){var f=Math.min(s.line,i.line),l=Math.min(s.ch,i.ch),c=Math.max(s.line,i.line),h=Math.max(s.ch,i.ch)+1,p=c-f+1,d=i.line==f?0:p-1,v=[];for(var m=0;m0&&s&&$(s);s=i.pop())n.line--,n.ch=0;s?(n.line--,n.ch=Ht(e,n.line)):n.ch=0}}function Qt(e,t,n){t.ch=0,n.ch=0,n.line++}function Gt(e){if(!e)return 0;var t=e.search(/\S/);return t==-1?e.length:t}function Yt(e,t,n,r,i){var s=$t(e),o=e.getLine(s.line),u=s.ch,a=i?P[0]:H[0];while(!a(o.charAt(u))){u++;if(u>=o.length)return null}r?a=H[0]:(a=P[0],a(o.charAt(u))||(a=P[1]));var f=u,l=u;while(a(o.charAt(f))&&f=0)l--;l++;if(t){var c=f;while(/\s/.test(o.charAt(f))&&f0)l--;l||(l=h)}}return{start:S(s.line,l),end:S(s.line,f)}}function Zt(e,t,n){Ot(t,n)||it.jumpList.add(e,t,n)}function en(e,t){it.lastCharacterSearch.increment=e,it.lastCharacterSearch.forward=t.forward,it.lastCharacterSearch.selectedCharacter=t.selectedCharacter}function rn(e,t,n,r){var i=At(e.getCursor()),s=n?1:-1,o=n?e.lineCount():-1,u=i.ch,a=i.line,f=e.getLine(a),l={lineText:f,nextCh:f.charAt(u),lastCh:null,index:u,symb:r,reverseSymb:(n?{")":"(","}":"{"}:{"(":")","{":"}"})[r],forward:n,depth:0,curMoveThrough:!1},c=tn[r];if(!c)return i;var h=nn[c].init,p=nn[c].isComplete;h&&h(l);while(a!==o&&t){l.index+=s,l.nextCh=l.lineText.charAt(l.index);if(!l.nextCh){a+=s,l.lineText=e.getLine(a)||"";if(s>0)l.index=0;else{var d=l.lineText.length;l.index=d>0?d-1:0}l.nextCh=l.lineText.charAt(l.index)}p(l)&&(i.line=a,i.ch=l.index,t--)}return l.nextCh||l.curMoveThrough?S(a,l.index):i}function sn(e,t,n,r,i){var s=t.line,o=t.ch,u=e.getLine(s),a=n?1:-1,f=r?H:P;if(i&&u==""){s+=a,u=e.getLine(s);if(!U(e,s))return null;o=n?0:u.length}for(;;){if(i&&u=="")return{from:0,to:0,line:s};var l=a>0?u.length:-1,c=l,h=l;while(o!=l){var p=!1;for(var d=0;d0?0:u.length}}function on(e,t,n,r,i,s){var o=At(t),u=[];(r&&!i||!r&&i)&&n++;var a=!r||!i;for(var f=0;f0?1:-1;var n=e.ace.session.getFoldLine(t);n&&t+r>n.start.row&&t+r0?n.end.row:n.start.row)-t)}var s=t.line,o=e.firstLine(),u=e.lastLine(),a,f,l=s;if(r){while(o<=l&&l<=u&&n>0)p(l),h(l,r)&&n--,l+=r;return new S(l,0)}var d=e.state.vim;if(d.visualLine&&h(s,1,!0)){var v=d.sel.anchor;h(v.line,-1,!0)&&(!i||v.line!=s)&&(s+=1)}var m=c(s);for(l=s;l<=u&&n;l++)h(l,1,!0)&&(!i||c(l)!=m)&&n--;f=new S(l,0),l>u&&!m?m=!0:i=!1;for(l=s;l>o;l--)if(!i||c(l)==m||l==s)if(h(l,-1,!0))break;return a=new S(l,0),{start:a,end:f}}function hn(e,t,n,r){function i(e,t){if(t.pos+t.dir<0||t.pos+t.dir>=t.line.length){t.ln+=t.dir;if(!U(e,t.ln)){t.line=null,t.ln=null,t.pos=null;return}t.line=e.getLine(t.ln),t.pos=t.dir>0?0:t.line.length-1}else t.pos+=t.dir}function s(e,t,n,r){var s=e.getLine(t),o=s==="",u={line:s,ln:t,pos:n,dir:r},a={ln:u.ln,pos:u.pos},f=u.line==="";i(e,u);while(u.line!==null){a.ln=u.ln,a.pos=u.pos;if(u.line===""&&!f)return{ln:u.ln,pos:u.pos};if(o&&u.line!==""&&!$(u.line[u.pos]))return{ln:u.ln,pos:u.pos};J(u.line[u.pos])&&!o&&(u.pos===u.line.length-1||$(u.line[u.pos+1]))&&(o=!0),i(e,u)}var s=e.getLine(a.ln);a.pos=0;for(var l=s.length-1;l>=0;--l)if(!$(s[l])){a.pos=l;break}return a}function o(e,t,n,r){var s=e.getLine(t),o={line:s,ln:t,pos:n,dir:r},u={ln:o.ln,pos:null},a=o.line==="";i(e,o);while(o.line!==null){if(o.line===""&&!a)return u.pos!==null?u:{ln:o.ln,pos:o.pos};if(!(!J(o.line[o.pos])||u.pos===null||o.ln===u.ln&&o.pos+1===u.pos))return u;o.line!==""&&!$(o.line[o.pos])&&(a=!1,u={ln:o.ln,pos:o.pos}),i(e,o)}var s=e.getLine(u.ln);u.pos=0;for(var f=0;f0)r<0?u=o(e,u.ln,u.pos,r):u=s(e,u.ln,u.pos,r),n--;return S(u.ln,u.pos)}function pn(e,t,n,r){var i=t,s,o,u={"(":/[()]/,")":/[()]/,"[":/[[\]]/,"]":/[[\]]/,"{":/[{}]/,"}":/[{}]/,"<":/[<>]/,">":/[<>]/}[n],a={"(":"(",")":"(","[":"[","]":"[","{":"{","}":"{","<":"<",">":"<"}[n],f=e.getLine(i.line).charAt(i.ch),l=f===a?1:0;s=e.scanForBracket(S(i.line,i.ch+l),-1,undefined,{bracketRegex:u}),o=e.scanForBracket(S(i.line,i.ch+l),1,undefined,{bracketRegex:u});if(!s||!o)return{start:i,end:i};s=s.pos,o=o.pos;if(s.line==o.line&&s.ch>o.ch||s.line>o.line){var c=s;s=o,o=c}return r?o.ch+=1:s.ch+=1,{start:s,end:o}}function dn(e,t,n,r){var i=At(t),s=e.getLine(i.line),o=s.split(""),u,a,f,l,c=o.indexOf(n);i.ch-1&&!u;f--)o[f]==n&&(u=f+1);if(u&&!a)for(f=u,l=o.length;f'+t+"",{bottom:!0,duration:5e3}):alert(t)}function An(e,t){var n=''+(e||"")+'';return t&&(n+=' '+t+""),n}function Mn(e,t){var n=(t.prefix||"")+" "+(t.desc||""),r=An(t.prefix,t.desc);gn(e,r,n,t.onClose,t)}function _n(e,t){if(e instanceof RegExp&&t instanceof RegExp){var n=["global","multiline","ignoreCase","source"];for(var r=0;r=t&&e<=n:e==t}function In(e){var t=e.ace.renderer;return{top:t.getFirstFullyVisibleRow(),bottom:t.getLastFullyVisibleRow()}}function qn(e,t,n){if(n=="'"||n=="`")return it.jumpList.find(e,-1)||S(0,0);if(n==".")return Rn(e);var r=t.marks[n];return r&&r.find()}function Rn(e){var t=e.ace.session.$undoManager;if(t&&t.$lastDelta)return g(t.$lastDelta.end)}function Xn(e,t,n,r,i,s,o,u,a){function c(){e.operation(function(){while(!f)h(),p();d()})}function h(){var t=e.getRange(s.from(),s.to()),n=t.replace(o,u);s.replace(n)}function p(){while(s.findNext()&&Fn(s.from(),r,i)){if(!n&&l&&s.from().line==l.line)continue;e.scrollIntoView(s.from(),30),e.setSelection(s.from(),s.to()),l=s.from(),f=!1;return}f=!0}function d(t){t&&t(),e.focus();if(l){e.setCursor(l);var n=e.state.vim;n.exMode=!1,n.lastHPos=n.lastHSPos=l.ch}a&&a()}function m(t,n,r){v.e_stop(t);var i=v.keyName(t);switch(i){case"Y":h(),p();break;case"N":p();break;case"A":var s=a;a=undefined,e.operation(c),a=s;break;case"L":h();case"Q":case"Esc":case"Ctrl-C":case"Ctrl-[":d(r)}return f&&d(r),!0}e.state.vim.exMode=!0;var f=!1,l=s.from();p();if(f){Ln(e,"No matches for "+o.source);return}if(!t){c(),a&&a();return}Mn(e,{prefix:"replace with "+u+" (y/n/a/q/l)",onKeyDown:m})}function Vn(e){var t=e.state.vim,n=it.macroModeState,r=it.registerController.getRegister("."),i=n.isPlaying,s=n.lastInsertModeChanges;i||(e.off("change",Zn),v.off(e.getInputField(),"keydown",ir)),!i&&t.insertModeRepeat>1&&(sr(e,t,t.insertModeRepeat-1,!0),t.lastEditInputState.repeatOverride=t.insertModeRepeat),delete t.insertModeRepeat,t.insertMode=!1,e.setCursor(e.getCursor().line,e.getCursor().ch-1),e.setOption("keyMap","vim"),e.setOption("disableInput",!0),e.toggleOverwrite(!1),r.setText(s.changes.join("")),v.signal(e,"vim-mode-change",{mode:"normal"}),n.isRecording&&Gn(n)}function $n(e){b.unshift(e)}function Jn(e,t,n,r,i){var s={keys:e,type:t};s[t]=n,s[t+"Args"]=r;for(var o in i)s[o]=i[o];$n(s)}function Kn(e,t,n,r){var i=it.registerController.getRegister(r);if(r==":"){i.keyBuffer[0]&&Wn.processCommand(e,i.keyBuffer[0]),n.isPlaying=!1;return}var s=i.keyBuffer,o=0;n.isPlaying=!0,n.replaySearchQueries=i.searchQueries.slice(0);for(var u=0;u|<\w+>|./.exec(a),l=f[0],a=a.substring(f.index+l.length),v.Vim.handleKey(e,l,"macro");if(t.insertMode){var c=i.insertModeChanges[o++].changes;it.macroModeState.lastInsertModeChanges.changes=c,or(e,c,1),Vn(e)}}}n.isPlaying=!1}function Qn(e,t){if(e.isPlaying)return;var n=e.latestRegister,r=it.registerController.getRegister(n);r&&r.pushText(t)}function Gn(e){if(e.isPlaying)return;var t=e.latestRegister,n=it.registerController.getRegister(t);n&&n.pushInsertModeChanges&&n.pushInsertModeChanges(e.lastInsertModeChanges)}function Yn(e,t){if(e.isPlaying)return;var n=e.latestRegister,r=it.registerController.getRegister(n);r&&r.pushSearchQuery&&r.pushSearchQuery(t)}function Zn(e,t){var n=it.macroModeState,r=n.lastInsertModeChanges;if(!n.isPlaying)while(t){r.expectCursorActivityForChange=!0;if(r.ignoreCount>1)r.ignoreCount--;else if(t.origin=="+input"||t.origin=="paste"||t.origin===undefined){var i=e.listSelections().length;i>1&&(r.ignoreCount=i);var s=t.text.join("\n");r.maybeReset&&(r.changes=[],r.maybeReset=!1),s&&(e.state.overwrite&&!/\n/.test(s)?r.changes.push([s]):r.changes.push(s))}t=t.next}}function er(e){var t=e.state.vim;if(t.insertMode){var n=it.macroModeState;if(n.isPlaying)return;var r=n.lastInsertModeChanges;r.expectCursorActivityForChange?r.expectCursorActivityForChange=!1:r.maybeReset=!0}else e.curOp.isVimOp||nr(e,t);t.visualMode&&tr(e)}function tr(e){var t=e.state.vim,n=St(e,At(t.sel.head)),r=Tt(n,0,1);t.fakeCursor&&t.fakeCursor.clear(),t.fakeCursor=e.markText(n,r,{className:"cm-animate-fat-cursor"})}function nr(e,t,n){var r=e.getCursor("anchor"),i=e.getCursor("head");t.visualMode&&!e.somethingSelected()?Jt(e,!1):!t.visualMode&&!t.insertMode&&e.somethingSelected()&&(t.visualMode=!0,t.visualLine=!1,v.signal(e,"vim-mode-change",{mode:"visual"}));if(t.visualMode){var s=Mt(i,r)?0:-1,o=Mt(i,r)?-1:0;i=Tt(i,0,s),r=Tt(r,0,o),t.sel={anchor:r,head:i},fn(e,t,"<",_t(i,r)),fn(e,t,">",Dt(i,r))}else!t.insertMode&&!n&&(t.lastHPos=e.getCursor().ch)}function rr(e){this.keyName=e}function ir(e){function i(){return n.maybeReset&&(n.changes=[],n.maybeReset=!1),n.changes.push(new rr(r)),!0}var t=it.macroModeState,n=t.lastInsertModeChanges,r=v.keyName(e);if(!r)return;(r.indexOf("Delete")!=-1||r.indexOf("Backspace")!=-1)&&v.lookupKey(r,"vim-insert",i)}function sr(e,t,n,r){function u(){s?dt.processAction(e,t,t.lastEditActionCommand):dt.evalInput(e,t)}function a(n){if(i.lastInsertModeChanges.changes.length>0){n=t.lastEditActionCommand?n:1;var r=i.lastInsertModeChanges;or(e,r.changes,n)}}var i=it.macroModeState;i.isPlaying=!0;var s=!!t.lastEditActionCommand,o=t.inputState;t.inputState=t.lastEditInputState;if(s&&t.lastEditActionCommand.interlaceInsertRepeat)for(var f=0;f1&&t[0]=="n"&&(t=t.replace("numpad","")),t=ur[t]||t;var r="";return n.ctrlKey&&(r+="C-"),n.altKey&&(r+="A-"),(r||t.length>1)&&n.shiftKey&&(r+="S-"),r+=t,r.length>1&&(r="<"+r+">"),r}function lr(e){var t=new e.constructor;return Object.keys(e).forEach(function(n){var r=e[n];Array.isArray(r)?r=r.slice():r&&typeof r=="object"&&r.constructor!=Object&&(r=lr(r)),t[n]=r}),e.sel&&(t.sel={head:e.sel.head&&At(e.sel.head),anchor:e.sel.anchor&&At(e.sel.anchor)}),t}function cr(e,t,n){var r=!1,i=x.maybeInitVimState_(e),s=i.visualBlock||i.wasInVisualBlock,o=e.ace.inMultiSelectMode;i.wasInVisualBlock&&!o?i.wasInVisualBlock=!1:o&&i.visualBlock&&(i.wasInVisualBlock=!0);if(t==""&&!i.insertMode&&!i.visualMode&&o)e.ace.exitMultiSelectMode();else if(s||!o||e.ace.inVirtualSelectionMode)r=x.handleKey(e,t,n);else{var u=lr(i);e.operation(function(){e.ace.forEachSelection(function(){var i=e.ace.selection;e.state.vim.lastHPos=i.$desiredColumn==null?i.lead.column:i.$desiredColumn;var s=e.getCursor("head"),o=e.getCursor("anchor"),a=Mt(s,o)?0:-1,f=Mt(s,o)?-1:0;s=Tt(s,0,a),o=Tt(o,0,f),e.state.vim.sel.head=s,e.state.vim.sel.anchor=o,r=fr(e,t,n),i.$desiredColumn=e.state.vim.lastHPos==-1?null:e.state.vim.lastHPos,e.virtualSelectionMode()&&(e.state.vim=lr(u))}),e.curOp.cursorActivity&&!r&&(e.curOp.cursorActivity=!1)},!0)}return r&&!i.visualMode&&!i.insert&&i.visualMode!=e.somethingSelected()&&nr(e,i,!0),r}function pr(e,t){t.off("beforeEndOperation",pr);var n=t.state.cm.vimCmd;n&&t.execCommand(n.exec?n:n.name,n.args),t.curOp=t.prevOp}var i=e("../range").Range,s=e("../lib/event_emitter").EventEmitter,o=e("../lib/dom"),u=e("../lib/oop"),a=e("../lib/keys"),f=e("../lib/event"),l=e("../search").Search,c=e("../lib/useragent"),h=e("../search_highlight").SearchHighlight,p=e("../commands/multi_select_commands"),d=e("../mode/text").Mode.prototype.tokenRe;e("../multi_select");var v=function(e){this.ace=e,this.state={},this.marks={},this.$uid=0,this.onChange=this.onChange.bind(this),this.onSelectionChange=this.onSelectionChange.bind(this),this.onBeforeEndOperation=this.onBeforeEndOperation.bind(this),this.ace.on("change",this.onChange),this.ace.on("changeSelection",this.onSelectionChange),this.ace.on("beforeEndOperation",this.onBeforeEndOperation)};v.Pos=function(e,t){if(!(this instanceof S))return new S(e,t);this.line=e,this.ch=t},v.defineOption=function(e,t,n){},v.commands={redo:function(e){e.ace.redo()},undo:function(e){e.ace.undo()},newlineAndIndent:function(e){e.ace.insert("\n")}},v.keyMap={},v.addClass=v.rmClass=function(){},v.e_stop=v.e_preventDefault=f.stopEvent,v.keyName=function(e){var t=a[e.keyCode]||e.key||"";return t.length==1&&(t=t.toUpperCase()),t=f.getModifierString(e).replace(/(^|-)\w/g,function(e){return e.toUpperCase()})+t,t},v.keyMap["default"]=function(e){return function(t){var n=t.ace.commands.commandKeyBinding[e.toLowerCase()];return n&&t.ace.execCommand(n)!==!1}},v.lookupKey=function dr(e,t,n){t||(t="default"),typeof t=="string"&&(t=v.keyMap[t]);var r=typeof t=="function"?t(e):t[e];if(r===!1)return"nothing";if(r==="...")return"multi";if(r!=null&&n(r))return"handled";if(t.fallthrough){if(!Array.isArray(t.fallthrough))return dr(e,t.fallthrough,n);for(var i=0;i0){a.row+=s,a.column+=a.row==r.row?o:0;continue}!t&&l<=0&&(a.row=n.row,a.column=n.column,l===0&&(a.bias=1))}};var e=function(e,t,n,r){this.cm=e,this.id=t,this.row=n,this.column=r,e.marks[this.id]=this};e.prototype.clear=function(){delete this.cm.marks[this.id]},e.prototype.find=function(){return g(this)},this.setBookmark=function(t,n){var r=new e(this,this.$uid++,t.line,t.ch);if(!n||!n.insertLeft)r.$insertRight=!0;return this.marks[r.id]=r,r},this.moveH=function(e,t){if(t=="char"){var n=this.ace.selection;n.clearSelection(),n.moveCursorBy(0,e)}},this.findPosV=function(e,t,n,r){if(n=="page"){var i=this.ace.renderer,s=i.layerConfig;t*=Math.floor(s.height/s.lineHeight),n="line"}if(n=="line"){var o=this.ace.session.documentToScreenPosition(e.line,e.ch);r!=null&&(o.column=r),o.row+=t,o.row=Math.min(Math.max(0,o.row),this.ace.session.getScreenLength()-1);var u=this.ace.session.screenToDocumentPosition(o.row,o.column);return g(u)}debugger},this.charCoords=function(e,t){if(t=="div"||!t){var n=this.ace.session.documentToScreenPosition(e.line,e.ch);return{left:n.column,top:n.row}}if(t=="local"){var r=this.ace.renderer,n=this.ace.session.documentToScreenPosition(e.line,e.ch),i=r.layerConfig.lineHeight,s=r.layerConfig.characterWidth,o=i*n.row;return{left:n.column*s,top:o,bottom:o+i}}},this.coordsChar=function(e,t){var n=this.ace.renderer;if(t=="local"){var r=Math.max(0,Math.floor(e.top/n.lineHeight)),i=Math.max(0,Math.floor(e.left/n.characterWidth)),s=n.session.screenToDocumentPosition(r,i);return g(s)}if(t=="div")throw"not implemented"},this.getSearchCursor=function(e,t,n){var r=!1,i=!1;e instanceof RegExp&&!e.global&&(r=!e.ignoreCase,e=e.source,i=!0);var s=new l;t.ch==undefined&&(t.ch=Number.MAX_VALUE);var o={row:t.line,column:t.ch},u=this,a=null;return{findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(t){s.setOptions({needle:e,caseSensitive:r,wrap:!1,backwards:t,regExp:i,start:a||o});var n=s.find(u.ace.session);return n&&n.isEmpty()&&u.getLine(n.start.row).length==n.start.column&&(s.$options.start=n,n=s.find(u.ace.session)),a=n,a},from:function(){return a&&g(a.start)},to:function(){return a&&g(a.end)},replace:function(e){a&&(a.end=u.ace.session.doc.replace(a,e))}}},this.scrollTo=function(e,t){var n=this.ace.renderer,r=n.layerConfig,i=r.maxHeight;i-=(n.$size.scrollerHeight-n.lineHeight)*n.$scrollPastEnd,t!=null&&this.ace.session.setScrollTop(Math.max(0,Math.min(t,i))),e!=null&&this.ace.session.setScrollLeft(Math.max(0,Math.min(e,r.width)))},this.scrollInfo=function(){return 0},this.scrollIntoView=function(e,t){if(e){var n=this.ace.renderer,r={top:0,bottom:t};n.scrollCursorIntoView(m(e),n.lineHeight*2/n.$size.scrollerHeight,r)}},this.getLine=function(e){return this.ace.session.getLine(e)},this.getRange=function(e,t){return this.ace.session.getTextRange(new i(e.line,e.ch,t.line,t.ch))},this.replaceRange=function(e,t,n){return n||(n=t),this.ace.session.replace(new i(t.line,t.ch,n.line,n.ch),e)},this.replaceSelection=this.replaceSelections=function(e){var t=this.ace.selection;if(this.ace.inVirtualSelectionMode){this.ace.session.replace(t.getRange(),e[0]||"");return}t.inVirtualSelectionMode=!0;var n=t.rangeList.ranges;n.length||(n=[this.ace.multiSelect.getRange()]);for(var r=n.length;r--;)this.ace.session.replace(n[r],e[r]||"");t.inVirtualSelectionMode=!1},this.getSelection=function(){return this.ace.getSelectedText()},this.getSelections=function(){return this.listSelections().map(function(e){return this.getRange(e.anchor,e.head)},this)},this.getInputField=function(){return this.ace.textInput.getElement()},this.getWrapperElement=function(){return this.ace.container};var t={indentWithTabs:"useSoftTabs",indentUnit:"tabSize",tabSize:"tabSize",firstLineNumber:"firstLineNumber",readOnly:"readOnly"};this.setOption=function(e,n){this.state[e]=n;switch(e){case"indentWithTabs":e=t[e],n=!n;break;case"keyMap":this.state.$keyMap=n;return;default:e=t[e]}e&&this.ace.setOption(e,n)},this.getOption=function(e,n){var r=t[e];r&&(n=this.ace.getOption(r));switch(e){case"indentWithTabs":return e=t[e],!n;case"keyMap":return this.state.$keyMap}return r?n:this.state[e]},this.toggleOverwrite=function(e){return this.state.overwrite=e,this.ace.setOverwrite(e)},this.addOverlay=function(e){if(!this.$searchHighlight||!this.$searchHighlight.session){var t=new h(null,"ace_highlight-marker","text"),n=this.ace.session.addDynamicMarker(t);t.id=n.id,t.session=this.ace.session,t.destroy=function(e){t.session.off("change",t.updateOnChange),t.session.off("changeEditor",t.destroy),t.session.removeMarker(t.id),t.session=null},t.updateOnChange=function(e){var n=e.start.row;n==e.end.row?t.cache[n]=undefined:t.cache.splice(n,t.cache.length)},t.session.on("changeEditor",t.destroy),t.session.on("change",t.updateOnChange)}var r=new RegExp(e.query.source,"gmi");this.$searchHighlight=e.highlight=t,this.$searchHighlight.setRegexp(r),this.ace.renderer.updateBackMarkers()},this.removeOverlay=function(e){this.$searchHighlight&&this.$searchHighlight.session&&this.$searchHighlight.destroy()},this.getScrollInfo=function(){var e=this.ace.renderer,t=e.layerConfig;return{left:e.scrollLeft,top:e.scrollTop,height:t.maxHeight,width:t.width,clientHeight:t.height,clientWidth:t.width}},this.getValue=function(){return this.ace.getValue()},this.setValue=function(e){return this.ace.setValue(e,-1)},this.getTokenTypeAt=function(e){var t=this.ace.session.getTokenAt(e.line,e.ch);return t&&/comment|string/.test(t.type)?"string":""},this.findMatchingBracket=function(e){var t=this.ace.session.findMatchingBracket(m(e));return{to:t&&g(t)}},this.indentLine=function(e,t){t===!0?this.ace.session.indentRows(e,e," "):t===!1&&this.ace.session.outdentRows(new i(e,0,e,0))},this.indexFromPos=function(e){return this.ace.session.doc.positionToIndex(m(e))},this.posFromIndex=function(e){return g(this.ace.session.doc.indexToPosition(e))},this.focus=function(e){return this.ace.textInput.focus()},this.blur=function(e){return this.ace.blur()},this.defaultTextHeight=function(e){return this.ace.renderer.layerConfig.lineHeight},this.scanForBracket=function(e,t,n,r){var i=r.bracketRegex.source,s=/paren|text|operator|tag/;if(t==1)var o=this.ace.session.$findClosingBracket(i.slice(1,2),m(e),s);else var o=this.ace.session.$findOpeningBracket(i.slice(-2,-1),{row:e.line,column:e.ch+1},s);return o&&{pos:g(o)}},this.refresh=function(){return this.ace.resize(!0)},this.getMode=function(){return{name:this.getOption("mode")}},this.execCommand=function(e){e=="indentAuto"?this.ace.execCommand("autoindent"):console.log(e+" is not implemented")}}.call(v.prototype);var y=v.StringStream=function(e,t){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0};y.prototype={eol:function(){return this.pos>=this.string.length},sol:function(){return this.pos==this.lineStart},peek:function(){return this.string.charAt(this.pos)||undefined},next:function(){if(this.post},eatSpace:function(){var e=this.pos;while(/[\s\u00a0]/.test(this.string.charAt(this.pos)))++this.pos;return this.pos>e},skipToEnd:function(){this.pos=this.string.length},skipTo:function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},backUp:function(e){this.pos-=e},column:function(){throw"not implemented"},indentation:function(){throw"not implemented"},match:function(e,t,n){if(typeof e!="string"){var s=this.string.slice(this.pos).match(e);return s&&s.index>0?null:(s&&t!==!1&&(this.pos+=s[0].length),s)}var r=function(e){return n?e.toLowerCase():e},i=this.string.substr(this.pos,e.length);if(r(i)==r(e))return t!==!1&&(this.pos+=e.length),!0},current:function(){return this.string.slice(this.start,this.pos)},hideFirstChars:function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}}},v.defineExtension=function(e,t){v.prototype[e]=t},o.importCssString(".normal-mode .ace_cursor{ border: none; background-color: rgba(255,0,0,0.5);}.normal-mode .ace_hidden-cursors .ace_cursor{ background-color: transparent; border: 1px solid red; opacity: 0.7}.ace_dialog { position: absolute; left: 0; right: 0; background: inherit; z-index: 15; padding: .1em .8em; overflow: hidden; color: inherit;}.ace_dialog-top { border-bottom: 1px solid #444; top: 0;}.ace_dialog-bottom { border-top: 1px solid #444; bottom: 0;}.ace_dialog input { border: none; outline: none; background: transparent; width: 20em; color: inherit; font-family: monospace;}","vimMode"),function(){function e(e,t,n){var r=e.ace.container,i;return i=r.appendChild(document.createElement("div")),n?i.className="ace_dialog ace_dialog-bottom":i.className="ace_dialog ace_dialog-top",typeof t=="string"?i.innerHTML=t:i.appendChild(t),i}function t(e,t){e.state.currentNotificationClose&&e.state.currentNotificationClose(),e.state.currentNotificationClose=t}v.defineExtension("openDialog",function(n,r,i){function a(e){if(typeof e=="string")f.value=e;else{if(o)return;if(e&&e.type=="blur"&&document.activeElement===f)return;u.state.dialog=null,o=!0,s.parentNode.removeChild(s),u.focus(),i.onClose&&i.onClose(s)}}if(this.virtualSelectionMode())return;i||(i={}),t(this,null);var s=e(this,n,i.bottom),o=!1,u=this;this.state.dialog=s;var f=s.getElementsByTagName("input")[0],l;if(f)i.value&&(f.value=i.value,i.selectValueOnOpen!==!1&&f.select()),i.onInput&&v.on(f,"input",function(e){i.onInput(e,f.value,a)}),i.onKeyUp&&v.on(f,"keyup",function(e){i.onKeyUp(e,f.value,a)}),v.on(f,"keydown",function(e){if(i&&i.onKeyDown&&i.onKeyDown(e,f.value,a))return;e.keyCode==13&&r(f.value);if(e.keyCode==27||i.closeOnEnter!==!1&&e.keyCode==13)f.blur(),v.e_stop(e),a()}),i.closeOnBlur!==!1&&v.on(f,"blur",a),f.focus();else if(l=s.getElementsByTagName("button")[0])v.on(l,"click",function(){a(),u.focus()}),i.closeOnBlur!==!1&&v.on(l,"blur",a),l.focus();return a}),v.defineExtension("openNotification",function(n,r){function a(){if(s)return;s=!0,clearTimeout(o),i.parentNode.removeChild(i)}if(this.virtualSelectionMode())return;t(this,a);var i=e(this,n,r&&r.bottom),s=!1,o,u=r&&typeof r.duration!="undefined"?r.duration:5e3;return v.on(i,"click",function(e){v.e_preventDefault(e),a()}),u&&(o=setTimeout(a,u)),a})}();var b=[{keys:"",type:"keyToKey",toKeys:"h"},{keys:"",type:"keyToKey",toKeys:"l"},{keys:"",type:"keyToKey",toKeys:"k"},{keys:"",type:"keyToKey",toKeys:"j"},{keys:"",type:"keyToKey",toKeys:"l"},{keys:"",type:"keyToKey",toKeys:"h",context:"normal"},{keys:"",type:"keyToKey",toKeys:"x",context:"normal"},{keys:"",type:"keyToKey",toKeys:"W"},{keys:"",type:"keyToKey",toKeys:"B",context:"normal"},{keys:"",type:"keyToKey",toKeys:"w"},{keys:"",type:"keyToKey",toKeys:"b",context:"normal"},{keys:"",type:"keyToKey",toKeys:"j"},{keys:"",type:"keyToKey",toKeys:"k"},{keys:"",type:"keyToKey",toKeys:""},{keys:"",type:"keyToKey",toKeys:""},{keys:"",type:"keyToKey",toKeys:"",context:"insert"},{keys:"",type:"keyToKey",toKeys:"",context:"insert"},{keys:"",type:"keyToKey",toKeys:""},{keys:"",type:"keyToKey",toKeys:"",context:"insert"},{keys:"s",type:"keyToKey",toKeys:"cl",context:"normal"},{keys:"s",type:"keyToKey",toKeys:"c",context:"visual"},{keys:"S",type:"keyToKey",toKeys:"cc",context:"normal"},{keys:"S",type:"keyToKey",toKeys:"VdO",context:"visual"},{keys:"",type:"keyToKey",toKeys:"0"},{keys:"",type:"keyToKey",toKeys:"$"},{keys:"",type:"keyToKey",toKeys:""},{keys:"",type:"keyToKey",toKeys:""},{keys:"",type:"keyToKey",toKeys:"j^",context:"normal"},{keys:"",type:"action",action:"toggleOverwrite",context:"insert"},{keys:"H",type:"motion",motion:"moveToTopLine",motionArgs:{linewise:!0,toJumplist:!0}},{keys:"M",type:"motion",motion:"moveToMiddleLine",motionArgs:{linewise:!0,toJumplist:!0}},{keys:"L",type:"motion",motion:"moveToBottomLine",motionArgs:{linewise:!0,toJumplist:!0}},{keys:"h",type:"motion",motion:"moveByCharacters",motionArgs:{forward:!1}},{keys:"l",type:"motion",motion:"moveByCharacters",motionArgs:{forward:!0}},{keys:"j",type:"motion",motion:"moveByLines",motionArgs:{forward:!0,linewise:!0}},{keys:"k",type:"motion",motion:"moveByLines",motionArgs:{forward:!1,linewise:!0}},{keys:"gj",type:"motion",motion:"moveByDisplayLines",motionArgs:{forward:!0}},{keys:"gk",type:"motion",motion:"moveByDisplayLines",motionArgs:{forward:!1}},{keys:"w",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!1}},{keys:"W",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!1,bigWord:!0}},{keys:"e",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!0,inclusive:!0}},{keys:"E",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!0,bigWord:!0,inclusive:!0}},{keys:"b",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!1}},{keys:"B",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!1,bigWord:!0}},{keys:"ge",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!0,inclusive:!0}},{keys:"gE",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!0,bigWord:!0,inclusive:!0}},{keys:"{",type:"motion",motion:"moveByParagraph",motionArgs:{forward:!1,toJumplist:!0}},{keys:"}",type:"motion",motion:"moveByParagraph",motionArgs:{forward:!0,toJumplist:!0}},{keys:"(",type:"motion",motion:"moveBySentence",motionArgs:{forward:!1}},{keys:")",type:"motion",motion:"moveBySentence",motionArgs:{forward:!0}},{keys:"",type:"motion",motion:"moveByPage",motionArgs:{forward:!0}},{keys:"",type:"motion",motion:"moveByPage",motionArgs:{forward:!1}},{keys:"",type:"motion",motion:"moveByScroll",motionArgs:{forward:!0,explicitRepeat:!0}},{keys:"",type:"motion",motion:"moveByScroll",motionArgs:{forward:!1,explicitRepeat:!0}},{keys:"gg",type:"motion",motion:"moveToLineOrEdgeOfDocument",motionArgs:{forward:!1,explicitRepeat:!0,linewise:!0,toJumplist:!0}},{keys:"G",type:"motion",motion:"moveToLineOrEdgeOfDocument",motionArgs:{forward:!0,explicitRepeat:!0,linewise:!0,toJumplist:!0}},{keys:"0",type:"motion",motion:"moveToStartOfLine"},{keys:"^",type:"motion",motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:"+",type:"motion",motion:"moveByLines",motionArgs:{forward:!0,toFirstChar:!0}},{keys:"-",type:"motion",motion:"moveByLines",motionArgs:{forward:!1,toFirstChar:!0}},{keys:"_",type:"motion",motion:"moveByLines",motionArgs:{forward:!0,toFirstChar:!0,repeatOffset:-1}},{keys:"$",type:"motion",motion:"moveToEol",motionArgs:{inclusive:!0}},{keys:"%",type:"motion",motion:"moveToMatchedSymbol",motionArgs:{inclusive:!0,toJumplist:!0}},{keys:"f",type:"motion",motion:"moveToCharacter",motionArgs:{forward:!0,inclusive:!0}},{keys:"F",type:"motion",motion:"moveToCharacter",motionArgs:{forward:!1}},{keys:"t",type:"motion",motion:"moveTillCharacter",motionArgs:{forward:!0,inclusive:!0}},{keys:"T",type:"motion",motion:"moveTillCharacter",motionArgs:{forward:!1}},{keys:";",type:"motion",motion:"repeatLastCharacterSearch",motionArgs:{forward:!0}},{keys:",",type:"motion",motion:"repeatLastCharacterSearch",motionArgs:{forward:!1}},{keys:"'",type:"motion",motion:"goToMark",motionArgs:{toJumplist:!0,linewise:!0}},{keys:"`",type:"motion",motion:"goToMark",motionArgs:{toJumplist:!0}},{keys:"]`",type:"motion",motion:"jumpToMark",motionArgs:{forward:!0}},{keys:"[`",type:"motion",motion:"jumpToMark",motionArgs:{forward:!1}},{keys:"]'",type:"motion",motion:"jumpToMark",motionArgs:{forward:!0,linewise:!0}},{keys:"['",type:"motion",motion:"jumpToMark",motionArgs:{forward:!1,linewise:!0}},{keys:"]p",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!0,isEdit:!0,matchIndent:!0}},{keys:"[p",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!1,isEdit:!0,matchIndent:!0}},{keys:"]",type:"motion",motion:"moveToSymbol",motionArgs:{forward:!0,toJumplist:!0}},{keys:"[",type:"motion",motion:"moveToSymbol",motionArgs:{forward:!1,toJumplist:!0}},{keys:"|",type:"motion",motion:"moveToColumn"},{keys:"o",type:"motion",motion:"moveToOtherHighlightedEnd",context:"visual"},{keys:"O",type:"motion",motion:"moveToOtherHighlightedEnd",motionArgs:{sameLine:!0},context:"visual"},{keys:"d",type:"operator",operator:"delete"},{keys:"y",type:"operator",operator:"yank"},{keys:"c",type:"operator",operator:"change"},{keys:"=",type:"operator",operator:"indentAuto"},{keys:">",type:"operator",operator:"indent",operatorArgs:{indentRight:!0}},{keys:"<",type:"operator",operator:"indent",operatorArgs:{indentRight:!1}},{keys:"g~",type:"operator",operator:"changeCase"},{keys:"gu",type:"operator",operator:"changeCase",operatorArgs:{toLower:!0},isEdit:!0},{keys:"gU",type:"operator",operator:"changeCase",operatorArgs:{toLower:!1},isEdit:!0},{keys:"n",type:"motion",motion:"findNext",motionArgs:{forward:!0,toJumplist:!0}},{keys:"N",type:"motion",motion:"findNext",motionArgs:{forward:!1,toJumplist:!0}},{keys:"x",type:"operatorMotion",operator:"delete",motion:"moveByCharacters",motionArgs:{forward:!0},operatorMotionArgs:{visualLine:!1}},{keys:"X",type:"operatorMotion",operator:"delete",motion:"moveByCharacters",motionArgs:{forward:!1},operatorMotionArgs:{visualLine:!0}},{keys:"D",type:"operatorMotion",operator:"delete",motion:"moveToEol",motionArgs:{inclusive:!0},context:"normal"},{keys:"D",type:"operator",operator:"delete",operatorArgs:{linewise:!0},context:"visual"},{keys:"Y",type:"operatorMotion",operator:"yank",motion:"expandToLine",motionArgs:{linewise:!0},context:"normal"},{keys:"Y",type:"operator",operator:"yank",operatorArgs:{linewise:!0},context:"visual"},{keys:"C",type:"operatorMotion",operator:"change",motion:"moveToEol",motionArgs:{inclusive:!0},context:"normal"},{keys:"C",type:"operator",operator:"change",operatorArgs:{linewise:!0},context:"visual"},{keys:"~",type:"operatorMotion",operator:"changeCase",motion:"moveByCharacters",motionArgs:{forward:!0},operatorArgs:{shouldMoveCursor:!0},context:"normal"},{keys:"~",type:"operator",operator:"changeCase",context:"visual"},{keys:"",type:"operatorMotion",operator:"delete",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!1},context:"insert"},{keys:"",type:"idle",context:"normal"},{keys:"",type:"action",action:"jumpListWalk",actionArgs:{forward:!0}},{keys:"",type:"action",action:"jumpListWalk",actionArgs:{forward:!1}},{keys:"",type:"action",action:"scroll",actionArgs:{forward:!0,linewise:!0}},{keys:"",type:"action",action:"scroll",actionArgs:{forward:!1,linewise:!0}},{keys:"a",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"charAfter"},context:"normal"},{keys:"A",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"eol"},context:"normal"},{keys:"A",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"endOfSelectedArea"},context:"visual"},{keys:"i",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"inplace"},context:"normal"},{keys:"gi",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"lastEdit"},context:"normal"},{keys:"I",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"firstNonBlank"},context:"normal"},{keys:"gI",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"bol"},context:"normal"},{keys:"I",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"startOfSelectedArea"},context:"visual"},{keys:"o",type:"action",action:"newLineAndEnterInsertMode",isEdit:!0,interlaceInsertRepeat:!0,actionArgs:{after:!0},context:"normal"},{keys:"O",type:"action",action:"newLineAndEnterInsertMode",isEdit:!0,interlaceInsertRepeat:!0,actionArgs:{after:!1},context:"normal"},{keys:"v",type:"action",action:"toggleVisualMode"},{keys:"V",type:"action",action:"toggleVisualMode",actionArgs:{linewise:!0}},{keys:"",type:"action",action:"toggleVisualMode",actionArgs:{blockwise:!0}},{keys:"",type:"action",action:"toggleVisualMode",actionArgs:{blockwise:!0}},{keys:"gv",type:"action",action:"reselectLastSelection"},{keys:"J",type:"action",action:"joinLines",isEdit:!0},{keys:"gJ",type:"action",action:"joinLines",actionArgs:{keepSpaces:!0},isEdit:!0},{keys:"p",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!0,isEdit:!0}},{keys:"P",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!1,isEdit:!0}},{keys:"r",type:"action",action:"replace",isEdit:!0},{keys:"@",type:"action",action:"replayMacro"},{keys:"q",type:"action",action:"enterMacroRecordMode"},{keys:"R",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{replace:!0},context:"normal"},{keys:"R",type:"operator",operator:"change",operatorArgs:{linewise:!0,fullLine:!0},context:"visual",exitVisualBlock:!0},{keys:"u",type:"action",action:"undo",context:"normal"},{keys:"u",type:"operator",operator:"changeCase",operatorArgs:{toLower:!0},context:"visual",isEdit:!0},{keys:"U",type:"operator",operator:"changeCase",operatorArgs:{toLower:!1},context:"visual",isEdit:!0},{keys:"",type:"action",action:"redo"},{keys:"m",type:"action",action:"setMark"},{keys:'"',type:"action",action:"setRegister"},{keys:"zz",type:"action",action:"scrollToCursor",actionArgs:{position:"center"}},{keys:"z.",type:"action",action:"scrollToCursor",actionArgs:{position:"center"},motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:"zt",type:"action",action:"scrollToCursor",actionArgs:{position:"top"}},{keys:"z",type:"action",action:"scrollToCursor",actionArgs:{position:"top"},motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:"z-",type:"action",action:"scrollToCursor",actionArgs:{position:"bottom"}},{keys:"zb",type:"action",action:"scrollToCursor",actionArgs:{position:"bottom"},motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:".",type:"action",action:"repeatLastEdit"},{keys:"",type:"action",action:"incrementNumberToken",isEdit:!0,actionArgs:{increase:!0,backtrack:!1}},{keys:"",type:"action",action:"incrementNumberToken",isEdit:!0,actionArgs:{increase:!1,backtrack:!1}},{keys:"",type:"action",action:"indent",actionArgs:{indentRight:!0},context:"insert"},{keys:"",type:"action",action:"indent",actionArgs:{indentRight:!1},context:"insert"},{keys:"a",type:"motion",motion:"textObjectManipulation"},{keys:"i",type:"motion",motion:"textObjectManipulation",motionArgs:{textObjectInner:!0}},{keys:"/",type:"search",searchArgs:{forward:!0,querySrc:"prompt",toJumplist:!0}},{keys:"?",type:"search",searchArgs:{forward:!1,querySrc:"prompt",toJumplist:!0}},{keys:"*",type:"search",searchArgs:{forward:!0,querySrc:"wordUnderCursor",wholeWordOnly:!0,toJumplist:!0}},{keys:"#",type:"search",searchArgs:{forward:!1,querySrc:"wordUnderCursor",wholeWordOnly:!0,toJumplist:!0}},{keys:"g*",type:"search",searchArgs:{forward:!0,querySrc:"wordUnderCursor",toJumplist:!0}},{keys:"g#",type:"search",searchArgs:{forward:!1,querySrc:"wordUnderCursor",toJumplist:!0}},{keys:":",type:"ex"}],w=b.length,E=[{name:"colorscheme",shortName:"colo"},{name:"map"},{name:"imap",shortName:"im"},{name:"nmap",shortName:"nm"},{name:"vmap",shortName:"vm"},{name:"unmap"},{name:"write",shortName:"w"},{name:"undo",shortName:"u"},{name:"redo",shortName:"red"},{name:"set",shortName:"se"},{name:"set",shortName:"se"},{name:"setlocal",shortName:"setl"},{name:"setglobal",shortName:"setg"},{name:"sort",shortName:"sor"},{name:"substitute",shortName:"s",possiblyAsync:!0},{name:"nohlsearch",shortName:"noh"},{name:"yank",shortName:"y"},{name:"delmarks",shortName:"delm"},{name:"registers",shortName:"reg",excludeFromCommandHistory:!0},{name:"global",shortName:"g"}],S=v.Pos,x=function(){return ut};v.defineOption("vimMode",!1,function(e,t,n){t&&e.getOption("keyMap")!="vim"?e.setOption("keyMap","vim"):!t&&n!=v.Init&&/^vim/.test(e.getOption("keyMap"))&&e.setOption("keyMap","default")});var A={Shift:"S",Ctrl:"C",Alt:"A",Cmd:"D",Mod:"A"},O={Enter:"CR",Backspace:"BS",Delete:"Del",Insert:"Ins"},D=/[\d]/,P=[v.isWordChar,function(e){return e&&!v.isWordChar(e)&&!/\s/.test(e)}],H=[function(e){return/\S/.test(e)}],j=B(65,26),F=B(97,26),I=B(48,10),q=[].concat(j,F,I,["<",">"]),R=[].concat(j,F,I,["-",'"',".",":","/"]),Q={};G("filetype",undefined,"string",["ft"],function(e,t){if(t===undefined)return;if(e===undefined){var n=t.getOption("mode");return n=="null"?"":n}var n=e==""?"null":e;t.setOption("mode",n)});var et=function(){function s(s,o,u){function l(n){var r=++t%e,o=i[r];o&&o.clear(),i[r]=s.setBookmark(n)}var a=t%e,f=i[a];if(f){var c=f.find();c&&!Ot(c,o)&&l(o)}else l(o);l(u),n=t,r=t-e+1,r<0&&(r=0)}function o(s,o){t+=o,t>n?t=n:t0?1:-1,f,l=s.getCursor();do{t+=a,u=i[(e+t)%e];if(u&&(f=u.find())&&!Ot(l,f))break}while(tr)}return u}function u(e,n){var r=t,i=o(e,n);return t=r,i&&i.find()}var e=100,t=-1,n=0,r=0,i=new Array(e);return{cachedCursor:undefined,add:s,find:u,move:o}},tt=function(e){return e?{changes:e.changes,expectCursorActivityForChange:e.expectCursorActivityForChange}:{changes:[],expectCursorActivityForChange:!1}};nt.prototype={exitMacroRecordMode:function(){var e=it.macroModeState;e.onRecordingDone&&e.onRecordingDone(),e.onRecordingDone=undefined,e.isRecording=!1},enterMacroRecordMode:function(e,t){var n=it.registerController.getRegister(t);n&&(n.clear(),this.latestRegister=t,e.openDialog&&(this.onRecordingDone=e.openDialog("(recording)["+t+"]",null,{bottom:!0})),this.isRecording=!0)}};var it,ot,ut={buildKeyMap:function(){},getRegisterController:function(){return it.registerController},resetVimGlobalState_:st,getVimGlobalState_:function(){return it},maybeInitVimState_:rt,suppressErrorLogging:!1,InsertModeKey:rr,map:function(e,t,n){Wn.map(e,t,n)},unmap:function(e,t){Wn.unmap(e,t)},noremap:function(e,t,n){function r(e){return e?[e]:["normal","insert","visual"]}var i=r(n),s=b.length,o=w;for(var u=s-o;u=0;i--){var s=r[i];if(e!==s.context)if(s.context)this._mapCommand(s);else{var o=["normal","insert","visual"];for(var u in o)if(o[u]!==e){var a={};for(var f in s)a[f]=s[f];a.context=o[u],this._mapCommand(a)}}}},setOption:Y,getOption:Z,defineOption:G,defineEx:function(e,t,n){if(!t)t=e;else if(e.indexOf(t)!==0)throw new Error('(Vim.defineEx) "'+t+'" is not a prefix of "'+e+'", command not registered');zn[e]=n,Wn.commandMap_[t]={name:e,shortName:t,type:"api"}},handleKey:function(e,t,n){var r=this.findKey(e,t,n);if(typeof r=="function")return r()},findKey:function(e,t,n){function i(){var r=it.macroModeState;if(r.isRecording){if(t=="q")return r.exitMacroRecordMode(),ft(e),!0;n!="mapping"&&Qn(r,t)}}function s(){if(t=="")return ft(e),r.visualMode?Jt(e):r.insertMode&&Vn(e),!0}function o(n){var r;while(n)r=/<\w+-.+?>|<\w+>|./.exec(n),t=r[0],n=n.substring(r.index+t.length),v.Vim.handleKey(e,t,"mapping")}function u(){if(s())return!0;var n=r.inputState.keyBuffer=r.inputState.keyBuffer+t,i=t.length==1,o=dt.matchCommand(n,b,r.inputState,"insert");while(n.length>1&&o.type!="full"){var n=r.inputState.keyBuffer=n.slice(1),u=dt.matchCommand(n,b,r.inputState,"insert");u.type!="none"&&(o=u)}if(o.type=="none")return ft(e),!1;if(o.type=="partial")return ot&&window.clearTimeout(ot),ot=window.setTimeout(function(){r.insertMode&&r.inputState.keyBuffer&&ft(e)},Z("insertModeEscKeysTimeout")),!i;ot&&window.clearTimeout(ot);if(i){var a=e.listSelections();for(var f=0;f0||this.motionRepeat.length>0)e=1,this.prefixRepeat.length>0&&(e*=parseInt(this.prefixRepeat.join(""),10)),this.motionRepeat.length>0&&(e*=parseInt(this.motionRepeat.join(""),10));return e},lt.prototype={setText:function(e,t,n){this.keyBuffer=[e||""],this.linewise=!!t,this.blockwise=!!n},pushText:function(e,t){t&&(this.linewise||this.keyBuffer.push("\n"),this.linewise=!0),this.keyBuffer.push(e)},pushInsertModeChanges:function(e){this.insertModeChanges.push(tt(e))},pushSearchQuery:function(e){this.searchQueries.push(e)},clear:function(){this.keyBuffer=[],this.insertModeChanges=[],this.searchQueries=[],this.linewise=!1},toString:function(){return this.keyBuffer.join("")}},ht.prototype={pushText:function(e,t,n,r,i){r&&n.charAt(n.length-1)!=="\n"&&(n+="\n");var s=this.isValidRegister(e)?this.getRegister(e):null;if(!s){switch(t){case"yank":this.registers[0]=new lt(n,r,i);break;case"delete":case"change":n.indexOf("\n")==-1?this.registers["-"]=new lt(n,r):(this.shiftNumericRegisters_(),this.registers[1]=new lt(n,r))}this.unnamedRegister.setText(n,r,i);return}var o=V(e);o?s.pushText(n,r):s.setText(n,r,i),this.unnamedRegister.setText(s.toString(),r)},getRegister:function(e){return this.isValidRegister(e)?(e=e.toLowerCase(),this.registers[e]||(this.registers[e]=new lt),this.registers[e]):this.unnamedRegister},isValidRegister:function(e){return e&&K(e,R)},shiftNumericRegisters_:function(){for(var e=9;e>=2;e--)this.registers[e]=this.getRegister(""+(e-1))}},pt.prototype={nextMatch:function(e,t){var n=this.historyBuffer,r=t?-1:1;this.initialPrefix===null&&(this.initialPrefix=e);for(var i=this.iterator+r;t?i>=0:i=n.length)return this.iterator=n.length,this.initialPrefix;if(i<0)return e},pushInput:function(e){var t=this.historyBuffer.indexOf(e);t>-1&&this.historyBuffer.splice(t,1),e.length&&this.historyBuffer.push(e)},reset:function(){this.initialPrefix=null,this.iterator=this.historyBuffer.length}};var dt={matchCommand:function(e,t,n,r){var i=Nt(e,t,r,n);if(!i.full&&!i.partial)return{type:"none"};if(!i.full&&i.partial)return{type:"partial"};var s;for(var o=0;o"){var a=kt(e);if(//.test(a)||!a)return{type:"none"};n.selectedCharacter=a}return{type:"full",command:s}},processCommand:function(e,t,n){t.inputState.repeatOverride=n.repeatOverride;switch(n.type){case"motion":this.processMotion(e,t,n);break;case"operator":this.processOperator(e,t,n);break;case"operatorMotion":this.processOperatorMotion(e,t,n);break;case"action":this.processAction(e,t,n);break;case"search":this.processSearch(e,t,n);break;case"ex":case"keyToEx":this.processEx(e,t,n);break;default:}},processMotion:function(e,t,n){t.inputState.motion=n.motion,t.inputState.motionArgs=xt(n.motionArgs),this.evalInput(e,t)},processOperator:function(e,t,n){var r=t.inputState;if(r.operator){if(r.operator==n.operator){r.motion="expandToLine",r.motionArgs={linewise:!0},this.evalInput(e,t);return}ft(e)}r.operator=n.operator,r.operatorArgs=xt(n.operatorArgs),n.exitVisualBlock&&(t.visualBlock=!1,Xt(e)),t.visualMode&&this.evalInput(e,t)},processOperatorMotion:function(e,t,n){var r=t.visualMode,i=xt(n.operatorMotionArgs);i&&r&&i.visualLine&&(t.visualLine=!0),this.processOperator(e,t,n),r||this.processMotion(e,t,n)},processAction:function(e,t,n){var r=t.inputState,i=r.getRepeat(),s=!!i,o=xt(n.actionArgs)||{};r.selectedCharacter&&(o.selectedCharacter=r.selectedCharacter),n.operator&&this.processOperator(e,t,n),n.motion&&this.processMotion(e,t,n),(n.motion||n.operator)&&this.evalInput(e,t),o.repeat=i||1,o.repeatIsExplicit=s,o.registerName=r.registerName,ft(e),t.lastMotion=null,n.isEdit&&this.recordLastEdit(t,r,n),wt[n.action](e,o,t)},processSearch:function(e,t,n){function a(r,i,s){it.searchHistoryController.pushInput(r),it.searchHistoryController.reset();try{Dn(e,r,i,s)}catch(o){Ln(e,"Invalid regex: "+r),ft(e);return}dt.processMotion(e,t,{type:"motion",motion:"findNext",motionArgs:{forward:!0,toJumplist:n.searchArgs.toJumplist}})}function f(t){e.scrollTo(u.left,u.top),a(t,!0,!0);var n=it.macroModeState;n.isRecording&&Yn(n,t)}function l(t,n,i){var s=v.keyName(t),o,a;s=="Up"||s=="Down"?(o=s=="Up"?!0:!1,a=t.target?t.target.selectionEnd:0,n=it.searchHistoryController.nextMatch(n,o)||"",i(n),a&&t.target&&(t.target.selectionEnd=t.target.selectionStart=Math.min(a,t.target.value.length))):s!="Left"&&s!="Right"&&s!="Ctrl"&&s!="Alt"&&s!="Shift"&&it.searchHistoryController.reset();var f;try{f=Dn(e,n,!0,!0)}catch(t){}f?e.scrollIntoView(Bn(e,!r,f),30):(jn(e),e.scrollTo(u.left,u.top))}function c(t,n,r){var i=v.keyName(t);i=="Esc"||i=="Ctrl-C"||i=="Ctrl-["||i=="Backspace"&&n==""?(it.searchHistoryController.pushInput(n),it.searchHistoryController.reset(),Dn(e,o),jn(e),e.scrollTo(u.left,u.top),v.e_stop(t),ft(e),r(),e.focus()):i=="Up"||i=="Down"?v.e_stop(t):i=="Ctrl-U"&&(v.e_stop(t),r(""))}if(!e.getSearchCursor)return;var r=n.searchArgs.forward,i=n.searchArgs.wholeWordOnly;mn(e).setReversed(!r);var s=r?"/":"?",o=mn(e).getQuery(),u=e.getScrollInfo();switch(n.searchArgs.querySrc){case"prompt":var h=it.macroModeState;if(h.isPlaying){var p=h.replaySearchQueries.shift();a(p,!0,!1)}else Mn(e,{onClose:f,prefix:s,desc:On,onKeyUp:l,onKeyDown:c});break;case"wordUnderCursor":var d=Yt(e,!1,!0,!1,!0),m=!0;d||(d=Yt(e,!1,!0,!1,!1),m=!1);if(!d)return;var p=e.getLine(d.start.line).substring(d.start.ch,d.end.ch);m&&i?p="\\b"+p+"\\b":p=jt(p),it.jumpList.cachedCursor=e.getCursor(),e.setCursor(d.start),a(p,!0,!1)}},processEx:function(e,t,n){function r(t){it.exCommandHistoryController.pushInput(t),it.exCommandHistoryController.reset(),Wn.processCommand(e,t)}function i(t,n,r){var i=v.keyName(t),s,o;if(i=="Esc"||i=="Ctrl-C"||i=="Ctrl-["||i=="Backspace"&&n=="")it.exCommandHistoryController.pushInput(n),it.exCommandHistoryController.reset(),v.e_stop(t),ft(e),r(),e.focus();i=="Up"||i=="Down"?(v.e_stop(t),s=i=="Up"?!0:!1,o=t.target?t.target.selectionEnd:0,n=it.exCommandHistoryController.nextMatch(n,s)||"",r(n),o&&t.target&&(t.target.selectionEnd=t.target.selectionStart=Math.min(o,t.target.value.length))):i=="Ctrl-U"?(v.e_stop(t),r("")):i!="Left"&&i!="Right"&&i!="Ctrl"&&i!="Alt"&&i!="Shift"&&it.exCommandHistoryController.reset()}n.type=="keyToEx"?Wn.processCommand(e,n.exArgs.input):t.visualMode?Mn(e,{onClose:r,prefix:":",value:"'<,'>",onKeyDown:i,selectValueOnOpen:!1}):Mn(e,{onClose:r,prefix:":",onKeyDown:i})},evalInput:function(e,t){var n=t.inputState,r=n.motion,i=n.motionArgs||{},s=n.operator,o=n.operatorArgs||{},u=n.registerName,a=t.sel,f=At(t.visualMode?St(e,a.head):e.getCursor("head")),l=At(t.visualMode?St(e,a.anchor):e.getCursor("anchor")),c=At(f),h=At(l),p,d,v;s&&this.recordLastEdit(t,n),n.repeatOverride!==undefined?v=n.repeatOverride:v=n.getRepeat();if(v>0&&i.explicitRepeat)i.repeatIsExplicit=!0;else if(i.noRepeat||!i.explicitRepeat&&v===0)v=1,i.repeatIsExplicit=!1;n.selectedCharacter&&(i.selectedCharacter=o.selectedCharacter=n.selectedCharacter),i.repeat=v,ft(e);if(r){var m=vt[r](e,f,i,t);t.lastMotion=vt[r];if(!m)return;if(i.toJumplist){!s&&e.ace.curOp!=null&&(e.ace.curOp.command.scrollIntoView="center-animate");var g=it.jumpList,y=g.cachedCursor;y?(Zt(e,y,m),delete g.cachedCursor):Zt(e,f,m)}m instanceof Array?(d=m[0],p=m[1]):p=m,p||(p=At(f));if(t.visualMode){if(!t.visualBlock||p.ch!==Infinity)p=St(e,p,t.visualBlock);d&&(d=St(e,d,!0)),d=d||h,a.anchor=d,a.head=p,Xt(e),fn(e,t,"<",Mt(d,p)?d:p),fn(e,t,">",Mt(d,p)?p:d)}else s||(p=St(e,p),e.setCursor(p.line,p.ch))}if(s){if(o.lastSel){d=h;var b=o.lastSel,w=Math.abs(b.head.line-b.anchor.line),E=Math.abs(b.head.ch-b.anchor.ch);b.visualLine?p=S(h.line+w,h.ch):b.visualBlock?p=S(h.line+w,h.ch+E):b.head.line==b.anchor.line?p=S(h.line,h.ch+E):p=S(h.line+w,h.ch),t.visualMode=!0,t.visualLine=b.visualLine,t.visualBlock=b.visualBlock,a=t.sel={anchor:d,head:p},Xt(e)}else t.visualMode&&(o.lastSel={anchor:At(a.anchor),head:At(a.head),visualBlock:t.visualBlock,visualLine:t.visualLine});var x,T,N,C,k;if(t.visualMode){x=_t(a.head,a.anchor),T=Dt(a.head,a.anchor),N=t.visualLine||o.linewise,C=t.visualBlock?"block":N?"line":"char",k=Vt(e,{anchor:x,head:T},C);if(N){var L=k.ranges;if(C=="block")for(var A=0;Af&&i.line==f)return this.moveToEol(e,t,n,r,!0);var l=e.ace.session.getFoldLine(u);return l&&(n.forward?u>l.start.row&&(u=l.end.row+1):u=l.start.row),n.toFirstChar&&(s=Gt(e.getLine(u)),r.lastHPos=s),r.lastHSPos=e.charCoords(S(u,s),"div").left,S(u,s)},moveByDisplayLines:function(e,t,n,r){var i=t;switch(r.lastMotion){case this.moveByDisplayLines:case this.moveByScroll:case this.moveByLines:case this.moveToColumn:case this.moveToEol:break;default:r.lastHSPos=e.charCoords(i,"div").left}var s=n.repeat,o=e.findPosV(i,n.forward?s:-s,"line",r.lastHSPos);if(o.hitSide)if(n.forward)var u=e.charCoords(o,"div"),a={top:u.top+8,left:r.lastHSPos},o=e.coordsChar(a,"div");else{var f=e.charCoords(S(e.firstLine(),0),"div");f.left=r.lastHSPos,o=e.coordsChar(f,"div")}return r.lastHPos=o.ch,o},moveByPage:function(e,t,n){var r=t,i=n.repeat;return e.findPosV(r,n.forward?i:-i,"page")},moveByParagraph:function(e,t,n){var r=n.forward?1:-1;return cn(e,t,n.repeat,r)},moveBySentence:function(e,t,n){var r=n.forward?1:-1;return hn(e,t,n.repeat,r)},moveByScroll:function(e,t,n,r){var i=e.getScrollInfo(),s=null,o=n.repeat;o||(o=i.clientHeight/(2*e.defaultTextHeight()));var u=e.charCoords(t,"local");n.repeat=o;var s=vt.moveByDisplayLines(e,t,n,r);if(!s)return null;var a=e.charCoords(s,"local");return e.scrollTo(null,i.top+a.top-u.top),s},moveByWords:function(e,t,n){return on(e,t,n.repeat,!!n.forward,!!n.wordEnd,!!n.bigWord)},moveTillCharacter:function(e,t,n){var r=n.repeat,i=un(e,r,n.forward,n.selectedCharacter),s=n.forward?-1:1;return en(s,n),i?(i.ch+=s,i):null},moveToCharacter:function(e,t,n){var r=n.repeat;return en(0,n),un(e,r,n.forward,n.selectedCharacter)||t},moveToSymbol:function(e,t,n){var r=n.repeat;return rn(e,r,n.forward,n.selectedCharacter)||t},moveToColumn:function(e,t,n,r){var i=n.repeat;return r.lastHPos=i-1,r.lastHSPos=e.charCoords(t,"div").left,an(e,i)},moveToEol:function(e,t,n,r,i){var s=t,o=S(s.line+n.repeat-1,Infinity),u=e.clipPos(o);return u.ch--,i||(r.lastHPos=Infinity,r.lastHSPos=e.charCoords(u,"div").left),o},moveToFirstNonWhiteSpaceCharacter:function(e,t){var n=t;return S(n.line,Gt(e.getLine(n.line)))},moveToMatchedSymbol:function(e,t){var n=t,r=n.line,i=n.ch,s=e.getLine(r),o;for(;i]/.test(s[i])?/[(){}[\]<>]/:/[(){}[\]]/,f=e.findMatchingBracket(S(r,i+1),{bracketRegex:a});return f.to}return n},moveToStartOfLine:function(e,t){return S(t.line,0)},moveToLineOrEdgeOfDocument:function(e,t,n){var r=n.forward?e.lastLine():e.firstLine();return n.repeatIsExplicit&&(r=n.repeat-e.getOption("firstLineNumber")),S(r,Gt(e.getLine(r)))},textObjectManipulation:function(e,t,n,r){var i={"(":")",")":"(","{":"}","}":"{","[":"]","]":"[","<":">",">":"<"},s={"'":!0,'"':!0,"`":!0},o=n.selectedCharacter;o=="b"?o="(":o=="B"&&(o="{");var u=!n.textObjectInner,a;if(i[o])a=pn(e,t,o,u);else if(s[o])a=dn(e,t,o,u);else if(o==="W")a=Yt(e,u,!0,!0);else if(o==="w")a=Yt(e,u,!0,!1);else{if(o!=="p")return null;a=cn(e,t,n.repeat,0,u),n.linewise=!0;if(r.visualMode)r.visualLine||(r.visualLine=!0);else{var f=r.inputState.operatorArgs;f&&(f.linewise=!0),a.end.line--}}return e.state.vim.visualMode?Wt(e,a.start,a.end):[a.start,a.end]},repeatLastCharacterSearch:function(e,t,n){var r=it.lastCharacterSearch,i=n.repeat,s=n.forward===r.forward,o=(r.increment?1:0)*(s?-1:1);e.moveH(-o,"char"),n.inclusive=s?!0:!1;var u=un(e,i,s,r.selectedCharacter);return u?(u.ch+=o,u):(e.moveH(o,"char"),t)}},yt={change:function(e,t,n){var r,i,s=e.state.vim,o=n[0].anchor,u=n[0].head;if(!s.visualMode){i=e.getRange(o,u);var a=s.lastEditInputState||{};if(a.motion=="moveByWords"&&!$(i)){var f=/\s+$/.exec(i);f&&a.motionArgs&&a.motionArgs.forward&&(u=Tt(u,0,-f[0].length),i=i.slice(0,-f[0].length))}var l=new S(o.line-1,Number.MAX_VALUE),c=e.firstLine()==e.lastLine();u.line>e.lastLine()&&t.linewise&&!c?e.replaceRange("",l,u):e.replaceRange("",o,u),t.linewise&&(c||(e.setCursor(l),v.commands.newlineAndIndent(e)),o.ch=Number.MAX_VALUE),r=o}else if(t.fullLine)u.ch=Number.MAX_VALUE,u.line--,e.setSelection(o,u),i=e.getSelection(),e.replaceSelection(""),r=o;else{i=e.getSelection();var h=gt("",n.length);e.replaceSelections(h),r=_t(n[0].head,n[0].anchor)}it.registerController.pushText(t.registerName,"change",i,t.linewise,n.length>1),wt.enterInsertMode(e,{head:r},e.state.vim)},"delete":function(e,t,n){var r,i,s=e.state.vim;if(!s.visualBlock){var o=n[0].anchor,u=n[0].head;t.linewise&&u.line!=e.firstLine()&&o.line==e.lastLine()&&o.line==u.line-1&&(o.line==e.firstLine()?o.ch=0:o=S(o.line-1,Ht(e,o.line-1))),i=e.getRange(o,u),e.replaceRange("",o,u),r=o,t.linewise&&(r=vt.moveToFirstNonWhiteSpaceCharacter(e,o))}else{i=e.getSelection();var a=gt("",n.length);e.replaceSelections(a),r=n[0].anchor}it.registerController.pushText(t.registerName,"delete",i,t.linewise,s.visualBlock);var f=s.insertMode;return St(e,r,f)},indent:function(e,t,n){var r=e.state.vim,i=n[0].anchor.line,s=r.visualBlock?n[n.length-1].anchor.line:n[0].head.line,o=r.visualMode?t.repeat:1;t.linewise&&s--;for(var u=i;u<=s;u++)for(var a=0;af.top?(a.line+=(u-f.top)/i,a.line=Math.ceil(a.line),e.setCursor(a),f=e.charCoords(a,"local"),e.scrollTo(null,f.top)):e.scrollTo(null,u);else{var l=u+e.getScrollInfo().clientHeight;l=i.anchor.line?s=Tt(i.head,0,1):s=S(i.anchor.line,0)}else if(r=="inplace"){if(n.visualMode)return}else r=="lastEdit"&&(s=Rn(e)||s);e.setOption("disableInput",!1),t&&t.replace?(e.toggleOverwrite(!0),e.setOption("keyMap","vim-replace"),v.signal(e,"vim-mode-change",{mode:"replace"})):(e.toggleOverwrite(!1),e.setOption("keyMap","vim-insert"),v.signal(e,"vim-mode-change",{mode:"insert"})),it.macroModeState.isPlaying||(e.on("change",Zn),v.on(e.getInputField(),"keydown",ir)),n.visualMode&&Jt(e),qt(e,s,o)},toggleVisualMode:function(e,t,n){var r=t.repeat,i=e.getCursor(),s;n.visualMode?n.visualLine^t.linewise||n.visualBlock^t.blockwise?(n.visualLine=!!t.linewise,n.visualBlock=!!t.blockwise,v.signal(e,"vim-mode-change",{mode:"visual",subMode:n.visualLine?"linewise":n.visualBlock?"blockwise":""}),Xt(e)):Jt(e):(n.visualMode=!0,n.visualLine=!!t.linewise,n.visualBlock=!!t.blockwise,s=St(e,S(i.line,i.ch+r-1),!0),n.sel={anchor:i,head:s},v.signal(e,"vim-mode-change",{mode:"visual",subMode:n.visualLine?"linewise":n.visualBlock?"blockwise":""}),Xt(e),fn(e,n,"<",_t(i,s)),fn(e,n,">",Dt(i,s)))},reselectLastSelection:function(e,t,n){var r=n.lastSelection;n.visualMode&&zt(e,n);if(r){var i=r.anchorMark.find(),s=r.headMark.find();if(!i||!s)return;n.sel={anchor:i,head:s},n.visualMode=!0,n.visualLine=r.visualLine,n.visualBlock=r.visualBlock,Xt(e),fn(e,n,"<",_t(i,s)),fn(e,n,">",Dt(i,s)),v.signal(e,"vim-mode-change",{mode:"visual",subMode:n.visualLine?"linewise":n.visualBlock?"blockwise":""})}},joinLines:function(e,t,n){var r,i;if(n.visualMode){r=e.getCursor("anchor"),i=e.getCursor("head");if(Mt(i,r)){var s=i;i=r,r=s}i.ch=Ht(e,i.line)-1}else{var o=Math.max(t.repeat,2);r=e.getCursor(),i=St(e,S(r.line+o-1,Infinity))}var u=0;for(var a=r.line;a1)var s=Array(t.repeat+1).join(s);var p=i.linewise,d=i.blockwise;if(d){s=s.split("\n"),p&&s.pop();for(var v=0;ve.lastLine()&&e.replaceRange("\n",S(C,0));var k=Ht(e,C);ka.length&&(s=a.length),o=S(i.line,s)}if(r=="\n")n.visualMode||e.replaceRange("",i,o),(v.commands.newlineAndIndentContinueComment||v.commands.newlineAndIndent)(e);else{var f=e.getRange(i,o);f=f.replace(/[^\n]/g,r);if(n.visualBlock){var l=(new Array(e.getOption("tabSize")+1)).join(" ");f=e.getSelection(),f=f.replace(/\t/g,l).replace(/[^\n]/g,r).split("\n"),e.replaceSelections(f)}else e.replaceRange(f,i,o);n.visualMode?(i=Mt(u[0].anchor,u[0].head)?u[0].anchor:u[0].head,e.setCursor(i),Jt(e,!1)):e.setCursor(Tt(o,0,-1))}},incrementNumberToken:function(e,t){var n=e.getCursor(),r=e.getLine(n.line),i=/(-?)(?:(0x)([\da-f]+)|(0b|0|)(\d+))/gi,s,o,u,a;while((s=i.exec(r))!==null){o=s.index,u=o+s[0].length;if(n.ch=1)return!0}else e.nextCh===e.reverseSymb&&e.depth--;return!1}},section:{init:function(e){e.curMoveThrough=!0,e.symb=(e.forward?"]":"[")===e.symb?"{":"}"},isComplete:function(e){return e.index===0&&e.nextCh===e.symb}},comment:{isComplete:function(e){var t=e.lastCh==="*"&&e.nextCh==="/";return e.lastCh=e.nextCh,t}},method:{init:function(e){e.symb=e.symb==="m"?"{":"}",e.reverseSymb=e.symb==="{"?"}":"{"},isComplete:function(e){return e.nextCh===e.symb?!0:!1}},preprocess:{init:function(e){e.index=0},isComplete:function(e){if(e.nextCh==="#"){var t=e.lineText.match(/#(\w+)/)[1];if(t==="endif"){if(e.forward&&e.depth===0)return!0;e.depth++}else if(t==="if"){if(!e.forward&&e.depth===0)return!0;e.depth--}if(t==="else"&&e.depth===0)return!0}return!1}}};G("pcre",!0,"boolean"),vn.prototype={getQuery:function(){return it.query},setQuery:function(e){it.query=e},getOverlay:function(){return this.searchOverlay},setOverlay:function(e){this.searchOverlay=e},isReversed:function(){return it.isReversed},setReversed:function(e){it.isReversed=e},getScrollbarAnnotate:function(){return this.annotate},setScrollbarAnnotate:function(e){this.annotate=e}};var xn={"\\n":"\n","\\r":"\r","\\t":" "},Nn={"\\/":"/","\\\\":"\\","\\n":"\n","\\r":"\r","\\t":" "},On="(Javascript regexp)",Un=function(){this.buildCommandMap_()};Un.prototype={processCommand:function(e,t,n){var r=this;e.operation(function(){e.curOp.isVimOp=!0,r._processCommand(e,t,n)})},_processCommand:function(e,t,n){var r=e.state.vim,i=it.registerController.getRegister(":"),s=i.toString();r.visualMode&&Jt(e);var o=new v.StringStream(t);i.setText(t);var u=n||{};u.input=t;try{this.parseInput_(e,o,u)}catch(a){throw Ln(e,a),a}var f,l;if(!u.commandName)u.line!==undefined&&(l="move");else{f=this.matchCommand_(u.commandName);if(f){l=f.name,f.excludeFromCommandHistory&&i.setText(s),this.parseCommandArgs_(o,u,f);if(f.type=="exToKey"){for(var c=0;c0;t--){var n=e.substring(0,t);if(this.commandMap_[n]){var r=this.commandMap_[n];if(r.name.indexOf(e)===0)return r}}return null},buildCommandMap_:function(){this.commandMap_={};for(var e=0;e
";if(!n)for(var s in r){var o=r[s].toString();o.length&&(i+='"'+s+" "+o+"
")}else{var s;n=n.join("");for(var u=0;u"}}Ln(e,i)},sort:function(e,t){function u(){if(t.argString){var e=new v.StringStream(t.argString);e.eat("!")&&(n=!0);if(e.eol())return;if(!e.eatSpace())return"Invalid arguments";var u=e.match(/([dinuox]+)?\s*(\/.+\/)?\s*/);if(!u&&!e.eol())return"Invalid arguments";if(u[1]){r=u[1].indexOf("i")!=-1,i=u[1].indexOf("u")!=-1;var a=u[1].indexOf("d")!=-1||u[1].indexOf("n")!=-1&&1,f=u[1].indexOf("x")!=-1&&1,l=u[1].indexOf("o")!=-1&&1;if(a+f+l>1)return"Invalid arguments";s=a&&"decimal"||f&&"hex"||l&&"octal"}u[2]&&(o=new RegExp(u[2].substr(1,u[2].length-2),r?"i":""))}}function E(e,t){if(n){var i;i=e,e=t,t=i}r&&(e=e.toLowerCase(),t=t.toLowerCase());var o=s&&d.exec(e),u=s&&d.exec(t);return o?(o=parseInt((o[1]+o[2]).toLowerCase(),m),u=parseInt((u[1]+u[2]).toLowerCase(),m),o-u):e")}if(!u){Ln(e,c);return}var d=0,v=function(){if(d=f){Ln(e,"Invalid argument: "+t.argString.substring(i));return}for(var l=0;l<=f-a;l++){var c=String.fromCharCode(a+l);delete n.marks[c]}}else delete n.marks[s]}}},Wn=new Un;v.keyMap.vim={attach:k,detach:C,call:L},G("insertModeEscKeysTimeout",200,"number"),v.keyMap["vim-insert"]={fallthrough:["default"],attach:k,detach:C,call:L},v.keyMap["vim-replace"]={Backspace:"goCharLeft",fallthrough:["vim-insert"],attach:k,detach:C,call:L},st(),v.Vim=x(),x=v.Vim;var ur={"return":"CR",backspace:"BS","delete":"Del",esc:"Esc",left:"Left",right:"Right",up:"Up",down:"Down",space:"Space",home:"Home",end:"End",pageup:"PageUp",pagedown:"PageDown",enter:"CR"},fr=x.handleKey.bind(x);x.handleKey=function(e,t,n){return e.operation(function(){return fr(e,t,n)},!0)},t.CodeMirror=v;var hr=x.maybeInitVimState_;t.handler={$id:"ace/keyboard/vim",drawCursor:function(e,t,n,r,s){var u=this.state.vim||{},a=n.characterWidth,f=n.lineHeight,l=t.top,c=t.left;if(!u.insertMode){var h=r.cursor?i.comparePoints(r.cursor,r.start)<=0:s.selection.isBackwards()||s.selection.isEmpty();!h&&c>a&&(c-=a)}!u.insertMode&&u.status&&(f/=2,l+=f),o.translate(e,c,l),o.setStyle(e.style,"width",a+"px"),o.setStyle(e.style,"height",f+"px")},handleKeyboard:function(e,t,n,r,i){var s=e.editor,o=s.state.cm,u=hr(o);if(r==-1)return;u.insertMode||(t==-1?(n.charCodeAt(0)>255&&e.inputKey&&(n=e.inputKey,n&&e.inputHash==4&&(n=n.toUpperCase())),e.inputChar=n):t==4||t==0?e.inputKey==n&&e.inputHash==t&&e.inputChar?(n=e.inputChar,t=-1):(e.inputChar=null,e.inputKey=n,e.inputHash=t):e.inputChar=e.inputKey=null);if(n=="c"&&t==1&&!c.isMac&&s.getCopyText())return s.once("copy",function(){s.selection.clearSelection()}),{command:"null",passEvent:!0};if(n=="esc"&&!u.insertMode&&!u.visualMode&&!o.ace.inMultiSelectMode){var a=mn(o),f=a.getOverlay();f&&o.removeOverlay(f)}if(t==-1||t&1||t===0&&n.length>1){var l=u.insertMode,h=ar(t,n,i||{});u.status==null&&(u.status="");var p=cr(o,h,"user");u=hr(o),p&&u.status!=null?u.status+=h:u.status==null&&(u.status=""),o._signal("changeStatus");if(!p&&(t!=-1||l))return;return{command:"null",passEvent:!p}}},attach:function(e){function n(){var n=hr(t).insertMode;t.ace.renderer.setStyle("normal-mode",!n),e.textInput.setCommandMode(!n),e.renderer.$keepTextAreaAtCursor=n,e.renderer.$blockCursor=!n}e.state||(e.state={});var t=new v(e);e.state.cm=t,e.$vimModeHandler=this,v.keyMap.vim.attach(t),hr(t).status=null,t.on("vim-command-done",function(){if(t.virtualSelectionMode())return;hr(t).status=null,t.ace._signal("changeStatus"),t.ace.session.markUndoGroup()}),t.on("changeStatus",function(){t.ace.renderer.updateCursor(),t.ace._signal("changeStatus")}),t.on("vim-mode-change",function(){if(t.virtualSelectionMode())return;n(),t._signal("changeStatus")}),n(),e.renderer.$cursorLayer.drawCursor=this.drawCursor.bind(t)},detach:function(e){var t=e.state.cm;v.keyMap.vim.detach(t),t.destroy(),e.state.cm=null,e.$vimModeHandler=null,e.renderer.$cursorLayer.drawCursor=null,e.renderer.setStyle("normal-mode",!1),e.textInput.setCommandMode(!1),e.renderer.$keepTextAreaAtCursor=!0},getStatusText:function(e){var t=e.state.cm,n=hr(t);if(n.insertMode)return"INSERT";var r="";return n.visualMode&&(r+="VISUAL",n.visualLine&&(r+=" LINE"),n.visualBlock&&(r+=" BLOCK")),n.status&&(r+=(r?" ":"")+n.status),r}},x.defineOption({name:"wrap",set:function(e,t){t&&t.ace.setOption("wrap",e)},type:"boolean"},!1),x.defineEx("write","w",function(){console.log(":write is not implemented")}),b.push({keys:"zc",type:"action",action:"fold",actionArgs:{open:!1}},{keys:"zC",type:"action",action:"fold",actionArgs:{open:!1,all:!0}},{keys:"zo",type:"action",action:"fold",actionArgs:{open:!0}},{keys:"zO",type:"action",action:"fold",actionArgs:{open:!0,all:!0}},{keys:"za",type:"action",action:"fold",actionArgs:{toggle:!0}},{keys:"zA",type:"action",action:"fold",actionArgs:{toggle:!0,all:!0}},{keys:"zf",type:"action",action:"fold",actionArgs:{open:!0,all:!0}},{keys:"zd",type:"action",action:"fold",actionArgs:{open:!0,all:!0}},{keys:"",type:"action",action:"aceCommand",actionArgs:{name:"addCursorAbove"}},{keys:"",type:"action",action:"aceCommand",actionArgs:{name:"addCursorBelow"}},{keys:"",type:"action",action:"aceCommand",actionArgs:{name:"addCursorAboveSkipCurrent"}},{keys:"",type:"action",action:"aceCommand",actionArgs:{name:"addCursorBelowSkipCurrent"}},{keys:"",type:"action",action:"aceCommand",actionArgs:{name:"selectMoreBefore"}},{keys:"",type:"action",action:"aceCommand",actionArgs:{name:"selectMoreAfter"}},{keys:"",type:"action",action:"aceCommand",actionArgs:{name:"selectNextBefore"}},{keys:"",type:"action",action:"aceCommand",actionArgs:{name:"selectNextAfter"}}),wt.aceCommand=function(e,t,n){e.vimCmd=t,e.ace.inVirtualSelectionMode?e.ace.on("beforeEndOperation",pr):pr(null,e.ace)},wt.fold=function(e,t,n){e.ace.execCommand(["toggleFoldWidget","toggleFoldWidget","foldOther","unfoldall"][(t.all?2:0)+(t.open?1:0)])},t.handler.defaultKeymap=b,t.handler.actions=wt,t.Vim=x}); (function() { window.require(["ace/keyboard/vim"], function(m) { if (typeof module == "object" && typeof exports == "object" && module) { module.exports = m; } }); })(); ================================================ FILE: pyp5js/http_local/static/js/ace/keybinding-vscode.js ================================================ define("ace/keyboard/vscode",["require","exports","module","ace/keyboard/hash_handler","ace/config"],function(e,t,n){"use strict";var r=e("../keyboard/hash_handler").HashHandler,i=e("../config");t.handler=new r,t.handler.$id="ace/keyboard/vscode",t.handler.addCommands([{name:"toggleWordWrap",exec:function(e){var t=e.session.getUseWrapMode();e.session.setUseWrapMode(!t)},readOnly:!0},{name:"navigateToLastEditLocation",exec:function(e){var t=e.session.getUndoManager().$lastDelta,n=t.action=="remove"?t.start:t.end;e.moveCursorTo(n.row,n.column),e.clearSelection()}},{name:"replaceAll",exec:function(e){e.searchBox?e.searchBox.active===!0&&e.searchBox.replaceOption.checked===!0&&e.searchBox.replaceAll():i.loadModule("ace/ext/searchbox",function(t){t.Search(e,!0)})}},{name:"replaceOne",exec:function(e){e.searchBox?e.searchBox.active===!0&&e.searchBox.replaceOption.checked===!0&&e.searchBox.replace():i.loadModule("ace/ext/searchbox",function(t){t.Search(e,!0)})}},{name:"selectAllMatches",exec:function(e){e.searchBox?e.searchBox.active===!0&&e.searchBox.findAll():i.loadModule("ace/ext/searchbox",function(t){t.Search(e,!1)})}},{name:"toggleFindCaseSensitive",exec:function(e){i.loadModule("ace/ext/searchbox",function(t){t.Search(e,!1);var n=e.searchBox;n.caseSensitiveOption.checked=!n.caseSensitiveOption.checked,n.$syncOptions()})}},{name:"toggleFindInSelection",exec:function(e){i.loadModule("ace/ext/searchbox",function(t){t.Search(e,!1);var n=e.searchBox;n.searchOption.checked=!n.searchRange,n.setSearchRange(n.searchOption.checked&&n.editor.getSelectionRange()),n.$syncOptions()})}},{name:"toggleFindRegex",exec:function(e){i.loadModule("ace/ext/searchbox",function(t){t.Search(e,!1);var n=e.searchBox;n.regExpOption.checked=!n.regExpOption.checked,n.$syncOptions()})}},{name:"toggleFindWholeWord",exec:function(e){i.loadModule("ace/ext/searchbox",function(t){t.Search(e,!1);var n=e.searchBox;n.wholeWordOption.checked=!n.wholeWordOption.checked,n.$syncOptions()})}},{name:"removeSecondaryCursors",exec:function(e){var t=e.selection.ranges;t&&t.length>1?e.selection.toSingleRange(t[t.length-1]):e.selection.clearSelection()}}]),[{bindKey:{mac:"Ctrl-G",win:"Ctrl-G"},name:"gotoline"},{bindKey:{mac:"Command-Shift-L|Command-F2",win:"Ctrl-Shift-L|Ctrl-F2"},name:"findAll"},{bindKey:{mac:"Shift-F8|Shift-Option-F8",win:"Shift-F8|Shift-Alt-F8"},name:"goToPreviousError"},{bindKey:{mac:"F8|Option-F8",win:"F8|Alt-F8"},name:"goToNextError"},{bindKey:{mac:"Command-Shift-P|F1",win:"Ctrl-Shift-P|F1"},name:"openCommandPallete"},{bindKey:{mac:"Command-K|Command-S",win:"Ctrl-K|Ctrl-S"},name:"showKeyboardShortcuts"},{bindKey:{mac:"Shift-Option-Up",win:"Alt-Shift-Up"},name:"copylinesup"},{bindKey:{mac:"Shift-Option-Down",win:"Alt-Shift-Down"},name:"copylinesdown"},{bindKey:{mac:"Command-Shift-K",win:"Ctrl-Shift-K"},name:"removeline"},{bindKey:{mac:"Command-Enter",win:"Ctrl-Enter"},name:"addLineAfter"},{bindKey:{mac:"Command-Shift-Enter",win:"Ctrl-Shift-Enter"},name:"addLineBefore"},{bindKey:{mac:"Command-Shift-\\",win:"Ctrl-Shift-\\"},name:"jumptomatching"},{bindKey:{mac:"Command-]",win:"Ctrl-]"},name:"blockindent"},{bindKey:{mac:"Command-[",win:"Ctrl-["},name:"blockoutdent"},{bindKey:{mac:"Ctrl-PageDown",win:"Alt-PageDown"},name:"pagedown"},{bindKey:{mac:"Ctrl-PageUp",win:"Alt-PageUp"},name:"pageup"},{bindKey:{mac:"Shift-Option-A",win:"Shift-Alt-A"},name:"toggleBlockComment"},{bindKey:{mac:"Option-Z",win:"Alt-Z"},name:"toggleWordWrap"},{bindKey:{mac:"Command-G",win:"F3|Ctrl-K Ctrl-D"},name:"findnext"},{bindKey:{mac:"Command-Shift-G",win:"Shift-F3"},name:"findprevious"},{bindKey:{mac:"Option-Enter",win:"Alt-Enter"},name:"selectAllMatches"},{bindKey:{mac:"Command-D",win:"Ctrl-D"},name:"selectMoreAfter"},{bindKey:{mac:"Command-K Command-D",win:"Ctrl-K Ctrl-D"},name:"selectOrFindNext"},{bindKey:{mac:"Shift-Option-I",win:"Shift-Alt-I"},name:"splitSelectionIntoLines"},{bindKey:{mac:"Command-K M",win:"Ctrl-K M"},name:"modeSelect"},{bindKey:{mac:"Command-Option-[",win:"Ctrl-Shift-["},name:"toggleFoldWidget"},{bindKey:{mac:"Command-Option-]",win:"Ctrl-Shift-]"},name:"toggleFoldWidget"},{bindKey:{mac:"Command-K Command-0",win:"Ctrl-K Ctrl-0"},name:"foldall"},{bindKey:{mac:"Command-K Command-J",win:"Ctrl-K Ctrl-J"},name:"unfoldall"},{bindKey:{mac:"Command-K Command-1",win:"Ctrl-K Ctrl-1"},name:"foldOther"},{bindKey:{mac:"Command-K Command-Q",win:"Ctrl-K Ctrl-Q"},name:"navigateToLastEditLocation"},{bindKey:{mac:"Command-K Command-R|Command-K Command-S",win:"Ctrl-K Ctrl-R|Ctrl-K Ctrl-S"},name:"showKeyboardShortcuts"},{bindKey:{mac:"Command-K Command-X",win:"Ctrl-K Ctrl-X"},name:"trimTrailingSpace"},{bindKey:{mac:"Shift-Down|Command-Shift-Down",win:"Shift-Down|Ctrl-Shift-Down"},name:"selectdown"},{bindKey:{mac:"Shift-Up|Command-Shift-Up",win:"Shift-Up|Ctrl-Shift-Up"},name:"selectup"},{bindKey:{mac:"Command-Alt-Enter",win:"Ctrl-Alt-Enter"},name:"replaceAll"},{bindKey:{mac:"Command-Shift-1",win:"Ctrl-Shift-1"},name:"replaceOne"},{bindKey:{mac:"Option-C",win:"Alt-C"},name:"toggleFindCaseSensitive"},{bindKey:{mac:"Option-L",win:"Alt-L"},name:"toggleFindInSelection"},{bindKey:{mac:"Option-R",win:"Alt-R"},name:"toggleFindRegex"},{bindKey:{mac:"Option-W",win:"Alt-W"},name:"toggleFindWholeWord"},{bindKey:{mac:"Command-L",win:"Ctrl-L"},name:"expandtoline"},{bindKey:{mac:"Shift-Esc",win:"Shift-Esc"},name:"removeSecondaryCursors"}].forEach(function(e){var n=t.handler.commands[e.name];n&&(n.bindKey=e.bindKey),t.handler.bindKey(e.bindKey,n||e.name)})}); (function() { window.require(["ace/keyboard/vscode"], function(m) { if (typeof module == "object" && typeof exports == "object" && module) { module.exports = m; } }); })(); ================================================ FILE: pyp5js/http_local/static/js/ace/mode-python.js ================================================ define("ace/mode/python_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(){var e="and|as|assert|break|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|not|or|pass|print|raise|return|try|while|with|yield|async|await|nonlocal",t="True|False|None|NotImplemented|Ellipsis|__debug__",n="abs|divmod|input|open|staticmethod|all|enumerate|int|ord|str|any|eval|isinstance|pow|sum|basestring|execfile|issubclass|print|super|binfile|bin|iter|property|tuple|bool|filter|len|range|type|bytearray|float|list|raw_input|unichr|callable|format|locals|reduce|unicode|chr|frozenset|long|reload|vars|classmethod|getattr|map|repr|xrange|cmp|globals|max|reversed|zip|compile|hasattr|memoryview|round|__import__|complex|hash|min|apply|delattr|help|next|setattr|set|buffer|dict|hex|object|slice|coerce|dir|id|oct|sorted|intern|ascii|breakpoint|bytes",r=this.createKeywordMapper({"invalid.deprecated":"debugger","support.function":n,"variable.language":"self|cls","constant.language":t,keyword:e},"identifier"),i="[uU]?",s="[rR]",o="[fF]",u="(?:[rR][fF]|[fF][rR])",a="(?:(?:[1-9]\\d*)|(?:0))",f="(?:0[oO]?[0-7]+)",l="(?:0[xX][\\dA-Fa-f]+)",c="(?:0[bB][01]+)",h="(?:"+a+"|"+f+"|"+l+"|"+c+")",p="(?:[eE][+-]?\\d+)",d="(?:\\.\\d+)",v="(?:\\d+)",m="(?:(?:"+v+"?"+d+")|(?:"+v+"\\.))",g="(?:(?:"+m+"|"+v+")"+p+")",y="(?:"+g+"|"+m+")",b="\\\\(x[0-9A-Fa-f]{2}|[0-7]{3}|[\\\\abfnrtv'\"]|U[0-9A-Fa-f]{8}|u[0-9A-Fa-f]{4})";this.$rules={start:[{token:"comment",regex:"#.*$"},{token:"string",regex:i+'"{3}',next:"qqstring3"},{token:"string",regex:i+'"(?=.)',next:"qqstring"},{token:"string",regex:i+"'{3}",next:"qstring3"},{token:"string",regex:i+"'(?=.)",next:"qstring"},{token:"string",regex:s+'"{3}',next:"rawqqstring3"},{token:"string",regex:s+'"(?=.)',next:"rawqqstring"},{token:"string",regex:s+"'{3}",next:"rawqstring3"},{token:"string",regex:s+"'(?=.)",next:"rawqstring"},{token:"string",regex:o+'"{3}',next:"fqqstring3"},{token:"string",regex:o+'"(?=.)',next:"fqqstring"},{token:"string",regex:o+"'{3}",next:"fqstring3"},{token:"string",regex:o+"'(?=.)",next:"fqstring"},{token:"string",regex:u+'"{3}',next:"rfqqstring3"},{token:"string",regex:u+'"(?=.)',next:"rfqqstring"},{token:"string",regex:u+"'{3}",next:"rfqstring3"},{token:"string",regex:u+"'(?=.)",next:"rfqstring"},{token:"keyword.operator",regex:"\\+|\\-|\\*|\\*\\*|\\/|\\/\\/|%|@|<<|>>|&|\\||\\^|~|<|>|<=|=>|==|!=|<>|="},{token:"punctuation",regex:",|:|;|\\->|\\+=|\\-=|\\*=|\\/=|\\/\\/=|%=|@=|&=|\\|=|^=|>>=|<<=|\\*\\*="},{token:"paren.lparen",regex:"[\\[\\(\\{]"},{token:"paren.rparen",regex:"[\\]\\)\\}]"},{token:"text",regex:"\\s+"},{include:"constants"}],qqstring3:[{token:"constant.language.escape",regex:b},{token:"string",regex:'"{3}',next:"start"},{defaultToken:"string"}],qstring3:[{token:"constant.language.escape",regex:b},{token:"string",regex:"'{3}",next:"start"},{defaultToken:"string"}],qqstring:[{token:"constant.language.escape",regex:b},{token:"string",regex:"\\\\$",next:"qqstring"},{token:"string",regex:'"|$',next:"start"},{defaultToken:"string"}],qstring:[{token:"constant.language.escape",regex:b},{token:"string",regex:"\\\\$",next:"qstring"},{token:"string",regex:"'|$",next:"start"},{defaultToken:"string"}],rawqqstring3:[{token:"string",regex:'"{3}',next:"start"},{defaultToken:"string"}],rawqstring3:[{token:"string",regex:"'{3}",next:"start"},{defaultToken:"string"}],rawqqstring:[{token:"string",regex:"\\\\$",next:"rawqqstring"},{token:"string",regex:'"|$',next:"start"},{defaultToken:"string"}],rawqstring:[{token:"string",regex:"\\\\$",next:"rawqstring"},{token:"string",regex:"'|$",next:"start"},{defaultToken:"string"}],fqqstring3:[{token:"constant.language.escape",regex:b},{token:"string",regex:'"{3}',next:"start"},{token:"paren.lparen",regex:"{",push:"fqstringParRules"},{defaultToken:"string"}],fqstring3:[{token:"constant.language.escape",regex:b},{token:"string",regex:"'{3}",next:"start"},{token:"paren.lparen",regex:"{",push:"fqstringParRules"},{defaultToken:"string"}],fqqstring:[{token:"constant.language.escape",regex:b},{token:"string",regex:"\\\\$",next:"fqqstring"},{token:"string",regex:'"|$',next:"start"},{token:"paren.lparen",regex:"{",push:"fqstringParRules"},{defaultToken:"string"}],fqstring:[{token:"constant.language.escape",regex:b},{token:"string",regex:"'|$",next:"start"},{token:"paren.lparen",regex:"{",push:"fqstringParRules"},{defaultToken:"string"}],rfqqstring3:[{token:"string",regex:'"{3}',next:"start"},{token:"paren.lparen",regex:"{",push:"fqstringParRules"},{defaultToken:"string"}],rfqstring3:[{token:"string",regex:"'{3}",next:"start"},{token:"paren.lparen",regex:"{",push:"fqstringParRules"},{defaultToken:"string"}],rfqqstring:[{token:"string",regex:"\\\\$",next:"rfqqstring"},{token:"string",regex:'"|$',next:"start"},{token:"paren.lparen",regex:"{",push:"fqstringParRules"},{defaultToken:"string"}],rfqstring:[{token:"string",regex:"'|$",next:"start"},{token:"paren.lparen",regex:"{",push:"fqstringParRules"},{defaultToken:"string"}],fqstringParRules:[{token:"paren.lparen",regex:"[\\[\\(]"},{token:"paren.rparen",regex:"[\\]\\)]"},{token:"string",regex:"\\s+"},{token:"string",regex:"'(.)*'"},{token:"string",regex:'"(.)*"'},{token:"function.support",regex:"(!s|!r|!a)"},{include:"constants"},{token:"paren.rparen",regex:"}",next:"pop"},{token:"paren.lparen",regex:"{",push:"fqstringParRules"}],constants:[{token:"constant.numeric",regex:"(?:"+y+"|\\d+)[jJ]\\b"},{token:"constant.numeric",regex:y},{token:"constant.numeric",regex:h+"[lL]\\b"},{token:"constant.numeric",regex:h+"\\b"},{token:["punctuation","function.support"],regex:"(\\.)([a-zA-Z_]+)\\b"},{token:r,regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"}]},this.normalizeRules()};r.inherits(s,i),t.PythonHighlightRules=s}),define("ace/mode/folding/pythonic",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("./fold_mode").FoldMode,s=t.FoldMode=function(e){this.foldingStartMarker=new RegExp("([\\[{])(?:\\s*)$|("+e+")(?:\\s*)(?:#.*)?$")};r.inherits(s,i),function(){this.getFoldWidgetRange=function(e,t,n){var r=e.getLine(n),i=r.match(this.foldingStartMarker);if(i)return i[1]?this.openingBracketBlock(e,i[1],n,i.index):i[2]?this.indentationBlock(e,n,i.index+i[2].length):this.indentationBlock(e,n)}}.call(s.prototype)}),define("ace/mode/python",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/python_highlight_rules","ace/mode/folding/pythonic","ace/range"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text").Mode,s=e("./python_highlight_rules").PythonHighlightRules,o=e("./folding/pythonic").FoldMode,u=e("../range").Range,a=function(){this.HighlightRules=s,this.foldingRules=new o("\\:"),this.$behaviour=this.$defaultBehaviour};r.inherits(a,i),function(){this.lineCommentStart="#",this.getNextLineIndent=function(e,t,n){var r=this.$getIndent(t),i=this.getTokenizer().getLineTokens(t,e),s=i.tokens;if(s.length&&s[s.length-1].type=="comment")return r;if(e=="start"){var o=t.match(/^.*[\{\(\[:]\s*$/);o&&(r+=n)}return r};var e={pass:1,"return":1,raise:1,"break":1,"continue":1};this.checkOutdent=function(t,n,r){if(r!=="\r\n"&&r!=="\r"&&r!=="\n")return!1;var i=this.getTokenizer().getLineTokens(n.trim(),t).tokens;if(!i)return!1;do var s=i.pop();while(s&&(s.type=="comment"||s.type=="text"&&s.value.match(/^\s+$/)));return s?s.type=="keyword"&&e[s.value]:!1},this.autoOutdent=function(e,t,n){n+=1;var r=this.$getIndent(t.getLine(n)),i=t.getTabString();r.slice(-i.length)==i&&t.remove(new u(n,r.length-i.length,n,r.length))},this.$id="ace/mode/python",this.snippetFileId="ace/snippets/python"}.call(a.prototype),t.Mode=a}); (function() { window.require(["ace/mode/python"], function(m) { if (typeof module == "object" && typeof exports == "object" && module) { module.exports = m; } }); })(); ================================================ FILE: pyp5js/http_local/static/js/ace/theme-ambiance.js ================================================ define("ace/theme/ambiance",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!0,t.cssClass="ace-ambiance",t.cssText=".ace-ambiance .ace_gutter {background-color: #3d3d3d;background-image: linear-gradient(left, #3D3D3D, #333);background-repeat: repeat-x;border-right: 1px solid #4d4d4d;text-shadow: 0px 1px 1px #4d4d4d;color: #222;}.ace-ambiance .ace_gutter-layer {background: repeat left top;}.ace-ambiance .ace_gutter-active-line {background-color: #3F3F3F;}.ace-ambiance .ace_fold-widget {text-align: center;}.ace-ambiance .ace_fold-widget:hover {color: #777;}.ace-ambiance .ace_fold-widget.ace_start,.ace-ambiance .ace_fold-widget.ace_end,.ace-ambiance .ace_fold-widget.ace_closed{background: none !important;border: none;box-shadow: none;}.ace-ambiance .ace_fold-widget.ace_start:after {content: '\u25be'}.ace-ambiance .ace_fold-widget.ace_end:after {content: '\u25b4'}.ace-ambiance .ace_fold-widget.ace_closed:after {content: '\u2023'}.ace-ambiance .ace_print-margin {border-left: 1px dotted #2D2D2D;right: 0;background: #262626;}.ace-ambiance .ace_scroller {-webkit-box-shadow: inset 0 0 10px black;-moz-box-shadow: inset 0 0 10px black;-o-box-shadow: inset 0 0 10px black;box-shadow: inset 0 0 10px black;}.ace-ambiance {color: #E6E1DC;background-color: #202020;}.ace-ambiance .ace_cursor {border-left: 1px solid #7991E8;}.ace-ambiance .ace_overwrite-cursors .ace_cursor {border: 1px solid #FFE300;background: #766B13;}.ace-ambiance.normal-mode .ace_cursor-layer {z-index: 0;}.ace-ambiance .ace_marker-layer .ace_selection {background: rgba(221, 240, 255, 0.20);}.ace-ambiance .ace_marker-layer .ace_selected-word {border-radius: 4px;border: 8px solid #3f475d;box-shadow: 0 0 4px black;}.ace-ambiance .ace_marker-layer .ace_step {background: rgb(198, 219, 174);}.ace-ambiance .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgba(255, 255, 255, 0.25);}.ace-ambiance .ace_marker-layer .ace_active-line {background: rgba(255, 255, 255, 0.031);}.ace-ambiance .ace_invisible {color: #333;}.ace-ambiance .ace_paren {color: #24C2C7;}.ace-ambiance .ace_keyword {color: #cda869;}.ace-ambiance .ace_keyword.ace_operator {color: #fa8d6a;}.ace-ambiance .ace_punctuation.ace_operator {color: #fa8d6a;}.ace-ambiance .ace_identifier {}.ace-ambiance .ace-statement {color: #cda869;}.ace-ambiance .ace_constant {color: #CF7EA9;}.ace-ambiance .ace_constant.ace_language {color: #CF7EA9;}.ace-ambiance .ace_constant.ace_library {}.ace-ambiance .ace_constant.ace_numeric {color: #78CF8A;}.ace-ambiance .ace_invalid {text-decoration: underline;}.ace-ambiance .ace_invalid.ace_illegal {color:#F8F8F8;background-color: rgba(86, 45, 86, 0.75);}.ace-ambiance .ace_invalid,.ace-ambiance .ace_deprecated {text-decoration: underline;font-style: italic;color: #D2A8A1;}.ace-ambiance .ace_support {color: #9B859D;}.ace-ambiance .ace_support.ace_function {color: #DAD085;}.ace-ambiance .ace_function.ace_buildin {color: #9b859d;}.ace-ambiance .ace_string {color: #8f9d6a;}.ace-ambiance .ace_string.ace_regexp {color: #DAD085;}.ace-ambiance .ace_comment {font-style: italic;color: #555;}.ace-ambiance .ace_comment.ace_doc {}.ace-ambiance .ace_comment.ace_doc.ace_tag {color: #666;font-style: normal;}.ace-ambiance .ace_definition,.ace-ambiance .ace_type {color: #aac6e3;}.ace-ambiance .ace_variable {color: #9999cc;}.ace-ambiance .ace_variable.ace_language {color: #9b859d;}.ace-ambiance .ace_xml-pe {color: #494949;}.ace-ambiance .ace_gutter-layer,.ace-ambiance .ace_text-layer {background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAQAAAAHUWYVAABFFUlEQVQYGbzBCeDVU/74/6fj9HIcx/FRHx9JCFmzMyGRURhLZIkUsoeRfUjS2FNDtr6WkMhO9sm+S8maJfu+Jcsg+/o/c+Z4z/t97/vezy3z+z8ekGlnYICG/o7gdk+wmSHZ1z4pJItqapjoKXWahm8NmV6eOTbWUOp6/6a/XIg6GQqmenJ2lDHyvCFZ2cBDbmtHA043VFhHwXxClWmeYAdLhV00Bd85go8VmaFCkbVkzlQENzfBDZ5gtN7HwF0KDrTwJ0dypSOzpaKCMwQHKTIreYIxlmhXTzTWkVm+LTynZhiSBT3RZQ7aGfjGEd3qyXQ1FDymqbKxpspERQN2MiRjNZlFFQXfCNFm9nM1zpAsoYjmtRTc5ajwuaXc5xrWskT97RaKzAGe5ARHhVUsDbjKklziiX5WROcJwSNCNI+9w1Jwv4Zb2r7lCMZ4oq5C0EdTx+2GzNuKpJ+iFf38JEWkHJn9DNF7mmBDITrWEg0VWL3pHU20tSZnuqWu+R3BtYa8XxV1HO7GyD32UkOpL/yDloINFTmvtId+nmAjxRw40VMwVKiwrKLE4bK5UOVntYwhOcSSXKrJHKPJedocpGjVz/ZMIbnYUPB10/eKCrs5apqpgVmWzBYWpmtKHecJPjaUuEgRDDaU0oZghCJ6zNMQ5ZhDYx05r5v2muQdM0EILtXUsaKiQX9WMEUotagQzFbUNN6NUPC2nm5pxEWGCjMc3GdJHjSU2kORLK/JGSrkfGEIjncU/CYUnOipoYemwj8tST9NsJmB7TUVXtbUtXATJVZXBMvYeTXJfobgJUPmGMP/yFaWonaa6BcFO3nqcIqCozSZoZoSr1g4zJOzuyGnxTEX3lUEJ7WcZgme8ddaWvWJo2AJR9DZU3CUIbhCSG6ybSwN6qtJVnCU2svDTP2ZInOw2cBTrqtQahtNZn9NcJ4l2NaSmSkkP1noZWnVwkLmdUPOwLZEwy2Z3S3R+4rIG9hcbpPXHFVWcQdZkn2FOta3cKWQnNRC5g1LsJah4GCzSVsKnCOY5OAFRTBekyyryeyilhFKva75r4Mc0aWanGEaThcy31s439KKxTzJYY5WTHPU1FtIHjQU3Oip4xlNzj/lBw23dYZVliQa7WAXf4shetcQfatI+jWRDBPmyNeW6A1P5kdDgyYJlba0BIM8BZu1JfrFwItyjcAMR3K0BWOIrtMEXyhyrlVEx3ui5dUBjmB/Q3CXW85R4mBD0s7B+4q5tKUjOlb9qqmhi5AZ6GFIC5HXtOobdYGlVdMVbNJ8toNTFcHxnoL+muBagcctjWnbNMuR00uI7nQESwg5q2qqrKWIfrNUmeQocY6HuyxJV02wj36w00yhpmUFenv4p6fUkZYqLyuinx2RGOjhCXYyJF84oiU00YMOOhhquNdfbOB7gU88pY4xJO8LVdp6/q2voeB4R04vIdhSE40xZObx1HGGJ/ja0LBthFInKaLPPFzuCaYaoj8JjPME8yoyxo6zlBqkiUZYgq00OYMswbWO5NGmq+xhipxHLRW29ARjNKXO0wRnear8XSg4XFPLKEPUS1GqvyLwiuBUoa7zpZ0l5xxFwWmWZC1H5h5FwU8eQ7K+g8UcVY6TMQreVQT/8uQ8Z+ALIXnSEa2pYZQneE9RZbSBNYXfWYJzW/h/4j4Dp1tYVcFIC5019Vyi4ThPqSFCzjGWaHQTBU8q6vrVwgxP9Lkm840imWKpcLCjYTtrKuwvsKSnrvHCXGkSMk9p6lhckfRpIeis+N2PiszT+mFLspyGleUhDwcLrZqmyeylxwjBcKHEapqkmyangyLZRVOijwOtCY5SsG5zL0OwlCJ4y5KznF3EUNDDrinwiyLZRzOXtlBbK5ITHFGLp8Q0R6ab6mS7enI2cFrxOyHvOCFaT1HThS1krjCwqWeurCkk+willhCC+RSZnRXBiZaC5RXRIZYKp2lyfrHwiKPKR0JDzrdU2EFgpidawlFDR6FgXUMNa+g1FY3bUQh2cLCwosRdnuQTS/S+JVrGLeWIvtQUvONJxlqSQYYKpwoN2kaocLjdVsis4Mk80ESF2YpSkzwldjHkjFCUutI/r+EHDU8oCs6yzL3PhWiEooZdFMkymlas4AcI3KmoMMNSQ3tHzjGWCrcJJdYyZC7QFGwjRL9p+MrRkAGWzIaWCn9W0F3TsK01c2ZvQw0byvxuQU0r1lM0qJO7wW0kRIMdDTtXEdzi4VIh+EoIHm0mWtAtpCixlabgn83fKTI7anJe9ST7WIK1DMGpQmYeA58ImV6ezOGOzK2Kgq01pd60cKWiUi9Lievb/0vIDPHQ05Kzt4ddPckQBQtoaurjyHnek/nKzpQLrVgKPjIkh2v4uyezpv+Xoo7fPFXaGFp1vaLKxQ4uUpQQS5VuQs7BCq4xRJv7fwpVvvFEB3j+620haOuocqMhWd6TTPAEx+mdFNGHdranFe95WrWmIvlY4F1Dle2ECgc6cto7SryuqGGGha0tFQ5V53migUKmg6XKAo4qS3mik+0OZpAhOLeZKicacgaYcyx5hypYQE02ZA4xi/pNhOQxR4klNKyqacj+mpxnLTnnGSo85++3ZCZq6lrZkXlGEX3o+C9FieccJbZWVFjC0Yo1FZnJhoYMFoI1hEZ9r6hwg75HwzBNhbZCdJEfJwTPGzJvaKImw1yYX1HDAmpXR+ZJQ/SmgqMNVQb5vgamGwLtt7VwvP7Qk1xpiM5x5Cyv93E06MZmgs0Nya2azIKOYKCGBQQW97RmhKNKF02JZqHEJ4o58qp7X5EcZmc56trXEqzjCBZ1MFGR87Ql2tSTs6CGxS05PTzRQorkbw7aKoKXFDXsYW42VJih/q+FP2BdTzDTwVqOYB13liM50vG7wy28qagyuIXMeQI/Oqq8bcn5wJI50xH00CRntyfpL1T4hydYpoXgNiFzoIUTDZnLNRzh4TBHwbYGDvZkxmlyJloyr6tRihpeUG94GnKtIznREF0tzJG/OOr73JBcrSh1k6WuTprgLU+mnSGnv6Zge0NNz+kTDdH8nuAuTdJDCNb21LCiIuqlYbqGzT3RAoZofQfjFazkqeNWdYaGvYTM001EW2oKPvVk1ldUGSgUtHFwjKM1h9jnFcmy5lChoLNaQMGGDsYbKixlaMBmmsx1QjCfflwTfO/gckW0ruZ3jugKR3R5W9hGUWqCgxuFgsuaCHorotGKzGaeZB9DMsaTnKCpMtwTvOzhYk0rdrArKCqcaWmVk1+F372ur1YkKxgatI8Qfe1gIX9wE9FgS8ESmuABIXnRUbCapcKe+nO7slClSZFzpV/LkLncEb1qiO42fS3R855Su2mCLh62t1SYZZYVmKwIHjREF2uihTzB20JOkz7dkxzYQnK0UOU494wh+VWRc6Un2kpTaVgLDFEkJ/uhzRcI0YKGgpGWOlocBU/a4fKoJ/pEaNV6jip3+Es9VXY078rGnmAdf7t9ylPXS34RBSuYPs1UecZTU78WanhBCHpZ5sAoTz0LGZKjPf9TRypqWEiTvOFglL1fCEY3wY/++rbk7C8bWebA6p6om6PgOL2kp44TFJlVNBXae2rqqdZztOJpT87GQsE9jqCPIe9VReZuQ/CIgacsyZdCpIScSYqcZk8r+nsyCzhyfhOqHGOIvrLknC8wTpFcaYiGC/RU1NRbUeUpocQOnkRpGOrIOcNRx+1uA0UrzhSSt+VyS3SJpnFWkzNDqOFGIWcfR86DnmARTQ1HKIL33ExPiemeOhYSSjzlSUZZuE4TveoJLnBUOFof6KiysCbnAEcZgcUNTDOwkqWu3RWtmGpZwlHhJENdZ3miGz0lJlsKnjbwqSHQjpxnFDlTLLwqJPMZMjd7KrzkSG7VsxXBZE+F8YZkb01Oe00yyRK9psh5SYh29ySPKBo2ylNht7ZkZnsKenjKNJu9PNEyZpaCHv4Kt6RQsLvAVp7M9kIimmCUwGeWqLMmGuIotYMmWNpSahkhZw9FqZsVnKJhsjAHvtHMsTM9fCI06Dx/u3vfUXCqfsKRc4oFY2jMsoo/7DJDwZ1CsIKnJu+J9ldkpmiCxQx1rWjI+T9FwcWWzOuaYH0Hj7klNRVWEQpmaqosakiGNTFHdjS/qnUdmf0NJW5xsL0HhimCCZZSRzmSPTXJQ4aaztAwtZnoabebJ+htCaZ7Cm535ByoqXKbX1WRc4Eh2MkRXWzImVc96Cj4VdOKVxR84VdQsIUM8Psoou2byVHyZFuq7O8otbSQ2UAoeEWTudATLGSpZzVLlXVkPU2Jc+27lsw2jmg5T5VhbeE3BT083K9WsTTkFU/Osi0rC5lRlpwRHUiesNS0sOvmqGML1aRbPAxTJD9ZKtxuob+hhl8cwYGWpJ8nub7t5p6coYbMovZ1BTdaKn1jYD6h4GFDNFyT/Kqe1XCXphXHOKLZmuRSRdBPEfVUXQzJm5YGPGGJdvAEr7hHNdGZnuBvrpciGmopOLf5N0uVMy0FfYToJk90uUCbJupaVpO53UJXR2bVpoU00V2KOo4zMFrBd0Jtz2pa0clT5Q5L8IpQ177mWQejPMEJhuQjS10ref6HHjdEhy1P1EYR7GtO0uSsKJQYLiTnG1rVScj5lyazpqWGl5uBbRWl7m6ixGOOnEsMJR7z8J0n6KMnCdxhiNYQCoZ6CmYLnO8omC3MkW3bktlPmEt/VQQHejL3+dOE5FlPdK/Mq8hZxxJtLyRrepLThYKbLZxkSb5W52vYxNOaOxUF0yxMUPwBTYqCzy01XayYK0sJyWBLqX0MwU5CzoymRzV0EjjeUeLgDpTo6ij42ZAzvD01dHUUTPLU96MdLbBME8nFBn7zJCMtJcZokn8YoqU0FS5WFKyniHobguMcmW8N0XkWZjkyN3hqOMtS08r+/xTBwpZSZ3qiVRX8SzMHHjfUNFjgHEPmY9PL3ykEzxkSre/1ZD6z/NuznuB0RcE1TWTm9zRgfUWVJiG6yrzgmWPXC8EAR4Wxhlad0ZbgQyEz3pG5RVEwwDJH2mgKpjcTiCOzn1lfUWANFbZ2BA8balnEweJC9J0iuaeZoI+ippFCztEKVvckR2iice1JvhVytrQwUAZpgsubCPaU7xUe9vWnaOpaSBEspalykhC9bUlOMpT42ZHca6hyrqKmw/wMR8H5ZmdFoBVJb03O4UL0tSNnvIeRmkrLWqrs78gcrEn2tpcboh0UPOW3UUR9PMk4T4nnNKWmCjlrefhCwxRNztfmIQVdDElvS4m1/WuOujoZCs5XVOjtKPGokJzsYCtFYoWonSPT21DheU/wWhM19FcElwqNGOsp9Q8N/cwXaiND1MmeL1Q5XROtYYgGeFq1aTMsoMmcrKjQrOFQTQ1fmBYhmW6o8Jkjc7iDJRTBIo5kgJD5yMEYA3srCg7VFKwiVJkmRCc5ohGOKhsYMn/XBLdo5taZjlb9YAlGWRimqbCsoY7HFAXLa5I1HPRxMMsQDHFkWtRNniqT9UEeNjcE7RUlrCJ4R2CSJuqlKHWvJXjAUNcITYkenuBRB84TbeepcqTj3zZyFJzgYQdHnqfgI0ddUwS6GqWpsKWhjq9cV0vBAEMN2znq+EBfIWT+pClYw5xsTlJU6GeIBsjGmmANTzJZiIYpgrM0Oa8ZMjd7NP87jxhqGOhJlnQtjuQpB+8aEE00wZFznSJPyHxgH3HkPOsJFvYk8zqCHzTs1BYOa4J3PFU+UVRZxlHDM4YavlNUuMoRveiZA2d7grMNc2g+RbSCEKzmgYsUmWmazFJyoiOZ4KnyhKOGRzWJa0+moyV4TVHDzn51Awtqaphfk/lRQ08FX1iiqxTB/kLwd0VynKfEvI6cd4XMV5bMhZ7gZUWVzYQ6Nm2BYzxJbw3bGthEUUMfgbGeorae6DxHtJoZ6alhZ0+ytiVoK1R4z5PTrOECT/SugseEOlb1MMNR4VRNcJy+V1Hg9ONClSZFZjdHlc6W6FBLdJja2MC5hhpu0DBYEY1TFGwiFAxRRCsYkiM9JRb0JNMVkW6CZYT/2EiTGWmo8k+h4FhDNE7BvppoTSFnmCV5xZKzvcCdDo7VVPnIU+I+Rc68juApC90MwcFCsJ5hDqxgScYKreruyQwTqrzoqDCmhWi4IbhB0Yrt3RGa6GfDv52rKXWhh28dyZaWUvcZeMTBaZoSGyiCtRU5J8iviioHaErs7Jkj61syVzTTgOcUOQ8buFBTYWdL5g3T4qlpe0+wvD63heAXRfCCIed9RbCsp2CiI7raUOYOTU13N8PNHvpaGvayo4a3LLT1lDrVEPT2zLUlheB1R+ZTRfKWJ+dcocLJfi11vyJ51lLqJ0WD7tRwryezjiV5W28uJO9qykzX8JDe2lHl/9oyBwa2UMfOngpXCixvKdXTk3wrsKmiVYdZIqsoWEERjbcUNDuiaQomGoIbFdEHmsyWnuR+IeriKDVLnlawlyNHKwKlSU631PKep8J4Q+ayjkSLKYLhalNHlYvttb6fHm0p6OApsZ4l2VfdqZkjuysy6ysKLlckf1KUutCTs39bmCgEyyoasIWlVaMF7mgmWtBT8Kol5xpH9IGllo8cJdopcvZ2sImlDmMIbtDk3KIpeNiS08lQw11NFPTwVFlPP6pJ2gvRfI7gQUfmNAtf6Gs0wQxDsKGlVBdF8rCa3jzdwMaGHOsItrZk7hAyOzpK9VS06j5F49b0VNGOOfKs3lDToMsMBe9ZWtHFEgxTJLs7qrygKZjUnmCYoeAqeU6jqWuLJup4WghOdvCYJnrSkSzoyRkm5M2StQwVltPkfCAk58tET/CSg+8MUecmotMEnhBKfWBIZsg2ihruMJQaoIm+tkTLKEqspMh00w95gvFCQRtDwTT1gVDDSEVdlwqZfxoQRbK0g+tbiBZxzKlpnpypejdDwTaeOvorMk/IJE10h9CqRe28hhLbe0pMsdSwv4ZbhKivo2BjDWfL8UKJgeavwlwb5KlwhyE4u4XkGE2ytZCznKLCDZZq42VzT8HLCrpruFbIfOIINmh/qCdZ1ZBc65kLHR1Bkyf5zn6pN3SvGKIlFNGplhrO9QSXanLOMQTLCa0YJCRrCZm/CZmrLTm7WzCK4GJDiWUdFeYx1LCFg3NMd0XmCuF3Y5rITLDUsYS9zoHVzwnJoYpSTQoObyEzr4cFBNqYTopoaU/wkyLZ2lPhX/5Y95ulxGTV7KjhWrOZgl8MyUUafjYraNjNU1N3IWcjT5WzWqjwtoarHSUObGYO3GCJZpsBlnJGPd6ZYLyl1GdCA2625IwwJDP8GUKymbzuyPlZlvTUsaUh5zFDhRWFzPKKZLAlWdcQbObgF9tOqOsmB1dqcqYJmWstFbZRRI9poolmqiLnU0POvxScpah2iSL5UJNzgScY5+AuIbpO0YD3NCW+dLMszFSdFCWGqG6eVq2uYVNDdICGD6W7EPRWZEY5gpsE9rUkS3mijzzJnm6UpUFXG1hCUeVoS5WfNcFpblELL2qqrCvMvRfd45oalvKU2tiQ6ePJOVMRXase9iTtLJztPxJKLWpo2CRDcJwn2sWSLKIO1WQWNTCvpVUvOZhgSC40JD0dOctaSqzkCRbXsKlb11Oip6PCJ0IwSJM31j3akRxlP7Rwn6aGaUL0qiLnJkvB3xWZ2+Q1TfCwpQH3G0o92UzmX4o/oJNQMMSQc547wVHhdk+VCw01DFYEnTxzZKAm74QmeNNR1w6WzEhNK15VJzuCdxQ53dRUDws5KvwgBMOEgpcVNe0hZI6RXT1Jd0cyj5nsaEAHgVmGaJIlWdsc5Ui2ElrRR6jrRAttNMEAIWrTDFubkZaok7/AkzfIwfuWVq0jHzuCK4QabtLUMVPB3kJ0oyHTSVFlqMALilJf2Rf8k5aaHtMfayocLBS8L89oKoxpJvnAkDPa0qp5DAUTHKWmCcnthlou8iCKaFFLHWcINd1nyIwXqrSxMNmSs6KmoL2QrKuWtlQ5V0120xQ5vRyZS1rgFkWwhiOwiuQbR0OOVhQM9iS3tiXp4RawRPMp5tDletOOBL95MpM01dZTBM9pkn5qF010rIeHFcFZhmSGpYpTsI6nwhqe5C9ynhlpp5ophuRb6WcJFldkVnVEwwxVfrVkvnWUuNLCg5bgboFHPDlDPDmnK7hUrWiIbjadDclujlZcaokOFup4Ri1kacV6jmrrK1hN9bGwpKEBQ4Q6DvIUXOmo6U5LqQM6EPyiKNjVkPnJkDPNEaxhiFay5ExW1NXVUGqcpYYdPcGiCq7z/TSlbhL4pplWXKd7NZO5QQFrefhRQW/NHOsqcIglc4UhWklR8K0QzbAw08CBDnpbgqXdeD/QUsM4RZXDFBW6WJKe/mFPdH0LtBgiq57wFLzlyQzz82qYx5D5WJP5yVJDW01BfyHnS6HKO/reZqId1WGa4Hkh2kWodJ8i6KoIPlAj2hPt76CzXsVR6koPRzWTfKqIentatYpQw2me4AA3y1Kind3SwoOKZDcFXTwl9tWU6mfgRk9d71sKtlNwrjnYw5tC5n5LdKiGry3JKNlHEd3oaMCFHrazBPMp/uNJ+V7IudcSbeOIdjUEdwl0VHCOZo5t6YluEuaC9mQeMgSfOyKnYGFHcIeQ84yQWbuJYJpZw5CzglDH7gKnWqqM9ZTaXcN0TeYhR84eQtJT76JJ1lREe7WnnvsMmRc9FQ7SBBM9mV3lCUdmHk/S2RAMt0QjFNFqQpWjDPQ01DXWUdDBkXziKPjGEP3VP+zIWU2t7im41FOloyWzn/L6dkUy3VLDaZ6appgDLHPjJEsyvJngWEPUyVBiAaHCTEXwrLvSEbV1e1gKJniicWorC1MUrVjB3uDhJE/wgSOzk1DXpk0k73qCM8xw2UvD5kJmDUfOomqMpWCkJRlvKXGmoeBm18USjVIk04SClxTB6YrgLAPLWYK9HLUt5cmc0vYES8GnTeRc6skZbQkWdxRsIcyBRzx1DbTk9FbU0caTPOgJHhJKnOGIVhQqvKmo0llRw9sabrZkDtdg3PqaKi9oatjY8B+G371paMg6+mZFNNtQ04mWBq3rYLOmtWWQp8KJnpy9DdFensyjdqZ+yY40VJlH8wcdLzC8PZnvHMFUTZUrDTkLyQaGus5X5LzpYAf3i+e/ZlhqGqWhh6Ou6xTR9Z6oi5AZZtp7Mj2EEm8oSpxiYZCHU/1fbGdNNNRRoZMhmilEb2gqHOEJDtXkHK/JnG6IrvbPCwV3NhONVdS1thBMs1T4QOBcTWa2IzhMk2nW5Kyn9tXUtpv9RsG2msxk+ZsQzRQacJncpgke0+T8y5Fzj8BiGo7XlJjaTIlpQs7KFjpqGnKuoyEPeIKnFMkZHvopgh81ySxNFWvJWcKRs70j2FOT012IllEEO1n4pD1513Yg2ssQPOThOkvyrqHUdEXOSEsihmBbTbKX1kLBPWqWkLOqJbjB3GBIZmoa8qWl4CG/iZ7oiA72ZL7TJNeZUY7kFQftDcHHluBzRbCegzMtrRjVQpX2lgoPKKLJAkcbMl01XK2p7yhL8pCBbQ3BN2avJgKvttcrWDK3CiUOVxQ8ZP+pqXKyIxnmBymCg5vJjNfkPK4+c8cIfK8ocVt7kmfd/I5SR1hKvCzUtb+lhgc00ZaO6CyhIQP1Uv4yIZjload72PXX0OIJvnFU+0Zf6MhsJwTfW0r0UwQfW4LNLZl5HK261JCZ4qnBaAreVAS3WrjV0LBnNDUNNDToCEeFfwgcb4gOEqLRhirWkexrCEYKVV711DLYEE1XBEsp5tpTGjorkomKYF9FDXv7fR3BGwbettSxnyL53MBPjsxDZjMh+VUW9NRxq1DhVk+FSxQcaGjV9Pawv6eGByw5qzoy7xk4RsOShqjJwWKe/1pEEfzkobeD/dQJmpqedcyBTy2sr4nGNRH0c0SPWTLrqAc0OQcb/gemKgqucQT7ySWKCn2EUotoCvpZct7RO2sy/QW0IWcXd7pQRQyZVwT2USRO87uhjioTLKV2brpMUcMQRbKH/N2T+UlTpaMls6cmc6CCNy3JdYYSUzzJQ4oSD3oKLncULOiJvjBEC2oqnCJkJluCYy2ZQ5so9YYlZ1VLlQU1mXEW1jZERwj/MUSRc24TdexlqLKfQBtDTScJUV8FszXBEY5ktpD5Ur9hYB4Nb1iikw3JoYpkKX+RodRKFt53MMuRnKSpY31PwYaGaILh3wxJGz9TkTPEETxoCWZrgvOlmyMzxFEwVJE5xZKzvyJ4WxEc16Gd4Xe3Weq4XH2jKRikqOkGQ87hQnC7wBmGYLAnesX3M+S87eFATauuN+Qcrh7xIxXJbUIdMw3JGE3ylCWzrieaqCn4zhGM19TQ3z1oH1AX+pWEqIc7wNGAkULBo/ZxRaV9NNyh4Br3rCHZzbzmSfawBL0dNRwpW1kK9mxPXR9povcdrGSZK9c2k0xwFGzjuniCtRSZCZ6ccZ7gaktmgAOtKbG/JnOkJrjcQTdFMsxRQ2cLY3WTIrlCw1eWKn8R6pvt4GFDso3QoL4a3nLk3G6JrtME3dSenpx7PNFTmga0EaJTLQ061sEeQoWXhSo9LTXsaSjoJQRXeZLtDclbCrYzfzHHeaKjHCVOUkQHO3JeEepr56mhiyaYYKjjNU+Fed1wS5VlhWSqI/hYUdDOkaxiKehoyOnrCV5yBHtbWFqTHCCwtpDcYolesVR5yUzTZBb3RNMd0d6WP+SvhuBmRcGxnuQzT95IC285cr41cLGQ6aJJhmi4TMGempxeimBRQw1tFKV+8jd6KuzoSTqqDxzRtpZkurvKEHxlqXKRIjjfUNNXQsNOsRScoWFLT+YeRZVD3GRN0MdQcKqQjHDMrdGGVu3iYJpQx3WGUvfbmxwFfR20WBq0oYY7LMFhhgYtr8jpaEnaOzjawWWaTP8mMr0t/EPDPoqcnxTBI5o58L7uoWnMrpoqPwgVrlAUWE+V+TQl9rawoyP6QGAlQw2TPRX+YSkxyBC8Z6jhHkXBgQL7WII3DVFnRfCrBfxewv9D6xsyjys4VkhWb9pUU627JllV0YDNHMku/ldNMMXDEo4aFnAkk4U6frNEU4XgZUPmEKHUl44KrzmYamjAbh0JFvGnaTLPu1s9jPCwjFpYiN7z1DTOk/nc07CfDFzmCf7i+bfNHXhDtLeBXzTBT5rkMvWOIxpl4EMh2LGJBu2syDnAEx2naEhHDWMMzPZEhygyS1mS5RTJr5ZkoKbEUoYqr2kqdDUE8ztK7OaIntJkFrIECwv8LJTaVx5XJE86go8dFeZ3FN3rjabCAYpoYEeC9zzJVULBbmZhDyd7ko09ydpNZ3nm2Kee4FPPXHnYEF1nqOFEC08LUVcDvYXkJHW8gTaKCk9YGOeIJhqiE4ToPEepdp7IWFjdwnWaufGMwJJCMtUTTBBK9BGCOy2tGGrJTHIwyEOzp6aPzNMOtlZkDvcEWpP5SVNhfkvDxhmSazTJXYrM9U1E0xwFVwqZQwzJxw6+kGGGUj2FglGGmnb1/G51udRSMNlTw6GGnCcUwVcOpmsqTHa06o72sw1RL02p9z0VbnMLOaIX3QKaYKSCFQzBKEUNHTSc48k53RH9wxGMtpQa5KjjW0W0n6XCCCG4yxNNdhQ4R4l1Ff+2sSd6UFHiIEOyqqFgT01mEUMD+joy75jPhOA+oVVLm309FR4yVOlp4RhLiScNmSmaYF5Pw0STrOIoWMSR2UkRXOMp+M4SHW8o8Zoi6OZgjKOaFar8zZDzkWzvKOjkKBjmCXby8JahhjXULY4KlzgKLvAwxVGhvyd4zxB1d9T0piazmKLCVZY5sKiD0y2ZSYrkUEPUbIk+dlQ4SJHTR50k1DPaUWIdTZW9NJwnJMOECgd7ou/MnppMJ02O1VT4Wsh85MnZzcFTngpXGKo84qmwgKbCL/orR/SzJ2crA+t6Mp94KvxJUeIbT3CQu1uIdlQEOzlKfS3UMcrTiFmOuroocrZrT2AcmamOKg8YomeEKm/rlT2sociMaybaUlFhuqHCM2qIJ+rg4EcDFymiDSxzaHdPcpE62pD5kyM5SBMoA1PaUtfIthS85ig1VPiPPYXgYEMNk4Qq7TXBgo7oT57gPUdwgCHzhIVFPFU6OYJzHAX9m5oNrVjeE61miDrqQ4VSa1oiURTsKHC0IfjNwU2WzK6eqK8jWln4g15TVBnqmDteCJ501PGAocJhhqjZdtBEB6lnhLreFJKxmlKbeGrqLiSThVIbCdGzloasa6lpMQXHCME2boLpJgT7yWaemu6wBONbqGNVRS0PKIL7LckbjmQtR7K8I5qtqel+T/ChJTNIKLjdUMNIRyvOEko9YYl2cwQveBikCNawJKcLBbc7+JM92mysNvd/Fqp8a0k6CNEe7cnZrxlW0wQXaXjaktnRwNOGZKYiONwS7a1JVheq3WgJHlQUGKHKmp4KAxXR/ULURcNgoa4zhKSLpZR3kxRRb0NmD0OFn+UCS7CzI1nbP6+o4x47QZE5xRCt3ZagnYcvmpYQktXdk5YKXTzBC57kKEe0VVuiSYqapssMS3C9p2CKkHOg8B8Pa8p5atrIw3qezIWanMGa5HRDNF6RM9wcacl0N+Q8Z8hsIkSnaIIdHRUOEebAPy1zbCkhM062FCJtif7PU+UtoVXzWKqM1PxXO8cfdruhFQ/a6x3JKYagvVDhQEtNiyiiSQ7OsuRsZUku0CRNDs4Sog6KKjsZgk2bYJqijgsEenoKeniinRXBn/U3lgpPdyDZynQx8IiioMnCep5Ky8mjGs6Wty0l1hUQTcNWswS3WRp2kCNZwJG8omG8JphPUaFbC8lEfabwP7VtM9yoaNCAjpR41VNhrD9LkbN722v0CoZMByFzhaW+MyzRYEWFDQwN2M4/JiT76PuljT3VU/A36eaIThb+R9oZGOAJ9tewkgGvqOMNRWYjT/Cwu99Q8LqDE4TgbLWxJ1jaDDAERsFOFrobgjUsBScaguXU8kKm2RL19tRypSHnHNlHiIZqgufs4opgQdVdwxBNNFBR6kVFqb8ogimOzB6a6HTzrlDHEpYaxjiiA4TMQobkDg2vejjfwJGWmnbVFAw3H3hq2NyQfG7hz4aC+w3BbwbesG0swYayvpAs6++Ri1Vfzx93mFChvyN5xVHTS+0p9aqCAxyZ6ZacZyw5+7uuQkFPR9DDk9NOiE7X1PCYJVjVUqq7JlrHwWALF5nfHNGjApdpqgzx5OwilDhCiDYTgnc9waGW4BdLNNUQvOtpzDOWHDH8D7TR/A/85KljEQu3NREc4Pl/6B1Hhc8Umb5CsKMmGC9EPcxoT2amwHNCmeOEnOPbklnMkbOgIvO5UMOpQrS9UGVdt6iH/fURjhI/WOpaW9OKLYRod6HCUEdOX000wpDZQ6hwg6LgZfOqo1RfT/CrJzjekXOGhpc1VW71ZLbXyyp+93ILbC1kPtIEYx0FIx1VDrLoVzXRKRYWk809yYlC9ImcrinxtabKnzRJk3lAU1OLEN1j2zrYzr2myHRXJFf4h4QKT1qSTzTB5+ZNTzTRkAxX8FcLV2uS8eoQQ2aAkFzvCM72sJIcJET3WPjRk5wi32uSS9rfZajpWEvj9hW42F4o5NytSXYy8IKHay10VYdrcl4SkqscrXpMwyGOgtkajheSxdQqmpxP1L3t4R5PqasFnrQEjytq6qgp9Y09Qx9o4S1FzhUCn1kyHSzBWLemoSGvOqLNhZyBjmCaAUYpMgt4Ck7wBBMMwWKWgjsUwTaGVsxWC1mYoKiyqqeGKYqonSIRQ3KIkHO0pmAxTdBHkbOvfllfr+AA+7gnc50huVKYK393FOyg7rbPO/izI7hE4CnHHHnJ0ogNPRUGeUpsrZZTBJcrovUcJe51BPsr6GkJdhCCsZ6aTtMEb2pqWkqeVtDXE/QVggsU/Nl86d9RMF3DxvZTA58agu810RWawCiSzzXBeU3MMW9oyJUedvNEvQyNu1f10BSMddR1vaLCYpYa/mGocLSiYDcLbQz8aMn5iyF4xBNMs1P0QEOV7o5gaWGuzSeLue4tt3ro7y4Tgm4G/mopdZgl6q0o6KzJWE3mMksNr3r+a6CbT8g5wZNzT9O7fi/zpaOmnz3BRoqos+tv9zMbdpxsqDBOEewtJLt7cg5wtKKbvldpSzRRCD43VFheCI7yZLppggMVBS/KMAdHODJvOwq2NQSbKKKPLdFWQs7Fqo+mpl01JXYRgq8dnGLhTiFzqmWsUMdpllZdbKlyvSdYxhI9YghOtxR8LgSLWHK62mGGVoxzBE8LNWzqH9CUesQzFy5RQzTc56mhi6fgXEWwpKfE5Z7M05ZgZUPmo6auiv8YKzDYwWBLMErIbKHJvOwIrvEdhOBcQ9JdU1NHQ7CXn2XIDFBKU2WAgcX9UAUzDXWd5alwuyJ41Z9rjKLCL4aCp4WarhPm2rH+SaHUYE001JDZ2ZAzXPjdMpZWvC9wmqIB2lLhQ01D5jO06hghWMndbM7yRJMsoCj1vYbnFQVrW9jak3OlEJ3s/96+p33dEPRV5GxiqaGjIthUU6FFEZyqCa5qJrpBdzSw95IUnOPIrCUUjRZQFrbw5PR0R1qiYx3cb6nrWUMrBmmiBQxVHtTew5ICP/ip6g4hed/Akob/32wvBHsIOX83cI8hGeNeNPCIkPmXe8fPKx84OMSRM1MTdXSwjCZ4S30jVGhvqTRak/OVhgGazHuOCud5onEO1lJr6ecVyaOK6H7zqlBlIaHE0oroCgfvGJIdPcmfLNGLjpz7hZwZQpUbFME0A1cIJa7VNORkgfsMBatbKgwwJM9bSvQXeNOvbIjelg6WWvo5kvbKaJJNHexkKNHL9xRyFlH8Ti2riB5wVPhUk7nGkJnoCe428LR/wRGdYIlmWebCyxou1rCk4g/ShugBDX0V0ZQWkh0dOVsagkM0yV6OoLd5ye+pRlsCr0n+KiQrGuq5yJDzrTAXHtLUMduTDBVKrSm3eHL+6ijxhFDX9Z5gVU/wliHYTMiMFpKLNMEywu80wd3meoFmt6VbRMPenhrOc6DVe4pgXU8DnnHakLOIIrlF4FZPIw6R+zxBP0dyq6OOZ4Q5sLKCcz084ok+VsMMyQhNZmmBgX5xIXOEJTmi7VsGTvMTNdHHhpzdbE8Du2oKxgvBqQKdDDnTFOylCFaxR1syz2iqrOI/FEpNc3C6f11/7+ASS6l2inq2ciTrCCzgyemrCL5SVPjQkdPZUmGy2c9Sw9FtR1sS30RmsKPCS4rkIC/2U0MduwucYolGaPjKEyhzmiPYXagyWbYz8LWBDdzRimAXzxx4z8K9hpzlhLq+NiQ97HuKorMUfK/OVvC2JfiHUPCQI/q7J2gjK+tTDNxkCc4TMssqCs4TGtLVwQihyoAWgj9bosU80XGW6Ac9TJGziaUh5+hnFcHOnlaM1iRn29NaqGENTTTSUHCH2tWTeV0osUhH6psuVLjRUmGWhm6OZEshGeNowABHcJ2Bpy2ZszRcKkRXd2QuKVEeXnbfaEq825FguqfgfE2whlChSRMdron+LATTPQ2Z369t4B9C5gs/ylzv+CMmepIDPclFQl13W0rspPd1JOcbghGOEutqCv5qacURQl3dDKyvyJlqKXGPgcM9FfawJAMVmdcspcYKOZc4GjDYkFlK05olNMHyHn4zFNykyOxt99RkHlfwmiHo60l2EKI+mhreEKp080Tbug08BVPcgoqC5zWt+NLDTZ7oNSF51N1qie7Va3uCCwyZbkINf/NED6jzOsBdZjFN8oqG3wxVunqCSYYKf3EdhJyf9YWGf7tRU2oH3VHgPr1fe5J9hOgHd7xQ0y7qBwXr23aGErP0cm64JVjZwsOGqL+mhNgZmhJLW2oY4UhedsyBgzrCKrq7BmcpNVhR6jBPq64Vgi+kn6XE68pp8J5/+0wRHGOpsKenQn9DZntPzjRLZpDAdD2fnSgkG9tmIXnUwQ6WVighs7Yi2MxQ0N3CqYaCXkJ0oyOztMDJjmSSpcpvlrk0RMMOjmArQ04PRV1DO1FwhCVaUVPpKUM03JK5SxPsIWRu8/CGHi8UHChiqGFDTbSRJWeYUDDcH6vJWUxR4k1FXbMUwV6e4AJFXS8oMqsZKqzvYQ9DDQdZckY4aGsIhtlubbd2r3j4QBMoTamdPZk7O/Bf62lacZwneNjQoGcdVU7zJOd7ghsUHOkosagic6cnWc8+4gg285R6zZP5s1/LUbCKIznTwK36PkdwlOrl4U1LwfdCCa+IrvFkmgw1PCAUXKWo0sURXWcI2muKJlgyFzhynCY4RBOsqCjoI1R5zREco0n2Vt09BQtYSizgKNHfUmUrQ5UOCh51BFcLmY7umhYqXKQomOop8bUnWNNQcIiBcYaC6xzMNOS8JQQfeqKBmmglB+97ok/lfk3ygaHSyZaCRTzRxQo6GzLfa2jWBPepw+UmT7SQEJyiyRkhBLMVOfcoMjcK0eZChfUNzFAUzCsEN5vP/X1uP/n/aoMX+K+nw/Hjr/9xOo7j7Pju61tLcgvJpTWXNbfN5jLpi6VfCOviTktKlFusQixdEKWmEBUKNaIpjZRSSOXSgzaaKLdabrm1/9nZ+/f+vd/vz/v9+Xy+zZ7PRorYoZqyLrCwQdEAixxVOEXNNnjX2nUSRlkqGmWowk8lxR50JPy9Bo6qJXaXwNvREBvnThPEPrewryLhcAnj5WE15Fqi8W7R1sAuEu86S4ENikItFN4xkv9Af4nXSnUVcLiA9xzesFpivRRVeFKtsMRaKBhuSbjOELnAUtlSQUpXgdfB4Z1oSbnFEetbQ0IrAe+Y+pqnDcEJFj6S8LDZzZHwY4e3XONNlARraomNEt2bkvGsosA3ioyHm+6jCMbI59wqt4eeara28IzEmyPgoRaUOEDhTVdEJhmCoTWfC0p8aNkCp0oYqih2iqGi4yXeMkOsn4LdLLnmKfh/YogjNsPebeFGR4m9BJHLzB61XQ3BtpISfS2FugsK9FAtLWX1dCRcrCnUp44CNzuCowUZmxSRgYaE6Za0W2u/E7CVXCiI/UOR8aAm1+OSyE3mOUcwyc1zBBeoX1kiKy0Zfxck1Gsyulti11i83QTBF5Kg3pDQThFMVHiPSlK+0cSedng/VaS8bOZbtsBcTcZAR8JP5KeqQ1OYKAi20njdNNRpgnsU//K+JnaXJaGTomr7aYIphoRn9aeShJWKEq9LcozSF7QleEfDI5LYm5bgVkFkRwVDBCVu0DDIkGupo8TZBq+/pMQURYErJQmPKGKjNDkWOLx7Jd5QizdUweIaKrlP7SwJDhZvONjLkOsBBX9UpGxnydhXkfBLQ8IxgojQbLFnJf81JytSljclYYyEFyx0kVBvKWOFJmONpshGAcsduQY5giVNCV51eOdJYo/pLhbvM0uDHSevNKRcrKZIqnCtJeEsO95RoqcgGK4ocZcho1tTYtcZvH41pNQ7vA0WrhIfOSraIIntIAi+NXWCErdbkvrWwjRLrt0NKUdL6KSOscTOdMSOUtBHwL6OLA0vNSdynaWQEnCpIvKaIrJJEbvHkmuNhn6OjM8VkSGSqn1uYJCGHnq9I3aLhNME3t6GjIkO7xrNFumpyTNX/NrwX7CrIRiqqWijI9JO4d1iieykyfiposQIQ8YjjsjlBh6oHWbwRjgYJQn2NgSnNycmJAk3NiXhx44Sxykihxm8ybUwT1OVKySc7vi3OXVkdBJ4AyXBeksDXG0IhgtYY0lY5ahCD0ehborIk5aUWRJviMA7Xt5kyRjonrXENkm8yYqgs8VzgrJmClK20uMM3jRJ0FiQICQF9hdETlLQWRIb5ki6WDfWRPobvO6a4GP5mcOrNzDFELtTkONLh9dXE8xypEg7z8A9jkhrQ6Fhjlg/QVktJXxt4WXzT/03Q8IaQWSqIuEvloQ2mqC9Jfi7wRul4RX3pSPlzpoVlmCtI2jvKHCFhjcM3sN6lqF6HxnKelLjXWbwrpR4xzuCrTUZx2qq9oAh8p6ixCUGr78g8oyjRAtB5CZFwi80VerVpI0h+IeBxa6Zg6kWvpDHaioYYuEsRbDC3eOmC2JvGYLeioxGknL2UATNJN6hmtj1DlpLvDVmocYbrGCVJKOrg4X6DgddLA203BKMFngdJJFtFd7vJLm6KEpc5yjQrkk7M80SGe34X24nSex1Ra5Omgb71JKyg8SrU3i/kARKwWpH0kOGhKkObyfd0ZGjvyXlAkVZ4xRbYJ2irFMkFY1SwyWxr2oo4zlNiV+7zmaweFpT4kR3kaDAFW6xpSqzJay05FtYR4HmZhc9UxKbbfF2V8RG1MBmSaE+kmC6JnaRXK9gsiXhJHl/U0qM0WTcbyhwkYIvFGwjSbjfwhiJt8ZSQU+Bd5+marPMOkVkD0muxYLIfEuhh60x/J92itguihJSEMySVPQnTewnEm+620rTQEMsOfo4/kP/0ARvWjitlpSX7GxBgcMEsd3EEeYWvdytd+Saawi6aCIj1CkGb6Aj9rwhx16Cf3vAwFy5pyLhVonXzy51FDpdEblbkdJbUcEPDEFzQ8qNmhzzLTmmKWKbFCXeEuRabp6rxbvAtLF442QjQ+wEA9eL1xSR7Q0JXzlSHjJ4exq89yR0laScJ/FW6z4a73pFMEfDiRZvuvijIt86RaSFOl01riV2mD1UEvxGk/Geg5aWwGki1zgKPG9J2U8PEg8qYvMsZeytiTRXBMslCU8JSlxi8EabjwUldlDNLfzTUmCgxWsjqWCOHavYAqsknKFIO0yQ61VL5AVFxk6WhEaCAkdJgt9aSkzXlKNX2jEa79waYuc7gq0N3GDJGCBhoiTXUEPsdknCUE1CK0fwsiaylSF2uiDyO4XX3pFhNd7R4itFGc0k/ElBZwWvq+GC6szVeEoS/MZ+qylwpKNKv9Z469UOjqCjwlusicyTxG6VpNxcQ8IncoR4RhLbR+NdpGGmJWOcIzJGUuKPGpQg8rrG21dOMqQssJQ4RxH5jaUqnZuQ0F4Q+cjxLwPtpZbIAk3QTJHQWBE5S1BokoVtDd6lhqr9UpHSUxMcIYl9pojsb8h4SBOsMQcqvOWC2E8EVehqiJ1hrrAEbQxeK0NGZ0Gkq+guSRgniM23bIHVkqwx4hiHd7smaOyglyIyQuM978j4VS08J/A2G1KeMBRo4fBaSNhKUEZfQewVQ/C1I+MgfbEleEzCUw7mKXI0M3hd1EESVji8x5uQ41nxs1q4RMJCCXs7Iq9acpxn22oSDnQ/sJTxsCbHIYZiLyhY05TY0ZLIOQrGaSJDDN4t8pVaIrsqqFdEegtizc1iTew5Q4ayBDMUsQMkXocaYkc0hZua412siZ1rSXlR460zRJ5SlHGe5j801RLMlJTxtaOM3Q1pvxJ45zUlWFD7rsAbpfEm1JHxG0eh8w2R7QQVzBUw28FhFp5QZzq8t2rx2joqulYTWSuJdTYfWwqMFMcovFmSyJPNyLhE4E10pHzYjOC3huArRa571ZsGajQpQx38SBP5pyZB6lMU3khDnp0MBV51BE9o2E+TY5Ml2E8S7C0o6w1xvCZjf0HkVEHCzFoyNmqC+9wdcqN+Tp7jSDheE9ws8Y5V0NJCn2bk2tqSY4okdrEhx1iDN8cSudwepWmAGXKcJXK65H9to8jYQRH7SBF01ESUJdd0TayVInaWhLkOjlXE5irKGOnI6GSWGCJa482zBI9rCr0jyTVcEuzriC1vcr6mwFGSiqy5zMwxBH/TJHwjSPhL8+01kaaSUuMFKTcLEvaUePcrSmwn8DZrgikWb7CGPxkSjhQwrRk57tctmxLsb9sZvL9LSlyuSLlWkqOjwduo8b6Uv1DkmudIeFF2dHCgxVtk8dpIvHpBxhEOdhKk7OLIUSdJ+cSRY57B+0DgGUUlNfpthTfGkauzxrvTsUUaCVhlKeteTXCoJDCa2NOKhOmC4G1H8JBd4OBZReSRGkqcb/CO1PyLJTLB4j1q8JYaIutEjSLX8YKM+a6phdMsdLFUoV5RTm9JSkuDN8WcIon0NZMNZWh1q8C7SJEwV5HxrmnnTrf3KoJBlmCYI2ilSLlfEvlE4011NNgjgthzEua0oKK7JLE7HZHlEl60BLMVFewg4EWNt0ThrVNEVkkiTwpKXSWJzdRENgvKGq4IhjsiezgSFtsfCUq8qki5S1LRQeYQQ4nemmCkImWMw3tFUoUBZk4NOeZYEp4XRKTGa6wJjrWNHBVJR4m3FCnbuD6aak2WsMTh3SZImGCIPKNgsDpVwnsa70K31lCFJZYcwwSMFcQulGTsZuEaSdBXkPGZhu0FsdUO73RHjq8MPGGIfaGIbVTk6iuI3GFgucHrIQkmWSJdBd7BBu+uOryWAhY7+Lki9rK5wtEQzWwvtbqGhIMFwWRJsElsY4m9IIg9L6lCX0VklaPAYkfkZEGDnOWowlBJjtMUkcGK4Lg6EtoZInMUBVYLgn0UsdmCyCz7gIGHFfk+k1QwTh5We7A9x+IdJ6CvIkEagms0hR50eH9UnTQJ+2oiKyVlLFUE+8gBGu8MQ3CppUHesnjTHN4QB/UGPhCTHLFPHMFrCqa73gqObUJGa03wgbhHkrCfpEpzNLE7JDS25FMKhlhKKWKfCgqstLCPu1zBXy0J2ztwjtixBu8UTRn9LVtkmCN2iyFhtME70JHRQ1KVZXqKI/KNIKYMCYs1GUMEKbM1bKOI9LDXC7zbHS+bt+1MTWS9odA9DtrYtpbImQJ2VHh/lisEwaHqUk1kjKTAKknkBEXkbkdMGwq0dnhzLJF3NJH3JVwrqOB4Sca2hti75nmJN0WzxS6UxDYoEpxpa4htVlRjkYE7DZGzJVU72uC9IyhQL4i8YfGWSYLLNcHXloyz7QhNifmKSE9JgfGmuyLhc403Xm9vqcp6gXe3xuuv8F6VJNxkyTHEkHG2g0aKXL0MsXc1bGfgas2//dCONXiNLCX+5mB7eZIl1kHh7ajwpikyzlUUWOVOsjSQlsS+M0R+pPje/dzBXRZGO0rMtgQrLLG9VSu9n6CMXS3BhwYmSoIBhsjNBmZbgusE9BCPCP5triU4VhNbJfE+swSP27aayE8tuTpYYjtrYjMVGZdp2NpS1s6aBnKSHDsbKuplKbHM4a0wMFd/5/DmGyKrJSUaW4IBrqUhx0vyfzTBBLPIUcnZdrAkNsKR0sWRspumSns6Ch0v/qqIbBYUWKvPU/CFoyrDJGwSNFhbA/MlzKqjrO80hRbpKx0Jewsi/STftwGSlKc1JZyAzx05dhLEdnfQvhZOqiHWWEAHC7+30FuRcZUgaO5gpaIK+xsiHRUsqaPElTV40xQZQ107Q9BZE1nryDVGU9ZSQ47bmhBpLcYpUt7S+xuK/FiT8qKjwXYw5ypS2iuCv7q1gtgjhuBuB8LCFY5cUuCNtsQOFcT+4Ih9JX+k8Ea6v0iCIRZOtCT0Et00JW5UeC85Cg0ScK0k411HcG1zKtre3SeITBRk7WfwDhEvaYLTHP9le0m8By0JDwn4TlLW/aJOvGHxdjYUes+ScZigCkYQdNdEOhkiezgShqkx8ueKjI8lDfK2oNiOFvrZH1hS+tk7NV7nOmLHicGWEgubkXKdwdtZknCLJXaCpkrjZBtLZFsDP9CdxWsSr05Sxl6CMmoFbCOgryX40uDtamB7SVmXW4Ihlgpmq+00tBKUUa83WbjLUNkzDmY7cow1JDygyPGlhgGKYKz4vcV7QBNbJIgM11TUqZaMdwTeSguH6rOaw1JRKzaaGyxVm2EJ/uCIrVWUcZUkcp2grMsEjK+DMwS59jQk3Kd6SEq1d0S6uVmO4Bc1lDXTUcHjluCXEq+1OlBDj1pi9zgiXxnKuE0SqTXwhqbETW6RggMEnGl/q49UT2iCzgJvRwVXS2K/d6+ZkyUl7jawSVLit46EwxVljDZwoSQ20sDBihztHfk2yA8NVZghiXwrYHQdfKAOtzsayjhY9bY0yE2CWEeJ9xfzO423xhL5syS2TFJofO2pboHob0nY4GiAgRrvGQEDa/FWSsoaaYl0syRsEt3kWoH3B01shCXhTUWe9w3Bt44SC9QCh3eShQctwbaK2ApLroGCMlZrYqvlY3qYhM0aXpFkPOuoqJ3Dm6fxXrGwVF9gCWZagjPqznfkuMKQ8DPTQRO8ZqG1hPGKEm9IgpGW4DZDgTNriTxvFiq+Lz+0cKfp4wj6OCK9JSnzNSn9LFU7UhKZZMnYwcJ8s8yRsECScK4j5UOB95HFO0CzhY4xJxuCix0lDlEUeMdS6EZBkTsUkZ4K74dugyTXS7aNgL8aqjDfkCE0ZbwkCXpaWCKhl8P7VD5jxykivSyxyZrYERbe168LYu9ZYh86IkscgVLE7tWPKmJv11CgoyJltMEbrohtVAQfO4ImltiHEroYEs7RxAarVpY8AwXMcMReFOTYWe5iiLRQxJ5Q8DtJ8LQhWOhIeFESPGsILhbNDRljNbHzNRlTFbk2S3L0NOS6V1KFJYKUbSTcIIhM0wQ/s2TM0SRMNcQmSap3jCH4yhJZKSkwyRHpYYgsFeQ4U7xoCB7VVOExhXepo9ABBsYbvGWKXPME3lyH95YioZ0gssQRWWbI+FaSMkXijZXwgiTlYdPdkNLaETxlyDVIwqeaEus0aTcYcg0RVOkpR3CSJqIddK+90JCxzsDVloyrFd5ZAr4TBKfaWa6boEA7C7s6EpYaeFPjveooY72mjIccLHJ9HUwVlDhKkmutJDJBwnp1rvulJZggKDRfbXAkvC/4l3ozQOG9a8lxjx0i7nV4jSXc7vhe3OwIxjgSHjdEhhsif9YkPGlus3iLFDnWOFhtCZbJg0UbQcIaR67JjthoCyMEZRwhiXWyxO5QxI6w5NhT4U1WsJvDO60J34fW9hwzwlKij6ZAW9ne4L0s8C6XeBMEkd/LQy1VucBRot6QMlbivaBhoBgjqGiCJNhsqVp/S2SsG6DIONCR0dXhvWbJ+MRRZJkkuEjgDXJjFQW6SSL7GXK8Z2CZg7cVsbWGoKmEpzQ5elpiy8Ryg7dMkLLUEauzeO86CuwlSOlgYLojZWeJ9xM3S1PWfEfKl5ISLQ0MEKR8YOB2QfCxJBjrKPCN4f9MkaSsqoVXJBmP7EpFZ9UQfOoOFwSzBN4MQ8LsGrymlipcJQhmy0GaQjPqCHaXRwuCZwRbqK2Fg9wlClZqYicrIgMdZfxTQ0c7TBIbrChxmuzoKG8XRaSrIhhiyNFJkrC7oIAWMEOQa5aBekPCRknCo4IKPrYkvCDI8aYmY7WFtprgekcJZ3oLIqssCSMtFbQTJKwXYy3BY5oCh2iKPCpJOE+zRdpYgi6O2KmOAgvVCYaU4ySRek1sgyFhJ403QFHiVEmJHwtybO1gs8Hr5+BETQX3War0qZngYGgtVZtoqd6vFSk/UwdZElYqyjrF4HXUeFspIi9IGKf4j92pKGAdCYMVsbcV3kRF0N+R8LUd5PCsIGWoxDtBkCI0nKofdJQxT+LtZflvuc8Q3CjwWkq8KwUpHzkK/NmSsclCL0nseQdj5FRH5CNHSgtLiW80Of5HU9Hhlsga9bnBq3fEVltKfO5IaSTmGjjc4J0otcP7QsJUSQM8pEj5/wCuUuC2DWz8AAAAAElFTkSuQmCC\");}.ace-ambiance .ace_indent-guide {background: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNQUFD4z6Crq/sfAAuYAuYl+7lfAAAAAElFTkSuQmCC\") right repeat-y;}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}); (function() { window.require(["ace/theme/ambiance"], function(m) { if (typeof module == "object" && typeof exports == "object" && module) { module.exports = m; } }); })(); ================================================ FILE: pyp5js/http_local/static/js/ace/theme-chaos.js ================================================ define("ace/theme/chaos",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!0,t.cssClass="ace-chaos",t.cssText=".ace-chaos .ace_gutter {background: #141414;color: #595959;border-right: 1px solid #282828;}.ace-chaos .ace_gutter-cell.ace_warning {background-image: none;background: #FC0;border-left: none;padding-left: 0;color: #000;}.ace-chaos .ace_gutter-cell.ace_error {background-position: -6px center;background-image: none;background: #F10;border-left: none;padding-left: 0;color: #000;}.ace-chaos .ace_print-margin {border-left: 1px solid #555;right: 0;background: #1D1D1D;}.ace-chaos {background-color: #161616;color: #E6E1DC;}.ace-chaos .ace_cursor {border-left: 2px solid #FFFFFF;}.ace-chaos .ace_cursor.ace_overwrite {border-left: 0px;border-bottom: 1px solid #FFFFFF;}.ace-chaos .ace_marker-layer .ace_selection {background: #494836;}.ace-chaos .ace_marker-layer .ace_step {background: rgb(198, 219, 174);}.ace-chaos .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid #FCE94F;}.ace-chaos .ace_marker-layer .ace_active-line {background: #333;}.ace-chaos .ace_gutter-active-line {background-color: #222;}.ace-chaos .ace_invisible {color: #404040;}.ace-chaos .ace_keyword {color:#00698F;}.ace-chaos .ace_keyword.ace_operator {color:#FF308F;}.ace-chaos .ace_constant {color:#1EDAFB;}.ace-chaos .ace_constant.ace_language {color:#FDC251;}.ace-chaos .ace_constant.ace_library {color:#8DFF0A;}.ace-chaos .ace_constant.ace_numeric {color:#58C554;}.ace-chaos .ace_invalid {color:#FFFFFF;background-color:#990000;}.ace-chaos .ace_invalid.ace_deprecated {color:#FFFFFF;background-color:#990000;}.ace-chaos .ace_support {color: #999;}.ace-chaos .ace_support.ace_function {color:#00AEEF;}.ace-chaos .ace_function {color:#00AEEF;}.ace-chaos .ace_string {color:#58C554;}.ace-chaos .ace_comment {color:#555;font-style:italic;padding-bottom: 0px;}.ace-chaos .ace_variable {color:#997744;}.ace-chaos .ace_meta.ace_tag {color:#BE53E6;}.ace-chaos .ace_entity.ace_other.ace_attribute-name {color:#FFFF89;}.ace-chaos .ace_markup.ace_underline {text-decoration: underline;}.ace-chaos .ace_fold-widget {text-align: center;}.ace-chaos .ace_fold-widget:hover {color: #777;}.ace-chaos .ace_fold-widget.ace_start,.ace-chaos .ace_fold-widget.ace_end,.ace-chaos .ace_fold-widget.ace_closed{background: none !important;border: none;box-shadow: none;}.ace-chaos .ace_fold-widget.ace_start:after {content: '\u25be'}.ace-chaos .ace_fold-widget.ace_end:after {content: '\u25b4'}.ace-chaos .ace_fold-widget.ace_closed:after {content: '\u2023'}.ace-chaos .ace_indent-guide {border-right:1px dotted #333;margin-right:-1px;}.ace-chaos .ace_fold { background: #222; border-radius: 3px; color: #7AF; border: none; }.ace-chaos .ace_fold:hover {background: #CCC; color: #000;}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}); (function() { window.require(["ace/theme/chaos"], function(m) { if (typeof module == "object" && typeof exports == "object" && module) { module.exports = m; } }); })(); ================================================ FILE: pyp5js/http_local/static/js/ace/theme-chrome.js ================================================ define("ace/theme/chrome",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!1,t.cssClass="ace-chrome",t.cssText='.ace-chrome .ace_gutter {background: #ebebeb;color: #333;overflow : hidden;}.ace-chrome .ace_print-margin {width: 1px;background: #e8e8e8;}.ace-chrome {background-color: #FFFFFF;color: black;}.ace-chrome .ace_cursor {color: black;}.ace-chrome .ace_invisible {color: rgb(191, 191, 191);}.ace-chrome .ace_constant.ace_buildin {color: rgb(88, 72, 246);}.ace-chrome .ace_constant.ace_language {color: rgb(88, 92, 246);}.ace-chrome .ace_constant.ace_library {color: rgb(6, 150, 14);}.ace-chrome .ace_invalid {background-color: rgb(153, 0, 0);color: white;}.ace-chrome .ace_fold {}.ace-chrome .ace_support.ace_function {color: rgb(60, 76, 114);}.ace-chrome .ace_support.ace_constant {color: rgb(6, 150, 14);}.ace-chrome .ace_support.ace_type,.ace-chrome .ace_support.ace_class.ace-chrome .ace_support.ace_other {color: rgb(109, 121, 222);}.ace-chrome .ace_variable.ace_parameter {font-style:italic;color:#FD971F;}.ace-chrome .ace_keyword.ace_operator {color: rgb(104, 118, 135);}.ace-chrome .ace_comment {color: #236e24;}.ace-chrome .ace_comment.ace_doc {color: #236e24;}.ace-chrome .ace_comment.ace_doc.ace_tag {color: #236e24;}.ace-chrome .ace_constant.ace_numeric {color: rgb(0, 0, 205);}.ace-chrome .ace_variable {color: rgb(49, 132, 149);}.ace-chrome .ace_xml-pe {color: rgb(104, 104, 91);}.ace-chrome .ace_entity.ace_name.ace_function {color: #0000A2;}.ace-chrome .ace_heading {color: rgb(12, 7, 255);}.ace-chrome .ace_list {color:rgb(185, 6, 144);}.ace-chrome .ace_marker-layer .ace_selection {background: rgb(181, 213, 255);}.ace-chrome .ace_marker-layer .ace_step {background: rgb(252, 255, 0);}.ace-chrome .ace_marker-layer .ace_stack {background: rgb(164, 229, 101);}.ace-chrome .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgb(192, 192, 192);}.ace-chrome .ace_marker-layer .ace_active-line {background: rgba(0, 0, 0, 0.07);}.ace-chrome .ace_gutter-active-line {background-color : #dcdcdc;}.ace-chrome .ace_marker-layer .ace_selected-word {background: rgb(250, 250, 255);border: 1px solid rgb(200, 200, 250);}.ace-chrome .ace_storage,.ace-chrome .ace_keyword,.ace-chrome .ace_meta.ace_tag {color: rgb(147, 15, 128);}.ace-chrome .ace_string.ace_regex {color: rgb(255, 0, 0)}.ace-chrome .ace_string {color: #1A1AA6;}.ace-chrome .ace_entity.ace_other.ace_attribute-name {color: #994409;}.ace-chrome .ace_indent-guide {background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y;}';var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}); (function() { window.require(["ace/theme/chrome"], function(m) { if (typeof module == "object" && typeof exports == "object" && module) { module.exports = m; } }); })(); ================================================ FILE: pyp5js/http_local/static/js/ace/theme-clouds.js ================================================ define("ace/theme/clouds",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!1,t.cssClass="ace-clouds",t.cssText='.ace-clouds .ace_gutter {background: #ebebeb;color: #333}.ace-clouds .ace_print-margin {width: 1px;background: #e8e8e8}.ace-clouds {background-color: #FFFFFF;color: #000000}.ace-clouds .ace_cursor {color: #000000}.ace-clouds .ace_marker-layer .ace_selection {background: #BDD5FC}.ace-clouds.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #FFFFFF;}.ace-clouds .ace_marker-layer .ace_step {background: rgb(255, 255, 0)}.ace-clouds .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid #BFBFBF}.ace-clouds .ace_marker-layer .ace_active-line {background: #FFFBD1}.ace-clouds .ace_gutter-active-line {background-color : #dcdcdc}.ace-clouds .ace_marker-layer .ace_selected-word {border: 1px solid #BDD5FC}.ace-clouds .ace_invisible {color: #BFBFBF}.ace-clouds .ace_keyword,.ace-clouds .ace_meta,.ace-clouds .ace_support.ace_constant.ace_property-value {color: #AF956F}.ace-clouds .ace_keyword.ace_operator {color: #484848}.ace-clouds .ace_keyword.ace_other.ace_unit {color: #96DC5F}.ace-clouds .ace_constant.ace_language {color: #39946A}.ace-clouds .ace_constant.ace_numeric {color: #46A609}.ace-clouds .ace_constant.ace_character.ace_entity {color: #BF78CC}.ace-clouds .ace_invalid {background-color: #FF002A}.ace-clouds .ace_fold {background-color: #AF956F;border-color: #000000}.ace-clouds .ace_storage,.ace-clouds .ace_support.ace_class,.ace-clouds .ace_support.ace_function,.ace-clouds .ace_support.ace_other,.ace-clouds .ace_support.ace_type {color: #C52727}.ace-clouds .ace_string {color: #5D90CD}.ace-clouds .ace_comment {color: #BCC8BA}.ace-clouds .ace_entity.ace_name.ace_tag,.ace-clouds .ace_entity.ace_other.ace_attribute-name {color: #606060}.ace-clouds .ace_indent-guide {background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y}';var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}); (function() { window.require(["ace/theme/clouds"], function(m) { if (typeof module == "object" && typeof exports == "object" && module) { module.exports = m; } }); })(); ================================================ FILE: pyp5js/http_local/static/js/ace/theme-clouds_midnight.js ================================================ define("ace/theme/clouds_midnight",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!0,t.cssClass="ace-clouds-midnight",t.cssText=".ace-clouds-midnight .ace_gutter {background: #232323;color: #929292}.ace-clouds-midnight .ace_print-margin {width: 1px;background: #232323}.ace-clouds-midnight {background-color: #191919;color: #929292}.ace-clouds-midnight .ace_cursor {color: #7DA5DC}.ace-clouds-midnight .ace_marker-layer .ace_selection {background: #000000}.ace-clouds-midnight.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #191919;}.ace-clouds-midnight .ace_marker-layer .ace_step {background: rgb(102, 82, 0)}.ace-clouds-midnight .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid #BFBFBF}.ace-clouds-midnight .ace_marker-layer .ace_active-line {background: rgba(215, 215, 215, 0.031)}.ace-clouds-midnight .ace_gutter-active-line {background-color: rgba(215, 215, 215, 0.031)}.ace-clouds-midnight .ace_marker-layer .ace_selected-word {border: 1px solid #000000}.ace-clouds-midnight .ace_invisible {color: #666}.ace-clouds-midnight .ace_keyword,.ace-clouds-midnight .ace_meta,.ace-clouds-midnight .ace_support.ace_constant.ace_property-value {color: #927C5D}.ace-clouds-midnight .ace_keyword.ace_operator {color: #4B4B4B}.ace-clouds-midnight .ace_keyword.ace_other.ace_unit {color: #366F1A}.ace-clouds-midnight .ace_constant.ace_language {color: #39946A}.ace-clouds-midnight .ace_constant.ace_numeric {color: #46A609}.ace-clouds-midnight .ace_constant.ace_character.ace_entity {color: #A165AC}.ace-clouds-midnight .ace_invalid {color: #FFFFFF;background-color: #E92E2E}.ace-clouds-midnight .ace_fold {background-color: #927C5D;border-color: #929292}.ace-clouds-midnight .ace_storage,.ace-clouds-midnight .ace_support.ace_class,.ace-clouds-midnight .ace_support.ace_function,.ace-clouds-midnight .ace_support.ace_other,.ace-clouds-midnight .ace_support.ace_type {color: #E92E2E}.ace-clouds-midnight .ace_string {color: #5D90CD}.ace-clouds-midnight .ace_comment {color: #3C403B}.ace-clouds-midnight .ace_entity.ace_name.ace_tag,.ace-clouds-midnight .ace_entity.ace_other.ace_attribute-name {color: #606060}.ace-clouds-midnight .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGBgYHB3d/8PAAOIAdULw8qMAAAAAElFTkSuQmCC) right repeat-y}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}); (function() { window.require(["ace/theme/clouds_midnight"], function(m) { if (typeof module == "object" && typeof exports == "object" && module) { module.exports = m; } }); })(); ================================================ FILE: pyp5js/http_local/static/js/ace/theme-cobalt.js ================================================ define("ace/theme/cobalt",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!0,t.cssClass="ace-cobalt",t.cssText=".ace-cobalt .ace_gutter {background: #011e3a;color: rgb(128,145,160)}.ace-cobalt .ace_print-margin {width: 1px;background: #555555}.ace-cobalt {background-color: #002240;color: #FFFFFF}.ace-cobalt .ace_cursor {color: #FFFFFF}.ace-cobalt .ace_marker-layer .ace_selection {background: rgba(179, 101, 57, 0.75)}.ace-cobalt.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #002240;}.ace-cobalt .ace_marker-layer .ace_step {background: rgb(127, 111, 19)}.ace-cobalt .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgba(255, 255, 255, 0.15)}.ace-cobalt .ace_marker-layer .ace_active-line {background: rgba(0, 0, 0, 0.35)}.ace-cobalt .ace_gutter-active-line {background-color: rgba(0, 0, 0, 0.35)}.ace-cobalt .ace_marker-layer .ace_selected-word {border: 1px solid rgba(179, 101, 57, 0.75)}.ace-cobalt .ace_invisible {color: rgba(255, 255, 255, 0.15)}.ace-cobalt .ace_keyword,.ace-cobalt .ace_meta {color: #FF9D00}.ace-cobalt .ace_constant,.ace-cobalt .ace_constant.ace_character,.ace-cobalt .ace_constant.ace_character.ace_escape,.ace-cobalt .ace_constant.ace_other {color: #FF628C}.ace-cobalt .ace_invalid {color: #F8F8F8;background-color: #800F00}.ace-cobalt .ace_support {color: #80FFBB}.ace-cobalt .ace_support.ace_constant {color: #EB939A}.ace-cobalt .ace_fold {background-color: #FF9D00;border-color: #FFFFFF}.ace-cobalt .ace_support.ace_function {color: #FFB054}.ace-cobalt .ace_storage {color: #FFEE80}.ace-cobalt .ace_entity {color: #FFDD00}.ace-cobalt .ace_string {color: #3AD900}.ace-cobalt .ace_string.ace_regexp {color: #80FFC2}.ace-cobalt .ace_comment {font-style: italic;color: #0088FF}.ace-cobalt .ace_heading,.ace-cobalt .ace_markup.ace_heading {color: #C8E4FD;background-color: #001221}.ace-cobalt .ace_list,.ace-cobalt .ace_markup.ace_list {background-color: #130D26}.ace-cobalt .ace_variable {color: #CCCCCC}.ace-cobalt .ace_variable.ace_language {color: #FF80E1}.ace-cobalt .ace_meta.ace_tag {color: #9EFFFF}.ace-cobalt .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGBgYHCLSvkPAAP3AgSDTRd4AAAAAElFTkSuQmCC) right repeat-y}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}); (function() { window.require(["ace/theme/cobalt"], function(m) { if (typeof module == "object" && typeof exports == "object" && module) { module.exports = m; } }); })(); ================================================ FILE: pyp5js/http_local/static/js/ace/theme-crimson_editor.js ================================================ define("ace/theme/crimson_editor",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!1,t.cssText='.ace-crimson-editor .ace_gutter {background: #ebebeb;color: #333;overflow : hidden;}.ace-crimson-editor .ace_gutter-layer {width: 100%;text-align: right;}.ace-crimson-editor .ace_print-margin {width: 1px;background: #e8e8e8;}.ace-crimson-editor {background-color: #FFFFFF;color: rgb(64, 64, 64);}.ace-crimson-editor .ace_cursor {color: black;}.ace-crimson-editor .ace_invisible {color: rgb(191, 191, 191);}.ace-crimson-editor .ace_identifier {color: black;}.ace-crimson-editor .ace_keyword {color: blue;}.ace-crimson-editor .ace_constant.ace_buildin {color: rgb(88, 72, 246);}.ace-crimson-editor .ace_constant.ace_language {color: rgb(255, 156, 0);}.ace-crimson-editor .ace_constant.ace_library {color: rgb(6, 150, 14);}.ace-crimson-editor .ace_invalid {text-decoration: line-through;color: rgb(224, 0, 0);}.ace-crimson-editor .ace_fold {}.ace-crimson-editor .ace_support.ace_function {color: rgb(192, 0, 0);}.ace-crimson-editor .ace_support.ace_constant {color: rgb(6, 150, 14);}.ace-crimson-editor .ace_support.ace_type,.ace-crimson-editor .ace_support.ace_class {color: rgb(109, 121, 222);}.ace-crimson-editor .ace_keyword.ace_operator {color: rgb(49, 132, 149);}.ace-crimson-editor .ace_string {color: rgb(128, 0, 128);}.ace-crimson-editor .ace_comment {color: rgb(76, 136, 107);}.ace-crimson-editor .ace_comment.ace_doc {color: rgb(0, 102, 255);}.ace-crimson-editor .ace_comment.ace_doc.ace_tag {color: rgb(128, 159, 191);}.ace-crimson-editor .ace_constant.ace_numeric {color: rgb(0, 0, 64);}.ace-crimson-editor .ace_variable {color: rgb(0, 64, 128);}.ace-crimson-editor .ace_xml-pe {color: rgb(104, 104, 91);}.ace-crimson-editor .ace_marker-layer .ace_selection {background: rgb(181, 213, 255);}.ace-crimson-editor .ace_marker-layer .ace_step {background: rgb(252, 255, 0);}.ace-crimson-editor .ace_marker-layer .ace_stack {background: rgb(164, 229, 101);}.ace-crimson-editor .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgb(192, 192, 192);}.ace-crimson-editor .ace_marker-layer .ace_active-line {background: rgb(232, 242, 254);}.ace-crimson-editor .ace_gutter-active-line {background-color : #dcdcdc;}.ace-crimson-editor .ace_meta.ace_tag {color:rgb(28, 2, 255);}.ace-crimson-editor .ace_marker-layer .ace_selected-word {background: rgb(250, 250, 255);border: 1px solid rgb(200, 200, 250);}.ace-crimson-editor .ace_string.ace_regex {color: rgb(192, 0, 192);}.ace-crimson-editor .ace_indent-guide {background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y;}',t.cssClass="ace-crimson-editor";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}); (function() { window.require(["ace/theme/crimson_editor"], function(m) { if (typeof module == "object" && typeof exports == "object" && module) { module.exports = m; } }); })(); ================================================ FILE: pyp5js/http_local/static/js/ace/theme-dawn.js ================================================ define("ace/theme/dawn",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!1,t.cssClass="ace-dawn",t.cssText=".ace-dawn .ace_gutter {background: #ebebeb;color: #333}.ace-dawn .ace_print-margin {width: 1px;background: #e8e8e8}.ace-dawn {background-color: #F9F9F9;color: #080808}.ace-dawn .ace_cursor {color: #000000}.ace-dawn .ace_marker-layer .ace_selection {background: rgba(39, 95, 255, 0.30)}.ace-dawn.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #F9F9F9;}.ace-dawn .ace_marker-layer .ace_step {background: rgb(255, 255, 0)}.ace-dawn .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgba(75, 75, 126, 0.50)}.ace-dawn .ace_marker-layer .ace_active-line {background: rgba(36, 99, 180, 0.12)}.ace-dawn .ace_gutter-active-line {background-color : #dcdcdc}.ace-dawn .ace_marker-layer .ace_selected-word {border: 1px solid rgba(39, 95, 255, 0.30)}.ace-dawn .ace_invisible {color: rgba(75, 75, 126, 0.50)}.ace-dawn .ace_keyword,.ace-dawn .ace_meta {color: #794938}.ace-dawn .ace_constant,.ace-dawn .ace_constant.ace_character,.ace-dawn .ace_constant.ace_character.ace_escape,.ace-dawn .ace_constant.ace_other {color: #811F24}.ace-dawn .ace_invalid.ace_illegal {text-decoration: underline;font-style: italic;color: #F8F8F8;background-color: #B52A1D}.ace-dawn .ace_invalid.ace_deprecated {text-decoration: underline;font-style: italic;color: #B52A1D}.ace-dawn .ace_support {color: #691C97}.ace-dawn .ace_support.ace_constant {color: #B4371F}.ace-dawn .ace_fold {background-color: #794938;border-color: #080808}.ace-dawn .ace_list,.ace-dawn .ace_markup.ace_list,.ace-dawn .ace_support.ace_function {color: #693A17}.ace-dawn .ace_storage {font-style: italic;color: #A71D5D}.ace-dawn .ace_string {color: #0B6125}.ace-dawn .ace_string.ace_regexp {color: #CF5628}.ace-dawn .ace_comment {font-style: italic;color: #5A525F}.ace-dawn .ace_heading,.ace-dawn .ace_markup.ace_heading {color: #19356D}.ace-dawn .ace_variable {color: #234A97}.ace-dawn .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGBgYLh/5+x/AAizA4hxNNsZAAAAAElFTkSuQmCC) right repeat-y}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}); (function() { window.require(["ace/theme/dawn"], function(m) { if (typeof module == "object" && typeof exports == "object" && module) { module.exports = m; } }); })(); ================================================ FILE: pyp5js/http_local/static/js/ace/theme-dracula.js ================================================ define("ace/theme/dracula",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!0,t.cssClass="ace-dracula",t.cssText=".ace-dracula .ace_gutter {background: #282a36;color: rgb(144,145,148)}.ace-dracula .ace_print-margin {width: 1px;background: #44475a}.ace-dracula {background-color: #282a36;color: #f8f8f2}.ace-dracula .ace_cursor {color: #f8f8f0}.ace-dracula .ace_marker-layer .ace_selection {background: #44475a}.ace-dracula.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #282a36;border-radius: 2px}.ace-dracula .ace_marker-layer .ace_step {background: rgb(198, 219, 174)}.ace-dracula .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid #a29709}.ace-dracula .ace_marker-layer .ace_active-line {background: #44475a}.ace-dracula .ace_gutter-active-line {background-color: #44475a}.ace-dracula .ace_marker-layer .ace_selected-word {box-shadow: 0px 0px 0px 1px #a29709;border-radius: 3px;}.ace-dracula .ace_fold {background-color: #50fa7b;border-color: #f8f8f2}.ace-dracula .ace_keyword {color: #ff79c6}.ace-dracula .ace_constant.ace_language {color: #bd93f9}.ace-dracula .ace_constant.ace_numeric {color: #bd93f9}.ace-dracula .ace_constant.ace_character {color: #bd93f9}.ace-dracula .ace_constant.ace_character.ace_escape {color: #ff79c6}.ace-dracula .ace_constant.ace_other {color: #bd93f9}.ace-dracula .ace_support.ace_function {color: #8be9fd}.ace-dracula .ace_support.ace_constant {color: #6be5fd}.ace-dracula .ace_support.ace_class {font-style: italic;color: #66d9ef}.ace-dracula .ace_support.ace_type {font-style: italic;color: #66d9ef}.ace-dracula .ace_storage {color: #ff79c6}.ace-dracula .ace_storage.ace_type {font-style: italic;color: #8be9fd}.ace-dracula .ace_invalid {color: #F8F8F0;background-color: #ff79c6}.ace-dracula .ace_invalid.ace_deprecated {color: #F8F8F0;background-color: #bd93f9}.ace-dracula .ace_string {color: #f1fa8c}.ace-dracula .ace_comment {color: #6272a4}.ace-dracula .ace_variable {color: #50fa7b}.ace-dracula .ace_variable.ace_parameter {font-style: italic;color: #ffb86c}.ace-dracula .ace_entity.ace_other.ace_attribute-name {color: #50fa7b}.ace-dracula .ace_entity.ace_name.ace_function {color: #50fa7b}.ace-dracula .ace_entity.ace_name.ace_tag {color: #ff79c6}.ace-dracula .ace_invisible {color: #626680;}.ace-dracula .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGBgYHB3d/8PAAOIAdULw8qMAAAAAElFTkSuQmCC) right repeat-y}",t.$selectionColorConflict=!0;var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}); (function() { window.require(["ace/theme/dracula"], function(m) { if (typeof module == "object" && typeof exports == "object" && module) { module.exports = m; } }); })(); ================================================ FILE: pyp5js/http_local/static/js/ace/theme-dreamweaver.js ================================================ define("ace/theme/dreamweaver",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!1,t.cssClass="ace-dreamweaver",t.cssText='.ace-dreamweaver .ace_gutter {background: #e8e8e8;color: #333;}.ace-dreamweaver .ace_print-margin {width: 1px;background: #e8e8e8;}.ace-dreamweaver {background-color: #FFFFFF;color: black;}.ace-dreamweaver .ace_fold {background-color: #757AD8;}.ace-dreamweaver .ace_cursor {color: black;}.ace-dreamweaver .ace_invisible {color: rgb(191, 191, 191);}.ace-dreamweaver .ace_storage,.ace-dreamweaver .ace_keyword {color: blue;}.ace-dreamweaver .ace_constant.ace_buildin {color: rgb(88, 72, 246);}.ace-dreamweaver .ace_constant.ace_language {color: rgb(88, 92, 246);}.ace-dreamweaver .ace_constant.ace_library {color: rgb(6, 150, 14);}.ace-dreamweaver .ace_invalid {background-color: rgb(153, 0, 0);color: white;}.ace-dreamweaver .ace_support.ace_function {color: rgb(60, 76, 114);}.ace-dreamweaver .ace_support.ace_constant {color: rgb(6, 150, 14);}.ace-dreamweaver .ace_support.ace_type,.ace-dreamweaver .ace_support.ace_class {color: #009;}.ace-dreamweaver .ace_support.ace_php_tag {color: #f00;}.ace-dreamweaver .ace_keyword.ace_operator {color: rgb(104, 118, 135);}.ace-dreamweaver .ace_string {color: #00F;}.ace-dreamweaver .ace_comment {color: rgb(76, 136, 107);}.ace-dreamweaver .ace_comment.ace_doc {color: rgb(0, 102, 255);}.ace-dreamweaver .ace_comment.ace_doc.ace_tag {color: rgb(128, 159, 191);}.ace-dreamweaver .ace_constant.ace_numeric {color: rgb(0, 0, 205);}.ace-dreamweaver .ace_variable {color: #06F}.ace-dreamweaver .ace_xml-pe {color: rgb(104, 104, 91);}.ace-dreamweaver .ace_entity.ace_name.ace_function {color: #00F;}.ace-dreamweaver .ace_heading {color: rgb(12, 7, 255);}.ace-dreamweaver .ace_list {color:rgb(185, 6, 144);}.ace-dreamweaver .ace_marker-layer .ace_selection {background: rgb(181, 213, 255);}.ace-dreamweaver .ace_marker-layer .ace_step {background: rgb(252, 255, 0);}.ace-dreamweaver .ace_marker-layer .ace_stack {background: rgb(164, 229, 101);}.ace-dreamweaver .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgb(192, 192, 192);}.ace-dreamweaver .ace_marker-layer .ace_active-line {background: rgba(0, 0, 0, 0.07);}.ace-dreamweaver .ace_gutter-active-line {background-color : #DCDCDC;}.ace-dreamweaver .ace_marker-layer .ace_selected-word {background: rgb(250, 250, 255);border: 1px solid rgb(200, 200, 250);}.ace-dreamweaver .ace_meta.ace_tag {color:#009;}.ace-dreamweaver .ace_meta.ace_tag.ace_anchor {color:#060;}.ace-dreamweaver .ace_meta.ace_tag.ace_form {color:#F90;}.ace-dreamweaver .ace_meta.ace_tag.ace_image {color:#909;}.ace-dreamweaver .ace_meta.ace_tag.ace_script {color:#900;}.ace-dreamweaver .ace_meta.ace_tag.ace_style {color:#909;}.ace-dreamweaver .ace_meta.ace_tag.ace_table {color:#099;}.ace-dreamweaver .ace_string.ace_regex {color: rgb(255, 0, 0)}.ace-dreamweaver .ace_indent-guide {background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y;}';var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}); (function() { window.require(["ace/theme/dreamweaver"], function(m) { if (typeof module == "object" && typeof exports == "object" && module) { module.exports = m; } }); })(); ================================================ FILE: pyp5js/http_local/static/js/ace/theme-eclipse.js ================================================ define("ace/theme/eclipse",["require","exports","module","ace/lib/dom"],function(e,t,n){"use strict";t.isDark=!1,t.cssText='.ace-eclipse .ace_gutter {background: #ebebeb;border-right: 1px solid rgb(159, 159, 159);color: rgb(136, 136, 136);}.ace-eclipse .ace_print-margin {width: 1px;background: #ebebeb;}.ace-eclipse {background-color: #FFFFFF;color: black;}.ace-eclipse .ace_fold {background-color: rgb(60, 76, 114);}.ace-eclipse .ace_cursor {color: black;}.ace-eclipse .ace_storage,.ace-eclipse .ace_keyword,.ace-eclipse .ace_variable {color: rgb(127, 0, 85);}.ace-eclipse .ace_constant.ace_buildin {color: rgb(88, 72, 246);}.ace-eclipse .ace_constant.ace_library {color: rgb(6, 150, 14);}.ace-eclipse .ace_function {color: rgb(60, 76, 114);}.ace-eclipse .ace_string {color: rgb(42, 0, 255);}.ace-eclipse .ace_comment {color: rgb(113, 150, 130);}.ace-eclipse .ace_comment.ace_doc {color: rgb(63, 95, 191);}.ace-eclipse .ace_comment.ace_doc.ace_tag {color: rgb(127, 159, 191);}.ace-eclipse .ace_constant.ace_numeric {color: darkblue;}.ace-eclipse .ace_tag {color: rgb(25, 118, 116);}.ace-eclipse .ace_type {color: rgb(127, 0, 127);}.ace-eclipse .ace_xml-pe {color: rgb(104, 104, 91);}.ace-eclipse .ace_marker-layer .ace_selection {background: rgb(181, 213, 255);}.ace-eclipse .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgb(192, 192, 192);}.ace-eclipse .ace_meta.ace_tag {color:rgb(25, 118, 116);}.ace-eclipse .ace_invisible {color: #ddd;}.ace-eclipse .ace_entity.ace_other.ace_attribute-name {color:rgb(127, 0, 127);}.ace-eclipse .ace_marker-layer .ace_step {background: rgb(255, 255, 0);}.ace-eclipse .ace_active-line {background: rgb(232, 242, 254);}.ace-eclipse .ace_gutter-active-line {background-color : #DADADA;}.ace-eclipse .ace_marker-layer .ace_selected-word {border: 1px solid rgb(181, 213, 255);}.ace-eclipse .ace_indent-guide {background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y;}',t.cssClass="ace-eclipse";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}); (function() { window.require(["ace/theme/eclipse"], function(m) { if (typeof module == "object" && typeof exports == "object" && module) { module.exports = m; } }); })(); ================================================ FILE: pyp5js/http_local/static/js/ace/theme-github.js ================================================ define("ace/theme/github",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!1,t.cssClass="ace-github",t.cssText='.ace-github .ace_gutter {background: #e8e8e8;color: #AAA;}.ace-github {background: #fff;color: #000;}.ace-github .ace_keyword {font-weight: bold;}.ace-github .ace_string {color: #D14;}.ace-github .ace_variable.ace_class {color: teal;}.ace-github .ace_constant.ace_numeric {color: #099;}.ace-github .ace_constant.ace_buildin {color: #0086B3;}.ace-github .ace_support.ace_function {color: #0086B3;}.ace-github .ace_comment {color: #998;font-style: italic;}.ace-github .ace_variable.ace_language {color: #0086B3;}.ace-github .ace_paren {font-weight: bold;}.ace-github .ace_boolean {font-weight: bold;}.ace-github .ace_string.ace_regexp {color: #009926;font-weight: normal;}.ace-github .ace_variable.ace_instance {color: teal;}.ace-github .ace_constant.ace_language {font-weight: bold;}.ace-github .ace_cursor {color: black;}.ace-github.ace_focus .ace_marker-layer .ace_active-line {background: rgb(255, 255, 204);}.ace-github .ace_marker-layer .ace_active-line {background: rgb(245, 245, 245);}.ace-github .ace_marker-layer .ace_selection {background: rgb(181, 213, 255);}.ace-github.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px white;}.ace-github.ace_nobold .ace_line > span {font-weight: normal !important;}.ace-github .ace_marker-layer .ace_step {background: rgb(252, 255, 0);}.ace-github .ace_marker-layer .ace_stack {background: rgb(164, 229, 101);}.ace-github .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgb(192, 192, 192);}.ace-github .ace_gutter-active-line {background-color : rgba(0, 0, 0, 0.07);}.ace-github .ace_marker-layer .ace_selected-word {background: rgb(250, 250, 255);border: 1px solid rgb(200, 200, 250);}.ace-github .ace_invisible {color: #BFBFBF}.ace-github .ace_print-margin {width: 1px;background: #e8e8e8;}.ace-github .ace_indent-guide {background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y;}';var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}); (function() { window.require(["ace/theme/github"], function(m) { if (typeof module == "object" && typeof exports == "object" && module) { module.exports = m; } }); })(); ================================================ FILE: pyp5js/http_local/static/js/ace/theme-gob.js ================================================ define("ace/theme/gob",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!0,t.cssClass="ace-gob",t.cssText=".ace-gob .ace_gutter {background: #0B1818;color: #03EE03}.ace-gob .ace_print-margin {width: 1px;background: #131313}.ace-gob {background-color: #0B0B0B;color: #00FF00}.ace-gob .ace_cursor {border-color: rgba(16, 248, 255, 0.90);background-color: rgba(16, 240, 248, 0.70);opacity: 0.4;}.ace-gob .ace_marker-layer .ace_selection {background: rgba(221, 240, 255, 0.20)}.ace-gob.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #141414;}.ace-gob .ace_marker-layer .ace_step {background: rgb(16, 128, 0)}.ace-gob .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgba(64, 255, 255, 0.25)}.ace-gob .ace_marker-layer .ace_active-line {background: rgba(255, 255, 255, 0.04)}.ace-gob .ace_gutter-active-line {background-color: rgba(255, 255, 255, 0.04)}.ace-gob .ace_marker-layer .ace_selected-word {border: 1px solid rgba(192, 240, 255, 0.20)}.ace-gob .ace_invisible {color: rgba(255, 255, 255, 0.25)}.ace-gob .ace_keyword,.ace-gob .ace_meta {color: #10D8E8}.ace-gob .ace_constant,.ace-gob .ace_constant.ace_character,.ace-gob .ace_constant.ace_character.ace_escape,.ace-gob .ace_constant.ace_other,.ace-gob .ace_heading,.ace-gob .ace_markup.ace_heading,.ace-gob .ace_support.ace_constant {color: #10F0A0}.ace-gob .ace_invalid.ace_illegal {color: #F8F8F8;background-color: rgba(86, 45, 86, 0.75)}.ace-gob .ace_invalid.ace_deprecated {text-decoration: underline;font-style: italic;color: #20F8C0}.ace-gob .ace_support {color: #20E8B0}.ace-gob .ace_fold {background-color: #50B8B8;border-color: #70F8F8}.ace-gob .ace_support.ace_function {color: #00F800}.ace-gob .ace_list,.ace-gob .ace_markup.ace_list,.ace-gob .ace_storage {color: #10FF98}.ace-gob .ace_entity.ace_name.ace_function,.ace-gob .ace_meta.ace_tag,.ace-gob .ace_variable {color: #00F868}.ace-gob .ace_string {color: #10F060}.ace-gob .ace_string.ace_regexp {color: #20F090;}.ace-gob .ace_comment {font-style: italic;color: #00E060;}.ace-gob .ace_variable {color: #00F888;}.ace-gob .ace_xml-pe {color: #488858;}.ace-gob .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWMQERFpYLC1tf0PAAgOAnPnhxyiAAAAAElFTkSuQmCC) right repeat-y}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}); (function() { window.require(["ace/theme/gob"], function(m) { if (typeof module == "object" && typeof exports == "object" && module) { module.exports = m; } }); })(); ================================================ FILE: pyp5js/http_local/static/js/ace/theme-gruvbox.js ================================================ define("ace/theme/gruvbox",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!0,t.cssClass="ace-gruvbox",t.cssText='.ace-gruvbox .ace_gutter-active-line {background-color: #3C3836;}.ace-gruvbox {color: #EBDAB4;background-color: #1D2021;}.ace-gruvbox .ace_invisible {color: #504945;}.ace-gruvbox .ace_marker-layer .ace_selection {background: rgba(179, 101, 57, 0.75)}.ace-gruvbox.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #002240;}.ace-gruvbox .ace_keyword {color: #8ec07c;}.ace-gruvbox .ace_comment {font-style: italic;color: #928375;}.ace-gruvbox .ace-statement {color: red;}.ace-gruvbox .ace_variable {color: #84A598;}.ace-gruvbox .ace_variable.ace_language {color: #D2879B;}.ace-gruvbox .ace_constant {color: #C2859A;}.ace-gruvbox .ace_constant.ace_language {color: #C2859A;}.ace-gruvbox .ace_constant.ace_numeric {color: #C2859A;}.ace-gruvbox .ace_string {color: #B8BA37;}.ace-gruvbox .ace_support {color: #F9BC41;}.ace-gruvbox .ace_support.ace_function {color: #F84B3C;}.ace-gruvbox .ace_storage {color: #8FBF7F;}.ace-gruvbox .ace_keyword.ace_operator {color: #EBDAB4;}.ace-gruvbox .ace_punctuation.ace_operator {color: yellow;}.ace-gruvbox .ace_marker-layer .ace_active-line {background: #3C3836;}.ace-gruvbox .ace_marker-layer .ace_selected-word {border-radius: 4px;border: 8px solid #3f475d;}.ace-gruvbox .ace_print-margin {width: 5px;background: #3C3836;}.ace-gruvbox .ace_indent-guide {background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNQUFD4z6Crq/sfAAuYAuYl+7lfAAAAAElFTkSuQmCC") right repeat-y;}';var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}); (function() { window.require(["ace/theme/gruvbox"], function(m) { if (typeof module == "object" && typeof exports == "object" && module) { module.exports = m; } }); })(); ================================================ FILE: pyp5js/http_local/static/js/ace/theme-idle_fingers.js ================================================ define("ace/theme/idle_fingers",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!0,t.cssClass="ace-idle-fingers",t.cssText=".ace-idle-fingers .ace_gutter {background: #3b3b3b;color: rgb(153,153,153)}.ace-idle-fingers .ace_print-margin {width: 1px;background: #3b3b3b}.ace-idle-fingers {background-color: #323232;color: #FFFFFF}.ace-idle-fingers .ace_cursor {color: #91FF00}.ace-idle-fingers .ace_marker-layer .ace_selection {background: rgba(90, 100, 126, 0.88)}.ace-idle-fingers.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #323232;}.ace-idle-fingers .ace_marker-layer .ace_step {background: rgb(102, 82, 0)}.ace-idle-fingers .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid #404040}.ace-idle-fingers .ace_marker-layer .ace_active-line {background: #353637}.ace-idle-fingers .ace_gutter-active-line {background-color: #353637}.ace-idle-fingers .ace_marker-layer .ace_selected-word {border: 1px solid rgba(90, 100, 126, 0.88)}.ace-idle-fingers .ace_invisible {color: #404040}.ace-idle-fingers .ace_keyword,.ace-idle-fingers .ace_meta {color: #CC7833}.ace-idle-fingers .ace_constant,.ace-idle-fingers .ace_constant.ace_character,.ace-idle-fingers .ace_constant.ace_character.ace_escape,.ace-idle-fingers .ace_constant.ace_other,.ace-idle-fingers .ace_support.ace_constant {color: #6C99BB}.ace-idle-fingers .ace_invalid {color: #FFFFFF;background-color: #FF0000}.ace-idle-fingers .ace_fold {background-color: #CC7833;border-color: #FFFFFF}.ace-idle-fingers .ace_support.ace_function {color: #B83426}.ace-idle-fingers .ace_variable.ace_parameter {font-style: italic}.ace-idle-fingers .ace_string {color: #A5C261}.ace-idle-fingers .ace_string.ace_regexp {color: #CCCC33}.ace-idle-fingers .ace_comment {font-style: italic;color: #BC9458}.ace-idle-fingers .ace_meta.ace_tag {color: #FFE5BB}.ace-idle-fingers .ace_entity.ace_name {color: #FFC66D}.ace-idle-fingers .ace_collab.ace_user1 {color: #323232;background-color: #FFF980}.ace-idle-fingers .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWMwMjLyZYiPj/8PAAreAwAI1+g0AAAAAElFTkSuQmCC) right repeat-y}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}); (function() { window.require(["ace/theme/idle_fingers"], function(m) { if (typeof module == "object" && typeof exports == "object" && module) { module.exports = m; } }); })(); ================================================ FILE: pyp5js/http_local/static/js/ace/theme-iplastic.js ================================================ define("ace/theme/iplastic",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!1,t.cssClass="ace-iplastic",t.cssText=".ace-iplastic .ace_gutter {background: #dddddd;color: #666666}.ace-iplastic .ace_print-margin {width: 1px;background: #bbbbbb}.ace-iplastic {background-color: #eeeeee;color: #333333}.ace-iplastic .ace_cursor {color: #333}.ace-iplastic .ace_marker-layer .ace_selection {background: #BAD6FD;}.ace-iplastic.ace_multiselect .ace_selection.ace_start {border-radius: 4px}.ace-iplastic .ace_marker-layer .ace_step {background: #444444}.ace-iplastic .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid #49483E;background: #FFF799}.ace-iplastic .ace_marker-layer .ace_active-line {background: #e5e5e5}.ace-iplastic .ace_gutter-active-line {background-color: #eeeeee}.ace-iplastic .ace_marker-layer .ace_selected-word {border: 1px solid #555555;border-radius:4px}.ace-iplastic .ace_invisible {color: #999999}.ace-iplastic .ace_entity.ace_name.ace_tag,.ace-iplastic .ace_keyword,.ace-iplastic .ace_meta.ace_tag,.ace-iplastic .ace_storage {color: #0000FF}.ace-iplastic .ace_punctuation,.ace-iplastic .ace_punctuation.ace_tag {color: #000}.ace-iplastic .ace_constant {color: #333333;font-weight: 700}.ace-iplastic .ace_constant.ace_character,.ace-iplastic .ace_constant.ace_language,.ace-iplastic .ace_constant.ace_numeric,.ace-iplastic .ace_constant.ace_other {color: #0066FF;font-weight: 700}.ace-iplastic .ace_constant.ace_numeric{font-weight: 100}.ace-iplastic .ace_invalid {color: #F8F8F0;background-color: #F92672}.ace-iplastic .ace_invalid.ace_deprecated {color: #F8F8F0;background-color: #AE81FF}.ace-iplastic .ace_support.ace_constant,.ace-iplastic .ace_support.ace_function {color: #333333;font-weight: 700}.ace-iplastic .ace_fold {background-color: #464646;border-color: #F8F8F2}.ace-iplastic .ace_storage.ace_type,.ace-iplastic .ace_support.ace_class,.ace-iplastic .ace_support.ace_type {color: #3333fc;font-weight: 700}.ace-iplastic .ace_entity.ace_name.ace_function,.ace-iplastic .ace_entity.ace_other,.ace-iplastic .ace_entity.ace_other.ace_attribute-name,.ace-iplastic .ace_variable {color: #3366cc;font-style: italic}.ace-iplastic .ace_variable.ace_parameter {font-style: italic;color: #2469E0}.ace-iplastic .ace_string {color: #a55f03}.ace-iplastic .ace_comment {color: #777777;font-style: italic}.ace-iplastic .ace_fold-widget {background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42mWKsQ0AMAzC8ixLlrzQjzmBiEjp0A6WwBCSPgKAXoLkqSot7nN3yMwR7pZ32NzpKkVoDBUxKAAAAABJRU5ErkJggg==);}.ace-iplastic .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuRLahdYwP2SycQWHTA4vcAAPK7b8HUKAgDgGiD4c93/+8//UegJQCAZkmScQAAXkQkLlTKsz/HCAAARKCBKrBBG/TBGCzABhzBBdzBC/xgNoRCJMTCQhBCCmSAHHJgKayCQiiGzbAdKmAv1EAdNMBRaIaTcA4uwlW4Dj1wD/phCJ7BKLyBCQRByAgTYSHaiAFiilgjjggXmYX4IcFIBBKLJCDJiBRRIkuRNUgxUopUIFVIHfI9cgI5h1xGupE7yAAygvyGvEcxlIGyUT3UDLVDuag3GoRGogvQZHQxmo8WoJvQcrQaPYw2oefQq2gP2o8+Q8cwwOgYBzPEbDAuxsNCsTgsCZNjy7EirAyrxhqwVqwDu4n1Y8+xdwQSgUXACTYEd0IgYR5BSFhMWE7YSKggHCQ0EdoJNwkDhFHCJyKTqEu0JroR+cQYYjIxh1hILCPWEo8TLxB7iEPENyQSiUMyJ7mQAkmxpFTSEtJG0m5SI+ksqZs0SBojk8naZGuyBzmULCAryIXkneTD5DPkG+Qh8lsKnWJAcaT4U+IoUspqShnlEOU05QZlmDJBVaOaUt2ooVQRNY9aQq2htlKvUYeoEzR1mjnNgxZJS6WtopXTGmgXaPdpr+h0uhHdlR5Ol9BX0svpR+iX6AP0dwwNhhWDx4hnKBmbGAcYZxl3GK+YTKYZ04sZx1QwNzHrmOeZD5lvVVgqtip8FZHKCpVKlSaVGyovVKmqpqreqgtV81XLVI+pXlN9rkZVM1PjqQnUlqtVqp1Q61MbU2epO6iHqmeob1Q/pH5Z/YkGWcNMw09DpFGgsV/jvMYgC2MZs3gsIWsNq4Z1gTXEJrHN2Xx2KruY/R27iz2qqaE5QzNKM1ezUvOUZj8H45hx+Jx0TgnnKKeX836K3hTvKeIpG6Y0TLkxZVxrqpaXllirSKtRq0frvTau7aedpr1Fu1n7gQ5Bx0onXCdHZ4/OBZ3nU9lT3acKpxZNPTr1ri6qa6UbobtEd79up+6Ynr5egJ5Mb6feeb3n+hx9L/1U/W36p/VHDFgGswwkBtsMzhg8xTVxbzwdL8fb8VFDXcNAQ6VhlWGX4YSRudE8o9VGjUYPjGnGXOMk423GbcajJgYmISZLTepN7ppSTbmmKaY7TDtMx83MzaLN1pk1mz0x1zLnm+eb15vft2BaeFostqi2uGVJsuRaplnutrxuhVo5WaVYVVpds0atna0l1rutu6cRp7lOk06rntZnw7Dxtsm2qbcZsOXYBtuutm22fWFnYhdnt8Wuw+6TvZN9un2N/T0HDYfZDqsdWh1+c7RyFDpWOt6azpzuP33F9JbpL2dYzxDP2DPjthPLKcRpnVOb00dnF2e5c4PziIuJS4LLLpc+Lpsbxt3IveRKdPVxXeF60vWdm7Obwu2o26/uNu5p7ofcn8w0nymeWTNz0MPIQ+BR5dE/C5+VMGvfrH5PQ0+BZ7XnIy9jL5FXrdewt6V3qvdh7xc+9j5yn+M+4zw33jLeWV/MN8C3yLfLT8Nvnl+F30N/I/9k/3r/0QCngCUBZwOJgUGBWwL7+Hp8Ib+OPzrbZfay2e1BjKC5QRVBj4KtguXBrSFoyOyQrSH355jOkc5pDoVQfujW0Adh5mGLw34MJ4WHhVeGP45wiFga0TGXNXfR3ENz30T6RJZE3ptnMU85ry1KNSo+qi5qPNo3ujS6P8YuZlnM1VidWElsSxw5LiquNm5svt/87fOH4p3iC+N7F5gvyF1weaHOwvSFpxapLhIsOpZATIhOOJTwQRAqqBaMJfITdyWOCnnCHcJnIi/RNtGI2ENcKh5O8kgqTXqS7JG8NXkkxTOlLOW5hCepkLxMDUzdmzqeFpp2IG0yPTq9MYOSkZBxQqohTZO2Z+pn5mZ2y6xlhbL+xW6Lty8elQfJa7OQrAVZLQq2QqboVFoo1yoHsmdlV2a/zYnKOZarnivN7cyzytuQN5zvn//tEsIS4ZK2pYZLVy0dWOa9rGo5sjxxedsK4xUFK4ZWBqw8uIq2Km3VT6vtV5eufr0mek1rgV7ByoLBtQFr6wtVCuWFfevc1+1dT1gvWd+1YfqGnRs+FYmKrhTbF5cVf9go3HjlG4dvyr+Z3JS0qavEuWTPZtJm6ebeLZ5bDpaql+aXDm4N2dq0Dd9WtO319kXbL5fNKNu7g7ZDuaO/PLi8ZafJzs07P1SkVPRU+lQ27tLdtWHX+G7R7ht7vPY07NXbW7z3/T7JvttVAVVN1WbVZftJ+7P3P66Jqun4lvttXa1ObXHtxwPSA/0HIw6217nU1R3SPVRSj9Yr60cOxx++/p3vdy0NNg1VjZzG4iNwRHnk6fcJ3/ceDTradox7rOEH0x92HWcdL2pCmvKaRptTmvtbYlu6T8w+0dbq3nr8R9sfD5w0PFl5SvNUyWna6YLTk2fyz4ydlZ19fi753GDborZ752PO32oPb++6EHTh0kX/i+c7vDvOXPK4dPKy2+UTV7hXmq86X23qdOo8/pPTT8e7nLuarrlca7nuer21e2b36RueN87d9L158Rb/1tWeOT3dvfN6b/fF9/XfFt1+cif9zsu72Xcn7q28T7xf9EDtQdlD3YfVP1v+3Njv3H9qwHeg89HcR/cGhYPP/pH1jw9DBY+Zj8uGDYbrnjg+OTniP3L96fynQ89kzyaeF/6i/suuFxYvfvjV69fO0ZjRoZfyl5O/bXyl/erA6xmv28bCxh6+yXgzMV70VvvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz/GMzLdsAAAAgY0hSTQAAeiUAAICDAAD5/wAAgOkAAHUwAADqYAAAOpgAABdvkl/FRgAAABlJREFUeNpi+P//PwMzMzPzfwAAAAD//wMAGRsECSML/RIAAAAASUVORK5CYII=) right repeat-y}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}); (function() { window.require(["ace/theme/iplastic"], function(m) { if (typeof module == "object" && typeof exports == "object" && module) { module.exports = m; } }); })(); ================================================ FILE: pyp5js/http_local/static/js/ace/theme-katzenmilch.js ================================================ define("ace/theme/katzenmilch",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!1,t.cssClass="ace-katzenmilch",t.cssText=".ace-katzenmilch .ace_gutter,.ace-katzenmilch .ace_gutter {background: #e8e8e8;color: #333}.ace-katzenmilch .ace_print-margin {width: 1px;background: #e8e8e8}.ace-katzenmilch {background-color: #f3f2f3;color: rgba(15, 0, 9, 1.0)}.ace-katzenmilch .ace_cursor {border-left: 2px solid #100011}.ace-katzenmilch .ace_overwrite-cursors .ace_cursor {border-left: 0px;border-bottom: 1px solid #100011}.ace-katzenmilch .ace_marker-layer .ace_selection {background: rgba(100, 5, 208, 0.27)}.ace-katzenmilch.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #f3f2f3;}.ace-katzenmilch .ace_marker-layer .ace_step {background: rgb(198, 219, 174)}.ace-katzenmilch .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgba(0, 0, 0, 0.33);}.ace-katzenmilch .ace_marker-layer .ace_active-line {background: rgb(232, 242, 254)}.ace-katzenmilch .ace_gutter-active-line {background-color: rgb(232, 242, 254)}.ace-katzenmilch .ace_marker-layer .ace_selected-word {border: 1px solid rgba(100, 5, 208, 0.27)}.ace-katzenmilch .ace_invisible {color: #BFBFBF}.ace-katzenmilch .ace_fold {background-color: rgba(2, 95, 73, 0.97);border-color: rgba(15, 0, 9, 1.0)}.ace-katzenmilch .ace_keyword {color: #674Aa8;rbackground-color: rgba(163, 170, 216, 0.055)}.ace-katzenmilch .ace_constant.ace_language {color: #7D7e52;rbackground-color: rgba(189, 190, 130, 0.059)}.ace-katzenmilch .ace_constant.ace_numeric {color: rgba(79, 130, 123, 0.93);rbackground-color: rgba(119, 194, 187, 0.059)}.ace-katzenmilch .ace_constant.ace_character,.ace-katzenmilch .ace_constant.ace_other {color: rgba(2, 95, 105, 1.0);rbackground-color: rgba(127, 34, 153, 0.063)}.ace-katzenmilch .ace_support.ace_function {color: #9D7e62;rbackground-color: rgba(189, 190, 130, 0.039)}.ace-katzenmilch .ace_support.ace_class {color: rgba(239, 106, 167, 1.0);rbackground-color: rgba(239, 106, 167, 0.063)}.ace-katzenmilch .ace_storage {color: rgba(123, 92, 191, 1.0);rbackground-color: rgba(139, 93, 223, 0.051)}.ace-katzenmilch .ace_invalid {color: #DFDFD5;rbackground-color: #CC1B27}.ace-katzenmilch .ace_string {color: #5a5f9b;rbackground-color: rgba(170, 175, 219, 0.035)}.ace-katzenmilch .ace_comment {font-style: italic;color: rgba(64, 79, 80, 0.67);rbackground-color: rgba(95, 15, 255, 0.0078)}.ace-katzenmilch .ace_entity.ace_name.ace_function,.ace-katzenmilch .ace_variable {color: rgba(2, 95, 73, 0.97);rbackground-color: rgba(34, 255, 73, 0.12)}.ace-katzenmilch .ace_variable.ace_language {color: #316fcf;rbackground-color: rgba(58, 175, 255, 0.039)}.ace-katzenmilch .ace_variable.ace_parameter {font-style: italic;color: rgba(51, 150, 159, 0.87);rbackground-color: rgba(5, 214, 249, 0.043)}.ace-katzenmilch .ace_entity.ace_other.ace_attribute-name {color: rgba(73, 70, 194, 0.93);rbackground-color: rgba(73, 134, 194, 0.035)}.ace-katzenmilch .ace_entity.ace_name.ace_tag {color: #3976a2;rbackground-color: rgba(73, 166, 210, 0.039)}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}); (function() { window.require(["ace/theme/katzenmilch"], function(m) { if (typeof module == "object" && typeof exports == "object" && module) { module.exports = m; } }); })(); ================================================ FILE: pyp5js/http_local/static/js/ace/theme-kr_theme.js ================================================ define("ace/theme/kr_theme",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!0,t.cssClass="ace-kr-theme",t.cssText=".ace-kr-theme .ace_gutter {background: #1c1917;color: #FCFFE0}.ace-kr-theme .ace_print-margin {width: 1px;background: #1c1917}.ace-kr-theme {background-color: #0B0A09;color: #FCFFE0}.ace-kr-theme .ace_cursor {color: #FF9900}.ace-kr-theme .ace_marker-layer .ace_selection {background: rgba(170, 0, 255, 0.45)}.ace-kr-theme.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #0B0A09;}.ace-kr-theme .ace_marker-layer .ace_step {background: rgb(102, 82, 0)}.ace-kr-theme .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgba(255, 177, 111, 0.32)}.ace-kr-theme .ace_marker-layer .ace_active-line {background: #38403D}.ace-kr-theme .ace_gutter-active-line {background-color : #38403D}.ace-kr-theme .ace_marker-layer .ace_selected-word {border: 1px solid rgba(170, 0, 255, 0.45)}.ace-kr-theme .ace_invisible {color: rgba(255, 177, 111, 0.32)}.ace-kr-theme .ace_keyword,.ace-kr-theme .ace_meta {color: #949C8B}.ace-kr-theme .ace_constant,.ace-kr-theme .ace_constant.ace_character,.ace-kr-theme .ace_constant.ace_character.ace_escape,.ace-kr-theme .ace_constant.ace_other {color: rgba(210, 117, 24, 0.76)}.ace-kr-theme .ace_invalid {color: #F8F8F8;background-color: #A41300}.ace-kr-theme .ace_support {color: #9FC28A}.ace-kr-theme .ace_support.ace_constant {color: #C27E66}.ace-kr-theme .ace_fold {background-color: #949C8B;border-color: #FCFFE0}.ace-kr-theme .ace_support.ace_function {color: #85873A}.ace-kr-theme .ace_storage {color: #FFEE80}.ace-kr-theme .ace_string {color: rgba(164, 161, 181, 0.8)}.ace-kr-theme .ace_string.ace_regexp {color: rgba(125, 255, 192, 0.65)}.ace-kr-theme .ace_comment {font-style: italic;color: #706D5B}.ace-kr-theme .ace_variable {color: #D1A796}.ace-kr-theme .ace_list,.ace-kr-theme .ace_markup.ace_list {background-color: #0F0040}.ace-kr-theme .ace_variable.ace_language {color: #FF80E1}.ace-kr-theme .ace_meta.ace_tag {color: #BABD9C}.ace-kr-theme .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGBgYFBXV/8PAAJoAXX4kT2EAAAAAElFTkSuQmCC) right repeat-y}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}); (function() { window.require(["ace/theme/kr_theme"], function(m) { if (typeof module == "object" && typeof exports == "object" && module) { module.exports = m; } }); })(); ================================================ FILE: pyp5js/http_local/static/js/ace/theme-kuroir.js ================================================ define("ace/theme/kuroir",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!1,t.cssClass="ace-kuroir",t.cssText=".ace-kuroir .ace_gutter {background: #e8e8e8;color: #333;}.ace-kuroir .ace_print-margin {width: 1px;background: #e8e8e8;}.ace-kuroir {background-color: #E8E9E8;color: #363636;}.ace-kuroir .ace_cursor {color: #202020;}.ace-kuroir .ace_marker-layer .ace_selection {background: rgba(245, 170, 0, 0.57);}.ace-kuroir.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #E8E9E8;}.ace-kuroir .ace_marker-layer .ace_step {background: rgb(198, 219, 174);}.ace-kuroir .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgba(0, 0, 0, 0.29);}.ace-kuroir .ace_marker-layer .ace_active-line {background: rgba(203, 220, 47, 0.22);}.ace-kuroir .ace_gutter-active-line {background-color: rgba(203, 220, 47, 0.22);}.ace-kuroir .ace_marker-layer .ace_selected-word {border: 1px solid rgba(245, 170, 0, 0.57);}.ace-kuroir .ace_invisible {color: #BFBFBF}.ace-kuroir .ace_fold {border-color: #363636;}.ace-kuroir .ace_constant{color:#CD6839;}.ace-kuroir .ace_constant.ace_numeric{color:#9A5925;}.ace-kuroir .ace_support{color:#104E8B;}.ace-kuroir .ace_support.ace_function{color:#005273;}.ace-kuroir .ace_support.ace_constant{color:#CF6A4C;}.ace-kuroir .ace_storage{color:#A52A2A;}.ace-kuroir .ace_invalid.ace_illegal{color:#FD1224;background-color:rgba(255, 6, 0, 0.15);}.ace-kuroir .ace_invalid.ace_deprecated{text-decoration:underline;font-style:italic;color:#FD1732;background-color:#E8E9E8;}.ace-kuroir .ace_string{color:#639300;}.ace-kuroir .ace_string.ace_regexp{color:#417E00;background-color:#C9D4BE;}.ace-kuroir .ace_comment{color:rgba(148, 148, 148, 0.91);background-color:rgba(220, 220, 220, 0.56);}.ace-kuroir .ace_variable{color:#009ACD;}.ace-kuroir .ace_meta.ace_tag{color:#005273;}.ace-kuroir .ace_markup.ace_heading{color:#B8012D;background-color:rgba(191, 97, 51, 0.051);}.ace-kuroir .ace_markup.ace_list{color:#8F5B26;}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}); (function() { window.require(["ace/theme/kuroir"], function(m) { if (typeof module == "object" && typeof exports == "object" && module) { module.exports = m; } }); })(); ================================================ FILE: pyp5js/http_local/static/js/ace/theme-merbivore.js ================================================ define("ace/theme/merbivore",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!0,t.cssClass="ace-merbivore",t.cssText=".ace-merbivore .ace_gutter {background: #202020;color: #E6E1DC}.ace-merbivore .ace_print-margin {width: 1px;background: #555651}.ace-merbivore {background-color: #161616;color: #E6E1DC}.ace-merbivore .ace_cursor {color: #FFFFFF}.ace-merbivore .ace_marker-layer .ace_selection {background: #454545}.ace-merbivore.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #161616;}.ace-merbivore .ace_marker-layer .ace_step {background: rgb(102, 82, 0)}.ace-merbivore .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid #404040}.ace-merbivore .ace_marker-layer .ace_active-line {background: #333435}.ace-merbivore .ace_gutter-active-line {background-color: #333435}.ace-merbivore .ace_marker-layer .ace_selected-word {border: 1px solid #454545}.ace-merbivore .ace_invisible {color: #404040}.ace-merbivore .ace_entity.ace_name.ace_tag,.ace-merbivore .ace_keyword,.ace-merbivore .ace_meta,.ace-merbivore .ace_meta.ace_tag,.ace-merbivore .ace_storage,.ace-merbivore .ace_support.ace_function {color: #FC6F09}.ace-merbivore .ace_constant,.ace-merbivore .ace_constant.ace_character,.ace-merbivore .ace_constant.ace_character.ace_escape,.ace-merbivore .ace_constant.ace_other,.ace-merbivore .ace_support.ace_type {color: #1EDAFB}.ace-merbivore .ace_constant.ace_character.ace_escape {color: #519F50}.ace-merbivore .ace_constant.ace_language {color: #FDC251}.ace-merbivore .ace_constant.ace_library,.ace-merbivore .ace_string,.ace-merbivore .ace_support.ace_constant {color: #8DFF0A}.ace-merbivore .ace_constant.ace_numeric {color: #58C554}.ace-merbivore .ace_invalid {color: #FFFFFF;background-color: #990000}.ace-merbivore .ace_fold {background-color: #FC6F09;border-color: #E6E1DC}.ace-merbivore .ace_comment {font-style: italic;color: #AD2EA4}.ace-merbivore .ace_entity.ace_other.ace_attribute-name {color: #FFFF89}.ace-merbivore .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWMQFxf3ZXB1df0PAAdsAmERTkEHAAAAAElFTkSuQmCC) right repeat-y}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}); (function() { window.require(["ace/theme/merbivore"], function(m) { if (typeof module == "object" && typeof exports == "object" && module) { module.exports = m; } }); })(); ================================================ FILE: pyp5js/http_local/static/js/ace/theme-merbivore_soft.js ================================================ define("ace/theme/merbivore_soft",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!0,t.cssClass="ace-merbivore-soft",t.cssText=".ace-merbivore-soft .ace_gutter {background: #262424;color: #E6E1DC}.ace-merbivore-soft .ace_print-margin {width: 1px;background: #262424}.ace-merbivore-soft {background-color: #1C1C1C;color: #E6E1DC}.ace-merbivore-soft .ace_cursor {color: #FFFFFF}.ace-merbivore-soft .ace_marker-layer .ace_selection {background: #494949}.ace-merbivore-soft.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #1C1C1C;}.ace-merbivore-soft .ace_marker-layer .ace_step {background: rgb(102, 82, 0)}.ace-merbivore-soft .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid #404040}.ace-merbivore-soft .ace_marker-layer .ace_active-line {background: #333435}.ace-merbivore-soft .ace_gutter-active-line {background-color: #333435}.ace-merbivore-soft .ace_marker-layer .ace_selected-word {border: 1px solid #494949}.ace-merbivore-soft .ace_invisible {color: #404040}.ace-merbivore-soft .ace_entity.ace_name.ace_tag,.ace-merbivore-soft .ace_keyword,.ace-merbivore-soft .ace_meta,.ace-merbivore-soft .ace_meta.ace_tag,.ace-merbivore-soft .ace_storage {color: #FC803A}.ace-merbivore-soft .ace_constant,.ace-merbivore-soft .ace_constant.ace_character,.ace-merbivore-soft .ace_constant.ace_character.ace_escape,.ace-merbivore-soft .ace_constant.ace_other,.ace-merbivore-soft .ace_support.ace_type {color: #68C1D8}.ace-merbivore-soft .ace_constant.ace_character.ace_escape {color: #B3E5B4}.ace-merbivore-soft .ace_constant.ace_language {color: #E1C582}.ace-merbivore-soft .ace_constant.ace_library,.ace-merbivore-soft .ace_string,.ace-merbivore-soft .ace_support.ace_constant {color: #8EC65F}.ace-merbivore-soft .ace_constant.ace_numeric {color: #7FC578}.ace-merbivore-soft .ace_invalid,.ace-merbivore-soft .ace_invalid.ace_deprecated {color: #FFFFFF;background-color: #FE3838}.ace-merbivore-soft .ace_fold {background-color: #FC803A;border-color: #E6E1DC}.ace-merbivore-soft .ace_comment,.ace-merbivore-soft .ace_meta {font-style: italic;color: #AC4BB8}.ace-merbivore-soft .ace_entity.ace_other.ace_attribute-name {color: #EAF1A3}.ace-merbivore-soft .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWOQkpLyZfD09PwPAAfYAnaStpHRAAAAAElFTkSuQmCC) right repeat-y}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}); (function() { window.require(["ace/theme/merbivore_soft"], function(m) { if (typeof module == "object" && typeof exports == "object" && module) { module.exports = m; } }); })(); ================================================ FILE: pyp5js/http_local/static/js/ace/theme-mono_industrial.js ================================================ define("ace/theme/mono_industrial",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!0,t.cssClass="ace-mono-industrial",t.cssText=".ace-mono-industrial .ace_gutter {background: #1d2521;color: #C5C9C9}.ace-mono-industrial .ace_print-margin {width: 1px;background: #555651}.ace-mono-industrial {background-color: #222C28;color: #FFFFFF}.ace-mono-industrial .ace_cursor {color: #FFFFFF}.ace-mono-industrial .ace_marker-layer .ace_selection {background: rgba(145, 153, 148, 0.40)}.ace-mono-industrial.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #222C28;}.ace-mono-industrial .ace_marker-layer .ace_step {background: rgb(102, 82, 0)}.ace-mono-industrial .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgba(102, 108, 104, 0.50)}.ace-mono-industrial .ace_marker-layer .ace_active-line {background: rgba(12, 13, 12, 0.25)}.ace-mono-industrial .ace_gutter-active-line {background-color: rgba(12, 13, 12, 0.25)}.ace-mono-industrial .ace_marker-layer .ace_selected-word {border: 1px solid rgba(145, 153, 148, 0.40)}.ace-mono-industrial .ace_invisible {color: rgba(102, 108, 104, 0.50)}.ace-mono-industrial .ace_string {background-color: #151C19;color: #FFFFFF}.ace-mono-industrial .ace_keyword,.ace-mono-industrial .ace_meta {color: #A39E64}.ace-mono-industrial .ace_constant,.ace-mono-industrial .ace_constant.ace_character,.ace-mono-industrial .ace_constant.ace_character.ace_escape,.ace-mono-industrial .ace_constant.ace_numeric,.ace-mono-industrial .ace_constant.ace_other {color: #E98800}.ace-mono-industrial .ace_entity.ace_name.ace_function,.ace-mono-industrial .ace_keyword.ace_operator,.ace-mono-industrial .ace_variable {color: #A8B3AB}.ace-mono-industrial .ace_invalid {color: #FFFFFF;background-color: rgba(153, 0, 0, 0.68)}.ace-mono-industrial .ace_support.ace_constant {color: #C87500}.ace-mono-industrial .ace_fold {background-color: #A8B3AB;border-color: #FFFFFF}.ace-mono-industrial .ace_support.ace_function {color: #588E60}.ace-mono-industrial .ace_entity.ace_name,.ace-mono-industrial .ace_support.ace_class,.ace-mono-industrial .ace_support.ace_type {color: #5778B6}.ace-mono-industrial .ace_storage {color: #C23B00}.ace-mono-industrial .ace_variable.ace_language,.ace-mono-industrial .ace_variable.ace_parameter {color: #648BD2}.ace-mono-industrial .ace_comment {color: #666C68;background-color: #151C19}.ace-mono-industrial .ace_entity.ace_other.ace_attribute-name {color: #909993}.ace-mono-industrial .ace_entity.ace_name.ace_tag {color: #A65EFF}.ace-mono-industrial .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNQ1NbwZfALD/4PAAlTArlEC4r/AAAAAElFTkSuQmCC) right repeat-y}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}); (function() { window.require(["ace/theme/mono_industrial"], function(m) { if (typeof module == "object" && typeof exports == "object" && module) { module.exports = m; } }); })(); ================================================ FILE: pyp5js/http_local/static/js/ace/theme-monokai.js ================================================ define("ace/theme/monokai",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!0,t.cssClass="ace-monokai",t.cssText=".ace-monokai .ace_gutter {background: #2F3129;color: #8F908A}.ace-monokai .ace_print-margin {width: 1px;background: #555651}.ace-monokai {background-color: #272822;color: #F8F8F2}.ace-monokai .ace_cursor {color: #F8F8F0}.ace-monokai .ace_marker-layer .ace_selection {background: #49483E}.ace-monokai.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #272822;}.ace-monokai .ace_marker-layer .ace_step {background: rgb(102, 82, 0)}.ace-monokai .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid #49483E}.ace-monokai .ace_marker-layer .ace_active-line {background: #202020}.ace-monokai .ace_gutter-active-line {background-color: #272727}.ace-monokai .ace_marker-layer .ace_selected-word {border: 1px solid #49483E}.ace-monokai .ace_invisible {color: #52524d}.ace-monokai .ace_entity.ace_name.ace_tag,.ace-monokai .ace_keyword,.ace-monokai .ace_meta.ace_tag,.ace-monokai .ace_storage {color: #F92672}.ace-monokai .ace_punctuation,.ace-monokai .ace_punctuation.ace_tag {color: #fff}.ace-monokai .ace_constant.ace_character,.ace-monokai .ace_constant.ace_language,.ace-monokai .ace_constant.ace_numeric,.ace-monokai .ace_constant.ace_other {color: #AE81FF}.ace-monokai .ace_invalid {color: #F8F8F0;background-color: #F92672}.ace-monokai .ace_invalid.ace_deprecated {color: #F8F8F0;background-color: #AE81FF}.ace-monokai .ace_support.ace_constant,.ace-monokai .ace_support.ace_function {color: #66D9EF}.ace-monokai .ace_fold {background-color: #A6E22E;border-color: #F8F8F2}.ace-monokai .ace_storage.ace_type,.ace-monokai .ace_support.ace_class,.ace-monokai .ace_support.ace_type {font-style: italic;color: #66D9EF}.ace-monokai .ace_entity.ace_name.ace_function,.ace-monokai .ace_entity.ace_other,.ace-monokai .ace_entity.ace_other.ace_attribute-name,.ace-monokai .ace_variable {color: #A6E22E}.ace-monokai .ace_variable.ace_parameter {font-style: italic;color: #FD971F}.ace-monokai .ace_string {color: #E6DB74}.ace-monokai .ace_comment {color: #75715E}.ace-monokai .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWPQ0FD0ZXBzd/wPAAjVAoxeSgNeAAAAAElFTkSuQmCC) right repeat-y}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}); (function() { window.require(["ace/theme/monokai"], function(m) { if (typeof module == "object" && typeof exports == "object" && module) { module.exports = m; } }); })(); ================================================ FILE: pyp5js/http_local/static/js/ace/theme-nord_dark.js ================================================ define("ace/theme/nord_dark",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!0,t.cssClass="ace-nord-dark",t.cssText=".ace-nord-dark .ace_gutter {color: #616e88;}.ace-nord-dark .ace_print-margin {width: 1px;background: #4c566a;}.ace-nord-dark {background-color: #2e3440;color: #d8dee9;}.ace-nord-dark .ace_entity.ace_other.ace_attribute-name,.ace-nord-dark .ace_storage {color: #d8dee9;}.ace-nord-dark .ace_cursor {color: #d8dee9;},.ace-nord-dark .ace_string.ace_regexp {color: #bf616a;}.ace-nord-dark .ace_marker-layer .ace_active-line {background: #434c5ecc;}.ace-nord-dark .ace_marker-layer .ace_selection {background: #434c5ecc;}.ace-nord-dark.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #2e3440;}.ace-nord-dark .ace_marker-layer .ace_step {background: #ebcb8b;}.ace-nord-dark .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid #88c0d066;}.ace-nord-dark .ace_gutter-active-line {background-color: #434c5ecc;}.ace-nord-dark .ace_marker-layer .ace_selected-word {border: 1px solid #88c0d066;}.ace-nord-dark .ace_invisible {color: #4c566a;}.ace-nord-dark .ace_keyword,.ace-nord-dark .ace_meta,.ace-nord-dark .ace_support.ace_class,.ace-nord-dark .ace_support.ace_type {color: #81a1c1;}.ace-nord-dark .ace_constant.ace_character,.ace-nord-dark .ace_constant.ace_other {color: #d8dee9;}.ace-nord-dark .ace_constant.ace_language {color: #5e81ac;}.ace-nord-dark .ace_constant.ace_escape {color: #ebcB8b;}.ace-nord-dark .ace_constant.ace_numeric {color: #b48ead;}.ace-nord-dark .ace_fold {background-color: #4c566a;border-color: #d8dee9;}.ace-nord-dark .ace_entity.ace_name.ace_function,.ace-nord-dark .ace_entity.ace_name.ace_tag,.ace-nord-dark .ace_support.ace_function,.ace-nord-dark .ace_variable,.ace-nord-dark .ace_variable.ace_language {color: #8fbcbb;}.ace-nord-dark .ace_string {color: #a3be8c;}.ace-nord-dark .ace_comment {color: #616e88;}.ace-nord-dark .ace_indent-guide {box-shadow: inset -1px 0 0 0 #434c5eb3;}",t.$selectionColorConflict=!0;var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}); (function() { window.require(["ace/theme/nord_dark"], function(m) { if (typeof module == "object" && typeof exports == "object" && module) { module.exports = m; } }); })(); ================================================ FILE: pyp5js/http_local/static/js/ace/theme-pastel_on_dark.js ================================================ define("ace/theme/pastel_on_dark",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!0,t.cssClass="ace-pastel-on-dark",t.cssText=".ace-pastel-on-dark .ace_gutter {background: #353030;color: #8F938F}.ace-pastel-on-dark .ace_print-margin {width: 1px;background: #353030}.ace-pastel-on-dark {background-color: #2C2828;color: #8F938F}.ace-pastel-on-dark .ace_cursor {color: #A7A7A7}.ace-pastel-on-dark .ace_marker-layer .ace_selection {background: rgba(221, 240, 255, 0.20)}.ace-pastel-on-dark.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #2C2828;}.ace-pastel-on-dark .ace_marker-layer .ace_step {background: rgb(102, 82, 0)}.ace-pastel-on-dark .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgba(255, 255, 255, 0.25)}.ace-pastel-on-dark .ace_marker-layer .ace_active-line {background: rgba(255, 255, 255, 0.031)}.ace-pastel-on-dark .ace_gutter-active-line {background-color: rgba(255, 255, 255, 0.031)}.ace-pastel-on-dark .ace_marker-layer .ace_selected-word {border: 1px solid rgba(221, 240, 255, 0.20)}.ace-pastel-on-dark .ace_invisible {color: rgba(255, 255, 255, 0.25)}.ace-pastel-on-dark .ace_keyword,.ace-pastel-on-dark .ace_meta {color: #757aD8}.ace-pastel-on-dark .ace_constant,.ace-pastel-on-dark .ace_constant.ace_character,.ace-pastel-on-dark .ace_constant.ace_character.ace_escape,.ace-pastel-on-dark .ace_constant.ace_other {color: #4FB7C5}.ace-pastel-on-dark .ace_keyword.ace_operator {color: #797878}.ace-pastel-on-dark .ace_constant.ace_character {color: #AFA472}.ace-pastel-on-dark .ace_constant.ace_language {color: #DE8E30}.ace-pastel-on-dark .ace_constant.ace_numeric {color: #CCCCCC}.ace-pastel-on-dark .ace_invalid,.ace-pastel-on-dark .ace_invalid.ace_illegal {color: #F8F8F8;background-color: rgba(86, 45, 86, 0.75)}.ace-pastel-on-dark .ace_invalid.ace_deprecated {text-decoration: underline;font-style: italic;color: #D2A8A1}.ace-pastel-on-dark .ace_fold {background-color: #757aD8;border-color: #8F938F}.ace-pastel-on-dark .ace_support.ace_function {color: #AEB2F8}.ace-pastel-on-dark .ace_string {color: #66A968}.ace-pastel-on-dark .ace_string.ace_regexp {color: #E9C062}.ace-pastel-on-dark .ace_comment {color: #A6C6FF}.ace-pastel-on-dark .ace_variable {color: #BEBF55}.ace-pastel-on-dark .ace_variable.ace_language {color: #C1C144}.ace-pastel-on-dark .ace_xml-pe {color: #494949}.ace-pastel-on-dark .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGBgYIiPj/8PAARgAh2NTMh8AAAAAElFTkSuQmCC) right repeat-y}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}); (function() { window.require(["ace/theme/pastel_on_dark"], function(m) { if (typeof module == "object" && typeof exports == "object" && module) { module.exports = m; } }); })(); ================================================ FILE: pyp5js/http_local/static/js/ace/theme-solarized_dark.js ================================================ define("ace/theme/solarized_dark",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!0,t.cssClass="ace-solarized-dark",t.cssText=".ace-solarized-dark .ace_gutter {background: #01313f;color: #d0edf7}.ace-solarized-dark .ace_print-margin {width: 1px;background: #33555E}.ace-solarized-dark {background-color: #002B36;color: #93A1A1}.ace-solarized-dark .ace_entity.ace_other.ace_attribute-name,.ace-solarized-dark .ace_storage {color: #93A1A1}.ace-solarized-dark .ace_cursor,.ace-solarized-dark .ace_string.ace_regexp {color: #D30102}.ace-solarized-dark .ace_marker-layer .ace_active-line,.ace-solarized-dark .ace_marker-layer .ace_selection {background: rgba(255, 255, 255, 0.1)}.ace-solarized-dark.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #002B36;}.ace-solarized-dark .ace_marker-layer .ace_step {background: rgb(102, 82, 0)}.ace-solarized-dark .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgba(147, 161, 161, 0.50)}.ace-solarized-dark .ace_gutter-active-line {background-color: #0d3440}.ace-solarized-dark .ace_marker-layer .ace_selected-word {border: 1px solid #073642}.ace-solarized-dark .ace_invisible {color: rgba(147, 161, 161, 0.50)}.ace-solarized-dark .ace_keyword,.ace-solarized-dark .ace_meta,.ace-solarized-dark .ace_support.ace_class,.ace-solarized-dark .ace_support.ace_type {color: #859900}.ace-solarized-dark .ace_constant.ace_character,.ace-solarized-dark .ace_constant.ace_other {color: #CB4B16}.ace-solarized-dark .ace_constant.ace_language {color: #B58900}.ace-solarized-dark .ace_constant.ace_numeric {color: #D33682}.ace-solarized-dark .ace_fold {background-color: #268BD2;border-color: #93A1A1}.ace-solarized-dark .ace_entity.ace_name.ace_function,.ace-solarized-dark .ace_entity.ace_name.ace_tag,.ace-solarized-dark .ace_support.ace_function,.ace-solarized-dark .ace_variable,.ace-solarized-dark .ace_variable.ace_language {color: #268BD2}.ace-solarized-dark .ace_string {color: #2AA198}.ace-solarized-dark .ace_comment {font-style: italic;color: #657B83}.ace-solarized-dark .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNg0Db1ZVCxc/sPAAd4AlUHlLenAAAAAElFTkSuQmCC) right repeat-y}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}); (function() { window.require(["ace/theme/solarized_dark"], function(m) { if (typeof module == "object" && typeof exports == "object" && module) { module.exports = m; } }); })(); ================================================ FILE: pyp5js/http_local/static/js/ace/theme-solarized_light.js ================================================ define("ace/theme/solarized_light",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!1,t.cssClass="ace-solarized-light",t.cssText=".ace-solarized-light .ace_gutter {background: #fbf1d3;color: #333}.ace-solarized-light .ace_print-margin {width: 1px;background: #e8e8e8}.ace-solarized-light {background-color: #FDF6E3;color: #586E75}.ace-solarized-light .ace_cursor {color: #000000}.ace-solarized-light .ace_marker-layer .ace_selection {background: rgba(7, 54, 67, 0.09)}.ace-solarized-light.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #FDF6E3;}.ace-solarized-light .ace_marker-layer .ace_step {background: rgb(255, 255, 0)}.ace-solarized-light .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgba(147, 161, 161, 0.50)}.ace-solarized-light .ace_marker-layer .ace_active-line {background: #EEE8D5}.ace-solarized-light .ace_gutter-active-line {background-color : #EDE5C1}.ace-solarized-light .ace_marker-layer .ace_selected-word {border: 1px solid #7f9390}.ace-solarized-light .ace_invisible {color: rgba(147, 161, 161, 0.50)}.ace-solarized-light .ace_keyword,.ace-solarized-light .ace_meta,.ace-solarized-light .ace_support.ace_class,.ace-solarized-light .ace_support.ace_type {color: #859900}.ace-solarized-light .ace_constant.ace_character,.ace-solarized-light .ace_constant.ace_other {color: #CB4B16}.ace-solarized-light .ace_constant.ace_language {color: #B58900}.ace-solarized-light .ace_constant.ace_numeric {color: #D33682}.ace-solarized-light .ace_fold {background-color: #268BD2;border-color: #586E75}.ace-solarized-light .ace_entity.ace_name.ace_function,.ace-solarized-light .ace_entity.ace_name.ace_tag,.ace-solarized-light .ace_support.ace_function,.ace-solarized-light .ace_variable,.ace-solarized-light .ace_variable.ace_language {color: #268BD2}.ace-solarized-light .ace_storage {color: #073642}.ace-solarized-light .ace_string {color: #2AA198}.ace-solarized-light .ace_string.ace_regexp {color: #D30102}.ace-solarized-light .ace_comment,.ace-solarized-light .ace_entity.ace_other.ace_attribute-name {color: #93A1A1}.ace-solarized-light .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGBgYHjy8NJ/AAjgA5fzQUmBAAAAAElFTkSuQmCC) right repeat-y}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}); (function() { window.require(["ace/theme/solarized_light"], function(m) { if (typeof module == "object" && typeof exports == "object" && module) { module.exports = m; } }); })(); ================================================ FILE: pyp5js/http_local/static/js/ace/theme-sqlserver.js ================================================ define("ace/theme/sqlserver",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!1,t.cssClass="ace-sqlserver",t.cssText='.ace-sqlserver .ace_gutter {background: #ebebeb;color: #333;overflow: hidden;}.ace-sqlserver .ace_print-margin {width: 1px;background: #e8e8e8;}.ace-sqlserver {background-color: #FFFFFF;color: black;}.ace-sqlserver .ace_identifier {color: black;}.ace-sqlserver .ace_keyword {color: #0000FF;}.ace-sqlserver .ace_numeric {color: black;}.ace-sqlserver .ace_storage {color: #11B7BE;}.ace-sqlserver .ace_keyword.ace_operator,.ace-sqlserver .ace_lparen,.ace-sqlserver .ace_rparen,.ace-sqlserver .ace_punctuation {color: #808080;}.ace-sqlserver .ace_set.ace_statement {color: #0000FF;text-decoration: underline;}.ace-sqlserver .ace_cursor {color: black;}.ace-sqlserver .ace_invisible {color: rgb(191, 191, 191);}.ace-sqlserver .ace_constant.ace_buildin {color: rgb(88, 72, 246);}.ace-sqlserver .ace_constant.ace_language {color: #979797;}.ace-sqlserver .ace_constant.ace_library {color: rgb(6, 150, 14);}.ace-sqlserver .ace_invalid {background-color: rgb(153, 0, 0);color: white;}.ace-sqlserver .ace_support.ace_function {color: #FF00FF;}.ace-sqlserver .ace_support.ace_constant {color: rgb(6, 150, 14);}.ace-sqlserver .ace_class {color: #008080;}.ace-sqlserver .ace_support.ace_other {color: #6D79DE;}.ace-sqlserver .ace_variable.ace_parameter {font-style: italic;color: #FD971F;}.ace-sqlserver .ace_comment {color: #008000;}.ace-sqlserver .ace_constant.ace_numeric {color: black;}.ace-sqlserver .ace_variable {color: rgb(49, 132, 149);}.ace-sqlserver .ace_xml-pe {color: rgb(104, 104, 91);}.ace-sqlserver .ace_support.ace_storedprocedure {color: #800000;}.ace-sqlserver .ace_heading {color: rgb(12, 7, 255);}.ace-sqlserver .ace_list {color: rgb(185, 6, 144);}.ace-sqlserver .ace_marker-layer .ace_selection {background: rgb(181, 213, 255);}.ace-sqlserver .ace_marker-layer .ace_step {background: rgb(252, 255, 0);}.ace-sqlserver .ace_marker-layer .ace_stack {background: rgb(164, 229, 101);}.ace-sqlserver .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgb(192, 192, 192);}.ace-sqlserver .ace_marker-layer .ace_active-line {background: rgba(0, 0, 0, 0.07);}.ace-sqlserver .ace_gutter-active-line {background-color: #dcdcdc;}.ace-sqlserver .ace_marker-layer .ace_selected-word {background: rgb(250, 250, 255);border: 1px solid rgb(200, 200, 250);}.ace-sqlserver .ace_meta.ace_tag {color: #0000FF;}.ace-sqlserver .ace_string.ace_regex {color: #FF0000;}.ace-sqlserver .ace_string {color: #FF0000;}.ace-sqlserver .ace_entity.ace_other.ace_attribute-name {color: #994409;}.ace-sqlserver .ace_indent-guide {background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y;}';var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}); (function() { window.require(["ace/theme/sqlserver"], function(m) { if (typeof module == "object" && typeof exports == "object" && module) { module.exports = m; } }); })(); ================================================ FILE: pyp5js/http_local/static/js/ace/theme-terminal.js ================================================ define("ace/theme/terminal",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!0,t.cssClass="ace-terminal-theme",t.cssText=".ace-terminal-theme .ace_gutter {background: #1a0005;color: steelblue}.ace-terminal-theme .ace_print-margin {width: 1px;background: #1a1a1a}.ace-terminal-theme {background-color: black;color: #DEDEDE}.ace-terminal-theme .ace_cursor {color: #9F9F9F}.ace-terminal-theme .ace_marker-layer .ace_selection {background: #424242}.ace-terminal-theme.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px black;}.ace-terminal-theme .ace_marker-layer .ace_step {background: rgb(0, 0, 0)}.ace-terminal-theme .ace_marker-layer .ace_bracket {background: #090;}.ace-terminal-theme .ace_marker-layer .ace_bracket-start {background: #090;}.ace-terminal-theme .ace_marker-layer .ace_bracket-unmatched {margin: -1px 0 0 -1px;border: 1px solid #900}.ace-terminal-theme .ace_marker-layer .ace_active-line {background: #2A2A2A}.ace-terminal-theme .ace_gutter-active-line {background-color: #2A112A}.ace-terminal-theme .ace_marker-layer .ace_selected-word {border: 1px solid #424242}.ace-terminal-theme .ace_invisible {color: #343434}.ace-terminal-theme .ace_keyword,.ace-terminal-theme .ace_meta,.ace-terminal-theme .ace_storage,.ace-terminal-theme .ace_storage.ace_type,.ace-terminal-theme .ace_support.ace_type {color: tomato}.ace-terminal-theme .ace_keyword.ace_operator {color: deeppink}.ace-terminal-theme .ace_constant.ace_character,.ace-terminal-theme .ace_constant.ace_language,.ace-terminal-theme .ace_constant.ace_numeric,.ace-terminal-theme .ace_keyword.ace_other.ace_unit,.ace-terminal-theme .ace_support.ace_constant,.ace-terminal-theme .ace_variable.ace_parameter {color: #E78C45}.ace-terminal-theme .ace_constant.ace_other {color: gold}.ace-terminal-theme .ace_invalid {color: yellow;background-color: red}.ace-terminal-theme .ace_invalid.ace_deprecated {color: #CED2CF;background-color: #B798BF}.ace-terminal-theme .ace_fold {background-color: #7AA6DA;border-color: #DEDEDE}.ace-terminal-theme .ace_entity.ace_name.ace_function,.ace-terminal-theme .ace_support.ace_function,.ace-terminal-theme .ace_variable {color: #7AA6DA}.ace-terminal-theme .ace_support.ace_class,.ace-terminal-theme .ace_support.ace_type {color: #E7C547}.ace-terminal-theme .ace_heading,.ace-terminal-theme .ace_string {color: #B9CA4A}.ace-terminal-theme .ace_entity.ace_name.ace_tag,.ace-terminal-theme .ace_entity.ace_other.ace_attribute-name,.ace-terminal-theme .ace_meta.ace_tag,.ace-terminal-theme .ace_string.ace_regexp,.ace-terminal-theme .ace_variable {color: #D54E53}.ace-terminal-theme .ace_comment {color: orangered}.ace-terminal-theme .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGBgYLBWV/8PAAK4AYnhiq+xAAAAAElFTkSuQmCC) right repeat-y;}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}); (function() { window.require(["ace/theme/terminal"], function(m) { if (typeof module == "object" && typeof exports == "object" && module) { module.exports = m; } }); })(); ================================================ FILE: pyp5js/http_local/static/js/ace/theme-textmate.js ================================================ define("ace/theme/textmate",["require","exports","module","ace/lib/dom"],function(e,t,n){"use strict";t.isDark=!1,t.cssClass="ace-tm",t.cssText='.ace-tm .ace_gutter {background: #f0f0f0;color: #333;}.ace-tm .ace_print-margin {width: 1px;background: #e8e8e8;}.ace-tm .ace_fold {background-color: #6B72E6;}.ace-tm {background-color: #FFFFFF;color: black;}.ace-tm .ace_cursor {color: black;}.ace-tm .ace_invisible {color: rgb(191, 191, 191);}.ace-tm .ace_storage,.ace-tm .ace_keyword {color: blue;}.ace-tm .ace_constant {color: rgb(197, 6, 11);}.ace-tm .ace_constant.ace_buildin {color: rgb(88, 72, 246);}.ace-tm .ace_constant.ace_language {color: rgb(88, 92, 246);}.ace-tm .ace_constant.ace_library {color: rgb(6, 150, 14);}.ace-tm .ace_invalid {background-color: rgba(255, 0, 0, 0.1);color: red;}.ace-tm .ace_support.ace_function {color: rgb(60, 76, 114);}.ace-tm .ace_support.ace_constant {color: rgb(6, 150, 14);}.ace-tm .ace_support.ace_type,.ace-tm .ace_support.ace_class {color: rgb(109, 121, 222);}.ace-tm .ace_keyword.ace_operator {color: rgb(104, 118, 135);}.ace-tm .ace_string {color: rgb(3, 106, 7);}.ace-tm .ace_comment {color: rgb(76, 136, 107);}.ace-tm .ace_comment.ace_doc {color: rgb(0, 102, 255);}.ace-tm .ace_comment.ace_doc.ace_tag {color: rgb(128, 159, 191);}.ace-tm .ace_constant.ace_numeric {color: rgb(0, 0, 205);}.ace-tm .ace_variable {color: rgb(49, 132, 149);}.ace-tm .ace_xml-pe {color: rgb(104, 104, 91);}.ace-tm .ace_entity.ace_name.ace_function {color: #0000A2;}.ace-tm .ace_heading {color: rgb(12, 7, 255);}.ace-tm .ace_list {color:rgb(185, 6, 144);}.ace-tm .ace_meta.ace_tag {color:rgb(0, 22, 142);}.ace-tm .ace_string.ace_regex {color: rgb(255, 0, 0)}.ace-tm .ace_marker-layer .ace_selection {background: rgb(181, 213, 255);}.ace-tm.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px white;}.ace-tm .ace_marker-layer .ace_step {background: rgb(252, 255, 0);}.ace-tm .ace_marker-layer .ace_stack {background: rgb(164, 229, 101);}.ace-tm .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgb(192, 192, 192);}.ace-tm .ace_marker-layer .ace_active-line {background: rgba(0, 0, 0, 0.07);}.ace-tm .ace_gutter-active-line {background-color : #dcdcdc;}.ace-tm .ace_marker-layer .ace_selected-word {background: rgb(250, 250, 255);border: 1px solid rgb(200, 200, 250);}.ace-tm .ace_indent-guide {background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y;}',t.$id="ace/theme/textmate";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}); (function() { window.require(["ace/theme/textmate"], function(m) { if (typeof module == "object" && typeof exports == "object" && module) { module.exports = m; } }); })(); ================================================ FILE: pyp5js/http_local/static/js/ace/theme-tomorrow.js ================================================ define("ace/theme/tomorrow",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!1,t.cssClass="ace-tomorrow",t.cssText=".ace-tomorrow .ace_gutter {background: #f6f6f6;color: #4D4D4C}.ace-tomorrow .ace_print-margin {width: 1px;background: #f6f6f6}.ace-tomorrow {background-color: #FFFFFF;color: #4D4D4C}.ace-tomorrow .ace_cursor {color: #AEAFAD}.ace-tomorrow .ace_marker-layer .ace_selection {background: #D6D6D6}.ace-tomorrow.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #FFFFFF;}.ace-tomorrow .ace_marker-layer .ace_step {background: rgb(255, 255, 0)}.ace-tomorrow .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid #D1D1D1}.ace-tomorrow .ace_marker-layer .ace_active-line {background: #EFEFEF}.ace-tomorrow .ace_gutter-active-line {background-color : #dcdcdc}.ace-tomorrow .ace_marker-layer .ace_selected-word {border: 1px solid #D6D6D6}.ace-tomorrow .ace_invisible {color: #D1D1D1}.ace-tomorrow .ace_keyword,.ace-tomorrow .ace_meta,.ace-tomorrow .ace_storage,.ace-tomorrow .ace_storage.ace_type,.ace-tomorrow .ace_support.ace_type {color: #8959A8}.ace-tomorrow .ace_keyword.ace_operator {color: #3E999F}.ace-tomorrow .ace_constant.ace_character,.ace-tomorrow .ace_constant.ace_language,.ace-tomorrow .ace_constant.ace_numeric,.ace-tomorrow .ace_keyword.ace_other.ace_unit,.ace-tomorrow .ace_support.ace_constant,.ace-tomorrow .ace_variable.ace_parameter {color: #F5871F}.ace-tomorrow .ace_constant.ace_other {color: #666969}.ace-tomorrow .ace_invalid {color: #FFFFFF;background-color: #C82829}.ace-tomorrow .ace_invalid.ace_deprecated {color: #FFFFFF;background-color: #8959A8}.ace-tomorrow .ace_fold {background-color: #4271AE;border-color: #4D4D4C}.ace-tomorrow .ace_entity.ace_name.ace_function,.ace-tomorrow .ace_support.ace_function,.ace-tomorrow .ace_variable {color: #4271AE}.ace-tomorrow .ace_support.ace_class,.ace-tomorrow .ace_support.ace_type {color: #C99E00}.ace-tomorrow .ace_heading,.ace-tomorrow .ace_markup.ace_heading,.ace-tomorrow .ace_string {color: #718C00}.ace-tomorrow .ace_entity.ace_name.ace_tag,.ace-tomorrow .ace_entity.ace_other.ace_attribute-name,.ace-tomorrow .ace_meta.ace_tag,.ace-tomorrow .ace_string.ace_regexp,.ace-tomorrow .ace_variable {color: #C82829}.ace-tomorrow .ace_comment {color: #8E908C}.ace-tomorrow .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bdu3f/BwAlfgctduB85QAAAABJRU5ErkJggg==) right repeat-y}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}); (function() { window.require(["ace/theme/tomorrow"], function(m) { if (typeof module == "object" && typeof exports == "object" && module) { module.exports = m; } }); })(); ================================================ FILE: pyp5js/http_local/static/js/ace/theme-tomorrow_night.js ================================================ define("ace/theme/tomorrow_night",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!0,t.cssClass="ace-tomorrow-night",t.cssText=".ace-tomorrow-night .ace_gutter {background: #25282c;color: #C5C8C6}.ace-tomorrow-night .ace_print-margin {width: 1px;background: #25282c}.ace-tomorrow-night {background-color: #1D1F21;color: #C5C8C6}.ace-tomorrow-night .ace_cursor {color: #AEAFAD}.ace-tomorrow-night .ace_marker-layer .ace_selection {background: #373B41}.ace-tomorrow-night.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #1D1F21;}.ace-tomorrow-night .ace_marker-layer .ace_step {background: rgb(102, 82, 0)}.ace-tomorrow-night .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid #4B4E55}.ace-tomorrow-night .ace_marker-layer .ace_active-line {background: #282A2E}.ace-tomorrow-night .ace_gutter-active-line {background-color: #282A2E}.ace-tomorrow-night .ace_marker-layer .ace_selected-word {border: 1px solid #373B41}.ace-tomorrow-night .ace_invisible {color: #4B4E55}.ace-tomorrow-night .ace_keyword,.ace-tomorrow-night .ace_meta,.ace-tomorrow-night .ace_storage,.ace-tomorrow-night .ace_storage.ace_type,.ace-tomorrow-night .ace_support.ace_type {color: #B294BB}.ace-tomorrow-night .ace_keyword.ace_operator {color: #8ABEB7}.ace-tomorrow-night .ace_constant.ace_character,.ace-tomorrow-night .ace_constant.ace_language,.ace-tomorrow-night .ace_constant.ace_numeric,.ace-tomorrow-night .ace_keyword.ace_other.ace_unit,.ace-tomorrow-night .ace_support.ace_constant,.ace-tomorrow-night .ace_variable.ace_parameter {color: #DE935F}.ace-tomorrow-night .ace_constant.ace_other {color: #CED1CF}.ace-tomorrow-night .ace_invalid {color: #CED2CF;background-color: #DF5F5F}.ace-tomorrow-night .ace_invalid.ace_deprecated {color: #CED2CF;background-color: #B798BF}.ace-tomorrow-night .ace_fold {background-color: #81A2BE;border-color: #C5C8C6}.ace-tomorrow-night .ace_entity.ace_name.ace_function,.ace-tomorrow-night .ace_support.ace_function,.ace-tomorrow-night .ace_variable {color: #81A2BE}.ace-tomorrow-night .ace_support.ace_class,.ace-tomorrow-night .ace_support.ace_type {color: #F0C674}.ace-tomorrow-night .ace_heading,.ace-tomorrow-night .ace_markup.ace_heading,.ace-tomorrow-night .ace_string {color: #B5BD68}.ace-tomorrow-night .ace_entity.ace_name.ace_tag,.ace-tomorrow-night .ace_entity.ace_other.ace_attribute-name,.ace-tomorrow-night .ace_meta.ace_tag,.ace-tomorrow-night .ace_string.ace_regexp,.ace-tomorrow-night .ace_variable {color: #CC6666}.ace-tomorrow-night .ace_comment {color: #969896}.ace-tomorrow-night .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGBgYHB3d/8PAAOIAdULw8qMAAAAAElFTkSuQmCC) right repeat-y}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}); (function() { window.require(["ace/theme/tomorrow_night"], function(m) { if (typeof module == "object" && typeof exports == "object" && module) { module.exports = m; } }); })(); ================================================ FILE: pyp5js/http_local/static/js/ace/theme-tomorrow_night_blue.js ================================================ define("ace/theme/tomorrow_night_blue",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!0,t.cssClass="ace-tomorrow-night-blue",t.cssText=".ace-tomorrow-night-blue .ace_gutter {background: #00204b;color: #7388b5}.ace-tomorrow-night-blue .ace_print-margin {width: 1px;background: #00204b}.ace-tomorrow-night-blue {background-color: #002451;color: #FFFFFF}.ace-tomorrow-night-blue .ace_constant.ace_other,.ace-tomorrow-night-blue .ace_cursor {color: #FFFFFF}.ace-tomorrow-night-blue .ace_marker-layer .ace_selection {background: #003F8E}.ace-tomorrow-night-blue.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #002451;}.ace-tomorrow-night-blue .ace_marker-layer .ace_step {background: rgb(127, 111, 19)}.ace-tomorrow-night-blue .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid #404F7D}.ace-tomorrow-night-blue .ace_marker-layer .ace_active-line {background: #00346E}.ace-tomorrow-night-blue .ace_gutter-active-line {background-color: #022040}.ace-tomorrow-night-blue .ace_marker-layer .ace_selected-word {border: 1px solid #003F8E}.ace-tomorrow-night-blue .ace_invisible {color: #404F7D}.ace-tomorrow-night-blue .ace_keyword,.ace-tomorrow-night-blue .ace_meta,.ace-tomorrow-night-blue .ace_storage,.ace-tomorrow-night-blue .ace_storage.ace_type,.ace-tomorrow-night-blue .ace_support.ace_type {color: #EBBBFF}.ace-tomorrow-night-blue .ace_keyword.ace_operator {color: #99FFFF}.ace-tomorrow-night-blue .ace_constant.ace_character,.ace-tomorrow-night-blue .ace_constant.ace_language,.ace-tomorrow-night-blue .ace_constant.ace_numeric,.ace-tomorrow-night-blue .ace_keyword.ace_other.ace_unit,.ace-tomorrow-night-blue .ace_support.ace_constant,.ace-tomorrow-night-blue .ace_variable.ace_parameter {color: #FFC58F}.ace-tomorrow-night-blue .ace_invalid {color: #FFFFFF;background-color: #F99DA5}.ace-tomorrow-night-blue .ace_invalid.ace_deprecated {color: #FFFFFF;background-color: #EBBBFF}.ace-tomorrow-night-blue .ace_fold {background-color: #BBDAFF;border-color: #FFFFFF}.ace-tomorrow-night-blue .ace_entity.ace_name.ace_function,.ace-tomorrow-night-blue .ace_support.ace_function,.ace-tomorrow-night-blue .ace_variable {color: #BBDAFF}.ace-tomorrow-night-blue .ace_support.ace_class,.ace-tomorrow-night-blue .ace_support.ace_type {color: #FFEEAD}.ace-tomorrow-night-blue .ace_heading,.ace-tomorrow-night-blue .ace_markup.ace_heading,.ace-tomorrow-night-blue .ace_string {color: #D1F1A9}.ace-tomorrow-night-blue .ace_entity.ace_name.ace_tag,.ace-tomorrow-night-blue .ace_entity.ace_other.ace_attribute-name,.ace-tomorrow-night-blue .ace_meta.ace_tag,.ace-tomorrow-night-blue .ace_string.ace_regexp,.ace-tomorrow-night-blue .ace_variable {color: #FF9DA4}.ace-tomorrow-night-blue .ace_comment {color: #7285B7}.ace-tomorrow-night-blue .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGBgYJDzqfwPAANXAeNsiA+ZAAAAAElFTkSuQmCC) right repeat-y}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}); (function() { window.require(["ace/theme/tomorrow_night_blue"], function(m) { if (typeof module == "object" && typeof exports == "object" && module) { module.exports = m; } }); })(); ================================================ FILE: pyp5js/http_local/static/js/ace/theme-tomorrow_night_bright.js ================================================ define("ace/theme/tomorrow_night_bright",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!0,t.cssClass="ace-tomorrow-night-bright",t.cssText=".ace-tomorrow-night-bright .ace_gutter {background: #1a1a1a;color: #DEDEDE}.ace-tomorrow-night-bright .ace_print-margin {width: 1px;background: #1a1a1a}.ace-tomorrow-night-bright {background-color: #000000;color: #DEDEDE}.ace-tomorrow-night-bright .ace_cursor {color: #9F9F9F}.ace-tomorrow-night-bright .ace_marker-layer .ace_selection {background: #424242}.ace-tomorrow-night-bright.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #000000;}.ace-tomorrow-night-bright .ace_marker-layer .ace_step {background: rgb(102, 82, 0)}.ace-tomorrow-night-bright .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid #888888}.ace-tomorrow-night-bright .ace_marker-layer .ace_highlight {border: 1px solid rgb(110, 119, 0);border-bottom: 0;box-shadow: inset 0 -1px rgb(110, 119, 0);margin: -1px 0 0 -1px;background: rgba(255, 235, 0, 0.1)}.ace-tomorrow-night-bright .ace_marker-layer .ace_active-line {background: #2A2A2A}.ace-tomorrow-night-bright .ace_gutter-active-line {background-color: #2A2A2A}.ace-tomorrow-night-bright .ace_stack {background-color: rgb(66, 90, 44)}.ace-tomorrow-night-bright .ace_marker-layer .ace_selected-word {border: 1px solid #888888}.ace-tomorrow-night-bright .ace_invisible {color: #343434}.ace-tomorrow-night-bright .ace_keyword,.ace-tomorrow-night-bright .ace_meta,.ace-tomorrow-night-bright .ace_storage,.ace-tomorrow-night-bright .ace_storage.ace_type,.ace-tomorrow-night-bright .ace_support.ace_type {color: #C397D8}.ace-tomorrow-night-bright .ace_keyword.ace_operator {color: #70C0B1}.ace-tomorrow-night-bright .ace_constant.ace_character,.ace-tomorrow-night-bright .ace_constant.ace_language,.ace-tomorrow-night-bright .ace_constant.ace_numeric,.ace-tomorrow-night-bright .ace_keyword.ace_other.ace_unit,.ace-tomorrow-night-bright .ace_support.ace_constant,.ace-tomorrow-night-bright .ace_variable.ace_parameter {color: #E78C45}.ace-tomorrow-night-bright .ace_constant.ace_other {color: #EEEEEE}.ace-tomorrow-night-bright .ace_invalid {color: #CED2CF;background-color: #DF5F5F}.ace-tomorrow-night-bright .ace_invalid.ace_deprecated {color: #CED2CF;background-color: #B798BF}.ace-tomorrow-night-bright .ace_fold {background-color: #7AA6DA;border-color: #DEDEDE}.ace-tomorrow-night-bright .ace_entity.ace_name.ace_function,.ace-tomorrow-night-bright .ace_support.ace_function,.ace-tomorrow-night-bright .ace_variable {color: #7AA6DA}.ace-tomorrow-night-bright .ace_support.ace_class,.ace-tomorrow-night-bright .ace_support.ace_type {color: #E7C547}.ace-tomorrow-night-bright .ace_heading,.ace-tomorrow-night-bright .ace_markup.ace_heading,.ace-tomorrow-night-bright .ace_string {color: #B9CA4A}.ace-tomorrow-night-bright .ace_entity.ace_name.ace_tag,.ace-tomorrow-night-bright .ace_entity.ace_other.ace_attribute-name,.ace-tomorrow-night-bright .ace_meta.ace_tag,.ace-tomorrow-night-bright .ace_string.ace_regexp,.ace-tomorrow-night-bright .ace_variable {color: #D54E53}.ace-tomorrow-night-bright .ace_comment {color: #969896}.ace-tomorrow-night-bright .ace_c9searchresults.ace_keyword {color: #C2C280}.ace-tomorrow-night-bright .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGBgYFBXV/8PAAJoAXX4kT2EAAAAAElFTkSuQmCC) right repeat-y}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}); (function() { window.require(["ace/theme/tomorrow_night_bright"], function(m) { if (typeof module == "object" && typeof exports == "object" && module) { module.exports = m; } }); })(); ================================================ FILE: pyp5js/http_local/static/js/ace/theme-tomorrow_night_eighties.js ================================================ define("ace/theme/tomorrow_night_eighties",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!0,t.cssClass="ace-tomorrow-night-eighties",t.cssText=".ace-tomorrow-night-eighties .ace_gutter {background: #272727;color: #CCC}.ace-tomorrow-night-eighties .ace_print-margin {width: 1px;background: #272727}.ace-tomorrow-night-eighties {background-color: #2D2D2D;color: #CCCCCC}.ace-tomorrow-night-eighties .ace_constant.ace_other,.ace-tomorrow-night-eighties .ace_cursor {color: #CCCCCC}.ace-tomorrow-night-eighties .ace_marker-layer .ace_selection {background: #515151}.ace-tomorrow-night-eighties.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #2D2D2D;}.ace-tomorrow-night-eighties .ace_marker-layer .ace_step {background: rgb(102, 82, 0)}.ace-tomorrow-night-eighties .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid #6A6A6A}.ace-tomorrow-night-bright .ace_stack {background: rgb(66, 90, 44)}.ace-tomorrow-night-eighties .ace_marker-layer .ace_active-line {background: #393939}.ace-tomorrow-night-eighties .ace_gutter-active-line {background-color: #393939}.ace-tomorrow-night-eighties .ace_marker-layer .ace_selected-word {border: 1px solid #515151}.ace-tomorrow-night-eighties .ace_invisible {color: #6A6A6A}.ace-tomorrow-night-eighties .ace_keyword,.ace-tomorrow-night-eighties .ace_meta,.ace-tomorrow-night-eighties .ace_storage,.ace-tomorrow-night-eighties .ace_storage.ace_type,.ace-tomorrow-night-eighties .ace_support.ace_type {color: #CC99CC}.ace-tomorrow-night-eighties .ace_keyword.ace_operator {color: #66CCCC}.ace-tomorrow-night-eighties .ace_constant.ace_character,.ace-tomorrow-night-eighties .ace_constant.ace_language,.ace-tomorrow-night-eighties .ace_constant.ace_numeric,.ace-tomorrow-night-eighties .ace_keyword.ace_other.ace_unit,.ace-tomorrow-night-eighties .ace_support.ace_constant,.ace-tomorrow-night-eighties .ace_variable.ace_parameter {color: #F99157}.ace-tomorrow-night-eighties .ace_invalid {color: #CDCDCD;background-color: #F2777A}.ace-tomorrow-night-eighties .ace_invalid.ace_deprecated {color: #CDCDCD;background-color: #CC99CC}.ace-tomorrow-night-eighties .ace_fold {background-color: #6699CC;border-color: #CCCCCC}.ace-tomorrow-night-eighties .ace_entity.ace_name.ace_function,.ace-tomorrow-night-eighties .ace_support.ace_function,.ace-tomorrow-night-eighties .ace_variable {color: #6699CC}.ace-tomorrow-night-eighties .ace_support.ace_class,.ace-tomorrow-night-eighties .ace_support.ace_type {color: #FFCC66}.ace-tomorrow-night-eighties .ace_heading,.ace-tomorrow-night-eighties .ace_markup.ace_heading,.ace-tomorrow-night-eighties .ace_string {color: #99CC99}.ace-tomorrow-night-eighties .ace_comment {color: #999999}.ace-tomorrow-night-eighties .ace_entity.ace_name.ace_tag,.ace-tomorrow-night-eighties .ace_entity.ace_other.ace_attribute-name,.ace-tomorrow-night-eighties .ace_meta.ace_tag,.ace-tomorrow-night-eighties .ace_variable {color: #F2777A}.ace-tomorrow-night-eighties .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWPQ09NrYAgMjP4PAAtGAwchHMyAAAAAAElFTkSuQmCC) right repeat-y}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}); (function() { window.require(["ace/theme/tomorrow_night_eighties"], function(m) { if (typeof module == "object" && typeof exports == "object" && module) { module.exports = m; } }); })(); ================================================ FILE: pyp5js/http_local/static/js/ace/theme-twilight.js ================================================ define("ace/theme/twilight",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!0,t.cssClass="ace-twilight",t.cssText=".ace-twilight .ace_gutter {background: #232323;color: #E2E2E2}.ace-twilight .ace_print-margin {width: 1px;background: #232323}.ace-twilight {background-color: #141414;color: #F8F8F8}.ace-twilight .ace_cursor {color: #A7A7A7}.ace-twilight .ace_marker-layer .ace_selection {background: rgba(221, 240, 255, 0.20)}.ace-twilight.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #141414;}.ace-twilight .ace_marker-layer .ace_step {background: rgb(102, 82, 0)}.ace-twilight .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgba(255, 255, 255, 0.25)}.ace-twilight .ace_marker-layer .ace_active-line {background: rgba(255, 255, 255, 0.031)}.ace-twilight .ace_gutter-active-line {background-color: rgba(255, 255, 255, 0.031)}.ace-twilight .ace_marker-layer .ace_selected-word {border: 1px solid rgba(221, 240, 255, 0.20)}.ace-twilight .ace_invisible {color: rgba(255, 255, 255, 0.25)}.ace-twilight .ace_keyword,.ace-twilight .ace_meta {color: #CDA869}.ace-twilight .ace_constant,.ace-twilight .ace_constant.ace_character,.ace-twilight .ace_constant.ace_character.ace_escape,.ace-twilight .ace_constant.ace_other,.ace-twilight .ace_heading,.ace-twilight .ace_markup.ace_heading,.ace-twilight .ace_support.ace_constant {color: #CF6A4C}.ace-twilight .ace_invalid.ace_illegal {color: #F8F8F8;background-color: rgba(86, 45, 86, 0.75)}.ace-twilight .ace_invalid.ace_deprecated {text-decoration: underline;font-style: italic;color: #D2A8A1}.ace-twilight .ace_support {color: #9B859D}.ace-twilight .ace_fold {background-color: #AC885B;border-color: #F8F8F8}.ace-twilight .ace_support.ace_function {color: #DAD085}.ace-twilight .ace_list,.ace-twilight .ace_markup.ace_list,.ace-twilight .ace_storage {color: #F9EE98}.ace-twilight .ace_entity.ace_name.ace_function,.ace-twilight .ace_meta.ace_tag,.ace-twilight .ace_variable {color: #AC885B}.ace-twilight .ace_string {color: #8F9D6A}.ace-twilight .ace_string.ace_regexp {color: #E9C062}.ace-twilight .ace_comment {font-style: italic;color: #5F5A60}.ace-twilight .ace_variable {color: #7587A6}.ace-twilight .ace_xml-pe {color: #494949}.ace-twilight .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWMQERFpYLC1tf0PAAgOAnPnhxyiAAAAAElFTkSuQmCC) right repeat-y}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}); (function() { window.require(["ace/theme/twilight"], function(m) { if (typeof module == "object" && typeof exports == "object" && module) { module.exports = m; } }); })(); ================================================ FILE: pyp5js/http_local/static/js/ace/theme-vibrant_ink.js ================================================ define("ace/theme/vibrant_ink",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!0,t.cssClass="ace-vibrant-ink",t.cssText=".ace-vibrant-ink .ace_gutter {background: #1a1a1a;color: #BEBEBE}.ace-vibrant-ink .ace_print-margin {width: 1px;background: #1a1a1a}.ace-vibrant-ink {background-color: #0F0F0F;color: #FFFFFF}.ace-vibrant-ink .ace_cursor {color: #FFFFFF}.ace-vibrant-ink .ace_marker-layer .ace_selection {background: #6699CC}.ace-vibrant-ink.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #0F0F0F;}.ace-vibrant-ink .ace_marker-layer .ace_step {background: rgb(102, 82, 0)}.ace-vibrant-ink .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid #404040}.ace-vibrant-ink .ace_marker-layer .ace_active-line {background: #333333}.ace-vibrant-ink .ace_gutter-active-line {background-color: #333333}.ace-vibrant-ink .ace_marker-layer .ace_selected-word {border: 1px solid #6699CC}.ace-vibrant-ink .ace_invisible {color: #404040}.ace-vibrant-ink .ace_keyword,.ace-vibrant-ink .ace_meta {color: #FF6600}.ace-vibrant-ink .ace_constant,.ace-vibrant-ink .ace_constant.ace_character,.ace-vibrant-ink .ace_constant.ace_character.ace_escape,.ace-vibrant-ink .ace_constant.ace_other {color: #339999}.ace-vibrant-ink .ace_constant.ace_numeric {color: #99CC99}.ace-vibrant-ink .ace_invalid,.ace-vibrant-ink .ace_invalid.ace_deprecated {color: #CCFF33;background-color: #000000}.ace-vibrant-ink .ace_fold {background-color: #FFCC00;border-color: #FFFFFF}.ace-vibrant-ink .ace_entity.ace_name.ace_function,.ace-vibrant-ink .ace_support.ace_function,.ace-vibrant-ink .ace_variable {color: #FFCC00}.ace-vibrant-ink .ace_variable.ace_parameter {font-style: italic}.ace-vibrant-ink .ace_string {color: #66FF00}.ace-vibrant-ink .ace_string.ace_regexp {color: #44B4CC}.ace-vibrant-ink .ace_comment {color: #9933CC}.ace-vibrant-ink .ace_entity.ace_other.ace_attribute-name {font-style: italic;color: #99CC99}.ace-vibrant-ink .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGBgYNDTc/oPAALPAZ7hxlbYAAAAAElFTkSuQmCC) right repeat-y}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}); (function() { window.require(["ace/theme/vibrant_ink"], function(m) { if (typeof module == "object" && typeof exports == "object" && module) { module.exports = m; } }); })(); ================================================ FILE: pyp5js/http_local/static/js/ace/theme-xcode.js ================================================ define("ace/theme/xcode",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!1,t.cssClass="ace-xcode",t.cssText=".ace-xcode .ace_gutter {background: #e8e8e8;color: #333}.ace-xcode .ace_print-margin {width: 1px;background: #e8e8e8}.ace-xcode {background-color: #FFFFFF;color: #000000}.ace-xcode .ace_cursor {color: #000000}.ace-xcode .ace_marker-layer .ace_selection {background: #B5D5FF}.ace-xcode.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #FFFFFF;}.ace-xcode .ace_marker-layer .ace_step {background: rgb(198, 219, 174)}.ace-xcode .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid #BFBFBF}.ace-xcode .ace_marker-layer .ace_active-line {background: rgba(0, 0, 0, 0.071)}.ace-xcode .ace_gutter-active-line {background-color: rgba(0, 0, 0, 0.071)}.ace-xcode .ace_marker-layer .ace_selected-word {border: 1px solid #B5D5FF}.ace-xcode .ace_constant.ace_language,.ace-xcode .ace_keyword,.ace-xcode .ace_meta,.ace-xcode .ace_variable.ace_language {color: #C800A4}.ace-xcode .ace_invisible {color: #BFBFBF}.ace-xcode .ace_constant.ace_character,.ace-xcode .ace_constant.ace_other {color: #275A5E}.ace-xcode .ace_constant.ace_numeric {color: #3A00DC}.ace-xcode .ace_entity.ace_other.ace_attribute-name,.ace-xcode .ace_support.ace_constant,.ace-xcode .ace_support.ace_function {color: #450084}.ace-xcode .ace_fold {background-color: #C800A4;border-color: #000000}.ace-xcode .ace_entity.ace_name.ace_tag,.ace-xcode .ace_support.ace_class,.ace-xcode .ace_support.ace_type {color: #790EAD}.ace-xcode .ace_storage {color: #C900A4}.ace-xcode .ace_string {color: #DF0002}.ace-xcode .ace_comment {color: #008E00}.ace-xcode .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==) right repeat-y}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}); (function() { window.require(["ace/theme/xcode"], function(m) { if (typeof module == "object" && typeof exports == "object" && module) { module.exports = m; } }); })(); ================================================ FILE: pyp5js/http_local/static/js/ace/worker-coffee.js ================================================ "no use strict";!function(e){function t(e,t){var n=e,r="";while(n){var i=t[n];if(typeof i=="string")return i+r;if(i)return i.location.replace(/\/*$/,"/")+(r||i.main||i.name);if(i===!1)return"";var s=n.lastIndexOf("/");if(s===-1)break;r=n.substr(s)+r,n=n.slice(0,s)}return e}if(typeof e.window!="undefined"&&e.document)return;if(e.require&&e.define)return;e.console||(e.console=function(){var e=Array.prototype.slice.call(arguments,0);postMessage({type:"log",data:e})},e.console.error=e.console.warn=e.console.log=e.console.trace=e.console),e.window=e,e.ace=e,e.onerror=function(e,t,n,r,i){postMessage({type:"error",data:{message:e,data:i.data,file:t,line:n,col:r,stack:i.stack}})},e.normalizeModule=function(t,n){if(n.indexOf("!")!==-1){var r=n.split("!");return e.normalizeModule(t,r[0])+"!"+e.normalizeModule(t,r[1])}if(n.charAt(0)=="."){var i=t.split("/").slice(0,-1).join("/");n=(i?i+"/":"")+n;while(n.indexOf(".")!==-1&&s!=n){var s=n;n=n.replace(/^\.\//,"").replace(/\/\.\//,"/").replace(/[^\/]+\/\.\.\//,"")}}return n},e.require=function(r,i){i||(i=r,r=null);if(!i.charAt)throw new Error("worker.js require() accepts only (parentId, id) as arguments");i=e.normalizeModule(r,i);var s=e.require.modules[i];if(s)return s.initialized||(s.initialized=!0,s.exports=s.factory().exports),s.exports;if(!e.require.tlns)return console.log("unable to load "+i);var o=t(i,e.require.tlns);return o.slice(-3)!=".js"&&(o+=".js"),e.require.id=i,e.require.modules[i]={},importScripts(o),e.require(r,i)},e.require.modules={},e.require.tlns={},e.define=function(t,n,r){arguments.length==2?(r=n,typeof t!="string"&&(n=t,t=e.require.id)):arguments.length==1&&(r=t,n=[],t=e.require.id);if(typeof r!="function"){e.require.modules[t]={exports:r,initialized:!0};return}n.length||(n=["require","exports","module"]);var i=function(n){return e.require(t,n)};e.require.modules[t]={exports:{},factory:function(){var e=this,t=r.apply(this,n.slice(0,r.length).map(function(t){switch(t){case"require":return i;case"exports":return e.exports;case"module":return e;default:return i(t)}}));return t&&(e.exports=t),e}}},e.define.amd={},require.tlns={},e.initBaseUrls=function(t){for(var n in t)require.tlns[n]=t[n]},e.initSender=function(){var n=e.require("ace/lib/event_emitter").EventEmitter,r=e.require("ace/lib/oop"),i=function(){};return function(){r.implement(this,n),this.callback=function(e,t){postMessage({type:"call",id:t,data:e})},this.emit=function(e,t){postMessage({type:"event",name:e,data:t})}}.call(i.prototype),new i};var n=e.main=null,r=e.sender=null;e.onmessage=function(t){var i=t.data;if(i.event&&r)r._signal(i.event,i.data);else if(i.command)if(n[i.command])n[i.command].apply(n,i.args);else{if(!e[i.command])throw new Error("Unknown command:"+i.command);e[i.command].apply(e,i.args)}else if(i.init){e.initBaseUrls(i.tlns),require("ace/lib/es5-shim"),r=e.sender=e.initSender();var s=require(i.module)[i.classname];n=e.main=new s(r)}}}(this),define("ace/lib/oop",[],function(e,t,n){"use strict";t.inherits=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})},t.mixin=function(e,t){for(var n in t)e[n]=t[n];return e},t.implement=function(e,n){t.mixin(e,n)}}),define("ace/range",[],function(e,t,n){"use strict";var r=function(e,t){return e.row-t.row||e.column-t.column},i=function(e,t,n,r){this.start={row:e,column:t},this.end={row:n,column:r}};(function(){this.isEqual=function(e){return this.start.row===e.start.row&&this.end.row===e.end.row&&this.start.column===e.start.column&&this.end.column===e.end.column},this.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},this.contains=function(e,t){return this.compare(e,t)==0},this.compareRange=function(e){var t,n=e.end,r=e.start;return t=this.compare(n.row,n.column),t==1?(t=this.compare(r.row,r.column),t==1?2:t==0?1:0):t==-1?-2:(t=this.compare(r.row,r.column),t==-1?-1:t==1?42:0)},this.comparePoint=function(e){return this.compare(e.row,e.column)},this.containsRange=function(e){return this.comparePoint(e.start)==0&&this.comparePoint(e.end)==0},this.intersects=function(e){var t=this.compareRange(e);return t==-1||t==0||t==1},this.isEnd=function(e,t){return this.end.row==e&&this.end.column==t},this.isStart=function(e,t){return this.start.row==e&&this.start.column==t},this.setStart=function(e,t){typeof e=="object"?(this.start.column=e.column,this.start.row=e.row):(this.start.row=e,this.start.column=t)},this.setEnd=function(e,t){typeof e=="object"?(this.end.column=e.column,this.end.row=e.row):(this.end.row=e,this.end.column=t)},this.inside=function(e,t){return this.compare(e,t)==0?this.isEnd(e,t)||this.isStart(e,t)?!1:!0:!1},this.insideStart=function(e,t){return this.compare(e,t)==0?this.isEnd(e,t)?!1:!0:!1},this.insideEnd=function(e,t){return this.compare(e,t)==0?this.isStart(e,t)?!1:!0:!1},this.compare=function(e,t){return!this.isMultiLine()&&e===this.start.row?tthis.end.column?1:0:ethis.end.row?1:this.start.row===e?t>=this.start.column?0:-1:this.end.row===e?t<=this.end.column?0:1:0},this.compareStart=function(e,t){return this.start.row==e&&this.start.column==t?-1:this.compare(e,t)},this.compareEnd=function(e,t){return this.end.row==e&&this.end.column==t?1:this.compare(e,t)},this.compareInside=function(e,t){return this.end.row==e&&this.end.column==t?1:this.start.row==e&&this.start.column==t?-1:this.compare(e,t)},this.clipRows=function(e,t){if(this.end.row>t)var n={row:t+1,column:0};else if(this.end.rowt)var r={row:t+1,column:0};else if(this.start.row=0&&t.row=0&&t.column<=e[t.row].length}function s(e,t){t.action!="insert"&&t.action!="remove"&&r(t,"delta.action must be 'insert' or 'remove'"),t.lines instanceof Array||r(t,"delta.lines must be an Array"),(!t.start||!t.end)&&r(t,"delta.start/end must be an present");var n=t.start;i(e,t.start)||r(t,"delta.start must be contained in document");var s=t.end;t.action=="remove"&&!i(e,s)&&r(t,"delta.end must contained in document for 'remove' actions");var o=s.row-n.row,u=s.column-(o==0?n.column:0);(o!=t.lines.length-1||t.lines[o].length!=u)&&r(t,"delta.range must match delta lines")}t.applyDelta=function(e,t,n){var r=t.start.row,i=t.start.column,s=e[r]||"";switch(t.action){case"insert":var o=t.lines;if(o.length===1)e[r]=s.substring(0,i)+t.lines[0]+s.substring(i);else{var u=[r,1].concat(t.lines);e.splice.apply(e,u),e[r]=s.substring(0,i)+e[r],e[r+t.lines.length-1]+=s.substring(i)}break;case"remove":var a=t.end.column,f=t.end.row;r===f?e[r]=s.substring(0,i)+s.substring(a):e.splice(r,f-r+1,s.substring(0,i)+e[f].substring(a))}}}),define("ace/lib/event_emitter",[],function(e,t,n){"use strict";var r={},i=function(){this.propagationStopped=!0},s=function(){this.defaultPrevented=!0};r._emit=r._dispatchEvent=function(e,t){this._eventRegistry||(this._eventRegistry={}),this._defaultHandlers||(this._defaultHandlers={});var n=this._eventRegistry[e]||[],r=this._defaultHandlers[e];if(!n.length&&!r)return;if(typeof t!="object"||!t)t={};t.type||(t.type=e),t.stopPropagation||(t.stopPropagation=i),t.preventDefault||(t.preventDefault=s),n=n.slice();for(var o=0;othis.row)return;var n=t(e,{row:this.row,column:this.column},this.$insertRight);this.setPosition(n.row,n.column,!0)},this.setPosition=function(e,t,n){var r;n?r={row:e,column:t}:r=this.$clipPositionToDocument(e,t);if(this.row==r.row&&this.column==r.column)return;var i={row:this.row,column:this.column};this.row=r.row,this.column=r.column,this._signal("change",{old:i,value:r})},this.detach=function(){this.document.off("change",this.$onChange)},this.attach=function(e){this.document=e||this.document,this.document.on("change",this.$onChange)},this.$clipPositionToDocument=function(e,t){var n={};return e>=this.document.getLength()?(n.row=Math.max(0,this.document.getLength()-1),n.column=this.document.getLine(n.row).length):e<0?(n.row=0,n.column=0):(n.row=e,n.column=Math.min(this.document.getLine(n.row).length,Math.max(0,t))),t<0&&(n.column=0),n}}).call(s.prototype)}),define("ace/document",[],function(e,t,n){"use strict";var r=e("./lib/oop"),i=e("./apply_delta").applyDelta,s=e("./lib/event_emitter").EventEmitter,o=e("./range").Range,u=e("./anchor").Anchor,a=function(e){this.$lines=[""],e.length===0?this.$lines=[""]:Array.isArray(e)?this.insertMergedLines({row:0,column:0},e):this.insert({row:0,column:0},e)};(function(){r.implement(this,s),this.setValue=function(e){var t=this.getLength()-1;this.remove(new o(0,0,t,this.getLine(t).length)),this.insert({row:0,column:0},e)},this.getValue=function(){return this.getAllLines().join(this.getNewLineCharacter())},this.createAnchor=function(e,t){return new u(this,e,t)},"aaa".split(/a/).length===0?this.$split=function(e){return e.replace(/\r\n|\r/g,"\n").split("\n")}:this.$split=function(e){return e.split(/\r\n|\r|\n/)},this.$detectNewLine=function(e){var t=e.match(/^.*?(\r\n|\r|\n)/m);this.$autoNewLine=t?t[1]:"\n",this._signal("changeNewLineMode")},this.getNewLineCharacter=function(){switch(this.$newLineMode){case"windows":return"\r\n";case"unix":return"\n";default:return this.$autoNewLine||"\n"}},this.$autoNewLine="",this.$newLineMode="auto",this.setNewLineMode=function(e){if(this.$newLineMode===e)return;this.$newLineMode=e,this._signal("changeNewLineMode")},this.getNewLineMode=function(){return this.$newLineMode},this.isNewLine=function(e){return e=="\r\n"||e=="\r"||e=="\n"},this.getLine=function(e){return this.$lines[e]||""},this.getLines=function(e,t){return this.$lines.slice(e,t+1)},this.getAllLines=function(){return this.getLines(0,this.getLength())},this.getLength=function(){return this.$lines.length},this.getTextRange=function(e){return this.getLinesForRange(e).join(this.getNewLineCharacter())},this.getLinesForRange=function(e){var t;if(e.start.row===e.end.row)t=[this.getLine(e.start.row).substring(e.start.column,e.end.column)];else{t=this.getLines(e.start.row,e.end.row),t[0]=(t[0]||"").substring(e.start.column);var n=t.length-1;e.end.row-e.start.row==n&&(t[n]=t[n].substring(0,e.end.column))}return t},this.insertLines=function(e,t){return console.warn("Use of document.insertLines is deprecated. Use the insertFullLines method instead."),this.insertFullLines(e,t)},this.removeLines=function(e,t){return console.warn("Use of document.removeLines is deprecated. Use the removeFullLines method instead."),this.removeFullLines(e,t)},this.insertNewLine=function(e){return console.warn("Use of document.insertNewLine is deprecated. Use insertMergedLines(position, ['', '']) instead."),this.insertMergedLines(e,["",""])},this.insert=function(e,t){return this.getLength()<=1&&this.$detectNewLine(t),this.insertMergedLines(e,this.$split(t))},this.insertInLine=function(e,t){var n=this.clippedPos(e.row,e.column),r=this.pos(e.row,e.column+t.length);return this.applyDelta({start:n,end:r,action:"insert",lines:[t]},!0),this.clonePos(r)},this.clippedPos=function(e,t){var n=this.getLength();e===undefined?e=n:e<0?e=0:e>=n&&(e=n-1,t=undefined);var r=this.getLine(e);return t==undefined&&(t=r.length),t=Math.min(Math.max(t,0),r.length),{row:e,column:t}},this.clonePos=function(e){return{row:e.row,column:e.column}},this.pos=function(e,t){return{row:e,column:t}},this.$clipPosition=function(e){var t=this.getLength();return e.row>=t?(e.row=Math.max(0,t-1),e.column=this.getLine(t-1).length):(e.row=Math.max(0,e.row),e.column=Math.min(Math.max(e.column,0),this.getLine(e.row).length)),e},this.insertFullLines=function(e,t){e=Math.min(Math.max(e,0),this.getLength());var n=0;e0,r=t=0&&this.applyDelta({start:this.pos(e,this.getLine(e).length),end:this.pos(e+1,0),action:"remove",lines:["",""]})},this.replace=function(e,t){e instanceof o||(e=o.fromPoints(e.start,e.end));if(t.length===0&&e.isEmpty())return e.start;if(t==this.getTextRange(e))return e.end;this.remove(e);var n;return t?n=this.insert(e.start,t):n=e.start,n},this.applyDeltas=function(e){for(var t=0;t=0;t--)this.revertDelta(e[t])},this.applyDelta=function(e,t){var n=e.action=="insert";if(n?e.lines.length<=1&&!e.lines[0]:!o.comparePoints(e.start,e.end))return;n&&e.lines.length>2e4?this.$splitAndapplyLargeDelta(e,2e4):(i(this.$lines,e,t),this._signal("change",e))},this.$safeApplyDelta=function(e){var t=this.$lines.length;(e.action=="remove"&&e.start.row0){t&1&&(n+=e);if(t>>=1)e+=e}return n};var r=/^\s\s*/,i=/\s\s*$/;t.stringTrimLeft=function(e){return e.replace(r,"")},t.stringTrimRight=function(e){return e.replace(i,"")},t.copyObject=function(e){var t={};for(var n in e)t[n]=e[n];return t},t.copyArray=function(e){var t=[];for(var n=0,r=e.length;n=6"},directories:{lib:"./lib/coffeescript"},main:"./lib/coffeescript/index",browser:"./lib/coffeescript/browser",bin:{coffee:"./bin/coffee",cake:"./bin/cake"},files:["bin","lib","register.js","repl.js"],scripts:{test:"node ./bin/cake test","test-harmony":"node --harmony ./bin/cake test"},homepage:"http://coffeescript.org",bugs:"https://github.com/jashkenas/coffeescript/issues",repository:{type:"git",url:"git://github.com/jashkenas/coffeescript.git"},devDependencies:{"babel-core":"~6.26.0","babel-preset-babili":"~0.1.4","babel-preset-env":"~1.6.1","babel-preset-minify":"^0.3.0",codemirror:"^5.32.0",docco:"~0.8.0","highlight.js":"~9.12.0",jison:">=0.4.18","markdown-it":"~8.4.0",underscore:"~1.8.3",webpack:"~3.10.0"},dependencies:{}}}(),require["./helpers"]=function(){var e={};return function(){var t,n,r,i,s,o,u,a;e.starts=function(e,t,n){return t===e.substr(n,t.length)},e.ends=function(e,t,n){var r;return r=t.length,t===e.substr(e.length-r-(n||0),r)},e.repeat=u=function(e,t){var n;for(n="";0>>=1,e+=e;return n},e.compact=function(e){var t,n,r,i;for(i=[],t=0,r=e.length;to)return s.returnOnNegativeLevel?void 0:i.call(this,c,n);n+=1}return n-1}},{key:"removeLeadingNewlines",value:function(){var t,n,r,i,s,o,u,a,f;for(u=this.tokens,t=n=0,s=u.length;n=s&&s>o;i=0<=o?++s:--s)if(null!=f[i]&&("string"==typeof f[i]&&(f[i]=[f[i]]),u=this.tag(n+i+r),0>t.call(f[i],u)))return-1;return n+i+r-1}},{key:"looksObjectish",value:function(n){var r,i;return-1!==this.indexOfTag(n,"@",null,":")||-1!==this.indexOfTag(n,null,":")||(i=this.indexOfTag(n,f),-1!==i&&(r=null,this.detectEnd(i+1,function(e){var n;return n=e[0],0<=t.call(a,n)},function(e,t){return r=t}),":"===this.tag(r+1)))}},{key:"findTagsBackwards",value:function(n,r){var i,s,o,u,l,c,h;for(i=[];0<=n&&(i.length||(u=this.tag(n),0>t.call(r,u))&&((l=this.tag(n),0>t.call(f,l))||this.tokens[n].generated)&&(c=this.tag(n),0>t.call(v,c)));)(s=this.tag(n),0<=t.call(a,s))&&i.push(this.tag(n)),(o=this.tag(n),0<=t.call(f,o))&&i.length&&i.pop(),n-=1;return h=this.tag(n),0<=t.call(r,h)}},{key:"addImplicitBracesAndParens",value:function(){var n,r;return n=[],r=null,this.scanTokens(function(e,o,u){var d=this,m=_slicedToArray(e,1),g,y,w,E,S,x,T,N,C,k,L,A,O,M,_,D,P,H,B,j,F,I,q,R,U,z,W,X,V,$,J,K,Q;Q=m[0];var G=B=0"!==H&&"->"!==H&&"["!==H&&"("!==H&&","!==H&&"{"!==H&&"ELSE"!==H&&"="!==H)for(;T()||C()&&":"!==H;)T()?g():y();return N()&&n.pop(),n.push([Q,o]),w(1)}if(0<=t.call(f,Q))return n.push([Q,o]),w(1);if(0<=t.call(a,Q)){for(;x();)T()?g():C()?y():n.pop();r=n.pop()}if(S=function(){var n,r,i,s;return(i=d.findTagsBackwards(o,["FOR"])&&d.findTagsBackwards(o,["FORIN","FOROF","FORFROM"]),n=i||d.findTagsBackwards(o,["WHILE","UNTIL","LOOP","LEADING_WHEN"]),!!n)&&(r=!1,s=e[2].first_line,d.detectEnd(o,function(e){var n;return n=e[0],0<=t.call(v,n)},function(e,t){var n=u[t-1]||[],i=_slicedToArray(n,3),o;return H=i[0],o=i[2].first_line,r=s===o&&("->"===H||"=>"===H)},{returnOnNegativeLevel:!0}),r)},(0<=t.call(h,Q)&&e.spaced||"?"===Q&&0t.call(a,e):return r[1];case"@"!==this.tag(o-2):return o-2;default:return o-1}}.call(this),K=0>=q||(F=this.tag(q-1),0<=t.call(v,F))||u[q-1].newLine,X()){var tt=X(),nt=_slicedToArray(tt,2);if(W=nt[0],U=nt[1],("{"===W||"INDENT"===W&&"{"===this.tag(U-1))&&(K||","===this.tag(q-1)||"{"===this.tag(q-1)))return w(1)}return J(q,!!K),w(2)}if(0<=t.call(v,Q))for(O=n.length-1;0<=O&&(z=n[O],!!k(z));O+=-1)A(z)&&(z[2].sameLine=!1);if(M="OUTDENT"===H||B.newLine,0<=t.call(c,Q)||0<=t.call(i,Q)&&M||(".."===Q||"..."===Q)&&this.findTagsBackwards(o,["INDEX_START"]))for(;x();){var rt=X(),it=_slicedToArray(rt,3);W=it[0],U=it[1];var st=it[2];if(R=st.sameLine,K=st.startsLine,T()&&","!==H||","===H&&"TERMINATOR"===Q&&null==_)g();else if(C()&&R&&"TERMINATOR"!==Q&&":"!==H&&("POST_IF"!==Q&&"FOR"!==Q&&"WHILE"!==Q&&"UNTIL"!==Q||!K||!E(o+1)))y();else{if(!C()||"TERMINATOR"!==Q||","===H||!!K&&!!this.looksObjectish(o+1))break;y()}}if(","===Q&&!this.looksObjectish(o+1)&&C()&&"FOROF"!==(I=this.tag(o+2))&&"FORIN"!==I&&("TERMINATOR"!==_||!this.looksObjectish(o+2)))for(P="OUTDENT"===_?1:0;C();)y(o+P);return w(1)})}},{key:"enforceValidCSXAttributes",value:function(){return this.scanTokens(function(e,t,n){var r,i;return e.csxColon&&(r=n[t+1],"STRING_START"!==(i=r[0])&&"STRING"!==i&&"("!==i&&N("expected wrapped or quoted JSX attribute",r[2])),1})}},{key:"rescueStowawayComments",value:function(){var n,r,i;return n=function(e,t,n,r){return"TERMINATOR"!==n[t][0]&&n[r](b("TERMINATOR","\n",n[t])),n[r](b("JS","",n[t],e))},i=function(e,r,i){var s,u,a,f,l,c,h;for(u=r;u!==i.length&&(l=i[u][0],0<=t.call(o,l));)u++;if(u===i.length||(c=i[u][0],0<=t.call(o,c)))return u=i.length-1,n(e,u,i,"push"),1;for(h=e.comments,a=0,f=h.length;at.call(i,r)))return this.tokens.splice(s,0,b("(","(",this.tokens[s])),this.tokens.splice(n+1,0,b(")",")",this.tokens[n]))},s=null,this.scanTokens(function(e,t){var i,o;return"do"===e[1]?(s=t,i=t+1,"PARAM_START"===this.tag(t+1)&&(i=null,this.detectEnd(t+1,function(e,t){return"PARAM_END"===this.tag(t-1)},function(e,t){return i=t})),null==i||"->"!==(o=this.tag(i))&&"=>"!==o||"INDENT"!==this.tag(i+1))?1:(this.detectEnd(i+1,r,n),2):1})}},{key:"normalizeLines",value:function(){var n=this,r,s,o,a,f,l,c,h,p;return p=f=h=null,c=null,l=null,a=[],o=function(e,n){var r,s,o,a;return";"!==e[1]&&(r=e[0],0<=t.call(g,r))&&!("TERMINATOR"===e[0]&&(s=this.tag(n+1),0<=t.call(u,s)))&&("ELSE"!==e[0]||"THEN"===p&&!l&&!c)&&("CATCH"!==(o=e[0])&&"FINALLY"!==o||"->"!==p&&"=>"!==p)||(a=e[0],0<=t.call(i,a))&&(this.tokens[n-1].newLine||"OUTDENT"===this.tokens[n-1][0])},r=function(e,t){return"ELSE"===e[0]&&"THEN"===p&&a.pop(),this.tokens.splice(","===this.tag(t-1)?t-1:t,0,h)},s=function(e,t){var r,i,s;if(s=a.length,0"===E||"=>"===E)&&this.findTagsBackwards(n,["IF","WHILE","FOR","UNTIL","SWITCH","WHEN","LEADING_WHEN","[","INDEX_START"])&&!this.findTagsBackwards(n,["THEN","..","..."]),"TERMINATOR"===E){if("ELSE"===this.tag(n+1)&&"OUTDENT"!==this.tag(n-1))return i.splice.apply(i,[n,1].concat(_toConsumableArray(this.indentation()))),1;if(b=this.tag(n+1),0<=t.call(u,b))return i.splice(n,1),0}if("CATCH"===E)for(m=g=1;2>=g;m=++g)if("OUTDENT"===(w=this.tag(n+m))||"TERMINATOR"===w||"FINALLY"===w)return i.splice.apply(i,[n+m,0].concat(_toConsumableArray(this.indentation()))),2+m;if("->"!==E&&"=>"!==E||!(","===this.tag(n+1)||"."===this.tag(n+1)&&e.newLine)){if(0<=t.call(y,E)&&"INDENT"!==this.tag(n+1)&&("ELSE"!==E||"IF"!==this.tag(n+1))&&!v){p=E;var T=this.indentation(i[n]),N=_slicedToArray(T,2);return f=N[0],h=N[1],"THEN"===p&&(f.fromThen=!0),"THEN"===E&&(c=this.findTagsBackwards(n,["LEADING_WHEN"])&&"IF"===this.tag(n+1),l=this.findTagsBackwards(n,["IF"])&&"IF"===this.tag(n+1)),"THEN"===E&&this.findTagsBackwards(n,["IF"])&&a.push(n),"ELSE"===E&&"OUTDENT"!==this.tag(n-1)&&(n=s(i,n)),i.splice(n+1,0,f),this.detectEnd(n+2,o,r),"THEN"===E&&i.splice(n,1),1}return 1}var S=this.indentation(i[n]),x=_slicedToArray(S,2);return f=x[0],h=x[1],i.splice(n+1,0,f,h),1})}},{key:"tagPostfixConditionals",value:function(){var n,r,i;return i=null,r=function(e,n){var r=_slicedToArray(e,1),i,s;s=r[0];var o=_slicedToArray(this.tokens[n-1],1);return i=o[0],"TERMINATOR"===s||"INDENT"===s&&0>t.call(y,i)},n=function(e){if("INDENT"!==e[0]||e.generated&&!e.fromThen)return i[0]="POST_"+i[0]},this.scanTokens(function(e,t){return"IF"===e[0]?(i=e,this.detectEnd(t+1,r,n),1):1})}},{key:"indentation",value:function(t){var n,r;return n=["INDENT",2],r=["OUTDENT",2],t?(n.generated=r.generated=!0,n.origin=r.origin=t):n.explicit=r.explicit=!0,[n,r]}},{key:"tag",value:function(t){var n;return null==(n=this.tokens[t])?void 0:n[0]}}]),e}();return e.prototype.generate=b,e}.call(this),r=[["(",")"],["[","]"],["{","}"],["INDENT","OUTDENT"],["CALL_START","CALL_END"],["PARAM_START","PARAM_END"],["INDEX_START","INDEX_END"],["STRING_START","STRING_END"],["REGEX_START","REGEX_END"]],e.INVERSES=d={},f=[],a=[],w=0,S=r.length;w","=>","[","(","{","--","++"],p=["+","-"],c=["POST_IF","FOR","WHILE","UNTIL","WHEN","BY","LOOP","TERMINATOR"],y=["ELSE","->","=>","TRY","FINALLY","THEN"],g=["TERMINATOR","CATCH","FINALLY","ELSE","OUTDENT","LEADING_WHEN"],v=["TERMINATOR","INDENT","OUTDENT"],i=[".","?.","::","?::"],s=["IF","TRY","FINALLY","CATCH","CLASS","SWITCH"],o=["(",")","[","]","{","}",".","..","...",",","=","++","--","?","AS","AWAIT","CALL_START","CALL_END","DEFAULT","ELSE","EXTENDS","EXPORT","FORIN","FOROF","FORFROM","IMPORT","INDENT","INDEX_SOAK","LEADING_WHEN","OUTDENT","PARAM_END","REGEX_START","REGEX_END","RETURN","STRING_END","THROW","UNARY","YIELD"].concat(p.concat(c.concat(i.concat(s))))}.call(this),{exports:e}.exports}(),require["./lexer"]=function(){var e={};return function(){var t=[].indexOf,n=[].slice,r=require("./rewriter"),i,s,o,u,a,f,l,c,h,p,d,v,m,g,y,b,w,E,S,x,T,N,C,k,L,A,O,M,_,D,P,H,B,j,F,I,q,R,U,z,W,X,V,$,J,K,Q,G,Y,Z,et,tt,nt,rt,it,st,ot,ut,at,ft,lt,ct,ht,pt,dt,vt,mt,gt,yt,bt,wt,Et,St,xt;K=r.Rewriter,O=r.INVERSES;var Tt=require("./helpers");dt=Tt.count,St=Tt.starts,pt=Tt.compact,Et=Tt.repeat,vt=Tt.invertLiterate,wt=Tt.merge,ht=Tt.attachCommentsToNode,bt=Tt.locationDataToString,xt=Tt.throwSyntaxError,e.Lexer=B=function(){function e(){_classCallCheck(this,e)}return _createClass(e,[{key:"tokenize",value:function(t){var n=1this.indent){if(a)return this.indebt=l-this.indent,this.suppressNewlines(),i.length;if(!this.tokens.length)return this.baseIndent=this.indent=l,this.indentLiteral=u,i.length;r=l-this.indent+this.outdebt,this.token("INDENT",r,i.length-l,l),this.indents.push(r),this.ends.push({tag:"OUTDENT"}),this.outdebt=this.indebt=0,this.indent=l,this.indentLiteral=u}else lt.call(h,v))))return 0;var E=l,S=_slicedToArray(E,3);return f=S[0],a=S[1],i=S[2],c=this.token("CSX_TAG",a,1,a.length),this.token("CALL_START","("),this.token("[","["),this.ends.push({tag:"/>",origin:c,name:a}),this.csxDepth++,a.length+1}if(s=this.atCSXTag()){if("/>"===this.chunk.slice(0,2))return this.pair("/>"),this.token("]","]",0,2),this.token("CALL_END",")",0,2),this.csxDepth--,2;if("{"===u)return":"===d?(b=this.token("(","("),this.csxObjAttribute[this.csxDepth]=!1):(b=this.token("{","{"),this.csxObjAttribute[this.csxDepth]=!0),this.ends.push({tag:"}",origin:b}),1;if(">"===u){this.pair("/>"),c=this.token("]","]"),this.token(",",",");var x=this.matchWithInterpolations(A,">",""})}),l=g.exec(this.chunk.slice(o))||m.exec(this.chunk.slice(o)),l&&l[1]===s.name||this.error("expected corresponding CSX closing tag for "+s.name,s.origin[2]),r=o+s.name.length,">"!==this.chunk[r]&&this.error("missing closing > after tag name",{offset:r,length:1}),this.token("CALL_END",")",o,s.name.length+1),this.csxDepth--,r+1}return 0}return this.atCSXTag(1)?"}"===u?(this.pair(u),this.csxObjAttribute[this.csxDepth]?(this.token("}","}"),this.csxObjAttribute[this.csxDepth]=!1):this.token(")",")"),this.token(",",","),1):0:0}},{key:"atCSXTag",value:function(){var t=0"===(null==r?void 0:r.tag)&&r}},{key:"literalToken",value:function(){var n,r,i,s,a,f,l,c,h,v,m,g,y;if(n=R.exec(this.chunk)){var b=n,w=_slicedToArray(b,1);y=w[0],u.test(y)&&this.tagParameters()}else y=this.chunk.charAt(0);if(m=y,s=this.prev(),s&&0<=t.call(["="].concat(_toConsumableArray(d)),y)&&(v=!1,"="!==y||"||"!==(a=s[1])&&"&&"!==a||s.spaced||(s[0]="COMPOUND_ASSIGN",s[1]+="=",s=this.tokens[this.tokens.length-2],v=!0),s&&"PROPERTY"!==s[0]&&(i=null==(f=s.origin)?s:f,r=gt(s[1],i[1]),r&&this.error(r,i[2])),v))return y.length;if("{"===y&&this.seenImport?this.importSpecifierList=!0:this.importSpecifierList&&"}"===y?this.importSpecifierList=!1:"{"===y&&"EXPORT"===(null==s?void 0:s[0])?this.exportSpecifierList=!0:this.exportSpecifierList&&"}"===y&&(this.exportSpecifierList=!1),";"===y)(l=null==s?void 0:s[0],0<=t.call(["="].concat(_toConsumableArray(at)),l))&&this.error("unexpected ;"),this.seenFor=this.seenImport=this.seenExport=!1,m="TERMINATOR";else if("*"===y&&"EXPORT"===(null==s?void 0:s[0]))m="EXPORT_ALL";else if(0<=t.call(j,y))m="MATH";else if(0<=t.call(p,y))m="COMPARE";else if(0<=t.call(d,y))m="COMPOUND_ASSIGN";else if(0<=t.call(ot,y))m="UNARY";else if(0<=t.call(ut,y))m="UNARY_MATH";else if(0<=t.call(Q,y))m="SHIFT";else if("?"===y&&(null==s?void 0:s.spaced))m="BIN?";else if(s)if("("===y&&!s.spaced&&(c=s[0],0<=t.call(o,c)))"?"===s[0]&&(s[0]="FUNC_EXIST"),m="CALL_START";else if("["===y&&((h=s[0],0<=t.call(L,h))&&!s.spaced||"::"===s[0]))switch(m="INDEX_START",s[0]){case"?":s[0]="INDEX_SOAK"}return g=this.makeToken(m,y),"("===y||"{"===y||"["===y?this.ends.push({tag:O[y],origin:g}):")"===y||"}"===y||"]"===y?this.pair(y):void 0,this.tokens.push(this.makeToken(m,y)),y.length}},{key:"tagParameters",value:function(){var t,n,r,i,s;if(")"!==this.tag())return this;for(r=[],s=this.tokens,t=s.length,n=s[--t],n[0]="PARAM_END";i=s[--t];)switch(i[0]){case")":r.push(i);break;case"(":case"CALL_START":if(!r.length)return"("===i[0]?(i[0]="PARAM_START",this):(n[0]="CALL_END",this);r.pop()}return this}},{key:"closeIndentation",value:function(){return this.outdentToken(this.indent)}},{key:"matchWithInterpolations",value:function(r,i,s,o){var u,a,f,l,c,h,p,d,v,m,g,y,b,w,E,S,x,T,N,C,k,L;if(null==s&&(s=i),null==o&&(o=/^#\{/),L=[],S=i.length,this.chunk.slice(0,S)!==i)return null;for(C=this.chunk.slice(S);;){var A=r.exec(C),O=_slicedToArray(A,1);if(k=O[0],this.validateEscapes(k,{isRegex:"/"===i.charAt(0),offsetInChunk:S}),L.push(this.makeToken("NEOSTRING",k,S)),C=C.slice(k.length),S+=k.length,!(w=o.exec(C)))break;var M=w,_=_slicedToArray(M,1);g=_[0],m=g.length-1;var D=this.getLineAndColumnFromChunk(S+m),P=_slicedToArray(D,2);b=P[0],p=P[1],N=C.slice(m);var H=(new e).tokenize(N,{line:b,column:p,untilBalanced:!0});if(E=H.tokens,v=H.index,v+=m,c="}"===C[v-1],c){var B,j,F,I;B=E,j=_slicedToArray(B,1),x=j[0],B,F=n.call(E,-1),I=_slicedToArray(F,1),h=I[0],F,x[0]=x[1]="(",h[0]=h[1]=")",h.origin=["","end of interpolation",h[2]]}"TERMINATOR"===(null==(T=E[1])?void 0:T[0])&&E.splice(1,1),c||(x=this.makeToken("(","(",S,0),h=this.makeToken(")",")",S+v,0),E=[x].concat(_toConsumableArray(E),[h])),L.push(["TOKENS",E]),C=C.slice(v),S+=v}return C.slice(0,s.length)!==s&&this.error("missing "+s,{length:i.length}),u=L,a=_slicedToArray(u,1),d=a[0],u,f=n.call(L,-1),l=_slicedToArray(f,1),y=l[0],f,d[2].first_column-=i.length,"\n"===y[1].substr(-1)?(y[2].last_line+=1,y[2].last_column=s.length-1):y[2].last_column+=s.length,0===y[1].length&&(y[2].last_column-=1),{tokens:L,index:S+s.length}}},{key:"mergeInterpolationTokens",value:function(t,r,i){var s,o,u,a,f,l,c,h,p,d,v,m,g,y,b,w,E,S,x;for(1u&&(g=this.token("+","+"),g[2]={first_line:d[2].first_line,first_column:d[2].first_column,last_line:d[2].first_line,last_column:d[2].first_column}),(T=this.tokens).push.apply(T,_toConsumableArray(E))}if(v){var L=n.call(t,-1),A=_slicedToArray(L,1);return c=A[0],v.origin=["STRING",null,{first_line:v[2].first_line,first_column:v[2].first_column,last_line:c[2].last_line,last_column:c[2].last_column}],v[2]=v.origin[2],y=this.token("STRING_END",")"),y[2]={first_line:c[2].last_line,first_column:c[2].last_column,last_line:c[2].last_line,last_column:c[2].last_column}}}},{key:"pair",value:function(t){var r,i,s,o,u,a,f;if(u=this.ends,r=n.call(u,-1),i=_slicedToArray(r,1),o=i[0],r,t!==(f=null==o?void 0:o.tag)){var l,c;return"OUTDENT"!==f&&this.error("unmatched "+t),a=this.indents,l=n.call(a,-1),c=_slicedToArray(l,1),s=c[0],l,this.outdentToken(s,!0),this.pair(t)}return this.ends.pop()}},{key:"getLineAndColumnFromChunk",value:function(t){var r,i,s,o,u;if(0===t)return[this.chunkLine,this.chunkColumn];if(u=t>=this.chunk.length?this.chunk:this.chunk.slice(0,+(t-1)+1||9e9),s=dt(u,"\n"),r=this.chunkColumn,0t)?i(t):(n=_Mathfloor((t-65536)/1024)+55296,r=(t-65536)%1024+56320,""+i(n)+i(r))}},{key:"replaceUnicodeCodePointEscapes",value:function(n,r){var i=this,s;return s=null!=r.flags&&0>t.call(r.flags,"u"),n.replace(ft,function(e,t,n,o){var u;return t?t:(u=parseInt(n,16),1114111t.call([].concat(_toConsumableArray(_),_toConsumableArray(l)),e):return"keyword '"+n+"' can't be assigned";case 0>t.call(Y,e):return"'"+n+"' can't be assigned";case 0>t.call(J,e):return"reserved word '"+n+"' can't be assigned";default:return!1}},e.isUnassignable=gt,mt=function(e){var t;return"IDENTIFIER"===e[0]?("from"===e[1]&&(e[1][0]="IDENTIFIER",!0),!0):"FOR"!==e[0]&&"{"!==(t=e[1])&&"["!==t&&","!==t&&":"!==t},_=["true","false","null","this","new","delete","typeof","in","instanceof","return","throw","break","continue","debugger","yield","await","if","else","switch","for","while","do","try","catch","finally","class","extends","super","import","export","default"],l=["undefined","Infinity","NaN","then","unless","until","loop","of","by","when"],f={and:"&&",or:"||",is:"==",isnt:"!=",not:"!",yes:"true",no:"false",on:"true",off:"false"},a=function(){var e;for(yt in e=[],f)e.push(yt);return e}(),l=l.concat(a),J=["case","function","var","void","with","const","let","enum","native","implements","interface","package","private","protected","public","static"],Y=["arguments","eval"],e.JS_FORBIDDEN=_.concat(J).concat(Y),i=65279,C=/^(?!\d)((?:(?!\s)[$\w\x7f-\uffff])+)([^\n\S]*:(?!:))?/,g=/^(?![\d<])((?:(?!\s)[\.\-$\w\x7f-\uffff])+)/,m=/^()>/,v=/^(?!\d)((?:(?!\s)[\-$\w\x7f-\uffff])+)([^\S]*=(?!=))?/,q=/^0b[01]+|^0o[0-7]+|^0x[\da-f]+|^\d*\.?\d+(?:e[+-]?\d+)?/i,R=/^(?:[-=]>|[-+*\/%<>&|^!?=]=|>>>=?|([-+:])\1|([&|<>*\/%])\2=?|\?(\.|::)|\.{2,3})/,ct=/^[^\n\S]+/,c=/^\s*###([^#][\s\S]*?)(?:###[^\n\S]*|###$)|^(?:\s*#(?!##[^#]).*)+/,u=/^[-=]>/,F=/^(?:\n[^\n\S]*)+/,M=/^`(?!``)((?:[^`\\]|\\[\s\S])*)`/,N=/^```((?:[^`\\]|\\[\s\S]|`(?!``))*)```/,rt=/^(?:'''|"""|'|")/,nt=/^(?:[^\\']|\\[\s\S])*/,Z=/^(?:[^\\"#]|\\[\s\S]|\#(?!\{))*/,S=/^(?:[^\\']|\\[\s\S]|'(?!''))*/,w=/^(?:[^\\"#]|\\[\s\S]|"(?!"")|\#(?!\{))*/,A=/^(?:[^\{<])*/,y=/^(?:\{|<(?!\/))/,tt=/((?:\\\\)+)|\\[^\S\n]*\n\s*/g,G=/\s*\n\s*/g,E=/\n+([^\n\S]*)(?=\S)/g,z=/^\/(?!\/)((?:[^[\/\n\\]|\\[^\n]|\[(?:\\[^\n]|[^\]\n\\])*\])*)(\/)?/,W=/^\w*/,lt=/^(?!.*(.).*\1)[imguy]*$/,x=/^(?:[^\\\/#\s]|\\[\s\S]|\/(?!\/\/)|\#(?!\{)|\s+(?:#(?!\{).*)?)*/,T=/((?:\\\\)+)|\\(\s)|\s+(?:#.*)?/g,X=/^(\/|\/{3}\s*)(\*)/,U=/^\/=?\s/,b=/\*\//,H=/^\s*(?:,|\??\.(?![.\d])|::)/,et=/((?:^|[^\\])(?:\\\\)*)\\(?:(0[0-7]|[1-7])|(x(?![\da-fA-F]{2}).{0,2})|(u\{(?![\da-fA-F]{1,}\})[^}]*\}?)|(u(?!\{|[\da-fA-F]{4}).{0,4}))/,V=/((?:^|[^\\])(?:\\\\)*)\\(?:(0[0-7])|(x(?![\da-fA-F]{2}).{0,2})|(u\{(?![\da-fA-F]{1,}\})[^}]*\}?)|(u(?!\{|[\da-fA-F]{4}).{0,4}))/,ft=/(\\\\)|\\u\{([\da-fA-F]+)\}/g,D=/^[^\n\S]*\n/,it=/\n[^\n\S]*$/,st=/\s+$/,d=["-=","+=","/=","*=","%=","||=","&&=","?=","<<=",">>=",">>>=","&=","^=","|=","**=","//=","%%="],ot=["NEW","TYPEOF","DELETE","DO"],ut=["!","~"],Q=["<<",">>",">>>"],p=["==","!=","<",">","<=",">="],j=["*","/","%","//","%%"],$=["IN","OF","INSTANCEOF"],s=["TRUE","FALSE"],o=["IDENTIFIER","PROPERTY",")","]","?","@","THIS","SUPER"],L=o.concat(["NUMBER","INFINITY","NAN","STRING","STRING_END","REGEX","REGEX_END","BOOL","NULL","UNDEFINED","}","::"]),h=["IDENTIFIER",")","]","NUMBER"],I=L.concat(["++","--"]),P=["INDENT","OUTDENT","TERMINATOR"],k=[")","}","]"],at=["\\",".","?.","?::","UNARY","MATH","UNARY_MATH","+","-","**","SHIFT","RELATION","COMPARE","&","^","|","&&","||","BIN?","EXTENDS"]}.call(this),{exports:e}.exports}(),require["./parser"]=function(){var e={},t={exports:e},n=function(){function e(){this.yy={}}var t=function(e,t,n,r){for(n=n||{},r=e.length;r--;n[e[r]]=t);return n},n=[1,24],r=[1,56],i=[1,91],s=[1,92],o=[1,87],u=[1,93],a=[1,94],f=[1,89],l=[1,90],c=[1,64],h=[1,66],p=[1,67],d=[1,68],v=[1,69],m=[1,70],g=[1,72],y=[1,73],b=[1,58],w=[1,42],E=[1,36],S=[1,76],x=[1,77],T=[1,86],N=[1,54],C=[1,59],k=[1,60],L=[1,74],A=[1,75],O=[1,47],M=[1,55],_=[1,71],D=[1,81],P=[1,82],H=[1,83],B=[1,84],j=[1,53],F=[1,80],I=[1,38],q=[1,39],R=[1,40],U=[1,41],z=[1,43],W=[1,44],X=[1,95],V=[1,6,36,47,146],$=[1,6,35,36,47,69,70,93,127,135,146,149,157],J=[1,113],K=[1,114],Q=[1,115],G=[1,110],Y=[1,98],Z=[1,97],et=[1,96],tt=[1,99],nt=[1,100],rt=[1,101],it=[1,102],st=[1,103],ot=[1,104],ut=[1,105],at=[1,106],ft=[1,107],lt=[1,108],ct=[1,109],ht=[1,117],pt=[1,6,35,36,47,69,70,83,88,93,109,127,135,146,148,149,150,156,157,174,178,179,182,183,184,185,186,187,188,189,190,191,192,193],dt=[2,196],vt=[1,123],mt=[1,128],gt=[1,124],yt=[1,125],bt=[1,126],wt=[1,129],Et=[1,122],St=[1,6,35,36,47,69,70,93,127,135,146,148,149,150,156,157,174],xt=[1,6,35,36,45,46,47,69,70,80,81,83,88,93,101,102,103,105,109,125,126,127,135,146,148,149,150,156,157,174,178,179,182,183,184,185,186,187,188,189,190,191,192,193],Tt=[2,122],Nt=[2,126],Ct=[6,35,88,93],kt=[2,99],Lt=[1,141],At=[1,135],Ot=[1,140],Mt=[1,144],_t=[1,149],Dt=[1,147],Pt=[1,151],Ht=[1,155],Bt=[1,153],jt=[1,6,35,36,45,46,47,61,69,70,80,81,83,88,93,101,102,103,105,109,125,126,127,135,146,148,149,150,156,157,174,178,179,182,183,184,185,186,187,188,189,190,191,192,193],Ft=[2,119],It=[1,6,36,47,69,70,83,88,93,109,127,135,146,148,149,150,156,157,174,178,179,182,183,184,185,186,187,188,189,190,191,192,193],qt=[2,31],Rt=[1,183],Ut=[2,86],zt=[1,187],Wt=[1,193],Xt=[1,208],Vt=[1,203],$t=[1,212],Jt=[1,209],Kt=[1,214],Qt=[1,215],Gt=[1,217],Yt=[14,32,35,38,39,43,45,46,49,50,54,55,56,57,58,59,68,77,84,85,86,90,91,107,110,112,120,129,130,140,144,145,148,150,153,156,167,173,176,177,178,179,180,181],Zt=[1,6,35,36,45,46,47,61,69,70,80,81,83,88,93,101,102,103,105,109,111,125,126,127,135,146,148,149,150,156,157,174,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194],en=[1,228],tn=[2,142],nn=[1,250],rn=[1,245],sn=[1,256],on=[1,6,35,36,45,46,47,65,69,70,80,81,83,88,93,101,102,103,105,109,125,126,127,135,146,148,149,150,156,157,174,178,179,182,183,184,185,186,187,188,189,190,191,192,193],un=[1,6,33,35,36,45,46,47,61,65,69,70,80,81,83,88,93,101,102,103,105,109,111,117,125,126,127,135,146,148,149,150,156,157,164,165,166,174,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194],an=[1,6,35,36,45,46,47,52,65,69,70,80,81,83,88,93,101,102,103,105,109,125,126,127,135,146,148,149,150,156,157,174,178,179,182,183,184,185,186,187,188,189,190,191,192,193],fn=[1,286],ln=[45,46,126],cn=[1,297],hn=[1,296],pn=[6,35],dn=[2,97],vn=[1,303],mn=[6,35,36,88,93],gn=[6,35,36,61,70,88,93],yn=[1,6,35,36,47,69,70,80,81,83,88,93,101,102,103,105,109,127,135,146,148,149,150,156,157,174,178,179,182,183,184,185,186,187,188,189,190,191,192,193],bn=[1,6,35,36,47,69,70,83,88,93,109,127,135,146,148,149,150,156,157,174,178,179,183,184,185,186,187,188,189,190,191,192,193],wn=[2,347],En=[1,6,35,36,47,69,70,83,88,93,109,127,135,146,148,149,150,156,157,174,178,179,183,185,186,187,188,189,190,191,192,193],Sn=[45,46,80,81,101,102,103,105,125,126],xn=[1,330],Tn=[1,6,35,36,47,69,70,83,88,93,109,127,135,146,148,149,150,156,157,174],Nn=[2,84],Cn=[1,346],kn=[1,348],Ln=[1,353],An=[1,355],On=[6,35,69,93],Mn=[2,221],_n=[2,222],Dn=[1,6,35,36,45,46,47,61,69,70,80,81,83,88,93,101,102,103,105,109,125,126,127,135,146,148,149,150,156,157,164,165,166,174,178,179,182,183,184,185,186,187,188,189,190,191,192,193],Pn=[1,369],Hn=[6,14,32,35,36,38,39,43,45,46,49,50,54,55,56,57,58,59,68,69,70,77,84,85,86,90,91,93,107,110,112,120,129,130,140,144,145,148,150,153,156,167,173,176,177,178,179,180,181],Bn=[6,35,36,69,93],jn=[6,35,36,69,93,127],Fn=[1,6,35,36,45,46,47,61,65,69,70,80,81,83,88,93,101,102,103,105,109,111,125,126,127,135,146,148,149,150,156,157,164,165,166,174,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194],In=[1,6,35,36,47,69,70,83,88,93,109,127,135,146,157,174],qn=[1,6,35,36,47,69,70,83,88,93,109,127,135,146,149,157,174],Rn=[2,273],Un=[164,165,166],zn=[93,164,165,166],Wn=[6,35,109],Xn=[1,393],Vn=[6,35,36,93,109],$n=[6,35,36,65,93,109],Jn=[1,399],Kn=[1,400],Qn=[6,35,36,61,65,70,80,81,93,109,126],Gn=[6,35,36,70,80,81,93,109,126],Yn=[1,6,35,36,47,69,70,83,88,93,109,127,135,146,148,149,150,156,157,174,178,179,185,186,187,188,189,190,191,192,193],Zn=[2,339],er=[2,338],tr=[1,6,35,36,45,46,47,52,69,70,80,81,83,88,93,101,102,103,105,109,125,126,127,135,146,148,149,150,156,157,174,178,179,182,183,184,185,186,187,188,189,190,191,192,193],nr=[1,422],rr=[14,32,38,39,43,45,46,49,50,54,55,56,57,58,59,68,77,83,84,85,86,90,91,107,110,112,120,129,130,140,144,145,148,150,153,156,167,173,176,177,178,179,180,181],ir=[2,207],sr=[6,35,36],or=[2,98],ur=[1,431],ar=[1,432],fr=[1,6,35,36,47,69,70,80,81,83,88,93,101,102,103,105,109,127,135,142,143,146,148,149,150,156,157,169,171,174,178,179,182,183,184,185,186,187,188,189,190,191,192,193],lr=[1,312],cr=[36,169,171],hr=[1,6,36,47,69,70,83,88,93,109,127,135,146,149,157,174],pr=[1,467],dr=[1,473],vr=[1,6,35,36,47,69,70,93,127,135,146,149,157,174],mr=[2,113],gr=[1,486],yr=[1,487],br=[6,35,36,69],wr=[1,6,35,36,47,69,70,83,88,93,109,127,135,146,148,149,150,156,157,169,174,178,179,182,183,184,185,186,187,188,189,190,191,192,193],Er=[1,6,35,36,47,69,70,93,127,135,146,149,157,169],Sr=[2,286],xr=[2,287],Tr=[2,302],Nr=[1,510],Cr=[1,511],kr=[6,35,36,109],Lr=[1,6,35,36,47,69,70,83,88,93,109,127,135,146,148,150,156,157,174],Ar=[1,532],Or=[6,35,36,93,127],Mr=[6,35,36,93],_r=[1,6,35,36,47,69,70,83,88,93,109,127,135,142,146,148,149,150,156,157,174,178,179,182,183,184,185,186,187,188,189,190,191,192,193],Dr=[35,93],Pr=[1,560],Hr=[1,561],Br=[1,567],jr=[1,568],Fr=[2,258],Ir=[2,261],qr=[2,274],Rr=[1,617],Ur=[1,618],zr=[2,288],Wr=[2,292],Xr=[2,289],Vr=[2,293],$r=[2,290],Jr=[2,291],Kr=[2,303],Qr=[2,304],Gr=[1,6,35,36,47,69,70,83,88,93,109,127,135,146,148,149,150,156,174],Yr=[2,294],Zr=[2,296],ei=[2,298],ti=[2,300],ni=[2,295],ri=[2,297],ii=[2,299],si=[2,301],oi={trace:function(){},yy:{},symbols_:{error:2,Root:3,Body:4,Line:5,TERMINATOR:6,Expression:7,ExpressionLine:8,Statement:9,FuncDirective:10,YieldReturn:11,AwaitReturn:12,Return:13,STATEMENT:14,Import:15,Export:16,Value:17,Code:18,Operation:19,Assign:20,If:21,Try:22,While:23,For:24,Switch:25,Class:26,Throw:27,Yield:28,CodeLine:29,IfLine:30,OperationLine:31,YIELD:32,FROM:33,Block:34,INDENT:35,OUTDENT:36,Identifier:37,IDENTIFIER:38,CSX_TAG:39,Property:40,PROPERTY:41,AlphaNumeric:42,NUMBER:43,String:44,STRING:45,STRING_START:46,STRING_END:47,Regex:48,REGEX:49,REGEX_START:50,Invocation:51,REGEX_END:52,Literal:53,JS:54,UNDEFINED:55,NULL:56,BOOL:57,INFINITY:58,NAN:59,Assignable:60,"=":61,AssignObj:62,ObjAssignable:63,ObjRestValue:64,":":65,SimpleObjAssignable:66,ThisProperty:67,"[":68,"]":69,"...":70,ObjSpreadExpr:71,ObjSpreadIdentifier:72,Object:73,Parenthetical:74,Super:75,This:76,SUPER:77,Arguments:78,ObjSpreadAccessor:79,".":80,INDEX_START:81,IndexValue:82,INDEX_END:83,RETURN:84,AWAIT:85,PARAM_START:86,ParamList:87,PARAM_END:88,FuncGlyph:89,"->":90,"=>":91,OptComma:92,",":93,Param:94,ParamVar:95,Array:96,Splat:97,SimpleAssignable:98,Accessor:99,Range:100,"?.":101,"::":102,"?::":103,Index:104,INDEX_SOAK:105,Slice:106,"{":107,AssignList:108,"}":109,CLASS:110,EXTENDS:111,IMPORT:112,ImportDefaultSpecifier:113,ImportNamespaceSpecifier:114,ImportSpecifierList:115,ImportSpecifier:116,AS:117,DEFAULT:118,IMPORT_ALL:119,EXPORT:120,ExportSpecifierList:121,EXPORT_ALL:122,ExportSpecifier:123,OptFuncExist:124,FUNC_EXIST:125,CALL_START:126,CALL_END:127,ArgList:128,THIS:129,"@":130,Elisions:131,ArgElisionList:132,OptElisions:133,RangeDots:134,"..":135,Arg:136,ArgElision:137,Elision:138,SimpleArgs:139,TRY:140,Catch:141,FINALLY:142,CATCH:143,THROW:144,"(":145,")":146,WhileLineSource:147,WHILE:148,WHEN:149,UNTIL:150,WhileSource:151,Loop:152,LOOP:153,ForBody:154,ForLineBody:155,FOR:156,BY:157,ForStart:158,ForSource:159,ForLineSource:160,ForVariables:161,OWN:162,ForValue:163,FORIN:164,FOROF:165,FORFROM:166,SWITCH:167,Whens:168,ELSE:169,When:170,LEADING_WHEN:171,IfBlock:172,IF:173,POST_IF:174,IfBlockLine:175,UNARY:176,UNARY_MATH:177,"-":178,"+":179,"--":180,"++":181,"?":182,MATH:183,"**":184,SHIFT:185,COMPARE:186,"&":187,"^":188,"|":189,"&&":190,"||":191,"BIN?":192,RELATION:193,COMPOUND_ASSIGN:194,$accept:0,$end:1},terminals_:{2:"error",6:"TERMINATOR",14:"STATEMENT",32:"YIELD",33:"FROM",35:"INDENT",36:"OUTDENT",38:"IDENTIFIER",39:"CSX_TAG",41:"PROPERTY",43:"NUMBER",45:"STRING",46:"STRING_START",47:"STRING_END",49:"REGEX",50:"REGEX_START",52:"REGEX_END",54:"JS",55:"UNDEFINED",56:"NULL",57:"BOOL",58:"INFINITY",59:"NAN",61:"=",65:":",68:"[",69:"]",70:"...",77:"SUPER",80:".",81:"INDEX_START",83:"INDEX_END",84:"RETURN",85:"AWAIT",86:"PARAM_START",88:"PARAM_END",90:"->",91:"=>",93:",",101:"?.",102:"::",103:"?::",105:"INDEX_SOAK",107:"{",109:"}",110:"CLASS",111:"EXTENDS",112:"IMPORT",117:"AS",118:"DEFAULT",119:"IMPORT_ALL",120:"EXPORT",122:"EXPORT_ALL",125:"FUNC_EXIST",126:"CALL_START",127:"CALL_END",129:"THIS",130:"@",135:"..",140:"TRY",142:"FINALLY",143:"CATCH",144:"THROW",145:"(",146:")",148:"WHILE",149:"WHEN",150:"UNTIL",153:"LOOP",156:"FOR",157:"BY",162:"OWN",164:"FORIN",165:"FOROF",166:"FORFROM",167:"SWITCH",169:"ELSE",171:"LEADING_WHEN",173:"IF",174:"POST_IF",176:"UNARY",177:"UNARY_MATH",178:"-",179:"+",180:"--",181:"++",182:"?",183:"MATH",184:"**",185:"SHIFT",186:"COMPARE",187:"&",188:"^",189:"|",190:"&&",191:"||",192:"BIN?",193:"RELATION",194:"COMPOUND_ASSIGN"},productions_:[0,[3,0],[3,1],[4,1],[4,3],[4,2],[5,1],[5,1],[5,1],[5,1],[10,1],[10,1],[9,1],[9,1],[9,1],[9,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[8,1],[8,1],[8,1],[28,1],[28,2],[28,3],[34,2],[34,3],[37,1],[37,1],[40,1],[42,1],[42,1],[44,1],[44,3],[48,1],[48,3],[53,1],[53,1],[53,1],[53,1],[53,1],[53,1],[53,1],[53,1],[20,3],[20,4],[20,5],[62,1],[62,1],[62,3],[62,5],[62,3],[62,5],[66,1],[66,1],[66,1],[66,3],[63,1],[63,1],[64,2],[64,2],[64,2],[64,2],[71,1],[71,1],[71,1],[71,1],[71,1],[71,2],[71,2],[71,2],[72,2],[72,2],[79,2],[79,3],[13,2],[13,4],[13,1],[11,3],[11,2],[12,3],[12,2],[18,5],[18,2],[29,5],[29,2],[89,1],[89,1],[92,0],[92,1],[87,0],[87,1],[87,3],[87,4],[87,6],[94,1],[94,2],[94,2],[94,3],[94,1],[95,1],[95,1],[95,1],[95,1],[97,2],[97,2],[98,1],[98,2],[98,2],[98,1],[60,1],[60,1],[60,1],[17,1],[17,1],[17,1],[17,1],[17,1],[17,1],[17,1],[75,3],[75,4],[99,2],[99,2],[99,2],[99,2],[99,1],[99,1],[104,3],[104,2],[82,1],[82,1],[73,4],[108,0],[108,1],[108,3],[108,4],[108,6],[26,1],[26,2],[26,3],[26,4],[26,2],[26,3],[26,4],[26,5],[15,2],[15,4],[15,4],[15,5],[15,7],[15,6],[15,9],[115,1],[115,3],[115,4],[115,4],[115,6],[116,1],[116,3],[116,1],[116,3],[113,1],[114,3],[16,3],[16,5],[16,2],[16,4],[16,5],[16,6],[16,3],[16,5],[16,4],[16,7],[121,1],[121,3],[121,4],[121,4],[121,6],[123,1],[123,3],[123,3],[123,1],[123,3],[51,3],[51,3],[51,3],[124,0],[124,1],[78,2],[78,4],[76,1],[76,1],[67,2],[96,2],[96,3],[96,4],[134,1],[134,1],[100,5],[100,5],[106,3],[106,2],[106,3],[106,2],[106,2],[106,1],[128,1],[128,3],[128,4],[128,4],[128,6],[136,1],[136,1],[136,1],[136,1],[132,1],[132,3],[132,4],[132,4],[132,6],[137,1],[137,2],[133,1],[133,2],[131,1],[131,2],[138,1],[139,1],[139,1],[139,3],[139,3],[22,2],[22,3],[22,4],[22,5],[141,3],[141,3],[141,2],[27,2],[27,4],[74,3],[74,5],[147,2],[147,4],[147,2],[147,4],[151,2],[151,4],[151,4],[151,2],[151,4],[151,4],[23,2],[23,2],[23,2],[23,2],[23,1],[152,2],[152,2],[24,2],[24,2],[24,2],[24,2],[154,2],[154,4],[154,2],[155,4],[155,2],[158,2],[158,3],[163,1],[163,1],[163,1],[163,1],[161,1],[161,3],[159,2],[159,2],[159,4],[159,4],[159,4],[159,4],[159,4],[159,4],[159,6],[159,6],[159,6],[159,6],[159,6],[159,6],[159,6],[159,6],[159,2],[159,4],[159,4],[160,2],[160,2],[160,4],[160,4],[160,4],[160,4],[160,4],[160,4],[160,6],[160,6],[160,6],[160,6],[160,6],[160,6],[160,6],[160,6],[160,2],[160,4],[160,4],[25,5],[25,5],[25,7],[25,7],[25,4],[25,6],[168,1],[168,2],[170,3],[170,4],[172,3],[172,5],[21,1],[21,3],[21,3],[21,3],[175,3],[175,5],[30,1],[30,3],[30,3],[30,3],[31,2],[19,2],[19,2],[19,2],[19,2],[19,2],[19,2],[19,2],[19,2],[19,2],[19,2],[19,3],[19,3],[19,3],[19,3],[19,3],[19,3],[19,3],[19,3],[19,3],[19,3],[19,3],[19,3],[19,3],[19,3],[19,5],[19,4]],performAction:function(e,t,n,r,i,s,o){var u=s.length-1;switch(i){case 1:return this.$=r.addDataToNode(r,o[u],o[u])(new r.Block);case 2:return this.$=s[u];case 3:this.$=r.addDataToNode(r,o[u],o[u])(r.Block.wrap([s[u]]));break;case 4:this.$=r.addDataToNode(r,o[u-2],o[u])(s[u-2].push(s[u]));break;case 5:this.$=s[u-1];break;case 6:case 7:case 8:case 9:case 10:case 11:case 12:case 14:case 15:case 16:case 17:case 18:case 19:case 20:case 21:case 22:case 23:case 24:case 25:case 26:case 27:case 28:case 29:case 30:case 40:case 45:case 47:case 57:case 62:case 63:case 64:case 66:case 67:case 72:case 73:case 74:case 75:case 76:case 97:case 98:case 109:case 110:case 111:case 112:case 118:case 119:case 122:case 127:case 136:case 221:case 222:case 223:case 225:case 237:case 238:case 280:case 281:case 330:case 336:case 342:this.$=s[u];break;case 13:this.$=r.addDataToNode(r,o[u],o[u])(new r.StatementLiteral(s[u]));break;case 31:this.$=r.addDataToNode(r,o[u],o[u])(new r.Op(s[u],new r.Value(new r.Literal(""))));break;case 32:case 346:case 347:case 348:case 351:this.$=r.addDataToNode(r,o[u-1],o[u])(new r.Op(s[u-1],s[u]));break;case 33:this.$=r.addDataToNode(r,o[u-2],o[u])(new r.Op(s[u-2].concat(s[u-1]),s[u]));break;case 34:this.$=r.addDataToNode(r,o[u-1],o[u])(new r.Block);break;case 35:case 83:case 137:this.$=r.addDataToNode(r,o[u-2],o[u])(s[u-1]);break;case 36:this.$=r.addDataToNode(r,o[u],o[u])(new r.IdentifierLiteral(s[u]));break;case 37:this.$=r.addDataToNode(r,o[u],o[u])(new r.CSXTag(s[u]));break;case 38:this.$=r.addDataToNode(r,o[u],o[u])(new r.PropertyName(s[u]));break;case 39:this.$=r.addDataToNode(r,o[u],o[u])(new r.NumberLiteral(s[u]));break;case 41:this.$=r.addDataToNode(r,o[u],o[u])(new r.StringLiteral(s[u]));break;case 42:this.$=r.addDataToNode(r,o[u-2],o[u])(new r.StringWithInterpolations(s[u-1]));break;case 43:this.$=r.addDataToNode(r,o[u],o[u])(new r.RegexLiteral(s[u]));break;case 44:this.$=r.addDataToNode(r,o[u-2],o[u])(new r.RegexWithInterpolations(s[u-1].args));break;case 46:this.$=r.addDataToNode(r,o[u],o[u])(new r.PassthroughLiteral(s[u]));break;case 48:this.$=r.addDataToNode(r,o[u],o[u])(new r.UndefinedLiteral(s[u]));break;case 49:this.$=r.addDataToNode(r,o[u],o[u])(new r.NullLiteral(s[u]));break;case 50:this.$=r.addDataToNode(r,o[u],o[u])(new r.BooleanLiteral(s[u]));break;case 51:this.$=r.addDataToNode(r,o[u],o[u])(new r.InfinityLiteral(s[u]));break;case 52:this.$=r.addDataToNode(r,o[u],o[u])(new r.NaNLiteral(s[u]));break;case 53:this.$=r.addDataToNode(r,o[u-2],o[u])(new r.Assign(s[u-2],s[u]));break;case 54:this.$=r.addDataToNode(r,o[u-3],o[u])(new r.Assign(s[u-3],s[u]));break;case 55:this.$=r.addDataToNode(r,o[u-4],o[u])(new r.Assign(s[u-4],s[u-1]));break;case 56:case 115:case 120:case 121:case 123:case 124:case 125:case 126:case 128:case 282:case 283:this.$=r.addDataToNode(r,o[u],o[u])(new r.Value(s[u]));break;case 58:this.$=r.addDataToNode(r,o[u-2],o[u])(new r.Assign(r.addDataToNode(r,o[u-2])(new r.Value(s[u-2])),s[u],"object",{operatorToken:r.addDataToNode(r,o[u-1])(new r.Literal(s[u-1]))}));break;case 59:this.$=r.addDataToNode(r,o[u-4],o[u])(new r.Assign(r.addDataToNode(r,o[u-4])(new r.Value(s[u-4])),s[u-1],"object",{operatorToken:r.addDataToNode(r,o[u-3])(new r.Literal(s[u-3]))}));break;case 60:this.$=r.addDataToNode(r,o[u-2],o[u])(new r.Assign(r.addDataToNode(r,o[u-2])(new r.Value(s[u-2])),s[u],null,{operatorToken:r.addDataToNode(r,o[u-1])(new r.Literal(s[u-1]))}));break;case 61:this.$=r.addDataToNode(r,o[u-4],o[u])(new r.Assign(r.addDataToNode(r,o[u-4])(new r.Value(s[u-4])),s[u-1],null,{operatorToken:r.addDataToNode(r,o[u-3])(new r.Literal(s[u-3]))}));break;case 65:this.$=r.addDataToNode(r,o[u-2],o[u])(new r.Value(new r.ComputedPropertyName(s[u-1])));break;case 68:this.$=r.addDataToNode(r,o[u-1],o[u])(new r.Splat(new r.Value(s[u-1])));break;case 69:this.$=r.addDataToNode(r,o[u-1],o[u])(new r.Splat(new r.Value(s[u])));break;case 70:case 113:this.$=r.addDataToNode(r,o[u-1],o[u])(new r.Splat(s[u-1]));break;case 71:case 114:this.$=r.addDataToNode(r,o[u-1],o[u])(new r.Splat(s[u]));break;case 77:this.$=r.addDataToNode(r,o[u-1],o[u])(new r.SuperCall(r.addDataToNode(r,o[u-1])(new r.Super),s[u],!1,s[u-1]));break;case 78:this.$=r.addDataToNode(r,o[u-1],o[u])(new r.Call(new r.Value(s[u-1]),s[u]));break;case 79:this.$=r.addDataToNode(r,o[u-1],o[u])(new r.Call(s[u-1],s[u]));break;case 80:case 81:this.$=r.addDataToNode(r,o[u-1],o[u])((new r.Value(s[u-1])).add(s[u]));break;case 82:case 131:this.$=r.addDataToNode(r,o[u-1],o[u])(new r.Access(s[u]));break;case 84:this.$=r.addDataToNode(r,o[u-1],o[u])(new r.Return(s[u]));break;case 85:this.$=r.addDataToNode(r,o[u-3],o[u])(new r.Return(new r.Value(s[u-1])));break;case 86:this.$=r.addDataToNode(r,o[u],o[u])(new r.Return);break;case 87:this.$=r.addDataToNode(r,o[u-2],o[u])(new r.YieldReturn(s[u]));break;case 88:this.$=r.addDataToNode(r,o[u-1],o[u])(new r.YieldReturn);break;case 89:this.$=r.addDataToNode(r,o[u-2],o[u])(new r.AwaitReturn(s[u]));break;case 90:this.$=r.addDataToNode(r,o[u-1],o[u])(new r.AwaitReturn);break;case 91:this.$=r.addDataToNode(r,o[u-4],o[u])(new r.Code(s[u-3],s[u],s[u-1],r.addDataToNode(r,o[u-4])(new r.Literal(s[u-4]))));break;case 92:this.$=r.addDataToNode(r,o[u-1],o[u])(new r.Code([],s[u],s[u-1]));break;case 93:this.$=r.addDataToNode(r,o[u-4],o[u])(new r.Code(s[u-3],r.addDataToNode(r,o[u])(r.Block.wrap([s[u]])),s[u-1],r.addDataToNode(r,o[u-4])(new r.Literal(s[u-4]))));break;case 94:this.$=r.addDataToNode(r,o[u-1],o[u])(new r.Code([],r.addDataToNode(r,o[u])(r.Block.wrap([s[u]])),s[u-1]));break;case 95:case 96:this.$=r.addDataToNode(r,o[u],o[u])(new r.FuncGlyph(s[u]));break;case 99:case 142:case 232:this.$=r.addDataToNode(r,o[u],o[u])([]);break;case 100:case 143:case 162:case 183:case 216:case 230:case 234:case 284:this.$=r.addDataToNode(r,o[u],o[u])([s[u]]);break;case 101:case 144:case 163:case 184:case 217:case 226:this.$=r.addDataToNode(r,o[u-2],o[u])(s[u-2].concat(s[u]));break;case 102:case 145:case 164:case 185:case 218:this.$=r.addDataToNode(r,o[u-3],o[u])(s[u-3].concat(s[u]));break;case 103:case 146:case 166:case 187:case 220:this.$=r.addDataToNode(r,o[u-5],o[u])(s[u-5].concat(s[u-2]));break;case 104:this.$=r.addDataToNode(r,o[u],o[u])(new r.Param(s[u]));break;case 105:this.$=r.addDataToNode(r,o[u-1],o[u])(new r.Param(s[u-1],null,!0));break;case 106:this.$=r.addDataToNode(r,o[u-1],o[u])(new r.Param(s[u],null,!0));break;case 107:this.$=r.addDataToNode(r,o[u-2],o[u])(new r.Param(s[u-2],s[u]));break;case 108:case 224:this.$=r.addDataToNode(r,o[u],o[u])(new r.Expansion);break;case 116:this.$=r.addDataToNode(r,o[u-1],o[u])(s[u-1].add(s[u]));break;case 117:this.$=r.addDataToNode(r,o[u-1],o[u])((new r.Value(s[u-1])).add(s[u]));break;case 129:this.$=r.addDataToNode(r,o[u-2],o[u])(new r.Super(r.addDataToNode(r,o[u])(new r.Access(s[u])),[],!1,s[u-2]));break;case 130:this.$=r.addDataToNode(r,o[u-3],o[u])(new r.Super(r.addDataToNode(r,o[u-1])(new r.Index(s[u-1])),[],!1,s[u-3]));break;case 132:this.$=r.addDataToNode(r,o[u-1],o[u])(new r.Access(s[u],"soak"));break;case 133:this.$=r.addDataToNode(r,o[u-1],o[u])([r.addDataToNode(r,o[u-1])(new r.Access(new r.PropertyName("prototype"))),r.addDataToNode(r,o[u])(new r.Access(s[u]))]);break;case 134:this.$=r.addDataToNode(r,o[u-1],o[u])([r.addDataToNode(r,o[u-1])(new r.Access(new r.PropertyName("prototype"),"soak")),r.addDataToNode(r,o[u])(new r.Access(s[u]))]);break;case 135:this.$=r.addDataToNode(r,o[u],o[u])(new r.Access(new r.PropertyName("prototype")));break;case 138:this.$=r.addDataToNode(r,o[u-1],o[u])(r.extend(s[u],{soak:!0}));break;case 139:this.$=r.addDataToNode(r,o[u],o[u])(new r.Index(s[u]));break;case 140:this.$=r.addDataToNode(r,o[u],o[u])(new r.Slice(s[u]));break;case 141:this.$=r.addDataToNode(r,o[u-3],o[u])(new r.Obj(s[u-2],s[u-3].generated));break;case 147:this.$=r.addDataToNode(r,o[u],o[u])(new r.Class);break;case 148:this.$=r.addDataToNode(r,o[u-1],o[u])(new r.Class(null,null,s[u]));break;case 149:this.$=r.addDataToNode(r,o[u-2],o[u])(new r.Class(null,s[u]));break;case 150:this.$=r.addDataToNode(r,o[u-3],o[u])(new r.Class(null,s[u-1],s[u]));break;case 151:this.$=r.addDataToNode(r,o[u-1],o[u])(new r.Class(s[u]));break;case 152:this.$=r.addDataToNode(r,o[u-2],o[u])(new r.Class(s[u-1],null,s[u]));break;case 153:this.$=r.addDataToNode(r,o[u-3],o[u])(new r.Class(s[u-2],s[u]));break;case 154:this.$=r.addDataToNode(r,o[u-4],o[u])(new r.Class(s[u-3],s[u-1],s[u]));break;case 155:this.$=r.addDataToNode(r,o[u-1],o[u])(new r.ImportDeclaration(null,s[u]));break;case 156:this.$=r.addDataToNode(r,o[u-3],o[u])(new r.ImportDeclaration(new r.ImportClause(s[u-2],null),s[u]));break;case 157:this.$=r.addDataToNode(r,o[u-3],o[u])(new r.ImportDeclaration(new r.ImportClause(null,s[u-2]),s[u]));break;case 158:this.$=r.addDataToNode(r,o[u-4],o[u])(new r.ImportDeclaration(new r.ImportClause(null,new r.ImportSpecifierList([])),s[u]));break;case 159:this.$=r.addDataToNode(r,o[u-6],o[u])(new r.ImportDeclaration(new r.ImportClause(null,new r.ImportSpecifierList(s[u-4])),s[u]));break;case 160:this.$=r.addDataToNode(r,o[u-5],o[u])(new r.ImportDeclaration(new r.ImportClause(s[u-4],s[u-2]),s[u]));break;case 161:this.$=r.addDataToNode(r,o[u-8],o[u])(new r.ImportDeclaration(new r.ImportClause(s[u-7],new r.ImportSpecifierList(s[u-4])),s[u]));break;case 165:case 186:case 199:case 219:this.$=r.addDataToNode(r,o[u-3],o[u])(s[u-2]);break;case 167:this.$=r.addDataToNode(r,o[u],o[u])(new r.ImportSpecifier(s[u]));break;case 168:this.$=r.addDataToNode(r,o[u-2],o[u])(new r.ImportSpecifier(s[u-2],s[u]));break;case 169:this.$=r.addDataToNode(r,o[u],o[u])(new r.ImportSpecifier(new r.Literal(s[u])));break;case 170:this.$=r.addDataToNode(r,o[u-2],o[u])(new r.ImportSpecifier(new r.Literal(s[u-2]),s[u]));break;case 171:this.$=r.addDataToNode(r,o[u],o[u])(new r.ImportDefaultSpecifier(s[u]));break;case 172:this.$=r.addDataToNode(r,o[u-2],o[u])(new r.ImportNamespaceSpecifier(new r.Literal(s[u-2]),s[u]));break;case 173:this.$=r.addDataToNode(r,o[u-2],o[u])(new r.ExportNamedDeclaration(new r.ExportSpecifierList([])));break;case 174:this.$=r.addDataToNode(r,o[u-4],o[u])(new r.ExportNamedDeclaration(new r.ExportSpecifierList(s[u-2])));break;case 175:this.$=r.addDataToNode(r,o[u-1],o[u])(new r.ExportNamedDeclaration(s[u]));break;case 176:this.$=r.addDataToNode(r,o[u-3],o[u])(new r.ExportNamedDeclaration(new r.Assign(s[u-2],s[u],null,{moduleDeclaration:"export"})));break;case 177:this.$=r.addDataToNode(r,o[u-4],o[u])(new r.ExportNamedDeclaration(new r.Assign(s[u-3],s[u],null,{moduleDeclaration:"export"})));break;case 178:this.$=r.addDataToNode(r,o[u-5],o[u])(new r.ExportNamedDeclaration(new r.Assign(s[u-4],s[u-1],null,{moduleDeclaration:"export"})));break;case 179:this.$=r.addDataToNode(r,o[u-2],o[u])(new r.ExportDefaultDeclaration(s[u]));break;case 180:this.$=r.addDataToNode(r,o[u-4],o[u])(new r.ExportDefaultDeclaration(new r.Value(s[u-1])));break;case 181:this.$=r.addDataToNode(r,o[u-3],o[u])(new r.ExportAllDeclaration(new r.Literal(s[u-2]),s[u]));break;case 182:this.$=r.addDataToNode(r,o[u-6],o[u])(new r.ExportNamedDeclaration(new r.ExportSpecifierList(s[u-4]),s[u]));break;case 188:this.$=r.addDataToNode(r,o[u],o[u])(new r.ExportSpecifier(s[u]));break;case 189:this.$=r.addDataToNode(r,o[u-2],o[u])(new r.ExportSpecifier(s[u-2],s[u]));break;case 190:this.$=r.addDataToNode(r,o[u-2],o[u])(new r.ExportSpecifier(s[u-2],new r.Literal(s[u])));break;case 191:this.$=r.addDataToNode(r,o[u],o[u])(new r.ExportSpecifier(new r.Literal(s[u])));break;case 192:this.$=r.addDataToNode(r,o[u-2],o[u])(new r.ExportSpecifier(new r.Literal(s[u-2]),s[u]));break;case 193:this.$=r.addDataToNode(r,o[u-2],o[u])(new r.TaggedTemplateCall(s[u-2],s[u],s[u-1]));break;case 194:this.$=r.addDataToNode(r,o[u-2],o[u])(new r.Call(s[u-2],s[u],s[u-1]));break;case 195:this.$=r.addDataToNode(r,o[u-2],o[u])(new r.SuperCall(r.addDataToNode(r,o[u-2])(new r.Super),s[u],s[u-1],s[u-2]));break;case 196:this.$=r.addDataToNode(r,o[u],o[u])(!1);break;case 197:this.$=r.addDataToNode(r,o[u],o[u])(!0);break;case 198:this.$=r.addDataToNode(r,o[u-1],o[u])([]);break;case 200:case 201:this.$=r.addDataToNode(r,o[u],o[u])(new r.Value(new r.ThisLiteral(s[u])));break;case 202:this.$=r.addDataToNode(r,o[u-1],o[u])(new r.Value(r.addDataToNode(r,o[u-1])(new r.ThisLiteral(s[u-1])),[r.addDataToNode(r,o[u])(new r.Access(s[u]))],"this"));break;case 203:this.$=r.addDataToNode(r,o[u-1],o[u])(new r.Arr([]));break;case 204:this.$=r.addDataToNode(r,o[u-2],o[u])(new r.Arr(s[u-1]));break;case 205:this.$=r.addDataToNode(r,o[u-3],o[u])(new r.Arr([].concat(s[u-2],s[u-1])));break;case 206:this.$=r.addDataToNode(r,o[u],o[u])("inclusive");break;case 207:this.$=r.addDataToNode(r,o[u],o[u])("exclusive");break;case 208:case 209:this.$=r.addDataToNode(r,o[u-4],o[u])(new r.Range(s[u-3],s[u-1],s[u-2]));break;case 210:case 212:this.$=r.addDataToNode(r,o[u-2],o[u])(new r.Range(s[u-2],s[u],s[u-1]));break;case 211:case 213:this.$=r.addDataToNode(r,o[u-1],o[u])(new r.Range(s[u-1],null,s[u]));break;case 214:this.$=r.addDataToNode(r,o[u-1],o[u])(new r.Range(null,s[u],s[u-1]));break;case 215:this.$=r.addDataToNode(r,o[u],o[u])(new r.Range(null,null,s[u]));break;case 227:this.$=r.addDataToNode(r,o[u-3],o[u])(s[u-3].concat(s[u-2],s[u]));break;case 228:this.$=r.addDataToNode(r,o[u-3],o[u])(s[u-2].concat(s[u-1]));break;case 229:this.$=r.addDataToNode(r,o[u-5],o[u])(s[u-5].concat(s[u-4],s[u-2],s[u-1]));break;case 231:case 235:case 331:this.$=r.addDataToNode(r,o[u-1],o[u])(s[u-1].concat(s[u]));break;case 233:this.$=r.addDataToNode(r,o[u-1],o[u])([].concat(s[u]));break;case 236:this.$=r.addDataToNode(r,o[u],o[u])(new r.Elision);break;case 239:case 240:this.$=r.addDataToNode(r,o[u-2],o[u])([].concat(s[u-2],s[u]));break;case 241:this.$=r.addDataToNode(r,o[u-1],o[u])(new r.Try(s[u]));break;case 242:this.$=r.addDataToNode(r,o[u-2],o[u])(new r.Try(s[u-1],s[u][0],s[u][1]));break;case 243:this.$=r.addDataToNode(r,o[u-3],o[u])(new r.Try(s[u-2],null,null,s[u]));break;case 244:this.$=r.addDataToNode(r,o[u-4],o[u])(new r.Try(s[u-3],s[u-2][0],s[u-2][1],s[u]));break;case 245:this.$=r.addDataToNode(r,o[u-2],o[u])([s[u-1],s[u]]);break;case 246:this.$=r.addDataToNode(r,o[u-2],o[u])([r.addDataToNode(r,o[u-1])(new r.Value(s[u-1])),s[u]]);break;case 247:this.$=r.addDataToNode(r,o[u-1],o[u])([null,s[u]]);break;case 248:this.$=r.addDataToNode(r,o[u-1],o[u])(new r.Throw(s[u]));break;case 249:this.$=r.addDataToNode(r,o[u-3],o[u])(new r.Throw(new r.Value(s[u-1])));break;case 250:this.$=r.addDataToNode(r,o[u-2],o[u])(new r.Parens(s[u-1]));break;case 251:this.$=r.addDataToNode(r,o[u-4],o[u])(new r.Parens(s[u-2]));break;case 252:case 256:this.$=r.addDataToNode(r,o[u-1],o[u])(new r.While(s[u]));break;case 253:case 257:case 258:this.$=r.addDataToNode(r,o[u-3],o[u])(new r.While(s[u-2],{guard:s[u]}));break;case 254:case 259:this.$=r.addDataToNode(r,o[u-1],o[u])(new r.While(s[u],{invert:!0}));break;case 255:case 260:case 261:this.$=r.addDataToNode(r,o[u-3],o[u])(new r.While(s[u-2],{invert:!0,guard:s[u]}));break;case 262:case 263:this.$=r.addDataToNode(r,o[u-1],o[u])(s[u-1].addBody(s[u]));break;case 264:case 265:this.$=r.addDataToNode(r,o[u-1],o[u])(s[u].addBody(r.addDataToNode(r,o[u-1])(r.Block.wrap([s[u-1]]))));break;case 266:this.$=r.addDataToNode(r,o[u],o[u])(s[u]);break;case 267:this.$=r.addDataToNode(r,o[u-1],o[u])((new r.While(r.addDataToNode(r,o[u-1])(new r.BooleanLiteral("true")))).addBody(s[u]));break;case 268:this.$=r.addDataToNode(r,o[u-1],o[u])((new r.While(r.addDataToNode(r,o[u-1])(new r.BooleanLiteral("true")))).addBody(r.addDataToNode(r,o[u])(r.Block.wrap([s[u]]))));break;case 269:case 270:this.$=r.addDataToNode(r,o[u-1],o[u])(new r.For(s[u-1],s[u]));break;case 271:case 272:this.$=r.addDataToNode(r,o[u-1],o[u])(new r.For(s[u],s[u-1]));break;case 273:this.$=r.addDataToNode(r,o[u-1],o[u])({source:r.addDataToNode(r,o[u])(new r.Value(s[u]))});break;case 274:case 276:this.$=r.addDataToNode(r,o[u-3],o[u])({source:r.addDataToNode(r,o[u-2])(new r.Value(s[u-2])),step:s[u]});break;case 275:case 277:this.$=r.addDataToNode(r,o[u-1],o[u])(function(){return s[u].own=s[u-1].own,s[u].ownTag=s[u-1].ownTag,s[u].name=s[u-1][0],s[u].index=s[u-1][1],s[u]}());break;case 278:this.$=r.addDataToNode(r,o[u-1],o[u])(s[u]);break;case 279:this.$=r.addDataToNode(r,o[u-2],o[u])(function(){return s[u].own=!0,s[u].ownTag=r.addDataToNode(r,o[u-1])(new r.Literal(s[u-1])),s[u]}());break;case 285:this.$=r.addDataToNode(r,o[u-2],o[u])([s[u-2],s[u]]);break;case 286:case 305:this.$=r.addDataToNode(r,o[u-1],o[u])({source:s[u]});break;case 287:case 306:this.$=r.addDataToNode(r,o[u-1],o[u])({source:s[u],object:!0});break;case 288:case 289:case 307:case 308:this.$=r.addDataToNode(r,o[u-3],o[u])({source:s[u-2],guard:s[u]});break;case 290:case 291:case 309:case 310:this.$=r.addDataToNode(r,o[u-3],o[u])({source:s[u-2],guard:s[u],object:!0});break;case 292:case 293:case 311:case 312:this.$=r.addDataToNode(r,o[u-3],o[u])({source:s[u-2],step:s[u]});break;case 294:case 295:case 296:case 297:case 313:case 314:case 315:case 316:this.$=r.addDataToNode(r,o[u-5],o[u])({source:s[u-4],guard:s[u-2],step:s[u]});break;case 298:case 299:case 300:case 301:case 317:case 318:case 319:case 320:this.$=r.addDataToNode(r,o[u-5],o[u])({source:s[u-4],step:s[u-2],guard:s[u]});break;case 302:case 321:this.$=r.addDataToNode(r,o[u-1],o[u])({source:s[u],from:!0});break;case 303:case 304:case 322:case 323:this.$=r.addDataToNode(r,o[u-3],o[u])({source:s[u-2],guard:s[u],from:!0});break;case 324:case 325:this.$=r.addDataToNode(r,o[u-4],o[u])(new r.Switch(s[u-3],s[u-1]));break;case 326:case 327:this.$=r.addDataToNode(r,o[u-6],o[u])(new r.Switch(s[u-5],s[u-3],s[u-1]));break;case 328:this.$=r.addDataToNode(r,o[u-3],o[u])(new r.Switch(null,s[u-1]));break;case 329:this.$=r.addDataToNode(r,o[u-5],o[u])(new r.Switch(null,s[u-3],s[u-1]));break;case 332:this.$=r.addDataToNode(r,o[u-2],o[u])([[s[u-1],s[u]]]);break;case 333:this.$=r.addDataToNode(r,o[u-3],o[u])([[s[u-2],s[u-1]]]);break;case 334:case 340:this.$=r.addDataToNode(r,o[u-2],o[u])(new r.If(s[u-1],s[u],{type:s[u-2]}));break;case 335:case 341:this.$=r.addDataToNode(r,o[u-4],o[u])(s[u-4].addElse(r.addDataToNode(r,o[u-2],o[u])(new r.If(s[u-1],s[u],{type:s[u-2]}))));break;case 337:case 343:this.$=r.addDataToNode(r,o[u-2],o[u])(s[u-2].addElse(s[u]));break;case 338:case 339:case 344:case 345:this.$=r.addDataToNode(r,o[u-2],o[u])(new r.If(s[u],r.addDataToNode(r,o[u-2])(r.Block.wrap([s[u-2]])),{type:s[u-1],statement:!0}));break;case 349:this.$=r.addDataToNode(r,o[u-1],o[u])(new r.Op("-",s[u]));break;case 350:this.$=r.addDataToNode(r,o[u-1],o[u])(new r.Op("+",s[u]));break;case 352:this.$=r.addDataToNode(r,o[u-1],o[u])(new r.Op("--",s[u]));break;case 353:this.$=r.addDataToNode(r,o[u-1],o[u])(new r.Op("++",s[u]));break;case 354:this.$=r.addDataToNode(r,o[u-1],o[u])(new r.Op("--",s[u-1],null,!0));break;case 355:this.$=r.addDataToNode(r,o[u-1],o[u])(new r.Op("++",s[u-1],null,!0));break;case 356:this.$=r.addDataToNode(r,o[u-1],o[u])(new r.Existence(s[u-1]));break;case 357:this.$=r.addDataToNode(r,o[u-2],o[u])(new r.Op("+",s[u-2],s[u]));break;case 358:this.$=r.addDataToNode(r,o[u-2],o[u])(new r.Op("-",s[u-2],s[u]));break;case 359:case 360:case 361:case 362:case 363:case 364:case 365:case 366:case 367:case 368:this.$=r.addDataToNode(r,o[u-2],o[u])(new r.Op(s[u-1],s[u-2],s[u]));break;case 369:this.$=r.addDataToNode(r,o[u-2],o[u])(function(){return"!"===s[u-1].charAt(0)?(new r.Op(s[u-1].slice(1),s[u-2],s[u])).invert():new r.Op(s[u-1],s[u-2],s[u])}());break;case 370:this.$=r.addDataToNode(r,o[u-2],o[u])(new r.Assign(s[u-2],s[u],s[u-1]));break;case 371:this.$=r.addDataToNode(r,o[u-4],o[u])(new r.Assign(s[u-4],s[u-1],s[u-3]));break;case 372:this.$=r.addDataToNode(r,o[u-3],o[u])(new r.Assign(s[u-3],s[u],s[u-2]))}},table:[{1:[2,1],3:1,4:2,5:3,7:4,8:5,9:6,10:7,11:27,12:28,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,29:20,30:21,31:22,32:r,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,84:b,85:w,86:E,89:37,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:F,175:57,176:I,177:q,178:R,179:U,180:z,181:W},{1:[3]},{1:[2,2],6:X},t(V,[2,3]),t($,[2,6],{151:111,154:112,158:116,148:J,150:K,156:Q,174:G,178:Y,179:Z,182:et,183:tt,184:nt,185:rt,186:it,187:st,188:ot,189:ut,190:at,191:ft,192:lt,193:ct}),t($,[2,7]),t($,[2,8],{158:116,151:118,154:119,148:J,150:K,156:Q,174:ht}),t($,[2,9]),t(pt,[2,16],{124:120,99:121,104:127,45:dt,46:dt,126:dt,80:vt,81:mt,101:gt,102:yt,103:bt,105:wt,125:Et}),t(pt,[2,17],{104:127,99:130,80:vt,81:mt,101:gt,102:yt,103:bt,105:wt}),t(pt,[2,18]),t(pt,[2,19]),t(pt,[2,20]),t(pt,[2,21]),t(pt,[2,22]),t(pt,[2,23]),t(pt,[2,24]),t(pt,[2,25]),t(pt,[2,26]),t(pt,[2,27]),t($,[2,28]),t($,[2,29]),t($,[2,30]),t(St,[2,12]),t(St,[2,13]),t(St,[2,14]),t(St,[2,15]),t($,[2,10]),t($,[2,11]),t(xt,Tt,{61:[1,131]}),t(xt,[2,123]),t(xt,[2,124]),t(xt,[2,125]),t(xt,Nt),t(xt,[2,127]),t(xt,[2,128]),t(Ct,kt,{87:132,94:133,95:134,37:136,67:137,96:138,73:139,38:i,39:s,68:Lt,70:At,107:T,130:Ot}),{5:143,7:4,8:5,9:6,10:7,11:27,12:28,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,29:20,30:21,31:22,32:r,34:142,35:Mt,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,84:b,85:w,86:E,89:37,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:F,175:57,176:I,177:q,178:R,179:U,180:z,181:W},{7:145,8:146,9:148,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,29:20,30:21,31:22,32:_t,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:E,89:37,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:F,175:57,176:I,177:q,178:R,179:U,180:z,181:W},{7:150,9:154,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,32:_t,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:Pt,89:152,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:Ht,176:Bt,177:q,178:R,179:U,180:z,181:W},{7:156,9:154,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,32:_t,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:Pt,89:152,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:Ht,176:Bt,177:q,178:R,179:U,180:z,181:W},{7:157,9:154,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,32:_t,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:Pt,89:152,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:Ht,176:Bt,177:q,178:R,179:U,180:z,181:W},{7:158,9:154,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,32:_t,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,84:[1,159],85:Dt,86:Pt,89:152,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:Ht,176:Bt,177:q,178:R,179:U,180:z,181:W},{17:161,18:162,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:163,67:79,68:g,73:62,74:31,75:35,76:34,77:y,86:Pt,89:152,90:S,91:x,96:61,98:160,100:32,107:T,129:L,130:A,145:_},{17:161,18:162,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:163,67:79,68:g,73:62,74:31,75:35,76:34,77:y,86:Pt,89:152,90:S,91:x,96:61,98:164,100:32,107:T,129:L,130:A,145:_},t(jt,Ft,{180:[1,165],181:[1,166],194:[1,167]}),t(pt,[2,336],{169:[1,168]}),{34:169,35:Mt},{34:170,35:Mt},{34:171,35:Mt},t(pt,[2,266]),{34:172,35:Mt},{34:173,35:Mt},{7:174,8:175,9:148,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,29:20,30:21,31:22,32:_t,35:[1,176],37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:E,89:37,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:F,175:57,176:I,177:q,178:R,179:U,180:z,181:W},t(It,[2,147],{53:30,74:31,100:32,51:33,76:34,75:35,96:61,73:62,42:63,48:65,37:78,67:79,44:88,89:152,17:161,18:162,60:163,34:177,98:179,35:Mt,38:i,39:s,43:o,45:u,46:a,49:f,50:l,54:c,55:h,56:p,57:d,58:v,59:m,68:g,77:y,86:Pt,90:S,91:x,107:T,111:[1,178],129:L,130:A,145:_}),{7:180,9:154,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,32:_t,35:[1,181],37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:Pt,89:152,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:Ht,176:Bt,177:q,178:R,179:U,180:z,181:W},t([1,6,35,36,47,69,70,93,127,135,146,148,149,150,156,157,174,182,183,184,185,186,187,188,189,190,191,192,193],qt,{17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,13:23,15:25,16:26,60:29,53:30,74:31,100:32,51:33,76:34,75:35,98:45,172:46,151:48,147:49,152:50,154:51,155:52,96:61,73:62,42:63,48:65,37:78,67:79,158:85,44:88,89:152,9:154,7:182,14:n,32:_t,33:Rt,38:i,39:s,43:o,45:u,46:a,49:f,50:l,54:c,55:h,56:p,57:d,58:v,59:m,68:g,77:y,84:[1,184],85:Dt,86:Pt,90:S,91:x,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,153:H,167:j,173:Ht,176:Bt,177:q,178:R,179:U,180:z,181:W}),t($,[2,342],{169:[1,185]}),t([1,6,36,47,69,70,93,127,135,146,148,149,150,156,157,174],Ut,{17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,13:23,15:25,16:26,60:29,53:30,74:31,100:32,51:33,76:34,75:35,98:45,172:46,151:48,147:49,152:50,154:51,155:52,96:61,73:62,42:63,48:65,37:78,67:79,158:85,44:88,89:152,9:154,7:186,14:n,32:_t,35:zt,38:i,39:s,43:o,45:u,46:a,49:f,50:l,54:c,55:h,56:p,57:d,58:v,59:m,68:g,77:y,84:b,85:Dt,86:Pt,90:S,91:x,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,153:H,167:j,173:Ht,176:Bt,177:q,178:R,179:U,180:z,181:W}),{37:192,38:i,39:s,44:188,45:u,46:a,107:[1,191],113:189,114:190,119:Wt},{26:195,37:196,38:i,39:s,107:[1,194],110:N,118:[1,197],122:[1,198]},t(jt,[2,120]),t(jt,[2,121]),t(xt,[2,45]),t(xt,[2,46]),t(xt,[2,47]),t(xt,[2,48]),t(xt,[2,49]),t(xt,[2,50]),t(xt,[2,51]),t(xt,[2,52]),{4:199,5:3,7:4,8:5,9:6,10:7,11:27,12:28,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,29:20,30:21,31:22,32:r,35:[1,200],37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,84:b,85:w,86:E,89:37,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:F,175:57,176:I,177:q,178:R,179:U,180:z,181:W},{7:201,8:202,9:148,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,29:20,30:21,31:22,32:_t,35:Xt,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,69:Vt,70:$t,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:E,89:37,90:S,91:x,93:Jt,96:61,97:211,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,131:204,132:205,136:210,137:207,138:206,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:F,175:57,176:I,177:q,178:R,179:U,180:z,181:W},{80:Kt,81:Qt,124:213,125:Et,126:dt},t(xt,[2,200]),t(xt,[2,201],{40:216,41:Gt}),t(Yt,[2,95]),t(Yt,[2,96]),t(Zt,[2,115]),t(Zt,[2,118]),{7:218,8:219,9:148,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,29:20,30:21,31:22,32:_t,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:E,89:37,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:F,175:57,176:I,177:q,178:R,179:U,180:z,181:W},{7:220,8:221,9:148,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,29:20,30:21,31:22,32:_t,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:E,89:37,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:F,175:57,176:I,177:q,178:R,179:U,180:z,181:W},{7:222,8:223,9:148,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,29:20,30:21,31:22,32:_t,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:E,89:37,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:F,175:57,176:I,177:q,178:R,179:U,180:z,181:W},{7:225,9:154,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,32:_t,34:224,35:Mt,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:Pt,89:152,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:Ht,176:Bt,177:q,178:R,179:U,180:z,181:W},{37:230,38:i,39:s,67:231,68:g,73:233,96:232,100:226,107:T,130:Ot,161:227,162:en,163:229},{159:234,160:235,164:[1,236],165:[1,237],166:[1,238]},t([6,35,93,109],tn,{44:88,108:239,62:240,63:241,64:242,66:243,42:244,71:246,37:247,40:248,67:249,72:251,73:252,74:253,75:254,76:255,38:i,39:s,41:Gt,43:o,45:u,46:a,68:nn,70:rn,77:sn,107:T,129:L,130:A,145:_}),t(on,[2,39]),t(on,[2,40]),t(xt,[2,43]),{17:161,18:162,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:257,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:163,67:79,68:g,73:62,74:31,75:35,76:34,77:y,86:Pt,89:152,90:S,91:x,96:61,98:258,100:32,107:T,129:L,130:A,145:_},t(un,[2,36]),t(un,[2,37]),t(an,[2,41]),{4:259,5:3,7:4,8:5,9:6,10:7,11:27,12:28,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,29:20,30:21,31:22,32:r,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,84:b,85:w,86:E,89:37,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:F,175:57,176:I,177:q,178:R,179:U,180:z,181:W},t(V,[2,5],{7:4,8:5,9:6,10:7,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,29:20,30:21,31:22,13:23,15:25,16:26,11:27,12:28,60:29,53:30,74:31,100:32,51:33,76:34,75:35,89:37,98:45,172:46,151:48,147:49,152:50,154:51,155:52,175:57,96:61,73:62,42:63,48:65,37:78,67:79,158:85,44:88,5:260,14:n,32:r,38:i,39:s,43:o,45:u,46:a,49:f,50:l,54:c,55:h,56:p,57:d,58:v,59:m,68:g,77:y,84:b,85:w,86:E,90:S,91:x,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,148:D,150:P,153:H,156:B,167:j,173:F,176:I,177:q,178:R,179:U,180:z,181:W}),t(pt,[2,356]),{7:261,9:154,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,32:_t,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:Pt,89:152,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:Ht,176:Bt,177:q,178:R,179:U,180:z,181:W},{7:262,9:154,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,32:_t,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:Pt,89:152,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:Ht,176:Bt,177:q,178:R,179:U,180:z,181:W},{7:263,9:154,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,32:_t,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:Pt,89:152,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:Ht,176:Bt,177:q,178:R,179:U,180:z,181:W},{7:264,9:154,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,32:_t,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:Pt,89:152,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:Ht,176:Bt,177:q,178:R,179:U,180:z,181:W},{7:265,9:154,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,32:_t,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:Pt,89:152,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:Ht,176:Bt,177:q,178:R,179:U,180:z,181:W},{7:266,9:154,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,32:_t,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:Pt,89:152,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:Ht,176:Bt,177:q,178:R,179:U,180:z,181:W},{7:267,9:154,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,32:_t,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:Pt,89:152,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:Ht,176:Bt,177:q,178:R,179:U,180:z,181:W},{7:268,9:154,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,32:_t,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:Pt,89:152,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:Ht,176:Bt,177:q,178:R,179:U,180:z,181:W},{7:269,9:154,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,32:_t,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:Pt,89:152,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:Ht,176:Bt,177:q,178:R,179:U,180:z,181:W},{7:270,9:154,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,32:_t,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:Pt,89:152,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:Ht,176:Bt,177:q,178:R,179:U,180:z,181:W},{7:271,9:154,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,32:_t,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:Pt,89:152,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:Ht,176:Bt,177:q,178:R,179:U,180:z,181:W},{7:272,9:154,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,32:_t,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:Pt,89:152,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:Ht,176:Bt,177:q,178:R,179:U,180:z,181:W},{7:273,9:154,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,32:_t,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:Pt,89:152,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:Ht,176:Bt,177:q,178:R,179:U,180:z,181:W},{7:274,8:275,9:148,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,29:20,30:21,31:22,32:_t,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:E,89:37,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:F,175:57,176:I,177:q,178:R,179:U,180:z,181:W},t(pt,[2,265]),t(pt,[2,270]),{7:220,8:276,9:148,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,29:20,30:21,31:22,32:_t,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:E,89:37,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:F,175:57,176:I,177:q,178:R,179:U,180:z,181:W},{7:222,8:277,9:148,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,29:20,30:21,31:22,32:_t,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:E,89:37,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:F,175:57,176:I,177:q,178:R,179:U,180:z,181:W},{37:230,38:i,39:s,67:231,68:g,73:233,96:232,100:278,107:T,130:Ot,161:227,162:en,163:229},{159:234,164:[1,279],165:[1,280],166:[1,281]},{7:282,8:283,9:148,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,29:20,30:21,31:22,32:_t,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:E,89:37,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:F,175:57,176:I,177:q,178:R,179:U,180:z,181:W},t(pt,[2,264]),t(pt,[2,269]),{44:284,45:u,46:a,78:285,126:fn},t(Zt,[2,116]),t(ln,[2,197]),{40:287,41:Gt},{40:288,41:Gt},t(Zt,[2,135],{40:289,41:Gt}),{40:290,41:Gt},t(Zt,[2,136]),{7:292,8:294,9:148,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,29:20,30:21,31:22,32:_t,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,70:cn,73:62,74:31,75:35,76:34,77:y,82:291,84:b,85:Dt,86:E,89:37,90:S,91:x,96:61,98:45,100:32,106:293,107:T,110:N,112:C,120:k,129:L,130:A,134:295,135:hn,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:F,175:57,176:I,177:q,178:R,179:U,180:z,181:W},{81:mt,104:298,105:wt},t(Zt,[2,117]),{6:[1,300],7:299,9:154,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,32:_t,35:[1,301],37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:Pt,89:152,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:Ht,176:Bt,177:q,178:R,179:U,180:z,181:W},t(pn,dn,{92:304,88:[1,302],93:vn}),t(mn,[2,100]),t(mn,[2,104],{61:[1,306],70:[1,305]}),t(mn,[2,108],{37:136,67:137,96:138,73:139,95:307,38:i,39:s,68:Lt,107:T,130:Ot}),t(gn,[2,109]),t(gn,[2,110]),t(gn,[2,111]),t(gn,[2,112]),{40:216,41:Gt},{7:308,8:309,9:148,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,29:20,30:21,31:22,32:_t,35:Xt,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,69:Vt,70:$t,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:E,89:37,90:S,91:x,93:Jt,96:61,97:211,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,131:204,132:205,136:210,137:207,138:206,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:F,175:57,176:I,177:q,178:R,179:U,180:z,181:W},t(yn,[2,92]),t($,[2,94]),{4:311,5:3,7:4,8:5,9:6,10:7,11:27,12:28,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,29:20,30:21,31:22,32:r,36:[1,310],37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,84:b,85:w,86:E,89:37,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:F,175:57,176:I,177:q,178:R,179:U,180:z,181:W},t(bn,wn,{151:111,154:112,158:116,182:et}),t($,[2,346]),{7:158,9:154,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,32:_t,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:Pt,89:152,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:Ht,176:Bt,177:q,178:R,179:U,180:z,181:W},{148:J,150:K,151:118,154:119,156:Q,158:116,174:ht},t([1,6,35,36,47,69,70,83,88,93,109,127,135,146,148,149,150,156,157,174,182,183,184,185,186,187,188,189,190,191,192,193],qt,{17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,13:23,15:25,16:26,60:29,53:30,74:31,100:32,51:33,76:34,75:35,98:45,172:46,151:48,147:49,152:50,154:51,155:52,96:61,73:62,42:63,48:65,37:78,67:79,158:85,44:88,89:152,9:154,7:182,14:n,32:_t,33:Rt,38:i,39:s,43:o,45:u,46:a,49:f,50:l,54:c,55:h,56:p,57:d,58:v,59:m,68:g,77:y,84:b,85:Dt,86:Pt,90:S,91:x,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,153:H,167:j,173:Ht,176:Bt,177:q,178:R,179:U,180:z,181:W}),t(En,[2,348],{151:111,154:112,158:116,182:et,184:nt}),t(Ct,kt,{94:133,95:134,37:136,67:137,96:138,73:139,87:313,38:i,39:s,68:Lt,70:At,107:T,130:Ot}),{34:142,35:Mt},{7:314,9:154,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,32:_t,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:Pt,89:152,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:Ht,176:Bt,177:q,178:R,179:U,180:z,181:W},{148:J,150:K,151:118,154:119,156:Q,158:116,174:[1,315]},{7:316,9:154,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,32:_t,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:Pt,89:152,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:Ht,176:Bt,177:q,178:R,179:U,180:z,181:W},t(En,[2,349],{151:111,154:112,158:116,182:et,184:nt}),t(En,[2,350],{151:111,154:112,158:116,182:et,184:nt}),t(bn,[2,351],{151:111,154:112,158:116,182:et}),t($,[2,90],{17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,13:23,15:25,16:26,60:29,53:30,74:31,100:32,51:33,76:34,75:35,98:45,172:46,151:48,147:49,152:50,154:51,155:52,96:61,73:62,42:63,48:65,37:78,67:79,158:85,44:88,89:152,9:154,7:317,14:n,32:_t,38:i,39:s,43:o,45:u,46:a,49:f,50:l,54:c,55:h,56:p,57:d,58:v,59:m,68:g,77:y,84:b,85:Dt,86:Pt,90:S,91:x,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,148:Ut,150:Ut,156:Ut,174:Ut,153:H,167:j,173:Ht,176:Bt,177:q,178:R,179:U,180:z,181:W}),t(pt,[2,352],{45:Ft,46:Ft,80:Ft,81:Ft,101:Ft,102:Ft,103:Ft,105:Ft,125:Ft,126:Ft}),t(ln,dt,{124:120,99:121,104:127,80:vt,81:mt,101:gt,102:yt,103:bt,105:wt,125:Et}),{80:vt,81:mt,99:130,101:gt,102:yt,103:bt,104:127,105:wt},t(Sn,Tt),t(pt,[2,353],{45:Ft,46:Ft,80:Ft,81:Ft,101:Ft,102:Ft,103:Ft,105:Ft,125:Ft,126:Ft}),t(pt,[2,354]),t(pt,[2,355]),{6:[1,320],7:318,9:154,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,32:_t,35:[1,319],37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:Pt,89:152,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:Ht,176:Bt,177:q,178:R,179:U,180:z,181:W},{34:321,35:Mt,173:[1,322]},t(pt,[2,241],{141:323,142:[1,324],143:[1,325]}),t(pt,[2,262]),t(pt,[2,263]),t(pt,[2,271]),t(pt,[2,272]),{35:[1,326],148:J,150:K,151:111,154:112,156:Q,158:116,174:G,178:Y,179:Z,182:et,183:tt,184:nt,185:rt,186:it,187:st,188:ot,189:ut,190:at,191:ft,192:lt,193:ct},{35:[1,327]},{168:328,170:329,171:xn},t(pt,[2,148]),{7:331,9:154,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,32:_t,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:Pt,89:152,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:Ht,176:Bt,177:q,178:R,179:U,180:z,181:W},t(It,[2,151],{34:332,35:Mt,45:Ft,46:Ft,80:Ft,81:Ft,101:Ft,102:Ft,103:Ft,105:Ft,125:Ft,126:Ft,111:[1,333]}),t(Tn,[2,248],{151:111,154:112,158:116,178:Y,179:Z,182:et,183:tt,184:nt,185:rt,186:it,187:st,188:ot,189:ut,190:at,191:ft,192:lt,193:ct}),{73:334,107:T},t(Tn,[2,32],{151:111,154:112,158:116,178:Y,179:Z,182:et,183:tt,184:nt,185:rt,186:it,187:st,188:ot,189:ut,190:at,191:ft,192:lt,193:ct}),{7:335,9:154,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,32:_t,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:Pt,89:152,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:Ht,176:Bt,177:q,178:R,179:U,180:z,181:W},t([1,6,36,47,69,70,93,127,135,146,149,157],[2,88],{17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,13:23,15:25,16:26,60:29,53:30,74:31,100:32,51:33,76:34,75:35,98:45,172:46,151:48,147:49,152:50,154:51,155:52,96:61,73:62,42:63,48:65,37:78,67:79,158:85,44:88,89:152,9:154,7:336,14:n,32:_t,35:zt,38:i,39:s,43:o,45:u,46:a,49:f,50:l,54:c,55:h,56:p,57:d,58:v,59:m,68:g,77:y,84:b,85:Dt,86:Pt,90:S,91:x,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,148:Ut,150:Ut,156:Ut,174:Ut,153:H,167:j,173:Ht,176:Bt,177:q,178:R,179:U,180:z,181:W}),{34:337,35:Mt,173:[1,338]},t(St,Nn,{151:111,154:112,158:116,178:Y,179:Z,182:et,183:tt,184:nt,185:rt,186:it,187:st,188:ot,189:ut,190:at,191:ft,192:lt,193:ct}),{73:339,107:T},t(St,[2,155]),{33:[1,340],93:[1,341]},{33:[1,342]},{35:Cn,37:347,38:i,39:s,109:[1,343],115:344,116:345,118:kn},t([33,93],[2,171]),{117:[1,349]},{35:Ln,37:354,38:i,39:s,109:[1,350],118:An,121:351,123:352},t(St,[2,175]),{61:[1,356]},{7:357,9:154,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,32:_t,35:[1,358],37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:Pt,89:152,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:Ht,176:Bt,177:q,178:R,179:U,180:z,181:W},{33:[1,359]},{6:X,146:[1,360]},{4:361,5:3,7:4,8:5,9:6,10:7,11:27,12:28,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,29:20,30:21,31:22,32:r,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,84:b,85:w,86:E,89:37,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:F,175:57,176:I,177:q,178:R,179:U,180:z,181:W},t(On,Mn,{151:111,154:112,158:116,134:362,70:[1,363],135:hn,148:J,150:K,156:Q,174:G,178:Y,179:Z,182:et,183:tt,184:nt,185:rt,186:it,187:st,188:ot,189:ut,190:at,191:ft,192:lt,193:ct}),t(On,_n,{134:364,70:cn,135:hn}),t(Dn,[2,203]),{7:308,8:309,9:148,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,29:20,30:21,31:22,32:_t,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,69:[1,365],70:$t,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:E,89:37,90:S,91:x,93:Jt,96:61,97:211,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,136:367,138:366,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:F,175:57,176:I,177:q,178:R,179:U,180:z,181:W},t([6,35,69],dn,{133:368,92:370,93:Pn}),t(Hn,[2,234]),t(Bn,[2,225]),{7:308,8:309,9:148,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,29:20,30:21,31:22,32:_t,35:Xt,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,70:$t,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:E,89:37,90:S,91:x,93:Jt,96:61,97:211,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,131:372,132:371,136:210,137:207,138:206,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:F,175:57,176:I,177:q,178:R,179:U,180:z,181:W},t(Hn,[2,236]),t(Bn,[2,230]),t(jn,[2,223]),t(jn,[2,224],{17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,13:23,15:25,16:26,60:29,53:30,74:31,100:32,51:33,76:34,75:35,98:45,172:46,151:48,147:49,152:50,154:51,155:52,96:61,73:62,42:63,48:65,37:78,67:79,158:85,44:88,89:152,9:154,7:373,14:n,32:_t,38:i,39:s,43:o,45:u,46:a,49:f,50:l,54:c,55:h,56:p,57:d,58:v,59:m,68:g,77:y,84:b,85:Dt,86:Pt,90:S,91:x,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,148:D,150:P,153:H,156:B,167:j,173:Ht,176:Bt,177:q,178:R,179:U,180:z,181:W}),{78:374,126:fn},{40:375,41:Gt},{7:376,9:154,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,32:_t,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:Pt,89:152,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:Ht,176:Bt,177:q,178:R,179:U,180:z,181:W},t(Fn,[2,202]),t(Fn,[2,38]),{34:377,35:Mt,148:J,150:K,151:111,154:112,156:Q,158:116,174:G,178:Y,179:Z,182:et,183:tt,184:nt,185:rt,186:it,187:st,188:ot,189:ut,190:at,191:ft,192:lt,193:ct},{34:378,35:Mt},t(In,[2,256],{151:111,154:112,158:116,148:J,149:[1,379],150:K,156:Q,178:Y,179:Z,182:et,183:tt,184:nt,185:rt,186:it,187:st,188:ot,189:ut,190:at,191:ft,192:lt,193:ct}),{35:[2,252],149:[1,380]},t(In,[2,259],{151:111,154:112,158:116,148:J,149:[1,381],150:K,156:Q,178:Y,179:Z,182:et,183:tt,184:nt,185:rt,186:it,187:st,188:ot,189:ut,190:at,191:ft,192:lt,193:ct}),{35:[2,254],149:[1,382]},t(pt,[2,267]),t(qn,[2,268],{151:111,154:112,158:116,148:J,150:K,156:Q,178:Y,179:Z,182:et,183:tt,184:nt,185:rt,186:it,187:st,188:ot,189:ut,190:at,191:ft,192:lt,193:ct}),{35:Rn,157:[1,383]},t(Un,[2,278]),{37:230,38:i,39:s,67:231,68:Lt,73:233,96:232,107:T,130:Ot,161:384,163:229},t(Un,[2,284],{93:[1,385]}),t(zn,[2,280]),t(zn,[2,281]),t(zn,[2,282]),t(zn,[2,283]),t(pt,[2,275]),{35:[2,277]},{7:386,8:387,9:148,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,29:20,30:21,31:22,32:_t,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:E,89:37,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:F,175:57,176:I,177:q,178:R,179:U,180:z,181:W},{7:388,8:389,9:148,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,29:20,30:21,31:22,32:_t,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:E,89:37,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:F,175:57,176:I,177:q,178:R,179:U,180:z,181:W},{7:390,8:391,9:148,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,29:20,30:21,31:22,32:_t,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:E,89:37,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:F,175:57,176:I,177:q,178:R,179:U,180:z,181:W},t(Wn,dn,{92:392,93:Xn}),t(Vn,[2,143]),t(Vn,[2,56],{65:[1,394]}),t(Vn,[2,57]),t($n,[2,66],{78:397,79:398,61:[1,395],70:[1,396],80:Jn,81:Kn,126:fn}),t($n,[2,67]),{37:247,38:i,39:s,40:248,41:Gt,66:401,67:249,68:nn,71:402,72:251,73:252,74:253,75:254,76:255,77:sn,107:T,129:L,130:A,145:_},{70:[1,403],78:404,79:405,80:Jn,81:Kn,126:fn},t(Qn,[2,62]),t(Qn,[2,63]),t(Qn,[2,64]),{7:406,9:154,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,32:_t,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:Pt,89:152,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:Ht,176:Bt,177:q,178:R,179:U,180:z,181:W},t(Gn,[2,72]),t(Gn,[2,73]),t(Gn,[2,74]),t(Gn,[2,75]),t(Gn,[2,76]),{78:407,80:Kt,81:Qt,126:fn},t(Sn,Nt,{52:[1,408]}),t(Sn,Ft),{6:X,47:[1,409]},t(V,[2,4]),t(Yn,[2,357],{151:111,154:112,158:116,182:et,183:tt,184:nt}),t(Yn,[2,358],{151:111,154:112,158:116,182:et,183:tt,184:nt}),t(En,[2,359],{151:111,154:112,158:116,182:et,184:nt}),t(En,[2,360],{151:111,154:112,158:116,182:et,184:nt}),t([1,6,35,36,47,69,70,83,88,93,109,127,135,146,148,149,150,156,157,174,185,186,187,188,189,190,191,192,193],[2,361],{151:111,154:112,158:116,178:Y,179:Z,182:et,183:tt,184:nt}),t([1,6,35,36,47,69,70,83,88,93,109,127,135,146,148,149,150,156,157,174,186,187,188,189,190,191,192],[2,362],{151:111,154:112,158:116,178:Y,179:Z,182:et,183:tt,184:nt,185:rt,193:ct}),t([1,6,35,36,47,69,70,83,88,93,109,127,135,146,148,149,150,156,157,174,187,188,189,190,191,192],[2,363],{151:111,154:112,158:116,178:Y,179:Z,182:et,183:tt,184:nt,185:rt,186:it,193:ct}),t([1,6,35,36,47,69,70,83,88,93,109,127,135,146,148,149,150,156,157,174,188,189,190,191,192],[2,364],{151:111,154:112,158:116,178:Y,179:Z,182:et,183:tt,184:nt,185:rt,186:it,187:st,193:ct}),t([1,6,35,36,47,69,70,83,88,93,109,127,135,146,148,149,150,156,157,174,189,190,191,192],[2,365],{151:111,154:112,158:116,178:Y,179:Z,182:et,183:tt,184:nt,185:rt,186:it,187:st,188:ot,193:ct}),t([1,6,35,36,47,69,70,83,88,93,109,127,135,146,148,149,150,156,157,174,190,191,192],[2,366],{151:111,154:112,158:116,178:Y,179:Z,182:et,183:tt,184:nt,185:rt,186:it,187:st,188:ot,189:ut,193:ct}),t([1,6,35,36,47,69,70,83,88,93,109,127,135,146,148,149,150,156,157,174,191,192],[2,367],{151:111,154:112,158:116,178:Y,179:Z,182:et,183:tt,184:nt,185:rt,186:it,187:st,188:ot,189:ut,190:at,193:ct}),t([1,6,35,36,47,69,70,83,88,93,109,127,135,146,148,149,150,156,157,174,192],[2,368],{151:111,154:112,158:116,178:Y,179:Z,182:et,183:tt,184:nt,185:rt,186:it,187:st,188:ot,189:ut,190:at,191:ft,193:ct}),t([1,6,35,36,47,69,70,83,88,93,109,127,135,146,148,149,150,156,157,174,186,187,188,189,190,191,192,193],[2,369],{151:111,154:112,158:116,178:Y,179:Z,182:et,183:tt,184:nt,185:rt}),t(qn,Zn,{151:111,154:112,158:116,148:J,150:K,156:Q,178:Y,179:Z,182:et,183:tt,184:nt,185:rt,186:it,187:st,188:ot,189:ut,190:at,191:ft,192:lt,193:ct}),t($,[2,345]),{149:[1,410]},{149:[1,411]},t([1,6,35,36,47,69,70,83,88,93,109,127,135,146,148,149,150,156,174,178,179,182,183,184,185,186,187,188,189,190,191,192,193],Rn,{157:[1,412]}),{7:413,8:414,9:148,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,29:20,30:21,31:22,32:_t,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:E,89:37,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:F,175:57,176:I,177:q,178:R,179:U,180:z,181:W},{7:415,8:416,9:148,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,29:20,30:21,31:22,32:_t,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:E,89:37,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:F,175:57,176:I,177:q,178:R,179:U,180:z,181:W},{7:417,8:418,9:148,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,29:20,30:21,31:22,32:_t,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:E,89:37,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:F,175:57,176:I,177:q,178:R,179:U,180:z,181:W},t(qn,er,{151:111,154:112,158:116,148:J,150:K,156:Q,178:Y,179:Z,182:et,183:tt,184:nt,185:rt,186:it,187:st,188:ot,189:ut,190:at,191:ft,192:lt,193:ct}),t($,[2,344]),t(tr,[2,193]),t(tr,[2,194]),{7:308,8:309,9:148,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,29:20,30:21,31:22,32:_t,35:nr,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,70:$t,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:E,89:37,90:S,91:x,96:61,97:211,98:45,100:32,107:T,110:N,112:C,120:k,127:[1,419],128:420,129:L,130:A,136:421,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:F,175:57,176:I,177:q,178:R,179:U,180:z,181:W},t(Zt,[2,131]),t(Zt,[2,132]),t(Zt,[2,133]),t(Zt,[2,134]),{83:[1,423]},{70:cn,83:[2,139],134:424,135:hn,148:J,150:K,151:111,154:112,156:Q,158:116,174:G,178:Y,179:Z,182:et,183:tt,184:nt,185:rt,186:it,187:st,188:ot,189:ut,190:at,191:ft,192:lt,193:ct},{83:[2,140]},{70:cn,134:425,135:hn},{7:426,9:154,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,32:_t,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,83:[2,215],84:b,85:Dt,86:Pt,89:152,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:Ht,176:Bt,177:q,178:R,179:U,180:z,181:W},t(rr,[2,206]),t(rr,ir),t(Zt,[2,138]),t(Tn,[2,53],{151:111,154:112,158:116,178:Y,179:Z,182:et,183:tt,184:nt,185:rt,186:it,187:st,188:ot,189:ut,190:at,191:ft,192:lt,193:ct}),{7:427,9:154,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,32:_t,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:Pt,89:152,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:Ht,176:Bt,177:q,178:R,179:U,180:z,181:W},{7:428,9:154,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,32:_t,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:Pt,89:152,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:Ht,176:Bt,177:q,178:R,179:U,180:z,181:W},{89:429,90:S,91:x},t(sr,or,{95:134,37:136,67:137,96:138,73:139,94:430,38:i,39:s,68:Lt,70:At,107:T,130:Ot}),{6:ur,35:ar},t(mn,[2,105]),{7:433,9:154,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,32:_t,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:Pt,89:152,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:Ht,176:Bt,177:q,178:R,179:U,180:z,181:W},t(mn,[2,106]),t(jn,Mn,{151:111,154:112,158:116,70:[1,434],148:J,150:K,156:Q,174:G,178:Y,179:Z,182:et,183:tt,184:nt,185:rt,186:it,187:st,188:ot,189:ut,190:at,191:ft,192:lt,193:ct}),t(jn,_n),t(fr,[2,34]),{6:X,36:[1,435]},{7:436,9:154,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,32:_t,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:Pt,89:152,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:Ht,176:Bt,177:q,178:R,179:U,180:z,181:W},t(pn,dn,{92:304,88:[1,437],93:vn}),t(bn,wn,{151:111,154:112,158:116,182:et}),{7:438,9:154,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,32:_t,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:Pt,89:152,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:Ht,176:Bt,177:q,178:R,179:U,180:z,181:W},{34:377,35:Mt,148:J,150:K,151:111,154:112,156:Q,158:116,174:lr,178:Y,179:Z,182:et,183:tt,184:nt,185:rt,186:it,187:st,188:ot,189:ut,190:at,191:ft,192:lt,193:ct},t($,[2,89],{151:111,154:112,158:116,148:Nn,150:Nn,156:Nn,174:Nn,178:Y,179:Z,182:et,183:tt,184:nt,185:rt,186:it,187:st,188:ot,189:ut,190:at,191:ft,192:lt,193:ct}),t(Tn,[2,370],{151:111,154:112,158:116,178:Y,179:Z,182:et,183:tt,184:nt,185:rt,186:it,187:st,188:ot,189:ut,190:at,191:ft,192:lt,193:ct}),{7:439,9:154,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,32:_t,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:Pt,89:152,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:Ht,176:Bt,177:q,178:R,179:U,180:z,181:W},{7:440,9:154,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,32:_t,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:Pt,89:152,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:Ht,176:Bt,177:q,178:R,179:U,180:z,181:W},t(pt,[2,337]),{7:441,9:154,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,32:_t,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:Pt,89:152,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:Ht,176:Bt,177:q,178:R,179:U,180:z,181:W},t(pt,[2,242],{142:[1,442]}),{34:443,35:Mt},{34:446,35:Mt,37:444,38:i,39:s,73:445,107:T},{168:447,170:329,171:xn},{168:448,170:329,171:xn},{36:[1,449],169:[1,450],170:451,171:xn},t(cr,[2,330]),{7:453,8:454,9:148,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,29:20,30:21,31:22,32:_t,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:E,89:37,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,139:452,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:F,175:57,176:I,177:q,178:R,179:U,180:z,181:W},t(hr,[2,149],{151:111,154:112,158:116,34:455,35:Mt,148:J,150:K,156:Q,178:Y,179:Z,182:et,183:tt,184:nt,185:rt,186:it,187:st,188:ot,189:ut,190:at,191:ft,192:lt,193:ct}),t(pt,[2,152]),{7:456,9:154,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,32:_t,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:Pt,89:152,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:Ht,176:Bt,177:q,178:R,179:U,180:z,181:W},{36:[1,457]},t(Tn,[2,33],{151:111,154:112,158:116,178:Y,179:Z,182:et,183:tt,184:nt,185:rt,186:it,187:st,188:ot,189:ut,190:at,191:ft,192:lt,193:ct}),t($,[2,87],{151:111,154:112,158:116,148:Nn,150:Nn,156:Nn,174:Nn,178:Y,179:Z,182:et,183:tt,184:nt,185:rt,186:it,187:st,188:ot,189:ut,190:at,191:ft,192:lt,193:ct}),t($,[2,343]),{7:459,8:458,9:148,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,29:20,30:21,31:22,32:_t,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:E,89:37,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:F,175:57,176:I,177:q,178:R,179:U,180:z,181:W},{36:[1,460]},{44:461,45:u,46:a},{107:[1,463],114:462,119:Wt},{44:464,45:u,46:a},{33:[1,465]},t(Wn,dn,{92:466,93:pr}),t(Vn,[2,162]),{35:Cn,37:347,38:i,39:s,115:468,116:345,118:kn},t(Vn,[2,167],{117:[1,469]}),t(Vn,[2,169],{117:[1,470]}),{37:471,38:i,39:s},t(St,[2,173]),t(Wn,dn,{92:472,93:dr}),t(Vn,[2,183]),{35:Ln,37:354,38:i,39:s,118:An,121:474,123:352},t(Vn,[2,188],{117:[1,475]}),t(Vn,[2,191],{117:[1,476]}),{6:[1,478],7:477,9:154,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,32:_t,35:[1,479],37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:Pt,89:152,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:Ht,176:Bt,177:q,178:R,179:U,180:z,181:W},t(vr,[2,179],{151:111,154:112,158:116,148:J,150:K,156:Q,178:Y,179:Z,182:et,183:tt,184:nt,185:rt,186:it,187:st,188:ot,189:ut,190:at,191:ft,192:lt,193:ct}),{73:480,107:T},{44:481,45:u,46:a},t(xt,[2,250]),{6:X,36:[1,482]},{7:483,9:154,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,32:_t,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:Pt,89:152,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:Ht,176:Bt,177:q,178:R,179:U,180:z,181:W},t([14,32,38,39,43,45,46,49,50,54,55,56,57,58,59,68,77,84,85,86,90,91,107,110,112,120,129,130,140,144,145,148,150,153,156,167,173,176,177,178,179,180,181],ir,{6:mr,35:mr,69:mr,93:mr}),{7:484,9:154,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,32:_t,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:Pt,89:152,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:Ht,176:Bt,177:q,178:R,179:U,180:z,181:W},t(Dn,[2,204]),t(Hn,[2,235]),t(Bn,[2,231]),{6:gr,35:yr,69:[1,485]},t(br,or,{17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,29:20,30:21,31:22,13:23,15:25,16:26,60:29,53:30,74:31,100:32,51:33,76:34,75:35,89:37,98:45,172:46,151:48,147:49,152:50,154:51,155:52,175:57,96:61,73:62,42:63,48:65,37:78,67:79,158:85,44:88,9:148,138:206,136:210,97:211,7:308,8:309,137:488,131:489,14:n,32:_t,38:i,39:s,43:o,45:u,46:a,49:f,50:l,54:c,55:h,56:p,57:d,58:v,59:m,68:g,70:$t,77:y,84:b,85:Dt,86:E,90:S,91:x,93:Jt,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,148:D,150:P,153:H,156:B,167:j,173:F,176:I,177:q,178:R,179:U,180:z,181:W}),t(br,[2,232]),t(sr,dn,{92:370,133:490,93:Pn}),{7:308,8:309,9:148,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,29:20,30:21,31:22,32:_t,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,70:$t,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:E,89:37,90:S,91:x,93:Jt,96:61,97:211,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,136:367,138:366,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:F,175:57,176:I,177:q,178:R,179:U,180:z,181:W},t(jn,[2,114],{151:111,154:112,158:116,148:J,150:K,156:Q,174:lr,178:Y,179:Z,182:et,183:tt,184:nt,185:rt,186:it,187:st,188:ot,189:ut,190:at,191:ft,192:lt,193:ct}),t(tr,[2,195]),t(xt,[2,129]),{83:[1,491],148:J,150:K,151:111,154:112,156:Q,158:116,174:lr,178:Y,179:Z,182:et,183:tt,184:nt,185:rt,186:it,187:st,188:ot,189:ut,190:at,191:ft,192:lt,193:ct},t(wr,[2,334]),t(Er,[2,340]),{7:492,9:154,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,32:_t,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:Pt,89:152,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:Ht,176:Bt,177:q,178:R,179:U,180:z,181:W},{7:493,8:494,9:148,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,29:20,30:21,31:22,32:_t,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:E,89:37,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:F,175:57,176:I,177:q,178:R,179:U,180:z,181:W},{7:495,9:154,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,32:_t,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:Pt,89:152,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:Ht,176:Bt,177:q,178:R,179:U,180:z,181:W},{7:496,8:497,9:148,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,29:20,30:21,31:22,32:_t,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:E,89:37,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:F,175:57,176:I,177:q,178:R,179:U,180:z,181:W},{7:498,8:499,9:148,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,29:20,30:21,31:22,32:_t,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:E,89:37,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:F,175:57,176:I,177:q,178:R,179:U,180:z,181:W},t(Un,[2,279]),{37:230,38:i,39:s,67:231,68:Lt,73:233,96:232,107:T,130:Ot,163:500},{35:Sr,148:J,149:[1,501],150:K,151:111,154:112,156:Q,157:[1,502],158:116,174:G,178:Y,179:Z,182:et,183:tt,184:nt,185:rt,186:it,187:st,188:ot,189:ut,190:at,191:ft,192:lt,193:ct},{35:[2,305],149:[1,503],157:[1,504]},{35:xr,148:J,149:[1,505],150:K,151:111,154:112,156:Q,158:116,174:G,178:Y,179:Z,182:et,183:tt,184:nt,185:rt,186:it,187:st,188:ot,189:ut,190:at,191:ft,192:lt,193:ct},{35:[2,306],149:[1,506]},{35:Tr,148:J,149:[1,507],150:K,151:111,154:112,156:Q,158:116,174:G,178:Y,179:Z,182:et,183:tt,184:nt,185:rt,186:it,187:st,188:ot,189:ut,190:at,191:ft,192:lt,193:ct},{35:[2,321],149:[1,508]},{6:Nr,35:Cr,109:[1,509]},t(kr,or,{44:88,63:241,64:242,66:243,42:244,71:246,37:247,40:248,67:249,72:251,73:252,74:253,75:254,76:255,62:512,38:i,39:s,41:Gt,43:o,45:u,46:a,68:nn,70:rn,77:sn,107:T,129:L,130:A,145:_}),{7:513,9:154,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,32:_t,35:[1,514],37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:Pt,89:152,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:Ht,176:Bt,177:q,178:R,179:U,180:z,181:W},{7:515,9:154,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,32:_t,35:[1,516],37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:Pt,89:152,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:Ht,176:Bt,177:q,178:R,179:U,180:z,181:W},t(Vn,[2,68]),t(Gn,[2,78]),t(Gn,[2,80]),{40:517,41:Gt},{7:292,8:294,9:148,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,29:20,30:21,31:22,32:_t,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,70:cn,73:62,74:31,75:35,76:34,77:y,82:518,84:b,85:Dt,86:E,89:37,90:S,91:x,96:61,98:45,100:32,106:293,107:T,110:N,112:C,120:k,129:L,130:A,134:295,135:hn,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:F,175:57,176:I,177:q,178:R,179:U,180:z,181:W},t(Vn,[2,69],{78:397,79:398,80:Jn,81:Kn,126:fn}),t(Vn,[2,71],{78:404,79:405,80:Jn,81:Kn,126:fn}),t(Vn,[2,70]),t(Gn,[2,79]),t(Gn,[2,81]),{69:[1,519],148:J,150:K,151:111,154:112,156:Q,158:116,174:lr,178:Y,179:Z,182:et,183:tt,184:nt,185:rt,186:it,187:st,188:ot,189:ut,190:at,191:ft,192:lt,193:ct},t(Gn,[2,77]),t(xt,[2,44]),t(an,[2,42]),{7:520,9:154,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,32:_t,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:Pt,89:152,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:Ht,176:Bt,177:q,178:R,179:U,180:z,181:W},{7:521,9:154,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,32:_t,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:Pt,89:152,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:Ht,176:Bt,177:q,178:R,179:U,180:z,181:W},{7:522,9:154,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,32:_t,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:Pt,89:152,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:Ht,176:Bt,177:q,178:R,179:U,180:z,181:W},t([1,6,35,36,47,69,70,83,88,93,109,127,135,146,148,150,156,174],Sr,{151:111,154:112,158:116,149:[1,523],157:[1,524],178:Y,179:Z,182:et,183:tt,184:nt,185:rt,186:it,187:st,188:ot,189:ut,190:at,191:ft,192:lt,193:ct}),{149:[1,525],157:[1,526]},t(Lr,xr,{151:111,154:112,158:116,149:[1,527],178:Y,179:Z,182:et,183:tt,184:nt,185:rt,186:it,187:st,188:ot,189:ut,190:at,191:ft,192:lt,193:ct}),{149:[1,528]},t(Lr,Tr,{151:111,154:112,158:116,149:[1,529],178:Y,179:Z,182:et,183:tt,184:nt,185:rt,186:it,187:st,188:ot,189:ut,190:at,191:ft,192:lt,193:ct}),{149:[1,530]},t(tr,[2,198]),t([6,35,127],dn,{92:531,93:Ar}),t(Or,[2,216]),{7:308,8:309,9:148,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,29:20,30:21,31:22,32:_t,35:nr,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,70:$t,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:E,89:37,90:S,91:x,96:61,97:211,98:45,100:32,107:T,110:N,112:C,120:k,128:533,129:L,130:A,136:421,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:F,175:57,176:I,177:q,178:R,179:U,180:z,181:W},t(Zt,[2,137]),{7:534,9:154,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,32:_t,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,83:[2,211],84:b,85:Dt,86:Pt,89:152,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:Ht,176:Bt,177:q,178:R,179:U,180:z,181:W},{7:535,9:154,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,32:_t,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,83:[2,213],84:b,85:Dt,86:Pt,89:152,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:Ht,176:Bt,177:q,178:R,179:U,180:z,181:W},{83:[2,214],148:J,150:K,151:111,154:112,156:Q,158:116,174:lr,178:Y,179:Z,182:et,183:tt,184:nt,185:rt,186:it,187:st,188:ot,189:ut,190:at,191:ft,192:lt,193:ct},t(Tn,[2,54],{151:111,154:112,158:116,178:Y,179:Z,182:et,183:tt,184:nt,185:rt,186:it,187:st,188:ot,189:ut,190:at,191:ft,192:lt,193:ct}),{36:[1,536],148:J,150:K,151:111,154:112,156:Q,158:116,174:lr,178:Y,179:Z,182:et,183:tt,184:nt,185:rt,186:it,187:st,188:ot,189:ut,190:at,191:ft,192:lt,193:ct},{5:538,7:4,8:5,9:6,10:7,11:27,12:28,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,29:20,30:21,31:22,32:r,34:537,35:Mt,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,84:b,85:w,86:E,89:37,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:F,175:57,176:I,177:q,178:R,179:U,180:z,181:W},t(mn,[2,101]),{37:136,38:i,39:s,67:137,68:Lt,70:At,73:139,94:539,95:134,96:138,107:T,130:Ot},t(Mr,kt,{94:133,95:134,37:136,67:137,96:138,73:139,87:540,38:i,39:s,68:Lt,70:At,107:T,130:Ot}),t(mn,[2,107],{151:111,154:112,158:116,148:J,150:K,156:Q,174:lr,178:Y,179:Z,182:et,183:tt,184:nt,185:rt,186:it,187:st,188:ot,189:ut,190:at,191:ft,192:lt,193:ct}),t(jn,mr),t(fr,[2,35]),t(qn,Zn,{151:111,154:112,158:116,148:J,150:K,156:Q,178:Y,179:Z,182:et,183:tt,184:nt,185:rt,186:it,187:st,188:ot,189:ut,190:at,191:ft,192:lt,193:ct}),{89:541,90:S,91:x},t(qn,er,{151:111,154:112,158:116,148:J,150:K,156:Q,178:Y,179:Z,182:et,183:tt,184:nt,185:rt,186:it,187:st,188:ot,189:ut,190:at,191:ft,192:lt,193:ct}),{36:[1,542],148:J,150:K,151:111,154:112,156:Q,158:116,174:lr,178:Y,179:Z,182:et,183:tt,184:nt,185:rt,186:it,187:st,188:ot,189:ut,190:at,191:ft,192:lt,193:ct},t(Tn,[2,372],{151:111,154:112,158:116,178:Y,179:Z,182:et,183:tt,184:nt,185:rt,186:it,187:st,188:ot,189:ut,190:at,191:ft,192:lt,193:ct}),{34:543,35:Mt,148:J,150:K,151:111,154:112,156:Q,158:116,174:lr,178:Y,179:Z,182:et,183:tt,184:nt,185:rt,186:it,187:st,188:ot,189:ut,190:at,191:ft,192:lt,193:ct},{34:544,35:Mt},t(pt,[2,243]),{34:545,35:Mt},{34:546,35:Mt},t(_r,[2,247]),{36:[1,547],169:[1,548],170:451,171:xn},{36:[1,549],169:[1,550],170:451,171:xn},t(pt,[2,328]),{34:551,35:Mt},t(cr,[2,331]),{34:552,35:Mt,93:[1,553]},t(Dr,[2,237],{151:111,154:112,158:116,148:J,150:K,156:Q,174:G,178:Y,179:Z,182:et,183:tt,184:nt,185:rt,186:it,187:st,188:ot,189:ut,190:at,191:ft,192:lt,193:ct}),t(Dr,[2,238]),t(pt,[2,150]),t(hr,[2,153],{151:111,154:112,158:116,34:554,35:Mt,148:J,150:K,156:Q,178:Y,179:Z,182:et,183:tt,184:nt,185:rt,186:it,187:st,188:ot,189:ut,190:at,191:ft,192:lt,193:ct}),t(pt,[2,249]),{34:555,35:Mt},{148:J,150:K,151:111,154:112,156:Q,158:116,174:G,178:Y,179:Z,182:et,183:tt,184:nt,185:rt,186:it,187:st,188:ot,189:ut,190:at,191:ft,192:lt,193:ct},t(St,[2,85]),t(St,[2,156]),{33:[1,556]},{35:Cn,37:347,38:i,39:s,115:557,116:345,118:kn},t(St,[2,157]),{44:558,45:u,46:a},{6:Pr,35:Hr,109:[1,559]},t(kr,or,{37:347,116:562,38:i,39:s,118:kn}),t(sr,dn,{92:563,93:pr}),{37:564,38:i,39:s},{37:565,38:i,39:s},{33:[2,172]},{6:Br,35:jr,109:[1,566]},t(kr,or,{37:354,123:569,38:i,39:s,118:An}),t(sr,dn,{92:570,93:dr}),{37:571,38:i,39:s,118:[1,572]},{37:573,38:i,39:s},t(vr,[2,176],{151:111,154:112,158:116,148:J,150:K,156:Q,178:Y,179:Z,182:et,183:tt,184:nt,185:rt,186:it,187:st,188:ot,189:ut,190:at,191:ft,192:lt,193:ct}),{7:574,9:154,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,32:_t,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:Pt,89:152,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:Ht,176:Bt,177:q,178:R,179:U,180:z,181:W},{7:575,9:154,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,32:_t,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:Pt,89:152,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:Ht,176:Bt,177:q,178:R,179:U,180:z,181:W},{36:[1,576]},t(St,[2,181]),{146:[1,577]},{69:[1,578],148:J,150:K,151:111,154:112,156:Q,158:116,174:lr,178:Y,179:Z,182:et,183:tt,184:nt,185:rt,186:it,187:st,188:ot,189:ut,190:at,191:ft,192:lt,193:ct},{69:[1,579],148:J,150:K,151:111,154:112,156:Q,158:116,174:lr,178:Y,179:Z,182:et,183:tt,184:nt,185:rt,186:it,187:st,188:ot,189:ut,190:at,191:ft,192:lt,193:ct},t(Dn,[2,205]),{7:308,8:309,9:148,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,29:20,30:21,31:22,32:_t,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,70:$t,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:E,89:37,90:S,91:x,93:Jt,96:61,97:211,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,131:372,136:210,137:580,138:206,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:F,175:57,176:I,177:q,178:R,179:U,180:z,181:W},{7:308,8:309,9:148,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,29:20,30:21,31:22,32:_t,35:Xt,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,70:$t,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:E,89:37,90:S,91:x,93:Jt,96:61,97:211,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,131:372,132:581,136:210,137:207,138:206,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:F,175:57,176:I,177:q,178:R,179:U,180:z,181:W},t(Bn,[2,226]),t(br,[2,233],{17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,29:20,30:21,31:22,13:23,15:25,16:26,60:29,53:30,74:31,100:32,51:33,76:34,75:35,89:37,98:45,172:46,151:48,147:49,152:50,154:51,155:52,175:57,96:61,73:62,42:63,48:65,37:78,67:79,158:85,44:88,9:148,97:211,7:308,8:309,138:366,136:367,14:n,32:_t,38:i,39:s,43:o,45:u,46:a,49:f,50:l,54:c,55:h,56:p,57:d,58:v,59:m,68:g,70:$t,77:y,84:b,85:Dt,86:E,90:S,91:x,93:Jt,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,148:D,150:P,153:H,156:B,167:j,173:F,176:I,177:q,178:R,179:U,180:z,181:W}),{6:gr,35:yr,36:[1,582]},t(xt,[2,130]),t(qn,[2,257],{151:111,154:112,158:116,148:J,150:K,156:Q,178:Y,179:Z,182:et,183:tt,184:nt,185:rt,186:it,187:st,188:ot,189:ut,190:at,191:ft,192:lt,193:ct}),{35:Fr,148:J,150:K,151:111,154:112,156:Q,158:116,174:G,178:Y,179:Z,182:et,183:tt,184:nt,185:rt,186:it,187:st,188:ot,189:ut,190:at,191:ft,192:lt,193:ct},{35:[2,253]},t(qn,[2,260],{151:111,154:112,158:116,148:J,150:K,156:Q,178:Y,179:Z,182:et,183:tt,184:nt,185:rt,186:it,187:st,188:ot,189:ut,190:at,191:ft,192:lt,193:ct}),{35:Ir,148:J,150:K,151:111,154:112,156:Q,158:116,174:G,178:Y,179:Z,182:et,183:tt,184:nt,185:rt,186:it,187:st,188:ot,189:ut,190:at,191:ft,192:lt,193:ct},{35:[2,255]},{35:qr,148:J,150:K,151:111,154:112,156:Q,158:116,174:G,178:Y,179:Z,182:et,183:tt,184:nt,185:rt,186:it,187:st,188:ot,189:ut,190:at,191:ft,192:lt,193:ct},{35:[2,276]},t(Un,[2,285]),{7:583,8:584,9:148,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,29:20,30:21,31:22,32:_t,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:E,89:37,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:F,175:57,176:I,177:q,178:R,179:U,180:z,181:W},{7:585,8:586,9:148,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,29:20,30:21,31:22,32:_t,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:E,89:37,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:F,175:57,176:I,177:q,178:R,179:U,180:z,181:W},{7:587,8:588,9:148,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,29:20,30:21,31:22,32:_t,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:E,89:37,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:F,175:57,176:I,177:q,178:R,179:U,180:z,181:W},{7:589,8:590,9:148,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,29:20,30:21,31:22,32:_t,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:E,89:37,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:F,175:57,176:I,177:q,178:R,179:U,180:z,181:W},{7:591,8:592,9:148,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,29:20,30:21,31:22,32:_t,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:E,89:37,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:F,175:57,176:I,177:q,178:R,179:U,180:z,181:W},{7:593,8:594,9:148,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,29:20,30:21,31:22,32:_t,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:E,89:37,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:F,175:57,176:I,177:q,178:R,179:U,180:z,181:W},{7:595,8:596,9:148,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,29:20,30:21,31:22,32:_t,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:E,89:37,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:F,175:57,176:I,177:q,178:R,179:U,180:z,181:W},{7:597,8:598,9:148,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,29:20,30:21,31:22,32:_t,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:E,89:37,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:F,175:57,176:I,177:q,178:R,179:U,180:z,181:W},t(Dn,[2,141]),{37:247,38:i,39:s,40:248,41:Gt,42:244,43:o,44:88,45:u,46:a,62:599,63:241,64:242,66:243,67:249,68:nn,70:rn,71:246,72:251,73:252,74:253,75:254,76:255,77:sn,107:T,129:L,130:A,145:_},t(Mr,tn,{44:88,62:240,63:241,64:242,66:243,42:244,71:246,37:247,40:248,67:249,72:251,73:252,74:253,75:254,76:255,108:600,38:i,39:s,41:Gt,43:o,45:u,46:a,68:nn,70:rn,77:sn,107:T,129:L,130:A,145:_}),t(Vn,[2,144]),t(Vn,[2,58],{151:111,154:112,158:116,148:J,150:K,156:Q,174:lr,178:Y,179:Z,182:et,183:tt,184:nt,185:rt,186:it,187:st,188:ot,189:ut,190:at,191:ft,192:lt,193:ct}),{7:601,9:154,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,32:_t,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:Pt,89:152,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:Ht,176:Bt,177:q,178:R,179:U,180:z,181:W},t(Vn,[2,60],{151:111,154:112,158:116,148:J,150:K,156:Q,174:lr,178:Y,179:Z,182:et,183:tt,184:nt,185:rt,186:it,187:st,188:ot,189:ut,190:at,191:ft,192:lt,193:ct}),{7:602,9:154,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,32:_t,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:Pt,89:152,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:Ht,176:Bt,177:q,178:R,179:U,180:z,181:W},t(Gn,[2,82]),{83:[1,603]},t(Qn,[2,65]),t(qn,Fr,{151:111,154:112,158:116,148:J,150:K,156:Q,178:Y,179:Z,182:et,183:tt,184:nt,185:rt,186:it,187:st,188:ot,189:ut,190:at,191:ft,192:lt,193:ct}),t(qn,Ir,{151:111,154:112,158:116,148:J,150:K,156:Q,178:Y,179:Z,182:et,183:tt,184:nt,185:rt,186:it,187:st,188:ot,189:ut,190:at,191:ft,192:lt,193:ct}),t(qn,qr,{151:111,154:112,158:116,148:J,150:K,156:Q,178:Y,179:Z,182:et,183:tt,184:nt,185:rt,186:it,187:st,188:ot,189:ut,190:at,191:ft,192:lt,193:ct}),{7:604,8:605,9:148,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,29:20,30:21,31:22,32:_t,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:E,89:37,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:F,175:57,176:I,177:q,178:R,179:U,180:z,181:W},{7:606,8:607,9:148,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,29:20,30:21,31:22,32:_t,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:E,89:37,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:F,175:57,176:I,177:q,178:R,179:U,180:z,181:W},{7:608,8:609,9:148,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,29:20,30:21,31:22,32:_t,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:E,89:37,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:F,175:57,176:I,177:q,178:R,179:U,180:z,181:W},{7:610,8:611,9:148,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,29:20,30:21,31:22,32:_t,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:E,89:37,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:F,175:57,176:I,177:q,178:R,179:U,180:z,181:W},{7:612,9:154,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,32:_t,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:Pt,89:152,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:Ht,176:Bt,177:q,178:R,179:U,180:z,181:W},{7:613,9:154,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,32:_t,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:Pt,89:152,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:Ht,176:Bt,177:q,178:R,179:U,180:z,181:W},{7:614,9:154,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,32:_t,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:Pt,89:152,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:Ht,176:Bt,177:q,178:R,179:U,180:z,181:W},{7:615,9:154,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,32:_t,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:Pt,89:152,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:Ht,176:Bt,177:q,178:R,179:U,180:z,181:W},{6:Rr,35:Ur,127:[1,616]},t([6,35,36,127],or,{17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,29:20,30:21,31:22,13:23,15:25,16:26,60:29,53:30,74:31,100:32,51:33,76:34,75:35,89:37,98:45,172:46,151:48,147:49,152:50,154:51,155:52,175:57,96:61,73:62,42:63,48:65,37:78,67:79,158:85,44:88,9:148,97:211,7:308,8:309,136:619,14:n,32:_t,38:i,39:s,43:o,45:u,46:a,49:f,50:l,54:c,55:h,56:p,57:d,58:v,59:m,68:g,70:$t,77:y,84:b,85:Dt,86:E,90:S,91:x,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,148:D,150:P,153:H,156:B,167:j,173:F,176:I,177:q,178:R,179:U,180:z,181:W}),t(sr,dn,{92:620,93:Ar}),{83:[2,210],148:J,150:K,151:111,154:112,156:Q,158:116,174:lr,178:Y,179:Z,182:et,183:tt,184:nt,185:rt,186:it,187:st,188:ot,189:ut,190:at,191:ft,192:lt,193:ct},{83:[2,212],148:J,150:K,151:111,154:112,156:Q,158:116,174:lr,178:Y,179:Z,182:et,183:tt,184:nt,185:rt,186:it,187:st,188:ot,189:ut,190:at,191:ft,192:lt,193:ct},t(pt,[2,55]),t(yn,[2,91]),t($,[2,93]),t(mn,[2,102]),t(sr,dn,{92:621,93:vn}),{34:537,35:Mt},t(pt,[2,371]),t(wr,[2,335]),t(pt,[2,244]),t(_r,[2,245]),t(_r,[2,246]),t(pt,[2,324]),{34:622,35:Mt},t(pt,[2,325]),{34:623,35:Mt},{36:[1,624]},t(cr,[2,332],{6:[1,625]}),{7:626,8:627,9:148,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,29:20,30:21,31:22,32:_t,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:E,89:37,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:F,175:57,176:I,177:q,178:R,179:U,180:z,181:W},t(pt,[2,154]),t(Er,[2,341]),{44:628,45:u,46:a},t(Wn,dn,{92:629,93:pr}),t(St,[2,158]),{33:[1,630]},{37:347,38:i,39:s,116:631,118:kn},{35:Cn,37:347,38:i,39:s,115:632,116:345,118:kn},t(Vn,[2,163]),{6:Pr,35:Hr,36:[1,633]},t(Vn,[2,168]),t(Vn,[2,170]),t(St,[2,174],{33:[1,634]}),{37:354,38:i,39:s,118:An,123:635},{35:Ln,37:354,38:i,39:s,118:An,121:636,123:352},t(Vn,[2,184]),{6:Br,35:jr,36:[1,637]},t(Vn,[2,189]),t(Vn,[2,190]),t(Vn,[2,192]),t(vr,[2,177],{151:111,154:112,158:116,148:J,150:K,156:Q,178:Y,179:Z,182:et,183:tt,184:nt,185:rt,186:it,187:st,188:ot,189:ut,190:at,191:ft,192:lt,193:ct}),{36:[1,638],148:J,150:K,151:111,154:112,156:Q,158:116,174:lr,178:Y,179:Z,182:et,183:tt,184:nt,185:rt,186:it,187:st,188:ot,189:ut,190:at,191:ft,192:lt,193:ct},t(St,[2,180]),t(xt,[2,251]),t(xt,[2,208]),t(xt,[2,209]),t(Bn,[2,227]),t(sr,dn,{92:370,133:639,93:Pn}),t(Bn,[2,228]),{35:zr,148:J,150:K,151:111,154:112,156:Q,157:[1,640],158:116,174:G,178:Y,179:Z,182:et,183:tt,184:nt,185:rt,186:it,187:st,188:ot,189:ut,190:at,191:ft,192:lt,193:ct},{35:[2,307],157:[1,641]},{35:Wr,148:J,149:[1,642],150:K,151:111,154:112,156:Q,158:116,174:G,178:Y,179:Z,182:et,183:tt,184:nt,185:rt,186:it,187:st,188:ot,189:ut,190:at,191:ft,192:lt,193:ct},{35:[2,311],149:[1,643]},{35:Xr,148:J,150:K,151:111,154:112,156:Q,157:[1,644],158:116,174:G,178:Y,179:Z,182:et,183:tt,184:nt,185:rt,186:it,187:st,188:ot,189:ut,190:at,191:ft,192:lt,193:ct},{35:[2,308],157:[1,645]},{35:Vr,148:J,149:[1,646],150:K,151:111,154:112,156:Q,158:116,174:G,178:Y,179:Z,182:et,183:tt,184:nt,185:rt,186:it,187:st,188:ot,189:ut,190:at,191:ft,192:lt,193:ct},{35:[2,312],149:[1,647]},{35:$r,148:J,150:K,151:111,154:112,156:Q,158:116,174:G,178:Y,179:Z,182:et,183:tt,184:nt,185:rt,186:it,187:st,188:ot,189:ut,190:at,191:ft,192:lt,193:ct},{35:[2,309]},{35:Jr,148:J,150:K,151:111,154:112,156:Q,158:116,174:G,178:Y,179:Z,182:et,183:tt,184:nt,185:rt,186:it,187:st,188:ot,189:ut,190:at,191:ft,192:lt,193:ct},{35:[2,310]},{35:Kr,148:J,150:K,151:111,154:112,156:Q,158:116,174:G,178:Y,179:Z,182:et,183:tt,184:nt,185:rt,186:it,187:st,188:ot,189:ut,190:at,191:ft,192:lt,193:ct},{35:[2,322]},{35:Qr,148:J,150:K,151:111,154:112,156:Q,158:116,174:G,178:Y,179:Z,182:et,183:tt,184:nt,185:rt,186:it,187:st,188:ot,189:ut,190:at,191:ft,192:lt,193:ct},{35:[2,323]},t(Vn,[2,145]),t(sr,dn,{92:648,93:Xn}),{36:[1,649],148:J,150:K,151:111,154:112,156:Q,158:116,174:lr,178:Y,179:Z,182:et,183:tt,184:nt,185:rt,186:it,187:st,188:ot,189:ut,190:at,191:ft,192:lt,193:ct},{36:[1,650],148:J,150:K,151:111,154:112,156:Q,158:116,174:lr,178:Y,179:Z,182:et,183:tt,184:nt,185:rt,186:it,187:st,188:ot,189:ut,190:at,191:ft,192:lt,193:ct},t(Gn,[2,83]),t(Gr,zr,{151:111,154:112,158:116,157:[1,651],178:Y,179:Z,182:et,183:tt,184:nt,185:rt,186:it,187:st,188:ot,189:ut,190:at,191:ft,192:lt,193:ct}),{157:[1,652]},t(Lr,Wr,{151:111,154:112,158:116,149:[1,653],178:Y,179:Z,182:et,183:tt,184:nt,185:rt,186:it,187:st,188:ot,189:ut,190:at,191:ft,192:lt,193:ct}),{149:[1,654]},t(Gr,Xr,{151:111,154:112,158:116,157:[1,655],178:Y,179:Z,182:et,183:tt,184:nt,185:rt,186:it,187:st,188:ot,189:ut,190:at,191:ft,192:lt,193:ct}),{157:[1,656]},t(Lr,Vr,{151:111,154:112,158:116,149:[1,657],178:Y,179:Z,182:et,183:tt,184:nt,185:rt,186:it,187:st,188:ot,189:ut,190:at,191:ft,192:lt,193:ct}),{149:[1,658]},t(Tn,$r,{151:111,154:112,158:116,178:Y,179:Z,182:et,183:tt,184:nt,185:rt,186:it,187:st,188:ot,189:ut,190:at,191:ft,192:lt,193:ct}),t(Tn,Jr,{151:111,154:112,158:116,178:Y,179:Z,182:et,183:tt,184:nt,185:rt,186:it,187:st,188:ot,189:ut,190:at,191:ft,192:lt,193:ct}),t(Tn,Kr,{151:111,154:112,158:116,178:Y,179:Z,182:et,183:tt,184:nt,185:rt,186:it,187:st,188:ot,189:ut,190:at,191:ft,192:lt,193:ct}),t(Tn,Qr,{151:111,154:112,158:116,178:Y,179:Z,182:et,183:tt,184:nt,185:rt,186:it,187:st,188:ot,189:ut,190:at,191:ft,192:lt,193:ct}),t(tr,[2,199]),{7:308,8:309,9:148,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,29:20,30:21,31:22,32:_t,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,70:$t,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:E,89:37,90:S,91:x,96:61,97:211,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,136:659,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:F,175:57,176:I,177:q,178:R,179:U,180:z,181:W},{7:308,8:309,9:148,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,29:20,30:21,31:22,32:_t,35:nr,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,70:$t,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:E,89:37,90:S,91:x,96:61,97:211,98:45,100:32,107:T,110:N,112:C,120:k,128:660,129:L,130:A,136:421,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:F,175:57,176:I,177:q,178:R,179:U,180:z,181:W},t(Or,[2,217]),{6:Rr,35:Ur,36:[1,661]},{6:ur,35:ar,36:[1,662]},{36:[1,663]},{36:[1,664]},t(pt,[2,329]),t(cr,[2,333]),t(Dr,[2,239],{151:111,154:112,158:116,148:J,150:K,156:Q,174:G,178:Y,179:Z,182:et,183:tt,184:nt,185:rt,186:it,187:st,188:ot,189:ut,190:at,191:ft,192:lt,193:ct}),t(Dr,[2,240]),t(St,[2,160]),{6:Pr,35:Hr,109:[1,665]},{44:666,45:u,46:a},t(Vn,[2,164]),t(sr,dn,{92:667,93:pr}),t(Vn,[2,165]),{44:668,45:u,46:a},t(Vn,[2,185]),t(sr,dn,{92:669,93:dr}),t(Vn,[2,186]),t(St,[2,178]),{6:gr,35:yr,36:[1,670]},{7:671,8:672,9:148,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,29:20,30:21,31:22,32:_t,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:E,89:37,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:F,175:57,176:I,177:q,178:R,179:U,180:z,181:W},{7:673,8:674,9:148,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,29:20,30:21,31:22,32:_t,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:E,89:37,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:F,175:57,176:I,177:q,178:R,179:U,180:z,181:W},{7:675,8:676,9:148,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,29:20,30:21,31:22,32:_t,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:E,89:37,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:F,175:57,176:I,177:q,178:R,179:U,180:z,181:W},{7:677,8:678,9:148,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,29:20,30:21,31:22,32:_t,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:E,89:37,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:F,175:57,176:I,177:q,178:R,179:U,180:z,181:W},{7:679,8:680,9:148,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,29:20,30:21,31:22,32:_t,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:E,89:37,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:F,175:57,176:I,177:q,178:R,179:U,180:z,181:W},{7:681,8:682,9:148,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,29:20,30:21,31:22,32:_t,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:E,89:37,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:F,175:57,176:I,177:q,178:R,179:U,180:z,181:W},{7:683,8:684,9:148,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,29:20,30:21,31:22,32:_t,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:E,89:37,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:F,175:57,176:I,177:q,178:R,179:U,180:z,181:W},{7:685,8:686,9:148,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,29:20,30:21,31:22,32:_t,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:E,89:37,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:F,175:57,176:I,177:q,178:R,179:U,180:z,181:W},{6:Nr,35:Cr,36:[1,687]},t(Vn,[2,59]),t(Vn,[2,61]),{7:688,9:154,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,32:_t,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:Pt,89:152,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:Ht,176:Bt,177:q,178:R,179:U,180:z,181:W},{7:689,9:154,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,32:_t,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:Pt,89:152,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:Ht,176:Bt,177:q,178:R,179:U,180:z,181:W},{7:690,9:154,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,32:_t,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:Pt,89:152,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:Ht,176:Bt,177:q,178:R,179:U,180:z,181:W},{7:691,9:154,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,32:_t,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:Pt,89:152,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:Ht,176:Bt,177:q,178:R,179:U,180:z,181:W},{7:692,9:154,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,32:_t,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:Pt,89:152,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:Ht,176:Bt,177:q,178:R,179:U,180:z,181:W},{7:693,9:154,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,32:_t,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:Pt,89:152,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:Ht,176:Bt,177:q,178:R,179:U,180:z,181:W},{7:694,9:154,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,32:_t,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:Pt,89:152,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:Ht,176:Bt,177:q,178:R,179:U,180:z,181:W},{7:695,9:154,13:23,14:n,15:25,16:26,17:8,18:9,19:10,20:11,21:12,22:13,23:14,24:15,25:16,26:17,27:18,28:19,32:_t,37:78,38:i,39:s,42:63,43:o,44:88,45:u,46:a,48:65,49:f,50:l,51:33,53:30,54:c,55:h,56:p,57:d,58:v,59:m,60:29,67:79,68:g,73:62,74:31,75:35,76:34,77:y,84:b,85:Dt,86:Pt,89:152,90:S,91:x,96:61,98:45,100:32,107:T,110:N,112:C,120:k,129:L,130:A,140:O,144:M,145:_,147:49,148:D,150:P,151:48,152:50,153:H,154:51,155:52,156:B,158:85,167:j,172:46,173:Ht,176:Bt,177:q,178:R,179:U,180:z,181:W},t(Or,[2,218]),t(sr,dn,{92:696,93:Ar}),t(Or,[2,219]),t(mn,[2,103]),t(pt,[2,326]),t(pt,[2,327]),{33:[1,697]},t(St,[2,159]),{6:Pr,35:Hr,36:[1,698]},t(St,[2,182]),{6:Br,35:jr,36:[1,699]},t(Bn,[2,229]),{35:Yr,148:J,150:K,151:111,154:112,156:Q,158:116,174:G,178:Y,179:Z,182:et,183:tt,184:nt,185:rt,186:it,187:st,188:ot,189:ut,190:at,191:ft,192:lt,193:ct},{35:[2,313]},{35:Zr,148:J,150:K,151:111,154:112,156:Q,158:116,174:G,178:Y,179:Z,182:et,183:tt,184:nt,185:rt,186:it,187:st,188:ot,189:ut,190:at,191:ft,192:lt,193:ct},{35:[2,315]},{35:ei,148:J,150:K,151:111,154:112,156:Q,158:116,174:G,178:Y,179:Z,182:et,183:tt,184:nt,185:rt,186:it,187:st,188:ot,189:ut,190:at,191:ft,192:lt,193:ct},{35:[2,317]},{35:ti,148:J,150:K,151:111,154:112,156:Q,158:116,174:G,178:Y,179:Z,182:et,183:tt,184:nt,185:rt,186:it,187:st,188:ot,189:ut,190:at,191:ft,192:lt,193:ct},{35:[2,319]},{35:ni,148:J,150:K,151:111,154:112,156:Q,158:116,174:G,178:Y,179:Z,182:et,183:tt,184:nt,185:rt,186:it,187:st,188:ot,189:ut,190:at,191:ft,192:lt,193:ct},{35:[2,314]},{35:ri,148:J,150:K,151:111,154:112,156:Q,158:116,174:G,178:Y,179:Z,182:et,183:tt,184:nt,185:rt,186:it,187:st,188:ot,189:ut,190:at,191:ft,192:lt,193:ct},{35:[2,316]},{35:ii,148:J,150:K,151:111,154:112,156:Q,158:116,174:G,178:Y,179:Z,182:et,183:tt,184:nt,185:rt,186:it,187:st,188:ot,189:ut,190:at,191:ft,192:lt,193:ct},{35:[2,318]},{35:si,148:J,150:K,151:111,154:112,156:Q,158:116,174:G,178:Y,179:Z,182:et,183:tt,184:nt,185:rt,186:it,187:st,188:ot,189:ut,190:at,191:ft,192:lt,193:ct},{35:[2,320]},t(Vn,[2,146]),t(Tn,Yr,{151:111,154:112,158:116,178:Y,179:Z,182:et,183:tt,184:nt,185:rt,186:it,187:st,188:ot,189:ut,190:at,191:ft,192:lt,193:ct}),t(Tn,Zr,{151:111,154:112,158:116,178:Y,179:Z,182:et,183:tt,184:nt,185:rt,186:it,187:st,188:ot,189:ut,190:at,191:ft,192:lt,193:ct}),t(Tn,ei,{151:111,154:112,158:116,178:Y,179:Z,182:et,183:tt,184:nt,185:rt,186:it,187:st,188:ot,189:ut,190:at,191:ft,192:lt,193:ct}),t(Tn,ti,{151:111,154:112,158:116,178:Y,179:Z,182:et,183:tt,184:nt,185:rt,186:it,187:st,188:ot,189:ut,190:at,191:ft,192:lt,193:ct}),t(Tn,ni,{151:111,154:112,158:116,178:Y,179:Z,182:et,183:tt,184:nt,185:rt,186:it,187:st,188:ot,189:ut,190:at,191:ft,192:lt,193:ct}),t(Tn,ri,{151:111,154:112,158:116,178:Y,179:Z,182:et,183:tt,184:nt,185:rt,186:it,187:st,188:ot,189:ut,190:at,191:ft,192:lt,193:ct}),t(Tn,ii,{151:111,154:112,158:116,178:Y,179:Z,182:et,183:tt,184:nt,185:rt,186:it,187:st,188:ot,189:ut,190:at,191:ft,192:lt,193:ct}),t(Tn,si,{151:111,154:112,158:116,178:Y,179:Z,182:et,183:tt,184:nt,185:rt,186:it,187:st,188:ot,189:ut,190:at,191:ft,192:lt,193:ct}),{6:Rr,35:Ur,36:[1,700]},{44:701,45:u,46:a},t(Vn,[2,166]),t(Vn,[2,187]),t(Or,[2,220]),t(St,[2,161])],defaultActions:{235:[2,277],293:[2,140],471:[2,172],494:[2,253],497:[2,255],499:[2,276],592:[2,309],594:[2,310],596:[2,322],598:[2,323],672:[2,313],674:[2,315],676:[2,317],678:[2,319],680:[2,314],682:[2,316],684:[2,318],686:[2,320]},parseError:function(e,t){if(!t.recoverable){var n=new Error(e);throw n.hash=t,n}this.trace(e)},parse:function(e){var t=this,n=[0],r=[null],i=[],s=this.table,o="",u=0,a=0,f=0,l=1,c=i.slice.call(arguments,1),h=Object.create(this.lexer),p={yy:{}};for(var d in this.yy)Object.prototype.hasOwnProperty.call(this.yy,d)&&(p.yy[d]=this.yy[d]);h.setInput(e,p.yy),p.yy.lexer=h,p.yy.parser=this,"undefined"==typeof h.yylloc&&(h.yylloc={});var v=h.yylloc;i.push(v);var m=h.options&&h.options.ranges;this.parseError="function"==typeof p.yy.parseError?p.yy.parseError:Object.getPrototypeOf(this).parseError;var g=function(){var e;return e=h.lex()||l,"number"!=typeof e&&(e=t.symbols_[e]||e),e};for(var y={},b,w,E,S,x,T,N,C,k;;){if(E=n[n.length-1],this.defaultActions[E]?S=this.defaultActions[E]:((null===b||"undefined"==typeof b)&&(b=g()),S=s[E]&&s[E][b]),"undefined"==typeof S||!S.length||!S[0]){var L="";for(T in k=[],s[E])this.terminals_[T]&&T>2&&k.push("'"+this.terminals_[T]+"'");L=h.showPosition?"Parse error on line "+(u+1)+":\n"+h.showPosition()+"\nExpecting "+k.join(", ")+", got '"+(this.terminals_[b]||b)+"'":"Parse error on line "+(u+1)+": Unexpected "+(b==l?"end of input":"'"+(this.terminals_[b]||b)+"'"),this.parseError(L,{text:h.match,token:this.terminals_[b]||b,line:h.yylineno,loc:v,expected:k})}if(S[0]instanceof Array&&1t.call(this.compiledComments,u))&&(this.compiledComments.push(u),a=u.here?(new O(u)).compileNode(n):(new Q(u)).compileNode(n),a.isHereComment&&!a.newLine||r.includeCommentFragments()?h(a):(0===i.length&&i.push(this.makeCode("")),a.unshift?(null==(s=i[0]).precedingComments&&(s.precedingComments=[]),i[0].precedingComments.push(a)):(null==(o=i[i.length-1]).followingComments&&(o.followingComments=[]),i[i.length-1].followingComments.push(a))));return i}},{key:"cache",value:function(t,n,r){var i,s,u;return i=null==r?this.shouldCache():r(this),i?(s=new _(t.scope.freeVariable("ref")),u=new o(s,this),n?[u.compileToFragments(t,n),[this.makeCode(s.value)]]:[u,s]):(s=n?this.compileToFragments(t,n):this,[s,s])}},{key:"hoist",value:function(){var t,n,r;return this.hoisted=!0,r=new M(this),t=this.compileNode,n=this.compileToFragments,this.compileNode=function(e){return r.update(t,e)},this.compileToFragments=function(e){return r.update(n,e)},r}},{key:"cacheToCodeFragments",value:function(t){return[Xt(t[0]),Xt(t[1])]}},{key:"makeReturn",value:function(t){var n;return n=this.unwrapAll(),t?new h(new G(t+".push"),[n]):new vt(n)}},{key:"contains",value:function(t){var n;return n=void 0,this.traverseChildren(!1,function(e){if(t(e))return n=e,!1}),n}},{key:"lastNode",value:function(t){return 0===t.length?null:t[t.length-1]}},{key:"toString",value:function r(){var e=0=V?this.wrapInParentheses(i):i)}},{key:"compileRoot",value:function(t){var n,r,i,s,o,u;for(t.indent=t.bare?"":Ct,t.level=K,this.spaced=!0,t.scope=new gt(null,this,null,null==(o=t.referencedVars)?[]:o),u=t.locals||[],r=0,i=u.length;r=$?this.wrapInParentheses(n):n}}]),t}(st),e.StringLiteral=Et=function(e){function t(){return _classCallCheck(this,t),_possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return _inherits(t,e),_createClass(t,[{key:"compileNode",value:function(){var n;return n=this.csx?[this.makeCode(this.unquote(!0,!0))]:_get(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"compileNode",this).call(this)}},{key:"unquote",value:function(){var t=0=W?"(void 0)":"void 0")]}}]),t}(G),e.NullLiteral=it=function(e){function t(){return _classCallCheck(this,t),_possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,"null"))}return _inherits(t,e),t}(G),e.BooleanLiteral=l=function(e){function t(){return _classCallCheck(this,t),_possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return _inherits(t,e),t}(G),e.Return=vt=function(){var e=function(e){function n(e){_classCallCheck(this,n);var t=_possibleConstructorReturn(this,(n.__proto__||Object.getPrototypeOf(n)).call(this));return t.expression=e,t}return _inherits(n,e),_createClass(n,[{key:"compileToFragments",value:function(t,r){var i,s;return i=null==(s=this.expression)?void 0:s.makeReturn(),!i||i instanceof n?_get(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"compileToFragments",this).call(this,t,r):i.compileToFragments(t,r)}},{key:"compileNode",value:function(n){var r,i,s,o;if(r=[],this.expression)for(r=this.expression.compileToFragments(n,J),un(r,this.makeCode(this.tab+"return ")),s=0,o=r.length;sthis.properties.length&&!this.base.shouldCache()&&(null==f||!f.shouldCache()))?[this,this]:(u=new t(this.base,this.properties.slice(0,-1)),u.shouldCache()&&(a=new _(n.scope.freeVariable("base")),u=new t(new ft(new o(a,u)))),!f)?[u,a]:(f.shouldCache()&&(l=new _(n.scope.freeVariable("name")),f=new R(new o(l,f.index)),l=new R(l)),[u.add(f),new t(a||u.base,[l||f])])}},{key:"compileNode",value:function(t){var n,r,i,s,o;for(this.base.front=this.front,o=this.properties,n=o.length&&null!=this.base.cached?this.base.cached:this.base.compileToFragments(t,o.length?W:null),o.length&&mt.test(Xt(n))&&n.push(this.makeCode(".")),r=0,i=o.length;rs.length&&(s=o);this.content=this.content.replace(RegExp("^("+o+")","gm"),"")}return this.content="/*"+this.content+(r?" ":"")+"*/",n=this.makeCode(this.content),n.newLine=this.newLine,n.unshift=this.unshift,n.multiline=f,n.isComment=n.isHereComment=!0,n}}]),n}(a),e.LineComment=Q=function(e){function t(e){var n=e.content,r=e.newLine,i=e.unshift;_classCallCheck(this,t);var s=_possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return s.content=n,s.newLine=r,s.unshift=i,s}return _inherits(t,e),_createClass(t,[{key:"compileNode",value:function(){var t;return t=this.makeCode(/^\s*$/.test(this.content)?"":"//"+this.content),t.newLine=this.newLine,t.unshift=this.unshift,t.trail=!this.newLine&&!this.unshift,t.isComment=t.isLineComment=!0,t}}]),t}(a),e.Call=h=function(){var e=function(e){function t(e){var n=1")),(m=f).push.apply(m,_toConsumableArray(a.compileNode(t,V))),(g=f).push.apply(g,[this.makeCode("")]))}else f.push(this.makeCode(" />"));return f}}]),t}(a);return e.prototype.children=["variable","args"],e}.call(this),e.SuperCall=Tt=function(){var e=function(e){function t(){return _classCallCheck(this,t),_possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return _inherits(t,e),_createClass(t,[{key:"isStatement",value:function(t){var n;return(null==(n=this.expressions)?void 0:n.length)&&t.level===K}},{key:"compileNode",value:function(n){var r,i,s,o;if(null==(i=this.expressions)||!i.length)return _get(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"compileNode",this).call(this,n);if(o=new G(Xt(_get(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"compileNode",this).call(this,n))),s=new f(this.expressions.slice()),n.level>K){var u=o.cache(n,null,Bt),a=_slicedToArray(u,2);o=a[0],r=a[1],s.push(r)}return s.unshift(o),s.compileToFragments(n,n.level===K?n.level:V)}}]),t}(h);return e.prototype.children=h.prototype.children.concat(["expressions"]),e}.call(this),e.Super=xt=function(){var e=function(e){function t(e){_classCallCheck(this,t);var n=_possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return n.accessor=e,n}return _inherits(t,e),_createClass(t,[{key:"compileNode",value:function(t){var n,r,i,s,u,a,f,l;if(r=t.scope.namedMethod(),(null==r?void 0:r.isMethod)||this.error("cannot use super outside of an instance method"),null==r.ctor&&null==this.accessor){var c=r;i=c.name,l=c.variable,(i.shouldCache()||i instanceof R&&i.index.isAssignable())&&(s=new _(t.scope.parent.freeVariable("name")),i.index=new o(s,i.index)),this.accessor=null==s?i:new R(s)}return(null==(u=this.accessor)||null==(a=u.name)?void 0:a.comments)&&(f=this.accessor.name.comments,delete this.accessor.name.comments),n=(new Pt(new G("super"),this.accessor?[this.accessor]:[])).compileToFragments(t),f&&It(f,this.accessor.name),n}}]),t}(a);return e.prototype.children=["accessor"],e}.call(this),e.RegexWithInterpolations=dt=function(e){function t(){var e=0"+this.equals;var g=[this.fromNum,this.toNum];return i=g[0],d=g[1],h=this.stepNum?this.stepNum+" !== 0":this.stepVar+" !== 0",r=a?null==this.step?i<=d?l+" "+d:s+" "+d:(f=i+" <= "+o+" && "+l+" "+d,v=i+" >= "+o+" && "+s+" "+d,i<=d?h+" && "+f:h+" && "+v):(f=this.fromVar+" <= "+o+" && "+l+" "+this.toVar,v=this.fromVar+" >= "+o+" && "+s+" "+this.toVar,h+" && ("+this.fromVar+" <= "+this.toVar+" ? "+f+" : "+v+")"),n=this.stepVar?this.stepVar+" > 0":this.fromVar+" <= "+this.toVar,p=this.stepVar?o+" += "+this.stepVar:a?c?i<=d?"++"+o:"--"+o:i<=d?o+"++":o+"--":c?n+" ? ++"+o+" : --"+o:n+" ? "+o+"++ : "+o+"--",c&&(m=u+" = "+m),c&&(p=u+" = "+p),[this.makeCode(m+"; "+r+"; "+p)]}},{key:"compileArray",value:function(t){var n,r,i,s,o,u,a,f,l,c,h,p,d;return(a=null!=this.fromNum&&null!=this.toNum,a&&20>=_Mathabs(this.fromNum-this.toNum))?(c=function(){for(var e=[],t=h=this.fromNum,n=this.toNum;h<=n?t<=n:t>=n;h<=n?t++:t--)e.push(t);return e}.apply(this),this.exclusive&&c.pop(),[this.makeCode("["+c.join(", ")+"]")]):(u=this.tab+Ct,o=t.scope.freeVariable("i",{single:!0,reserve:!1}),p=t.scope.freeVariable("results",{reserve:!1}),l="\n"+u+"var "+p+" = [];",a?(t.index=o,r=Xt(this.compileNode(t))):(d=o+" = "+this.fromC+(this.toC===this.toVar?"":", "+this.toC),i=this.fromVar+" <= "+this.toVar,r="var "+d+"; "+i+" ? "+o+" <"+this.equals+" "+this.toVar+" : "+o+" >"+this.equals+" "+this.toVar+"; "+i+" ? "+o+"++ : "+o+"--"),f="{ "+p+".push("+o+"); }\n"+u+"return "+p+";\n"+t.indent,s=function(e){return null==e?void 0:e.contains(Jt)},(s(this.from)||s(this.to))&&(n=", arguments"),[this.makeCode("(function() {"+l+"\n"+u+"for ("+r+")"+f+"}).apply(this"+(null==n?"":n)+")")])}}]),t}(a);return e.prototype.children=["from","to"],e}.call(this),e.Slice=yt=function(){var e=function(e){function t(e){_classCallCheck(this,t);var n=_possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return n.range=e,n}return _inherits(t,e),_createClass(t,[{key:"compileNode",value:function(t){var n=this.range,r,i,s,o,u,a;return u=n.to,s=n.from,(null==s?void 0:s.shouldCache())&&(s=new Pt(new ft(s))),(null==u?void 0:u.shouldCache())&&(u=new Pt(new ft(u))),o=(null==s?void 0:s.compileToFragments(t,J))||[this.makeCode("0")],u&&(r=u.compileToFragments(t,J),i=Xt(r),(this.range.exclusive||-1!=+i)&&(a=", "+(this.range.exclusive?i:u.isNumber()?""+(+i+1):(r=u.compileToFragments(t,W),"+"+Xt(r)+" + 1 || 9e9")))),[this.makeCode(".slice("+Xt(o)+(a||"")+")")]}}]),t}(a);return e.prototype.children=["range"],e}.call(this),e.Obj=ot=function(){var e=function(e){function t(e){var n=1E)return u.push(new Pt(new ot(y.slice(E,r),!0)))};t=y[r];)(c=this.addInitializerExpression(t))&&(b(),u.push(c),l.push(c),E=r+1),r++;b(),n.apply(o,[a,a-a+1].concat(u)),u,a+=u.length}else(c=this.addInitializerExpression(s))&&(l.push(c),o[a]=c),a+=1;for(p=0,m=l.length;pV||u&&this.variable.base instanceof ot&&!this.nestedLhs&&!0!==this.param?this.wrapInParentheses(i):i)}},{key:"compileObjectDestruct",value:function(t){var n,o,u,a,l,c,p,d,v,m,g,y;if(o=function(e){var n;if(e instanceof r){var i=e.variable.cache(t),s=_slicedToArray(i,2);return e.variable=s[0],n=s[1],n}return e},u=function(e){var n,i;return i=o(e),n=e instanceof r&&e.variable!==i,n||!i.isAssignable()?i:new G("'"+i.compileWithoutComments(t)+"'")},v=function(n,a){var f,l,c,h,p,d,m,g,y,b,w;for(b=[],w=void 0,null==a.properties&&(a=new Pt(a)),l=c=0,h=n.length;c=$?this.wrapInParentheses(f):f;var J=O,Q=_slicedToArray(J,1);return L=Q[0],1===M&&L instanceof w&&L.error("Destructuring assignment has no target"),I=function(){var e,t,n;for(n=[],E=e=0,t=O.length;et.call(v,E):return new Pt(L.base);default:return L}}(),y=function(){switch(!1){case!(L instanceof bt):return l(u,E);default:return new Pt(new G(u),[new R(new st(E))])}}();d=Qt(s.unwrap().value),d&&s.error(d),m.push(a.push((new r(s,y,null,{param:o.param,subpattern:!0})).compileToFragments(n,V)))}return m},u=function(e,t,i){var u;return t=new Pt(new s(e,!0)),u=i instanceof Pt?i:new Pt(new G(i)),a.push((new r(t,u,null,{param:o.param,subpattern:!0})).compileToFragments(n,V))},D=function(e,t,n){return p(e)?k(e,t,n):u(e,t,n)},q.length?(d=q[0],C=O.slice(0,d+(N?1:0)),j=O.slice(d+1),0!==C.length&&D(C,W,X),0!==j.length&&(H=function(){switch(!1){case!N:return c(O[d].unwrapAll().value,-1*j.length);case!x:return l(X,-1*j.length)}}(),p(j)&&(B=H,H=n.scope.freeVariable("ref"),a.push([this.makeCode(H+" = ")].concat(_toConsumableArray(B.compileToFragments(n,V))))),D(j,W,H))):D(O,W,X),U||this.subpattern||a.push(W),m=this.joinFragmentArrays(a,", "),n.levelK?this.wrapInParentheses(i):i}},{key:"eachName",value:function(t){return this.variable.unwrapAll().eachName(t)}}]),r}(a);return e.prototype.children=["variable","value"],e.prototype.isAssignable=Bt,e}.call(this),e.FuncGlyph=A=function(e){function t(e){_classCallCheck(this,t);var n=_possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return n.glyph=e,n}return _inherits(t,e),t}(a),e.Code=d=function(){var e=function(e){function n(e,t,r,i){_classCallCheck(this,n);var s=_possibleConstructorReturn(this,(n.__proto__||Object.getPrototypeOf(n)).call(this)),o;return s.funcGlyph=r,s.paramStart=i,s.params=e||[],s.body=t||new f,s.bound="=>"===(null==(o=s.funcGlyph)?void 0:o.glyph),s.isGenerator=!1,s.isAsync=!1,s.isMethod=!1,s.body.traverseChildren(!1,function(e){if((e instanceof ut&&e.isYield()||e instanceof jt)&&(s.isGenerator=!0),(e instanceof ut&&e.isAwait()||e instanceof u)&&(s.isAsync=!0),s.isGenerator&&s.isAsync)return e.error("function can't contain both yield and await")}),s}return _inherits(n,e),_createClass(n,[{key:"isStatement",value:function(){return this.isMethod}},{key:"makeScope",value:function(t){return new gt(t,this.body,this)}},{key:"compileNode",value:function(n){var r,i,u,a,f,l,c,p,d,v,m,g,y,b,E,S,x,T,N,C,k,L,A,O,M,P,H,B,j,F,I,q,R,U,X,V,$,J,K,Q,Y,Z,et;for(this.ctor&&(this.isAsync&&this.name.error("Class constructor may not be async"),this.isGenerator&&this.name.error("Class constructor may not be a generator")),this.bound&&((null==(F=n.scope.method)?void 0:F.bound)&&(this.context=n.scope.method.context),!this.context&&(this.context="this")),n.scope=Rt(n,"classScope")||this.makeScope(n.scope),n.scope.shared=Rt(n,"sharedScope"),n.indent+=Ct,delete n.bare,delete n.isExistentialEquals,H=[],p=[],Y=null==(I=null==(q=this.thisAssignments)?void 0:q.slice())?[]:I,B=[],m=!1,v=!1,M=[],this.eachParamName(function(e,r,i,s){var u,a;if(0<=t.call(M,e)&&r.error("multiple parameters named '"+e+"'"),M.push(e),r.this)return e=r.properties[0].name.value,0<=t.call(z,e)&&(e="_"+e),a=new _(n.scope.freeVariable(e,{reserve:!1})),u=i.name instanceof ot&&s instanceof o&&"="===s.operatorToken.value?new o(new _(e),a,"object"):a,i.renameParam(r,u),Y.push(new o(r,a))}),R=this.params,g=b=0,x=R.length;b")),u.push(this.makeCode(" {")),null==a?void 0:a.length){var at;(at=u).push.apply(at,[this.makeCode("\n")].concat(_toConsumableArray(a),[this.makeCode("\n"+this.tab)]))}return u.push(this.makeCode("}")),this.isMethod?$t(u,this):this.front||n.level>=W?this.wrapInParentheses(u):u}},{key:"eachParamName",value:function(t){var n,r,i,s,o;for(s=this.params,o=[],n=0,r=s.length;n"===t||">="===t||"<="===t||"==="===t||"!=="===t}},{key:"invert",value:function(){var t,n,i,o,u;if(this.isChainable()&&this.first.isChainable()){for(t=!0,n=this;n&&n.operator;)t&&(t=n.operator in r),n=n.first;if(!t)return(new ft(this)).invert();for(n=this;n&&n.operator;)n.invert=!n.invert,n.operator=r[n.operator],n=n.first;return this}return(o=r[this.operator])?(this.operator=o,this.first.unwrap()instanceof s&&this.first.invert(),this):this.second?(new ft(this)).invert():"!"===this.operator&&(i=this.first.unwrap())instanceof s&&("!"===(u=i.operator)||"in"===u||"instanceof"===u)?i:new s("!",this)}},{key:"unfoldSoak",value:function(t){var n;return("++"===(n=this.operator)||"--"===n||"delete"===n)&&on(t,this,"first")}},{key:"generateDo",value:function(t){var n,r,i,s,u,a,f,l;for(a=[],r=t instanceof o&&(f=t.value.unwrap())instanceof d?f:t,l=r.params||[],i=0,s=l.length;i=W?(new ft(this)).compileToFragments(t):(i="+"===n||"-"===n,("new"===n||"typeof"===n||"delete"===n||i&&this.first instanceof s&&this.first.operator===n)&&r.push([this.makeCode(" ")]),(i&&this.first instanceof s||"new"===n&&this.first.isStatement(t))&&(this.first=new ft(this.first)),r.push(this.first.compileToFragments(t,$)),this.flip&&r.reverse(),this.joinFragmentArrays(r,""))}},{key:"compileContinuation",value:function(n){var r,i,s,o;return i=[],r=this.operator,null==n.scope.parent&&this.error(this.operator+" can only occur inside functions"),(null==(s=n.scope.method)?void 0:s.bound)&&n.scope.method.isGenerator&&this.error("yield cannot occur inside bound (fat arrow) functions"),0<=t.call(Object.keys(this.first),"expression")&&!(this.first instanceof Ot)?null!=this.first.expression&&i.push(this.first.expression.compileToFragments(n,$)):(n.level>=J&&i.push([this.makeCode("(")]),i.push([this.makeCode(r)]),""!==(null==(o=this.first.base)?void 0:o.value)&&i.push([this.makeCode(" ")]),i.push(this.first.compileToFragments(n,$)),n.level>=J&&i.push([this.makeCode(")")])),this.joinFragmentArrays(i,"")}},{key:"compilePower",value:function(t){var n;return n=new Pt(new _("Math"),[new i(new ct("pow"))]),(new h(n,[this.first,this.second])).compileToFragments(t)}},{key:"compileFloorDivision",value:function(t){var n,r,o;return r=new Pt(new _("Math"),[new i(new ct("floor"))]),o=this.second.shouldCache()?new ft(this.second):this.second,n=new s("/",this.first,o),(new h(r,[n])).compileToFragments(t)}},{key:"compileModulo",value:function(t){var n;return n=new Pt(new G(an("modulo",t))),(new h(n,[this.first,this.second])).compileToFragments(t)}},{key:"toString",value:function u(e){return _get(s.prototype.__proto__||Object.getPrototypeOf(s.prototype),"toString",this).call(this,e,this.constructor.name+" "+this.operator)}}]),s}(a),n,r;return n={"==":"===","!=":"!==",of:"in",yieldfrom:"yield*"},r={"!==":"===","===":"!=="},e.prototype.children=["first","second"],e}.call(this),e.In=q=function(){var e=function(e){function t(e,n){_classCallCheck(this,t);var r=_possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return r.object=e,r.array=n,r}return _inherits(t,e),_createClass(t,[{key:"compileNode",value:function(t){var n,r,i,s,o;if(this.array instanceof Pt&&this.array.isArray()&&this.array.base.objects.length){for(o=this.array.base.objects,r=0,i=o.length;r= 0"))),Xt(o)===Xt(s))?i:(i=o.concat(this.makeCode(", "),i),t.levelt.call(s,n)&&s.push(n);return delete e.comments}}),It(s,i),Zt(i.expression,i),i}return _inherits(n,e),_createClass(n,[{key:"compileNode",value:function(t){var n,r,i;if(this.expression.front=this.front,i=this.expression.compile(t,$),this.expression.unwrap()instanceof _&&!t.scope.check(i)){var s=this.negated?["===","||"]:["!==","&&"],o=_slicedToArray(s,2);n=o[0],r=o[1],i="typeof "+i+" "+n+' "undefined"'+("undefined"===this.comparisonTarget?"":" "+r+" "+i+" "+n+" "+this.comparisonTarget)}else n="null"===this.comparisonTarget?this.negated?"==":"!=":this.negated?"===":"!==",i=i+" "+n+" "+this.comparisonTarget;return[this.makeCode(t.level<=X?i:"("+i+")")]}}]),n}(a);return e.prototype.children=["expression"],e.prototype.invert=tt,e}.call(this),e.Parens=ft=function(){var e=function(e){function t(e){_classCallCheck(this,t);var n=_possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return n.body=e,n}return _inherits(t,e),_createClass(t,[{key:"unwrap",value:function(){return this.body}},{key:"shouldCache",value:function(){return this.body.shouldCache()}},{key:"compileNode",value:function(t){var n,r,i,s,o;return(r=this.body.unwrap(),o=null==(s=r.comments)?void 0:s.some(function(e){return e.here&&!e.unshift&&!e.newLine}),r instanceof Pt&&r.isAtomic()&&!this.csxAttribute&&!o)?(r.front=this.front,r.compileToFragments(t)):(i=r.compileToFragments(t,J),n=t.level<$&&!o&&(r instanceof ut||r.unwrap()instanceof h||r instanceof L&&r.returns)&&(t.level=i.length),this.csxAttribute?this.wrapInBraces(i):n?i:this.wrapInParentheses(i))}}]),t}(a);return e.prototype.children=["body"],e}.call(this),e.StringWithInterpolations=St=function(){var e=function(e){function t(e){_classCallCheck(this,t);var n=_possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return n.body=e,n}return _inherits(t,e),_createClass(t,[{key:"unwrap",value:function(){return this}},{key:"shouldCache",value:function(){return this.body.shouldCache()}},{key:"compileNode",value:function(n){var r,i,s,o,u,a,f,l,c;if(this.csxAttribute)return c=new ft(new t(this.body)),c.csxAttribute=!0,c.compileNode(n);for(o=this.body.unwrap(),s=[],l=[],o.traverseChildren(!1,function(e){var t,n,r,i,o,u;if(e instanceof Et){if(e.comments){var a;(a=l).push.apply(a,_toConsumableArray(e.comments)),delete e.comments}return s.push(e),!0}if(e instanceof ft){if(0!==l.length){for(n=0,i=l.length;nF,(!this.step||null==F||!d)&&(N=H.freeVariable("len")),c=""+x+E+" = 0, "+N+" = "+q+".length",h=""+x+E+" = "+q+".length - 1",a=E+" < "+N,l=E+" >= 0",this.step?(null==F?(a=I+" > 0 ? "+a+" : "+l,c="("+I+" > 0 ? ("+c+") : "+h+")"):d&&(a=l,c=h),b=E+" += "+I):b=""+(S===E?E+"++":"++"+E),v=[this.makeCode(c+"; "+a+"; "+x+b)])),this.returns&&(O=""+this.tab+P+" = [];\n",M="\n"+this.tab+"return "+P+";",s.makeReturn(P)),this.guard&&(1=X?this.wrapInParentheses(s):s}},{key:"unfoldSoak",value:function(){return this.soak&&this}}]),t}(a);return e.prototype.children=["condition","body","elseBody"],e}.call(this),_t={modulo:function(){return"function(a, b) { return (+a % (b = +b) + b) % b; }"},objectWithoutKeys:function(){return"function(o, ks) { var res = {}; for (var k in o) ([].indexOf.call(ks, k) < 0 && {}.hasOwnProperty.call(o, k)) && (res[k] = o[k]); return res; }"},boundMethodCheck:function(){return"function(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new Error('Bound instance method accessed before binding'); } }"},_extends:function(){return"Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }"},hasProp:function(){return"{}.hasOwnProperty"},indexOf:function(){return"[].indexOf"},slice:function(){return"[].slice"},splice:function(){return"[].splice"}},K=1,J=2,V=3,X=4,$=5,W=6,Ct=" ",mt=/^[+-]?\d+$/,an=function(e,t){var n,r;return r=t.scope.root,e in r.utilities?r.utilities[e]:(n=r.freeVariable(e),r.assign(n,_t[e](t)),r.utilities[e]=n)},en=function(e,t){var n=!(2=t);)t--;return n&&[n.sourceLine,n.sourceColumn]}}]),e}(),n=function(){var e=function(){function e(){_classCallCheck(this,e),this.lines=[]}return _createClass(e,[{key:"add",value:function(n,r){var i=2=r);)r--;return s&&s.sourceLocation(i)}},{key:"generate",value:function(){var t=0"],y={version:3,file:t.generatedFile||"",sourceRoot:t.sourceRoot||"",sources:g,names:[],mappings:r},(t.sourceMap||t.inlineMap)&&(y.sourcesContent=[n]),y}},{key:"encodeVlq",value:function(t){var n,u,a,f;for(n="",a=0>t?1:0,f=(_Mathabs(t)<<1)+a;f||!n;)u=f&s,f>>=i,f&&(u|=r),n+=this.encodeBase64(u);return n}},{key:"encodeBase64",value:function(t){return n[t]||function(){throw new Error("Cannot Base64 encode value: "+t)}()}}]),e}(),n,r,i,s;return i=5,r=1<",u(a,e),null==m[a]&&(m[a]=[]),m[a].push(e),p&&(x=new s),O=h.tokenize(e,t),t.referencedVars=function(){var e,t,n;for(n=[],e=0,t=O.length;e"),f=e.getLineNumber(),r=e.getColumnNumber(),c=t(s,f,r),i=c?s+":"+c[0]+":"+c[1]:s+":"+f+":"+r),o=e.getFunctionName(),u=e.isConstructor(),a=!e.isToplevel()&&!u,a?(l=e.getMethodName(),p=e.getTypeName(),o?(h=n="",p&&o.indexOf(p)&&(h=p+"."),l&&o.indexOf("."+l)!==o.length-l.length-1&&(n=" [as "+l+"]"),""+h+o+n+" ("+i+")"):p+"."+(l||"")+" ("+i+")"):u?"new "+(o||"")+" ("+i+")":o?o+" ("+i+")":i},l=function(e,n,i){var s,o,u,f,l,h;if(""===e||(f=e.slice(e.lastIndexOf(".")),0<=t.call(r,f))){if(""!==e&&null!=v[e])return v[e][v[e].length-1];if(null!=v[""])for(l=v[""],o=l.length-1;0<=o;o+=-1)if(u=l[o],h=u.sourceLocation([n-1,i-1]),null!=(null==h?void 0:h[0])&&null!=h[1])return u;return null==m[e]?null:(s=a(m[e][m[e].length-1],{filename:e,sourceMap:!0,literate:c.isLiterate(e)}),s.sourceMap)}return null},Error.prepareStackTrace=function(t,n){var r,i,s;return s=function(e,t,n){var r,i;return i=l(e,t,n),null!=i&&(r=i.sourceLocation([t-1,n-1])),null==r?null:[r[0]+1,r[1]+1]},i=function(){var t,i,o;for(o=[],t=0,i=n.length;t0||-1)*Math.floor(Math.abs(e))),e}function B(e){var t=typeof e;return e===null||t==="undefined"||t==="boolean"||t==="number"||t==="string"}function j(e){var t,n,r;if(B(e))return e;n=e.valueOf;if(typeof n=="function"){t=n.call(e);if(B(t))return t}r=e.toString;if(typeof r=="function"){t=r.call(e);if(B(t))return t}throw new TypeError}Function.prototype.bind||(Function.prototype.bind=function(t){var n=this;if(typeof n!="function")throw new TypeError("Function.prototype.bind called on incompatible "+n);var i=u.call(arguments,1),s=function(){if(this instanceof s){var e=n.apply(this,i.concat(u.call(arguments)));return Object(e)===e?e:this}return n.apply(t,i.concat(u.call(arguments)))};return n.prototype&&(r.prototype=n.prototype,s.prototype=new r,r.prototype=null),s});var i=Function.prototype.call,s=Array.prototype,o=Object.prototype,u=s.slice,a=i.bind(o.toString),f=i.bind(o.hasOwnProperty),l,c,h,p,d;if(d=f(o,"__defineGetter__"))l=i.bind(o.__defineGetter__),c=i.bind(o.__defineSetter__),h=i.bind(o.__lookupGetter__),p=i.bind(o.__lookupSetter__);if([1,2].splice(0).length!=2)if(!function(){function e(e){var t=new Array(e+2);return t[0]=t[1]=0,t}var t=[],n;t.splice.apply(t,e(20)),t.splice.apply(t,e(26)),n=t.length,t.splice(5,0,"XXX"),n+1==t.length;if(n+1==t.length)return!0}())Array.prototype.splice=function(e,t){var n=this.length;e>0?e>n&&(e=n):e==void 0?e=0:e<0&&(e=Math.max(n+e,0)),e+ta)for(h=l;h--;)this[f+h]=this[a+h];if(s&&e===c)this.length=c,this.push.apply(this,i);else{this.length=c+s;for(h=0;h>>0;if(a(t)!="[object Function]")throw new TypeError;while(++s>>0,s=Array(i),o=arguments[1];if(a(t)!="[object Function]")throw new TypeError(t+" is not a function");for(var u=0;u>>0,s=[],o,u=arguments[1];if(a(t)!="[object Function]")throw new TypeError(t+" is not a function");for(var f=0;f>>0,s=arguments[1];if(a(t)!="[object Function]")throw new TypeError(t+" is not a function");for(var o=0;o>>0,s=arguments[1];if(a(t)!="[object Function]")throw new TypeError(t+" is not a function");for(var o=0;o>>0;if(a(t)!="[object Function]")throw new TypeError(t+" is not a function");if(!i&&arguments.length==1)throw new TypeError("reduce of empty array with no initial value");var s=0,o;if(arguments.length>=2)o=arguments[1];else do{if(s in r){o=r[s++];break}if(++s>=i)throw new TypeError("reduce of empty array with no initial value")}while(!0);for(;s>>0;if(a(t)!="[object Function]")throw new TypeError(t+" is not a function");if(!i&&arguments.length==1)throw new TypeError("reduceRight of empty array with no initial value");var s,o=i-1;if(arguments.length>=2)s=arguments[1];else do{if(o in r){s=r[o--];break}if(--o<0)throw new TypeError("reduceRight of empty array with no initial value")}while(!0);do o in this&&(s=t.call(void 0,s,r[o],o,n));while(o--);return s});if(!Array.prototype.indexOf||[0,1].indexOf(1,2)!=-1)Array.prototype.indexOf=function(t){var n=g&&a(this)=="[object String]"?this.split(""):F(this),r=n.length>>>0;if(!r)return-1;var i=0;arguments.length>1&&(i=H(arguments[1])),i=i>=0?i:Math.max(0,r+i);for(;i>>0;if(!r)return-1;var i=r-1;arguments.length>1&&(i=Math.min(i,H(arguments[1]))),i=i>=0?i:r-Math.abs(i);for(;i>=0;i--)if(i in n&&t===n[i])return i;return-1};Object.getPrototypeOf||(Object.getPrototypeOf=function(t){return t.__proto__||(t.constructor?t.constructor.prototype:o)});if(!Object.getOwnPropertyDescriptor){var y="Object.getOwnPropertyDescriptor called on a non-object: ";Object.getOwnPropertyDescriptor=function(t,n){if(typeof t!="object"&&typeof t!="function"||t===null)throw new TypeError(y+t);if(!f(t,n))return;var r,i,s;r={enumerable:!0,configurable:!0};if(d){var u=t.__proto__;t.__proto__=o;var i=h(t,n),s=p(t,n);t.__proto__=u;if(i||s)return i&&(r.get=i),s&&(r.set=s),r}return r.value=t[n],r}}Object.getOwnPropertyNames||(Object.getOwnPropertyNames=function(t){return Object.keys(t)});if(!Object.create){var b;Object.prototype.__proto__===null?b=function(){return{__proto__:null}}:b=function(){var e={};for(var t in e)e[t]=null;return e.constructor=e.hasOwnProperty=e.propertyIsEnumerable=e.isPrototypeOf=e.toLocaleString=e.toString=e.valueOf=e.__proto__=null,e},Object.create=function(t,n){var r;if(t===null)r=b();else{if(typeof t!="object")throw new TypeError("typeof prototype["+typeof t+"] != 'object'");var i=function(){};i.prototype=t,r=new i,r.__proto__=t}return n!==void 0&&Object.defineProperties(r,n),r}}if(Object.defineProperty){var E=w({}),S=typeof document=="undefined"||w(document.createElement("div"));if(!E||!S)var x=Object.defineProperty}if(!Object.defineProperty||x){var T="Property description must be an object: ",N="Object.defineProperty called on non-object: ",C="getters & setters can not be defined on this javascript engine";Object.defineProperty=function(t,n,r){if(typeof t!="object"&&typeof t!="function"||t===null)throw new TypeError(N+t);if(typeof r!="object"&&typeof r!="function"||r===null)throw new TypeError(T+r);if(x)try{return x.call(Object,t,n,r)}catch(i){}if(f(r,"value"))if(d&&(h(t,n)||p(t,n))){var s=t.__proto__;t.__proto__=o,delete t[n],t[n]=r.value,t.__proto__=s}else t[n]=r.value;else{if(!d)throw new TypeError(C);f(r,"get")&&l(t,n,r.get),f(r,"set")&&c(t,n,r.set)}return t}}Object.defineProperties||(Object.defineProperties=function(t,n){for(var r in n)f(n,r)&&Object.defineProperty(t,r,n[r]);return t}),Object.seal||(Object.seal=function(t){return t}),Object.freeze||(Object.freeze=function(t){return t});try{Object.freeze(function(){})}catch(k){Object.freeze=function(t){return function(n){return typeof n=="function"?n:t(n)}}(Object.freeze)}Object.preventExtensions||(Object.preventExtensions=function(t){return t}),Object.isSealed||(Object.isSealed=function(t){return!1}),Object.isFrozen||(Object.isFrozen=function(t){return!1}),Object.isExtensible||(Object.isExtensible=function(t){if(Object(t)===t)throw new TypeError;var n="";while(f(t,n))n+="?";t[n]=!0;var r=f(t,n);return delete t[n],r});if(!Object.keys){var L=!0,A=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],O=A.length;for(var M in{toString:null})L=!1;Object.keys=function I(e){if(typeof e!="object"&&typeof e!="function"||e===null)throw new TypeError("Object.keys called on a non-object");var I=[];for(var t in e)f(e,t)&&I.push(t);if(L)for(var n=0,r=O;n0){t&1&&(n+=e);if(t>>=1)e+=e}return n};var r=/^\s\s*/,i=/\s\s*$/;t.stringTrimLeft=function(e){return e.replace(r,"")},t.stringTrimRight=function(e){return e.replace(i,"")},t.copyObject=function(e){var t={};for(var n in e)t[n]=e[n];return t},t.copyArray=function(e){var t=[];for(var n=0,r=e.length;n ["+this.end.row+"/"+this.end.column+"]"},this.contains=function(e,t){return this.compare(e,t)==0},this.compareRange=function(e){var t,n=e.end,r=e.start;return t=this.compare(n.row,n.column),t==1?(t=this.compare(r.row,r.column),t==1?2:t==0?1:0):t==-1?-2:(t=this.compare(r.row,r.column),t==-1?-1:t==1?42:0)},this.comparePoint=function(e){return this.compare(e.row,e.column)},this.containsRange=function(e){return this.comparePoint(e.start)==0&&this.comparePoint(e.end)==0},this.intersects=function(e){var t=this.compareRange(e);return t==-1||t==0||t==1},this.isEnd=function(e,t){return this.end.row==e&&this.end.column==t},this.isStart=function(e,t){return this.start.row==e&&this.start.column==t},this.setStart=function(e,t){typeof e=="object"?(this.start.column=e.column,this.start.row=e.row):(this.start.row=e,this.start.column=t)},this.setEnd=function(e,t){typeof e=="object"?(this.end.column=e.column,this.end.row=e.row):(this.end.row=e,this.end.column=t)},this.inside=function(e,t){return this.compare(e,t)==0?this.isEnd(e,t)||this.isStart(e,t)?!1:!0:!1},this.insideStart=function(e,t){return this.compare(e,t)==0?this.isEnd(e,t)?!1:!0:!1},this.insideEnd=function(e,t){return this.compare(e,t)==0?this.isStart(e,t)?!1:!0:!1},this.compare=function(e,t){return!this.isMultiLine()&&e===this.start.row?tthis.end.column?1:0:ethis.end.row?1:this.start.row===e?t>=this.start.column?0:-1:this.end.row===e?t<=this.end.column?0:1:0},this.compareStart=function(e,t){return this.start.row==e&&this.start.column==t?-1:this.compare(e,t)},this.compareEnd=function(e,t){return this.end.row==e&&this.end.column==t?1:this.compare(e,t)},this.compareInside=function(e,t){return this.end.row==e&&this.end.column==t?1:this.start.row==e&&this.start.column==t?-1:this.compare(e,t)},this.clipRows=function(e,t){if(this.end.row>t)var n={row:t+1,column:0};else if(this.end.rowt)var r={row:t+1,column:0};else if(this.start.row=0&&t.row=0&&t.column<=e[t.row].length}function s(e,t){t.action!="insert"&&t.action!="remove"&&r(t,"delta.action must be 'insert' or 'remove'"),t.lines instanceof Array||r(t,"delta.lines must be an Array"),(!t.start||!t.end)&&r(t,"delta.start/end must be an present");var n=t.start;i(e,t.start)||r(t,"delta.start must be contained in document");var s=t.end;t.action=="remove"&&!i(e,s)&&r(t,"delta.end must contained in document for 'remove' actions");var o=s.row-n.row,u=s.column-(o==0?n.column:0);(o!=t.lines.length-1||t.lines[o].length!=u)&&r(t,"delta.range must match delta lines")}t.applyDelta=function(e,t,n){var r=t.start.row,i=t.start.column,s=e[r]||"";switch(t.action){case"insert":var o=t.lines;if(o.length===1)e[r]=s.substring(0,i)+t.lines[0]+s.substring(i);else{var u=[r,1].concat(t.lines);e.splice.apply(e,u),e[r]=s.substring(0,i)+e[r],e[r+t.lines.length-1]+=s.substring(i)}break;case"remove":var a=t.end.column,f=t.end.row;r===f?e[r]=s.substring(0,i)+s.substring(a):e.splice(r,f-r+1,s.substring(0,i)+e[f].substring(a))}}}),define("ace/lib/event_emitter",[],function(e,t,n){"use strict";var r={},i=function(){this.propagationStopped=!0},s=function(){this.defaultPrevented=!0};r._emit=r._dispatchEvent=function(e,t){this._eventRegistry||(this._eventRegistry={}),this._defaultHandlers||(this._defaultHandlers={});var n=this._eventRegistry[e]||[],r=this._defaultHandlers[e];if(!n.length&&!r)return;if(typeof t!="object"||!t)t={};t.type||(t.type=e),t.stopPropagation||(t.stopPropagation=i),t.preventDefault||(t.preventDefault=s),n=n.slice();for(var o=0;othis.row)return;var n=t(e,{row:this.row,column:this.column},this.$insertRight);this.setPosition(n.row,n.column,!0)},this.setPosition=function(e,t,n){var r;n?r={row:e,column:t}:r=this.$clipPositionToDocument(e,t);if(this.row==r.row&&this.column==r.column)return;var i={row:this.row,column:this.column};this.row=r.row,this.column=r.column,this._signal("change",{old:i,value:r})},this.detach=function(){this.document.off("change",this.$onChange)},this.attach=function(e){this.document=e||this.document,this.document.on("change",this.$onChange)},this.$clipPositionToDocument=function(e,t){var n={};return e>=this.document.getLength()?(n.row=Math.max(0,this.document.getLength()-1),n.column=this.document.getLine(n.row).length):e<0?(n.row=0,n.column=0):(n.row=e,n.column=Math.min(this.document.getLine(n.row).length,Math.max(0,t))),t<0&&(n.column=0),n}}).call(s.prototype)}),define("ace/document",[],function(e,t,n){"use strict";var r=e("./lib/oop"),i=e("./apply_delta").applyDelta,s=e("./lib/event_emitter").EventEmitter,o=e("./range").Range,u=e("./anchor").Anchor,a=function(e){this.$lines=[""],e.length===0?this.$lines=[""]:Array.isArray(e)?this.insertMergedLines({row:0,column:0},e):this.insert({row:0,column:0},e)};(function(){r.implement(this,s),this.setValue=function(e){var t=this.getLength()-1;this.remove(new o(0,0,t,this.getLine(t).length)),this.insert({row:0,column:0},e)},this.getValue=function(){return this.getAllLines().join(this.getNewLineCharacter())},this.createAnchor=function(e,t){return new u(this,e,t)},"aaa".split(/a/).length===0?this.$split=function(e){return e.replace(/\r\n|\r/g,"\n").split("\n")}:this.$split=function(e){return e.split(/\r\n|\r|\n/)},this.$detectNewLine=function(e){var t=e.match(/^.*?(\r\n|\r|\n)/m);this.$autoNewLine=t?t[1]:"\n",this._signal("changeNewLineMode")},this.getNewLineCharacter=function(){switch(this.$newLineMode){case"windows":return"\r\n";case"unix":return"\n";default:return this.$autoNewLine||"\n"}},this.$autoNewLine="",this.$newLineMode="auto",this.setNewLineMode=function(e){if(this.$newLineMode===e)return;this.$newLineMode=e,this._signal("changeNewLineMode")},this.getNewLineMode=function(){return this.$newLineMode},this.isNewLine=function(e){return e=="\r\n"||e=="\r"||e=="\n"},this.getLine=function(e){return this.$lines[e]||""},this.getLines=function(e,t){return this.$lines.slice(e,t+1)},this.getAllLines=function(){return this.getLines(0,this.getLength())},this.getLength=function(){return this.$lines.length},this.getTextRange=function(e){return this.getLinesForRange(e).join(this.getNewLineCharacter())},this.getLinesForRange=function(e){var t;if(e.start.row===e.end.row)t=[this.getLine(e.start.row).substring(e.start.column,e.end.column)];else{t=this.getLines(e.start.row,e.end.row),t[0]=(t[0]||"").substring(e.start.column);var n=t.length-1;e.end.row-e.start.row==n&&(t[n]=t[n].substring(0,e.end.column))}return t},this.insertLines=function(e,t){return console.warn("Use of document.insertLines is deprecated. Use the insertFullLines method instead."),this.insertFullLines(e,t)},this.removeLines=function(e,t){return console.warn("Use of document.removeLines is deprecated. Use the removeFullLines method instead."),this.removeFullLines(e,t)},this.insertNewLine=function(e){return console.warn("Use of document.insertNewLine is deprecated. Use insertMergedLines(position, ['', '']) instead."),this.insertMergedLines(e,["",""])},this.insert=function(e,t){return this.getLength()<=1&&this.$detectNewLine(t),this.insertMergedLines(e,this.$split(t))},this.insertInLine=function(e,t){var n=this.clippedPos(e.row,e.column),r=this.pos(e.row,e.column+t.length);return this.applyDelta({start:n,end:r,action:"insert",lines:[t]},!0),this.clonePos(r)},this.clippedPos=function(e,t){var n=this.getLength();e===undefined?e=n:e<0?e=0:e>=n&&(e=n-1,t=undefined);var r=this.getLine(e);return t==undefined&&(t=r.length),t=Math.min(Math.max(t,0),r.length),{row:e,column:t}},this.clonePos=function(e){return{row:e.row,column:e.column}},this.pos=function(e,t){return{row:e,column:t}},this.$clipPosition=function(e){var t=this.getLength();return e.row>=t?(e.row=Math.max(0,t-1),e.column=this.getLine(t-1).length):(e.row=Math.max(0,e.row),e.column=Math.min(Math.max(e.column,0),this.getLine(e.row).length)),e},this.insertFullLines=function(e,t){e=Math.min(Math.max(e,0),this.getLength());var n=0;e0,r=t=0&&this.applyDelta({start:this.pos(e,this.getLine(e).length),end:this.pos(e+1,0),action:"remove",lines:["",""]})},this.replace=function(e,t){e instanceof o||(e=o.fromPoints(e.start,e.end));if(t.length===0&&e.isEmpty())return e.start;if(t==this.getTextRange(e))return e.end;this.remove(e);var n;return t?n=this.insert(e.start,t):n=e.start,n},this.applyDeltas=function(e){for(var t=0;t=0;t--)this.revertDelta(e[t])},this.applyDelta=function(e,t){var n=e.action=="insert";if(n?e.lines.length<=1&&!e.lines[0]:!o.comparePoints(e.start,e.end))return;n&&e.lines.length>2e4?this.$splitAndapplyLargeDelta(e,2e4):(i(this.$lines,e,t),this._signal("change",e))},this.$safeApplyDelta=function(e){var t=this.$lines.length;(e.action=="remove"&&e.start.row=0&&this._ltIndex-1&&!t[u.type].hide&&(u.channel=t[u.type].channel,this._token=u,this._lt.push(u),this._ltIndexCache.push(this._lt.length-this._ltIndex+i),this._lt.length>5&&this._lt.shift(),this._ltIndexCache.length>5&&this._ltIndexCache.shift(),this._ltIndex=this._lt.length),a=t[u.type],a&&(a.hide||a.channel!==undefined&&e!==a.channel)?this.get(e):u.type},LA:function(e){var t=e,n;if(e>0){if(e>5)throw new Error("Too much lookahead.");while(t)n=this.get(),t--;while(tthis._tokenData.length?"UNKNOWN_TOKEN":this._tokenData[e].name},tokenType:function(e){return this._tokenData[e]||-1},unget:function(){if(!this._ltIndexCache.length)throw new Error("Too much lookahead.");this._ltIndex-=this._ltIndexCache.pop(),this._token=this._lt[this._ltIndex-1]}},parserlib.util={StringReader:t,SyntaxError:n,SyntaxUnit:r,EventTarget:e,TokenStreamBase:i}})(),function(){function Combinator(e,t,n){SyntaxUnit.call(this,e,t,n,Parser.COMBINATOR_TYPE),this.type="unknown",/^\s+$/.test(e)?this.type="descendant":e==">"?this.type="child":e=="+"?this.type="adjacent-sibling":e=="~"&&(this.type="sibling")}function MediaFeature(e,t){SyntaxUnit.call(this,"("+e+(t!==null?":"+t:"")+")",e.startLine,e.startCol,Parser.MEDIA_FEATURE_TYPE),this.name=e,this.value=t}function MediaQuery(e,t,n,r,i){SyntaxUnit.call(this,(e?e+" ":"")+(t?t:"")+(t&&n.length>0?" and ":"")+n.join(" and "),r,i,Parser.MEDIA_QUERY_TYPE),this.modifier=e,this.mediaType=t,this.features=n}function Parser(e){EventTarget.call(this),this.options=e||{},this._tokenStream=null}function PropertyName(e,t,n,r){SyntaxUnit.call(this,e,n,r,Parser.PROPERTY_NAME_TYPE),this.hack=t}function PropertyValue(e,t,n){SyntaxUnit.call(this,e.join(" "),t,n,Parser.PROPERTY_VALUE_TYPE),this.parts=e}function PropertyValueIterator(e){this._i=0,this._parts=e.parts,this._marks=[],this.value=e}function PropertyValuePart(text,line,col){SyntaxUnit.call(this,text,line,col,Parser.PROPERTY_VALUE_PART_TYPE),this.type="unknown";var temp;if(/^([+\-]?[\d\.]+)([a-z]+)$/i.test(text)){this.type="dimension",this.value=+RegExp.$1,this.units=RegExp.$2;switch(this.units.toLowerCase()){case"em":case"rem":case"ex":case"px":case"cm":case"mm":case"in":case"pt":case"pc":case"ch":case"vh":case"vw":case"fr":case"vmax":case"vmin":this.type="length";break;case"deg":case"rad":case"grad":this.type="angle";break;case"ms":case"s":this.type="time";break;case"hz":case"khz":this.type="frequency";break;case"dpi":case"dpcm":this.type="resolution"}}else/^([+\-]?[\d\.]+)%$/i.test(text)?(this.type="percentage",this.value=+RegExp.$1):/^([+\-]?\d+)$/i.test(text)?(this.type="integer",this.value=+RegExp.$1):/^([+\-]?[\d\.]+)$/i.test(text)?(this.type="number",this.value=+RegExp.$1):/^#([a-f0-9]{3,6})/i.test(text)?(this.type="color",temp=RegExp.$1,temp.length==3?(this.red=parseInt(temp.charAt(0)+temp.charAt(0),16),this.green=parseInt(temp.charAt(1)+temp.charAt(1),16),this.blue=parseInt(temp.charAt(2)+temp.charAt(2),16)):(this.red=parseInt(temp.substring(0,2),16),this.green=parseInt(temp.substring(2,4),16),this.blue=parseInt(temp.substring(4,6),16))):/^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/i.test(text)?(this.type="color",this.red=+RegExp.$1,this.green=+RegExp.$2,this.blue=+RegExp.$3):/^rgb\(\s*(\d+)%\s*,\s*(\d+)%\s*,\s*(\d+)%\s*\)/i.test(text)?(this.type="color",this.red=+RegExp.$1*255/100,this.green=+RegExp.$2*255/100,this.blue=+RegExp.$3*255/100):/^rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d\.]+)\s*\)/i.test(text)?(this.type="color",this.red=+RegExp.$1,this.green=+RegExp.$2,this.blue=+RegExp.$3,this.alpha=+RegExp.$4):/^rgba\(\s*(\d+)%\s*,\s*(\d+)%\s*,\s*(\d+)%\s*,\s*([\d\.]+)\s*\)/i.test(text)?(this.type="color",this.red=+RegExp.$1*255/100,this.green=+RegExp.$2*255/100,this.blue=+RegExp.$3*255/100,this.alpha=+RegExp.$4):/^hsl\(\s*(\d+)\s*,\s*(\d+)%\s*,\s*(\d+)%\s*\)/i.test(text)?(this.type="color",this.hue=+RegExp.$1,this.saturation=+RegExp.$2/100,this.lightness=+RegExp.$3/100):/^hsla\(\s*(\d+)\s*,\s*(\d+)%\s*,\s*(\d+)%\s*,\s*([\d\.]+)\s*\)/i.test(text)?(this.type="color",this.hue=+RegExp.$1,this.saturation=+RegExp.$2/100,this.lightness=+RegExp.$3/100,this.alpha=+RegExp.$4):/^url\(["']?([^\)"']+)["']?\)/i.test(text)?(this.type="uri",this.uri=RegExp.$1):/^([^\(]+)\(/i.test(text)?(this.type="function",this.name=RegExp.$1,this.value=text):/^["'][^"']*["']/.test(text)?(this.type="string",this.value=eval(text)):Colors[text.toLowerCase()]?(this.type="color",temp=Colors[text.toLowerCase()].substring(1),this.red=parseInt(temp.substring(0,2),16),this.green=parseInt(temp.substring(2,4),16),this.blue=parseInt(temp.substring(4,6),16)):/^[\,\/]$/.test(text)?(this.type="operator",this.value=text):/^[a-z\-_\u0080-\uFFFF][a-z0-9\-_\u0080-\uFFFF]*$/i.test(text)&&(this.type="identifier",this.value=text)}function Selector(e,t,n){SyntaxUnit.call(this,e.join(" "),t,n,Parser.SELECTOR_TYPE),this.parts=e,this.specificity=Specificity.calculate(this)}function SelectorPart(e,t,n,r,i){SyntaxUnit.call(this,n,r,i,Parser.SELECTOR_PART_TYPE),this.elementName=e,this.modifiers=t}function SelectorSubPart(e,t,n,r){SyntaxUnit.call(this,e,n,r,Parser.SELECTOR_SUB_PART_TYPE),this.type=t,this.args=[]}function Specificity(e,t,n,r){this.a=e,this.b=t,this.c=n,this.d=r}function isHexDigit(e){return e!==null&&h.test(e)}function isDigit(e){return e!==null&&/\d/.test(e)}function isWhitespace(e){return e!==null&&/\s/.test(e)}function isNewLine(e){return e!==null&&nl.test(e)}function isNameStart(e){return e!==null&&/[a-z_\u0080-\uFFFF\\]/i.test(e)}function isNameChar(e){return e!==null&&(isNameStart(e)||/[0-9\-\\]/.test(e))}function isIdentStart(e){return e!==null&&(isNameStart(e)||/\-\\/.test(e))}function mix(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}function TokenStream(e){TokenStreamBase.call(this,e,Tokens)}function ValidationError(e,t,n){this.col=n,this.line=t,this.message=e}var EventTarget=parserlib.util.EventTarget,TokenStreamBase=parserlib.util.TokenStreamBase,StringReader=parserlib.util.StringReader,SyntaxError=parserlib.util.SyntaxError,SyntaxUnit=parserlib.util.SyntaxUnit,Colors={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgrey:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",grey:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32",activeBorder:"Active window border.",activecaption:"Active window caption.",appworkspace:"Background color of multiple document interface.",background:"Desktop background.",buttonface:"The face background color for 3-D elements that appear 3-D due to one layer of surrounding border.",buttonhighlight:"The color of the border facing the light source for 3-D elements that appear 3-D due to one layer of surrounding border.",buttonshadow:"The color of the border away from the light source for 3-D elements that appear 3-D due to one layer of surrounding border.",buttontext:"Text on push buttons.",captiontext:"Text in caption, size box, and scrollbar arrow box.",graytext:"Grayed (disabled) text. This color is set to #000 if the current display driver does not support a solid gray color.",greytext:"Greyed (disabled) text. This color is set to #000 if the current display driver does not support a solid grey color.",highlight:"Item(s) selected in a control.",highlighttext:"Text of item(s) selected in a control.",inactiveborder:"Inactive window border.",inactivecaption:"Inactive window caption.",inactivecaptiontext:"Color of text in an inactive caption.",infobackground:"Background color for tooltip controls.",infotext:"Text color for tooltip controls.",menu:"Menu background.",menutext:"Text in menus.",scrollbar:"Scroll bar gray area.",threeddarkshadow:"The color of the darker (generally outer) of the two borders away from the light source for 3-D elements that appear 3-D due to two concentric layers of surrounding border.",threedface:"The face background color for 3-D elements that appear 3-D due to two concentric layers of surrounding border.",threedhighlight:"The color of the lighter (generally outer) of the two borders facing the light source for 3-D elements that appear 3-D due to two concentric layers of surrounding border.",threedlightshadow:"The color of the darker (generally inner) of the two borders facing the light source for 3-D elements that appear 3-D due to two concentric layers of surrounding border.",threedshadow:"The color of the lighter (generally inner) of the two borders away from the light source for 3-D elements that appear 3-D due to two concentric layers of surrounding border.",window:"Window background.",windowframe:"Window frame.",windowtext:"Text in windows."};Combinator.prototype=new SyntaxUnit,Combinator.prototype.constructor=Combinator,MediaFeature.prototype=new SyntaxUnit,MediaFeature.prototype.constructor=MediaFeature,MediaQuery.prototype=new SyntaxUnit,MediaQuery.prototype.constructor=MediaQuery,Parser.DEFAULT_TYPE=0,Parser.COMBINATOR_TYPE=1,Parser.MEDIA_FEATURE_TYPE=2,Parser.MEDIA_QUERY_TYPE=3,Parser.PROPERTY_NAME_TYPE=4,Parser.PROPERTY_VALUE_TYPE=5,Parser.PROPERTY_VALUE_PART_TYPE=6,Parser.SELECTOR_TYPE=7,Parser.SELECTOR_PART_TYPE=8,Parser.SELECTOR_SUB_PART_TYPE=9,Parser.prototype=function(){var e=new EventTarget,t,n={constructor:Parser,DEFAULT_TYPE:0,COMBINATOR_TYPE:1,MEDIA_FEATURE_TYPE:2,MEDIA_QUERY_TYPE:3,PROPERTY_NAME_TYPE:4,PROPERTY_VALUE_TYPE:5,PROPERTY_VALUE_PART_TYPE:6,SELECTOR_TYPE:7,SELECTOR_PART_TYPE:8,SELECTOR_SUB_PART_TYPE:9,_stylesheet:function(){var e=this._tokenStream,t=null,n,r,i;this.fire("startstylesheet"),this._charset(),this._skipCruft();while(e.peek()==Tokens.IMPORT_SYM)this._import(),this._skipCruft();while(e.peek()==Tokens.NAMESPACE_SYM)this._namespace(),this._skipCruft();i=e.peek();while(i>Tokens.EOF){try{switch(i){case Tokens.MEDIA_SYM:this._media(),this._skipCruft();break;case Tokens.PAGE_SYM:this._page(),this._skipCruft();break;case Tokens.FONT_FACE_SYM:this._font_face(),this._skipCruft();break;case Tokens.KEYFRAMES_SYM:this._keyframes(),this._skipCruft();break;case Tokens.VIEWPORT_SYM:this._viewport(),this._skipCruft();break;case Tokens.UNKNOWN_SYM:e.get();if(!!this.options.strict)throw new SyntaxError("Unknown @ rule.",e.LT(0).startLine,e.LT(0).startCol);this.fire({type:"error",error:null,message:"Unknown @ rule: "+e.LT(0).value+".",line:e.LT(0).startLine,col:e.LT(0).startCol}),n=0;while(e.advance([Tokens.LBRACE,Tokens.RBRACE])==Tokens.LBRACE)n++;while(n)e.advance([Tokens.RBRACE]),n--;break;case Tokens.S:this._readWhitespace();break;default:if(!this._ruleset())switch(i){case Tokens.CHARSET_SYM:throw r=e.LT(1),this._charset(!1),new SyntaxError("@charset not allowed here.",r.startLine,r.startCol);case Tokens.IMPORT_SYM:throw r=e.LT(1),this._import(!1),new SyntaxError("@import not allowed here.",r.startLine,r.startCol);case Tokens.NAMESPACE_SYM:throw r=e.LT(1),this._namespace(!1),new SyntaxError("@namespace not allowed here.",r.startLine,r.startCol);default:e.get(),this._unexpectedToken(e.token())}}}catch(s){if(!(s instanceof SyntaxError&&!this.options.strict))throw s;this.fire({type:"error",error:s,message:s.message,line:s.line,col:s.col})}i=e.peek()}i!=Tokens.EOF&&this._unexpectedToken(e.token()),this.fire("endstylesheet")},_charset:function(e){var t=this._tokenStream,n,r,i,s;t.match(Tokens.CHARSET_SYM)&&(i=t.token().startLine,s=t.token().startCol,this._readWhitespace(),t.mustMatch(Tokens.STRING),r=t.token(),n=r.value,this._readWhitespace(),t.mustMatch(Tokens.SEMICOLON),e!==!1&&this.fire({type:"charset",charset:n,line:i,col:s}))},_import:function(e){var t=this._tokenStream,n,r,i,s=[];t.mustMatch(Tokens.IMPORT_SYM),i=t.token(),this._readWhitespace(),t.mustMatch([Tokens.STRING,Tokens.URI]),r=t.token().value.replace(/^(?:url\()?["']?([^"']+?)["']?\)?$/,"$1"),this._readWhitespace(),s=this._media_query_list(),t.mustMatch(Tokens.SEMICOLON),this._readWhitespace(),e!==!1&&this.fire({type:"import",uri:r,media:s,line:i.startLine,col:i.startCol})},_namespace:function(e){var t=this._tokenStream,n,r,i,s;t.mustMatch(Tokens.NAMESPACE_SYM),n=t.token().startLine,r=t.token().startCol,this._readWhitespace(),t.match(Tokens.IDENT)&&(i=t.token().value,this._readWhitespace()),t.mustMatch([Tokens.STRING,Tokens.URI]),s=t.token().value.replace(/(?:url\()?["']([^"']+)["']\)?/,"$1"),this._readWhitespace(),t.mustMatch(Tokens.SEMICOLON),this._readWhitespace(),e!==!1&&this.fire({type:"namespace",prefix:i,uri:s,line:n,col:r})},_media:function(){var e=this._tokenStream,t,n,r;e.mustMatch(Tokens.MEDIA_SYM),t=e.token().startLine,n=e.token().startCol,this._readWhitespace(),r=this._media_query_list(),e.mustMatch(Tokens.LBRACE),this._readWhitespace(),this.fire({type:"startmedia",media:r,line:t,col:n});for(;;)if(e.peek()==Tokens.PAGE_SYM)this._page();else if(e.peek()==Tokens.FONT_FACE_SYM)this._font_face();else if(e.peek()==Tokens.VIEWPORT_SYM)this._viewport();else if(!this._ruleset())break;e.mustMatch(Tokens.RBRACE),this._readWhitespace(),this.fire({type:"endmedia",media:r,line:t,col:n})},_media_query_list:function(){var e=this._tokenStream,t=[];this._readWhitespace(),(e.peek()==Tokens.IDENT||e.peek()==Tokens.LPAREN)&&t.push(this._media_query());while(e.match(Tokens.COMMA))this._readWhitespace(),t.push(this._media_query());return t},_media_query:function(){var e=this._tokenStream,t=null,n=null,r=null,i=[];e.match(Tokens.IDENT)&&(n=e.token().value.toLowerCase(),n!="only"&&n!="not"?(e.unget(),n=null):r=e.token()),this._readWhitespace(),e.peek()==Tokens.IDENT?(t=this._media_type(),r===null&&(r=e.token())):e.peek()==Tokens.LPAREN&&(r===null&&(r=e.LT(1)),i.push(this._media_expression()));if(t===null&&i.length===0)return null;this._readWhitespace();while(e.match(Tokens.IDENT))e.token().value.toLowerCase()!="and"&&this._unexpectedToken(e.token()),this._readWhitespace(),i.push(this._media_expression());return new MediaQuery(n,t,i,r.startLine,r.startCol)},_media_type:function(){return this._media_feature()},_media_expression:function(){var e=this._tokenStream,t=null,n,r=null;return e.mustMatch(Tokens.LPAREN),this._readWhitespace(),t=this._media_feature(),this._readWhitespace(),e.match(Tokens.COLON)&&(this._readWhitespace(),n=e.LT(1),r=this._expression()),e.mustMatch(Tokens.RPAREN),this._readWhitespace(),new MediaFeature(t,r?new SyntaxUnit(r,n.startLine,n.startCol):null)},_media_feature:function(){var e=this._tokenStream;return e.mustMatch(Tokens.IDENT),SyntaxUnit.fromToken(e.token())},_page:function(){var e=this._tokenStream,t,n,r=null,i=null;e.mustMatch(Tokens.PAGE_SYM),t=e.token().startLine,n=e.token().startCol,this._readWhitespace(),e.match(Tokens.IDENT)&&(r=e.token().value,r.toLowerCase()==="auto"&&this._unexpectedToken(e.token())),e.peek()==Tokens.COLON&&(i=this._pseudo_page()),this._readWhitespace(),this.fire({type:"startpage",id:r,pseudo:i,line:t,col:n}),this._readDeclarations(!0,!0),this.fire({type:"endpage",id:r,pseudo:i,line:t,col:n})},_margin:function(){var e=this._tokenStream,t,n,r=this._margin_sym();return r?(t=e.token().startLine,n=e.token().startCol,this.fire({type:"startpagemargin",margin:r,line:t,col:n}),this._readDeclarations(!0),this.fire({type:"endpagemargin",margin:r,line:t,col:n}),!0):!1},_margin_sym:function(){var e=this._tokenStream;return e.match([Tokens.TOPLEFTCORNER_SYM,Tokens.TOPLEFT_SYM,Tokens.TOPCENTER_SYM,Tokens.TOPRIGHT_SYM,Tokens.TOPRIGHTCORNER_SYM,Tokens.BOTTOMLEFTCORNER_SYM,Tokens.BOTTOMLEFT_SYM,Tokens.BOTTOMCENTER_SYM,Tokens.BOTTOMRIGHT_SYM,Tokens.BOTTOMRIGHTCORNER_SYM,Tokens.LEFTTOP_SYM,Tokens.LEFTMIDDLE_SYM,Tokens.LEFTBOTTOM_SYM,Tokens.RIGHTTOP_SYM,Tokens.RIGHTMIDDLE_SYM,Tokens.RIGHTBOTTOM_SYM])?SyntaxUnit.fromToken(e.token()):null},_pseudo_page:function(){var e=this._tokenStream;return e.mustMatch(Tokens.COLON),e.mustMatch(Tokens.IDENT),e.token().value},_font_face:function(){var e=this._tokenStream,t,n;e.mustMatch(Tokens.FONT_FACE_SYM),t=e.token().startLine,n=e.token().startCol,this._readWhitespace(),this.fire({type:"startfontface",line:t,col:n}),this._readDeclarations(!0),this.fire({type:"endfontface",line:t,col:n})},_viewport:function(){var e=this._tokenStream,t,n;e.mustMatch(Tokens.VIEWPORT_SYM),t=e.token().startLine,n=e.token().startCol,this._readWhitespace(),this.fire({type:"startviewport",line:t,col:n}),this._readDeclarations(!0),this.fire({type:"endviewport",line:t,col:n})},_operator:function(e){var t=this._tokenStream,n=null;if(t.match([Tokens.SLASH,Tokens.COMMA])||e&&t.match([Tokens.PLUS,Tokens.STAR,Tokens.MINUS]))n=t.token(),this._readWhitespace();return n?PropertyValuePart.fromToken(n):null},_combinator:function(){var e=this._tokenStream,t=null,n;return e.match([Tokens.PLUS,Tokens.GREATER,Tokens.TILDE])&&(n=e.token(),t=new Combinator(n.value,n.startLine,n.startCol),this._readWhitespace()),t},_unary_operator:function(){var e=this._tokenStream;return e.match([Tokens.MINUS,Tokens.PLUS])?e.token().value:null},_property:function(){var e=this._tokenStream,t=null,n=null,r,i,s,o;return e.peek()==Tokens.STAR&&this.options.starHack&&(e.get(),i=e.token(),n=i.value,s=i.startLine,o=i.startCol),e.match(Tokens.IDENT)&&(i=e.token(),r=i.value,r.charAt(0)=="_"&&this.options.underscoreHack&&(n="_",r=r.substring(1)),t=new PropertyName(r,n,s||i.startLine,o||i.startCol),this._readWhitespace()),t},_ruleset:function(){var e=this._tokenStream,t,n;try{n=this._selectors_group()}catch(r){if(r instanceof SyntaxError&&!this.options.strict){this.fire({type:"error",error:r,message:r.message,line:r.line,col:r.col}),t=e.advance([Tokens.RBRACE]);if(t!=Tokens.RBRACE)throw r;return!0}throw r}return n&&(this.fire({type:"startrule",selectors:n,line:n[0].line,col:n[0].col}),this._readDeclarations(!0),this.fire({type:"endrule",selectors:n,line:n[0].line,col:n[0].col})),n},_selectors_group:function(){var e=this._tokenStream,t=[],n;n=this._selector();if(n!==null){t.push(n);while(e.match(Tokens.COMMA))this._readWhitespace(),n=this._selector(),n!==null?t.push(n):this._unexpectedToken(e.LT(1))}return t.length?t:null},_selector:function(){var e=this._tokenStream,t=[],n=null,r=null,i=null;n=this._simple_selector_sequence();if(n===null)return null;t.push(n);do{r=this._combinator();if(r!==null)t.push(r),n=this._simple_selector_sequence(),n===null?this._unexpectedToken(e.LT(1)):t.push(n);else{if(!this._readWhitespace())break;i=new Combinator(e.token().value,e.token().startLine,e.token().startCol),r=this._combinator(),n=this._simple_selector_sequence(),n===null?r!==null&&this._unexpectedToken(e.LT(1)):(r!==null?t.push(r):t.push(i),t.push(n))}}while(!0);return new Selector(t,t[0].line,t[0].col)},_simple_selector_sequence:function(){var e=this._tokenStream,t=null,n=[],r="",i=[function(){return e.match(Tokens.HASH)?new SelectorSubPart(e.token().value,"id",e.token().startLine,e.token().startCol):null},this._class,this._attrib,this._pseudo,this._negation],s=0,o=i.length,u=null,a=!1,f,l;f=e.LT(1).startLine,l=e.LT(1).startCol,t=this._type_selector(),t||(t=this._universal()),t!==null&&(r+=t);for(;;){if(e.peek()===Tokens.S)break;while(s1&&e.unget()),null)},_class:function(){var e=this._tokenStream,t;return e.match(Tokens.DOT)?(e.mustMatch(Tokens.IDENT),t=e.token(),new SelectorSubPart("."+t.value,"class",t.startLine,t.startCol-1)):null},_element_name:function(){var e=this._tokenStream,t;return e.match(Tokens.IDENT)?(t=e.token(),new SelectorSubPart(t.value,"elementName",t.startLine,t.startCol)):null},_namespace_prefix:function(){var e=this._tokenStream,t="";if(e.LA(1)===Tokens.PIPE||e.LA(2)===Tokens.PIPE)e.match([Tokens.IDENT,Tokens.STAR])&&(t+=e.token().value),e.mustMatch(Tokens.PIPE),t+="|";return t.length?t:null},_universal:function(){var e=this._tokenStream,t="",n;return n=this._namespace_prefix(),n&&(t+=n),e.match(Tokens.STAR)&&(t+="*"),t.length?t:null},_attrib:function(){var e=this._tokenStream,t=null,n,r;return e.match(Tokens.LBRACKET)?(r=e.token(),t=r.value,t+=this._readWhitespace(),n=this._namespace_prefix(),n&&(t+=n),e.mustMatch(Tokens.IDENT),t+=e.token().value,t+=this._readWhitespace(),e.match([Tokens.PREFIXMATCH,Tokens.SUFFIXMATCH,Tokens.SUBSTRINGMATCH,Tokens.EQUALS,Tokens.INCLUDES,Tokens.DASHMATCH])&&(t+=e.token().value,t+=this._readWhitespace(),e.mustMatch([Tokens.IDENT,Tokens.STRING]),t+=e.token().value,t+=this._readWhitespace()),e.mustMatch(Tokens.RBRACKET),new SelectorSubPart(t+"]","attribute",r.startLine,r.startCol)):null},_pseudo:function(){var e=this._tokenStream,t=null,n=":",r,i;return e.match(Tokens.COLON)&&(e.match(Tokens.COLON)&&(n+=":"),e.match(Tokens.IDENT)?(t=e.token().value,r=e.token().startLine,i=e.token().startCol-n.length):e.peek()==Tokens.FUNCTION&&(r=e.LT(1).startLine,i=e.LT(1).startCol-n.length,t=this._functional_pseudo()),t&&(t=new SelectorSubPart(n+t,"pseudo",r,i))),t},_functional_pseudo:function(){var e=this._tokenStream,t=null;return e.match(Tokens.FUNCTION)&&(t=e.token().value,t+=this._readWhitespace(),t+=this._expression(),e.mustMatch(Tokens.RPAREN),t+=")"),t},_expression:function(){var e=this._tokenStream,t="";while(e.match([Tokens.PLUS,Tokens.MINUS,Tokens.DIMENSION,Tokens.NUMBER,Tokens.STRING,Tokens.IDENT,Tokens.LENGTH,Tokens.FREQ,Tokens.ANGLE,Tokens.TIME,Tokens.RESOLUTION,Tokens.SLASH]))t+=e.token().value,t+=this._readWhitespace();return t.length?t:null},_negation:function(){var e=this._tokenStream,t,n,r="",i,s=null;return e.match(Tokens.NOT)&&(r=e.token().value,t=e.token().startLine,n=e.token().startCol,r+=this._readWhitespace(),i=this._negation_arg(),r+=i,r+=this._readWhitespace(),e.match(Tokens.RPAREN),r+=e.token().value,s=new SelectorSubPart(r,"not",t,n),s.args.push(i)),s},_negation_arg:function(){var e=this._tokenStream,t=[this._type_selector,this._universal,function(){return e.match(Tokens.HASH)?new SelectorSubPart(e.token().value,"id",e.token().startLine,e.token().startCol):null},this._class,this._attrib,this._pseudo],n=null,r=0,i=t.length,s,o,u,a;o=e.LT(1).startLine,u=e.LT(1).startCol;while(r0?new PropertyValue(n,n[0].line,n[0].col):null},_term:function(e){var t=this._tokenStream,n=null,r=null,i=null,s,o,u;return n=this._unary_operator(),n!==null&&(o=t.token().startLine,u=t.token().startCol),t.peek()==Tokens.IE_FUNCTION&&this.options.ieFilters?(r=this._ie_function(),n===null&&(o=t.token().startLine,u=t.token().startCol)):e&&t.match([Tokens.LPAREN,Tokens.LBRACE,Tokens.LBRACKET])?(s=t.token(),i=s.endChar,r=s.value+this._expr(e).text,n===null&&(o=t.token().startLine,u=t.token().startCol),t.mustMatch(Tokens.type(i)),r+=i,this._readWhitespace()):t.match([Tokens.NUMBER,Tokens.PERCENTAGE,Tokens.LENGTH,Tokens.ANGLE,Tokens.TIME,Tokens.FREQ,Tokens.STRING,Tokens.IDENT,Tokens.URI,Tokens.UNICODE_RANGE])?(r=t.token().value,n===null&&(o=t.token().startLine,u=t.token().startCol),this._readWhitespace()):(s=this._hexcolor(),s===null?(n===null&&(o=t.LT(1).startLine,u=t.LT(1).startCol),r===null&&(t.LA(3)==Tokens.EQUALS&&this.options.ieFilters?r=this._ie_function():r=this._function())):(r=s.value,n===null&&(o=s.startLine,u=s.startCol))),r!==null?new PropertyValuePart(n!==null?n+r:r,o,u):null},_function:function(){var e=this._tokenStream,t=null,n=null,r;if(e.match(Tokens.FUNCTION)){t=e.token().value,this._readWhitespace(),n=this._expr(!0),t+=n;if(this.options.ieFilters&&e.peek()==Tokens.EQUALS)do{this._readWhitespace()&&(t+=e.token().value),e.LA(0)==Tokens.COMMA&&(t+=e.token().value),e.match(Tokens.IDENT),t+=e.token().value,e.match(Tokens.EQUALS),t+=e.token().value,r=e.peek();while(r!=Tokens.COMMA&&r!=Tokens.S&&r!=Tokens.RPAREN)e.get(),t+=e.token().value,r=e.peek()}while(e.match([Tokens.COMMA,Tokens.S]));e.match(Tokens.RPAREN),t+=")",this._readWhitespace()}return t},_ie_function:function(){var e=this._tokenStream,t=null,n=null,r;if(e.match([Tokens.IE_FUNCTION,Tokens.FUNCTION])){t=e.token().value;do{this._readWhitespace()&&(t+=e.token().value),e.LA(0)==Tokens.COMMA&&(t+=e.token().value),e.match(Tokens.IDENT),t+=e.token().value,e.match(Tokens.EQUALS),t+=e.token().value,r=e.peek();while(r!=Tokens.COMMA&&r!=Tokens.S&&r!=Tokens.RPAREN)e.get(),t+=e.token().value,r=e.peek()}while(e.match([Tokens.COMMA,Tokens.S]));e.match(Tokens.RPAREN),t+=")",this._readWhitespace()}return t},_hexcolor:function(){var e=this._tokenStream,t=null,n;if(e.match(Tokens.HASH)){t=e.token(),n=t.value;if(!/#[a-f0-9]{3,6}/i.test(n))throw new SyntaxError("Expected a hex color but found '"+n+"' at line "+t.startLine+", col "+t.startCol+".",t.startLine,t.startCol);this._readWhitespace()}return t},_keyframes:function(){var e=this._tokenStream,t,n,r,i="";e.mustMatch(Tokens.KEYFRAMES_SYM),t=e.token(),/^@\-([^\-]+)\-/.test(t.value)&&(i=RegExp.$1),this._readWhitespace(),r=this._keyframe_name(),this._readWhitespace(),e.mustMatch(Tokens.LBRACE),this.fire({type:"startkeyframes",name:r,prefix:i,line:t.startLine,col:t.startCol}),this._readWhitespace(),n=e.peek();while(n==Tokens.IDENT||n==Tokens.PERCENTAGE)this._keyframe_rule(),this._readWhitespace(),n=e.peek();this.fire({type:"endkeyframes",name:r,prefix:i,line:t.startLine,col:t.startCol}),this._readWhitespace(),e.mustMatch(Tokens.RBRACE)},_keyframe_name:function(){var e=this._tokenStream,t;return e.mustMatch([Tokens.IDENT,Tokens.STRING]),SyntaxUnit.fromToken(e.token())},_keyframe_rule:function(){var e=this._tokenStream,t,n=this._key_list();this.fire({type:"startkeyframerule",keys:n,line:n[0].line,col:n[0].col}),this._readDeclarations(!0),this.fire({type:"endkeyframerule",keys:n,line:n[0].line,col:n[0].col})},_key_list:function(){var e=this._tokenStream,t,n,r=[];r.push(this._key()),this._readWhitespace();while(e.match(Tokens.COMMA))this._readWhitespace(),r.push(this._key()),this._readWhitespace();return r},_key:function(){var e=this._tokenStream,t;if(e.match(Tokens.PERCENTAGE))return SyntaxUnit.fromToken(e.token());if(e.match(Tokens.IDENT)){t=e.token();if(/from|to/i.test(t.value))return SyntaxUnit.fromToken(t);e.unget()}this._unexpectedToken(e.LT(1))},_skipCruft:function(){while(this._tokenStream.match([Tokens.S,Tokens.CDO,Tokens.CDC]));},_readDeclarations:function(e,t){var n=this._tokenStream,r;this._readWhitespace(),e&&n.mustMatch(Tokens.LBRACE),this._readWhitespace();try{for(;;){if(!(n.match(Tokens.SEMICOLON)||t&&this._margin())){if(!this._declaration())break;if(!n.match(Tokens.SEMICOLON))break}this._readWhitespace()}n.mustMatch(Tokens.RBRACE),this._readWhitespace()}catch(i){if(!(i instanceof SyntaxError&&!this.options.strict))throw i;this.fire({type:"error",error:i,message:i.message,line:i.line,col:i.col}),r=n.advance([Tokens.SEMICOLON,Tokens.RBRACE]);if(r==Tokens.SEMICOLON)this._readDeclarations(!1,t);else if(r!=Tokens.RBRACE)throw i}},_readWhitespace:function(){var e=this._tokenStream,t="";while(e.match(Tokens.S))t+=e.token().value;return t},_unexpectedToken:function(e){throw new SyntaxError("Unexpected token '"+e.value+"' at line "+e.startLine+", col "+e.startCol+".",e.startLine,e.startCol)},_verifyEnd:function(){this._tokenStream.LA(1)!=Tokens.EOF&&this._unexpectedToken(this._tokenStream.LT(1))},_validateProperty:function(e,t){Validation.validate(e,t)},parse:function(e){this._tokenStream=new TokenStream(e,Tokens),this._stylesheet()},parseStyleSheet:function(e){return this.parse(e)},parseMediaQuery:function(e){this._tokenStream=new TokenStream(e,Tokens);var t=this._media_query();return this._verifyEnd(),t},parsePropertyValue:function(e){this._tokenStream=new TokenStream(e,Tokens),this._readWhitespace();var t=this._expr();return this._readWhitespace(),this._verifyEnd(),t},parseRule:function(e){this._tokenStream=new TokenStream(e,Tokens),this._readWhitespace();var t=this._ruleset();return this._readWhitespace(),this._verifyEnd(),t},parseSelector:function(e){this._tokenStream=new TokenStream(e,Tokens),this._readWhitespace();var t=this._selector();return this._readWhitespace(),this._verifyEnd(),t},parseStyleAttribute:function(e){e+="}",this._tokenStream=new TokenStream(e,Tokens),this._readDeclarations()}};for(t in n)n.hasOwnProperty(t)&&(e[t]=n[t]);return e}();var Properties={"align-items":"flex-start | flex-end | center | baseline | stretch","align-content":"flex-start | flex-end | center | space-between | space-around | stretch","align-self":"auto | flex-start | flex-end | center | baseline | stretch","-webkit-align-items":"flex-start | flex-end | center | baseline | stretch","-webkit-align-content":"flex-start | flex-end | center | space-between | space-around | stretch","-webkit-align-self":"auto | flex-start | flex-end | center | baseline | stretch","alignment-adjust":"auto | baseline | before-edge | text-before-edge | middle | central | after-edge | text-after-edge | ideographic | alphabetic | hanging | mathematical | | ","alignment-baseline":"baseline | use-script | before-edge | text-before-edge | after-edge | text-after-edge | central | middle | ideographic | alphabetic | hanging | mathematical",animation:1,"animation-delay":{multi:"