commit 4fde8c3c4987187f9c0ffe575a3176c5e330a6f1
Author: Dooho Yi
Date: Wed Feb 23 17:28:25 2022 +0900
init
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..992f45f
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,3 @@
+.env
+node_modules
+.DS_Store
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..f7343c8
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,179 @@
+The LICENSE file for any project gives credit to the creator/author of the
+project, copyright information for the project, and the legal terms under
+which it's being shared. In other words, this is us using an MIT license to
+say "we wrote this and you can do whatever you want with it."
+
+******************************************************************************
+~glitch-hello-node
+******************************************************************************
+MIT License
+
+Copyright (c) 2021, Glitch, Inc.
+
+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.
+
+
+
+
+******************************************************************************
+
+THIRD-PARTY SOFTWARE
+
+
+1. fastify: Fastify is a web framework focused on developer experience.
+2. fastify-static: Plugin for serving static files as fast as possible.
+3. handlebars.js: Minimal templating on steroids
+4. point-of-view: Templates rendering plugin support for Fastify.
+5. HK Grotesk: The font we're using.
+
+
+******************************************************************************
+1. fastify (also applies to fastify-formbody)
+URL: https://www.fastify.io/
+ https://github.com/fastify/fastify
+******************************************************************************
+MIT License
+
+Copyright (c) 2016-2020 The Fastify Team
+
+The Fastify team members are listed at https://github.com/fastify/fastify#team
+and in the README file.
+
+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.
+******************************************************************************
+END, fastify
+******************************************************************************
+
+
+******************************************************************************
+2. fastify-static
+URL: https://github.com/fastify/fastify-static
+******************************************************************************
+MIT License
+
+Copyright (c) 2017-2018 Fastify
+
+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.
+******************************************************************************
+END, fastify-static
+******************************************************************************
+
+
+******************************************************************************
+3. handlebars.js
+URL: https://handlebarsjs.com/
+ https://github.com/handlebars-lang/handlebars.js
+******************************************************************************
+Copyright (C) 2011-2019 by Yehuda Katz
+
+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.
+******************************************************************************
+END, fastify-static
+******************************************************************************
+
+
+******************************************************************************
+4. point-of-view
+URL: https://github.com/fastify/point-of-view
+******************************************************************************
+MIT License
+
+Copyright (c) 2017 Fastify
+
+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.
+******************************************************************************
+END, point-of-view
+******************************************************************************
+
+
+******************************************************************************
+5. HK Grotesk
+URL: https://hanken.co/products/hk-grotesk
+******************************************************************************
+HK Grotesk was designed by Hanken Design Co. It is shared using a SIL OFL
+license. Full license text can be found at:
+
+https://hanken.co/pages/web-fonts-eula
+******************************************************************************
+END, HK Grotesk
+******************************************************************************
\ No newline at end of file
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..9f97e6d
--- /dev/null
+++ b/README.md
@@ -0,0 +1,42 @@
+# Hello Node!
+
+This project includes a Node.js server script and a web page that connects to it. The front-end page presents a form the visitor can use to submit a color name, sending the submitted value to the back-end API running on the server. The server returns info to the page that allows it to update the display with the chosen color. ๐จ
+
+[Node.js](https://nodejs.org/en/about/) is a popular runtime that lets you run server-side JavaScript. This project uses the [Fastify](https://www.fastify.io/) framework and explores basic templating with [Handlebars](https://handlebarsjs.com/).
+
+## Prerequisites
+
+You'll get best use out of this project if you're familiar with basic JavaScript. If you've written JavaScript for client-side web pages this is a little different because it uses server-side JS, but the syntax is the same!
+
+## What's in this project?
+
+โ `README.md`: Thatโs this file, where you can tell people what your cool website does and how you built it.
+
+โ `public/style.css`: The styling rules for the pages in your site.
+
+โ `server.js`: The **Node.js** server script for your new site. The JavaScript defines the endpoints in the site back-end, one to return the homepage and one to update with the submitted color. Each one sends data to a Handlebars template which builds these parameter values into the web page the visitor sees.
+
+โ `package.json`: The NPM packages for your project's dependencies.
+
+โ `src/`: This folder holds the site template along with some basic data files.
+
+โ `src/pages/index.hbs`: This is the main page template for your site. The template receives parameters from the server script, which it includes in the page HTML. The page sends the user submitted color value in the body of a request, or as a query parameter to choose a random color.
+
+โ `src/colors.json`: A collection of CSS color names. We use this in the server script to pick a random color, and to match searches against color names.
+
+โ `src/seo.json`: When you're ready to share your new site or add a custom domain, change SEO/meta settings in here.
+
+## Try this next ๐๏ธ
+
+Take a look in `TODO.md` for next steps you can try out in your new site!
+
+___Want a minimal version of this project to build your own Node.js app? Check out [Blank Node](https://glitch.com/edit/#!/remix/glitch-blank-node)!___
+
+
+
+## You built this with Glitch!
+
+[Glitch](https://glitch.com) is a friendly community where millions of people come together to build web apps and websites.
+
+- Need more help? [Check out our Help Center](https://help.glitch.com/) for answers to any common questions.
+- Ready to make it official? [Become a paid Glitch member](https://glitch.com/pricing) to boost your app with private sharing, more storage and memory, domains and more.
diff --git a/TODO.md b/TODO.md
new file mode 100644
index 0000000..d326a22
--- /dev/null
+++ b/TODO.md
@@ -0,0 +1,22 @@
+# TODO ๐ง
+
+Your new site is all yours so it doesn't matter if you break it! Try editing the code.
+
+Let's keep track of the submitted favorites using an array. First add this code near the top of `server.js` (where the comment says `ADD FAVORITES ARRAY VARIABLE`):
+
+```js
+const favorites = [];
+```
+
+In the `POST` route, inside the `if(color)` block, add this code to save the submitted value to the array, and write it to the console:
+
+```js
+favorites.push(color);
+console.log(favorites);
+```
+
+Click __Tools__ > __Logs__ at the bottom of Glitch to see the log statement in action when you submit new colors through the form.
+
+## Keep going! ๐
+
+Clearly this is not a robust data storage approach and won't persist for long! Your Node apps can use a variety of databases, like [SQLite](https://glitch.com/~glitch-hello-sqlite) and [Airtable](https://glitch.com/~glitch-hello-airtable).
diff --git a/package-lock.json b/package-lock.json
new file mode 100644
index 0000000..78877d7
--- /dev/null
+++ b/package-lock.json
@@ -0,0 +1,2129 @@
+{
+ "name": "hello-node",
+ "version": "0.0.1",
+ "lockfileVersion": 1,
+ "requires": true,
+ "dependencies": {
+ "@fastify/ajv-compiler": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/@fastify/ajv-compiler/-/ajv-compiler-1.1.0.tgz",
+ "integrity": "sha512-gvCOUNpXsWrIQ3A4aXCLIdblL0tDq42BG/2Xw7oxbil9h11uow10ztS2GuFazNBfjbrsZ5nl+nPl5jDSjj5TSg==",
+ "requires": {
+ "ajv": "^6.12.6"
+ }
+ },
+ "@fastify/busboy": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/@fastify/busboy/-/busboy-1.0.0.tgz",
+ "integrity": "sha512-tzTXX1TFEjWCseEsNdIlXXkD+48uJoN+zpqIojUX4pSoMscsbhO/UuVEB5SzJucexqDWOo2ma0ECwdD7hZdrzg==",
+ "requires": {
+ "text-decoding": "^1.0.0"
+ }
+ },
+ "@sindresorhus/is": {
+ "version": "0.14.0",
+ "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-0.14.0.tgz",
+ "integrity": "sha512-9NET910DNaIPngYnLLPeg+Ogzqsi9uM4mSboU5y6p8S5DzMTVEsJZrawi+BoDNUVBa2DhJqQYUFvMDfgU062LQ==",
+ "dev": true
+ },
+ "@szmarczak/http-timer": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-1.1.2.tgz",
+ "integrity": "sha512-XIB2XbzHTN6ieIjfIMV9hlVcfPU26s2vafYWQcZHWXHOxiaRZYEDKEwdl129Zyg50+foYV2jCgtrqSA6qNuNSA==",
+ "dev": true,
+ "requires": {
+ "defer-to-connect": "^1.0.1"
+ }
+ },
+ "@tootallnate/once": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz",
+ "integrity": "sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw=="
+ },
+ "abbrev": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz",
+ "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==",
+ "dev": true
+ },
+ "abstract-logging": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/abstract-logging/-/abstract-logging-2.0.1.tgz",
+ "integrity": "sha512-2BjRTZxTPvheOvGbBslFSYOUkr+SjPtOnrLP33f+VIWLzezQpZcqVg7ja3L4dBXmzzgwT+a029jRx5PCi3JuiA=="
+ },
+ "accepts": {
+ "version": "1.3.7",
+ "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz",
+ "integrity": "sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA==",
+ "requires": {
+ "mime-types": "~2.1.24",
+ "negotiator": "0.6.2"
+ }
+ },
+ "after": {
+ "version": "0.8.2",
+ "resolved": "https://registry.npmjs.org/after/-/after-0.8.2.tgz",
+ "integrity": "sha1-/ts5T58OAqqXaOcCvaI7UF+ufh8="
+ },
+ "agent-base": {
+ "version": "6.0.2",
+ "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz",
+ "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==",
+ "requires": {
+ "debug": "4"
+ }
+ },
+ "ajv": {
+ "version": "6.12.6",
+ "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz",
+ "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==",
+ "requires": {
+ "fast-deep-equal": "^3.1.1",
+ "fast-json-stable-stringify": "^2.0.0",
+ "json-schema-traverse": "^0.4.1",
+ "uri-js": "^4.2.2"
+ }
+ },
+ "ansi-align": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-3.0.1.tgz",
+ "integrity": "sha512-IOfwwBF5iczOjp/WeY4YxyjqAFMQoZufdQWDd19SEExbVLNXqvpzSJ/M7Za4/sCPmQ0+GRquoA7bGcINcxew6w==",
+ "dev": true,
+ "requires": {
+ "string-width": "^4.1.0"
+ }
+ },
+ "ansi-regex": {
+ "version": "5.0.1",
+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
+ "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
+ "dev": true
+ },
+ "ansi-styles": {
+ "version": "4.3.0",
+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
+ "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
+ "dev": true,
+ "requires": {
+ "color-convert": "^2.0.1"
+ }
+ },
+ "anymatch": {
+ "version": "3.1.2",
+ "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz",
+ "integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==",
+ "dev": true,
+ "requires": {
+ "normalize-path": "^3.0.0",
+ "picomatch": "^2.0.4"
+ }
+ },
+ "archy": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz",
+ "integrity": "sha1-+cjBN1fMHde8N5rHeyxipcKGjEA="
+ },
+ "arraybuffer.slice": {
+ "version": "0.0.7",
+ "resolved": "https://registry.npmjs.org/arraybuffer.slice/-/arraybuffer.slice-0.0.7.tgz",
+ "integrity": "sha512-wGUIVQXuehL5TCqQun8OW81jGzAWycqzFF8lFp+GOM5BXLYj3bKNsYC4daB7n6XjCqxQA/qgTJ+8ANR3acjrog=="
+ },
+ "async": {
+ "version": "3.2.3",
+ "resolved": "https://registry.npmjs.org/async/-/async-3.2.3.tgz",
+ "integrity": "sha512-spZRyzKL5l5BZQrr/6m/SqFdBN0q3OCI0f9rjfBzCMBIP4p75P620rR3gTmaksNOhmzgdxcaxdNfMy6anrbM0g=="
+ },
+ "async-limiter": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.1.tgz",
+ "integrity": "sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ=="
+ },
+ "atomic-sleep": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/atomic-sleep/-/atomic-sleep-1.0.0.tgz",
+ "integrity": "sha512-kNOjDqAh7px0XWNI+4QbzoiR/nTkHAWNud2uvnJquD1/x5a7EQZMJT0AczqK0Qn67oY/TTQ1LbUKajZpp3I9tQ=="
+ },
+ "avvio": {
+ "version": "7.2.2",
+ "resolved": "https://registry.npmjs.org/avvio/-/avvio-7.2.2.tgz",
+ "integrity": "sha512-XW2CMCmZaCmCCsIaJaLKxAzPwF37fXi1KGxNOvedOpeisLdmxZnblGc3hpHWYnlP+KOUxZsazh43WXNHgXpbqw==",
+ "requires": {
+ "archy": "^1.0.0",
+ "debug": "^4.0.0",
+ "fastq": "^1.6.1",
+ "queue-microtask": "^1.1.2"
+ }
+ },
+ "backo2": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/backo2/-/backo2-1.0.2.tgz",
+ "integrity": "sha1-MasayLEpNjRj41s+u2n038+6eUc="
+ },
+ "balanced-match": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
+ "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw=="
+ },
+ "base64-arraybuffer": {
+ "version": "0.1.4",
+ "resolved": "https://registry.npmjs.org/base64-arraybuffer/-/base64-arraybuffer-0.1.4.tgz",
+ "integrity": "sha1-mBjHngWbE1X5fgQooBfIOOkLqBI="
+ },
+ "base64id": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/base64id/-/base64id-2.0.0.tgz",
+ "integrity": "sha512-lGe34o6EHj9y3Kts9R4ZYs/Gr+6N7MCaMlIFA3F1R2O5/m7K06AxfSeO5530PEERE6/WyEg3lsuyw4GHlPZHog=="
+ },
+ "better-assert": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/better-assert/-/better-assert-1.0.2.tgz",
+ "integrity": "sha1-QIZrnhueC1W0gYlDEeaPr/rrxSI=",
+ "requires": {
+ "callsite": "1.0.0"
+ }
+ },
+ "binary-extensions": {
+ "version": "2.2.0",
+ "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz",
+ "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==",
+ "dev": true
+ },
+ "blob": {
+ "version": "0.0.5",
+ "resolved": "https://registry.npmjs.org/blob/-/blob-0.0.5.tgz",
+ "integrity": "sha512-gaqbzQPqOoamawKg0LGVd7SzLgXS+JH61oWprSLH+P+abTczqJbhTR8CmJ2u9/bUYNmHTGJx/UEmn6doAvvuig=="
+ },
+ "boxen": {
+ "version": "5.1.2",
+ "resolved": "https://registry.npmjs.org/boxen/-/boxen-5.1.2.tgz",
+ "integrity": "sha512-9gYgQKXx+1nP8mP7CzFyaUARhg7D3n1dF/FnErWmu9l6JvGpNUN278h0aSb+QjoiKSWG+iZ3uHrcqk0qrY9RQQ==",
+ "dev": true,
+ "requires": {
+ "ansi-align": "^3.0.0",
+ "camelcase": "^6.2.0",
+ "chalk": "^4.1.0",
+ "cli-boxes": "^2.2.1",
+ "string-width": "^4.2.2",
+ "type-fest": "^0.20.2",
+ "widest-line": "^3.1.0",
+ "wrap-ansi": "^7.0.0"
+ }
+ },
+ "brace-expansion": {
+ "version": "1.1.11",
+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
+ "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
+ "requires": {
+ "balanced-match": "^1.0.0",
+ "concat-map": "0.0.1"
+ }
+ },
+ "braces": {
+ "version": "3.0.2",
+ "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz",
+ "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==",
+ "dev": true,
+ "requires": {
+ "fill-range": "^7.0.1"
+ }
+ },
+ "buffer-from": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz",
+ "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ=="
+ },
+ "cacheable-request": {
+ "version": "6.1.0",
+ "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-6.1.0.tgz",
+ "integrity": "sha512-Oj3cAGPCqOZX7Rz64Uny2GYAZNliQSqfbePrgAQ1wKAihYmCUnraBtJtKcGR4xz7wF+LoJC+ssFZvv5BgF9Igg==",
+ "dev": true,
+ "requires": {
+ "clone-response": "^1.0.2",
+ "get-stream": "^5.1.0",
+ "http-cache-semantics": "^4.0.0",
+ "keyv": "^3.0.0",
+ "lowercase-keys": "^2.0.0",
+ "normalize-url": "^4.1.0",
+ "responselike": "^1.0.2"
+ },
+ "dependencies": {
+ "get-stream": {
+ "version": "5.2.0",
+ "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz",
+ "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==",
+ "dev": true,
+ "requires": {
+ "pump": "^3.0.0"
+ }
+ },
+ "lowercase-keys": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-2.0.0.tgz",
+ "integrity": "sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==",
+ "dev": true
+ }
+ }
+ },
+ "callsite": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/callsite/-/callsite-1.0.0.tgz",
+ "integrity": "sha1-KAOY5dZkvXQDi28JBRU+borxvCA="
+ },
+ "camelcase": {
+ "version": "6.3.0",
+ "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz",
+ "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==",
+ "dev": true
+ },
+ "chalk": {
+ "version": "4.1.2",
+ "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
+ "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
+ "dev": true,
+ "requires": {
+ "ansi-styles": "^4.1.0",
+ "supports-color": "^7.1.0"
+ },
+ "dependencies": {
+ "has-flag": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
+ "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
+ "dev": true
+ },
+ "supports-color": {
+ "version": "7.2.0",
+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
+ "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
+ "dev": true,
+ "requires": {
+ "has-flag": "^4.0.0"
+ }
+ }
+ }
+ },
+ "chokidar": {
+ "version": "3.5.2",
+ "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.2.tgz",
+ "integrity": "sha512-ekGhOnNVPgT77r4K/U3GDhu+FQ2S8TnK/s2KbIGXi0SZWuwkZ2QNyfWdZW+TVfn84DpEP7rLeCt2UI6bJ8GwbQ==",
+ "dev": true,
+ "requires": {
+ "anymatch": "~3.1.2",
+ "braces": "~3.0.2",
+ "fsevents": "~2.3.2",
+ "glob-parent": "~5.1.2",
+ "is-binary-path": "~2.1.0",
+ "is-glob": "~4.0.1",
+ "normalize-path": "~3.0.0",
+ "readdirp": "~3.6.0"
+ }
+ },
+ "ci-info": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz",
+ "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==",
+ "dev": true
+ },
+ "cli-boxes": {
+ "version": "2.2.1",
+ "resolved": "https://registry.npmjs.org/cli-boxes/-/cli-boxes-2.2.1.tgz",
+ "integrity": "sha512-y4coMcylgSCdVinjiDBuR8PCC2bLjyGTwEmPb9NHR/QaNU6EUOXcTY/s6VjGMD6ENSEaeQYHCY0GNGS5jfMwPw==",
+ "dev": true
+ },
+ "clone-response": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/clone-response/-/clone-response-1.0.2.tgz",
+ "integrity": "sha1-0dyXOSAxTfZ/vrlCI7TuNQI56Ws=",
+ "dev": true,
+ "requires": {
+ "mimic-response": "^1.0.0"
+ }
+ },
+ "color-convert": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
+ "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
+ "dev": true,
+ "requires": {
+ "color-name": "~1.1.4"
+ }
+ },
+ "color-name": {
+ "version": "1.1.4",
+ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
+ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
+ "dev": true
+ },
+ "component-bind": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/component-bind/-/component-bind-1.0.0.tgz",
+ "integrity": "sha1-AMYIq33Nk4l8AAllGx06jh5zu9E="
+ },
+ "component-emitter": {
+ "version": "1.2.1",
+ "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz",
+ "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY="
+ },
+ "component-inherit": {
+ "version": "0.0.3",
+ "resolved": "https://registry.npmjs.org/component-inherit/-/component-inherit-0.0.3.tgz",
+ "integrity": "sha1-ZF/ErfWLcrZJ1crmUTVhnbJv8UM="
+ },
+ "concat-map": {
+ "version": "0.0.1",
+ "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
+ "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s="
+ },
+ "configstore": {
+ "version": "5.0.1",
+ "resolved": "https://registry.npmjs.org/configstore/-/configstore-5.0.1.tgz",
+ "integrity": "sha512-aMKprgk5YhBNyH25hj8wGt2+D52Sw1DRRIzqBwLp2Ya9mFmY8KPvvtvmna8SxVR9JMZ4kzMD68N22vlaRpkeFA==",
+ "dev": true,
+ "requires": {
+ "dot-prop": "^5.2.0",
+ "graceful-fs": "^4.1.2",
+ "make-dir": "^3.0.0",
+ "unique-string": "^2.0.0",
+ "write-file-atomic": "^3.0.0",
+ "xdg-basedir": "^4.0.0"
+ }
+ },
+ "content-disposition": {
+ "version": "0.5.4",
+ "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz",
+ "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==",
+ "requires": {
+ "safe-buffer": "5.2.1"
+ }
+ },
+ "cookie": {
+ "version": "0.4.1",
+ "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.1.tgz",
+ "integrity": "sha512-ZwrFkGJxUR3EIoXtO+yVE69Eb7KlixbaeAWfBQB9vVsNn/o+Yw69gBWSSDK825hQNdN+wF8zELf3dFNl/kxkUA=="
+ },
+ "crypto-random-string": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-2.0.0.tgz",
+ "integrity": "sha512-v1plID3y9r/lPhviJ1wrXpLeyUIGAZ2SHNYTEapm7/8A9nLPoyvVp3RK/EPFqn5kEznyWgYZNsRtYYIWbuG8KA==",
+ "dev": true
+ },
+ "debug": {
+ "version": "4.3.3",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz",
+ "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==",
+ "requires": {
+ "ms": "2.1.2"
+ }
+ },
+ "decompress-response": {
+ "version": "3.3.0",
+ "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-3.3.0.tgz",
+ "integrity": "sha1-gKTdMjdIOEv6JICDYirt7Jgq3/M=",
+ "dev": true,
+ "requires": {
+ "mimic-response": "^1.0.0"
+ }
+ },
+ "deep-extend": {
+ "version": "0.6.0",
+ "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz",
+ "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==",
+ "dev": true
+ },
+ "deepmerge": {
+ "version": "4.2.2",
+ "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.2.2.tgz",
+ "integrity": "sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg=="
+ },
+ "defer-to-connect": {
+ "version": "1.1.3",
+ "resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-1.1.3.tgz",
+ "integrity": "sha512-0ISdNousHvZT2EiFlZeZAHBUvSxmKswVCEf8hW7KWgG4a8MVEu/3Vb6uWYozkjylyCxe0JBIiRB1jV45S70WVQ==",
+ "dev": true
+ },
+ "depd": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz",
+ "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak="
+ },
+ "destroy": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz",
+ "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA="
+ },
+ "dot-prop": {
+ "version": "5.3.0",
+ "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-5.3.0.tgz",
+ "integrity": "sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q==",
+ "dev": true,
+ "requires": {
+ "is-obj": "^2.0.0"
+ }
+ },
+ "dotenv": {
+ "version": "11.0.0",
+ "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-11.0.0.tgz",
+ "integrity": "sha512-Fp/b504Y5W+e+FpCxTFMUZ7ZEQkQYF0rx+KZtmwixJxGQbLHrhCwo3FjZgNC8vIfrSi29PABNbMoCGD9YoiXbQ=="
+ },
+ "duplexer3": {
+ "version": "0.1.4",
+ "resolved": "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.4.tgz",
+ "integrity": "sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI=",
+ "dev": true
+ },
+ "ee-first": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz",
+ "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0="
+ },
+ "emoji-regex": {
+ "version": "8.0.0",
+ "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
+ "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==",
+ "dev": true
+ },
+ "encodeurl": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz",
+ "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k="
+ },
+ "encoding-negotiator": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/encoding-negotiator/-/encoding-negotiator-2.0.1.tgz",
+ "integrity": "sha512-GSK7qphNR4iPcejfAlZxKDoz3xMhnspwImK+Af5WhePS9jUpK/Oh7rUdyENWu+9rgDflOCTmAojBsgsvM8neAQ=="
+ },
+ "end-of-stream": {
+ "version": "1.4.4",
+ "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz",
+ "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==",
+ "requires": {
+ "once": "^1.4.0"
+ }
+ },
+ "engine.io": {
+ "version": "3.4.2",
+ "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-3.4.2.tgz",
+ "integrity": "sha512-b4Q85dFkGw+TqgytGPrGgACRUhsdKc9S9ErRAXpPGy/CXKs4tYoHDkvIRdsseAF7NjfVwjRFIn6KTnbw7LwJZg==",
+ "requires": {
+ "accepts": "~1.3.4",
+ "base64id": "2.0.0",
+ "cookie": "0.3.1",
+ "debug": "~4.1.0",
+ "engine.io-parser": "~2.2.0",
+ "ws": "^7.1.2"
+ },
+ "dependencies": {
+ "cookie": {
+ "version": "0.3.1",
+ "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.3.1.tgz",
+ "integrity": "sha1-5+Ch+e9DtMi6klxcWpboBtFoc7s="
+ },
+ "debug": {
+ "version": "4.1.1",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz",
+ "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==",
+ "requires": {
+ "ms": "^2.1.1"
+ }
+ }
+ }
+ },
+ "engine.io-client": {
+ "version": "3.4.4",
+ "resolved": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-3.4.4.tgz",
+ "integrity": "sha512-iU4CRr38Fecj8HoZEnFtm2EiKGbYZcPn3cHxqNGl/tmdWRf60KhK+9vE0JeSjgnlS/0oynEfLgKbT9ALpim0sQ==",
+ "requires": {
+ "component-emitter": "~1.3.0",
+ "component-inherit": "0.0.3",
+ "debug": "~3.1.0",
+ "engine.io-parser": "~2.2.0",
+ "has-cors": "1.1.0",
+ "indexof": "0.0.1",
+ "parseqs": "0.0.6",
+ "parseuri": "0.0.6",
+ "ws": "~6.1.0",
+ "xmlhttprequest-ssl": "~1.5.4",
+ "yeast": "0.1.2"
+ },
+ "dependencies": {
+ "component-emitter": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz",
+ "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg=="
+ },
+ "debug": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz",
+ "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==",
+ "requires": {
+ "ms": "2.0.0"
+ }
+ },
+ "ms": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
+ "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g="
+ },
+ "parseqs": {
+ "version": "0.0.6",
+ "resolved": "https://registry.npmjs.org/parseqs/-/parseqs-0.0.6.tgz",
+ "integrity": "sha512-jeAGzMDbfSHHA091hr0r31eYfTig+29g3GKKE/PPbEQ65X0lmMwlEoqmhzu0iztID5uJpZsFlUPDP8ThPL7M8w=="
+ },
+ "parseuri": {
+ "version": "0.0.6",
+ "resolved": "https://registry.npmjs.org/parseuri/-/parseuri-0.0.6.tgz",
+ "integrity": "sha512-AUjen8sAkGgao7UyCX6Ahv0gIK2fABKmYjvP4xmy5JaKvcbTRueIqIPHLAfq30xJddqSE033IOMUSOMCcK3Sow=="
+ },
+ "ws": {
+ "version": "6.1.4",
+ "resolved": "https://registry.npmjs.org/ws/-/ws-6.1.4.tgz",
+ "integrity": "sha512-eqZfL+NE/YQc1/ZynhojeV8q+H050oR8AZ2uIev7RU10svA9ZnJUddHcOUZTJLinZ9yEfdA2kSATS2qZK5fhJA==",
+ "requires": {
+ "async-limiter": "~1.0.0"
+ }
+ }
+ }
+ },
+ "engine.io-parser": {
+ "version": "2.2.1",
+ "resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-2.2.1.tgz",
+ "integrity": "sha512-x+dN/fBH8Ro8TFwJ+rkB2AmuVw9Yu2mockR/p3W8f8YtExwFgDvBDi0GWyb4ZLkpahtDGZgtr3zLovanJghPqg==",
+ "requires": {
+ "after": "0.8.2",
+ "arraybuffer.slice": "~0.0.7",
+ "base64-arraybuffer": "0.1.4",
+ "blob": "0.0.5",
+ "has-binary2": "~1.0.2"
+ }
+ },
+ "escape-goat": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/escape-goat/-/escape-goat-2.1.1.tgz",
+ "integrity": "sha512-8/uIhbG12Csjy2JEW7D9pHbreaVaS/OpN3ycnyvElTdwM5n6GY6W6e2IPemfvGZeUMqZ9A/3GqIZMgKnBhAw/Q==",
+ "dev": true
+ },
+ "escape-html": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz",
+ "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg="
+ },
+ "etag": {
+ "version": "1.8.1",
+ "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz",
+ "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc="
+ },
+ "fast-decode-uri-component": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/fast-decode-uri-component/-/fast-decode-uri-component-1.0.1.tgz",
+ "integrity": "sha512-WKgKWg5eUxvRZGwW8FvfbaH7AXSh2cL+3j5fMGzUMCxWBJ3dV3a7Wz8y2f/uQ0e3B6WmodD3oS54jTQ9HVTIIg=="
+ },
+ "fast-deep-equal": {
+ "version": "3.1.3",
+ "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz",
+ "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q=="
+ },
+ "fast-json-stable-stringify": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz",
+ "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw=="
+ },
+ "fast-json-stringify": {
+ "version": "2.7.13",
+ "resolved": "https://registry.npmjs.org/fast-json-stringify/-/fast-json-stringify-2.7.13.tgz",
+ "integrity": "sha512-ar+hQ4+OIurUGjSJD1anvYSDcUflywhKjfxnsW4TBTD7+u0tJufv6DKRWoQk3vI6YBOWMoz0TQtfbe7dxbQmvA==",
+ "requires": {
+ "ajv": "^6.11.0",
+ "deepmerge": "^4.2.2",
+ "rfdc": "^1.2.0",
+ "string-similarity": "^4.0.1"
+ }
+ },
+ "fast-redact": {
+ "version": "3.0.2",
+ "resolved": "https://registry.npmjs.org/fast-redact/-/fast-redact-3.0.2.tgz",
+ "integrity": "sha512-YN+CYfCVRVMUZOUPeinHNKgytM1wPI/C/UCLEi56EsY2dwwvI00kIJHJoI7pMVqGoMew8SMZ2SSfHKHULHXDsg=="
+ },
+ "fast-safe-stringify": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.1.1.tgz",
+ "integrity": "sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA=="
+ },
+ "fast-xml-parser": {
+ "version": "3.21.1",
+ "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-3.21.1.tgz",
+ "integrity": "sha512-FTFVjYoBOZTJekiUsawGsSYV9QL0A+zDYCRj7y34IO6Jg+2IMYEtQa+bbictpdpV8dHxXywqU7C0gRDEOFtBFg==",
+ "requires": {
+ "strnum": "^1.0.4"
+ }
+ },
+ "fastify": {
+ "version": "3.25.3",
+ "resolved": "https://registry.npmjs.org/fastify/-/fastify-3.25.3.tgz",
+ "integrity": "sha512-20SbobjjMfjGNCU4PlcZis3d5XLDtQxIbcAf6ogi/8zPxRxOOkKwfjmj7yW9Q1VnxDpBwcllwPtbZ/LyvQzXbQ==",
+ "requires": {
+ "@fastify/ajv-compiler": "^1.0.0",
+ "abstract-logging": "^2.0.0",
+ "avvio": "^7.1.2",
+ "fast-json-stringify": "^2.5.2",
+ "fastify-error": "^0.3.0",
+ "find-my-way": "^4.5.0",
+ "flatstr": "^1.0.12",
+ "light-my-request": "^4.2.0",
+ "pino": "^6.13.0",
+ "process-warning": "^1.0.0",
+ "proxy-addr": "^2.0.7",
+ "rfdc": "^1.1.4",
+ "secure-json-parse": "^2.0.0",
+ "semver": "^7.3.2",
+ "tiny-lru": "^7.0.0"
+ }
+ },
+ "fastify-error": {
+ "version": "0.3.1",
+ "resolved": "https://registry.npmjs.org/fastify-error/-/fastify-error-0.3.1.tgz",
+ "integrity": "sha512-oCfpcsDndgnDVgiI7bwFKAun2dO+4h84vBlkWsWnz/OUK9Reff5UFoFl241xTiLeHWX/vU9zkDVXqYUxjOwHcQ=="
+ },
+ "fastify-formbody": {
+ "version": "5.2.0",
+ "resolved": "https://registry.npmjs.org/fastify-formbody/-/fastify-formbody-5.2.0.tgz",
+ "integrity": "sha512-d8Y5hCL82akPyoFiXh2wYOm3es0pV9jqoPo3pO9OV2cNF0cQx39J5WAVXzCh4MSt9Z2qF4Fy5gHlvlyESwjtvg==",
+ "requires": {
+ "fastify-plugin": "^3.0.0"
+ }
+ },
+ "fastify-multipart": {
+ "version": "5.2.1",
+ "resolved": "https://registry.npmjs.org/fastify-multipart/-/fastify-multipart-5.2.1.tgz",
+ "integrity": "sha512-dy7yogJ4ARaQALGbi4dQtyYziNBuUJgGgTGmp3eS3+roAwLMDBsWz0OvBzJHth4xS/OW/js26xNdW6VlxT8htA==",
+ "requires": {
+ "@fastify/busboy": "^1.0.0",
+ "deepmerge": "^4.2.2",
+ "end-of-stream": "^1.4.4",
+ "fastify-error": "^0.3.0",
+ "fastify-plugin": "^3.0.0",
+ "hexoid": "^1.0.0",
+ "secure-json-parse": "^2.4.0",
+ "stream-wormhole": "^1.1.0"
+ }
+ },
+ "fastify-plugin": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/fastify-plugin/-/fastify-plugin-3.0.0.tgz",
+ "integrity": "sha512-ZdCvKEEd92DNLps5n0v231Bha8bkz1DjnPP/aEz37rz/q42Z5JVLmgnqR4DYuNn3NXAO3IDCPyRvgvxtJ4Ym4w=="
+ },
+ "fastify-static": {
+ "version": "4.5.0",
+ "resolved": "https://registry.npmjs.org/fastify-static/-/fastify-static-4.5.0.tgz",
+ "integrity": "sha512-Q7Tgl55AjsmBwiO4hKYib2BUCt+XTWLJ6Xp8YPPHU3EsrKNpevJ4cz8pjf1Ey1QhHw9O8Y2FDKdu+IC74oHvqw==",
+ "requires": {
+ "content-disposition": "^0.5.3",
+ "encoding-negotiator": "^2.0.1",
+ "fastify-plugin": "^3.0.0",
+ "glob": "^7.1.4",
+ "p-limit": "^3.1.0",
+ "readable-stream": "^3.4.0",
+ "send": "^0.17.1"
+ }
+ },
+ "fastify-warning": {
+ "version": "0.2.0",
+ "resolved": "https://registry.npmjs.org/fastify-warning/-/fastify-warning-0.2.0.tgz",
+ "integrity": "sha512-s1EQguBw/9qtc1p/WTY4eq9WMRIACkj+HTcOIK1in4MV5aFaQC9ZCIt0dJ7pr5bIf4lPpHvAtP2ywpTNgs7hqw=="
+ },
+ "fastq": {
+ "version": "1.13.0",
+ "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.13.0.tgz",
+ "integrity": "sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==",
+ "requires": {
+ "reusify": "^1.0.4"
+ }
+ },
+ "fill-range": {
+ "version": "7.0.1",
+ "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz",
+ "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==",
+ "dev": true,
+ "requires": {
+ "to-regex-range": "^5.0.1"
+ }
+ },
+ "find-my-way": {
+ "version": "4.5.1",
+ "resolved": "https://registry.npmjs.org/find-my-way/-/find-my-way-4.5.1.tgz",
+ "integrity": "sha512-kE0u7sGoUFbMXcOG/xpkmz4sRLCklERnBcg7Ftuu1iAxsfEt2S46RLJ3Sq7vshsEy2wJT2hZxE58XZK27qa8kg==",
+ "requires": {
+ "fast-decode-uri-component": "^1.0.1",
+ "fast-deep-equal": "^3.1.3",
+ "safe-regex2": "^2.0.0",
+ "semver-store": "^0.3.0"
+ }
+ },
+ "flatstr": {
+ "version": "1.0.12",
+ "resolved": "https://registry.npmjs.org/flatstr/-/flatstr-1.0.12.tgz",
+ "integrity": "sha512-4zPxDyhCyiN2wIAtSLI6gc82/EjqZc1onI4Mz/l0pWrAlsSfYH/2ZIcU+e3oA2wDwbzIWNKwa23F8rh6+DRWkw=="
+ },
+ "fluent-ffmpeg": {
+ "version": "2.1.2",
+ "resolved": "https://registry.npmjs.org/fluent-ffmpeg/-/fluent-ffmpeg-2.1.2.tgz",
+ "integrity": "sha1-yVLeIkD4EuvaCqgAbXd27irPfXQ=",
+ "requires": {
+ "async": ">=0.2.9",
+ "which": "^1.1.1"
+ }
+ },
+ "forwarded": {
+ "version": "0.2.0",
+ "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz",
+ "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow=="
+ },
+ "fresh": {
+ "version": "0.5.2",
+ "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz",
+ "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac="
+ },
+ "fs.realpath": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
+ "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8="
+ },
+ "fsevents": {
+ "version": "2.3.2",
+ "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz",
+ "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==",
+ "dev": true,
+ "optional": true
+ },
+ "get-stream": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz",
+ "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==",
+ "dev": true,
+ "requires": {
+ "pump": "^3.0.0"
+ }
+ },
+ "glob": {
+ "version": "7.2.0",
+ "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz",
+ "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==",
+ "requires": {
+ "fs.realpath": "^1.0.0",
+ "inflight": "^1.0.4",
+ "inherits": "2",
+ "minimatch": "^3.0.4",
+ "once": "^1.3.0",
+ "path-is-absolute": "^1.0.0"
+ }
+ },
+ "glob-parent": {
+ "version": "5.1.2",
+ "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz",
+ "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==",
+ "dev": true,
+ "requires": {
+ "is-glob": "^4.0.1"
+ }
+ },
+ "global-dirs": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-3.0.0.tgz",
+ "integrity": "sha512-v8ho2DS5RiCjftj1nD9NmnfaOzTdud7RRnVd9kFNOjqZbISlx5DQ+OrTkywgd0dIt7oFCvKetZSHoHcP3sDdiA==",
+ "dev": true,
+ "requires": {
+ "ini": "2.0.0"
+ }
+ },
+ "got": {
+ "version": "9.6.0",
+ "resolved": "https://registry.npmjs.org/got/-/got-9.6.0.tgz",
+ "integrity": "sha512-R7eWptXuGYxwijs0eV+v3o6+XH1IqVK8dJOEecQfTmkncw9AV4dcw/Dhxi8MdlqPthxxpZyizMzyg8RTmEsG+Q==",
+ "dev": true,
+ "requires": {
+ "@sindresorhus/is": "^0.14.0",
+ "@szmarczak/http-timer": "^1.1.2",
+ "cacheable-request": "^6.0.0",
+ "decompress-response": "^3.3.0",
+ "duplexer3": "^0.1.4",
+ "get-stream": "^4.1.0",
+ "lowercase-keys": "^1.0.1",
+ "mimic-response": "^1.0.1",
+ "p-cancelable": "^1.0.0",
+ "to-readable-stream": "^1.0.0",
+ "url-parse-lax": "^3.0.0"
+ }
+ },
+ "graceful-fs": {
+ "version": "4.2.9",
+ "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.9.tgz",
+ "integrity": "sha512-NtNxqUcXgpW2iMrfqSfR73Glt39K+BLwWsPs94yR63v45T0Wbej7eRmL5cWfwEgqXnmjQp3zaJTshdRW/qC2ZQ==",
+ "dev": true
+ },
+ "handlebars": {
+ "version": "4.7.7",
+ "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.7.tgz",
+ "integrity": "sha512-aAcXm5OAfE/8IXkcZvCepKU3VzW1/39Fb5ZuqMtgI/hT8X2YgoMvBY5dLhq/cpOvw7Lk1nK/UF71aLG/ZnVYRA==",
+ "requires": {
+ "minimist": "^1.2.5",
+ "neo-async": "^2.6.0",
+ "source-map": "^0.6.1",
+ "uglify-js": "^3.1.4",
+ "wordwrap": "^1.0.0"
+ }
+ },
+ "has-binary2": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/has-binary2/-/has-binary2-1.0.3.tgz",
+ "integrity": "sha512-G1LWKhDSvhGeAQ8mPVQlqNcOB2sJdwATtZKl2pDKKHfpf/rYj24lkinxf69blJbnsvtqqNU+L3SL50vzZhXOnw==",
+ "requires": {
+ "isarray": "2.0.1"
+ }
+ },
+ "has-cors": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/has-cors/-/has-cors-1.1.0.tgz",
+ "integrity": "sha1-XkdHk/fqmEPRu5nCPu9J/xJv/zk="
+ },
+ "has-flag": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
+ "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=",
+ "dev": true
+ },
+ "has-yarn": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/has-yarn/-/has-yarn-2.1.0.tgz",
+ "integrity": "sha512-UqBRqi4ju7T+TqGNdqAO0PaSVGsDGJUBQvk9eUWNGRY1CFGDzYhLWoM7JQEemnlvVcv/YEmc2wNW8BC24EnUsw==",
+ "dev": true
+ },
+ "hashlru": {
+ "version": "2.3.0",
+ "resolved": "https://registry.npmjs.org/hashlru/-/hashlru-2.3.0.tgz",
+ "integrity": "sha512-0cMsjjIC8I+D3M44pOQdsy0OHXGLVz6Z0beRuufhKa0KfaD2wGwAev6jILzXsd3/vpnNQJmWyZtIILqM1N+n5A=="
+ },
+ "hexoid": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/hexoid/-/hexoid-1.0.0.tgz",
+ "integrity": "sha512-QFLV0taWQOZtvIRIAdBChesmogZrtuXvVWsFHZTk2SU+anspqZ2vMnoLg7IE1+Uk16N19APic1BuF8bC8c2m5g=="
+ },
+ "http-cache-semantics": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz",
+ "integrity": "sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ==",
+ "dev": true
+ },
+ "http-errors": {
+ "version": "1.8.1",
+ "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.8.1.tgz",
+ "integrity": "sha512-Kpk9Sm7NmI+RHhnj6OIWDI1d6fIoFAtFt9RLaTMRlg/8w49juAStsrBgp0Dp4OdxdVbRIeKhtCUvoi/RuAhO4g==",
+ "requires": {
+ "depd": "~1.1.2",
+ "inherits": "2.0.4",
+ "setprototypeof": "1.2.0",
+ "statuses": ">= 1.5.0 < 2",
+ "toidentifier": "1.0.1"
+ }
+ },
+ "http-proxy-agent": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz",
+ "integrity": "sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg==",
+ "requires": {
+ "@tootallnate/once": "1",
+ "agent-base": "6",
+ "debug": "4"
+ }
+ },
+ "ignore-by-default": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz",
+ "integrity": "sha1-SMptcvbGo68Aqa1K5odr44ieKwk=",
+ "dev": true
+ },
+ "import-lazy": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/import-lazy/-/import-lazy-2.1.0.tgz",
+ "integrity": "sha1-BWmOPUXIjo1+nZLLBYTnfwlvPkM=",
+ "dev": true
+ },
+ "imurmurhash": {
+ "version": "0.1.4",
+ "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz",
+ "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=",
+ "dev": true
+ },
+ "indexof": {
+ "version": "0.0.1",
+ "resolved": "https://registry.npmjs.org/indexof/-/indexof-0.0.1.tgz",
+ "integrity": "sha1-gtwzbSMrkGIXnQWrMpOmYFn9Q10="
+ },
+ "inflight": {
+ "version": "1.0.6",
+ "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
+ "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
+ "requires": {
+ "once": "^1.3.0",
+ "wrappy": "1"
+ }
+ },
+ "inherits": {
+ "version": "2.0.4",
+ "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
+ "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
+ },
+ "ini": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/ini/-/ini-2.0.0.tgz",
+ "integrity": "sha512-7PnF4oN3CvZF23ADhA5wRaYEQpJ8qygSkbtTXWBeXWXmEVRXK+1ITciHWwHhsjv1TmW0MgacIv6hEi5pX5NQdA==",
+ "dev": true
+ },
+ "ipaddr.js": {
+ "version": "1.9.1",
+ "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz",
+ "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g=="
+ },
+ "is-binary-path": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz",
+ "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==",
+ "dev": true,
+ "requires": {
+ "binary-extensions": "^2.0.0"
+ }
+ },
+ "is-ci": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-2.0.0.tgz",
+ "integrity": "sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w==",
+ "dev": true,
+ "requires": {
+ "ci-info": "^2.0.0"
+ }
+ },
+ "is-extglob": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz",
+ "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=",
+ "dev": true
+ },
+ "is-fullwidth-code-point": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
+ "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==",
+ "dev": true
+ },
+ "is-glob": {
+ "version": "4.0.3",
+ "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz",
+ "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==",
+ "dev": true,
+ "requires": {
+ "is-extglob": "^2.1.1"
+ }
+ },
+ "is-installed-globally": {
+ "version": "0.4.0",
+ "resolved": "https://registry.npmjs.org/is-installed-globally/-/is-installed-globally-0.4.0.tgz",
+ "integrity": "sha512-iwGqO3J21aaSkC7jWnHP/difazwS7SFeIqxv6wEtLU8Y5KlzFTjyqcSIT0d8s4+dDhKytsk9PJZ2BkS5eZwQRQ==",
+ "dev": true,
+ "requires": {
+ "global-dirs": "^3.0.0",
+ "is-path-inside": "^3.0.2"
+ }
+ },
+ "is-npm": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/is-npm/-/is-npm-5.0.0.tgz",
+ "integrity": "sha512-WW/rQLOazUq+ST/bCAVBp/2oMERWLsR7OrKyt052dNDk4DHcDE0/7QSXITlmi+VBcV13DfIbysG3tZJm5RfdBA==",
+ "dev": true
+ },
+ "is-number": {
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz",
+ "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==",
+ "dev": true
+ },
+ "is-obj": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz",
+ "integrity": "sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==",
+ "dev": true
+ },
+ "is-path-inside": {
+ "version": "3.0.3",
+ "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz",
+ "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==",
+ "dev": true
+ },
+ "is-typedarray": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz",
+ "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=",
+ "dev": true
+ },
+ "is-yarn-global": {
+ "version": "0.3.0",
+ "resolved": "https://registry.npmjs.org/is-yarn-global/-/is-yarn-global-0.3.0.tgz",
+ "integrity": "sha512-VjSeb/lHmkoyd8ryPVIKvOCn4D1koMqY+vqyjjUfc3xyKtP4dYOxM44sZrnqQSzSds3xyOrUTLTC9LVCVgLngw==",
+ "dev": true
+ },
+ "isarray": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.1.tgz",
+ "integrity": "sha1-o32U7ZzaLVmGXJ92/llu4fM4dB4="
+ },
+ "isexe": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
+ "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA="
+ },
+ "json-buffer": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.0.tgz",
+ "integrity": "sha1-Wx85evx11ne96Lz8Dkfh+aPZqJg=",
+ "dev": true
+ },
+ "json-schema-traverse": {
+ "version": "0.4.1",
+ "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz",
+ "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg=="
+ },
+ "keyv": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/keyv/-/keyv-3.1.0.tgz",
+ "integrity": "sha512-9ykJ/46SN/9KPM/sichzQ7OvXyGDYKGTaDlKMGCAlg2UK8KRy4jb0d8sFc+0Tt0YYnThq8X2RZgCg74RPxgcVA==",
+ "dev": true,
+ "requires": {
+ "json-buffer": "3.0.0"
+ }
+ },
+ "latest-version": {
+ "version": "5.1.0",
+ "resolved": "https://registry.npmjs.org/latest-version/-/latest-version-5.1.0.tgz",
+ "integrity": "sha512-weT+r0kTkRQdCdYCNtkMwWXQTMEswKrFBkm4ckQOMVhhqhIMI1UT2hMj+1iigIhgSZm5gTmrRXBNoGUgaTY1xA==",
+ "dev": true,
+ "requires": {
+ "package-json": "^6.3.0"
+ }
+ },
+ "light-my-request": {
+ "version": "4.7.0",
+ "resolved": "https://registry.npmjs.org/light-my-request/-/light-my-request-4.7.0.tgz",
+ "integrity": "sha512-LTa8YZp3K2AUpqUnwwKajoIHcsKOBnzwJNQSrk7unziPwo6CjOYjyO0F9wfkxFvP+nBsCGe3eMPnedVgIIgdAw==",
+ "requires": {
+ "ajv": "^8.1.0",
+ "cookie": "^0.4.0",
+ "fastify-warning": "^0.2.0",
+ "set-cookie-parser": "^2.4.1"
+ },
+ "dependencies": {
+ "ajv": {
+ "version": "8.8.2",
+ "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.8.2.tgz",
+ "integrity": "sha512-x9VuX+R/jcFj1DHo/fCp99esgGDWiHENrKxaCENuCxpoMCmAt/COCGVDwA7kleEpEzJjDnvh3yGoOuLu0Dtllw==",
+ "requires": {
+ "fast-deep-equal": "^3.1.1",
+ "json-schema-traverse": "^1.0.0",
+ "require-from-string": "^2.0.2",
+ "uri-js": "^4.2.2"
+ }
+ },
+ "json-schema-traverse": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz",
+ "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug=="
+ }
+ }
+ },
+ "lowercase-keys": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.1.tgz",
+ "integrity": "sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA==",
+ "dev": true
+ },
+ "lru-cache": {
+ "version": "6.0.0",
+ "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz",
+ "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==",
+ "requires": {
+ "yallist": "^4.0.0"
+ }
+ },
+ "make-dir": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz",
+ "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==",
+ "dev": true,
+ "requires": {
+ "semver": "^6.0.0"
+ },
+ "dependencies": {
+ "semver": {
+ "version": "6.3.0",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz",
+ "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==",
+ "dev": true
+ }
+ }
+ },
+ "mime": {
+ "version": "1.6.0",
+ "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz",
+ "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg=="
+ },
+ "mime-db": {
+ "version": "1.51.0",
+ "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.51.0.tgz",
+ "integrity": "sha512-5y8A56jg7XVQx2mbv1lu49NR4dokRnhZYTtL+KGfaa27uq4pSTXkwQkFJl4pkRMyNFz/EtYDSkiiEHx3F7UN6g=="
+ },
+ "mime-types": {
+ "version": "2.1.34",
+ "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.34.tgz",
+ "integrity": "sha512-6cP692WwGIs9XXdOO4++N+7qjqv0rqxxVvJ3VHPh/Sc9mVZcQP+ZGhkKiTvWMQRr2tbHkJP/Yn7Y0npb3ZBs4A==",
+ "requires": {
+ "mime-db": "1.51.0"
+ }
+ },
+ "mimic-response": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz",
+ "integrity": "sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==",
+ "dev": true
+ },
+ "minimatch": {
+ "version": "3.0.4",
+ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
+ "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
+ "requires": {
+ "brace-expansion": "^1.1.7"
+ }
+ },
+ "minimist": {
+ "version": "1.2.5",
+ "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz",
+ "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw=="
+ },
+ "moment": {
+ "version": "2.29.1",
+ "resolved": "https://registry.npmjs.org/moment/-/moment-2.29.1.tgz",
+ "integrity": "sha512-kHmoybcPV8Sqy59DwNDY3Jefr64lK/by/da0ViFcuA4DH0vQg5Q6Ze5VimxkfQNSC+Mls/Kx53s7TjP1RhFEDQ=="
+ },
+ "moment-timezone": {
+ "version": "0.5.34",
+ "resolved": "https://registry.npmjs.org/moment-timezone/-/moment-timezone-0.5.34.tgz",
+ "integrity": "sha512-3zAEHh2hKUs3EXLESx/wsgw6IQdusOT8Bxm3D9UrHPQR7zlMmzwybC8zHEM1tQ4LJwP7fcxrWr8tuBg05fFCbg==",
+ "requires": {
+ "moment": ">= 2.9.0"
+ }
+ },
+ "ms": {
+ "version": "2.1.2",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
+ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="
+ },
+ "negotiator": {
+ "version": "0.6.2",
+ "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz",
+ "integrity": "sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw=="
+ },
+ "neo-async": {
+ "version": "2.6.2",
+ "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz",
+ "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw=="
+ },
+ "nextcloud-node-client": {
+ "version": "1.8.2",
+ "resolved": "https://registry.npmjs.org/nextcloud-node-client/-/nextcloud-node-client-1.8.2.tgz",
+ "integrity": "sha512-zbU8pUBXK4wPniq1WY8VBzak5YaODiYQu44l4u7tUx+mG5irHZWD4jQeB4CCrrOfDuJF1Wtu/LzcERs8NDkAGQ==",
+ "requires": {
+ "debug": "^4.1.0",
+ "dotenv": "^8.2.0",
+ "fast-xml-parser": "^3.16.0",
+ "http-proxy-agent": "^4.0.1",
+ "node-fetch": "^2.6.0",
+ "tslog": "^2.6.2",
+ "vcap_services": "^0.7.1"
+ },
+ "dependencies": {
+ "dotenv": {
+ "version": "8.6.0",
+ "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-8.6.0.tgz",
+ "integrity": "sha512-IrPdXQsk2BbzvCBGBOTmmSH5SodmqZNt4ERAZDmW4CT+tL8VtvinqywuANaFu4bOMWki16nqf0e4oC0QIaDr/g=="
+ }
+ }
+ },
+ "node-fetch": {
+ "version": "2.6.6",
+ "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.6.tgz",
+ "integrity": "sha512-Z8/6vRlTUChSdIgMa51jxQ4lrw/Jy5SOW10ObaA47/RElsAN2c5Pn8bTgFGWn/ibwzXTE8qwr1Yzx28vsecXEA==",
+ "requires": {
+ "whatwg-url": "^5.0.0"
+ }
+ },
+ "nodemon": {
+ "version": "2.0.15",
+ "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-2.0.15.tgz",
+ "integrity": "sha512-gdHMNx47Gw7b3kWxJV64NI+Q5nfl0y5DgDbiVtShiwa7Z0IZ07Ll4RLFo6AjrhzMtoEZn5PDE3/c2AbVsiCkpA==",
+ "dev": true,
+ "requires": {
+ "chokidar": "^3.5.2",
+ "debug": "^3.2.7",
+ "ignore-by-default": "^1.0.1",
+ "minimatch": "^3.0.4",
+ "pstree.remy": "^1.1.8",
+ "semver": "^5.7.1",
+ "supports-color": "^5.5.0",
+ "touch": "^3.1.0",
+ "undefsafe": "^2.0.5",
+ "update-notifier": "^5.1.0"
+ },
+ "dependencies": {
+ "debug": {
+ "version": "3.2.7",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz",
+ "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==",
+ "dev": true,
+ "requires": {
+ "ms": "^2.1.1"
+ }
+ },
+ "semver": {
+ "version": "5.7.1",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz",
+ "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==",
+ "dev": true
+ }
+ }
+ },
+ "nopt": {
+ "version": "1.0.10",
+ "resolved": "https://registry.npmjs.org/nopt/-/nopt-1.0.10.tgz",
+ "integrity": "sha1-bd0hvSoxQXuScn3Vhfim83YI6+4=",
+ "dev": true,
+ "requires": {
+ "abbrev": "1"
+ }
+ },
+ "normalize-path": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz",
+ "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==",
+ "dev": true
+ },
+ "normalize-url": {
+ "version": "4.5.1",
+ "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-4.5.1.tgz",
+ "integrity": "sha512-9UZCFRHQdNrfTpGg8+1INIg93B6zE0aXMVFkw1WFwvO4SlZywU6aLg5Of0Ap/PgcbSw4LNxvMWXMeugwMCX0AA==",
+ "dev": true
+ },
+ "object-component": {
+ "version": "0.0.3",
+ "resolved": "https://registry.npmjs.org/object-component/-/object-component-0.0.3.tgz",
+ "integrity": "sha1-8MaapQ78lbhmwYb0AKM3acsvEpE="
+ },
+ "on-finished": {
+ "version": "2.3.0",
+ "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz",
+ "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=",
+ "requires": {
+ "ee-first": "1.1.1"
+ }
+ },
+ "once": {
+ "version": "1.4.0",
+ "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
+ "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
+ "requires": {
+ "wrappy": "1"
+ }
+ },
+ "p-cancelable": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-1.1.0.tgz",
+ "integrity": "sha512-s73XxOZ4zpt1edZYZzvhqFa6uvQc1vwUa0K0BdtIZgQMAJj9IbebH+JkgKZc9h+B05PKHLOTl4ajG1BmNrVZlw==",
+ "dev": true
+ },
+ "p-limit": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz",
+ "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==",
+ "requires": {
+ "yocto-queue": "^0.1.0"
+ }
+ },
+ "package-json": {
+ "version": "6.5.0",
+ "resolved": "https://registry.npmjs.org/package-json/-/package-json-6.5.0.tgz",
+ "integrity": "sha512-k3bdm2n25tkyxcjSKzB5x8kfVxlMdgsbPr0GkZcwHsLpba6cBjqCt1KlcChKEvxHIcTB1FVMuwoijZ26xex5MQ==",
+ "dev": true,
+ "requires": {
+ "got": "^9.6.0",
+ "registry-auth-token": "^4.0.0",
+ "registry-url": "^5.0.0",
+ "semver": "^6.2.0"
+ },
+ "dependencies": {
+ "semver": {
+ "version": "6.3.0",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz",
+ "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==",
+ "dev": true
+ }
+ }
+ },
+ "parseqs": {
+ "version": "0.0.5",
+ "resolved": "https://registry.npmjs.org/parseqs/-/parseqs-0.0.5.tgz",
+ "integrity": "sha1-1SCKNzjkZ2bikbouoXNoSSGouJ0=",
+ "requires": {
+ "better-assert": "~1.0.0"
+ }
+ },
+ "parseuri": {
+ "version": "0.0.5",
+ "resolved": "https://registry.npmjs.org/parseuri/-/parseuri-0.0.5.tgz",
+ "integrity": "sha1-gCBKUNTbt3m/3G6+J3jZDkvOMgo=",
+ "requires": {
+ "better-assert": "~1.0.0"
+ }
+ },
+ "path-is-absolute": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
+ "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18="
+ },
+ "picomatch": {
+ "version": "2.3.1",
+ "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz",
+ "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==",
+ "dev": true
+ },
+ "pino": {
+ "version": "6.13.4",
+ "resolved": "https://registry.npmjs.org/pino/-/pino-6.13.4.tgz",
+ "integrity": "sha512-g4tHSISmQJYUEKEMVdaZ+ZokWwFnTwZL5JPn+lnBVZ1BuBbrSchrXwQINknkM5+Q4fF6U9NjiI8PWwwMDHt9zA==",
+ "requires": {
+ "fast-redact": "^3.0.0",
+ "fast-safe-stringify": "^2.0.8",
+ "flatstr": "^1.0.12",
+ "pino-std-serializers": "^3.1.0",
+ "process-warning": "^1.0.0",
+ "quick-format-unescaped": "^4.0.3",
+ "sonic-boom": "^1.0.2"
+ }
+ },
+ "pino-std-serializers": {
+ "version": "3.2.0",
+ "resolved": "https://registry.npmjs.org/pino-std-serializers/-/pino-std-serializers-3.2.0.tgz",
+ "integrity": "sha512-EqX4pwDPrt3MuOAAUBMU0Tk5kR/YcCM5fNPEzgCO2zJ5HfX0vbiH9HbJglnyeQsN96Kznae6MWD47pZB5avTrg=="
+ },
+ "point-of-view": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/point-of-view/-/point-of-view-5.0.0.tgz",
+ "integrity": "sha512-JY12G3+jVFYccKTexe2OHG9WHrEUb3eLKPtLM/YEnaJf2i2OuzIun/v6SBzjHFm5sOuNXyKKo47HIe/YkGtEMA==",
+ "requires": {
+ "fastify-plugin": "^3.0.0",
+ "hashlru": "^2.3.0"
+ }
+ },
+ "prepend-http": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-2.0.0.tgz",
+ "integrity": "sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc=",
+ "dev": true
+ },
+ "process-warning": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/process-warning/-/process-warning-1.0.0.tgz",
+ "integrity": "sha512-du4wfLyj4yCZq1VupnVSZmRsPJsNuxoDQFdCFHLaYiEbFBD7QE0a+I4D7hOxrVnh78QE/YipFAj9lXHiXocV+Q=="
+ },
+ "proxy-addr": {
+ "version": "2.0.7",
+ "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz",
+ "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==",
+ "requires": {
+ "forwarded": "0.2.0",
+ "ipaddr.js": "1.9.1"
+ }
+ },
+ "pstree.remy": {
+ "version": "1.1.8",
+ "resolved": "https://registry.npmjs.org/pstree.remy/-/pstree.remy-1.1.8.tgz",
+ "integrity": "sha512-77DZwxQmxKnu3aR542U+X8FypNzbfJ+C5XQDk3uWjWxn6151aIMGthWYRXTqT1E5oJvg+ljaa2OJi+VfvCOQ8w==",
+ "dev": true
+ },
+ "pump": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz",
+ "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==",
+ "dev": true,
+ "requires": {
+ "end-of-stream": "^1.1.0",
+ "once": "^1.3.1"
+ }
+ },
+ "punycode": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz",
+ "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A=="
+ },
+ "pupa": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/pupa/-/pupa-2.1.1.tgz",
+ "integrity": "sha512-l1jNAspIBSFqbT+y+5FosojNpVpF94nlI+wDUpqP9enwOTfHx9f0gh5nB96vl+6yTpsJsypeNrwfzPrKuHB41A==",
+ "dev": true,
+ "requires": {
+ "escape-goat": "^2.0.0"
+ }
+ },
+ "queue-microtask": {
+ "version": "1.2.3",
+ "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz",
+ "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A=="
+ },
+ "quick-format-unescaped": {
+ "version": "4.0.4",
+ "resolved": "https://registry.npmjs.org/quick-format-unescaped/-/quick-format-unescaped-4.0.4.tgz",
+ "integrity": "sha512-tYC1Q1hgyRuHgloV/YXs2w15unPVh8qfu/qCTfhTYamaw7fyhumKa2yGpdSo87vY32rIclj+4fWYQXUMs9EHvg=="
+ },
+ "range-parser": {
+ "version": "1.2.1",
+ "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz",
+ "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg=="
+ },
+ "rc": {
+ "version": "1.2.8",
+ "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz",
+ "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==",
+ "dev": true,
+ "requires": {
+ "deep-extend": "^0.6.0",
+ "ini": "~1.3.0",
+ "minimist": "^1.2.0",
+ "strip-json-comments": "~2.0.1"
+ },
+ "dependencies": {
+ "ini": {
+ "version": "1.3.8",
+ "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz",
+ "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==",
+ "dev": true
+ }
+ }
+ },
+ "readable-stream": {
+ "version": "3.6.0",
+ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz",
+ "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==",
+ "requires": {
+ "inherits": "^2.0.3",
+ "string_decoder": "^1.1.1",
+ "util-deprecate": "^1.0.1"
+ }
+ },
+ "readdirp": {
+ "version": "3.6.0",
+ "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz",
+ "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==",
+ "dev": true,
+ "requires": {
+ "picomatch": "^2.2.1"
+ }
+ },
+ "registry-auth-token": {
+ "version": "4.2.1",
+ "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-4.2.1.tgz",
+ "integrity": "sha512-6gkSb4U6aWJB4SF2ZvLb76yCBjcvufXBqvvEx1HbmKPkutswjW1xNVRY0+daljIYRbogN7O0etYSlbiaEQyMyw==",
+ "dev": true,
+ "requires": {
+ "rc": "^1.2.8"
+ }
+ },
+ "registry-url": {
+ "version": "5.1.0",
+ "resolved": "https://registry.npmjs.org/registry-url/-/registry-url-5.1.0.tgz",
+ "integrity": "sha512-8acYXXTI0AkQv6RAOjE3vOaIXZkT9wo4LOFbBKYQEEnnMNBpKqdUrI6S4NT0KPIo/WVvJ5tE/X5LF/TQUf0ekw==",
+ "dev": true,
+ "requires": {
+ "rc": "^1.2.8"
+ }
+ },
+ "require-from-string": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz",
+ "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw=="
+ },
+ "responselike": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/responselike/-/responselike-1.0.2.tgz",
+ "integrity": "sha1-kYcg7ztjHFZCvgaPFa3lpG9Loec=",
+ "dev": true,
+ "requires": {
+ "lowercase-keys": "^1.0.0"
+ }
+ },
+ "ret": {
+ "version": "0.2.2",
+ "resolved": "https://registry.npmjs.org/ret/-/ret-0.2.2.tgz",
+ "integrity": "sha512-M0b3YWQs7R3Z917WRQy1HHA7Ba7D8hvZg6UE5mLykJxQVE2ju0IXbGlaHPPlkY+WN7wFP+wUMXmBFA0aV6vYGQ=="
+ },
+ "reusify": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz",
+ "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw=="
+ },
+ "rfdc": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.3.0.tgz",
+ "integrity": "sha512-V2hovdzFbOi77/WajaSMXk2OLm+xNIeQdMMuB7icj7bk6zi2F8GGAxigcnDFpJHbNyNcgyJDiP+8nOrY5cZGrA=="
+ },
+ "safe-buffer": {
+ "version": "5.2.1",
+ "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
+ "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ=="
+ },
+ "safe-regex2": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/safe-regex2/-/safe-regex2-2.0.0.tgz",
+ "integrity": "sha512-PaUSFsUaNNuKwkBijoAPHAK6/eM6VirvyPWlZ7BAQy4D+hCvh4B6lIG+nPdhbFfIbP+gTGBcrdsOaUs0F+ZBOQ==",
+ "requires": {
+ "ret": "~0.2.0"
+ }
+ },
+ "secure-json-parse": {
+ "version": "2.4.0",
+ "resolved": "https://registry.npmjs.org/secure-json-parse/-/secure-json-parse-2.4.0.tgz",
+ "integrity": "sha512-Q5Z/97nbON5t/L/sH6mY2EacfjVGwrCcSi5D3btRO2GZ8pf1K1UN7Z9H5J57hjVU2Qzxr1xO+FmBhOvEkzCMmg=="
+ },
+ "semver": {
+ "version": "7.3.5",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz",
+ "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==",
+ "requires": {
+ "lru-cache": "^6.0.0"
+ }
+ },
+ "semver-diff": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/semver-diff/-/semver-diff-3.1.1.tgz",
+ "integrity": "sha512-GX0Ix/CJcHyB8c4ykpHGIAvLyOwOobtM/8d+TQkAd81/bEjgPHrfba41Vpesr7jX/t8Uh+R3EX9eAS5be+jQYg==",
+ "dev": true,
+ "requires": {
+ "semver": "^6.3.0"
+ },
+ "dependencies": {
+ "semver": {
+ "version": "6.3.0",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz",
+ "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==",
+ "dev": true
+ }
+ }
+ },
+ "semver-store": {
+ "version": "0.3.0",
+ "resolved": "https://registry.npmjs.org/semver-store/-/semver-store-0.3.0.tgz",
+ "integrity": "sha512-TcZvGMMy9vodEFSse30lWinkj+JgOBvPn8wRItpQRSayhc+4ssDs335uklkfvQQJgL/WvmHLVj4Ycv2s7QCQMg=="
+ },
+ "send": {
+ "version": "0.17.2",
+ "resolved": "https://registry.npmjs.org/send/-/send-0.17.2.tgz",
+ "integrity": "sha512-UJYB6wFSJE3G00nEivR5rgWp8c2xXvJ3OPWPhmuteU0IKj8nKbG3DrjiOmLwpnHGYWAVwA69zmTm++YG0Hmwww==",
+ "requires": {
+ "debug": "2.6.9",
+ "depd": "~1.1.2",
+ "destroy": "~1.0.4",
+ "encodeurl": "~1.0.2",
+ "escape-html": "~1.0.3",
+ "etag": "~1.8.1",
+ "fresh": "0.5.2",
+ "http-errors": "1.8.1",
+ "mime": "1.6.0",
+ "ms": "2.1.3",
+ "on-finished": "~2.3.0",
+ "range-parser": "~1.2.1",
+ "statuses": "~1.5.0"
+ },
+ "dependencies": {
+ "debug": {
+ "version": "2.6.9",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
+ "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
+ "requires": {
+ "ms": "2.0.0"
+ },
+ "dependencies": {
+ "ms": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
+ "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g="
+ }
+ }
+ },
+ "ms": {
+ "version": "2.1.3",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
+ "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA=="
+ }
+ }
+ },
+ "set-cookie-parser": {
+ "version": "2.4.8",
+ "resolved": "https://registry.npmjs.org/set-cookie-parser/-/set-cookie-parser-2.4.8.tgz",
+ "integrity": "sha512-edRH8mBKEWNVIVMKejNnuJxleqYE/ZSdcT8/Nem9/mmosx12pctd80s2Oy00KNZzrogMZS5mauK2/ymL1bvlvg=="
+ },
+ "setprototypeof": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz",
+ "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw=="
+ },
+ "signal-exit": {
+ "version": "3.0.6",
+ "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.6.tgz",
+ "integrity": "sha512-sDl4qMFpijcGw22U5w63KmD3cZJfBuFlVNbVMKje2keoKML7X2UzWbc4XrmEbDwg0NXJc3yv4/ox7b+JWb57kQ==",
+ "dev": true
+ },
+ "socket.io": {
+ "version": "2.3.0",
+ "resolved": "https://registry.npmjs.org/socket.io/-/socket.io-2.3.0.tgz",
+ "integrity": "sha512-2A892lrj0GcgR/9Qk81EaY2gYhCBxurV0PfmmESO6p27QPrUK1J3zdns+5QPqvUYK2q657nSj0guoIil9+7eFg==",
+ "requires": {
+ "debug": "~4.1.0",
+ "engine.io": "~3.4.0",
+ "has-binary2": "~1.0.2",
+ "socket.io-adapter": "~1.1.0",
+ "socket.io-client": "2.3.0",
+ "socket.io-parser": "~3.4.0"
+ },
+ "dependencies": {
+ "debug": {
+ "version": "4.1.1",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz",
+ "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==",
+ "requires": {
+ "ms": "^2.1.1"
+ }
+ }
+ }
+ },
+ "socket.io-adapter": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/socket.io-adapter/-/socket.io-adapter-1.1.2.tgz",
+ "integrity": "sha512-WzZRUj1kUjrTIrUKpZLEzFZ1OLj5FwLlAFQs9kuZJzJi5DKdU7FsWc36SNmA8iDOtwBQyT8FkrriRM8vXLYz8g=="
+ },
+ "socket.io-client": {
+ "version": "2.3.0",
+ "resolved": "https://registry.npmjs.org/socket.io-client/-/socket.io-client-2.3.0.tgz",
+ "integrity": "sha512-cEQQf24gET3rfhxZ2jJ5xzAOo/xhZwK+mOqtGRg5IowZsMgwvHwnf/mCRapAAkadhM26y+iydgwsXGObBB5ZdA==",
+ "requires": {
+ "backo2": "1.0.2",
+ "base64-arraybuffer": "0.1.5",
+ "component-bind": "1.0.0",
+ "component-emitter": "1.2.1",
+ "debug": "~4.1.0",
+ "engine.io-client": "~3.4.0",
+ "has-binary2": "~1.0.2",
+ "has-cors": "1.1.0",
+ "indexof": "0.0.1",
+ "object-component": "0.0.3",
+ "parseqs": "0.0.5",
+ "parseuri": "0.0.5",
+ "socket.io-parser": "~3.3.0",
+ "to-array": "0.1.4"
+ },
+ "dependencies": {
+ "base64-arraybuffer": {
+ "version": "0.1.5",
+ "resolved": "https://registry.npmjs.org/base64-arraybuffer/-/base64-arraybuffer-0.1.5.tgz",
+ "integrity": "sha1-c5JncZI7Whl0etZmqlzUv5xunOg="
+ },
+ "debug": {
+ "version": "4.1.1",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz",
+ "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==",
+ "requires": {
+ "ms": "^2.1.1"
+ }
+ },
+ "socket.io-parser": {
+ "version": "3.3.2",
+ "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-3.3.2.tgz",
+ "integrity": "sha512-FJvDBuOALxdCI9qwRrO/Rfp9yfndRtc1jSgVgV8FDraihmSP/MLGD5PEuJrNfjALvcQ+vMDM/33AWOYP/JSjDg==",
+ "requires": {
+ "component-emitter": "~1.3.0",
+ "debug": "~3.1.0",
+ "isarray": "2.0.1"
+ },
+ "dependencies": {
+ "component-emitter": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz",
+ "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg=="
+ },
+ "debug": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz",
+ "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==",
+ "requires": {
+ "ms": "2.0.0"
+ }
+ },
+ "ms": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
+ "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g="
+ }
+ }
+ }
+ }
+ },
+ "socket.io-parser": {
+ "version": "3.4.1",
+ "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-3.4.1.tgz",
+ "integrity": "sha512-11hMgzL+WCLWf1uFtHSNvliI++tcRUWdoeYuwIl+Axvwy9z2gQM+7nJyN3STj1tLj5JyIUH8/gpDGxzAlDdi0A==",
+ "requires": {
+ "component-emitter": "1.2.1",
+ "debug": "~4.1.0",
+ "isarray": "2.0.1"
+ },
+ "dependencies": {
+ "debug": {
+ "version": "4.1.1",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz",
+ "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==",
+ "requires": {
+ "ms": "^2.1.1"
+ }
+ }
+ }
+ },
+ "sonic-boom": {
+ "version": "1.4.1",
+ "resolved": "https://registry.npmjs.org/sonic-boom/-/sonic-boom-1.4.1.tgz",
+ "integrity": "sha512-LRHh/A8tpW7ru89lrlkU4AszXt1dbwSjVWguGrmlxE7tawVmDBlI1PILMkXAxJTwqhgsEeTHzj36D5CmHgQmNg==",
+ "requires": {
+ "atomic-sleep": "^1.0.0",
+ "flatstr": "^1.0.12"
+ }
+ },
+ "source-map": {
+ "version": "0.6.1",
+ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
+ "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g=="
+ },
+ "source-map-support": {
+ "version": "0.5.21",
+ "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz",
+ "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==",
+ "requires": {
+ "buffer-from": "^1.0.0",
+ "source-map": "^0.6.0"
+ }
+ },
+ "statuses": {
+ "version": "1.5.0",
+ "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz",
+ "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow="
+ },
+ "stream-wormhole": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/stream-wormhole/-/stream-wormhole-1.1.0.tgz",
+ "integrity": "sha512-gHFfL3px0Kctd6Po0M8TzEvt3De/xu6cnRrjlfYNhwbhLPLwigI2t1nc6jrzNuaYg5C4YF78PPFuQPzRiqn9ew=="
+ },
+ "string-similarity": {
+ "version": "4.0.4",
+ "resolved": "https://registry.npmjs.org/string-similarity/-/string-similarity-4.0.4.tgz",
+ "integrity": "sha512-/q/8Q4Bl4ZKAPjj8WerIBJWALKkaPRfrvhfF8k/B23i4nzrlRj2/go1m90In7nG/3XDSbOo0+pu6RvCTM9RGMQ=="
+ },
+ "string-width": {
+ "version": "4.2.3",
+ "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",
+ "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
+ "dev": true,
+ "requires": {
+ "emoji-regex": "^8.0.0",
+ "is-fullwidth-code-point": "^3.0.0",
+ "strip-ansi": "^6.0.1"
+ }
+ },
+ "string_decoder": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz",
+ "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==",
+ "requires": {
+ "safe-buffer": "~5.2.0"
+ }
+ },
+ "strip-ansi": {
+ "version": "6.0.1",
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
+ "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
+ "dev": true,
+ "requires": {
+ "ansi-regex": "^5.0.1"
+ }
+ },
+ "strip-json-comments": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz",
+ "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=",
+ "dev": true
+ },
+ "strnum": {
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/strnum/-/strnum-1.0.5.tgz",
+ "integrity": "sha512-J8bbNyKKXl5qYcR36TIO8W3mVGVHrmmxsd5PAItGkmyzwJvybiw2IVq5nqd0i4LSNSkB/sx9VHllbfFdr9k1JA=="
+ },
+ "supports-color": {
+ "version": "5.5.0",
+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
+ "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==",
+ "dev": true,
+ "requires": {
+ "has-flag": "^3.0.0"
+ }
+ },
+ "text-decoding": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/text-decoding/-/text-decoding-1.0.0.tgz",
+ "integrity": "sha512-/0TJD42KDnVwKmDK6jj3xP7E2MG7SHAOG4tyTgyUCRPdHwvkquYNLEQltmdMa3owq3TkddCVcTsoctJI8VQNKA=="
+ },
+ "tiny-lru": {
+ "version": "7.0.6",
+ "resolved": "https://registry.npmjs.org/tiny-lru/-/tiny-lru-7.0.6.tgz",
+ "integrity": "sha512-zNYO0Kvgn5rXzWpL0y3RS09sMK67eGaQj9805jlK9G6pSadfriTczzLHFXa/xcW4mIRfmlB9HyQ/+SgL0V1uow=="
+ },
+ "to-array": {
+ "version": "0.1.4",
+ "resolved": "https://registry.npmjs.org/to-array/-/to-array-0.1.4.tgz",
+ "integrity": "sha1-F+bBH3PdTz10zaek/zI46a2b+JA="
+ },
+ "to-readable-stream": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/to-readable-stream/-/to-readable-stream-1.0.0.tgz",
+ "integrity": "sha512-Iq25XBt6zD5npPhlLVXGFN3/gyR2/qODcKNNyTMd4vbm39HUaOiAM4PMq0eMVC/Tkxz+Zjdsc55g9yyz+Yq00Q==",
+ "dev": true
+ },
+ "to-regex-range": {
+ "version": "5.0.1",
+ "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
+ "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==",
+ "dev": true,
+ "requires": {
+ "is-number": "^7.0.0"
+ }
+ },
+ "toidentifier": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz",
+ "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA=="
+ },
+ "touch": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/touch/-/touch-3.1.0.tgz",
+ "integrity": "sha512-WBx8Uy5TLtOSRtIq+M03/sKDrXCLHxwDcquSP2c43Le03/9serjQBIztjRz6FkJez9D/hleyAXTBGLwwZUw9lA==",
+ "dev": true,
+ "requires": {
+ "nopt": "~1.0.10"
+ }
+ },
+ "tr46": {
+ "version": "0.0.3",
+ "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz",
+ "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o="
+ },
+ "tslog": {
+ "version": "2.12.0",
+ "resolved": "https://registry.npmjs.org/tslog/-/tslog-2.12.0.tgz",
+ "integrity": "sha512-I6XnHbYzBY4K/NZw/DwRKabXMGx1wB4TdoMfrV3+ugfntGVUY7qmOsIb36tf4kuySuKBchxIRSX126niyvsnYg==",
+ "requires": {
+ "source-map-support": "^0.5.19"
+ }
+ },
+ "type-fest": {
+ "version": "0.20.2",
+ "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz",
+ "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==",
+ "dev": true
+ },
+ "typedarray-to-buffer": {
+ "version": "3.1.5",
+ "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz",
+ "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==",
+ "dev": true,
+ "requires": {
+ "is-typedarray": "^1.0.0"
+ }
+ },
+ "uglify-js": {
+ "version": "3.14.5",
+ "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.14.5.tgz",
+ "integrity": "sha512-qZukoSxOG0urUTvjc2ERMTcAy+BiFh3weWAkeurLwjrCba73poHmG3E36XEjd/JGukMzwTL7uCxZiAexj8ppvQ==",
+ "optional": true
+ },
+ "undefsafe": {
+ "version": "2.0.5",
+ "resolved": "https://registry.npmjs.org/undefsafe/-/undefsafe-2.0.5.tgz",
+ "integrity": "sha512-WxONCrssBM8TSPRqN5EmsjVrsv4A8X12J4ArBiiayv3DyyG3ZlIg6yysuuSYdZsVz3TKcTg2fd//Ujd4CHV1iA==",
+ "dev": true
+ },
+ "unique-string": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/unique-string/-/unique-string-2.0.0.tgz",
+ "integrity": "sha512-uNaeirEPvpZWSgzwsPGtU2zVSTrn/8L5q/IexZmH0eH6SA73CmAA5U4GwORTxQAZs95TAXLNqeLoPPNO5gZfWg==",
+ "dev": true,
+ "requires": {
+ "crypto-random-string": "^2.0.0"
+ }
+ },
+ "update-notifier": {
+ "version": "5.1.0",
+ "resolved": "https://registry.npmjs.org/update-notifier/-/update-notifier-5.1.0.tgz",
+ "integrity": "sha512-ItnICHbeMh9GqUy31hFPrD1kcuZ3rpxDZbf4KUDavXwS0bW5m7SLbDQpGX3UYr072cbrF5hFUs3r5tUsPwjfHw==",
+ "dev": true,
+ "requires": {
+ "boxen": "^5.0.0",
+ "chalk": "^4.1.0",
+ "configstore": "^5.0.1",
+ "has-yarn": "^2.1.0",
+ "import-lazy": "^2.1.0",
+ "is-ci": "^2.0.0",
+ "is-installed-globally": "^0.4.0",
+ "is-npm": "^5.0.0",
+ "is-yarn-global": "^0.3.0",
+ "latest-version": "^5.1.0",
+ "pupa": "^2.1.1",
+ "semver": "^7.3.4",
+ "semver-diff": "^3.1.1",
+ "xdg-basedir": "^4.0.0"
+ }
+ },
+ "uri-js": {
+ "version": "4.4.1",
+ "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz",
+ "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==",
+ "requires": {
+ "punycode": "^2.1.0"
+ }
+ },
+ "url-parse-lax": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-3.0.0.tgz",
+ "integrity": "sha1-FrXK/Afb42dsGxmZF3gj1lA6yww=",
+ "dev": true,
+ "requires": {
+ "prepend-http": "^2.0.0"
+ }
+ },
+ "util-deprecate": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
+ "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8="
+ },
+ "uuid": {
+ "version": "8.3.2",
+ "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz",
+ "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg=="
+ },
+ "vcap_services": {
+ "version": "0.7.1",
+ "resolved": "https://registry.npmjs.org/vcap_services/-/vcap_services-0.7.1.tgz",
+ "integrity": "sha512-Xo9lMYbQKYZCTKAAkfEoAEeP1aZZuO5VunT15XlB4mkwFrhlesT3A4R/FXBqOO8KLQ0j5scEQwJU6lLV/yIv/A=="
+ },
+ "webidl-conversions": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz",
+ "integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE="
+ },
+ "whatwg-url": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz",
+ "integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=",
+ "requires": {
+ "tr46": "~0.0.3",
+ "webidl-conversions": "^3.0.0"
+ }
+ },
+ "which": {
+ "version": "1.3.1",
+ "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz",
+ "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==",
+ "requires": {
+ "isexe": "^2.0.0"
+ }
+ },
+ "widest-line": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-3.1.0.tgz",
+ "integrity": "sha512-NsmoXalsWVDMGupxZ5R08ka9flZjjiLvHVAWYOKtiKM8ujtZWr9cRffak+uSE48+Ob8ObalXpwyeUiyDD6QFgg==",
+ "dev": true,
+ "requires": {
+ "string-width": "^4.0.0"
+ }
+ },
+ "wordwrap": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz",
+ "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus="
+ },
+ "wrap-ansi": {
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz",
+ "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==",
+ "dev": true,
+ "requires": {
+ "ansi-styles": "^4.0.0",
+ "string-width": "^4.1.0",
+ "strip-ansi": "^6.0.0"
+ }
+ },
+ "wrappy": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
+ "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8="
+ },
+ "write-file-atomic": {
+ "version": "3.0.3",
+ "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz",
+ "integrity": "sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q==",
+ "dev": true,
+ "requires": {
+ "imurmurhash": "^0.1.4",
+ "is-typedarray": "^1.0.0",
+ "signal-exit": "^3.0.2",
+ "typedarray-to-buffer": "^3.1.5"
+ }
+ },
+ "ws": {
+ "version": "7.5.6",
+ "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.6.tgz",
+ "integrity": "sha512-6GLgCqo2cy2A2rjCNFlxQS6ZljG/coZfZXclldI8FB/1G3CCI36Zd8xy2HrFVACi8tfk5XrgLQEk+P0Tnz9UcA=="
+ },
+ "xdg-basedir": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-4.0.0.tgz",
+ "integrity": "sha512-PSNhEJDejZYV7h50BohL09Er9VaIefr2LMAf3OEmpCkjOi34eYyQYAXUTjEQtZJTKcF0E2UKTh+osDLsgNim9Q==",
+ "dev": true
+ },
+ "xmlhttprequest-ssl": {
+ "version": "1.5.5",
+ "resolved": "https://registry.npmjs.org/xmlhttprequest-ssl/-/xmlhttprequest-ssl-1.5.5.tgz",
+ "integrity": "sha1-wodrBhaKrcQOV9l+gRkayPQ5iz4="
+ },
+ "yallist": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
+ "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A=="
+ },
+ "yeast": {
+ "version": "0.1.2",
+ "resolved": "https://registry.npmjs.org/yeast/-/yeast-0.1.2.tgz",
+ "integrity": "sha1-AI4G2AlDIMNy28L47XagymyKxBk="
+ },
+ "yocto-queue": {
+ "version": "0.1.0",
+ "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz",
+ "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q=="
+ }
+ }
+}
diff --git a/package.json b/package.json
new file mode 100644
index 0000000..f76afb8
--- /dev/null
+++ b/package.json
@@ -0,0 +1,40 @@
+{
+ "name": "hello-node",
+ "version": "0.0.1",
+ "description": "A simple Node app built on fastify, instantly up and running.",
+ "main": "server.js",
+ "scripts": {
+ "start": "node server.js",
+ "dev": "nodemon server.js"
+ },
+ "dependencies": {
+ "dotenv": "^11.0.0",
+ "fastify": "^3.25.3",
+ "fastify-formbody": "^5.2.0",
+ "fastify-multipart": "^5.2.1",
+ "fastify-static": "^4.5.0",
+ "fluent-ffmpeg": "^2.1.2",
+ "handlebars": "^4.7.7",
+ "moment": "^2.29.1",
+ "moment-timezone": "^0.5.34",
+ "nextcloud-node-client": "^1.8.2",
+ "point-of-view": "^5.0.0",
+ "socket.io": "~2.3.0",
+ "uuid": "^8.3.2"
+ },
+ "engines": {
+ "node": "12.x"
+ },
+ "repository": {
+ "url": "https://glitch.com/edit/#!/glitch-hello-node"
+ },
+ "license": "MIT",
+ "keywords": [
+ "node",
+ "glitch",
+ "express"
+ ],
+ "devDependencies": {
+ "nodemon": "^2.0.15"
+ }
+}
diff --git a/public/audio/_silence.wav b/public/audio/_silence.wav
new file mode 100644
index 0000000..6b6aed2
Binary files /dev/null and b/public/audio/_silence.wav differ
diff --git a/public/audio/clap01.mp3 b/public/audio/clap01.mp3
new file mode 100644
index 0000000..0b7da4f
Binary files /dev/null and b/public/audio/clap01.mp3 differ
diff --git a/public/default.css b/public/default.css
new file mode 100644
index 0000000..debf6e0
--- /dev/null
+++ b/public/default.css
@@ -0,0 +1,429 @@
+* {
+ margin: 0;
+ padding: 0;
+ box-sizing: border-box;
+ word-break: keep-all;
+}
+
+body {
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+ color: white;
+ font-size: 15px;
+ line-height: 1.4;
+ font-family: 'Noto Sans KR', sans-serif;
+}
+
+.bg {
+ position: fixed;
+ top: 0;
+ left: 0;
+ background: linear-gradient(#000000, #222958 65%, #e7e7d6 95%);
+ background-repeat: no-repeat;
+ background-position: center;
+ height: 100vh;
+ width: 100vw;
+ /* z-index usage is up to you.. although there is no need of using it because the default stack context will work. */
+ z-index: -1; // this is optional
+}
+
+#krtitle {
+ position: absolute;
+ top: 20%;
+ left: 50%;
+ transform: translate(-50%);
+ writing-mode: vertical-lr;
+}
+
+#entitle {
+ position: absolute;
+ bottom: 15%;
+ left: 50%;
+ transform: translate(-50%);
+ writing-mode: vertical-lr;
+}
+
+.popup {
+ display: none;
+ position: absolute;
+ max-width: 800px;
+ top: 50%;
+ left: 50%;
+ transform: translate(-50%, -50%);
+ background-color: rgba(255, 255, 255, 0.3);
+ z-index: 100;
+}
+
+.content {
+ width: 100%;
+ height: 100%;
+}
+
+.lang {
+ position: fixed;
+ top: 20px;
+ right: 15px;
+ z-index: 2;
+ writing-mode: vertical-lr;
+}
+
+.first {
+ position: fixed;
+ top: 20px;
+ right: 18px;
+ z-index: 2;
+ writing-mode: vertical-lr;
+}
+
+.second {
+ position: fixed;
+ top: 20px;
+ right: 40px;
+ z-index: 2;
+ writing-mode: vertical-lr;
+}
+
+.third {
+ position: fixed;
+ top: 20px;
+ right: 60px;
+ z-index: 2;
+ writing-mode: vertical-lr;
+}
+
+audio {
+ cursor: pointer;
+}
+
+.sub {
+ position: fixed;
+ bottom: 15px;
+ left: 20px;
+}
+
+.list2 {
+ position: fixed;
+ bottom: 15px;
+ left: 50%;
+ text-align: center;
+}
+.parade {
+ position: fixed;
+ bottom: 15px;
+ right: 20px;
+}
+.list-sub {
+ position: fixed;
+ top: 36px;
+ right: 20px;
+ z-index: 2;
+}
+.list-parade {
+ position: fixed;
+ top: 68px;
+ right: 20px;
+ z-index: 2;
+}
+
+a,
+a:visited,
+a:hover,
+a:focus,
+a:active {
+ color: white;
+ text-decoration: none;
+}
+
+.notice {
+ position: absolute;
+ display: inline-block;
+ width: 550px;
+ top: 50px;
+ left: 50%;
+ transform: translate(-50%);
+ padding-bottom: 50px;
+}
+
+section {
+ margin-bottom: 100px;
+}
+
+.info {
+ margin-left: 40px;
+}
+
+.participation li {
+ margin-bottom: 15px;
+}
+
+.participation ol {
+ margin-top: 15px;
+}
+
+h1, h2, h3 {
+ font-weight: normal;
+}
+
+h1 {
+ position: relative;
+ display: block;
+ left: 50%;
+ transform: translate(-50%);
+ font-size: 15px;
+ margin-bottom: 50px;
+ writing-mode: vertical-lr;
+ text-align: center;
+}
+
+h2 {
+ position: relative;
+ display: block;
+ left: 50%;
+ transform: translate(-50%);
+ font-size: 15px;
+ margin-bottom: 15px;
+ writing-mode: vertical-lr;
+ text-align: center;
+}
+
+h3 {
+ font-size: 15px;
+}
+
+p {
+ font-size: 15px;
+ margin-bottom: 15px;
+}
+
+ol, ul {
+ list-style: none;
+}
+
+.submit li {
+ margin-bottom: 30px;
+}
+
+.submit li li {
+ margin-bottom: 0px;
+}
+
+.category {
+ margin-left: 40px;
+}
+
+.noscroll {
+ overflow: hidden;
+}
+
+.noscroll * {
+ touch-action: none;
+}
+
+small {
+ margin-top: 5px;
+ display: block;
+}
+
+canvas {
+ margin: 5px 0 5px 0;
+}
+
+.items {
+ padding: 50px 0 50px 0;
+}
+
+.items li {
+ position: relative;
+ vertical-align: top;
+ padding: 2px 0 2px 0;
+}
+
+.sound {
+ position: relative;
+ left: 50%;
+ transform: translate(-50%);
+ margin-top: 40px;
+}
+
+.delete {
+ margin-top: 15px;
+}
+
+.drawing {
+ position: relative;
+ display: inline-block;
+ width: 300px;
+ left: 50%;
+ transform: translate(-50%);
+ vertical-align: top;
+ text-align: center;
+}
+
+.name {
+ display: inline-block;
+}
+
+.sound {
+ display: inline-block;
+}
+
+.soundinfo {
+ padding-top: 30px;
+}
+
+.soundinfo li {
+ vertical-align: top;
+}
+
+.group,
+.title,
+.comment,
+.sound,
+.smallclose {
+ display: inline-block;
+ vertical-algin: top;
+}
+
+details summary::-webkit-details-marker {
+ display:none;
+}
+
+.roomsel {
+ position: absolute;
+ width: 100%;
+ height: 100%;
+ top: 0%;
+ left: 0%;
+}
+
+.roomsel button {
+ position: absolute;
+ bottom: 50px;
+ left: 50%;
+ transform: translate(-50%);
+}
+
+.intro {
+ animation-delay: 15s;
+ animation-name: fadeout;
+ animation-duration: 5s;
+ animation-fill-mode: forwards;
+}
+
+@keyframes fadeout {
+ 0% {
+ opacity: 0.7;
+ }
+ 100% {
+ opacity: 0;
+ display: none;
+ }
+}
+
+tr {
+ color: red;
+}
+
+tr,
+td {
+ display: inline-block;
+}
+
+summary {
+ list-style: none;
+ outline: none;
+ cursor: pointer;
+}
+
+.delete {
+ position: absolute;
+ display: inline-block;
+ right: 0;
+ padding: 0;
+ cursor: pointer;
+ padding: 2px;
+ vertical-align: top;
+}
+
+.preview {
+ position: absolute;
+ display: inline-block;
+ left: 0;
+ padding: 0;
+ cursor: pointer;
+ padding: 2px;
+ vertical-align: top;
+ margin-top: 15px;
+}
+
+
+.intro {
+ top: 40%;
+ transform: translate(-50%);
+}
+
+button {
+ padding: 2px 6px 3px 6px;
+ font-size: 12px;
+}
+
+.roomsel .title {
+ position: absolute;
+ top: 50%;
+ left: 50%;
+ transform: translate(-50%, -30%);
+ height: 600px;
+ writing-mode: vertical-lr;
+}
+
+@media screen and (max-width: 700px) {
+
+ #krtitle {
+ position: absolute;
+ top: 20%;
+ left: 50%;
+ transform: translate(-50%);
+ writing-mode: vertical-lr;
+ }
+
+ #entitle {
+ position: absolute;
+ bottom: 10%;
+ left: 50%;
+ transform: translate(-50%);
+ writing-mode: vertical-lr;
+ }
+
+ .notice {
+ position: absolute;
+ display: inline-block;
+ width: 90%;
+ top: 50px;
+ left: 50%;
+ transform: translate(-50%);
+ padding-bottom: 20px;
+ }
+
+ .intro {
+ top: 30%;
+ transform: translate(-50%);
+ }
+
+ button {
+ padding: 8px 6px 5px 6px;
+ font-size: 12px;
+ }
+
+ .roomsel .title {
+ position: absolute;
+ top: 50%;
+ left: 50%;
+ transform: translate(-50%, -30%);
+ height: 600px;
+ writing-mode: vertical-lr;
+ }
+
+}
diff --git a/public/js/Tone-14.8.36.min.js b/public/js/Tone-14.8.36.min.js
new file mode 100644
index 0000000..bccdaa6
--- /dev/null
+++ b/public/js/Tone-14.8.36.min.js
@@ -0,0 +1 @@
+!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Tone=e():t.Tone=e()}("undefined"!=typeof self?self:this,function(){return(()=>{var s={228:t=>{t.exports=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var s=0,n=new Array(e);s{t.exports=function(t){if(Array.isArray(t))return t},t.exports.default=t.exports,t.exports.__esModule=!0},575:t=>{t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},t.exports.default=t.exports,t.exports.__esModule=!0},913:t=>{function n(t,e){for(var s=0;s{t.exports=function(t,e){var s=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=s){var n,i,r=[],o=!0,a=!1;try{for(s=s.call(t);!(o=(n=s.next()).done)&&(r.push(n.value),!e||r.length!==e);o=!0);}catch(t){a=!0,i=t}finally{try{o||null==s.return||s.return()}finally{if(a)throw i}}return r}},t.exports.default=t.exports,t.exports.__esModule=!0},521:t=>{t.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},t.exports.default=t.exports,t.exports.__esModule=!0},38:(t,e,s)=>{var n=s(858),i=s(884),r=s(379),o=s(521);t.exports=function(t,e){return n(t)||i(t,e)||r(t,e)||o()},t.exports.default=t.exports,t.exports.__esModule=!0},379:(t,e,s)=>{var n=s(228);t.exports=function(t,e){if(t){if("string"==typeof t)return n(t,e);var s=Object.prototype.toString.call(t).slice(8,-1);return"Map"===(s="Object"===s&&t.constructor?t.constructor.name:s)||"Set"===s?Array.from(t):"Arguments"===s||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s)?n(t,e):void 0}},t.exports.default=t.exports,t.exports.__esModule=!0},382:function(t,e,s){!function(t,e,s,n){"use strict";function i(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}function o(t,e,s){return{endTime:e,insertTime:s,type:"exponentialRampToValue",value:t}}function a(t,e,s){return{endTime:e,insertTime:s,type:"linearRampToValue",value:t}}function h(t,e){return{startTime:e,type:"setValue",value:t}}function c(t,e,s){return{duration:s,startTime:e,type:"setValueCurve",values:t}}function l(t,e,s){var n=s.startTime,i=s.target,s=s.timeConstant;return i+(e-i)*Math.exp((n-t)/s)}function u(t){return"exponentialRampToValue"===t.type}function p(t){return"linearRampToValue"===t.type}function d(t){return u(t)||p(t)}function f(t){return"setValue"===t.type}function _(t){return"setValueCurve"===t.type}function m(t,e,s,n){var i=t[e];return void 0===i?n:d(i)||f(i)?i.value:_(i)?i.values[i.values.length-1]:l(s,m(t,e-1,i.startTime,n),i)}function g(t,e,s,n,i){return void 0===s?[n.insertTime,i]:d(s)?[s.endTime,s.value]:f(s)?[s.startTime,s.value]:_(s)?[s.startTime+s.duration,s.values[s.values.length-1]]:[s.startTime,m(t,e-1,s.startTime,i)]}function v(t){return"cancelAndHold"===t.type}function y(t){return"cancelScheduledValues"===t.type}function x(t){return v(t)||y(t)?t.cancelTime:u(t)||p(t)?t.endTime:t.startTime}function w(t,e,s,n){var i=n.endTime,n=n.value;return s===n?n:0=s:x(t)>=s}),n=this._automationEvents[t];if(-1!==t&&(this._automationEvents=this._automationEvents.slice(0,t)),v(e)){var i=this._automationEvents[this._automationEvents.length-1];if(void 0!==n&&d(n)){if(T(i))throw new Error("The internal list is malformed.");var t=_(i)?i.startTime+i.duration:x(i),r=_(i)?i.values[i.values.length-1]:i.value,r=(u(n)?w:b)(s,t,r,n),r=(u(n)?o:a)(r,s,this._currenTime);this._automationEvents.push(r)}void 0!==i&&T(i)&&this._automationEvents.push(h(this.getValue(s),s)),void 0!==i&&_(i)&&i.startTime+i.duration>s&&(this._automationEvents[this._automationEvents.length-1]=c(new Float32Array([6,7]),i.startTime,s-i.startTime))}}else{r=this._automationEvents.findIndex(function(t){return x(t)>s}),i=-1===r?this._automationEvents[this._automationEvents.length-1]:this._automationEvents[r-1];if(void 0!==i&&_(i)&&x(i)+i.duration>s)return!1;i=u(e)?o(e.value,e.endTime,this._currenTime):p(e)?a(e.value,s,this._currenTime):e;if(-1===r)this._automationEvents.push(i);else{if(_(e)&&s+e.duration>x(this._automationEvents[r]))return!1;this._automationEvents.splice(r,0,i)}}return!0}},{key:"flush",value:function(e){var t,s,n=this._automationEvents.findIndex(function(t){return x(t)>e});1e}),n=this._automationEvents[s],i=(-1===s?this._automationEvents.length:s)-1,r=this._automationEvents[i];if(void 0!==r&&T(r)&&(void 0===n||!d(n)||n.insertTime>e))return l(e,m(this._automationEvents,i-1,r.startTime,this._defaultValue),r);if(void 0!==r&&f(r)&&(void 0===n||!d(n)))return r.value;if(void 0!==r&&_(r)&&(void 0===n||!d(n)||r.startTime+r.duration>e))return e{for(var s in e)qm.o(e,s)&&!qm.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},qm.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),qm.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var Fm={};return(()=>{"use strict";qm.r(Fm),qm.d(Fm,{AMOscillator:()=>sf,AMSynth:()=>If,Abs:()=>yf,Add:()=>lf,AmplitudeEnvelope:()=>Rf,Analyser:()=>nm,AudioToGain:()=>tf,AutoFilter:()=>x_,AutoPanner:()=>b_,AutoWah:()=>S_,BaseContext:()=>Bp,BiquadFilter:()=>Vf,BitCrusher:()=>A_,Buffer:()=>Mm,BufferSource:()=>Rm,Buffers:()=>Em,Channel:()=>um,Chebyshev:()=>D_,Chorus:()=>q_,Clock:()=>Dd,Compressor:()=>gm,Context:()=>Up,Convolver:()=>Tm,CrossFade:()=>g_,DCMeter:()=>am,Delay:()=>Od,Destination:()=>km,Distortion:()=>F_,Draw:()=>Dm,DuoSynth:()=>Lf,EQ3:()=>bm,Emitter:()=>Wp,Envelope:()=>Df,FFT:()=>om,FMOscillator:()=>nf,FMSynth:()=>zf,FatOscillator:()=>of,FeedbackCombFilter:()=>Hf,FeedbackDelay:()=>V_,Filter:()=>Nf,Follower:()=>T_,Freeverb:()=>z_,Frequency:()=>function(t,e){return new cd(Jp(),t,e)},FrequencyClass:()=>cd,FrequencyEnvelope:()=>Pf,FrequencyShifter:()=>P_,Gain:()=>xd,GainToAudio:()=>xf,Gate:()=>vm,GrainPlayer:()=>vf,GreaterThan:()=>Sf,GreaterThanZero:()=>Tf,IntervalTimeline:()=>Fd,JCReverb:()=>G_,LFO:()=>df,Limiter:()=>ym,Listener:()=>Cm,Loop:()=>i_,LowpassCombFilter:()=>Kf,Master:()=>Am,MembraneSynth:()=>Uf,Merge:()=>M_,MetalSynth:()=>Bf,Meter:()=>rm,MidSideCompressor:()=>xm,MidSideMerge:()=>J_,MidSideSplit:()=>H_,Midi:()=>function(t,e){return new Ed(Jp(),t,e)},MidiClass:()=>Ed,Mono:()=>pm,MonoSynth:()=>jf,MultibandCompressor:()=>wm,MultibandSplit:()=>dm,Multiply:()=>ef,Negate:()=>wf,Noise:()=>Ud,NoiseSynth:()=>Gf,Offline:()=>function(n,i,r=2,o=Jp().sampleRate){return yp(this,void 0,void 0,function*(){const t=Jp(),e=new Yp(r,i,o);Kp(e),yield n(e);var s=e.render();Kp(t);s=yield s;return new Xp(s)})},OfflineContext:()=>Yp,OmniOscillator:()=>cf,OnePoleFilter:()=>Jf,Oscillator:()=>Hd,PWMOscillator:()=>af,PanVol:()=>lm,Panner:()=>w_,Panner3D:()=>_m,Param:()=>_d,Part:()=>r_,Pattern:()=>__,Phaser:()=>Y_,PingPongDelay:()=>Z_,PitchShift:()=>X_,Player:()=>mf,Players:()=>gf,PluckSynth:()=>t_,PolySynth:()=>e_,Pow:()=>kf,PulseOscillator:()=>rf,Recorder:()=>mm,Reverb:()=>$_,Sampler:()=>s_,Scale:()=>uf,ScaleExp:()=>Af,Sequence:()=>m_,Signal:()=>Td,Solo:()=>cm,Split:()=>O_,StateTimeline:()=>fd,StereoWidener:()=>tm,Subtract:()=>bf,SyncedSignal:()=>Cf,Synth:()=>qf,Ticks:()=>function(t,e){return new Rd(Jp(),t,e)},TicksClass:()=>Rd,Time:()=>function(t,e){return new hd(Jp(),t,e)},TimeClass:()=>hd,Timeline:()=>Np,ToneAudioBuffer:()=>Xp,ToneAudioBuffers:()=>Md,ToneAudioNode:()=>md,ToneBufferSource:()=>Bd,ToneEvent:()=>n_,ToneOscillatorNode:()=>$d,Transport:()=>Sm,TransportTime:()=>function(t,e){return new pd(Jp(),t,e)},TransportTimeClass:()=>pd,Tremolo:()=>em,Unit:()=>e,UserMedia:()=>Xd,Vibrato:()=>sm,Volume:()=>Vd,WaveShaper:()=>Kd,Waveform:()=>hm,Zero:()=>pf,connect:()=>vd,connectSeries:()=>gd,connectSignal:()=>Sd,context:()=>Om,dbToGain:()=>td,debug:()=>t,defaultArg:()=>Dp,disconnect:()=>yd,fanIn:()=>function(...t){const e=t.pop();Ju(e)&&t.forEach(t=>vd(t,e))},ftom:()=>id,gainToDb:()=>ed,getContext:()=>Jp,getDestination:()=>function(){return Jp().destination},getDraw:()=>function(){return Jp().draw},getListener:()=>function(){return Jp().listener},getTransport:()=>function(){return Jp().transport},immediate:()=>function(){return Jp().immediate()},intervalToFrequencyRatio:()=>sd,isArray:()=>np,isBoolean:()=>sp,isDefined:()=>Ju,isFunction:()=>Ku,isNote:()=>rp,isNumber:()=>tp,isObject:()=>ep,isString:()=>ip,isUndef:()=>Hu,loaded:()=>function(){return Xp.loaded()},mtof:()=>od,now:()=>function(){return Jp().now()},optionsFromArguments:()=>Cp,setContext:()=>Kp,start:()=>function(){return Hp.resume()},supported:()=>$u,version:()=>s});var t={};qm.r(t),qm.d(t,{assert:()=>op,assertContextRunning:()=>hp,assertRange:()=>ap,assertUsedScheduleTime:()=>pp,enterScheduledCallback:()=>up,log:()=>fp,setLogger:()=>function(t){dp=t},warn:()=>_p});var e={};qm.r(e);const s="14.8.36";var n,i,a,o,r,h,c,l,u,p,d,f,_,m,g,v,y,x,w,b,T,S,k,A,C,D,O,M,E,R,q,F,I,V,N,P,j,L,z,W,B,U,G,Q,Z,X,Y,$,H,J,K,tt,et,st,nt=qm(382);const it=new WeakSet,rt=new WeakMap,ot=new WeakMap,at=new WeakMap,ht=new WeakMap,ct=new WeakMap,lt=new WeakMap,ut=new WeakMap,pt=new WeakMap,dt=new WeakMap,ft={construct:()=>ft},_t=/^import(?:(?:[\s]+[\w]+|(?:[\s]+[\w]+[\s]*,)?[\s]*\{[\s]*[\w]+(?:[\s]+as[\s]+[\w]+)?(?:[\s]*,[\s]*[\w]+(?:[\s]+as[\s]+[\w]+)?)*[\s]*}|(?:[\s]+[\w]+[\s]*,)?[\s]*\*[\s]+as[\s]+[\w]+)[\s]+from)?(?:[\s]*)("([^"\\]|\\.)+"|'([^'\\]|\\.)+')(?:[\s]*);?/,mt=(t,e)=>{const s=[];let n=t.replace(/^[\s]+/,""),i=n.match(_t);for(;null!==i;){const t=i[1].slice(1,-1),r=i[0].replace(/([\s]+)?;?$/,"").replace(t,new URL(t,e).toString());s.push(r),n=n.slice(i[0].length).replace(/^[\s]+/,""),i=n.match(_t)}return[s.join(";"),n]},gt=t=>{if(void 0!==t&&!Array.isArray(t))throw new TypeError("The parameterDescriptors property of given value for processorCtor is not an array.")},vt=t=>{if(!(t=>{try{new new Proxy(t,ft)}catch{return!1}return!0})(t))throw new TypeError("The given value for processorCtor should be a constructor.");if(null===t.prototype||"object"!=typeof t.prototype)throw new TypeError("The given value for processorCtor should have a prototype.")},yt=(t,e)=>{e=t.get(e);if(void 0===e)throw new Error("A value with the given key could not be found.");return e},xt=(t,e)=>{e=Array.from(t).filter(e);if(1{var i=yt(t,e),r=xt(i,t=>t[0]===s&&t[1]===n);return 0===i.size&&t.delete(e),r},bt=t=>yt(lt,t),Tt=t=>{if(it.has(t))throw new Error("The AudioNode is already stored.");it.add(t),bt(t).forEach(t=>t(!0))},St=t=>"port"in t,kt=t=>{if(!it.has(t))throw new Error("The AudioNode is not stored.");it.delete(t),bt(t).forEach(t=>t(!1))},At=(t,e)=>{!St(t)&&e.every(t=>0===t.size)&&kt(t)},Ct={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",fftSize:2048,maxDecibels:-30,minDecibels:-100,smoothingTimeConstant:.8},Dt=(t,e)=>t.context===e,Ot=t=>{try{t.copyToChannel(new Float32Array(1),0,-1)}catch{return!1}return!0},Mt=()=>new DOMException("","IndexSizeError"),Et=e=>{var s;e.getChannelData=(s=e.getChannelData,t=>{try{return s.call(e,t)}catch(t){if(12===t.code)throw Mt();throw t}})},Rt={numberOfChannels:1},qt=-34028234663852886e22,Ft=-qt,It=t=>it.has(t),Vt={buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1},Nt=t=>yt(rt,t),Pt=t=>yt(at,t),jt=(e,s)=>{const t=Nt(e)["activeInputs"];t.forEach(t=>t.forEach(([t])=>{s.includes(e)||jt(t,[...s,e])}));var n,i,n="playbackRate"in e?[e.playbackRate]:St(e)?Array.from(e.parameters.values()):"frequency"in(i=e)&&"gain"in i?[e.Q,e.detune,e.frequency,e.gain]:"offset"in e?[e.offset]:!("frequency"in(i=e))&&"gain"in i?[e.gain]:"detune"in(n=e)&&"frequency"in n?[e.detune,e.frequency]:"pan"in e?[e.pan]:[];for(const e of n){const t=Pt(e);void 0!==t&&t.activeInputs.forEach(([t])=>jt(t,s))}It(e)&&kt(e)},Lt=t=>{jt(t.destination,[])},zt=t=>"context"in t,Wt=t=>zt(t[0]),Bt=(t,e,s,n)=>{for(const e of t)if(s(e)){if(n)return!1;throw Error("The set contains at least one similar element.")}return t.add(e),!0},Ut=(t,e,[s,n],i)=>{Bt(t,[e,s,n],t=>t[0]===e&&t[1]===s,i)},Gt=(t,[e,s,n],i)=>{var r=t.get(e);void 0===r?t.set(e,new Set([[s,n]])):Bt(r,[s,n],t=>t[0]===s,i)},Qt=t=>"inputs"in t,Zt=(t,e,s,n)=>{if(Qt(e)){var i=e.inputs[n];return t.connect(i,s,0),[i,s,0]}return t.connect(e,s,n),[e,s,n]},Xt=(t,e,s)=>{for(const n of t)if(n[0]===e&&n[1]===s)return t.delete(n),n;return null},Yt=(t,e)=>{if(!bt(t).delete(e))throw new Error("Missing the expected event listener.")},$t=(t,e,s)=>{var n=yt(t,e),i=xt(n,t=>t[0]===s);return 0===n.size&&t.delete(e),i},Ht=(t,e,s,n)=>{Qt(e)?t.disconnect(e.inputs[n],s,0):t.disconnect(e,s,n)},Jt=t=>yt(ot,t),Kt=t=>yt(ht,t),te=t=>ut.has(t),ee=t=>!it.has(t),se=(r,o)=>new Promise(e=>{if(null!==o)e(!0);else{const o=r.createScriptProcessor(256,1,1),t=r.createGain(),s=r.createBuffer(1,2,44100),n=s.getChannelData(0);n[0]=1,n[1]=1;const i=r.createBufferSource();i.buffer=s,i.loop=!0,i.connect(o).connect(r.destination),i.connect(t),i.disconnect(t),o.onaudioprocess=t=>{t=t.inputBuffer.getChannelData(0);Array.prototype.some.call(t,t=>1===t)?e(!0):e(!1),i.stop(),o.onaudioprocess=null,i.disconnect(o),o.disconnect(r.destination)},i.start()}}),ne=(t,s)=>{const e=new Map;for(const s of t)for(const t of s){const s=e.get(t);e.set(t,void 0===s?1:s+1)}e.forEach((t,e)=>s(e,t))},ie=t=>"context"in t,re=(t,e,s,n,i)=>{var[r,o]=((t,e,s,n)=>{var{activeInputs:i,passiveInputs:e}=Nt(e),i=Xt(i[n],t,s);return null===i?[wt(e,t,s,n)[2],!1]:[i[2],!0]})(t,s,n,i);if(null!==r&&(Yt(t,r),!o||e||te(t)||Ht(Jt(t),Jt(s),n,i)),It(s)){const t=Nt(s)["activeInputs"];At(s,t)}},oe=(t,e,s,n)=>{var[i,r]=((t,e,s)=>{var{activeInputs:n,passiveInputs:e}=Pt(e),n=Xt(n,t,s);return null===n?[$t(e,t,s)[1],!1]:[n[2],!0]})(t,s,n);null!==i&&(Yt(t,i),!r||e||te(t)||Jt(t).disconnect(Kt(s),n))};class ae{constructor(t){this._map=new Map(t)}get size(){return this._map.size}entries(){return this._map.entries()}forEach(s,n=null){return this._map.forEach((t,e)=>s.call(n,t,e,this))}get(t){return this._map.get(t)}has(t){return this._map.has(t)}keys(){return this._map.keys()}values(){return this._map.values()}}const he={channelCount:2,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:1,numberOfOutputs:1,parameterData:{},processorOptions:{}};function ce(t,e,s,n,i){if("function"==typeof t.copyFromChannel)0===e[s].byteLength&&(e[s]=new Float32Array(128)),t.copyFromChannel(e[s],n,i);else{const r=t.getChannelData(n);if(0===e[s].byteLength)e[s]=r.slice(i,i+128);else{const t=new Float32Array(r.buffer,i*Float32Array.BYTES_PER_ELEMENT,128);e[s].set(t)}}}const le=(t,e,s,n,i)=>{"function"==typeof t.copyToChannel?0!==e[s].byteLength&&t.copyToChannel(e[s],n,i):0!==e[s].byteLength&&t.getChannelData(n).set(e[s],i)},ue=(e,s)=>{const n=[];for(let t=0;t{const{port1:n,port2:i}=new MessageChannel;return new Promise(t=>{const e=()=>{i.onmessage=null,n.close(),i.close(),t()};i.onmessage=()=>e();try{n.postMessage(s,[s])}finally{e()}})},ve={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",delayTime:0,maxDelayTime:1},ye=(t,e,s)=>{s=e[s];if(void 0===s)throw t();return s},xe={attack:.003,channelCount:2,channelCountMode:"clamped-max",channelInterpretation:"speakers",knee:30,ratio:12,release:.25,threshold:-24},we={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",gain:1},be=()=>new DOMException("","InvalidStateError"),Te=()=>new DOMException("","InvalidAccessError"),Se={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers"},ke=(s,n,i,r,o,a,h,t,c,l,u)=>{var e=l.length;let p=t;for(let t=0;t{var e=new Uint32Array([1179011410,40,1163280727,544501094,16,131073,44100,176400,1048580,1635017060,4,0]);try{const s=t.decodeAudioData(e.buffer,()=>{});return void 0!==s&&(s.catch(()=>{}),!0)}catch{}return!1},De=(t,e,s)=>{e=e[s];void 0!==e&&e!==t[s]&&(t[s]=e)},Oe=(t,e)=>{De(t,e,"channelCount"),De(t,e,"channelCountMode"),De(t,e,"channelInterpretation")},Me=t=>"function"==typeof t.getFloatTimeDomainData,Ee=(t,e,s)=>{e=e[s];void 0!==e&&e!==t[s].value&&(t[s].value=e)},Re=n=>{var i;n.start=(i=n.start,(t=0,e=0,s)=>{if("number"==typeof s&&s<0||e<0||t<0)throw new RangeError("The parameters can't be negative.");i.call(n,t,e,s)})},qe=e=>{var s;e.stop=(s=e.stop,(t=0)=>{if(t<0)throw new RangeError("The parameter can't be negative.");s.call(e,t)})},Fe=(t,e)=>null===t?512:Math.max(512,Math.min(16384,Math.pow(2,Math.round(Math.log2(t*e))))),Ie=(t,e)=>{t=t.createBiquadFilter();return Oe(t,e),Ee(t,e,"Q"),Ee(t,e,"detune"),Ee(t,e,"frequency"),Ee(t,e,"gain"),De(t,e,"type"),t},Ve=(t,e)=>{t=t.createChannelSplitter(e.numberOfOutputs);return Oe(t,e),(t=>{const e=t.numberOfOutputs;Object.defineProperty(t,"channelCount",{get:()=>e,set:t=>{if(t!==e)throw be()}}),Object.defineProperty(t,"channelCountMode",{get:()=>"explicit",set:t=>{if("explicit"!==t)throw be()}}),Object.defineProperty(t,"channelInterpretation",{get:()=>"discrete",set:t=>{if("discrete"!==t)throw be()}})})(t),t},Ne=(t,e)=>(t.connect=e.connect.bind(e),t.disconnect=e.disconnect.bind(e),t),Pe=(t,e)=>{t=t.createDelay(e.maxDelayTime);return Oe(t,e),Ee(t,e,"delayTime"),t},je=(t,e)=>{t=t.createGain();return Oe(t,e),Ee(t,e,"gain"),t};function Le(e,s){let n=[0,0];for(let t=e.length-1;0<=t;--t)n=[(i=n)[0]*s[0]-i[1]*s[1],i[0]*s[1]+i[1]*s[0]],n[0]+=e[t];var i;return n}const ze=(t,e,s,n)=>t.createScriptProcessor(e,s,n),We=()=>new DOMException("","NotSupportedError"),Be={numberOfChannels:1},Ue={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",detune:0,frequency:440,periodicWave:void 0,type:"sine"},Ge={channelCount:2,channelCountMode:"clamped-max",channelInterpretation:"speakers",coneInnerAngle:360,coneOuterAngle:360,coneOuterGain:0,distanceModel:"inverse",maxDistance:1e4,orientationX:1,orientationY:0,orientationZ:0,panningModel:"equalpower",positionX:0,positionY:0,positionZ:0,refDistance:1,rolloffFactor:1},Qe={disableNormalization:!1},Ze={channelCount:2,channelCountMode:"explicit",channelInterpretation:"speakers",pan:0},Xe={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",curve:null,oversample:"none"},Ye=(t,e,s)=>void 0===t.copyFromChannel?t.getChannelData(s)[0]:(t.copyFromChannel(e,s),e[0]),$e=t=>{if(null===t)return!1;var e=t.length;return e%2!=0?0!==t[Math.floor(e/2)]:t[e/2-1]+t[e/2]!==0},He=(t,e,s,n)=>{let i=t;for(;!i.hasOwnProperty(e);)i=Object.getPrototypeOf(i);var{get:r,set:o}=Object.getOwnPropertyDescriptor(i,e);Object.defineProperty(t,e,{get:s(r),set:n(o)})},Je=(e,s,n)=>{try{e.setValueAtTime(s,n)}catch(t){if(9!==t.code)throw t;Je(e,s,n+1e-7)}},Ke=t=>{const e=t.createOscillator();try{e.start(-1)}catch(t){return t instanceof RangeError}return!1},ts=t=>{const e=t.createBuffer(1,1,44100),s=t.createBufferSource();s.buffer=e,s.start(),s.stop();try{return s.stop(),!0}catch{return!1}},es=t=>{const e=t.createOscillator();try{e.stop(-1)}catch(t){return t instanceof RangeError}return!1},ss=()=>{try{new DOMException}catch{return!1}return!0},ns=()=>new Promise(e=>{const t=new ArrayBuffer(0),{port1:s,port2:n}=new MessageChannel;s.onmessage=({data:t})=>e(null!==t),n.postMessage(t,[t])}),is=(n,t)=>{const i=t.createGain();n.connect(i);const e=(s=n.disconnect,()=>{s.call(n,i),n.removeEventListener("ended",e)});var s;n.addEventListener("ended",e),Ne(n,i),n.stop=(e=>{let s=!1;return(t=0)=>{if(s)try{e.call(n,t)}catch{i.gain.setValueAtTime(0,t)}else e.call(n,t),s=!0}})(n.stop)},rs=(s,n)=>t=>{var e={value:s};return Object.defineProperties(t,{currentTarget:e,target:e}),("function"==typeof n?n:n.handleEvent).call(s,t)},os=(o=Bt,(t,e,[s,n,i],r)=>{o(t[n],[e,s,i],t=>t[0]===e&&t[1]===s,r)}),as=(a=Bt,(t,e,[s,n,i],r)=>{var o=t.get(s);void 0===o?t.set(s,new Set([[n,e,i]])):a(o,[n,e,i],t=>t[0]===n&&t[1]===e,r)}),hs=(i=xt,(t,e,s,n)=>i(t[n],t=>t[0]===e&&t[1]===s)),cs=new WeakMap,ls=(n=cs,t=>{return null!==(t=n.get(t))&&void 0!==t?t:0}),us=(r=new Map,h=new WeakMap,(e,t)=>{const s=h.get(e);if(void 0!==s)return s;var n=r.get(e);if(void 0!==n)return n;try{const s=t();return s instanceof Promise?(r.set(e,s),s.catch(()=>!1).then(t=>(r.delete(e),h.set(e,t),t))):(h.set(e,s),s)}catch{return h.set(e,!1),!1}}),ps="undefined"==typeof window?null:window,ds=(m=us,g=Mt,(t,e)=>{const s=t.createAnalyser();if(Oe(s,e),!(e.maxDecibels>e.minDecibels))throw g();return De(s,e,"fftSize"),De(s,e,"maxDecibels"),De(s,e,"minDecibels"),De(s,e,"smoothingTimeConstant"),m(Me,()=>Me(s))||((i=s).getFloatTimeDomainData=e=>{var s=new Uint8Array(e.length);i.getByteTimeDomainData(s);var n=Math.max(s.length,i.fftSize);for(let t=0;t{t=_(t);if(null===t.renderer)throw new Error("Missing the renderer of the given AudioNode in the audio graph.");return t.renderer}),_s=(p=Nt,d=fs,f=te,async(o,a,h)=>{const t=p(o);await Promise.all(t.activeInputs.map((t,r)=>Array.from(t).map(async([t,e])=>{const s=d(t),n=await s.render(t,a),i=o.context.destination;f(t)||o===i&&f(o)||n.connect(h,e,r)})).reduce((t,e)=>[...t,...e],[]))}),ms=(c=ds,l=Jt,u=_s,()=>{const n=new WeakMap;return{render(t,e){var s=n.get(e);return void 0!==s?Promise.resolve(s):(async(t,e)=>{let s=l(t);if(!Dt(s,e)){const l={channelCount:s.channelCount,channelCountMode:s.channelCountMode,channelInterpretation:s.channelInterpretation,fftSize:s.fftSize,maxDecibels:s.maxDecibels,minDecibels:s.minDecibels,smoothingTimeConstant:s.smoothingTimeConstant};s=c(e,l)}return n.set(e,s),await u(t,e,s),s})(t,e)}}}),gs=(v=ct,t=>{t=v.get(t);if(void 0===t)throw be();return t}),vs=null===(Jc=ps)?null:Jc.hasOwnProperty("OfflineAudioContext")?Jc.OfflineAudioContext:Jc.hasOwnProperty("webkitOfflineAudioContext")?Jc.webkitOfflineAudioContext:null,ys=(et=vs,t=>null!==et&&t instanceof et),xs=new WeakMap,ws=(tt=rs,class{constructor(t){this._nativeEventTarget=t,this._listeners=new WeakMap}addEventListener(e,s,n){if(null!==s){let t=this._listeners.get(s);void 0===t&&(t=tt(this,s),"function"==typeof s&&this._listeners.set(s,t)),this._nativeEventTarget.addEventListener(e,t,n)}}dispatchEvent(t){return this._nativeEventTarget.dispatchEvent(t)}removeEventListener(t,e,s){e=null===e?void 0:this._listeners.get(e);this._nativeEventTarget.removeEventListener(t,void 0===e?null:e,s)}}),bs=null===(ol=ps)?null:ol.hasOwnProperty("AudioContext")?ol.AudioContext:ol.hasOwnProperty("webkitAudioContext")?ol.webkitAudioContext:null,Ts=(K=bs,t=>null!==K&&t instanceof K),Ss=(J=ps,t=>null!==J&&"function"==typeof J.AudioNode&&t instanceof J.AudioNode),ks=(H=ps,t=>null!==H&&"function"==typeof H.AudioParam&&t instanceof H.AudioParam),As=null!==(al=ps)&&al.hasOwnProperty("AudioWorkletNode")?al.AudioWorkletNode:null,Cs=(st=rt,y=(t,e,s)=>{const n=[];for(let t=0;t{const T=new WeakMap;return(n,i,r,o,a)=>{const{activeInputs:h,passiveInputs:c}=_(i),t=_(n)["outputs"],e=g(n),s=t=>{var e=v(i),s=v(n);if(t){const u=wt(c,n,r,o);l(h,n,u,!1),a||w(n)||p(s,e,r,o),b(i)&&Tt(i)}else{const l=d(h,n,r,o);u(c,o,l,!1),a||w(n)||f(s,e,r,o);const p=m(i);if(0===p)x(i)&&At(i,h);else{const l=T.get(i);void 0!==l&&clearTimeout(l),T.set(i,setTimeout(()=>{x(i)&&At(i,h)},1e3*p))}}};return!!y(t,[i,r,o],t=>t[0]===i&&t[1]===r&&t[2]===o,!0)&&(e.add(s),x(n)?l(h,n,[r,o,s],!0):u(c,o,[n,r,s],!0),!0)}})(os,as,Zt,hs,Ht,Nt,ls,bt,Jt,Bt,It,te,ee),w=us,G=ut,Q=Ht,Z=Nt,X=Jt,Y=Kt,$=It,b=n=>(t,e)=>{var s=G.get(t);if(void 0===s){if(!n&&$(t)){const G=X(t),$=Z(t)["outputs"];for(const Z of $)if(Wt(Z)){const Y=X(Z[0]);Q(G,Y,Z[1],Z[2])}else{const Q=Y(Z[0]);G.disconnect(Q,Z[1])}}G.set(t,e)}else G.set(t,s+e)},T=Mt,S=Te,k=We,N=Zt,P=ut,j=Nt,L=Jt,z=Kt,W=gs,B=It,U=ys,A=(t,e)=>{var s=P.get(t);if(void 0===s)throw new Error("Missing the expected cycle count.");var n=W(t.context),n=U(n);if(s===e){if(P.delete(t),!n&&B(t)){const P=L(t),W=j(t)["outputs"];for(const j of W)if(Wt(j)){const z=L(j[0]);N(P,z,j[1],j[2])}else{const N=z(j[0]);P.connect(N,j[1])}}}else P.set(t,s-e)},F=xs,I=Nt,V=yt,C=function e(s,t){const n=zt(t)?t:V(F,t);if("delayTime"in n)return[];if(s[0]===n)return[s];if(s.includes(n))return[];var t=I(n)["outputs"];return Array.from(t).map(t=>e([...s,n],t[0])).reduce((t,e)=>t.concat(e),[])},Ds=ws,O=Ts,M=Ss,E=ks,q=As,class extends Ds{constructor(t,e,s,n){super(s),this._context=t,this._nativeAudioNode=s;const i=D(t);O(i)&&!0!==w(se,()=>se(i,q))&&(i=>{const r=new Map;var o,a;i.connect=(a=i.connect.bind(i),(t,e=0,s=0)=>{const n=ie(t)?a(t,e,s):a(t,e),i=r.get(t);return void 0===i?r.set(t,[{input:s,output:e}]):i.every(t=>t.input!==s||t.output!==e)&&i.push({input:s,output:e}),n}),i.disconnect=(o=i.disconnect,(e,s,n)=>{if(o.apply(i),void 0===e)r.clear();else if("number"==typeof e)for(const[i,o]of r){const s=o.filter(t=>t.output!==e);0===s.length?r.delete(i):r.set(i,s)}else if(r.has(e))if(void 0===s)r.delete(e);else{const i=r.get(e);if(void 0!==i){const o=i.filter(t=>t.output!==s&&(t.input!==n||void 0===n));0===o.length?r.delete(e):r.set(e,o)}}for(const[o,e]of r)e.forEach(t=>{ie(o)?i.connect(o,t.output,t.input):i.connect(o,t.output)})})})(s),ot.set(this,s),lt.set(this,new Set),"closed"!==t.state&&e&&Tt(this),y(this,n,s)}get channelCount(){return this._nativeAudioNode.channelCount}set channelCount(t){this._nativeAudioNode.channelCount=t}get channelCountMode(){return this._nativeAudioNode.channelCountMode}set channelCountMode(t){this._nativeAudioNode.channelCountMode=t}get channelInterpretation(){return this._nativeAudioNode.channelInterpretation}set channelInterpretation(t){this._nativeAudioNode.channelInterpretation=t}get context(){return this._context}get numberOfInputs(){return this._nativeAudioNode.numberOfInputs}get numberOfOutputs(){return this._nativeAudioNode.numberOfOutputs}connect(t,e=0,s=0){if(e<0||e>=this._nativeAudioNode.numberOfOutputs)throw T();var n=D(this._context),n=R(n);if(M(t)||E(t))throw S();if(zt(t)){const T=Jt(t);try{const x=Zt(this._nativeAudioNode,T,e,s),b=ee(this);(n||b)&&this._nativeAudioNode.disconnect(...x),"closed"!==this.context.state&&!b&&ee(t)&&Tt(t)}catch(t){if(12===t.code)throw S();throw t}if(x(this,t,e,s,n)){const x=C([this],t);ne(x,b(n))}return t}s=Kt(t);if("playbackRate"===s.name&&1024===s.maxValue)throw k();try{this._nativeAudioNode.connect(s,e),(n||ee(this))&&this._nativeAudioNode.disconnect(s,e)}catch(t){if(12===t.code)throw S();throw t}if(((r,o,a,h)=>{const{activeInputs:c,passiveInputs:l}=Pt(o),t=Nt(r)["outputs"],e=bt(r),s=t=>{const e=Jt(r),s=Kt(o);if(t){const o=$t(l,r,a);Ut(c,r,o,!1),h||te(r)||e.connect(s,a)}else{const o=(t=c,n=r,i=a,xt(t,t=>t[0]===n&&t[1]===i));Gt(l,o,!1),h||te(r)||e.disconnect(s,a)}var n,i};return!!Bt(t,[o,a],t=>t[0]===o&&t[1]===a,!0)&&(e.add(s),It(r)?Ut(c,r,[a,s],!0):Gt(l,[r,a,s],!0),!0)})(this,t,e,n)){const x=C([this],t);ne(x,b(n))}}disconnect(t,e,s){let n;var i=D(this._context),i=R(i);if(void 0===t)n=((t,e)=>{const s=Nt(t),n=[];for(const i of s.outputs)(Wt(i)?re:oe)(t,e,...i),n.push(i[0]);return s.outputs.clear(),n})(this,i);else if("number"==typeof t){if(t<0||t>=this.numberOfOutputs)throw T();n=((t,e,s)=>{const n=Nt(t),i=[];for(const r of n.outputs)r[1]===s&&((Wt(r)?re:oe)(t,e,...r),i.push(r[0]),n.outputs.delete(r));return i})(this,i,t)}else{if(void 0!==e&&(e<0||e>=this.numberOfOutputs))throw T();if(zt(t)&&void 0!==s&&(s<0||s>=t.numberOfInputs))throw T();if(n=((e,s,n,i,r)=>{const o=Nt(e);return Array.from(o.outputs).filter(t=>!(t[0]!==n||void 0!==i&&t[1]!==i||void 0!==r&&t[2]!==r)).map(t=>((Wt(t)?re:oe)(e,s,...t),o.outputs.delete(t),t[0]))})(this,i,t,e,s),0===n.length)throw S()}for(const t of n){const e=C([this],t);ne(e,A)}}});var Ds,Os,Ms,Es,Rs,qs,Fs,Is,Vs,Ns,Ps,js,Ls,zs,Ws,Bs,Us,Gs,Qs,Zs,Xs,Ys,$s,Hs,Js,Ks,tn,en,sn,nn,rn,on,an,hn,cn,ln,un,pn,dn,fn,_n,mn,gn,vn,yn,xn,wn,bn,Tn,Sn,kn,An,Cn,Dn,On,Mn,En,Rn,qn,Fn,In,Vn,Nn,Pn,jn,Ln,zn,Wn,Bn,Un,Gn,Qn,Zn,Xn,Yn,$n,Hn,Jn,Kn,ti,ei,si,ni,ii,ri,oi,ai,hi,ci,li,ui,pi,di,fi,_i,mi,gi,vi,yi,xi,wi,bi,Ti,Si,ki,Ai,Ci,Di,Oi,Mi,Ei,Ri,qi,Fi,Ii,Vi,Ni,Pi,ji,Li,zi,Wi,Bi,Ui,Gi,Qi,Zi,Xi,Yi,$i,Hi,Ji,Ki,tr,er,sr,nr,ir,rr,or,ar,hr,cr,lr,ur,pr,dr,fr,_r,mr,gr,vr,yr,xr,wr,br,Tr,Sr,kr,Ar,Cr,Dr,Or,Mr,Er,Rr,qr,Fr,Ir,Vr,Nr,Pr,jr,Lr,zr,Wr,Br,Ur,Gr,Qr,Zr,Xr,Yr,$r,Hr,Jr,Kr,to,eo,so,no,io,ro,oo,ao,ho,co,lo,uo,po,fo,_o,mo,go,vo,yo,xo,wo,bo,To,So,ko,Ao,Co,Do,Oo,Mo,Eo,Ro,qo,Fo,Io,Vo,No,Po,jo,Lo,zo,Wo,Bo,Uo,Go,Qo,Zo,Xo,Yo,$o,Ho,Jo,Ko,ta,ea,sa,na,ia,ra,oa,aa,ha,ca,la,ua,pa,da,fa,_a,ma,ga,va,ya,xa,wa,ba,Ta,Sa,ka,Aa,Ca,Da,Oa,Ma,Ea,Ra,qa,Fa,Ia,Va,Na,Pa,ja,La,za,Wa,Ba,Ua,Ga,Qa,Za,Xa,Ya,$a,Ha,Ja,Ka,th,eh,sh,nh,ih,rh,oh,ah,hh,ch,lh,uh,ph,dh,fh,_h,mh,gh,vh,yh,xh,wh,bh,Th,Sh,kh,Ah,Ch,Dh,Oh,Mh,Eh,Rh,qh,Fh,Ih,Vh,Nh,Ph,jh,Lh,zh,Wh,Bh,Uh,Gh,Qh,Zh,Xh,Yh,$h,Hh,Jh,Kh,tc,ec,sc,nc,ic,rc,oc,ac,hc,cc,lc,uc,pc,dc,fc,_c,mc,gc,vc,yc,xc,wc,bc,Tc,Sc,kc,Ac,Cc,Dc,Oc,Mc,Ec,Rc,qc,Fc,Ic,Vc,Nc,Pc,jc,Lc,zc,Wc,Bc,Uc,Gc,Qc,Zc,Xc,Yc,$c,Hc,Jc,Kc,tl,el,sl,nl,il,rl,ol=(Jc=Cs,Os=ms,Ms=Mt,Es=ds,Rs=D=gs,qs=R=ys,class extends Jc{constructor(t,e){var s=Rs(t),e={...Ct,...e},e=Es(s,e);super(t,!1,e,qs(s)?Os():null),this._nativeAnalyserNode=e}get fftSize(){return this._nativeAnalyserNode.fftSize}set fftSize(t){this._nativeAnalyserNode.fftSize=t}get frequencyBinCount(){return this._nativeAnalyserNode.frequencyBinCount}get maxDecibels(){return this._nativeAnalyserNode.maxDecibels}set maxDecibels(t){var e=this._nativeAnalyserNode.maxDecibels;if(!((this._nativeAnalyserNode.maxDecibels=t)>this._nativeAnalyserNode.minDecibels))throw this._nativeAnalyserNode.maxDecibels=e,Ms()}get minDecibels(){return this._nativeAnalyserNode.minDecibels}set minDecibels(t){var e=this._nativeAnalyserNode.minDecibels;if(this._nativeAnalyserNode.minDecibels=t,!(this._nativeAnalyserNode.maxDecibels>t))throw this._nativeAnalyserNode.minDecibels=e,Ms()}get smoothingTimeConstant(){return this._nativeAnalyserNode.smoothingTimeConstant}set smoothingTimeConstant(t){this._nativeAnalyserNode.smoothingTimeConstant=t}getByteFrequencyData(t){this._nativeAnalyserNode.getByteFrequencyData(t)}getByteTimeDomainData(t){this._nativeAnalyserNode.getByteTimeDomainData(t)}getFloatFrequencyData(t){this._nativeAnalyserNode.getFloatFrequencyData(t)}getFloatTimeDomainData(t){this._nativeAnalyserNode.getFloatTimeDomainData(t)}}),al=new WeakSet,Jc=null!==(Ds=ps)&&Ds.hasOwnProperty("AudioBuffer")?Ds.AudioBuffer:null,Ds=(Fs=new Uint32Array(1),t=>(Fs[0]=t,Fs[0]));const hl=(wn=Mt,a=>{a.copyFromChannel=(e,t,s=0)=>{var n=xn(s),t=xn(t);if(t>=a.numberOfChannels)throw wn();var i=a.length,r=a.getChannelData(t),o=e.length;for(let t=n<0?-n:0;t+n{var n=xn(s),t=xn(t);if(t>=a.numberOfChannels)throw wn();const i=a.length,r=a.getChannelData(t),o=e.length;for(let t=n<0?-n:0;t+n{var i,r;n.copyFromChannel=(r=n.copyFromChannel,(t,e,s=0)=>{s=yn(s),e=yn(e);if(s{s=yn(s),e=yn(e);if(s{let p=null;return class e{constructor(t){if(null===h)throw new Error("Missing the native OfflineAudioContext constructor.");var{length:e,numberOfChannels:s,sampleRate:t}={...Rt,...t};null===p&&(p=new h(1,1,44100));const n=null!==a&&r(c,c)?new a({length:e,numberOfChannels:s,sampleRate:t}):p.createBuffer(s,e,t);if(0===n.numberOfChannels)throw o();return"function"!=typeof n.copyFromChannel?(l(n),Et(n)):r(Ot,()=>Ot(n))||u(n),i.add(n),n}static[Symbol.hasInstance](t){return null!==t&&"object"==typeof t&&Object.getPrototypeOf(t)===e.prototype||i.has(t)}}})(al,us,We,Jc,vs,(vn=Jc,()=>{if(null===vn)return!1;try{new vn({length:1,sampleRate:44100})}catch{return!1}return!0}),hl,cl),ul=(gn=je,(t,e)=>{const s=gn(t,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0});e.connect(s).connect(t.destination);const n=()=>{e.removeEventListener("ended",n),e.disconnect(s),s.disconnect()};e.addEventListener("ended",n)}),pl=(fn=fs,_n=Pt,mn=te,async(t,i,r)=>{t=_n(t);await Promise.all(Array.from(t.activeInputs).map(async([t,e])=>{const s=fn(t),n=await s.render(t,i);mn(t)||n.connect(r,e)}))}),dl=(dn=pl,(t,e,s)=>dn(e,t,s)),fl=(en=ul,sn=us,nn=t=>{const e=t.createBufferSource();e.start();try{e.start()}catch{return!0}return!1},rn=t=>{const e=t.createBufferSource(),s=t.createBuffer(1,1,44100);e.buffer=s;try{e.start(0,1)}catch{return!1}return!0},on=t=>{const e=t.createBufferSource();e.start();try{e.stop()}catch{return!1}return!0},an=Ke,hn=ts,cn=es,pn=He,ln=(s,t)=>{const n=t.createBuffer(1,1,44100);null===s.buffer&&(s.buffer=n),pn(s,"buffer",e=>()=>{var t=e.call(s);return t===n?null:t},e=>t=>e.call(s,null===t?n:t))},un=is,(t,e)=>{var i,r,o,s=t.createBufferSource();return Oe(s,e),Ee(s,e,"playbackRate"),De(s,e,"buffer"),De(s,e,"loop"),De(s,e,"loopEnd"),De(s,e,"loopStart"),sn(nn,()=>nn(t))||((o=s).start=(n=>{let i=!1;return(t=0,e=0,s)=>{if(i)throw be();n.call(o,t,e,s),i=!0}})(o.start)),sn(rn,()=>rn(t))||((i=s).start=(r=i.start,(t=0,e=0,s)=>{var n=i.buffer,e=null===n?e:Math.min(n.duration,e);null!==n&&e>n.duration-.5/i.context.sampleRate?r.call(i,t,0,0):r.call(i,t,e,s)})),sn(on,()=>on(t))||ln(s,t),sn(an,()=>an(t))||Re(s),sn(hn,()=>hn(t))||un(s,t),sn(cn,()=>cn(t))||qe(s),en(t,s),s}),_l=(tn=Pt,Js=t=>{t=tn(t);if(null===t.renderer)throw new Error("Missing the renderer of the given AudioParam in the audio graph.");return t.renderer},Ks=pl,(t,e,s)=>(Js(e).replay(s),Ks(e,t,s))),ml=(Zs=dl,Xs=fl,Ys=Jt,$s=_l,Hs=_s,()=>{const i=new WeakMap;let r=null,o=null;return{set start(t){r=t},set stop(t){o=t},render(t,e){var s=i.get(e);return void 0!==s?Promise.resolve(s):(async(t,e)=>{let s=Ys(t);var n=Dt(s,e);if(!n){const Zs={buffer:s.buffer,channelCount:s.channelCount,channelCountMode:s.channelCountMode,channelInterpretation:s.channelInterpretation,loop:s.loop,loopEnd:s.loopEnd,loopStart:s.loopStart,playbackRate:s.playbackRate.value};s=Xs(e,Zs),null!==r&&s.start(...r),null!==o&&s.stop(o)}return i.set(e,s),n?await Zs(e,t.playbackRate,s.playbackRate):await $s(e,t.playbackRate,s.playbackRate),await Hs(t,e,s),s})(t,e)}}}),gl=(bn=at,Is=(t,e)=>{bn.set(t,{activeInputs:new Set,passiveInputs:new WeakMap,renderer:e})},Vs=xs,Ns=ht,Ps=nt.createCancelAndHoldAutomationEvent,js=nt.createCancelScheduledValuesAutomationEvent,Ls=nt.createExponentialRampToValueAutomationEvent,zs=nt.createLinearRampToValueAutomationEvent,Ws=nt.createSetTargetAutomationEvent,Bs=nt.createSetValueAutomationEvent,Us=nt.createSetValueCurveAutomationEvent,Gs=bs,Qs=Je,(p,t,d,e=null,s=null)=>{const f=new nt.AutomationEventList(d.defaultValue),_=t?(c=f,{replay(t){for(const e of c)if("exponentialRampToValue"===e.type){const{endTime:c,value:s}=e;t.exponentialRampToValueAtTime(s,c)}else if("linearRampToValue"===e.type){const{endTime:c,value:n}=e;t.linearRampToValueAtTime(n,c)}else if("setTarget"===e.type){const{startTime:c,target:i,timeConstant:r}=e;t.setTargetAtTime(i,c,r)}else if("setValue"===e.type){const{startTime:c,value:o}=e;t.setValueAtTime(o,c)}else{if("setValueCurve"!==e.type)throw new Error("Can't apply an unknown automation.");{const{duration:c,startTime:a,values:h}=e;t.setValueCurveAtTime(h,a,c)}}}}):null,m={get defaultValue(){return d.defaultValue},get maxValue(){return null===e?d.maxValue:e},get minValue(){return null===s?d.minValue:s},get value(){return d.value},set value(t){d.value=t,m.setValueAtTime(t,p.context.currentTime)},cancelAndHoldAtTime(t){var e,s;return"function"==typeof d.cancelAndHoldAtTime?(null===_&&f.flush(p.context.currentTime),f.add(Ps(t)),d.cancelAndHoldAtTime(t)):(e=Array.from(f).pop(),null===_&&f.flush(p.context.currentTime),f.add(Ps(t)),s=Array.from(f).pop(),d.cancelScheduledValues(t),e!==s&&void 0!==s&&("exponentialRampToValue"===s.type?d.exponentialRampToValueAtTime(s.value,s.endTime):"linearRampToValue"===s.type?d.linearRampToValueAtTime(s.value,s.endTime):"setValue"===s.type?d.setValueAtTime(s.value,s.startTime):"setValueCurve"===s.type&&d.setValueCurveAtTime(s.values,s.startTime,s.duration))),m},cancelScheduledValues:t=>(null===_&&f.flush(p.context.currentTime),f.add(js(t)),d.cancelScheduledValues(t),m),exponentialRampToValueAtTime(t,e){if(0===t)throw new RangeError;if(!Number.isFinite(e)||e<0)throw new RangeError;return null===_&&f.flush(p.context.currentTime),f.add(Ls(t,e)),d.exponentialRampToValueAtTime(t,e),m},linearRampToValueAtTime:(t,e)=>(null===_&&f.flush(p.context.currentTime),f.add(zs(t,e)),d.linearRampToValueAtTime(t,e),m),setTargetAtTime:(t,e,s)=>(null===_&&f.flush(p.context.currentTime),f.add(Ws(t,e,s)),d.setTargetAtTime(t,e,s),m),setValueAtTime:(t,e)=>(null===_&&f.flush(p.context.currentTime),f.add(Bs(t,e)),d.setValueAtTime(t,e),m),setValueCurveAtTime(t,e,s){var n=t instanceof Float32Array?t:new Float32Array(t);if(null!==Gs&&"webkitAudioContext"===Gs.name){const i=e+s,r=p.context.sampleRate,o=Math.ceil(e*r),a=Math.floor(i*r),h=a-o,c=new Float32Array(h);for(let t=0;t{this._nativeAudioBufferSourceNode.removeEventListener("ended",t),It(this)&&kt(this)};this._nativeAudioBufferSourceNode.addEventListener("ended",t)}}stop(t=0){this._nativeAudioBufferSourceNode.stop(t),null!==this._audioBufferSourceNodeRenderer&&(this._audioBufferSourceNodeRenderer.stop=t)}}),yl=(Jc=Cs,Uc=Mt,Gc=be,$c=je,Hc=He,Qc=(t,e,s)=>{const n=t.destination;if(n.channelCount!==e)try{n.channelCount=e}catch{}s&&"explicit"!==n.channelCountMode&&(n.channelCountMode="explicit"),0===n.maxChannelCount&&Object.defineProperty(n,"maxChannelCount",{value:e});const i=$c(t,{channelCount:e,channelCountMode:n.channelCountMode,channelInterpretation:n.channelInterpretation,gain:1});return Hc(i,"channelCount",t=>()=>t.call(i),t=>e=>{t.call(i,e);try{n.channelCount=e}catch(t){if(e>n.maxChannelCount)throw t}}),Hc(i,"channelCountMode",t=>()=>t.call(i),e=>t=>{e.call(i,t),n.channelCountMode=t}),Hc(i,"channelInterpretation",t=>()=>t.call(i),e=>t=>{e.call(i,t),n.channelInterpretation=t}),Object.defineProperty(i,"maxChannelCount",{get:()=>n.maxChannelCount}),i.connect(n),i},class extends Jc{constructor(t,e){var s=Zc(t),n=Xc(s),e=Qc(s,e,n);super(t,!1,e,n?(n=>{const i=new WeakMap;return{render(t,e){var s=i.get(e);return void 0!==s?Promise.resolve(s):(async(t,e)=>{var s=e.destination;return i.set(e,s),await n(t,e,s),s})(t,e)}}})(Yc):null),this._isNodeOfNativeOfflineAudioContext=n,this._nativeAudioDestinationNode=e}get channelCount(){return this._nativeAudioDestinationNode.channelCount}set channelCount(t){if(this._isNodeOfNativeOfflineAudioContext)throw Gc();if(t>this._nativeAudioDestinationNode.maxChannelCount)throw Uc();this._nativeAudioDestinationNode.channelCount=t}get channelCountMode(){return this._nativeAudioDestinationNode.channelCountMode}set channelCountMode(t){if(this._isNodeOfNativeOfflineAudioContext)throw Gc();this._nativeAudioDestinationNode.channelCountMode=t}get maxChannelCount(){return this._nativeAudioDestinationNode.maxChannelCount}}),xl=(jc=dl,zc=Jt,Wc=_l,Bc=Yc=_s,()=>{const i=new WeakMap;return{render(t,e){var s=i.get(e);return void 0!==s?Promise.resolve(s):(async(t,e)=>{let s=zc(t);var n=Dt(s,e);if(!n){const jc={Q:s.Q.value,channelCount:s.channelCount,channelCountMode:s.channelCountMode,channelInterpretation:s.channelInterpretation,detune:s.detune.value,frequency:s.frequency.value,gain:s.gain.value,type:s.type};s=Lc(e,jc)}return i.set(e,s),n?(await jc(e,t.Q,s.Q),await jc(e,t.detune,s.detune),await jc(e,t.frequency,s.frequency),await jc(e,t.gain,s.gain)):(await Wc(e,t.Q,s.Q),await Wc(e,t.detune,s.detune),await Wc(e,t.frequency,s.frequency),await Wc(e,t.gain,s.gain)),await Bc(t,e,s),s})(t,e)}}}),wl=(Pc=cs,(t,e)=>Pc.set(t,e)),bl=(Jc=Cs,Ec=tl=gl,Rc=xl,qc=Te,Fc=Lc=Ie,Ic=Zc=nl=gs,Vc=Xc=il=ys,Nc=wl,class extends Jc{constructor(t,e){var s=Ic(t),e={...pe,...e},e=Fc(s,e),s=Vc(s);super(t,!1,e,s?Rc():null),this._Q=Ec(this,s,e.Q,Ft,qt),this._detune=Ec(this,s,e.detune,1200*Math.log2(Ft),-1200*Math.log2(Ft)),this._frequency=Ec(this,s,e.frequency,t.sampleRate/2,0),this._gain=Ec(this,s,e.gain,40*Math.log10(Ft),qt),this._nativeBiquadFilterNode=e,Nc(this,1)}get detune(){return this._detune}get frequency(){return this._frequency}get gain(){return this._gain}get Q(){return this._Q}get type(){return this._nativeBiquadFilterNode.type}set type(t){this._nativeBiquadFilterNode.type=t}getFrequencyResponse(t,e,s){try{this._nativeBiquadFilterNode.getFrequencyResponse(t,e,s)}catch(t){if(11===t.code)throw qc();throw t}if(t.length!==e.length||e.length!==s.length)throw qc()}}),Tl=(Oc=Bt,Mc=Ss,(r,i,o)=>{const a=new Set;return r.connect=(c=r.connect,(e,s=0,n=0)=>{var t=0===a.size;if(Mc(e))return c.call(r,e,s,n),Oc(a,[e,s,n],t=>t[0]===e&&t[1]===s&&t[2]===n,!0),t&&i(),e;c.call(r,e,s),Oc(a,[e,s],t=>t[0]===e&&t[1]===s,!0),t&&i()}),r.disconnect=(h=r.disconnect,(t,e,s)=>{var n=0{s.channelCount=1,s.channelCountMode="explicit",Object.defineProperty(s,"channelCount",{get:()=>1,set:()=>{throw Cc()}}),Object.defineProperty(s,"channelCountMode",{get:()=>"explicit",set:()=>{throw Cc()}});const n=t.createBufferSource();Dc(s,()=>{var e=s.numberOfInputs;for(let t=0;tn.disconnect(s))}),kl=(kc=bs,Ac=Sl,(t,e)=>{var s=t.createChannelMerger(e.numberOfInputs);return null!==kc&&"webkitAudioContext"===kc.name&&Ac(t,s),Oe(s,e),s}),Al=(Tc=Jt,()=>{const n=new WeakMap;return{render(t,e){var s=n.get(e);return void 0!==s?Promise.resolve(s):(async(t,e)=>{let s=Tc(t);if(!Dt(s,e)){const Tc={channelCount:s.channelCount,channelCountMode:s.channelCountMode,channelInterpretation:s.channelInterpretation,numberOfInputs:s.numberOfInputs};s=bc(e,Tc)}return n.set(e,s),await Sc(t,e,s),s})(t,e)}}}),Cl=(Jc=Cs,vc=Al,class extends Jc{constructor(t,e){var s=xc(t),e={...de,...e};super(t,!1,yc(s,e),wc(s)?vc():null)}}),Dl=(mc=Jt,()=>{const n=new WeakMap;return{render(t,e){var s=n.get(e);return void 0!==s?Promise.resolve(s):(async(t,e)=>{let s=mc(t);if(!Dt(s,e)){const mc={channelCount:s.channelCount,channelCountMode:s.channelCountMode,channelInterpretation:s.channelInterpretation,numberOfOutputs:s.numberOfOutputs};s=_c(e,mc)}return n.set(e,s),await gc(t,e,s),s})(t,e)}}}),Ol=(Jc=Cs,uc=Dl,pc=_c=Ve,class extends Jc{constructor(t,e){var s=dc(t),e={...e={...fe,...e},channelCount:e.numberOfOutputs};super(t,!1,pc(s,e),fc(s)?uc():null)}}),Ml=(lc=Dc=Tl,(t,{offset:e,...s})=>{const n=t.createBuffer(1,2,44100),i=hc(t,{buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1}),r=cc(t,{...s,gain:e}),o=n.getChannelData(0);o[0]=1,o[1]=1,i.buffer=n,i.loop=!0;e={get bufferSize(){},get channelCount(){return r.channelCount},set channelCount(t){r.channelCount=t},get channelCountMode(){return r.channelCountMode},set channelCountMode(t){r.channelCountMode=t},get channelInterpretation(){return r.channelInterpretation},set channelInterpretation(t){r.channelInterpretation=t},get context(){return r.context},get inputs(){return[]},get numberOfInputs(){return i.numberOfInputs},get numberOfOutputs(){return r.numberOfOutputs},get offset(){return r.gain},get onended(){return i.onended},set onended(t){i.onended=t},addEventListener:(...t)=>i.addEventListener(t[0],t[1],t[2]),dispatchEvent:(...t)=>i.dispatchEvent(t[0]),removeEventListener:(...t)=>i.removeEventListener(t[0],t[1],t[2]),start(t=0){i.start.call(i,t)},stop(t=0){i.stop.call(i,t)}};return ac(t,i),lc(Ne(e,r),()=>i.connect(r),()=>i.disconnect(r))}),El=(sc=ac=ul,nc=us,ic=Ml,rc=Ke,oc=es,(t,e)=>{if(void 0===t.createConstantSource)return ic(t,e);var s=t.createConstantSource();return Oe(s,e),Ee(s,e,"offset"),nc(rc,()=>rc(t))||Re(s),nc(oc,()=>oc(t))||qe(s),sc(t,s),s}),Rl=(Kh=Jt,()=>{const i=new WeakMap;let r=null,o=null;return{set start(t){r=t},set stop(t){o=t},render(t,e){var s=i.get(e);return void 0!==s?Promise.resolve(s):(async(t,e)=>{let s=Kh(t);var n=Dt(s,e);if(!n){const Hh={channelCount:s.channelCount,channelCountMode:s.channelCountMode,channelInterpretation:s.channelInterpretation,offset:s.offset.value};s=Jh(e,Hh),null!==r&&s.start(r),null!==o&&s.stop(o)}return i.set(e,s),n?await Hh(e,t.offset,s.offset):await tc(e,t.offset,s.offset),await ec(t,e,s),s})(t,e)}}}),ql=(Jc=Cs,Qh=Rl,$h=rs,class extends Jc{constructor(t,e){var s=Xh(t),n={..._e,...e},e=Zh(s,n),n=Yh(s),s=n?Qh():null;super(t,!1,e,s),this._constantSourceNodeRenderer=s,this._nativeConstantSourceNode=e,this._offset=Gh(this,n,e.offset,Ft,qt),this._onended=null}get offset(){return this._offset}get onended(){return this._onended}set onended(t){var e="function"==typeof t?$h(this,t):null;this._nativeConstantSourceNode.onended=e;var s=this._nativeConstantSourceNode.onended;this._onended=null!==s&&s===e?t:s}start(t=0){if(this._nativeConstantSourceNode.start(t),null!==this._constantSourceNodeRenderer&&(this._constantSourceNodeRenderer.start=t),"closed"!==this.context.state){Tt(this);const t=()=>{this._nativeConstantSourceNode.removeEventListener("ended",t),It(this)&&kt(this)};this._nativeConstantSourceNode.addEventListener("ended",t)}}stop(t=0){this._nativeConstantSourceNode.stop(t),null!==this._constantSourceNodeRenderer&&(this._constantSourceNodeRenderer.stop=t)}}),Fl=(t,e)=>{const s=t.createConvolver();if(Oe(s,e),e.disableNormalization===s.normalize&&(s.normalize=!e.disableNormalization),De(s,e,"buffer"),2()=>t.call(s),e=>t=>{if(2()=>t.call(s),e=>t=>{if("max"===t)throw Bh();return e.call(s,t)}),s},Il=(zh=Jt,()=>{const n=new WeakMap;return{render(t,e){var s=n.get(e);return void 0!==s?Promise.resolve(s):(async(t,e)=>{let s=zh(t);if(!Dt(s,e)){const zh={buffer:s.buffer,channelCount:s.channelCount,channelCountMode:s.channelCountMode,channelInterpretation:s.channelInterpretation,disableNormalization:!s.normalize};s=Lh(e,zh)}return n.set(e,s),Qt(s)?await Wh(t,e,s.inputs[0]):await Wh(t,e,s),s})(t,e)}}}),Vl=(Jc=Cs,Ih=Il,Vh=Lh=Fl,class extends Jc{constructor(t,e){var s=Nh(t),n={...me,...e},e=Vh(s,n);super(t,!1,e,Ph(s)?Ih():null),this._isBufferNullified=!1,this._nativeConvolverNode=e,null!==n.buffer&&jh(this,n.buffer.duration)}get buffer(){return this._isBufferNullified?null:this._nativeConvolverNode.buffer}set buffer(t){if(null===(this._nativeConvolverNode.buffer=t)&&null!==this._nativeConvolverNode.buffer){const t=this._nativeConvolverNode.context;this._nativeConvolverNode.buffer=t.createBuffer(1,1,44100),this._isBufferNullified=!0,jh(this,0)}else this._isBufferNullified=!1,jh(this,null===this._nativeConvolverNode.buffer?0:this._nativeConvolverNode.buffer.duration)}get normalize(){return this._nativeConvolverNode.normalize}set normalize(t){this._nativeConvolverNode.normalize=t}}),Nl=(Rh=Jt,i=>{const r=new WeakMap;return{render(t,e){var s=r.get(e);return void 0!==s?Promise.resolve(s):(async(t,e)=>{let s=Rh(t);var n=Dt(s,e);if(!n){const Mh={channelCount:s.channelCount,channelCountMode:s.channelCountMode,channelInterpretation:s.channelInterpretation,delayTime:s.delayTime.value,maxDelayTime:i};s=Eh(e,Mh)}return r.set(e,s),n?await Mh(e,t.delayTime,s.delayTime):await qh(e,t.delayTime,s.delayTime),await Fh(t,e,s),s})(t,e)}}}),Pl=(Jc=Cs,kh=Nl,Ah=Eh=Pe,class extends Jc{constructor(t,e){var s=Ch(t),n={...ve,...e},e=Ah(s,n),s=Dh(s);super(t,!1,e,s?kh(n.maxDelayTime):null),this._delayTime=Sh(this,s,e.delayTime),Oh(this,n.maxDelayTime)}get delayTime(){return this._delayTime}}),jl=(t,e)=>{t=t.createDynamicsCompressor();if(Oe(t,e),2{const i=new WeakMap;return{render(t,e){var s=i.get(e);return void 0!==s?Promise.resolve(s):(async(t,e)=>{let s=xh(t);var n=Dt(s,e);if(!n){const vh={attack:s.attack.value,channelCount:s.channelCount,channelCountMode:s.channelCountMode,channelInterpretation:s.channelInterpretation,knee:s.knee.value,ratio:s.ratio.value,release:s.release.value,threshold:s.threshold.value};s=yh(e,vh)}return i.set(e,s),n?(await vh(e,t.attack,s.attack),await vh(e,t.knee,s.knee),await vh(e,t.ratio,s.ratio),await vh(e,t.release,s.release),await vh(e,t.threshold,s.threshold)):(await wh(e,t.attack,s.attack),await wh(e,t.knee,s.knee),await wh(e,t.ratio,s.ratio),await wh(e,t.release,s.release),await wh(e,t.threshold,s.threshold)),await bh(t,e,s),s})(t,e)}}}),zl=(Jc=Cs,ph=Ll,dh=yh=jl,class extends Jc{constructor(t,e){var s=_h(t),e={...xe,...e},e=dh(s,e),s=mh(s);super(t,!1,e,s?ph():null),this._attack=uh(this,s,e.attack),this._knee=uh(this,s,e.knee),this._nativeDynamicsCompressorNode=e,this._ratio=uh(this,s,e.ratio),this._release=uh(this,s,e.release),this._threshold=uh(this,s,e.threshold),gh(this,.006)}get attack(){return this._attack}get channelCount(){return this._nativeDynamicsCompressorNode.channelCount}set channelCount(t){var e=this._nativeDynamicsCompressorNode.channelCount;if(2<(this._nativeDynamicsCompressorNode.channelCount=t))throw this._nativeDynamicsCompressorNode.channelCount=e,fh()}get channelCountMode(){return this._nativeDynamicsCompressorNode.channelCountMode}set channelCountMode(t){var e=this._nativeDynamicsCompressorNode.channelCountMode;if("max"===(this._nativeDynamicsCompressorNode.channelCountMode=t))throw this._nativeDynamicsCompressorNode.channelCountMode=e,fh()}get knee(){return this._knee}get ratio(){return this._ratio}get reduction(){return"number"==typeof this._nativeDynamicsCompressorNode.reduction.value?this._nativeDynamicsCompressorNode.reduction.value:this._nativeDynamicsCompressorNode.reduction}get release(){return this._release}get threshold(){return this._threshold}}),Wl=(oh=vh=Mh=Hh=dl,hh=Jt,ch=wh=qh=tc=_l,()=>{const i=new WeakMap;return{render(t,e){var s=i.get(e);return void 0!==s?Promise.resolve(s):(async(t,e)=>{let s=hh(t);var n=Dt(s,e);if(!n){const oh={channelCount:s.channelCount,channelCountMode:s.channelCountMode,channelInterpretation:s.channelInterpretation,gain:s.gain.value};s=ah(e,oh)}return i.set(e,s),n?await oh(e,t.gain,s.gain):await ch(e,t.gain,s.gain),await lh(t,e,s),s})(t,e)}}}),Bl=(Jc=Cs,sh=Wl,class extends Jc{constructor(t,e){var s=ih(t),e={...we,...e},e=nh(s,e),s=rh(s);super(t,!1,e,s?sh():null),this._gain=eh(this,s,e.gain,Ft,qt)}get gain(){return this._gain}}),Ul=(Ha=Te,Ja=be,(t,e,{channelCount:s,channelCountMode:n,channelInterpretation:i,feedback:r,feedforward:o})=>{const a=Fe(e,t.sampleRate),l=r instanceof Float64Array?r:new Float64Array(r),u=o instanceof Float64Array?o:new Float64Array(o),h=l.length,c=u.length,p=Math.min(h,c);if(0===h||20{const e=t.inputBuffer,s=t.outputBuffer,n=e.numberOfChannels;for(let t=0;td.addEventListener(t[0],t[1],t[2]),dispatchEvent:(...t)=>d.dispatchEvent(t[0]),getFrequencyResponse(e,s,n){if(e.length!==s.length||s.length!==n.length)throw Ha();const i=e.length;for(let t=0;td.removeEventListener(t[0],t[1],t[2])},d)}),Gl=(Ga=us,Ya=Qa=nh=ah=cc=je,$a=vs,Xa=()=>{if(null===$a)return Promise.resolve(!1);const e=new $a(1,1,44100),s=Ya(e,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0});return new Promise(t=>{e.oncomplete=()=>{s.disconnect(),t(0!==e.currentTime)},e.startRendering()})},n=>Ga(Ce,()=>Ce(n))?Promise.resolve(Ga(Xa,Xa)).then(t=>{if(!t){const t=Za(n,512,0,1);n.oncomplete=()=>{t.onaudioprocess=null,t.disconnect()},t.onaudioprocess=()=>n.currentTime,t.connect(n.destination)}return n.startRendering()}):new Promise(e=>{const s=Qa(n,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0});n.oncomplete=t=>{s.disconnect(),e(t.renderedBuffer)},s.connect(n.destination),n.startRendering()})),Ql=(La=hc=fl,za=Jt,Wa=vs,Ba=lh=bh=Fh=Wh=ec=gc=Sc=_s,Ua=Gl,(r,o)=>{const a=new WeakMap;let h=null;return{render(t,e){var s=a.get(e);return void 0!==s?Promise.resolve(s):(async(t,e)=>{let s=null,n=za(t);var i=Dt(n,e);if(void 0===e.createIIRFilter?s=La(e,{buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1}):i||(n=e.createIIRFilter(o,r)),a.set(e,null===s?n:s),null===s)return await Ba(t,e,n),n;{if(null===h){if(null===Wa)throw new Error("Missing the native OfflineAudioContext constructor.");const La=new Wa(t.context.destination.channelCount,t.context.length,e.sampleRate);h=(async()=>(await Ba(t,La,La.destination),((e,t,s,n)=>{const i=s instanceof Float64Array?s:new Float64Array(s),r=n instanceof Float64Array?n:new Float64Array(n),o=i.length,a=r.length,h=Math.min(o,a);if(1!==i[0]){for(let t=0;t{if(void 0===t.createIIRFilter)return ja(t,e,s);t=t.createIIRFilter(s.feedforward,s.feedback);return Oe(t,s),t}),Xl=(Jc=Cs,Fa=Zl,Ia=Ql,Va=ih=_h=Ch=Nh=Xh=dc=xc=gs,Pa=gh=Oh=jh=wl,class extends Jc{constructor(t,e){var n,i,s=Va(t),r=Na(s),e={...Se,...e},s=Fa(s,r?null:t.baseLatency,e);super(t,!1,s,r?Ia(e.feedback,e.feedforward):null),(n=s).getFrequencyResponse=(i=n.getFrequencyResponse,(t,e,s)=>{if(t.length!==e.length||e.length!==s.length)throw Te();return i.call(n,t,e,s)}),this._nativeIIRFilterNode=s,Pa(this,1)}getFrequencyResponse(t,e,s){return this._nativeIIRFilterNode.getFrequencyResponse(t,e,s)}}),Yl=(Aa=eh=uh=Sh=Gh=gl,Ca=yc=bc=kl,Da=Zh=Jh=El,Oa=Za=Ka=ze,Ma=th=fh=Th=Bh=We,Ea=Ye,Ra=Na=rh=mh=Dh=Ph=Yh=fc=wc=ys,qa=Uh=He,(_,m)=>{const a=m.listener,{forwardX:t,forwardY:e,forwardZ:s,positionX:n,positionY:i,positionZ:r,upX:o,upY:h,upZ:c}=void 0===a.forwardX?(()=>{const n=new Float32Array(1),p=Ca(m,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:9}),d=Ra(m);let e=!1,i=[0,0,-1,0,1,0],r=[0,0,0];const f=()=>{if(!e){e=!0;const t=Oa(m,256,9,0);t.onaudioprocess=({inputBuffer:t})=>{const e=[Ea(t,n,0),Ea(t,n,1),Ea(t,n,2),Ea(t,n,3),Ea(t,n,4),Ea(t,n,5)];e.some((t,e)=>t!==i[e])&&(a.setOrientation(...e),i=e);const s=[Ea(t,n,6),Ea(t,n,7),Ea(t,n,8)];s.some((t,e)=>t!==r[e])&&(a.setPosition(...s),r=s)},p.connect(t)}},t=e=>t=>{t!==i[e]&&(i[e]=t,a.setOrientation(...i))},s=e=>t=>{t!==r[e]&&(r[e]=t,a.setPosition(...r))},o=(t,e,s)=>{const n=Da(m,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",offset:e});n.connect(p,0,t),n.start(),Object.defineProperty(n.offset,"defaultValue",{get:()=>e});const i=Aa({context:_},d,n.offset,Ft,qt);var r,o,a,h,c,l,u;return qa(i,"value",t=>()=>t.call(i),e=>t=>{try{e.call(i,t)}catch(t){if(9!==t.code)throw t}f(),d&&s(t)}),i.cancelAndHoldAtTime=(r=i.cancelAndHoldAtTime,d?()=>{throw Ma()}:(...t)=>{t=r.apply(i,t);return f(),t}),i.cancelScheduledValues=(o=i.cancelScheduledValues,d?()=>{throw Ma()}:(...t)=>{t=o.apply(i,t);return f(),t}),i.exponentialRampToValueAtTime=(a=i.exponentialRampToValueAtTime,d?()=>{throw Ma()}:(...t)=>{t=a.apply(i,t);return f(),t}),i.linearRampToValueAtTime=(h=i.linearRampToValueAtTime,d?()=>{throw Ma()}:(...t)=>{t=h.apply(i,t);return f(),t}),i.setTargetAtTime=(c=i.setTargetAtTime,d?()=>{throw Ma()}:(...t)=>{t=c.apply(i,t);return f(),t}),i.setValueAtTime=(l=i.setValueAtTime,d?()=>{throw Ma()}:(...t)=>{t=l.apply(i,t);return f(),t}),i.setValueCurveAtTime=(u=i.setValueCurveAtTime,d?()=>{throw Ma()}:(...t)=>{t=u.apply(i,t);return f(),t}),i};return{forwardX:o(0,0,t(0)),forwardY:o(1,0,t(1)),forwardZ:o(2,-1,t(2)),positionX:o(6,0,s(0)),positionY:o(7,0,s(1)),positionZ:o(8,0,s(2)),upX:o(3,0,t(3)),upY:o(4,1,t(4)),upZ:o(5,0,t(5))}})():a;return{get forwardX(){return t},get forwardY(){return e},get forwardZ(){return s},get positionX(){return n},get positionY(){return i},get positionZ(){return r},get upX(){return o},get upY(){return h},get upZ(){return c}}}),$l=new WeakMap,Hl=(wa=yl,ba=Yl,Sa=$l,class extends ws{constructor(t,e){super(t),this._nativeContext=t,ct.set(this,t),Ta(t)&&Sa.set(t,new Set),this._destination=new wa(this,e),this._listener=ba(this,t),this._onstatechange=null}get currentTime(){return this._nativeContext.currentTime}get destination(){return this._destination}get listener(){return this._listener}get onstatechange(){return this._onstatechange}set onstatechange(t){var e="function"==typeof t?ka(this,t):null;this._nativeContext.onstatechange=e;var s=this._nativeContext.onstatechange;this._onstatechange=null!==s&&s===e?t:s}get sampleRate(){return this._nativeContext.sampleRate}get state(){return this._nativeContext.state}}),Jl=(_a=ul,ma=us,ga=Ke,va=ts,ya=es,xa=is,(t,e)=>{const s=t.createOscillator();return Oe(s,e),Ee(s,e,"detune"),Ee(s,e,"frequency"),void 0!==e.periodicWave?s.setPeriodicWave(e.periodicWave):De(s,e,"type"),ma(ga,()=>ga(t))||Re(s),ma(va,()=>va(t))||xa(s,t),ma(ya,()=>ya(t))||qe(s),_a(t,s),s}),Kl=(pa=Jt,()=>{const i=new WeakMap;let r=null,o=null,a=null;return{set periodicWave(t){r=t},set start(t){o=t},set stop(t){a=t},render(t,e){var s=i.get(e);return void 0!==s?Promise.resolve(s):(async(t,e)=>{let s=pa(t);var n=Dt(s,e);if(!n){const la={channelCount:s.channelCount,channelCountMode:s.channelCountMode,channelInterpretation:s.channelInterpretation,detune:s.detune.value,frequency:s.frequency.value,periodicWave:null===r?void 0:r,type:s.type};s=ua(e,la),null!==o&&s.start(o),null!==a&&s.stop(a)}return i.set(e,s),n?(await la(e,t.detune,s.detune),await la(e,t.frequency,s.frequency)):(await da(e,t.detune,s.detune),await da(e,t.frequency,s.frequency)),await fa(t,e,s),s})(t,e)}}}),tu=(Jc=Cs,ra=ua=Jl,oa=Kl,ca=ka=rs,class extends Jc{constructor(t,e){var s=aa(t),n={...Ue,...e},i=ra(s,n),r=ha(s),e=r?oa():null,s=t.sampleRate/2;super(t,!1,i,e),this._detune=ia(this,r,i.detune,153600,-153600),this._frequency=ia(this,r,i.frequency,s,-s),this._nativeOscillatorNode=i,this._onended=null,this._oscillatorNodeRenderer=e,null!==this._oscillatorNodeRenderer&&void 0!==n.periodicWave&&(this._oscillatorNodeRenderer.periodicWave=n.periodicWave)}get detune(){return this._detune}get frequency(){return this._frequency}get onended(){return this._onended}set onended(t){var e="function"==typeof t?ca(this,t):null;this._nativeOscillatorNode.onended=e;var s=this._nativeOscillatorNode.onended;this._onended=null!==s&&s===e?t:s}get type(){return this._nativeOscillatorNode.type}set type(t){this._nativeOscillatorNode.type=t,null!==this._oscillatorNodeRenderer&&(this._oscillatorNodeRenderer.periodicWave=null)}setPeriodicWave(t){this._nativeOscillatorNode.setPeriodicWave(t),null!==this._oscillatorNodeRenderer&&(this._oscillatorNodeRenderer.periodicWave=t)}start(t=0){if(this._nativeOscillatorNode.start(t),null!==this._oscillatorNodeRenderer&&(this._oscillatorNodeRenderer.start=t),"closed"!==this.context.state){Tt(this);const t=()=>{this._nativeOscillatorNode.removeEventListener("ended",t),It(this)&&kt(this)};this._nativeOscillatorNode.addEventListener("ended",t)}}stop(t=0){this._nativeOscillatorNode.stop(t),null!==this._oscillatorNodeRenderer&&(this._oscillatorNodeRenderer.stop=t)}}),eu=(na=fl,(t,e)=>{const s=na(t,{buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1}),n=t.createBuffer(1,2,44100);return s.buffer=n,s.loop=!0,s.connect(e),s.start(),()=>{s.stop(),s.disconnect(e)}}),su=(Ko=be,(r,{curve:t,oversample:e,...s})=>{const o=r.createWaveShaper(),a=r.createWaveShaper();Oe(o,s),Oe(a,s);const h=ta(r,{...s,gain:1}),n=ta(r,{...s,gain:-1}),i=ta(r,{...s,gain:1}),c=ta(r,{...s,gain:-1});let l=null,u=!1,p=null;const d={get bufferSize(){},get channelCount(){return o.channelCount},set channelCount(t){h.channelCount=t,n.channelCount=t,o.channelCount=t,i.channelCount=t,a.channelCount=t,c.channelCount=t},get channelCountMode(){return o.channelCountMode},set channelCountMode(t){h.channelCountMode=t,n.channelCountMode=t,o.channelCountMode=t,i.channelCountMode=t,a.channelCountMode=t,c.channelCountMode=t},get channelInterpretation(){return o.channelInterpretation},set channelInterpretation(t){h.channelInterpretation=t,n.channelInterpretation=t,o.channelInterpretation=t,i.channelInterpretation=t,a.channelInterpretation=t,c.channelInterpretation=t},get context(){return o.context},get curve(){return p},set curve(e){if(null!==e&&e.length<2)throw Ko();if(null===e)o.curve=e,a.curve=e;else{const Jo=e.length,Ko=new Float32Array(Jo+2-Jo%2),ea=new Float32Array(Jo+2-Jo%2);Ko[0]=e[0],ea[0]=-e[Jo-1];const s=Math.ceil((Jo+1)/2),r=(Jo+1)/2-1;for(let t=1;th.addEventListener(t[0],t[1],t[2]),dispatchEvent:(...t)=>h.dispatchEvent(t[0]),removeEventListener:(...t)=>h.removeEventListener(t[0],t[1],t[2])};return null!==t&&(d.curve=t instanceof Float32Array?t:new Float32Array(t)),e!==d.oversample&&(d.oversample=e),sa(Ne(d,i),()=>{h.connect(o).connect(i),h.connect(n).connect(a).connect(c).connect(i),u=!0,ea(p)&&(l=Jo(r,h))},()=>{h.disconnect(o),o.disconnect(i),h.disconnect(n),n.disconnect(a),a.disconnect(c),c.disconnect(i),u=!1,null!==l&&(l(),l=null)})}),nu=(Go=Jo=eu,Qo=be,Zo=su,Xo=ea=$e,$o=bs,Ho=He,(s,t)=>{const n=s.createWaveShaper();if(null!==$o&&"webkitAudioContext"===$o.name&&void 0===s.createGain().gain.automationRate)return Zo(s,t);Oe(n,t);var e=null===t.curve||t.curve instanceof Float32Array?t.curve:new Float32Array(t.curve);if(null!==e&&e.length<2)throw Qo();De(n,{curve:e},"curve"),De(n,t,"oversample");let i=null,r=!1;return Ho(n,"curve",t=>()=>t.call(n),e=>t=>(e.call(n,t),r&&(Xo(t)&&null===i?i=Go(s,n):Xo(t)||null===i||(i(),i=null)),t)),Yo(n,()=>{r=!0,Xo(n.curve)&&(i=Go(s,n))},()=>{r=!1,null!==i&&(i(),i=null)})}),iu=(Io=Zt,Vo=be,jo=ze,Lo=nu,zo=We,Wo=Ht,Bo=Ye,Uo=Yo=sa=Tl,(t,{coneInnerAngle:e,coneOuterAngle:s,coneOuterGain:n,distanceModel:i,maxDistance:r,orientationX:o,orientationY:a,orientationZ:h,panningModel:c,positionX:l,positionY:u,positionZ:p,refDistance:d,rolloffFactor:f,..._})=>{const m=t.createPanner();if(2<_.channelCount)throw zo();if("max"===_.channelCountMode)throw zo();Oe(m,_);const g={channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete"},v=No(t,{...g,channelInterpretation:"speakers",numberOfInputs:6}),y=Po(t,{..._,gain:1}),x=Po(t,{...g,gain:1}),w=Po(t,{...g,gain:0}),b=Po(t,{...g,gain:0}),T=Po(t,{...g,gain:0}),S=Po(t,{...g,gain:0}),k=Po(t,{...g,gain:0}),A=jo(t,256,6,1),C=Lo(t,{...g,curve:new Float32Array([1,1]),oversample:"none"});let D=[o,a,h],O=[l,u,p];const M=new Float32Array(1);A.onaudioprocess=({inputBuffer:t})=>{const e=[Bo(t,M,0),Bo(t,M,1),Bo(t,M,2)];e.some((t,e)=>t!==D[e])&&(m.setOrientation(...e),D=e);const s=[Bo(t,M,3),Bo(t,M,4),Bo(t,M,5)];s.some((t,e)=>t!==O[e])&&(m.setPosition(...s),O=s)},Object.defineProperty(w.gain,"defaultValue",{get:()=>0}),Object.defineProperty(b.gain,"defaultValue",{get:()=>0}),Object.defineProperty(T.gain,"defaultValue",{get:()=>0}),Object.defineProperty(S.gain,"defaultValue",{get:()=>0}),Object.defineProperty(k.gain,"defaultValue",{get:()=>0});const E={get bufferSize(){},get channelCount(){return m.channelCount},set channelCount(t){if(2y.addEventListener(t[0],t[1],t[2]),dispatchEvent:(...t)=>y.dispatchEvent(t[0]),removeEventListener:(...t)=>y.removeEventListener(t[0],t[1],t[2])};return e!==E.coneInnerAngle&&(E.coneInnerAngle=e),s!==E.coneOuterAngle&&(E.coneOuterAngle=s),n!==E.coneOuterGain&&(E.coneOuterGain=n),i!==E.distanceModel&&(E.distanceModel=i),r!==E.maxDistance&&(E.maxDistance=r),o!==E.orientationX.value&&(E.orientationX.value=o),a!==E.orientationY.value&&(E.orientationY.value=a),h!==E.orientationZ.value&&(E.orientationZ.value=h),c!==E.panningModel&&(E.panningModel=c),l!==E.positionX.value&&(E.positionX.value=l),u!==E.positionY.value&&(E.positionY.value=u),p!==E.positionZ.value&&(E.positionZ.value=p),d!==E.refDistance&&(E.refDistance=d),f!==E.rolloffFactor&&(E.rolloffFactor=f),1===D[0]&&0===D[1]&&0===D[2]||m.setOrientation(...D),0===O[0]&&0===O[1]&&0===O[2]||m.setPosition(...O),Uo(Ne(E,m),()=>{y.connect(m),Io(y,C,0,0),C.connect(x).connect(v,0,0),C.connect(w).connect(v,0,1),C.connect(b).connect(v,0,2),C.connect(T).connect(v,0,3),C.connect(S).connect(v,0,4),C.connect(k).connect(v,0,5),v.connect(A).connect(t.destination)},()=>{y.disconnect(m),Wo(y,C,0,0),C.disconnect(x),x.disconnect(v),C.disconnect(w),w.disconnect(v),C.disconnect(b),b.disconnect(v),C.disconnect(T),T.disconnect(v),C.disconnect(S),S.disconnect(v),C.disconnect(k),k.disconnect(v),v.disconnect(A),A.disconnect(t.destination)})}),ru=(Fo=iu,(t,e)=>{var s=t.createPanner();return void 0===s.orientationX?Fo(t,e):(Oe(s,e),Ee(s,e,"orientationX"),Ee(s,e,"orientationY"),Ee(s,e,"orientationZ"),Ee(s,e,"positionX"),Ee(s,e,"positionY"),Ee(s,e,"positionZ"),De(s,e,"coneInnerAngle"),De(s,e,"coneOuterAngle"),De(s,e,"coneOuterGain"),De(s,e,"distanceModel"),De(s,e,"maxDistance"),De(s,e,"panningModel"),De(s,e,"refDistance"),De(s,e,"rolloffFactor"),s)}),ou=(So=la=dl,ko=No=kl,Ao=El,Co=Po=ta=je,Oo=Jt,Mo=vs,Eo=da=_l,Ro=fa=_s,qo=Gl,()=>{const c=new WeakMap;let l=null;return{render(t,e){var s=c.get(e);return void 0!==s?Promise.resolve(s):(async(t,r)=>{let o=null,e=Oo(t);var a={channelCount:e.channelCount,channelCountMode:e.channelCountMode,channelInterpretation:e.channelInterpretation},h={...a,coneInnerAngle:e.coneInnerAngle,coneOuterAngle:e.coneOuterAngle,coneOuterGain:e.coneOuterGain,distanceModel:e.distanceModel,maxDistance:e.maxDistance,panningModel:e.panningModel,refDistance:e.refDistance,rolloffFactor:e.rolloffFactor},s=Dt(e,r);if("bufferSize"in e)o=Co(r,{...a,gain:1});else if(!s){const So={...h,orientationX:e.orientationX.value,orientationY:e.orientationY.value,orientationZ:e.orientationZ.value,positionX:e.positionX.value,positionY:e.positionY.value,positionZ:e.positionZ.value};e=Do(r,So)}if(c.set(r,null===o?e:o),null===o)return s?(await So(r,t.orientationX,e.orientationX),await So(r,t.orientationY,e.orientationY),await So(r,t.orientationZ,e.orientationZ),await So(r,t.positionX,e.positionX),await So(r,t.positionY,e.positionY),await So(r,t.positionZ,e.positionZ)):(await Eo(r,t.orientationX,e.orientationX),await Eo(r,t.orientationY,e.orientationY),await Eo(r,t.orientationZ,e.orientationZ),await Eo(r,t.positionX,e.positionX),await Eo(r,t.positionY,e.positionY),await Eo(r,t.positionZ,e.positionZ)),Qt(e)?await Ro(t,r,e.inputs[0]):await Ro(t,r,e),e;{if(null===l){if(null===Mo)throw new Error("Missing the native OfflineAudioContext constructor.");const So=new Mo(6,t.context.length,r.sampleRate),Co=ko(So,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:6});Co.connect(So.destination),l=(async()=>{const e=await Promise.all([t.orientationX,t.orientationY,t.orientationZ,t.positionX,t.positionY,t.positionZ].map(async(t,e)=>{e=Ao(So,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",offset:0===e?1:0});return await Eo(So,t,e.offset),e}));for(let t=0;t<6;t+=1)e[t].connect(Co,0,t),e[t].start(0);return qo(So)})()}const So=await l,Oo=Co(r,{...a,gain:1});await Ro(t,r,Oo);const c=[];for(let t=0;tt!==s[e])||Ao.some((t,e)=>t!==n[e])){s=So,n=Ao;const Mo=t/r.sampleRate;e.gain.setValueAtTime(0,Mo),e=Co(r,{...a,gain:0}),i=Do(r,{...h,orientationX:s[0],orientationY:s[1],orientationZ:s[2],positionX:n[0],positionY:n[1],positionZ:n[2]}),e.gain.setValueAtTime(1,Mo),Oo.connect(e).connect(i.inputs[0]),i.connect(o)}}return o}})(t,e)}}}),au=(Jc=Cs,vo=ia=gl,yo=Do=ru,xo=ou,bo=ha=Ta=ys,To=wl,class extends Jc{constructor(t,e){var s=wo(t),e={...Ge,...e},e=yo(s,e),s=bo(s);super(t,!1,e,s?xo():null),this._nativePannerNode=e,this._orientationX=vo(this,s,e.orientationX,Ft,qt),this._orientationY=vo(this,s,e.orientationY,Ft,qt),this._orientationZ=vo(this,s,e.orientationZ,Ft,qt),this._positionX=vo(this,s,e.positionX,Ft,qt),this._positionY=vo(this,s,e.positionY,Ft,qt),this._positionZ=vo(this,s,e.positionZ,Ft,qt),To(this,1)}get coneInnerAngle(){return this._nativePannerNode.coneInnerAngle}set coneInnerAngle(t){this._nativePannerNode.coneInnerAngle=t}get coneOuterAngle(){return this._nativePannerNode.coneOuterAngle}set coneOuterAngle(t){this._nativePannerNode.coneOuterAngle=t}get coneOuterGain(){return this._nativePannerNode.coneOuterGain}set coneOuterGain(t){this._nativePannerNode.coneOuterGain=t}get distanceModel(){return this._nativePannerNode.distanceModel}set distanceModel(t){this._nativePannerNode.distanceModel=t}get maxDistance(){return this._nativePannerNode.maxDistance}set maxDistance(t){this._nativePannerNode.maxDistance=t}get orientationX(){return this._orientationX}get orientationY(){return this._orientationY}get orientationZ(){return this._orientationZ}get panningModel(){return this._nativePannerNode.panningModel}set panningModel(t){this._nativePannerNode.panningModel=t}get positionX(){return this._positionX}get positionY(){return this._positionY}get positionZ(){return this._positionZ}get refDistance(){return this._nativePannerNode.refDistance}set refDistance(t){this._nativePannerNode.refDistance=t}get rolloffFactor(){return this._nativePannerNode.rolloffFactor}set rolloffFactor(t){this._nativePannerNode.rolloffFactor=t}}),hu=(go=Mt,(t,{disableNormalization:e,imag:s,real:n})=>{var i=s instanceof Float32Array?s:new Float32Array(s),n=n instanceof Float32Array?n:new Float32Array(n),e=t.createPeriodicWave(n,i,{disableNormalization:e});if(Array.from(s).length<2)throw go();return e}),cu=(po=hu,fo=wo=aa=gs,_o=new WeakSet,class mo{constructor(t,e){t=fo(t),e=(t=>{var{imag:e,real:s}=t;return void 0===e?void 0===s?{...t,imag:[0,0],real:[0,0]}:{...t,imag:Array.from(s,()=>0),real:s}:void 0===s?{...t,imag:e,real:Array.from(e,()=>0)}:{...t,imag:e,real:s}})({...Qe,...e}),e=po(t,e);return _o.add(e),e}static[Symbol.hasInstance](t){return null!==t&&"object"==typeof t&&Object.getPrototypeOf(t)===mo.prototype||_o.has(t)}}),lu=((u,y,x,w,p,d)=>{const b=16385,T=new Float32Array([1,1]),S=Math.PI/2,k={channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete"},A={...k,oversample:"none"},f=(t,e,s,n,i)=>{if(1===e)return((t,e,s,n)=>{const i=new Float32Array(b),r=new Float32Array(b);for(let t=0;t{const i=new Float32Array(b),r=new Float32Array(b),o=new Float32Array(b),a=new Float32Array(b),h=Math.floor(8192.5);for(let t=0;th){const y=(t-h)/(16384-h)*S;i[t]=Math.cos(y),r[t]=Math.sin(y),o[t]=0,a[t]=1}else{const y=t/(16384-h)*S;i[t]=1,r[t]=0,o[t]=Math.cos(y),a[t]=Math.sin(y)}const c=y(t,{channelCount:2,channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:2}),l=x(t,{...k,gain:0}),u=w(t,{...A,curve:i}),p=x(t,{...k,gain:0}),d=w(t,{...A,curve:r}),f=w(t,{...A,curve:T}),_=x(t,{...k,gain:0}),m=w(t,{...A,curve:o}),g=x(t,{...k,gain:0}),v=w(t,{...A,curve:a});return{connectGraph(){e.connect(c),e.connect(void 0===f.inputs?f:f.inputs[0]),c.connect(l,0),c.connect(p,0),c.connect(_,1),c.connect(g,1),f.connect(s),s.connect(void 0===u.inputs?u:u.inputs[0]),s.connect(void 0===d.inputs?d:d.inputs[0]),s.connect(void 0===m.inputs?m:m.inputs[0]),s.connect(void 0===v.inputs?v:v.inputs[0]),u.connect(l.gain),d.connect(p.gain),m.connect(_.gain),v.connect(g.gain),l.connect(n,0,0),_.connect(n,0,0),p.connect(n,0,1),g.connect(n,0,1)},disconnectGraph(){e.disconnect(c),e.disconnect(void 0===f.inputs?f:f.inputs[0]),c.disconnect(l,0),c.disconnect(p,0),c.disconnect(_,1),c.disconnect(g,1),f.disconnect(s),s.disconnect(void 0===u.inputs?u:u.inputs[0]),s.disconnect(void 0===d.inputs?d:d.inputs[0]),s.disconnect(void 0===m.inputs?m:m.inputs[0]),s.disconnect(void 0===v.inputs?v:v.inputs[0]),u.disconnect(l.gain),d.disconnect(p.gain),m.disconnect(_.gain),v.disconnect(g.gain),l.disconnect(n,0,0),_.disconnect(n,0,0),p.disconnect(n,0,1),g.disconnect(n,0,1)}}})(t,s,n,i);throw p()};return(e,{channelCount:t,channelCountMode:s,pan:n,...i})=>{if("max"===s)throw p();const r=u(e,{...i,channelCount:1,channelCountMode:s,numberOfInputs:2}),o=x(e,{...i,channelCount:t,channelCountMode:s,gain:1}),a=x(e,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:n});let{connectGraph:h,disconnectGraph:c}=f(e,t,o,a,r);Object.defineProperty(a.gain,"defaultValue",{get:()=>0}),Object.defineProperty(a.gain,"maxValue",{get:()=>1}),Object.defineProperty(a.gain,"minValue",{get:()=>-1});t={get bufferSize(){},get channelCount(){return o.channelCount},set channelCount(t){o.channelCount!==t&&(l&&c(),{connectGraph:h,disconnectGraph:c}=f(e,t,o,a,r),l&&h()),o.channelCount=t},get channelCountMode(){return o.channelCountMode},set channelCountMode(t){if("clamped-max"===t||"max"===t)throw p();o.channelCountMode=t},get channelInterpretation(){return o.channelInterpretation},set channelInterpretation(t){o.channelInterpretation=t},get context(){return o.context},get inputs(){return[o]},get numberOfInputs(){return o.numberOfInputs},get numberOfOutputs(){return o.numberOfOutputs},get pan(){return a.gain},addEventListener:(...t)=>o.addEventListener(t[0],t[1],t[2]),dispatchEvent:(...t)=>o.dispatchEvent(t[0]),removeEventListener:(...t)=>o.removeEventListener(t[0],t[1],t[2])};let l=!1;return d(Ne(t,r),()=>{h(),l=!0},()=>{c(),l=!1})}})(kl,Ve,je,nu,We,Tl),uu=(lo=lu,uo=We,(t,e)=>{const s=e.channelCountMode;if("clamped-max"===s)throw uo();if(void 0===t.createStereoPanner)return lo(t,e);t=t.createStereoPanner();return Oe(t,e),Ee(t,e,"pan"),Object.defineProperty(t,"channelCountMode",{get:()=>s,set:t=>{if(t!==s)throw uo()}}),t}),pu=(ro=dl,ao=Jt,ho=_l,()=>{const i=new WeakMap;return{render(t,e){var s=i.get(e);return void 0!==s?Promise.resolve(s):(async(t,e)=>{let s=ao(t);var n=Dt(s,e);if(!n){const ro={channelCount:s.channelCount,channelCountMode:s.channelCountMode,channelInterpretation:s.channelInterpretation,pan:s.pan.value};s=oo(e,ro)}return i.set(e,s),n?await ro(e,t.pan,s.pan):await ho(e,t.pan,s.pan),Qt(s)?await co(t,e,s.inputs[0]):await co(t,e,s),s})(t,e)}}}),du=(Jc=Cs,to=gl,eo=oo=uu,so=pu,class extends Jc{constructor(t,e){var s=no(t),e={...Ze,...e},e=eo(s,e),s=io(s);super(t,!1,e,s?so():null),this._pan=to(this,s,e.pan)}get pan(){return this._pan}}),fu=(Jr=Jt,Kr=co=_s,()=>{const n=new WeakMap;return{render(t,e){var s=n.get(e);return void 0!==s?Promise.resolve(s):(async(t,e)=>{let s=Jr(t);if(!Dt(s,e)){const Jr={channelCount:s.channelCount,channelCountMode:s.channelCountMode,channelInterpretation:s.channelInterpretation,curve:s.curve,oversample:s.oversample};s=Hr(e,Jr)}return n.set(e,s),Qt(s)?await Kr(t,e,s.inputs[0]):await Kr(t,e,s),s})(t,e)}}}),_u=(Jc=Cs,Gr=be,Qr=Hr=nu,Zr=fu,Xr=no=gs,Yr=io=ys,$r=wl,class extends Jc{constructor(t,e){var s=Xr(t),e={...Xe,...e},e=Qr(s,e);super(t,!0,e,Yr(s)?Zr():null),this._isCurveNullified=!1,this._nativeWaveShaperNode=e,$r(this,1)}get curve(){return this._isCurveNullified?null:this._nativeWaveShaperNode.curve}set curve(t){if(null===t)this._isCurveNullified=!0,this._nativeWaveShaperNode.curve=new Float32Array([0,0]);else{if(t.length<2)throw Gr();this._isCurveNullified=!1,this._nativeWaveShaperNode.curve=t}}get oversample(){return this._nativeWaveShaperNode.oversample}set oversample(t){this._nativeWaveShaperNode.oversample=t}}),mu=null!==(Jc=ps)&&Jc.isSecureContext,gu=(Ur=ps,(t,e,s)=>{Object.defineProperties(Ur,{currentFrame:{configurable:!0,get:()=>Math.round(t*e)},currentTime:{configurable:!0,get:()=>t}});try{return s()}finally{null!==Ur&&(delete Ur.currentFrame,delete Ur.currentTime)}}),vu=new WeakMap,yu=(Wr=vu,Br=vs,t=>{let e=Wr.get(t);if(void 0!==e)return e;if(null===Br)throw new Error("Missing the native OfflineAudioContext constructor.");return e=new Br(1,1,44100),Wr.set(t,e),e}),xu=mu?((r,o,a,l,u,p,d,f,_,m,g,v,y)=>{let x=0;return(e,s,h={credentials:"omit"})=>{const t=g.get(e);if(void 0!==t&&t.has(s))return Promise.resolve();const n=m.get(e);if(void 0!==n){const r=n.get(s);if(void 0!==r)return r}const c=p(e),i=void 0===c.audioWorklet?u(s).then(([t,e])=>{var[t,e]=mt(t,e);return a(`${t};((a,b)=>{(a[b]=a[b]||[]).push((AudioWorkletProcessor,global,registerProcessor,sampleRate,self,window)=>{${e}\n})})(window,'_AWGS')`)}).then(()=>{const t=y._AWGS.pop();if(void 0===t)throw new SyntaxError;l(c.currentTime,c.sampleRate,()=>t(class{},void 0,(t,e)=>{if(""===t.trim())throw o();const s=pt.get(c);if(void 0!==s){if(s.has(t))throw o();vt(e),gt(e.parameterDescriptors),s.set(t,e)}else vt(e),gt(e.parameterDescriptors),pt.set(c,new Map([[t,e]]))},c.sampleRate,void 0,void 0))}):Promise.all([u(s),Promise.resolve(r(v,v))]).then(([[t,e],s])=>{const n=x+1;x=n;const[i,r]=mt(t,e),o=new Blob([`${i};((AudioWorkletProcessor,registerProcessor)=>{${r}\n})(${s?"AudioWorkletProcessor":"class extends AudioWorkletProcessor {__b=new WeakSet();constructor(){super();(p=>p.postMessage=(q=>(m,t)=>q.call(p,m,t?t.filter(u=>!this.__b.has(u)):t))(p.postMessage))(this.port)}}"},(n,p)=>registerProcessor(n,class extends p{${s?"":"__c = (a) => a.forEach(e=>this.__b.add(e.buffer));"}process(i,o,p){${s?"":"i.forEach(this.__c);o.forEach(this.__c);this.__c(Object.values(p));"}return super.process(i.map(j=>j.some(k=>k.length===0)?[]:j),o,p)}}));registerProcessor('__sac${n}',class extends AudioWorkletProcessor{process(){return !1}})`],{type:"application/javascript; charset=utf-8"}),a=URL.createObjectURL(o);return c.audioWorklet.addModule(a,h).then(()=>{if(f(c))return c;const t=d(c);return t.audioWorklet.addModule(a,h).then(()=>t)}).then(t=>{if(null===_)throw new SyntaxError;try{new _(t,`__sac${n}`)}catch{throw new SyntaxError}}).finally(()=>URL.revokeObjectURL(a))});return void 0===n?m.set(e,new Map([[s,i]])):n.set(s,i),i.then(()=>{const t=g.get(e);void 0===t?g.set(e,new Set([s])):t.add(s)}).finally(()=>{const t=m.get(e);void 0!==t&&t.delete(s)}),i}})(us,We,(zr=ps,i=>new Promise((t,r)=>{if(null!==zr){const e=zr.document.head;if(null===e)r(new SyntaxError);else{const s=zr.document.createElement("script"),n=new Blob([i],{type:"application/javascript"}),o=URL.createObjectURL(n),a=zr.onerror,h=()=>{zr.onerror=a,URL.revokeObjectURL(o)};zr.onerror=(t,e,s,n,i)=>e===o||e===zr.location.href&&1===s&&1===n?(h(),r(i),!1):null!==a?a(t,e,s,n,i):void 0,s.onerror=()=>{h(),r(new SyntaxError)},s.onload=()=>{h(),t()},s.src=o,s.type="module",e.appendChild(s)}}else r(new SyntaxError)})),gu,async t=>{try{const e=await fetch(t);if(e.ok)return[await e.text(),e.url]}catch{}throw new DOMException("","AbortError")},gs,yu,ys,As,new WeakMap,new WeakMap,(jr=As,Lr=vs,async()=>{if(null===jr)return!0;if(null===Lr)return!1;const t=new Blob(['class A extends AudioWorkletProcessor{process(i){this.port.postMessage(i,[i[0][0].buffer])}}registerProcessor("a",A)'],{type:"application/javascript; charset=utf-8"}),e=new Lr(1,128,44100),s=URL.createObjectURL(t);let n=!1,i=!1;try{await e.audioWorklet.addModule(s);const Lr=new jr(e,"a",{numberOfOutputs:0}),t=e.createOscillator();Lr.port.onmessage=()=>n=!0,Lr.onprocessorerror=()=>i=!0,t.connect(Lr),t.start(0),await e.startRendering()}catch{}finally{URL.revokeObjectURL(s)}return n&&!i}),ps):void 0,wu=(Nr=Ts,Pr=ys,t=>Nr(t)||Pr(t)),bu=(Dr=al,Or=us,Mr=new WeakSet,Rr=wu,qr=Ot,Fr=Ce,Ir=hl,Vr=cl,(t,r)=>{const o=Rr(t)?t:Er(t);if(Mr.has(r)){const Dr=new DOMException("","DataCloneError");return Promise.reject(Dr)}try{Mr.add(r)}catch{}return Or(Fr,()=>Fr(o))?o.decodeAudioData(r).then(t=>(ge(r).catch(()=>{}),Or(qr,()=>qr(t))||Vr(t),Dr.add(t),t)):new Promise((e,s)=>{const n=async()=>{try{await ge(r)}catch{}},i=t=>{s(t),n()};try{o.decodeAudioData(r,t=>{"function"!=typeof t.copyFromChannel&&(Ir(t),Et(t)),Dr.add(t),n().then(()=>e(t))},t=>{i(null===t?new DOMException("","EncodingError"):t)})}catch(t){i(t)}})}),Tu=(cr=xu,lr=ol,ur=ll,pr=vl,dr=bl,fr=Cl,_r=Ol,mr=ql,gr=Vl,vr=bu,yr=Pl,xr=zl,wr=Bl,br=Xl,Tr=tu,Sr=au,kr=cu,Ar=du,Cr=_u,class extends Hl{constructor(t,e){super(t,e),this._nativeContext=t,this._audioWorklet=void 0===cr?void 0:{addModule:(t,e)=>cr(this,t,e)}}get audioWorklet(){return this._audioWorklet}createAnalyser(){return new lr(this)}createBiquadFilter(){return new dr(this)}createBuffer(t,e,s){return new ur({length:e,numberOfChannels:t,sampleRate:s})}createBufferSource(){return new pr(this)}createChannelMerger(t=6){return new fr(this,{numberOfInputs:t})}createChannelSplitter(t=6){return new _r(this,{numberOfOutputs:t})}createConstantSource(){return new mr(this)}createConvolver(){return new gr(this)}createDelay(t=1){return new yr(this,{maxDelayTime:t})}createDynamicsCompressor(){return new xr(this)}createGain(){return new wr(this)}createIIRFilter(t,e){return new br(this,{feedback:e,feedforward:t})}createOscillator(){return new Tr(this)}createPanner(){return new Sr(this)}createPeriodicWave(t,e,s={disableNormalization:!1}){return new kr(this,{...s,imag:e,real:t})}createStereoPanner(){return new Ar(this)}createWaveShaper(){return new Cr(this)}decodeAudioData(t,e,s){return vr(this._nativeContext,t).then(t=>("function"==typeof e&&e(t),t),t=>{throw"function"==typeof s&&s(t),t})}}),Su=class extends Cs{constructor(t,e){const s=ar(t),n=s.createMediaElementSource(e.mediaElement);if(hr(s))throw TypeError();super(t,!0,n,null),this._nativeMediaElementAudioSourceNode=n}get mediaElement(){return this._nativeMediaElementAudioSourceNode.mediaElement}},ku=class extends Cs{constructor(t,e){var s=rr(t);if(or(s))throw new TypeError;e=((t,e)=>{t=t.createMediaStreamDestination();return Oe(t,e),1===t.numberOfOutputs&&Object.defineProperty(t,"numberOfOutputs",{get:()=>0}),t})(s,{...Ae,...e});super(t,!1,e,null),this._nativeMediaStreamAudioDestinationNode=e}get stream(){return this._nativeMediaStreamAudioDestinationNode.stream}},Au=class extends Cs{constructor(t,e){var s=nr(t),e=((t,{mediaStream:e})=>{const s=e.getAudioTracks();s.sort((t,e)=>t.ide.id?1:0);var n=s.slice(0,1),n=t.createMediaStreamSource(new MediaStream(n));return Object.defineProperty(n,"mediaStream",{value:e}),n})(s,e);if(ir(s))throw new TypeError;super(t,!0,e,null),this._nativeMediaStreamAudioSourceNode=e}get mediaStream(){return this._nativeMediaStreamAudioSourceNode.mediaStream}},Cu=(er=be,sr=ir=or=hr=ys,(t,{mediaStreamTrack:e})=>{if("function"==typeof t.createMediaStreamTrackSource)return t.createMediaStreamTrackSource(e);var s=new MediaStream([e]),s=t.createMediaStreamSource(s);if("audio"!==e.kind)throw er();if(sr(t))throw new TypeError;return s}),Du=(ol=Cs,Ki=Cu,tr=nr=rr=ar=Er=gs,class extends ol{constructor(t,e){var s=tr(t);super(t,!0,Ki(s,e),null)}}),Ou=(ol=Tu,Gi=be,Qi=We,Zi=()=>new DOMException("","UnknownError"),Xi=Su,Yi=ku,$i=Au,Hi=Du,Ji=bs,class extends ol{constructor(t={}){if(null===Ji)throw new Error("Missing the native AudioContext constructor.");let e;try{e=new Ji(t)}catch(t){if(12===t.code&&"sampleRate is not in range"===t.message)throw Qi();throw t}if(null===e)throw Zi();if(void 0!==(n=t.latencyHint)&&"number"!=typeof n&&("string"!=typeof n||"balanced"!==n&&"interactive"!==n&&"playback"!==n))throw new TypeError(`The provided value '${t.latencyHint}' is not a valid enum value of type AudioContextLatencyCategory.`);if(void 0!==t.sampleRate&&e.sampleRate!==t.sampleRate)throw Qi();super(e,2);var s=t["latencyHint"],n=e["sampleRate"];if(this._baseLatency="number"==typeof e.baseLatency?e.baseLatency:"balanced"===s?512/n:"interactive"===s||void 0===s?256/n:"playback"===s?1024/n:128*Math.max(2,Math.min(128,Math.round(s*n/128)))/n,this._nativeAudioContext=e,"webkitAudioContext"===Ji.name?(this._nativeGainNode=e.createGain(),this._nativeOscillatorNode=e.createOscillator(),this._nativeGainNode.gain.value=1e-37,this._nativeOscillatorNode.connect(this._nativeGainNode).connect(e.destination),this._nativeOscillatorNode.start()):(this._nativeGainNode=null,this._nativeOscillatorNode=null),this._state=null,"running"===e.state){this._state="suspended";const t=()=>{"suspended"===this._state&&(this._state=null),e.removeEventListener("statechange",t)};e.addEventListener("statechange",t)}}get baseLatency(){return this._baseLatency}get state(){return null!==this._state?this._state:this._nativeAudioContext.state}close(){return"closed"===this.state?this._nativeAudioContext.close().then(()=>{throw Gi()}):("suspended"===this._state&&(this._state=null),this._nativeAudioContext.close().then(()=>{null!==this._nativeGainNode&&null!==this._nativeOscillatorNode&&(this._nativeOscillatorNode.stop(),this._nativeGainNode.disconnect(),this._nativeOscillatorNode.disconnect()),Lt(this)}))}createMediaElementSource(t){return new Xi(this,{mediaElement:t})}createMediaStreamDestination(){return new Yi(this)}createMediaStreamSource(t){return new $i(this,{mediaStream:t})}createMediaStreamTrackSource(t){return new Hi(this,{mediaStreamTrack:t})}resume(){return"suspended"===this._state?new Promise((t,e)=>{const s=()=>{this._nativeAudioContext.removeEventListener("statechange",s),"running"===this._nativeAudioContext.state?t():this.resume().then(t,e)};this._nativeAudioContext.addEventListener("statechange",s)}):this._nativeAudioContext.resume().catch(t=>{if(void 0===t||15===t.code)throw Gi();throw t})}suspend(){return this._nativeAudioContext.suspend().catch(t=>{if(void 0===t)throw Gi();throw t})}}),Mu=(Ui=$l,t=>{t=Ui.get(t);if(void 0===t)throw new Error("The context has no set of AudioWorkletNodes.");return t}),Eu=(t,e)=>{Bi(t).add(e)},Ru=(Wi=Mt,(t,e,s=0,n=0)=>{const i=t[s];if(void 0===i)throw Wi();return ie(e)?i.connect(e,0,n):i.connect(e,0)}),qu=(zi=Bi=Mu,(t,e)=>{zi(t).delete(e)}),Fu=(Li=Mt,(t,e,s,n=0)=>void 0===e?t.forEach(t=>t.disconnect()):"number"==typeof e?ye(Li,t,e).disconnect():ie(e)?void 0===s?t.forEach(t=>t.disconnect(e)):void 0===n?ye(Li,t,s).disconnect(e,0):ye(Li,t,s).disconnect(e,0,n):void 0===s?t.forEach(t=>t.disconnect(e)):ye(Li,t,s).disconnect(e,0)),Iu=new WeakMap,Vu=(Pi=Iu,ji=yt,t=>ji(Pi,t)),Nu=(Ai=Mt,Ci=be,Ri=ze,Vi=Vu,(o,t,e,a)=>{if(0===a.numberOfInputs&&0===a.numberOfOutputs)throw qi();const h=Array.isArray(a.outputChannelCount)?a.outputChannelCount:Array.from(a.outputChannelCount);if(h.some(t=>t<1))throw qi();if(h.length!==a.numberOfOutputs)throw Ai();if("explicit"!==a.channelCountMode)throw qi();const c=a.channelCount*a.numberOfInputs,s=h.reduce((t,e)=>t+e,0),n=void 0===e.parameterDescriptors?0:e.parameterDescriptors.length;if(6void 0===ki?0:ki},maxValue:{get:()=>void 0===Ai?Ft:Ai},minValue:{get:()=>void 0===Ci?qt:Ci}}),p.push(Oi)}const d=Di(o,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:Math.max(1,c+n)}),f=Fe(t,o.sampleRate),_=Ri(o,f,c+n,Math.max(1,s)),r=Oi(o,{channelCount:Math.max(1,s),channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:Math.max(1,s)}),m=[];for(let t=0;t{const s=p[e];return s.connect(d,0,c+e),s.start(0),[t,s.offset]}));d.connect(_);let v=a.channelInterpretation,y=null;const x=0===a.numberOfOutputs?[_]:m,w={get bufferSize(){return f},get channelCount(){return a.channelCount},set channelCount(t){throw Ci()},get channelCountMode(){return a.channelCountMode},set channelCountMode(t){throw Ci()},get channelInterpretation(){return v},set channelInterpretation(t){for(const e of l)e.channelInterpretation=t;v=t},get context(){return _.context},get inputs(){return l},get numberOfInputs(){return a.numberOfInputs},get numberOfOutputs(){return a.numberOfOutputs},get onprocessorerror(){return y},set onprocessorerror(t){"function"==typeof y&&w.removeEventListener("processorerror",y),y="function"==typeof t?t:null,"function"==typeof y&&w.addEventListener("processorerror",y)},get parameters(){return g},get port(){return i.port2},addEventListener:(...t)=>_.addEventListener(t[0],t[1],t[2]),connect:ki.bind(null,x),disconnect:Fi.bind(null,x),dispatchEvent:(...t)=>_.dispatchEvent(t[0]),removeEventListener:(...t)=>_.removeEventListener(t[0],t[1],t[2])},b=new Map;var T,S;i.port1.addEventListener=(T=i.port1.addEventListener,(...t)=>{if("message"===t[0]){const s="function"==typeof t[1]?t[1]:"object"==typeof t[1]&&null!==t[1]&&"function"==typeof t[1].handleEvent?t[1].handleEvent:null;var e;null!==s&&(void 0!==(e=b.get(t[1]))?t[1]=e:(t[1]=t=>{Ii(o.currentTime,o.sampleRate,()=>s(t))},b.set(s,t[1])))}return T.call(i.port1,t[0],t[1],t[2])}),i.port1.removeEventListener=(S=i.port1.removeEventListener,(...t)=>{var e;return"message"!==t[0]||void 0!==(e=b.get(t[1]))&&(b.delete(t[1]),t[1]=e),S.call(i.port1,t[0],t[1],t[2])});let k=null;Object.defineProperty(i.port1,"onmessage",{get:()=>k,set:t=>{"function"==typeof k&&i.port1.removeEventListener("message",k),k="function"==typeof t?t:null,"function"==typeof k&&(i.port1.addEventListener("message",k),i.port1.start())}}),e.prototype.port=i.port1;let A=null;const C=((t,e,s,n)=>{let i=dt.get(t);void 0===i&&(i=new WeakMap,dt.set(t,i));t=(async()=>{var t;return new s((t=n,await new Promise((e,s)=>{const{port1:n,port2:i}=new MessageChannel;n.onmessage=({data:t})=>{n.close(),i.close(),e(t)},n.onmessageerror=({data:t})=>{n.close(),i.close(),s(t)},i.postMessage(t)})))})();return i.set(e,t),t})(o,w,e,a);C.then(t=>A=t);const D=ue(a.numberOfInputs,a.channelCount),O=ue(a.numberOfOutputs,h),M=void 0===e.parameterDescriptors?[]:e.parameterDescriptors.reduce((t,{name:e})=>({...t,[e]:new Float32Array(128)}),{});let E=!0;const R=()=>{0{if(null!==A){const r=Vi(w);for(let n=0;n{ce(s,M,t,c+e,n)});for(let e=0;e{if(0t.every(t=>0===t))&&(1===s?q.delete(e):q.set(e,s-1)),t)}),t=Ii(o.currentTime+n/o.sampleRate,o.sampleRate,()=>A.process(s,O,M));E=t;for(let e=0,s=0;e_.connect(I).connect(o.destination),N=()=>{_.disconnect(I),I.disconnect()};return V(),Ni(w,()=>{if(E){N(),0{E&&(V(),R()),F=!1})}),Pu=(xi=be,wi=Nu,Ti=qi=We,Si=Ni=Tl,(t,e,s,n,i,r)=>{if(null!==s)try{const wi=new s(t,n,r),Ti=new Map;let e=null;if(Object.defineProperties(wi,{channelCount:{get:()=>r.channelCount,set:()=>{throw xi()}},channelCountMode:{get:()=>"explicit",set:()=>{throw xi()}},onprocessorerror:{get:()=>e,set:t=>{"function"==typeof e&&wi.removeEventListener("processorerror",e),e="function"==typeof t?t:null,"function"==typeof e&&wi.addEventListener("processorerror",e)}}}),wi.addEventListener=(a=wi.addEventListener,(...e)=>{if("processorerror"===e[0]){const wi="function"==typeof e[1]?e[1]:"object"==typeof e[1]&&null!==e[1]&&"function"==typeof e[1].handleEvent?e[1].handleEvent:null;var t;null!==wi&&(void 0!==(t=Ti.get(e[1]))?e[1]=t:(e[1]=t=>{"error"===t.type?(Object.defineProperties(t,{type:{value:"processorerror"}}),wi(t)):wi(new ErrorEvent(e[0],{...t}))},Ti.set(wi,e[1])))}return a.call(wi,"error",e[1],e[2]),a.call(wi,...e)}),wi.removeEventListener=(o=wi.removeEventListener,(...t)=>{if("processorerror"===t[0]){const wi=Ti.get(t[1]);void 0!==wi&&(Ti.delete(t[1]),t[1]=wi)}return o.call(wi,"error",t[1],t[2]),o.call(wi,t[0],t[1],t[2])}),0===r.numberOfOutputs)return wi;{const xi=bi(t,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0});return wi.connect(xi).connect(t.destination),Si(wi,()=>xi.disconnect(),()=>xi.connect(t.destination))}}catch(t){if(11===t.code)throw Ti();throw t}var o,a;if(void 0===i)throw Ti();return(t=>{const e=(new MessageChannel)["port1"];try{e.postMessage(t)}finally{e.close()}})(r),wi(t,e,i,r)}),ju=(ii=dl,ri=ki=Ru,oi=fl,ai=Di=kl,hi=Oi=Ve,ci=Mi=El,li=bi=Ei=je,ui=qu,pi=Fi=Fu,di=Ii=gu,fi=Jt,_i=As,mi=vs,gi=_l,vi=_s,yi=Gl,(r,a,h)=>{const c=new WeakMap;let l=null;return{render(t,e){ui(e,t);var s=c.get(e);return void 0!==s?Promise.resolve(s):(async(o,e)=>{let t=fi(o),s=null;const n=Dt(t,e),i=Array.isArray(a.outputChannelCount)?a.outputChannelCount:Array.from(a.outputChannelCount);if(null===_i){const ii=i.reduce((t,e)=>t+e,0),oi=hi(e,{channelCount:Math.max(1,ii),channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:Math.max(1,ii)}),ci=[];for(let t=0;t{const s=new mi(oi,128*Math.ceil(o.context.length/128),e.sampleRate),n=[],i=[];for(let t=0;t{var e=ci(s,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",offset:t.value});return await gi(s,t,e.offset),e})),r=ai(s,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:Math.max(1,ii+ri)});for(let e=0;evi(o,s,t))),yi(s)};l=(async(t,s,e,i,r,o,a)=>{const h=null===s?128*Math.ceil(t.context.length/128):s.length,c=i.channelCount*i.numberOfInputs,n=r.reduce((t,e)=>t+e,0),l=0===n?null:e.createBuffer(n,h,e.sampleRate);if(void 0===o)throw new Error("Missing the processor constructor.");const u=Nt(t),p=await((t,e)=>{t=yt(dt,t),e=Jt(e);return yt(t,e)})(e,t),d=ue(i.numberOfInputs,i.channelCount),f=ue(i.numberOfOutputs,r),_=Array.from(t.parameters.keys()).reduce((t,e)=>({...t,[e]:new Float32Array(128)}),{});for(let n=0;n{ce(s,_,t,c+e,n)});for(let e=0;e0===u.activeInputs[e].size?[]:t),s=a(n/e.sampleRate,e.sampleRate,()=>p.process(t,f,_));if(null!==l)for(let e=0,s=0;eni.get(t)),zu=(si=Iu,(t,e)=>{si.set(t,e)}),Wu=mu?(Gn=Eu,Qn=gl,Zn=ju,Xn=Pu,Yn=Nt,$n=Lu,Hn=gs,Jn=ys,Kn=As,ti=zu,ei=rs,class extends Cs{constructor(t,e,s){var n;const i=Hn(t),r=Jn(i),o={...s={...he,...s},outputChannelCount:void 0!==s.outputChannelCount?s.outputChannelCount:1===s.numberOfInputs&&1===s.numberOfOutputs?[s.channelCount]:Array.from({length:s.numberOfOutputs},()=>1)};(t=>{const{port1:e,port2:s}=new MessageChannel;try{e.postMessage(t)}finally{e.close(),s.close()}})(o);const a=pt.get(i),h=null==a?void 0:a.get(e),c=!r&&"closed"===i.state&&null!==(n=$n(i))&&void 0!==n?n:i,l=Xn(c,r?null:t.baseLatency,Kn,e,h,o);super(t,!0,l,r?Zn(e,o,h):null);const u=[];l.parameters.forEach((t,e)=>{t=Qn(this,r,t);u.push([e,t])}),this._nativeAudioWorkletNode=l,this._onprocessorerror=null,this._parameters=new ae(u),r&&Gn(i,this);var e=Yn(this)["activeInputs"];ti(l,e)}get onprocessorerror(){return this._onprocessorerror}set onprocessorerror(t){var e="function"==typeof t?ei(this,t):null;this._nativeAudioWorkletNode.onprocessorerror=e;var s=this._nativeAudioWorkletNode.onprocessorerror;this._onprocessorerror=null!==s&&s===e?t:s}get parameters(){return null===this._parameters?this._nativeAudioWorkletNode.parameters:this._parameters}get port(){return this._nativeAudioWorkletNode.port}}):void 0,Bu=(Bn=We,Un=vs,(t,e,s)=>{if(null===Un)throw new Error("Missing the native OfflineAudioContext constructor.");try{return new Un(t,e,s)}catch(t){if("SyntaxError"===t.name)throw Bn();throw t}}),Uu=(In=al,Vn=us,Nn=fs,Pn=Mu,jn=Gl,Ln=Ot,zn=hl,Wn=cl,(t,e)=>Nn(t).render(t,e).then(()=>Promise.all(Array.from(Pn(e)).map(t=>Nn(t).render(t,e)))).then(()=>jn(e)).then(t=>("function"!=typeof t.copyFromChannel?(zn(t),Et(t)):Vn(Ln,()=>Ln(t))||Wn(t),In.add(t),t))),Gu=(En=us,Rn=be,qn=Bu,Fn=Uu,class extends Tu{constructor(t,e,s){let n;if("number"==typeof t&&void 0!==e&&void 0!==s)n={length:e,numberOfChannels:t,sampleRate:s};else{if("object"!=typeof t)throw new Error("The given parameters are not valid.");n=t}const{length:i,numberOfChannels:r,sampleRate:o}={...Be,...n},a=qn(r,i,o);En(Ce,()=>Ce(a))||a.addEventListener("statechange",(()=>{let e=0;const s=t=>{"running"===this._state&&(0{this._state=null,Lt(this)}))}_waitForThePromiseToSettle(t){null===this._state?this._nativeOfflineAudioContext.dispatchEvent(t):setTimeout(()=>this._waitForThePromiseToSettle(t))}}),Qu=(On=ct,Mn=Ts,t=>{var e=On.get(t);return Mn(e)||Mn(t)}),Zu=(Cn=ot,Dn=Ss,t=>Cn.has(t)||Dn(t)),Xu=(kn=ht,An=ks,t=>kn.has(t)||An(t)),Yu=(Tn=ct,Sn=ys,t=>{var e=Tn.get(t);return Sn(e)||Sn(t)}),$u=()=>(async(t,e,s,n,i,r,o,a,h,c,l,u,p,d,f,_)=>!!(t(e,e)&&t(s,s)&&t(i,i)&&t(r,r)&&t(a,a)&&t(h,h)&&t(c,c)&&t(l,l)&&t(u,u)&&t(p,p)&&t(d,d))&&(await Promise.all([t(n,n),t(o,o),t(f,f),t(_,_)])).every(t=>t))(us,(s=>()=>{if(null===s)return!1;const t=new s(1,1,44100).createBuffer(1,1,44100);if(void 0===t.copyToChannel)return!0;var e=new Float32Array(2);try{t.copyFromChannel(e,0,0)}catch{return!1}return!0})(vs),(s=>()=>{if(null===s)return!1;if(void 0!==s.prototype&&void 0!==s.prototype.close)return!0;const t=new s,e=void 0!==t.close;try{t.close()}catch{}return e})(bs),(t=>()=>{if(null===t)return Promise.resolve(!1);const i=new t(1,1,44100);return new Promise(e=>{let s=!0;var t=t=>{s&&(s=!1,i.startRendering(),e(t instanceof TypeError))};let n;try{n=i.decodeAudioData(null,()=>{},t)}catch(e){t(e)}void 0!==n&&n.catch(t)})})(vs),(e=>()=>{if(null===e)return!1;let t;try{t=new e({latencyHint:"balanced"})}catch{return!1}return t.close(),!0})(bs),(s=>()=>{if(null===s)return!1;const t=new s(1,1,44100).createGain(),e=t.connect(t)===t;return t.disconnect(t),e})(vs),((r,o)=>async()=>{if(null===r)return!0;if(null===o)return!1;const t=new Blob(['let c,p;class A extends AudioWorkletProcessor{constructor(){super();this.port.onmessage=(e)=>{p=e.data;p.onmessage=()=>{p.postMessage(c);p.close()};this.port.postMessage(0)}}process(){c=1}}registerProcessor("a",A)'],{type:"application/javascript; charset=utf-8"}),s=new MessageChannel,e=new o(1,128,44100),n=URL.createObjectURL(t);let i=!1;try{await e.audioWorklet.addModule(n);const o=new r(e,"a",{numberOfOutputs:0}),t=e.createOscillator();await new Promise(t=>{o.port.onmessage=()=>t(),o.port.postMessage(s.port2,[s.port2])}),o.port.onmessage=()=>i=!0,t.connect(o),t.start(0),await e.startRendering(),i=await new Promise(e=>{s.port1.onmessage=({data:t})=>e(1===t),s.port1.postMessage(0)})}catch{}finally{s.port1.close(),URL.revokeObjectURL(n)}return i})(As,vs),(e=>()=>{if(null===e)return!1;const t=new e(1,1,44100).createChannelMerger();if("max"===t.channelCountMode)return!0;try{t.channelCount=2}catch{return!0}return!1})(vs),(e=>()=>{if(null===e)return!1;const t=new e(1,1,44100);return void 0===t.createConstantSource||t.createConstantSource().offset.maxValue!==Number.POSITIVE_INFINITY})(vs),(s=>()=>{if(null===s)return!1;const t=new s(1,1,44100),e=t.createConvolver();e.buffer=t.createBuffer(1,1,t.sampleRate);try{e.buffer=t.createBuffer(1,1,t.sampleRate)}catch{return!1}return!0})(vs),(e=>()=>{if(null===e)return!1;const t=new e(1,1,44100).createConvolver();try{t.channelCount=1}catch{return!1}return!0})(vs),ss,(t=>()=>null!==t&&t.hasOwnProperty("isSecureContext"))(ps),(e=>()=>{if(null===e)return!1;const t=new e;try{return t.createMediaStreamSource(new MediaStream),!1}catch(t){return!0}finally{t.close()}})(bs),(n=>()=>{if(null===n)return Promise.resolve(!1);const t=new n(1,1,44100);if(void 0===t.createStereoPanner)return Promise.resolve(!0);if(void 0===t.createConstantSource)return Promise.resolve(!0);const e=t.createConstantSource(),s=t.createStereoPanner();return e.channelCount=1,e.offset.value=1,s.channelCount=1,e.start(),e.connect(s).connect(t.destination),t.startRendering().then(t=>1!==t.getChannelData(0)[0])})(vs),ns);function Hu(t){return void 0===t}function Ju(t){return!Hu(t)}function Ku(t){return"function"==typeof t}function tp(t){return"number"==typeof t}function ep(t){return"[object Object]"===Object.prototype.toString.call(t)&&t.constructor===Object}function sp(t){return"boolean"==typeof t}function np(t){return Array.isArray(t)}function ip(t){return"string"==typeof t}function rp(t){return ip(t)&&/^([a-g]{1}(?:b|#|x|bb)?)(-?[0-9]+)/i.test(t)}function op(t,e){if(!t)throw new Error(e)}function ap(t,e,s=1/0){if(!(e<=t&&t<=s))throw new RangeError(`Value must be within [${e}, ${s}], got: ${t}`)}function hp(t){t.isOffline||"running"===t.state||_p('The AudioContext is "suspended". Invoke Tone.start() from a user action to start the audio.')}let cp=!1,lp=!1;function up(t){cp=t}function pp(t){Hu(t)&&cp&&!lp&&(lp=!0,_p("Events scheduled inside of scheduled callbacks should use the passed in scheduling time. See https://github.com/Tonejs/Tone.js/wiki/Accurate-Timing"))}let dp=console;function fp(...t){dp.log(...t)}function _p(...t){dp.warn(...t)}const mp="object"==typeof self?self:null,gp=mp&&(mp.hasOwnProperty("AudioContext")||mp.hasOwnProperty("webkitAudioContext"));function vp(t,e,s,n){var i,r=arguments.length,o=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,s):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,s,n);else for(var a=t.length-1;0<=a;a--)(i=t[a])&&(o=(r<3?i(o):3{this._createTimeout(),this._callback()},1e3*this._updateInterval)}_createClock(){if("worker"===this._type)try{this._createWorker()}catch(t){this._type="timeout",this._createClock()}else"timeout"===this._type&&this._createTimeout()}_disposeClock(){this._timeout&&clearTimeout(this._timeout),this._worker&&(this._worker.terminate(),this._worker.onmessage=null)}get updateInterval(){return this._updateInterval}set updateInterval(t){this._updateInterval=Math.max(t,128/44100),"worker"===this._type&&this._worker.postMessage(Math.max(1e3*t,1))}get type(){return this._type}set type(t){this._disposeClock(),this._type=t,this._createClock()}dispose(){this._disposeClock()}}function wp(t){return Xu(t)}function bp(t){return Zu(t)}function Tp(t){return Yu(t)}function Sp(t){return Qu(t)}function kp(t){return t instanceof ll}function Ap(t,...e){if(!e.length)return t;var s,n,i=e.shift();if(ep(t)&&ep(i))for(const e in i)s=e,n=i[e],"value"===s||wp(n)||bp(n)||kp(n)?t[e]=i[e]:ep(i[e])?(t[e]||Object.assign(t,{[e]:{}}),Ap(t[e],i[e])):Object.assign(t,{[e]:i[e]});return Ap(t,...e)}function Cp(e,t,s=[],n){const i={},r=Array.from(t);if(ep(r[0])&&n&&!Reflect.has(r[0],n)&&(Object.keys(r[0]).some(t=>Reflect.has(e,t))||(Ap(i,{[n]:r[0]}),s.splice(s.indexOf(n),1),r.shift())),1===r.length&&ep(r[0]))Ap(i,r[0]);else for(let t=0;t{Reflect.has(e,t)&&delete e[t]}),e}class Mp{constructor(){this.debug=!1,this._wasDisposed=!1}static getDefaults(){return{}}log(...t){(this.debug||mp&&this.toString()===mp.TONE_DEBUG_CLASS)&&fp(this,...t)}dispose(){return this._wasDisposed=!0,this}get disposed(){return this._wasDisposed}toString(){return this.name}}Mp.version=s;const Ep=1e-6;function Rp(t,e){return t>e+Ep}function qp(t,e){return Rp(t,e)||Ip(t,e)}function Fp(t,e){return t+Epthis.memory){const t=this.length-this.memory;this._timeline.splice(0,t)}return this}remove(t){t=this._timeline.indexOf(t);return-1!==t&&this._timeline.splice(t,1),this}get(t,e="time"){e=this._search(t,e);return-1!==e?this._timeline[e]:null}peek(){return this._timeline[0]}shift(){return this._timeline.shift()}getAfter(t,e="time"){e=this._search(t,e);return e+1=t;)s--;return this._iterate(e,s+1),this}forEachAtTime(s,n){var i=this._search(s);if(-1!==i&&Ip(this._timeline[i].time,s)){let e=i;for(let t=i;0<=t&&Ip(this._timeline[t].time,s);t--)e=t;this._iterate(t=>{n(t)},e,i)}return this}dispose(){return super.dispose(),this._timeline=[],this}}const Pp=[];function jp(t){Pp.push(t)}const Lp=[];function zp(t){Lp.push(t)}class Wp extends Mp{constructor(){super(...arguments),this.name="Emitter"}on(t,e){return t.split(/\W+/).forEach(t=>{Hu(this._events)&&(this._events={}),this._events.hasOwnProperty(t)||(this._events[t]=[]),this._events[t].push(e)}),this}once(e,s){const n=(...t)=>{s(...t),this.off(e,n)};return this.on(e,n),this}off(t,s){return t.split(/\W+/).forEach(t=>{if(Hu(this._events)&&(this._events={}),this._events.hasOwnProperty(t))if(Hu(s))this._events[t]=[];else{const e=this._events[t];for(let t=e.length-1;0<=t;t--)e[t]===s&&e.splice(t,1)}}),this}emit(t,...s){if(this._events&&this._events.hasOwnProperty(t)){const n=this._events[t].slice(0);for(let t=0,e=n.length;t{var e=Object.getOwnPropertyDescriptor(Wp.prototype,t);Object.defineProperty(s.prototype,t,e)})}dispose(){return super.dispose(),this._events=void 0,this}}class Bp extends Wp{constructor(){super(...arguments),this.isOffline=!1}toJSON(){return{}}}class Up extends Bp{constructor(){super(),this.name="Context",this._constants=new Map,this._timeouts=new Np,this._timeoutIds=0,this._initialized=!1,this.isOffline=!1,this._workletModules=new Map;var t,e=Cp(Up.getDefaults(),arguments,["context"]);e.context?this._context=e.context:this._context=(t={latencyHint:e.latencyHint},new Ou(t)),this._ticker=new xp(this.emit.bind(this,"tick"),e.clockSource,e.updateInterval),this.on("tick",this._timeoutLoop.bind(this)),this._context.onstatechange=()=>{this.emit("statechange",this.state)},this._setLatencyHint(e.latencyHint),this.lookAhead=e.lookAhead}static getDefaults(){return{clockSource:"worker",latencyHint:"interactive",lookAhead:.1,updateInterval:.05}}initialize(){var e;return this._initialized||(e=this,Pp.forEach(t=>t(e)),this._initialized=!0),this}createAnalyser(){return this._context.createAnalyser()}createOscillator(){return this._context.createOscillator()}createBufferSource(){return this._context.createBufferSource()}createBiquadFilter(){return this._context.createBiquadFilter()}createBuffer(t,e,s){return this._context.createBuffer(t,e,s)}createChannelMerger(t){return this._context.createChannelMerger(t)}createChannelSplitter(t){return this._context.createChannelSplitter(t)}createConstantSource(){return this._context.createConstantSource()}createConvolver(){return this._context.createConvolver()}createDelay(t){return this._context.createDelay(t)}createDynamicsCompressor(){return this._context.createDynamicsCompressor()}createGain(){return this._context.createGain()}createIIRFilter(t,e){return this._context.createIIRFilter(t,e)}createPanner(){return this._context.createPanner()}createPeriodicWave(t,e,s){return this._context.createPeriodicWave(t,e,s)}createStereoPanner(){return this._context.createStereoPanner()}createWaveShaper(){return this._context.createWaveShaper()}createMediaStreamSource(t){return op(Sp(this._context),"Not available if OfflineAudioContext"),this._context.createMediaStreamSource(t)}createMediaElementSource(t){return op(Sp(this._context),"Not available if OfflineAudioContext"),this._context.createMediaElementSource(t)}createMediaStreamDestination(){return op(Sp(this._context),"Not available if OfflineAudioContext"),this._context.createMediaStreamDestination()}decodeAudioData(t){return this._context.decodeAudioData(t)}get currentTime(){return this._context.currentTime}get state(){return this._context.state}get sampleRate(){return this._context.sampleRate}get listener(){return this.initialize(),this._listener}set listener(t){op(!this._initialized,"The listener cannot be set after initialization."),this._listener=t}get transport(){return this.initialize(),this._transport}set transport(t){op(!this._initialized,"The transport cannot be set after initialization."),this._transport=t}get draw(){return this.initialize(),this._draw}set draw(t){op(!this._initialized,"Draw cannot be set after initialization."),this._draw=t}get destination(){return this.initialize(),this._destination}set destination(t){op(!this._initialized,"The destination cannot be set after initialization."),this._destination=t}createAudioWorkletNode(t,e){return s=this.rawContext,t=t,e=e,op(Ju(Wu),"This node only works in a secure context (https or localhost)"),new Wu(s,t,e);var s}addAudioWorkletModule(t,e){return yp(this,void 0,void 0,function*(){op(Ju(this.rawContext.audioWorklet),"AudioWorkletNode is only available in a secure context (https or localhost)"),this._workletModules.has(e)||this._workletModules.set(e,this.rawContext.audioWorklet.addModule(t)),yield this._workletModules.get(e)})}workletsAreReady(){return yp(this,void 0,void 0,function*(){const e=[];this._workletModules.forEach(t=>e.push(t)),yield Promise.all(e)})}get updateInterval(){return this._ticker.updateInterval}set updateInterval(t){this._ticker.updateInterval=t}get clockSource(){return this._ticker.type}set clockSource(t){this._ticker.type=t}get latencyHint(){return this._latencyHint}_setLatencyHint(t){let e=0;if(ip(this._latencyHint=t))switch(t){case"interactive":e=.1;break;case"playback":e=.5;break;case"balanced":e=.25}this.lookAhead=e,this.updateInterval=e/2}get rawContext(){return this._context}now(){return this._context.currentTime+this.lookAhead}immediate(){return this._context.currentTime}resume(){return Sp(this._context)?this._context.resume():Promise.resolve()}close(){return yp(this,void 0,void 0,function*(){var e;Sp(this._context)&&(yield this._context.close()),this._initialized&&(e=this,Lp.forEach(t=>t(e)))})}getConstant(e){if(this._constants.has(e))return this._constants.get(e);{const t=this._context.createBuffer(1,128,this._context.sampleRate),s=t.getChannelData(0);for(let t=0;tthis._constants[t].disconnect()),this}_timeoutLoop(){var t=this.now();let e=this._timeouts.peek();for(;this._timeouts.length&&e&&e.time<=t;)e.callback(),this._timeouts.shift(),e=this._timeouts.peek()}setTimeout(t,e){this._timeoutIds++;var s=this.now();return this._timeouts.add({callback:t,id:this._timeoutIds,time:s+e}),this._timeoutIds}clearTimeout(e){return this._timeouts.forEach(t=>{t.id===e&&this._timeouts.remove(t)}),this}clearInterval(t){return this.clearTimeout(t)}setInterval(e,s){const n=++this._timeoutIds,i=()=>{var t=this.now();this._timeouts.add({callback:()=>{e(),i()},id:n,time:t+s})};return i(),n}}function Gp(e,t){np(t)?t.forEach(t=>Gp(e,t)):Object.defineProperty(e,t,{enumerable:!0,writable:!1})}function Qp(e,t){np(t)?t.forEach(t=>Qp(e,t)):Object.defineProperty(e,t,{writable:!0})}const Zp=()=>{};class Xp extends Mp{constructor(){super(),this.name="ToneAudioBuffer",this.onload=Zp;var t=Cp(Xp.getDefaults(),arguments,["url","onload","onerror"]);this.reverse=t.reverse,this.onload=t.onload,t.url&&kp(t.url)||t.url instanceof Xp?this.set(t.url):ip(t.url)&&this.load(t.url).catch(t.onerror)}static getDefaults(){return{onerror:Zp,onload:Zp,reverse:!1}}get sampleRate(){return(this._buffer||Jp()).sampleRate}set(t){return t instanceof Xp?t.loaded?this._buffer=t.get():t.onload=()=>{this.set(t),this.onload(this)}:this._buffer=t,this._reversed&&this._reverse(),this}get(){return this._buffer}load(e){return yp(this,void 0,void 0,function*(){var t=Xp.load(e).then(t=>{this.set(t),this.onload(this)});Xp.downloads.push(t);try{yield t}finally{const e=Xp.downloads.indexOf(t);Xp.downloads.splice(e,1)}return this})}dispose(){return super.dispose(),this._buffer=void 0,this}fromArray(t){const e=np(t)&&0t/n),this.fromArray(e)}return this}toArray(e){if(tp(e))return this.getChannelData(e);if(1===this.numberOfChannels)return this.toArray(0);{const e=[];for(let t=0;tsetTimeout(t,1)))}})}render(e=!0){return yp(this,void 0,void 0,function*(){yield this.workletsAreReady(),yield this._renderClock(e);var t=yield this._context.startRendering();return new Xp(t)})}close(){return Promise.resolve()}}const $p=new class extends Bp{constructor(){super(...arguments),this.lookAhead=0,this.latencyHint=0,this.isOffline=!1}createAnalyser(){return{}}createOscillator(){return{}}createBufferSource(){return{}}createBiquadFilter(){return{}}createBuffer(t,e,s){return{}}createChannelMerger(t){return{}}createChannelSplitter(t){return{}}createConstantSource(){return{}}createConvolver(){return{}}createDelay(t){return{}}createDynamicsCompressor(){return{}}createGain(){return{}}createIIRFilter(t,e){return{}}createPanner(){return{}}createPeriodicWave(t,e,s){return{}}createStereoPanner(){return{}}createWaveShaper(){return{}}createMediaStreamSource(t){return{}}createMediaElementSource(t){return{}}createMediaStreamDestination(){return{}}decodeAudioData(t){return Promise.resolve({})}createAudioWorkletNode(t,e){return{}}get rawContext(){return{}}addAudioWorkletModule(t,e){return yp(this,void 0,void 0,function*(){return Promise.resolve()})}resume(){return Promise.resolve()}setTimeout(t,e){return 0}clearTimeout(t){return this}setInterval(t,e){return 0}clearInterval(t){return this}getConstant(t){return{}}get currentTime(){return 0}get state(){return{}}get sampleRate(){return 0}get listener(){return{}}get transport(){return{}}get draw(){return{}}set draw(t){}get destination(){return{}}set destination(t){}now(){return 0}immediate(){return 0}};let Hp=$p;function Jp(){return Hp===$p&&gp&&Kp(new Up),Hp}function Kp(t,e=!1){e&&Hp.dispose(),Hp=Sp(t)?new Up(t):Tp(t)?new Yp(t):t}if(mp&&!mp.TONE_SILENCE_LOGGING){let t="v";"dev"===s&&(t="");const e=` * Tone.js ${t}${s} * `;console.log(`%c${e}`,"background: #000; color: #fff")}function td(t){return Math.pow(10,t/20)}function ed(t){return Math.log(t)/Math.LN10*20}function sd(t){return Math.pow(2,t/12)}let nd=440;function id(t){return Math.round(rd(t))}function rd(t){return 69+12*Math.log2(t/nd)}function od(t){return nd*Math.pow(2,(t-69)/12)}class ad extends Mp{constructor(t,e,s){super(),this.defaultUnits="s",this._val=e,this._units=s,this.context=t,this._expressions=this._getExpressions()}_getExpressions(){return{hz:{method:t=>this._frequencyToUnits(parseFloat(t)),regexp:/^(\d+(?:\.\d+)?)hz$/i},i:{method:t=>this._ticksToUnits(parseInt(t,10)),regexp:/^(\d+)i$/i},m:{method:t=>this._beatsToUnits(parseInt(t,10)*this._getTimeSignature()),regexp:/^(\d+)m$/i},n:{method:(t,e)=>{t=parseInt(t,10),e="."===e?1.5:1;return 1===t?this._beatsToUnits(this._getTimeSignature())*e:this._beatsToUnits(4/t)*e},regexp:/^(\d+)n(\.?)$/i},number:{method:t=>this._expressions[this.defaultUnits].method.call(this,t),regexp:/^(\d+(?:\.\d+)?)$/},s:{method:t=>this._secondsToUnits(parseFloat(t)),regexp:/^(\d+(?:\.\d+)?)s$/},samples:{method:t=>parseInt(t,10)/this.context.sampleRate,regexp:/^(\d+)samples$/},t:{method:t=>{t=parseInt(t,10);return this._beatsToUnits(8/(3*Math.floor(t)))},regexp:/^(\d+)t$/i},tr:{method:(t,e,s)=>{let n=0;return t&&"0"!==t&&(n+=this._beatsToUnits(this._getTimeSignature()*parseFloat(t))),e&&"0"!==e&&(n+=this._beatsToUnits(parseFloat(e))),s&&"0"!==s&&(n+=this._beatsToUnits(parseFloat(s)/4)),n},regexp:/^(\d+(?:\.\d+)?):(\d+(?:\.\d+)?):?(\d+(?:\.\d+)?)?$/}}}valueOf(){if(this._val instanceof ad&&this.fromType(this._val),Hu(this._val))return this._noArg();if(ip(this._val)&&Hu(this._units)){for(const t in this._expressions)if(this._expressions[t].regexp.test(this._val.trim())){this._units=t;break}}else if(ep(this._val)){let t=0;for(const s in this._val){var e;Ju(this._val[s])&&(e=this._val[s],t+=new this.constructor(this.context,s).valueOf()*e)}return t}if(Ju(this._units)){const n=this._expressions[this._units],i=this._val.toString().trim().match(n.regexp);return i?n.method.apply(this,i.slice(1)):n.method.call(this,this._val)}return ip(this._val)?parseFloat(this._val):this._val}_frequencyToUnits(t){return 1/t}_beatsToUnits(t){return 60/this._getBpm()*t}_secondsToUnits(t){return t}_ticksToUnits(t){return t*this._beatsToUnits(1)/this._getPPQ()}_noArg(){return this._now()}_getBpm(){return this.context.transport.bpm.value}_getTimeSignature(){return this.context.transport.timeSignature}_getPPQ(){return this.context.transport.PPQ}fromType(t){switch(this._units=void 0,this.defaultUnits){case"s":this._val=t.toSeconds();break;case"i":this._val=t.toTicks();break;case"hz":this._val=t.toFrequency();break;case"midi":this._val=t.toMidi()}return this}toFrequency(){return 1/this.toSeconds()}toSamples(){return this.toSeconds()*this.context.sampleRate}toMilliseconds(){return 1e3*this.toSeconds()}}class hd extends ad{constructor(){super(...arguments),this.name="TimeClass"}_getExpressions(){return Object.assign(super._getExpressions(),{now:{method:t=>this._now()+new this.constructor(this.context,t).valueOf(),regexp:/^\+(.+)/},quantize:{method:t=>{t=new hd(this.context,t).valueOf();return this._secondsToUnits(this.context.transport.nextSubdivision(t))},regexp:/^@(.+)/}})}quantize(t,e=1){var s=new this.constructor(this.context,t).valueOf(),t=this.valueOf();return t+(Math.round(t/s)*s-t)*e}toNotation(){const s=this.toSeconds(),e=["1m"];for(let t=1;t<9;t++){const n=Math.pow(2,t);e.push(n+"n."),e.push(n+"n"),e.push(n+"t")}e.push("0");let n=e[0],i=new hd(this.context,e[0]).toSeconds();return e.forEach(t=>{var e=new hd(this.context,t).toSeconds();Math.abs(e-s)this.transpose(t))}toMidi(){return id(this.valueOf())}toNote(){var t=this.toFrequency(),t=Math.log2(t/cd.A4);let e=Math.round(12*t)+57;const s=Math.floor(e/12);return s<0&&(e+=-12*s),ud[e%12]+s.toString()}toSeconds(){return 1/super.toSeconds()}toTicks(){var t=this._beatsToUnits(1),t=this.valueOf()/t;return Math.floor(t*this._getPPQ())}_noArg(){return 0}_frequencyToUnits(t){return t}_ticksToUnits(t){return 1/(60*t/(this._getBpm()*this._getPPQ()))}_beatsToUnits(t){return 1/super._beatsToUnits(t)}_secondsToUnits(t){return 1/t}static mtof(t){return od(t)}static ftom(t){return id(t)}}const ld={cbbb:-3,cbb:-2,cb:-1,c:0,"c#":1,cx:2,"c##":2,"c###":3,"cx#":3,"c#x":3,dbbb:-1,dbb:0,db:1,d:2,"d#":3,dx:4,"d##":4,"d###":5,"dx#":5,"d#x":5,ebbb:1,ebb:2,eb:3,e:4,"e#":5,ex:6,"e##":6,"e###":7,"ex#":7,"e#x":7,fbbb:2,fbb:3,fb:4,f:5,"f#":6,fx:7,"f##":7,"f###":8,"fx#":8,"f#x":8,gbbb:4,gbb:5,gb:6,g:7,"g#":8,gx:9,"g##":9,"g###":10,"gx#":10,"g#x":10,abbb:6,abb:7,ab:8,a:9,"a#":10,ax:11,"a##":11,"a###":12,"ax#":12,"a#x":12,bbbb:8,bbb:9,bb:10,b:11,"b#":12,bx:13,"b##":13,"b###":14,"bx#":14,"b#x":14},ud=["C","C#","D","D#","E","F","F#","G","G#","A","A#","B"];class pd extends hd{constructor(){super(...arguments),this.name="TransportTime"}_now(){return this.context.transport.seconds}}class dd extends Mp{constructor(){super();var t=Cp(dd.getDefaults(),arguments,["context"]);this.defaultContext?this.context=this.defaultContext:this.context=t.context}static getDefaults(){return{context:Jp()}}now(){return this.context.currentTime+this.context.lookAhead}immediate(){return this.context.currentTime}get sampleTime(){return 1/this.context.sampleRate}get blockTime(){return 128/this.context.sampleRate}toSeconds(t){return pp(t),new hd(this.context,t).toSeconds()}toFrequency(t){return new cd(this.context,t).toFrequency()}toTicks(t){return new pd(this.context,t).toTicks()}_getPartialProperties(e){const s=this.get();return Object.keys(s).forEach(t=>{Hu(e[t])&&delete s[t]}),s}get(){const s=this.constructor.getDefaults();return Object.keys(s).forEach(t=>{if(Reflect.has(this,t)){const e=this[t];Ju(e)&&Ju(e.value)&&Ju(e.setValueAtTime)?s[t]=e.value:e instanceof dd?s[t]=e._getPartialProperties(s[t]):np(e)||tp(e)||ip(e)||sp(e)?s[t]=e:delete s[t]}}),s}set(e){return Object.keys(e).forEach(t=>{Reflect.has(this,t)&&Ju(this[t])&&(this[t]&&Ju(this[t].value)&&Ju(this[t].setValueAtTime)?this[t].value!==e[t]&&(this[t].value=e[t]):this[t]instanceof dd?this[t].set(e[t]):this[t]=e[t])}),this}}class fd extends Np{constructor(t="stopped"){super(),this.name="StateTimeline",this._initial=t,this.setStateAtTime(this._initial,0)}getValueAtTime(t){t=this.get(t);return null!==t?t.state:this._initial}setStateAtTime(t,e,s){return ap(e,0),this.add(Object.assign({},s,{state:t,time:e})),this}getLastState(e,s){for(let t=this._search(s);0<=t;t--){const s=this._timeline[t];if(s.state===e)return s}}getNextState(e,t){const s=this._search(t);if(-1!==s)for(let t=s;t{"cancelScheduledValues"===t.type?e.cancelScheduledValues(t.time):"setTargetAtTime"===t.type?e.setTargetAtTime(t.value,t.time,t.constant):e[t.type](t.value,t.time)}),this}setParam(t){op(this._swappable,"The Param must be assigned as 'swappable' in the constructor");const e=this.input;return e.disconnect(this._param),this.apply(t),this._param=t,e.connect(this._param),this}dispose(){return super.dispose(),this._events.dispose(),this}get defaultValue(){return this._toType(this._param.defaultValue)}_exponentialApproach(t,e,s,n,i){return s+(e-s)*Math.exp(-(i-t)/n)}_linearInterpolate(t,e,s,n,i){return e+(i-t)/(s-t)*(n-e)}_exponentialInterpolate(t,e,s,n,i){return e*Math.pow(n/e,(i-t)/(s-t))}}class md extends dd{constructor(){super(...arguments),this._internalChannels=[]}get numberOfInputs(){return Ju(this.input)?wp(this.input)||this.input instanceof _d?1:this.input.numberOfInputs:0}get numberOfOutputs(){return Ju(this.output)?this.output.numberOfOutputs:0}_isAudioNode(t){return Ju(t)&&(t instanceof md||bp(t))}_getInternalNodes(){const t=this._internalChannels.slice(0);return this._isAudioNode(this.input)&&t.push(this.input),this._isAudioNode(this.output)&&this.input!==this.output&&t.push(this.output),t}_setChannelProperties(e){this._getInternalNodes().forEach(t=>{t.channelCount=e.channelCount,t.channelCountMode=e.channelCountMode,t.channelInterpretation=e.channelInterpretation})}_getChannelProperties(){var t=this._getInternalNodes();op(0this.connect(t)),this}dispose(){return super.dispose(),Ju(this.input)&&(this.input instanceof md?this.input.dispose():bp(this.input)&&this.input.disconnect()),Ju(this.output)&&(this.output instanceof md?this.output.dispose():bp(this.output)&&this.output.disconnect()),this._internalChannels=[],this}}function gd(...t){var e=t.shift();t.reduce((t,e)=>(t instanceof md?t.connect(e):bp(t)&&vd(t,e),e),e)}function vd(t,e,s=0,n=0){for(op(Ju(t),"Cannot connect from undefined node"),op(Ju(e),"Cannot connect to undefined node"),(e instanceof md||bp(e))&&op(0=this._startTime&&(-1===this._stopTime||t<=this._stopTime)?"started":"stopped"},this._fadeIn=t.fadeIn,this._fadeOut=t.fadeOut,this._curve=t.curve,this.onended=t.onended}static getDefaults(){return Object.assign(md.getDefaults(),{curve:"linear",fadeIn:0,fadeOut:0,onended:Zp})}_startGain(t,e=1){op(-1===this._startTime,"Source cannot be started more than once");var s=this.toSeconds(this._fadeIn);return this._startTime=t+s,this._startTime=Math.max(this._startTime,this.context.currentTime),0{var t="exponential"===this._curve?2*e:0;this._stopSource(this.now()+t),this._onended()},this._stopTime-this.context.currentTime),this}_onended(){var t;this.onended===Zp||(this.onended(this),this.onended=Zp,this.context.isOffline)||(t=()=>this.dispose(),void 0!==window.requestIdleCallback?window.requestIdleCallback(t):setTimeout(t,1e3))}get state(){return this.getStateAtTime(this.now())}cancelStop(){return this.log("cancelStop"),op(-1!==this._startTime,"Source is not started"),this._gainNode.gain.cancelScheduledValues(this._startTime+this.sampleTime),this.context.clearTimeout(this._timeout),this._stopTime=-1,this}dispose(){return super.dispose(),this._gainNode.dispose(),this.onended=Zp,this}}class bd extends wd{constructor(){super(Cp(bd.getDefaults(),arguments,["offset"])),this.name="ToneConstantSource",this._source=this.context.createConstantSource();var t=Cp(bd.getDefaults(),arguments,["offset"]);vd(this._source,this._gainNode),this.offset=new _d({context:this.context,convert:t.convert,param:this._source.offset,units:t.units,value:t.offset,minValue:t.minValue,maxValue:t.maxValue})}static getDefaults(){return Object.assign(wd.getDefaults(),{convert:!0,offset:1,units:"number"})}start(t){t=this.toSeconds(t);return this.log("start",t),this._startGain(t),this._source.start(t),this}_stopSource(t){this._source.stop(t)}dispose(){return super.dispose(),"started"===this.state&&this.stop(),this._source.disconnect(),this.offset.dispose(),this}}class Td extends md{constructor(){super(Cp(Td.getDefaults(),arguments,["value","units"])),this.name="Signal",this.override=!0;var t=Cp(Td.getDefaults(),arguments,["value","units"]);this.output=this._constantSource=new bd({context:this.context,convert:t.convert,offset:t.value,units:t.units,minValue:t.minValue,maxValue:t.maxValue}),this._constantSource.start(0),this.input=this._param=this._constantSource.offset}static getDefaults(){return Object.assign(md.getDefaults(),{convert:!0,units:"number",value:0})}connect(t,e=0,s=0){return Sd(this,t,e,s),this}dispose(){return super.dispose(),this._param.dispose(),this._constantSource.dispose(),this}setValueAtTime(t,e){return this._param.setValueAtTime(t,e),this}getValueAtTime(t){return this._param.getValueAtTime(t)}setRampPoint(t){return this._param.setRampPoint(t),this}linearRampToValueAtTime(t,e){return this._param.linearRampToValueAtTime(t,e),this}exponentialRampToValueAtTime(t,e){return this._param.exponentialRampToValueAtTime(t,e),this}exponentialRampTo(t,e,s){return this._param.exponentialRampTo(t,e,s),this}linearRampTo(t,e,s){return this._param.linearRampTo(t,e,s),this}targetRampTo(t,e,s){return this._param.targetRampTo(t,e,s),this}exponentialApproachValueAtTime(t,e,s){return this._param.exponentialApproachValueAtTime(t,e,s),this}setTargetAtTime(t,e,s){return this._param.setTargetAtTime(t,e,s),this}setValueCurveAtTime(t,e,s,n){return this._param.setValueCurveAtTime(t,e,s,n),this}cancelScheduledValues(t){return this._param.cancelScheduledValues(t),this}cancelAndHoldAtTime(t){return this._param.cancelAndHoldAtTime(t),this}rampTo(t,e,s){return this._param.rampTo(t,e,s),this}get value(){return this._param.value}set value(t){this._param.value=t}get convert(){return this._param.convert}set convert(t){this._param.convert=t}get units(){return this._param.units}get overridden(){return this._param.overridden}set overridden(t){this._param.overridden=t}get maxValue(){return this._param.maxValue}get minValue(){return this._param.minValue}apply(t){return this._param.apply(t),this}}function Sd(t,e,s,n){(e instanceof _d||wp(e)||e instanceof Td&&e.override)&&(e.cancelScheduledValues(0),e.setValueAtTime(0,0),e instanceof Td&&(e.overridden=!0)),vd(t,e,s,n)}class kd extends _d{constructor(){super(Cp(kd.getDefaults(),arguments,["value"])),this.name="TickParam",this._events=new Np(1/0),this._multiplier=1;var t=Cp(kd.getDefaults(),arguments,["value"]);this._multiplier=t.multiplier,this._events.cancel(0),this._events.add({ticks:0,time:0,type:"setValueAtTime",value:this._fromType(t.value)}),this.setValueAtTime(t.value,0)}static getDefaults(){return Object.assign(_d.getDefaults(),{multiplier:1,units:"hertz",value:1})}setTargetAtTime(t,e,s){e=this.toSeconds(e),this.setRampPoint(e);const n=this._fromType(t),i=this._events.get(e),r=Math.round(Math.max(1/s,1));for(let t=0;t<=r;t++){const r=s*t+e,o=this._exponentialApproach(i.time,i.value,n,s,r);this.linearRampToValueAtTime(this._toType(o),r)}return this}setValueAtTime(t,e){var s=this.toSeconds(e);super.setValueAtTime(t,e);const n=this._events.get(s),i=this._events.previousEvent(n),r=this._getTicksUntilEvent(i,s);return n.ticks=Math.max(r,0),this}linearRampToValueAtTime(t,e){var s=this.toSeconds(e);super.linearRampToValueAtTime(t,e);const n=this._events.get(s),i=this._events.previousEvent(n),r=this._getTicksUntilEvent(i,s);return n.ticks=Math.max(r,0),this}exponentialRampToValueAtTime(t,e){e=this.toSeconds(e);const s=this._fromType(t),n=this._events.get(e),i=Math.round(Math.max(10*(e-n.time),1)),r=(e-n.time)/i;for(let t=0;t<=i;t++){const i=r*t+n.time,o=this._exponentialInterpolate(n.time,n.value,e,s,i);this.linearRampToValueAtTime(this._toType(o),i)}return this}_getTicksUntilEvent(t,e){if(null===t)t={ticks:0,time:0,type:"setValueAtTime",value:0};else if(Hu(t.ticks)){const e=this._events.previousEvent(t);t.ticks=this._getTicksUntilEvent(e,t.time)}var s=this._fromType(this.getValueAtTime(t.time));let n=this._fromType(this.getValueAtTime(e));var i=this._events.get(e);return i&&i.time===e&&"setValueAtTime"===i.type&&(n=this._fromType(this.getValueAtTime(e-this.sampleTime))),.5*(e-t.time)*(s+n)+t.ticks}getTicksAtTime(t){var e=this.toSeconds(t),t=this._events.get(e);return Math.max(this._getTicksUntilEvent(t,e),0)}getDurationOfTicks(t,e){var s=this.toSeconds(e),e=this.getTicksAtTime(e);return this.getTimeOfTick(e+t)-s}getTimeOfTick(t){var e=this._events.get(t,"ticks"),s=this._events.getAfter(t,"ticks");if(e&&e.ticks===t)return e.time;if(e&&s&&"linearRampToValueAtTime"===s.type&&e.value!==s.value){var n=this._fromType(this.getValueAtTime(e.time)),i=(this._fromType(this.getValueAtTime(s.time))-n)/(s.time-e.time),r=Math.sqrt(Math.pow(n,2)-2*i*(e.ticks-t)),s=(-n+r)/i;return(0{let e=r.time;var s=this._tickOffset.get(t.time);s&&s.time>=r.time&&(o=s.ticks,e=s.time),"started"===r.state&&"started"!==t.state&&(o+=this.frequency.getTicksAtTime(t.time)-this.frequency.getTicksAtTime(e),t.time!=i.time&&(a={state:t.state,time:t.time,ticks:o})),r=t}),this._state.remove(i),a&&this._ticksAtTime.add(a),o}get ticks(){return this.getTicksAtTime(this.now())}set ticks(t){this.setTicksAtTime(t,this.now())}get seconds(){return this.getSecondsAtTime(this.now())}set seconds(t){var e=this.now(),t=this.frequency.timeToTicks(t,e);this.setTicksAtTime(t,e)}getSecondsAtTime(t){t=this.toSeconds(t);const e=this._state.getLastState("stopped",t),n={state:"paused",time:t};this._state.add(n);var s=this._secondsAtTime.get(t);let i=s||e,r=s?s.seconds:0,o=null;return this._state.forEachBetween(i.time,t+this.sampleTime,t=>{let e=i.time;var s=this._tickOffset.get(t.time);s&&s.time>=i.time&&(r=s.seconds,e=s.time),"started"===i.state&&"started"!==t.state&&(r+=t.time-e,t.time!=n.time&&(o={state:t.state,time:t.time,seconds:r})),i=t}),this._state.remove(n),o&&this._secondsAtTime.add(o),r}setTicksAtTime(t,e){return e=this.toSeconds(e),this._tickOffset.cancel(e),this._tickOffset.add({seconds:this.frequency.getDurationOfTicks(t,e),ticks:t,time:e}),this._ticksAtTime.cancel(e),this._secondsAtTime.cancel(e),this}getStateAtTime(t){return t=this.toSeconds(t),this._state.getValueAtTime(t)}getTimeOfTick(t,e=this.now()){var s=this._tickOffset.get(e),e=this._state.get(e),e=Math.max(s.time,e.time),s=this.frequency.getTicksAtTime(e)+t-s.ticks;return this.frequency.getTimeOfTick(s)}forEachTickBetween(s,n,i){let r=this._state.get(s);this._state.forEachBetween(s,n,t=>{r&&"started"===r.state&&"started"!==t.state&&this.forEachTickBetween(Math.max(r.time,s),t.time-this.sampleTime,i),r=t});let o=null;if(r&&"started"===r.state){var a=Math.max(r.time,s),h=this.frequency.getTicksAtTime(a),a=h-this.frequency.getTicksAtTime(r.time);let t=Math.ceil(a)-a;t=Ip(t,1)?0:t;let e=this.frequency.getTimeOfTick(h+t);for(;e{switch(t.state){case"started":var e=this._tickSource.getTicksAtTime(t.time);this.emit("start",t.time,e);break;case"stopped":0!==t.time&&this.emit("stop",t.time);break;case"paused":this.emit("pause",t.time)}}),this._tickSource.forEachTickBetween(t,e,(t,e)=>{this.callback(t,e)}))}getStateAtTime(t){t=this.toSeconds(t);return this._state.getValueAtTime(t)}dispose(){return super.dispose(),this.context.off("tick",this._boundLoop),this._tickSource.dispose(),this._state.dispose(),this}}Wp.mixin(Dd);class Od extends md{constructor(){super(Cp(Od.getDefaults(),arguments,["delayTime","maxDelay"])),this.name="Delay";var t=Cp(Od.getDefaults(),arguments,["delayTime","maxDelay"]),e=this.toSeconds(t.maxDelay);this._maxDelay=Math.max(e,this.toSeconds(t.delayTime)),this._delayNode=this.input=this.output=this.context.createDelay(e),this.delayTime=new _d({context:this.context,param:this._delayNode.delayTime,units:"time",value:t.delayTime,minValue:0,maxValue:this.maxDelay}),Gp(this,"delayTime")}static getDefaults(){return Object.assign(md.getDefaults(),{delayTime:0,maxDelay:1})}get maxDelay(){return this._maxDelay}dispose(){return super.dispose(),this._delayNode.disconnect(),this.delayTime.dispose(),this}}class Md extends Mp{constructor(){super(),this.name="ToneAudioBuffers",this._buffers=new Map,this._loadingCount=0;const s=Cp(Md.getDefaults(),arguments,["urls","onload","baseUrl"],"urls");this.baseUrl=s.baseUrl,Object.keys(s.urls).forEach(t=>{this._loadingCount++;var e=s.urls[t];this.add(t,e,this._bufferLoaded.bind(this,s.onload),s.onerror)})}static getDefaults(){return{baseUrl:"",onerror:Zp,onload:Zp,urls:{}}}has(t){return this._buffers.has(t.toString())}get(t){return op(this.has(t),`ToneAudioBuffers has no buffer named: ${t}`),this._buffers.get(t.toString())}_bufferLoaded(t){this._loadingCount--,0===this._loadingCount&&t&&t()}get loaded(){return Array.from(this._buffers).every(([,t])=>t.loaded)}add(t,e,s=Zp,n=Zp){return ip(e)?(this.baseUrl&&"data:audio/"===e.trim().substring(0,11).toLowerCase()&&(this.baseUrl=""),this._buffers.set(t.toString(),new Xp(this.baseUrl+e,s,n))):this._buffers.set(t.toString(),new Xp(e,s,n)),this}dispose(){return super.dispose(),this._buffers.forEach(t=>t.dispose()),this._buffers.clear(),this}}class Ed extends cd{constructor(){super(...arguments),this.name="MidiClass",this.defaultUnits="midi"}_frequencyToUnits(t){return id(super._frequencyToUnits(t))}_ticksToUnits(t){return id(super._ticksToUnits(t))}_beatsToUnits(t){return id(super._beatsToUnits(t))}_secondsToUnits(t){return id(super._secondsToUnits(t))}toMidi(){return this.valueOf()}toFrequency(){return od(this.toMidi())}transpose(t){return new Ed(this.context,this.toMidi()+t)}}class Rd extends pd{constructor(){super(...arguments),this.name="Ticks",this.defaultUnits="i"}_now(){return this.context.transport.ticks}_beatsToUnits(t){return this._getPPQ()*t}_secondsToUnits(t){return Math.floor(t/(60/this._getBpm())*this._getPPQ())}_ticksToUnits(t){return t}toTicks(){return this.valueOf()}toSeconds(){return this.valueOf()/this._getPPQ()*(60/this._getBpm())}}class qd extends dd{constructor(){super(...arguments),this.name="Draw",this.expiration=.25,this.anticipation=.008,this._events=new Np,this._boundDrawLoop=this._drawLoop.bind(this),this._animationFrame=-1}schedule(t,e){return this._events.add({callback:t,time:this.toSeconds(e)}),1===this._events.length&&(this._animationFrame=requestAnimationFrame(this._boundDrawLoop)),this}cancel(t){return this._events.cancel(this.toSeconds(t)),this}_drawLoop(){for(var t=this.context.currentTime;this._events.length&&this._events.peek().time-this.anticipation<=t;){const e=this._events.shift();e&&t-e.time<=this.expiration&&e.callback()}0{t.draw=new qd({context:t})}),zp(t=>{t.draw.dispose()});class Fd extends Mp{constructor(){super(...arguments),this.name="IntervalTimeline",this._root=null,this._length=0}add(t){op(Ju(t.time),"Events must have a time property"),op(Ju(t.duration),"Events must have a duration parameter"),t.time=t.time.valueOf();let e=new Id(t.time,t.time+t.duration,t);for(null===this._root?this._root=e:this._root.insert(e),this._length++;null!==e;)e.updateHeight(),e.updateMax(),this._rebalance(e),e=e.parent;return this}remove(t){if(null!==this._root){var e=[];this._root.search(t.time,e);for(const s of e)if(s.event===t){this._removeNode(s),this._length--;break}}return this}get length(){return this._length}cancel(t){return this.forEachFrom(t,t=>this.remove(t)),this}_setRoot(t){this._root=t,null!==this._root&&(this._root.parent=null)}_replaceNodeInParent(t,e){null!==t.parent?(t.isLeftChild()?t.parent.left=e:t.parent.right=e,this._rebalance(t.parent)):this._setRoot(e)}_removeNode(s){if(null===s.left&&null===s.right)this._replaceNodeInParent(s,null);else if(null===s.right)this._replaceNodeInParent(s,s.left);else if(null===s.left)this._replaceNodeInParent(s,s.right);else{let t,e=null;if(0e.low&&(e=s[t]);return e.event}}return null}forEach(e){if(null!==this._root){const s=[];this._root.traverse(t=>s.push(t)),s.forEach(t=>{t.event&&e(t.event)})}return this}forEachAtTime(t,e){if(null!==this._root){const s=[];this._root.search(t,s),s.forEach(t=>{t.event&&e(t.event)})}return this}forEachFrom(t,e){if(null!==this._root){const s=[];this._root.searchAfter(t,s),s.forEach(t=>{t.event&&e(t.event)})}return this}dispose(){return super.dispose(),null!==this._root&&this._root.traverse(t=>t.dispose()),this._root=null,this}}class Id{constructor(t,e,s){this._left=null,this._right=null,this.parent=null,this.height=0,this.event=s,this.low=t,this.high=e,this.max=this.high}insert(t){t.low<=this.low?null===this.left?this.left=t:this.left.insert(t):null===this.right?this.right=t:this.right.insert(t)}search(t,e){t>this.max||(null!==this.left&&this.left.search(t,e),this.low<=t&&this.high>t&&e.push(this),this.low>t||null!==this.right&&this.right.search(t,e))}searchAfter(t,e){this.low>=t&&(e.push(this),null!==this.left&&this.left.searchAfter(t,e)),null!==this.right&&this.right.searchAfter(t,e)}traverse(t){t(this),null!==this.left&&this.left.traverse(t),null!==this.right&&this.right.traverse(t)}updateHeight(){null!==this.left&&null!==this.right?this.height=Math.max(this.left.height,this.right.height)+1:null!==this.right?this.height=this.right.height+1:null!==this.left?this.height=this.left.height+1:this.height=0}updateMax(){this.max=this.high,null!==this.left&&(this.max=Math.max(this.max,this.left.max)),null!==this.right&&(this.max=Math.max(this.max,this.right.max))}getBalance(){let t=0;return null!==this.left&&null!==this.right?t=this.left.height-this.right.height:null!==this.left?t=this.left.height+1:null!==this.right&&(t=-(this.right.height+1)),t}isLeftChild(){return null!==this.parent&&this.parent.left===this}get left(){return this._left}set left(t){null!==(this._left=t)&&(t.parent=this),this.updateHeight(),this.updateMax()}get right(){return this._right}set right(t){null!==(this._right=t)&&(t.parent=this),this.updateHeight(),this.updateMax()}dispose(){this.parent=null,this._left=null,this._right=null,this.event=null}}class Vd extends md{constructor(){super(Cp(Vd.getDefaults(),arguments,["volume"])),this.name="Volume";var t=Cp(Vd.getDefaults(),arguments,["volume"]);this.input=this.output=new xd({context:this.context,gain:t.volume,units:"decibels"}),this.volume=this.output.gain,Gp(this,"volume"),this._unmutedVolume=t.volume,this.mute=t.mute}static getDefaults(){return Object.assign(md.getDefaults(),{mute:!1,volume:0})}get mute(){return this.volume.value===-1/0}set mute(t){!this.mute&&t?(this._unmutedVolume=this.volume.value,this.volume.value=-1/0):this.mute&&!t&&(this.volume.value=this._unmutedVolume)}dispose(){return super.dispose(),this.input.dispose(),this.volume.dispose(),this}}class Nd extends md{constructor(){super(Cp(Nd.getDefaults(),arguments)),this.name="Destination",this.input=new Vd({context:this.context}),this.output=new xd({context:this.context}),this.volume=this.input.volume;var t=Cp(Nd.getDefaults(),arguments);gd(this.input,this.output,this.context.rawContext.destination),this.mute=t.mute,this._internalChannels=[this.input,this.context.rawContext.destination,this.output]}static getDefaults(){return Object.assign(md.getDefaults(),{mute:!1,volume:0})}get mute(){return this.input.mute}set mute(t){this.input.mute=t}chain(...t){return this.input.disconnect(),t.unshift(this.input),t.push(this.output),gd(...t),this}get maxChannelCount(){return this.context.rawContext.destination.maxChannelCount}dispose(){return super.dispose(),this.volume.dispose(),this}}jp(t=>{t.destination=new Nd({context:t})}),zp(t=>{t.destination.dispose()});class Pd extends Mp{constructor(t){super(),this.name="TimelineValue",this._timeline=new Np({memory:10}),this._initialValue=t}set(t,e){return this._timeline.add({value:t,time:e}),this}get(t){t=this._timeline.get(t);return t?t.value:this._initialValue}}class jd{constructor(t,e){this.id=jd._eventId++,this._remainderTime=0;e=Object.assign(jd.getDefaults(),e);this.transport=t,this.callback=e.callback,this._once=e.once,this.time=Math.floor(e.time),this._remainderTime=e.time-this.time}static getDefaults(){return{callback:Zp,once:!1,time:0}}get floatTime(){return this.time+this._remainderTime}invoke(t){var e;this.callback&&(e=this.transport.bpm.getDurationOfTicks(1,t),this.callback(t+this._remainderTime*e),this._once&&this.transport.clear(this.id))}dispose(){return this.callback=void 0,this}}jd._eventId=0;class Ld extends jd{constructor(t,e){super(t,e),this._currentId=-1,this._nextId=-1,this._nextTick=this.time,this._boundRestart=this._restart.bind(this);e=Object.assign(Ld.getDefaults(),e);this.duration=e.duration,this._interval=e.interval,this._nextTick=e.time,this.transport.on("start",this._boundRestart),this.transport.on("loopStart",this._boundRestart),this.transport.on("ticks",this._boundRestart),this.context=this.transport.context,this._restart()}static getDefaults(){return Object.assign({},jd.getDefaults(),{duration:1/0,interval:1,once:!1})}invoke(t){this._createEvents(t),super.invoke(t)}_createEvent(){return Fp(this._nextTick,this.floatTime+this.duration)?this.transport.scheduleOnce(this.invoke.bind(this),new Rd(this.context,this._nextTick).toSeconds()):-1}_createEvents(t){Fp(this._nextTick+this._interval,this.floatTime+this.duration)&&(this._nextTick+=this._interval,this._currentId=this._nextId,this._nextId=this.transport.scheduleOnce(this.invoke.bind(this),new Rd(this.context,this._nextTick).toSeconds()))}_restart(t){this.transport.clear(this._currentId),this.transport.clear(this._nextId),this._nextTick=this.floatTime;t=this.transport.getTicksAtTime(t);Rp(t,this.time)&&(this._nextTick=this.floatTime+Math.ceil((t-this.floatTime)/this._interval)*this._interval),this._currentId=this._createEvent(),this._nextTick+=this._interval,this._nextId=this._createEvent()}dispose(){return super.dispose(),this.transport.clear(this._currentId),this.transport.clear(this._nextId),this.transport.off("start",this._boundRestart),this.transport.off("loopStart",this._boundRestart),this.transport.off("ticks",this._boundRestart),this}}class zd extends dd{constructor(){super(Cp(zd.getDefaults(),arguments)),this.name="Transport",this._loop=new Pd(!1),this._loopStart=0,this._loopEnd=0,this._scheduledEvents={},this._timeline=new Np,this._repeatedEvents=new Fd,this._syncedSignals=[],this._swingAmount=0;var t=Cp(zd.getDefaults(),arguments);this._ppq=t.ppq,this._clock=new Dd({callback:this._processTick.bind(this),context:this.context,frequency:0,units:"bpm"}),this._bindClockEvents(),this.bpm=this._clock.frequency,this._clock.frequency.multiplier=t.ppq,this.bpm.setValueAtTime(t.bpm,0),Gp(this,"bpm"),this._timeSignature=t.timeSignature,this._swingTicks=t.ppq/2}static getDefaults(){return Object.assign(dd.getDefaults(),{bpm:120,loopEnd:"4m",loopStart:0,ppq:192,swing:0,swingSubdivision:"8n",timeSignature:4})}_processTick(e,t){var s;this._loop.get(e)&&t>=this._loopEnd&&(this.emit("loopEnd",e),this._clock.setTicksAtTime(this._loopStart,e),t=this._loopStart,this.emit("loopStart",e,this._clock.getSecondsAtTime(e)),this.emit("loop",e)),0t.invoke(e)),up(!1)}schedule(t,e){e=new jd(this,{callback:t,time:new pd(this.context,e).toTicks()});return this._addEvent(e,this._timeline)}scheduleRepeat(t,e,s,n=1/0){s=new Ld(this,{callback:t,duration:new hd(this.context,n).toTicks(),interval:new hd(this.context,e).toTicks(),time:new pd(this.context,s).toTicks()});return this._addEvent(s,this._repeatedEvents)}scheduleOnce(t,e){e=new jd(this,{callback:t,once:!0,time:new pd(this.context,e).toTicks()});return this._addEvent(e,this._timeline)}clear(t){if(this._scheduledEvents.hasOwnProperty(t)){const e=this._scheduledEvents[t.toString()];e.timeline.remove(e.event),e.event.dispose(),delete this._scheduledEvents[t.toString()]}return this}_addEvent(t,e){return this._scheduledEvents[t.id.toString()]={event:t,timeline:e},e.add(t),t.id}cancel(t=0){t=this.toTicks(t);return this._timeline.forEachFrom(t,t=>this.clear(t.id)),this._repeatedEvents.forEachFrom(t,t=>this.clear(t.id)),this}_bindClockEvents(){this._clock.on("start",(t,e)=>{e=new Rd(this.context,e).toSeconds(),this.emit("start",t,e)}),this._clock.on("stop",t=>{this.emit("stop",t)}),this._clock.on("pause",t=>{this.emit("pause",t)})}get state(){return this._clock.getStateAtTime(this.now())}start(t,e){let s;return this.context.resume(),Ju(e)&&(s=this.toTicks(e)),this._clock.start(t,s),this}stop(t){return this._clock.stop(t),this}pause(t){return this._clock.pause(t),this}toggle(t){return t=this.toSeconds(t),"started"!==this._clock.getStateAtTime(t)?this.start(t):this.stop(t),this}get timeSignature(){return this._timeSignature}set timeSignature(t){np(t)&&(t=t[0]/t[1]*4),this._timeSignature=t}get loopStart(){return new hd(this.context,this._loopStart,"i").toSeconds()}set loopStart(t){this._loopStart=this.toTicks(t)}get loopEnd(){return new hd(this.context,this._loopEnd,"i").toSeconds()}set loopEnd(t){this._loopEnd=this.toTicks(t)}get loop(){return this._loop.get(this.now())}set loop(t){this._loop.set(t,this.now())}setLoopPoints(t,e){return this.loopStart=t,this.loopEnd=e,this}get swing(){return this._swingAmount}set swing(t){this._swingAmount=t}get swingSubdivision(){return new Rd(this.context,this._swingTicks).toNotation()}set swingSubdivision(t){this._swingTicks=this.toTicks(t)}get position(){var t=this.now(),t=this._clock.getTicksAtTime(t);return new Rd(this.context,t).toBarsBeatsSixteenths()}set position(t){t=this.toTicks(t);this.ticks=t}get seconds(){return this._clock.seconds}set seconds(t){var e=this.now(),e=this._clock.frequency.timeToTicks(t,e);this.ticks=e}get progress(){if(this.loop){var t=this.now();return(this._clock.getTicksAtTime(t)-this._loopStart)/(this._loopEnd-this._loopStart)}return 0}get ticks(){return this._clock.ticks}set ticks(t){var e,s;this._clock.ticks!==t&&(e=this.now(),"started"===this.state?(s=this._clock.getTicksAtTime(e),s=e+this._clock.frequency.getDurationOfTicks(Math.ceil(s)-s,e),this.emit("stop",s),this._clock.setTicksAtTime(t,s),this.emit("start",s,this._clock.getSecondsAtTime(s))):(this.emit("ticks",e),this._clock.setTicksAtTime(t,e)))}getTicksAtTime(t){return this._clock.getTicksAtTime(t)}getSecondsAtTime(t){return this._clock.getSecondsAtTime(t)}get PPQ(){return this._clock.frequency.multiplier}set PPQ(t){this._clock.frequency.multiplier=t}nextSubdivision(t){if(t=this.toTicks(t),"started"!==this.state)return 0;var e=this.now(),t=t-this.getTicksAtTime(e)%t;return this._clock.nextTickTime(t,e)}syncSignal(t,e){if(!e){const n=this.now();var s;e=0!==t.getValueAtTime(n)?(s=1/(60/this.bpm.getValueAtTime(n)/this.PPQ),t.getValueAtTime(n)/s):0}const n=new xd(e);return this.bpm.connect(n),n.connect(t._param),this._syncedSignals.push({initial:t.value,ratio:n,signal:t}),t.value=0,this}unsyncSignal(e){for(let t=this._syncedSignals.length-1;0<=t;t--){const s=this._syncedSignals[t];s.signal===e&&(s.ratio.dispose(),s.signal.value=s.initial,this._syncedSignals.splice(t,1))}return this}dispose(){return super.dispose(),this._clock.dispose(),Qp(this,"bpm"),this._timeline.dispose(),this._repeatedEvents.dispose(),this}}Wp.mixin(zd),jp(t=>{t.transport=new zd({context:t})}),zp(t=>{t.transport.dispose()});class Wd extends md{constructor(t){super(t),this.input=void 0,this._state=new fd("stopped"),this._synced=!1,this._scheduled=[],this._syncedStart=Zp,this._syncedStop=Zp,this._state.memory=100,this._state.increasing=!0,this._volume=this.output=new Vd({context:this.context,mute:t.mute,volume:t.volume}),this.volume=this._volume.volume,Gp(this,"volume"),this.onstop=t.onstop}static getDefaults(){return Object.assign(md.getDefaults(),{mute:!1,onstop:Zp,volume:0})}get state(){return this._synced?"started"===this.context.transport.state?this._state.getValueAtTime(this.context.transport.seconds):"stopped":this._state.getValueAtTime(this.now())}get mute(){return this._volume.mute}set mute(t){this._volume.mute=t}_clampToCurrentTime(t){return this._synced?t:Math.max(t,this.context.currentTime)}start(t,e,s){var n=Hu(t)&&this._synced?this.context.transport.seconds:this.toSeconds(t),n=this._clampToCurrentTime(n);if(this._synced||"started"!==this._state.getValueAtTime(n))if(this.log("start",n),this._state.setStateAtTime("started",n),this._synced){const i=this._state.get(n);i&&(i.offset=this.toSeconds(Dp(e,0)),i.duration=s?this.toSeconds(s):void 0);t=this.context.transport.schedule(t=>{this._start(t,e,s)},n);this._scheduled.push(t),"started"===this.context.transport.state&&this.context.transport.getSecondsAtTime(this.immediate())>n&&this._syncedStart(this.now(),this.context.transport.seconds)}else hp(this.context),this._start(n,e,s);else op(Rp(n,this._state.get(n).time),"Start time must be strictly greater than previous start time"),this._state.cancel(n),this._state.setStateAtTime("started",n),this.log("restart",n),this.restart(n,e,s);return this}stop(t){t=Hu(t)&&this._synced?this.context.transport.seconds:this.toSeconds(t),t=this._clampToCurrentTime(t);if("started"===this._state.getValueAtTime(t)||Ju(this._state.getNextState("started",t))){if(this.log("stop",t),this._synced){const e=this.context.transport.schedule(this._stop.bind(this),t);this._scheduled.push(e)}else this._stop(t);this._state.cancel(t),this._state.setStateAtTime("stopped",t)}return this}restart(t,e,s){return t=this.toSeconds(t),"started"===this._state.getValueAtTime(t)&&(this._state.cancel(t),this._restart(t,e,s)),this}sync(){return this._synced||(this._synced=!0,this._syncedStart=(e,s)=>{if(Rp(s,0)){var n=this._state.get(s);if(n&&"started"===n.state&&n.time!==s){s=s-this.toSeconds(n.time);let t;n.duration&&(t=this.toSeconds(n.duration)-s),this._start(e,this.toSeconds(n.offset)+s,t)}}},this._syncedStop=t=>{var e=this.context.transport.getSecondsAtTime(Math.max(t-this.sampleTime,0));"started"===this._state.getValueAtTime(e)&&this._stop(t)},this.context.transport.on("start",this._syncedStart),this.context.transport.on("loopStart",this._syncedStart),this.context.transport.on("stop",this._syncedStop),this.context.transport.on("pause",this._syncedStop),this.context.transport.on("loopEnd",this._syncedStop)),this}unsync(){return this._synced&&(this.context.transport.off("stop",this._syncedStop),this.context.transport.off("pause",this._syncedStop),this.context.transport.off("loopEnd",this._syncedStop),this.context.transport.off("start",this._syncedStart),this.context.transport.off("loopStart",this._syncedStart)),this._synced=!1,this._scheduled.forEach(t=>this.context.transport.clear(t)),this._scheduled=[],this._state.cancel(0),this._stop(0),this}dispose(){return super.dispose(),this.onstop=Zp,this.unsync(),this._volume.dispose(),this._state.dispose(),this}}class Bd extends wd{constructor(){super(Cp(Bd.getDefaults(),arguments,["url","onload"])),this.name="ToneBufferSource",this._source=this.context.createBufferSource(),this._internalChannels=[this._source],this._sourceStarted=!1,this._sourceStopped=!1;var t=Cp(Bd.getDefaults(),arguments,["url","onload"]);vd(this._source,this._gainNode),this._source.onended=()=>this._stopSource(),this.playbackRate=new _d({context:this.context,param:this._source.playbackRate,units:"positive",value:t.playbackRate}),this.loop=t.loop,this.loopStart=t.loopStart,this.loopEnd=t.loopEnd,this._buffer=new Xp(t.url,t.onload,t.onerror),this._internalChannels.push(this._source)}static getDefaults(){return Object.assign(wd.getDefaults(),{url:new Xp,loop:!1,loopEnd:0,loopStart:0,onload:Zp,onerror:Zp,playbackRate:1})}get fadeIn(){return this._fadeIn}set fadeIn(t){this._fadeIn=t}get fadeOut(){return this._fadeOut}set fadeOut(t){this._fadeOut=t}get curve(){return this._curve}set curve(t){this._curve=t}start(t,e,s,n=1){op(this.buffer.loaded,"buffer is either not set or not loaded");t=this.toSeconds(t);this._startGain(t,n),e=this.loop?Dp(e,this.loopStart):Dp(e,0);let i=Math.max(this.toSeconds(e),0);if(this.loop){const r=this.toSeconds(this.loopEnd)||this.buffer.duration,e=this.toSeconds(this.loopStart),o=r-e;qp(i,r)&&(i=(i-e)%o+e),Ip(i,this.buffer.duration)&&(i=0)}return this._source.buffer=this.buffer.get(),this._source.loopEnd=this.toSeconds(this.loopEnd)||this.buffer.duration,Fp(i,this.buffer.duration)&&(this._sourceStarted=!0,this._source.start(t,i)),Ju(s)&&(s=this.toSeconds(s),s=Math.max(s,0),this.stop(t+s)),this}_stopSource(t){!this._sourceStopped&&this._sourceStarted&&(this._sourceStopped=!0,this._source.stop(this.toSeconds(t)),this._onended())}get loopStart(){return this._source.loopStart}set loopStart(t){this._source.loopStart=this.toSeconds(t)}get loopEnd(){return this._source.loopEnd}set loopEnd(t){this._source.loopEnd=this.toSeconds(t)}get buffer(){return this._buffer}set buffer(t){this._buffer.set(t)}get loop(){return this._source.loop}set loop(t){this._source.loop=t,this._sourceStarted&&this.cancelStop()}dispose(){return super.dispose(),this._source.onended=null,this._source.disconnect(),this._buffer.dispose(),this.playbackRate.dispose(),this}}class Ud extends Wd{constructor(){super(Cp(Ud.getDefaults(),arguments,["type"])),this.name="Noise",this._source=null;var t=Cp(Ud.getDefaults(),arguments,["type"]);this._playbackRate=t.playbackRate,this.type=t.type,this._fadeIn=t.fadeIn,this._fadeOut=t.fadeOut}static getDefaults(){return Object.assign(Wd.getDefaults(),{fadeIn:0,fadeOut:0,playbackRate:1,type:"white"})}get type(){return this._type}set type(t){if(op(t in Zd,"Noise: invalid type: "+t),this._type!==t&&(this._type=t,"started"===this.state)){const t=this.now();this._stop(t),this._start(t)}}get playbackRate(){return this._playbackRate}set playbackRate(t){this._playbackRate=t,this._source&&(this._source.playbackRate.value=t)}_start(t){var e=Zd[this._type];this._source=new Bd({url:e,context:this.context,fadeIn:this._fadeIn,fadeOut:this._fadeOut,loop:!0,onended:()=>this.onstop(this),playbackRate:this._playbackRate}).connect(this.output),this._source.start(this.toSeconds(t),Math.random()*(e.duration-.001))}_stop(t){this._source&&(this._source.stop(this.toSeconds(t)),this._source=null)}get fadeIn(){return this._fadeIn}set fadeIn(t){this._fadeIn=t,this._source&&(this._source.fadeIn=this._fadeIn)}get fadeOut(){return this._fadeOut}set fadeOut(t){this._fadeOut=t,this._source&&(this._source.fadeOut=this._fadeOut)}_restart(t){this._stop(t),this._start(t)}dispose(){return super.dispose(),this._source&&this._source.disconnect(),this}}const Gd=220500,Qd={brown:null,pink:null,white:null},Zd={get brown(){if(!Qd.brown){const n=[];for(let t=0;t<2;t++){const i=new Float32Array(Gd);n[t]=i;let e=0;for(let t=0;tt.label===n||t.deviceId===n),!this._device&&0{t.stop()}),this._stream=void 0,this._mediaStream.disconnect(),this._mediaStream=void 0),this._device=void 0,this}static enumerateDevices(){return yp(this,void 0,void 0,function*(){return(yield navigator.mediaDevices.enumerateDevices()).filter(t=>"audioinput"===t.kind)})}get state(){return this._stream&&this._stream.active?"started":"stopped"}get deviceId(){return this._device?this._device.deviceId:void 0}get groupId(){return this._device?this._device.groupId:void 0}get label(){return this._device?this._device.label:void 0}get mute(){return this._volume.mute}set mute(t){this._volume.mute=t}dispose(){return super.dispose(),this.close(),this._volume.dispose(),this.volume.dispose(),this}static get supported(){return Ju(navigator.mediaDevices)&&Ju(navigator.mediaDevices.getUserMedia)}}function Yd(s,n){return yp(this,void 0,void 0,function*(){const t=n/s.context.sampleRate,e=new Yp(1,t,s.context.sampleRate);return new s.constructor(Object.assign(s.get(),{frequency:2/t,detune:0,context:e})).toDestination().start(0),(yield e.render()).getChannelData(0)})}class $d extends wd{constructor(){super(Cp($d.getDefaults(),arguments,["frequency","type"])),this.name="ToneOscillatorNode",this._oscillator=this.context.createOscillator(),this._internalChannels=[this._oscillator];var t=Cp($d.getDefaults(),arguments,["frequency","type"]);vd(this._oscillator,this._gainNode),this.type=t.type,this.frequency=new _d({context:this.context,param:this._oscillator.frequency,units:"frequency",value:t.frequency}),this.detune=new _d({context:this.context,param:this._oscillator.detune,units:"cents",value:t.detune}),Gp(this,["frequency","detune"])}static getDefaults(){return Object.assign(wd.getDefaults(),{detune:0,frequency:440,type:"sine"})}start(t){t=this.toSeconds(t);return this.log("start",t),this._startGain(t),this._oscillator.start(t),this}_stopSource(t){this._oscillator.stop(t)}setPeriodicWave(t){return this._oscillator.setPeriodicWave(t),this}get type(){return this._oscillator.type}set type(t){this._oscillator.type=t}dispose(){return super.dispose(),"started"===this.state&&this.stop(),this._oscillator.disconnect(),this.frequency.dispose(),this.detune.dispose(),this}}class Hd extends Wd{constructor(){super(Cp(Hd.getDefaults(),arguments,["frequency","type"])),this.name="Oscillator",this._oscillator=null;const t=Cp(Hd.getDefaults(),arguments,["frequency","type"]);this.frequency=new Td({context:this.context,units:"frequency",value:t.frequency}),Gp(this,"frequency"),this.detune=new Td({context:this.context,units:"cents",value:t.detune}),Gp(this,"detune"),this._partials=t.partials,this._partialCount=t.partialCount,this._type=t.type,t.partialCount&&"custom"!==t.type&&(this._type=this.baseType+t.partialCount.toString()),this.phase=t.phase}static getDefaults(){return Object.assign(Wd.getDefaults(),{detune:0,frequency:440,partialCount:0,partials:[],phase:0,type:"sine"})}_start(t){var e=this.toSeconds(t),t=new $d({context:this.context,onended:()=>this.onstop(this)});this._oscillator=t,this._wave?this._oscillator.setPeriodicWave(this._wave):this._oscillator.type=this._type,this._oscillator.connect(this.output),this.frequency.connect(this._oscillator.frequency),this.detune.connect(this._oscillator.detune),this._oscillator.start(e)}_stop(t){t=this.toSeconds(t);this._oscillator&&this._oscillator.stop(t)}_restart(t){t=this.toSeconds(t);return this.log("restart",t),this._oscillator&&this._oscillator.cancelStop(),this._state.cancel(t),this}syncFrequency(){return this.context.transport.syncSignal(this.frequency),this}unsyncFrequency(){return this.context.transport.unsyncSignal(this.frequency),this}_getCachedPeriodicWave(){if("custom"===this._type)return Hd._periodicWaveCache.find(t=>{return t.phase===this._phase&&(t=t.partials,s=this._partials,t.length===s.length&&t.every((t,e)=>s[e]===t));var s});var t=Hd._periodicWaveCache.find(t=>t.type===this._type&&t.phase===this._phase);return this._partialCount=t?t.partialCount:this._partialCount,t}get type(){return this._type}set type(t){this._type=t;const e=-1!==["sine","square","sawtooth","triangle"].indexOf(t);if(0===this._phase&&e)this._wave=void 0,this._partialCount=0,null!==this._oscillator&&(this._oscillator.type=t);else{const e=this._getCachedPeriodicWave();if(Ju(e)){const{partials:t,wave:s}=e;this._wave=s,this._partials=t,null!==this._oscillator&&this._oscillator.setPeriodicWave(this._wave)}else{const[e,n]=this._getRealImaginary(t,this._phase),i=this.context.createPeriodicWave(e,n);this._wave=i,null!==this._oscillator&&this._oscillator.setPeriodicWave(this._wave),Hd._periodicWaveCache.push({imag:n,partialCount:this._partialCount,partials:this._partials,phase:this._phase,real:e,type:this._type,wave:this._wave}),100s[e]=t),this._partials=Array.from(s),this.type=this._type}}_getRealImaginary(s,n){let i=2048;const r=new Float32Array(i),o=new Float32Array(i);let a=1;if("custom"===s){if(a=this._partials.length+1,this._partialCount=this._partials.length,i=a,0===this._partials.length)return[r,o]}else{const n=/^(sine|triangle|square|sawtooth)(\d+)$/.exec(s);n?(a=parseInt(n[2],10)+1,this._partialCount=parseInt(n[2],10),s=n[1],a=Math.max(a,2),i=a):this._partialCount=0,this._partials=[]}for(let e=1;e>1&1?-1:1):0,this._partials[e-1]=t;break;case"custom":t=this._partials[e-1];break;default:throw new TypeError("Oscillator: invalid type: "+s)}0!==t?(r[e]=-t*Math.sin(n*e),o[e]=t*Math.cos(n*e)):(r[e]=0,o[e]=0)}return[r,o]}_inverseFFT(e,s,n){let i=0;var r=e.length;for(let t=0;tt.includes(e)),"oversampling must be either 'none', '2x', or '4x'"),this._shaper.oversample=e}dispose(){return super.dispose(),this._shaper.disconnect(),this}}class tf extends Jd{constructor(){super(...arguments),this.name="AudioToGain",this._norm=new Kd({context:this.context,mapping:t=>(t+1)/2}),this.input=this._norm,this.output=this._norm}dispose(){return super.dispose(),this._norm.dispose(),this}}class ef extends Td{constructor(){super(Object.assign(Cp(ef.getDefaults(),arguments,["value"]))),this.name="Multiply",this.override=!1;var t=Cp(ef.getDefaults(),arguments,["value"]);this._mult=this.input=this.output=new xd({context:this.context,minValue:t.minValue,maxValue:t.maxValue}),this.factor=this._param=this._mult.gain,this.factor.setValueAtTime(t.value,0)}static getDefaults(){return Object.assign(Td.getDefaults(),{value:0})}dispose(){return super.dispose(),this._mult.dispose(),this}}class sf extends Wd{constructor(){super(Cp(sf.getDefaults(),arguments,["frequency","type","modulationType"])),this.name="AMOscillator",this._modulationScale=new tf({context:this.context}),this._modulationNode=new xd({context:this.context});var t=Cp(sf.getDefaults(),arguments,["frequency","type","modulationType"]);this._carrier=new Hd({context:this.context,detune:t.detune,frequency:t.frequency,onstop:()=>this.onstop(this),phase:t.phase,type:t.type}),this.frequency=this._carrier.frequency,this.detune=this._carrier.detune,this._modulator=new Hd({context:this.context,phase:t.phase,type:t.modulationType}),this.harmonicity=new ef({context:this.context,units:"positive",value:t.harmonicity}),this.frequency.chain(this.harmonicity,this._modulator.frequency),this._modulator.chain(this._modulationScale,this._modulationNode.gain),this._carrier.chain(this._modulationNode,this.output),Gp(this,["frequency","detune","harmonicity"])}static getDefaults(){return Object.assign(Hd.getDefaults(),{harmonicity:1,modulationType:"square"})}_start(t){this._modulator.start(t),this._carrier.start(t)}_stop(t){this._modulator.stop(t),this._carrier.stop(t)}_restart(t){this._modulator.restart(t),this._carrier.restart(t)}get type(){return this._carrier.type}set type(t){this._carrier.type=t}get baseType(){return this._carrier.baseType}set baseType(t){this._carrier.baseType=t}get partialCount(){return this._carrier.partialCount}set partialCount(t){this._carrier.partialCount=t}get modulationType(){return this._modulator.type}set modulationType(t){this._modulator.type=t}get phase(){return this._carrier.phase}set phase(t){this._carrier.phase=t,this._modulator.phase=t}get partials(){return this._carrier.partials}set partials(t){this._carrier.partials=t}asArray(t=1024){return yp(this,void 0,void 0,function*(){return Yd(this,t)})}dispose(){return super.dispose(),this.frequency.dispose(),this.detune.dispose(),this.harmonicity.dispose(),this._carrier.dispose(),this._modulator.dispose(),this._modulationNode.dispose(),this._modulationScale.dispose(),this}}class nf extends Wd{constructor(){super(Cp(nf.getDefaults(),arguments,["frequency","type","modulationType"])),this.name="FMOscillator",this._modulationNode=new xd({context:this.context,gain:0});var t=Cp(nf.getDefaults(),arguments,["frequency","type","modulationType"]);this._carrier=new Hd({context:this.context,detune:t.detune,frequency:0,onstop:()=>this.onstop(this),phase:t.phase,type:t.type}),this.detune=this._carrier.detune,this.frequency=new Td({context:this.context,units:"frequency",value:t.frequency}),this._modulator=new Hd({context:this.context,phase:t.phase,type:t.modulationType}),this.harmonicity=new ef({context:this.context,units:"positive",value:t.harmonicity}),this.modulationIndex=new ef({context:this.context,units:"positive",value:t.modulationIndex}),this.frequency.connect(this._carrier.frequency),this.frequency.chain(this.harmonicity,this._modulator.frequency),this.frequency.chain(this.modulationIndex,this._modulationNode),this._modulator.connect(this._modulationNode.gain),this._modulationNode.connect(this._carrier.frequency),this._carrier.connect(this.output),this.detune.connect(this._modulator.detune),Gp(this,["modulationIndex","frequency","detune","harmonicity"])}static getDefaults(){return Object.assign(Hd.getDefaults(),{harmonicity:1,modulationIndex:2,modulationType:"square"})}_start(t){this._modulator.start(t),this._carrier.start(t)}_stop(t){this._modulator.stop(t),this._carrier.stop(t)}_restart(t){return this._modulator.restart(t),this._carrier.restart(t),this}get type(){return this._carrier.type}set type(t){this._carrier.type=t}get baseType(){return this._carrier.baseType}set baseType(t){this._carrier.baseType=t}get partialCount(){return this._carrier.partialCount}set partialCount(t){this._carrier.partialCount=t}get modulationType(){return this._modulator.type}set modulationType(t){this._modulator.type=t}get phase(){return this._carrier.phase}set phase(t){this._carrier.phase=t,this._modulator.phase=t}get partials(){return this._carrier.partials}set partials(t){this._carrier.partials=t}asArray(t=1024){return yp(this,void 0,void 0,function*(){return Yd(this,t)})}dispose(){return super.dispose(),this.frequency.dispose(),this.harmonicity.dispose(),this._carrier.dispose(),this._modulator.dispose(),this._modulationNode.dispose(),this.modulationIndex.dispose(),this}}class rf extends Wd{constructor(){super(Cp(rf.getDefaults(),arguments,["frequency","width"])),this.name="PulseOscillator",this._widthGate=new xd({context:this.context,gain:0}),this._thresh=new Kd({context:this.context,mapping:t=>t<=0?-1:1});var t=Cp(rf.getDefaults(),arguments,["frequency","width"]);this.width=new Td({context:this.context,units:"audioRange",value:t.width}),this._triangle=new Hd({context:this.context,detune:t.detune,frequency:t.frequency,onstop:()=>this.onstop(this),phase:t.phase,type:"triangle"}),this.frequency=this._triangle.frequency,this.detune=this._triangle.detune,this._triangle.chain(this._thresh,this.output),this.width.chain(this._widthGate,this._thresh),Gp(this,["width","frequency","detune"])}static getDefaults(){return Object.assign(Wd.getDefaults(),{detune:0,frequency:440,phase:0,type:"pulse",width:.2})}_start(t){t=this.toSeconds(t),this._triangle.start(t),this._widthGate.gain.setValueAtTime(1,t)}_stop(t){t=this.toSeconds(t),this._triangle.stop(t),this._widthGate.gain.cancelScheduledValues(t),this._widthGate.gain.setValueAtTime(0,t)}_restart(t){this._triangle.restart(t),this._widthGate.gain.cancelScheduledValues(t),this._widthGate.gain.setValueAtTime(1,t)}get phase(){return this._triangle.phase}set phase(t){this._triangle.phase=t}get type(){return"pulse"}get baseType(){return"pulse"}get partials(){return[]}get partialCount(){return 0}set carrierType(t){this._triangle.type=t}asArray(t=1024){return yp(this,void 0,void 0,function*(){return Yd(this,t)})}dispose(){return super.dispose(),this._triangle.dispose(),this.width.dispose(),this._widthGate.dispose(),this._thresh.dispose(),this}}class of extends Wd{constructor(){super(Cp(of.getDefaults(),arguments,["frequency","type","spread"])),this.name="FatOscillator",this._oscillators=[];var t=Cp(of.getDefaults(),arguments,["frequency","type","spread"]);this.frequency=new Td({context:this.context,units:"frequency",value:t.frequency}),this.detune=new Td({context:this.context,units:"cents",value:t.detune}),this._spread=t.spread,this._type=t.type,this._phase=t.phase,this._partials=t.partials,this._partialCount=t.partialCount,this.count=t.count,Gp(this,["frequency","detune"])}static getDefaults(){return Object.assign(Hd.getDefaults(),{count:3,spread:20,type:"sawtooth"})}_start(e){e=this.toSeconds(e),this._forEach(t=>t.start(e))}_stop(e){e=this.toSeconds(e),this._forEach(t=>t.stop(e))}_restart(e){this._forEach(t=>t.restart(e))}_forEach(e){for(let t=0;tt.type=e)}get spread(){return this._spread}set spread(t){if(this._spread=t,1t.detune.value=s+n*e)}}get count(){return this._oscillators.length}set count(e){if(ap(e,1),this._oscillators.length!==e){this._forEach(t=>t.dispose()),this._oscillators=[];for(let t=0;tthis.onstop(this):Zp});"custom"===this.type&&(s.partials=this._partials),this.frequency.connect(s.frequency),this.detune.connect(s.detune),s.detune.overridden=!1,s.connect(this.output),this._oscillators[t]=s}this.spread=this._spread,"started"===this.state&&this._forEach(t=>t.start())}}get phase(){return this._phase}set phase(t){this._phase=t,this._forEach((t,e)=>t.phase=this._phase+e/this.count*360)}get baseType(){return this._oscillators[0].baseType}set baseType(e){this._forEach(t=>t.baseType=e),this._type=this._oscillators[0].type}get partials(){return this._oscillators[0].partials}set partials(e){this._partials=e,this._partialCount=this._partials.length,e.length&&(this._type="custom",this._forEach(t=>t.partials=e))}get partialCount(){return this._oscillators[0].partialCount}set partialCount(e){this._partialCount=e,this._forEach(t=>t.partialCount=e),this._type=this._oscillators[0].type}asArray(t=1024){return yp(this,void 0,void 0,function*(){return Yd(this,t)})}dispose(){return super.dispose(),this.frequency.dispose(),this.detune.dispose(),this._forEach(t=>t.dispose()),this}}class af extends Wd{constructor(){super(Cp(af.getDefaults(),arguments,["frequency","modulationFrequency"])),this.name="PWMOscillator",this.sourceType="pwm",this._scale=new ef({context:this.context,value:2});var t=Cp(af.getDefaults(),arguments,["frequency","modulationFrequency"]);this._pulse=new rf({context:this.context,frequency:t.modulationFrequency}),this._pulse.carrierType="sine",this.modulationFrequency=this._pulse.frequency,this._modulator=new Hd({context:this.context,detune:t.detune,frequency:t.frequency,onstop:()=>this.onstop(this),phase:t.phase}),this.frequency=this._modulator.frequency,this.detune=this._modulator.detune,this._modulator.chain(this._scale,this._pulse.width),this._pulse.connect(this.output),Gp(this,["modulationFrequency","frequency","detune"])}static getDefaults(){return Object.assign(Wd.getDefaults(),{detune:0,frequency:440,modulationFrequency:.4,phase:0,type:"pwm"})}_start(t){t=this.toSeconds(t),this._modulator.start(t),this._pulse.start(t)}_stop(t){t=this.toSeconds(t),this._modulator.stop(t),this._pulse.stop(t)}_restart(t){this._modulator.restart(t),this._pulse.restart(t)}get type(){return"pwm"}get baseType(){return"pwm"}get partials(){return[]}get partialCount(){return 0}get phase(){return this._modulator.phase}set phase(t){this._modulator.phase=t}asArray(t=1024){return yp(this,void 0,void 0,function*(){return Yd(this,t)})}dispose(){return super.dispose(),this._pulse.dispose(),this._scale.dispose(),this._modulator.dispose(),this}}const hf={am:sf,fat:of,fm:nf,oscillator:Hd,pulse:rf,pwm:af};class cf extends Wd{constructor(){super(Cp(cf.getDefaults(),arguments,["frequency","type"])),this.name="OmniOscillator";var t=Cp(cf.getDefaults(),arguments,["frequency","type"]);this.frequency=new Td({context:this.context,units:"frequency",value:t.frequency}),this.detune=new Td({context:this.context,units:"cents",value:t.detune}),Gp(this,["frequency","detune"]),this.set(t)}static getDefaults(){return Object.assign(Hd.getDefaults(),nf.getDefaults(),sf.getDefaults(),of.getDefaults(),rf.getDefaults(),af.getDefaults())}_start(t){this._oscillator.start(t)}_stop(t){this._oscillator.stop(t)}_restart(t){return this._oscillator.restart(t),this}get type(){let t="";return["am","fm","fat"].some(t=>this._sourceType===t)&&(t=this._sourceType),t+this._oscillator.type}set type(t){"fm"===t.substr(0,2)?(this._createNewOscillator("fm"),this._oscillator=this._oscillator,this._oscillator.type=t.substr(2)):"am"===t.substr(0,2)?(this._createNewOscillator("am"),this._oscillator=this._oscillator,this._oscillator.type=t.substr(2)):"fat"===t.substr(0,3)?(this._createNewOscillator("fat"),this._oscillator=this._oscillator,this._oscillator.type=t.substr(3)):"pwm"===t?(this._createNewOscillator("pwm"),this._oscillator=this._oscillator):"pulse"===t?this._createNewOscillator("pulse"):(this._createNewOscillator("oscillator"),this._oscillator=this._oscillator,this._oscillator.type=t)}get partials(){return this._oscillator.partials}set partials(t){this._getOscType(this._oscillator,"pulse")||this._getOscType(this._oscillator,"pwm")||(this._oscillator.partials=t)}get partialCount(){return this._oscillator.partialCount}set partialCount(t){this._getOscType(this._oscillator,"pulse")||this._getOscType(this._oscillator,"pwm")||(this._oscillator.partialCount=t)}set(t){return Reflect.has(t,"type")&&t.type&&(this.type=t.type),super.set(t),this}_createNewOscillator(t){if(t!==this._sourceType){this._sourceType=t;const e=hf[t],s=this.now();if(this._oscillator){const t=this._oscillator;t.stop(s),this.context.setTimeout(()=>t.dispose(),this.blockTime)}this._oscillator=new e({context:this.context}),this.frequency.connect(this._oscillator.frequency),this.detune.connect(this._oscillator.detune),this._oscillator.connect(this.output),this._oscillator.onstop=()=>this.onstop(this),"started"===this.state&&this._oscillator.start(s)}}get phase(){return this._oscillator.phase}set phase(t){this._oscillator.phase=t}get sourceType(){return this._sourceType}set sourceType(t){let e="sine";"pwm"!==this._oscillator.type&&"pulse"!==this._oscillator.type&&(e=this._oscillator.type),"fm"===t?this.type="fm"+e:"am"===t?this.type="am"+e:"fat"===t?this.type="fat"+e:"oscillator"===t?this.type=e:"pulse"===t?this.type="pulse":"pwm"===t&&(this.type="pwm")}_getOscType(t,e){return t instanceof hf[e]}get baseType(){return this._oscillator.baseType}set baseType(t){this._getOscType(this._oscillator,"pulse")||this._getOscType(this._oscillator,"pwm")||"pulse"===t||"pwm"===t||(this._oscillator.baseType=t)}get width(){return this._getOscType(this._oscillator,"pulse")?this._oscillator.width:void 0}get count(){return this._getOscType(this._oscillator,"fat")?this._oscillator.count:void 0}set count(t){this._getOscType(this._oscillator,"fat")&&tp(t)&&(this._oscillator.count=t)}get spread(){return this._getOscType(this._oscillator,"fat")?this._oscillator.spread:void 0}set spread(t){this._getOscType(this._oscillator,"fat")&&tp(t)&&(this._oscillator.spread=t)}get modulationType(){return this._getOscType(this._oscillator,"fm")||this._getOscType(this._oscillator,"am")?this._oscillator.modulationType:void 0}set modulationType(t){(this._getOscType(this._oscillator,"fm")||this._getOscType(this._oscillator,"am"))&&ip(t)&&(this._oscillator.modulationType=t)}get modulationIndex(){return this._getOscType(this._oscillator,"fm")?this._oscillator.modulationIndex:void 0}get harmonicity(){return this._getOscType(this._oscillator,"fm")||this._getOscType(this._oscillator,"am")?this._oscillator.harmonicity:void 0}get modulationFrequency(){return this._getOscType(this._oscillator,"pwm")?this._oscillator.modulationFrequency:void 0}asArray(t=1024){return yp(this,void 0,void 0,function*(){return Yd(this,t)})}dispose(){return super.dispose(),this.detune.dispose(),this.frequency.dispose(),this._oscillator.dispose(),this}}class lf extends Td{constructor(){super(Object.assign(Cp(lf.getDefaults(),arguments,["value"]))),this.override=!1,this.name="Add",this._sum=new xd({context:this.context}),this.input=this._sum,this.output=this._sum,this.addend=this._param,gd(this._constantSource,this._sum)}static getDefaults(){return Object.assign(Td.getDefaults(),{value:0})}dispose(){return super.dispose(),this._sum.dispose(),this}}class uf extends Jd{constructor(){super(Object.assign(Cp(uf.getDefaults(),arguments,["min","max"]))),this.name="Scale";var t=Cp(uf.getDefaults(),arguments,["min","max"]);this._mult=this.input=new ef({context:this.context,value:t.max-t.min}),this._add=this.output=new lf({context:this.context,value:t.min}),this._min=t.min,this._max=t.max,this.input.connect(this.output)}static getDefaults(){return Object.assign(Jd.getDefaults(),{max:1,min:0})}get min(){return this._min}set min(t){this._min=t,this._setRange()}get max(){return this._max}set max(t){this._max=t,this._setRange()}_setRange(){this._add.value=this._min,this._mult.value=this._max-this._min}dispose(){return super.dispose(),this._add.dispose(),this._mult.dispose(),this}}class pf extends Jd{constructor(){super(Object.assign(Cp(pf.getDefaults(),arguments))),this.name="Zero",this._gain=new xd({context:this.context}),this.output=this._gain,this.input=void 0,vd(this.context.getConstant(0),this._gain)}dispose(){return super.dispose(),yd(this.context.getConstant(0),this._gain),this}}class df extends md{constructor(){super(Cp(df.getDefaults(),arguments,["frequency","min","max"])),this.name="LFO",this._stoppedValue=0,this._units="number",this.convert=!0,this._fromType=_d.prototype._fromType,this._toType=_d.prototype._toType,this._is=_d.prototype._is,this._clampValue=_d.prototype._clampValue;var t=Cp(df.getDefaults(),arguments,["frequency","min","max"]);this._oscillator=new Hd(t),this.frequency=this._oscillator.frequency,this._amplitudeGain=new xd({context:this.context,gain:t.amplitude,units:"normalRange"}),this.amplitude=this._amplitudeGain.gain,this._stoppedSignal=new Td({context:this.context,units:"audioRange",value:0}),this._zeros=new pf({context:this.context}),this._a2g=new tf({context:this.context}),this._scaler=this.output=new uf({context:this.context,max:t.max,min:t.min}),this.units=t.units,this.min=t.min,this.max=t.max,this._oscillator.chain(this._amplitudeGain,this._a2g,this._scaler),this._zeros.connect(this._a2g),this._stoppedSignal.connect(this._a2g),Gp(this,["amplitude","frequency"]),this.phase=t.phase}static getDefaults(){return Object.assign(Hd.getDefaults(),{amplitude:1,frequency:"4n",max:1,min:0,type:"sine",units:"number"})}start(t){return t=this.toSeconds(t),this._stoppedSignal.setValueAtTime(0,t),this._oscillator.start(t),this}stop(t){return t=this.toSeconds(t),this._stoppedSignal.setValueAtTime(this._stoppedValue,t),this._oscillator.stop(t),this}sync(){return this._oscillator.sync(),this._oscillator.syncFrequency(),this}unsync(){return this._oscillator.unsync(),this._oscillator.unsyncFrequency(),this}_setStoppedValue(){this._stoppedValue=this._oscillator.getInitialValue(),this._stoppedSignal.value=this._stoppedValue}get min(){return this._toType(this._scaler.min)}set min(t){t=this._fromType(t),this._scaler.min=t}get max(){return this._toType(this._scaler.max)}set max(t){t=this._fromType(t),this._scaler.max=t}get type(){return this._oscillator.type}set type(t){this._oscillator.type=t,this._setStoppedValue()}get partials(){return this._oscillator.partials}set partials(t){this._oscillator.partials=t,this._setStoppedValue()}get phase(){return this._oscillator.phase}set phase(t){this._oscillator.phase=t,this._setStoppedValue()}get units(){return this._units}set units(t){var e=this.min,s=this.max;this._units=t,this.min=e,this.max=s}get state(){return this._oscillator.state}connect(t,e,s){return(t instanceof _d||t instanceof Td)&&(this.convert=t.convert,this.units=t.units),Sd(this,t,e,s),this}dispose(){return super.dispose(),this._oscillator.dispose(),this._stoppedSignal.dispose(),this._zeros.dispose(),this._scaler.dispose(),this._a2g.dispose(),this._amplitudeGain.dispose(),this.amplitude.dispose(),this}}function ff(s,n=1/0){const i=new WeakMap;return function(t,e){Reflect.defineProperty(t,e,{configurable:!0,enumerable:!0,get:function(){return i.get(this)},set:function(t){ap(t,s,n),i.set(this,t)}})}}function _f(s,n=1/0){const i=new WeakMap;return function(t,e){Reflect.defineProperty(t,e,{configurable:!0,enumerable:!0,get:function(){return i.get(this)},set:function(t){ap(this.toSeconds(t),s,n),i.set(this,t)}})}}class mf extends Wd{constructor(){super(Cp(mf.getDefaults(),arguments,["url","onload"])),this.name="Player",this._activeSources=new Set;var t=Cp(mf.getDefaults(),arguments,["url","onload"]);this._buffer=new Xp({onload:this._onload.bind(this,t.onload),onerror:t.onerror,reverse:t.reverse,url:t.url}),this.autostart=t.autostart,this._loop=t.loop,this._loopStart=t.loopStart,this._loopEnd=t.loopEnd,this._playbackRate=t.playbackRate,this.fadeIn=t.fadeIn,this.fadeOut=t.fadeOut}static getDefaults(){return Object.assign(Wd.getDefaults(),{autostart:!1,fadeIn:0,fadeOut:0,loop:!1,loopEnd:0,loopStart:0,onload:Zp,onerror:Zp,playbackRate:1,reverse:!1})}load(t){return yp(this,void 0,void 0,function*(){return yield this._buffer.load(t),this._onload(),this})}_onload(t=Zp){t(),this.autostart&&this.start()}_onSourceEnd(t){this.onstop(this),this._activeSources.delete(t),0!==this._activeSources.size||this._synced||"started"!==this._state.getValueAtTime(this.now())||(this._state.cancel(this.now()),this._state.setStateAtTime("stopped",this.now()))}start(t,e,s){return super.start(t,e,s),this}_start(t,e,s){e=this._loop?Dp(e,this._loopStart):Dp(e,0);var n=this.toSeconds(e),e=s;s=Dp(s,Math.max(this._buffer.duration-n,0));s=this.toSeconds(s);s/=this._playbackRate,t=this.toSeconds(t);const i=new Bd({url:this._buffer,context:this.context,fadeIn:this.fadeIn,fadeOut:this.fadeOut,loop:this._loop,loopEnd:this._loopEnd,loopStart:this._loopStart,onended:this._onSourceEnd.bind(this),playbackRate:this._playbackRate}).connect(this.output);this._loop||this._synced||(this._state.cancel(t+s),this._state.setStateAtTime("stopped",t+s,{implicitEnd:!0})),this._activeSources.add(i),this._loop&&Hu(e)?i.start(t,n):i.start(t,n,s-this.toSeconds(this.fadeOut))}_stop(t){const e=this.toSeconds(t);this._activeSources.forEach(t=>t.stop(e))}restart(t,e,s){return super.restart(t,e,s),this}_restart(t,e,s){this._stop(t),this._start(t,e,s)}seek(t,e){e=this.toSeconds(e);if("started"===this._state.getValueAtTime(e)){const s=this.toSeconds(t);this._stop(e),this._start(e,s)}return this}setLoopPoints(t,e){return this.loopStart=t,this.loopEnd=e,this}get loopStart(){return this._loopStart}set loopStart(e){this._loopStart=e,this.buffer.loaded&&ap(this.toSeconds(e),0,this.buffer.duration),this._activeSources.forEach(t=>{t.loopStart=e})}get loopEnd(){return this._loopEnd}set loopEnd(e){this._loopEnd=e,this.buffer.loaded&&ap(this.toSeconds(e),0,this.buffer.duration),this._activeSources.forEach(t=>{t.loopEnd=e})}get buffer(){return this._buffer}set buffer(t){this._buffer.set(t)}get loop(){return this._loop}set loop(e){if(this._loop!==e&&(this._loop=e,this._activeSources.forEach(t=>{t.loop=e}),e)){const e=this._state.getNextState("stopped",this.now());e&&this._state.cancel(e.time)}}get playbackRate(){return this._playbackRate}set playbackRate(e){this._playbackRate=e;const s=this.now(),t=this._state.getNextState("stopped",s);t&&t.implicitEnd&&(this._state.cancel(t.time),this._activeSources.forEach(t=>t.cancelStop())),this._activeSources.forEach(t=>{t.playbackRate.setValueAtTime(e,s)})}get reverse(){return this._buffer.reverse}set reverse(t){this._buffer.reverse=t}get loaded(){return this._buffer.loaded}dispose(){return super.dispose(),this._activeSources.forEach(t=>t.dispose()),this._activeSources.clear(),this._buffer.dispose(),this}}vp([_f(0)],mf.prototype,"fadeIn",void 0),vp([_f(0)],mf.prototype,"fadeOut",void 0);class gf extends md{constructor(){super(Cp(gf.getDefaults(),arguments,["urls","onload"],"urls")),this.name="Players",this.input=void 0,this._players=new Map;var t=Cp(gf.getDefaults(),arguments,["urls","onload"],"urls");this._volume=this.output=new Vd({context:this.context,volume:t.volume}),this.volume=this._volume.volume,Gp(this,"volume"),this._buffers=new Md({urls:t.urls,onload:t.onload,baseUrl:t.baseUrl,onerror:t.onerror}),this.mute=t.mute,this._fadeIn=t.fadeIn,this._fadeOut=t.fadeOut}static getDefaults(){return Object.assign(Wd.getDefaults(),{baseUrl:"",fadeIn:0,fadeOut:0,mute:!1,onload:Zp,onerror:Zp,urls:{},volume:0})}get mute(){return this._volume.mute}set mute(t){this._volume.mute=t}get fadeIn(){return this._fadeIn}set fadeIn(e){this._fadeIn=e,this._players.forEach(t=>{t.fadeIn=e})}get fadeOut(){return this._fadeOut}set fadeOut(e){this._fadeOut=e,this._players.forEach(t=>{t.fadeOut=e})}get state(){return Array.from(this._players).some(([,t])=>"started"===t.state)?"started":"stopped"}has(t){return this._buffers.has(t)}player(t){var e;return op(this.has(t),`No Player with the name ${t} exists on this object`),this._players.has(t)||(e=new mf({context:this.context,fadeIn:this._fadeIn,fadeOut:this._fadeOut,url:this._buffers.get(t)}).connect(this.output),this._players.set(t,e)),this._players.get(t)}get loaded(){return this._buffers.loaded}add(t,e,s){return op(!this._buffers.has(t),"A buffer with that name already exists on this object"),this._buffers.add(t,e,s),this}stopAll(e){return this._players.forEach(t=>t.stop(e)),this}dispose(){return super.dispose(),this._volume.dispose(),this.volume.dispose(),this._players.forEach(t=>t.dispose()),this._buffers.dispose(),this}}class vf extends Wd{constructor(){super(Cp(vf.getDefaults(),arguments,["url","onload"])),this.name="GrainPlayer",this._loopStart=0,this._loopEnd=0,this._activeSources=[];var t=Cp(vf.getDefaults(),arguments,["url","onload"]);this.buffer=new Xp({onload:t.onload,onerror:t.onerror,reverse:t.reverse,url:t.url}),this._clock=new Dd({context:this.context,callback:this._tick.bind(this),frequency:1/t.grainSize}),this._playbackRate=t.playbackRate,this._grainSize=t.grainSize,this._overlap=t.overlap,this.detune=t.detune,this.overlap=t.overlap,this.loop=t.loop,this.playbackRate=t.playbackRate,this.grainSize=t.grainSize,this.loopStart=t.loopStart,this.loopEnd=t.loopEnd,this.reverse=t.reverse,this._clock.on("stop",this._onstop.bind(this))}static getDefaults(){return Object.assign(Wd.getDefaults(),{onload:Zp,onerror:Zp,overlap:.1,grainSize:.2,playbackRate:1,detune:0,loop:!1,loopStart:0,loopEnd:0,reverse:!1})}_start(t,e,s){e=Dp(e,0),e=this.toSeconds(e),t=this.toSeconds(t);var n=1/this._clock.frequency.getValueAtTime(t);this._clock.start(t,e/n),s&&this.stop(t+this.toSeconds(s))}restart(t,e,s){return super.restart(t,e,s),this}_restart(t,e,s){this._stop(t),this._start(t,e,s)}_stop(t){this._clock.stop(t)}_onstop(e){this._activeSources.forEach(t=>{t.fadeOut=0,t.stop(e)}),this.onstop(this)}_tick(t){var e=this._clock.getTicksAtTime(t),s=e*this._grainSize;if(this.log("offset",s),!this.loop&&s>this.buffer.duration)this.stop(t);else{const n=s{var t=this._activeSources.indexOf(i);-1!==t&&this._activeSources.splice(t,1)}}}get playbackRate(){return this._playbackRate}set playbackRate(t){ap(t,.001),this._playbackRate=t,this.grainSize=this._grainSize}get loopStart(){return this._loopStart}set loopStart(t){this.buffer.loaded&&ap(this.toSeconds(t),0,this.buffer.duration),this._loopStart=this.toSeconds(t)}get loopEnd(){return this._loopEnd}set loopEnd(t){this.buffer.loaded&&ap(this.toSeconds(t),0,this.buffer.duration),this._loopEnd=this.toSeconds(t)}get reverse(){return this.buffer.reverse}set reverse(t){this.buffer.reverse=t}get grainSize(){return this._grainSize}set grainSize(t){this._grainSize=this.toSeconds(t),this._clock.frequency.setValueAtTime(this._playbackRate/this._grainSize,this.now())}get overlap(){return this._overlap}set overlap(t){t=this.toSeconds(t);ap(t,0),this._overlap=t}get loaded(){return this.buffer.loaded}dispose(){return super.dispose(),this.buffer.dispose(),this._clock.dispose(),this._activeSources.forEach(t=>t.dispose()),this}}class yf extends Jd{constructor(){super(...arguments),this.name="Abs",this._abs=new Kd({context:this.context,mapping:t=>Math.abs(t)<.001?0:Math.abs(t)}),this.input=this._abs,this.output=this._abs}dispose(){return super.dispose(),this._abs.dispose(),this}}class xf extends Jd{constructor(){super(...arguments),this.name="GainToAudio",this._norm=new Kd({context:this.context,mapping:t=>2*Math.abs(t)-1}),this.input=this._norm,this.output=this._norm}dispose(){return super.dispose(),this._norm.dispose(),this}}class wf extends Jd{constructor(){super(...arguments),this.name="Negate",this._multiply=new ef({context:this.context,value:-1}),this.input=this._multiply,this.output=this._multiply}dispose(){return super.dispose(),this._multiply.dispose(),this}}class bf extends Td{constructor(){super(Object.assign(Cp(bf.getDefaults(),arguments,["value"]))),this.override=!1,this.name="Subtract",this._sum=new xd({context:this.context}),this.input=this._sum,this.output=this._sum,this._neg=new wf({context:this.context}),this.subtrahend=this._param,gd(this._constantSource,this._neg,this._sum)}static getDefaults(){return Object.assign(Td.getDefaults(),{value:0})}dispose(){return super.dispose(),this._neg.dispose(),this._sum.dispose(),this}}class Tf extends Jd{constructor(){super(Object.assign(Cp(Tf.getDefaults(),arguments))),this.name="GreaterThanZero",this._thresh=this.output=new Kd({context:this.context,length:127,mapping:t=>t<=0?0:1}),this._scale=this.input=new ef({context:this.context,value:1e4}),this._scale.connect(this._thresh)}dispose(){return super.dispose(),this._scale.dispose(),this._thresh.dispose(),this}}class Sf extends Td{constructor(){super(Object.assign(Cp(Sf.getDefaults(),arguments,["value"]))),this.name="GreaterThan",this.override=!1;var t=Cp(Sf.getDefaults(),arguments,["value"]);this._subtract=this.input=new bf({context:this.context,value:t.value}),this._gtz=this.output=new Tf({context:this.context}),this.comparator=this._param=this._subtract.subtrahend,Gp(this,"comparator"),this._subtract.connect(this._gtz)}static getDefaults(){return Object.assign(Td.getDefaults(),{value:0})}dispose(){return super.dispose(),this._gtz.dispose(),this._subtract.dispose(),this.comparator.dispose(),this}}class kf extends Jd{constructor(){super(Object.assign(Cp(kf.getDefaults(),arguments,["value"]))),this.name="Pow";var t=Cp(kf.getDefaults(),arguments,["value"]);this._exponentScaler=this.input=this.output=new Kd({context:this.context,mapping:this._expFunc(t.value),length:8192}),this._exponent=t.value}static getDefaults(){return Object.assign(Jd.getDefaults(),{value:1})}_expFunc(e){return t=>Math.pow(Math.abs(t),e)}get value(){return this._exponent}set value(t){this._exponent=t,this._exponentScaler.setMap(this._expFunc(this._exponent))}dispose(){return super.dispose(),this._exponentScaler.dispose(),this}}class Af extends uf{constructor(){super(Object.assign(Cp(Af.getDefaults(),arguments,["min","max","exponent"]))),this.name="ScaleExp";var t=Cp(Af.getDefaults(),arguments,["min","max","exponent"]);this.input=this._exp=new kf({context:this.context,value:t.exponent}),this._exp.connect(this._mult)}static getDefaults(){return Object.assign(uf.getDefaults(),{exponent:1})}get exponent(){return this._exp.value}set exponent(t){this._exp.value=t}dispose(){return super.dispose(),this._exp.dispose(),this}}class Cf extends Td{constructor(){super(Cp(Td.getDefaults(),arguments,["value","units"])),this.name="SyncedSignal",this.override=!1;var t=Cp(Td.getDefaults(),arguments,["value","units"]);this._lastVal=t.value,this._synced=this.context.transport.scheduleRepeat(this._onTick.bind(this),"1i"),this._syncedCallback=this._anchorValue.bind(this),this.context.transport.on("start",this._syncedCallback),this.context.transport.on("pause",this._syncedCallback),this.context.transport.on("stop",this._syncedCallback),this._constantSource.disconnect(),this._constantSource.stop(0),this._constantSource=this.output=new bd({context:this.context,offset:t.value,units:t.units}).start(0),this.setValueAtTime(t.value,0)}_onTick(t){var e=super.getValueAtTime(this.context.transport.seconds);this._lastVal!==e&&(this._lastVal=e,this._constantSource.offset.setValueAtTime(e,t))}_anchorValue(t){var e=super.getValueAtTime(this.context.transport.seconds);this._lastVal=e,this._constantSource.offset.cancelAndHoldAtTime(t),this._constantSource.offset.setValueAtTime(e,t)}getValueAtTime(t){t=new pd(this.context,t).toSeconds();return super.getValueAtTime(t)}setValueAtTime(t,e){e=new pd(this.context,e).toSeconds();return super.setValueAtTime(t,e),this}linearRampToValueAtTime(t,e){e=new pd(this.context,e).toSeconds();return super.linearRampToValueAtTime(t,e),this}exponentialRampToValueAtTime(t,e){e=new pd(this.context,e).toSeconds();return super.exponentialRampToValueAtTime(t,e),this}setTargetAtTime(t,e,s){e=new pd(this.context,e).toSeconds();return super.setTargetAtTime(t,e,s),this}cancelScheduledValues(t){t=new pd(this.context,t).toSeconds();return super.cancelScheduledValues(t),this}setValueCurveAtTime(t,e,s,n){e=new pd(this.context,e).toSeconds();return s=this.toSeconds(s),super.setValueCurveAtTime(t,e,s,n),this}cancelAndHoldAtTime(t){t=new pd(this.context,t).toSeconds();return super.cancelAndHoldAtTime(t),this}setRampPoint(t){t=new pd(this.context,t).toSeconds();return super.setRampPoint(t),this}exponentialRampTo(t,e,s){s=new pd(this.context,s).toSeconds();return super.exponentialRampTo(t,e,s),this}linearRampTo(t,e,s){s=new pd(this.context,s).toSeconds();return super.linearRampTo(t,e,s),this}targetRampTo(t,e,s){s=new pd(this.context,s).toSeconds();return super.targetRampTo(t,e,s),this}dispose(){return super.dispose(),this.context.transport.clear(this._synced),this.context.transport.off("start",this._syncedCallback),this.context.transport.off("pause",this._syncedCallback),this.context.transport.off("stop",this._syncedCallback),this._constantSource.dispose(),this}}class Df extends md{constructor(){super(Cp(Df.getDefaults(),arguments,["attack","decay","sustain","release"])),this.name="Envelope",this._sig=new Td({context:this.context,value:0}),this.output=this._sig,this.input=void 0;var t=Cp(Df.getDefaults(),arguments,["attack","decay","sustain","release"]);this.attack=t.attack,this.decay=t.decay,this.sustain=t.sustain,this.release=t.release,this.attackCurve=t.attackCurve,this.releaseCurve=t.releaseCurve,this.decayCurve=t.decayCurve}static getDefaults(){return Object.assign(md.getDefaults(),{attack:.01,attackCurve:"linear",decay:.1,decayCurve:"exponential",release:1,releaseCurve:"exponential",sustain:.5})}get value(){return this.getValueAtTime(this.now())}_getCurve(e,s){if(ip(e))return e;{let t;for(t in Of)if(Of[t][s]===e)return t;return e}}_setCurve(t,e,s){if(ip(s)&&Reflect.has(Of,s)){var n=Of[s];ep(n)?"_decayCurve"!==t&&(this[t]=n[e]):this[t]=n}else{if(!np(s)||"_decayCurve"===t)throw new Error("Envelope: invalid curve: "+s);this[t]=s}}get attackCurve(){return this._getCurve(this._attackCurve,"In")}set attackCurve(t){this._setCurve("_attackCurve","In",t)}get releaseCurve(){return this._getCurve(this._releaseCurve,"Out")}set releaseCurve(t){this._setCurve("_releaseCurve","Out",t)}get decayCurve(){return this._decayCurve}set decayCurve(e){op(["linear","exponential"].some(t=>t===e),`Invalid envelope curve: ${e}`),this._decayCurve=e}triggerAttack(t,s=1){this.log("triggerAttack",t,s),t=this.toSeconds(t);let n=this.toSeconds(this.attack);const e=this.toSeconds(this.decay),i=this.getValueAtTime(t);if(0{const t=128;let e,s;const n=[];for(e=0;ethis._original_triggerRelease(t);var t=Cp(Mf.getDefaults(),arguments);this._volume=this.output=new Vd({context:this.context,volume:t.volume}),this.volume=this._volume.volume,Gp(this,"volume")}static getDefaults(){return Object.assign(md.getDefaults(),{volume:0})}sync(){return this._syncState()&&(this._syncMethod("triggerAttack",1),this._syncMethod("triggerRelease",0),this.context.transport.on("stop",this._syncedRelease),this.context.transport.on("pause",this._syncedRelease),this.context.transport.on("loopEnd",this._syncedRelease)),this}_syncState(){let t=!1;return this._synced||(this._synced=!0,t=!0),t}_syncMethod(t,s){const n=this["_original_"+t]=this[t];this[t]=(...e)=>{var t=e[s],t=this.context.transport.schedule(t=>{e[s]=t,n.apply(this,e)},t);this._scheduledEvents.push(t)}}unsync(){return this._scheduledEvents.forEach(t=>this.context.transport.clear(t)),this._scheduledEvents=[],this._synced&&(this._synced=!1,this.triggerAttack=this._original_triggerAttack,this.triggerRelease=this._original_triggerRelease,this.context.transport.off("stop",this._syncedRelease),this.context.transport.off("pause",this._syncedRelease),this.context.transport.off("loopEnd",this._syncedRelease)),this}triggerAttackRelease(t,e,s,n){s=this.toSeconds(s),e=this.toSeconds(e);return this.triggerAttack(t,s,n),this.triggerRelease(s+e),this}dispose(){return super.dispose(),this._volume.dispose(),this.unsync(),this._scheduledEvents=[],this}}class Ef extends Mf{constructor(){super(Cp(Ef.getDefaults(),arguments));var t=Cp(Ef.getDefaults(),arguments);this.portamento=t.portamento,this.onsilence=t.onsilence}static getDefaults(){return Object.assign(Mf.getDefaults(),{detune:0,onsilence:Zp,portamento:0})}triggerAttack(t,e,s=1){this.log("triggerAttack",t,e,s);e=this.toSeconds(e);return this._triggerEnvelopeAttack(e,s),this.setNote(t,e),this}triggerRelease(t){this.log("triggerRelease",t);t=this.toSeconds(t);return this._triggerEnvelopeRelease(t),this}setNote(t,e){e=this.toSeconds(e),t=t instanceof cd?t.toFrequency():t;if(0this.onsilence(this)},t.oscillator)),this.frequency=this.oscillator.frequency,this.detune=this.oscillator.detune,this.envelope=new Rf(Object.assign({context:this.context},t.envelope)),this.oscillator.chain(this.envelope,this.output),Gp(this,["oscillator","frequency","detune","envelope"])}static getDefaults(){return Object.assign(Ef.getDefaults(),{envelope:Object.assign(Op(Df.getDefaults(),Object.keys(md.getDefaults())),{attack:.005,decay:.1,release:1,sustain:.3}),oscillator:Object.assign(Op(cf.getDefaults(),[...Object.keys(Wd.getDefaults()),"frequency","detune"]),{type:"triangle"})})}_triggerEnvelopeAttack(t,e){if(this.envelope.triggerAttack(t,e),this.oscillator.start(t),0===this.envelope.sustain){const e=this.toSeconds(this.envelope.attack),s=this.toSeconds(this.envelope.decay);this.oscillator.stop(t+e+s)}}_triggerEnvelopeRelease(t){this.envelope.triggerRelease(t),this.oscillator.stop(t+this.toSeconds(this.envelope.release))}getLevelAtTime(t){return t=this.toSeconds(t),this.envelope.getValueAtTime(t)}dispose(){return super.dispose(),this.oscillator.dispose(),this.envelope.dispose(),this}}class Ff extends Ef{constructor(){super(Cp(Ff.getDefaults(),arguments)),this.name="ModulationSynth";var t=Cp(Ff.getDefaults(),arguments);this._carrier=new qf({context:this.context,oscillator:t.oscillator,envelope:t.envelope,onsilence:()=>this.onsilence(this),volume:-10}),this._modulator=new qf({context:this.context,oscillator:t.modulation,envelope:t.modulationEnvelope,volume:-10}),this.oscillator=this._carrier.oscillator,this.envelope=this._carrier.envelope,this.modulation=this._modulator.oscillator,this.modulationEnvelope=this._modulator.envelope,this.frequency=new Td({context:this.context,units:"frequency"}),this.detune=new Td({context:this.context,value:t.detune,units:"cents"}),this.harmonicity=new ef({context:this.context,value:t.harmonicity,minValue:0}),this._modulationNode=new xd({context:this.context,gain:0}),Gp(this,["frequency","harmonicity","oscillator","envelope","modulation","modulationEnvelope","detune"])}static getDefaults(){return Object.assign(Ef.getDefaults(),{harmonicity:3,oscillator:Object.assign(Op(cf.getDefaults(),[...Object.keys(Wd.getDefaults()),"frequency","detune"]),{type:"sine"}),envelope:Object.assign(Op(Df.getDefaults(),Object.keys(md.getDefaults())),{attack:.01,decay:.01,sustain:1,release:.5}),modulation:Object.assign(Op(cf.getDefaults(),[...Object.keys(Wd.getDefaults()),"frequency","detune"]),{type:"square"}),modulationEnvelope:Object.assign(Op(Df.getDefaults(),Object.keys(md.getDefaults())),{attack:.5,decay:0,sustain:1,release:.5})})}_triggerEnvelopeAttack(t,e){this._carrier._triggerEnvelopeAttack(t,e),this._modulator._triggerEnvelopeAttack(t,e)}_triggerEnvelopeRelease(t){return this._carrier._triggerEnvelopeRelease(t),this._modulator._triggerEnvelopeRelease(t),this}getLevelAtTime(t){return t=this.toSeconds(t),this.envelope.getValueAtTime(t)}dispose(){return super.dispose(),this._carrier.dispose(),this._modulator.dispose(),this.frequency.dispose(),this.detune.dispose(),this.harmonicity.dispose(),this._modulationNode.dispose(),this}}class If extends Ff{constructor(){super(Cp(If.getDefaults(),arguments)),this.name="AMSynth",this._modulationScale=new tf({context:this.context}),this.frequency.connect(this._carrier.frequency),this.frequency.chain(this.harmonicity,this._modulator.frequency),this.detune.fan(this._carrier.detune,this._modulator.detune),this._modulator.chain(this._modulationScale,this._modulationNode.gain),this._carrier.chain(this._modulationNode,this.output)}dispose(){return super.dispose(),this._modulationScale.dispose(),this}}class Vf extends md{constructor(){super(Cp(Vf.getDefaults(),arguments,["frequency","type"])),this.name="BiquadFilter";var t=Cp(Vf.getDefaults(),arguments,["frequency","type"]);this._filter=this.context.createBiquadFilter(),this.input=this.output=this._filter,this.Q=new _d({context:this.context,units:"number",value:t.Q,param:this._filter.Q}),this.frequency=new _d({context:this.context,units:"frequency",value:t.frequency,param:this._filter.frequency}),this.detune=new _d({context:this.context,units:"cents",value:t.detune,param:this._filter.detune}),this.gain=new _d({context:this.context,units:"decibels",convert:!1,value:t.gain,param:this._filter.gain}),this.type=t.type}static getDefaults(){return Object.assign(md.getDefaults(),{Q:1,type:"lowpass",frequency:350,detune:0,gain:0})}get type(){return this._filter.type}set type(t){op(-1!==["lowpass","highpass","bandpass","lowshelf","highshelf","notch","allpass","peaking"].indexOf(t),`Invalid filter type: ${t}`),this._filter.type=t}getFrequencyResponse(e=128){const s=new Float32Array(e);for(let t=0;tt.type=e)}get rolloff(){return this._rolloff}set rolloff(t){const e=tp(t)?t:parseInt(t,10),s=[-12,-24,-48,-96];var n=s.indexOf(e);op(-1!==n,`rolloff can only be ${s.join(", ")}`),n+=1,this._rolloff=e,this.input.disconnect(),this._filters.forEach(t=>t.disconnect()),this._filters=new Array(n);for(let t=0;t1);return this._filters.forEach(()=>{e.getFrequencyResponse(t).forEach((t,e)=>s[e]*=t)}),e.dispose(),s}dispose(){return super.dispose(),this._filters.forEach(t=>{t.dispose()}),Qp(this,["detune","frequency","gain","Q"]),this.frequency.dispose(),this.Q.dispose(),this.detune.dispose(),this.gain.dispose(),this}}class Pf extends Df{constructor(){super(Cp(Pf.getDefaults(),arguments,["attack","decay","sustain","release"])),this.name="FrequencyEnvelope";var t=Cp(Pf.getDefaults(),arguments,["attack","decay","sustain","release"]);this._octaves=t.octaves,this._baseFrequency=this.toFrequency(t.baseFrequency),this._exponent=this.input=new kf({context:this.context,value:t.exponent}),this._scale=this.output=new uf({context:this.context,min:this._baseFrequency,max:this._baseFrequency*Math.pow(2,this._octaves)}),this._sig.chain(this._exponent,this._scale)}static getDefaults(){return Object.assign(Df.getDefaults(),{baseFrequency:200,exponent:1,octaves:4})}get baseFrequency(){return this._baseFrequency}set baseFrequency(t){t=this.toFrequency(t);ap(t,0),this._baseFrequency=t,this._scale.min=this._baseFrequency,this.octaves=this._octaves}get octaves(){return this._octaves}set octaves(t){this._octaves=t,this._scale.max=this._baseFrequency*Math.pow(2,t)}get exponent(){return this._exponent.value}set exponent(t){this._exponent.value=t}dispose(){return super.dispose(),this._exponent.dispose(),this._scale.dispose(),this}}class jf extends Ef{constructor(){super(Cp(jf.getDefaults(),arguments)),this.name="MonoSynth";var t=Cp(jf.getDefaults(),arguments);this.oscillator=new cf(Object.assign(t.oscillator,{context:this.context,detune:t.detune,onstop:()=>this.onsilence(this)})),this.frequency=this.oscillator.frequency,this.detune=this.oscillator.detune,this.filter=new Nf(Object.assign(t.filter,{context:this.context})),this.filterEnvelope=new Pf(Object.assign(t.filterEnvelope,{context:this.context})),this.envelope=new Rf(Object.assign(t.envelope,{context:this.context})),this.oscillator.chain(this.filter,this.envelope,this.output),this.filterEnvelope.connect(this.filter.frequency),Gp(this,["oscillator","frequency","detune","filter","filterEnvelope","envelope"])}static getDefaults(){return Object.assign(Ef.getDefaults(),{envelope:Object.assign(Op(Df.getDefaults(),Object.keys(md.getDefaults())),{attack:.005,decay:.1,release:1,sustain:.9}),filter:Object.assign(Op(Nf.getDefaults(),Object.keys(md.getDefaults())),{Q:1,rolloff:-12,type:"lowpass"}),filterEnvelope:Object.assign(Op(Pf.getDefaults(),Object.keys(md.getDefaults())),{attack:.6,baseFrequency:200,decay:.2,exponent:2,octaves:3,release:2,sustain:.5}),oscillator:Object.assign(Op(cf.getDefaults(),Object.keys(Wd.getDefaults())),{type:"sawtooth"})})}_triggerEnvelopeAttack(t,e=1){if(this.envelope.triggerAttack(t,e),this.filterEnvelope.triggerAttack(t),this.oscillator.start(t),0===this.envelope.sustain){const e=this.toSeconds(this.envelope.attack),s=this.toSeconds(this.envelope.decay);this.oscillator.stop(t+e+s)}}_triggerEnvelopeRelease(t){this.envelope.triggerRelease(t),this.filterEnvelope.triggerRelease(t),this.oscillator.stop(t+this.toSeconds(this.envelope.release))}getLevelAtTime(t){return t=this.toSeconds(t),this.envelope.getValueAtTime(t)}dispose(){return super.dispose(),this.oscillator.dispose(),this.envelope.dispose(),this.filterEnvelope.dispose(),this.filter.dispose(),this}}class Lf extends Ef{constructor(){super(Cp(Lf.getDefaults(),arguments)),this.name="DuoSynth";var t=Cp(Lf.getDefaults(),arguments);this.voice0=new jf(Object.assign(t.voice0,{context:this.context,onsilence:()=>this.onsilence(this)})),this.voice1=new jf(Object.assign(t.voice1,{context:this.context})),this.harmonicity=new ef({context:this.context,units:"positive",value:t.harmonicity}),this._vibrato=new df({frequency:t.vibratoRate,context:this.context,min:-50,max:50}),this._vibrato.start(),this.vibratoRate=this._vibrato.frequency,this._vibratoGain=new xd({context:this.context,units:"normalRange",gain:t.vibratoAmount}),this.vibratoAmount=this._vibratoGain.gain,this.frequency=new Td({context:this.context,units:"frequency",value:440}),this.detune=new Td({context:this.context,units:"cents",value:t.detune}),this.frequency.connect(this.voice0.frequency),this.frequency.chain(this.harmonicity,this.voice1.frequency),this._vibrato.connect(this._vibratoGain),this._vibratoGain.fan(this.voice0.detune,this.voice1.detune),this.detune.fan(this.voice0.detune,this.voice1.detune),this.voice0.connect(this.output),this.voice1.connect(this.output),Gp(this,["voice0","voice1","frequency","vibratoAmount","vibratoRate"])}getLevelAtTime(t){return t=this.toSeconds(t),this.voice0.envelope.getValueAtTime(t)+this.voice1.envelope.getValueAtTime(t)}static getDefaults(){return Ap(Ef.getDefaults(),{vibratoAmount:.5,vibratoRate:5,harmonicity:1.5,voice0:Ap(Op(jf.getDefaults(),Object.keys(Ef.getDefaults())),{filterEnvelope:{attack:.01,decay:0,sustain:1,release:.5},envelope:{attack:.01,decay:0,sustain:1,release:.5}}),voice1:Ap(Op(jf.getDefaults(),Object.keys(Ef.getDefaults())),{filterEnvelope:{attack:.01,decay:0,sustain:1,release:.5},envelope:{attack:.01,decay:0,sustain:1,release:.5}})})}_triggerEnvelopeAttack(t,e){this.voice0._triggerEnvelopeAttack(t,e),this.voice1._triggerEnvelopeAttack(t,e)}_triggerEnvelopeRelease(t){return this.voice0._triggerEnvelopeRelease(t),this.voice1._triggerEnvelopeRelease(t),this}dispose(){return super.dispose(),this.voice0.dispose(),this.voice1.dispose(),this.frequency.dispose(),this.detune.dispose(),this._vibrato.dispose(),this.vibratoRate.dispose(),this._vibratoGain.dispose(),this.harmonicity.dispose(),this}}class zf extends Ff{constructor(){super(Cp(zf.getDefaults(),arguments)),this.name="FMSynth";var t=Cp(zf.getDefaults(),arguments);this.modulationIndex=new ef({context:this.context,value:t.modulationIndex}),this.frequency.connect(this._carrier.frequency),this.frequency.chain(this.harmonicity,this._modulator.frequency),this.frequency.chain(this.modulationIndex,this._modulationNode),this.detune.fan(this._carrier.detune,this._modulator.detune),this._modulator.connect(this._modulationNode.gain),this._modulationNode.connect(this._carrier.frequency),this._carrier.connect(this.output)}static getDefaults(){return Object.assign(Ff.getDefaults(),{modulationIndex:10})}dispose(){return super.dispose(),this.modulationIndex.dispose(),this}}const Wf=[1,1.483,1.932,2.546,2.63,3.897];class Bf extends Ef{constructor(){super(Cp(Bf.getDefaults(),arguments)),this.name="MetalSynth",this._oscillators=[],this._freqMultipliers=[];var e=Cp(Bf.getDefaults(),arguments);this.detune=new Td({context:this.context,units:"cents",value:e.detune}),this.frequency=new Td({context:this.context,units:"frequency"}),this._amplitude=new xd({context:this.context,gain:0}).connect(this.output),this._highpass=new Nf({Q:0,context:this.context,type:"highpass"}).connect(this._amplitude);for(let t=0;tthis.onsilence(this):Zp,type:"square"});n.connect(this._highpass),this._oscillators[t]=n;var s=new ef({context:this.context,value:Wf[t]});this._freqMultipliers[t]=s,this.frequency.chain(s,n.frequency),this.detune.connect(n.detune)}this._filterFreqScaler=new uf({context:this.context,max:7e3,min:this.toFrequency(e.resonance)}),this.envelope=new Df({attack:e.envelope.attack,attackCurve:"linear",context:this.context,decay:e.envelope.decay,release:e.envelope.release,sustain:0}),this.envelope.chain(this._filterFreqScaler,this._highpass.frequency),this.envelope.connect(this._amplitude.gain),this._octaves=e.octaves,this.octaves=e.octaves}static getDefaults(){return Ap(Ef.getDefaults(),{envelope:Object.assign(Op(Df.getDefaults(),Object.keys(md.getDefaults())),{attack:.001,decay:1.4,release:.2}),harmonicity:5.1,modulationIndex:32,octaves:1.5,resonance:4e3})}_triggerEnvelopeAttack(e,t=1){return this.envelope.triggerAttack(e,t),this._oscillators.forEach(t=>t.start(e)),0===this.envelope.sustain&&this._oscillators.forEach(t=>{t.stop(e+this.toSeconds(this.envelope.attack)+this.toSeconds(this.envelope.decay))}),this}_triggerEnvelopeRelease(e){return this.envelope.triggerRelease(e),this._oscillators.forEach(t=>t.stop(e+this.toSeconds(this.envelope.release))),this}getLevelAtTime(t){return t=this.toSeconds(t),this.envelope.getValueAtTime(t)}get modulationIndex(){return this._oscillators[0].modulationIndex.value}set modulationIndex(e){this._oscillators.forEach(t=>t.modulationIndex.value=e)}get harmonicity(){return this._oscillators[0].harmonicity.value}set harmonicity(e){this._oscillators.forEach(t=>t.harmonicity.value=e)}get resonance(){return this._filterFreqScaler.min}set resonance(t){this._filterFreqScaler.min=this.toFrequency(t),this.octaves=this._octaves}get octaves(){return this._octaves}set octaves(t){this._octaves=t,this._filterFreqScaler.max=this._filterFreqScaler.min*Math.pow(2,t)}dispose(){return super.dispose(),this._oscillators.forEach(t=>t.dispose()),this._freqMultipliers.forEach(t=>t.dispose()),this.frequency.dispose(),this.detune.dispose(),this._filterFreqScaler.dispose(),this._amplitude.dispose(),this.envelope.dispose(),this._highpass.dispose(),this}}class Uf extends qf{constructor(){super(Cp(Uf.getDefaults(),arguments)),this.name="MembraneSynth",this.portamento=0;var t=Cp(Uf.getDefaults(),arguments);this.pitchDecay=t.pitchDecay,this.octaves=t.octaves,Gp(this,["oscillator","envelope"])}static getDefaults(){return Ap(Ef.getDefaults(),qf.getDefaults(),{envelope:{attack:.001,attackCurve:"exponential",decay:.4,release:1.4,sustain:.01},octaves:10,oscillator:{type:"sine"},pitchDecay:.05})}setNote(t,e){var s=this.toSeconds(e),e=this.toFrequency(t instanceof cd?t.toFrequency():t),t=e*this.octaves;return this.oscillator.frequency.setValueAtTime(t,s),this.oscillator.frequency.exponentialRampToValueAtTime(e,s+this.toSeconds(this.pitchDecay)),this}dispose(){return super.dispose(),this}}vp([ff(0)],Uf.prototype,"octaves",void 0),vp([_f(0)],Uf.prototype,"pitchDecay",void 0);class Gf extends Mf{constructor(){super(Cp(Gf.getDefaults(),arguments)),this.name="NoiseSynth";var t=Cp(Gf.getDefaults(),arguments);this.noise=new Ud(Object.assign({context:this.context},t.noise)),this.envelope=new Rf(Object.assign({context:this.context},t.envelope)),this.noise.chain(this.envelope,this.output)}static getDefaults(){return Object.assign(Mf.getDefaults(),{envelope:Object.assign(Op(Df.getDefaults(),Object.keys(md.getDefaults())),{decay:.1,sustain:0}),noise:Object.assign(Op(Ud.getDefaults(),Object.keys(Wd.getDefaults())),{type:"white"})})}triggerAttack(t,e=1){return t=this.toSeconds(t),this.envelope.triggerAttack(t,e),this.noise.start(t),0===this.envelope.sustain&&this.noise.stop(t+this.toSeconds(this.envelope.attack)+this.toSeconds(this.envelope.decay)),this}triggerRelease(t){return t=this.toSeconds(t),this.envelope.triggerRelease(t),this.noise.stop(t+this.toSeconds(this.envelope.release)),this}sync(){return this._syncState()&&(this._syncMethod("triggerAttack",0),this._syncMethod("triggerRelease",0)),this}triggerAttackRelease(t,e,s=1){return e=this.toSeconds(e),t=this.toSeconds(t),this.triggerAttack(e,s),this.triggerRelease(e+t),this}dispose(){return super.dispose(),this.noise.dispose(),this.envelope.dispose(),this}}const Qf=new Set;function Zf(t){Qf.add(t)}function Xf(t,e){e=`registerProcessor("${t}", ${e})`;Qf.add(e)}class Yf extends md{constructor(t){super(t),this.name="ToneAudioWorklet",this.workletOptions={},this.onprocessorerror=Zp;const e=URL.createObjectURL(new Blob([Array.from(Qf).join("\n")],{type:"text/javascript"})),s=this._audioWorkletName();this._dummyGain=this.context.createGain(),this._dummyParam=this._dummyGain.gain,this.context.addAudioWorkletModule(e,s).then(()=>{this.disposed||(this._worklet=this.context.createAudioWorkletNode(s,this.workletOptions),this._worklet.onprocessorerror=this.onprocessorerror.bind(this),this.onReady(this._worklet))})}dispose(){return super.dispose(),this._dummyGain.disconnect(),this._worklet&&(this._worklet.port.postMessage("dispose"),this._worklet.disconnect()),this}}Zf('\n\t/**\n\t * The base AudioWorkletProcessor for use in Tone.js. Works with the [[ToneAudioWorklet]]. \n\t */\n\tclass ToneAudioWorkletProcessor extends AudioWorkletProcessor {\n\n\t\tconstructor(options) {\n\t\t\t\n\t\t\tsuper(options);\n\t\t\t/**\n\t\t\t * If the processor was disposed or not. Keep alive until it\'s disposed.\n\t\t\t */\n\t\t\tthis.disposed = false;\n\t\t \t/** \n\t\t\t * The number of samples in the processing block\n\t\t\t */\n\t\t\tthis.blockSize = 128;\n\t\t\t/**\n\t\t\t * the sample rate\n\t\t\t */\n\t\t\tthis.sampleRate = sampleRate;\n\n\t\t\tthis.port.onmessage = (event) => {\n\t\t\t\t// when it receives a dispose \n\t\t\t\tif (event.data === "dispose") {\n\t\t\t\t\tthis.disposed = true;\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t}\n'),Zf("\n\t/**\n\t * Abstract class for a single input/output processor. \n\t * has a 'generate' function which processes one sample at a time\n\t */\n\tclass SingleIOProcessor extends ToneAudioWorkletProcessor {\n\n\t\tconstructor(options) {\n\t\t\tsuper(Object.assign(options, {\n\t\t\t\tnumberOfInputs: 1,\n\t\t\t\tnumberOfOutputs: 1\n\t\t\t}));\n\t\t\t/**\n\t\t\t * Holds the name of the parameter and a single value of that\n\t\t\t * parameter at the current sample\n\t\t\t * @type { [name: string]: number }\n\t\t\t */\n\t\t\tthis.params = {}\n\t\t}\n\n\t\t/**\n\t\t * Generate an output sample from the input sample and parameters\n\t\t * @abstract\n\t\t * @param input number\n\t\t * @param channel number\n\t\t * @param parameters { [name: string]: number }\n\t\t * @returns number\n\t\t */\n\t\tgenerate(){}\n\n\t\t/**\n\t\t * Update the private params object with the \n\t\t * values of the parameters at the given index\n\t\t * @param parameters { [name: string]: Float32Array },\n\t\t * @param index number\n\t\t */\n\t\tupdateParams(parameters, index) {\n\t\t\tfor (const paramName in parameters) {\n\t\t\t\tconst param = parameters[paramName];\n\t\t\t\tif (param.length > 1) {\n\t\t\t\t\tthis.params[paramName] = parameters[paramName][index];\n\t\t\t\t} else {\n\t\t\t\t\tthis.params[paramName] = parameters[paramName][0];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Process a single frame of the audio\n\t\t * @param inputs Float32Array[][]\n\t\t * @param outputs Float32Array[][]\n\t\t */\n\t\tprocess(inputs, outputs, parameters) {\n\t\t\tconst input = inputs[0];\n\t\t\tconst output = outputs[0];\n\t\t\t// get the parameter values\n\t\t\tconst channelCount = Math.max(input && input.length || 0, output.length);\n\t\t\tfor (let sample = 0; sample < this.blockSize; sample++) {\n\t\t\t\tthis.updateParams(parameters, sample);\n\t\t\t\tfor (let channel = 0; channel < channelCount; channel++) {\n\t\t\t\t\tconst inputSample = input && input.length ? input[channel][sample] : 0;\n\t\t\t\t\toutput[channel][sample] = this.generate(inputSample, channel, this.params);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn !this.disposed;\n\t\t}\n\t};\n"),Zf("\n\t/**\n\t * A multichannel buffer for use within an AudioWorkletProcessor as a delay line\n\t */\n\tclass DelayLine {\n\t\t\n\t\tconstructor(size, channels) {\n\t\t\tthis.buffer = [];\n\t\t\tthis.writeHead = []\n\t\t\tthis.size = size;\n\n\t\t\t// create the empty channels\n\t\t\tfor (let i = 0; i < channels; i++) {\n\t\t\t\tthis.buffer[i] = new Float32Array(this.size);\n\t\t\t\tthis.writeHead[i] = 0;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Push a value onto the end\n\t\t * @param channel number\n\t\t * @param value number\n\t\t */\n\t\tpush(channel, value) {\n\t\t\tthis.writeHead[channel] += 1;\n\t\t\tif (this.writeHead[channel] > this.size) {\n\t\t\t\tthis.writeHead[channel] = 0;\n\t\t\t}\n\t\t\tthis.buffer[channel][this.writeHead[channel]] = value;\n\t\t}\n\n\t\t/**\n\t\t * Get the recorded value of the channel given the delay\n\t\t * @param channel number\n\t\t * @param delay number delay samples\n\t\t */\n\t\tget(channel, delay) {\n\t\t\tlet readHead = this.writeHead[channel] - Math.floor(delay);\n\t\t\tif (readHead < 0) {\n\t\t\t\treadHead += this.size;\n\t\t\t}\n\t\t\treturn this.buffer[channel][readHead];\n\t\t}\n\t}\n");const $f="feedback-comb-filter";Xf($f,'\n\tclass FeedbackCombFilterWorklet extends SingleIOProcessor {\n\n\t\tconstructor(options) {\n\t\t\tsuper(options);\n\t\t\tthis.delayLine = new DelayLine(this.sampleRate, options.channelCount || 2);\n\t\t}\n\n\t\tstatic get parameterDescriptors() {\n\t\t\treturn [{\n\t\t\t\tname: "delayTime",\n\t\t\t\tdefaultValue: 0.1,\n\t\t\t\tminValue: 0,\n\t\t\t\tmaxValue: 1,\n\t\t\t\tautomationRate: "k-rate"\n\t\t\t}, {\n\t\t\t\tname: "feedback",\n\t\t\t\tdefaultValue: 0.5,\n\t\t\t\tminValue: 0,\n\t\t\t\tmaxValue: 0.9999,\n\t\t\t\tautomationRate: "k-rate"\n\t\t\t}];\n\t\t}\n\n\t\tgenerate(input, channel, parameters) {\n\t\t\tconst delayedSample = this.delayLine.get(channel, parameters.delayTime * this.sampleRate);\n\t\t\tthis.delayLine.push(channel, input + delayedSample * parameters.feedback);\n\t\t\treturn delayedSample;\n\t\t}\n\t}\n');class Hf extends Yf{constructor(){super(Cp(Hf.getDefaults(),arguments,["delayTime","resonance"])),this.name="FeedbackCombFilter";var t=Cp(Hf.getDefaults(),arguments,["delayTime","resonance"]);this.input=new xd({context:this.context}),this.output=new xd({context:this.context}),this.delayTime=new _d({context:this.context,value:t.delayTime,units:"time",minValue:0,maxValue:1,param:this._dummyParam,swappable:!0}),this.resonance=new _d({context:this.context,value:t.resonance,units:"normalRange",param:this._dummyParam,swappable:!0}),Gp(this,["resonance","delayTime"])}_audioWorkletName(){return $f}static getDefaults(){return Object.assign(md.getDefaults(),{delayTime:.1,resonance:.5})}onReady(t){gd(this.input,t,this.output);var e=t.parameters.get("delayTime");this.delayTime.setParam(e);t=t.parameters.get("feedback");this.resonance.setParam(t)}dispose(){return super.dispose(),this.input.dispose(),this.output.dispose(),this.delayTime.dispose(),this.resonance.dispose(),this}}class Jf extends md{constructor(){super(Cp(Jf.getDefaults(),arguments,["frequency","type"])),this.name="OnePoleFilter";var t=Cp(Jf.getDefaults(),arguments,["frequency","type"]);this._frequency=t.frequency,this._type=t.type,this.input=new xd({context:this.context}),this.output=new xd({context:this.context}),this._createFilter()}static getDefaults(){return Object.assign(md.getDefaults(),{frequency:880,type:"lowpass"})}_createFilter(){const t=this._filter,e=this.toFrequency(this._frequency),s=1/(2*Math.PI*e);if("lowpass"===this._type){const t=1/(s*this.context.sampleRate),e=t-1;this._filter=this.context.createIIRFilter([t,0],[1,e])}else{const t=1/(s*this.context.sampleRate)-1;this._filter=this.context.createIIRFilter([1,-1],[1,t])}this.input.chain(this._filter,this.output),t&&this.context.setTimeout(()=>{this.disposed||(this.input.disconnect(t),t.disconnect())},this.blockTime)}get frequency(){return this._frequency}set frequency(t){this._frequency=t,this._createFilter()}get type(){return this._type}set type(t){this._type=t,this._createFilter()}getFrequencyResponse(e=128){const s=new Float32Array(e);for(let t=0;tthis.releaseAll(t);const t=Cp(e_.getDefaults(),arguments,["voice","options"]);op(!tp(t.voice),"DEPRECATED: The polyphony count is no longer the first argument.");var e=t.voice.getDefaults();this.options=Object.assign(e,t.options),this.voice=t.voice,this.maxPolyphony=t.maxPolyphony,this._dummyVoice=this._getNextAvailableVoice();e=this._voices.indexOf(this._dummyVoice);this._voices.splice(e,1),this._gcTimeout=this.context.setInterval(this._collectGarbage.bind(this),1)}static getDefaults(){return Object.assign(Mf.getDefaults(),{maxPolyphony:32,options:{},voice:qf})}get activeVoices(){return this._activeVoices.length}_makeVoiceAvailable(e){this._availableVoices.push(e);var t=this._activeVoices.findIndex(t=>t.voice===e);this._activeVoices.splice(t,1)}_getNextAvailableVoice(){if(this._availableVoices.length)return this._availableVoices.shift();if(this._voices.lengthMath.ceil(this._averageActiveVoices+1)){const t=this._availableVoices.shift(),e=this._voices.indexOf(t);this._voices.splice(e,1),this.context.isOffline||t.dispose()}}_triggerAttack(t,n,i){t.forEach(t=>{const e=new Ed(this.context,t).toMidi(),s=this._getNextAvailableVoice();s&&(s.triggerAttack(t,n,i),this._activeVoices.push({midi:e,voice:s,released:!1}),this.log("triggerAttack",t,n))})}_triggerRelease(t,n){t.forEach(t=>{const s=new Ed(this.context,t).toMidi(),e=this._activeVoices.find(({midi:t,released:e})=>t===s&&!e);e&&(e.voice.triggerRelease(n),e.released=!0,this.log("triggerRelease",t,n))})}_scheduleEvent(t,e,s,n){op(!this.disposed,"Synth was already disposed"),s<=this.now()?"attack"===t?this._triggerAttack(e,s,n):this._triggerRelease(e,s):this.context.setTimeout(()=>{this.disposed||this._scheduleEvent(t,e,s,n)},s-this.now())}triggerAttack(t,e,s){Array.isArray(t)||(t=[t]);e=this.toSeconds(e);return this._scheduleEvent("attack",t,e,s),this}triggerRelease(t,e){Array.isArray(t)||(t=[t]);e=this.toSeconds(e);return this._scheduleEvent("release",t,e),this}triggerAttackRelease(e,s,t,n){var i=this.toSeconds(t);if(this.triggerAttack(e,i,n),np(s)){op(np(e),"If the duration is an array, the notes must also be an array");for(let t=0;tt.set(e)),this._dummyVoice.set(e),this}get(){return this._dummyVoice.get()}releaseAll(t){const e=this.toSeconds(t);return this._activeVoices.forEach(({voice:t})=>{t.triggerRelease(e)}),this}dispose(){return super.dispose(),this._dummyVoice.dispose(),this._voices.forEach(t=>t.dispose()),this._activeVoices=[],this._availableVoices=[],this.context.clearInterval(this._gcTimeout),this}}class s_ extends Mf{constructor(){super(Cp(s_.getDefaults(),arguments,["urls","onload","baseUrl"],"urls")),this.name="Sampler",this._activeSources=new Map;const s=Cp(s_.getDefaults(),arguments,["urls","onload","baseUrl"],"urls"),n={};Object.keys(s.urls).forEach(t=>{const e=parseInt(t,10);if(op(rp(t)||tp(e)&&isFinite(e),`url key is neither a note or midi pitch: ${t}`),rp(t)){const e=new cd(this.context,t).toMidi();n[e]=s.urls[t]}else tp(e)&&isFinite(e)&&(n[e]=s.urls[e])}),this._buffers=new Md({urls:n,onload:s.onload,baseUrl:s.baseUrl,onerror:s.onerror}),this.attack=s.attack,this.release=s.release,this.curve=s.curve,this._buffers.loaded&&Promise.resolve().then(s.onload)}static getDefaults(){return Object.assign(Mf.getDefaults(),{attack:0,baseUrl:"",curve:"exponential",onload:Zp,onerror:Zp,release:.1,urls:{}})}_findClosest(t){let e=0;for(;e<96;){if(this._buffers.has(t+e))return-e;if(this._buffers.has(t-e))return e;e++}throw new Error(`No available buffers for note: ${t}`)}triggerAttack(t,c,l=1){return this.log("triggerAttack",t,c,l),(t=!Array.isArray(t)?[t]:t).forEach(t=>{const e=rd(new cd(this.context,t).toFrequency()),s=Math.round(e),n=e-s,i=this._findClosest(s),r=s-i,o=this._buffers.get(r),a=sd(i+n),h=new Bd({url:o,context:this.context,curve:this.curve,fadeIn:this.attack,fadeOut:this.release,playbackRate:a}).connect(this.output);h.start(c,0,o.duration/a,l),np(this._activeSources.get(s))||this._activeSources.set(s,[]),this._activeSources.get(s).push(h),h.onended=()=>{if(this._activeSources&&this._activeSources.has(s)){const t=this._activeSources.get(s),e=t.indexOf(h);-1!==e&&t.splice(e,1)}}}),this}triggerRelease(t,s){return this.log("triggerRelease",t,s),(t=!Array.isArray(t)?[t]:t).forEach(t=>{t=new cd(this.context,t).toMidi();if(this._activeSources.has(t)&&this._activeSources.get(t).length){const e=this._activeSources.get(t);s=this.toSeconds(s),e.forEach(t=>{t.stop(s)}),this._activeSources.set(t,[])}}),this}releaseAll(t){const e=this.toSeconds(t);return this._activeSources.forEach(t=>{for(;t.length;)t.shift().stop(e)}),this}sync(){return this._syncState()&&(this._syncMethod("triggerAttack",1),this._syncMethod("triggerRelease",1)),this}triggerAttackRelease(t,s,e,n=1){const i=this.toSeconds(e);return this.triggerAttack(t,i,n),np(s)?(op(np(t),"notes must be an array when duration is array"),t.forEach((t,e)=>{e=s[Math.min(e,s.length-1)];this.triggerRelease(t,i+this.toSeconds(e))})):this.triggerRelease(t,i+this.toSeconds(s)),this}add(t,e,s){var n;return op(rp(t)||isFinite(t),`note must be a pitch or midi: ${t}`),rp(t)?(n=new cd(this.context,t).toMidi(),this._buffers.add(n,e,s)):this._buffers.add(t,e,s),this}get loaded(){return this._buffers.loaded}dispose(){return super.dispose(),this._buffers.dispose(),this._activeSources.forEach(t=>{t.forEach(t=>t.dispose())}),this._activeSources.clear(),this}}vp([_f(0)],s_.prototype,"attack",void 0),vp([_f(0)],s_.prototype,"release",void 0);class n_ extends dd{constructor(){super(Cp(n_.getDefaults(),arguments,["callback","value"])),this.name="ToneEvent",this._state=new fd("stopped"),this._startOffset=0;var t=Cp(n_.getDefaults(),arguments,["callback","value"]);this._loop=t.loop,this.callback=t.callback,this.value=t.value,this._loopStart=this.toTicks(t.loopStart),this._loopEnd=this.toTicks(t.loopEnd),this._playbackRate=t.playbackRate,this._probability=t.probability,this._humanize=t.humanize,this.mute=t.mute,this._playbackRate=t.playbackRate,this._state.increasing=!0,this._rescheduleEvents()}static getDefaults(){return Object.assign(dd.getDefaults(),{callback:Zp,humanize:!1,loop:!1,loopEnd:"1m",loopStart:0,mute:!1,playbackRate:1,probability:1,value:null})}_rescheduleEvents(t=-1){this._state.forEachFrom(t,t=>{let e;var s,n;"started"===t.state&&(-1!==t.id&&this.context.transport.clear(t.id),s=t.time+Math.round(this.startOffset/this._playbackRate),!0===this._loop||tp(this._loop)&&1{this.context.transport.clear(t.id)}),this._state.cancel(t),this}_tick(e){var t=this.context.transport.getTicksAtTime(e);if(!(this.mute||"started"!==this._state.getValueAtTime(t)||this.probability<1&&Math.random()>this.probability)){if(this.humanize){let t=.02;sp(this.humanize)||(t=this.toSeconds(this.humanize)),e+=(2*Math.random()-1)*t}this.callback(e,this.value)}}_getLoopDuration(){return(this._loopEnd-this._loopStart)/this._playbackRate}get loop(){return this._loop}set loop(t){this._loop=t,this._rescheduleEvents()}get playbackRate(){return this._playbackRate}set playbackRate(t){this._playbackRate=t,this._rescheduleEvents()}get loopEnd(){return new Rd(this.context,this._loopEnd).toSeconds()}set loopEnd(t){this._loopEnd=this.toTicks(t),this._loop&&this._rescheduleEvents()}get loopStart(){return new Rd(this.context,this._loopStart).toSeconds()}set loopStart(t){this._loopStart=this.toTicks(t),this._loop&&this._rescheduleEvents()}get progress(){if(this._loop){var t=this.context.transport.ticks,e=this._state.get(t);if(null===e||"started"!==e.state)return 0;var s=this._getLoopDuration();return(t-e.time)%s/s}return 0}dispose(){return super.dispose(),this.cancel(),this._state.dispose(),this}}class i_ extends dd{constructor(){super(Cp(i_.getDefaults(),arguments,["callback","interval"])),this.name="Loop";var t=Cp(i_.getDefaults(),arguments,["callback","interval"]);this._event=new n_({context:this.context,callback:this._tick.bind(this),loop:!0,loopEnd:t.interval,playbackRate:t.playbackRate,probability:t.probability}),this.callback=t.callback,this.iterations=t.iterations}static getDefaults(){return Object.assign(dd.getDefaults(),{interval:"4n",callback:Zp,playbackRate:1,iterations:1/0,probability:1,mute:!1,humanize:!1})}start(t){return this._event.start(t),this}stop(t){return this._event.stop(t),this}cancel(t){return this._event.cancel(t),this}_tick(t){this.callback(t)}get state(){return this._event.state}get progress(){return this._event.progress}get interval(){return this._event.loopEnd}set interval(t){this._event.loopEnd=t}get playbackRate(){return this._event.playbackRate}set playbackRate(t){this._event.playbackRate=t}get humanize(){return this._event.humanize}set humanize(t){this._event.humanize=t}get probability(){return this._event.probability}set probability(t){this._event.probability=t}get mute(){return this._event.mute}set mute(t){this._event.mute=t}get iterations(){return!0===this._event.loop?1/0:this._event.loop}set iterations(t){this._event.loop=t===1/0||t}dispose(){return super.dispose(),this._event.dispose(),this}}class r_ extends n_{constructor(){super(Cp(r_.getDefaults(),arguments,["callback","events"])),this.name="Part",this._state=new fd("stopped"),this._events=new Set;const t=Cp(r_.getDefaults(),arguments,["callback","events"]);this._state.increasing=!0,t.events.forEach(t=>{np(t)?this.add(t[0],t[1]):this.add(t)})}static getDefaults(){return Object.assign(n_.getDefaults(),{events:[]})}start(e,t){const s=this.toTicks(e);if("started"!==this._state.getValueAtTime(s)){t=Dp(t,this._loop?this._loopStart:0),t=this._loop?Dp(t,this._loopStart):Dp(t,0);const e=this.toTicks(t);this._state.add({id:-1,offset:e,state:"started",time:s}),this._forEach(t=>{this._startNote(t,s,e)})}return this}_startNote(t,e,s){e-=s,this._loop?t.startOffset>=this._loopStart&&t.startOffset=s&&(t.loop=!1,t.start(new Rd(this.context,e))):t.startOffset>=s&&t.start(new Rd(this.context,e))}get startOffset(){return this._startOffset}set startOffset(t){this._startOffset=t,this._forEach(t=>{t.startOffset+=this._startOffset})}stop(e){var t=this.toTicks(e);return this._state.cancel(t),this._state.setStateAtTime("stopped",t),this._forEach(t=>{t.stop(e)}),this}at(t,e){const s=new pd(this.context,t).toTicks(),n=new Rd(this.context,1).toSeconds(),i=this._events.values();let r=i.next();for(;!r.done;){const t=r.value;if(Math.abs(s-t.startOffset){"started"===t.state?this._startNote(e,t.time,t.offset):e.stop(new Rd(this.context,t.time))})}remove(e,s){return ep(e)&&e.hasOwnProperty("time")&&(e=(s=e).time),e=this.toTicks(e),this._events.forEach(t=>{t.startOffset===e&&(Hu(s)||Ju(s)&&t.value===s)&&(this._events.delete(t),t.dispose())}),this}clear(){return this._forEach(t=>t.dispose()),this._events.clear(),this}cancel(e){return this._forEach(t=>t.cancel(e)),this._state.cancel(this.toTicks(e)),this}_forEach(e){return this._events&&this._events.forEach(t=>{t instanceof r_?t._forEach(e):e(t)}),this}_setAll(e,s){this._forEach(t=>{t[e]=s})}_tick(t,e){this.mute||this.callback(t,e)}_testLoopBoundries(t){this._loop&&(t.startOffset=this._loopEnd)?t.cancel(0):"stopped"===t.state&&this._restartEvent(t)}get probability(){return this._probability}set probability(t){this._probability=t,this._setAll("probability",t)}get humanize(){return this._humanize}set humanize(t){this._humanize=t,this._setAll("humanize",t)}get loop(){return this._loop}set loop(e){this._loop=e,this._forEach(t=>{t.loopStart=this.loopStart,t.loopEnd=this.loopEnd,t.loop=e,this._testLoopBoundries(t)})}get loopEnd(){return new Rd(this.context,this._loopEnd).toSeconds()}set loopEnd(e){this._loopEnd=this.toTicks(e),this._loop&&this._forEach(t=>{t.loopEnd=e,this._testLoopBoundries(t)})}get loopStart(){return new Rd(this.context,this._loopStart).toSeconds()}set loopStart(t){this._loopStart=this.toTicks(t),this._loop&&this._forEach(t=>{t.loopStart=this.loopStart,this._testLoopBoundries(t)})}get playbackRate(){return this._playbackRate}set playbackRate(t){this._playbackRate=t,this._setAll("playbackRate",t)}get length(){return this._events.size}dispose(){return super.dispose(),this.clear(),this}}function*o_(t){let e=0;for(;e=t.length-1&&(e=!1)):(s--,s<=0&&(e=!0))}function*u_(t){let e=0,s=0;for(;et[e],set:(t,e,s)=>(ip(e)&&isFinite(parseInt(e,10))&&np(s)?t[e]=this._createSequence(s):t[e]=s,this._eventsUpdated(),!0)})}_eventsUpdated(){this._part.clear(),this._rescheduleSequence(this._eventsArray,this._subdivision,this.startOffset),this.loopEnd=this.loopEnd}_rescheduleSequence(t,s,n){t.forEach((t,e)=>{e=e*s+n;if(np(t))this._rescheduleSequence(t,s/t.length,e);else{const s=new Rd(this.context,e,"i").toSeconds();this._part.add(s,t)}})}_indexTime(t){return new Rd(this.context,t*this._subdivision+this.startOffset).toSeconds()}clear(){return this._part.clear(),this}dispose(){return super.dispose(),this._part.dispose(),this}get loop(){return this._part.loop}set loop(t){this._part.loop=t}get loopStart(){return this._loopStart}set loopStart(t){this._loopStart=t,this._part.loopStart=this._indexTime(t)}get loopEnd(){return this._loopEnd}set loopEnd(t){this._loopEnd=t,this._part.loopEnd=0===t?this._indexTime(this._eventsArray.length):this._indexTime(t)}get startOffset(){return this._part.startOffset}set startOffset(t){this._part.startOffset=t}get playbackRate(){return this._part.playbackRate}set playbackRate(t){this._part.playbackRate=t}get probability(){return this._part.probability}set probability(t){this._part.probability=t}get progress(){return this._part.progress}get humanize(){return this._part.humanize}set humanize(t){this._part.humanize=t}get length(){return this._part.length}}class g_ extends md{constructor(){super(Object.assign(Cp(g_.getDefaults(),arguments,["fade"]))),this.name="CrossFade",this._panner=this.context.createStereoPanner(),this._split=this.context.createChannelSplitter(2),this._g2a=new xf({context:this.context}),this.a=new xd({context:this.context,gain:0}),this.b=new xd({context:this.context,gain:0}),this.output=new xd({context:this.context}),this._internalChannels=[this.a,this.b];var t=Cp(g_.getDefaults(),arguments,["fade"]);this.fade=new Td({context:this.context,units:"normalRange",value:t.fade}),Gp(this,"fade"),this.context.getConstant(1).connect(this._panner),this._panner.connect(this._split),this._panner.channelCount=1,this._panner.channelCountMode="explicit",vd(this._split,this.a.gain,0),vd(this._split,this.b.gain,1),this.fade.chain(this._g2a,this._panner.pan),this.a.connect(this.output),this.b.connect(this.output)}static getDefaults(){return Object.assign(md.getDefaults(),{fade:.5})}dispose(){return super.dispose(),this.a.dispose(),this.b.dispose(),this.output.dispose(),this.fade.dispose(),this._g2a.dispose(),this._panner.disconnect(),this._split.disconnect(),this}}class v_ extends md{constructor(t){super(t),this.name="Effect",this._dryWet=new g_({context:this.context}),this.wet=this._dryWet.fade,this.effectSend=new xd({context:this.context}),this.effectReturn=new xd({context:this.context}),this.input=new xd({context:this.context}),this.output=this._dryWet,this.input.fan(this._dryWet.a,this.effectSend),this.effectReturn.connect(this._dryWet.b),this.wet.setValueAtTime(t.wet,0),this._internalChannels=[this.effectReturn,this.effectSend],Gp(this,"wet")}static getDefaults(){return Object.assign(md.getDefaults(),{wet:1})}connectEffect(t){return this._internalChannels.push(t),this.effectSend.chain(t,this.effectReturn),this}dispose(){return super.dispose(),this._dryWet.dispose(),this.effectSend.dispose(),this.effectReturn.dispose(),this.wet.dispose(),this}}class y_ extends v_{constructor(t){super(t),this.name="LFOEffect",this._lfo=new df({context:this.context,frequency:t.frequency,amplitude:t.depth}),this.depth=this._lfo.amplitude,this.frequency=this._lfo.frequency,this.type=t.type,Gp(this,["frequency","depth"])}static getDefaults(){return Object.assign(v_.getDefaults(),{frequency:1,type:"sine",depth:1})}start(t){return this._lfo.start(t),this}stop(t){return this._lfo.stop(t),this}sync(){return this._lfo.sync(),this}unsync(){return this._lfo.unsync(),this}get type(){return this._lfo.type}set type(t){this._lfo.type=t}dispose(){return super.dispose(),this._lfo.dispose(),this.frequency.dispose(),this.depth.dispose(),this}}class x_ extends y_{constructor(){super(Cp(x_.getDefaults(),arguments,["frequency","baseFrequency","octaves"])),this.name="AutoFilter";var t=Cp(x_.getDefaults(),arguments,["frequency","baseFrequency","octaves"]);this.filter=new Nf(Object.assign(t.filter,{context:this.context})),this.connectEffect(this.filter),this._lfo.connect(this.filter.frequency),this.octaves=t.octaves,this.baseFrequency=t.baseFrequency}static getDefaults(){return Object.assign(y_.getDefaults(),{baseFrequency:200,octaves:2.6,filter:{type:"lowpass",rolloff:-12,Q:1}})}get baseFrequency(){return this._lfo.min}set baseFrequency(t){this._lfo.min=this.toFrequency(t),this.octaves=this._octaves}get octaves(){return this._octaves}set octaves(t){this._octaves=t,this._lfo.max=this._lfo.min*Math.pow(2,t)}dispose(){return super.dispose(),this.filter.dispose(),this}}class w_ extends md{constructor(){super(Object.assign(Cp(w_.getDefaults(),arguments,["pan"]))),this.name="Panner",this._panner=this.context.createStereoPanner(),this.input=this._panner,this.output=this._panner;var t=Cp(w_.getDefaults(),arguments,["pan"]);this.pan=new _d({context:this.context,param:this._panner.pan,value:t.pan,minValue:-1,maxValue:1}),this._panner.channelCount=t.channelCount,this._panner.channelCountMode="explicit",Gp(this,"pan")}static getDefaults(){return Object.assign(md.getDefaults(),{pan:0,channelCount:1})}dispose(){return super.dispose(),this._panner.disconnect(),this.pan.dispose(),this}}class b_ extends y_{constructor(){super(Cp(b_.getDefaults(),arguments,["frequency"])),this.name="AutoPanner";var t=Cp(b_.getDefaults(),arguments,["frequency"]);this._panner=new w_({context:this.context,channelCount:t.channelCount}),this.connectEffect(this._panner),this._lfo.connect(this._panner.pan),this._lfo.min=-1,this._lfo.max=1}static getDefaults(){return Object.assign(y_.getDefaults(),{channelCount:1})}dispose(){return super.dispose(),this._panner.dispose(),this}}class T_ extends md{constructor(){super(Cp(T_.getDefaults(),arguments,["smoothing"])),this.name="Follower";var t=Cp(T_.getDefaults(),arguments,["smoothing"]);this._abs=this.input=new yf({context:this.context}),this._lowpass=this.output=new Jf({context:this.context,frequency:1/this.toSeconds(t.smoothing),type:"lowpass"}),this._abs.connect(this._lowpass),this._smoothing=t.smoothing}static getDefaults(){return Object.assign(md.getDefaults(),{smoothing:.05})}get smoothing(){return this._smoothing}set smoothing(t){this._smoothing=t,this._lowpass.frequency=1/this.toSeconds(this.smoothing)}dispose(){return super.dispose(),this._abs.dispose(),this._lowpass.dispose(),this}}class S_ extends v_{constructor(){super(Cp(S_.getDefaults(),arguments,["baseFrequency","octaves","sensitivity"])),this.name="AutoWah";var t=Cp(S_.getDefaults(),arguments,["baseFrequency","octaves","sensitivity"]);this._follower=new T_({context:this.context,smoothing:t.follower}),this._sweepRange=new Af({context:this.context,min:0,max:1,exponent:.5}),this._baseFrequency=this.toFrequency(t.baseFrequency),this._octaves=t.octaves,this._inputBoost=new xd({context:this.context}),this._bandpass=new Nf({context:this.context,rolloff:-48,frequency:0,Q:t.Q}),this._peaking=new Nf({context:this.context,type:"peaking"}),this._peaking.gain.value=t.gain,this.gain=this._peaking.gain,this.Q=this._bandpass.Q,this.effectSend.chain(this._inputBoost,this._follower,this._sweepRange),this._sweepRange.connect(this._bandpass.frequency),this._sweepRange.connect(this._peaking.frequency),this.effectSend.chain(this._bandpass,this._peaking,this.effectReturn),this._setSweepRange(),this.sensitivity=t.sensitivity,Gp(this,["gain","Q"])}static getDefaults(){return Object.assign(v_.getDefaults(),{baseFrequency:100,octaves:6,sensitivity:0,Q:2,gain:2,follower:.2})}get octaves(){return this._octaves}set octaves(t){this._octaves=t,this._setSweepRange()}get follower(){return this._follower.smoothing}set follower(t){this._follower.smoothing=t}get baseFrequency(){return this._baseFrequency}set baseFrequency(t){this._baseFrequency=this.toFrequency(t),this._setSweepRange()}get sensitivity(){return ed(1/this._inputBoost.gain.value)}set sensitivity(t){this._inputBoost.gain.value=1/td(t)}_setSweepRange(){this._sweepRange.min=this._baseFrequency,this._sweepRange.max=Math.min(this._baseFrequency*Math.pow(2,this._octaves),this.context.sampleRate/2)}dispose(){return super.dispose(),this._follower.dispose(),this._sweepRange.dispose(),this._bandpass.dispose(),this._peaking.dispose(),this._inputBoost.dispose(),this}}const k_="bit-crusher";Xf(k_,"\n\tclass BitCrusherWorklet extends SingleIOProcessor {\n\n\t\tstatic get parameterDescriptors() {\n\t\t\treturn [{\n\t\t\t\tname: \"bits\",\n\t\t\t\tdefaultValue: 12,\n\t\t\t\tminValue: 1,\n\t\t\t\tmaxValue: 16,\n\t\t\t\tautomationRate: 'k-rate'\n\t\t\t}];\n\t\t}\n\n\t\tgenerate(input, _channel, parameters) {\n\t\t\tconst step = Math.pow(0.5, parameters.bits - 1);\n\t\t\tconst val = step * Math.floor(input / step + 0.5);\n\t\t\treturn val;\n\t\t}\n\t}\n");class A_ extends v_{constructor(){super(Cp(A_.getDefaults(),arguments,["bits"])),this.name="BitCrusher";var t=Cp(A_.getDefaults(),arguments,["bits"]);this._bitCrusherWorklet=new C_({context:this.context,bits:t.bits}),this.connectEffect(this._bitCrusherWorklet),this.bits=this._bitCrusherWorklet.bits}static getDefaults(){return Object.assign(v_.getDefaults(),{bits:4})}dispose(){return super.dispose(),this._bitCrusherWorklet.dispose(),this}}class C_ extends Yf{constructor(){super(Cp(C_.getDefaults(),arguments)),this.name="BitCrusherWorklet";var t=Cp(C_.getDefaults(),arguments);this.input=new xd({context:this.context}),this.output=new xd({context:this.context}),this.bits=new _d({context:this.context,value:t.bits,units:"positive",minValue:1,maxValue:16,param:this._dummyParam,swappable:!0})}static getDefaults(){return Object.assign(Yf.getDefaults(),{bits:12})}_audioWorkletName(){return k_}onReady(t){gd(this.input,t,this.output);t=t.parameters.get("bits");this.bits.setParam(t)}dispose(){return super.dispose(),this.input.dispose(),this.output.dispose(),this.bits.dispose(),this}}class D_ extends v_{constructor(){super(Cp(D_.getDefaults(),arguments,["order"])),this.name="Chebyshev";var t=Cp(D_.getDefaults(),arguments,["order"]);this._shaper=new Kd({context:this.context,length:4096}),this._order=t.order,this.connectEffect(this._shaper),this.order=t.order,this.oversample=t.oversample}static getDefaults(){return Object.assign(v_.getDefaults(),{order:1,oversample:"none"})}_getCoefficient(t,e,s){return s.has(e)||(0===e?s.set(e,0):1===e?s.set(e,t):s.set(e,2*t*this._getCoefficient(t,e-1,s)-this._getCoefficient(t,e-2,s))),s.get(e)}get order(){return this._order}set order(e){op(Number.isInteger(e),"'order' must be an integer"),this._order=e,this._shaper.setMap(t=>this._getCoefficient(t,e,new Map))}get oversample(){return this._shaper.oversample}set oversample(t){this._shaper.oversample=t}dispose(){return super.dispose(),this._shaper.dispose(),this}}class O_ extends md{constructor(){super(Cp(O_.getDefaults(),arguments,["channels"])),this.name="Split";var t=Cp(O_.getDefaults(),arguments,["channels"]);this._splitter=this.input=this.output=this.context.createChannelSplitter(t.channels),this._internalChannels=[this._splitter]}static getDefaults(){return Object.assign(md.getDefaults(),{channels:2})}dispose(){return super.dispose(),this._splitter.disconnect(),this}}class M_ extends md{constructor(){super(Cp(M_.getDefaults(),arguments,["channels"])),this.name="Merge";var t=Cp(M_.getDefaults(),arguments,["channels"]);this._merger=this.output=this.input=this.context.createChannelMerger(t.channels)}static getDefaults(){return Object.assign(md.getDefaults(),{channels:2})}dispose(){return super.dispose(),this._merger.disconnect(),this}}class E_ extends md{constructor(t){super(t),this.name="StereoEffect",this.input=new xd({context:this.context}),this.input.channelCount=2,this.input.channelCountMode="explicit",this._dryWet=this.output=new g_({context:this.context,fade:t.wet}),this.wet=this._dryWet.fade,this._split=new O_({context:this.context,channels:2}),this._merge=new M_({context:this.context,channels:2}),this.input.connect(this._split),this.input.connect(this._dryWet.a),this._merge.connect(this._dryWet.b),Gp(this,["wet"])}connectEffectLeft(...t){this._split.connect(t[0],0,0),gd(...t),vd(t[t.length-1],this._merge,0,0)}connectEffectRight(...t){this._split.connect(t[0],1,0),gd(...t),vd(t[t.length-1],this._merge,0,1)}static getDefaults(){return Object.assign(md.getDefaults(),{wet:1})}dispose(){return super.dispose(),this._dryWet.dispose(),this._split.dispose(),this._merge.dispose(),this}}class R_ extends E_{constructor(t){super(t),this.feedback=new Td({context:this.context,value:t.feedback,units:"normalRange"}),this._feedbackL=new xd({context:this.context}),this._feedbackR=new xd({context:this.context}),this._feedbackSplit=new O_({context:this.context,channels:2}),this._feedbackMerge=new M_({context:this.context,channels:2}),this._merge.connect(this._feedbackSplit),this._feedbackMerge.connect(this._split),this._feedbackSplit.connect(this._feedbackL,0,0),this._feedbackL.connect(this._feedbackMerge,0,0),this._feedbackSplit.connect(this._feedbackR,1,0),this._feedbackR.connect(this._feedbackMerge,0,1),this.feedback.fan(this._feedbackL.gain,this._feedbackR.gain),Gp(this,["feedback"])}static getDefaults(){return Object.assign(E_.getDefaults(),{feedback:.5})}dispose(){return super.dispose(),this.feedback.dispose(),this._feedbackL.dispose(),this._feedbackR.dispose(),this._feedbackSplit.dispose(),this._feedbackMerge.dispose(),this}}class q_ extends R_{constructor(){super(Cp(q_.getDefaults(),arguments,["frequency","delayTime","depth"])),this.name="Chorus";var t=Cp(q_.getDefaults(),arguments,["frequency","delayTime","depth"]);this._depth=t.depth,this._delayTime=t.delayTime/1e3,this._lfoL=new df({context:this.context,frequency:t.frequency,min:0,max:1}),this._lfoR=new df({context:this.context,frequency:t.frequency,min:0,max:1,phase:180}),this._delayNodeL=new Od({context:this.context}),this._delayNodeR=new Od({context:this.context}),this.frequency=this._lfoL.frequency,Gp(this,["frequency"]),this._lfoL.frequency.connect(this._lfoR.frequency),this.connectEffectLeft(this._delayNodeL),this.connectEffectRight(this._delayNodeR),this._lfoL.connect(this._delayNodeL.delayTime),this._lfoR.connect(this._delayNodeR.delayTime),this.depth=this._depth,this.type=t.type,this.spread=t.spread}static getDefaults(){return Object.assign(R_.getDefaults(),{frequency:1.5,delayTime:3.5,depth:.7,type:"sine",spread:180,feedback:0,wet:.5})}get depth(){return this._depth}set depth(t){this._depth=t;t=this._delayTime*t;this._lfoL.min=Math.max(this._delayTime-t,0),this._lfoL.max=this._delayTime+t,this._lfoR.min=Math.max(this._delayTime-t,0),this._lfoR.max=this._delayTime+t}get delayTime(){return 1e3*this._delayTime}set delayTime(t){this._delayTime=t/1e3,this.depth=this._depth}get type(){return this._lfoL.type}set type(t){this._lfoL.type=t,this._lfoR.type=t}get spread(){return this._lfoR.phase-this._lfoL.phase}set spread(t){this._lfoL.phase=90-t/2,this._lfoR.phase=t/2+90}start(t){return this._lfoL.start(t),this._lfoR.start(t),this}stop(t){return this._lfoL.stop(t),this._lfoR.stop(t),this}sync(){return this._lfoL.sync(),this._lfoR.sync(),this}unsync(){return this._lfoL.unsync(),this._lfoR.unsync(),this}dispose(){return super.dispose(),this._lfoL.dispose(),this._lfoR.dispose(),this._delayNodeL.dispose(),this._delayNodeR.dispose(),this.frequency.dispose(),this}}class F_ extends v_{constructor(){super(Cp(F_.getDefaults(),arguments,["distortion"])),this.name="Distortion";var t=Cp(F_.getDefaults(),arguments,["distortion"]);this._shaper=new Kd({context:this.context,length:4096}),this._distortion=t.distortion,this.connectEffect(this._shaper),this.distortion=t.distortion,this.oversample=t.oversample}static getDefaults(){return Object.assign(v_.getDefaults(),{distortion:.4,oversample:"none"})}get distortion(){return this._distortion}set distortion(t){const e=100*(this._distortion=t),s=Math.PI/180;this._shaper.setMap(t=>Math.abs(t)<.001?0:(3+e)*t*20*s/(Math.PI+e*Math.abs(t)))}get oversample(){return this._shaper.oversample}set oversample(t){this._shaper.oversample=t}dispose(){return super.dispose(),this._shaper.dispose(),this}}class I_ extends v_{constructor(t){super(t),this.name="FeedbackEffect",this._feedbackGain=new xd({context:this.context,gain:t.feedback,units:"normalRange"}),this.feedback=this._feedbackGain.gain,Gp(this,"feedback"),this.effectReturn.chain(this._feedbackGain,this.effectSend)}static getDefaults(){return Object.assign(v_.getDefaults(),{feedback:.125})}dispose(){return super.dispose(),this._feedbackGain.dispose(),this.feedback.dispose(),this}}class V_ extends I_{constructor(){super(Cp(V_.getDefaults(),arguments,["delayTime","feedback"])),this.name="FeedbackDelay";var t=Cp(V_.getDefaults(),arguments,["delayTime","feedback"]);this._delayNode=new Od({context:this.context,delayTime:t.delayTime,maxDelay:t.maxDelay}),this.delayTime=this._delayNode.delayTime,this.connectEffect(this._delayNode),Gp(this,"delayTime")}static getDefaults(){return Object.assign(I_.getDefaults(),{delayTime:.25,maxDelay:1})}dispose(){return super.dispose(),this._delayNode.dispose(),this.delayTime.dispose(),this}}class N_ extends md{constructor(t){super(t),this.name="PhaseShiftAllpass",this.input=new xd({context:this.context}),this.output=new xd({context:this.context}),this.offset90=new xd({context:this.context}),this._bank0=this._createAllPassFilterBank([.6923878,.9360654322959,.988229522686,.9987488452737]),this._bank1=this._createAllPassFilterBank([.4021921162426,.856171088242,.9722909545651,.9952884791278]),this._oneSampleDelay=this.context.createIIRFilter([0,1],[1,0]),gd(this.input,...this._bank0,this._oneSampleDelay,this.output),gd(this.input,...this._bank1,this.offset90)}_createAllPassFilterBank(t){return t.map(t=>{t=[[t*t,0,-1],[1,0,-t*t]];return this.context.createIIRFilter(t[0],t[1])})}dispose(){return super.dispose(),this.input.dispose(),this.output.dispose(),this.offset90.dispose(),this._bank0.forEach(t=>t.disconnect()),this._bank1.forEach(t=>t.disconnect()),this._oneSampleDelay.disconnect(),this}}class P_ extends v_{constructor(){super(Cp(P_.getDefaults(),arguments,["frequency"])),this.name="FrequencyShifter";var t=Cp(P_.getDefaults(),arguments,["frequency"]);this.frequency=new Td({context:this.context,units:"frequency",value:t.frequency,minValue:-this.context.sampleRate/2,maxValue:this.context.sampleRate/2}),this._sine=new $d({context:this.context,type:"sine"}),this._cosine=new Hd({context:this.context,phase:-90,type:"sine"}),this._sineMultiply=new ef({context:this.context}),this._cosineMultiply=new ef({context:this.context}),this._negate=new wf({context:this.context}),this._add=new lf({context:this.context}),this._phaseShifter=new N_({context:this.context}),this.effectSend.connect(this._phaseShifter),this.frequency.fan(this._sine.frequency,this._cosine.frequency),this._phaseShifter.offset90.connect(this._cosineMultiply),this._cosine.connect(this._cosineMultiply.factor),this._phaseShifter.connect(this._sineMultiply),this._sine.connect(this._sineMultiply.factor),this._sineMultiply.connect(this._negate),this._cosineMultiply.connect(this._add),this._negate.connect(this._add.addend),this._add.connect(this.effectReturn);t=this.immediate();this._sine.start(t),this._cosine.start(t)}static getDefaults(){return Object.assign(v_.getDefaults(),{frequency:0})}dispose(){return super.dispose(),this.frequency.dispose(),this._add.dispose(),this._cosine.dispose(),this._cosineMultiply.dispose(),this._negate.dispose(),this._phaseShifter.dispose(),this._sine.dispose(),this._sineMultiply.dispose(),this}}const j_=[1557/44100,1617/44100,1491/44100,1422/44100,1277/44100,1356/44100,1188/44100,1116/44100],L_=[225,556,441,341];class z_ extends E_{constructor(){super(Cp(z_.getDefaults(),arguments,["roomSize","dampening"])),this.name="Freeverb",this._combFilters=[],this._allpassFiltersL=[],this._allpassFiltersR=[];const s=Cp(z_.getDefaults(),arguments,["roomSize","dampening"]);this.roomSize=new Td({context:this.context,value:s.roomSize,units:"normalRange"}),this._allpassFiltersL=L_.map(t=>{const e=this.context.createBiquadFilter();return e.type="allpass",e.frequency.value=t,e}),this._allpassFiltersR=L_.map(t=>{const e=this.context.createBiquadFilter();return e.type="allpass",e.frequency.value=t,e}),this._combFilters=j_.map((t,e)=>{t=new Kf({context:this.context,dampening:s.dampening,delayTime:t});return et.dampening=e)}dispose(){return super.dispose(),this._allpassFiltersL.forEach(t=>t.disconnect()),this._allpassFiltersR.forEach(t=>t.disconnect()),this._combFilters.forEach(t=>t.dispose()),this.roomSize.dispose(),this}}const W_=[.06748,.06404,.08212,.09004],B_=[.773,.802,.753,.733],U_=[347,113,37];class G_ extends E_{constructor(){super(Cp(G_.getDefaults(),arguments,["roomSize"])),this.name="JCReverb",this._allpassFilters=[],this._feedbackCombFilters=[];var t=Cp(G_.getDefaults(),arguments,["roomSize"]);this.roomSize=new Td({context:this.context,value:t.roomSize,units:"normalRange"}),this._scaleRoomSize=new uf({context:this.context,min:-.733,max:.197}),this._allpassFilters=U_.map(t=>{const e=this.context.createBiquadFilter();return e.type="allpass",e.frequency.value=t,e}),this._feedbackCombFilters=W_.map((t,e)=>{const s=new Hf({context:this.context,delayTime:t});return this._scaleRoomSize.connect(s.resonance),s.resonance.value=B_[e],et.disconnect()),this._feedbackCombFilters.forEach(t=>t.dispose()),this.roomSize.dispose(),this._scaleRoomSize.dispose(),this}}class Q_ extends R_{constructor(t){super(t),this._feedbackL.disconnect(),this._feedbackL.connect(this._feedbackMerge,0,1),this._feedbackR.disconnect(),this._feedbackR.connect(this._feedbackMerge,0,0),Gp(this,["feedback"])}}class Z_ extends Q_{constructor(){super(Cp(Z_.getDefaults(),arguments,["delayTime","feedback"])),this.name="PingPongDelay";var t=Cp(Z_.getDefaults(),arguments,["delayTime","feedback"]);this._leftDelay=new Od({context:this.context,maxDelay:t.maxDelay}),this._rightDelay=new Od({context:this.context,maxDelay:t.maxDelay}),this._rightPreDelay=new Od({context:this.context,maxDelay:t.maxDelay}),this.delayTime=new Td({context:this.context,units:"time",value:t.delayTime}),this.connectEffectLeft(this._leftDelay),this.connectEffectRight(this._rightPreDelay,this._rightDelay),this.delayTime.fan(this._leftDelay.delayTime,this._rightDelay.delayTime,this._rightPreDelay.delayTime),this._feedbackL.disconnect(),this._feedbackL.connect(this._rightDelay),Gp(this,["delayTime"])}static getDefaults(){return Object.assign(Q_.getDefaults(),{delayTime:.25,maxDelay:1})}dispose(){return super.dispose(),this._leftDelay.dispose(),this._rightDelay.dispose(),this._rightPreDelay.dispose(),this.delayTime.dispose(),this}}class X_ extends I_{constructor(){super(Cp(X_.getDefaults(),arguments,["pitch"])),this.name="PitchShift";var t=Cp(X_.getDefaults(),arguments,["pitch"]);this._frequency=new Td({context:this.context}),this._delayA=new Od({maxDelay:1,context:this.context}),this._lfoA=new df({context:this.context,min:0,max:.1,type:"sawtooth"}).connect(this._delayA.delayTime),this._delayB=new Od({maxDelay:1,context:this.context}),this._lfoB=new df({context:this.context,min:0,max:.1,type:"sawtooth",phase:180}).connect(this._delayB.delayTime),this._crossFade=new g_({context:this.context}),this._crossFadeLFO=new df({context:this.context,min:0,max:1,type:"triangle",phase:90}).connect(this._crossFade.fade),this._feedbackDelay=new Od({delayTime:t.delayTime,context:this.context}),this.delayTime=this._feedbackDelay.delayTime,Gp(this,"delayTime"),this._pitch=t.pitch,this._windowSize=t.windowSize,this._delayA.connect(this._crossFade.a),this._delayB.connect(this._crossFade.b),this._frequency.fan(this._lfoA.frequency,this._lfoB.frequency,this._crossFadeLFO.frequency),this.effectSend.fan(this._delayA,this._delayB),this._crossFade.chain(this._feedbackDelay,this.effectReturn);t=this.now();this._lfoA.start(t),this._lfoB.start(t),this._crossFadeLFO.start(t),this.windowSize=this._windowSize}static getDefaults(){return Object.assign(I_.getDefaults(),{pitch:0,windowSize:.1,delayTime:0,feedback:0})}get pitch(){return this._pitch}set pitch(t){this._pitch=t;let e=0;e=t<0?(this._lfoA.min=0,this._lfoA.max=this._windowSize,this._lfoB.min=0,this._lfoB.max=this._windowSize,sd(t-1)+1):(this._lfoA.min=this._windowSize,this._lfoA.max=0,this._lfoB.min=this._windowSize,this._lfoB.max=0,sd(t)-1),this._frequency.value=e*(1.2/this._windowSize)}get windowSize(){return this._windowSize}set windowSize(t){this._windowSize=this.toSeconds(t),this.pitch=this._pitch}dispose(){return super.dispose(),this._frequency.dispose(),this._delayA.dispose(),this._delayB.dispose(),this._lfoA.dispose(),this._lfoB.dispose(),this._crossFade.dispose(),this._crossFadeLFO.dispose(),this._feedbackDelay.dispose(),this}}class Y_ extends E_{constructor(){super(Cp(Y_.getDefaults(),arguments,["frequency","octaves","baseFrequency"])),this.name="Phaser";var t=Cp(Y_.getDefaults(),arguments,["frequency","octaves","baseFrequency"]);this._lfoL=new df({context:this.context,frequency:t.frequency,min:0,max:1}),this._lfoR=new df({context:this.context,frequency:t.frequency,min:0,max:1,phase:180}),this._baseFrequency=this.toFrequency(t.baseFrequency),this._octaves=t.octaves,this.Q=new Td({context:this.context,value:t.Q,units:"positive"}),this._filtersL=this._makeFilters(t.stages,this._lfoL),this._filtersR=this._makeFilters(t.stages,this._lfoR),this.frequency=this._lfoL.frequency,this.frequency.value=t.frequency,this.connectEffectLeft(...this._filtersL),this.connectEffectRight(...this._filtersR),this._lfoL.frequency.connect(this._lfoR.frequency),this.baseFrequency=t.baseFrequency,this.octaves=t.octaves,this._lfoL.start(),this._lfoR.start(),Gp(this,["frequency","Q"])}static getDefaults(){return Object.assign(E_.getDefaults(),{frequency:.5,octaves:3,stages:10,Q:10,baseFrequency:350})}_makeFilters(e,s){const n=[];for(let t=0;tt.disconnect()),this._filtersR.forEach(t=>t.disconnect()),this.frequency.dispose(),this}}class $_ extends v_{constructor(){super(Cp($_.getDefaults(),arguments,["decay"])),this.name="Reverb",this._convolver=this.context.createConvolver(),this.ready=Promise.resolve();var t=Cp($_.getDefaults(),arguments,["decay"]);this._decay=t.decay,this._preDelay=t.preDelay,this.generate(),this.connectEffect(this._convolver)}static getDefaults(){return Object.assign(v_.getDefaults(),{decay:1.5,preDelay:.01})}get decay(){return this._decay}set decay(t){ap(t=this.toSeconds(t),.001),this._decay=t,this.generate()}get preDelay(){return this._preDelay}set preDelay(t){ap(t=this.toSeconds(t),0),this._preDelay=t,this.generate()}generate(){return yp(this,void 0,void 0,function*(){const t=this.ready,e=new Yp(2,this._decay+this._preDelay,this.context.sampleRate),s=new Ud({context:e}),n=new Ud({context:e}),i=new M_({context:e});s.connect(i,0,0),n.connect(i,0,1);const r=new xd({context:e}).toDestination();i.connect(r),s.start(0),n.start(0),r.gain.setValueAtTime(0,0),r.gain.setValueAtTime(1,this._preDelay),r.gain.exponentialApproachValueAtTime(0,this._preDelay,this.decay);const o=e.render();return this.ready=o.then(Zp),yield t,this._convolver.buffer=(yield o).get(),this})}dispose(){return super.dispose(),this._convolver.disconnect(),this}}class H_ extends md{constructor(){super(Cp(H_.getDefaults(),arguments)),this.name="MidSideSplit",this._split=this.input=new O_({channels:2,context:this.context}),this._midAdd=new lf({context:this.context}),this.mid=new ef({context:this.context,value:Math.SQRT1_2}),this._sideSubtract=new bf({context:this.context}),this.side=new ef({context:this.context,value:Math.SQRT1_2}),this._split.connect(this._midAdd,0),this._split.connect(this._midAdd.addend,1),this._split.connect(this._sideSubtract,0),this._split.connect(this._sideSubtract.subtrahend,1),this._midAdd.connect(this.mid),this._sideSubtract.connect(this.side)}dispose(){return super.dispose(),this.mid.dispose(),this.side.dispose(),this._midAdd.dispose(),this._sideSubtract.dispose(),this._split.dispose(),this}}class J_ extends md{constructor(){super(Cp(J_.getDefaults(),arguments)),this.name="MidSideMerge",this.mid=new xd({context:this.context}),this.side=new xd({context:this.context}),this._left=new lf({context:this.context}),this._leftMult=new ef({context:this.context,value:Math.SQRT1_2}),this._right=new bf({context:this.context}),this._rightMult=new ef({context:this.context,value:Math.SQRT1_2}),this._merge=this.output=new M_({context:this.context}),this.mid.fan(this._left),this.side.connect(this._left.addend),this.mid.connect(this._right),this.side.connect(this._right.subtrahend),this._left.connect(this._leftMult),this._right.connect(this._rightMult),this._leftMult.connect(this._merge,0,0),this._rightMult.connect(this._merge,0,1)}dispose(){return super.dispose(),this.mid.dispose(),this.side.dispose(),this._leftMult.dispose(),this._rightMult.dispose(),this._left.dispose(),this._right.dispose(),this}}class K_ extends v_{constructor(t){super(t),this.name="MidSideEffect",this._midSideMerge=new J_({context:this.context}),this._midSideSplit=new H_({context:this.context}),this._midSend=this._midSideSplit.mid,this._sideSend=this._midSideSplit.side,this._midReturn=this._midSideMerge.mid,this._sideReturn=this._midSideMerge.side,this.effectSend.connect(this._midSideSplit),this._midSideMerge.connect(this.effectReturn)}connectEffectMid(...t){this._midSend.chain(...t,this._midReturn)}connectEffectSide(...t){this._sideSend.chain(...t,this._sideReturn)}dispose(){return super.dispose(),this._midSideSplit.dispose(),this._midSideMerge.dispose(),this._midSend.dispose(),this._sideSend.dispose(),this._midReturn.dispose(),this._sideReturn.dispose(),this}}class tm extends K_{constructor(){super(Cp(tm.getDefaults(),arguments,["width"])),this.name="StereoWidener";var t=Cp(tm.getDefaults(),arguments,["width"]);this.width=new Td({context:this.context,value:t.width,units:"normalRange"}),Gp(this,["width"]),this._twoTimesWidthMid=new ef({context:this.context,value:2}),this._twoTimesWidthSide=new ef({context:this.context,value:2}),this._midMult=new ef({context:this.context}),this._twoTimesWidthMid.connect(this._midMult.factor),this.connectEffectMid(this._midMult),this._oneMinusWidth=new bf({context:this.context}),this._oneMinusWidth.connect(this._twoTimesWidthMid),vd(this.context.getConstant(1),this._oneMinusWidth),this.width.connect(this._oneMinusWidth.subtrahend),this._sideMult=new ef({context:this.context}),this.width.connect(this._twoTimesWidthSide),this._twoTimesWidthSide.connect(this._sideMult.factor),this.connectEffectSide(this._sideMult)}static getDefaults(){return Object.assign(K_.getDefaults(),{width:.5})}dispose(){return super.dispose(),this.width.dispose(),this._midMult.dispose(),this._sideMult.dispose(),this._twoTimesWidthMid.dispose(),this._twoTimesWidthSide.dispose(),this._oneMinusWidth.dispose(),this}}class em extends E_{constructor(){super(Cp(em.getDefaults(),arguments,["frequency","depth"])),this.name="Tremolo";var t=Cp(em.getDefaults(),arguments,["frequency","depth"]);this._lfoL=new df({context:this.context,type:t.type,min:1,max:0}),this._lfoR=new df({context:this.context,type:t.type,min:1,max:0}),this._amplitudeL=new xd({context:this.context}),this._amplitudeR=new xd({context:this.context}),this.frequency=new Td({context:this.context,value:t.frequency,units:"frequency"}),this.depth=new Td({context:this.context,value:t.depth,units:"normalRange"}),Gp(this,["frequency","depth"]),this.connectEffectLeft(this._amplitudeL),this.connectEffectRight(this._amplitudeR),this._lfoL.connect(this._amplitudeL.gain),this._lfoR.connect(this._amplitudeR.gain),this.frequency.fan(this._lfoL.frequency,this._lfoR.frequency),this.depth.fan(this._lfoR.amplitude,this._lfoL.amplitude),this.spread=t.spread}static getDefaults(){return Object.assign(E_.getDefaults(),{frequency:10,type:"sine",depth:.5,spread:180})}start(t){return this._lfoL.start(t),this._lfoR.start(t),this}stop(t){return this._lfoL.stop(t),this._lfoR.stop(t),this}sync(){return this._lfoL.sync(),this._lfoR.sync(),this.context.transport.syncSignal(this.frequency),this}unsync(){return this._lfoL.unsync(),this._lfoR.unsync(),this.context.transport.unsyncSignal(this.frequency),this}get type(){return this._lfoL.type}set type(t){this._lfoL.type=t,this._lfoR.type=t}get spread(){return this._lfoR.phase-this._lfoL.phase}set spread(t){this._lfoL.phase=90-t/2,this._lfoR.phase=t/2+90}dispose(){return super.dispose(),this._lfoL.dispose(),this._lfoR.dispose(),this._amplitudeL.dispose(),this._amplitudeR.dispose(),this.frequency.dispose(),this.depth.dispose(),this}}class sm extends v_{constructor(){super(Cp(sm.getDefaults(),arguments,["frequency","depth"])),this.name="Vibrato";var t=Cp(sm.getDefaults(),arguments,["frequency","depth"]);this._delayNode=new Od({context:this.context,delayTime:0,maxDelay:t.maxDelay}),this._lfo=new df({context:this.context,type:t.type,min:0,max:t.maxDelay,frequency:t.frequency,phase:-90}).start().connect(this._delayNode.delayTime),this.frequency=this._lfo.frequency,this.depth=this._lfo.amplitude,this.depth.value=t.depth,Gp(this,["frequency","depth"]),this.effectSend.chain(this._delayNode,this.effectReturn)}static getDefaults(){return Object.assign(v_.getDefaults(),{maxDelay:.005,frequency:5,depth:.1,type:"sine"})}get type(){return this._lfo.type}set type(t){this._lfo.type=t}dispose(){return super.dispose(),this._delayNode.dispose(),this._lfo.dispose(),this.frequency.dispose(),this.depth.dispose(),this}}class nm extends md{constructor(){super(Cp(nm.getDefaults(),arguments,["type","size"])),this.name="Analyser",this._analysers=[],this._buffers=[];var e=Cp(nm.getDefaults(),arguments,["type","size"]);this.input=this.output=this._gain=new xd({context:this.context}),this._split=new O_({context:this.context,channels:e.channels}),this.input.connect(this._split),ap(e.channels,1);for(let t=0;t{e=this._buffers[e];"fft"===this._type?t.getFloatFrequencyData(e):"waveform"===this._type&&t.getFloatTimeDomainData(e)}),1===this.channels?this._buffers[0]:this._buffers}get size(){return this._analysers[0].frequencyBinCount}set size(s){this._analysers.forEach((t,e)=>{t.fftSize=2*s,this._buffers[e]=new Float32Array(s)})}get channels(){return this._analysers.length}get type(){return this._type}set type(t){op("waveform"===t||"fft"===t,`Analyser: invalid type: ${t}`),this._type=t}get smoothing(){return this._analysers[0].smoothingTimeConstant}set smoothing(e){this._analysers.forEach(t=>t.smoothingTimeConstant=e)}dispose(){return super.dispose(),this._analysers.forEach(t=>t.disconnect()),this._split.dispose(),this._gain.dispose(),this}}class im extends md{constructor(){super(Cp(im.getDefaults(),arguments)),this.name="MeterBase",this.input=this.output=this._analyser=new nm({context:this.context,size:256,type:"waveform"})}dispose(){return super.dispose(),this._analyser.dispose(),this}}class rm extends im{constructor(){super(Cp(rm.getDefaults(),arguments,["smoothing"])),this.name="Meter",this._rms=0;var t=Cp(rm.getDefaults(),arguments,["smoothing"]);this.input=this.output=this._analyser=new nm({context:this.context,size:256,type:"waveform",channels:t.channelCount}),this.smoothing=t.smoothing,this.normalRange=t.normalRange}static getDefaults(){return Object.assign(im.getDefaults(),{smoothing:.8,normalRange:!1,channelCount:1})}getLevel(){return _p("'getLevel' has been changed to 'getValue'"),this.getValue()}getValue(){const t=this._analyser.getValue(),e=(1===this.channels?[t]:t).map(t=>{var e=t.reduce((t,e)=>t+e*e,0),t=Math.sqrt(e/t.length);return this._rms=Math.max(t,this._rms*this.smoothing),this.normalRange?this._rms:ed(this._rms)});return 1===this.channels?e[0]:e}get channels(){return this._analyser.channels}dispose(){return super.dispose(),this._analyser.dispose(),this}}class om extends im{constructor(){super(Cp(om.getDefaults(),arguments,["size"])),this.name="FFT";var t=Cp(om.getDefaults(),arguments,["size"]);this.normalRange=t.normalRange,this._analyser.type="fft",this.size=t.size}static getDefaults(){return Object.assign(md.getDefaults(),{normalRange:!1,size:1024,smoothing:.8})}getValue(){return this._analyser.getValue().map(t=>this.normalRange?td(t):t)}get size(){return this._analyser.size}set size(t){this._analyser.size=t}get smoothing(){return this._analyser.smoothing}set smoothing(t){this._analyser.smoothing=t}getFrequencyOfIndex(t){return op(0<=t&&tt._updateSolo())}get muted(){return 0===this.input.gain.value}_addSolo(){cm._soloed.has(this.context)||cm._soloed.set(this.context,new Set),cm._soloed.get(this.context).add(this)}_removeSolo(){cm._soloed.has(this.context)&&cm._soloed.get(this.context).delete(this)}_isSoloed(){return cm._soloed.has(this.context)&&cm._soloed.get(this.context).has(this)}_noSolos(){return!cm._soloed.has(this.context)||cm._soloed.has(this.context)&&0===cm._soloed.get(this.context).size}_updateSolo(){this._isSoloed()||this._noSolos()?this.input.gain.value=1:this.input.gain.value=0}dispose(){return super.dispose(),cm._allSolos.get(this.context).delete(this),this._removeSolo(),this}}cm._allSolos=new Map,cm._soloed=new Map;class lm extends md{constructor(){super(Cp(lm.getDefaults(),arguments,["pan","volume"])),this.name="PanVol";var t=Cp(lm.getDefaults(),arguments,["pan","volume"]);this._panner=this.input=new w_({context:this.context,pan:t.pan,channelCount:t.channelCount}),this.pan=this._panner.pan,this._volume=this.output=new Vd({context:this.context,volume:t.volume}),this.volume=this._volume.volume,this._panner.connect(this._volume),this.mute=t.mute,Gp(this,["pan","volume"])}static getDefaults(){return Object.assign(md.getDefaults(),{mute:!1,pan:0,volume:0,channelCount:1})}get mute(){return this._volume.mute}set mute(t){this._volume.mute=t}dispose(){return super.dispose(),this._panner.dispose(),this.pan.dispose(),this._volume.dispose(),this.volume.dispose(),this}}class um extends md{constructor(){super(Cp(um.getDefaults(),arguments,["volume","pan"])),this.name="Channel";var t=Cp(um.getDefaults(),arguments,["volume","pan"]);this._solo=this.input=new cm({solo:t.solo,context:this.context}),this._panVol=this.output=new lm({context:this.context,pan:t.pan,volume:t.volume,mute:t.mute,channelCount:t.channelCount}),this.pan=this._panVol.pan,this.volume=this._panVol.volume,this._solo.connect(this._panVol),Gp(this,["pan","volume"])}static getDefaults(){return Object.assign(md.getDefaults(),{pan:0,volume:0,mute:!1,solo:!1,channelCount:1})}get solo(){return this._solo.solo}set solo(t){this._solo.solo=t}get muted(){return this._solo.muted||this.mute}get mute(){return this._panVol.mute}set mute(t){this._panVol.mute=t}_getBus(t){return um.buses.has(t)||um.buses.set(t,new xd({context:this.context})),um.buses.get(t)}send(t,e=0){const s=this._getBus(t),n=new xd({context:this.context,units:"decibels",gain:e});return this.connect(n),n.connect(s),n}receive(t){return this._getBus(t).connect(this),this}dispose(){return super.dispose(),this._panVol.dispose(),this.pan.dispose(),this.volume.dispose(),this._solo.dispose(),this}}um.buses=new Map;class pm extends md{constructor(){super(Cp(pm.getDefaults(),arguments)),this.name="Mono",this.input=new xd({context:this.context}),this._merge=this.output=new M_({channels:2,context:this.context}),this.input.connect(this._merge,0,0),this.input.connect(this._merge,0,1)}dispose(){return super.dispose(),this._merge.dispose(),this.input.dispose(),this}}class dm extends md{constructor(){super(Cp(dm.getDefaults(),arguments,["lowFrequency","highFrequency"])),this.name="MultibandSplit",this.input=new xd({context:this.context}),this.output=void 0,this.low=new Nf({context:this.context,frequency:0,type:"lowpass"}),this._lowMidFilter=new Nf({context:this.context,frequency:0,type:"highpass"}),this.mid=new Nf({context:this.context,frequency:0,type:"lowpass"}),this.high=new Nf({context:this.context,frequency:0,type:"highpass"}),this._internalChannels=[this.low,this.mid,this.high];var t=Cp(dm.getDefaults(),arguments,["lowFrequency","highFrequency"]);this.lowFrequency=new Td({context:this.context,units:"frequency",value:t.lowFrequency}),this.highFrequency=new Td({context:this.context,units:"frequency",value:t.highFrequency}),this.Q=new Td({context:this.context,units:"positive",value:t.Q}),this.input.fan(this.low,this.high),this.input.chain(this._lowMidFilter,this.mid),this.lowFrequency.fan(this.low.frequency,this._lowMidFilter.frequency),this.highFrequency.fan(this.mid.frequency,this.high.frequency),this.Q.connect(this.low.Q),this.Q.connect(this._lowMidFilter.Q),this.Q.connect(this.mid.Q),this.Q.connect(this.high.Q),Gp(this,["high","mid","low","highFrequency","lowFrequency"])}static getDefaults(){return Object.assign(md.getDefaults(),{Q:1,highFrequency:2500,lowFrequency:400})}dispose(){return super.dispose(),Qp(this,["high","mid","low","highFrequency","lowFrequency"]),this.low.dispose(),this._lowMidFilter.dispose(),this.mid.dispose(),this.high.dispose(),this.lowFrequency.dispose(),this.highFrequency.dispose(),this.Q.dispose(),this}}class fm extends md{constructor(){super(...arguments),this.name="Listener",this.positionX=new _d({context:this.context,param:this.context.rawContext.listener.positionX}),this.positionY=new _d({context:this.context,param:this.context.rawContext.listener.positionY}),this.positionZ=new _d({context:this.context,param:this.context.rawContext.listener.positionZ}),this.forwardX=new _d({context:this.context,param:this.context.rawContext.listener.forwardX}),this.forwardY=new _d({context:this.context,param:this.context.rawContext.listener.forwardY}),this.forwardZ=new _d({context:this.context,param:this.context.rawContext.listener.forwardZ}),this.upX=new _d({context:this.context,param:this.context.rawContext.listener.upX}),this.upY=new _d({context:this.context,param:this.context.rawContext.listener.upY}),this.upZ=new _d({context:this.context,param:this.context.rawContext.listener.upZ})}static getDefaults(){return Object.assign(md.getDefaults(),{positionX:0,positionY:0,positionZ:0,forwardX:0,forwardY:0,forwardZ:-1,upX:0,upY:1,upZ:0})}dispose(){return super.dispose(),this.positionX.dispose(),this.positionY.dispose(),this.positionZ.dispose(),this.forwardX.dispose(),this.forwardY.dispose(),this.forwardZ.dispose(),this.upX.dispose(),this.upY.dispose(),this.upZ.dispose(),this}}jp(t=>{t.listener=new fm({context:t})}),zp(t=>{t.listener.dispose()});class _m extends md{constructor(){super(Cp(_m.getDefaults(),arguments,["positionX","positionY","positionZ"])),this.name="Panner3D";var t=Cp(_m.getDefaults(),arguments,["positionX","positionY","positionZ"]);this._panner=this.input=this.output=this.context.createPanner(),this.panningModel=t.panningModel,this.maxDistance=t.maxDistance,this.distanceModel=t.distanceModel,this.coneOuterGain=t.coneOuterGain,this.coneOuterAngle=t.coneOuterAngle,this.coneInnerAngle=t.coneInnerAngle,this.refDistance=t.refDistance,this.rolloffFactor=t.rolloffFactor,this.positionX=new _d({context:this.context,param:this._panner.positionX,value:t.positionX}),this.positionY=new _d({context:this.context,param:this._panner.positionY,value:t.positionY}),this.positionZ=new _d({context:this.context,param:this._panner.positionZ,value:t.positionZ}),this.orientationX=new _d({context:this.context,param:this._panner.orientationX,value:t.orientationX}),this.orientationY=new _d({context:this.context,param:this._panner.orientationY,value:t.orientationY}),this.orientationZ=new _d({context:this.context,param:this._panner.orientationZ,value:t.orientationZ})}static getDefaults(){return Object.assign(md.getDefaults(),{coneInnerAngle:360,coneOuterAngle:360,coneOuterGain:0,distanceModel:"inverse",maxDistance:1e4,orientationX:0,orientationY:0,orientationZ:0,panningModel:"equalpower",positionX:0,positionY:0,positionZ:0,refDistance:1,rolloffFactor:1})}setPosition(t,e,s){return this.positionX.value=t,this.positionY.value=e,this.positionZ.value=s,this}setOrientation(t,e,s){return this.orientationX.value=t,this.orientationY.value=e,this.orientationZ.value=s,this}get panningModel(){return this._panner.panningModel}set panningModel(t){this._panner.panningModel=t}get refDistance(){return this._panner.refDistance}set refDistance(t){this._panner.refDistance=t}get rolloffFactor(){return this._panner.rolloffFactor}set rolloffFactor(t){this._panner.rolloffFactor=t}get distanceModel(){return this._panner.distanceModel}set distanceModel(t){this._panner.distanceModel=t}get coneInnerAngle(){return this._panner.coneInnerAngle}set coneInnerAngle(t){this._panner.coneInnerAngle=t}get coneOuterAngle(){return this._panner.coneOuterAngle}set coneOuterAngle(t){this._panner.coneOuterAngle=t}get coneOuterGain(){return this._panner.coneOuterGain}set coneOuterGain(t){this._panner.coneOuterGain=t}get maxDistance(){return this._panner.maxDistance}set maxDistance(t){this._panner.maxDistance=t}dispose(){return super.dispose(),this._panner.disconnect(),this.orientationX.dispose(),this.orientationY.dispose(),this.orientationZ.dispose(),this.positionX.dispose(),this.positionY.dispose(),this.positionZ.dispose(),this}}class mm extends md{constructor(){super(Cp(mm.getDefaults(),arguments)),this.name="Recorder";var t=Cp(mm.getDefaults(),arguments);this.input=new xd({context:this.context}),op(mm.supported,"Media Recorder API is not available"),this._stream=this.context.createMediaStreamDestination(),this.input.connect(this._stream),this._recorder=new MediaRecorder(this._stream.stream,{mimeType:t.mimeType})}static getDefaults(){return md.getDefaults()}get mimeType(){return this._recorder.mimeType}static get supported(){return null!==mp&&Reflect.has(mp,"MediaRecorder")}get state(){return"inactive"===this._recorder.state?"stopped":"paused"===this._recorder.state?"paused":"started"}start(){return yp(this,void 0,void 0,function*(){op("started"!==this.state,"Recorder is already started");var t=new Promise(t=>{const e=()=>{this._recorder.removeEventListener("start",e,!1),t()};this._recorder.addEventListener("start",e,!1)});return this._recorder.start(),yield t})}stop(){return yp(this,void 0,void 0,function*(){op("stopped"!==this.state,"Recorder is not started");var t=new Promise(e=>{const s=t=>{this._recorder.removeEventListener("dataavailable",s,!1),e(t.data)};this._recorder.addEventListener("dataavailable",s,!1)});return this._recorder.stop(),yield t})}pause(){return op("started"===this.state,"Recorder must be started"),this._recorder.pause(),this}dispose(){return super.dispose(),this.input.dispose(),this._stream.disconnect(),this}}class gm extends md{constructor(){super(Cp(gm.getDefaults(),arguments,["threshold","ratio"])),this.name="Compressor",this._compressor=this.context.createDynamicsCompressor(),this.input=this._compressor,this.output=this._compressor;var t=Cp(gm.getDefaults(),arguments,["threshold","ratio"]);this.threshold=new _d({minValue:this._compressor.threshold.minValue,maxValue:this._compressor.threshold.maxValue,context:this.context,convert:!1,param:this._compressor.threshold,units:"decibels",value:t.threshold}),this.attack=new _d({minValue:this._compressor.attack.minValue,maxValue:this._compressor.attack.maxValue,context:this.context,param:this._compressor.attack,units:"time",value:t.attack}),this.release=new _d({minValue:this._compressor.release.minValue,maxValue:this._compressor.release.maxValue,context:this.context,param:this._compressor.release,units:"time",value:t.release}),this.knee=new _d({minValue:this._compressor.knee.minValue,maxValue:this._compressor.knee.maxValue,context:this.context,convert:!1,param:this._compressor.knee,units:"decibels",value:t.knee}),this.ratio=new _d({minValue:this._compressor.ratio.minValue,maxValue:this._compressor.ratio.maxValue,context:this.context,convert:!1,param:this._compressor.ratio,units:"positive",value:t.ratio}),Gp(this,["knee","release","attack","ratio","threshold"])}static getDefaults(){return Object.assign(md.getDefaults(),{attack:.003,knee:30,ratio:12,release:.25,threshold:-24})}get reduction(){return this._compressor.reduction}dispose(){return super.dispose(),this._compressor.disconnect(),this.attack.dispose(),this.release.dispose(),this.threshold.dispose(),this.ratio.dispose(),this.knee.dispose(),this}}class vm extends md{constructor(){super(Object.assign(Cp(vm.getDefaults(),arguments,["threshold","smoothing"]))),this.name="Gate";var t=Cp(vm.getDefaults(),arguments,["threshold","smoothing"]);this._follower=new T_({context:this.context,smoothing:t.smoothing}),this._gt=new Sf({context:this.context,value:td(t.threshold)}),this.input=new xd({context:this.context}),this._gate=this.output=new xd({context:this.context}),this.input.connect(this._gate),this.input.chain(this._follower,this._gt,this._gate.gain)}static getDefaults(){return Object.assign(md.getDefaults(),{smoothing:.1,threshold:-40})}get threshold(){return ed(this._gt.value)}set threshold(t){this._gt.value=td(t)}get smoothing(){return this._follower.smoothing}set smoothing(t){this._follower.smoothing=t}dispose(){return super.dispose(),this.input.dispose(),this._follower.dispose(),this._gt.dispose(),this._gate.dispose(),this}}class ym extends md{constructor(){super(Object.assign(Cp(ym.getDefaults(),arguments,["threshold"]))),this.name="Limiter";var t=Cp(ym.getDefaults(),arguments,["threshold"]);this._compressor=this.input=this.output=new gm({context:this.context,ratio:20,attack:.003,release:.01,threshold:t.threshold}),this.threshold=this._compressor.threshold,Gp(this,"threshold")}static getDefaults(){return Object.assign(md.getDefaults(),{threshold:-12})}get reduction(){return this._compressor.reduction}dispose(){return super.dispose(),this._compressor.dispose(),this.threshold.dispose(),this}}class xm extends md{constructor(){super(Object.assign(Cp(xm.getDefaults(),arguments))),this.name="MidSideCompressor";var t=Cp(xm.getDefaults(),arguments);this._midSideSplit=this.input=new H_({context:this.context}),this._midSideMerge=this.output=new J_({context:this.context}),this.mid=new gm(Object.assign(t.mid,{context:this.context})),this.side=new gm(Object.assign(t.side,{context:this.context})),this._midSideSplit.mid.chain(this.mid,this._midSideMerge.mid),this._midSideSplit.side.chain(this.side,this._midSideMerge.side),Gp(this,["mid","side"])}static getDefaults(){return Object.assign(md.getDefaults(),{mid:{ratio:3,threshold:-24,release:.03,attack:.02,knee:16},side:{ratio:6,threshold:-30,release:.25,attack:.03,knee:10}})}dispose(){return super.dispose(),this.mid.dispose(),this.side.dispose(),this._midSideSplit.dispose(),this._midSideMerge.dispose(),this}}class wm extends md{constructor(){super(Object.assign(Cp(wm.getDefaults(),arguments))),this.name="MultibandCompressor";var t=Cp(wm.getDefaults(),arguments);this._splitter=this.input=new dm({context:this.context,lowFrequency:t.lowFrequency,highFrequency:t.highFrequency}),this.lowFrequency=this._splitter.lowFrequency,this.highFrequency=this._splitter.highFrequency,this.output=new xd({context:this.context}),this.low=new gm(Object.assign(t.low,{context:this.context})),this.mid=new gm(Object.assign(t.mid,{context:this.context})),this.high=new gm(Object.assign(t.high,{context:this.context})),this._splitter.low.chain(this.low,this.output),this._splitter.mid.chain(this.mid,this.output),this._splitter.high.chain(this.high,this.output),Gp(this,["high","mid","low","highFrequency","lowFrequency"])}static getDefaults(){return Object.assign(md.getDefaults(),{lowFrequency:250,highFrequency:2e3,low:{ratio:6,threshold:-30,release:.25,attack:.03,knee:10},mid:{ratio:3,threshold:-24,release:.03,attack:.02,knee:16},high:{ratio:3,threshold:-24,release:.03,attack:.02,knee:16}})}dispose(){return super.dispose(),this._splitter.dispose(),this.low.dispose(),this.mid.dispose(),this.high.dispose(),this.output.dispose(),this}}class bm extends md{constructor(){super(Cp(bm.getDefaults(),arguments,["low","mid","high"])),this.name="EQ3",this.output=new xd({context:this.context}),this._internalChannels=[];var t=Cp(bm.getDefaults(),arguments,["low","mid","high"]);this.input=this._multibandSplit=new dm({context:this.context,highFrequency:t.highFrequency,lowFrequency:t.lowFrequency}),this._lowGain=new xd({context:this.context,gain:t.low,units:"decibels"}),this._midGain=new xd({context:this.context,gain:t.mid,units:"decibels"}),this._highGain=new xd({context:this.context,gain:t.high,units:"decibels"}),this.low=this._lowGain.gain,this.mid=this._midGain.gain,this.high=this._highGain.gain,this.Q=this._multibandSplit.Q,this.lowFrequency=this._multibandSplit.lowFrequency,this.highFrequency=this._multibandSplit.highFrequency,this._multibandSplit.low.chain(this._lowGain,this.output),this._multibandSplit.mid.chain(this._midGain,this.output),this._multibandSplit.high.chain(this._highGain,this.output),Gp(this,["low","mid","high","lowFrequency","highFrequency"]),this._internalChannels=[this._multibandSplit]}static getDefaults(){return Object.assign(md.getDefaults(),{high:0,highFrequency:2500,low:0,lowFrequency:400,mid:0})}dispose(){return super.dispose(),Qp(this,["low","mid","high","lowFrequency","highFrequency"]),this._multibandSplit.dispose(),this.lowFrequency.dispose(),this.highFrequency.dispose(),this._lowGain.dispose(),this._midGain.dispose(),this._highGain.dispose(),this.low.dispose(),this.mid.dispose(),this.high.dispose(),this.Q.dispose(),this}}class Tm extends md{constructor(){super(Cp(Tm.getDefaults(),arguments,["url","onload"])),this.name="Convolver",this._convolver=this.context.createConvolver();const e=Cp(Tm.getDefaults(),arguments,["url","onload"]);this._buffer=new Xp(e.url,t=>{this.buffer=t,e.onload()}),this.input=new xd({context:this.context}),this.output=new xd({context:this.context}),this._buffer.loaded&&(this.buffer=this._buffer),this.normalize=e.normalize,this.input.chain(this._convolver,this.output)}static getDefaults(){return Object.assign(md.getDefaults(),{normalize:!0,onload:Zp})}load(t){return yp(this,void 0,void 0,function*(){this.buffer=yield this._buffer.load(t)})}get buffer(){return this._buffer.length?this._buffer:null}set buffer(t){t&&this._buffer.set(t),this._convolver.buffer&&(this.input.disconnect(),this._convolver.disconnect(),this._convolver=this.context.createConvolver(),this.input.chain(this._convolver,this.output));t=this._buffer.get();this._convolver.buffer=t||null}get normalize(){return this._convolver.normalize}set normalize(t){this._convolver.normalize=t}dispose(){return super.dispose(),this._buffer.dispose(),this._convolver.disconnect(),this}}const Sm=Jp().transport;const km=Jp().destination,Am=Jp().destination;const Cm=Jp().listener;const Dm=Jp().draw;const Om=Jp();const Mm=Xp,Em=Md,Rm=Bd})(),Fm})()});
\ No newline at end of file
diff --git a/public/js/p5-v0.3.11.sound.min.js b/public/js/p5-v0.3.11.sound.min.js
new file mode 100644
index 0000000..899f447
--- /dev/null
+++ b/public/js/p5-v0.3.11.sound.min.js
@@ -0,0 +1,28 @@
+/*! p5.sound.min.js v0.3.11 2019-03-14 */
+
+/**
+ * p5.sound
+ * https://p5js.org/reference/#/libraries/p5.sound
+ *
+ * From the Processing Foundation and contributors
+ * https://github.com/processing/p5.js-sound/graphs/contributors
+ *
+ * MIT License (MIT)
+ * https://github.com/processing/p5.js-sound/blob/master/LICENSE
+ *
+ * Some of the many audio libraries & resources that inspire p5.sound:
+ * - TONE.js (c) Yotam Mann. Licensed under The MIT License (MIT). https://github.com/TONEnoTONE/Tone.js
+ * - buzz.js (c) Jay Salvat. Licensed under The MIT License (MIT). http://buzz.jaysalvat.com/
+ * - Boris Smus Web Audio API book, 2013. Licensed under the Apache License http://www.apache.org/licenses/LICENSE-2.0
+ * - wavesurfer.js https://github.com/katspaugh/wavesurfer.js
+ * - Web Audio Components by Jordan Santell https://github.com/web-audio-components
+ * - Wilm Thoben's Sound library for Processing https://github.com/processing/processing/tree/master/java/libraries/sound
+ *
+ * Web Audio API: http://w3.org/TR/webaudio/
+ */
+
+!function(t,e){"function"==typeof define&&define.amd?define("p5.sound",["p5"],function(t){e(t)}):e("object"==typeof exports?require("../p5"):t.p5)}(this,function(t){var e;e=function(){!function(){function t(t){t&&(t.setTargetAtTime||(t.setTargetAtTime=t.setTargetValueAtTime))}window.hasOwnProperty("webkitAudioContext")&&!window.hasOwnProperty("AudioContext")&&(window.AudioContext=window.webkitAudioContext,"function"!=typeof AudioContext.prototype.createGain&&(AudioContext.prototype.createGain=AudioContext.prototype.createGainNode),"function"!=typeof AudioContext.prototype.createDelay&&(AudioContext.prototype.createDelay=AudioContext.prototype.createDelayNode),"function"!=typeof AudioContext.prototype.createScriptProcessor&&(AudioContext.prototype.createScriptProcessor=AudioContext.prototype.createJavaScriptNode),"function"!=typeof AudioContext.prototype.createPeriodicWave&&(AudioContext.prototype.createPeriodicWave=AudioContext.prototype.createWaveTable),AudioContext.prototype.internal_createGain=AudioContext.prototype.createGain,AudioContext.prototype.createGain=function(){var e=this.internal_createGain();return t(e.gain),e},AudioContext.prototype.internal_createDelay=AudioContext.prototype.createDelay,AudioContext.prototype.createDelay=function(e){var i=e?this.internal_createDelay(e):this.internal_createDelay();return t(i.delayTime),i},AudioContext.prototype.internal_createBufferSource=AudioContext.prototype.createBufferSource,AudioContext.prototype.createBufferSource=function(){var e=this.internal_createBufferSource();return e.start?(e.internal_start=e.start,e.start=function(t,i,n){"undefined"!=typeof n?e.internal_start(t||0,i,n):e.internal_start(t||0,i||0)}):e.start=function(t,e,i){e||i?this.noteGrainOn(t||0,e,i):this.noteOn(t||0)},e.stop?(e.internal_stop=e.stop,e.stop=function(t){e.internal_stop(t||0)}):e.stop=function(t){this.noteOff(t||0)},t(e.playbackRate),e},AudioContext.prototype.internal_createDynamicsCompressor=AudioContext.prototype.createDynamicsCompressor,AudioContext.prototype.createDynamicsCompressor=function(){var e=this.internal_createDynamicsCompressor();return t(e.threshold),t(e.knee),t(e.ratio),t(e.reduction),t(e.attack),t(e.release),e},AudioContext.prototype.internal_createBiquadFilter=AudioContext.prototype.createBiquadFilter,AudioContext.prototype.createBiquadFilter=function(){var e=this.internal_createBiquadFilter();return t(e.frequency),t(e.detune),t(e.Q),t(e.gain),e},"function"!=typeof AudioContext.prototype.createOscillator&&(AudioContext.prototype.internal_createOscillator=AudioContext.prototype.createOscillator,AudioContext.prototype.createOscillator=function(){var e=this.internal_createOscillator();return e.start?(e.internal_start=e.start,e.start=function(t){e.internal_start(t||0)}):e.start=function(t){this.noteOn(t||0)},e.stop?(e.internal_stop=e.stop,e.stop=function(t){e.internal_stop(t||0)}):e.stop=function(t){this.noteOff(t||0)},e.setPeriodicWave||(e.setPeriodicWave=e.setWaveTable),t(e.frequency),t(e.detune),e})),window.hasOwnProperty("webkitOfflineAudioContext")&&!window.hasOwnProperty("OfflineAudioContext")&&(window.OfflineAudioContext=window.webkitOfflineAudioContext)}(window),navigator.getUserMedia=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia;var e=document.createElement("audio");t.prototype.isSupported=function(){return!!e.canPlayType};var i=function(){return!!e.canPlayType&&e.canPlayType('audio/ogg; codecs="vorbis"')},n=function(){return!!e.canPlayType&&e.canPlayType("audio/mpeg;")},o=function(){return!!e.canPlayType&&e.canPlayType('audio/wav; codecs="1"')},r=function(){return!!e.canPlayType&&(e.canPlayType("audio/x-m4a;")||e.canPlayType("audio/aac;"))},s=function(){return!!e.canPlayType&&e.canPlayType("audio/x-aiff;")};t.prototype.isFileSupported=function(t){switch(t.toLowerCase()){case"mp3":return n();case"wav":return o();case"ogg":return i();case"aac":case"m4a":case"mp4":return r();case"aif":case"aiff":return s();default:return!1}}}();var i;!function(t,e){i=function(){return e()}()}(this,function(){function t(t){var e=t.createBuffer(1,1,t.sampleRate),i=t.createBufferSource();i.buffer=e,i.connect(t.destination),i.start(0),t.resume&&t.resume()}function e(t){return"running"===t.state}function i(t,i){function n(){e(t)?i():(requestAnimationFrame(n),t.resume&&t.resume())}e(t)?i():n()}function n(t,e,i){if(Array.isArray(t)||NodeList&&t instanceof NodeList)for(var o=0;o1&&(this.input=new Array(t)),this.isUndef(e)||1===e?this.output=this.context.createGain():e>1&&(this.output=new Array(t))};t.prototype.set=function(e,i,n){if(this.isObject(e))n=i;else if(this.isString(e)){var o={};o[e]=i,e=o}t:for(var r in e){i=e[r];var s=this;if(-1!==r.indexOf(".")){for(var a=r.split("."),u=0;u1)for(var t=arguments[0],e=1;e0)for(var t=this,e=0;e0)for(var t=0;tn;n++)i[n].apply(this,e)}return this},t.Emitter.mixin=function(e){var i=["on","off","emit"];e._events={};for(var n=0;n1?t.getChannelData(1):e;var s=i(e,r),a=new window.ArrayBuffer(44+2*s.length),u=new window.DataView(a);n(u,0,"RIFF"),u.setUint32(4,36+2*s.length,!0),n(u,8,"WAVE"),n(u,12,"fmt "),u.setUint32(16,16,!0),u.setUint16(20,1,!0),u.setUint16(22,2,!0),u.setUint32(24,o.audiocontext.sampleRate,!0),u.setUint32(28,4*o.audiocontext.sampleRate,!0),u.setUint16(32,4,!0),u.setUint16(34,16,!0),n(u,36,"data"),u.setUint32(40,2*s.length,!0);for(var c=s.length,p=44,h=1,l=0;c>l;l++)u.setInt16(p,s[l]*(32767*h),!0),p+=2;return u}function i(t,e){for(var i=t.length+e.length,n=new Float32Array(i),o=0,r=0;i>r;)n[r++]=t[o],n[r++]=e[o],o++;return n}function n(t,e,i){for(var n=i.length,o=0;n>o;o++)t.setUint8(e+o,i.charCodeAt(o))}var o=a;t.prototype.sampleRate=function(){return o.audiocontext.sampleRate},t.prototype.freqToMidi=function(t){var e=Math.log(t/440)/Math.log(2),i=Math.round(12*e)+69;return i};var r=t.prototype.midiToFreq=function(t){return 440*Math.pow(2,(t-69)/12)},s=function(t){if("string"!=typeof t)return t;var e={A:21,B:23,C:24,D:26,E:28,F:29,G:31},i=e[t[0].toUpperCase()],n=~~t.slice(-1);switch(i+=12*(n-1),t[1]){case"#":i+=1;break;case"b":i-=1}return r(i)};return t.prototype.soundFormats=function(){o.extensions=[];for(var t=0;t-1))throw arguments[t]+" is not a valid sound format!";o.extensions.push(arguments[t])}},t.prototype.disposeSound=function(){for(var t=0;t-1)if(t.prototype.isFileSupported(n))i=i;else for(var r=i.split("."),s=r[r.length-1],a=0;a1?(this.splitter=i.createChannelSplitter(2),this.input.connect(this.splitter),this.splitter.connect(this.left,1),this.splitter.connect(this.right,0)):(this.input.connect(this.left),this.input.connect(this.right)),this.output=i.createChannelMerger(2),this.left.connect(this.output,0,1),this.right.connect(this.output,0,0),this.output.connect(e)},t.Panner.prototype.pan=function(t,e){var n=e||0,o=i.currentTime+n,r=(t+1)/2,s=Math.cos(r*Math.PI/2),a=Math.sin(r*Math.PI/2);this.left.gain.linearRampToValueAtTime(a,o),this.right.gain.linearRampToValueAtTime(s,o)},t.Panner.prototype.inputChannels=function(t){1===t?(this.input.disconnect(),this.input.connect(this.left),this.input.connect(this.right)):2===t&&(this.splitter=i.createChannelSplitter(2),this.input.disconnect(),this.input.connect(this.splitter),this.splitter.connect(this.left,1),this.splitter.connect(this.right,0))},t.Panner.prototype.connect=function(t){this.output.connect(t)},t.Panner.prototype.disconnect=function(){this.output&&this.output.disconnect()})}(a);var h;h=function(){function e(t,e){for(var i={},n=t.length,o=0;n>o;o++){if(t[o]>e){var r=t[o],s=new v(r,o);i[o]=s,o+=6e3}o++}return i}function i(t){for(var e=[],i=Object.keys(t).sort(),n=0;no;o++){var r=t[i[n]],s=t[i[n+o]];if(r&&s){var a=r.sampleIndex,u=s.sampleIndex,c=u-a;c>0&&r.intervals.push(c);var p=e.some(function(t){return t.interval===c?(t.count++,t):void 0});p||e.push({interval:c,count:1})}}return e}function n(t,e){var i=[];return t.forEach(function(t){try{var n=Math.abs(60/(t.interval/e));n=r(n);var o=i.some(function(e){return e.tempo===n?e.count+=t.count:void 0});if(!o){if(isNaN(n))return;i.push({tempo:Math.round(n),count:t.count})}}catch(s){throw s}}),i}function o(t,e,i,n){for(var o=[],s=Object.keys(t).sort(),a=0;a.01?!0:void 0})}function r(t){if(isFinite(t)&&0!==t){for(;90>t;)t*=2;for(;t>180&&t>90;)t/=2;return t}}function s(t){var e=t.inputBuffer.getChannelData(0);this._lastPos=e[e.length-1]||0,this._onTimeUpdate(self._lastPos)}function p(t){const e=t.target,i=this;e._playing=!1,e.removeEventListener("ended",i._clearOnEnd),i._onended(i),i.bufferSourceNodes.forEach(function(t,e){t._playing===!1&&i.bufferSourceNodes.splice(e)}),0===i.bufferSourceNodes.length&&(i._playing=!1)}var h=c,l=a,f=l.audiocontext,d=u.midiToFreq,m=u.convertToWav;t.SoundFile=function(e,i,n,o){if("undefined"!=typeof e){if("string"==typeof e||"string"==typeof e[0]){var r=t.prototype._checkFileFormats(e);this.url=r}else if("object"==typeof e&&!(window.File&&window.FileReader&&window.FileList&&window.Blob))throw"Unable to load file because the File API is not supported";e.file&&(e=e.file),this.file=e}this._onended=function(){},this._looping=!1,this._playing=!1,this._paused=!1,this._pauseTime=0,this._cues=[],this._cueIDCounter=0,this._lastPos=0,this._counterNode=null,this._scopeNode=null,this.bufferSourceNodes=[],this.bufferSourceNode=null,this.buffer=null,this.playbackRate=1,this.input=l.audiocontext.createGain(),this.output=l.audiocontext.createGain(),this.reversed=!1,this.startTime=0,this.endTime=null,this.pauseTime=0,this.mode="sustain",this.startMillis=null,this.panPosition=0,this.panner=new t.Panner(this.output,l.input,2),(this.url||this.file)&&this.load(i,n),l.soundArray.push(this),"function"==typeof o?this._whileLoading=o:this._whileLoading=function(){},this._onAudioProcess=s.bind(this),this._clearOnEnd=p.bind(this)},t.prototype.registerPreloadMethod("loadSound",t.prototype),t.prototype.loadSound=function(e,i,n,o){window.location.origin.indexOf("file://")>-1&&"undefined"===window.cordova&&window.alert("This sketch may require a server to load external files. Please see http://bit.ly/1qcInwS");var r=this,s=new t.SoundFile(e,function(){"function"==typeof i&&i.apply(r,arguments),"function"==typeof r._decrementPreload&&r._decrementPreload()},n,o);return s},t.SoundFile.prototype.load=function(t,e){var i=this,n=(new Error).stack;if(void 0!==this.url&&""!==this.url){var o=new XMLHttpRequest;o.addEventListener("progress",function(t){i._updateProgress(t)},!1),o.open("GET",this.url,!0),o.responseType="arraybuffer",o.onload=function(){if(200===o.status){if(!i.panner)return;f.decodeAudioData(o.response,function(e){i.panner&&(i.buffer=e,i.panner.inputChannels(e.numberOfChannels),t&&t(i))},function(){if(i.panner){var t=new h("decodeAudioData",n,i.url),o="AudioContext error at decodeAudioData for "+i.url;e?(t.msg=o,e(t)):console.error(o+"\n The error stack trace includes: \n"+t.stack)}})}else{if(!i.panner)return;var r=new h("loadSound",n,i.url),s="Unable to load "+i.url+". The request status was: "+o.status+" ("+o.statusText+")";e?(r.message=s,e(r)):console.error(s+"\n The error stack trace includes: \n"+r.stack)}},o.onerror=function(){var t=new h("loadSound",n,i.url),o="There was no response from the server at "+i.url+". Check the url and internet connectivity.";e?(t.message=o,e(t)):console.error(o+"\n The error stack trace includes: \n"+t.stack)},o.send()}else if(void 0!==this.file){var r=new FileReader;r.onload=function(){i.panner&&f.decodeAudioData(r.result,function(e){i.panner&&(i.buffer=e,i.panner.inputChannels(e.numberOfChannels),t&&t(i))})},r.onerror=function(t){i.panner&&onerror&&onerror(t)},r.readAsArrayBuffer(this.file)}},t.SoundFile.prototype._updateProgress=function(t){if(t.lengthComputable){var e=t.loaded/t.total*.99;this._whileLoading(e,t)}else this._whileLoading("size unknown")},t.SoundFile.prototype.isLoaded=function(){return this.buffer?!0:!1},t.SoundFile.prototype.play=function(t,e,i,n,o){if(!this.output)return void console.warn("SoundFile.play() called after dispose");var r,s,a=l.audiocontext.currentTime,u=t||0;if(0>u&&(u=0),u+=a,"undefined"!=typeof e&&this.rate(e),"undefined"!=typeof i&&this.setVolume(i),!this.buffer)throw"not ready to play file, buffer has yet to load. Try preload()";if(this._pauseTime=0,"restart"===this.mode&&this.buffer&&this.bufferSourceNode&&(this.bufferSourceNode.stop(u),this._counterNode.stop(u)),"untildone"!==this.mode||!this.isPlaying()){if(this.bufferSourceNode=this._initSourceNode(),delete this._counterNode,this._counterNode=this._initCounterNode(),n){if(!(n>=0&&nt&&!this.reversed?(t=Math.abs(t),e=!0):t>0&&this.reversed&&(e=!0),this.bufferSourceNode){var i=l.audiocontext.currentTime;this.bufferSourceNode.playbackRate.cancelScheduledValues(i),this.bufferSourceNode.playbackRate.linearRampToValueAtTime(Math.abs(t),i),this._counterNode.playbackRate.cancelScheduledValues(i),this._counterNode.playbackRate.linearRampToValueAtTime(Math.abs(t),i)}return e&&this.reverseBuffer(),this.playbackRate},t.SoundFile.prototype.setPitch=function(t){var e=d(t)/d(60);this.rate(e)},t.SoundFile.prototype.getPlaybackRate=function(){return this.playbackRate},t.SoundFile.prototype.duration=function(){return this.buffer?this.buffer.duration:0},t.SoundFile.prototype.currentTime=function(){return this.reversed?Math.abs(this._lastPos-this.buffer.length)/f.sampleRate:this._lastPos/f.sampleRate},t.SoundFile.prototype.jump=function(t,e){if(0>t||t>this.buffer.duration)throw"jump time out of range";if(e>this.buffer.duration-t)throw"end time out of range";var i=t||0,n=e||void 0;this.isPlaying()&&this.stop(0),this.play(0,this.playbackRate,this.output.gain.value,i,n);
+},t.SoundFile.prototype.channels=function(){return this.buffer.numberOfChannels},t.SoundFile.prototype.sampleRate=function(){return this.buffer.sampleRate},t.SoundFile.prototype.frames=function(){return this.buffer.length},t.SoundFile.prototype.getPeaks=function(t){if(!this.buffer)throw"Cannot load peaks yet, buffer is not loaded";if(t||(t=5*window.width),this.buffer){for(var e=this.buffer,i=e.length/t,n=~~(i/10)||1,o=e.numberOfChannels,r=new Float32Array(Math.round(t)),s=0;o>s;s++)for(var a=e.getChannelData(s),u=0;t>u;u++){for(var c=~~(u*i),p=~~(c+i),h=0,l=c;p>l;l+=n){var f=a[l];f>h?h=f:-f>h&&(h=f)}(0===s||Math.abs(h)>r[u])&&(r[u]=h)}return r}},t.SoundFile.prototype.reverseBuffer=function(){if(!this.buffer)throw"SoundFile is not done loading";var t=this._lastPos/f.sampleRate,e=this.getVolume();this.setVolume(0,.001);const i=this.buffer.numberOfChannels;for(var n=0;i>n;n++)this.buffer.getChannelData(n).reverse();this.reversed=!this.reversed,t&&this.jump(this.duration()-t),this.setVolume(e,.001)},t.SoundFile.prototype.onended=function(t){return this._onended=t,this},t.SoundFile.prototype.add=function(){},t.SoundFile.prototype.dispose=function(){var t=l.audiocontext.currentTime,e=l.soundArray.indexOf(this);if(l.soundArray.splice(e,1),this.stop(t),this.buffer&&this.bufferSourceNode){for(var i=0;io;o++){var r=n.getChannelData(o);r.set(t[o])}this.buffer=n,this.panner.inputChannels(e)};var y=function(t){const e=t.length,i=f.createBuffer(1,t.length,f.sampleRate),n=i.getChannelData(0);for(var o=0;e>o;o++)n[o]=o;return i};t.SoundFile.prototype._initCounterNode=function(){var e=this,i=f.currentTime,n=f.createBufferSource();return e._scopeNode&&(e._scopeNode.disconnect(),e._scopeNode.removeEventListener("audioprocess",e._onAudioProcess),delete e._scopeNode),e._scopeNode=f.createScriptProcessor(256,1,1),n.buffer=y(e.buffer),n.playbackRate.setValueAtTime(e.playbackRate,i),n.connect(e._scopeNode),e._scopeNode.connect(t.soundOut._silentNode),e._scopeNode.addEventListener("audioprocess",e._onAudioProcess),n},t.SoundFile.prototype._initSourceNode=function(){var t=f.createBufferSource();return t.buffer=this.buffer,t.playbackRate.value=this.playbackRate,t.connect(this.output),t},t.SoundFile.prototype.processPeaks=function(t,r,s,a){var u=this.buffer.length,c=this.buffer.sampleRate,p=this.buffer,h=[],l=r||.9,f=l,d=s||.22,m=a||200,y=new window.OfflineAudioContext(1,u,c),v=y.createBufferSource();v.buffer=p;var g=y.createBiquadFilter();g.type="lowpass",v.connect(g),g.connect(y.destination),v.start(0),y.startRendering(),y.oncomplete=function(r){if(self.panner){var s=r.renderedBuffer,a=s.getChannelData(0);do h=e(a,f),f-=.005;while(Object.keys(h).length=d);var u=i(h),c=n(u,s.sampleRate),p=c.sort(function(t,e){return e.count-t.count}).splice(0,5);this.tempo=p[0].tempo;var l=5,y=o(h,p[0].tempo,s.sampleRate,l);t(y)}}};var v=function(t,e){this.sampleIndex=e,this.amplitude=t,this.tempos=[],this.intervals=[]},g=function(t,e,i,n){this.callback=t,this.time=e,this.id=i,this.val=n};t.SoundFile.prototype.addCue=function(t,e,i){var n=this._cueIDCounter++,o=new g(e,t,n,i);return this._cues.push(o),n},t.SoundFile.prototype.removeCue=function(t){for(var e=this._cues.length,i=0;e>i;i++){var n=this._cues[i];if(n.id===t){this._cues.splice(i,1);break}}0===this._cues.length},t.SoundFile.prototype.clearCues=function(){this._cues=[]},t.SoundFile.prototype._onTimeUpdate=function(t){for(var e=t/this.buffer.sampleRate,i=this._cues.length,n=0;i>n;n++){var o=this._cues[n],r=o.time,s=o.val;this._prevTime=r&&o.callback(s)}this._prevTime=e},t.SoundFile.prototype.save=function(e){const i=m(this.buffer);t.prototype.saveSound([i],e,"wav")},t.SoundFile.prototype.getBlob=function(){const t=m(this.buffer);return new Blob([t],{type:"audio/wav"})}}(c,a,u,u);var l;l=function(){var e=a;t.Amplitude=function(t){this.bufferSize=2048,this.audiocontext=e.audiocontext,this.processor=this.audiocontext.createScriptProcessor(this.bufferSize,2,1),this.input=this.processor,this.output=this.audiocontext.createGain(),this.smoothing=t||0,this.volume=0,this.average=0,this.stereoVol=[0,0],this.stereoAvg=[0,0],this.stereoVolNorm=[0,0],this.volMax=.001,this.normalize=!1,this.processor.onaudioprocess=this._audioProcess.bind(this),this.processor.connect(this.output),this.output.gain.value=0,this.output.connect(this.audiocontext.destination),e.meter.connect(this.processor),e.soundArray.push(this)},t.Amplitude.prototype.setInput=function(i,n){e.meter.disconnect(),n&&(this.smoothing=n),null==i?(console.log("Amplitude input source is not ready! Connecting to master output instead"),e.meter.connect(this.processor)):i instanceof t.Signal?i.output.connect(this.processor):i?(i.connect(this.processor),this.processor.disconnect(),this.processor.connect(this.output)):e.meter.connect(this.processor)},t.Amplitude.prototype.connect=function(t){t?t.hasOwnProperty("input")?this.output.connect(t.input):this.output.connect(t):this.output.connect(this.panner.connect(e.input))},t.Amplitude.prototype.disconnect=function(){this.output&&this.output.disconnect()},t.Amplitude.prototype._audioProcess=function(t){for(var e=0;ea;a++)i=n[a],this.normalize?(r+=Math.max(Math.min(i/this.volMax,1),-1),s+=Math.max(Math.min(i/this.volMax,1),-1)*Math.max(Math.min(i/this.volMax,1),-1)):(r+=i,s+=i*i);var u=r/o,c=Math.sqrt(s/o);this.stereoVol[e]=Math.max(c,this.stereoVol[e]*this.smoothing),this.stereoAvg[e]=Math.max(u,this.stereoVol[e]*this.smoothing),this.volMax=Math.max(this.stereoVol[e],this.volMax)}var p=this,h=this.stereoVol.reduce(function(t,e,i){return p.stereoVolNorm[i-1]=Math.max(Math.min(p.stereoVol[i-1]/p.volMax,1),0),p.stereoVolNorm[i]=Math.max(Math.min(p.stereoVol[i]/p.volMax,1),0),t+e});this.volume=h/this.stereoVol.length,this.volNorm=Math.max(Math.min(this.volume/this.volMax,1),0)},t.Amplitude.prototype.getLevel=function(t){return"undefined"!=typeof t?this.normalize?this.stereoVolNorm[t]:this.stereoVol[t]:this.normalize?this.volNorm:this.volume},t.Amplitude.prototype.toggleNormalize=function(t){"boolean"==typeof t?this.normalize=t:this.normalize=!this.normalize},t.Amplitude.prototype.smooth=function(t){t>=0&&1>t?this.smoothing=t:console.log("Error: smoothing must be between 0 and 1")},t.Amplitude.prototype.dispose=function(){var t=e.soundArray.indexOf(this);e.soundArray.splice(t,1),this.input&&(this.input.disconnect(),delete this.input),this.output&&(this.output.disconnect(),delete this.output),delete this.processor}}(a);var f;f=function(){var e=a;t.FFT=function(t,i){this.input=this.analyser=e.audiocontext.createAnalyser(),Object.defineProperties(this,{bins:{get:function(){return this.analyser.fftSize/2},set:function(t){this.analyser.fftSize=2*t},configurable:!0,enumerable:!0},smoothing:{get:function(){return this.analyser.smoothingTimeConstant},set:function(t){this.analyser.smoothingTimeConstant=t},configurable:!0,enumerable:!0}}),this.smooth(t),this.bins=i||1024,e.fftMeter.connect(this.analyser),this.freqDomain=new Uint8Array(this.analyser.frequencyBinCount),this.timeDomain=new Uint8Array(this.analyser.frequencyBinCount),this.bass=[20,140],this.lowMid=[140,400],this.mid=[400,2600],this.highMid=[2600,5200],this.treble=[5200,14e3],e.soundArray.push(this)},t.FFT.prototype.setInput=function(t){t?(t.output?t.output.connect(this.analyser):t.connect&&t.connect(this.analyser),e.fftMeter.disconnect()):e.fftMeter.connect(this.analyser)},t.FFT.prototype.waveform=function(){for(var e,i,n,s=0;si){var o=i;i=t,t=o}for(var r=Math.round(t/n*this.freqDomain.length),s=Math.round(i/n*this.freqDomain.length),a=0,u=0,c=r;s>=c;c++)a+=this.freqDomain[c],u+=1;var p=a/u;return p}throw"invalid input for getEnergy()"}var h=Math.round(t/n*this.freqDomain.length);return this.freqDomain[h]},t.FFT.prototype.getFreq=function(t,e){console.log("getFreq() is deprecated. Please use getEnergy() instead.");var i=this.getEnergy(t,e);return i},t.FFT.prototype.getCentroid=function(){for(var t=e.audiocontext.sampleRate/2,i=0,n=0,o=0;os;s++)o[r]=void 0!==o[r]?(o[r]+e[s])/2:e[s],s%n===n-1&&r++;return o},t.FFT.prototype.logAverages=function(t){for(var i=e.audiocontext.sampleRate/2,n=this.freqDomain,o=n.length,r=new Array(t.length),s=0,a=0;o>a;a++){var u=Math.round(a*i/this.freqDomain.length);u>t[s].hi&&s++,r[s]=void 0!==r[s]?(r[s]+n[a])/2:n[a]}return r},t.FFT.prototype.getOctaveBands=function(t,i){var t=t||3,i=i||15.625,n=[],o={lo:i/Math.pow(2,1/(2*t)),ctr:i,hi:i*Math.pow(2,1/(2*t))};n.push(o);for(var r=e.audiocontext.sampleRate/2;o.hie;e++){var n=e/(i-1)*2-1;this._curve[e]=t(n,e)}return this._shaper.curve=this._curve,this},Object.defineProperty(t.WaveShaper.prototype,"curve",{get:function(){return this._shaper.curve},set:function(t){this._curve=new Float32Array(t),this._shaper.curve=this._curve}}),Object.defineProperty(t.WaveShaper.prototype,"oversample",{get:function(){return this._shaper.oversample},set:function(t){if(-1===["none","2x","4x"].indexOf(t))throw new RangeError("Tone.WaveShaper: oversampling must be either 'none', '2x', or '4x'");this._shaper.oversample=t}}),t.WaveShaper.prototype.dispose=function(){return t.prototype.dispose.call(this),this._shaper.disconnect(),this._shaper=null,this._curve=null,this},t.WaveShaper}(n);var y;y=function(t){return t.TimeBase=function(e,i){if(!(this instanceof t.TimeBase))return new t.TimeBase(e,i);if(this._expr=this._noOp,e instanceof t.TimeBase)this.copy(e);else if(!this.isUndef(i)||this.isNumber(e)){i=this.defaultArg(i,this._defaultUnits);var n=this._primaryExpressions[i].method;this._expr=n.bind(this,e)}else this.isString(e)?this.set(e):this.isUndef(e)&&(this._expr=this._defaultExpr())},t.extend(t.TimeBase),t.TimeBase.prototype.set=function(t){return this._expr=this._parseExprString(t),this},t.TimeBase.prototype.clone=function(){var t=new this.constructor;return t.copy(this),t},t.TimeBase.prototype.copy=function(t){var e=t._expr();return this.set(e)},t.TimeBase.prototype._primaryExpressions={n:{regexp:/^(\d+)n/i,method:function(t){return t=parseInt(t),1===t?this._beatsToUnits(this._timeSignature()):this._beatsToUnits(4/t)}},t:{regexp:/^(\d+)t/i,method:function(t){return t=parseInt(t),this._beatsToUnits(8/(3*parseInt(t)))}},m:{regexp:/^(\d+)m/i,method:function(t){return this._beatsToUnits(parseInt(t)*this._timeSignature())}},i:{regexp:/^(\d+)i/i,method:function(t){return this._ticksToUnits(parseInt(t))}},hz:{regexp:/^(\d+(?:\.\d+)?)hz/i,method:function(t){return this._frequencyToUnits(parseFloat(t))}},tr:{regexp:/^(\d+(?:\.\d+)?):(\d+(?:\.\d+)?):?(\d+(?:\.\d+)?)?/,method:function(t,e,i){var n=0;return t&&"0"!==t&&(n+=this._beatsToUnits(this._timeSignature()*parseFloat(t))),e&&"0"!==e&&(n+=this._beatsToUnits(parseFloat(e))),i&&"0"!==i&&(n+=this._beatsToUnits(parseFloat(i)/4)),n}},s:{regexp:/^(\d+(?:\.\d+)?s)/,method:function(t){return this._secondsToUnits(parseFloat(t))}},samples:{regexp:/^(\d+)samples/,method:function(t){return parseInt(t)/this.context.sampleRate}},"default":{regexp:/^(\d+(?:\.\d+)?)/,method:function(t){return this._primaryExpressions[this._defaultUnits].method.call(this,t)}}},t.TimeBase.prototype._binaryExpressions={"+":{regexp:/^\+/,precedence:2,method:function(t,e){return t()+e()}},"-":{regexp:/^\-/,precedence:2,method:function(t,e){return t()-e()}},"*":{regexp:/^\*/,precedence:1,method:function(t,e){return t()*e()}},"/":{regexp:/^\//,precedence:1,method:function(t,e){return t()/e()}}},t.TimeBase.prototype._unaryExpressions={neg:{regexp:/^\-/,method:function(t){return-t()}}},t.TimeBase.prototype._syntaxGlue={"(":{regexp:/^\(/},")":{regexp:/^\)/}},t.TimeBase.prototype._tokenize=function(t){function e(t,e){for(var i=["_binaryExpressions","_unaryExpressions","_primaryExpressions","_syntaxGlue"],n=0;n0;){t=t.trim();var o=e(t,this);n.push(o),t=t.substr(o.value.length)}return{next:function(){return n[++i]},peek:function(){return n[i+1]}}},t.TimeBase.prototype._matchGroup=function(t,e,i){var n=!1;if(!this.isUndef(t))for(var o in e){var r=e[o];if(r.regexp.test(t.value)){if(this.isUndef(i))return r;if(r.precedence===i)return r}}return n},t.TimeBase.prototype._parseBinary=function(t,e){this.isUndef(e)&&(e=2);var i;i=0>e?this._parseUnary(t):this._parseBinary(t,e-1);for(var n=t.peek();n&&this._matchGroup(n,this._binaryExpressions,e);)n=t.next(),i=n.method.bind(this,i,this._parseBinary(t,e-1)),n=t.peek();return i},t.TimeBase.prototype._parseUnary=function(t){var e,i;e=t.peek();var n=this._matchGroup(e,this._unaryExpressions);return n?(e=t.next(),i=this._parseUnary(t),n.method.bind(this,i)):this._parsePrimary(t)},t.TimeBase.prototype._parsePrimary=function(t){var e,i;if(e=t.peek(),this.isUndef(e))throw new SyntaxError("Tone.TimeBase: Unexpected end of expression");if(this._matchGroup(e,this._primaryExpressions)){e=t.next();var n=e.value.match(e.regexp);return e.method.bind(this,n[1],n[2],n[3])}if(e&&"("===e.value){if(t.next(),i=this._parseBinary(t),e=t.next(),!e||")"!==e.value)throw new SyntaxError("Expected )");return i}throw new SyntaxError("Tone.TimeBase: Cannot process token "+e.value)},t.TimeBase.prototype._parseExprString=function(t){this.isString(t)||(t=t.toString());var e=this._tokenize(t),i=this._parseBinary(e);return i},t.TimeBase.prototype._noOp=function(){return 0},t.TimeBase.prototype._defaultExpr=function(){return this._noOp},t.TimeBase.prototype._defaultUnits="s",t.TimeBase.prototype._frequencyToUnits=function(t){return 1/t},t.TimeBase.prototype._beatsToUnits=function(e){return 60/t.Transport.bpm.value*e},t.TimeBase.prototype._secondsToUnits=function(t){return t},t.TimeBase.prototype._ticksToUnits=function(e){return e*(this._beatsToUnits(1)/t.Transport.PPQ)},t.TimeBase.prototype._timeSignature=function(){return t.Transport.timeSignature},t.TimeBase.prototype._pushExpr=function(e,i,n){return e instanceof t.TimeBase||(e=new this.constructor(e,n)),this._expr=this._binaryExpressions[i].method.bind(this,this._expr,e._expr),this},t.TimeBase.prototype.add=function(t,e){return this._pushExpr(t,"+",e)},t.TimeBase.prototype.sub=function(t,e){return this._pushExpr(t,"-",e)},t.TimeBase.prototype.mult=function(t,e){return this._pushExpr(t,"*",e)},t.TimeBase.prototype.div=function(t,e){return this._pushExpr(t,"/",e)},t.TimeBase.prototype.valueOf=function(){return this._expr()},t.TimeBase.prototype.dispose=function(){this._expr=null},t.TimeBase}(n);var v;v=function(t){return t.Time=function(e,i){return this instanceof t.Time?(this._plusNow=!1,void t.TimeBase.call(this,e,i)):new t.Time(e,i)},t.extend(t.Time,t.TimeBase),t.Time.prototype._unaryExpressions=Object.create(t.TimeBase.prototype._unaryExpressions),t.Time.prototype._unaryExpressions.quantize={regexp:/^@/,method:function(e){return t.Transport.nextSubdivision(e())}},t.Time.prototype._unaryExpressions.now={regexp:/^\+/,method:function(t){return this._plusNow=!0,t()}},t.Time.prototype.quantize=function(t,e){return e=this.defaultArg(e,1),this._expr=function(t,e,i){t=t(),e=e.toSeconds();var n=Math.round(t/e),o=n*e,r=o-t;return t+r*i}.bind(this,this._expr,new this.constructor(t),e),this},t.Time.prototype.addNow=function(){return this._plusNow=!0,this},t.Time.prototype._defaultExpr=function(){return this._plusNow=!0,this._noOp},t.Time.prototype.copy=function(e){return t.TimeBase.prototype.copy.call(this,e),this._plusNow=e._plusNow,this},t.Time.prototype.toNotation=function(){var t=this.toSeconds(),e=["1m","2n","4n","8n","16n","32n","64n","128n"],i=this._toNotationHelper(t,e),n=["1m","2n","2t","4n","4t","8n","8t","16n","16t","32n","32t","64n","64t","128n"],o=this._toNotationHelper(t,n);return o.split("+").length1-s%1&&(s+=a),s=Math.floor(s),s>0){if(n+=1===s?e[o]:s.toString()+"*"+e[o],t-=s*r,i>t)break;n+=" + "}}return""===n&&(n="0"),n},t.Time.prototype._notationToUnits=function(t){for(var e=this._primaryExpressions,i=[e.n,e.t,e.m],n=0;n3&&(n=parseFloat(n).toFixed(3));var o=[i,e,n];return o.join(":")},t.Time.prototype.toTicks=function(){var e=this._beatsToUnits(1),i=this.valueOf()/e;return Math.floor(i*t.Transport.PPQ)},t.Time.prototype.toSamples=function(){return this.toSeconds()*this.context.sampleRate},t.Time.prototype.toFrequency=function(){return 1/this.toSeconds()},t.Time.prototype.toSeconds=function(){return this.valueOf()},t.Time.prototype.toMilliseconds=function(){return 1e3*this.toSeconds()},t.Time.prototype.valueOf=function(){var t=this._expr();return t+(this._plusNow?this.now():0)},t.Time}(n);var g;g=function(t){t.Frequency=function(e,i){return this instanceof t.Frequency?void t.TimeBase.call(this,e,i):new t.Frequency(e,i)},t.extend(t.Frequency,t.TimeBase),t.Frequency.prototype._primaryExpressions=Object.create(t.TimeBase.prototype._primaryExpressions),t.Frequency.prototype._primaryExpressions.midi={regexp:/^(\d+(?:\.\d+)?midi)/,method:function(t){return this.midiToFrequency(t)}},t.Frequency.prototype._primaryExpressions.note={regexp:/^([a-g]{1}(?:b|#|x|bb)?)(-?[0-9]+)/i,method:function(t,i){var n=e[t.toLowerCase()],o=n+12*(parseInt(i)+1);return this.midiToFrequency(o)}},t.Frequency.prototype._primaryExpressions.tr={regexp:/^(\d+(?:\.\d+)?):(\d+(?:\.\d+)?):?(\d+(?:\.\d+)?)?/,method:function(t,e,i){var n=1;return t&&"0"!==t&&(n*=this._beatsToUnits(this._timeSignature()*parseFloat(t))),e&&"0"!==e&&(n*=this._beatsToUnits(parseFloat(e))),i&&"0"!==i&&(n*=this._beatsToUnits(parseFloat(i)/4)),n}},t.Frequency.prototype.transpose=function(t){return this._expr=function(t,e){var i=t();return i*this.intervalToFrequencyRatio(e)}.bind(this,this._expr,t),this},t.Frequency.prototype.harmonize=function(t){return this._expr=function(t,e){for(var i=t(),n=[],o=0;or&&(o+=-12*r);var s=i[o%12];return s+r.toString()},t.Frequency.prototype.toSeconds=function(){return 1/this.valueOf()},t.Frequency.prototype.toFrequency=function(){return this.valueOf()},t.Frequency.prototype.toTicks=function(){var e=this._beatsToUnits(1),i=this.valueOf()/e;return Math.floor(i*t.Transport.PPQ)},t.Frequency.prototype._frequencyToUnits=function(t){return t},t.Frequency.prototype._ticksToUnits=function(e){return 1/(60*e/(t.Transport.bpm.value*t.Transport.PPQ))},t.Frequency.prototype._beatsToUnits=function(e){return 1/t.TimeBase.prototype._beatsToUnits.call(this,e)},t.Frequency.prototype._secondsToUnits=function(t){return 1/t},t.Frequency.prototype._defaultUnits="hz";var e={cbb:-2,cb:-1,c:0,"c#":1,cx:2,dbb:0,db:1,d:2,"d#":3,dx:4,ebb:2,eb:3,e:4,"e#":5,ex:6,fbb:3,fb:4,f:5,"f#":6,fx:7,gbb:5,gb:6,g:7,"g#":8,gx:9,abb:7,ab:8,a:9,"a#":10,ax:11,bbb:9,bb:10,b:11,"b#":12,bx:13},i=["C","C#","D","D#","E","F","F#","G","G#","A","A#","B"];return t.Frequency.A4=440,t.Frequency.prototype.midiToFrequency=function(e){return t.Frequency.A4*Math.pow(2,(e-69)/12)},t.Frequency.prototype.frequencyToMidi=function(e){return 69+12*Math.log(e/t.Frequency.A4)/Math.LN2},t.Frequency}(n);var _;_=function(t){return t.TransportTime=function(e,i){return this instanceof t.TransportTime?void t.Time.call(this,e,i):new t.TransportTime(e,i)},t.extend(t.TransportTime,t.Time),t.TransportTime.prototype._unaryExpressions=Object.create(t.Time.prototype._unaryExpressions),t.TransportTime.prototype._unaryExpressions.quantize={regexp:/^@/,method:function(e){var i=this._secondsToTicks(e()),n=Math.ceil(t.Transport.ticks/i);return this._ticksToUnits(n*i)}},t.TransportTime.prototype._secondsToTicks=function(e){var i=this._beatsToUnits(1),n=e/i;return Math.round(n*t.Transport.PPQ)},t.TransportTime.prototype.valueOf=function(){var e=this._secondsToTicks(this._expr());return e+(this._plusNow?t.Transport.ticks:0)},t.TransportTime.prototype.toTicks=function(){return this.valueOf()},t.TransportTime.prototype.toSeconds=function(){var e=this._expr();return e+(this._plusNow?t.Transport.seconds:0)},t.TransportTime.prototype.toFrequency=function(){return 1/this.toSeconds()},t.TransportTime}(n);var T;T=function(t){return t.Type={Default:"number",Time:"time",Frequency:"frequency",TransportTime:"transportTime",Ticks:"ticks",NormalRange:"normalRange",AudioRange:"audioRange",Decibels:"db",Interval:"interval",BPM:"bpm",Positive:"positive",Cents:"cents",Degrees:"degrees",MIDI:"midi",BarsBeatsSixteenths:"barsBeatsSixteenths",Samples:"samples",Hertz:"hertz",Note:"note",Milliseconds:"milliseconds",Seconds:"seconds",Notation:"notation"},t.prototype.toSeconds=function(e){return this.isNumber(e)?e:this.isUndef(e)?this.now():this.isString(e)?new t.Time(e).toSeconds():e instanceof t.TimeBase?e.toSeconds():void 0},t.prototype.toFrequency=function(e){return this.isNumber(e)?e:this.isString(e)||this.isUndef(e)?new t.Frequency(e).valueOf():e instanceof t.TimeBase?e.toFrequency():void 0},t.prototype.toTicks=function(e){return this.isNumber(e)||this.isString(e)?new t.TransportTime(e).toTicks():this.isUndef(e)?t.Transport.ticks:e instanceof t.TimeBase?e.toTicks():void 0},t}(n,v,g,_);var b;b=function(t){"use strict";return t.Param=function(){var e=this.optionsObject(arguments,["param","units","convert"],t.Param.defaults);this._param=this.input=e.param,this.units=e.units,this.convert=e.convert,this.overridden=!1,this._lfo=null,this.isObject(e.lfo)?this.value=e.lfo:this.isUndef(e.value)||(this.value=e.value)},t.extend(t.Param),t.Param.defaults={units:t.Type.Default,convert:!0,param:void 0},Object.defineProperty(t.Param.prototype,"value",{get:function(){return this._toUnits(this._param.value)},set:function(e){if(this.isObject(e)){if(this.isUndef(t.LFO))throw new Error("Include 'Tone.LFO' to use an LFO as a Param value.");this._lfo&&this._lfo.dispose(),this._lfo=new t.LFO(e).start(),this._lfo.connect(this.input)}else{var i=this._fromUnits(e);this._param.cancelScheduledValues(0),this._param.value=i}}}),t.Param.prototype._fromUnits=function(e){if(!this.convert&&!this.isUndef(this.convert))return e;switch(this.units){case t.Type.Time:return this.toSeconds(e);case t.Type.Frequency:return this.toFrequency(e);case t.Type.Decibels:return this.dbToGain(e);case t.Type.NormalRange:return Math.min(Math.max(e,0),1);case t.Type.AudioRange:return Math.min(Math.max(e,-1),1);case t.Type.Positive:return Math.max(e,0);default:return e}},t.Param.prototype._toUnits=function(e){if(!this.convert&&!this.isUndef(this.convert))return e;switch(this.units){case t.Type.Decibels:return this.gainToDb(e);default:return e}},t.Param.prototype._minOutput=1e-5,t.Param.prototype.setValueAtTime=function(t,e){return t=this._fromUnits(t),e=this.toSeconds(e),e<=this.now()+this.blockTime?this._param.value=t:this._param.setValueAtTime(t,e),this},t.Param.prototype.setRampPoint=function(t){t=this.defaultArg(t,this.now());var e=this._param.value;return 0===e&&(e=this._minOutput),this._param.setValueAtTime(e,t),this},t.Param.prototype.linearRampToValueAtTime=function(t,e){return t=this._fromUnits(t),this._param.linearRampToValueAtTime(t,this.toSeconds(e)),this},t.Param.prototype.exponentialRampToValueAtTime=function(t,e){return t=this._fromUnits(t),t=Math.max(this._minOutput,t),this._param.exponentialRampToValueAtTime(t,this.toSeconds(e)),this},t.Param.prototype.exponentialRampToValue=function(t,e,i){return i=this.toSeconds(i),this.setRampPoint(i),this.exponentialRampToValueAtTime(t,i+this.toSeconds(e)),this},t.Param.prototype.linearRampToValue=function(t,e,i){return i=this.toSeconds(i),this.setRampPoint(i),this.linearRampToValueAtTime(t,i+this.toSeconds(e)),this},t.Param.prototype.setTargetAtTime=function(t,e,i){return t=this._fromUnits(t),t=Math.max(this._minOutput,t),i=Math.max(this._minOutput,i),this._param.setTargetAtTime(t,this.toSeconds(e),i),this},t.Param.prototype.setValueCurveAtTime=function(t,e,i){for(var n=0;n1&&(this.input=new Array(e)),1===i?this.output=new t.Gain:i>1&&(this.output=new Array(e))},t.Gain}(n,b);var S;S=function(t){"use strict";return t.Signal=function(){var e=this.optionsObject(arguments,["value","units"],t.Signal.defaults);this.output=this._gain=this.context.createGain(),e.param=this._gain.gain,t.Param.call(this,e),this.input=this._param=this._gain.gain,this.context.getConstant(1).chain(this._gain)},t.extend(t.Signal,t.Param),t.Signal.defaults={value:0,units:t.Type.Default,convert:!0},t.Signal.prototype.connect=t.SignalBase.prototype.connect,t.Signal.prototype.dispose=function(){return t.Param.prototype.dispose.call(this),this._param=null,this._gain.disconnect(),this._gain=null,this},t.Signal}(n,m,T,b);var w;w=function(t){"use strict";return t.Add=function(e){this.createInsOuts(2,0),this._sum=this.input[0]=this.input[1]=this.output=new t.Gain,this._param=this.input[1]=new t.Signal(e),this._param.connect(this._sum)},t.extend(t.Add,t.Signal),t.Add.prototype.dispose=function(){return t.prototype.dispose.call(this),this._sum.dispose(),this._sum=null,this._param.dispose(),this._param=null,this},t.Add}(n,S);var A;A=function(t){"use strict";return t.Multiply=function(e){this.createInsOuts(2,0),this._mult=this.input[0]=this.output=new t.Gain,this._param=this.input[1]=this.output.gain,this._param.value=this.defaultArg(e,0)},t.extend(t.Multiply,t.Signal),t.Multiply.prototype.dispose=function(){return t.prototype.dispose.call(this),this._mult.dispose(),this._mult=null,
+this._param=null,this},t.Multiply}(n,S);var P;P=function(t){"use strict";return t.Scale=function(e,i){this._outputMin=this.defaultArg(e,0),this._outputMax=this.defaultArg(i,1),this._scale=this.input=new t.Multiply(1),this._add=this.output=new t.Add(0),this._scale.connect(this._add),this._setRange()},t.extend(t.Scale,t.SignalBase),Object.defineProperty(t.Scale.prototype,"min",{get:function(){return this._outputMin},set:function(t){this._outputMin=t,this._setRange()}}),Object.defineProperty(t.Scale.prototype,"max",{get:function(){return this._outputMax},set:function(t){this._outputMax=t,this._setRange()}}),t.Scale.prototype._setRange=function(){this._add.value=this._outputMin,this._scale.value=this._outputMax-this._outputMin},t.Scale.prototype.dispose=function(){return t.prototype.dispose.call(this),this._add.dispose(),this._add=null,this._scale.dispose(),this._scale=null,this},t.Scale}(n,w,A);var k;k=function(){var e=S,i=w,n=A,o=P;t.Signal=function(t){var i=new e(t);return i},e.prototype.fade=e.prototype.linearRampToValueAtTime,n.prototype.fade=e.prototype.fade,i.prototype.fade=e.prototype.fade,o.prototype.fade=e.prototype.fade,e.prototype.setInput=function(t){t.connect(this)},n.prototype.setInput=e.prototype.setInput,i.prototype.setInput=e.prototype.setInput,o.prototype.setInput=e.prototype.setInput,e.prototype.add=function(t){var e=new i(t);return this.connect(e),e},n.prototype.add=e.prototype.add,i.prototype.add=e.prototype.add,o.prototype.add=e.prototype.add,e.prototype.mult=function(t){var e=new n(t);return this.connect(e),e},n.prototype.mult=e.prototype.mult,i.prototype.mult=e.prototype.mult,o.prototype.mult=e.prototype.mult,e.prototype.scale=function(e,i,n,r){var s,a;4===arguments.length?(s=t.prototype.map(n,e,i,0,1)-.5,a=t.prototype.map(r,e,i,0,1)-.5):(s=arguments[0],a=arguments[1]);var u=new o(s,a);return this.connect(u),u},n.prototype.scale=e.prototype.scale,i.prototype.scale=e.prototype.scale,o.prototype.scale=e.prototype.scale}(S,w,A,P);var O;O=function(){var e=a,i=w,n=A,o=P;t.Oscillator=function(i,n){if("string"==typeof i){var o=n;n=i,i=o}if("number"==typeof n){var o=n;n=i,i=o}this.started=!1,this.phaseAmount=void 0,this.oscillator=e.audiocontext.createOscillator(),this.f=i||440,this.oscillator.type=n||"sine",this.oscillator.frequency.setValueAtTime(this.f,e.audiocontext.currentTime),this.output=e.audiocontext.createGain(),this._freqMods=[],this.output.gain.value=.5,this.output.gain.setValueAtTime(.5,e.audiocontext.currentTime),this.oscillator.connect(this.output),this.panPosition=0,this.connection=e.input,this.panner=new t.Panner(this.output,this.connection,1),this.mathOps=[this.output],e.soundArray.push(this)},t.Oscillator.prototype.start=function(t,i){if(this.started){var n=e.audiocontext.currentTime;this.stop(n)}if(!this.started){var o=i||this.f,r=this.oscillator.type;this.oscillator&&(this.oscillator.disconnect(),delete this.oscillator),this.oscillator=e.audiocontext.createOscillator(),this.oscillator.frequency.value=Math.abs(o),this.oscillator.type=r,this.oscillator.connect(this.output),t=t||0,this.oscillator.start(t+e.audiocontext.currentTime),this.freqNode=this.oscillator.frequency;for(var s in this._freqMods)"undefined"!=typeof this._freqMods[s].connect&&this._freqMods[s].connect(this.oscillator.frequency);this.started=!0}},t.Oscillator.prototype.stop=function(t){if(this.started){var i=t||0,n=e.audiocontext.currentTime;this.oscillator.stop(i+n),this.started=!1}},t.Oscillator.prototype.amp=function(t,i,n){var o=this;if("number"==typeof t){var i=i||0,n=n||0,r=e.audiocontext.currentTime;this.output.gain.linearRampToValueAtTime(t,r+n+i)}else{if(!t)return this.output.gain;t.connect(o.output.gain)}},t.Oscillator.prototype.fade=t.Oscillator.prototype.amp,t.Oscillator.prototype.getAmp=function(){return this.output.gain.value},t.Oscillator.prototype.freq=function(t,i,n){if("number"!=typeof t||isNaN(t)){if(!t)return this.oscillator.frequency;t.output&&(t=t.output),t.connect(this.oscillator.frequency),this._freqMods.push(t)}else{this.f=t;var o=e.audiocontext.currentTime,i=i||0,n=n||0;0===i?this.oscillator.frequency.setValueAtTime(t,n+o):t>0?this.oscillator.frequency.exponentialRampToValueAtTime(t,n+i+o):this.oscillator.frequency.linearRampToValueAtTime(t,n+i+o),this.phaseAmount&&this.phase(this.phaseAmount)}},t.Oscillator.prototype.getFreq=function(){return this.oscillator.frequency.value},t.Oscillator.prototype.setType=function(t){this.oscillator.type=t},t.Oscillator.prototype.getType=function(){return this.oscillator.type},t.Oscillator.prototype.connect=function(t){t?t.hasOwnProperty("input")?(this.panner.connect(t.input),this.connection=t.input):(this.panner.connect(t),this.connection=t):this.panner.connect(e.input)},t.Oscillator.prototype.disconnect=function(){this.output&&this.output.disconnect(),this.panner&&(this.panner.disconnect(),this.output&&this.output.connect(this.panner)),this.oscMods=[]},t.Oscillator.prototype.pan=function(t,e){this.panPosition=t,this.panner.pan(t,e)},t.Oscillator.prototype.getPan=function(){return this.panPosition},t.Oscillator.prototype.dispose=function(){var t=e.soundArray.indexOf(this);if(e.soundArray.splice(t,1),this.oscillator){var i=e.audiocontext.currentTime;this.stop(i),this.disconnect(),this.panner=null,this.oscillator=null}this.osc2&&this.osc2.dispose()},t.Oscillator.prototype.phase=function(i){var n=t.prototype.map(i,0,1,0,1/this.f),o=e.audiocontext.currentTime;this.phaseAmount=i,this.dNode||(this.dNode=e.audiocontext.createDelay(),this.oscillator.disconnect(),this.oscillator.connect(this.dNode),this.dNode.connect(this.output)),this.dNode.delayTime.setValueAtTime(n,o)};var r=function(t,e,i,n,o){var r=t.oscillator;for(var s in t.mathOps)t.mathOps[s]instanceof o&&(r.disconnect(),t.mathOps[s].dispose(),i=s,i0&&(r=t.mathOps[s-1]),r.disconnect(),r.connect(e),e.connect(n),t.mathOps[i]=e,t};t.Oscillator.prototype.add=function(t){var e=new i(t),n=this.mathOps.length-1,o=this.output;return r(this,e,n,o,i)},t.Oscillator.prototype.mult=function(t){var e=new n(t),i=this.mathOps.length-1,o=this.output;return r(this,e,i,o,n)},t.Oscillator.prototype.scale=function(e,i,n,s){var a,u;4===arguments.length?(a=t.prototype.map(n,e,i,0,1)-.5,u=t.prototype.map(s,e,i,0,1)-.5):(a=arguments[0],u=arguments[1]);var c=new o(a,u),p=this.mathOps.length-1,h=this.output;return r(this,c,p,h,o)},t.SinOsc=function(e){t.Oscillator.call(this,e,"sine")},t.SinOsc.prototype=Object.create(t.Oscillator.prototype),t.TriOsc=function(e){t.Oscillator.call(this,e,"triangle")},t.TriOsc.prototype=Object.create(t.Oscillator.prototype),t.SawOsc=function(e){t.Oscillator.call(this,e,"sawtooth")},t.SawOsc.prototype=Object.create(t.Oscillator.prototype),t.SqrOsc=function(e){t.Oscillator.call(this,e,"square")},t.SqrOsc.prototype=Object.create(t.Oscillator.prototype)}(a,w,A,P);var F;F=function(t){"use strict";return t.Timeline=function(){var e=this.optionsObject(arguments,["memory"],t.Timeline.defaults);this._timeline=[],this._toRemove=[],this._iterating=!1,this.memory=e.memory},t.extend(t.Timeline),t.Timeline.defaults={memory:1/0},Object.defineProperty(t.Timeline.prototype,"length",{get:function(){return this._timeline.length}}),t.Timeline.prototype.add=function(t){if(this.isUndef(t.time))throw new Error("Tone.Timeline: events must have a time attribute");if(this._timeline.length){var e=this._search(t.time);this._timeline.splice(e+1,0,t)}else this._timeline.push(t);if(this.length>this.memory){var i=this.length-this.memory;this._timeline.splice(0,i)}return this},t.Timeline.prototype.remove=function(t){if(this._iterating)this._toRemove.push(t);else{var e=this._timeline.indexOf(t);-1!==e&&this._timeline.splice(e,1)}return this},t.Timeline.prototype.get=function(t){var e=this._search(t);return-1!==e?this._timeline[e]:null},t.Timeline.prototype.peek=function(){return this._timeline[0]},t.Timeline.prototype.shift=function(){return this._timeline.shift()},t.Timeline.prototype.getAfter=function(t){var e=this._search(t);return e+10&&this._timeline[e-1].time=0?this._timeline[i-1]:null},t.Timeline.prototype.cancel=function(t){if(this._timeline.length>1){var e=this._search(t);if(e>=0)if(this._timeline[e].time===t){for(var i=e;i>=0&&this._timeline[i].time===t;i--)e=i;this._timeline=this._timeline.slice(0,e)}else this._timeline=this._timeline.slice(0,e+1);else this._timeline=[]}else 1===this._timeline.length&&this._timeline[0].time>=t&&(this._timeline=[]);return this},t.Timeline.prototype.cancelBefore=function(t){if(this._timeline.length){var e=this._search(t);e>=0&&(this._timeline=this._timeline.slice(e+1))}return this},t.Timeline.prototype._search=function(t){var e=0,i=this._timeline.length,n=i;if(i>0&&this._timeline[i-1].time<=t)return i-1;for(;n>e;){var o=Math.floor(e+(n-e)/2),r=this._timeline[o],s=this._timeline[o+1];if(r.time===t){for(var a=o;at)return o;r.time>t?n=o:r.time=n;n++)t(this._timeline[n]);if(this._iterating=!1,this._toRemove.length>0){for(var o=0;o=0&&this._timeline[i].time>=t;)i--;return this._iterate(e,i+1),this},t.Timeline.prototype.forEachAtTime=function(t,e){var i=this._search(t);return-1!==i&&this._iterate(function(i){i.time===t&&e(i)},0,i),this},t.Timeline.prototype.dispose=function(){t.prototype.dispose.call(this),this._timeline=null,this._toRemove=null},t.Timeline}(n);var q;q=function(t){"use strict";return t.TimelineSignal=function(){var e=this.optionsObject(arguments,["value","units"],t.Signal.defaults);this._events=new t.Timeline(10),t.Signal.apply(this,e),e.param=this._param,t.Param.call(this,e),this._initial=this._fromUnits(this._param.value)},t.extend(t.TimelineSignal,t.Param),t.TimelineSignal.Type={Linear:"linear",Exponential:"exponential",Target:"target",Curve:"curve",Set:"set"},Object.defineProperty(t.TimelineSignal.prototype,"value",{get:function(){var t=this.now(),e=this.getValueAtTime(t);return this._toUnits(e)},set:function(t){var e=this._fromUnits(t);this._initial=e,this.cancelScheduledValues(),this._param.value=e}}),t.TimelineSignal.prototype.setValueAtTime=function(e,i){return e=this._fromUnits(e),i=this.toSeconds(i),this._events.add({type:t.TimelineSignal.Type.Set,value:e,time:i}),this._param.setValueAtTime(e,i),this},t.TimelineSignal.prototype.linearRampToValueAtTime=function(e,i){return e=this._fromUnits(e),i=this.toSeconds(i),this._events.add({type:t.TimelineSignal.Type.Linear,value:e,time:i}),this._param.linearRampToValueAtTime(e,i),this},t.TimelineSignal.prototype.exponentialRampToValueAtTime=function(e,i){i=this.toSeconds(i);var n=this._searchBefore(i);n&&0===n.value&&this.setValueAtTime(this._minOutput,n.time),e=this._fromUnits(e);var o=Math.max(e,this._minOutput);return this._events.add({type:t.TimelineSignal.Type.Exponential,value:o,time:i}),ee)this.cancelScheduledValues(e),this.linearRampToValueAtTime(i,e);else{var o=this._searchAfter(e);o&&(this.cancelScheduledValues(e),o.type===t.TimelineSignal.Type.Linear?this.linearRampToValueAtTime(i,e):o.type===t.TimelineSignal.Type.Exponential&&this.exponentialRampToValueAtTime(i,e)),this.setValueAtTime(i,e)}return this},t.TimelineSignal.prototype.linearRampToValueBetween=function(t,e,i){return this.setRampPoint(e),this.linearRampToValueAtTime(t,i),this},t.TimelineSignal.prototype.exponentialRampToValueBetween=function(t,e,i){return this.setRampPoint(e),this.exponentialRampToValueAtTime(t,i),this},t.TimelineSignal.prototype._searchBefore=function(t){return this._events.get(t)},t.TimelineSignal.prototype._searchAfter=function(t){return this._events.getAfter(t)},t.TimelineSignal.prototype.getValueAtTime=function(e){e=this.toSeconds(e);var i=this._searchAfter(e),n=this._searchBefore(e),o=this._initial;if(null===n)o=this._initial;else if(n.type===t.TimelineSignal.Type.Target){var r,s=this._events.getBefore(n.time);r=null===s?this._initial:s.value,o=this._exponentialApproach(n.time,r,n.value,n.constant,e)}else o=n.type===t.TimelineSignal.Type.Curve?this._curveInterpolate(n.time,n.value,n.duration,e):null===i?n.value:i.type===t.TimelineSignal.Type.Linear?this._linearInterpolate(n.time,n.value,i.time,i.value,e):i.type===t.TimelineSignal.Type.Exponential?this._exponentialInterpolate(n.time,n.value,i.time,i.value,e):n.value;return o},t.TimelineSignal.prototype.connect=t.SignalBase.prototype.connect,t.TimelineSignal.prototype._exponentialApproach=function(t,e,i,n,o){return i+(e-i)*Math.exp(-(o-t)/n)},t.TimelineSignal.prototype._linearInterpolate=function(t,e,i,n,o){return e+(n-e)*((o-t)/(i-t))},t.TimelineSignal.prototype._exponentialInterpolate=function(t,e,i,n,o){return e=Math.max(this._minOutput,e),e*Math.pow(n/e,(o-t)/(i-t))},t.TimelineSignal.prototype._curveInterpolate=function(t,e,i,n){var o=e.length;if(n>=t+i)return e[o-1];if(t>=n)return e[0];var r=(n-t)/i,s=Math.floor((o-1)*r),a=Math.ceil((o-1)*r),u=e[s],c=e[a];return a===s?u:this._linearInterpolate(s,u,a,c,r*(o-1))},t.TimelineSignal.prototype.dispose=function(){t.Signal.prototype.dispose.call(this),t.Param.prototype.dispose.call(this),this._events.dispose(),this._events=null},t.TimelineSignal}(n,S);var M;M=function(){var e=a,i=w,n=A,o=P,r=q;t.Envelope=function(t,i,n,o,s,a){this.aTime=t||.1,this.aLevel=i||1,this.dTime=n||.5,this.dLevel=o||0,this.rTime=s||0,this.rLevel=a||0,this._rampHighPercentage=.98,this._rampLowPercentage=.02,this.output=e.audiocontext.createGain(),this.control=new r,this._init(),this.control.connect(this.output),this.connection=null,this.mathOps=[this.control],this.isExponential=!1,this.sourceToClear=null,this.wasTriggered=!1,e.soundArray.push(this)},t.Envelope.prototype._init=function(){var t=e.audiocontext.currentTime,i=t;this.control.setTargetAtTime(1e-5,i,.001),this._setRampAD(this.aTime,this.dTime)},t.Envelope.prototype.set=function(t,e,i,n,o,r){this.aTime=t,this.aLevel=e,this.dTime=i||0,this.dLevel=n||0,this.rTime=o||0,this.rLevel=r||0,this._setRampAD(t,i)},t.Envelope.prototype.setADSR=function(t,e,i,n){this.aTime=t,this.dTime=e||0,this.sPercent=i||0,this.dLevel="undefined"!=typeof i?i*(this.aLevel-this.rLevel)+this.rLevel:0,this.rTime=n||0,this._setRampAD(t,e)},t.Envelope.prototype.setRange=function(t,e){this.aLevel=t||1,this.rLevel=e||0},t.Envelope.prototype._setRampAD=function(t,e){this._rampAttackTime=this.checkExpInput(t),this._rampDecayTime=this.checkExpInput(e);var i=1;i=Math.log(1/this.checkExpInput(1-this._rampHighPercentage)),this._rampAttackTC=t/this.checkExpInput(i),i=Math.log(1/this._rampLowPercentage),this._rampDecayTC=e/this.checkExpInput(i)},t.Envelope.prototype.setRampPercentages=function(t,e){this._rampHighPercentage=this.checkExpInput(t),this._rampLowPercentage=this.checkExpInput(e);var i=1;i=Math.log(1/this.checkExpInput(1-this._rampHighPercentage)),this._rampAttackTC=this._rampAttackTime/this.checkExpInput(i),i=Math.log(1/this._rampLowPercentage),this._rampDecayTC=this._rampDecayTime/this.checkExpInput(i)},t.Envelope.prototype.setInput=function(){for(var t=0;t=t&&(t=1e-8),t},t.Envelope.prototype.play=function(t,e,i){var n=e||0,i=i||0;t&&this.connection!==t&&this.connect(t),this.triggerAttack(t,n),this.triggerRelease(t,n+this.aTime+this.dTime+i)},t.Envelope.prototype.triggerAttack=function(t,i){var n=e.audiocontext.currentTime,o=i||0,r=n+o;this.lastAttack=r,this.wasTriggered=!0,t&&this.connection!==t&&this.connect(t);var s=this.control.getValueAtTime(r);this.isExponential===!0?this.control.exponentialRampToValueAtTime(this.checkExpInput(s),r):this.control.linearRampToValueAtTime(s,r),r+=this.aTime,this.isExponential===!0?(this.control.exponentialRampToValueAtTime(this.checkExpInput(this.aLevel),r),s=this.checkExpInput(this.control.getValueAtTime(r)),this.control.cancelScheduledValues(r),this.control.exponentialRampToValueAtTime(s,r)):(this.control.linearRampToValueAtTime(this.aLevel,r),s=this.control.getValueAtTime(r),this.control.cancelScheduledValues(r),this.control.linearRampToValueAtTime(s,r)),r+=this.dTime,this.isExponential===!0?(this.control.exponentialRampToValueAtTime(this.checkExpInput(this.dLevel),r),s=this.checkExpInput(this.control.getValueAtTime(r)),this.control.cancelScheduledValues(r),this.control.exponentialRampToValueAtTime(s,r)):(this.control.linearRampToValueAtTime(this.dLevel,r),s=this.control.getValueAtTime(r),this.control.cancelScheduledValues(r),this.control.linearRampToValueAtTime(s,r))},t.Envelope.prototype.triggerRelease=function(t,i){if(this.wasTriggered){var n=e.audiocontext.currentTime,o=i||0,r=n+o;t&&this.connection!==t&&this.connect(t);var s=this.control.getValueAtTime(r);this.isExponential===!0?this.control.exponentialRampToValueAtTime(this.checkExpInput(s),r):this.control.linearRampToValueAtTime(s,r),r+=this.rTime,this.isExponential===!0?(this.control.exponentialRampToValueAtTime(this.checkExpInput(this.rLevel),r),s=this.checkExpInput(this.control.getValueAtTime(r)),this.control.cancelScheduledValues(r),this.control.exponentialRampToValueAtTime(s,r)):(this.control.linearRampToValueAtTime(this.rLevel,r),s=this.control.getValueAtTime(r),this.control.cancelScheduledValues(r),this.control.linearRampToValueAtTime(s,r)),this.wasTriggered=!1}},t.Envelope.prototype.ramp=function(t,i,n,o){var r=e.audiocontext.currentTime,s=i||0,a=r+s,u=this.checkExpInput(n),c="undefined"!=typeof o?this.checkExpInput(o):void 0;t&&this.connection!==t&&this.connect(t);var p=this.checkExpInput(this.control.getValueAtTime(a));u>p?(this.control.setTargetAtTime(u,a,this._rampAttackTC),a+=this._rampAttackTime):p>u&&(this.control.setTargetAtTime(u,a,this._rampDecayTC),a+=this._rampDecayTime),void 0!==c&&(c>u?this.control.setTargetAtTime(c,a,this._rampAttackTC):u>c&&this.control.setTargetAtTime(c,a,this._rampDecayTC))},t.Envelope.prototype.connect=function(i){this.connection=i,(i instanceof t.Oscillator||i instanceof t.SoundFile||i instanceof t.AudioIn||i instanceof t.Reverb||i instanceof t.Noise||i instanceof t.Filter||i instanceof t.Delay)&&(i=i.output.gain),i instanceof AudioParam&&i.setValueAtTime(0,e.audiocontext.currentTime),i instanceof t.Signal&&i.setValue(0),this.output.connect(i)},t.Envelope.prototype.disconnect=function(){this.output&&this.output.disconnect()},t.Envelope.prototype.add=function(e){var n=new i(e),o=this.mathOps.length,r=this.output;return t.prototype._mathChain(this,n,o,r,i)},t.Envelope.prototype.mult=function(e){var i=new n(e),o=this.mathOps.length,r=this.output;return t.prototype._mathChain(this,i,o,r,n)},t.Envelope.prototype.scale=function(e,i,n,r){var s=new o(e,i,n,r),a=this.mathOps.length,u=this.output;return t.prototype._mathChain(this,s,a,u,o)},t.Envelope.prototype.dispose=function(){var t=e.soundArray.indexOf(this);e.soundArray.splice(t,1),this.disconnect(),this.control&&(this.control.dispose(),this.control=null);for(var i=1;io;o++)n[o]=1;var r=t.createBufferSource();return r.buffer=e,r.loop=!0,r}var i=a;t.Pulse=function(n,o){t.Oscillator.call(this,n,"sawtooth"),this.w=o||0,this.osc2=new t.SawOsc(n),this.dNode=i.audiocontext.createDelay(),this.dcOffset=e(),this.dcGain=i.audiocontext.createGain(),this.dcOffset.connect(this.dcGain),this.dcGain.connect(this.output),this.f=n||440;var r=this.w/this.oscillator.frequency.value;this.dNode.delayTime.value=r,this.dcGain.gain.value=1.7*(.5-this.w),this.osc2.disconnect(),this.osc2.panner.disconnect(),this.osc2.amp(-1),this.osc2.output.connect(this.dNode),this.dNode.connect(this.output),this.output.gain.value=1,this.output.connect(this.panner)},t.Pulse.prototype=Object.create(t.Oscillator.prototype),t.Pulse.prototype.width=function(e){if("number"==typeof e){if(1>=e&&e>=0){this.w=e;var i=this.w/this.oscillator.frequency.value;this.dNode.delayTime.value=i}this.dcGain.gain.value=1.7*(.5-this.w)}else{e.connect(this.dNode.delayTime);var n=new t.SignalAdd(-.5);n.setInput(e),n=n.mult(-1),n=n.mult(1.7),n.connect(this.dcGain.gain)}},t.Pulse.prototype.start=function(t,n){var o=i.audiocontext.currentTime,r=n||0;if(!this.started){var s=t||this.f,a=this.oscillator.type;this.oscillator=i.audiocontext.createOscillator(),this.oscillator.frequency.setValueAtTime(s,o),this.oscillator.type=a,this.oscillator.connect(this.output),this.oscillator.start(r+o),this.osc2.oscillator=i.audiocontext.createOscillator(),this.osc2.oscillator.frequency.setValueAtTime(s,r+o),this.osc2.oscillator.type=a,this.osc2.oscillator.connect(this.osc2.output),this.osc2.start(r+o),this.freqNode=[this.oscillator.frequency,this.osc2.oscillator.frequency],this.dcOffset=e(),this.dcOffset.connect(this.dcGain),this.dcOffset.start(r+o),void 0!==this.mods&&void 0!==this.mods.frequency&&(this.mods.frequency.connect(this.freqNode[0]),this.mods.frequency.connect(this.freqNode[1])),this.started=!0,this.osc2.started=!0}},t.Pulse.prototype.stop=function(t){if(this.started){var e=t||0,n=i.audiocontext.currentTime;this.oscillator.stop(e+n),this.osc2.oscillator&&this.osc2.oscillator.stop(e+n),this.dcOffset.stop(e+n),this.started=!1,this.osc2.started=!1}},t.Pulse.prototype.freq=function(t,e,n){if("number"==typeof t){this.f=t;var o=i.audiocontext.currentTime,e=e||0,n=n||0,r=this.oscillator.frequency.value;this.oscillator.frequency.cancelScheduledValues(o),this.oscillator.frequency.setValueAtTime(r,o+n),this.oscillator.frequency.exponentialRampToValueAtTime(t,n+e+o),this.osc2.oscillator.frequency.cancelScheduledValues(o),this.osc2.oscillator.frequency.setValueAtTime(r,o+n),this.osc2.oscillator.frequency.exponentialRampToValueAtTime(t,n+e+o),this.freqMod&&(this.freqMod.output.disconnect(),this.freqMod=null)}else t.output&&(t.output.disconnect(),t.output.connect(this.oscillator.frequency),t.output.connect(this.osc2.oscillator.frequency),this.freqMod=t)}}(a,O);var V;V=function(){var e=a;t.Noise=function(e){var r;t.Oscillator.call(this),delete this.f,delete this.freq,delete this.oscillator,r="brown"===e?o:"pink"===e?n:i,this.buffer=r},t.Noise.prototype=Object.create(t.Oscillator.prototype);var i=function(){for(var t=2*e.audiocontext.sampleRate,i=e.audiocontext.createBuffer(1,t,e.audiocontext.sampleRate),n=i.getChannelData(0),o=0;t>o;o++)n[o]=2*Math.random()-1;return i.type="white",i}(),n=function(){var t,i,n,o,r,s,a,u=2*e.audiocontext.sampleRate,c=e.audiocontext.createBuffer(1,u,e.audiocontext.sampleRate),p=c.getChannelData(0);t=i=n=o=r=s=a=0;for(var h=0;u>h;h++){var l=2*Math.random()-1;t=.99886*t+.0555179*l,i=.99332*i+.0750759*l,n=.969*n+.153852*l,o=.8665*o+.3104856*l,r=.55*r+.5329522*l,s=-.7616*s-.016898*l,p[h]=t+i+n+o+r+s+a+.5362*l,p[h]*=.11,a=.115926*l}return c.type="pink",c}(),o=function(){for(var t=2*e.audiocontext.sampleRate,i=e.audiocontext.createBuffer(1,t,e.audiocontext.sampleRate),n=i.getChannelData(0),o=0,r=0;t>r;r++){var s=2*Math.random()-1;n[r]=(o+.02*s)/1.02,o=n[r],n[r]*=3.5}return i.type="brown",i}();t.Noise.prototype.setType=function(t){switch(t){case"white":this.buffer=i;break;case"pink":this.buffer=n;break;case"brown":this.buffer=o;break;default:this.buffer=i}if(this.started){var r=e.audiocontext.currentTime;this.stop(r),this.start(r+.01)}},t.Noise.prototype.getType=function(){return this.buffer.type},t.Noise.prototype.start=function(){this.started&&this.stop(),this.noise=e.audiocontext.createBufferSource(),this.noise.buffer=this.buffer,this.noise.loop=!0,this.noise.connect(this.output);var t=e.audiocontext.currentTime;this.noise.start(t),this.started=!0},t.Noise.prototype.stop=function(){var t=e.audiocontext.currentTime;this.noise&&(this.noise.stop(t),this.started=!1)},t.Noise.prototype.dispose=function(){var t=e.audiocontext.currentTime,i=e.soundArray.indexOf(this);e.soundArray.splice(i,1),this.noise&&(this.noise.disconnect(),this.stop(t)),this.output&&this.output.disconnect(),this.panner&&this.panner.disconnect(),this.output=null,this.panner=null,this.buffer=null,this.noise=null}}(a);var R;R=function(){var e=a;e.inputSources=[],t.AudioIn=function(i){this.input=e.audiocontext.createGain(),this.output=e.audiocontext.createGain(),this.stream=null,this.mediaStream=null,this.currentSource=null,this.enabled=!1,this.amplitude=new t.Amplitude,this.output.connect(this.amplitude.input),window.MediaStreamTrack&&window.navigator.mediaDevices&&window.navigator.mediaDevices.getUserMedia||(i?i():window.alert("This browser does not support MediaStreamTrack and mediaDevices")),e.soundArray.push(this)},t.AudioIn.prototype.start=function(t,i){var n=this;this.stream&&this.stop();var o=e.inputSources[n.currentSource],r={audio:{sampleRate:e.audiocontext.sampleRate,echoCancellation:!1}};e.inputSources[this.currentSource]&&(r.audio.deviceId=o.deviceId),window.navigator.mediaDevices.getUserMedia(r).then(function(i){n.stream=i,n.enabled=!0,n.mediaStream=e.audiocontext.createMediaStreamSource(i),n.mediaStream.connect(n.output),n.amplitude.setInput(n.output),t&&t()})["catch"](function(t){i?i(t):console.error(t)})},t.AudioIn.prototype.stop=function(){this.stream&&(this.stream.getTracks().forEach(function(t){t.stop()}),this.mediaStream.disconnect(),delete this.mediaStream,delete this.stream)},t.AudioIn.prototype.connect=function(t){t?t.hasOwnProperty("input")?this.output.connect(t.input):t.hasOwnProperty("analyser")?this.output.connect(t.analyser):this.output.connect(t):this.output.connect(e.input)},t.AudioIn.prototype.disconnect=function(){this.output&&(this.output.disconnect(),this.output.connect(this.amplitude.input))},t.AudioIn.prototype.getLevel=function(t){return t&&(this.amplitude.smoothing=t),this.amplitude.getLevel()},t.AudioIn.prototype.amp=function(t,i){if(i){var n=i||0,o=this.output.gain.value;this.output.gain.cancelScheduledValues(e.audiocontext.currentTime),this.output.gain.setValueAtTime(o,e.audiocontext.currentTime),this.output.gain.linearRampToValueAtTime(t,n+e.audiocontext.currentTime)}else this.output.gain.cancelScheduledValues(e.audiocontext.currentTime),this.output.gain.setValueAtTime(t,e.audiocontext.currentTime)},t.AudioIn.prototype.getSources=function(t,i){return new Promise(function(n,o){window.navigator.mediaDevices.enumerateDevices().then(function(i){e.inputSources=i.filter(function(t){return"audioinput"===t.kind}),n(e.inputSources),t&&t(e.inputSources)})["catch"](function(t){o(t),i?i(t):console.error("This browser does not support MediaStreamTrack.getSources()")})})},t.AudioIn.prototype.setSource=function(t){e.inputSources.length>0&&t=t?0:1},127),this._scale=this.input=new t.Multiply(1e4),this._scale.connect(this._thresh)},t.extend(t.GreaterThanZero,t.SignalBase),t.GreaterThanZero.prototype.dispose=function(){return t.prototype.dispose.call(this),this._scale.dispose(),this._scale=null,this._thresh.dispose(),this._thresh=null,this},t.GreaterThanZero}(n,S,A);var B;B=function(t){"use strict";return t.GreaterThan=function(e){this.createInsOuts(2,0),this._param=this.input[0]=new t.Subtract(e),this.input[1]=this._param.input[1],this._gtz=this.output=new t.GreaterThanZero,this._param.connect(this._gtz)},t.extend(t.GreaterThan,t.Signal),t.GreaterThan.prototype.dispose=function(){return t.prototype.dispose.call(this),this._param.dispose(),this._param=null,this._gtz.dispose(),this._gtz=null,this},t.GreaterThan}(n,N,D);var U;U=function(t){"use strict";return t.Abs=function(){this._abs=this.input=this.output=new t.WaveShaper(function(t){return 0===t?0:Math.abs(t)},127)},t.extend(t.Abs,t.SignalBase),t.Abs.prototype.dispose=function(){return t.prototype.dispose.call(this),this._abs.dispose(),this._abs=null,this},t.Abs}(n,m);var I;I=function(t){"use strict";return t.Modulo=function(e){this.createInsOuts(1,0),this._shaper=new t.WaveShaper(Math.pow(2,16)),this._multiply=new t.Multiply,this._subtract=this.output=new t.Subtract,this._modSignal=new t.Signal(e),this.input.fan(this._shaper,this._subtract),this._modSignal.connect(this._multiply,0,0),this._shaper.connect(this._multiply,0,1),this._multiply.connect(this._subtract,0,1),this._setWaveShaper(e)},t.extend(t.Modulo,t.SignalBase),t.Modulo.prototype._setWaveShaper=function(t){this._shaper.setMap(function(e){var i=Math.floor((e+1e-4)/t);return i;
+})},Object.defineProperty(t.Modulo.prototype,"value",{get:function(){return this._modSignal.value},set:function(t){this._modSignal.value=t,this._setWaveShaper(t)}}),t.Modulo.prototype.dispose=function(){return t.prototype.dispose.call(this),this._shaper.dispose(),this._shaper=null,this._multiply.dispose(),this._multiply=null,this._subtract.dispose(),this._subtract=null,this._modSignal.dispose(),this._modSignal=null,this},t.Modulo}(n,m,A);var G;G=function(t){"use strict";return t.Pow=function(e){this._exp=this.defaultArg(e,1),this._expScaler=this.input=this.output=new t.WaveShaper(this._expFunc(this._exp),8192)},t.extend(t.Pow,t.SignalBase),Object.defineProperty(t.Pow.prototype,"value",{get:function(){return this._exp},set:function(t){this._exp=t,this._expScaler.setMap(this._expFunc(this._exp))}}),t.Pow.prototype._expFunc=function(t){return function(e){return Math.pow(Math.abs(e),t)}},t.Pow.prototype.dispose=function(){return t.prototype.dispose.call(this),this._expScaler.dispose(),this._expScaler=null,this},t.Pow}(n);var L;L=function(t){"use strict";return t.AudioToGain=function(){this._norm=this.input=this.output=new t.WaveShaper(function(t){return(t+1)/2})},t.extend(t.AudioToGain,t.SignalBase),t.AudioToGain.prototype.dispose=function(){return t.prototype.dispose.call(this),this._norm.dispose(),this._norm=null,this},t.AudioToGain}(n,m);var j;j=function(t){"use strict";function e(t,e,i){var n=new t;return i._eval(e[0]).connect(n,0,0),i._eval(e[1]).connect(n,0,1),n}function i(t,e,i){var n=new t;return i._eval(e[0]).connect(n,0,0),n}function n(t){return t?parseFloat(t):void 0}function o(t){return t&&t.args?parseFloat(t.args):void 0}return t.Expr=function(){var t=this._replacements(Array.prototype.slice.call(arguments)),e=this._parseInputs(t);this._nodes=[],this.input=new Array(e);for(var i=0;e>i;i++)this.input[i]=this.context.createGain();var n,o=this._parseTree(t);try{n=this._eval(o)}catch(r){throw this._disposeNodes(),new Error("Tone.Expr: Could evaluate expression: "+t)}this.output=n},t.extend(t.Expr,t.SignalBase),t.Expr._Expressions={value:{signal:{regexp:/^\d+\.\d+|^\d+/,method:function(e){var i=new t.Signal(n(e));return i}},input:{regexp:/^\$\d/,method:function(t,e){return e.input[n(t.substr(1))]}}},glue:{"(":{regexp:/^\(/},")":{regexp:/^\)/},",":{regexp:/^,/}},func:{abs:{regexp:/^abs/,method:i.bind(this,t.Abs)},mod:{regexp:/^mod/,method:function(e,i){var n=o(e[1]),r=new t.Modulo(n);return i._eval(e[0]).connect(r),r}},pow:{regexp:/^pow/,method:function(e,i){var n=o(e[1]),r=new t.Pow(n);return i._eval(e[0]).connect(r),r}},a2g:{regexp:/^a2g/,method:function(e,i){var n=new t.AudioToGain;return i._eval(e[0]).connect(n),n}}},binary:{"+":{regexp:/^\+/,precedence:1,method:e.bind(this,t.Add)},"-":{regexp:/^\-/,precedence:1,method:function(n,o){return 1===n.length?i(t.Negate,n,o):e(t.Subtract,n,o)}},"*":{regexp:/^\*/,precedence:0,method:e.bind(this,t.Multiply)}},unary:{"-":{regexp:/^\-/,method:i.bind(this,t.Negate)},"!":{regexp:/^\!/,method:i.bind(this,t.NOT)}}},t.Expr.prototype._parseInputs=function(t){var e=t.match(/\$\d/g),i=0;if(null!==e)for(var n=0;n0;){e=e.trim();var r=i(e);o.push(r),e=e.substr(r.value.length)}return{next:function(){return o[++n]},peek:function(){return o[n+1]}}},t.Expr.prototype._parseTree=function(e){function i(t,e){return!p(t)&&"glue"===t.type&&t.value===e}function n(e,i,n){var o=!1,r=t.Expr._Expressions[i];if(!p(e))for(var s in r){var a=r[s];if(a.regexp.test(e.value)){if(p(n))return!0;if(a.precedence===n)return!0}}return o}function o(t){p(t)&&(t=5);var e;e=0>t?r():o(t-1);for(var i=c.peek();n(i,"binary",t);)i=c.next(),e={operator:i.value,method:i.method,args:[e,o(t-1)]},i=c.peek();return e}function r(){var t,e;return t=c.peek(),n(t,"unary")?(t=c.next(),e=r(),{operator:t.value,method:t.method,args:[e]}):s()}function s(){var t,e;if(t=c.peek(),p(t))throw new SyntaxError("Tone.Expr: Unexpected termination of expression");if("func"===t.type)return t=c.next(),a(t);if("value"===t.type)return t=c.next(),{method:t.method,args:t.value};if(i(t,"(")){if(c.next(),e=o(),t=c.next(),!i(t,")"))throw new SyntaxError("Expected )");return e}throw new SyntaxError("Tone.Expr: Parse error, cannot process token "+t.value)}function a(t){var e,n=[];if(e=c.next(),!i(e,"("))throw new SyntaxError('Tone.Expr: Expected ( in a function call "'+t.value+'"');if(e=c.peek(),i(e,")")||(n=u()),e=c.next(),!i(e,")"))throw new SyntaxError('Tone.Expr: Expected ) in a function call "'+t.value+'"');return{method:t.method,args:n,name:name}}function u(){for(var t,e,n=[];;){if(e=o(),p(e))break;if(n.push(e),t=c.peek(),!i(t,","))break;c.next()}return n}var c=this._tokenize(e),p=this.isUndef.bind(this);return o()},t.Expr.prototype._eval=function(t){if(!this.isUndef(t)){var e=t.method(t.args,this);return this._nodes.push(e),e}},t.Expr.prototype._disposeNodes=function(){for(var t=0;t0){this.connect(arguments[0]);for(var t=1;t=t&&(t=1),"number"==typeof t?(this.biquad.frequency.cancelScheduledValues(this.ac.currentTime+.01+i),this.biquad.frequency.exponentialRampToValueAtTime(t,this.ac.currentTime+.02+i)):t&&t.connect(this.biquad.frequency),this.biquad.frequency.value},t.Filter.prototype.res=function(t,e){var i=e||0;return"number"==typeof t?(this.biquad.Q.value=t,this.biquad.Q.cancelScheduledValues(this.ac.currentTime+.01+i),this.biquad.Q.linearRampToValueAtTime(t,this.ac.currentTime+.02+i)):t&&t.connect(this.biquad.Q),this.biquad.Q.value},t.Filter.prototype.gain=function(t,e){var i=e||0;return"number"==typeof t?(this.biquad.gain.value=t,this.biquad.gain.cancelScheduledValues(this.ac.currentTime+.01+i),this.biquad.gain.linearRampToValueAtTime(t,this.ac.currentTime+.02+i)):t&&t.connect(this.biquad.gain),this.biquad.gain.value},t.Filter.prototype.toggle=function(){return this._on=!this._on,this._on===!0?this.biquad.type=this._untoggledType:this._on===!1&&(this.biquad.type="allpass"),this._on},t.Filter.prototype.setType=function(t){this.biquad.type=t,this._untoggledType=this.biquad.type},t.Filter.prototype.dispose=function(){e.prototype.dispose.apply(this),this.biquad&&(this.biquad.disconnect(),delete this.biquad)},t.LowPass=function(){t.Filter.call(this,"lowpass")},t.LowPass.prototype=Object.create(t.Filter.prototype),t.HighPass=function(){t.Filter.call(this,"highpass")},t.HighPass.prototype=Object.create(t.Filter.prototype),t.BandPass=function(){t.Filter.call(this,"bandpass")},t.BandPass.prototype=Object.create(t.Filter.prototype),t.Filter}(a,Y);var W;W=function(){var e=z,i=a,n=function(t,i){e.call(this,"peaking"),this.disconnect(),this.set(t,i),this.biquad.gain.value=0,delete this.input,delete this.output,delete this._drywet,delete this.wet};return n.prototype=Object.create(e.prototype),n.prototype.amp=function(){console.warn("`amp()` is not available for p5.EQ bands. Use `.gain()`")},n.prototype.drywet=function(){console.warn("`drywet()` is not available for p5.EQ bands.")},n.prototype.connect=function(e){var i=e||t.soundOut.input;this.biquad?this.biquad.connect(i.input?i.input:i):this.output.connect(i.input?i.input:i)},n.prototype.disconnect=function(){this.biquad&&this.biquad.disconnect()},n.prototype.dispose=function(){var t=i.soundArray.indexOf(this);i.soundArray.splice(t,1),this.disconnect(),delete this.biquad},n}(z,a);var Q;Q=function(){var e=Y,i=W;return t.EQ=function(t){e.call(this),t=3===t||8===t?t:3;var i;i=3===t?Math.pow(2,3):2,this.bands=[];for(var n,o,r=0;t>r;r++)r===t-1?(n=21e3,o=.01):0===r?(n=100,o=.1):1===r?(n=3===t?360*i:360,o=1):(n=this.bands[r-1].freq()*i,o=1),this.bands[r]=this._newBand(n,o),r>0?this.bands[r-1].connect(this.bands[r].biquad):this.input.connect(this.bands[r].biquad);this.bands[t-1].connect(this.output)},t.EQ.prototype=Object.create(e.prototype),t.EQ.prototype.process=function(t){t.connect(this.input)},t.EQ.prototype.set=function(){if(arguments.length===2*this.bands.length)for(var t=0;t0;)delete this.bands.pop().dispose();delete this.bands}},t.EQ}(Y,W);var H;H=function(){var e=Y;return t.Panner3D=function(){e.call(this),this.panner=this.ac.createPanner(),this.panner.panningModel="HRTF",this.panner.distanceModel="linear",this.panner.connect(this.output),this.input.connect(this.panner)},t.Panner3D.prototype=Object.create(e.prototype),t.Panner3D.prototype.process=function(t){t.connect(this.input)},t.Panner3D.prototype.set=function(t,e,i,n){return this.positionX(t,n),this.positionY(e,n),this.positionZ(i,n),[this.panner.positionX.value,this.panner.positionY.value,this.panner.positionZ.value]},t.Panner3D.prototype.positionX=function(t,e){var i=e||0;return"number"==typeof t?(this.panner.positionX.value=t,this.panner.positionX.cancelScheduledValues(this.ac.currentTime+.01+i),this.panner.positionX.linearRampToValueAtTime(t,this.ac.currentTime+.02+i)):t&&t.connect(this.panner.positionX),this.panner.positionX.value},t.Panner3D.prototype.positionY=function(t,e){var i=e||0;return"number"==typeof t?(this.panner.positionY.value=t,this.panner.positionY.cancelScheduledValues(this.ac.currentTime+.01+i),this.panner.positionY.linearRampToValueAtTime(t,this.ac.currentTime+.02+i)):t&&t.connect(this.panner.positionY),this.panner.positionY.value},t.Panner3D.prototype.positionZ=function(t,e){var i=e||0;return"number"==typeof t?(this.panner.positionZ.value=t,this.panner.positionZ.cancelScheduledValues(this.ac.currentTime+.01+i),this.panner.positionZ.linearRampToValueAtTime(t,this.ac.currentTime+.02+i)):t&&t.connect(this.panner.positionZ),this.panner.positionZ.value},t.Panner3D.prototype.orient=function(t,e,i,n){return this.orientX(t,n),this.orientY(e,n),this.orientZ(i,n),[this.panner.orientationX.value,this.panner.orientationY.value,this.panner.orientationZ.value]},t.Panner3D.prototype.orientX=function(t,e){var i=e||0;return"number"==typeof t?(this.panner.orientationX.value=t,this.panner.orientationX.cancelScheduledValues(this.ac.currentTime+.01+i),this.panner.orientationX.linearRampToValueAtTime(t,this.ac.currentTime+.02+i)):t&&t.connect(this.panner.orientationX),this.panner.orientationX.value},t.Panner3D.prototype.orientY=function(t,e){var i=e||0;return"number"==typeof t?(this.panner.orientationY.value=t,this.panner.orientationY.cancelScheduledValues(this.ac.currentTime+.01+i),this.panner.orientationY.linearRampToValueAtTime(t,this.ac.currentTime+.02+i)):t&&t.connect(this.panner.orientationY),this.panner.orientationY.value},t.Panner3D.prototype.orientZ=function(t,e){var i=e||0;return"number"==typeof t?(this.panner.orientationZ.value=t,this.panner.orientationZ.cancelScheduledValues(this.ac.currentTime+.01+i),this.panner.orientationZ.linearRampToValueAtTime(t,this.ac.currentTime+.02+i)):t&&t.connect(this.panner.orientationZ),this.panner.orientationZ.value},t.Panner3D.prototype.setFalloff=function(t,e){this.maxDist(t),this.rolloff(e)},t.Panner3D.prototype.maxDist=function(t){return"number"==typeof t&&(this.panner.maxDistance=t),this.panner.maxDistance},t.Panner3D.prototype.rolloff=function(t){return"number"==typeof t&&(this.panner.rolloffFactor=t),this.panner.rolloffFactor},t.Panner3D.dispose=function(){e.prototype.dispose.apply(this),this.panner&&(this.panner.disconnect(),delete this.panner)},t.Panner3D}(a,Y);var $;$=function(){var e=a;return t.Listener3D=function(t){this.ac=e.audiocontext,this.listener=this.ac.listener},t.Listener3D.prototype.process=function(t){t.connect(this.input)},t.Listener3D.prototype.position=function(t,e,i,n){return this.positionX(t,n),this.positionY(e,n),this.positionZ(i,n),[this.listener.positionX.value,this.listener.positionY.value,this.listener.positionZ.value]},t.Listener3D.prototype.positionX=function(t,e){var i=e||0;return"number"==typeof t?(this.listener.positionX.value=t,this.listener.positionX.cancelScheduledValues(this.ac.currentTime+.01+i),this.listener.positionX.linearRampToValueAtTime(t,this.ac.currentTime+.02+i)):t&&t.connect(this.listener.positionX),this.listener.positionX.value},t.Listener3D.prototype.positionY=function(t,e){var i=e||0;return"number"==typeof t?(this.listener.positionY.value=t,this.listener.positionY.cancelScheduledValues(this.ac.currentTime+.01+i),this.listener.positionY.linearRampToValueAtTime(t,this.ac.currentTime+.02+i)):t&&t.connect(this.listener.positionY),this.listener.positionY.value},t.Listener3D.prototype.positionZ=function(t,e){var i=e||0;return"number"==typeof t?(this.listener.positionZ.value=t,this.listener.positionZ.cancelScheduledValues(this.ac.currentTime+.01+i),this.listener.positionZ.linearRampToValueAtTime(t,this.ac.currentTime+.02+i)):t&&t.connect(this.listener.positionZ),this.listener.positionZ.value},t.Listener3D.prototype.orient=function(t,e,i,n,o,r,s){return 3===arguments.length||4===arguments.length?(s=arguments[3],this.orientForward(t,e,i,s)):(6===arguments.length||7===arguments)&&(this.orientForward(t,e,i),this.orientUp(n,o,r,s)),[this.listener.forwardX.value,this.listener.forwardY.value,this.listener.forwardZ.value,this.listener.upX.value,this.listener.upY.value,this.listener.upZ.value]},t.Listener3D.prototype.orientForward=function(t,e,i,n){return this.forwardX(t,n),this.forwardY(e,n),this.forwardZ(i,n),[this.listener.forwardX,this.listener.forwardY,this.listener.forwardZ]},t.Listener3D.prototype.orientUp=function(t,e,i,n){return this.upX(t,n),this.upY(e,n),this.upZ(i,n),[this.listener.upX,this.listener.upY,this.listener.upZ]},t.Listener3D.prototype.forwardX=function(t,e){var i=e||0;return"number"==typeof t?(this.listener.forwardX.value=t,this.listener.forwardX.cancelScheduledValues(this.ac.currentTime+.01+i),this.listener.forwardX.linearRampToValueAtTime(t,this.ac.currentTime+.02+i)):t&&t.connect(this.listener.forwardX),this.listener.forwardX.value},t.Listener3D.prototype.forwardY=function(t,e){var i=e||0;return"number"==typeof t?(this.listener.forwardY.value=t,this.listener.forwardY.cancelScheduledValues(this.ac.currentTime+.01+i),this.listener.forwardY.linearRampToValueAtTime(t,this.ac.currentTime+.02+i)):t&&t.connect(this.listener.forwardY),this.listener.forwardY.value},t.Listener3D.prototype.forwardZ=function(t,e){var i=e||0;return"number"==typeof t?(this.listener.forwardZ.value=t,this.listener.forwardZ.cancelScheduledValues(this.ac.currentTime+.01+i),this.listener.forwardZ.linearRampToValueAtTime(t,this.ac.currentTime+.02+i)):t&&t.connect(this.listener.forwardZ),this.listener.forwardZ.value},t.Listener3D.prototype.upX=function(t,e){var i=e||0;return"number"==typeof t?(this.listener.upX.value=t,this.listener.upX.cancelScheduledValues(this.ac.currentTime+.01+i),this.listener.upX.linearRampToValueAtTime(t,this.ac.currentTime+.02+i)):t&&t.connect(this.listener.upX),this.listener.upX.value},t.Listener3D.prototype.upY=function(t,e){var i=e||0;return"number"==typeof t?(this.listener.upY.value=t,this.listener.upY.cancelScheduledValues(this.ac.currentTime+.01+i),this.listener.upY.linearRampToValueAtTime(t,this.ac.currentTime+.02+i)):t&&t.connect(this.listener.upY),this.listener.upY.value},t.Listener3D.prototype.upZ=function(t,e){var i=e||0;return"number"==typeof t?(this.listener.upZ.value=t,this.listener.upZ.cancelScheduledValues(this.ac.currentTime+.01+i),this.listener.upZ.linearRampToValueAtTime(t,this.ac.currentTime+.02+i)):t&&t.connect(this.listener.upZ),this.listener.upZ.value},t.Listener3D}(a,Y);var J;J=function(){var e=z,i=Y;t.Delay=function(){i.call(this),this._split=this.ac.createChannelSplitter(2),this._merge=this.ac.createChannelMerger(2),this._leftGain=this.ac.createGain(),this._rightGain=this.ac.createGain(),this.leftDelay=this.ac.createDelay(),this.rightDelay=this.ac.createDelay(),this._leftFilter=new e,this._rightFilter=new e,this._leftFilter.disconnect(),this._rightFilter.disconnect(),this._leftFilter.biquad.frequency.setValueAtTime(1200,this.ac.currentTime),this._rightFilter.biquad.frequency.setValueAtTime(1200,this.ac.currentTime),this._leftFilter.biquad.Q.setValueAtTime(.3,this.ac.currentTime),this._rightFilter.biquad.Q.setValueAtTime(.3,this.ac.currentTime),this.input.connect(this._split),this.leftDelay.connect(this._leftGain),this.rightDelay.connect(this._rightGain),this._leftGain.connect(this._leftFilter.input),this._rightGain.connect(this._rightFilter.input),this._merge.connect(this.wet),this._leftFilter.biquad.gain.setValueAtTime(1,this.ac.currentTime),this._rightFilter.biquad.gain.setValueAtTime(1,this.ac.currentTime),this.setType(0),this._maxDelay=this.leftDelay.delayTime.maxValue,this.feedback(.5)},t.Delay.prototype=Object.create(i.prototype),t.Delay.prototype.process=function(t,e,i,n){var o=i||0,r=e||0;if(o>=1)throw new Error("Feedback value will force a positive feedback loop.");if(r>=this._maxDelay)throw new Error("Delay Time exceeds maximum delay time of "+this._maxDelay+" second.");t.connect(this.input),this.leftDelay.delayTime.setValueAtTime(r,this.ac.currentTime),this.rightDelay.delayTime.setValueAtTime(r,this.ac.currentTime),this._leftGain.gain.value=o,this._rightGain.gain.value=o,n&&(this._leftFilter.freq(n),this._rightFilter.freq(n))},t.Delay.prototype.delayTime=function(t){"number"!=typeof t?(t.connect(this.leftDelay.delayTime),t.connect(this.rightDelay.delayTime)):(this.leftDelay.delayTime.cancelScheduledValues(this.ac.currentTime),this.rightDelay.delayTime.cancelScheduledValues(this.ac.currentTime),this.leftDelay.delayTime.linearRampToValueAtTime(t,this.ac.currentTime),this.rightDelay.delayTime.linearRampToValueAtTime(t,this.ac.currentTime))},t.Delay.prototype.feedback=function(t){if(t&&"number"!=typeof t)t.connect(this._leftGain.gain),t.connect(this._rightGain.gain);else{if(t>=1)throw new Error("Feedback value will force a positive feedback loop.");"number"==typeof t&&(this._leftGain.gain.value=t,this._rightGain.gain.value=t)}return this._leftGain.gain.value},t.Delay.prototype.filter=function(t,e){this._leftFilter.set(t,e),this._rightFilter.set(t,e)},t.Delay.prototype.setType=function(t){switch(1===t&&(t="pingPong"),this._split.disconnect(),this._leftFilter.disconnect(),this._rightFilter.disconnect(),this._split.connect(this.leftDelay,0),this._split.connect(this.rightDelay,1),t){case"pingPong":this._rightFilter.setType(this._leftFilter.biquad.type),this._leftFilter.output.connect(this._merge,0,0),this._rightFilter.output.connect(this._merge,0,1),this._leftFilter.output.connect(this.rightDelay),this._rightFilter.output.connect(this.leftDelay);break;default:this._leftFilter.output.connect(this._merge,0,0),this._rightFilter.output.connect(this._merge,0,1),this._leftFilter.output.connect(this.leftDelay),this._rightFilter.output.connect(this.rightDelay)}},t.Delay.prototype.dispose=function(){i.prototype.dispose.apply(this),this._split.disconnect(),this._leftFilter.dispose(),this._rightFilter.dispose(),this._merge.disconnect(),this._leftGain.disconnect(),this._rightGain.disconnect(),this.leftDelay.disconnect(),this.rightDelay.disconnect(),this._split=void 0,this._leftFilter=void 0,this._rightFilter=void 0,this._merge=void 0,this._leftGain=void 0,this._rightGain=void 0,this.leftDelay=void 0,this.rightDelay=void 0}}(z,Y);var K;K=function(){var e=c,i=Y;t.Reverb=function(){i.call(this),this._initConvolverNode(),this.input.gain.value=.5,this._seconds=3,this._decay=2,this._reverse=!1,this._buildImpulse()},t.Reverb.prototype=Object.create(i.prototype),t.Reverb.prototype._initConvolverNode=function(){this.convolverNode=this.ac.createConvolver(),this.input.connect(this.convolverNode),this.convolverNode.connect(this.wet)},t.Reverb.prototype._teardownConvolverNode=function(){this.convolverNode&&(this.convolverNode.disconnect(),delete this.convolverNode)},t.Reverb.prototype._setBuffer=function(t){this._teardownConvolverNode(),this._initConvolverNode(),this.convolverNode.buffer=t},t.Reverb.prototype.process=function(t,e,i,n){t.connect(this.input);var o=!1;e&&(this._seconds=e,o=!0),i&&(this._decay=i),n&&(this._reverse=n),o&&this._buildImpulse()},t.Reverb.prototype.set=function(t,e,i){var n=!1;t&&(this._seconds=t,n=!0),e&&(this._decay=e),i&&(this._reverse=i),n&&this._buildImpulse()},t.Reverb.prototype._buildImpulse=function(){var t,e,i=this.ac.sampleRate,n=i*this._seconds,o=this._decay,r=this.ac.createBuffer(2,n,i),s=r.getChannelData(0),a=r.getChannelData(1);for(e=0;n>e;e++)t=this._reverse?n-e:e,s[e]=(2*Math.random()-1)*Math.pow(1-t/n,o),a[e]=(2*Math.random()-1)*Math.pow(1-t/n,o);this._setBuffer(r)},t.Reverb.prototype.dispose=function(){i.prototype.dispose.apply(this),this._teardownConvolverNode()},t.Convolver=function(e,i,n){t.Reverb.call(this),this._initConvolverNode(),this.input.gain.value=.5,e?(this.impulses=[],this._loadBuffer(e,i,n)):(this._seconds=3,this._decay=2,this._reverse=!1,this._buildImpulse())},t.Convolver.prototype=Object.create(t.Reverb.prototype),t.prototype.registerPreloadMethod("createConvolver",t.prototype),t.prototype.createConvolver=function(e,i,n){window.location.origin.indexOf("file://")>-1&&"undefined"===window.cordova&&alert("This sketch may require a server to load external files. Please see http://bit.ly/1qcInwS");var o=this,r=new t.Convolver(e,function(t){"function"==typeof i&&i(t),"function"==typeof o._decrementPreload&&o._decrementPreload()},n);return r.impulses=[],r},t.Convolver.prototype._loadBuffer=function(i,n,o){var i=t.prototype._checkFileFormats(i),r=this,s=(new Error).stack,a=t.prototype.getAudioContext(),u=new XMLHttpRequest;u.open("GET",i,!0),u.responseType="arraybuffer",u.onload=function(){if(200===u.status)a.decodeAudioData(u.response,function(t){var e={},o=i.split("/");e.name=o[o.length-1],e.audioBuffer=t,r.impulses.push(e),r._setBuffer(e.audioBuffer),n&&n(e)},function(){var t=new e("decodeAudioData",s,r.url),i="AudioContext error at decodeAudioData for "+r.url;o?(t.msg=i,o(t)):console.error(i+"\n The error stack trace includes: \n"+t.stack)});else{var t=new e("loadConvolver",s,r.url),c="Unable to load "+r.url+". The request status was: "+u.status+" ("+u.statusText+")";o?(t.message=c,o(t)):console.error(c+"\n The error stack trace includes: \n"+t.stack)}},u.onerror=function(){var t=new e("loadConvolver",s,r.url),i="There was no response from the server at "+r.url+". Check the url and internet connectivity.";o?(t.message=i,o(t)):console.error(i+"\n The error stack trace includes: \n"+t.stack)},u.send()},t.Convolver.prototype.set=null,t.Convolver.prototype.process=function(t){t.connect(this.input)},t.Convolver.prototype.impulses=[],t.Convolver.prototype.addImpulse=function(t,e,i){window.location.origin.indexOf("file://")>-1&&"undefined"===window.cordova&&alert("This sketch may require a server to load external files. Please see http://bit.ly/1qcInwS"),this._loadBuffer(t,e,i)},t.Convolver.prototype.resetImpulse=function(t,e,i){window.location.origin.indexOf("file://")>-1&&"undefined"===window.cordova&&alert("This sketch may require a server to load external files. Please see http://bit.ly/1qcInwS"),this.impulses=[],this._loadBuffer(t,e,i)},t.Convolver.prototype.toggleImpulse=function(t){if("number"==typeof t&&tthis._nextTick&&this._state;){var s=this._state.getValueAtTime(this._nextTick);if(s!==this._lastState){this._lastState=s;var a=this._state.get(this._nextTick);s===t.State.Started?(this._nextTick=a.time,this.isUndef(a.offset)||(this.ticks=a.offset),this.emit("start",a.time,this.ticks)):s===t.State.Stopped?(this.ticks=0,this.emit("stop",a.time)):s===t.State.Paused&&this.emit("pause",a.time)}var u=this._nextTick;this.frequency&&(this._nextTick+=1/this.frequency.getValueAtTime(this._nextTick),s===t.State.Started&&(this.callback(u),this.ticks++))}},t.Clock.prototype.getStateAtTime=function(t){return t=this.toSeconds(t),this._state.getValueAtTime(t)},t.Clock.prototype.dispose=function(){t.Emitter.prototype.dispose.call(this),this.context.off("tick",this._boundLoop),this._writable("frequency"),this.frequency.dispose(),this.frequency=null,this._boundLoop=null,this._nextTick=1/0,this.callback=null,this._state.dispose(),this._state=null},t.Clock}(n,q,tt,o);var it;it=function(){var e=a,i=et;t.Metro=function(){this.clock=new i({callback:this.ontick.bind(this)}),this.syncedParts=[],this.bpm=120,this._init(),this.prevTick=0,this.tatumTime=0,this.tickCallback=function(){}},t.Metro.prototype.ontick=function(t){var i=t-this.prevTick,n=t-e.audiocontext.currentTime;if(!(i-this.tatumTime<=-.02)){this.prevTick=t;var o=this;this.syncedParts.forEach(function(t){t.isPlaying&&(t.incrementStep(n),t.phrases.forEach(function(t){var e=t.sequence,i=o.metroTicks%e.length;0!==e[i]&&(o.metroTicks=t.parts.length?(t.scoreStep=0,t.onended()):(t.scoreStep=0,t.parts[t.currentPart-1].stop(),t.parts[t.currentPart].start())}var i=a,n=120;t.prototype.setBPM=function(t,e){n=t;for(var o in i.parts)i.parts[o]&&i.parts[o].setBPM(t,e)},t.Phrase=function(t,e,i){this.phraseStep=0,this.name=t,this.callback=e,this.sequence=i},t.Part=function(e,o){this.length=e||0,this.partStep=0,
+this.phrases=[],this.isPlaying=!1,this.noLoop(),this.tatums=o||.0625,this.metro=new t.Metro,this.metro._init(),this.metro.beatLength(this.tatums),this.metro.setBPM(n),i.parts.push(this),this.callback=function(){}},t.Part.prototype.setBPM=function(t,e){this.metro.setBPM(t,e)},t.Part.prototype.getBPM=function(){return this.metro.getBPM()},t.Part.prototype.start=function(t){if(!this.isPlaying){this.isPlaying=!0,this.metro.resetSync(this);var e=t||0;this.metro.start(e)}},t.Part.prototype.loop=function(t){this.looping=!0,this.onended=function(){this.partStep=0};var e=t||0;this.start(e)},t.Part.prototype.noLoop=function(){this.looping=!1,this.onended=function(){this.stop()}},t.Part.prototype.stop=function(t){this.partStep=0,this.pause(t)},t.Part.prototype.pause=function(t){this.isPlaying=!1;var e=t||0;this.metro.stop(e)},t.Part.prototype.addPhrase=function(e,i,n){var o;if(3===arguments.length)o=new t.Phrase(e,i,n);else{if(!(arguments[0]instanceof t.Phrase))throw"invalid input. addPhrase accepts name, callback, array or a p5.Phrase";o=arguments[0]}this.phrases.push(o),o.sequence.length>this.length&&(this.length=o.sequence.length)},t.Part.prototype.removePhrase=function(t){for(var e in this.phrases)this.phrases[e].name===t&&this.phrases.splice(e,1)},t.Part.prototype.getPhrase=function(t){for(var e in this.phrases)if(this.phrases[e].name===t)return this.phrases[e]},t.Part.prototype.replaceSequence=function(t,e){for(var i in this.phrases)this.phrases[i].name===t&&(this.phrases[i].sequence=e)},t.Part.prototype.incrementStep=function(t){this.partStep0&&o.iterations<=o.maxIterations&&o.callback(i)},frequency:this._calcFreq()})},t.SoundLoop.prototype.start=function(t){var i=t||0,n=e.audiocontext.currentTime;this.isPlaying||(this.clock.start(n+i),this.isPlaying=!0)},t.SoundLoop.prototype.stop=function(t){var i=t||0,n=e.audiocontext.currentTime;this.isPlaying&&(this.clock.stop(n+i),this.isPlaying=!1)},t.SoundLoop.prototype.pause=function(t){var i=t||0,n=e.audiocontext.currentTime;this.isPlaying&&(this.clock.pause(n+i),this.isPlaying=!1)},t.SoundLoop.prototype.syncedStart=function(t,i){var n=i||0,o=e.audiocontext.currentTime;if(t.isPlaying){if(t.isPlaying){var r=t.clock._nextTick-e.audiocontext.currentTime;this.clock.start(o+r),this.isPlaying=!0}}else t.clock.start(o+n),t.isPlaying=!0,this.clock.start(o+n),this.isPlaying=!0},t.SoundLoop.prototype._update=function(){this.clock.frequency.value=this._calcFreq()},t.SoundLoop.prototype._calcFreq=function(){return"number"==typeof this._interval?(this.musicalTimeMode=!1,1/this._interval):"string"==typeof this._interval?(this.musicalTimeMode=!0,this._bpm/60/this._convertNotation(this._interval)*(this._timeSignature/4)):void 0},t.SoundLoop.prototype._convertNotation=function(t){var e=t.slice(-1);switch(t=Number(t.slice(0,-1)),e){case"m":return this._measure(t);case"n":return this._note(t);default:console.warn("Specified interval is not formatted correctly. See Tone.js timing reference for more info: https://github.com/Tonejs/Tone.js/wiki/Time")}},t.SoundLoop.prototype._measure=function(t){return t*this._timeSignature},t.SoundLoop.prototype._note=function(t){return this._timeSignature/t},Object.defineProperty(t.SoundLoop.prototype,"bpm",{get:function(){return this._bpm},set:function(t){this.musicalTimeMode||console.warn('Changing the BPM in "seconds" mode has no effect. BPM is only relevant in musicalTimeMode when the interval is specified as a string ("2n", "4n", "1m"...etc)'),this._bpm=t,this._update()}}),Object.defineProperty(t.SoundLoop.prototype,"timeSignature",{get:function(){return this._timeSignature},set:function(t){this.musicalTimeMode||console.warn('Changing the timeSignature in "seconds" mode has no effect. BPM is only relevant in musicalTimeMode when the interval is specified as a string ("2n", "4n", "1m"...etc)'),this._timeSignature=t,this._update()}}),Object.defineProperty(t.SoundLoop.prototype,"interval",{get:function(){return this._interval},set:function(t){this.musicalTimeMode="Number"==typeof t?!1:!0,this._interval=t,this._update()}}),Object.defineProperty(t.SoundLoop.prototype,"iterations",{get:function(){return this.clock.ticks}}),t.SoundLoop}(a,et);var rt;rt=function(){"use strict";var e=Y;return t.Compressor=function(){e.call(this),this.compressor=this.ac.createDynamicsCompressor(),this.input.connect(this.compressor),this.compressor.connect(this.wet)},t.Compressor.prototype=Object.create(e.prototype),t.Compressor.prototype.process=function(t,e,i,n,o,r){t.connect(this.input),this.set(e,i,n,o,r)},t.Compressor.prototype.set=function(t,e,i,n,o){"undefined"!=typeof t&&this.attack(t),"undefined"!=typeof e&&this.knee(e),"undefined"!=typeof i&&this.ratio(i),"undefined"!=typeof n&&this.threshold(n),"undefined"!=typeof o&&this.release(o)},t.Compressor.prototype.attack=function(t,e){var i=e||0;return"number"==typeof t?(this.compressor.attack.value=t,this.compressor.attack.cancelScheduledValues(this.ac.currentTime+.01+i),this.compressor.attack.linearRampToValueAtTime(t,this.ac.currentTime+.02+i)):"undefined"!=typeof t&&t.connect(this.compressor.attack),this.compressor.attack.value},t.Compressor.prototype.knee=function(t,e){var i=e||0;return"number"==typeof t?(this.compressor.knee.value=t,this.compressor.knee.cancelScheduledValues(this.ac.currentTime+.01+i),this.compressor.knee.linearRampToValueAtTime(t,this.ac.currentTime+.02+i)):"undefined"!=typeof t&&t.connect(this.compressor.knee),this.compressor.knee.value},t.Compressor.prototype.ratio=function(t,e){var i=e||0;return"number"==typeof t?(this.compressor.ratio.value=t,this.compressor.ratio.cancelScheduledValues(this.ac.currentTime+.01+i),this.compressor.ratio.linearRampToValueAtTime(t,this.ac.currentTime+.02+i)):"undefined"!=typeof t&&t.connect(this.compressor.ratio),this.compressor.ratio.value},t.Compressor.prototype.threshold=function(t,e){var i=e||0;return"number"==typeof t?(this.compressor.threshold.value=t,this.compressor.threshold.cancelScheduledValues(this.ac.currentTime+.01+i),this.compressor.threshold.linearRampToValueAtTime(t,this.ac.currentTime+.02+i)):"undefined"!=typeof t&&t.connect(this.compressor.threshold),this.compressor.threshold.value},t.Compressor.prototype.release=function(t,e){var i=e||0;return"number"==typeof t?(this.compressor.release.value=t,this.compressor.release.cancelScheduledValues(this.ac.currentTime+.01+i),this.compressor.release.linearRampToValueAtTime(t,this.ac.currentTime+.02+i)):"undefined"!=typeof number&&t.connect(this.compressor.release),this.compressor.release.value},t.Compressor.prototype.reduction=function(){return this.compressor.reduction.value},t.Compressor.prototype.dispose=function(){e.prototype.dispose.apply(this),this.compressor&&(this.compressor.disconnect(),delete this.compressor)},t.Compressor}(a,Y,c);var st;st=function(){var e=a,i=u.convertToWav,n=e.audiocontext;t.SoundRecorder=function(){this.input=n.createGain(),this.output=n.createGain(),this.recording=!1,this.bufferSize=1024,this._channels=2,this._clear(),this._jsNode=n.createScriptProcessor(this.bufferSize,this._channels,2),this._jsNode.onaudioprocess=this._audioprocess.bind(this),this._callback=function(){},this._jsNode.connect(t.soundOut._silentNode),this.setInput(),e.soundArray.push(this)},t.SoundRecorder.prototype.setInput=function(e){this.input.disconnect(),this.input=null,this.input=n.createGain(),this.input.connect(this._jsNode),this.input.connect(this.output),e?e.connect(this.input):t.soundOut.output.connect(this.input)},t.SoundRecorder.prototype.record=function(t,e,i){this.recording=!0,e&&(this.sampleLimit=Math.round(e*n.sampleRate)),t&&i?this._callback=function(){this.buffer=this._getBuffer(),t.setBuffer(this.buffer),i()}:t&&(this._callback=function(){this.buffer=this._getBuffer(),t.setBuffer(this.buffer)})},t.SoundRecorder.prototype.stop=function(){this.recording=!1,this._callback(),this._clear()},t.SoundRecorder.prototype._clear=function(){this._leftBuffers=[],this._rightBuffers=[],this.recordedSamples=0,this.sampleLimit=null},t.SoundRecorder.prototype._audioprocess=function(t){if(this.recording!==!1&&this.recording===!0)if(this.sampleLimit&&this.recordedSamples>=this.sampleLimit)this.stop();else{var e=t.inputBuffer.getChannelData(0),i=t.inputBuffer.getChannelData(1);this._leftBuffers.push(new Float32Array(e)),this._rightBuffers.push(new Float32Array(i)),this.recordedSamples+=this.bufferSize}},t.SoundRecorder.prototype._getBuffer=function(){var t=[];return t.push(this._mergeBuffers(this._leftBuffers)),t.push(this._mergeBuffers(this._rightBuffers)),t},t.SoundRecorder.prototype._mergeBuffers=function(t){for(var e=new Float32Array(this.recordedSamples),i=0,n=t.length,o=0;n>o;o++){var r=t[o];e.set(r,i),i+=r.length}return e},t.SoundRecorder.prototype.dispose=function(){this._clear();var t=e.soundArray.indexOf(this);e.soundArray.splice(t,1),this._callback=function(){},this.input&&this.input.disconnect(),this.input=null,this._jsNode=null},t.prototype.saveSound=function(e,n){const o=i(e.buffer);t.prototype.writeFile([o],n,"wav")}}(a,u);var at;at=function(){t.PeakDetect=function(t,e,i,n){this.framesPerPeak=n||20,this.framesSinceLastPeak=0,this.decayRate=.95,this.threshold=i||.35,this.cutoff=0,this.cutoffMult=1.5,this.energy=0,this.penergy=0,this.currentValue=0,this.isDetected=!1,this.f1=t||40,this.f2=e||2e4,this._onPeak=function(){}},t.PeakDetect.prototype.update=function(t){var e=this.energy=t.getEnergy(this.f1,this.f2)/255;e>this.cutoff&&e>this.threshold&&e-this.penergy>0?(this._onPeak(),this.isDetected=!0,this.cutoff=e*this.cutoffMult,this.framesSinceLastPeak=0):(this.isDetected=!1,this.framesSinceLastPeak<=this.framesPerPeak?this.framesSinceLastPeak++:(this.cutoff*=this.decayRate,this.cutoff=Math.max(this.cutoff,this.threshold))),this.currentValue=e,this.penergy=e},t.PeakDetect.prototype.onPeak=function(t,e){var i=this;i._onPeak=function(){t(i.energy,e)}}}();var ut;ut=function(){var e=a;t.Gain=function(){this.ac=e.audiocontext,this.input=this.ac.createGain(),this.output=this.ac.createGain(),this.input.gain.value=.5,this.input.connect(this.output),e.soundArray.push(this)},t.Gain.prototype.setInput=function(t){t.connect(this.input)},t.Gain.prototype.connect=function(e){var i=e||t.soundOut.input;this.output.connect(i.input?i.input:i)},t.Gain.prototype.disconnect=function(){this.output&&this.output.disconnect()},t.Gain.prototype.amp=function(t,i,n){var i=i||0,n=n||0,o=e.audiocontext.currentTime,r=this.output.gain.value;this.output.gain.cancelScheduledValues(o),this.output.gain.linearRampToValueAtTime(r,o+n),this.output.gain.linearRampToValueAtTime(t,o+n+i)},t.Gain.prototype.dispose=function(){var t=e.soundArray.indexOf(this);e.soundArray.splice(t,1),this.output&&(this.output.disconnect(),delete this.output),this.input&&(this.input.disconnect(),delete this.input)}}(a);var ct;ct=function(){var e=a;return t.AudioVoice=function(){this.ac=e.audiocontext,this.output=this.ac.createGain(),this.connect(),e.soundArray.push(this)},t.AudioVoice.prototype.play=function(t,e,i,n){},t.AudioVoice.prototype.triggerAttack=function(t,e,i){},t.AudioVoice.prototype.triggerRelease=function(t){},t.AudioVoice.prototype.amp=function(t,e){},t.AudioVoice.prototype.connect=function(t){var i=t||e.input;this.output.connect(i.input?i.input:i)},t.AudioVoice.prototype.disconnect=function(){this.output.disconnect()},t.AudioVoice.prototype.dispose=function(){this.output&&(this.output.disconnect(),delete this.output)},t.AudioVoice}(a);var pt;pt=function(){var e=a,i=ct,n=u.noteToFreq,o=.15;t.MonoSynth=function(){i.call(this),this.oscillator=new t.Oscillator,this.env=new t.Envelope,this.env.setRange(1,0),this.env.setExp(!0),this.setADSR(.02,.25,.05,.35),this.oscillator.disconnect(),this.oscillator.connect(this.output),this.env.disconnect(),this.env.setInput(this.output.gain),this.oscillator.output.gain.value=1,this.oscillator.start(),this.connect(),e.soundArray.push(this)},t.MonoSynth.prototype=Object.create(t.AudioVoice.prototype),t.MonoSynth.prototype.play=function(t,e,i,n){this.triggerAttack(t,e,~~i),this.triggerRelease(~~i+(n||o))},t.MonoSynth.prototype.triggerAttack=function(t,e,i){var i=~~i,o=n(t),r=e||.1;this.oscillator.freq(o,0,i),this.env.ramp(this.output.gain,i,r)},t.MonoSynth.prototype.triggerRelease=function(t){var t=t||0;this.env.ramp(this.output.gain,t,0)},t.MonoSynth.prototype.setADSR=function(t,e,i,n){this.env.setADSR(t,e,i,n)},Object.defineProperties(t.MonoSynth.prototype,{attack:{get:function(){return this.env.aTime},set:function(t){this.env.setADSR(t,this.env.dTime,this.env.sPercent,this.env.rTime)}},decay:{get:function(){return this.env.dTime},set:function(t){this.env.setADSR(this.env.aTime,t,this.env.sPercent,this.env.rTime)}},sustain:{get:function(){return this.env.sPercent},set:function(t){this.env.setADSR(this.env.aTime,this.env.dTime,t,this.env.rTime)}},release:{get:function(){return this.env.rTime},set:function(t){this.env.setADSR(this.env.aTime,this.env.dTime,this.env.sPercent,t)}}}),t.MonoSynth.prototype.amp=function(t,e){var i=e||0;return"undefined"!=typeof t&&this.oscillator.amp(t,i),this.oscillator.amp().value},t.MonoSynth.prototype.connect=function(t){var i=t||e.input;this.output.connect(i.input?i.input:i)},t.MonoSynth.prototype.disconnect=function(){this.output&&this.output.disconnect()},t.MonoSynth.prototype.dispose=function(){i.prototype.dispose.apply(this),this.env&&this.env.dispose(),this.oscillator&&this.oscillator.dispose()}}(a,ct,u);var ht;ht=function(){var e=a,i=q,n=u.noteToFreq;t.PolySynth=function(n,o){this.audiovoices=[],this.notes={},this._newest=0,this._oldest=0,this.maxVoices=o||8,this.AudioVoice=void 0===n?t.MonoSynth:n,this._voicesInUse=new i(0),this.output=e.audiocontext.createGain(),this.connect(),this._allocateVoices(),e.soundArray.push(this)},t.PolySynth.prototype._allocateVoices=function(){for(var t=0;tf?f:p}this.audiovoices[a].triggerAttack(c,p,s)},t.PolySynth.prototype._updateAfter=function(t,e){if(null!==this._voicesInUse._searchAfter(t)){this._voicesInUse._searchAfter(t).value+=e;var i=this._voicesInUse._searchAfter(t).time;this._updateAfter(i,e)}},t.PolySynth.prototype.noteRelease=function(t,i){var o=e.audiocontext.currentTime,r=i||0,s=o+r;if(t){var a=n(t);if(this.notes[a]&&null!==this.notes[a].getValueAtTime(s)){var u=Math.max(~~this._voicesInUse.getValueAtTime(s).value,1);this._voicesInUse.setValueAtTime(u-1,s),u>0&&this._updateAfter(s,-1),this.audiovoices[this.notes[a].getValueAtTime(s)].triggerRelease(r),this.notes[a].dispose(),delete this.notes[a],this._newest=0===this._newest?0:(this._newest-1)%(this.maxVoices-1)}else console.warn("Cannot release a note that is not already playing")}else{this.audiovoices.forEach(function(t){t.triggerRelease(r)}),this._voicesInUse.setValueAtTime(0,s);for(var c in this.notes)this.notes[c].dispose(),delete this.notes[c]}},t.PolySynth.prototype.connect=function(t){var i=t||e.input;this.output.connect(i.input?i.input:i)},t.PolySynth.prototype.disconnect=function(){this.output&&this.output.disconnect()},t.PolySynth.prototype.dispose=function(){this.audiovoices.forEach(function(t){t.dispose()}),this.output&&(this.output.disconnect(),delete this.output)}}(a,q,u);var lt;lt=function(){function e(t){for(var e,i="number"==typeof t?t:50,n=44100,o=new Float32Array(n),r=Math.PI/180,s=0;n>s;++s)e=2*s/n-1,o[s]=(3+i)*e*20*r/(Math.PI+i*Math.abs(e));return o}var i=Y;t.Distortion=function(n,o){if(i.call(this),"undefined"==typeof n&&(n=.25),"number"!=typeof n)throw new Error("amount must be a number");if("undefined"==typeof o&&(o="2x"),"string"!=typeof o)throw new Error("oversample must be a String");var r=t.prototype.map(n,0,1,0,2e3);this.waveShaperNode=this.ac.createWaveShaper(),this.amount=r,this.waveShaperNode.curve=e(r),this.waveShaperNode.oversample=o,this.input.connect(this.waveShaperNode),this.waveShaperNode.connect(this.wet)},t.Distortion.prototype=Object.create(i.prototype),t.Distortion.prototype.process=function(t,e,i){t.connect(this.input),this.set(e,i)},t.Distortion.prototype.set=function(i,n){if(i){var o=t.prototype.map(i,0,1,0,2e3);this.amount=o,this.waveShaperNode.curve=e(o)}n&&(this.waveShaperNode.oversample=n)},t.Distortion.prototype.getAmount=function(){return this.amount},t.Distortion.prototype.getOversample=function(){return this.waveShaperNode.oversample},t.Distortion.prototype.dispose=function(){i.prototype.dispose.apply(this),this.waveShaperNode&&(this.waveShaperNode.disconnect(),this.waveShaperNode=null)}}(Y);var ft;ft=function(){var t=a;return t}(e,s,a,u,c,p,h,l,f,k,O,M,E,V,R,z,Q,H,$,J,K,it,nt,ot,rt,st,at,ut,pt,ht,lt,ct,pt,ht)});
\ No newline at end of file
diff --git a/public/js/p5-v1.1.9.min.js b/public/js/p5-v1.1.9.min.js
new file mode 100644
index 0000000..275116f
--- /dev/null
+++ b/public/js/p5-v1.1.9.min.js
@@ -0,0 +1,3 @@
+/*! p5.js v1.1.9 July 22, 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(i,s,l){function p(t,e){if(!s[t]){if(!i[t]){var r="function"==typeof require&&require;if(!e&&r)return r(t,!0);if(u)return u(t,!0);var n=new Error("Cannot find module '"+t+"'");throw n.code="MODULE_NOT_FOUND",n}var a=s[t]={exports:{}};i[t][0].call(a.exports,function(e){return p(i[t][1][e]||e)},a,a.exports,o,i,s,l)}return s[t].exports}for(var u="function"==typeof require&&require,e=0;ep5.Color object, color components,\n or CSS color
\n',type:"p5.Color|Number[]|String"}],class:"p5",module:"Color"},blue:{name:"blue",params:[{name:"color",description:'p5.Color object, color components,\n or CSS color
\n',type:"p5.Color|Number[]|String"}],class:"p5",module:"Color"},brightness:{name:"brightness",params:[{name:"color",description:'p5.Color object, color components,\n or CSS color
\n',type:"p5.Color|Number[]|String"}],class:"p5",module:"Color"},color:{name:"color",class:"p5",module:"Color",overloads:[{params:[{name:"gray",description:"number specifying value between white and black.
\n",type:"Number"},{name:"alpha",description:"alpha value relative to current color range\n (default is 0-255)
\n",type:"Number",optional:!0}]},{params:[{name:"v1",description:"red or hue value relative to\n the current color range
\n",type:"Number"},{name:"v2",description:"green or saturation value\n relative to the current color range
\n",type:"Number"},{name:"v3",description:"blue or brightness value\n relative to the current color range
\n",type:"Number"},{name:"alpha",description:"",type:"Number",optional:!0}]},{params:[{name:"value",description:"a color string
\n",type:"String"}]},{params:[{name:"values",description:"an array containing the red,green,blue &\n and alpha components of the color
\n",type:"Number[]"}]},{params:[{name:"color",description:"",type:"p5.Color"}]}]},green:{name:"green",params:[{name:"color",description:'p5.Color object, color components,\n or CSS color
\n',type:"p5.Color|Number[]|String"}],class:"p5",module:"Color"},hue:{name:"hue",params:[{name:"color",description:'p5.Color object, color components,\n or CSS color
\n',type:"p5.Color|Number[]|String"}],class:"p5",module:"Color"},lerpColor:{name:"lerpColor",params:[{name:"c1",description:"interpolate from this color
\n",type:"p5.Color"},{name:"c2",description:"interpolate to this color
\n",type:"p5.Color"},{name:"amt",description:"number between 0 and 1
\n",type:"Number"}],class:"p5",module:"Color"},lightness:{name:"lightness",params:[{name:"color",description:'p5.Color object, color components,\n or CSS color
\n',type:"p5.Color|Number[]|String"}],class:"p5",module:"Color"},red:{name:"red",params:[{name:"color",description:'p5.Color object, color components,\n or CSS color
\n',type:"p5.Color|Number[]|String"}],class:"p5",module:"Color"},saturation:{name:"saturation",params:[{name:"color",description:'p5.Color object, color components,\n or CSS color
\n',type:"p5.Color|Number[]|String"}],class:"p5",module:"Color"},background:{name:"background",class:"p5",module:"Color",overloads:[{params:[{name:"color",description:'any value created by the color() function
\n',type:"p5.Color"}],chainable:1},{params:[{name:"colorstring",description:"color string, possible formats include: integer\n rgb() or rgba(), percentage rgb() or rgba(),\n 3-digit hex, 6-digit hex
\n",type:"String"},{name:"a",description:"opacity of the background relative to current\n color range (default is 0-255)
\n",type:"Number",optional:!0}],chainable:1},{params:[{name:"gray",description:"specifies a value between white and black
\n",type:"Number"},{name:"a",description:"",type:"Number",optional:!0}],chainable:1},{params:[{name:"v1",description:"red or hue value (depending on the current color\n mode)
\n",type:"Number"},{name:"v2",description:"green or saturation value (depending on the current\n color mode)
\n",type:"Number"},{name:"v3",description:"blue or brightness value (depending on the current\n color mode)
\n",type:"Number"},{name:"a",description:"",type:"Number",optional:!0}],chainable:1},{params:[{name:"values",description:"an array containing the red, green, blue\n and alpha components of the color
\n",type:"Number[]"}],chainable:1},{params:[{name:"image",description:'image created with loadImage() or createImage(),\n to set as background\n (must be same size as the sketch window)
\n',type:"p5.Image"},{name:"a",description:"",type:"Number",optional:!0}],chainable:1}]},clear:{name:"clear",class:"p5",module:"Color"},colorMode:{name:"colorMode",class:"p5",module:"Color",overloads:[{params:[{name:"mode",description:"either RGB, HSB or HSL, corresponding to\n Red/Green/Blue and Hue/Saturation/Brightness\n (or Lightness)
\n",type:"Constant"},{name:"max",description:"range for all values
\n",type:"Number",optional:!0}],chainable:1},{params:[{name:"mode",description:"",type:"Constant"},{name:"max1",description:"range for the red or hue depending on the\n current color mode
\n",type:"Number"},{name:"max2",description:"range for the green or saturation depending\n on the current color mode
\n",type:"Number"},{name:"max3",description:"range for the blue or brightness/lightness\n depending on the current color mode
\n",type:"Number"},{name:"maxA",description:"range for the alpha
\n",type:"Number",optional:!0}],chainable:1}]},fill:{name:"fill",class:"p5",module:"Color",overloads:[{params:[{name:"v1",description:"red or hue value relative to\n the current color range
\n",type:"Number"},{name:"v2",description:"green or saturation value\n relative to the current color range
\n",type:"Number"},{name:"v3",description:"blue or brightness value\n relative to the current color range
\n",type:"Number"},{name:"alpha",description:"",type:"Number",optional:!0}],chainable:1},{params:[{name:"value",description:"a color string
\n",type:"String"}],chainable:1},{params:[{name:"gray",description:"a gray value
\n",type:"Number"},{name:"alpha",description:"",type:"Number",optional:!0}],chainable:1},{params:[{name:"values",description:"an array containing the red,green,blue &\n and alpha components of the color
\n",type:"Number[]"}],chainable:1},{params:[{name:"color",description:"the fill color
\n",type:"p5.Color"}],chainable:1}]},noFill:{name:"noFill",class:"p5",module:"Color"},noStroke:{name:"noStroke",class:"p5",module:"Color"},stroke:{name:"stroke",class:"p5",module:"Color",overloads:[{params:[{name:"v1",description:"red or hue value relative to\n the current color range
\n",type:"Number"},{name:"v2",description:"green or saturation value\n relative to the current color range
\n",type:"Number"},{name:"v3",description:"blue or brightness value\n relative to the current color range
\n",type:"Number"},{name:"alpha",description:"",type:"Number",optional:!0}],chainable:1},{params:[{name:"value",description:"a color string
\n",type:"String"}],chainable:1},{params:[{name:"gray",description:"a gray value
\n",type:"Number"},{name:"alpha",description:"",type:"Number",optional:!0}],chainable:1},{params:[{name:"values",description:"an array containing the red,green,blue &\n and alpha components of the color
\n",type:"Number[]"}],chainable:1},{params:[{name:"color",description:"the stroke color
\n",type:"p5.Color"}],chainable:1}]},erase:{name:"erase",params:[{name:"strengthFill",description:"A number (0-255) for the strength of erasing for a shape's fill.\n This will default to 255 when no argument is given, which\n is full strength.
\n",type:"Number",optional:!0},{name:"strengthStroke",description:"A number (0-255) for the strength of erasing for a shape's stroke.\n This will default to 255 when no argument is given, which\n is full strength.
\n",type:"Number",optional:!0}],class:"p5",module:"Color"},noErase:{name:"noErase",class:"p5",module:"Color"},arc:{name:"arc",params:[{name:"x",description:"x-coordinate of the arc's ellipse
\n",type:"Number"},{name:"y",description:"y-coordinate of the arc's ellipse
\n",type:"Number"},{name:"w",description:"width of the arc's ellipse by default
\n",type:"Number"},{name:"h",description:"height of the arc's ellipse by default
\n",type:"Number"},{name:"start",description:"angle to start the arc, specified in radians
\n",type:"Number"},{name:"stop",description:"angle to stop the arc, specified in radians
\n",type:"Number"},{name:"mode",description:"optional parameter to determine the way of drawing\n the arc. either CHORD, PIE or OPEN
\n",type:"Constant",optional:!0},{name:"detail",description:"optional parameter for WebGL mode only. This is to\n specify the number of vertices that makes up the\n perimeter of the arc. Default value is 25.
\n",type:"Number",optional:!0}],class:"p5",module:"Shape"},ellipse:{name:"ellipse",class:"p5",module:"Shape",overloads:[{params:[{name:"x",description:"x-coordinate of the center of ellipse.
\n",type:"Number"},{name:"y",description:"y-coordinate of the center of ellipse.
\n",type:"Number"},{name:"w",description:"width of the ellipse.
\n",type:"Number"},{name:"h",description:"height of the ellipse.
\n",type:"Number",optional:!0}],chainable:1},{params:[{name:"x",description:"",type:"Number"},{name:"y",description:"",type:"Number"},{name:"w",description:"",type:"Number"},{name:"h",description:"",type:"Number"},{name:"detail",description:"number of radial sectors to draw (for WebGL mode)
\n",type:"Integer"}]}]},circle:{name:"circle",params:[{name:"x",description:"x-coordinate of the centre of the circle.
\n",type:"Number"},{name:"y",description:"y-coordinate of the centre of the circle.
\n",type:"Number"},{name:"d",description:"diameter of the circle.
\n",type:"Number"}],class:"p5",module:"Shape"},line:{name:"line",class:"p5",module:"Shape",overloads:[{params:[{name:"x1",description:"the x-coordinate of the first point
\n",type:"Number"},{name:"y1",description:"the y-coordinate of the first point
\n",type:"Number"},{name:"x2",description:"the x-coordinate of the second point
\n",type:"Number"},{name:"y2",description:"the y-coordinate of the second point
\n",type:"Number"}],chainable:1},{params:[{name:"x1",description:"",type:"Number"},{name:"y1",description:"",type:"Number"},{name:"z1",description:"the z-coordinate of the first point
\n",type:"Number"},{name:"x2",description:"",type:"Number"},{name:"y2",description:"",type:"Number"},{name:"z2",description:"the z-coordinate of the second point
\n",type:"Number"}],chainable:1}]},point:{name:"point",class:"p5",module:"Shape",overloads:[{params:[{name:"x",description:"the x-coordinate
\n",type:"Number"},{name:"y",description:"the y-coordinate
\n",type:"Number"},{name:"z",description:"the z-coordinate (for WebGL mode)
\n",type:"Number",optional:!0}],chainable:1},{params:[{name:"coordinate_vector",description:"the coordinate vector
\n",type:"p5.Vector"}],chainable:1}]},quad:{name:"quad",class:"p5",module:"Shape",overloads:[{params:[{name:"x1",description:"the x-coordinate of the first point
\n",type:"Number"},{name:"y1",description:"the y-coordinate of the first point
\n",type:"Number"},{name:"x2",description:"the x-coordinate of the second point
\n",type:"Number"},{name:"y2",description:"the y-coordinate of the second point
\n",type:"Number"},{name:"x3",description:"the x-coordinate of the third point
\n",type:"Number"},{name:"y3",description:"the y-coordinate of the third point
\n",type:"Number"},{name:"x4",description:"the x-coordinate of the fourth point
\n",type:"Number"},{name:"y4",description:"the y-coordinate of the fourth point
\n",type:"Number"}],chainable:1},{params:[{name:"x1",description:"",type:"Number"},{name:"y1",description:"",type:"Number"},{name:"z1",description:"the z-coordinate of the first point
\n",type:"Number"},{name:"x2",description:"",type:"Number"},{name:"y2",description:"",type:"Number"},{name:"z2",description:"the z-coordinate of the second point
\n",type:"Number"},{name:"x3",description:"",type:"Number"},{name:"y3",description:"",type:"Number"},{name:"z3",description:"the z-coordinate of the third point
\n",type:"Number"},{name:"x4",description:"",type:"Number"},{name:"y4",description:"",type:"Number"},{name:"z4",description:"the z-coordinate of the fourth point
\n",type:"Number"}],chainable:1}]},rect:{name:"rect",class:"p5",module:"Shape",overloads:[{params:[{name:"x",description:"x-coordinate of the rectangle.
\n",type:"Number"},{name:"y",description:"y-coordinate of the rectangle.
\n",type:"Number"},{name:"w",description:"width of the rectangle.
\n",type:"Number"},{name:"h",description:"height of the rectangle.
\n",type:"Number",optional:!0},{name:"tl",description:"optional radius of top-left corner.
\n",type:"Number",optional:!0},{name:"tr",description:"optional radius of top-right corner.
\n",type:"Number",optional:!0},{name:"br",description:"optional radius of bottom-right corner.
\n",type:"Number",optional:!0},{name:"bl",description:"optional radius of bottom-left corner.
\n",type:"Number",optional:!0}],chainable:1},{params:[{name:"x",description:"",type:"Number"},{name:"y",description:"",type:"Number"},{name:"w",description:"",type:"Number"},{name:"h",description:"",type:"Number"},{name:"detailX",description:"number of segments in the x-direction (for WebGL mode)
\n",type:"Integer",optional:!0},{name:"detailY",description:"number of segments in the y-direction (for WebGL mode)
\n",type:"Integer",optional:!0}],chainable:1}]},square:{name:"square",params:[{name:"x",description:"x-coordinate of the square.
\n",type:"Number"},{name:"y",description:"y-coordinate of the square.
\n",type:"Number"},{name:"s",description:"side size of the square.
\n",type:"Number"},{name:"tl",description:"optional radius of top-left corner.
\n",type:"Number",optional:!0},{name:"tr",description:"optional radius of top-right corner.
\n",type:"Number",optional:!0},{name:"br",description:"optional radius of bottom-right corner.
\n",type:"Number",optional:!0},{name:"bl",description:"optional radius of bottom-left corner.
\n",type:"Number",optional:!0}],class:"p5",module:"Shape"},triangle:{name:"triangle",params:[{name:"x1",description:"x-coordinate of the first point
\n",type:"Number"},{name:"y1",description:"y-coordinate of the first point
\n",type:"Number"},{name:"x2",description:"x-coordinate of the second point
\n",type:"Number"},{name:"y2",description:"y-coordinate of the second point
\n",type:"Number"},{name:"x3",description:"x-coordinate of the third point
\n",type:"Number"},{name:"y3",description:"y-coordinate of the third point
\n",type:"Number"}],class:"p5",module:"Shape"},ellipseMode:{name:"ellipseMode",params:[{name:"mode",description:"either CENTER, RADIUS, CORNER, or CORNERS
\n",type:"Constant"}],class:"p5",module:"Shape"},noSmooth:{name:"noSmooth",class:"p5",module:"Shape"},rectMode:{name:"rectMode",params:[{name:"mode",description:"either CORNER, CORNERS, CENTER, or RADIUS
\n",type:"Constant"}],class:"p5",module:"Shape"},smooth:{name:"smooth",class:"p5",module:"Shape"},strokeCap:{name:"strokeCap",params:[{name:"cap",description:"either ROUND, SQUARE or PROJECT
\n",type:"Constant"}],class:"p5",module:"Shape"},strokeJoin:{name:"strokeJoin",params:[{name:"join",description:"either MITER, BEVEL, ROUND
\n",type:"Constant"}],class:"p5",module:"Shape"},strokeWeight:{name:"strokeWeight",params:[{name:"weight",description:"the weight of the stroke (in pixels)
\n",type:"Number"}],class:"p5",module:"Shape"},bezier:{name:"bezier",class:"p5",module:"Shape",overloads:[{params:[{name:"x1",description:"x-coordinate for the first anchor point
\n",type:"Number"},{name:"y1",description:"y-coordinate for the first anchor point
\n",type:"Number"},{name:"x2",description:"x-coordinate for the first control point
\n",type:"Number"},{name:"y2",description:"y-coordinate for the first control point
\n",type:"Number"},{name:"x3",description:"x-coordinate for the second control point
\n",type:"Number"},{name:"y3",description:"y-coordinate for the second control point
\n",type:"Number"},{name:"x4",description:"x-coordinate for the second anchor point
\n",type:"Number"},{name:"y4",description:"y-coordinate for the second anchor point
\n",type:"Number"}],chainable:1},{params:[{name:"x1",description:"",type:"Number"},{name:"y1",description:"",type:"Number"},{name:"z1",description:"z-coordinate for the first anchor point
\n",type:"Number"},{name:"x2",description:"",type:"Number"},{name:"y2",description:"",type:"Number"},{name:"z2",description:"z-coordinate for the first control point
\n",type:"Number"},{name:"x3",description:"",type:"Number"},{name:"y3",description:"",type:"Number"},{name:"z3",description:"z-coordinate for the second control point
\n",type:"Number"},{name:"x4",description:"",type:"Number"},{name:"y4",description:"",type:"Number"},{name:"z4",description:"z-coordinate for the second anchor point
\n",type:"Number"}],chainable:1}]},bezierDetail:{name:"bezierDetail",params:[{name:"detail",description:"resolution of the curves
\n",type:"Number"}],class:"p5",module:"Shape"},bezierPoint:{name:"bezierPoint",params:[{name:"a",description:"coordinate of first point on the curve
\n",type:"Number"},{name:"b",description:"coordinate of first control point
\n",type:"Number"},{name:"c",description:"coordinate of second control point
\n",type:"Number"},{name:"d",description:"coordinate of second point on the curve
\n",type:"Number"},{name:"t",description:"value between 0 and 1
\n",type:"Number"}],class:"p5",module:"Shape"},bezierTangent:{name:"bezierTangent",params:[{name:"a",description:"coordinate of first point on the curve
\n",type:"Number"},{name:"b",description:"coordinate of first control point
\n",type:"Number"},{name:"c",description:"coordinate of second control point
\n",type:"Number"},{name:"d",description:"coordinate of second point on the curve
\n",type:"Number"},{name:"t",description:"value between 0 and 1
\n",type:"Number"}],class:"p5",module:"Shape"},curve:{name:"curve",class:"p5",module:"Shape",overloads:[{params:[{name:"x1",description:"x-coordinate for the beginning control point
\n",type:"Number"},{name:"y1",description:"y-coordinate for the beginning control point
\n",type:"Number"},{name:"x2",description:"x-coordinate for the first point
\n",type:"Number"},{name:"y2",description:"y-coordinate for the first point
\n",type:"Number"},{name:"x3",description:"x-coordinate for the second point
\n",type:"Number"},{name:"y3",description:"y-coordinate for the second point
\n",type:"Number"},{name:"x4",description:"x-coordinate for the ending control point
\n",type:"Number"},{name:"y4",description:"y-coordinate for the ending control point
\n",type:"Number"}],chainable:1},{params:[{name:"x1",description:"",type:"Number"},{name:"y1",description:"",type:"Number"},{name:"z1",description:"z-coordinate for the beginning control point
\n",type:"Number"},{name:"x2",description:"",type:"Number"},{name:"y2",description:"",type:"Number"},{name:"z2",description:"z-coordinate for the first point
\n",type:"Number"},{name:"x3",description:"",type:"Number"},{name:"y3",description:"",type:"Number"},{name:"z3",description:"z-coordinate for the second point
\n",type:"Number"},{name:"x4",description:"",type:"Number"},{name:"y4",description:"",type:"Number"},{name:"z4",description:"z-coordinate for the ending control point
\n",type:"Number"}],chainable:1}]},curveDetail:{name:"curveDetail",params:[{name:"resolution",description:"resolution of the curves
\n",type:"Number"}],class:"p5",module:"Shape"},curveTightness:{name:"curveTightness",params:[{name:"amount",description:"amount of deformation from the original vertices
\n",type:"Number"}],class:"p5",module:"Shape"},curvePoint:{name:"curvePoint",params:[{name:"a",description:"coordinate of first control point of the curve
\n",type:"Number"},{name:"b",description:"coordinate of first point
\n",type:"Number"},{name:"c",description:"coordinate of second point
\n",type:"Number"},{name:"d",description:"coordinate of second control point
\n",type:"Number"},{name:"t",description:"value between 0 and 1
\n",type:"Number"}],class:"p5",module:"Shape"},curveTangent:{name:"curveTangent",params:[{name:"a",description:"coordinate of first control point
\n",type:"Number"},{name:"b",description:"coordinate of first point on the curve
\n",type:"Number"},{name:"c",description:"coordinate of second point on the curve
\n",type:"Number"},{name:"d",description:"coordinate of second conrol point
\n",type:"Number"},{name:"t",description:"value between 0 and 1
\n",type:"Number"}],class:"p5",module:"Shape"},beginContour:{name:"beginContour",class:"p5",module:"Shape"},beginShape:{name:"beginShape",params:[{name:"kind",description:"either POINTS, LINES, TRIANGLES, TRIANGLE_FAN\n TRIANGLE_STRIP, QUADS, QUAD_STRIP or TESS
\n",type:"Constant",optional:!0}],class:"p5",module:"Shape"},bezierVertex:{name:"bezierVertex",class:"p5",module:"Shape",overloads:[{params:[{name:"x2",description:"x-coordinate for the first control point
\n",type:"Number"},{name:"y2",description:"y-coordinate for the first control point
\n",type:"Number"},{name:"x3",description:"x-coordinate for the second control point
\n",type:"Number"},{name:"y3",description:"y-coordinate for the second control point
\n",type:"Number"},{name:"x4",description:"x-coordinate for the anchor point
\n",type:"Number"},{name:"y4",description:"y-coordinate for the anchor point
\n",type:"Number"}],chainable:1},{params:[{name:"x2",description:"",type:"Number"},{name:"y2",description:"",type:"Number"},{name:"z2",description:"z-coordinate for the first control point (for WebGL mode)
\n",type:"Number"},{name:"x3",description:"",type:"Number"},{name:"y3",description:"",type:"Number"},{name:"z3",description:"z-coordinate for the second control point (for WebGL mode)
\n",type:"Number"},{name:"x4",description:"",type:"Number"},{name:"y4",description:"",type:"Number"},{name:"z4",description:"z-coordinate for the anchor point (for WebGL mode)
\n",type:"Number"}],chainable:1}]},curveVertex:{name:"curveVertex",class:"p5",module:"Shape",overloads:[{params:[{name:"x",description:"x-coordinate of the vertex
\n",type:"Number"},{name:"y",description:"y-coordinate of the vertex
\n",type:"Number"}],chainable:1},{params:[{name:"x",description:"",type:"Number"},{name:"y",description:"",type:"Number"},{name:"z",description:"z-coordinate of the vertex (for WebGL mode)
\n",type:"Number",optional:!0}],chainable:1}]},endContour:{name:"endContour",class:"p5",module:"Shape"},endShape:{name:"endShape",params:[{name:"mode",description:"use CLOSE to close the shape
\n",type:"Constant",optional:!0}],class:"p5",module:"Shape"},quadraticVertex:{name:"quadraticVertex",class:"p5",module:"Shape",overloads:[{params:[{name:"cx",description:"x-coordinate for the control point
\n",type:"Number"},{name:"cy",description:"y-coordinate for the control point
\n",type:"Number"},{name:"x3",description:"x-coordinate for the anchor point
\n",type:"Number"},{name:"y3",description:"y-coordinate for the anchor point
\n",type:"Number"}],chainable:1},{params:[{name:"cx",description:"",type:"Number"},{name:"cy",description:"",type:"Number"},{name:"cz",description:"z-coordinate for the control point (for WebGL mode)
\n",type:"Number"},{name:"x3",description:"",type:"Number"},{name:"y3",description:"",type:"Number"},{name:"z3",description:"z-coordinate for the anchor point (for WebGL mode)
\n",type:"Number"}],chainable:1}]},vertex:{name:"vertex",class:"p5",module:"Shape",overloads:[{params:[{name:"x",description:"x-coordinate of the vertex
\n",type:"Number"},{name:"y",description:"y-coordinate of the vertex
\n",type:"Number"}],chainable:1},{params:[{name:"x",description:"",type:"Number"},{name:"y",description:"",type:"Number"},{name:"z",description:"z-coordinate of the vertex
\n",type:"Number"},{name:"u",description:"the vertex's texture u-coordinate
\n",type:"Number",optional:!0},{name:"v",description:"the vertex's texture v-coordinate
\n",type:"Number",optional:!0}],chainable:1}]},P2D:{name:"P2D",class:"p5",module:"Constants"},WEBGL:{name:"WEBGL",class:"p5",module:"Constants"},ARROW:{name:"ARROW",class:"p5",module:"Constants"},CROSS:{name:"CROSS",class:"p5",module:"Constants"},HAND:{name:"HAND",class:"p5",module:"Constants"},MOVE:{name:"MOVE",class:"p5",module:"Constants"},TEXT:{name:"TEXT",class:"p5",module:"Constants"},WAIT:{name:"WAIT",class:"p5",module:"Constants"},HALF_PI:{name:"HALF_PI",class:"p5",module:"Constants"},PI:{name:"PI",class:"p5",module:"Constants"},QUARTER_PI:{name:"QUARTER_PI",class:"p5",module:"Constants"},TAU:{name:"TAU",class:"p5",module:"Constants"},TWO_PI:{name:"TWO_PI",class:"p5",module:"Constants"},DEGREES:{name:"DEGREES",class:"p5",module:"Constants"},RADIANS:{name:"RADIANS",class:"p5",module:"Constants"},CORNER:{name:"CORNER",class:"p5",module:"Constants"},CORNERS:{name:"CORNERS",class:"p5",module:"Constants"},RADIUS:{name:"RADIUS",class:"p5",module:"Constants"},RIGHT:{name:"RIGHT",class:"p5",module:"Constants"},LEFT:{name:"LEFT",class:"p5",module:"Constants"},CENTER:{name:"CENTER",class:"p5",module:"Constants"},TOP:{name:"TOP",class:"p5",module:"Constants"},BOTTOM:{name:"BOTTOM",class:"p5",module:"Constants"},BASELINE:{name:"BASELINE",class:"p5",module:"Constants"},POINTS:{name:"POINTS",class:"p5",module:"Constants"},LINES:{name:"LINES",class:"p5",module:"Constants"},LINE_STRIP:{name:"LINE_STRIP",class:"p5",module:"Constants"},LINE_LOOP:{name:"LINE_LOOP",class:"p5",module:"Constants"},TRIANGLES:{name:"TRIANGLES",class:"p5",module:"Constants"},TRIANGLE_FAN:{name:"TRIANGLE_FAN",class:"p5",module:"Constants"},TRIANGLE_STRIP:{name:"TRIANGLE_STRIP",class:"p5",module:"Constants"},QUADS:{name:"QUADS",class:"p5",module:"Constants"},QUAD_STRIP:{name:"QUAD_STRIP",class:"p5",module:"Constants"},TESS:{name:"TESS",class:"p5",module:"Constants"},CLOSE:{name:"CLOSE",class:"p5",module:"Constants"},OPEN:{name:"OPEN",class:"p5",module:"Constants"},CHORD:{name:"CHORD",class:"p5",module:"Constants"},PIE:{name:"PIE",class:"p5",module:"Constants"},PROJECT:{name:"PROJECT",class:"p5",module:"Constants"},SQUARE:{name:"SQUARE",class:"p5",module:"Constants"},ROUND:{name:"ROUND",class:"p5",module:"Constants"},BEVEL:{name:"BEVEL",class:"p5",module:"Constants"},MITER:{name:"MITER",class:"p5",module:"Constants"},RGB:{name:"RGB",class:"p5",module:"Constants"},HSB:{name:"HSB",class:"p5",module:"Constants"},HSL:{name:"HSL",class:"p5",module:"Constants"},AUTO:{name:"AUTO",class:"p5",module:"Constants"},ALT:{name:"ALT",class:"p5",module:"Constants"},BACKSPACE:{name:"BACKSPACE",class:"p5",module:"Constants"},CONTROL:{name:"CONTROL",class:"p5",module:"Constants"},DELETE:{name:"DELETE",class:"p5",module:"Constants"},DOWN_ARROW:{name:"DOWN_ARROW",class:"p5",module:"Constants"},ENTER:{name:"ENTER",class:"p5",module:"Constants"},ESCAPE:{name:"ESCAPE",class:"p5",module:"Constants"},LEFT_ARROW:{name:"LEFT_ARROW",class:"p5",module:"Constants"},OPTION:{name:"OPTION",class:"p5",module:"Constants"},RETURN:{name:"RETURN",class:"p5",module:"Constants"},RIGHT_ARROW:{name:"RIGHT_ARROW",class:"p5",module:"Constants"},SHIFT:{name:"SHIFT",class:"p5",module:"Constants"},TAB:{name:"TAB",class:"p5",module:"Constants"},UP_ARROW:{name:"UP_ARROW",class:"p5",module:"Constants"},BLEND:{name:"BLEND",class:"p5",module:"Constants"},REMOVE:{name:"REMOVE",class:"p5",module:"Constants"},ADD:{name:"ADD",class:"p5",module:"Constants"},DARKEST:{name:"DARKEST",class:"p5",module:"Constants"},LIGHTEST:{name:"LIGHTEST",class:"p5",module:"Constants"},DIFFERENCE:{name:"DIFFERENCE",class:"p5",module:"Constants"},SUBTRACT:{name:"SUBTRACT",class:"p5",module:"Constants"},EXCLUSION:{name:"EXCLUSION",class:"p5",module:"Constants"},MULTIPLY:{name:"MULTIPLY",class:"p5",module:"Constants"},SCREEN:{name:"SCREEN",class:"p5",module:"Constants"},REPLACE:{name:"REPLACE",class:"p5",module:"Constants"},OVERLAY:{name:"OVERLAY",class:"p5",module:"Constants"},HARD_LIGHT:{name:"HARD_LIGHT",class:"p5",module:"Constants"},SOFT_LIGHT:{name:"SOFT_LIGHT",class:"p5",module:"Constants"},DODGE:{name:"DODGE",class:"p5",module:"Constants"},BURN:{name:"BURN",class:"p5",module:"Constants"},THRESHOLD:{name:"THRESHOLD",class:"p5",module:"Constants"},GRAY:{name:"GRAY",class:"p5",module:"Constants"},OPAQUE:{name:"OPAQUE",class:"p5",module:"Constants"},INVERT:{name:"INVERT",class:"p5",module:"Constants"},POSTERIZE:{name:"POSTERIZE",class:"p5",module:"Constants"},DILATE:{name:"DILATE",class:"p5",module:"Constants"},ERODE:{name:"ERODE",class:"p5",module:"Constants"},BLUR:{name:"BLUR",class:"p5",module:"Constants"},NORMAL:{name:"NORMAL",class:"p5",module:"Constants"},ITALIC:{name:"ITALIC",class:"p5",module:"Constants"},BOLD:{name:"BOLD",class:"p5",module:"Constants"},BOLDITALIC:{name:"BOLDITALIC",class:"p5",module:"Constants"},LINEAR:{name:"LINEAR",class:"p5",module:"Constants"},QUADRATIC:{name:"QUADRATIC",class:"p5",module:"Constants"},BEZIER:{name:"BEZIER",class:"p5",module:"Constants"},CURVE:{name:"CURVE",class:"p5",module:"Constants"},STROKE:{name:"STROKE",class:"p5",module:"Constants"},FILL:{name:"FILL",class:"p5",module:"Constants"},TEXTURE:{name:"TEXTURE",class:"p5",module:"Constants"},IMMEDIATE:{name:"IMMEDIATE",class:"p5",module:"Constants"},IMAGE:{name:"IMAGE",class:"p5",module:"Constants"},NEAREST:{name:"NEAREST",class:"p5",module:"Constants"},REPEAT:{name:"REPEAT",class:"p5",module:"Constants"},CLAMP:{name:"CLAMP",class:"p5",module:"Constants"},MIRROR:{name:"MIRROR",class:"p5",module:"Constants"},LANDSCAPE:{name:"LANDSCAPE",class:"p5",module:"Constants"},PORTRAIT:{name:"PORTRAIT",class:"p5",module:"Constants"},GRID:{name:"GRID",class:"p5",module:"Constants"},AXES:{name:"AXES",class:"p5",module:"Constants"},print:{name:"print",params:[{name:"contents",description:"any combination of Number, String, Object, Boolean,\n Array to print
\n",type:"Any"}],class:"p5",module:"Environment"},frameCount:{name:"frameCount",class:"p5",module:"Environment"},deltaTime:{name:"deltaTime",class:"p5",module:"Environment"},focused:{name:"focused",class:"p5",module:"Environment"},cursor:{name:"cursor",params:[{name:"type",description:"Built-In: either ARROW, CROSS, HAND, MOVE, TEXT and WAIT\n Native CSS properties: 'grab', 'progress', 'cell' etc.\n External: path for cursor's images\n (Allowed File extensions: .cur, .gif, .jpg, .jpeg, .png)\n For more information on Native CSS cursors and url visit:\n https://developer.mozilla.org/en-US/docs/Web/CSS/cursor
\n",type:"String|Constant"},{name:"x",description:"the horizontal active spot of the cursor (must be less than 32)
\n",type:"Number",optional:!0},{name:"y",description:"the vertical active spot of the cursor (must be less than 32)
\n",type:"Number",optional:!0}],class:"p5",module:"Environment"},frameRate:{name:"frameRate",class:"p5",module:"Environment",overloads:[{params:[{name:"fps",description:"number of frames to be displayed every second
\n",type:"Number"}],chainable:1},{params:[]}]},noCursor:{name:"noCursor",class:"p5",module:"Environment"},displayWidth:{name:"displayWidth",class:"p5",module:"Environment"},displayHeight:{name:"displayHeight",class:"p5",module:"Environment"},windowWidth:{name:"windowWidth",class:"p5",module:"Environment"},windowHeight:{name:"windowHeight",class:"p5",module:"Environment"},windowResized:{name:"windowResized",class:"p5",module:"Environment"},width:{name:"width",class:"p5",module:"Environment"},height:{name:"height",class:"p5",module:"Environment"},fullscreen:{name:"fullscreen",params:[{name:"val",description:"whether the sketch should be in fullscreen mode\nor not
\n",type:"Boolean",optional:!0}],class:"p5",module:"Environment"},pixelDensity:{name:"pixelDensity",class:"p5",module:"Environment",overloads:[{params:[{name:"val",description:"whether or how much the sketch should scale
\n",type:"Number"}],chainable:1},{params:[]}]},displayDensity:{name:"displayDensity",class:"p5",module:"Environment"},getURL:{name:"getURL",class:"p5",module:"Environment"},getURLPath:{name:"getURLPath",class:"p5",module:"Environment"},getURLParams:{name:"getURLParams",class:"p5",module:"Environment"},preload:{name:"preload",class:"p5",module:"Structure"},setup:{name:"setup",class:"p5",module:"Structure"},draw:{name:"draw",class:"p5",module:"Structure"},remove:{name:"remove",class:"p5",module:"Structure"},disableFriendlyErrors:{name:"disableFriendlyErrors",class:"p5",module:"Structure"},let:{name:"let",class:"p5",module:"Foundation"},const:{name:"const",class:"p5",module:"Foundation"},"===":{name:"===",class:"p5",module:"Foundation"},">":{name:">",class:"p5",module:"Foundation"},">=":{name:">=",class:"p5",module:"Foundation"},"<":{name:"<",class:"p5",module:"Foundation"},"<=":{name:"<=",class:"p5",module:"Foundation"},"if-else":{name:"if-else",class:"p5",module:"Foundation"},function:{name:"function",class:"p5",module:"Foundation"},return:{name:"return",class:"p5",module:"Foundation"},boolean:{name:"boolean",params:[{name:"n",description:"value to parse
\n",type:"String|Boolean|Number|Array"}],class:"p5",module:"Data"},string:{name:"string",class:"p5",module:"Foundation"},number:{name:"number",class:"p5",module:"Foundation"},object:{name:"object",class:"p5",module:"Foundation"},class:{name:"class",class:"p5",module:"Foundation"},for:{name:"for",class:"p5",module:"Foundation"},while:{name:"while",class:"p5",module:"Foundation"},createCanvas:{name:"createCanvas",params:[{name:"w",description:"width of the canvas
\n",type:"Number"},{name:"h",description:"height of the canvas
\n",type:"Number"},{name:"renderer",description:"either P2D or WEBGL
\n",type:"Constant",optional:!0}],class:"p5",module:"Rendering"},resizeCanvas:{name:"resizeCanvas",params:[{name:"w",description:"width of the canvas
\n",type:"Number"},{name:"h",description:"height of the canvas
\n",type:"Number"},{name:"noRedraw",description:"don't redraw the canvas immediately
\n",type:"Boolean",optional:!0}],class:"p5",module:"Rendering"},noCanvas:{name:"noCanvas",class:"p5",module:"Rendering"},createGraphics:{name:"createGraphics",params:[{name:"w",description:"width of the offscreen graphics buffer
\n",type:"Number"},{name:"h",description:"height of the offscreen graphics buffer
\n",type:"Number"},{name:"renderer",description:"either P2D or WEBGL\n undefined defaults to p2d
\n",type:"Constant",optional:!0}],class:"p5",module:"Rendering"},blendMode:{name:"blendMode",params:[{name:"mode",description:"blend mode to set for canvas.\n either BLEND, DARKEST, LIGHTEST, DIFFERENCE, MULTIPLY,\n EXCLUSION, SCREEN, REPLACE, OVERLAY, HARD_LIGHT,\n SOFT_LIGHT, DODGE, BURN, ADD, REMOVE or SUBTRACT
\n",type:"Constant"}],class:"p5",module:"Rendering"},drawingContext:{name:"drawingContext",class:"p5",module:"Rendering"},noLoop:{name:"noLoop",class:"p5",module:"Structure"},loop:{name:"loop",class:"p5",module:"Structure"},isLooping:{name:"isLooping",class:"p5",module:"Structure"},push:{name:"push",class:"p5",module:"Structure"},pop:{name:"pop",class:"p5",module:"Structure"},redraw:{name:"redraw",params:[{name:"n",description:"Redraw for n-times. The default value is 1.
\n",type:"Integer",optional:!0}],class:"p5",module:"Structure"},p5:{name:"p5",params:[{name:"sketch",description:"a function containing a p5.js sketch
\n",type:"Object"},{name:"node",description:"ID or pointer to HTML DOM node to contain sketch in
\n",type:"String|Object"}],class:"p5",module:"Structure"},applyMatrix:{name:"applyMatrix",params:[{name:"a",description:"numbers which define the 2x3 matrix to be multiplied
\n",type:"Number"},{name:"b",description:"numbers which define the 2x3 matrix to be multiplied
\n",type:"Number"},{name:"c",description:"numbers which define the 2x3 matrix to be multiplied
\n",type:"Number"},{name:"d",description:"numbers which define the 2x3 matrix to be multiplied
\n",type:"Number"},{name:"e",description:"numbers which define the 2x3 matrix to be multiplied
\n",type:"Number"},{name:"f",description:"numbers which define the 2x3 matrix to be multiplied
\n",type:"Number"}],class:"p5",module:"Transform"},resetMatrix:{name:"resetMatrix",class:"p5",module:"Transform"},rotate:{name:"rotate",params:[{name:"angle",description:"the angle of rotation, specified in radians\n or degrees, depending on current angleMode
\n",type:"Number"},{name:"axis",description:"(in 3d) the axis to rotate around
\n",type:"p5.Vector|Number[]",optional:!0}],class:"p5",module:"Transform"},rotateX:{name:"rotateX",params:[{name:"angle",description:"the angle of rotation, specified in radians\n or degrees, depending on current angleMode
\n",type:"Number"}],class:"p5",module:"Transform"},rotateY:{name:"rotateY",params:[{name:"angle",description:"the angle of rotation, specified in radians\n or degrees, depending on current angleMode
\n",type:"Number"}],class:"p5",module:"Transform"},rotateZ:{name:"rotateZ",params:[{name:"angle",description:"the angle of rotation, specified in radians\n or degrees, depending on current angleMode
\n",type:"Number"}],class:"p5",module:"Transform"},scale:{name:"scale",class:"p5",module:"Transform",overloads:[{params:[{name:"s",description:"percent to scale the object, or percentage to\n scale the object in the x-axis if multiple arguments\n are given
\n",type:"Number|p5.Vector|Number[]"},{name:"y",description:"percent to scale the object in the y-axis
\n",type:"Number",optional:!0},{name:"z",description:"percent to scale the object in the z-axis (webgl only)
\n",type:"Number",optional:!0}],chainable:1},{params:[{name:"scales",description:"per-axis percents to scale the object
\n",type:"p5.Vector|Number[]"}],chainable:1}]},shearX:{name:"shearX",params:[{name:"angle",description:"angle of shear specified in radians or degrees,\n depending on current angleMode
\n",type:"Number"}],class:"p5",module:"Transform"},shearY:{name:"shearY",params:[{name:"angle",description:"angle of shear specified in radians or degrees,\n depending on current angleMode
\n",type:"Number"}],class:"p5",module:"Transform"},translate:{name:"translate",class:"p5",module:"Transform",overloads:[{params:[{name:"x",description:"left/right translation
\n",type:"Number"},{name:"y",description:"up/down translation
\n",type:"Number"},{name:"z",description:"forward/backward translation (webgl only)
\n",type:"Number",optional:!0}],chainable:1},{params:[{name:"vector",description:"the vector to translate by
\n",type:"p5.Vector"}],chainable:1}]},storeItem:{name:"storeItem",params:[{name:"key",description:"",type:"String"},{name:"value",description:"",type:"String|Number|Object|Boolean|p5.Color|p5.Vector"}],class:"p5",module:"Data"},getItem:{name:"getItem",params:[{name:"key",description:"name that you wish to use to store in local storage
\n",type:"String"}],class:"p5",module:"Data"},clearStorage:{name:"clearStorage",class:"p5",module:"Data"},removeItem:{name:"removeItem",params:[{name:"key",description:"",type:"String"}],class:"p5",module:"Data"},createStringDict:{name:"createStringDict",class:"p5",module:"Data",overloads:[{params:[{name:"key",description:"",type:"String"},{name:"value",description:"",type:"String"}]},{params:[{name:"object",description:"object
\n",type:"Object"}]}]},createNumberDict:{name:"createNumberDict",class:"p5",module:"Data",overloads:[{params:[{name:"key",description:"",type:"Number"},{name:"value",description:"",type:"Number"}]},{params:[{name:"object",description:"object
\n",type:"Object"}]}]},select:{name:"select",params:[{name:"selectors",description:"CSS selector string of element to search for
\n",type:"String"},{name:"container",description:'CSS selector string, p5.Element, or\n HTML element to search within
\n',type:"String|p5.Element|HTMLElement",optional:!0}],class:"p5",module:"DOM"},selectAll:{name:"selectAll",params:[{name:"selectors",description:"CSS selector string of elements to search for
\n",type:"String"},{name:"container",description:'CSS selector string, p5.Element\n , or HTML element to search within
\n',type:"String|p5.Element|HTMLElement",optional:!0}],class:"p5",module:"DOM"},removeElements:{name:"removeElements",class:"p5",module:"DOM"},changed:{name:"changed",params:[{name:"fxn",description:"function to be fired when the value of\n an element changes.\n if false is passed instead, the previously\n firing function will no longer fire.
\n",type:"Function|Boolean"}],class:"p5",module:"DOM"},input:{name:"input",params:[{name:"fxn",description:"function to be fired when any user input is\n detected within the element.\n if false is passed instead, the previously\n firing function will no longer fire.
\n",type:"Function|Boolean"}],class:"p5",module:"DOM"},createDiv:{name:"createDiv",params:[{name:"html",description:"inner HTML for element created
\n",type:"String",optional:!0}],class:"p5",module:"DOM"},createP:{name:"createP",params:[{name:"html",description:"inner HTML for element created
\n",type:"String",optional:!0}],class:"p5",module:"DOM"},createSpan:{name:"createSpan",params:[{name:"html",description:"inner HTML for element created
\n",type:"String",optional:!0}],class:"p5",module:"DOM"},createImg:{name:"createImg",class:"p5",module:"DOM",overloads:[{params:[{name:"src",description:"src path or url for image
\n",type:"String"},{name:"alt",description:'alternate text to be used if image does not load. You can use also an empty string ("") if that an image is not intended to be viewed.
\n',type:"String"}]},{params:[{name:"src",description:"",type:"String"},{name:"alt",description:"",type:"String"},{name:"crossOrigin",description:"crossOrigin property of the img element; use either 'anonymous' or 'use-credentials' to retrieve the image with cross-origin access (for later use with canvas. if an empty string(\"\") is passed, CORS is not used
\n",type:"String"},{name:"successCallback",description:'callback to be called once image data is loaded with the p5.Element as argument
\n',type:"Function",optional:!0}]}]},createA:{name:"createA",params:[{name:"href",description:"url of page to link to
\n",type:"String"},{name:"html",description:"inner html of link element to display
\n",type:"String"},{name:"target",description:"target where new link should open,\n could be _blank, _self, _parent, _top.
\n",type:"String",optional:!0}],class:"p5",module:"DOM"},createSlider:{name:"createSlider",params:[{name:"min",description:"minimum value of the slider
\n",type:"Number"},{name:"max",description:"maximum value of the slider
\n",type:"Number"},{name:"value",description:"default value of the slider
\n",type:"Number",optional:!0},{name:"step",description:"step size for each tick of the slider (if step is set to 0, the slider will move continuously from the minimum to the maximum value)
\n",type:"Number",optional:!0}],class:"p5",module:"DOM"},createButton:{name:"createButton",params:[{name:"label",description:"label displayed on the button
\n",type:"String"},{name:"value",description:"value of the button
\n",type:"String",optional:!0}],class:"p5",module:"DOM"},createCheckbox:{name:"createCheckbox",params:[{name:"label",description:"label displayed after checkbox
\n",type:"String",optional:!0},{name:"value",description:"value of the checkbox; checked is true, unchecked is false
\n",type:"Boolean",optional:!0}],class:"p5",module:"DOM"},createSelect:{name:"createSelect",class:"p5",module:"DOM",overloads:[{params:[{name:"multiple",description:"true if dropdown should support multiple selections
\n",type:"Boolean",optional:!0}]},{params:[{name:"existing",description:"DOM select element
\n",type:"Object"}]}]},createRadio:{name:"createRadio",class:"p5",module:"DOM",overloads:[{params:[{name:"containerElement",description:"An container HTML Element either a div\nor span inside which all existing radio inputs will be considered as options.
\n",type:"Object"},{name:"name",description:"A name parameter for each Input Element.
\n",type:"String",optional:!0}]},{params:[{name:"name",description:"",type:"String"}]},{params:[]}]},createColorPicker:{name:"createColorPicker",params:[{name:"value",description:"default color of element
\n",type:"String|p5.Color",optional:!0}],class:"p5",module:"DOM"},createInput:{name:"createInput",class:"p5",module:"DOM",overloads:[{params:[{name:"value",description:"default value of the input box
\n",type:"String"},{name:"type",description:"type of text, ie text, password etc. Defaults to text.\n Needs a value to be specified first.
\n",type:"String",optional:!0}]},{params:[{name:"value",description:"",type:"String",optional:!0}]}]},createFileInput:{name:"createFileInput",params:[{name:"callback",description:"callback function for when a file is loaded
\n",type:"Function"},{name:"multiple",description:"optional, to allow multiple files to be selected
\n",type:"Boolean",optional:!0}],class:"p5",module:"DOM"},createVideo:{name:"createVideo",params:[{name:"src",description:"path to a video file, or array of paths for\n supporting different browsers
\n",type:"String|String[]"},{name:"callback",description:"callback function to be called upon\n 'canplaythrough' event fire, that is, when the\n browser can play the media, and estimates that\n enough data has been loaded to play the media\n up to its end without having to stop for\n further buffering of content
\n",type:"Function",optional:!0}],class:"p5",module:"DOM"},createAudio:{name:"createAudio",params:[{name:"src",description:"path to an audio file, or array of paths\n for supporting different browsers
\n",type:"String|String[]",optional:!0},{name:"callback",description:"callback function to be called upon\n 'canplaythrough' event fire, that is, when the\n browser can play the media, and estimates that\n enough data has been loaded to play the media\n up to its end without having to stop for\n further buffering of content
\n",type:"Function",optional:!0}],class:"p5",module:"DOM"},VIDEO:{name:"VIDEO",class:"p5",module:"DOM"},AUDIO:{name:"AUDIO",class:"p5",module:"DOM"},createCapture:{name:"createCapture",params:[{name:"type",description:"type of capture, either VIDEO or\n AUDIO if none specified, default both,\n or a Constraints object
\n",type:"String|Constant|Object"},{name:"callback",description:"function to be called once\n stream has loaded
\n",type:"Function",optional:!0}],class:"p5",module:"DOM"},createElement:{name:"createElement",params:[{name:"tag",description:"tag for the new element
\n",type:"String"},{name:"content",description:"html content to be inserted into the element
\n",type:"String",optional:!0}],class:"p5",module:"DOM"},deviceOrientation:{name:"deviceOrientation",class:"p5",module:"Events"},accelerationX:{name:"accelerationX",class:"p5",module:"Events"},accelerationY:{name:"accelerationY",class:"p5",module:"Events"},accelerationZ:{name:"accelerationZ",class:"p5",module:"Events"},pAccelerationX:{name:"pAccelerationX",class:"p5",module:"Events"},pAccelerationY:{name:"pAccelerationY",class:"p5",module:"Events"},pAccelerationZ:{name:"pAccelerationZ",class:"p5",module:"Events"},rotationX:{name:"rotationX",class:"p5",module:"Events"},rotationY:{name:"rotationY",class:"p5",module:"Events"},rotationZ:{name:"rotationZ",class:"p5",module:"Events"},pRotationX:{name:"pRotationX",class:"p5",module:"Events"},pRotationY:{name:"pRotationY",class:"p5",module:"Events"},pRotationZ:{name:"pRotationZ",class:"p5",module:"Events"},turnAxis:{name:"turnAxis",class:"p5",module:"Events"},setMoveThreshold:{name:"setMoveThreshold",params:[{name:"value",description:"The threshold value
\n",type:"Number"}],class:"p5",module:"Events"},setShakeThreshold:{name:"setShakeThreshold",params:[{name:"value",description:"The threshold value
\n",type:"Number"}],class:"p5",module:"Events"},deviceMoved:{name:"deviceMoved",class:"p5",module:"Events"},deviceTurned:{name:"deviceTurned",class:"p5",module:"Events"},deviceShaken:{name:"deviceShaken",class:"p5",module:"Events"},keyIsPressed:{name:"keyIsPressed",class:"p5",module:"Events"},key:{name:"key",class:"p5",module:"Events"},keyCode:{name:"keyCode",class:"p5",module:"Events"},keyPressed:{name:"keyPressed",class:"p5",module:"Events"},keyReleased:{name:"keyReleased",class:"p5",module:"Events"},keyTyped:{name:"keyTyped",class:"p5",module:"Events"},keyIsDown:{name:"keyIsDown",params:[{name:"code",description:"The key to check for.
\n",type:"Number"}],class:"p5",module:"Events"},movedX:{name:"movedX",class:"p5",module:"Events"},movedY:{name:"movedY",class:"p5",module:"Events"},mouseX:{name:"mouseX",class:"p5",module:"Events"},mouseY:{name:"mouseY",class:"p5",module:"Events"},pmouseX:{name:"pmouseX",class:"p5",module:"Events"},pmouseY:{name:"pmouseY",class:"p5",module:"Events"},winMouseX:{name:"winMouseX",class:"p5",module:"Events"},winMouseY:{name:"winMouseY",class:"p5",module:"Events"},pwinMouseX:{name:"pwinMouseX",class:"p5",module:"Events"},pwinMouseY:{name:"pwinMouseY",class:"p5",module:"Events"},mouseButton:{name:"mouseButton",class:"p5",module:"Events"},mouseIsPressed:{name:"mouseIsPressed",class:"p5",module:"Events"},mouseMoved:{name:"mouseMoved",params:[{name:"event",description:"optional MouseEvent callback argument.
\n",type:"Object",optional:!0}],class:"p5",module:"Events"},mouseDragged:{name:"mouseDragged",params:[{name:"event",description:"optional MouseEvent callback argument.
\n",type:"Object",optional:!0}],class:"p5",module:"Events"},mousePressed:{name:"mousePressed",params:[{name:"event",description:"optional MouseEvent callback argument.
\n",type:"Object",optional:!0}],class:"p5",module:"Events"},mouseReleased:{name:"mouseReleased",params:[{name:"event",description:"optional MouseEvent callback argument.
\n",type:"Object",optional:!0}],class:"p5",module:"Events"},mouseClicked:{name:"mouseClicked",params:[{name:"event",description:"optional MouseEvent callback argument.
\n",type:"Object",optional:!0}],class:"p5",module:"Events"},doubleClicked:{name:"doubleClicked",params:[{name:"event",description:"optional MouseEvent callback argument.
\n",type:"Object",optional:!0}],class:"p5",module:"Events"},mouseWheel:{name:"mouseWheel",params:[{name:"event",description:"optional WheelEvent callback argument.
\n",type:"Object",optional:!0}],class:"p5",module:"Events"},requestPointerLock:{name:"requestPointerLock",class:"p5",module:"Events"},exitPointerLock:{name:"exitPointerLock",class:"p5",module:"Events"},touches:{name:"touches",class:"p5",module:"Events"},touchStarted:{name:"touchStarted",params:[{name:"event",description:"optional TouchEvent callback argument.
\n",type:"Object",optional:!0}],class:"p5",module:"Events"},touchMoved:{name:"touchMoved",params:[{name:"event",description:"optional TouchEvent callback argument.
\n",type:"Object",optional:!0}],class:"p5",module:"Events"},touchEnded:{name:"touchEnded",params:[{name:"event",description:"optional TouchEvent callback argument.
\n",type:"Object",optional:!0}],class:"p5",module:"Events"},createImage:{name:"createImage",params:[{name:"width",description:"width in pixels
\n",type:"Integer"},{name:"height",description:"height in pixels
\n",type:"Integer"}],class:"p5",module:"Image"},saveCanvas:{name:"saveCanvas",class:"p5",module:"Image",overloads:[{params:[{name:"selectedCanvas",description:"a variable\n representing a specific html5 canvas (optional)
\n",type:"p5.Element|HTMLCanvasElement"},{name:"filename",description:"",type:"String",optional:!0},{name:"extension",description:"'jpg' or 'png'
\n",type:"String",optional:!0}]},{params:[{name:"filename",description:"",type:"String",optional:!0},{name:"extension",description:"",type:"String",optional:!0}]}]},saveFrames:{name:"saveFrames",params:[{name:"filename",description:"",type:"String"},{name:"extension",description:"'jpg' or 'png'
\n",type:"String"},{name:"duration",description:"Duration in seconds to save the frames for.
\n",type:"Number"},{name:"framerate",description:"Framerate to save the frames in.
\n",type:"Number"},{name:"callback",description:"A callback function that will be executed\n to handle the image data. This function\n should accept an array as argument. The\n array will contain the specified number of\n frames of objects. Each object has three\n properties: imageData - an\n image/octet-stream, filename and extension.
\n",type:"Function(Array)",optional:!0}],class:"p5",module:"Image"},loadImage:{name:"loadImage",params:[{name:"path",description:"Path of the image to be loaded
\n",type:"String"},{name:"successCallback",description:'Function to be called once\n the image is loaded. Will be passed the\n p5.Image.
\n',type:"function(p5.Image)",optional:!0},{name:"failureCallback",description:"called with event error if\n the image fails to load.
\n",type:"Function(Event)",optional:!0}],class:"p5",module:"Image"},image:{name:"image",class:"p5",module:"Image",overloads:[{params:[{name:"img",description:"the image to display
\n",type:"p5.Image|p5.Element"},{name:"x",description:"the x-coordinate of the top-left corner of the image
\n",type:"Number"},{name:"y",description:"the y-coordinate of the top-left corner of the image
\n",type:"Number"},{name:"width",description:"the width to draw the image
\n",type:"Number",optional:!0},{name:"height",description:"the height to draw the image
\n",type:"Number",optional:!0}]},{params:[{name:"img",description:"",type:"p5.Image|p5.Element"},{name:"dx",description:"the x-coordinate of the destination\n rectangle in which to draw the source image
\n",type:"Number"},{name:"dy",description:"the y-coordinate of the destination\n rectangle in which to draw the source image
\n",type:"Number"},{name:"dWidth",description:"the width of the destination rectangle
\n",type:"Number"},{name:"dHeight",description:"the height of the destination rectangle
\n",type:"Number"},{name:"sx",description:"the x-coordinate of the subsection of the source\nimage to draw into the destination rectangle
\n",type:"Number"},{name:"sy",description:"the y-coordinate of the subsection of the source\nimage to draw into the destination rectangle
\n",type:"Number"},{name:"sWidth",description:"the width of the subsection of the\n source image to draw into the destination\n rectangle
\n",type:"Number",optional:!0},{name:"sHeight",description:"the height of the subsection of the\n source image to draw into the destination rectangle
\n",type:"Number",optional:!0}]}]},tint:{name:"tint",class:"p5",module:"Image",overloads:[{params:[{name:"v1",description:"red or hue value relative to\n the current color range
\n",type:"Number"},{name:"v2",description:"green or saturation value\n relative to the current color range
\n",type:"Number"},{name:"v3",description:"blue or brightness value\n relative to the current color range
\n",type:"Number"},{name:"alpha",description:"",type:"Number",optional:!0}]},{params:[{name:"value",description:"a color string
\n",type:"String"}]},{params:[{name:"gray",description:"a gray value
\n",type:"Number"},{name:"alpha",description:"",type:"Number",optional:!0}]},{params:[{name:"values",description:"an array containing the red,green,blue &\n and alpha components of the color
\n",type:"Number[]"}]},{params:[{name:"color",description:"the tint color
\n",type:"p5.Color"}]}]},noTint:{name:"noTint",class:"p5",module:"Image"},imageMode:{name:"imageMode",params:[{name:"mode",description:"either CORNER, CORNERS, or CENTER
\n",type:"Constant"}],class:"p5",module:"Image"},pixels:{name:"pixels",class:"p5",module:"Image"},blend:{name:"blend",class:"p5",module:"Image",overloads:[{params:[{name:"srcImage",description:"source image
\n",type:"p5.Image"},{name:"sx",description:"X coordinate of the source's upper left corner
\n",type:"Integer"},{name:"sy",description:"Y coordinate of the source's upper left corner
\n",type:"Integer"},{name:"sw",description:"source image width
\n",type:"Integer"},{name:"sh",description:"source image height
\n",type:"Integer"},{name:"dx",description:"X coordinate of the destination's upper left corner
\n",type:"Integer"},{name:"dy",description:"Y coordinate of the destination's upper left corner
\n",type:"Integer"},{name:"dw",description:"destination image width
\n",type:"Integer"},{name:"dh",description:"destination image height
\n",type:"Integer"},{name:"blendMode",description:"the blend mode. either\n BLEND, DARKEST, LIGHTEST, DIFFERENCE,\n MULTIPLY, EXCLUSION, SCREEN, REPLACE, OVERLAY, HARD_LIGHT,\n SOFT_LIGHT, DODGE, BURN, ADD or NORMAL.
\n",type:"Constant"}]},{params:[{name:"sx",description:"",type:"Integer"},{name:"sy",description:"",type:"Integer"},{name:"sw",description:"",type:"Integer"},{name:"sh",description:"",type:"Integer"},{name:"dx",description:"",type:"Integer"},{name:"dy",description:"",type:"Integer"},{name:"dw",description:"",type:"Integer"},{name:"dh",description:"",type:"Integer"},{name:"blendMode",description:"",type:"Constant"}]}]},copy:{name:"copy",class:"p5",module:"Image",overloads:[{params:[{name:"srcImage",description:"source image
\n",type:"p5.Image|p5.Element"},{name:"sx",description:"X coordinate of the source's upper left corner
\n",type:"Integer"},{name:"sy",description:"Y coordinate of the source's upper left corner
\n",type:"Integer"},{name:"sw",description:"source image width
\n",type:"Integer"},{name:"sh",description:"source image height
\n",type:"Integer"},{name:"dx",description:"X coordinate of the destination's upper left corner
\n",type:"Integer"},{name:"dy",description:"Y coordinate of the destination's upper left corner
\n",type:"Integer"},{name:"dw",description:"destination image width
\n",type:"Integer"},{name:"dh",description:"destination image height
\n",type:"Integer"}]},{params:[{name:"sx",description:"",type:"Integer"},{name:"sy",description:"",type:"Integer"},{name:"sw",description:"",type:"Integer"},{name:"sh",description:"",type:"Integer"},{name:"dx",description:"",type:"Integer"},{name:"dy",description:"",type:"Integer"},{name:"dw",description:"",type:"Integer"},{name:"dh",description:"",type:"Integer"}]}]},filter:{name:"filter",params:[{name:"filterType",description:"either THRESHOLD, GRAY, OPAQUE, INVERT,\n POSTERIZE, BLUR, ERODE, DILATE or BLUR.\n See Filters.js for docs on\n each available filter
\n",type:"Constant"},{name:"filterParam",description:"an optional parameter unique\n to each filter, see above
\n",type:"Number",optional:!0}],class:"p5",module:"Image"},get:{name:"get",class:"p5",module:"Image",overloads:[{params:[{name:"x",description:"x-coordinate of the pixel
\n",type:"Number"},{name:"y",description:"y-coordinate of the pixel
\n",type:"Number"},{name:"w",description:"width
\n",type:"Number"},{name:"h",description:"height
\n",type:"Number"}]},{params:[]},{params:[{name:"x",description:"",type:"Number"},{name:"y",description:"",type:"Number"}]}]},loadPixels:{name:"loadPixels",class:"p5",module:"Image"},set:{name:"set",params:[{name:"x",description:"x-coordinate of the pixel
\n",type:"Number"},{name:"y",description:"y-coordinate of the pixel
\n",type:"Number"},{name:"c",description:'insert a grayscale value | a pixel array |\n a p5.Color object | a p5.Image to copy
\n',type:"Number|Number[]|Object"}],class:"p5",module:"Image"},updatePixels:{name:"updatePixels",params:[{name:"x",description:"x-coordinate of the upper-left corner of region\n to update
\n",type:"Number",optional:!0},{name:"y",description:"y-coordinate of the upper-left corner of region\n to update
\n",type:"Number",optional:!0},{name:"w",description:"width of region to update
\n",type:"Number",optional:!0},{name:"h",description:"height of region to update
\n",type:"Number",optional:!0}],class:"p5",module:"Image"},loadJSON:{name:"loadJSON",class:"p5",module:"IO",overloads:[{params:[{name:"path",description:"name of the file or url to load
\n",type:"String"},{name:"jsonpOptions",description:"options object for jsonp related settings
\n",type:"Object",optional:!0},{name:"datatype",description:'"json" or "jsonp"
\n',type:"String",optional:!0},{name:"callback",description:'function to be executed after\n loadJSON() completes, data is passed\n in as first argument
\n',type:"Function",optional:!0},{name:"errorCallback",description:"function to be executed if\n there is an error, response is passed\n in as first argument
\n",type:"Function",optional:!0}]},{params:[{name:"path",description:"",type:"String"},{name:"datatype",description:"",type:"String"},{name:"callback",description:"",type:"Function",optional:!0},{name:"errorCallback",description:"",type:"Function",optional:!0}]},{params:[{name:"path",description:"",type:"String"},{name:"callback",description:"",type:"Function"},{name:"errorCallback",description:"",type:"Function",optional:!0}]}]},loadStrings:{name:"loadStrings",params:[{name:"filename",description:"name of the file or url to load
\n",type:"String"},{name:"callback",description:'function to be executed after loadStrings()\n completes, Array is passed in as first\n argument
\n',type:"Function",optional:!0},{name:"errorCallback",description:"function to be executed if\n there is an error, response is passed\n in as first argument
\n",type:"Function",optional:!0}],class:"p5",module:"IO"},loadTable:{name:"loadTable",params:[{name:"filename",description:"name of the file or URL to load
\n",type:"String"},{name:"extension",description:'parse the table by comma-separated values "csv", semicolon-separated\n values "ssv", or tab-separated values "tsv"
\n',type:"String",optional:!0},{name:"header",description:'"header" to indicate table has header row
\n',type:"String",optional:!0},{name:"callback",description:'function to be executed after\n loadTable() completes. On success, the\n Table object is passed in as the\n first argument.
\n',type:"Function",optional:!0},{name:"errorCallback",description:"function to be executed if\n there is an error, response is passed\n in as first argument
\n",type:"Function",optional:!0}],class:"p5",module:"IO"},loadXML:{name:"loadXML",params:[{name:"filename",description:"name of the file or URL to load
\n",type:"String"},{name:"callback",description:'function to be executed after loadXML()\n completes, XML object is passed in as\n first argument
\n',type:"Function",optional:!0},{name:"errorCallback",description:"function to be executed if\n there is an error, response is passed\n in as first argument
\n",type:"Function",optional:!0}],class:"p5",module:"IO"},loadBytes:{name:"loadBytes",params:[{name:"file",description:"name of the file or URL to load
\n",type:"String"},{name:"callback",description:'function to be executed after loadBytes()\n completes
\n',type:"Function",optional:!0},{name:"errorCallback",description:"function to be executed if there\n is an error
\n",type:"Function",optional:!0}],class:"p5",module:"IO"},httpGet:{name:"httpGet",class:"p5",module:"IO",overloads:[{params:[{name:"path",description:"name of the file or url to load
\n",type:"String"},{name:"datatype",description:'"json", "jsonp", "binary", "arrayBuffer",\n "xml", or "text"
\n',type:"String",optional:!0},{name:"data",description:"param data passed sent with request
\n",type:"Object|Boolean",optional:!0},{name:"callback",description:'function to be executed after\n httpGet() completes, data is passed in\n as first argument
\n',type:"Function",optional:!0},{name:"errorCallback",description:"function to be executed if\n there is an error, response is passed\n in as first argument
\n",type:"Function",optional:!0}]},{params:[{name:"path",description:"",type:"String"},{name:"data",description:"",type:"Object|Boolean"},{name:"callback",description:"",type:"Function",optional:!0},{name:"errorCallback",description:"",type:"Function",optional:!0}]},{params:[{name:"path",description:"",type:"String"},{name:"callback",description:"",type:"Function"},{name:"errorCallback",description:"",type:"Function",optional:!0}]}]},httpPost:{name:"httpPost",class:"p5",module:"IO",overloads:[{params:[{name:"path",description:"name of the file or url to load
\n",type:"String"},{name:"datatype",description:'"json", "jsonp", "xml", or "text".\n If omitted, httpPost() will guess.
\n',type:"String",optional:!0},{name:"data",description:"param data passed sent with request
\n",type:"Object|Boolean",optional:!0},{name:"callback",description:'function to be executed after\n httpPost() completes, data is passed in\n as first argument
\n',type:"Function",optional:!0},{name:"errorCallback",description:"function to be executed if\n there is an error, response is passed\n in as first argument
\n",type:"Function",optional:!0}]},{params:[{name:"path",description:"",type:"String"},{name:"data",description:"",type:"Object|Boolean"},{name:"callback",description:"",type:"Function",optional:!0},{name:"errorCallback",description:"",type:"Function",optional:!0}]},{params:[{name:"path",description:"",type:"String"},{name:"callback",description:"",type:"Function"},{name:"errorCallback",description:"",type:"Function",optional:!0}]}]},httpDo:{name:"httpDo",class:"p5",module:"IO",overloads:[{params:[{name:"path",description:"name of the file or url to load
\n",type:"String"},{name:"method",description:'either "GET", "POST", or "PUT",\n defaults to "GET"
\n',type:"String",optional:!0},{name:"datatype",description:'"json", "jsonp", "xml", or "text"
\n',type:"String",optional:!0},{name:"data",description:"param data passed sent with request
\n",type:"Object",optional:!0},{name:"callback",description:'function to be executed after\n httpGet() completes, data is passed in\n as first argument
\n',type:"Function",optional:!0},{name:"errorCallback",description:"function to be executed if\n there is an error, response is passed\n in as first argument
\n",type:"Function",optional:!0}]},{params:[{name:"path",description:"",type:"String"},{name:"options",description:'Request object options as documented in the\n "fetch" API\nreference
\n',type:"Object"},{name:"callback",description:"",type:"Function",optional:!0},{name:"errorCallback",description:"",type:"Function",optional:!0}]}]},createWriter:{name:"createWriter",params:[{name:"name",description:"name of the file to be created
\n",type:"String"},{name:"extension",description:"",type:"String",optional:!0}],class:"p5",module:"IO"},save:{name:"save",params:[{name:"objectOrFilename",description:"If filename is provided, will\n save canvas as an image with\n either png or jpg extension\n depending on the filename.\n If object is provided, will\n save depending on the object\n and filename (see examples\n above).
\n",type:"Object|String",optional:!0},{name:"filename",description:"If an object is provided as the first\n parameter, then the second parameter\n indicates the filename,\n and should include an appropriate\n file extension (see examples above).
\n",type:"String",optional:!0},{name:"options",description:"Additional options depend on\n filetype. For example, when saving JSON,\n true indicates that the\n output will be optimized for filesize,\n rather than readability.
\n",type:"Boolean|String",optional:!0}],class:"p5",module:"IO"},saveJSON:{name:"saveJSON",params:[{name:"json",description:"",type:"Array|Object"},{name:"filename",description:"",type:"String"},{name:"optimize",description:"If true, removes line breaks\n and spaces from the output\n file to optimize filesize\n (but not readability).
\n",type:"Boolean",optional:!0}],class:"p5",module:"IO"},saveStrings:{name:"saveStrings",params:[{name:"list",description:"string array to be written
\n",type:"String[]"},{name:"filename",description:"filename for output
\n",type:"String"},{name:"extension",description:"the filename's extension
\n",type:"String",optional:!0},{name:"isCRLF",description:"if true, change line-break to CRLF
\n",type:"Boolean",optional:!0}],class:"p5",module:"IO"},saveTable:{name:"saveTable",params:[{name:"Table",description:'the Table object to save to a file
\n',type:"p5.Table"},{name:"filename",description:"the filename to which the Table should be saved
\n",type:"String"},{name:"options",description:'can be one of "tsv", "csv", or "html"
\n',type:"String",optional:!0}],class:"p5",module:"IO"},abs:{name:"abs",params:[{name:"n",description:"number to compute
\n",type:"Number"}],class:"p5",module:"Math"},ceil:{name:"ceil",params:[{name:"n",description:"number to round up
\n",type:"Number"}],class:"p5",module:"Math"},constrain:{name:"constrain",params:[{name:"n",description:"number to constrain
\n",type:"Number"},{name:"low",description:"minimum limit
\n",type:"Number"},{name:"high",description:"maximum limit
\n",type:"Number"}],class:"p5",module:"Math"},dist:{name:"dist",class:"p5",module:"Math",overloads:[{params:[{name:"x1",description:"x-coordinate of the first point
\n",type:"Number"},{name:"y1",description:"y-coordinate of the first point
\n",type:"Number"},{name:"x2",description:"x-coordinate of the second point
\n",type:"Number"},{name:"y2",description:"y-coordinate of the second point
\n",type:"Number"}]},{params:[{name:"x1",description:"",type:"Number"},{name:"y1",description:"",type:"Number"},{name:"z1",description:"z-coordinate of the first point
\n",type:"Number"},{name:"x2",description:"",type:"Number"},{name:"y2",description:"",type:"Number"},{name:"z2",description:"z-coordinate of the second point
\n",type:"Number"}]}]},exp:{name:"exp",params:[{name:"n",description:"exponent to raise
\n",type:"Number"}],class:"p5",module:"Math"},floor:{name:"floor",params:[{name:"n",description:"number to round down
\n",type:"Number"}],class:"p5",module:"Math"},lerp:{name:"lerp",params:[{name:"start",description:"first value
\n",type:"Number"},{name:"stop",description:"second value
\n",type:"Number"},{name:"amt",description:"number
\n",type:"Number"}],class:"p5",module:"Math"},log:{name:"log",params:[{name:"n",description:"number greater than 0
\n",type:"Number"}],class:"p5",module:"Math"},mag:{name:"mag",params:[{name:"a",description:"first value
\n",type:"Number"},{name:"b",description:"second value
\n",type:"Number"}],class:"p5",module:"Math"},map:{name:"map",params:[{name:"value",description:"the incoming value to be converted
\n",type:"Number"},{name:"start1",description:"lower bound of the value's current range
\n",type:"Number"},{name:"stop1",description:"upper bound of the value's current range
\n",type:"Number"},{name:"start2",description:"lower bound of the value's target range
\n",type:"Number"},{name:"stop2",description:"upper bound of the value's target range
\n",type:"Number"},{name:"withinBounds",description:"constrain the value to the newly mapped range
\n",type:"Boolean",optional:!0}],class:"p5",module:"Math"},max:{name:"max",class:"p5",module:"Math",overloads:[{params:[{name:"n0",description:"Number to compare
\n",type:"Number"},{name:"n1",description:"Number to compare
\n",type:"Number"}]},{params:[{name:"nums",description:"Numbers to compare
\n",type:"Number[]"}]}]},min:{name:"min",class:"p5",module:"Math",overloads:[{params:[{name:"n0",description:"Number to compare
\n",type:"Number"},{name:"n1",description:"Number to compare
\n",type:"Number"}]},{params:[{name:"nums",description:"Numbers to compare
\n",type:"Number[]"}]}]},norm:{name:"norm",params:[{name:"value",description:"incoming value to be normalized
\n",type:"Number"},{name:"start",description:"lower bound of the value's current range
\n",type:"Number"},{name:"stop",description:"upper bound of the value's current range
\n",type:"Number"}],class:"p5",module:"Math"},pow:{name:"pow",params:[{name:"n",description:"base of the exponential expression
\n",type:"Number"},{name:"e",description:"power by which to raise the base
\n",type:"Number"}],class:"p5",module:"Math"},round:{name:"round",params:[{name:"n",description:"number to round
\n",type:"Number"},{name:"decimals",description:"number of decimal places to round to, default is 0
\n",type:"Number",optional:!0}],class:"p5",module:"Math"},sq:{name:"sq",params:[{name:"n",description:"number to square
\n",type:"Number"}],class:"p5",module:"Math"},sqrt:{name:"sqrt",params:[{name:"n",description:"non-negative number to square root
\n",type:"Number"}],class:"p5",module:"Math"},fract:{name:"fract",params:[{name:"num",description:"Number whose fractional part needs to be found out
\n",type:"Number"}],class:"p5",module:"Math"},createVector:{name:"createVector",params:[{name:"x",description:"x component of the vector
\n",type:"Number",optional:!0},{name:"y",description:"y component of the vector
\n",type:"Number",optional:!0},{name:"z",description:"z component of the vector
\n",type:"Number",optional:!0}],class:"p5",module:"Math"},noise:{name:"noise",params:[{name:"x",description:"x-coordinate in noise space
\n",type:"Number"},{name:"y",description:"y-coordinate in noise space
\n",type:"Number",optional:!0},{name:"z",description:"z-coordinate in noise space
\n",type:"Number",optional:!0}],class:"p5",module:"Math"},noiseDetail:{name:"noiseDetail",params:[{name:"lod",description:"number of octaves to be used by the noise
\n",type:"Number"},{name:"falloff",description:"falloff factor for each octave
\n",type:"Number"}],class:"p5",module:"Math"},noiseSeed:{name:"noiseSeed",params:[{name:"seed",description:"the seed value
\n",type:"Number"}],class:"p5",module:"Math"},randomSeed:{name:"randomSeed",params:[{name:"seed",description:"the seed value
\n",type:"Number"}],class:"p5",module:"Math"},random:{name:"random",class:"p5",module:"Math",overloads:[{params:[{name:"min",description:"the lower bound (inclusive)
\n",type:"Number",optional:!0},{name:"max",description:"the upper bound (exclusive)
\n",type:"Number",optional:!0}]},{params:[{name:"choices",description:"the array to choose from
\n",type:"Array"}]}]},randomGaussian:{name:"randomGaussian",params:[{name:"mean",description:"the mean
\n",type:"Number"},{name:"sd",description:"the standard deviation
\n",type:"Number"}],class:"p5",module:"Math"},acos:{name:"acos",params:[{name:"value",description:"the value whose arc cosine is to be returned
\n",type:"Number"}],class:"p5",module:"Math"},asin:{name:"asin",params:[{name:"value",description:"the value whose arc sine is to be returned
\n",type:"Number"}],class:"p5",module:"Math"},atan:{name:"atan",params:[{name:"value",description:"the value whose arc tangent is to be returned
\n",type:"Number"}],class:"p5",module:"Math"},atan2:{name:"atan2",params:[{name:"y",description:"y-coordinate of the point
\n",type:"Number"},{name:"x",description:"x-coordinate of the point
\n",type:"Number"}],class:"p5",module:"Math"},cos:{name:"cos",params:[{name:"angle",description:"the angle
\n",type:"Number"}],class:"p5",module:"Math"},sin:{name:"sin",params:[{name:"angle",description:"the angle
\n",type:"Number"}],class:"p5",module:"Math"},tan:{name:"tan",params:[{name:"angle",description:"the angle
\n",type:"Number"}],class:"p5",module:"Math"},degrees:{name:"degrees",params:[{name:"radians",description:"the radians value to convert to degrees
\n",type:"Number"}],class:"p5",module:"Math"},radians:{name:"radians",params:[{name:"degrees",description:"the degree value to convert to radians
\n",type:"Number"}],class:"p5",module:"Math"},angleMode:{name:"angleMode",params:[{name:"mode",description:"either RADIANS or DEGREES
\n",type:"Constant"}],class:"p5",module:"Math"},textAlign:{name:"textAlign",class:"p5",module:"Typography",overloads:[{params:[{name:"horizAlign",description:"horizontal alignment, either LEFT,\n CENTER, or RIGHT
\n",type:"Constant"},{name:"vertAlign",description:"vertical alignment, either TOP,\n BOTTOM, CENTER, or BASELINE
\n",type:"Constant",optional:!0}],chainable:1},{params:[]}]},textLeading:{name:"textLeading",class:"p5",module:"Typography",overloads:[{params:[{name:"leading",description:"the size in pixels for spacing between lines
\n",type:"Number"}],chainable:1},{params:[]}]},textSize:{name:"textSize",class:"p5",module:"Typography",overloads:[{params:[{name:"theSize",description:"the size of the letters in units of pixels
\n",type:"Number"}],chainable:1},{params:[]}]},textStyle:{name:"textStyle",class:"p5",module:"Typography",overloads:[{params:[{name:"theStyle",description:"styling for text, either NORMAL,\n ITALIC, BOLD or BOLDITALIC
\n",type:"Constant"}],chainable:1},{params:[]}]},textWidth:{name:"textWidth",params:[{name:"theText",description:"the String of characters to measure
\n",type:"String"}],class:"p5",module:"Typography"},textAscent:{name:"textAscent",class:"p5",module:"Typography"},textDescent:{name:"textDescent",class:"p5",module:"Typography"},loadFont:{name:"loadFont",params:[{name:"path",description:"name of the file or url to load
\n",type:"String"},{name:"callback",description:'function to be executed after\n loadFont() completes
\n',type:"Function",optional:!0},{name:"onError",description:"function to be executed if\n an error occurs
\n",type:"Function",optional:!0}],class:"p5",module:"Typography"},text:{name:"text",params:[{name:"str",description:"the alphanumeric\n symbols to be displayed
\n",type:"String|Object|Array|Number|Boolean"},{name:"x",description:"x-coordinate of text
\n",type:"Number"},{name:"y",description:"y-coordinate of text
\n",type:"Number"},{name:"x2",description:'by default, the width of the text box,\n see rectMode() for more info
\n',type:"Number",optional:!0},{name:"y2",description:'by default, the height of the text box,\n see rectMode() for more info
\n',type:"Number",optional:!0}],class:"p5",module:"Typography"},textFont:{name:"textFont",class:"p5",module:"Typography",overloads:[{params:[]},{params:[{name:"font",description:'a font loaded via loadFont(),\nor a String representing a web safe font\n(a font that is generally available across all systems)
\n',type:"Object|String"},{name:"size",description:"the font size to use
\n",type:"Number",optional:!0}],chainable:1}]},append:{name:"append",params:[{name:"array",description:"Array to append
\n",type:"Array"},{name:"value",description:"to be added to the Array
\n",type:"Any"}],class:"p5",module:"Data"},arrayCopy:{name:"arrayCopy",class:"p5",module:"Data",overloads:[{params:[{name:"src",description:"the source Array
\n",type:"Array"},{name:"srcPosition",description:"starting position in the source Array
\n",type:"Integer"},{name:"dst",description:"the destination Array
\n",type:"Array"},{name:"dstPosition",description:"starting position in the destination Array
\n",type:"Integer"},{name:"length",description:"number of Array elements to be copied
\n",type:"Integer"}]},{params:[{name:"src",description:"",type:"Array"},{name:"dst",description:"",type:"Array"},{name:"length",description:"",type:"Integer",optional:!0}]}]},concat:{name:"concat",params:[{name:"a",description:"first Array to concatenate
\n",type:"Array"},{name:"b",description:"second Array to concatenate
\n",type:"Array"}],class:"p5",module:"Data"},reverse:{name:"reverse",params:[{name:"list",description:"Array to reverse
\n",type:"Array"}],class:"p5",module:"Data"},shorten:{name:"shorten",params:[{name:"list",description:"Array to shorten
\n",type:"Array"}],class:"p5",module:"Data"},shuffle:{name:"shuffle",params:[{name:"array",description:"Array to shuffle
\n",type:"Array"},{name:"bool",description:"modify passed array
\n",type:"Boolean",optional:!0}],class:"p5",module:"Data"},sort:{name:"sort",params:[{name:"list",description:"Array to sort
\n",type:"Array"},{name:"count",description:"number of elements to sort, starting from 0
\n",type:"Integer",optional:!0}],class:"p5",module:"Data"},splice:{name:"splice",params:[{name:"list",description:"Array to splice into
\n",type:"Array"},{name:"value",description:"value to be spliced in
\n",type:"Any"},{name:"position",description:"in the array from which to insert data
\n",type:"Integer"}],class:"p5",module:"Data"},subset:{name:"subset",params:[{name:"list",description:"Array to extract from
\n",type:"Array"},{name:"start",description:"position to begin
\n",type:"Integer"},{name:"count",description:"number of values to extract
\n",type:"Integer",optional:!0}],class:"p5",module:"Data"},float:{name:"float",params:[{name:"str",description:"float string to parse
\n",type:"String"}],class:"p5",module:"Data"},int:{name:"int",class:"p5",module:"Data",overloads:[{params:[{name:"n",description:"value to parse
\n",type:"String|Boolean|Number"},{name:"radix",description:"the radix to convert to (default: 10)
\n",type:"Integer",optional:!0}]},{params:[{name:"ns",description:"values to parse
\n",type:"Array"}]}]},str:{name:"str",params:[{name:"n",description:"value to parse
\n",type:"String|Boolean|Number|Array"}],class:"p5",module:"Data"},byte:{name:"byte",class:"p5",module:"Data",overloads:[{params:[{name:"n",description:"value to parse
\n",type:"String|Boolean|Number"}]},{params:[{name:"ns",description:"values to parse
\n",type:"Array"}]}]},char:{name:"char",class:"p5",module:"Data",overloads:[{params:[{name:"n",description:"value to parse
\n",type:"String|Number"}]},{params:[{name:"ns",description:"values to parse
\n",type:"Array"}]}]},unchar:{name:"unchar",class:"p5",module:"Data",overloads:[{params:[{name:"n",description:"value to parse
\n",type:"String"}]},{params:[{name:"ns",description:"values to parse
\n",type:"Array"}]}]},hex:{name:"hex",class:"p5",module:"Data",overloads:[{params:[{name:"n",description:"value to parse
\n",type:"Number"},{name:"digits",description:"",type:"Number",optional:!0}]},{params:[{name:"ns",description:"array of values to parse
\n",type:"Number[]"},{name:"digits",description:"",type:"Number",optional:!0}]}]},unhex:{name:"unhex",class:"p5",module:"Data",overloads:[{params:[{name:"n",description:"value to parse
\n",type:"String"}]},{params:[{name:"ns",description:"values to parse
\n",type:"Array"}]}]},join:{name:"join",params:[{name:"list",description:"array of Strings to be joined
\n",type:"Array"},{name:"separator",description:"String to be placed between each item
\n",type:"String"}],class:"p5",module:"Data"},match:{name:"match",params:[{name:"str",description:"the String to be searched
\n",type:"String"},{name:"regexp",description:"the regexp to be used for matching
\n",type:"String"}],class:"p5",module:"Data"},matchAll:{name:"matchAll",params:[{name:"str",description:"the String to be searched
\n",type:"String"},{name:"regexp",description:"the regexp to be used for matching
\n",type:"String"}],class:"p5",module:"Data"},nf:{name:"nf",class:"p5",module:"Data",overloads:[{params:[{name:"num",description:"the Number to format
\n",type:"Number|String"},{name:"left",description:"number of digits to the left of the\n decimal point
\n",type:"Integer|String",optional:!0},{name:"right",description:"number of digits to the right of the\n decimal point
\n",type:"Integer|String",optional:!0}]},{params:[{name:"nums",description:"the Numbers to format
\n",type:"Array"},{name:"left",description:"",type:"Integer|String",optional:!0},{name:"right",description:"",type:"Integer|String",optional:!0}]}]},nfc:{name:"nfc",class:"p5",module:"Data",overloads:[{params:[{name:"num",description:"the Number to format
\n",type:"Number|String"},{name:"right",description:"number of digits to the right of the\n decimal point
\n",type:"Integer|String",optional:!0}]},{params:[{name:"nums",description:"the Numbers to format
\n",type:"Array"},{name:"right",description:"",type:"Integer|String",optional:!0}]}]},nfp:{name:"nfp",class:"p5",module:"Data",overloads:[{params:[{name:"num",description:"the Number to format
\n",type:"Number"},{name:"left",description:"number of digits to the left of the decimal\n point
\n",type:"Integer",optional:!0},{name:"right",description:"number of digits to the right of the\n decimal point
\n",type:"Integer",optional:!0}]},{params:[{name:"nums",description:"the Numbers to format
\n",type:"Number[]"},{name:"left",description:"",type:"Integer",optional:!0},{name:"right",description:"",type:"Integer",optional:!0}]}]},nfs:{name:"nfs",class:"p5",module:"Data",overloads:[{params:[{name:"num",description:"the Number to format
\n",type:"Number"},{name:"left",description:"number of digits to the left of the decimal\n point
\n",type:"Integer",optional:!0},{name:"right",description:"number of digits to the right of the\n decimal point
\n",type:"Integer",optional:!0}]},{params:[{name:"nums",description:"the Numbers to format
\n",type:"Array"},{name:"left",description:"",type:"Integer",optional:!0},{name:"right",description:"",type:"Integer",optional:!0}]}]},split:{name:"split",params:[{name:"value",description:"the String to be split
\n",type:"String"},{name:"delim",description:"the String used to separate the data
\n",type:"String"}],class:"p5",module:"Data"},splitTokens:{name:"splitTokens",params:[{name:"value",description:"the String to be split
\n",type:"String"},{name:"delim",description:"list of individual Strings that will be used as\n separators
\n",type:"String",optional:!0}],class:"p5",module:"Data"},trim:{name:"trim",class:"p5",module:"Data",overloads:[{params:[{name:"str",description:"a String to be trimmed
\n",type:"String"}]},{params:[{name:"strs",description:"an Array of Strings to be trimmed
\n",type:"Array"}]}]},day:{name:"day",class:"p5",module:"IO"},hour:{name:"hour",class:"p5",module:"IO"},minute:{name:"minute",class:"p5",module:"IO"},millis:{name:"millis",class:"p5",module:"IO"},month:{name:"month",class:"p5",module:"IO"},second:{name:"second",class:"p5",module:"IO"},year:{name:"year",class:"p5",module:"IO"},plane:{name:"plane",params:[{name:"width",description:"width of the plane
\n",type:"Number",optional:!0},{name:"height",description:"height of the plane
\n",type:"Number",optional:!0},{name:"detailX",description:"Optional number of triangle\n subdivisions in x-dimension
\n",type:"Integer",optional:!0},{name:"detailY",description:"Optional number of triangle\n subdivisions in y-dimension
\n",type:"Integer",optional:!0}],class:"p5",module:"Shape"},box:{name:"box",params:[{name:"width",description:"width of the box
\n",type:"Number",optional:!0},{name:"Height",description:"height of the box
\n",type:"Number",optional:!0},{name:"depth",description:"depth of the box
\n",type:"Number",optional:!0},{name:"detailX",description:"Optional number of triangle\n subdivisions in x-dimension
\n",type:"Integer",optional:!0},{name:"detailY",description:"Optional number of triangle\n subdivisions in y-dimension
\n",type:"Integer",optional:!0}],class:"p5",module:"Shape"},sphere:{name:"sphere",params:[{name:"radius",description:"radius of circle
\n",type:"Number",optional:!0},{name:"detailX",description:"optional number of subdivisions in x-dimension
\n",type:"Integer",optional:!0},{name:"detailY",description:"optional number of subdivisions in y-dimension
\n",type:"Integer",optional:!0}],class:"p5",module:"Shape"},cylinder:{name:"cylinder",params:[{name:"radius",description:"radius of the surface
\n",type:"Number",optional:!0},{name:"height",description:"height of the cylinder
\n",type:"Number",optional:!0},{name:"detailX",description:"number of subdivisions in x-dimension;\n default is 24
\n",type:"Integer",optional:!0},{name:"detailY",description:"number of subdivisions in y-dimension;\n default is 1
\n",type:"Integer",optional:!0},{name:"bottomCap",description:"whether to draw the bottom of the cylinder
\n",type:"Boolean",optional:!0},{name:"topCap",description:"whether to draw the top of the cylinder
\n",type:"Boolean",optional:!0}],class:"p5",module:"Shape"},cone:{name:"cone",params:[{name:"radius",description:"radius of the bottom surface
\n",type:"Number",optional:!0},{name:"height",description:"height of the cone
\n",type:"Number",optional:!0},{name:"detailX",description:"number of segments,\n the more segments the smoother geometry\n default is 24
\n",type:"Integer",optional:!0},{name:"detailY",description:"number of segments,\n the more segments the smoother geometry\n default is 1
\n",type:"Integer",optional:!0},{name:"cap",description:"whether to draw the base of the cone
\n",type:"Boolean",optional:!0}],class:"p5",module:"Shape"},ellipsoid:{name:"ellipsoid",params:[{name:"radiusx",description:"x-radius of ellipsoid
\n",type:"Number",optional:!0},{name:"radiusy",description:"y-radius of ellipsoid
\n",type:"Number",optional:!0},{name:"radiusz",description:"z-radius of ellipsoid
\n",type:"Number",optional:!0},{name:"detailX",description:"number of segments,\n the more segments the smoother geometry\n default is 24. Avoid detail number above\n 150, it may crash the browser.
\n",type:"Integer",optional:!0},{name:"detailY",description:"number of segments,\n the more segments the smoother geometry\n default is 16. Avoid detail number above\n 150, it may crash the browser.
\n",type:"Integer",optional:!0}],class:"p5",module:"Shape"},torus:{name:"torus",params:[{name:"radius",description:"radius of the whole ring
\n",type:"Number",optional:!0},{name:"tubeRadius",description:"radius of the tube
\n",type:"Number",optional:!0},{name:"detailX",description:"number of segments in x-dimension,\n the more segments the smoother geometry\n default is 24
\n",type:"Integer",optional:!0},{name:"detailY",description:"number of segments in y-dimension,\n the more segments the smoother geometry\n default is 16
\n",type:"Integer",optional:!0}],class:"p5",module:"Shape"},orbitControl:{name:"orbitControl",params:[{name:"sensitivityX",description:"sensitivity to mouse movement along X axis
\n",type:"Number",optional:!0},{name:"sensitivityY",description:"sensitivity to mouse movement along Y axis
\n",type:"Number",optional:!0},{name:"sensitivityZ",description:"sensitivity to scroll movement along Z axis
\n",type:"Number",optional:!0}],class:"p5",module:"Lights, Camera"},debugMode:{name:"debugMode",class:"p5",module:"Lights, Camera",overloads:[{params:[]},{params:[{name:"mode",description:"either GRID or AXES
\n",type:"Constant"}]},{params:[{name:"mode",description:"",type:"Constant"},{name:"gridSize",description:"size of one side of the grid
\n",type:"Number",optional:!0},{name:"gridDivisions",description:"number of divisions in the grid
\n",type:"Number",optional:!0},{name:"xOff",description:"X axis offset from origin (0,0,0)
\n",type:"Number",optional:!0},{name:"yOff",description:"Y axis offset from origin (0,0,0)
\n",type:"Number",optional:!0},{name:"zOff",description:"Z axis offset from origin (0,0,0)
\n",type:"Number",optional:!0}]},{params:[{name:"mode",description:"",type:"Constant"},{name:"axesSize",description:"size of axes icon
\n",type:"Number",optional:!0},{name:"xOff",description:"",type:"Number",optional:!0},{name:"yOff",description:"",type:"Number",optional:!0},{name:"zOff",description:"",type:"Number",optional:!0}]},{params:[{name:"gridSize",description:"",type:"Number",optional:!0},{name:"gridDivisions",description:"",type:"Number",optional:!0},{name:"gridXOff",description:"",type:"Number",optional:!0},{name:"gridYOff",description:"",type:"Number",optional:!0},{name:"gridZOff",description:"",type:"Number",optional:!0},{name:"axesSize",description:"",type:"Number",optional:!0},{name:"axesXOff",description:"",type:"Number",optional:!0},{name:"axesYOff",description:"",type:"Number",optional:!0},{name:"axesZOff",description:"",type:"Number",optional:!0}]}]},noDebugMode:{name:"noDebugMode",class:"p5",module:"Lights, Camera"},ambientLight:{name:"ambientLight",class:"p5",module:"Lights, Camera",overloads:[{params:[{name:"v1",description:"red or hue value relative to\n the current color range
\n",type:"Number"},{name:"v2",description:"green or saturation value\n relative to the current color range
\n",type:"Number"},{name:"v3",description:"blue or brightness value\n relative to the current color range
\n",type:"Number"},{name:"alpha",description:"the alpha value
\n",type:"Number",optional:!0}],chainable:1},{params:[{name:"value",description:"a color string
\n",type:"String"}],chainable:1},{params:[{name:"gray",description:"a gray value
\n",type:"Number"},{name:"alpha",description:"",type:"Number",optional:!0}],chainable:1},{params:[{name:"values",description:"an array containing the red,green,blue &\n and alpha components of the color
\n",type:"Number[]"}],chainable:1},{params:[{name:"color",description:"the ambient light color
\n",type:"p5.Color"}],chainable:1}]},specularColor:{name:"specularColor",class:"p5",module:"Lights, Camera",overloads:[{params:[{name:"v1",description:"red or hue value relative to\n the current color range
\n",type:"Number"},{name:"v2",description:"green or saturation value\n relative to the current color range
\n",type:"Number"},{name:"v3",description:"blue or brightness value\n relative to the current color range
\n",type:"Number"}],chainable:1},{params:[{name:"value",description:"a color string
\n",type:"String"}],chainable:1},{params:[{name:"gray",description:"a gray value
\n",type:"Number"}],chainable:1},{params:[{name:"values",description:"an array containing the red,green,blue &\n and alpha components of the color
\n",type:"Number[]"}],chainable:1},{params:[{name:"color",description:"the ambient light color
\n",type:"p5.Color"}],chainable:1}]},directionalLight:{name:"directionalLight",class:"p5",module:"Lights, Camera",overloads:[{params:[{name:"v1",description:"red or hue value (depending on the current\ncolor mode),
\n",type:"Number"},{name:"v2",description:"green or saturation value
\n",type:"Number"},{name:"v3",description:"blue or brightness value
\n",type:"Number"},{name:"position",description:"the direction of the light
\n",type:"p5.Vector"}],chainable:1},{params:[{name:"color",description:'color Array, CSS color string,\n or p5.Color value
\n',type:"Number[]|String|p5.Color"},{name:"x",description:"x axis direction
\n",type:"Number"},{name:"y",description:"y axis direction
\n",type:"Number"},{name:"z",description:"z axis direction
\n",type:"Number"}],chainable:1},{params:[{name:"color",description:"",type:"Number[]|String|p5.Color"},{name:"position",description:"",type:"p5.Vector"}],chainable:1},{params:[{name:"v1",description:"",type:"Number"},{name:"v2",description:"",type:"Number"},{name:"v3",description:"",type:"Number"},{name:"x",description:"",type:"Number"},{name:"y",description:"",type:"Number"},{name:"z",description:"",type:"Number"}],chainable:1}]},pointLight:{name:"pointLight",class:"p5",module:"Lights, Camera",overloads:[{params:[{name:"v1",description:"red or hue value (depending on the current\ncolor mode),
\n",type:"Number"},{name:"v2",description:"green or saturation value
\n",type:"Number"},{name:"v3",description:"blue or brightness value
\n",type:"Number"},{name:"x",description:"x axis position
\n",type:"Number"},{name:"y",description:"y axis position
\n",type:"Number"},{name:"z",description:"z axis position
\n",type:"Number"}],chainable:1},{params:[{name:"v1",description:"",type:"Number"},{name:"v2",description:"",type:"Number"},{name:"v3",description:"",type:"Number"},{name:"position",description:"the position of the light
\n",type:"p5.Vector"}],chainable:1},{params:[{name:"color",description:'color Array, CSS color string,\nor p5.Color value
\n',type:"Number[]|String|p5.Color"},{name:"x",description:"",type:"Number"},{name:"y",description:"",type:"Number"},{name:"z",description:"",type:"Number"}],chainable:1},{params:[{name:"color",description:"",type:"Number[]|String|p5.Color"},{name:"position",description:"",type:"p5.Vector"}],chainable:1}]},lights:{name:"lights",class:"p5",module:"Lights, Camera"},lightFalloff:{name:"lightFalloff",params:[{name:"constant",description:"constant value for determining falloff
\n",type:"Number"},{name:"linear",description:"linear value for determining falloff
\n",type:"Number"},{name:"quadratic",description:"quadratic value for determining falloff
\n",type:"Number"}],class:"p5",module:"Lights, Camera"},spotLight:{name:"spotLight",class:"p5",module:"Lights, Camera",overloads:[{params:[{name:"v1",description:"red or hue value (depending on the current\ncolor mode),
\n",type:"Number"},{name:"v2",description:"green or saturation value
\n",type:"Number"},{name:"v3",description:"blue or brightness value
\n",type:"Number"},{name:"x",description:"x axis position
\n",type:"Number"},{name:"y",description:"y axis position
\n",type:"Number"},{name:"z",description:"z axis position
\n",type:"Number"},{name:"rx",description:"x axis direction of light
\n",type:"Number"},{name:"ry",description:"y axis direction of light
\n",type:"Number"},{name:"rz",description:"z axis direction of light
\n",type:"Number"},{name:"angle",description:"optional parameter for angle. Defaults to PI/3
\n",type:"Number",optional:!0},{name:"conc",description:"optional parameter for concentration. Defaults to 100
\n",type:"Number",optional:!0}],chainable:1},{params:[{name:"color",description:'color Array, CSS color string,\nor p5.Color value
\n',type:"Number[]|String|p5.Color"},{name:"position",description:"the position of the light
\n",type:"p5.Vector"},{name:"direction",description:"the direction of the light
\n",type:"p5.Vector"},{name:"angle",description:"",type:"Number",optional:!0},{name:"conc",description:"",type:"Number",optional:!0}]},{params:[{name:"v1",description:"",type:"Number"},{name:"v2",description:"",type:"Number"},{name:"v3",description:"",type:"Number"},{name:"position",description:"",type:"p5.Vector"},{name:"direction",description:"",type:"p5.Vector"},{name:"angle",description:"",type:"Number",optional:!0},{name:"conc",description:"",type:"Number",optional:!0}]},{params:[{name:"color",description:"",type:"Number[]|String|p5.Color"},{name:"x",description:"",type:"Number"},{name:"y",description:"",type:"Number"},{name:"z",description:"",type:"Number"},{name:"direction",description:"",type:"p5.Vector"},{name:"angle",description:"",type:"Number",optional:!0},{name:"conc",description:"",type:"Number",optional:!0}]},{params:[{name:"color",description:"",type:"Number[]|String|p5.Color"},{name:"position",description:"",type:"p5.Vector"},{name:"rx",description:"",type:"Number"},{name:"ry",description:"",type:"Number"},{name:"rz",description:"",type:"Number"},{name:"angle",description:"",type:"Number",optional:!0},{name:"conc",description:"",type:"Number",optional:!0}]},{params:[{name:"v1",description:"",type:"Number"},{name:"v2",description:"",type:"Number"},{name:"v3",description:"",type:"Number"},{name:"x",description:"",type:"Number"},{name:"y",description:"",type:"Number"},{name:"z",description:"",type:"Number"},{name:"direction",description:"",type:"p5.Vector"},{name:"angle",description:"",type:"Number",optional:!0},{name:"conc",description:"",type:"Number",optional:!0}]},{params:[{name:"v1",description:"",type:"Number"},{name:"v2",description:"",type:"Number"},{name:"v3",description:"",type:"Number"},{name:"position",description:"",type:"p5.Vector"},{name:"rx",description:"",type:"Number"},{name:"ry",description:"",type:"Number"},{name:"rz",description:"",type:"Number"},{name:"angle",description:"",type:"Number",optional:!0},{name:"conc",description:"",type:"Number",optional:!0}]},{params:[{name:"color",description:"",type:"Number[]|String|p5.Color"},{name:"x",description:"",type:"Number"},{name:"y",description:"",type:"Number"},{name:"z",description:"",type:"Number"},{name:"rx",description:"",type:"Number"},{name:"ry",description:"",type:"Number"},{name:"rz",description:"",type:"Number"},{name:"angle",description:"",type:"Number",optional:!0},{name:"conc",description:"",type:"Number",optional:!0}]}]},noLights:{name:"noLights",class:"p5",module:"Lights, Camera"},loadModel:{name:"loadModel",class:"p5",module:"Shape",overloads:[{params:[{name:"path",description:"Path of the model to be loaded
\n",type:"String"},{name:"normalize",description:"If true, scale the model to a\n standardized size when loading
\n",type:"Boolean"},{name:"successCallback",description:"Function to be called\n once the model is loaded. Will be passed\n the 3D model object.
\n",type:"function(p5.Geometry)",optional:!0},{name:"failureCallback",description:"called with event error if\n the model fails to load.
\n",type:"Function(Event)",optional:!0},{name:"fileType",description:"The file extension of the model\n (.stl, .obj).
\n",type:"String",optional:!0}]},{params:[{name:"path",description:"",type:"String"},{name:"successCallback",description:"",type:"function(p5.Geometry)",optional:!0},{name:"failureCallback",description:"",type:"Function(Event)",optional:!0},{name:"fileType",description:"",type:"String",optional:!0}]}]},model:{name:"model",params:[{name:"model",description:"Loaded 3d model to be rendered
\n",type:"p5.Geometry"}],class:"p5",module:"Shape"},loadShader:{name:"loadShader",params:[{name:"vertFilename",description:"path to file containing vertex shader\nsource code
\n",type:"String"},{name:"fragFilename",description:"path to file containing fragment shader\nsource code
\n",type:"String"},{name:"callback",description:"callback to be executed after loadShader\ncompletes. On success, the Shader object is passed as the first argument.
\n",type:"Function",optional:!0},{name:"errorCallback",description:"callback to be executed when an error\noccurs inside loadShader. On error, the error is passed as the first\nargument.
\n",type:"Function",optional:!0}],class:"p5",module:"Lights, Camera"},createShader:{name:"createShader",params:[{name:"vertSrc",description:"source code for the vertex shader
\n",type:"String"},{name:"fragSrc",description:"source code for the fragment shader
\n",type:"String"}],class:"p5",module:"Lights, Camera"},shader:{name:"shader",params:[{name:"s",description:'the desired p5.Shader to use for rendering\nshapes.
\n',type:"p5.Shader",optional:!0}],class:"p5",module:"Lights, Camera"},resetShader:{name:"resetShader",class:"p5",module:"Lights, Camera"},normalMaterial:{name:"normalMaterial",class:"p5",module:"Lights, Camera"},texture:{name:"texture",params:[{name:"tex",description:"2-dimensional graphics\n to render as texture
\n",type:"p5.Image|p5.MediaElement|p5.Graphics"}],class:"p5",module:"Lights, Camera"},textureMode:{name:"textureMode",params:[{name:"mode",description:"either IMAGE or NORMAL
\n",type:"Constant"}],class:"p5",module:"Lights, Camera"},textureWrap:{name:"textureWrap",params:[{name:"wrapX",description:"either CLAMP, REPEAT, or MIRROR
\n",type:"Constant"},{name:"wrapY",description:"either CLAMP, REPEAT, or MIRROR
\n",type:"Constant",optional:!0}],class:"p5",module:"Lights, Camera"},ambientMaterial:{name:"ambientMaterial",class:"p5",module:"Lights, Camera",overloads:[{params:[{name:"v1",description:"gray value, red or hue value\n (depending on the current color mode),
\n",type:"Number"},{name:"v2",description:"green or saturation value
\n",type:"Number",optional:!0},{name:"v3",description:"blue or brightness value
\n",type:"Number",optional:!0}],chainable:1},{params:[{name:"color",description:"color, color Array, or CSS color string
\n",type:"Number[]|String|p5.Color"}],chainable:1}]},emissiveMaterial:{name:"emissiveMaterial",class:"p5",module:"Lights, Camera",overloads:[{params:[{name:"v1",description:"gray value, red or hue value\n (depending on the current color mode),
\n",type:"Number"},{name:"v2",description:"green or saturation value
\n",type:"Number",optional:!0},{name:"v3",description:"blue or brightness value
\n",type:"Number",optional:!0},{name:"a",description:"opacity
\n",type:"Number",optional:!0}],chainable:1},{params:[{name:"color",description:"color, color Array, or CSS color string
\n",type:"Number[]|String|p5.Color"}],chainable:1}]},specularMaterial:{name:"specularMaterial",class:"p5",module:"Lights, Camera",overloads:[{params:[{name:"gray",description:"number specifying value between white and black.
\n",type:"Number"},{name:"alpha",description:"alpha value relative to current color range\n (default is 0-255)
\n",type:"Number",optional:!0}],chainable:1},{params:[{name:"v1",description:"red or hue value relative to\n the current color range
\n",type:"Number"},{name:"v2",description:"green or saturation value\n relative to the current color range
\n",type:"Number"},{name:"v3",description:"blue or brightness value\n relative to the current color range
\n",type:"Number"},{name:"alpha",description:"",type:"Number",optional:!0}],chainable:1},{params:[{name:"color",description:"color Array, or CSS color string
\n",type:"Number[]|String|p5.Color"}],chainable:1}]},shininess:{name:"shininess",params:[{name:"shine",description:"Degree of Shininess.\n Defaults to 1.
\n",type:"Number"}],class:"p5",module:"Lights, Camera"},camera:{name:"camera",params:[{name:"x",description:"camera position value on x axis
\n",type:"Number",optional:!0},{name:"y",description:"camera position value on y axis
\n",type:"Number",optional:!0},{name:"z",description:"camera position value on z axis
\n",type:"Number",optional:!0},{name:"centerX",description:"x coordinate representing center of the sketch
\n",type:"Number",optional:!0},{name:"centerY",description:"y coordinate representing center of the sketch
\n",type:"Number",optional:!0},{name:"centerZ",description:"z coordinate representing center of the sketch
\n",type:"Number",optional:!0},{name:"upX",description:"x component of direction 'up' from camera
\n",type:"Number",optional:!0},{name:"upY",description:"y component of direction 'up' from camera
\n",type:"Number",optional:!0},{name:"upZ",description:"z component of direction 'up' from camera
\n",type:"Number",optional:!0}],class:"p5",module:"Lights, Camera"},perspective:{name:"perspective",params:[{name:"fovy",description:'camera frustum vertical field of view,\n from bottom to top of view, in angleMode units
\n',type:"Number",optional:!0},{name:"aspect",description:"camera frustum aspect ratio
\n",type:"Number",optional:!0},{name:"near",description:"frustum near plane length
\n",type:"Number",optional:!0},{name:"far",description:"frustum far plane length
\n",type:"Number",optional:!0}],class:"p5",module:"Lights, Camera"},ortho:{name:"ortho",params:[{name:"left",description:"camera frustum left plane
\n",type:"Number",optional:!0},{name:"right",description:"camera frustum right plane
\n",type:"Number",optional:!0},{name:"bottom",description:"camera frustum bottom plane
\n",type:"Number",optional:!0},{name:"top",description:"camera frustum top plane
\n",type:"Number",optional:!0},{name:"near",description:"camera frustum near plane
\n",type:"Number",optional:!0},{name:"far",description:"camera frustum far plane
\n",type:"Number",optional:!0}],class:"p5",module:"Lights, Camera"},frustum:{name:"frustum",params:[{name:"left",description:"camera frustum left plane
\n",type:"Number",optional:!0},{name:"right",description:"camera frustum right plane
\n",type:"Number",optional:!0},{name:"bottom",description:"camera frustum bottom plane
\n",type:"Number",optional:!0},{name:"top",description:"camera frustum top plane
\n",type:"Number",optional:!0},{name:"near",description:"camera frustum near plane
\n",type:"Number",optional:!0},{name:"far",description:"camera frustum far plane
\n",type:"Number",optional:!0}],class:"p5",module:"Lights, Camera"},createCamera:{name:"createCamera",class:"p5",module:"Lights, Camera"},setCamera:{name:"setCamera",params:[{name:"cam",description:"p5.Camera object
\n",type:"p5.Camera"}],class:"p5",module:"Lights, Camera"},setAttributes:{name:"setAttributes",class:"p5",module:"Rendering",overloads:[{params:[{name:"key",description:"Name of attribute
\n",type:"String"},{name:"value",description:"New value of named attribute
\n",type:"Boolean"}]},{params:[{name:"obj",description:"object with key-value pairs
\n",type:"Object"}]}]},sampleRate:{name:"sampleRate",class:"p5",module:"p5.sound"},freqToMidi:{name:"freqToMidi",params:[{name:"frequency",description:'A freqeuncy, for example, the "A"\n above Middle C is 440Hz
\n',type:"Number"}],class:"p5",module:"p5.sound"},midiToFreq:{name:"midiToFreq",params:[{name:"midiNote",description:"The number of a MIDI note
\n",type:"Number"}],class:"p5",module:"p5.sound"},soundFormats:{name:"soundFormats",params:[{name:"formats",description:"i.e. 'mp3', 'wav', 'ogg'
\n",type:"String",optional:!0,multiple:!0}],class:"p5",module:"p5.sound"},getAudioContext:{name:"getAudioContext",class:"p5",module:"p5.sound"},userStartAudio:{params:[{name:"element(s)",description:"This argument can be an Element,\n Selector String, NodeList, p5.Element,\n jQuery Element, or an Array of any of those.
\n",type:"Element|Array",optional:!0},{name:"callback",description:"Callback to invoke when the AudioContext\n has started
\n",type:"Function",optional:!0}],name:"userStartAudio",class:"p5",module:"p5.sound"},loadSound:{name:"loadSound",params:[{name:"path",description:"Path to the sound file, or an array with\n paths to soundfiles in multiple formats\n i.e. ['sound.ogg', 'sound.mp3'].\n Alternately, accepts an object: either\n from the HTML5 File API, or a p5.File.
\n",type:"String|Array"},{name:"successCallback",description:"Name of a function to call once file loads
\n",type:"Function",optional:!0},{name:"errorCallback",description:"Name of a function to call if there is\n an error loading the file.
\n",type:"Function",optional:!0},{name:"whileLoading",description:"Name of a function to call while file is loading.\n This function will receive the percentage loaded\n so far, from 0.0 to 1.0.
\n",type:"Function",optional:!0}],class:"p5",module:"p5.sound"},createConvolver:{name:"createConvolver",params:[{name:"path",description:"path to a sound file
\n",type:"String"},{name:"callback",description:"function to call if loading is successful.\n The object will be passed in as the argument\n to the callback function.
\n",type:"Function",optional:!0},{name:"errorCallback",description:"function to call if loading is not successful.\n A custom error will be passed in as the argument\n to the callback function.
\n",type:"Function",optional:!0}],class:"p5",module:"p5.sound"},setBPM:{name:"setBPM",params:[{name:"BPM",description:"Beats Per Minute
\n",type:"Number"},{name:"rampTime",description:"Seconds from now
\n",type:"Number"}],class:"p5",module:"p5.sound"},saveSound:{name:"saveSound",params:[{name:"soundFile",description:"p5.SoundFile that you wish to save
\n",type:"p5.SoundFile"},{name:"fileName",description:"name of the resulting .wav file.
\n",type:"String"}],class:"p5",module:"p5.sound"}},"p5.Color":{toString:{name:"toString",params:[{name:"format",description:"How the color string will be formatted.\nLeaving this empty formats the string as rgba(r, g, b, a).\n'#rgb' '#rgba' '#rrggbb' and '#rrggbbaa' format as hexadecimal color codes.\n'rgb' 'hsb' and 'hsl' return the color formatted in the specified color mode.\n'rgba' 'hsba' and 'hsla' are the same as above but with alpha channels.\n'rgb%' 'hsb%' 'hsl%' 'rgba%' 'hsba%' and 'hsla%' format as percentages.
\n",type:"String",optional:!0}],class:"p5.Color",module:"Color"},setRed:{name:"setRed",params:[{name:"red",description:"the new red value
\n",type:"Number"}],class:"p5.Color",module:"Color"},setGreen:{name:"setGreen",params:[{name:"green",description:"the new green value
\n",type:"Number"}],class:"p5.Color",module:"Color"},setBlue:{name:"setBlue",params:[{name:"blue",description:"the new blue value
\n",type:"Number"}],class:"p5.Color",module:"Color"},setAlpha:{name:"setAlpha",params:[{name:"alpha",description:"the new alpha value
\n",type:"Number"}],class:"p5.Color",module:"Color"}},"p5.Element":{elt:{name:"elt",class:"p5.Element",module:"DOM"},parent:{name:"parent",class:"p5.Element",module:"DOM",overloads:[{params:[{name:"parent",description:'the ID, DOM node, or p5.Element\n of desired parent element
\n',type:"String|p5.Element|Object"}],chainable:1},{params:[]}]},id:{name:"id",class:"p5.Element",module:"DOM",overloads:[{params:[{name:"id",description:"ID of the element
\n",type:"String"}],chainable:1},{params:[]}]},class:{name:"class",class:"p5.Element",module:"DOM",overloads:[{params:[{name:"class",description:"class to add
\n",type:"String"}],chainable:1},{params:[]}]},mousePressed:{name:"mousePressed",params:[{name:"fxn",description:"function to be fired when mouse is\n pressed over the element.\n if false is passed instead, the previously\n firing function will no longer fire.
\n",type:"Function|Boolean"}],class:"p5.Element",module:"DOM"},doubleClicked:{name:"doubleClicked",params:[{name:"fxn",description:"function to be fired when mouse is\n double clicked over the element.\n if false is passed instead, the previously\n firing function will no longer fire.
\n",type:"Function|Boolean"}],class:"p5.Element",module:"DOM"},mouseWheel:{name:"mouseWheel",params:[{name:"fxn",description:"function to be fired when mouse is\n scrolled over the element.\n if false is passed instead, the previously\n firing function will no longer fire.
\n",type:"Function|Boolean"}],class:"p5.Element",module:"DOM"},mouseReleased:{name:"mouseReleased",params:[{name:"fxn",description:"function to be fired when mouse is\n released over the element.\n if false is passed instead, the previously\n firing function will no longer fire.
\n",type:"Function|Boolean"}],class:"p5.Element",module:"DOM"},mouseClicked:{name:"mouseClicked",params:[{name:"fxn",description:"function to be fired when mouse is\n clicked over the element.\n if false is passed instead, the previously\n firing function will no longer fire.
\n",type:"Function|Boolean"}],class:"p5.Element",module:"DOM"},mouseMoved:{name:"mouseMoved",params:[{name:"fxn",description:"function to be fired when a mouse moves\n over the element.\n if false is passed instead, the previously\n firing function will no longer fire.
\n",type:"Function|Boolean"}],class:"p5.Element",module:"DOM"},mouseOver:{name:"mouseOver",params:[{name:"fxn",description:"function to be fired when a mouse moves\n onto the element.\n if false is passed instead, the previously\n firing function will no longer fire.
\n",type:"Function|Boolean"}],class:"p5.Element",module:"DOM"},mouseOut:{name:"mouseOut",params:[{name:"fxn",description:"function to be fired when a mouse\n moves off of an element.\n if false is passed instead, the previously\n firing function will no longer fire.
\n",type:"Function|Boolean"}],class:"p5.Element",module:"DOM"},touchStarted:{name:"touchStarted",params:[{name:"fxn",description:"function to be fired when a touch\n starts over the element.\n if false is passed instead, the previously\n firing function will no longer fire.
\n",type:"Function|Boolean"}],class:"p5.Element",module:"DOM"},touchMoved:{name:"touchMoved",params:[{name:"fxn",description:"function to be fired when a touch moves over\n the element.\n if false is passed instead, the previously\n firing function will no longer fire.
\n",type:"Function|Boolean"}],class:"p5.Element",module:"DOM"},touchEnded:{name:"touchEnded",params:[{name:"fxn",description:"function to be fired when a touch ends\n over the element.\n if false is passed instead, the previously\n firing function will no longer fire.
\n",type:"Function|Boolean"}],class:"p5.Element",module:"DOM"},dragOver:{name:"dragOver",params:[{name:"fxn",description:"function to be fired when a file is\n dragged over the element.\n if false is passed instead, the previously\n firing function will no longer fire.
\n",type:"Function|Boolean"}],class:"p5.Element",module:"DOM"},dragLeave:{name:"dragLeave",params:[{name:"fxn",description:"function to be fired when a file is\n dragged off the element.\n if false is passed instead, the previously\n firing function will no longer fire.
\n",type:"Function|Boolean"}],class:"p5.Element",module:"DOM"},addClass:{name:"addClass",params:[{name:"class",description:"name of class to add
\n",type:"String"}],class:"p5.Element",module:"DOM"},removeClass:{name:"removeClass",params:[{name:"class",description:"name of class to remove
\n",type:"String"}],class:"p5.Element",module:"DOM"},hasClass:{name:"hasClass",params:[{name:"c",description:"class name of class to check
\n",type:"String"}],class:"p5.Element",module:"DOM"},toggleClass:{name:"toggleClass",params:[{name:"c",description:"class name to toggle
\n",type:"String"}],class:"p5.Element",module:"DOM"},child:{name:"child",class:"p5.Element",module:"DOM",overloads:[{params:[]},{params:[{name:"child",description:'the ID, DOM node, or p5.Element\n to add to the current element
\n',type:"String|p5.Element",optional:!0}],chainable:1}]},center:{name:"center",params:[{name:"align",description:"passing 'vertical', 'horizontal' aligns element accordingly
\n",type:"String",optional:!0}],class:"p5.Element",module:"DOM"},html:{name:"html",class:"p5.Element",module:"DOM",overloads:[{params:[]},{params:[{name:"html",description:"the HTML to be placed inside the element
\n",type:"String",optional:!0},{name:"append",description:"whether to append HTML to existing
\n",type:"Boolean",optional:!0}],chainable:1}]},position:{name:"position",class:"p5.Element",module:"DOM",overloads:[{params:[]},{params:[{name:"x",description:"x-position relative to upper left of window (optional)
\n",type:"Number",optional:!0},{name:"y",description:"y-position relative to upper left of window (optional)
\n",type:"Number",optional:!0},{name:"positionType",description:"it can be static, fixed, relative, sticky, initial or inherit (optional)
\n",type:"String"}],chainable:1}]},style:{name:"style",class:"p5.Element",module:"DOM",overloads:[{params:[{name:"property",description:"property to be set
\n",type:"String"}]},{params:[{name:"property",description:"",type:"String"},{name:"value",description:"value to assign to property
\n",type:"String|p5.Color"}],chainable:1}]},attribute:{name:"attribute",class:"p5.Element",module:"DOM",overloads:[{params:[]},{params:[{name:"attr",description:"attribute to set
\n",type:"String"},{name:"value",description:"value to assign to attribute
\n",type:"String"}],chainable:1}]},removeAttribute:{name:"removeAttribute",params:[{name:"attr",description:"attribute to remove
\n",type:"String"}],class:"p5.Element",module:"DOM"},value:{name:"value",class:"p5.Element",module:"DOM",overloads:[{params:[]},{params:[{name:"value",description:"",type:"String|Number"}],chainable:1}]},show:{name:"show",class:"p5.Element",module:"DOM"},hide:{name:"hide",class:"p5.Element",module:"DOM"},size:{name:"size",class:"p5.Element",module:"DOM",overloads:[{params:[]},{params:[{name:"w",description:"width of the element, either AUTO, or a number
\n",type:"Number|Constant"},{name:"h",description:"height of the element, either AUTO, or a number
\n",type:"Number|Constant",optional:!0}],chainable:1}]},remove:{name:"remove",class:"p5.Element",module:"DOM"},drop:{name:"drop",params:[{name:"callback",description:"callback to receive loaded file, called for each file dropped.
\n",type:"Function"},{name:"fxn",description:"callback triggered once when files are dropped with the drop event.
\n",type:"Function",optional:!0}],class:"p5.Element",module:"DOM"}},"p5.Graphics":{reset:{name:"reset",class:"p5.Graphics",module:"Rendering"},remove:{name:"remove",class:"p5.Graphics",module:"Rendering"}},JSON:{stringify:{name:"stringify",params:[{name:"object",description:":Javascript object that you would like to convert to JSON
\n",type:"Object"}],class:"JSON",module:"Foundation"}},console:{log:{name:"log",params:[{name:"message",description:":Message that you would like to print to the console
\n",type:"String|Expression|Object"}],class:"console",module:"Foundation"}},"p5.TypedDict":{size:{name:"size",class:"p5.TypedDict",module:"Data"},hasKey:{name:"hasKey",params:[{name:"key",description:"that you want to look up
\n",type:"Number|String"}],class:"p5.TypedDict",module:"Data"},get:{name:"get",params:[{name:"the",description:"key you want to access
\n",type:"Number|String"}],class:"p5.TypedDict",module:"Data"},set:{name:"set",params:[{name:"key",description:"",type:"Number|String"},{name:"value",description:"",type:"Number|String"}],class:"p5.TypedDict",module:"Data"},create:{name:"create",class:"p5.TypedDict",module:"Data",overloads:[{params:[{name:"key",description:"",type:"Number|String"},{name:"value",description:"",type:"Number|String"}]},{params:[{name:"obj",description:"key/value pair
\n",type:"Object"}]}]},clear:{name:"clear",class:"p5.TypedDict",module:"Data"},remove:{name:"remove",params:[{name:"key",description:"for the pair to remove
\n",type:"Number|String"}],class:"p5.TypedDict",module:"Data"},print:{name:"print",class:"p5.TypedDict",module:"Data"},saveTable:{name:"saveTable",class:"p5.TypedDict",module:"Data"},saveJSON:{name:"saveJSON",class:"p5.TypedDict",module:"Data"}},"p5.NumberDict":{add:{name:"add",params:[{name:"Key",description:"for the value you wish to add to
\n",type:"Number"},{name:"Number",description:"to add to the value
\n",type:"Number"}],class:"p5.NumberDict",module:"Data"},sub:{name:"sub",params:[{name:"Key",description:"for the value you wish to subtract from
\n",type:"Number"},{name:"Number",description:"to subtract from the value
\n",type:"Number"}],class:"p5.NumberDict",module:"Data"},mult:{name:"mult",params:[{name:"Key",description:"for value you wish to multiply
\n",type:"Number"},{name:"Amount",description:"to multiply the value by
\n",type:"Number"}],class:"p5.NumberDict",module:"Data"},div:{name:"div",params:[{name:"Key",description:"for value you wish to divide
\n",type:"Number"},{name:"Amount",description:"to divide the value by
\n",type:"Number"}],class:"p5.NumberDict",module:"Data"},minValue:{name:"minValue",class:"p5.NumberDict",module:"Data"},maxValue:{name:"maxValue",class:"p5.NumberDict",module:"Data"},minKey:{name:"minKey",class:"p5.NumberDict",module:"Data"},maxKey:{name:"maxKey",class:"p5.NumberDict",module:"Data"}},"p5.MediaElement":{src:{name:"src",class:"p5.MediaElement",module:"DOM"},play:{name:"play",class:"p5.MediaElement",module:"DOM"},stop:{name:"stop",class:"p5.MediaElement",module:"DOM"},pause:{name:"pause",class:"p5.MediaElement",module:"DOM"},loop:{name:"loop",class:"p5.MediaElement",module:"DOM"},noLoop:{name:"noLoop",class:"p5.MediaElement",module:"DOM"},autoplay:{name:"autoplay",params:[{name:"shouldAutoplay",description:"whether the element should autoplay
\n",type:"Boolean"}],class:"p5.MediaElement",module:"DOM"},volume:{name:"volume",class:"p5.MediaElement",module:"DOM",overloads:[{params:[]},{params:[{name:"val",description:"volume between 0.0 and 1.0
\n",type:"Number"}],chainable:1}]},speed:{name:"speed",class:"p5.MediaElement",module:"DOM",overloads:[{params:[]},{params:[{name:"speed",description:"speed multiplier for element playback
\n",type:"Number"}],chainable:1}]},time:{name:"time",class:"p5.MediaElement",module:"DOM",overloads:[{params:[]},{params:[{name:"time",description:"time to jump to (in seconds)
\n",type:"Number"}],chainable:1}]},duration:{name:"duration",class:"p5.MediaElement",module:"DOM"},onended:{name:"onended",params:[{name:"callback",description:"function to call when the\n soundfile has ended. The\n media element will be passed\n in as the argument to the\n callback.
\n",type:"Function"}],class:"p5.MediaElement",module:"DOM"},connect:{name:"connect",params:[{name:"audioNode",description:"AudioNode from the Web Audio API,\nor an object from the p5.sound library
\n",type:"AudioNode|Object"}],class:"p5.MediaElement",module:"DOM"},disconnect:{name:"disconnect",class:"p5.MediaElement",module:"DOM"},showControls:{name:"showControls",class:"p5.MediaElement",module:"DOM"},hideControls:{name:"hideControls",class:"p5.MediaElement",module:"DOM"},addCue:{name:"addCue",params:[{name:"time",description:"Time in seconds, relative to this media\n element's playback. For example, to trigger\n an event every time playback reaches two\n seconds, pass in the number 2. This will be\n passed as the first parameter to\n the callback function.
\n",type:"Number"},{name:"callback",description:"Name of a function that will be\n called at the given time. The callback will\n receive time and (optionally) param as its\n two parameters.
\n",type:"Function"},{name:"value",description:"An object to be passed as the\n second parameter to the\n callback function.
\n",type:"Object",optional:!0}],class:"p5.MediaElement",module:"DOM"},removeCue:{name:"removeCue",params:[{name:"id",description:"ID of the cue, as returned by addCue
\n",type:"Number"}],class:"p5.MediaElement",module:"DOM"},clearCues:{name:"clearCues",params:[{name:"id",description:"ID of the cue, as returned by addCue
\n",type:"Number"}],class:"p5.MediaElement",module:"DOM"}},"p5.File":{file:{name:"file",class:"p5.File",module:"DOM"},type:{name:"type",class:"p5.File",module:"DOM"},subtype:{name:"subtype",class:"p5.File",module:"DOM"},name:{name:"name",class:"p5.File",module:"DOM"},size:{name:"size",class:"p5.File",module:"DOM"},data:{name:"data",class:"p5.File",module:"DOM"}},"p5.Image":{width:{name:"width",class:"p5.Image",module:"Image"},height:{name:"height",class:"p5.Image",module:"Image"},pixels:{name:"pixels",class:"p5.Image",module:"Image"},loadPixels:{name:"loadPixels",class:"p5.Image",module:"Image"},updatePixels:{name:"updatePixels",class:"p5.Image",module:"Image",overloads:[{params:[{name:"x",description:"x-offset of the target update area for the\n underlying canvas
\n",type:"Integer"},{name:"y",description:"y-offset of the target update area for the\n underlying canvas
\n",type:"Integer"},{name:"w",description:"height of the target update area for the\n underlying canvas
\n",type:"Integer"},{name:"h",description:"height of the target update area for the\n underlying canvas
\n",type:"Integer"}]},{params:[]}]},get:{name:"get",class:"p5.Image",module:"Image",overloads:[{params:[{name:"x",description:"x-coordinate of the pixel
\n",type:"Number"},{name:"y",description:"y-coordinate of the pixel
\n",type:"Number"},{name:"w",description:"width
\n",type:"Number"},{name:"h",description:"height
\n",type:"Number"}]},{params:[]},{params:[{name:"x",description:"",type:"Number"},{name:"y",description:"",type:"Number"}]}]},set:{name:"set",params:[{name:"x",description:"x-coordinate of the pixel
\n",type:"Number"},{name:"y",description:"y-coordinate of the pixel
\n",type:"Number"},{name:"a",description:'grayscale value | pixel array |\n a p5.Color | image to copy
\n',type:"Number|Number[]|Object"}],class:"p5.Image",module:"Image"},resize:{name:"resize",params:[{name:"width",description:"the resized image width
\n",type:"Number"},{name:"height",description:"the resized image height
\n",type:"Number"}],class:"p5.Image",module:"Image"},copy:{name:"copy",class:"p5.Image",module:"Image",overloads:[{params:[{name:"srcImage",description:"source image
\n",type:"p5.Image|p5.Element"},{name:"sx",description:"X coordinate of the source's upper left corner
\n",type:"Integer"},{name:"sy",description:"Y coordinate of the source's upper left corner
\n",type:"Integer"},{name:"sw",description:"source image width
\n",type:"Integer"},{name:"sh",description:"source image height
\n",type:"Integer"},{name:"dx",description:"X coordinate of the destination's upper left corner
\n",type:"Integer"},{name:"dy",description:"Y coordinate of the destination's upper left corner
\n",type:"Integer"},{name:"dw",description:"destination image width
\n",type:"Integer"},{name:"dh",description:"destination image height
\n",type:"Integer"}]},{params:[{name:"sx",description:"",type:"Integer"},{name:"sy",description:"",type:"Integer"},{name:"sw",description:"",type:"Integer"},{name:"sh",description:"",type:"Integer"},{name:"dx",description:"",type:"Integer"},{name:"dy",description:"",type:"Integer"},{name:"dw",description:"",type:"Integer"},{name:"dh",description:"",type:"Integer"}]}]},mask:{name:"mask",params:[{name:"srcImage",description:"source image
\n",type:"p5.Image"}],class:"p5.Image",module:"Image"},filter:{name:"filter",params:[{name:"filterType",description:"either THRESHOLD, GRAY, OPAQUE, INVERT,\n POSTERIZE, BLUR, ERODE, DILATE or BLUR.\n See Filters.js for docs on\n each available filter
\n",type:"Constant"},{name:"filterParam",description:"an optional parameter unique\n to each filter, see above
\n",type:"Number",optional:!0}],class:"p5.Image",module:"Image"},blend:{name:"blend",class:"p5.Image",module:"Image",overloads:[{params:[{name:"srcImage",description:"source image
\n",type:"p5.Image"},{name:"sx",description:"X coordinate of the source's upper left corner
\n",type:"Integer"},{name:"sy",description:"Y coordinate of the source's upper left corner
\n",type:"Integer"},{name:"sw",description:"source image width
\n",type:"Integer"},{name:"sh",description:"source image height
\n",type:"Integer"},{name:"dx",description:"X coordinate of the destination's upper left corner
\n",type:"Integer"},{name:"dy",description:"Y coordinate of the destination's upper left corner
\n",type:"Integer"},{name:"dw",description:"destination image width
\n",type:"Integer"},{name:"dh",description:"destination image height
\n",type:"Integer"},{name:"blendMode",description:'the blend mode. either\n BLEND, DARKEST, LIGHTEST, DIFFERENCE,\n MULTIPLY, EXCLUSION, SCREEN, REPLACE, OVERLAY, HARD_LIGHT,\n SOFT_LIGHT, DODGE, BURN, ADD or NORMAL.
\nAvailable blend modes are: normal | multiply | screen | overlay |\n darken | lighten | color-dodge | color-burn | hard-light |\n soft-light | difference | exclusion | hue | saturation |\n color | luminosity
\nhttp://blogs.adobe.com/webplatform/2013/01/28/blending-features-in-canvas/
\n',type:"Constant"}]},{params:[{name:"sx",description:"",type:"Integer"},{name:"sy",description:"",type:"Integer"},{name:"sw",description:"",type:"Integer"},{name:"sh",description:"",type:"Integer"},{name:"dx",description:"",type:"Integer"},{name:"dy",description:"",type:"Integer"},{name:"dw",description:"",type:"Integer"},{name:"dh",description:"",type:"Integer"},{name:"blendMode",description:"",type:"Constant"}]}]},save:{name:"save",params:[{name:"filename",description:"give your file a name
\n",type:"String"},{name:"extension",description:"'png' or 'jpg'
\n",type:"String"}],class:"p5.Image",module:"Image"},reset:{name:"reset",class:"p5.Image",module:"Image"},getCurrentFrame:{name:"getCurrentFrame",class:"p5.Image",module:"Image"},setFrame:{name:"setFrame",params:[{name:"index",description:"the index for the frame that should be displayed
\n",type:"Number"}],class:"p5.Image",module:"Image"},numFrames:{name:"numFrames",class:"p5.Image",module:"Image"},play:{name:"play",class:"p5.Image",module:"Image"},pause:{name:"pause",class:"p5.Image",module:"Image"},delay:{name:"delay",params:[{name:"d",description:"the amount in milliseconds to delay between switching frames
\n",type:"Number"},{name:"index",description:"the index of the frame that should have the new delay value {optional}
\n",type:"Number",optional:!0}],class:"p5.Image",module:"Image"}},"p5.PrintWriter":{write:{name:"write",params:[{name:"data",description:"all data to be written by the PrintWriter
\n",type:"Array"}],class:"p5.PrintWriter",module:"IO"},print:{name:"print",params:[{name:"data",description:"all data to be printed by the PrintWriter
\n",type:"Array"}],class:"p5.PrintWriter",module:"IO"},clear:{name:"clear",class:"p5.PrintWriter",module:"IO"},close:{name:"close",class:"p5.PrintWriter",module:"IO"}},"p5.Table":{columns:{name:"columns",class:"p5.Table",module:"IO"},rows:{name:"rows",class:"p5.Table",module:"IO"},addRow:{name:"addRow",params:[{name:"row",description:"row to be added to the table
\n",type:"p5.TableRow",optional:!0}],class:"p5.Table",module:"IO"},removeRow:{name:"removeRow",params:[{name:"id",description:"ID number of the row to remove
\n",type:"Integer"}],class:"p5.Table",module:"IO"},getRow:{name:"getRow",params:[{name:"rowID",description:"ID number of the row to get
\n",type:"Integer"}],class:"p5.Table",module:"IO"},getRows:{name:"getRows",class:"p5.Table",module:"IO"},findRow:{name:"findRow",params:[{name:"value",description:"The value to match
\n",type:"String"},{name:"column",description:"ID number or title of the\n column to search
\n",type:"Integer|String"}],class:"p5.Table",module:"IO"},findRows:{name:"findRows",params:[{name:"value",description:"The value to match
\n",type:"String"},{name:"column",description:"ID number or title of the\n column to search
\n",type:"Integer|String"}],class:"p5.Table",module:"IO"},matchRow:{name:"matchRow",params:[{name:"regexp",description:"The regular expression to match
\n",type:"String|RegExp"},{name:"column",description:"The column ID (number) or\n title (string)
\n",type:"String|Integer"}],class:"p5.Table",module:"IO"},matchRows:{name:"matchRows",params:[{name:"regexp",description:"The regular expression to match
\n",type:"String"},{name:"column",description:"The column ID (number) or\n title (string)
\n",type:"String|Integer",optional:!0}],class:"p5.Table",module:"IO"},getColumn:{name:"getColumn",params:[{name:"column",description:"String or Number of the column to return
\n",type:"String|Number"}],class:"p5.Table",module:"IO"},clearRows:{name:"clearRows",class:"p5.Table",module:"IO"},addColumn:{name:"addColumn",params:[{name:"title",description:"title of the given column
\n",type:"String",optional:!0}],class:"p5.Table",module:"IO"},getColumnCount:{name:"getColumnCount",class:"p5.Table",module:"IO"},getRowCount:{name:"getRowCount",class:"p5.Table",module:"IO"},removeTokens:{name:"removeTokens",params:[{name:"chars",description:"String listing characters to be removed
\n",type:"String"},{name:"column",description:"Column ID (number)\n or name (string)
\n",type:"String|Integer",optional:!0}],class:"p5.Table",module:"IO"},trim:{name:"trim",params:[{name:"column",description:"Column ID (number)\n or name (string)
\n",type:"String|Integer",optional:!0}],class:"p5.Table",module:"IO"},removeColumn:{name:"removeColumn",params:[{name:"column",description:"columnName (string) or ID (number)
\n",type:"String|Integer"}],class:"p5.Table",module:"IO"},set:{name:"set",params:[{name:"row",description:"row ID
\n",type:"Integer"},{name:"column",description:"column ID (Number)\n or title (String)
\n",type:"String|Integer"},{name:"value",description:"value to assign
\n",type:"String|Number"}],class:"p5.Table",module:"IO"},setNum:{name:"setNum",params:[{name:"row",description:"row ID
\n",type:"Integer"},{name:"column",description:"column ID (Number)\n or title (String)
\n",type:"String|Integer"},{name:"value",description:"value to assign
\n",type:"Number"}],class:"p5.Table",module:"IO"},setString:{name:"setString",params:[{name:"row",description:"row ID
\n",type:"Integer"},{name:"column",description:"column ID (Number)\n or title (String)
\n",type:"String|Integer"},{name:"value",description:"value to assign
\n",type:"String"}],class:"p5.Table",module:"IO"},get:{name:"get",params:[{name:"row",description:"row ID
\n",type:"Integer"},{name:"column",description:"columnName (string) or\n ID (number)
\n",type:"String|Integer"}],class:"p5.Table",module:"IO"},getNum:{name:"getNum",params:[{name:"row",description:"row ID
\n",type:"Integer"},{name:"column",description:"columnName (string) or\n ID (number)
\n",type:"String|Integer"}],class:"p5.Table",module:"IO"},getString:{name:"getString",params:[{name:"row",description:"row ID
\n",type:"Integer"},{name:"column",description:"columnName (string) or\n ID (number)
\n",type:"String|Integer"}],class:"p5.Table",module:"IO"},getObject:{name:"getObject",params:[{name:"headerColumn",description:"Name of the column which should be used to\n title each row object (optional)
\n",type:"String",optional:!0}],class:"p5.Table",module:"IO"},getArray:{name:"getArray",class:"p5.Table",module:"IO"}},"p5.TableRow":{set:{name:"set",params:[{name:"column",description:"Column ID (Number)\n or Title (String)
\n",type:"String|Integer"},{name:"value",description:"The value to be stored
\n",type:"String|Number"}],class:"p5.TableRow",module:"IO"},setNum:{name:"setNum",params:[{name:"column",description:"Column ID (Number)\n or Title (String)
\n",type:"String|Integer"},{name:"value",description:"The value to be stored\n as a Float
\n",type:"Number|String"}],class:"p5.TableRow",module:"IO"},setString:{name:"setString",params:[{name:"column",description:"Column ID (Number)\n or Title (String)
\n",type:"String|Integer"},{name:"value",description:"The value to be stored\n as a String
\n",type:"String|Number|Boolean|Object"}],class:"p5.TableRow",module:"IO"},get:{name:"get",params:[{name:"column",description:"columnName (string) or\n ID (number)
\n",type:"String|Integer"}],class:"p5.TableRow",module:"IO"},getNum:{name:"getNum",params:[{name:"column",description:"columnName (string) or\n ID (number)
\n",type:"String|Integer"}],class:"p5.TableRow",module:"IO"},getString:{name:"getString",params:[{name:"column",description:"columnName (string) or\n ID (number)
\n",type:"String|Integer"}],class:"p5.TableRow",module:"IO"}},"p5.XML":{getParent:{name:"getParent",class:"p5.XML",module:"IO"},getName:{name:"getName",class:"p5.XML",module:"IO"},setName:{name:"setName",params:[{name:"the",description:"new name of the node
\n",type:"String"}],class:"p5.XML",module:"IO"},hasChildren:{name:"hasChildren",class:"p5.XML",module:"IO"},listChildren:{name:"listChildren",class:"p5.XML",module:"IO"},getChildren:{name:"getChildren",params:[{name:"name",description:"element name
\n",type:"String",optional:!0}],class:"p5.XML",module:"IO"},getChild:{name:"getChild",params:[{name:"name",description:"element name or index
\n",type:"String|Integer"}],class:"p5.XML",module:"IO"},addChild:{name:"addChild",params:[{name:"node",description:'a p5.XML Object which will be the child to be added
\n',type:"p5.XML"}],class:"p5.XML",module:"IO"},removeChild:{name:"removeChild",params:[{name:"name",description:"element name or index
\n",type:"String|Integer"}],class:"p5.XML",module:"IO"},getAttributeCount:{name:"getAttributeCount",class:"p5.XML",module:"IO"},listAttributes:{name:"listAttributes",class:"p5.XML",module:"IO"},hasAttribute:{name:"hasAttribute",params:[{name:"the",description:"attribute to be checked
\n",type:"String"}],class:"p5.XML",module:"IO"},getNum:{name:"getNum",params:[{name:"name",description:"the non-null full name of the attribute
\n",type:"String"},{name:"defaultValue",description:"the default value of the attribute
\n",type:"Number",optional:!0}],class:"p5.XML",module:"IO"},getString:{name:"getString",params:[{name:"name",description:"the non-null full name of the attribute
\n",type:"String"},{name:"defaultValue",description:"the default value of the attribute
\n",type:"Number",optional:!0}],class:"p5.XML",module:"IO"},setAttribute:{name:"setAttribute",params:[{name:"name",description:"the full name of the attribute
\n",type:"String"},{name:"value",description:"the value of the attribute
\n",type:"Number|String|Boolean"}],class:"p5.XML",module:"IO"},getContent:{name:"getContent",params:[{name:"defaultValue",description:"value returned if no content is found
\n",type:"String",optional:!0}],class:"p5.XML",module:"IO"},setContent:{name:"setContent",params:[{name:"text",description:"the new content
\n",type:"String"}],class:"p5.XML",module:"IO"},serialize:{name:"serialize",class:"p5.XML",module:"IO"}},"p5.Vector":{x:{name:"x",class:"p5.Vector",module:"Math"},y:{name:"y",class:"p5.Vector",module:"Math"},z:{name:"z",class:"p5.Vector",module:"Math"},toString:{name:"toString",class:"p5.Vector",module:"Math"},set:{name:"set",class:"p5.Vector",module:"Math",overloads:[{params:[{name:"x",description:"the x component of the vector
\n",type:"Number",optional:!0},{name:"y",description:"the y component of the vector
\n",type:"Number",optional:!0},{name:"z",description:"the z component of the vector
\n",type:"Number",optional:!0}],chainable:1},{params:[{name:"value",description:"the vector to set
\n",type:"p5.Vector|Number[]"}],chainable:1}]},copy:{name:"copy",class:"p5.Vector",module:"Math"},add:{name:"add",class:"p5.Vector",module:"Math",overloads:[{params:[{name:"x",description:"the x component of the vector to be added
\n",type:"Number"},{name:"y",description:"the y component of the vector to be added
\n",type:"Number",optional:!0},{name:"z",description:"the z component of the vector to be added
\n",type:"Number",optional:!0}],chainable:1},{params:[{name:"value",description:"the vector to add
\n",type:"p5.Vector|Number[]"}],chainable:1},{params:[{name:"v1",description:'a p5.Vector to add
\n',type:"p5.Vector"},{name:"v2",description:'a p5.Vector to add
\n',type:"p5.Vector"},{name:"target",description:"the vector to receive the result (Optional)
\n",type:"p5.Vector",optional:!0}],static:1}]},rem:{name:"rem",class:"p5.Vector",module:"Math",overloads:[{params:[{name:"x",description:"the x component of divisor vector
\n",type:"Number"},{name:"y",description:"the y component of divisor vector
\n",type:"Number"},{name:"z",description:"the z component of divisor vector
\n",type:"Number"}],chainable:1},{params:[{name:"value",description:"divisor vector
\n",type:"p5.Vector | Number[]"}],chainable:1},{params:[{name:"v1",description:'dividend p5.Vector
\n',type:"p5.Vector"},{name:"v2",description:'divisor p5.Vector
\n',type:"p5.Vector"}],static:1},{params:[{name:"v1",description:"",type:"p5.Vector"},{name:"v2",description:"",type:"p5.Vector"}],static:1}]},sub:{name:"sub",class:"p5.Vector",module:"Math",overloads:[{params:[{name:"x",description:"the x component of the vector to subtract
\n",type:"Number"},{name:"y",description:"the y component of the vector to subtract
\n",type:"Number",optional:!0},{name:"z",description:"the z component of the vector to subtract
\n",type:"Number",optional:!0}],chainable:1},{params:[{name:"value",description:"the vector to subtract
\n",type:"p5.Vector|Number[]"}],chainable:1},{params:[{name:"v1",description:'a p5.Vector to subtract from
\n',type:"p5.Vector"},{name:"v2",description:'a p5.Vector to subtract
\n',type:"p5.Vector"},{name:"target",description:"the vector to receive the result (Optional)
\n",type:"p5.Vector",optional:!0}],static:1}]},mult:{name:"mult",class:"p5.Vector",module:"Math",overloads:[{params:[{name:"n",description:"The number to multiply with the vector
\n",type:"Number"}],chainable:1},{params:[{name:"x",description:"The number to multiply with the x component of the vector
\n",type:"Number"},{name:"y",description:"The number to multiply with the y component of the vector
\n",type:"Number"},{name:"z",description:"The number to multiply with the z component of the vector
\n",type:"Number",optional:!0}],chainable:1},{params:[{name:"arr",description:"The array to multiply with the components of the vector
\n",type:"Number[]"}],chainable:1},{params:[{name:"v",description:"The vector to multiply with the components of the original vector
\n",type:"p5.Vector"}],chainable:1},{params:[{name:"x",description:"",type:"Number"},{name:"y",description:"",type:"Number"},{name:"z",description:"",type:"Number",optional:!0}],static:1},{params:[{name:"v",description:"",type:"p5.Vector"},{name:"n",description:"",type:"Number"},{name:"target",description:"the vector to receive the result (Optional)
\n",type:"p5.Vector",optional:!0}],static:1},{params:[{name:"v0",description:"",type:"p5.Vector"},{name:"v1",description:"",type:"p5.Vector"},{name:"target",description:"",type:"p5.Vector",optional:!0}],static:1},{params:[{name:"v0",description:"",type:"p5.Vector"},{name:"arr",description:"",type:"Number[]"},{name:"target",description:"",type:"p5.Vector",optional:!0}],static:1}]},div:{name:"div",class:"p5.Vector",module:"Math",overloads:[{params:[{name:"n",description:"The number to divide the vector by
\n",type:"Number"}],chainable:1},{params:[{name:"x",description:"The number to divide with the x component of the vector
\n",type:"Number"},{name:"y",description:"The number to divide with the y component of the vector
\n",type:"Number"},{name:"z",description:"The number to divide with the z component of the vector
\n",type:"Number",optional:!0}],chainable:1},{params:[{name:"arr",description:"The array to divide the components of the vector by
\n",type:"Number[]"}],chainable:1},{params:[{name:"v",description:"The vector to divide the components of the original vector by
\n",type:"p5.Vector"}],chainable:1},{params:[{name:"x",description:"",type:"Number"},{name:"y",description:"",type:"Number"},{name:"z",description:"",type:"Number",optional:!0}],static:1},{params:[{name:"v",description:"",type:"p5.Vector"},{name:"n",description:"",type:"Number"},{name:"target",description:"the vector to receive the result (Optional)
\n",type:"p5.Vector",optional:!0}],static:1},{params:[{name:"v0",description:"",type:"p5.Vector"},{name:"v1",description:"",type:"p5.Vector"},{name:"target",description:"",type:"p5.Vector",optional:!0}],static:1},{params:[{name:"v0",description:"",type:"p5.Vector"},{name:"arr",description:"",type:"Number[]"},{name:"target",description:"",type:"p5.Vector",optional:!0}],static:1}]},mag:{name:"mag",class:"p5.Vector",module:"Math",overloads:[{params:[]},{params:[{name:"vecT",description:"the vector to return the magnitude of
\n",type:"p5.Vector"}],static:1}]},magSq:{name:"magSq",class:"p5.Vector",module:"Math"},dot:{name:"dot",class:"p5.Vector",module:"Math",overloads:[{params:[{name:"x",description:"x component of the vector
\n",type:"Number"},{name:"y",description:"y component of the vector
\n",type:"Number",optional:!0},{name:"z",description:"z component of the vector
\n",type:"Number",optional:!0}]},{params:[{name:"value",description:'value component of the vector or a p5.Vector
\n',type:"p5.Vector"}]},{params:[{name:"v1",description:'the first p5.Vector
\n',type:"p5.Vector"},{name:"v2",description:'the second p5.Vector
\n',type:"p5.Vector"}],static:1}]},cross:{name:"cross",class:"p5.Vector",module:"Math",overloads:[{params:[{name:"v",description:'p5.Vector to be crossed
\n',type:"p5.Vector"}]},{params:[{name:"v1",description:'the first p5.Vector
\n',type:"p5.Vector"},{name:"v2",description:'the second p5.Vector
\n',type:"p5.Vector"}],static:1}]},dist:{name:"dist",class:"p5.Vector",module:"Math",overloads:[{params:[{name:"v",description:'the x, y, and z coordinates of a p5.Vector
\n',type:"p5.Vector"}]},{params:[{name:"v1",description:'the first p5.Vector
\n',type:"p5.Vector"},{name:"v2",description:'the second p5.Vector
\n',type:"p5.Vector"}],static:1}]},normalize:{name:"normalize",class:"p5.Vector",module:"Math"},limit:{name:"limit",params:[{name:"max",description:"the maximum magnitude for the vector
\n",type:"Number"}],class:"p5.Vector",module:"Math"},setMag:{name:"setMag",params:[{name:"len",description:"the new length for this vector
\n",type:"Number"}],class:"p5.Vector",module:"Math"},heading:{name:"heading",class:"p5.Vector",module:"Math"},rotate:{name:"rotate",params:[{name:"angle",description:"the angle of rotation
\n",type:"Number"}],class:"p5.Vector",module:"Math"},angleBetween:{name:"angleBetween",params:[{name:"value",description:'the x, y, and z components of a p5.Vector
\n',type:"p5.Vector"}],class:"p5.Vector",module:"Math"},lerp:{name:"lerp",class:"p5.Vector",module:"Math",overloads:[{params:[{name:"x",description:"the x component
\n",type:"Number"},{name:"y",description:"the y component
\n",type:"Number"},{name:"z",description:"the z component
\n",type:"Number"},{name:"amt",description:"the amount of interpolation; some value between 0.0\n (old vector) and 1.0 (new vector). 0.9 is very near\n the new vector. 0.5 is halfway in between.
\n",type:"Number"}],chainable:1},{params:[{name:"v",description:'the p5.Vector to lerp to
\n',type:"p5.Vector"},{name:"amt",description:"",type:"Number"}],chainable:1},{params:[{name:"v1",description:"",type:"p5.Vector"},{name:"v2",description:"",type:"p5.Vector"},{name:"amt",description:"",type:"Number"},{name:"target",description:"the vector to receive the result (Optional)
\n",type:"p5.Vector",optional:!0}],static:1}]},reflect:{name:"reflect",params:[{name:"surfaceNormal",description:'the p5.Vector to reflect about, will be normalized by this method
\n',type:"p5.Vector"}],class:"p5.Vector",module:"Math"},array:{name:"array",class:"p5.Vector",module:"Math"},equals:{name:"equals",class:"p5.Vector",module:"Math",overloads:[{params:[{name:"x",description:"the x component of the vector
\n",type:"Number",optional:!0},{name:"y",description:"the y component of the vector
\n",type:"Number",optional:!0},{name:"z",description:"the z component of the vector
\n",type:"Number",optional:!0}]},{params:[{name:"value",description:"the vector to compare
\n",type:"p5.Vector|Array"}]}]},fromAngle:{name:"fromAngle",params:[{name:"angle",description:'the desired angle, in radians (unaffected by angleMode)
\n',type:"Number"},{name:"length",description:"the length of the new vector (defaults to 1)
\n",type:"Number",optional:!0}],class:"p5.Vector",module:"Math"},fromAngles:{name:"fromAngles",params:[{name:"theta",description:"the polar angle, in radians (zero is up)
\n",type:"Number"},{name:"phi",description:"the azimuthal angle, in radians\n (zero is out of the screen)
\n",type:"Number"},{name:"length",description:"the length of the new vector (defaults to 1)
\n",type:"Number",optional:!0}],class:"p5.Vector",module:"Math"},random2D:{name:"random2D",class:"p5.Vector",module:"Math"},random3D:{name:"random3D",class:"p5.Vector",module:"Math"}},"p5.Font":{font:{name:"font",class:"p5.Font",module:"Typography"},textBounds:{name:"textBounds",params:[{name:"line",description:"a line of text
\n",type:"String"},{name:"x",description:"x-position
\n",type:"Number"},{name:"y",description:"y-position
\n",type:"Number"},{name:"fontSize",description:"font size to use (optional) Default is 12.
\n",type:"Number",optional:!0},{name:"options",description:"opentype options (optional)\n opentype fonts contains alignment and baseline options.\n Default is 'LEFT' and 'alphabetic'
\n",type:"Object",optional:!0}],class:"p5.Font",module:"Typography"},textToPoints:{name:"textToPoints",params:[{name:"txt",description:"a line of text
\n",type:"String"},{name:"x",description:"x-position
\n",type:"Number"},{name:"y",description:"y-position
\n",type:"Number"},{name:"fontSize",description:"font size to use (optional)
\n",type:"Number"},{name:"options",description:"an (optional) object that can contain:
\n
sampleFactor - the ratio of path-length to number of samples\n(default=.1); higher values yield more points and are therefore\nmore precise
\n
simplifyThreshold - if set to a non-zero value, collinear points will be\nbe removed from the polygon; the value represents the threshold angle to use\nwhen determining whether two edges are collinear
\n",type:"Object",optional:!0}],class:"p5.Font",module:"Typography"}},"p5.Camera":{perspective:{name:"perspective",class:"p5.Camera",module:"Lights, Camera"},ortho:{name:"ortho",class:"p5.Camera",module:"Lights, Camera"},frustum:{name:"frustum",class:"p5.Camera",module:"Lights, Camera"},pan:{name:"pan",params:[{name:"angle",description:'amount to rotate camera in current\nangleMode units.\nGreater than 0 values rotate counterclockwise (to the left).
\n',type:"Number"}],class:"p5.Camera",module:"Lights, Camera"},tilt:{name:"tilt",params:[{name:"angle",description:'amount to rotate camera in current\nangleMode units.\nGreater than 0 values rotate counterclockwise (to the left).
\n',type:"Number"}],class:"p5.Camera",module:"Lights, Camera"},lookAt:{name:"lookAt",params:[{name:"x",description:"x position of a point in world space
\n",type:"Number"},{name:"y",description:"y position of a point in world space
\n",type:"Number"},{name:"z",description:"z position of a point in world space
\n",type:"Number"}],class:"p5.Camera",module:"Lights, Camera"},camera:{name:"camera",class:"p5.Camera",module:"Lights, Camera"},move:{name:"move",params:[{name:"x",description:"amount to move along camera's left-right axis
\n",type:"Number"},{name:"y",description:"amount to move along camera's up-down axis
\n",type:"Number"},{name:"z",description:"amount to move along camera's forward-backward axis
\n",type:"Number"}],class:"p5.Camera",module:"Lights, Camera"},setPosition:{name:"setPosition",params:[{name:"x",description:"x position of a point in world space
\n",type:"Number"},{name:"y",description:"y position of a point in world space
\n",type:"Number"},{name:"z",description:"z position of a point in world space
\n",type:"Number"}],class:"p5.Camera",module:"Lights, Camera"}},"p5.Geometry":{computeFaces:{name:"computeFaces",class:"p5.Geometry",module:"Lights, Camera"},computeNormals:{name:"computeNormals",class:"p5.Geometry",module:"Lights, Camera"},averageNormals:{name:"averageNormals",class:"p5.Geometry",module:"Lights, Camera"},averagePoleNormals:{name:"averagePoleNormals",class:"p5.Geometry",module:"Lights, Camera"},normalize:{name:"normalize",class:"p5.Geometry",module:"Lights, Camera"}},"p5.Shader":{setUniform:{name:"setUniform",params:[{name:"uniformName",description:"the name of the uniform in the\nshader program
\n",type:"String"},{name:"data",description:"the data to be associated\nwith that uniform; type varies (could be a single numerical value, array,\nmatrix, or texture / sampler reference)
\n",type:"Object|Number|Boolean|Number[]"}],class:"p5.Shader",module:"Lights, Camera"}},"p5.sound":{getMasterVolume:{name:"getMasterVolume",class:"p5.sound",module:"p5.sound"},masterVolume:{name:"masterVolume",params:[{name:"volume",description:"Volume (amplitude) between 0.0\n and 1.0 or modulating signal/oscillator
\n",type:"Number|Object"},{name:"rampTime",description:"Fade for t seconds
\n",type:"Number",optional:!0},{name:"timeFromNow",description:"Schedule this event to happen at\n t seconds in the future
\n",type:"Number",optional:!0}],class:"p5.sound",module:"p5.sound"},soundOut:{name:"soundOut",class:"p5.sound",module:"p5.sound"}},"p5.Effect":{amp:{name:"amp",params:[{name:"vol",description:"amplitude between 0 and 1.0
\n",type:"Number",optional:!0},{name:"rampTime",description:"create a fade that lasts until rampTime
\n",type:"Number",optional:!0},{name:"tFromNow",description:"schedule this event to happen in tFromNow seconds
\n",type:"Number",optional:!0}],class:"p5.Effect",module:"p5.sound"},chain:{name:"chain",params:[{name:"arguments",description:"Chain together multiple sound objects
\n",type:"Object",optional:!0}],class:"p5.Effect",module:"p5.sound"},drywet:{name:"drywet",params:[{name:"fade",description:"The desired drywet value (0 - 1.0)
\n",type:"Number",optional:!0}],class:"p5.Effect",module:"p5.sound"},connect:{name:"connect",params:[{name:"unit",description:"",type:"Object"}],class:"p5.Effect",module:"p5.sound"},disconnect:{name:"disconnect",class:"p5.Effect",module:"p5.sound"}},"p5.Filter":{biquadFilter:{name:"biquadFilter",class:"p5.Filter",module:"p5.sound"},process:{name:"process",params:[{name:"Signal",description:"An object that outputs audio
\n",type:"Object"},{name:"freq",description:"Frequency in Hz, from 10 to 22050
\n",type:"Number",optional:!0},{name:"res",description:"Resonance/Width of the filter frequency\n from 0.001 to 1000
\n",type:"Number",optional:!0}],class:"p5.Filter",module:"p5.sound"},set:{name:"set",params:[{name:"freq",description:"Frequency in Hz, from 10 to 22050
\n",type:"Number",optional:!0},{name:"res",description:"Resonance (Q) from 0.001 to 1000
\n",type:"Number",optional:!0},{name:"timeFromNow",description:"schedule this event to happen\n seconds from now
\n",type:"Number",optional:!0}],class:"p5.Filter",module:"p5.sound"},freq:{name:"freq",params:[{name:"freq",description:"Filter Frequency
\n",type:"Number"},{name:"timeFromNow",description:"schedule this event to happen\n seconds from now
\n",type:"Number",optional:!0}],class:"p5.Filter",module:"p5.sound"},res:{name:"res",params:[{name:"res",description:"Resonance/Width of filter freq\n from 0.001 to 1000
\n",type:"Number"},{name:"timeFromNow",description:"schedule this event to happen\n seconds from now
\n",type:"Number",optional:!0}],class:"p5.Filter",module:"p5.sound"},gain:{name:"gain",params:[{name:"gain",description:"",type:"Number"}],class:"p5.Filter",module:"p5.sound"},toggle:{name:"toggle",class:"p5.Filter",module:"p5.sound"},setType:{name:"setType",params:[{name:"t",description:"",type:"String"}],class:"p5.Filter",module:"p5.sound"}},"p5.Oscillator":{start:{name:"start",params:[{name:"time",description:"startTime in seconds from now.
\n",type:"Number",optional:!0},{name:"frequency",description:"frequency in Hz.
\n",type:"Number",optional:!0}],class:"p5.Oscillator",module:"p5.sound"},stop:{name:"stop",params:[{name:"secondsFromNow",description:"Time, in seconds from now.
\n",type:"Number"}],class:"p5.Oscillator",module:"p5.sound"},amp:{name:"amp",params:[{name:"vol",description:"between 0 and 1.0\n or a modulating signal/oscillator
\n",type:"Number|Object"},{name:"rampTime",description:"create a fade that lasts rampTime
\n",type:"Number",optional:!0},{name:"timeFromNow",description:"schedule this event to happen\n seconds from now
\n",type:"Number",optional:!0}],class:"p5.Oscillator",module:"p5.sound"},freq:{name:"freq",params:[{name:"Frequency",description:"Frequency in Hz\n or modulating signal/oscillator
\n",type:"Number|Object"},{name:"rampTime",description:"Ramp time (in seconds)
\n",type:"Number",optional:!0},{name:"timeFromNow",description:"Schedule this event to happen\n at x seconds from now
\n",type:"Number",optional:!0}],class:"p5.Oscillator",module:"p5.sound"},setType:{name:"setType",params:[{name:"type",description:"'sine', 'triangle', 'sawtooth' or 'square'.
\n",type:"String"}],class:"p5.Oscillator",module:"p5.sound"},connect:{name:"connect",params:[{name:"unit",description:"A p5.sound or Web Audio object
\n",type:"Object"}],class:"p5.Oscillator",module:"p5.sound"},disconnect:{name:"disconnect",class:"p5.Oscillator",module:"p5.sound"},pan:{name:"pan",params:[{name:"panning",description:"Number between -1 and 1
\n",type:"Number"},{name:"timeFromNow",description:"schedule this event to happen\n seconds from now
\n",type:"Number"}],class:"p5.Oscillator",module:"p5.sound"},phase:{name:"phase",params:[{name:"phase",description:"float between 0.0 and 1.0
\n",type:"Number"}],class:"p5.Oscillator",module:"p5.sound"},add:{name:"add",params:[{name:"number",description:"Constant number to add
\n",type:"Number"}],class:"p5.Oscillator",module:"p5.sound"},mult:{name:"mult",params:[{name:"number",description:"Constant number to multiply
\n",type:"Number"}],class:"p5.Oscillator",module:"p5.sound"},scale:{name:"scale",params:[{name:"inMin",description:"input range minumum
\n",type:"Number"},{name:"inMax",description:"input range maximum
\n",type:"Number"},{name:"outMin",description:"input range minumum
\n",type:"Number"},{name:"outMax",description:"input range maximum
\n",type:"Number"}],class:"p5.Oscillator",module:"p5.sound"}},"p5.MonoSynth":{play:{name:"play",params:[{name:"note",description:'the note you want to play, specified as a\n frequency in Hertz (Number) or as a midi\n value in Note/Octave format ("C4", "Eb3"...etc")\n See \n Tone. Defaults to 440 hz.
\n',type:"String | Number"},{name:"velocity",description:"velocity of the note to play (ranging from 0 to 1)
\n",type:"Number",optional:!0},{name:"secondsFromNow",description:"time from now (in seconds) at which to play
\n",type:"Number",optional:!0},{name:"sustainTime",description:"time to sustain before releasing the envelope. Defaults to 0.15 seconds.
\n",type:"Number",optional:!0}],class:"p5.MonoSynth",module:"p5.sound"},triggerAttack:{params:[{name:"note",description:'the note you want to play, specified as a\n frequency in Hertz (Number) or as a midi\n value in Note/Octave format ("C4", "Eb3"...etc")\n See \n Tone. Defaults to 440 hz
\n',type:"String | Number"},{name:"velocity",description:"velocity of the note to play (ranging from 0 to 1)
\n",type:"Number",optional:!0},{name:"secondsFromNow",description:"time from now (in seconds) at which to play
\n",type:"Number",optional:!0}],name:"triggerAttack",class:"p5.MonoSynth",module:"p5.sound"},triggerRelease:{params:[{name:"secondsFromNow",description:"time to trigger the release
\n",type:"Number"}],name:"triggerRelease",class:"p5.MonoSynth",module:"p5.sound"},setADSR:{name:"setADSR",params:[{name:"attackTime",description:"Time (in seconds before envelope\n reaches Attack Level
\n",type:"Number"},{name:"decayTime",description:"Time (in seconds) before envelope\n reaches Decay/Sustain Level
\n",type:"Number",optional:!0},{name:"susRatio",description:"Ratio between attackLevel and releaseLevel, on a scale from 0 to 1,\n where 1.0 = attackLevel, 0.0 = releaseLevel.\n The susRatio determines the decayLevel and the level at which the\n sustain portion of the envelope will sustain.\n For example, if attackLevel is 0.4, releaseLevel is 0,\n and susAmt is 0.5, the decayLevel would be 0.2. If attackLevel is\n increased to 1.0 (using setRange),\n then decayLevel would increase proportionally, to become 0.5.
\n",type:"Number",optional:!0},{name:"releaseTime",description:"Time in seconds from now (defaults to 0)
\n",type:"Number",optional:!0}],class:"p5.MonoSynth",module:"p5.sound"},attack:{name:"attack",class:"p5.MonoSynth",module:"p5.sound"},decay:{name:"decay",class:"p5.MonoSynth",module:"p5.sound"},sustain:{name:"sustain",class:"p5.MonoSynth",module:"p5.sound"},release:{name:"release",class:"p5.MonoSynth",module:"p5.sound"},amp:{name:"amp",params:[{name:"vol",description:"desired volume
\n",type:"Number"},{name:"rampTime",description:"Time to reach new volume
\n",type:"Number",optional:!0}],class:"p5.MonoSynth",module:"p5.sound"},connect:{name:"connect",params:[{name:"unit",description:"A p5.sound or Web Audio object
\n",type:"Object"}],class:"p5.MonoSynth",module:"p5.sound"},disconnect:{name:"disconnect",class:"p5.MonoSynth",module:"p5.sound"},dispose:{name:"dispose",class:"p5.MonoSynth",module:"p5.sound"}},"p5.AudioVoice":{connect:{name:"connect",params:[{name:"unit",description:"",type:"Object"}],class:"p5.AudioVoice",module:"p5.sound"},disconnect:{name:"disconnect",class:"p5.AudioVoice",module:"p5.sound"}},"p5.PolySynth":{notes:{name:"notes",class:"p5.PolySynth",module:"p5.sound"},polyvalue:{name:"polyvalue",class:"p5.PolySynth",module:"p5.sound"},AudioVoice:{name:"AudioVoice",class:"p5.PolySynth",module:"p5.sound"},play:{name:"play",params:[{name:"note",description:"midi note to play (ranging from 0 to 127 - 60 being a middle C)
\n",type:"Number",optional:!0},{name:"velocity",description:"velocity of the note to play (ranging from 0 to 1)
\n",type:"Number",optional:!0},{name:"secondsFromNow",description:"time from now (in seconds) at which to play
\n",type:"Number",optional:!0},{name:"sustainTime",description:"time to sustain before releasing the envelope
\n",type:"Number",optional:!0}],class:"p5.PolySynth",module:"p5.sound"},noteADSR:{name:"noteADSR",params:[{name:"note",description:"Midi note on which ADSR should be set.
\n",type:"Number",optional:!0},{name:"attackTime",description:"Time (in seconds before envelope\n reaches Attack Level
\n",type:"Number",optional:!0},{name:"decayTime",description:"Time (in seconds) before envelope\n reaches Decay/Sustain Level
\n",type:"Number",optional:!0},{name:"susRatio",description:"Ratio between attackLevel and releaseLevel, on a scale from 0 to 1,\n where 1.0 = attackLevel, 0.0 = releaseLevel.\n The susRatio determines the decayLevel and the level at which the\n sustain portion of the envelope will sustain.\n For example, if attackLevel is 0.4, releaseLevel is 0,\n and susAmt is 0.5, the decayLevel would be 0.2. If attackLevel is\n increased to 1.0 (using setRange),\n then decayLevel would increase proportionally, to become 0.5.
\n",type:"Number",optional:!0},{name:"releaseTime",description:"Time in seconds from now (defaults to 0)
\n",type:"Number",optional:!0}],class:"p5.PolySynth",module:"p5.sound"},setADSR:{name:"setADSR",params:[{name:"attackTime",description:"Time (in seconds before envelope\n reaches Attack Level
\n",type:"Number",optional:!0},{name:"decayTime",description:"Time (in seconds) before envelope\n reaches Decay/Sustain Level
\n",type:"Number",optional:!0},{name:"susRatio",description:"Ratio between attackLevel and releaseLevel, on a scale from 0 to 1,\n where 1.0 = attackLevel, 0.0 = releaseLevel.\n The susRatio determines the decayLevel and the level at which the\n sustain portion of the envelope will sustain.\n For example, if attackLevel is 0.4, releaseLevel is 0,\n and susAmt is 0.5, the decayLevel would be 0.2. If attackLevel is\n increased to 1.0 (using setRange),\n then decayLevel would increase proportionally, to become 0.5.
\n",type:"Number",optional:!0},{name:"releaseTime",description:"Time in seconds from now (defaults to 0)
\n",type:"Number",optional:!0}],class:"p5.PolySynth",module:"p5.sound"},noteAttack:{name:"noteAttack",params:[{name:"note",description:"midi note on which attack should be triggered.
\n",type:"Number",optional:!0},{name:"velocity",description:"velocity of the note to play (ranging from 0 to 1)/
\n",type:"Number",optional:!0},{name:"secondsFromNow",description:"time from now (in seconds)
\n",type:"Number",optional:!0}],class:"p5.PolySynth",module:"p5.sound"},noteRelease:{name:"noteRelease",params:[{name:"note",description:"midi note on which attack should be triggered.\n If no value is provided, all notes will be released.
\n",type:"Number",optional:!0},{name:"secondsFromNow",description:"time to trigger the release
\n",type:"Number",optional:!0}],class:"p5.PolySynth",module:"p5.sound"},connect:{name:"connect",params:[{name:"unit",description:"A p5.sound or Web Audio object
\n",type:"Object"}],class:"p5.PolySynth",module:"p5.sound"},disconnect:{name:"disconnect",class:"p5.PolySynth",module:"p5.sound"},dispose:{name:"dispose",class:"p5.PolySynth",module:"p5.sound"}},"p5.SoundFile":{isLoaded:{name:"isLoaded",class:"p5.SoundFile",module:"p5.sound"},play:{name:"play",params:[{name:"startTime",description:"(optional) schedule playback to start (in seconds from now).
\n",type:"Number",optional:!0},{name:"rate",description:"(optional) playback rate
\n",type:"Number",optional:!0},{name:"amp",description:"(optional) amplitude (volume)\n of playback
\n",type:"Number",optional:!0},{name:"cueStart",description:"(optional) cue start time in seconds
\n",type:"Number",optional:!0},{name:"duration",description:"(optional) duration of playback in seconds
\n",type:"Number",optional:!0}],class:"p5.SoundFile",module:"p5.sound"},playMode:{name:"playMode",params:[{name:"str",description:"'restart' or 'sustain' or 'untilDone'
\n",type:"String"}],class:"p5.SoundFile",module:"p5.sound"},pause:{name:"pause",params:[{name:"startTime",description:"(optional) schedule event to occur\n seconds from now
\n",type:"Number",optional:!0}],class:"p5.SoundFile",module:"p5.sound"},loop:{name:"loop",params:[{name:"startTime",description:"(optional) schedule event to occur\n seconds from now
\n",type:"Number",optional:!0},{name:"rate",description:"(optional) playback rate
\n",type:"Number",optional:!0},{name:"amp",description:"(optional) playback volume
\n",type:"Number",optional:!0},{name:"cueLoopStart",description:"(optional) startTime in seconds
\n",type:"Number",optional:!0},{name:"duration",description:"(optional) loop duration in seconds
\n",type:"Number",optional:!0}],class:"p5.SoundFile",module:"p5.sound"},setLoop:{name:"setLoop",params:[{name:"Boolean",description:"set looping to true or false
\n",type:"Boolean"}],class:"p5.SoundFile",module:"p5.sound"},isLooping:{name:"isLooping",class:"p5.SoundFile",module:"p5.sound"},isPlaying:{name:"isPlaying",class:"p5.SoundFile",module:"p5.sound"},isPaused:{name:"isPaused",class:"p5.SoundFile",module:"p5.sound"},stop:{name:"stop",params:[{name:"startTime",description:"(optional) schedule event to occur\n in seconds from now
\n",type:"Number",optional:!0}],class:"p5.SoundFile",module:"p5.sound"},setVolume:{name:"setVolume",params:[{name:"volume",description:"Volume (amplitude) between 0.0\n and 1.0 or modulating signal/oscillator
\n",type:"Number|Object"},{name:"rampTime",description:"Fade for t seconds
\n",type:"Number",optional:!0},{name:"timeFromNow",description:"Schedule this event to happen at\n t seconds in the future
\n",type:"Number",optional:!0}],class:"p5.SoundFile",module:"p5.sound"},pan:{name:"pan",params:[{name:"panValue",description:"Set the stereo panner
\n",type:"Number",optional:!0},{name:"timeFromNow",description:"schedule this event to happen\n seconds from now
\n",type:"Number",optional:!0}],class:"p5.SoundFile",module:"p5.sound"},getPan:{name:"getPan",class:"p5.SoundFile",module:"p5.sound"},rate:{name:"rate",params:[{name:"playbackRate",description:"Set the playback rate. 1.0 is normal,\n .5 is half-speed, 2.0 is twice as fast.\n Values less than zero play backwards.
\n",type:"Number",optional:!0}],class:"p5.SoundFile",module:"p5.sound"},duration:{name:"duration",class:"p5.SoundFile",module:"p5.sound"},currentTime:{name:"currentTime",class:"p5.SoundFile",module:"p5.sound"},jump:{name:"jump",params:[{name:"cueTime",description:"cueTime of the soundFile in seconds.
\n",type:"Number"},{name:"duration",description:"duration in seconds.
\n",type:"Number"}],class:"p5.SoundFile",module:"p5.sound"},channels:{name:"channels",class:"p5.SoundFile",module:"p5.sound"},sampleRate:{name:"sampleRate",class:"p5.SoundFile",module:"p5.sound"},frames:{name:"frames",class:"p5.SoundFile",module:"p5.sound"},getPeaks:{name:"getPeaks",params:[{name:"length",description:"length is the size of the returned array.\n Larger length results in more precision.\n Defaults to 5*width of the browser window.
\n",type:"Number",optional:!0}],class:"p5.SoundFile",module:"p5.sound"},reverseBuffer:{name:"reverseBuffer",class:"p5.SoundFile",module:"p5.sound"},onended:{name:"onended",params:[{name:"callback",description:"function to call when the\n soundfile has ended.
\n",type:"Function"}],class:"p5.SoundFile",module:"p5.sound"},connect:{name:"connect",params:[{name:"object",description:"Audio object that accepts an input
\n",type:"Object",optional:!0}],class:"p5.SoundFile",module:"p5.sound"},disconnect:{name:"disconnect",class:"p5.SoundFile",module:"p5.sound"},setPath:{name:"setPath",params:[{name:"path",description:"path to audio file
\n",type:"String"},{name:"callback",description:"Callback
\n",type:"Function"}],class:"p5.SoundFile",module:"p5.sound"},setBuffer:{name:"setBuffer",params:[{name:"buf",description:"Array of Float32 Array(s). 2 Float32 Arrays\n will create a stereo source. 1 will create\n a mono source.
\n",type:"Array"}],class:"p5.SoundFile",module:"p5.sound"},processPeaks:{name:"processPeaks",params:[{name:"callback",description:"a function to call once this data is returned
\n",type:"Function"},{name:"initThreshold",description:"initial threshold defaults to 0.9
\n",type:"Number",optional:!0},{name:"minThreshold",description:"minimum threshold defaults to 0.22
\n",type:"Number",optional:!0},{name:"minPeaks",description:"minimum number of peaks defaults to 200
\n",type:"Number",optional:!0}],class:"p5.SoundFile",module:"p5.sound"},addCue:{name:"addCue",params:[{name:"time",description:"Time in seconds, relative to this media\n element's playback. For example, to trigger\n an event every time playback reaches two\n seconds, pass in the number 2. This will be\n passed as the first parameter to\n the callback function.
\n",type:"Number"},{name:"callback",description:"Name of a function that will be\n called at the given time. The callback will\n receive time and (optionally) param as its\n two parameters.
\n",type:"Function"},{name:"value",description:"An object to be passed as the\n second parameter to the\n callback function.
\n",type:"Object",optional:!0}],class:"p5.SoundFile",module:"p5.sound"},removeCue:{name:"removeCue",params:[{name:"id",description:"ID of the cue, as returned by addCue
\n",type:"Number"}],class:"p5.SoundFile",module:"p5.sound"},clearCues:{name:"clearCues",class:"p5.SoundFile",module:"p5.sound"},save:{name:"save",params:[{name:"fileName",description:"name of the resulting .wav file.
\n",type:"String",optional:!0}],class:"p5.SoundFile",module:"p5.sound"},getBlob:{name:"getBlob",class:"p5.SoundFile",module:"p5.sound"}},"p5.Amplitude":{setInput:{name:"setInput",params:[{name:"snd",description:"set the sound source\n (optional, defaults to\n master output)
\n",type:"SoundObject|undefined",optional:!0},{name:"smoothing",description:"a range between 0.0 and 1.0\n to smooth amplitude readings
\n",type:"Number|undefined",optional:!0}],class:"p5.Amplitude",module:"p5.sound"},getLevel:{name:"getLevel",params:[{name:"channel",description:"Optionally return only channel 0 (left) or 1 (right)
\n",type:"Number",optional:!0}],class:"p5.Amplitude",module:"p5.sound"},toggleNormalize:{name:"toggleNormalize",params:[{name:"boolean",description:"set normalize to true (1) or false (0)
\n",type:"Boolean",optional:!0}],class:"p5.Amplitude",module:"p5.sound"},smooth:{name:"smooth",params:[{name:"set",description:"smoothing from 0.0 <= 1
\n",type:"Number"}],class:"p5.Amplitude",module:"p5.sound"}},"p5.FFT":{setInput:{name:"setInput",params:[{name:"source",description:"p5.sound object (or web audio API source node)
\n",type:"Object",optional:!0}],class:"p5.FFT",module:"p5.sound"},waveform:{name:"waveform",params:[{name:"bins",description:"Must be a power of two between\n 16 and 1024. Defaults to 1024.
\n",type:"Number",optional:!0},{name:"precision",description:"If any value is provided, will return results\n in a Float32 Array which is more precise\n than a regular array.
\n",type:"String",optional:!0}],class:"p5.FFT",module:"p5.sound"},analyze:{name:"analyze",params:[{name:"bins",description:"Must be a power of two between\n 16 and 1024. Defaults to 1024.
\n",type:"Number",optional:!0},{name:"scale",description:'If "dB," returns decibel\n float measurements between\n -140 and 0 (max).\n Otherwise returns integers from 0-255.
\n',type:"Number",optional:!0}],class:"p5.FFT",module:"p5.sound"},getEnergy:{name:"getEnergy",params:[{name:"frequency1",description:'Will return a value representing\n energy at this frequency. Alternately,\n the strings "bass", "lowMid" "mid",\n "highMid", and "treble" will return\n predefined frequency ranges.
\n',type:"Number|String"},{name:"frequency2",description:"If a second frequency is given,\n will return average amount of\n energy that exists between the\n two frequencies.
\n",type:"Number",optional:!0}],class:"p5.FFT",module:"p5.sound"},getCentroid:{name:"getCentroid",class:"p5.FFT",module:"p5.sound"},smooth:{name:"smooth",params:[{name:"smoothing",description:"0.0 < smoothing < 1.0.\n Defaults to 0.8.
\n",type:"Number"}],class:"p5.FFT",module:"p5.sound"},linAverages:{name:"linAverages",params:[{name:"N",description:"Number of returned frequency groups
\n",type:"Number"}],class:"p5.FFT",module:"p5.sound"},logAverages:{name:"logAverages",params:[{name:"octaveBands",description:"Array of Octave Bands objects for grouping
\n",type:"Array"}],class:"p5.FFT",module:"p5.sound"},getOctaveBands:{name:"getOctaveBands",params:[{name:"N",description:"Specifies the 1/N type of generated octave bands
\n",type:"Number"},{name:"fCtr0",description:"Minimum central frequency for the lowest band
\n",type:"Number"}],class:"p5.FFT",module:"p5.sound"}},"p5.Signal":{fade:{name:"fade",params:[{name:"value",description:"Value to set this signal
\n",type:"Number"},{name:"secondsFromNow",description:"Length of fade, in seconds from now
\n",type:"Number",optional:!0}],class:"p5.Signal",module:"p5.sound"},setInput:{name:"setInput",params:[{name:"input",description:"",type:"Object"}],class:"p5.Signal",module:"p5.sound"},add:{name:"add",params:[{name:"number",description:"",type:"Number"}],class:"p5.Signal",module:"p5.sound"},mult:{name:"mult",params:[{name:"number",description:"to multiply
\n",type:"Number"}],class:"p5.Signal",module:"p5.sound"},scale:{name:"scale",params:[{name:"number",description:"to multiply
\n",type:"Number"},{name:"inMin",description:"input range minumum
\n",type:"Number"},{name:"inMax",description:"input range maximum
\n",type:"Number"},{name:"outMin",description:"input range minumum
\n",type:"Number"},{name:"outMax",description:"input range maximum
\n",type:"Number"}],class:"p5.Signal",module:"p5.sound"}},"p5.Envelope":{attackTime:{name:"attackTime",class:"p5.Envelope",module:"p5.sound"},attackLevel:{name:"attackLevel",class:"p5.Envelope",module:"p5.sound"},decayTime:{name:"decayTime",class:"p5.Envelope",module:"p5.sound"},decayLevel:{name:"decayLevel",class:"p5.Envelope",module:"p5.sound"},releaseTime:{name:"releaseTime",class:"p5.Envelope",module:"p5.sound"},releaseLevel:{name:"releaseLevel",class:"p5.Envelope",module:"p5.sound"},set:{name:"set",params:[{name:"attackTime",description:"Time (in seconds) before level\n reaches attackLevel
\n",type:"Number"},{name:"attackLevel",description:"Typically an amplitude between\n 0.0 and 1.0
\n",type:"Number"},{name:"decayTime",description:"Time
\n",type:"Number"},{name:"decayLevel",description:"Amplitude (In a standard ADSR envelope,\n decayLevel = sustainLevel)
\n",type:"Number"},{name:"releaseTime",description:"Release Time (in seconds)
\n",type:"Number"},{name:"releaseLevel",description:"Amplitude
\n",type:"Number"}],class:"p5.Envelope",module:"p5.sound"},setADSR:{name:"setADSR",params:[{name:"attackTime",description:"Time (in seconds before envelope\n reaches Attack Level
\n",type:"Number"},{name:"decayTime",description:"Time (in seconds) before envelope\n reaches Decay/Sustain Level
\n",type:"Number",optional:!0},{name:"susRatio",description:"Ratio between attackLevel and releaseLevel, on a scale from 0 to 1,\n where 1.0 = attackLevel, 0.0 = releaseLevel.\n The susRatio determines the decayLevel and the level at which the\n sustain portion of the envelope will sustain.\n For example, if attackLevel is 0.4, releaseLevel is 0,\n and susAmt is 0.5, the decayLevel would be 0.2. If attackLevel is\n increased to 1.0 (using setRange),\n then decayLevel would increase proportionally, to become 0.5.
\n",type:"Number",optional:!0},{name:"releaseTime",description:"Time in seconds from now (defaults to 0)
\n",type:"Number",optional:!0}],class:"p5.Envelope",module:"p5.sound"},setRange:{name:"setRange",params:[{name:"aLevel",description:"attack level (defaults to 1)
\n",type:"Number"},{name:"rLevel",description:"release level (defaults to 0)
\n",type:"Number"}],class:"p5.Envelope",module:"p5.sound"},setInput:{name:"setInput",params:[{name:"inputs",description:"A p5.sound object or\n Web Audio Param.
\n",type:"Object",optional:!0,multiple:!0}],class:"p5.Envelope",module:"p5.sound"},setExp:{name:"setExp",params:[{name:"isExp",description:"true is exponential, false is linear
\n",type:"Boolean"}],class:"p5.Envelope",module:"p5.sound"},play:{name:"play",params:[{name:"unit",description:"A p5.sound object or\n Web Audio Param.
\n",type:"Object"},{name:"startTime",description:"time from now (in seconds) at which to play
\n",type:"Number",optional:!0},{name:"sustainTime",description:"time to sustain before releasing the envelope
\n",type:"Number",optional:!0}],class:"p5.Envelope",module:"p5.sound"},triggerAttack:{name:"triggerAttack",params:[{name:"unit",description:"p5.sound Object or Web Audio Param
\n",type:"Object"},{name:"secondsFromNow",description:"time from now (in seconds)
\n",type:"Number"}],class:"p5.Envelope",module:"p5.sound"},triggerRelease:{name:"triggerRelease",params:[{name:"unit",description:"p5.sound Object or Web Audio Param
\n",type:"Object"},{name:"secondsFromNow",description:"time to trigger the release
\n",type:"Number"}],class:"p5.Envelope",module:"p5.sound"},ramp:{name:"ramp",params:[{name:"unit",description:"p5.sound Object or Web Audio Param
\n",type:"Object"},{name:"secondsFromNow",description:"When to trigger the ramp
\n",type:"Number"},{name:"v",description:"Target value
\n",type:"Number"},{name:"v2",description:"Second target value (optional)
\n",type:"Number",optional:!0}],class:"p5.Envelope",module:"p5.sound"},add:{name:"add",params:[{name:"number",description:"Constant number to add
\n",type:"Number"}],class:"p5.Envelope",module:"p5.sound"},mult:{name:"mult",params:[{name:"number",description:"Constant number to multiply
\n",type:"Number"}],class:"p5.Envelope",module:"p5.sound"},scale:{name:"scale",params:[{name:"inMin",description:"input range minumum
\n",type:"Number"},{name:"inMax",description:"input range maximum
\n",type:"Number"},{name:"outMin",description:"input range minumum
\n",type:"Number"},{name:"outMax",description:"input range maximum
\n",type:"Number"}],class:"p5.Envelope",module:"p5.sound"}},"p5.Pulse":{width:{name:"width",params:[{name:"width",description:"Width between the pulses (0 to 1.0,\n defaults to 0)
\n",type:"Number",optional:!0}],class:"p5.Pulse",module:"p5.sound"}},"p5.Noise":{setType:{name:"setType",params:[{name:"type",description:"'white', 'pink' or 'brown'
\n",type:"String",optional:!0}],class:"p5.Noise",module:"p5.sound"}},"p5.AudioIn":{input:{name:"input",class:"p5.AudioIn",module:"p5.sound"},output:{name:"output",class:"p5.AudioIn",module:"p5.sound"},stream:{name:"stream",class:"p5.AudioIn",module:"p5.sound"},mediaStream:{name:"mediaStream",class:"p5.AudioIn",module:"p5.sound"},currentSource:{name:"currentSource",class:"p5.AudioIn",module:"p5.sound"},enabled:{name:"enabled",class:"p5.AudioIn",module:"p5.sound"},amplitude:{name:"amplitude",class:"p5.AudioIn",module:"p5.sound"},start:{name:"start",params:[{name:"successCallback",description:"Name of a function to call on\n success.
\n",type:"Function",optional:!0},{name:"errorCallback",description:"Name of a function to call if\n there was an error. For example,\n some browsers do not support\n getUserMedia.
\n",type:"Function",optional:!0}],class:"p5.AudioIn",module:"p5.sound"},stop:{name:"stop",class:"p5.AudioIn",module:"p5.sound"},connect:{name:"connect",params:[{name:"unit",description:"An object that accepts audio input,\n such as an FFT
\n",type:"Object",optional:!0}],class:"p5.AudioIn",module:"p5.sound"},disconnect:{name:"disconnect",class:"p5.AudioIn",module:"p5.sound"},getLevel:{name:"getLevel",params:[{name:"smoothing",description:"Smoothing is 0.0 by default.\n Smooths values based on previous values.
\n",type:"Number",optional:!0}],class:"p5.AudioIn",module:"p5.sound"},amp:{name:"amp",params:[{name:"vol",description:"between 0 and 1.0
\n",type:"Number"},{name:"time",description:"ramp time (optional)
\n",type:"Number",optional:!0}],class:"p5.AudioIn",module:"p5.sound"},getSources:{name:"getSources",params:[{name:"successCallback",description:"This callback function handles the sources when they\n have been enumerated. The callback function\n receives the deviceList array as its only argument
\n",type:"Function",optional:!0},{name:"errorCallback",description:"This optional callback receives the error\n message as its argument.
\n",type:"Function",optional:!0}],class:"p5.AudioIn",module:"p5.sound"},setSource:{name:"setSource",params:[{name:"num",description:"position of input source in the array
\n",type:"Number"}],class:"p5.AudioIn",module:"p5.sound"}},"p5.EQ":{bands:{name:"bands",class:"p5.EQ",module:"p5.sound"},process:{name:"process",params:[{name:"src",description:"Audio source
\n",type:"Object"}],class:"p5.EQ",module:"p5.sound"}},"p5.Panner3D":{panner:{name:"panner",class:"p5.Panner3D",module:"p5.sound"},process:{name:"process",params:[{name:"src",description:"Input source
\n",type:"Object"}],class:"p5.Panner3D",module:"p5.sound"},set:{name:"set",params:[{name:"xVal",description:"",type:"Number"},{name:"yVal",description:"",type:"Number"},{name:"zVal",description:"",type:"Number"},{name:"time",description:"",type:"Number"}],class:"p5.Panner3D",module:"p5.sound"},positionX:{name:"positionX",class:"p5.Panner3D",module:"p5.sound"},positionY:{name:"positionY",class:"p5.Panner3D",module:"p5.sound"},positionZ:{name:"positionZ",class:"p5.Panner3D",module:"p5.sound"},orient:{name:"orient",params:[{name:"xVal",description:"",type:"Number"},{name:"yVal",description:"",type:"Number"},{name:"zVal",description:"",type:"Number"},{name:"time",description:"",type:"Number"}],class:"p5.Panner3D",module:"p5.sound"},orientX:{name:"orientX",class:"p5.Panner3D",module:"p5.sound"},orientY:{name:"orientY",class:"p5.Panner3D",module:"p5.sound"},orientZ:{name:"orientZ",class:"p5.Panner3D",module:"p5.sound"},setFalloff:{name:"setFalloff",params:[{name:"maxDistance",description:"",type:"Number",optional:!0},{name:"rolloffFactor",description:"",type:"Number",optional:!0}],class:"p5.Panner3D",module:"p5.sound"},maxDist:{name:"maxDist",params:[{name:"maxDistance",description:"",type:"Number"}],class:"p5.Panner3D",module:"p5.sound"},rollof:{name:"rollof",params:[{name:"rolloffFactor",description:"",type:"Number"}],class:"p5.Panner3D",module:"p5.sound"}},"p5.Delay":{leftDelay:{name:"leftDelay",class:"p5.Delay",module:"p5.sound"},rightDelay:{name:"rightDelay",class:"p5.Delay",module:"p5.sound"},process:{name:"process",params:[{name:"Signal",description:"An object that outputs audio
\n",type:"Object"},{name:"delayTime",description:"Time (in seconds) of the delay/echo.\n Some browsers limit delayTime to\n 1 second.
\n",type:"Number",optional:!0},{name:"feedback",description:"sends the delay back through itself\n in a loop that decreases in volume\n each time.
\n",type:"Number",optional:!0},{name:"lowPass",description:"Cutoff frequency. Only frequencies\n below the lowPass will be part of the\n delay.
\n",type:"Number",optional:!0}],class:"p5.Delay",module:"p5.sound"},delayTime:{name:"delayTime",params:[{name:"delayTime",description:"Time (in seconds) of the delay
\n",type:"Number"}],class:"p5.Delay",module:"p5.sound"},feedback:{name:"feedback",params:[{name:"feedback",description:"0.0 to 1.0, or an object such as an\n Oscillator that can be used to\n modulate this param
\n",type:"Number|Object"}],class:"p5.Delay",module:"p5.sound"},filter:{name:"filter",params:[{name:"cutoffFreq",description:"A lowpass filter will cut off any\n frequencies higher than the filter frequency.
\n",type:"Number|Object"},{name:"res",description:"Resonance of the filter frequency\n cutoff, or an object (i.e. a p5.Oscillator)\n that can be used to modulate this parameter.\n High numbers (i.e. 15) will produce a resonance,\n low numbers (i.e. .2) will produce a slope.
\n",type:"Number|Object"}],class:"p5.Delay",module:"p5.sound"},setType:{name:"setType",params:[{name:"type",description:"'pingPong' (1) or 'default' (0)
\n",type:"String|Number"}],class:"p5.Delay",module:"p5.sound"},amp:{name:"amp",params:[{name:"volume",description:"amplitude between 0 and 1.0
\n",type:"Number"},{name:"rampTime",description:"create a fade that lasts rampTime
\n",type:"Number",optional:!0},{name:"timeFromNow",description:"schedule this event to happen\n seconds from now
\n",type:"Number",optional:!0}],class:"p5.Delay",module:"p5.sound"},connect:{name:"connect",params:[{name:"unit",description:"",type:"Object"}],class:"p5.Delay",module:"p5.sound"},disconnect:{name:"disconnect",class:"p5.Delay",module:"p5.sound"}},"p5.Reverb":{process:{name:"process",params:[{name:"src",description:"p5.sound / Web Audio object with a sound\n output.
\n",type:"Object"},{name:"seconds",description:"Duration of the reverb, in seconds.\n Min: 0, Max: 10. Defaults to 3.
\n",type:"Number",optional:!0},{name:"decayRate",description:"Percentage of decay with each echo.\n Min: 0, Max: 100. Defaults to 2.
\n",type:"Number",optional:!0},{name:"reverse",description:"Play the reverb backwards or forwards.
\n",type:"Boolean",optional:!0}],class:"p5.Reverb",module:"p5.sound"},set:{name:"set",params:[{name:"seconds",description:"Duration of the reverb, in seconds.\n Min: 0, Max: 10. Defaults to 3.
\n",type:"Number",optional:!0},{name:"decayRate",description:"Percentage of decay with each echo.\n Min: 0, Max: 100. Defaults to 2.
\n",type:"Number",optional:!0},{name:"reverse",description:"Play the reverb backwards or forwards.
\n",type:"Boolean",optional:!0}],class:"p5.Reverb",module:"p5.sound"},amp:{name:"amp",params:[{name:"volume",description:"amplitude between 0 and 1.0
\n",type:"Number"},{name:"rampTime",description:"create a fade that lasts rampTime
\n",type:"Number",optional:!0},{name:"timeFromNow",description:"schedule this event to happen\n seconds from now
\n",type:"Number",optional:!0}],class:"p5.Reverb",module:"p5.sound"},connect:{name:"connect",params:[{name:"unit",description:"",type:"Object"}],class:"p5.Reverb",module:"p5.sound"},disconnect:{name:"disconnect",class:"p5.Reverb",module:"p5.sound"}},"p5.Convolver":{convolverNode:{name:"convolverNode",class:"p5.Convolver",module:"p5.sound"},process:{name:"process",params:[{name:"src",description:"p5.sound / Web Audio object with a sound\n output.
\n",type:"Object"}],class:"p5.Convolver",module:"p5.sound"},impulses:{name:"impulses",class:"p5.Convolver",module:"p5.sound"},addImpulse:{name:"addImpulse",params:[{name:"path",description:"path to a sound file
\n",type:"String"},{name:"callback",description:"function (optional)
\n",type:"Function"},{name:"errorCallback",description:"function (optional)
\n",type:"Function"}],class:"p5.Convolver",module:"p5.sound"},resetImpulse:{name:"resetImpulse",params:[{name:"path",description:"path to a sound file
\n",type:"String"},{name:"callback",description:"function (optional)
\n",type:"Function"},{name:"errorCallback",description:"function (optional)
\n",type:"Function"}],class:"p5.Convolver",module:"p5.sound"},toggleImpulse:{name:"toggleImpulse",params:[{name:"id",description:"Identify the impulse by its original filename\n (String), or by its position in the\n .impulses Array (Number).
\n",type:"String|Number"}],class:"p5.Convolver",module:"p5.sound"}},"p5.Phrase":{sequence:{name:"sequence",class:"p5.Phrase",module:"p5.sound"}},"p5.Part":{setBPM:{name:"setBPM",params:[{name:"BPM",description:"Beats Per Minute
\n",type:"Number"},{name:"rampTime",description:"Seconds from now
\n",type:"Number",optional:!0}],class:"p5.Part",module:"p5.sound"},getBPM:{name:"getBPM",class:"p5.Part",module:"p5.sound"},start:{name:"start",params:[{name:"time",description:"seconds from now
\n",type:"Number",optional:!0}],class:"p5.Part",module:"p5.sound"},loop:{name:"loop",params:[{name:"time",description:"seconds from now
\n",type:"Number",optional:!0}],class:"p5.Part",module:"p5.sound"},noLoop:{name:"noLoop",class:"p5.Part",module:"p5.sound"},stop:{name:"stop",params:[{name:"time",description:"seconds from now
\n",type:"Number",optional:!0}],class:"p5.Part",module:"p5.sound"},pause:{name:"pause",params:[{name:"time",description:"seconds from now
\n",type:"Number"}],class:"p5.Part",module:"p5.sound"},addPhrase:{name:"addPhrase",params:[{name:"phrase",description:"reference to a p5.Phrase
\n",type:"p5.Phrase"}],class:"p5.Part",module:"p5.sound"},removePhrase:{name:"removePhrase",params:[{name:"phraseName",description:"",type:"String"}],class:"p5.Part",module:"p5.sound"},getPhrase:{name:"getPhrase",params:[{name:"phraseName",description:"",type:"String"}],class:"p5.Part",module:"p5.sound"},replaceSequence:{name:"replaceSequence",params:[{name:"phraseName",description:"",type:"String"},{name:"sequence",description:"Array of values to pass into the callback\n at each step of the phrase.
\n",type:"Array"}],class:"p5.Part",module:"p5.sound"},onStep:{name:"onStep",params:[{name:"callback",description:"The name of the callback\n you want to fire\n on every beat/tatum.
\n",type:"Function"}],class:"p5.Part",module:"p5.sound"}},"p5.Score":{start:{name:"start",class:"p5.Score",module:"p5.sound"},stop:{name:"stop",class:"p5.Score",module:"p5.sound"},pause:{name:"pause",class:"p5.Score",module:"p5.sound"},loop:{name:"loop",class:"p5.Score",module:"p5.sound"},noLoop:{name:"noLoop",class:"p5.Score",module:"p5.sound"},setBPM:{name:"setBPM",params:[{name:"BPM",description:"Beats Per Minute
\n",type:"Number"},{name:"rampTime",description:"Seconds from now
\n",type:"Number"}],class:"p5.Score",module:"p5.sound"}},"p5.SoundLoop":{musicalTimeMode:{name:"musicalTimeMode",class:"p5.SoundLoop",module:"p5.sound"},maxIterations:{name:"maxIterations",class:"p5.SoundLoop",module:"p5.sound"},start:{name:"start",params:[{name:"timeFromNow",description:"schedule a starting time
\n",type:"Number",optional:!0}],class:"p5.SoundLoop",module:"p5.sound"},stop:{name:"stop",params:[{name:"timeFromNow",description:"schedule a stopping time
\n",type:"Number",optional:!0}],class:"p5.SoundLoop",module:"p5.sound"},pause:{name:"pause",params:[{name:"timeFromNow",description:"schedule a pausing time
\n",type:"Number",optional:!0}],class:"p5.SoundLoop",module:"p5.sound"},syncedStart:{name:"syncedStart",params:[{name:"otherLoop",description:"a p5.SoundLoop to sync with
\n",type:"Object"},{name:"timeFromNow",description:"Start the loops in sync after timeFromNow seconds
\n",type:"Number",optional:!0}],class:"p5.SoundLoop",module:"p5.sound"},bpm:{name:"bpm",class:"p5.SoundLoop",module:"p5.sound"},timeSignature:{name:"timeSignature",class:"p5.SoundLoop",module:"p5.sound"},interval:{name:"interval",class:"p5.SoundLoop",module:"p5.sound"},iterations:{name:"iterations",class:"p5.SoundLoop",module:"p5.sound"}},"p5.Compressor":{compressor:{name:"compressor",class:"p5.Compressor",module:"p5.sound"},process:{name:"process",params:[{name:"src",description:"Sound source to be connected
\n",type:"Object"},{name:"attack",description:"The amount of time (in seconds) to reduce the gain by 10dB,\n default = .003, range 0 - 1
\n",type:"Number",optional:!0},{name:"knee",description:'A decibel value representing the range above the\n threshold where the curve smoothly transitions to the "ratio" portion.\n default = 30, range 0 - 40
\n',type:"Number",optional:!0},{name:"ratio",description:"The amount of dB change in input for a 1 dB change in output\n default = 12, range 1 - 20
\n",type:"Number",optional:!0},{name:"threshold",description:"The decibel value above which the compression will start taking effect\n default = -24, range -100 - 0
\n",type:"Number",optional:!0},{name:"release",description:"The amount of time (in seconds) to increase the gain by 10dB\n default = .25, range 0 - 1
\n",type:"Number",optional:!0}],class:"p5.Compressor",module:"p5.sound"},set:{name:"set",params:[{name:"attack",description:"The amount of time (in seconds) to reduce the gain by 10dB,\n default = .003, range 0 - 1
\n",type:"Number"},{name:"knee",description:'A decibel value representing the range above the\n threshold where the curve smoothly transitions to the "ratio" portion.\n default = 30, range 0 - 40
\n',type:"Number"},{name:"ratio",description:"The amount of dB change in input for a 1 dB change in output\n default = 12, range 1 - 20
\n",type:"Number"},{name:"threshold",description:"The decibel value above which the compression will start taking effect\n default = -24, range -100 - 0
\n",type:"Number"},{name:"release",description:"The amount of time (in seconds) to increase the gain by 10dB\n default = .25, range 0 - 1
\n",type:"Number"}],class:"p5.Compressor",module:"p5.sound"},attack:{name:"attack",params:[{name:"attack",description:"Attack is the amount of time (in seconds) to reduce the gain by 10dB,\n default = .003, range 0 - 1
\n",type:"Number",optional:!0},{name:"time",description:"Assign time value to schedule the change in value
\n",type:"Number",optional:!0}],class:"p5.Compressor",module:"p5.sound"},knee:{name:"knee",params:[{name:"knee",description:'A decibel value representing the range above the\n threshold where the curve smoothly transitions to the "ratio" portion.\n default = 30, range 0 - 40
\n',type:"Number",optional:!0},{name:"time",description:"Assign time value to schedule the change in value
\n",type:"Number",optional:!0}],class:"p5.Compressor",module:"p5.sound"},ratio:{name:"ratio",params:[{name:"ratio",description:"The amount of dB change in input for a 1 dB change in output\n default = 12, range 1 - 20
\n",type:"Number",optional:!0},{name:"time",description:"Assign time value to schedule the change in value
\n",type:"Number",optional:!0}],class:"p5.Compressor",module:"p5.sound"},threshold:{name:"threshold",params:[{name:"threshold",description:"The decibel value above which the compression will start taking effect\n default = -24, range -100 - 0
\n",type:"Number"},{name:"time",description:"Assign time value to schedule the change in value
\n",type:"Number",optional:!0}],class:"p5.Compressor",module:"p5.sound"},release:{name:"release",params:[{name:"release",description:"The amount of time (in seconds) to increase the gain by 10dB\n default = .25, range 0 - 1
\n",type:"Number"},{name:"time",description:"Assign time value to schedule the change in value
\n",type:"Number",optional:!0}],class:"p5.Compressor",module:"p5.sound"},reduction:{name:"reduction",class:"p5.Compressor",module:"p5.sound"}},"p5.SoundRecorder":{setInput:{name:"setInput",params:[{name:"unit",description:"p5.sound object or a web audio unit\n that outputs sound
\n",type:"Object",optional:!0}],class:"p5.SoundRecorder",module:"p5.sound"},record:{name:"record",params:[{name:"soundFile",description:"p5.SoundFile
\n",type:"p5.SoundFile"},{name:"duration",description:"Time (in seconds)
\n",type:"Number",optional:!0},{name:"callback",description:"The name of a function that will be\n called once the recording completes
\n",type:"Function",optional:!0}],class:"p5.SoundRecorder",module:"p5.sound"},stop:{name:"stop",class:"p5.SoundRecorder",module:"p5.sound"}},"p5.PeakDetect":{isDetected:{name:"isDetected",class:"p5.PeakDetect",module:"p5.sound"},update:{name:"update",params:[{name:"fftObject",description:"A p5.FFT object
\n",type:"p5.FFT"}],class:"p5.PeakDetect",module:"p5.sound"},onPeak:{name:"onPeak",params:[{name:"callback",description:"Name of a function that will\n be called when a peak is\n detected.
\n",type:"Function"},{name:"val",description:"Optional value to pass\n into the function when\n a peak is detected.
\n",type:"Object",optional:!0}],class:"p5.PeakDetect",module:"p5.sound"}},"p5.Gain":{setInput:{name:"setInput",params:[{name:"src",description:"p5.sound / Web Audio object with a sound\n output.
\n",type:"Object"}],class:"p5.Gain",module:"p5.sound"},connect:{name:"connect",params:[{name:"unit",description:"",type:"Object"}],class:"p5.Gain",module:"p5.sound"},disconnect:{name:"disconnect",class:"p5.Gain",module:"p5.sound"},amp:{name:"amp",params:[{name:"volume",description:"amplitude between 0 and 1.0
\n",type:"Number"},{name:"rampTime",description:"create a fade that lasts rampTime
\n",type:"Number",optional:!0},{name:"timeFromNow",description:"schedule this event to happen\n seconds from now
\n",type:"Number",optional:!0}],class:"p5.Gain",module:"p5.sound"}},"p5.Distortion":{WaveShaperNode:{name:"WaveShaperNode",class:"p5.Distortion",module:"p5.sound"},process:{name:"process",params:[{name:"amount",description:"Unbounded distortion amount.\n Normal values range from 0-1.
\n",type:"Number",optional:!0,optdefault:"0.25"},{name:"oversample",description:"'none', '2x', or '4x'.
\n",type:"String",optional:!0,optdefault:"'none'"}],class:"p5.Distortion",module:"p5.sound"},set:{name:"set",params:[{name:"amount",description:"Unbounded distortion amount.\n Normal values range from 0-1.
\n",type:"Number",optional:!0,optdefault:"0.25"},{name:"oversample",description:"'none', '2x', or '4x'.
\n",type:"String",optional:!0,optdefault:"'none'"}],class:"p5.Distortion",module:"p5.sound"},getAmount:{name:"getAmount",class:"p5.Distortion",module:"p5.sound"},getOversample:{name:"getOversample",class:"p5.Distortion",module:"p5.sound"}}}},{}],2:[function(e,t,r){"use strict";r.byteLength=function(e){var t=c(e),r=t[0],n=t[1];return 3*(r+n)/4-n},r.toByteArray=function(e){var t,r,n=c(e),a=n[0],o=n[1],i=new u(function(e,t){return 3*(e+t)/4-t}(a,o)),s=0,l=0>16&255,i[s++]=t>>8&255,i[s++]=255&t;2===o&&(t=p[e.charCodeAt(r)]<<2|p[e.charCodeAt(r+1)]>>4,i[s++]=255&t);1===o&&(t=p[e.charCodeAt(r)]<<10|p[e.charCodeAt(r+1)]<<4|p[e.charCodeAt(r+2)]>>2,i[s++]=t>>8&255,i[s++]=255&t);return i},r.fromByteArray=function(e){for(var t,r=e.length,n=r%3,a=[],o=0,i=r-n;o>2]+s[t<<4&63]+"==")):2==n&&(t=(e[r-2]<<8)+e[r-1],a.push(s[t>>10]+s[t>>4&63]+s[t<<2&63]+"="));return a.join("")};for(var s=[],p=[],u="undefined"!=typeof Uint8Array?Uint8Array:Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,o=n.length;a>18&63]+s[a>>12&63]+s[a>>6&63]+s[63&a]);return o.join("")}p["-".charCodeAt(0)]=62,p["_".charCodeAt(0)]=63},{}],3:[function(e,t,r){},{}],4:[function(e,t,r){arguments[4][3][0].apply(r,arguments)},{dup:3}],5:[function(F,e,U){(function(c){"use strict";var n=F("base64-js"),o=F("ieee754"),e="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;U.Buffer=c,U.SlowBuffer=function(e){+e!=e&&(e=0);return c.alloc(+e)},U.INSPECT_MAX_BYTES=50;var r=2147483647;function i(e){if(r>>1;case"base64":return P(e).length;default:if(a)return n?-1:I(e).length;t=(""+t).toLowerCase(),a=!0}}function h(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function m(e,t,r,n,a){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):2147483647=e.length){if(a)return-1;r=e.length-1}else if(r<0){if(!a)return-1;r=0}if("string"==typeof t&&(t=c.from(t,n)),c.isBuffer(t))return 0===t.length?-1:f(e,t,r,n,a);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?a?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):f(e,[t],r,n,a);throw new TypeError("val must be string, number or Buffer")}function f(e,t,r,n,a){var o,i=1,s=e.length,l=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;s/=i=2,l/=2,r/=2}function p(e,t){return 1===i?e[t]:e.readUInt16BE(t*i)}if(a){var u=-1;for(o=r;o>8,a=r%256,o.push(a),o.push(n);return o}(t,e.length-r),e,r,n)}function b(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function _(e,t,r){r=Math.min(e.length,r);for(var n=[],a=t;a>>10&1023|55296),u=56320|1023&u),n.push(u),a+=c}return function(e){var t=e.length;if(t<=x)return String.fromCharCode.apply(String,e);var r="",n=0;for(;nthis.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 S(this,t,r);case"latin1":case"binary":return w(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(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!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=U.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,n,a){if(D(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===n&&(n=0),void 0===a&&(a=this.length),t<0||r>e.length||n<0||a>this.length)throw new RangeError("out of range index");if(a<=n&&r<=t)return 0;if(a<=n)return-1;if(r<=t)return 1;if(this===e)return 0;for(var o=(a>>>=0)-(n>>>=0),i=(r>>>=0)-(t>>>=0),s=Math.min(o,i),l=this.slice(n,a),p=e.slice(t,r),u=0;u>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var a=this.length-t;if((void 0===r||athis.length)throw new RangeError("Attempt to write outside buffer bounds");n=n||"utf8";for(var o,i,s,l,p,u,c=!1;;)switch(n){case"hex":return y(this,e,t,r);case"utf8":case"utf-8":return p=t,u=r,R(I(e,(l=this).length-p),l,p,u);case"ascii":return g(this,e,t,r);case"latin1":case"binary":return g(this,e,t,r);case"base64":return o=this,i=t,s=r,R(P(e),o,i,s);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return v(this,e,t,r);default:if(c)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),c=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var x=4096;function S(e,t,r){var n="";r=Math.min(e.length,r);for(var a=t;ae.length)throw new RangeError("Index out of range")}function N(e,t,r,n){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function O(e,t,r,n,a){return t=+t,r>>>=0,a||N(e,0,r,4),o.write(e,t,r,n,23,4),r+4}function L(e,t,r,n,a){return t=+t,r>>>=0,a||N(e,0,r,8),o.write(e,t,r,n,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 n=this[e],a=1,o=0;++o>>=0,t>>>=0,r||T(e,t,this.length);for(var n=this[e+--t],a=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 n=this[e],a=1,o=0;++o>>=0,t>>>=0,r||T(e,t,this.length);for(var n=t,a=1,o=this[e+--n];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,n){e=+e,t>>>=0,r>>>=0,n||C(this,e,t,r,Math.pow(2,8*r)-1,0);var a=1,o=0;for(this[t]=255&e;++o>>=0,r>>>=0,n||C(this,e,t,r,Math.pow(2,8*r)-1,0);var a=r-1,o=1;for(this[t+a]=255&e;0<=--a&&(o*=256);)this[t+a]=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,n){if(e=+e,t>>>=0,!n){var a=Math.pow(2,8*r-1);C(this,e,t,r,a-1,-a)}var o=0,i=1,s=0;for(this[t]=255&e;++o>0)-s&255;return t+r},c.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var a=Math.pow(2,8*r-1);C(this,e,t,r,a-1,-a)}var o=r-1,i=1,s=0;for(this[t+o]=255&e;0<=--o&&(i*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/i>>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 O(this,e,t,!0,r)},c.prototype.writeFloatBE=function(e,t,r){return O(this,e,t,!1,r)},c.prototype.writeDoubleLE=function(e,t,r){return L(this,e,t,!0,r)},c.prototype.writeDoubleBE=function(e,t,r){return L(this,e,t,!1,r)},c.prototype.copy=function(e,t,r,n){if(!c.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r=r||0,n||0===n||(n=this.length),t>=e.length&&(t=e.length),t=t||0,0=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=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 P(e){return n.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 R(e,t,r,n){for(var a=0;a=t.length||a>=e.length);++a)t[a+r]=e[a];return a}function D(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function A(e){return e!=e}var k=function(){for(var e="0123456789abcdef",t=new Array(256),r=0;r<16;++r)for(var n=16*r,a=0;a<16;++a)t[n+a]=e[r]+e[a];return t}()}).call(this,F("buffer").Buffer)},{"base64-js":2,buffer:5,ieee754:10}],6:[function(e,t,r){"use strict";t.exports=e("./").polyfill()},{"./":7}],7:[function(z,r,n){(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)},n=0,t=void 0,a=void 0,i=function(e,t){d[n]=e,d[n+1]=t,2===(n+=2)&&(a?a(h):v())};var e="undefined"!=typeof window?window:void 0,o=e||{},s=o.MutationObserver||o.WebKitMutationObserver,p="undefined"==typeof self&&void 0!==j&&"[object process]"==={}.toString.call(j),u="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function c(){var e=setTimeout;return function(){return e(h,1)}}var d=new Array(1e3);function h(){for(var e=0;e>1,u=-7,c=r?a-1:0,d=r?-1:1,h=e[t+c];for(c+=d,o=h&(1<<-u)-1,h>>=-u,u+=s;0>=-u,u+=n;0>1,d=23===a?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:o-1,m=n?1:-1,f=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,i=u):(i=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-i))<1&&(i--,l*=2),2<=(t+=1<=i+c?d/l:d*Math.pow(2,1-c))*l&&(i++,l/=2),u<=i+c?(s=0,i=u):1<=i+c?(s=(t*l-1)*Math.pow(2,a),i+=c):(s=t*Math.pow(2,c-1)*Math.pow(2,a),i=0));8<=a;e[r+h]=255&s,h+=m,s/=256,a-=8);for(i=i<Math.abs(e[0])&&(t=1),Math.abs(e[2])>Math.abs(e[t])&&(t=2),t}var C=4e150;function N(e,t){e.f+=t.f,e.b.f+=t.b.f}function p(e,t,r){return e=e.a,t=t.a,r=r.a,t.b.a===e?r.b.a===e?g(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=v(t.b.a,e,t.a),(e=v(r.b.a,e,r.a))<=t)}function O(e){e.a.i=null;var t=e.e;t.a.c=t.c,t.c.a=t.a,e.e=null}function u(e,t){c(e.a),e.c=!1,(e.a=t).i=e}function L(e){for(var t=e.a.a;(e=de(e)).a.a===t;);return e.c&&(u(e,t=d(ce(e).a.b,e.a.e)),e=de(e)),e}function I(e,t,r){var n=new ue;return n.a=r,n.e=W(e.f,t.e,n),r.i=n}function P(e,t){switch(e.s){case 100130:return 0!=(1&t);case 100131:return 0!==t;case 100132:return 0>1]],s[i[p]])?le(r,p):pe(r,p)),s[o]=null,l[o]=r.b,r.b=o}else for(r.c[-(o+1)]=null;0Math.max(i.a,l.a))return!1;if(g(o,i)){if(0n.f&&(n.f*=2,n.c=oe(n.c,n.f+1)),0===n.b?r=a:(r=n.b,n.b=n.c[n.b]),n.e[r]=t,n.c[r]=a,n.d[a]=r,n.h&&pe(n,a),r}return n=e.a++,e.c[n]=t,-(n+1)}function ne(e){if(0===e.a)return se(e.b);var t=e.c[e.d[e.a-1]];if(0!==e.b.a&&g(ie(e.b),t))return se(e.b);for(;--e.a,0e.a||g(n[i],n[l])){a[r[o]=i]=o;break}a[r[o]=l]=o,o=s}}function pe(e,t){for(var r=e.d,n=e.e,a=e.c,o=t,i=r[o];;){var s=o>>1,l=r[s];if(0==s||g(n[l],n[i])){a[r[o]=i]=o;break}a[r[o]=l]=o,o=s}}function ue(){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 de(e){return e.e.a.b}(n=q.prototype).x=function(){Y(this,0)},n.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)},n.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},n.A=function(e,t,r){this.j[0]=e,this.j[1]=t,this.j[2]=r},n.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)}},n.C=function(e,t){var r=!1,n=[0,0,0];Y(this,2);for(var a=0;a<3;++a){var o=e[a];o<-1e150&&(o=-1e150,r=!0),1e150a[p]&&(a[p]=u,i[p]=l)}if(l=0,a[1]-o[1]>a[0]-o[0]&&(l=1),a[2]-o[2]>a[l]-o[l]&&(l=2),o[l]>=a[l])n[0]=0,n[1]=0,n[2]=1;else{for(a=0,o=s[l],i=i[l],s=[0,0,0],o=[o.g[0]-i.g[0],o.g[1]-i.g[1],o.g[2]-i.g[2]],p=[0,0,0],l=r.e;l!==r;l=l.e)p[0]=l.g[0]-i.g[0],p[1]=l.g[1]-i.g[1],p[2]=l.g[2]-i.g[2],s[0]=o[1]*p[2]-o[2]*p[1],s[1]=o[2]*p[0]-o[0]*p[2],s[2]=o[0]*p[1]-o[1]*p[0],a<(u=s[0]*s[0]+s[1]*s[1]+s[2]*s[2])&&(a=u,n[0]=s[0],n[1]=s[1],n[2]=s[2]);a<=0&&(n[0]=n[1]=n[2]=0,n[T(o)]=1)}r=!0}for(s=T(n),l=this.b.c,a=(s+1)%3,i=(s+2)%3,s=0>=l,u-=l,y!=o){if(y==i)break;for(var g=y>8,++v;var _=b;if(n>=8;null!==f&&s<4096&&(m[s++]=f<<8|_,p+1<=s&&l<12&&(++l,p=p<<1|1)),f=y}else s=1+i,p=(1<<(l=a+1))-1,f=null}return d!==n&&console.log("Warning, gif stream shorter than expected."),r}try{r.GifWriter=function(g,e,t,r){var v=0,n=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;)++a;if(i=1<>8&255,g[v++]=255&t,g[v++]=t>>8&255,g[v++]=(null!==b?128:0)|a,g[v++]=o,g[v++]=0,null!==b)for(var s=0,l=b.length;s>16&255,g[v++]=p>>8&255,g[v++]=255&p}if(null!==n){if(n<0||65535>8&255,g[v++]=0}var x=!1;this.addFrame=function(e,t,r,n,a,o){if(!0===x&&(--v,x=!1),o=void 0===o?{}:o,e<0||t<0||65535>=1;)++p;l=1<>8&255,g[v++]=h,g[v++]=0),g[v++]=44,g[v++]=255&e,g[v++]=e>>8&255,g[v++]=255&t,g[v++]=t>>8&255,g[v++]=255&r,g[v++]=r>>8&255,g[v++]=255&n,g[v++]=n>>8&255,g[v++]=!0===i?128|p-1:0,!0===i)for(var m=0,f=s.length;m>16&255,g[v++]=y>>8&255,g[v++]=255&y}return v=function(t,r,e,n){t[r++]=e;var a=r++,o=1<>=8,u-=8,r===a+256&&(t[a]=255,a=r++)}function h(e){c|=e<>=8,u-=8,r===a+256&&(t[a]=255,a=r++);4096===l?(h(o),l=1+s,p=e+1,f={}):(1<>7,a=1<<1+(7&r);x[e++],x[e++];var o=null,i=null;n&&(o=e,e+=3*(i=a));var s=!0,l=[],p=0,u=null,c=0,d=null;for(this.width=S,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 m=x[e++]|x[e++]<<8,f=x[e++]|x[e++]<<8,y=x[e++]|x[e++]<<8,g=x[e++]|x[e++]<<8,v=x[e++],b=v>>6&1,_=1<<1+(7&v),w=o,M=i,E=!1;if(v>>7){E=!0;w=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:m,y:f,width:y,height:g,has_local_palette:E,palette_offset:w,palette_size:M,data_offset:T,data_length:e-T,transparent_index:u,interlaced:!!b,delay:p,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 d},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),n=r.width*r.height,a=new Uint8Array(n);N(x,r.data_offset,a,n);var o=r.palette_offset,i=r.transparent_index;null===i&&(i=256);var s=r.width,l=S-s,p=s,u=4*(r.y*S+r.x),c=4*((r.y+r.height)*S+r.x),d=u,h=4*l;!0===r.interlaced&&(h+=4*S*7);for(var m=8,f=0,y=a.length;f>=1)),g===i)d+=4;else{var v=x[o+3*g],b=x[o+3*g+1],_=x[o+3*g+2];t[d++]=_,t[d++]=b,t[d++]=v,t[d++]=255}--p}},this.decodeAndBlitFrameRGBA=function(e,t){var r=this.frameInfo(e),n=r.width*r.height,a=new Uint8Array(n);N(x,r.data_offset,a,n);var o=r.palette_offset,i=r.transparent_index;null===i&&(i=256);var s=r.width,l=S-s,p=s,u=4*(r.y*S+r.x),c=4*((r.y+r.height)*S+r.x),d=u,h=4*l;!0===r.interlaced&&(h+=4*S*7);for(var m=8,f=0,y=a.length;f>=1)),g===i)d+=4;else{var v=x[o+3*g],b=x[o+3*g+1],_=x[o+3*g+2];t[d++]=v,t[d++]=b,t[d++]=_,t[d++]=255}--p}}}}catch(e){}},{}],13:[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,n=e?Number(e):0;if(n!=n&&(n=0),!(n<0||r<=n)){var a,o=t.charCodeAt(n);return 55296<=o&&o<=56319&&n+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,n+r}function x(e,t){for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<>>=1,++a,r+=t.table[a],0<=(n-=t.table[a]););return e.tag=o,e.bitcount-=a,t.trans[r+n]}function S(e,t,r){var n,a,o,i,s,l;for(n=_(e,5,257),a=_(e,5,1),o=_(e,4,4),i=0;i<19;++i)y[i]=0;for(i=0;ithis.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,n,a,o,i,s){var l=this,p=[e,t],u=[r,n],c=[a,o],d=[i,s];this.addPoint(e,t),this.addPoint(i,s);for(var h=0;h<=1;h++){var m=6*p[h]-12*u[h]+6*c[h],f=-3*p[h]+9*u[h]-9*c[h]+3*d[h],y=3*u[h]-3*p[h];if(0!=f){var g=Math.pow(m,2)-4*y*f;if(!(g<0)){var v=(-m+Math.sqrt(g))/(2*f);0"},A.prototype.toDOMElement=function(e){var t=this.toPathData(e),r=document.createElementNS("http://www.w3.org/2000/svg","path");return r.setAttribute("d",t),r};var L={fail:N,argument:O,assert:O},I=2147483648,P={},R={},D={};function k(e){return function(){return e}}R.BYTE=function(e){return L.argument(0<=e&&e<=255,"Byte value should be between 0 and 255."),[e]},D.BYTE=k(1),R.CHAR=function(e){return[e.charCodeAt(0)]},D.CHAR=k(1),R.CHARARRAY=function(e){for(var t=[],r=0;r>8&255,255&e]},D.USHORT=k(2),R.SHORT=function(e){return 32768<=e&&(e=-(65536-e)),[e>>8&255,255&e]},D.SHORT=k(2),R.UINT24=function(e){return[e>>16&255,e>>8&255,255&e]},D.UINT24=k(3),R.ULONG=function(e){return[e>>24&255,e>>16&255,e>>8&255,255&e]},D.ULONG=k(4),R.LONG=function(e){return I<=e&&(e=-(2*I-e)),[e>>24&255,e>>16&255,e>>8&255,255&e]},D.LONG=k(4),R.FIXED=R.ULONG,D.FIXED=D.ULONG,R.FWORD=R.SHORT,D.FWORD=D.SHORT,R.UFWORD=R.USHORT,D.UFWORD=D.USHORT,R.LONGDATETIME=function(e){return[0,0,0,0,e>>24&255,e>>16&255,e>>8&255,255&e]},D.LONGDATETIME=k(8),R.TAG=function(e){return L.argument(4===e.length,"Tag should be exactly 4 ASCII characters."),[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]},D.TAG=k(4),R.Card8=R.BYTE,D.Card8=D.BYTE,R.Card16=R.USHORT,D.Card16=D.USHORT,R.OffSize=R.BYTE,D.OffSize=D.BYTE,R.SID=R.USHORT,D.SID=D.USHORT,R.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?R.NUMBER16(e):R.NUMBER32(e)},D.NUMBER=function(e){return R.NUMBER(e).length},R.NUMBER16=function(e){return[28,e>>8&255,255&e]},D.NUMBER16=k(3),R.NUMBER32=function(e){return[29,e>>24&255,e>>16&255,e>>8&255,255&e]},D.NUMBER32=k(5),R.REAL=function(e){var t=e.toString(),r=/\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec(t);if(r){var n=parseFloat("1e"+((r[2]?+r[2]:0)+r[1].length));t=(Math.round(e*n)/n).toString()}for(var a="",o=0,i=t.length;o>8&255,t[t.length]=255&n}return t},D.UTF16=function(e){return 2*e.length};var F={"x-mac-croatian":"รร
รรรรรรกร รขรครฃรฅรงรฉรจรชรซรญรฌรฎรฏรฑรณรฒรดรถรตรบรนรปรผโ ยฐยขยฃยงโขยถรยฎล โขยดยจโ ลฝรโยฑโคโฅโยตโโโลกโซยชยบฮฉลพรธยฟยกยฌโฦโฤยซฤโฆย รรรลลฤโโโโโรทโ๏ฃฟยฉโโฌโนโบรยปโยทโโโฐรฤรฤรรรรรรรฤรรรรฤฑหหยฏฯรหยธรรฆห","x-mac-cyrillic":"ะะะะะะะะะะะะะะะะะ ะกะขะฃะคะฅะฆะงะจะฉะชะซะฌะญะฎะฏโ ยฐายฃยงโขยถะยฎยฉโขะัโ ะัโยฑโคโฅัยตาะะัะัะัะััะ
ยฌโฦโโยซยปโฆย ะัะััโโโโโโรทโะัะัโะััะฐะฑะฒะณะดะตะถะทะธะนะบะปะผะฝะพะฟัััััั
ััััััััั","x-mac-gaelic":"รร
รรรรรรกร รขรครฃรฅรงรฉรจรชรซรญรฌรฎรฏรฑรณรฒรดรถรตรบรนรปรผโ ยฐยขยฃยงโขยถรยฎยฉโขยดยจโ รรแธยฑโคโฅแธฤฤแธแธแธแธฤ ฤกแนรฆรธแนแนแนษผฦลฟแน ยซยปโฆย รรรลลโโโโโโแนกแบรฟลธแนชโฌโนโบลถลทแนซยทแปฒแปณโรรรรรรรรรรรโฃรรรรฤฑรรฝลดลตแบแบ
แบแบแบแบ","x-mac-greek":"รยนยฒรยณรรฮ
ร รขรคฮยจรงรฉรจรชรซยฃโขรฎรฏโขยฝโฐรดรถยฆโฌรนรปรผโ ฮฮฮฮฮฮ รยฎยฉฮฃฮชยงโ ยฐยทฮยฑโคโฅยฅฮฮฮฮฮฮฮฮฆฮซฮจฮฉฮฌฮยฌฮฮกโฮคยซยปโฆย ฮฅฮงฮฮลโโโโโโรทฮฮฮฮฮญฮฎฮฏฯฮฯฮฑฮฒฯฮดฮตฯฮณฮทฮนฮพฮบฮปฮผฮฝฮฟฯฯฯฯฯฮธฯฯฯฯ
ฮถฯฯฮฮฐยญ","x-mac-icelandic":"รร
รรรรรรกร รขรครฃรฅรงรฉรจรชรซรญรฌรฎรฏรฑรณรฒรดรถรตรบรนรปรผรยฐยขยฃยงโขยถรยฎยฉโขยดยจโ รรโยฑโคโฅยฅยตโโโฯโซยชยบฮฉรฆรธยฟยกยฌโฦโโยซยปโฆย รรรลลโโโโโโรทโรฟลธโโฌรรฐรรพรฝยทโโโฐรรรรรรรรรรร๏ฃฟรรรรฤฑหหยฏหหหยธหหห","x-mac-inuit":"แแแ
แแแแฑแฒแณแดแธแนแแแแแแแแฆแญแฎแฏแฐแฒแณแแแแแแแยฐแกแฅแฆโขยถแงยฎยฉโขแจแชแซแปแแแแ
แแแแฏแฐแฑแฒแดแตแ
แแแแแแแชแจแฉแชแซแญโฆย แฎแพแแแโโโโโโแแแแแแแแแแแแฟแแแแแแ
แแแแแแแแฑแฒแณแดแตแถแแ แกแขแฃแคแฅแฆแผลล","x-mac-ce":"รฤฤรฤรรรกฤ
ฤรคฤฤฤรฉลนลบฤรญฤฤฤฤรณฤรดรถรตรบฤฤรผโ ยฐฤยฃยงโขยถรยฎยฉโขฤยจโ ฤฃฤฎฤฏฤชโคโฅฤซฤถโโลฤปฤผฤฝฤพฤนฤบล
ลลยฌโลลโยซยปโฆย ลลรลลโโโโโโรทโลลลลโนโบลลลล โโลกลลรลคลฅรลฝลพลชรรลซลฎรลฏลฐลฑลฒลณรรฝฤทลปลลผฤขห",macintosh:"รร
รรรรรรกร รขรครฃรฅรงรฉรจรชรซรญรฌรฎรฏรฑรณรฒรดรถรตรบรนรปรผโ ยฐยขยฃยงโขยถรยฎยฉโขยดยจโ รรโยฑโคโฅยฅยตโโโฯโซยชยบฮฉรฆรธยฟยกยฌโฦโโยซยปโฆย รรรลลโโโโโโรทโรฟลธโโฌโนโบ๏ฌ๏ฌโกยทโโโฐรรรรรรรรรรร๏ฃฟรรรรฤฑหหยฏหหหยธหหห","x-mac-romanian":"รร
รรรรรรกร รขรครฃรฅรงรฉรจรชรซรญรฌรฎรฏรฑรณรฒรดรถรตรบรนรปรผโ ยฐยขยฃยงโขยถรยฎยฉโขยดยจโ ฤศโยฑโคโฅยฅยตโโโฯโซยชยบฮฉฤศยฟยกยฌโฦโโยซยปโฆย รรรลลโโโโโโรทโรฟลธโโฌโนโบศศโกยทโโโฐรรรรรรรรรรร๏ฃฟรรรรฤฑหหยฏหหหยธหหห","x-mac-turkish":"รร
รรรรรรกร รขรครฃรฅรงรฉรจรชรซรญรฌรฎรฏรฑรณรฒรดรถรตรบรนรปรผโ ยฐยขยฃยงโขยถรยฎยฉโขยดยจโ รรโยฑโคโฅยฅยตโโโฯโซยชยบฮฉรฆรธยฟยกยฌโฦโโยซยปโฆย รรรลลโโโโโโรทโรฟลธฤฤฤฐฤฑลลโกยทโโโฐรรรรรรรรรรร๏ฃฟรรรร๏ข หหยฏหหหยธหหห"};P.MACSTRING=function(e,t,r,n){var a=F[n];if(void 0!==a){for(var o="",i=0;i>8&255,l+256&255)}return o}R.MACSTRING=function(e,t){var r=function(e){if(!U)for(var t in U={},F)U[t]=new String(t);var r=U[e];if(void 0!==r){if(B){var n=B.get(r);if(void 0!==n)return n}var a=F[e];if(void 0!==a){for(var o={},i=0;i>8,t[c+1]=255&d,t=t.concat(n[u])}return t},D.TABLE=function(e){for(var t=0,r=e.fields.length,n=0;n>1,t.skip("uShort",3),e.glyphIndexMap={};for(var i=new se.Parser(r,n+a+14),s=new se.Parser(r,n+a+16+2*o),l=new se.Parser(r,n+a+16+4*o),p=new se.Parser(r,n+a+16+6*o),u=n+a+16+8*o,c=0;c>4,o=15&n;if(15==a)break;if(t+=r[a],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 n=new se.Parser(e,t),a=[],o=[];for(r=void 0!==r?r:e.length;n.relativeOffset>1,T.length=0,N=!0}return function e(t){for(var r,n,a,o,i,s,l,p,u,c,d,h,m=0;mMath.abs(h-I)?L=d+T.shift():I=h+T.shift(),E.curveTo(v,b,_,x,l,p),E.curveTo(u,c,d,h,L,I);break;default:console.log("Glyph "+g.index+": unknown operator 1200"+f),T.length=0}break;case 14:0>3;break;case 21:2>16),m+=2;break;case 29:i=T.pop()+y.gsubrsBias,(s=y.gsubrs[i])&&e(s);break;case 30:for(;0=r.begin&&e=de.length){var i=n.parseChar();r.names.push(n.parseString(i))}break;case 2.5:r.numberOfGlyphs=n.parseUShort(),r.offset=new Array(r.numberOfGlyphs);for(var s=0;st.value.tag?1:-1}),t.fields=t.fields.concat(n),t.fields=t.fields.concat(a),t}function yt(e,t,r){for(var n=0;n 123 are reserved for internal usage");h|=1<>>1,o=e[a].tag;if(o===t)return a;o>>1,o=e[a];if(o===t)return a;o>>1,i=(r=e[o]).start;if(i===t)return r;i(r=e[n-1]).end?0:r}function xt(e,t){this.font=e,this.tableName=t}function St(e){xt.call(this,e,"gpos")}function wt(e){xt.call(this,e,"gsub")}function Mt(e,t){var r=e.length;if(r!==t.length)return!1;for(var n=0;nt.points.length-1||n.matchedPoints[1]>a.points.length-1)throw Error("Matched points out of range in "+t.name);var i=t.points[n.matchedPoints[0]],s=a.points[n.matchedPoints[1]],l={xScale:n.xScale,scale01:n.scale01,scale10:n.scale10,yScale:n.yScale,dx:0,dy:0};s=Lt([s],l)[0],l.dx=i.x-s.x,l.dy=i.y-s.y,o=Lt(a.points,l)}t.points=t.points.concat(o)}}return It(t.points)}(St.prototype=xt.prototype={searchTag:vt,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[p-1].tag,"Features must be added in alphabetical order."),o={tag:r,feature:{params:0,lookupListIndexes:[]}},s.push(o),i.push(p),o.feature}}},getLookupTables:function(e,t,r,n,a){var o=this.getFeatureTable(e,t,r,a),i=[];if(o){for(var s,l=o.lookupListIndexes,p=this.font.tables[this.tableName].lookups,u=0;u",s),t.stack.push(Math.round(64*s))}function gr(e,t){var r=t.stack,n=r.pop(),a=t.fv,o=t.pv,i=t.ppem,s=t.deltaBase+16*(e-1),l=t.deltaShift,p=t.z0;E.DEBUG&&console.log(t.step,"DELTAP["+e+"]",n,r);for(var u=0;u>4)===i){var h=(15&d)-8;0<=h&&h++,E.DEBUG&&console.log(t.step,"DELTAPFIX",c,"by",h*l);var m=p[c];a.setRelative(m,m,h*l,o)}}}function vr(e,t){var r=t.stack,n=r.pop();E.DEBUG&&console.log(t.step,"ROUND[]"),r.push(64*t.round(n/64))}function br(e,t){var r=t.stack,n=r.pop(),a=t.ppem,o=t.deltaBase+16*(e-1),i=t.deltaShift;E.DEBUG&&console.log(t.step,"DELTAC["+e+"]",n,r);for(var s=0;s>4)===a){var u=(15&p)-8;0<=u&&u++;var c=u*i;E.DEBUG&&console.log(t.step,"DELTACFIX",l,"by",c),t.cvt[l]+=c}}}function _r(e,t){var r,n,a=t.stack,o=a.pop(),i=a.pop(),s=t.z2[o],l=t.z1[i];E.DEBUG&&console.log(t.step,"SDPVTL["+e+"]",o,i),n=e?(r=s.y-l.y,l.x-s.x):(r=l.x-s.x,l.y-s.y),t.dpv=Zt(r,n)}function xr(e,t){var r=t.stack,n=t.prog,a=t.ip;E.DEBUG&&console.log(t.step,"PUSHB["+e+"]");for(var o=0;o":"_")+(n?"R":"_")+(0===a?"Gr":1===a?"Bl":2===a?"Wh":"")+"]",e?c+"("+o.cvt[c]+","+p+")":"",d,"(d =",i,"->",l*s,")"),o.rp1=o.rp0,o.rp2=d,t&&(o.rp0=d)}Ut.prototype.exec=function(e,t){if("number"!=typeof t)throw new Error("Point size is not a number!");if(!(2",n),s.interpolate(c,o,i,l),s.touch(c)}e.loop=1},hr.bind(void 0,0),hr.bind(void 0,1),function(e){for(var t=e.stack,r=e.rp0,n=e.z0[r],a=e.loop,o=e.fv,i=e.pv,s=e.z1;a--;){var l=t.pop(),p=s[l];E.DEBUG&&console.log(e.step,(1"].indexOf(a[0])?void 0:a[0],lineNumber:a[1],columnNumber:a[2],source:e}},this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter(function(e){return!e.match(n)},this).map(function(e){if(-1 eval")&&(e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===e.indexOf("@")&&-1===e.indexOf(":"))return{functionName:e};var t=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=e.match(t),n=r&&r[1]?r[1]:void 0,a=this.extractLocation(e.replace(t,""));return{functionName:n,fileName:a[0],lineNumber:a[1],columnNumber:a[2],source:e}},this)},parseOpera:function(e){return!e.stacktrace||-1e.stacktrace.split("\n").length?this.parseOpera9(e):e.stack?this.parseOpera11(e):this.parseOpera10(e)},parseOpera9:function(e){for(var t=/Line (\d+).*script (?:in )?(\S+)/i,r=e.message.split("\n"),n=[],a=2,o=r.length;a/,"$2").replace(/\([^)]*\)/g,"")||void 0;return a.match(/\(([^)]*)\)/)&&(t=a.replace(/^[^(]+\(([^)]*)\)$/,"$1")),{functionName:o,args:void 0===t||"[arguments not available]"===t?void 0:t.split(","),fileName:n[0],lineNumber:n[1],columnNumber:n[2],source:e}},this)}}}a.default._getErrorStackParser=function(){return new o};var i=a.default;r.default=i},{"../main":32}],27:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n,a=(n=e("../main"))&&n.__esModule?n:{default:n};(function(e){if(e&&e.__esModule)return;if(null===e||"object"!==s(e)&&"function"!=typeof e)return;var t=i();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){var o=n?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}r.default=e,t&&t.set(e,r)})(e("../constants")),e("../internationalization");function i(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return i=function(){return e},e}function s(e){return(s="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)}a.default._validateParameters=a.default._clearValidateParamsCache=function(){};var o=a.default;r.default=o},{"../../../docs/parameterData.json":1,"../constants":22,"../internationalization":30,"../main":32}],28:[function(e,t,r){"use strict";function i(e){return(i="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 o=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){var o=n?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}r.default=e,t&&t.set(e,r);return r}(e("./constants"));function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}var n={modeAdjust:function(e,t,r,n,a){return a===o.CORNER?{x:e,y:t,w:r,h:n}:a===o.CORNERS?{x:e,y:t,w:r-e,h:n-t}:a===o.RADIUS?{x:e-r,y:t-n,w:2*r,h:2*n}:a===o.CENTER?{x:e-.5*r,y:t-.5*n,w:r,h:n}:void 0}};r.default=n},{"./constants":22}],29:[function(e,t,r){"use strict";var n,a=(n=e("../core/main"))&&n.__esModule?n:{default:n};e("./internationalization");var o=Promise.resolve();Promise.all([new Promise(function(e,t){"complete"===document.readyState?e():window.addEventListener("load",e,!1)}),o]).then(function(){void 0===window._setupDone?window.mocha||(window.setup&&"function"==typeof window.setup||window.draw&&"function"==typeof window.draw)&&!a.default.instance&&new a.default:console.warn("p5.js seems to have been imported multiple times. Please remove the duplicate import")})},{"../core/main":32,"./internationalization":30}],30:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.initialize=n.translator=void 0;var a,o=r(e("i18next")),i=r(e("i18next-browser-languagedetector"));function r(e){return e&&e.__esModule?e:{default:e}}var s=function(){return console.debug("p5.js translator called before translations were loaded"),""};n.translator=s;n.initialize=function(){return new Promise(function(t,r){o.default.use(i.default).init({fallbackLng:"en",nestingPrefix:"$tr(",nestingSuffix:")",defaultNS:"translation",returnEmptyString:!1,interpolation:{escapeValue:!1},detection:{checkWhitelist:!1},resources:a}).then(function(e){n.translator=s=e,t()},function(e){return r("Translations failed to load (".concat(e,")"))})})}},{"../../translations":void 0,i18next:4,"i18next-browser-languagedetector":4}],31:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n,a=(n=e("./main"))&&n.__esModule?n:{default:n};a.default.prototype.pushStyle=function(){throw new Error("pushStyle() not used, see push()")},a.default.prototype.popStyle=function(){throw new Error("popStyle() not used, see pop()")},a.default.prototype.popMatrix=function(){throw new Error("popMatrix() not used, see pop()")},a.default.prototype.pushMatrix=function(){throw new Error("pushMatrix() not used, see push()")};var o=a.default;r.default=o},{"./main":32}],32:[function(e,t,r){"use strict";function i(e){return(i="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,e("./shim");var n=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){var o=n?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}r.default=e,t&&t.set(e,r);return r}(e("./constants"));function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}function a(e,t){for(var r=0;r=i.width||t>=i.height?[0,0,0,0]:this._getPixel(e,t);var s=new l.default.Image(r,n);return s.canvas.getContext("2d").drawImage(i,e,t,r*o,n*o,0,0,r,n),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*b._DEFAULT_LEADMULT),this._applyTextProperties()):this._textSize},l.default.Renderer.prototype.textStyle=function(e){return e?(e!==b.NORMAL&&e!==b.ITALIC&&e!==b.BOLD&&e!==b.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,n,a){var o,i,s,l,p,u,c,d,h,m=this._pInst,f=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!==n){for(c=1,s=h=0;ss.HALF_PI&&e<=3*s.HALF_PI?Math.atan(r/n*Math.tan(e))+s.PI:Math.atan(r/n*Math.tan(e))+s.TWO_PI,t=t<=s.HALF_PI?Math.atan(r/n*Math.tan(t)):t>s.HALF_PI&&t<=3*s.HALF_PI?Math.atan(r/n*Math.tan(t))+s.PI:Math.atan(r/n*Math.tan(t))+s.TWO_PI),tg||Math.abs(this.accelerationY-this.pAccelerationY)>g||Math.abs(this.accelerationZ-this.pAccelerationZ)>g)&&e();var t=this.deviceTurned||window.deviceTurned;if("function"==typeof t){var r=this.rotationX+180,n=this.pRotationX+180,a=c+180;0>>24],n+=x[(16711680&C)>>16],a+=x[(65280&C)>>8],o+=x[255&C],r+=L[_],s++}S[l=T+v]=i/r,w[l]=n/r,M[l]=a/r,E[l]=o/r}T+=h}for(u=(p=-N)*h,b=T=0;b>>16,e[r+1]=(65280&t[n])>>>8,e[r+2]=255&t[n],e[r+3]=(4278190080&t[n])>>>24},P._toImageData=function(e){return e instanceof ImageData?e:e.getContext("2d").getImageData(0,0,e.width,e.height)},P._createImageData=function(e,t){return P._tmpCanvas=document.createElement("canvas"),P._tmpCtx=P._tmpCanvas.getContext("2d"),this._tmpCtx.createImageData(e,t)},P.apply=function(e,t,r){var n=e.getContext("2d"),a=n.getImageData(0,0,e.width,e.height),o=t(a,r);o instanceof ImageData?n.putImageData(o,0,0,0,0,e.width,e.height):n.putImageData(a,0,0,0,0,e.width,e.height)},P.threshold=function(e,t){var r=P._toPixels(e);void 0===t&&(t=.5);for(var n=Math.floor(255*t),a=0;a>8)/n,r[a+1]=255*(i*t>>8)/n,r[a+2]=255*(s*t>>8)/n}},P.dilate=function(e){for(var t,r,n,a,o,i,s,l,p,u,c,d,h,m,f,y,g,v=P._toPixels(e),b=0,_=v.length?v.length/4:0,x=new Int32Array(_);b<_;)for(r=(t=b)+e.width;b>16&255)+151*(n>>8&255)+28*(255&n))<(f=77*(c>>16&255)+151*(c>>8&255)+28*(255&c))&&(a=c,o=f),o<(m=77*((u=P._getARGB(v,i))>>16&255)+151*(u>>8&255)+28*(255&u))&&(a=u,o=m),o<(y=77*(d>>16&255)+151*(d>>8&255)+28*(255&d))&&(a=d,o=y),o<(g=77*(h>>16&255)+151*(h>>8&255)+28*(255&h))&&(a=h,o=g),x[b++]=a;P._setPixels(v,x)},P.erode=function(e){for(var t,r,n,a,o,i,s,l,p,u,c,d,h,m,f,y,g,v=P._toPixels(e),b=0,_=v.length?v.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*(n>>16&255)+151*(n>>8&255)+28*(255&n))&&(a=c,o=f),(m=77*((u=P._getARGB(v,i))>>16&255)+151*(u>>8&255)+28*(255&u))>16&255)+151*(d>>8&255)+28*(255&d))>16&255)+151*(h>>8&255)+28*(255&h))=r){var n=Math.floor(t.timeDisplayed/r);if(t.timeDisplayed=0,t.displayIndex+=n,t.loopCount=Math.floor(t.displayIndex/t.numFrames),null!==t.loopLimit&&t.loopCount>=t.loopLimit)t.playing=!1;else{var a=t.displayIndex%t.numFrames;this.drawingContext.putImageData(t.frames[a].image,0,0),t.displayIndex=a,this.setModified(!0)}}}},a.default.Image.prototype._setProperty=function(e,t){this[e]=t,this.setModified(!0)},a.default.Image.prototype.loadPixels=function(){a.default.Renderer2D.prototype.loadPixels.call(this),this.setModified(!0)},a.default.Image.prototype.updatePixels=function(e,t,r,n){a.default.Renderer2D.prototype.updatePixels.call(this,e,t,r,n),this.setModified(!0)},a.default.Image.prototype.get=function(e,t,r,n){return a.default._validateParameters("p5.Image.get",arguments),a.default.Renderer2D.prototype.get.apply(this,arguments)},a.default.Image.prototype._getPixel=a.default.Renderer2D.prototype._getPixel,a.default.Image.prototype.set=function(e,t,r){a.default.Renderer2D.prototype.set.call(this,e,t,r),this.setModified(!0)},a.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 n=this.gifProperties,a=function(e,t){for(var r=0,n=0;n/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/friendly_errors/validate_params"),e("../core/friendly_errors/file_errors"),e("../core/friendly_errors/fes_core"),g.default.prototype.loadJSON=function(){for(var e=arguments.length,t=new Array(e),r=0;r"),a.print("");if(a.print(' '),a.print(""),a.print(""),a.print(" "),"0"!==o[0]){a.print(" ");for(var u=0;u".concat(c)),a.print(" ")}a.print("
")}for(var d=0;d");for(var h=0;h".concat(m)),a.print(" ")}a.print(" ")}a.print("
"),a.print(""),a.print("